pptx-react-viewer 1.25.5 → 2.1.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 (231) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +2 -2
  3. package/dist/AiChatPanel-RFBZWMUE.mjs +1087 -0
  4. package/dist/AiChatPanel-RFBZWMUE.mjs.br +0 -0
  5. package/dist/AiChatPanel-RFBZWMUE.mjs.gz +0 -0
  6. package/dist/AiChatPanel-VCCVHAAI.js +1089 -0
  7. package/dist/AiChatPanel-VCCVHAAI.js.br +0 -0
  8. package/dist/AiChatPanel-VCCVHAAI.js.gz +0 -0
  9. package/dist/{GLTFLoader-NMAS6VRH.mjs → GLTFLoader-374ZNTXW.mjs} +1 -1
  10. package/dist/GLTFLoader-374ZNTXW.mjs.br +0 -0
  11. package/dist/GLTFLoader-374ZNTXW.mjs.gz +0 -0
  12. package/dist/{GLTFLoader-GP55DVVS.js → GLTFLoader-Q7BHCGAW.js} +1 -1
  13. package/dist/GLTFLoader-Q7BHCGAW.js.br +0 -0
  14. package/dist/GLTFLoader-Q7BHCGAW.js.gz +0 -0
  15. package/dist/{Model3DScene-XVYOISVJ.mjs → Model3DScene-2M6HVWTE.mjs} +3 -3
  16. package/dist/Model3DScene-2M6HVWTE.mjs.br +0 -0
  17. package/dist/Model3DScene-2M6HVWTE.mjs.gz +0 -0
  18. package/dist/{Model3DScene-Y5ABLO7K.js → Model3DScene-RQIGSYGQ.js} +4 -4
  19. package/dist/Model3DScene-RQIGSYGQ.js.br +0 -0
  20. package/dist/Model3DScene-RQIGSYGQ.js.gz +0 -0
  21. package/dist/{OrbitControls-VH6KILH7.js → OrbitControls-SMYCPLXO.js} +1 -1
  22. package/dist/OrbitControls-SMYCPLXO.js.br +3 -0
  23. package/dist/OrbitControls-SMYCPLXO.js.gz +0 -0
  24. package/dist/{OrbitControls-F5XPYD2Z.mjs → OrbitControls-ZTGHPI5G.mjs} +1 -1
  25. package/dist/OrbitControls-ZTGHPI5G.mjs.br +0 -0
  26. package/dist/{OrbitControls-F5XPYD2Z.mjs.gz → OrbitControls-ZTGHPI5G.mjs.gz} +0 -0
  27. package/dist/{PowerPointViewer-CnADroqZ.d.ts → PowerPointViewer-gmU5rc7K.d.ts} +2 -2
  28. package/dist/PowerPointViewer-gmU5rc7K.d.ts.map +1 -0
  29. package/dist/{SmartArt3DScene-WQIDFZ7X.mjs → SmartArt3DScene-XCFVGCXE.mjs} +1 -1
  30. package/dist/SmartArt3DScene-XCFVGCXE.mjs.br +0 -0
  31. package/dist/SmartArt3DScene-XCFVGCXE.mjs.gz +0 -0
  32. package/dist/{SmartArt3DScene-HCQBDRAM.js → SmartArt3DScene-ZO3KFDI2.js} +1 -1
  33. package/dist/SmartArt3DScene-ZO3KFDI2.js.br +0 -0
  34. package/dist/SmartArt3DScene-ZO3KFDI2.js.gz +0 -0
  35. package/dist/{SurfaceChart3DScene-WMY5JTW4.js → SurfaceChart3DScene-2FVASQGC.js} +4 -4
  36. package/dist/SurfaceChart3DScene-2FVASQGC.js.br +0 -0
  37. package/dist/SurfaceChart3DScene-2FVASQGC.js.gz +0 -0
  38. package/dist/{SurfaceChart3DScene-RXZADECL.mjs → SurfaceChart3DScene-EGMWY4CZ.mjs} +3 -3
  39. package/dist/SurfaceChart3DScene-EGMWY4CZ.mjs.br +0 -0
  40. package/dist/SurfaceChart3DScene-EGMWY4CZ.mjs.gz +0 -0
  41. package/dist/{animation-timeline-CEJJLFqK.d.ts → animation-timeline-eb5z0SHW.d.ts} +250 -8
  42. package/dist/animation-timeline-eb5z0SHW.d.ts.map +1 -0
  43. package/dist/{chunk-FVQDRA5N.mjs → chunk-27XBWVO5.mjs} +3815 -415
  44. package/dist/chunk-27XBWVO5.mjs.br +0 -0
  45. package/dist/chunk-27XBWVO5.mjs.gz +0 -0
  46. package/dist/{chunk-M3SIFXWD.mjs → chunk-2X72MOPZ.mjs} +65 -0
  47. package/dist/chunk-2X72MOPZ.mjs.br +0 -0
  48. package/dist/chunk-2X72MOPZ.mjs.gz +0 -0
  49. package/dist/{chunk-TEN35NUX.js → chunk-46Z6MNRS.js} +3877 -455
  50. package/dist/chunk-46Z6MNRS.js.br +0 -0
  51. package/dist/chunk-46Z6MNRS.js.gz +0 -0
  52. package/dist/{chunk-QGM4M3NI.js → chunk-4VNS5WPM.js} +5 -0
  53. package/dist/chunk-4VNS5WPM.js.br +0 -0
  54. package/dist/chunk-4VNS5WPM.js.gz +0 -0
  55. package/dist/{chunk-FOMF7POV.mjs → chunk-6YXLGMTN.mjs} +2493 -1588
  56. package/dist/chunk-6YXLGMTN.mjs.br +0 -0
  57. package/dist/chunk-6YXLGMTN.mjs.gz +0 -0
  58. package/dist/chunk-7DQHWPIB.mjs +8029 -0
  59. package/dist/chunk-7DQHWPIB.mjs.br +0 -0
  60. package/dist/chunk-7DQHWPIB.mjs.gz +0 -0
  61. package/dist/chunk-BHVCED34.mjs +16664 -0
  62. package/dist/chunk-BHVCED34.mjs.br +0 -0
  63. package/dist/chunk-BHVCED34.mjs.gz +0 -0
  64. package/dist/{chunk-IPYAN574.js → chunk-CLNGAVNH.js} +2495 -1587
  65. package/dist/chunk-CLNGAVNH.js.br +0 -0
  66. package/dist/chunk-CLNGAVNH.js.gz +0 -0
  67. package/dist/{chunk-2EFVXYNA.js → chunk-CUUYYYC5.js} +65 -0
  68. package/dist/chunk-CUUYYYC5.js.br +0 -0
  69. package/dist/chunk-CUUYYYC5.js.gz +0 -0
  70. package/dist/chunk-LDF77JJD.js +8121 -0
  71. package/dist/chunk-LDF77JJD.js.br +0 -0
  72. package/dist/chunk-LDF77JJD.js.gz +0 -0
  73. package/dist/{chunk-F4WPQRZU.mjs → chunk-NGE7YQTF.mjs} +3866 -11224
  74. package/dist/chunk-NGE7YQTF.mjs.br +0 -0
  75. package/dist/chunk-NGE7YQTF.mjs.gz +0 -0
  76. package/dist/chunk-SYPHGLIB.js +16701 -0
  77. package/dist/chunk-SYPHGLIB.js.br +0 -0
  78. package/dist/chunk-SYPHGLIB.js.gz +0 -0
  79. package/dist/{chunk-7CSBUYRN.js → chunk-VHO53ZXZ.js} +2083 -940
  80. package/dist/chunk-VHO53ZXZ.js.br +0 -0
  81. package/dist/chunk-VHO53ZXZ.js.gz +0 -0
  82. package/dist/{chunk-6DZX6EAA.mjs → chunk-XGB3TDIC.mjs} +5 -1
  83. package/dist/chunk-XGB3TDIC.mjs.br +0 -0
  84. package/dist/chunk-XGB3TDIC.mjs.gz +0 -0
  85. package/dist/{chunk-L4ZADJOM.mjs → chunk-Y4OSELBT.mjs} +1295 -152
  86. package/dist/chunk-Y4OSELBT.mjs.br +0 -0
  87. package/dist/chunk-Y4OSELBT.mjs.gz +0 -0
  88. package/dist/chunk-ZRY7NLKS.js +11208 -0
  89. package/dist/chunk-ZRY7NLKS.js.br +0 -0
  90. package/dist/chunk-ZRY7NLKS.js.gz +0 -0
  91. package/dist/{dist-755SJ3ZH.js → dist-4LUVI3SW.js} +578 -566
  92. package/dist/dist-4LUVI3SW.js.br +0 -0
  93. package/dist/dist-4LUVI3SW.js.gz +0 -0
  94. package/dist/dist-J6PC54PZ.mjs +2 -0
  95. package/dist/dist-J6PC54PZ.mjs.br +0 -0
  96. package/dist/dist-J6PC54PZ.mjs.gz +0 -0
  97. package/dist/i18n.js +5 -5
  98. package/dist/i18n.js.br +0 -0
  99. package/dist/i18n.js.gz +0 -0
  100. package/dist/i18n.mjs +2 -2
  101. package/dist/i18n.mjs.br +0 -0
  102. package/dist/i18n.mjs.gz +0 -0
  103. package/dist/{index-J6IuHQ2_.d.ts → index-nAyIdGqF.d.ts} +4 -4
  104. package/dist/{index-J6IuHQ2_.d.ts.map → index-nAyIdGqF.d.ts.map} +1 -1
  105. package/dist/index.d.ts +3030 -220
  106. package/dist/index.d.ts.map +1 -1
  107. package/dist/index.js +41 -39
  108. package/dist/index.js.br +0 -0
  109. package/dist/index.js.gz +0 -0
  110. package/dist/index.mjs +8 -6
  111. package/dist/index.mjs.br +0 -0
  112. package/dist/index.mjs.gz +0 -0
  113. package/dist/{hooks-unstable.d.ts → internals.d.ts} +1323 -959
  114. package/dist/internals.d.ts.map +1 -0
  115. package/dist/{hooks-unstable.js → internals.js} +81 -80
  116. package/dist/internals.js.br +0 -0
  117. package/dist/internals.js.gz +0 -0
  118. package/dist/{hooks-unstable.mjs → internals.mjs} +6 -5
  119. package/dist/internals.mjs.br +0 -0
  120. package/dist/internals.mjs.gz +0 -0
  121. package/dist/pptx-viewer.css +1 -1
  122. package/dist/pptx-viewer.css.br +0 -0
  123. package/dist/pptx-viewer.css.gz +0 -0
  124. package/dist/{three.module-7CXEVRKB.mjs → three.module-AC7ESV4W.mjs} +1 -1
  125. package/dist/three.module-AC7ESV4W.mjs.br +0 -0
  126. package/dist/three.module-AC7ESV4W.mjs.gz +0 -0
  127. package/dist/{three.module-CPZZFD2Q.js → three.module-GNNNRIMK.js} +1 -1
  128. package/dist/three.module-GNNNRIMK.js.br +0 -0
  129. package/dist/three.module-GNNNRIMK.js.gz +0 -0
  130. package/dist/{useViewerBuildingBlocks-ll3_ncCH.d.ts → useViewerBuildingBlocks-CjureTRf.d.ts} +185 -174
  131. package/dist/useViewerBuildingBlocks-CjureTRf.d.ts.map +1 -0
  132. package/dist/viewer/index.d.ts +469 -52
  133. package/dist/viewer/index.d.ts.map +1 -1
  134. package/dist/viewer/index.js +35 -33
  135. package/dist/viewer/index.js.br +0 -0
  136. package/dist/viewer/index.js.gz +0 -0
  137. package/dist/viewer/index.mjs +8 -6
  138. package/dist/viewer/index.mjs.br +0 -0
  139. package/dist/viewer/index.mjs.gz +0 -0
  140. package/dist/{y-webrtc-6CRYHAXH.mjs → y-webrtc-DGVURJIF.mjs} +1 -1
  141. package/dist/y-webrtc-DGVURJIF.mjs.br +0 -0
  142. package/dist/y-webrtc-DGVURJIF.mjs.gz +0 -0
  143. package/dist/{y-webrtc-QCZF75JW.js → y-webrtc-YN53KW3J.js} +5 -5
  144. package/dist/y-webrtc-YN53KW3J.js.br +0 -0
  145. package/dist/y-webrtc-YN53KW3J.js.gz +0 -0
  146. package/dist/{y-websocket-QJEM6VOB.js → y-websocket-HZCIQLM6.js} +1 -1
  147. package/dist/y-websocket-HZCIQLM6.js.br +0 -0
  148. package/dist/y-websocket-HZCIQLM6.js.gz +0 -0
  149. package/dist/{y-websocket-57Q3RNHC.mjs → y-websocket-P5LTAJ5T.mjs} +1 -1
  150. package/dist/y-websocket-P5LTAJ5T.mjs.br +0 -0
  151. package/dist/y-websocket-P5LTAJ5T.mjs.gz +0 -0
  152. package/dist/{yjs-Y7IYUWOG.mjs → yjs-FKGX4QHS.mjs} +1 -1
  153. package/dist/yjs-FKGX4QHS.mjs.br +0 -0
  154. package/dist/yjs-FKGX4QHS.mjs.gz +0 -0
  155. package/dist/{yjs-UH3EPF3C.js → yjs-HBLSEMHP.js} +1 -1
  156. package/dist/yjs-HBLSEMHP.js.br +0 -0
  157. package/dist/yjs-HBLSEMHP.js.gz +0 -0
  158. package/package.json +23 -9
  159. package/dist/GLTFLoader-GP55DVVS.js.br +0 -0
  160. package/dist/GLTFLoader-GP55DVVS.js.gz +0 -0
  161. package/dist/GLTFLoader-NMAS6VRH.mjs.br +0 -0
  162. package/dist/GLTFLoader-NMAS6VRH.mjs.gz +0 -0
  163. package/dist/Model3DScene-XVYOISVJ.mjs.br +0 -0
  164. package/dist/Model3DScene-XVYOISVJ.mjs.gz +0 -0
  165. package/dist/Model3DScene-Y5ABLO7K.js.br +0 -0
  166. package/dist/Model3DScene-Y5ABLO7K.js.gz +0 -0
  167. package/dist/OrbitControls-F5XPYD2Z.mjs.br +0 -0
  168. package/dist/OrbitControls-VH6KILH7.js.br +0 -2
  169. package/dist/OrbitControls-VH6KILH7.js.gz +0 -0
  170. package/dist/PowerPointViewer-CnADroqZ.d.ts.map +0 -1
  171. package/dist/SmartArt3DScene-HCQBDRAM.js.br +0 -0
  172. package/dist/SmartArt3DScene-HCQBDRAM.js.gz +0 -0
  173. package/dist/SmartArt3DScene-WQIDFZ7X.mjs.br +0 -0
  174. package/dist/SmartArt3DScene-WQIDFZ7X.mjs.gz +0 -0
  175. package/dist/SurfaceChart3DScene-RXZADECL.mjs.br +0 -0
  176. package/dist/SurfaceChart3DScene-RXZADECL.mjs.gz +0 -0
  177. package/dist/SurfaceChart3DScene-WMY5JTW4.js.br +0 -0
  178. package/dist/SurfaceChart3DScene-WMY5JTW4.js.gz +0 -0
  179. package/dist/animation-timeline-CEJJLFqK.d.ts.map +0 -1
  180. package/dist/chunk-2EFVXYNA.js.br +0 -0
  181. package/dist/chunk-2EFVXYNA.js.gz +0 -0
  182. package/dist/chunk-6DZX6EAA.mjs.br +0 -0
  183. package/dist/chunk-6DZX6EAA.mjs.gz +0 -0
  184. package/dist/chunk-7CSBUYRN.js.br +0 -0
  185. package/dist/chunk-7CSBUYRN.js.gz +0 -0
  186. package/dist/chunk-E55Q4AC7.js +0 -18639
  187. package/dist/chunk-E55Q4AC7.js.br +0 -0
  188. package/dist/chunk-E55Q4AC7.js.gz +0 -0
  189. package/dist/chunk-F4WPQRZU.mjs.br +0 -0
  190. package/dist/chunk-F4WPQRZU.mjs.gz +0 -0
  191. package/dist/chunk-FOMF7POV.mjs.br +0 -0
  192. package/dist/chunk-FOMF7POV.mjs.gz +0 -0
  193. package/dist/chunk-FVQDRA5N.mjs.br +0 -0
  194. package/dist/chunk-FVQDRA5N.mjs.gz +0 -0
  195. package/dist/chunk-IPYAN574.js.br +0 -0
  196. package/dist/chunk-IPYAN574.js.gz +0 -0
  197. package/dist/chunk-L4ZADJOM.mjs.br +0 -0
  198. package/dist/chunk-L4ZADJOM.mjs.gz +0 -0
  199. package/dist/chunk-M3SIFXWD.mjs.br +0 -0
  200. package/dist/chunk-M3SIFXWD.mjs.gz +0 -0
  201. package/dist/chunk-QGM4M3NI.js.br +0 -0
  202. package/dist/chunk-QGM4M3NI.js.gz +0 -0
  203. package/dist/chunk-TEN35NUX.js.br +0 -0
  204. package/dist/chunk-TEN35NUX.js.gz +0 -0
  205. package/dist/dist-755SJ3ZH.js.br +0 -0
  206. package/dist/dist-755SJ3ZH.js.gz +0 -0
  207. package/dist/dist-FFWP5NQZ.mjs +0 -2
  208. package/dist/dist-FFWP5NQZ.mjs.br +0 -0
  209. package/dist/dist-FFWP5NQZ.mjs.gz +0 -0
  210. package/dist/hooks-unstable.d.ts.map +0 -1
  211. package/dist/hooks-unstable.js.br +0 -0
  212. package/dist/hooks-unstable.js.gz +0 -0
  213. package/dist/hooks-unstable.mjs.br +0 -0
  214. package/dist/hooks-unstable.mjs.gz +0 -0
  215. package/dist/three.module-7CXEVRKB.mjs.br +0 -0
  216. package/dist/three.module-7CXEVRKB.mjs.gz +0 -0
  217. package/dist/three.module-CPZZFD2Q.js.br +0 -0
  218. package/dist/three.module-CPZZFD2Q.js.gz +0 -0
  219. package/dist/useViewerBuildingBlocks-ll3_ncCH.d.ts.map +0 -1
  220. package/dist/y-webrtc-6CRYHAXH.mjs.br +0 -0
  221. package/dist/y-webrtc-6CRYHAXH.mjs.gz +0 -0
  222. package/dist/y-webrtc-QCZF75JW.js.br +0 -0
  223. package/dist/y-webrtc-QCZF75JW.js.gz +0 -0
  224. package/dist/y-websocket-57Q3RNHC.mjs.br +0 -0
  225. package/dist/y-websocket-57Q3RNHC.mjs.gz +0 -0
  226. package/dist/y-websocket-QJEM6VOB.js.br +0 -0
  227. package/dist/y-websocket-QJEM6VOB.js.gz +0 -0
  228. package/dist/yjs-UH3EPF3C.js.br +0 -0
  229. package/dist/yjs-UH3EPF3C.js.gz +0 -0
  230. package/dist/yjs-Y7IYUWOG.mjs.br +0 -0
  231. package/dist/yjs-Y7IYUWOG.mjs.gz +0 -0
@@ -1023,6 +1023,14 @@ interface ShapeStyle {
1023
1023
  };
1024
1024
  /** Fill overlay blend mode from effectDag `a:fillOverlay/@blend`. */
1025
1025
  dagFillOverlayBlend?: 'over' | 'mult' | 'screen' | 'darken' | 'lighten';
1026
+ /**
1027
+ * Fill overlay tint colour (hex `#RRGGBB`) from effectDag `a:fillOverlay`'s
1028
+ * `a:solidFill`/`a:gradFill`. Painted as a blended overlay layer over the
1029
+ * element; the blend mode comes from {@link dagFillOverlayBlend}.
1030
+ */
1031
+ dagFillOverlayColor?: string;
1032
+ /** Fill overlay tint opacity (0-1), from the overlay fill colour's alpha. */
1033
+ dagFillOverlayOpacity?: number;
1026
1034
  /** `<a:lnRef @idx>` — 1-based index into the theme's lnStyleLst. */
1027
1035
  lnRefIdx?: number;
1028
1036
  /** Raw XML colour child of `<a:lnRef>` (e.g. `<a:schemeClr>` with transforms). */
@@ -1955,6 +1963,75 @@ interface PptxChartProtection {
1955
1963
  rawXml?: XmlObject;
1956
1964
  }
1957
1965
  //#endregion
1966
+ //#region src/core/types/chart-user-shapes.d.ts
1967
+ /**
1968
+ * Types for chart drawing-overlay shapes (`c:userShapes`).
1969
+ *
1970
+ * A chart's `c:userShapes` element carries an `r:id` that references a
1971
+ * separate drawing part (`ppt/drawings/drawingN.xml`) whose root is a
1972
+ * `c:userShapes` element populated with `cdr:relSizeAnchor` /
1973
+ * `cdr:absSizeAnchor` wrappers around `sp` / `pic` / `cxnSp` shapes drawn on
1974
+ * top of the chart plot. These interfaces describe the parsed, renderable
1975
+ * overlay model. The raw reference is preserved separately on
1976
+ * {@link PptxChartData.userShapesXml} for verbatim round-trip save; this model
1977
+ * is render-only.
1978
+ *
1979
+ * @module pptx-types/chart-user-shapes
1980
+ */
1981
+ /** A single paragraph of overlay-shape text with light formatting. */
1982
+ interface PptxChartUserShapeParagraph {
1983
+ /** Joined run text of the paragraph. */
1984
+ text: string;
1985
+ /** Font size in points (`a:rPr/@sz` divided by 100), when present. */
1986
+ fontSize?: number;
1987
+ /** Whether the first run is bold (`a:rPr/@b`). */
1988
+ bold?: boolean;
1989
+ /** Whether the first run is italic (`a:rPr/@i`). */
1990
+ italic?: boolean;
1991
+ /** Resolved run colour hex (e.g. `"#FF0000"`), when present. */
1992
+ color?: string;
1993
+ /** Paragraph alignment (`a:pPr/@algn`): left / centre / right. */
1994
+ align?: 'l' | 'ctr' | 'r';
1995
+ }
1996
+ /**
1997
+ * A parsed chart-overlay shape positioned by a drawing anchor.
1998
+ *
1999
+ * Position is expressed as chart-relative fractions in {@link from}. For a
2000
+ * `relSizeAnchor` the opposite corner is {@link to} (also fractional); for an
2001
+ * `absSizeAnchor` the extent is {@link ext} in EMU.
2002
+ */
2003
+ interface PptxChartUserShape {
2004
+ /** Shape kind: text/preset shape, connector, or picture. */
2005
+ kind: 'sp' | 'cxnSp' | 'pic';
2006
+ /** Anchor kind that positioned the shape. */
2007
+ anchor: 'rel' | 'abs';
2008
+ /** Top-left corner as chart-relative fractions (0-1). */
2009
+ from: {
2010
+ x: number;
2011
+ y: number;
2012
+ };
2013
+ /** Bottom-right corner as chart-relative fractions (0-1); relSizeAnchor only. */
2014
+ to?: {
2015
+ x: number;
2016
+ y: number;
2017
+ };
2018
+ /** Extent in EMU (cx, cy); absSizeAnchor only. */
2019
+ ext?: {
2020
+ cx: number;
2021
+ cy: number;
2022
+ };
2023
+ /** Preset geometry name (`a:prstGeom/@prst`), defaulting to `"rect"`. */
2024
+ prst?: string;
2025
+ /** Resolved solid-fill hex colour, when present. */
2026
+ fill?: string;
2027
+ /** Resolved line/stroke hex colour, when present. */
2028
+ stroke?: string;
2029
+ /** Line width in points (`a:ln/@w` divided by 12700), when present. */
2030
+ strokeWidth?: number;
2031
+ /** Text paragraphs of the shape's `txBody`, when present. */
2032
+ paragraphs?: PptxChartUserShapeParagraph[];
2033
+ }
2034
+ //#endregion
1958
2035
  //#region src/core/types/chart.d.ts
1959
2036
  /**
1960
2037
  * Supported chart type discriminators.
@@ -2288,6 +2365,15 @@ interface PptxChartTreemapOptions {
2288
2365
  interface PptxChartSeries {
2289
2366
  name: string;
2290
2367
  values: number[];
2368
+ /**
2369
+ * Blank-value mask aligned index-for-index with {@link values}: `true` marks
2370
+ * a category whose numeric cache point (`c:numCache/c:pt`) was absent or
2371
+ * empty, i.e. a genuine blank rather than a real `0`. Present only when the
2372
+ * source series actually contains blanks; when set, blank slots in
2373
+ * {@link values} carry `0` as a placeholder. Renderers honour
2374
+ * `c:dispBlanksAs` (gap / zero / span) using this mask.
2375
+ */
2376
+ blanks?: boolean[];
2291
2377
  color?: string;
2292
2378
  trendlines?: PptxChartTrendline[];
2293
2379
  errBars?: PptxChartErrBars[];
@@ -2509,6 +2595,14 @@ interface PptxChartManualLayout {
2509
2595
  y?: number;
2510
2596
  width?: number;
2511
2597
  height?: number;
2598
+ /**
2599
+ * Raw `c:extLst` (CT_ExtensionList) of the `c:manualLayout`, captured
2600
+ * verbatim so it round-trips through the typed model. Without this, a dirty
2601
+ * write of an edited layout would drop the extension list (the manual node
2602
+ * is rebuilt from the typed fields). Emitted as the trailing child, matching
2603
+ * the CT_ManualLayout schema order.
2604
+ */
2605
+ ext?: XmlObject;
2512
2606
  }
2513
2607
  /**
2514
2608
  * Typed manual layouts for chart regions that accept `c:layout`.
@@ -2700,6 +2794,15 @@ interface PptxChartData {
2700
2794
  * attempting to parse the nested drawing tree.
2701
2795
  */
2702
2796
  userShapesXml?: unknown;
2797
+ /**
2798
+ * Parsed, renderable drawing-overlay shapes resolved from the separate
2799
+ * drawing part referenced by `c:userShapes/@r:id`
2800
+ * (`ppt/drawings/drawingN.xml`). Each entry carries chart-relative anchor
2801
+ * geometry plus light shape/text formatting so the viewer can render an
2802
+ * overlay on top of the chart plot. Render-only: {@link userShapesXml}
2803
+ * remains the source of truth for round-trip save.
2804
+ */
2805
+ userShapes?: PptxChartUserShape[];
2703
2806
  /**
2704
2807
  * Raw `c:pivotFmts` XML subtree preserved verbatim.
2705
2808
  *
@@ -2975,7 +3078,7 @@ interface PptxImageProperties {
2975
3078
  /** Crop-to-shape — CSS clip-path shape name. */
2976
3079
  cropShape?: PptxCropShape;
2977
3080
  }
2978
- declare module "./hooks-unstable" {
3081
+ declare module "./internals" {
2979
3082
  interface TextStyle {
2980
3083
  /**
2981
3084
  * Raw `a:effectDag` XML node from `a:rPr`, preserved verbatim for
@@ -2993,7 +3096,7 @@ declare module "./hooks-unstable" {
2993
3096
  textEffectDagTree?: EffectDagContainer;
2994
3097
  }
2995
3098
  }
2996
- declare module "./hooks-unstable" {
3099
+ declare module "./internals" {
2997
3100
  interface ShapeStyle {
2998
3101
  /**
2999
3102
  * Typed effect graph parsed from {@link ShapeStyle.effectDagXml}. The four
@@ -3720,7 +3823,7 @@ interface PptxSmartArtData {
3720
3823
  /**
3721
3824
  * Per-cell visual style for a table cell.
3722
3825
  *
3723
- * All fields are optional unset values inherit from the table style.
3826
+ * All fields are optional - unset values inherit from the table style.
3724
3827
  *
3725
3828
  * @example
3726
3829
  * ```ts
@@ -3848,6 +3951,52 @@ interface PptxTableCellStyle {
3848
3951
  patternFillForeground?: string;
3849
3952
  /** Pattern fill background colour. */
3850
3953
  patternFillBackground?: string;
3954
+ /**
3955
+ * Cell 3D bevel + lighting from `a:tcPr/a:cell3D` (CT_Cell3D,
3956
+ * ECMA-376 §21.1.3.1). Rendered as a CSS bevel treatment.
3957
+ */
3958
+ cell3D?: PptxTableCell3D;
3959
+ /**
3960
+ * `a:tcPr/@anchorCtr` - centre the text block in the direction
3961
+ * perpendicular to the text flow (horizontal centring for horizontal text).
3962
+ */
3963
+ anchorCtr?: boolean;
3964
+ /**
3965
+ * `a:tcPr/@horzOverflow` (ST_TextHorzOverflowType): `clip` clips text at
3966
+ * the cell edge, `overflow` (the default) lets it spill.
3967
+ */
3968
+ horzOverflow?: 'clip' | 'overflow';
3969
+ }
3970
+ /**
3971
+ * Cell 3D bevel + lighting parsed from `a:tcPr/a:cell3D` (CT_Cell3D).
3972
+ *
3973
+ * Only the fields needed to render a plausible bevel treatment are captured;
3974
+ * verbatim round-trip of the full node is handled separately by the save path.
3975
+ *
3976
+ * @example
3977
+ * ```ts
3978
+ * const c3d: PptxTableCell3D = {
3979
+ * bevelWidth: 8,
3980
+ * bevelHeight: 8,
3981
+ * bevelPreset: 'circle',
3982
+ * material: 'plastic',
3983
+ * };
3984
+ * // => satisfies PptxTableCell3D
3985
+ * ```
3986
+ */
3987
+ interface PptxTableCell3D {
3988
+ /** Bevel width in px (from `a:bevel@w`, EMU converted). */
3989
+ bevelWidth?: number;
3990
+ /** Bevel height in px (from `a:bevel@h`, EMU converted). */
3991
+ bevelHeight?: number;
3992
+ /** Bevel preset name (`a:bevel@prst`, e.g. `circle`, `relaxedInset`). */
3993
+ bevelPreset?: string;
3994
+ /** Preset material (`a:cell3D@prstMaterial`, e.g. `plastic`, `metal`). */
3995
+ material?: string;
3996
+ /** Light rig type (`a:lightRig@rig`, e.g. `threePt`, `soft`). */
3997
+ lightRig?: string;
3998
+ /** Light rig direction (`a:lightRig@dir`, e.g. `tl`, `t`, `tr`). */
3999
+ lightRigDirection?: string;
3851
4000
  }
3852
4001
  /**
3853
4002
  * A single table cell with text content, optional style, and merge info.
@@ -4071,7 +4220,7 @@ interface ParsedTableStyleBorder {
4071
4220
  fill?: ParsedTableStyleFill;
4072
4221
  /** Explicit hex colour when the line used `a:srgbClr` (e.g. `#808080`). */
4073
4222
  color?: string;
4074
- /** The line was `a:noFill` an explicit "no border" that clears lower layers. */
4223
+ /** The line was `a:noFill` - an explicit "no border" that clears lower layers. */
4075
4224
  noFill?: boolean;
4076
4225
  }
4077
4226
  /**
@@ -5067,6 +5216,14 @@ interface PptxNativeAnimation {
5067
5216
  * that aren't OLE charts).
5068
5217
  */
5069
5218
  graphicBuild?: string;
5219
+ /**
5220
+ * OLE-embedded chart build attribute (`p:bldOleChart/@bld`) when this
5221
+ * animation stages an OLE chart graphic frame. Values follow
5222
+ * ST_TLOleChartBuildType: `allAtOnce`, `series`, `category`, `seriesEl`,
5223
+ * `categoryEl`. Lets a staged-reveal renderer build the chart by series /
5224
+ * category / element to match PowerPoint, rather than as one whole element.
5225
+ */
5226
+ oleChartBuild?: string;
5070
5227
  /** Schema-accurate `p:bldGraphic/p:bldAsOne|p:bldSub` representation. */
5071
5228
  graphicBuildProperties?: PptxGraphicBuild;
5072
5229
  /**
@@ -5556,6 +5713,18 @@ interface PptxAppProperties {
5556
5713
  template?: string;
5557
5714
  /** Hyperlink base URL. */
5558
5715
  hyperlinkBase?: string;
5716
+ /** Document security bitmask (`<DocSecurity>`). */
5717
+ docSecurity?: number;
5718
+ /** Number of multimedia clips (`<MMClips>`). */
5719
+ mmClips?: number;
5720
+ /** Whether thumbnail images were scaled to fit (`<ScaleCrop>`). */
5721
+ scaleCrop?: boolean;
5722
+ /** Whether hyperlinks are current (`<LinksUpToDate>`). */
5723
+ linksUpToDate?: boolean;
5724
+ /** Whether the document is shared (`<SharedDoc>`). */
5725
+ sharedDoc?: boolean;
5726
+ /** Whether hyperlinks changed since last save (`<HyperlinksChanged>`). */
5727
+ hyperlinksChanged?: boolean;
5559
5728
  }
5560
5729
  //#endregion
5561
5730
  //#region src/core/types/presentation-print-properties.d.ts
@@ -6060,6 +6229,21 @@ interface PptxActiveXControl {
6060
6229
  name?: string;
6061
6230
  /** Shape ID this control is linked to (from @spid). */
6062
6231
  shapeId?: string;
6232
+ /** X position (px) of the control's fallback picture, if present. */
6233
+ x?: number;
6234
+ /** Y position (px) of the control's fallback picture, if present. */
6235
+ y?: number;
6236
+ /** Width (px) of the control's fallback picture, if present. */
6237
+ width?: number;
6238
+ /** Height (px) of the control's fallback picture, if present. */
6239
+ height?: number;
6240
+ /**
6241
+ * Relationship ID of the control's static fallback picture
6242
+ * (`mc:AlternateContent > mc:Fallback > p:pic > p:blipFill > a:blip@r:embed`).
6243
+ * Renderers resolve this to an image so a control shows its last static
6244
+ * frame instead of a blank area (the live ActiveX cannot run in a viewer).
6245
+ */
6246
+ fallbackImageRelId?: string;
6063
6247
  /** Raw XML for round-trip preservation. */
6064
6248
  rawXml?: XmlObject;
6065
6249
  }
@@ -6186,6 +6370,13 @@ interface PptxSlide {
6186
6370
  customerData?: PptxCustomerData[];
6187
6371
  /** ActiveX control references from `p:controls` on this slide. */
6188
6372
  activeXControls?: PptxActiveXControl[];
6373
+ /**
6374
+ * Shapes parsed from a referenced legacy VML drawing part
6375
+ * (`ppt/drawings/vmlDrawing*.vml`, linked via a `legacyDrawing`
6376
+ * relationship). These are read-only render hints: the VML part itself is
6377
+ * preserved verbatim on save, so this field is not re-serialized.
6378
+ */
6379
+ legacyVmlElements?: PptxElement[];
6189
6380
  /** Per-slide header/footer flags from `<p:hf>` (P-H3). */
6190
6381
  headerFooterFlags?: PptxHeaderFooterFlags;
6191
6382
  /** Server-backed slide synchronization metadata stored in a related OPC part. */
@@ -6294,12 +6485,6 @@ interface PptxPresentationProperties {
6294
6485
  showSubtitles?: boolean;
6295
6486
  /** Typed `p:prnPr` settings. Set to null during save to remove the element. */
6296
6487
  printProperties?: PptxPresentationPrintProperties | null;
6297
- /** @deprecated Use `printProperties.printWhat`; retained as a handout compatibility alias. */
6298
- printSlidesPerPage?: number;
6299
- /** @deprecated Use `printProperties.frameSlides`. */
6300
- printFrameSlides?: boolean;
6301
- /** @deprecated Use `printProperties.colorMode`. */
6302
- printColorMode?: 'clr' | 'gray' | 'bw';
6303
6488
  /** Most-recently-used colours from the presentation palette. */
6304
6489
  mruColors?: string[];
6305
6490
  /** Grid spacing in EMUs (cx, cy). Default is 914400 / 8 = 114300. */
@@ -8142,12 +8327,69 @@ interface CollaborationConfig {
8142
8327
  */
8143
8328
  writeBackDebounceMs?: number;
8144
8329
  }
8330
+ /**
8331
+ * Normalized staged-reveal mode for a chart graphic frame, derived from the
8332
+ * OOXML `a:bldChart/@bld` (or `p:bldOleChart/@bld`) token:
8333
+ * - `asOne` the whole chart appears at once (`allAtOnce`).
8334
+ * - `bySeries` one data series is revealed per stage (`series`).
8335
+ * - `byCategory` one category is revealed per stage (`category`).
8336
+ * - `byElement` one series/category ELEMENT is revealed per stage
8337
+ * (`seriesElement` / `categoryElement`).
8338
+ */
8339
+ type ChartBuildMode = 'asOne' | 'bySeries' | 'byCategory' | 'byElement';
8340
+ /**
8341
+ * Normalized staged-reveal mode for a SmartArt diagram, derived from the OOXML
8342
+ * `a:bldDgm/@bld` or `p:bldDgm/@bld` token:
8343
+ * - `asOne` the whole diagram appears at once (`whole` / `allAtOnce`).
8344
+ * - `byOne` one node is revealed per stage (`one`, and the assorted
8345
+ * `depthBy*` / `breadthBy*` / directional traversals).
8346
+ * - `byLvl` levels are revealed one element at a time (`lvlOne`).
8347
+ * - `byLvlAtOnce` a whole level is revealed per stage (`lvlAtOnce`).
8348
+ */
8349
+ type DiagramBuildMode = 'asOne' | 'byOne' | 'byLvl' | 'byLvlAtOnce';
8350
+ /**
8351
+ * Playback-time staged-build state surfaced on {@link ElementAnimationState}.
8352
+ * `progress` is the 0..1 fraction of the build revealed at the current playback
8353
+ * time; a consumer maps it to its own item COUNT (see `revealedStageCount`).
8354
+ */
8355
+ type ElementBuildState = {
8356
+ kind: 'chart';
8357
+ mode: ChartBuildMode;
8358
+ progress: number;
8359
+ } | {
8360
+ kind: 'diagram';
8361
+ mode: DiagramBuildMode;
8362
+ progress: number;
8363
+ };
8145
8364
  /** Snapshot of a single element's animation state at a point in the timeline. */
8146
8365
  interface ElementAnimationState {
8147
8366
  /** Whether the element should be visible. */
8148
8367
  visible: boolean;
8149
8368
  /** CSS animation shorthand to apply (undefined = no active animation). */
8150
8369
  cssAnimation: string | undefined;
8370
+ /**
8371
+ * Staged-build reveal state, present only when the active animation builds a
8372
+ * chart or SmartArt diagram in stages (`p:bldChart` / `p:bldDgm`) rather than
8373
+ * revealing the whole element at once. A staged renderer multiplies
8374
+ * `build.progress` (0..1) by its own series / category / level COUNT to
8375
+ * decide how many stages are revealed at the current playback time; see
8376
+ * {@link import('./animation-build').revealedStageCount}. Absent for ordinary
8377
+ * whole-element entrances, so existing renderers are unaffected.
8378
+ */
8379
+ build?: ElementBuildState;
8380
+ /**
8381
+ * True when an active `p:animClr` color animation targets this shape's fill.
8382
+ * A vector renderer should then paint the fill with `fill: inherit` so the
8383
+ * wrapper-level colour keyframes cascade to the SVG path. Absent/false means
8384
+ * no active fill-colour animation.
8385
+ */
8386
+ animatesFill?: boolean;
8387
+ /**
8388
+ * True when an active `p:animClr` color animation targets this shape's
8389
+ * stroke. A vector renderer should then paint the stroke with
8390
+ * `stroke: inherit`. Absent/false means no active stroke-colour animation.
8391
+ */
8392
+ animatesStroke?: boolean;
8151
8393
  }
8152
8394
  /** The unit system used for ruler display. */
8153
8395
  type RulerUnit = 'inches' | 'centimetres';
@@ -8186,6 +8428,93 @@ interface FieldSubstitutionContext {
8186
8428
  //#region src/render/text-case-transform.d.ts
8187
8429
  type ChangeCaseMode = 'sentence' | 'lower' | 'upper' | 'capitalize' | 'toggle';
8188
8430
  //#endregion
8431
+ //#region src/render/collaboration-text-codec.d.ts
8432
+ /**
8433
+ * collaboration-text-codec.ts: TextSegment[] <-> Y.Text delta codec used by the
8434
+ * collaboration sync layer. Split out of collaboration-sync.ts to keep both
8435
+ * modules focused.
8436
+ *
8437
+ * Exports:
8438
+ * - DeltaOp / YTextLike: structural Yjs text interfaces (no yjs import)
8439
+ * - encodeTextBody: write TextSegment[] into a live YTextLike
8440
+ * - encodeSegmentsToDelta: pure simulation of the delta Y.Text would produce
8441
+ * - decodeDelta / decodeTextBody: delta -> TextSegment[]
8442
+ * - isYTextLike: runtime guard
8443
+ */
8444
+ interface DeltaOp {
8445
+ insert?: unknown;
8446
+ attributes?: Record<string, unknown>;
8447
+ }
8448
+ interface YTextLike {
8449
+ insert: (index: number, text: string, attrs?: Record<string, string>) => void;
8450
+ toDelta: () => DeltaOp[];
8451
+ toString: () => string;
8452
+ }
8453
+ //#endregion
8454
+ //#region src/render/collaboration-sync.d.ts
8455
+ interface YMapLike {
8456
+ get: (key: string) => unknown;
8457
+ set: (key: string, value: unknown) => void;
8458
+ delete: (key: string) => void;
8459
+ forEach: (cb: (value: unknown, key: string) => void) => void;
8460
+ }
8461
+ /** Shape of the Yjs transaction passed to (deep) observers. */
8462
+ interface YTransactionLike {
8463
+ origin?: unknown;
8464
+ }
8465
+ type YDeepObserver = (events?: unknown, transaction?: YTransactionLike) => void;
8466
+ interface YArrayLike {
8467
+ readonly length: number;
8468
+ get: (index: number) => unknown;
8469
+ push: (items: unknown[]) => void;
8470
+ delete: (index: number, length?: number) => void;
8471
+ insert: (index: number, items: unknown[]) => void;
8472
+ toArray: () => unknown[];
8473
+ observe: (handler: () => void) => void;
8474
+ unobserve: (handler: () => void) => void;
8475
+ observeDeep: (handler: YDeepObserver) => void;
8476
+ unobserveDeep: (handler: YDeepObserver) => void;
8477
+ }
8478
+ interface YDocLike {
8479
+ getMap: (name: string) => YMapLike;
8480
+ getArray: (name: string) => YArrayLike;
8481
+ transact: (fn: () => void, origin?: unknown) => void;
8482
+ }
8483
+ interface YjsFactories {
8484
+ createMap: () => YMapLike;
8485
+ createArray: () => YArrayLike;
8486
+ createText: () => YTextLike;
8487
+ }
8488
+ //#endregion
8489
+ //#region src/render/collaboration-live-patch-target.d.ts
8490
+ /** Interim geometry for an element mid-gesture. All fields optional. */
8491
+ interface LiveGeometryPatch {
8492
+ x?: number;
8493
+ y?: number;
8494
+ width?: number;
8495
+ height?: number;
8496
+ rotation?: number;
8497
+ }
8498
+ /** The element's pre-edit rich text, used to remap the interim plain text. */
8499
+ interface LiveTextSource {
8500
+ textSegments?: TextSegment[];
8501
+ textStyle?: TextStyle;
8502
+ }
8503
+ interface CollaborationLivePatcher {
8504
+ /** Attach a live doc (or `null` to go dormant). Pending patches are dropped. */
8505
+ configure: (doc: YDocLike | null, factories: YjsFactories | null) => void;
8506
+ /** True when a doc + factories are attached, i.e. patches will be written. */
8507
+ isActive: () => boolean;
8508
+ /** Queue interim geometry for an element. */
8509
+ patchGeometry: (slideId: string | undefined, elementId: string, geometry: LiveGeometryPatch) => void;
8510
+ /** Queue interim text for an element (remapped over `source`'s segments). */
8511
+ patchText: (slideId: string | undefined, elementId: string, text: string, source?: LiveTextSource) => void;
8512
+ /** Write everything queued right now (call on gesture end / edit commit). */
8513
+ flush: () => void;
8514
+ /** Drop pending work, cancel timers and detach the doc. */
8515
+ dispose: () => void;
8516
+ }
8517
+ //#endregion
8189
8518
  //#region src/render/slide-compare.d.ts
8190
8519
  type SlideDiffStatus = 'added' | 'removed' | 'changed' | 'unchanged';
8191
8520
  type ElementChangeKind = 'added' | 'removed' | 'moved' | 'resized' | 'textChanged';
@@ -8740,418 +9069,801 @@ interface PowerPointViewerHandle extends FileViewerHandle, PowerPointViewerAPI {
8740
9069
  getContent: () => Promise<Uint8Array>;
8741
9070
  }
8742
9071
 
8743
- //#region src/viewer/hooks/presentation-mode/types.d.ts
8744
- /**
8745
- * How a forward/backward slide advance was requested.
8746
- *
8747
- * - `'click'`: a click/tap on the slide surface (PowerPoint's "On Mouse Click"
8748
- * advance). This is the only trigger governed by `advanceOnClick`.
8749
- * - `'explicit'`: keyboard, navigation buttons, action triggers, and timed
8750
- * auto-advance. These always navigate regardless of `advanceOnClick`, matching
8751
- * PowerPoint (arrow keys / Next always work even when click-advance is off).
8752
- */
8753
- type SlideAdvanceTrigger = 'click' | 'explicit';
8754
- /**
8755
- * State describing the transition overlay that plays while advancing into a
8756
- * slide that carries a `p:transition`. The outgoing slide is snapshotted into
8757
- * an animated overlay layer while the incoming slide renders underneath on the
8758
- * main stage; the overlay tears down once `durationMs` elapses.
8759
- */
8760
- interface PresentationTransitionOverlayState {
8761
- /** Index of the leaving slide, rendered (animated) in the overlay layer. */
8762
- outgoingSlideIndex: number;
8763
- /** Index of the arriving slide, already live on the main stage. */
8764
- incomingSlideIndex: number;
8765
- /** The incoming slide's transition definition (drives the CSS animation). */
8766
- transition: PptxSlideTransition;
8767
- /** Resolved transition duration (ms). */
8768
- durationMs: number;
8769
- }
8770
- interface UsePresentationModeInput {
9072
+ //#region src/viewer/components/toolbar/toolbar-types.d.ts
9073
+ interface ToolbarProps {
9074
+ fileName?: string;
8771
9075
  mode: ViewerMode;
8772
- slides: PptxSlide[];
8773
- visibleSlideIndexes: number[];
8774
- activeSlideIndex: number;
8775
- containerRef: React.RefObject<HTMLElement | null>;
8776
- /** Raw PPTX bytes: forwarded to audience window for content sharing. */
8777
- content?: ArrayBuffer | Uint8Array | null;
9076
+ canEdit: boolean;
9077
+ isNarrowViewport: boolean;
9078
+ isSidebarCollapsed: boolean;
9079
+ isInspectorPaneOpen: boolean;
9080
+ isCompactToolbarOpen: boolean;
9081
+ toolbarSection: ToolbarSection;
9082
+ scale: number;
9083
+ canUndo: boolean;
9084
+ canRedo: boolean;
9085
+ undoLabel: string | undefined;
9086
+ redoLabel: string | undefined;
9087
+ findReplaceOpen: boolean;
9088
+ selectedElement: PptxElement | null;
9089
+ tableEditorState?: TableCellEditorState | null;
9090
+ editTemplateMode: boolean;
9091
+ newShapeType: SupportedShapeType;
9092
+ activeTool: DrawingTool;
9093
+ drawingColor: string;
9094
+ drawingWidth: number;
9095
+ clipboardPayload: ElementClipboardPayload | null;
8778
9096
  onSetMode: (mode: ViewerMode) => void;
8779
- onSetActiveSlideIndex: (index: number) => void;
8780
- /**
8781
- * Play a sound file for an action/transition. When `options.loop` is true the
8782
- * audio repeats until the next animation sound plays or the show exits
8783
- * (used for transition sounds flagged with `soundLoop`).
8784
- */
8785
- onPlayActionSound?: (soundPath: string, options?: {
8786
- loop?: boolean;
8787
- }) => void;
8788
- /** Called when L key is pressed during presentation. */
8789
- onToggleLaser?: () => void;
8790
- /** Called when P key is pressed during presentation. */
8791
- onTogglePen?: () => void;
8792
- /** Called when E key is pressed during presentation. */
8793
- onToggleEraser?: () => void;
8794
- /** Called when Ctrl+M is pressed during presentation. */
8795
- onToggleToolbar?: () => void;
8796
- /** Called to persist rehearsal timings into slide transitions. */
8797
- onSaveRehearsalTimings?: (timings: Record<number, number>) => void;
8798
- /** Whether to loop continuously (kiosk or explicit loop setting). */
8799
- loopContinuously?: boolean;
8800
- /** Whether to play animations during the slide show (false = skip all animations). */
8801
- showWithAnimation?: boolean;
8802
- /** Whether to use rehearsed auto-advance timings (false = manual advance only). */
8803
- useTimings?: boolean;
8804
- /**
8805
- * Options > Advanced > "End with black slide". When true (PowerPoint's
8806
- * default), advancing past the last slide shows a black end-of-show
8807
- * screen; the next advance (or a click on it) exits. When false,
8808
- * advancing past the last slide exits the show directly.
8809
- */
8810
- endWithBlackSlide?: boolean;
8811
- }
8812
- interface UsePresentationModeResult {
8813
- presentationSlideIndex: number;
8814
- setPresentationSlideIndex: (index: number) => void;
8815
- presentationSlideVisible: boolean;
8816
- /** Active slide-transition overlay, or `null` when no transition is playing. */
8817
- transitionOverlay: PresentationTransitionOverlayState | null;
8818
- /** Tear down the transition overlay once its animation completes. */
8819
- handleTransitionOverlayComplete: () => void;
8820
- presentationAnimations: PresentationAnimationRuntime[];
8821
- presentationElementStates: Map<string, ElementAnimationState>;
8822
- presentationKeyframesCss: string;
8823
- clearPresentationTimers: () => void;
8824
- runPresentationEntranceAnimations: (slideIndex: number) => void;
8825
- /** True while the black "End of slide show" screen is displayed. */
8826
- endOfShowVisible: boolean;
8827
- movePresentationSlide: (direction: 1 | -1, trigger?: SlideAdvanceTrigger) => void;
8828
- navigateToSlide: (slideIndex: number) => void;
8829
- handlePresentationAction: (action: PptxAction) => void;
8830
- /**
8831
- * Handle a shape click in presentation mode. If the shape is an interactive
8832
- * trigger, play its animation sequence. Returns `true` if handled.
8833
- */
8834
- handleInteractiveShapeClick: (shapeId: string) => boolean;
8835
- /** Set of shape IDs that are interactive sequence triggers on the current slide. */
8836
- interactiveTriggerShapeIds: ReadonlySet<string>;
8837
- /** Set of shape IDs that are hover animation triggers on the current slide. */
8838
- hoverTriggerShapeIds: ReadonlySet<string>;
8839
- /** Handle hover start on a shape. If the shape has a hover sequence, play it. Returns `true` if handled. */
8840
- handleHoverStart: (shapeId: string) => boolean;
8841
- /** Handle hover end on a shape. Resets the hover sequence for replay. */
8842
- handleHoverEnd: (shapeId: string) => void;
8843
- /** Must be called from a user-gesture handler (click) to satisfy browser fullscreen policy. */
8844
- enterPresentMode: () => void;
8845
- /** Whether presenter view (split-screen with notes) is active instead of fullscreen. */
8846
- presenterMode: boolean;
8847
- /** Enter presenter view mode (no fullscreen, shows notes panel). */
8848
- enterPresenterView: () => void;
8849
- /** Toggle between fullscreen and presenter view during presentation. */
8850
- togglePresenterView: () => void;
8851
- /** Timestamp (ms) when the presentation started: used for elapsed timer. */
8852
- presentationStartTime: number | null;
8853
- /** Whether the current presentation session is in rehearse-timings mode. */
8854
- rehearsing: boolean;
8855
- /** Enter rehearse-timings mode (fullscreen presentation + timing HUD). */
8856
- enterRehearsalMode: () => void;
8857
- /** Recorded timings in ms, keyed by slide index. Populated during rehearsal. */
8858
- recordedTimings: Record<number, number>;
8859
- /** Timestamp when the current slide started (ms since epoch). */
8860
- slideStartTime: number | null;
8861
- /** Whether the rehearsal summary dialog should be shown. */
8862
- showRehearsalSummary: boolean;
8863
- /** Dismiss the rehearsal summary (discard timings). */
8864
- dismissRehearsalSummary: () => void;
8865
- /** Save recorded timings into each slide's transition.advanceAfterMs. */
8866
- saveRehearsalTimings: () => void;
8867
- /** Whether rehearsal timer is paused. */
8868
- rehearsalPaused: boolean;
8869
- /** Toggle the rehearsal timer pause state. */
8870
- toggleRehearsalPause: () => void;
8871
- /** Handle a zoom element click in presentation mode. */
8872
- handleZoomClick: (targetSlideIndex: number, returnSlideIndex: number) => void;
8873
- /** Ref holding the slide index to return to after zoom navigation. */
8874
- zoomReturnSlideIndex: React.RefObject<number | null>;
8875
- /** Navigate back to the zoom summary slide. Returns true if navigation occurred. */
8876
- returnToZoomSlide: () => boolean;
8877
- /** Clear the stored zoom return index. */
8878
- clearZoomReturn: () => void;
8879
- /** Open the audience display in a separate browser window. Returns `true` if successful. */
8880
- openAudienceWindow: () => boolean;
8881
- /** Close the audience display window. */
8882
- closeAudienceWindow: () => void;
8883
- /** Whether the audience window is currently open. */
8884
- isAudienceWindowOpen: () => boolean;
8885
- /** Send a slide index to the audience window explicitly. */
8886
- syncSlideToAudience: (slideIndex: number) => void;
8887
- syncStateToAudience: (snapshot: PresentationSnapshot) => void;
8888
- presenterSnapshot: PresentationSnapshot;
8889
- setPresenterBlackout: (blackout: PresentationSnapshot['blackout']) => void;
8890
- togglePresenterTimer: () => void;
8891
- resetPresenterTimer: () => void;
8892
- stepPresenterZoom: (direction: 1 | -1) => void;
8893
- resetPresenterZoom: () => void;
8894
- setPresenterCaption: (caption: string) => void;
8895
- setPresenterSubtitlesVisible: (visible: boolean) => void;
8896
- updatePresenterSnapshot: (patch: Partial<PresentationSnapshot>) => void;
8897
- swapPresenterDisplays: () => Promise<boolean>;
9097
+ onToggleSidebar: () => void;
9098
+ onToggleInspector: () => void;
9099
+ /** Opens the inspector pane and switches to the properties tab (for animation panel). */
9100
+ onOpenAnimationPanel: () => void;
9101
+ /** Adds an animation preset to the selected element. */
9102
+ onAddAnimation?: (preset: string, group: 'entrance' | 'emphasis' | 'exit') => void;
9103
+ /** Removes all animations from the selected element. */
9104
+ onRemoveAnimation?: () => void;
9105
+ onToggleCompactToolbar: () => void;
9106
+ onSetToolbarSection: (section: ToolbarSection) => void;
9107
+ onZoomIn: () => void;
9108
+ onZoomOut: () => void;
9109
+ onZoomToFit: () => void;
9110
+ onUndo: () => void;
9111
+ onRedo: () => void;
9112
+ onToggleFindReplace: () => void;
9113
+ onSetNewShapeType: (type: SupportedShapeType) => void;
9114
+ onAddTextBox: () => void;
9115
+ onAddShape: () => void;
9116
+ onAddTable: () => void;
9117
+ onAddChart?: (chartType: PptxChartType) => void;
9118
+ onAddSmartArt: () => void;
9119
+ onAddEquation: () => void;
9120
+ onAddActionButton: (shapeType: string) => void;
9121
+ onInsertField?: (fieldType: string, value?: string) => void;
9122
+ onOpenHeaderFooter?: () => void;
9123
+ onOpenImagePicker: () => void;
9124
+ onOpenMediaPicker: () => void;
9125
+ onSetActiveTool: (tool: DrawingTool) => void;
9126
+ onSetDrawingColor: (color: string) => void;
9127
+ onSetDrawingWidth: (width: number) => void;
9128
+ onSetEditTemplateMode: (mode: boolean) => void;
9129
+ spellCheckEnabled: boolean;
9130
+ showGrid: boolean;
9131
+ showRulers: boolean;
9132
+ snapToGrid: boolean;
9133
+ snapToShape: boolean;
9134
+ onSetSpellCheckEnabled: (enabled: boolean) => void;
9135
+ onSetShowGrid: (enabled: boolean) => void;
9136
+ onSetShowRulers: (enabled: boolean) => void;
9137
+ onSetSnapToGrid: (enabled: boolean) => void;
9138
+ onSetSnapToShape: (enabled: boolean) => void;
9139
+ onAddGuide: (axis: 'h' | 'v') => void;
9140
+ onAlignElements: (align: string) => void;
9141
+ onDistributeElements: (axis: string) => void;
9142
+ canDistribute: boolean;
9143
+ onCopy: () => void;
9144
+ onCut: () => void;
9145
+ onPaste: () => void;
9146
+ onFlip: (direction: 'horizontal' | 'vertical') => void;
9147
+ onMoveLayer: (direction: string) => void;
9148
+ onMoveLayerToEdge: (direction: string) => void;
9149
+ onDuplicate: () => void;
9150
+ onDelete: () => void;
9151
+ /** Open another presentation (File ▸ Open). Hidden when not provided. */
9152
+ onOpenFile?: () => void;
9153
+ onOpenRecentFile?: (key: string) => void;
9154
+ onCreatePresentation: (templateId: string) => void;
9155
+ onExportPng: () => void;
9156
+ onExportPdf: () => void;
9157
+ onExportVideo: () => void;
9158
+ onExportGif: () => void;
9159
+ onPackageForSharing: () => void;
9160
+ onOpenShareDialog?: () => void;
9161
+ onSaveAsPptx: () => void;
9162
+ onSaveAsPpsx: () => void;
9163
+ onSaveAsPptm: () => void;
9164
+ hasMacros: boolean;
9165
+ onCopySlideAsImage: () => void;
9166
+ onPrint: () => void;
9167
+ onToggleShortcuts: () => void;
9168
+ onOpenSettings?: () => void;
9169
+ onRunAccessibilityCheck: () => void;
9170
+ onToggleSlideSorter: () => void;
9171
+ onUpdateTextStyle: (updates: Partial<TextStyle>) => void;
9172
+ /** Rewrite the selected text's characters (PowerPoint's Aa "Change Case" dropdown). */
9173
+ onTransformTextCase: (mode: ChangeCaseMode) => void;
9174
+ isOverflowMenuOpen: boolean;
9175
+ onSetOverflowMenuOpen: (open: boolean) => void;
9176
+ layoutOptions: Array<{
9177
+ path: string;
9178
+ name: string;
9179
+ }>;
9180
+ onInsertSlideFromLayout: (path: string, name?: string) => void;
9181
+ customShows: PptxCustomShow[];
9182
+ activeCustomShowId: string | null;
9183
+ onSetActiveCustomShowId: (id: string | null) => void;
9184
+ onCreateCustomShow: () => void;
9185
+ onRenameActiveCustomShow: () => void;
9186
+ onDeleteActiveCustomShow: () => void;
9187
+ onToggleCurrentSlideInActiveShow: () => void;
9188
+ isCurrentSlideInActiveShow: boolean;
9189
+ onToggleVersionHistory?: () => void;
9190
+ onOpenPasswordProtection?: () => void;
9191
+ onOpenDocumentProperties?: () => void;
9192
+ onOpenFontEmbedding?: () => void;
9193
+ onOpenDigitalSignatures?: () => void;
9194
+ onEnterMasterView: () => void;
9195
+ onCloseMasterView: () => void;
9196
+ onEnterPresenterView?: () => void;
9197
+ onEnterRehearsalMode?: () => void;
9198
+ onToggleThemeEditor: () => void;
9199
+ isThemeEditorOpen: boolean;
9200
+ onToggleThemeGallery: () => void;
9201
+ isThemeGalleryOpen: boolean;
9202
+ onCompare?: () => void;
9203
+ onToggleComments?: () => void;
9204
+ isCommentsPanelOpen?: boolean;
9205
+ spellCheckActive?: boolean;
9206
+ slideCommentCount?: number;
9207
+ formatPainterActive?: boolean;
9208
+ onToggleFormatPainter?: () => void;
9209
+ canActivateFormatPainter?: boolean;
9210
+ isSelectionPaneOpen?: boolean;
9211
+ onToggleSelectionPane?: () => void;
9212
+ eyedropperActive?: boolean;
9213
+ onToggleEyedropper?: () => void;
9214
+ onOpenSetUpSlideShow?: () => void;
9215
+ onOpenBroadcastDialog?: () => void;
9216
+ onToggleSubtitles?: () => void;
9217
+ showSubtitles?: boolean;
9218
+ activeSlide?: PptxSlide;
9219
+ onTransitionChange: (updates: Partial<PptxSlideTransition>) => void;
9220
+ onApplyTransitionToAll: () => void;
9221
+ /** Host-supplied list of toolbar buttons/ribbon tabs to hide. See `PowerPointViewerProps.hiddenActions`. */
9222
+ hiddenActions?: readonly ToolbarActionId[];
9223
+ /** Whether the AI assistant is available (the host passed the `ai` prop). */
9224
+ aiEnabled?: boolean;
9225
+ /** Whether the AI assistant panel is currently open. */
9226
+ isAiPanelOpen?: boolean;
9227
+ /** Toggle the AI assistant panel. */
9228
+ onToggleAiPanel?: () => void;
8898
9229
  }
8899
9230
  //#endregion
8900
- //#region src/viewer/hooks/useThemeSwitching.d.ts
8901
- interface UseThemeSwitchingInput {
8902
- /** Ref to the PptxHandler instance. */
8903
- handlerRef: RefObject<PptxHandler | null>;
8904
- /** Current parsed presentation data (null when nothing is loaded). */
8905
- data: PptxData | null;
8906
- /** Callback to update the presentation data after theme switch. */
8907
- onDataChange: (newData: PptxData) => void;
8908
- /** Optional callback fired when theme switch completes successfully. */
8909
- onThemeChanged?: (preset: PptxThemePreset) => void;
9231
+ //#region src/viewer/utils/table-band-style.d.ts
9232
+ /** Context for resolving table style colours from the theme. */
9233
+ interface TableStyleContext {
9234
+ tableStyleMap?: ParsedTableStyleMap;
9235
+ theme?: PptxTheme;
8910
9236
  }
8911
- interface ThemeSwitchingResult {
8912
- /** All available built-in theme presets. */
8913
- presets: readonly PptxThemePreset[];
8914
- /**
8915
- * Apply a theme preset to the current presentation.
8916
- * Updates both the in-memory ZIP and all resolved element colours.
8917
- */
8918
- switchToPreset: (preset: PptxThemePreset) => Promise<void>;
9237
+ //#endregion
9238
+ //#region src/viewer/components/canvas/canvas-types.d.ts
9239
+ interface ZoomViewport {
9240
+ canvasViewportRef: React$1.RefObject<HTMLDivElement | null>;
9241
+ editWrapperRef: React$1.RefObject<HTMLDivElement | null>;
9242
+ canvasStageRef: React$1.RefObject<HTMLDivElement | null>;
9243
+ editorScale: number;
9244
+ }
9245
+ interface SlideCanvasProps {
9246
+ activeSlide: PptxSlide | undefined;
9247
+ templateElements: PptxElement[];
9248
+ canvasSize: CanvasSize;
9249
+ zoom: ZoomViewport;
9250
+ mode: ViewerMode;
9251
+ canEdit: boolean;
9252
+ editTemplateMode: boolean;
9253
+ selectedElementIdSet: Set<string>;
9254
+ selectedElement: PptxElement | null;
9255
+ inlineEditingElementId: string | null;
9256
+ inlineEditingText: string;
9257
+ spellCheckEnabled: boolean;
9258
+ mediaDataUrls: Map<string, string>;
9259
+ tableEditorState: TableCellEditorState | null;
9260
+ marqueeSelectionState: MarqueeSelectionState | null;
9261
+ snapLines: Array<{
9262
+ axis: string;
9263
+ position: number;
9264
+ }>;
9265
+ showGrid: boolean;
9266
+ /** Grid spacing in CSS px (derived from PPTX gridSpacing EMUs). */
9267
+ gridSpacingPx?: number;
9268
+ showRulers: boolean;
9269
+ /** Unit system for rulers (default: inches). */
9270
+ rulerUnit?: RulerUnit;
9271
+ guides: Array<{
9272
+ id: string;
9273
+ axis: 'h' | 'v';
9274
+ position: number;
9275
+ }>;
9276
+ presentationElementStates?: Map<string, ElementAnimationState>;
9277
+ presentationKeyframesCss?: string;
9278
+ onClick: (elementId: string, e: React$1.MouseEvent) => void;
9279
+ onDoubleClick: (elementId: string, e: React$1.MouseEvent) => void;
9280
+ onMouseDown: (elementId: string, e: React$1.MouseEvent) => void;
9281
+ onContextMenu: (elementId: string, e: React$1.MouseEvent) => void;
9282
+ /** Called when the user presses mouse down on empty canvas space. */
9283
+ onCanvasMouseDown?: (e: React$1.MouseEvent) => void;
9284
+ onResizePointerDown: (elementId: string, e: React$1.MouseEvent, handle: string) => void;
9285
+ onAdjustmentPointerDown: (elementId: string, e: React$1.MouseEvent) => void;
9286
+ /** Commit a new rotation (degrees) when the on-canvas rotate handle is dragged. */
9287
+ onRotate?: (elementId: string, rotationDeg: number) => void;
9288
+ onInlineEditChange: (text: string) => void;
9289
+ onInlineEditCommit: () => void;
9290
+ onInlineEditCancel: () => void;
9291
+ onTableCellSelect: (cell: Omit<TableCellEditorState, 'elementId'> | null, elementId: string) => void;
9292
+ /** Called when an edited table cell should be committed. */
9293
+ onCommitCellEdit?: (elementId: string, rowIndex: number, colIndex: number, text: string) => void;
8919
9294
  /**
8920
- * Apply a custom colour scheme (and optional font scheme) to the
8921
- * current presentation.
9295
+ * Commit a partial update to a SmartArt element from inline (on-canvas) node
9296
+ * editing. Routed to the same element-update path the inspector uses (undo/redo
9297
+ * + dirty marking). When absent, inline SmartArt editing is disabled.
8922
9298
  */
8923
- switchToCustom: (colorScheme: PptxThemeColorScheme, fontScheme?: PptxThemeFontScheme, themeName?: string) => Promise<void>;
9299
+ onUpdateSmartArtElement?: (elementId: string, updates: Partial<PptxElement>) => void;
8924
9300
  /**
8925
- * Get the preset matching the current presentation theme (if any).
8926
- * Returns undefined if the current theme does not match a built-in preset.
9301
+ * Apply a text-style toggle (Ctrl/Cmd+B/I/U) to the element being
9302
+ * inline-edited. Routed to the same updateSelectedTextStyle path as the
9303
+ * toolbar. When absent, the inline formatting shortcuts are inert.
8927
9304
  */
8928
- currentPreset: PptxThemePreset | undefined;
8929
- }
8930
- /**
8931
- * React hook providing theme switching capabilities for the PowerPoint viewer.
8932
- *
8933
- * @example
8934
- * ```tsx
8935
- * const { presets, switchToPreset, currentPreset } = useThemeSwitching({
8936
- * handlerRef,
8937
- * data,
8938
- * onDataChange: setData,
8939
- * });
8940
- *
8941
- * return (
8942
- * <div>
8943
- * {presets.map(preset => (
8944
- * <button
8945
- * key={preset.id}
8946
- * onClick={() => switchToPreset(preset)}
8947
- * aria-pressed={preset.id === currentPreset?.id}
8948
- * >
8949
- * {preset.name}
8950
- * </button>
8951
- * ))}
8952
- * </div>
8953
- * );
8954
- * ```
8955
- */
8956
- declare function useThemeSwitching(input: UseThemeSwitchingInput): ThemeSwitchingResult;
8957
- //#endregion
8958
- //#region ../../node_modules/.bun/lib0@0.2.117/node_modules/lib0/observable.d.ts
8959
- /**
8960
- * Handles named events.
8961
- *
8962
- * @deprecated
8963
- * @template N
8964
- */
8965
- declare class Observable<N> {
8966
- /**
8967
- * Some desc.
8968
- * @type {Map<N, any>}
8969
- */
8970
- _observers: Map<N, any>;
8971
- /**
8972
- * @param {N} name
8973
- * @param {function} f
8974
- */
8975
- on(name: N, f: Function): void;
8976
- /**
8977
- * @param {N} name
8978
- * @param {function} f
8979
- */
8980
- once(name: N, f: Function): void;
8981
- /**
8982
- * @param {N} name
8983
- * @param {function} f
8984
- */
8985
- off(name: N, f: Function): void;
9305
+ onFormatText?: (updates: Partial<TextStyle>) => void;
9306
+ /** Called when table column widths are resized. */
9307
+ onResizeTableColumns?: (elementId: string, newWidths: number[]) => void;
9308
+ /** Called when a table row is resized. */
9309
+ onResizeTableRow?: (elementId: string, rowIndex: number, newHeight: number) => void;
9310
+ /** Find & Replace results (all matches across all slides). */
9311
+ findResults?: Array<{
9312
+ slideIndex: number;
9313
+ elementId: string;
9314
+ segmentIndex: number;
9315
+ startOffset: number;
9316
+ length: number;
9317
+ }>;
9318
+ /** Index of the currently focused find result (-1 for none). */
9319
+ findResultIndex?: number;
9320
+ /** Index of the currently visible slide (needed to filter find results). */
9321
+ activeSlideIndex?: number;
9322
+ /** Currently active drawing tool ("select" means no drawing overlay). */
9323
+ activeTool?: DrawingTool;
9324
+ /** Stroke colour for pen / highlighter. */
9325
+ drawingColor?: string;
9326
+ /** Stroke width for pen / highlighter. */
9327
+ drawingWidth?: number;
9328
+ /** Ref that is true while a pointer stroke is in progress. */
9329
+ isDrawingRef?: React$1.RefObject<boolean>;
9330
+ /** Called when a completed ink stroke should be added to the slide. */
9331
+ onAddInkElement?: (ink: InkPptxElement) => void;
9332
+ /** Called when a freeform drawing stroke should be added as a shape element. */
9333
+ onAddFreeformShape?: (shape: ShapePptxElement) => void;
9334
+ /** Called when the eraser tool removes an ink element. */
9335
+ onEraseInkElement?: (elementId: string) => void;
9336
+ /** Called when a shape-level action is clicked (e.g. slide jump, URL). */
9337
+ onActionClick?: (elementId: string, action: PptxAction) => void;
9338
+ /** Called when a text-level hyperlink is clicked. */
9339
+ onHyperlinkClick?: (url: string) => void;
9340
+ /** Comments for the current slide (used for on-canvas markers). */
9341
+ comments?: PptxComment[];
9342
+ /** Whether to show comment markers on the slide canvas. */
9343
+ showCommentMarkers?: boolean;
9344
+ /** Called when a comment marker is clicked. */
9345
+ onCommentMarkerClick?: (commentId: string) => void;
9346
+ onMoveGuide?: (guideId: string, position: number) => void;
9347
+ onDeleteGuide?: (guideId: string) => void;
9348
+ onCreateGuideFromRuler?: (axis: 'h' | 'v', positionPx: number) => void;
9349
+ /** When true, shows connection sites on shapes and enables connector drawing. */
9350
+ connectorCreationMode?: boolean;
9351
+ /** Called when a new connector is created between two shapes. */
9352
+ onCreateConnector?: (connector: ConnectorPptxElement) => void;
9353
+ /** All slides in the presentation (for zoom element thumbnails). */
9354
+ allSlides?: readonly PptxSlide[];
9355
+ /** Callback fired when a zoom element is clicked in presentation mode. */
9356
+ onZoomClick?: (targetSlideIndex: number, returnSlideIndex: number) => void;
9357
+ /** Index of the current slide (for zoom return navigation). */
9358
+ sourceSlideIndex?: number;
9359
+ /** Context for text field placeholder substitution (slide number, header/footer, etc.). */
9360
+ fieldContext?: FieldSubstitutionContext;
9361
+ /** Theme + table style map for resolving table band/header colours. */
9362
+ tableStyleContext?: TableStyleContext;
9363
+ /** Optional collaboration cursor overlay rendered on top of the canvas. */
9364
+ collaborationOverlay?: React$1.ReactNode;
8986
9365
  /**
8987
- * Emit a named event. All registered event listeners that listen to the
8988
- * specified name will receive the event.
8989
- *
8990
- * @todo This should catch exceptions
8991
- *
8992
- * @param {N} name The event name.
8993
- * @param {Array<any>} args The arguments that are applied to the event listener.
9366
+ * When true, the stage marks itself `data-pptx-ai-active` so element colour
9367
+ * changes tween while the AI assistant is working (see AiFocusHighlightOverlay).
8994
9368
  */
8995
- emit(name: N, args: Array<any>): void;
8996
- destroy(): void;
9369
+ aiActive?: boolean;
8997
9370
  }
8998
9371
  //#endregion
8999
- //#region ../../node_modules/.bun/y-protocols@1.0.7+253afa400b9c0a30/node_modules/y-protocols/awareness.d.ts
9372
+ //#region src/viewer/hooks/useAutosave.d.ts
9373
+ type AutosaveStatus = {
9374
+ state: 'idle';
9375
+ } | {
9376
+ state: 'disabled';
9377
+ reason: string;
9378
+ } | {
9379
+ state: 'saving';
9380
+ } | {
9381
+ state: 'saved';
9382
+ timestamp: number;
9383
+ } | {
9384
+ state: 'error';
9385
+ message: string;
9386
+ };
9387
+ interface UseAutosaveInput {
9388
+ /** Whether the document has unsaved changes. */
9389
+ isDirty: boolean;
9390
+ /** File path or name of the currently-open PPTX. Required for autosave to work. */
9391
+ filePath: string | undefined;
9392
+ /** Serialise current editor state to a Uint8Array. */
9393
+ serializeSlides: () => Promise<Uint8Array | null>;
9394
+ /** Autosave interval in seconds (default 120). */
9395
+ intervalSeconds?: number;
9396
+ /** Whether autosave is enabled. */
9397
+ enabled?: boolean;
9398
+ }
9399
+ interface UseAutosaveResult {
9400
+ /** Current autosave status for display in the StatusBar. */
9401
+ autosaveStatus: AutosaveStatus;
9402
+ /** Manually trigger an autosave right now. */
9403
+ triggerAutosave: () => Promise<void>;
9404
+ }
9405
+ declare function useAutosave(input: UseAutosaveInput): UseAutosaveResult;
9406
+ //#endregion
9407
+ //#region src/viewer/hooks/useViewerBuildingBlocks.d.ts
9408
+ interface UseViewerBuildingBlocksInput {
9409
+ /** PPTX content as ArrayBuffer/Uint8Array, or null/undefined while no file is loaded. */
9410
+ content: ArrayBuffer | Uint8Array | null | undefined;
9411
+ /** Whether editing actions are enabled. Defaults to false (view-only). */
9412
+ canEdit?: boolean;
9413
+ /** Original file path, used for autosave recovery. */
9414
+ filePath?: string;
9415
+ /** Display name for the toolbar's file-name-aware controls (e.g. title bar hosts build themselves). */
9416
+ fileName?: string;
9417
+ /** Whether the built-in autosave-to-localStorage recovery timer is active. Defaults to true. */
9418
+ autosaveEnabled?: boolean;
9419
+ /** Display name used as the author for comments. */
9420
+ userName?: string;
9421
+ /** Host-supplied list of toolbar buttons/ribbon tabs to hide. */
9422
+ hiddenActions?: readonly ToolbarActionId[];
9423
+ /** Imperative handle ref, exposing the same `PowerPointViewerHandle` API `PowerPointViewer` does. */
9424
+ handle?: React.ForwardedRef<PowerPointViewerHandle>;
9425
+ onContentChange?: (content: Uint8Array) => void;
9426
+ onDirtyChange?: (dirty: boolean) => void;
9427
+ onActiveSlideChange?: (index: number) => void;
9428
+ onModeChange?: (mode: ViewerMode) => void;
9429
+ onZoomChange?: (zoom: number) => void;
9430
+ onSelectionChange?: (ids: string[]) => void;
9431
+ onSlideCountChange?: (count: number) => void;
9432
+ /** Fired by the toolbar's "Settings" button; the host owns rendering that dialog. */
9433
+ onOpenSettings?: () => void;
9434
+ /** Fired by the toolbar's "Header & Footer" button; the host owns rendering that panel. */
9435
+ onOpenHeaderFooter?: () => void;
9436
+ /** Fired by the toolbar's "Share" button; the host owns rendering that dialog. */
9437
+ onOpenShareDialog?: () => void;
9438
+ }
9439
+ interface ViewerBuildingBlocksResult {
9440
+ /** Flat, self-contained props for the standalone `<Toolbar>` component. */
9441
+ toolbarProps: ToolbarProps;
9442
+ /** Flat, self-contained props for the standalone `<SlideCanvas>` component. */
9443
+ canvasProps: SlideCanvasProps;
9444
+ /** Current viewer mode (edit, view, present, master). */
9445
+ mode: ViewerMode;
9446
+ /** True while the initial parse of `content` is in progress. */
9447
+ loading: boolean;
9448
+ /** Parse error message, or null. */
9449
+ error: string | null;
9450
+ /** Current autosave-to-localStorage recovery status. */
9451
+ autosaveStatus: AutosaveStatus;
9452
+ }
9453
+ declare function useViewerBuildingBlocks(input: UseViewerBuildingBlocksInput): ViewerBuildingBlocksResult;
9454
+
9455
+ //#region src/viewer/hooks/presentation-mode/types.d.ts
9000
9456
  /**
9001
- * @typedef {Object} MetaClientState
9002
- * @property {number} MetaClientState.clock
9003
- * @property {number} MetaClientState.lastUpdated unix timestamp
9457
+ * How a forward/backward slide advance was requested.
9458
+ *
9459
+ * - `'click'`: a click/tap on the slide surface (PowerPoint's "On Mouse Click"
9460
+ * advance). This is the only trigger governed by `advanceOnClick`.
9461
+ * - `'explicit'`: keyboard, navigation buttons, action triggers, and timed
9462
+ * auto-advance. These always navigate regardless of `advanceOnClick`, matching
9463
+ * PowerPoint (arrow keys / Next always work even when click-advance is off).
9004
9464
  */
9465
+ type SlideAdvanceTrigger = 'click' | 'explicit';
9005
9466
  /**
9006
- * The Awareness class implements a simple shared state protocol that can be used for non-persistent data like awareness information
9007
- * (cursor, username, status, ..). Each client can update its own local state and listen to state changes of
9008
- * remote clients. Every client may set a state of a remote peer to `null` to mark the client as offline.
9009
- *
9010
- * Each client is identified by a unique client id (something we borrow from `doc.clientID`). A client can override
9011
- * its own state by propagating a message with an increasing timestamp (`clock`). If such a message is received, it is
9012
- * applied if the known state of that client is older than the new state (`clock < newClock`). If a client thinks that
9013
- * a remote client is offline, it may propagate a message with
9014
- * `{ clock: currentClientClock, state: null, client: remoteClient }`. If such a
9015
- * message is received, and the known clock of that client equals the received clock, it will override the state with `null`.
9016
- *
9017
- * Before a client disconnects, it should propagate a `null` state with an updated clock.
9018
- *
9019
- * Awareness states must be updated every 30 seconds. Otherwise the Awareness instance will delete the client state.
9020
- *
9021
- * @extends {Observable<string>}
9467
+ * State describing the transition overlay that plays while advancing into a
9468
+ * slide that carries a `p:transition`. The outgoing slide is snapshotted into
9469
+ * an animated overlay layer while the incoming slide renders underneath on the
9470
+ * main stage; the overlay tears down once `durationMs` elapses.
9022
9471
  */
9023
- declare class Awareness extends Observable<string> {
9024
- /**
9025
- * @param {Y.Doc} doc
9026
- */
9027
- constructor(doc: Y.Doc);
9028
- doc: Y.Doc;
9029
- /**
9030
- * @type {number}
9031
- */
9032
- clientID: number;
9033
- /**
9034
- * Maps from client id to client state
9035
- * @type {Map<number, Object<string, any>>}
9036
- */
9037
- states: Map<number, {
9038
- [x: string]: any;
9039
- }>;
9472
+ interface PresentationTransitionOverlayState {
9473
+ /** Index of the leaving slide, rendered (animated) in the overlay layer. */
9474
+ outgoingSlideIndex: number;
9475
+ /** Index of the arriving slide, already live on the main stage. */
9476
+ incomingSlideIndex: number;
9477
+ /** The incoming slide's transition definition (drives the CSS animation). */
9478
+ transition: PptxSlideTransition;
9479
+ /** Resolved transition duration (ms). */
9480
+ durationMs: number;
9481
+ }
9482
+ interface UsePresentationModeInput {
9483
+ mode: ViewerMode;
9484
+ slides: PptxSlide[];
9485
+ visibleSlideIndexes: number[];
9486
+ activeSlideIndex: number;
9487
+ containerRef: React.RefObject<HTMLElement | null>;
9488
+ /** Raw PPTX bytes: forwarded to audience window for content sharing. */
9489
+ content?: ArrayBuffer | Uint8Array | null;
9490
+ onSetMode: (mode: ViewerMode) => void;
9491
+ onSetActiveSlideIndex: (index: number) => void;
9040
9492
  /**
9041
- * @type {Map<number, MetaClientState>}
9493
+ * Play a sound file for an action/transition. When `options.loop` is true the
9494
+ * audio repeats until the next animation sound plays or the show exits
9495
+ * (used for transition sounds flagged with `soundLoop`).
9042
9496
  */
9043
- meta: Map<number, MetaClientState>;
9044
- _checkInterval: any;
9045
- /**
9046
- * @return {Object<string,any>|null}
9047
- */
9048
- getLocalState(): {
9049
- [x: string]: any;
9050
- } | null;
9051
- /**
9052
- * @param {Object<string,any>|null} state
9053
- */
9054
- setLocalState(state: {
9055
- [x: string]: any;
9056
- } | null): void;
9497
+ onPlayActionSound?: (soundPath: string, options?: {
9498
+ loop?: boolean;
9499
+ }) => void;
9500
+ /** Called when L key is pressed during presentation. */
9501
+ onToggleLaser?: () => void;
9502
+ /** Called when P key is pressed during presentation. */
9503
+ onTogglePen?: () => void;
9504
+ /** Called when E key is pressed during presentation. */
9505
+ onToggleEraser?: () => void;
9506
+ /** Called when Ctrl+M is pressed during presentation. */
9507
+ onToggleToolbar?: () => void;
9508
+ /** Called to persist rehearsal timings into slide transitions. */
9509
+ onSaveRehearsalTimings?: (timings: Record<number, number>) => void;
9510
+ /** Whether to loop continuously (kiosk or explicit loop setting). */
9511
+ loopContinuously?: boolean;
9512
+ /** Whether to play animations during the slide show (false = skip all animations). */
9513
+ showWithAnimation?: boolean;
9514
+ /** Whether to use rehearsed auto-advance timings (false = manual advance only). */
9515
+ useTimings?: boolean;
9057
9516
  /**
9058
- * @param {string} field
9059
- * @param {any} value
9517
+ * Options > Advanced > "End with black slide". When true (PowerPoint's
9518
+ * default), advancing past the last slide shows a black end-of-show
9519
+ * screen; the next advance (or a click on it) exits. When false,
9520
+ * advancing past the last slide exits the show directly.
9060
9521
  */
9061
- setLocalStateField(field: string, value: any): void;
9522
+ endWithBlackSlide?: boolean;
9523
+ }
9524
+ interface UsePresentationModeResult {
9525
+ presentationSlideIndex: number;
9526
+ setPresentationSlideIndex: (index: number) => void;
9527
+ presentationSlideVisible: boolean;
9528
+ /** Active slide-transition overlay, or `null` when no transition is playing. */
9529
+ transitionOverlay: PresentationTransitionOverlayState | null;
9530
+ /** Tear down the transition overlay once its animation completes. */
9531
+ handleTransitionOverlayComplete: () => void;
9532
+ presentationAnimations: PresentationAnimationRuntime[];
9533
+ presentationElementStates: Map<string, ElementAnimationState>;
9534
+ presentationKeyframesCss: string;
9535
+ clearPresentationTimers: () => void;
9536
+ runPresentationEntranceAnimations: (slideIndex: number) => void;
9537
+ /** True while the black "End of slide show" screen is displayed. */
9538
+ endOfShowVisible: boolean;
9539
+ movePresentationSlide: (direction: 1 | -1, trigger?: SlideAdvanceTrigger) => void;
9540
+ navigateToSlide: (slideIndex: number) => void;
9541
+ handlePresentationAction: (action: PptxAction) => void;
9062
9542
  /**
9063
- * @return {Map<number,Object<string,any>>}
9543
+ * Handle a shape click in presentation mode. If the shape is an interactive
9544
+ * trigger, play its animation sequence. Returns `true` if handled.
9064
9545
  */
9065
- getStates(): Map<number, {
9066
- [x: string]: any;
9067
- }>;
9546
+ handleInteractiveShapeClick: (shapeId: string) => boolean;
9547
+ /** Set of shape IDs that are interactive sequence triggers on the current slide. */
9548
+ interactiveTriggerShapeIds: ReadonlySet<string>;
9549
+ /** Set of shape IDs that are hover animation triggers on the current slide. */
9550
+ hoverTriggerShapeIds: ReadonlySet<string>;
9551
+ /** Handle hover start on a shape. If the shape has a hover sequence, play it. Returns `true` if handled. */
9552
+ handleHoverStart: (shapeId: string) => boolean;
9553
+ /** Handle hover end on a shape. Resets the hover sequence for replay. */
9554
+ handleHoverEnd: (shapeId: string) => void;
9555
+ /** Must be called from a user-gesture handler (click) to satisfy browser fullscreen policy. */
9556
+ enterPresentMode: () => void;
9557
+ /** Whether presenter view (split-screen with notes) is active instead of fullscreen. */
9558
+ presenterMode: boolean;
9559
+ /** Enter presenter view mode (no fullscreen, shows notes panel). */
9560
+ enterPresenterView: () => void;
9561
+ /** Toggle between fullscreen and presenter view during presentation. */
9562
+ togglePresenterView: () => void;
9563
+ /** Timestamp (ms) when the presentation started: used for elapsed timer. */
9564
+ presentationStartTime: number | null;
9565
+ /** Whether the current presentation session is in rehearse-timings mode. */
9566
+ rehearsing: boolean;
9567
+ /** Enter rehearse-timings mode (fullscreen presentation + timing HUD). */
9568
+ enterRehearsalMode: () => void;
9569
+ /** Recorded timings in ms, keyed by slide index. Populated during rehearsal. */
9570
+ recordedTimings: Record<number, number>;
9571
+ /** Timestamp when the current slide started (ms since epoch). */
9572
+ slideStartTime: number | null;
9573
+ /** Whether the rehearsal summary dialog should be shown. */
9574
+ showRehearsalSummary: boolean;
9575
+ /** Dismiss the rehearsal summary (discard timings). */
9576
+ dismissRehearsalSummary: () => void;
9577
+ /** Save recorded timings into each slide's transition.advanceAfterMs. */
9578
+ saveRehearsalTimings: () => void;
9579
+ /** Whether rehearsal timer is paused. */
9580
+ rehearsalPaused: boolean;
9581
+ /** Toggle the rehearsal timer pause state. */
9582
+ toggleRehearsalPause: () => void;
9583
+ /** Handle a zoom element click in presentation mode. */
9584
+ handleZoomClick: (targetSlideIndex: number, returnSlideIndex: number) => void;
9585
+ /** Ref holding the slide index to return to after zoom navigation. */
9586
+ zoomReturnSlideIndex: React.RefObject<number | null>;
9587
+ /** Navigate back to the zoom summary slide. Returns true if navigation occurred. */
9588
+ returnToZoomSlide: () => boolean;
9589
+ /** Clear the stored zoom return index. */
9590
+ clearZoomReturn: () => void;
9591
+ /** Open the audience display in a separate browser window. Returns `true` if successful. */
9592
+ openAudienceWindow: () => boolean;
9593
+ /** Close the audience display window. */
9594
+ closeAudienceWindow: () => void;
9595
+ /** Whether the audience window is currently open. */
9596
+ isAudienceWindowOpen: () => boolean;
9597
+ /** Send a slide index to the audience window explicitly. */
9598
+ syncSlideToAudience: (slideIndex: number) => void;
9599
+ syncStateToAudience: (snapshot: PresentationSnapshot) => void;
9600
+ presenterSnapshot: PresentationSnapshot;
9601
+ setPresenterBlackout: (blackout: PresentationSnapshot['blackout']) => void;
9602
+ togglePresenterTimer: () => void;
9603
+ resetPresenterTimer: () => void;
9604
+ stepPresenterZoom: (direction: 1 | -1) => void;
9605
+ resetPresenterZoom: () => void;
9606
+ setPresenterCaption: (caption: string) => void;
9607
+ setPresenterSubtitlesVisible: (visible: boolean) => void;
9608
+ updatePresenterSnapshot: (patch: Partial<PresentationSnapshot>) => void;
9609
+ swapPresenterDisplays: () => Promise<boolean>;
9068
9610
  }
9069
- type MetaClientState = {
9070
- clock: number;
9611
+ //#endregion
9612
+ //#region src/viewer/hooks/useThemeSwitching.d.ts
9613
+ interface UseThemeSwitchingInput {
9614
+ /** Ref to the PptxHandler instance. */
9615
+ handlerRef: RefObject<PptxHandler | null>;
9616
+ /** Current parsed presentation data (null when nothing is loaded). */
9617
+ data: PptxData | null;
9618
+ /** Callback to update the presentation data after theme switch. */
9619
+ onDataChange: (newData: PptxData) => void;
9620
+ /** Optional callback fired when theme switch completes successfully. */
9621
+ onThemeChanged?: (preset: PptxThemePreset) => void;
9622
+ }
9623
+ interface ThemeSwitchingResult {
9624
+ /** All available built-in theme presets. */
9625
+ presets: readonly PptxThemePreset[];
9071
9626
  /**
9072
- * unix timestamp
9627
+ * Apply a theme preset to the current presentation.
9628
+ * Updates both the in-memory ZIP and all resolved element colours.
9073
9629
  */
9074
- lastUpdated: number;
9075
- };
9076
- //#endregion
9077
- //#region src/viewer/hooks/collaboration/useYjsProvider.d.ts
9078
- interface UseYjsProviderInput {
9630
+ switchToPreset: (preset: PptxThemePreset) => Promise<void>;
9079
9631
  /**
9080
- * Collaboration config, or `undefined` when collaboration is inactive. The
9081
- * hook is always called (React hook rules) but stays fully dormant, never
9082
- * opening a transport, while config is absent.
9632
+ * Apply a custom colour scheme (and optional font scheme) to the
9633
+ * current presentation.
9083
9634
  */
9084
- config?: CollaborationConfig;
9085
- }
9086
- interface UseYjsProviderResult {
9087
- /** Current WebSocket connection status. */
9088
- status: ConnectionStatus;
9089
- /** The Yjs awareness instance (null until connected). */
9090
- awareness: Awareness | null;
9091
- /** The Yjs document (null until initialised). */
9092
- doc: Doc | null;
9093
- /** Local awareness client ID. */
9094
- clientId: number | null;
9635
+ switchToCustom: (colorScheme: PptxThemeColorScheme, fontScheme?: PptxThemeFontScheme, themeName?: string) => Promise<void>;
9095
9636
  /**
9096
- * Whether the provider completed its initial document sync. Local doc
9097
- * writes should be gated on this so a late joiner never seeds its
9098
- * bootstrap deck into a room whose content has not arrived yet. Websocket
9099
- * flips it on the provider's 'synced' event; webrtc flips it on peer sync
9100
- * or after {@link INITIAL_SYNC_GRACE_MS} (a lone fresh-room peer never
9101
- * receives a sync event).
9637
+ * Get the preset matching the current presentation theme (if any).
9638
+ * Returns undefined if the current theme does not match a built-in preset.
9102
9639
  */
9103
- synced: boolean;
9104
- /** Manually retry the connection after a timeout or error. */
9105
- retry: () => void;
9640
+ currentPreset: PptxThemePreset | undefined;
9106
9641
  }
9107
9642
  /**
9108
- * Lazily loads `yjs` and `y-websocket`, creates a Y.Doc and
9109
- * WebSocketProvider, and tracks the connection lifecycle.
9643
+ * React hook providing theme switching capabilities for the PowerPoint viewer.
9110
9644
  *
9111
- * If the connection does not succeed within {@link CONNECTION_TIMEOUT_MS},
9112
- * the provider is torn down and status moves to `'error'`. The consumer
9113
- * can call `retry()` to attempt a fresh connection.
9645
+ * @example
9646
+ * ```tsx
9647
+ * const { presets, switchToPreset, currentPreset } = useThemeSwitching({
9648
+ * handlerRef,
9649
+ * data,
9650
+ * onDataChange: setData,
9651
+ * });
9114
9652
  *
9115
- * The Yjs packages are dynamically imported so they are fully
9116
- * tree-shaken when collaboration is not enabled.
9653
+ * return (
9654
+ * <div>
9655
+ * {presets.map(preset => (
9656
+ * <button
9657
+ * key={preset.id}
9658
+ * onClick={() => switchToPreset(preset)}
9659
+ * aria-pressed={preset.id === currentPreset?.id}
9660
+ * >
9661
+ * {preset.name}
9662
+ * </button>
9663
+ * ))}
9664
+ * </div>
9665
+ * );
9666
+ * ```
9117
9667
  */
9118
- declare function useYjsProvider({ config }: UseYjsProviderInput): UseYjsProviderResult;
9119
- //#endregion
9120
- //#region src/viewer/hooks/collaboration/usePresenceTracking.d.ts
9121
- interface UsePresenceTrackingInput {
9122
- awareness: Awareness | null;
9123
- localClientId: number | null;
9124
- userName: string;
9125
- userColor: string;
9126
- userAvatar?: string;
9127
- /** Role in the session (broadcaster, viewer, or collaborator). */
9128
- role?: string;
9129
- canvasWidth: number;
9130
- canvasHeight: number;
9131
- }
9132
- interface UsePresenceTrackingResult {
9133
- /** Presence data for all remote users (excludes local). */
9134
- remoteUsers: UserPresence[];
9135
- /** Broadcast a partial presence update for the local user. */
9136
- broadcastPresence: (update: Partial<Omit<UserPresence, 'clientId'>>) => void;
9137
- }
9138
- declare function usePresenceTracking({ awareness, localClientId, userName, userColor, userAvatar, role, canvasWidth, canvasHeight }: UsePresenceTrackingInput): UsePresenceTrackingResult;
9668
+ declare function useThemeSwitching(input: UseThemeSwitchingInput): ThemeSwitchingResult;
9139
9669
  //#endregion
9140
- //#region src/viewer/hooks/collaboration/useCollaborativeState.d.ts
9141
- interface UseCollaborativeStateInput {
9670
+ //#region ../../node_modules/.bun/lib0@0.2.117/node_modules/lib0/observable.d.ts
9671
+ /**
9672
+ * Handles named events.
9673
+ *
9674
+ * @deprecated
9675
+ * @template N
9676
+ */
9677
+ declare class Observable<N> {
9142
9678
  /**
9143
- * Collaboration config, or `undefined` when collaboration is inactive. The
9144
- * hook is always called so the surrounding provider keeps a stable React
9145
- * tree shape; it produces a dormant value (no transport, empty presence)
9146
- * while config is absent.
9679
+ * Some desc.
9680
+ * @type {Map<N, any>}
9147
9681
  */
9148
- config?: CollaborationConfig;
9149
- canvasWidth: number;
9150
- canvasHeight: number;
9151
- }
9152
- declare function useCollaborativeState({ config, canvasWidth, canvasHeight }: UseCollaborativeStateInput): CollaborationContextValue | null;
9153
- //#endregion
9154
- //#region src/viewer/hooks/collaboration/useCollaborativeHistory.d.ts
9682
+ _observers: Map<N, any>;
9683
+ /**
9684
+ * @param {N} name
9685
+ * @param {function} f
9686
+ */
9687
+ on(name: N, f: Function): void;
9688
+ /**
9689
+ * @param {N} name
9690
+ * @param {function} f
9691
+ */
9692
+ once(name: N, f: Function): void;
9693
+ /**
9694
+ * @param {N} name
9695
+ * @param {function} f
9696
+ */
9697
+ off(name: N, f: Function): void;
9698
+ /**
9699
+ * Emit a named event. All registered event listeners that listen to the
9700
+ * specified name will receive the event.
9701
+ *
9702
+ * @todo This should catch exceptions
9703
+ *
9704
+ * @param {N} name The event name.
9705
+ * @param {Array<any>} args The arguments that are applied to the event listener.
9706
+ */
9707
+ emit(name: N, args: Array<any>): void;
9708
+ destroy(): void;
9709
+ }
9710
+ //#endregion
9711
+ //#region ../../node_modules/.bun/y-protocols@1.0.7+253afa400b9c0a30/node_modules/y-protocols/awareness.d.ts
9712
+ /**
9713
+ * @typedef {Object} MetaClientState
9714
+ * @property {number} MetaClientState.clock
9715
+ * @property {number} MetaClientState.lastUpdated unix timestamp
9716
+ */
9717
+ /**
9718
+ * The Awareness class implements a simple shared state protocol that can be used for non-persistent data like awareness information
9719
+ * (cursor, username, status, ..). Each client can update its own local state and listen to state changes of
9720
+ * remote clients. Every client may set a state of a remote peer to `null` to mark the client as offline.
9721
+ *
9722
+ * Each client is identified by a unique client id (something we borrow from `doc.clientID`). A client can override
9723
+ * its own state by propagating a message with an increasing timestamp (`clock`). If such a message is received, it is
9724
+ * applied if the known state of that client is older than the new state (`clock < newClock`). If a client thinks that
9725
+ * a remote client is offline, it may propagate a message with
9726
+ * `{ clock: currentClientClock, state: null, client: remoteClient }`. If such a
9727
+ * message is received, and the known clock of that client equals the received clock, it will override the state with `null`.
9728
+ *
9729
+ * Before a client disconnects, it should propagate a `null` state with an updated clock.
9730
+ *
9731
+ * Awareness states must be updated every 30 seconds. Otherwise the Awareness instance will delete the client state.
9732
+ *
9733
+ * @extends {Observable<string>}
9734
+ */
9735
+ declare class Awareness extends Observable<string> {
9736
+ /**
9737
+ * @param {Y.Doc} doc
9738
+ */
9739
+ constructor(doc: Y.Doc);
9740
+ doc: Y.Doc;
9741
+ /**
9742
+ * @type {number}
9743
+ */
9744
+ clientID: number;
9745
+ /**
9746
+ * Maps from client id to client state
9747
+ * @type {Map<number, Object<string, any>>}
9748
+ */
9749
+ states: Map<number, {
9750
+ [x: string]: any;
9751
+ }>;
9752
+ /**
9753
+ * @type {Map<number, MetaClientState>}
9754
+ */
9755
+ meta: Map<number, MetaClientState>;
9756
+ _checkInterval: any;
9757
+ /**
9758
+ * @return {Object<string,any>|null}
9759
+ */
9760
+ getLocalState(): {
9761
+ [x: string]: any;
9762
+ } | null;
9763
+ /**
9764
+ * @param {Object<string,any>|null} state
9765
+ */
9766
+ setLocalState(state: {
9767
+ [x: string]: any;
9768
+ } | null): void;
9769
+ /**
9770
+ * @param {string} field
9771
+ * @param {any} value
9772
+ */
9773
+ setLocalStateField(field: string, value: any): void;
9774
+ /**
9775
+ * @return {Map<number,Object<string,any>>}
9776
+ */
9777
+ getStates(): Map<number, {
9778
+ [x: string]: any;
9779
+ }>;
9780
+ }
9781
+ type MetaClientState = {
9782
+ clock: number;
9783
+ /**
9784
+ * unix timestamp
9785
+ */
9786
+ lastUpdated: number;
9787
+ };
9788
+ //#endregion
9789
+ //#region src/viewer/hooks/collaboration/useYjsProvider.d.ts
9790
+ interface UseYjsProviderInput {
9791
+ /**
9792
+ * Collaboration config, or `undefined` when collaboration is inactive. The
9793
+ * hook is always called (React hook rules) but stays fully dormant, never
9794
+ * opening a transport, while config is absent.
9795
+ */
9796
+ config?: CollaborationConfig;
9797
+ }
9798
+ interface UseYjsProviderResult {
9799
+ /** Current WebSocket connection status. */
9800
+ status: ConnectionStatus;
9801
+ /** The Yjs awareness instance (null until connected). */
9802
+ awareness: Awareness | null;
9803
+ /** The Yjs document (null until initialised). */
9804
+ doc: Doc | null;
9805
+ /** Local awareness client ID. */
9806
+ clientId: number | null;
9807
+ /**
9808
+ * Whether the provider completed its initial document sync. Local doc
9809
+ * writes should be gated on this so a late joiner never seeds its
9810
+ * bootstrap deck into a room whose content has not arrived yet. Websocket
9811
+ * flips it on the provider's 'synced' event; webrtc flips it on peer sync
9812
+ * or after {@link INITIAL_SYNC_GRACE_MS} (a lone fresh-room peer never
9813
+ * receives a sync event).
9814
+ */
9815
+ synced: boolean;
9816
+ /** Manually retry the connection after a timeout or error. */
9817
+ retry: () => void;
9818
+ }
9819
+ /**
9820
+ * Lazily loads `yjs` and `y-websocket`, creates a Y.Doc and
9821
+ * WebSocketProvider, and tracks the connection lifecycle.
9822
+ *
9823
+ * If the connection does not succeed within {@link CONNECTION_TIMEOUT_MS},
9824
+ * the provider is torn down and status moves to `'error'`. The consumer
9825
+ * can call `retry()` to attempt a fresh connection.
9826
+ *
9827
+ * The Yjs packages are dynamically imported so they are fully
9828
+ * tree-shaken when collaboration is not enabled.
9829
+ */
9830
+ declare function useYjsProvider({ config }: UseYjsProviderInput): UseYjsProviderResult;
9831
+ //#endregion
9832
+ //#region src/viewer/hooks/collaboration/usePresenceTracking.d.ts
9833
+ interface UsePresenceTrackingInput {
9834
+ awareness: Awareness | null;
9835
+ localClientId: number | null;
9836
+ userName: string;
9837
+ userColor: string;
9838
+ userAvatar?: string;
9839
+ /** Role in the session (broadcaster, viewer, or collaborator). */
9840
+ role?: string;
9841
+ canvasWidth: number;
9842
+ canvasHeight: number;
9843
+ }
9844
+ interface UsePresenceTrackingResult {
9845
+ /** Presence data for all remote users (excludes local). */
9846
+ remoteUsers: UserPresence[];
9847
+ /** Broadcast a partial presence update for the local user. */
9848
+ broadcastPresence: (update: Partial<Omit<UserPresence, 'clientId'>>) => void;
9849
+ }
9850
+ declare function usePresenceTracking({ awareness, localClientId, userName, userColor, userAvatar, role, canvasWidth, canvasHeight }: UsePresenceTrackingInput): UsePresenceTrackingResult;
9851
+ //#endregion
9852
+ //#region src/viewer/hooks/collaboration/useCollaborativeState.d.ts
9853
+ interface UseCollaborativeStateInput {
9854
+ /**
9855
+ * Collaboration config, or `undefined` when collaboration is inactive. The
9856
+ * hook is always called so the surrounding provider keeps a stable React
9857
+ * tree shape; it produces a dormant value (no transport, empty presence)
9858
+ * while config is absent.
9859
+ */
9860
+ config?: CollaborationConfig;
9861
+ canvasWidth: number;
9862
+ canvasHeight: number;
9863
+ }
9864
+ declare function useCollaborativeState({ config, canvasWidth, canvasHeight }: UseCollaborativeStateInput): CollaborationContextValue | null;
9865
+ //#endregion
9866
+ //#region src/viewer/hooks/collaboration/useCollaborativeHistory.d.ts
9155
9867
  interface UseCollaborativeHistoryInput {
9156
9868
  /** The local user's client ID (from Yjs awareness). */
9157
9869
  localClientId: number | null;
@@ -9183,586 +9895,214 @@ interface UseYjsDocumentSyncInput {
9183
9895
  /** Current slides state. */
9184
9896
  slides: PptxSlide[];
9185
9897
  /** Separated master/layout (template) elements, merged back on write-back. */
9186
- templateElementsBySlideId: Record<string, PptxElement[]>;
9187
- /** React state setter for slides. */
9188
- setSlides: React.Dispatch<React.SetStateAction<PptxSlide[]>>;
9189
- /** Whether collaboration is active (status === 'connected'). */
9190
- isConnected: boolean;
9191
- /**
9192
- * Whether the provider completed its initial document sync. Local -> doc
9193
- * writes are gated on this so a late joiner never seeds its bootstrap deck
9194
- * into a room whose real content has not arrived yet. Defaults to true for
9195
- * callers that manage sync readiness themselves.
9196
- */
9197
- isSynced?: boolean;
9198
- /** Collaboration config (for role and write-back). */
9199
- config?: Pick<CollaborationConfig, 'role' | 'onWriteBack' | 'writeBackDebounceMs'>;
9200
- /**
9201
- * Return the source PPTX bytes for write-back serialization. Only called
9202
- * when role === 'owner' and onWriteBack is set.
9203
- */
9204
- getSourceBytes?: () => Uint8Array | null;
9205
- /**
9206
- * Monotonic counter bumped each time the content-load pipeline finishes
9207
- * applying a parsed deck to viewer state. A local load that lands while the
9208
- * shared doc already holds slides (a late joiner's bootstrap deck parsing
9209
- * after the room state arrived) would silently clobber the synced slides;
9210
- * each bump re-adopts the doc's slides when the room has content.
9211
- */
9212
- loadVersion?: number;
9213
- }
9214
- declare function useYjsDocumentSync({ doc, slides, templateElementsBySlideId, setSlides, isConnected, isSynced, config, getSourceBytes, loadVersion }: UseYjsDocumentSyncInput): void;
9215
- //#endregion
9216
- //#region src/viewer/hooks/collaboration/useBroadcastFollower.d.ts
9217
- interface UseBroadcastFollowerInput {
9218
- /** The collaboration context (null when collaboration is disabled). */
9219
- collab: CollaborationContextValue | null;
9220
- /** Current local active slide index. */
9221
- activeSlideIndex: number;
9222
- /** Setter for the active slide index. */
9223
- setActiveSlideIndex: (index: number) => void;
9224
- /** Total number of slides (for bounds checking). */
9225
- slideCount: number;
9226
- /**
9227
- * When true, auto-follow stands down (e.g. the local user is manually
9228
- * following a specific peer via the follow bar). Defaults to false.
9229
- */
9230
- paused?: boolean;
9231
- }
9232
- declare function useBroadcastFollower({ collab, activeSlideIndex, setActiveSlideIndex, slideCount, paused }: UseBroadcastFollowerInput): void;
9233
- //#endregion
9234
- //#region src/viewer/hooks/collaboration/useFollowMode.d.ts
9235
- interface UseFollowModeInput {
9236
- /** The collaboration context (null when collaboration is disabled). */
9237
- collab: CollaborationContextValue | null;
9238
- /** Current local active slide index. */
9239
- activeSlideIndex: number;
9240
- /** Setter for the active slide index. */
9241
- setActiveSlideIndex: (index: number) => void;
9242
- /** Total number of slides (for bounds checking). */
9243
- slideCount: number;
9244
- }
9245
- interface UseFollowModeResult {
9246
- /** The clientId currently being followed, or null. */
9247
- followedClientId: number | null;
9248
- /** Follow the given peer, or `null` to stop following. */
9249
- followUser: (clientId: number | null) => void;
9250
- }
9251
- declare function useFollowMode({ collab, activeSlideIndex, setActiveSlideIndex, slideCount }: UseFollowModeInput): UseFollowModeResult;
9252
- //#endregion
9253
- //#region src/viewer/hooks/presentation-mode/useAnimationPlayback.d.ts
9254
- interface UseAnimationPlaybackInput {
9255
- slides: PptxSlide[];
9256
- onPlayActionSound?: (soundPath: string) => void;
9257
- /** When false, all animations are skipped (elements shown immediately). */
9258
- showWithAnimation?: boolean;
9259
- }
9260
- interface UseAnimationPlaybackResult {
9261
- presentationAnimations: PresentationAnimationRuntime[];
9262
- presentationElementStates: Map<string, ElementAnimationState>;
9263
- presentationKeyframesCss: string;
9264
- interactiveTriggerShapeIds: ReadonlySet<string>;
9265
- hoverTriggerShapeIds: ReadonlySet<string>;
9266
- clearPresentationTimers: () => void;
9267
- playNextAnimationGroup: () => boolean;
9268
- handleInteractiveShapeClick: (shapeId: string) => boolean;
9269
- handleHoverStart: (shapeId: string) => boolean;
9270
- handleHoverEnd: (shapeId: string) => void;
9271
- runPresentationEntranceAnimations: (slideIndex: number) => void;
9272
- /** Exposed so the orchestrator can schedule additional timers (e.g. auto-advance). */
9273
- presentationTimersRef: React.RefObject<number[]>;
9274
- }
9275
- declare function useAnimationPlayback(input: UseAnimationPlaybackInput): UseAnimationPlaybackResult;
9276
- //#endregion
9277
- //#region src/viewer/hooks/presentation-mode/useRehearsalTimings.d.ts
9278
- interface UseRehearsalTimingsInput {
9279
- containerRef: React.RefObject<HTMLElement | null>;
9280
- onSetMode: (mode: ViewerMode) => void;
9281
- onSaveRehearsalTimings?: (timings: Record<number, number>) => void;
9282
- setPresentationStartTime: (time: number | null) => void;
9283
- setPresenterMode: (mode: boolean) => void;
9284
- }
9285
- interface UseRehearsalTimingsResult {
9286
- rehearsing: boolean;
9287
- setRehearsing: React.Dispatch<React.SetStateAction<boolean>>;
9288
- recordedTimings: Record<number, number>;
9289
- slideStartTime: number | null;
9290
- showRehearsalSummary: boolean;
9291
- setShowRehearsalSummary: React.Dispatch<React.SetStateAction<boolean>>;
9292
- rehearsalPaused: boolean;
9293
- recordCurrentSlideTime: (slideIndex: number) => void;
9294
- dismissRehearsalSummary: () => void;
9295
- saveRehearsalTimings: () => void;
9296
- enterRehearsalMode: () => void;
9297
- toggleRehearsalPause: () => void;
9298
- }
9299
- declare function useRehearsalTimings(input: UseRehearsalTimingsInput): UseRehearsalTimingsResult;
9300
- //#endregion
9301
- //#region src/viewer/hooks/presentation-mode/usePresentationKeyboard.d.ts
9302
- interface UsePresentationKeyboardInput {
9303
- mode: ViewerMode;
9304
- movePresentationSlide: (direction: 1 | -1) => void;
9305
- onSetMode: (mode: ViewerMode) => void;
9306
- onToggleLaser?: () => void;
9307
- onTogglePen?: () => void;
9308
- onToggleEraser?: () => void;
9309
- onToggleToolbar?: () => void;
9310
- /** Toggle between presenter view (split-screen with notes) and fullscreen. */
9311
- onTogglePresenterView?: () => void;
9312
- onToggleBlackScreen?: () => void;
9313
- onToggleWhiteScreen?: () => void;
9314
- rehearsing: boolean;
9315
- recordCurrentSlideTime: (slideIndex: number) => void;
9316
- presentationSlideIndex: number;
9317
- setShowRehearsalSummary: (value: boolean) => void;
9318
- }
9319
- /**
9320
- * Registers keyboard shortcuts for presentation mode: arrow/space
9321
- * for slide navigation, Escape to exit, and annotation tool toggles.
9322
- */
9323
- declare function usePresentationKeyboard(input: UsePresentationKeyboardInput): void;
9324
- //#endregion
9325
- //#region src/viewer/hooks/presentation-mode/useSlideNavigation.d.ts
9326
- interface UseSlideNavigationInput {
9327
- slides: PptxSlide[];
9328
- visibleSlideIndexes: number[];
9329
- presentationSlideIndex: number;
9330
- setPresentationSlideIndex: (index: number) => void;
9331
- setPresentationSlideVisible: (visible: boolean) => void;
9332
- setTransitionOverlay: (state: PresentationTransitionOverlayState | null) => void;
9333
- onSetMode: (mode: ViewerMode) => void;
9334
- onSetActiveSlideIndex: (index: number) => void;
9335
- onPlayActionSound?: (soundPath: string) => void;
9336
- loopContinuously?: boolean;
9337
- /** Whether to use rehearsed auto-advance timings. When false, slides advance only on click. */
9338
- useTimings?: boolean;
9339
- /**
9340
- * Fired when the user advances past the last slide (no loop, no rehearsal).
9341
- * The presentation-mode hook uses it for PowerPoint's "End with black
9342
- * slide" behavior. When absent, advancing past the end clamps as before.
9343
- */
9344
- onAdvancePastLastSlide?: () => void;
9345
- playNextAnimationGroup: () => boolean;
9346
- clearPresentationTimers: () => void;
9347
- runPresentationEntranceAnimations: (slideIndex: number) => void;
9348
- presentationTimersRef: {
9349
- current: number[];
9350
- };
9351
- rehearsing: boolean;
9352
- recordCurrentSlideTime: (slideIndex: number) => void;
9353
- setShowRehearsalSummary: (value: boolean) => void;
9354
- }
9355
- interface UseSlideNavigationResult {
9356
- movePresentationSlide: (direction: 1 | -1, trigger?: SlideAdvanceTrigger) => void;
9357
- navigateToSlide: (slideIndex: number) => void;
9358
- handlePresentationAction: (action: PptxAction) => void;
9359
- scheduleAutoAdvanceForSlide: (slideIndex: number) => void;
9360
- }
9361
- declare function useSlideNavigation(input: UseSlideNavigationInput): UseSlideNavigationResult;
9362
- interface UsePresenterWindowInput {
9363
- currentSlideIndex: number;
9364
- isPresenterMode: boolean;
9365
- /** Raw PPTX bytes to share with the audience tab via IndexedDB. */
9366
- content?: ArrayBuffer | Uint8Array | null;
9367
- snapshot: PresentationSnapshot;
9368
- }
9369
- interface UsePresenterWindowResult {
9370
- openAudienceWindow: () => boolean;
9371
- closeAudienceWindow: () => void;
9372
- isAudienceWindowOpen: () => boolean;
9373
- syncSlideToAudience: (slideIndex: number) => void;
9374
- syncStateToAudience: (snapshot: PresentationSnapshot) => void;
9375
- swapDisplays: () => Promise<boolean>;
9376
- }
9377
- declare function usePresenterWindow(input: UsePresenterWindowInput): UsePresenterWindowResult;
9378
- //#endregion
9379
- //#region src/viewer/hooks/presentation-mode/useAudienceMode.d.ts
9380
- interface UseAudienceModeInput {
9381
- mode: ViewerMode;
9382
- onSetMode: (mode: ViewerMode) => void;
9383
- onSetActiveSlideIndex: (index: number) => void;
9384
- containerRef: React.RefObject<HTMLElement | null>;
9385
- onSnapshot?: (snapshot: PresentationSnapshot) => void;
9386
- }
9387
- /**
9388
- * When the page was opened with the `#pptx-audience` hash, this hook:
9389
- * 1. Auto-enters fullscreen presentation mode after content loads
9390
- * 2. Listens on BroadcastChannel for slide-change messages from the presenter
9391
- * 3. Exits presentation mode when the presenter sends an exit signal
9392
- */
9393
- declare function useAudienceMode(input: UseAudienceModeInput): void;
9394
-
9395
- //#region src/viewer/hooks/useAutosave.d.ts
9396
- type AutosaveStatus = {
9397
- state: 'idle';
9398
- } | {
9399
- state: 'disabled';
9400
- reason: string;
9401
- } | {
9402
- state: 'saving';
9403
- } | {
9404
- state: 'saved';
9405
- timestamp: number;
9406
- } | {
9407
- state: 'error';
9408
- message: string;
9409
- };
9410
- interface UseAutosaveInput {
9411
- /** Whether the document has unsaved changes. */
9412
- isDirty: boolean;
9413
- /** File path or name of the currently-open PPTX. Required for autosave to work. */
9414
- filePath: string | undefined;
9415
- /** Serialise current editor state to a Uint8Array. */
9416
- serializeSlides: () => Promise<Uint8Array | null>;
9417
- /** Autosave interval in seconds (default 120). */
9418
- intervalSeconds?: number;
9419
- /** Whether autosave is enabled. */
9420
- enabled?: boolean;
9421
- }
9422
- interface UseAutosaveResult {
9423
- /** Current autosave status for display in the StatusBar. */
9424
- autosaveStatus: AutosaveStatus;
9425
- /** Manually trigger an autosave right now. */
9426
- triggerAutosave: () => Promise<void>;
9427
- }
9428
- declare function useAutosave(input: UseAutosaveInput): UseAutosaveResult;
9429
- //#endregion
9430
- //#region src/viewer/utils/table-band-style.d.ts
9431
- /** Context for resolving table style colours from the theme. */
9432
- interface TableStyleContext {
9433
- tableStyleMap?: ParsedTableStyleMap;
9434
- theme?: PptxTheme;
9435
- }
9436
- //#endregion
9437
- //#region src/viewer/components/canvas/canvas-types.d.ts
9438
- interface ZoomViewport {
9439
- canvasViewportRef: React$1.RefObject<HTMLDivElement | null>;
9440
- editWrapperRef: React$1.RefObject<HTMLDivElement | null>;
9441
- canvasStageRef: React$1.RefObject<HTMLDivElement | null>;
9442
- editorScale: number;
9443
- }
9444
- interface SlideCanvasProps {
9445
- activeSlide: PptxSlide | undefined;
9446
- templateElements: PptxElement[];
9447
- canvasSize: CanvasSize;
9448
- zoom: ZoomViewport;
9449
- mode: ViewerMode;
9450
- canEdit: boolean;
9451
- editTemplateMode: boolean;
9452
- selectedElementIdSet: Set<string>;
9453
- selectedElement: PptxElement | null;
9454
- inlineEditingElementId: string | null;
9455
- inlineEditingText: string;
9456
- spellCheckEnabled: boolean;
9457
- mediaDataUrls: Map<string, string>;
9458
- tableEditorState: TableCellEditorState | null;
9459
- marqueeSelectionState: MarqueeSelectionState | null;
9460
- snapLines: Array<{
9461
- axis: string;
9462
- position: number;
9463
- }>;
9464
- showGrid: boolean;
9465
- /** Grid spacing in CSS px (derived from PPTX gridSpacing EMUs). */
9466
- gridSpacingPx?: number;
9467
- showRulers: boolean;
9468
- /** Unit system for rulers (default: inches). */
9469
- rulerUnit?: RulerUnit;
9470
- guides: Array<{
9471
- id: string;
9472
- axis: 'h' | 'v';
9473
- position: number;
9474
- }>;
9475
- presentationElementStates?: Map<string, ElementAnimationState>;
9476
- presentationKeyframesCss?: string;
9477
- onClick: (elementId: string, e: React$1.MouseEvent) => void;
9478
- onDoubleClick: (elementId: string, e: React$1.MouseEvent) => void;
9479
- onMouseDown: (elementId: string, e: React$1.MouseEvent) => void;
9480
- onContextMenu: (elementId: string, e: React$1.MouseEvent) => void;
9481
- /** Called when the user presses mouse down on empty canvas space. */
9482
- onCanvasMouseDown?: (e: React$1.MouseEvent) => void;
9483
- onResizePointerDown: (elementId: string, e: React$1.MouseEvent, handle: string) => void;
9484
- onAdjustmentPointerDown: (elementId: string, e: React$1.MouseEvent) => void;
9485
- /** Commit a new rotation (degrees) when the on-canvas rotate handle is dragged. */
9486
- onRotate?: (elementId: string, rotationDeg: number) => void;
9487
- onInlineEditChange: (text: string) => void;
9488
- onInlineEditCommit: () => void;
9489
- onInlineEditCancel: () => void;
9490
- onTableCellSelect: (cell: Omit<TableCellEditorState, 'elementId'> | null, elementId: string) => void;
9491
- /** Called when an edited table cell should be committed. */
9492
- onCommitCellEdit?: (elementId: string, rowIndex: number, colIndex: number, text: string) => void;
9493
- /**
9494
- * Commit a partial update to a SmartArt element from inline (on-canvas) node
9495
- * editing. Routed to the same element-update path the inspector uses (undo/redo
9496
- * + dirty marking). When absent, inline SmartArt editing is disabled.
9497
- */
9498
- onUpdateSmartArtElement?: (elementId: string, updates: Partial<PptxElement>) => void;
9499
- /**
9500
- * Apply a text-style toggle (Ctrl/Cmd+B/I/U) to the element being
9501
- * inline-edited. Routed to the same updateSelectedTextStyle path as the
9502
- * toolbar. When absent, the inline formatting shortcuts are inert.
9503
- */
9504
- onFormatText?: (updates: Partial<TextStyle>) => void;
9505
- /** Called when table column widths are resized. */
9506
- onResizeTableColumns?: (elementId: string, newWidths: number[]) => void;
9507
- /** Called when a table row is resized. */
9508
- onResizeTableRow?: (elementId: string, rowIndex: number, newHeight: number) => void;
9509
- /** Find & Replace results (all matches across all slides). */
9510
- findResults?: Array<{
9511
- slideIndex: number;
9512
- elementId: string;
9513
- segmentIndex: number;
9514
- startOffset: number;
9515
- length: number;
9516
- }>;
9517
- /** Index of the currently focused find result (-1 for none). */
9518
- findResultIndex?: number;
9519
- /** Index of the currently visible slide (needed to filter find results). */
9520
- activeSlideIndex?: number;
9521
- /** Currently active drawing tool ("select" means no drawing overlay). */
9522
- activeTool?: DrawingTool;
9523
- /** Stroke colour for pen / highlighter. */
9524
- drawingColor?: string;
9525
- /** Stroke width for pen / highlighter. */
9526
- drawingWidth?: number;
9527
- /** Ref that is true while a pointer stroke is in progress. */
9528
- isDrawingRef?: React$1.RefObject<boolean>;
9529
- /** Called when a completed ink stroke should be added to the slide. */
9530
- onAddInkElement?: (ink: InkPptxElement) => void;
9531
- /** Called when a freeform drawing stroke should be added as a shape element. */
9532
- onAddFreeformShape?: (shape: ShapePptxElement) => void;
9533
- /** Called when the eraser tool removes an ink element. */
9534
- onEraseInkElement?: (elementId: string) => void;
9535
- /** Called when a shape-level action is clicked (e.g. slide jump, URL). */
9536
- onActionClick?: (elementId: string, action: PptxAction) => void;
9537
- /** Called when a text-level hyperlink is clicked. */
9538
- onHyperlinkClick?: (url: string) => void;
9539
- /** Comments for the current slide (used for on-canvas markers). */
9540
- comments?: PptxComment[];
9541
- /** Whether to show comment markers on the slide canvas. */
9542
- showCommentMarkers?: boolean;
9543
- /** Called when a comment marker is clicked. */
9544
- onCommentMarkerClick?: (commentId: string) => void;
9545
- onMoveGuide?: (guideId: string, position: number) => void;
9546
- onDeleteGuide?: (guideId: string) => void;
9547
- onCreateGuideFromRuler?: (axis: 'h' | 'v', positionPx: number) => void;
9548
- /** When true, shows connection sites on shapes and enables connector drawing. */
9549
- connectorCreationMode?: boolean;
9550
- /** Called when a new connector is created between two shapes. */
9551
- onCreateConnector?: (connector: ConnectorPptxElement) => void;
9552
- /** All slides in the presentation (for zoom element thumbnails). */
9553
- allSlides?: readonly PptxSlide[];
9554
- /** Callback fired when a zoom element is clicked in presentation mode. */
9555
- onZoomClick?: (targetSlideIndex: number, returnSlideIndex: number) => void;
9556
- /** Index of the current slide (for zoom return navigation). */
9557
- sourceSlideIndex?: number;
9558
- /** Context for text field placeholder substitution (slide number, header/footer, etc.). */
9559
- fieldContext?: FieldSubstitutionContext;
9560
- /** Theme + table style map for resolving table band/header colours. */
9561
- tableStyleContext?: TableStyleContext;
9562
- /** Optional collaboration cursor overlay rendered on top of the canvas. */
9563
- collaborationOverlay?: React$1.ReactNode;
9564
- }
9565
- //#endregion
9566
- //#region src/viewer/components/toolbar/toolbar-types.d.ts
9567
- interface ToolbarProps {
9568
- fileName?: string;
9569
- mode: ViewerMode;
9570
- canEdit: boolean;
9571
- isNarrowViewport: boolean;
9572
- isSidebarCollapsed: boolean;
9573
- isInspectorPaneOpen: boolean;
9574
- isCompactToolbarOpen: boolean;
9575
- toolbarSection: ToolbarSection;
9576
- scale: number;
9577
- canUndo: boolean;
9578
- canRedo: boolean;
9579
- undoLabel: string | undefined;
9580
- redoLabel: string | undefined;
9581
- findReplaceOpen: boolean;
9582
- selectedElement: PptxElement | null;
9583
- tableEditorState?: TableCellEditorState | null;
9584
- editTemplateMode: boolean;
9585
- newShapeType: SupportedShapeType;
9586
- activeTool: DrawingTool;
9587
- drawingColor: string;
9588
- drawingWidth: number;
9589
- clipboardPayload: ElementClipboardPayload | null;
9590
- onSetMode: (mode: ViewerMode) => void;
9591
- onToggleSidebar: () => void;
9592
- onToggleInspector: () => void;
9593
- /** Opens the inspector pane and switches to the properties tab (for animation panel). */
9594
- onOpenAnimationPanel: () => void;
9595
- /** Adds an animation preset to the selected element. */
9596
- onAddAnimation?: (preset: string, group: 'entrance' | 'emphasis' | 'exit') => void;
9597
- /** Removes all animations from the selected element. */
9598
- onRemoveAnimation?: () => void;
9599
- onToggleCompactToolbar: () => void;
9600
- onSetToolbarSection: (section: ToolbarSection) => void;
9601
- onZoomIn: () => void;
9602
- onZoomOut: () => void;
9603
- onZoomToFit: () => void;
9604
- onUndo: () => void;
9605
- onRedo: () => void;
9606
- onToggleFindReplace: () => void;
9607
- onSetNewShapeType: (type: SupportedShapeType) => void;
9608
- onAddTextBox: () => void;
9609
- onAddShape: () => void;
9610
- onAddTable: () => void;
9611
- onAddChart?: (chartType: PptxChartType) => void;
9612
- onAddSmartArt: () => void;
9613
- onAddEquation: () => void;
9614
- onAddActionButton: (shapeType: string) => void;
9615
- onInsertField?: (fieldType: string, value?: string) => void;
9616
- onOpenHeaderFooter?: () => void;
9617
- onOpenImagePicker: () => void;
9618
- onOpenMediaPicker: () => void;
9619
- onSetActiveTool: (tool: DrawingTool) => void;
9620
- onSetDrawingColor: (color: string) => void;
9621
- onSetDrawingWidth: (width: number) => void;
9622
- onSetEditTemplateMode: (mode: boolean) => void;
9623
- spellCheckEnabled: boolean;
9624
- showGrid: boolean;
9625
- showRulers: boolean;
9626
- snapToGrid: boolean;
9627
- snapToShape: boolean;
9628
- onSetSpellCheckEnabled: (enabled: boolean) => void;
9629
- onSetShowGrid: (enabled: boolean) => void;
9630
- onSetShowRulers: (enabled: boolean) => void;
9631
- onSetSnapToGrid: (enabled: boolean) => void;
9632
- onSetSnapToShape: (enabled: boolean) => void;
9633
- onAddGuide: (axis: 'h' | 'v') => void;
9634
- onAlignElements: (align: string) => void;
9635
- onDistributeElements: (axis: string) => void;
9636
- canDistribute: boolean;
9637
- onCopy: () => void;
9638
- onCut: () => void;
9639
- onPaste: () => void;
9640
- onFlip: (direction: 'horizontal' | 'vertical') => void;
9641
- onMoveLayer: (direction: string) => void;
9642
- onMoveLayerToEdge: (direction: string) => void;
9643
- onDuplicate: () => void;
9644
- onDelete: () => void;
9645
- /** Open another presentation (File ▸ Open). Hidden when not provided. */
9646
- onOpenFile?: () => void;
9647
- onOpenRecentFile?: (key: string) => void;
9648
- onCreatePresentation: (templateId: string) => void;
9649
- onExportPng: () => void;
9650
- onExportPdf: () => void;
9651
- onExportVideo: () => void;
9652
- onExportGif: () => void;
9653
- onPackageForSharing: () => void;
9654
- onOpenShareDialog?: () => void;
9655
- onSaveAsPptx: () => void;
9656
- onSaveAsPpsx: () => void;
9657
- onSaveAsPptm: () => void;
9658
- hasMacros: boolean;
9659
- onCopySlideAsImage: () => void;
9660
- onPrint: () => void;
9661
- onToggleShortcuts: () => void;
9662
- onOpenSettings?: () => void;
9663
- onRunAccessibilityCheck: () => void;
9664
- onToggleSlideSorter: () => void;
9665
- onUpdateTextStyle: (updates: Partial<TextStyle>) => void;
9666
- /** Rewrite the selected text's characters (PowerPoint's Aa "Change Case" dropdown). */
9667
- onTransformTextCase: (mode: ChangeCaseMode) => void;
9668
- isOverflowMenuOpen: boolean;
9669
- onSetOverflowMenuOpen: (open: boolean) => void;
9670
- layoutOptions: Array<{
9671
- path: string;
9672
- name: string;
9673
- }>;
9674
- onInsertSlideFromLayout: (path: string, name?: string) => void;
9675
- customShows: PptxCustomShow[];
9676
- activeCustomShowId: string | null;
9677
- onSetActiveCustomShowId: (id: string | null) => void;
9678
- onCreateCustomShow: () => void;
9679
- onRenameActiveCustomShow: () => void;
9680
- onDeleteActiveCustomShow: () => void;
9681
- onToggleCurrentSlideInActiveShow: () => void;
9682
- isCurrentSlideInActiveShow: boolean;
9683
- onToggleVersionHistory?: () => void;
9684
- onOpenPasswordProtection?: () => void;
9685
- onOpenDocumentProperties?: () => void;
9686
- onOpenFontEmbedding?: () => void;
9687
- onOpenDigitalSignatures?: () => void;
9688
- onEnterMasterView: () => void;
9689
- onCloseMasterView: () => void;
9690
- onEnterPresenterView?: () => void;
9691
- onEnterRehearsalMode?: () => void;
9692
- onToggleThemeEditor: () => void;
9693
- isThemeEditorOpen: boolean;
9694
- onToggleThemeGallery: () => void;
9695
- isThemeGalleryOpen: boolean;
9696
- onCompare?: () => void;
9697
- onToggleComments?: () => void;
9698
- isCommentsPanelOpen?: boolean;
9699
- spellCheckActive?: boolean;
9700
- slideCommentCount?: number;
9701
- formatPainterActive?: boolean;
9702
- onToggleFormatPainter?: () => void;
9703
- canActivateFormatPainter?: boolean;
9704
- isSelectionPaneOpen?: boolean;
9705
- onToggleSelectionPane?: () => void;
9706
- eyedropperActive?: boolean;
9707
- onToggleEyedropper?: () => void;
9708
- onOpenSetUpSlideShow?: () => void;
9709
- onOpenBroadcastDialog?: () => void;
9710
- onToggleSubtitles?: () => void;
9711
- showSubtitles?: boolean;
9712
- activeSlide?: PptxSlide;
9713
- onTransitionChange: (updates: Partial<PptxSlideTransition>) => void;
9714
- onApplyTransitionToAll: () => void;
9715
- /** Host-supplied list of toolbar buttons/ribbon tabs to hide. See `PowerPointViewerProps.hiddenActions`. */
9716
- hiddenActions?: readonly ToolbarActionId[];
9898
+ templateElementsBySlideId: Record<string, PptxElement[]>;
9899
+ /** React state setter for slides. */
9900
+ setSlides: React.Dispatch<React.SetStateAction<PptxSlide[]>>;
9901
+ /** Whether collaboration is active (status === 'connected'). */
9902
+ isConnected: boolean;
9903
+ /**
9904
+ * Whether the provider completed its initial document sync. Local -> doc
9905
+ * writes are gated on this so a late joiner never seeds its bootstrap deck
9906
+ * into a room whose real content has not arrived yet. Defaults to true for
9907
+ * callers that manage sync readiness themselves.
9908
+ */
9909
+ isSynced?: boolean;
9910
+ /** Collaboration config (for role and write-back). */
9911
+ config?: Pick<CollaborationConfig, 'role' | 'onWriteBack' | 'writeBackDebounceMs'>;
9912
+ /**
9913
+ * Return the source PPTX bytes for write-back serialization. Only called
9914
+ * when role === 'owner' and onWriteBack is set.
9915
+ */
9916
+ getSourceBytes?: () => Uint8Array | null;
9917
+ /**
9918
+ * Monotonic counter bumped each time the content-load pipeline finishes
9919
+ * applying a parsed deck to viewer state. A local load that lands while the
9920
+ * shared doc already holds slides (a late joiner's bootstrap deck parsing
9921
+ * after the room state arrived) would silently clobber the synced slides;
9922
+ * each bump re-adopts the doc's slides when the room has content.
9923
+ */
9924
+ loadVersion?: number;
9717
9925
  }
9926
+ declare function useYjsDocumentSync({ doc, slides, templateElementsBySlideId, setSlides, isConnected, isSynced, config, getSourceBytes, loadVersion }: UseYjsDocumentSyncInput): void;
9718
9927
  //#endregion
9719
- //#region src/viewer/hooks/useViewerBuildingBlocks.d.ts
9720
- interface UseViewerBuildingBlocksInput {
9721
- /** PPTX content as ArrayBuffer/Uint8Array, or null/undefined while no file is loaded. */
9722
- content: ArrayBuffer | Uint8Array | null | undefined;
9723
- /** Whether editing actions are enabled. Defaults to false (view-only). */
9724
- canEdit?: boolean;
9725
- /** Original file path, used for autosave recovery. */
9726
- filePath?: string;
9727
- /** Display name for the toolbar's file-name-aware controls (e.g. title bar hosts build themselves). */
9728
- fileName?: string;
9729
- /** Whether the built-in autosave-to-localStorage recovery timer is active. Defaults to true. */
9730
- autosaveEnabled?: boolean;
9731
- /** Display name used as the author for comments. */
9732
- userName?: string;
9733
- /** Host-supplied list of toolbar buttons/ribbon tabs to hide. */
9734
- hiddenActions?: readonly ToolbarActionId[];
9735
- /** Imperative handle ref, exposing the same `PowerPointViewerHandle` API `PowerPointViewer` does. */
9736
- handle?: React.ForwardedRef<PowerPointViewerHandle>;
9737
- onContentChange?: (content: Uint8Array) => void;
9738
- onDirtyChange?: (dirty: boolean) => void;
9739
- onActiveSlideChange?: (index: number) => void;
9740
- onModeChange?: (mode: ViewerMode) => void;
9741
- onZoomChange?: (zoom: number) => void;
9742
- onSelectionChange?: (ids: string[]) => void;
9743
- onSlideCountChange?: (count: number) => void;
9744
- /** Fired by the toolbar's "Settings" button; the host owns rendering that dialog. */
9745
- onOpenSettings?: () => void;
9746
- /** Fired by the toolbar's "Header & Footer" button; the host owns rendering that panel. */
9747
- onOpenHeaderFooter?: () => void;
9748
- /** Fired by the toolbar's "Share" button; the host owns rendering that dialog. */
9749
- onOpenShareDialog?: () => void;
9928
+ //#region src/viewer/hooks/collaboration/useBroadcastFollower.d.ts
9929
+ interface UseBroadcastFollowerInput {
9930
+ /** The collaboration context (null when collaboration is disabled). */
9931
+ collab: CollaborationContextValue | null;
9932
+ /** Current local active slide index. */
9933
+ activeSlideIndex: number;
9934
+ /** Setter for the active slide index. */
9935
+ setActiveSlideIndex: (index: number) => void;
9936
+ /** Total number of slides (for bounds checking). */
9937
+ slideCount: number;
9938
+ /**
9939
+ * When true, auto-follow stands down (e.g. the local user is manually
9940
+ * following a specific peer via the follow bar). Defaults to false.
9941
+ */
9942
+ paused?: boolean;
9750
9943
  }
9751
- interface ViewerBuildingBlocksResult {
9752
- /** Flat, self-contained props for the standalone `<Toolbar>` component. */
9753
- toolbarProps: ToolbarProps;
9754
- /** Flat, self-contained props for the standalone `<SlideCanvas>` component. */
9755
- canvasProps: SlideCanvasProps;
9756
- /** Current viewer mode (edit, view, present, master). */
9944
+ declare function useBroadcastFollower({ collab, activeSlideIndex, setActiveSlideIndex, slideCount, paused }: UseBroadcastFollowerInput): void;
9945
+ //#endregion
9946
+ //#region src/viewer/hooks/collaboration/useFollowMode.d.ts
9947
+ interface UseFollowModeInput {
9948
+ /** The collaboration context (null when collaboration is disabled). */
9949
+ collab: CollaborationContextValue | null;
9950
+ /** Current local active slide index. */
9951
+ activeSlideIndex: number;
9952
+ /** Setter for the active slide index. */
9953
+ setActiveSlideIndex: (index: number) => void;
9954
+ /** Total number of slides (for bounds checking). */
9955
+ slideCount: number;
9956
+ }
9957
+ interface UseFollowModeResult {
9958
+ /** The clientId currently being followed, or null. */
9959
+ followedClientId: number | null;
9960
+ /** Follow the given peer, or `null` to stop following. */
9961
+ followUser: (clientId: number | null) => void;
9962
+ }
9963
+ declare function useFollowMode({ collab, activeSlideIndex, setActiveSlideIndex, slideCount }: UseFollowModeInput): UseFollowModeResult;
9964
+ //#endregion
9965
+ //#region src/viewer/hooks/presentation-mode/useAnimationPlayback.d.ts
9966
+ interface UseAnimationPlaybackInput {
9967
+ slides: PptxSlide[];
9968
+ onPlayActionSound?: (soundPath: string) => void;
9969
+ /** When false, all animations are skipped (elements shown immediately). */
9970
+ showWithAnimation?: boolean;
9971
+ }
9972
+ interface UseAnimationPlaybackResult {
9973
+ presentationAnimations: PresentationAnimationRuntime[];
9974
+ presentationElementStates: Map<string, ElementAnimationState>;
9975
+ presentationKeyframesCss: string;
9976
+ interactiveTriggerShapeIds: ReadonlySet<string>;
9977
+ hoverTriggerShapeIds: ReadonlySet<string>;
9978
+ clearPresentationTimers: () => void;
9979
+ playNextAnimationGroup: () => boolean;
9980
+ handleInteractiveShapeClick: (shapeId: string) => boolean;
9981
+ handleHoverStart: (shapeId: string) => boolean;
9982
+ handleHoverEnd: (shapeId: string) => void;
9983
+ runPresentationEntranceAnimations: (slideIndex: number) => void;
9984
+ /** Exposed so the orchestrator can schedule additional timers (e.g. auto-advance). */
9985
+ presentationTimersRef: React.RefObject<number[]>;
9986
+ }
9987
+ declare function useAnimationPlayback(input: UseAnimationPlaybackInput): UseAnimationPlaybackResult;
9988
+ //#endregion
9989
+ //#region src/viewer/hooks/presentation-mode/useRehearsalTimings.d.ts
9990
+ interface UseRehearsalTimingsInput {
9991
+ containerRef: React.RefObject<HTMLElement | null>;
9992
+ onSetMode: (mode: ViewerMode) => void;
9993
+ onSaveRehearsalTimings?: (timings: Record<number, number>) => void;
9994
+ setPresentationStartTime: (time: number | null) => void;
9995
+ setPresenterMode: (mode: boolean) => void;
9996
+ }
9997
+ interface UseRehearsalTimingsResult {
9998
+ rehearsing: boolean;
9999
+ setRehearsing: React.Dispatch<React.SetStateAction<boolean>>;
10000
+ recordedTimings: Record<number, number>;
10001
+ slideStartTime: number | null;
10002
+ showRehearsalSummary: boolean;
10003
+ setShowRehearsalSummary: React.Dispatch<React.SetStateAction<boolean>>;
10004
+ rehearsalPaused: boolean;
10005
+ recordCurrentSlideTime: (slideIndex: number) => void;
10006
+ dismissRehearsalSummary: () => void;
10007
+ saveRehearsalTimings: () => void;
10008
+ enterRehearsalMode: () => void;
10009
+ toggleRehearsalPause: () => void;
10010
+ }
10011
+ declare function useRehearsalTimings(input: UseRehearsalTimingsInput): UseRehearsalTimingsResult;
10012
+ //#endregion
10013
+ //#region src/viewer/hooks/presentation-mode/usePresentationKeyboard.d.ts
10014
+ interface UsePresentationKeyboardInput {
9757
10015
  mode: ViewerMode;
9758
- /** True while the initial parse of `content` is in progress. */
9759
- loading: boolean;
9760
- /** Parse error message, or null. */
9761
- error: string | null;
9762
- /** Current autosave-to-localStorage recovery status. */
9763
- autosaveStatus: AutosaveStatus;
10016
+ movePresentationSlide: (direction: 1 | -1) => void;
10017
+ onSetMode: (mode: ViewerMode) => void;
10018
+ onToggleLaser?: () => void;
10019
+ onTogglePen?: () => void;
10020
+ onToggleEraser?: () => void;
10021
+ onToggleToolbar?: () => void;
10022
+ /** Toggle between presenter view (split-screen with notes) and fullscreen. */
10023
+ onTogglePresenterView?: () => void;
10024
+ onToggleBlackScreen?: () => void;
10025
+ onToggleWhiteScreen?: () => void;
10026
+ rehearsing: boolean;
10027
+ recordCurrentSlideTime: (slideIndex: number) => void;
10028
+ presentationSlideIndex: number;
10029
+ setShowRehearsalSummary: (value: boolean) => void;
9764
10030
  }
9765
- declare function useViewerBuildingBlocks(input: UseViewerBuildingBlocksInput): ViewerBuildingBlocksResult;
10031
+ /**
10032
+ * Registers keyboard shortcuts for presentation mode: arrow/space
10033
+ * for slide navigation, Escape to exit, and annotation tool toggles.
10034
+ */
10035
+ declare function usePresentationKeyboard(input: UsePresentationKeyboardInput): void;
10036
+ //#endregion
10037
+ //#region src/viewer/hooks/presentation-mode/useSlideNavigation.d.ts
10038
+ interface UseSlideNavigationInput {
10039
+ slides: PptxSlide[];
10040
+ visibleSlideIndexes: number[];
10041
+ presentationSlideIndex: number;
10042
+ setPresentationSlideIndex: (index: number) => void;
10043
+ setPresentationSlideVisible: (visible: boolean) => void;
10044
+ setTransitionOverlay: (state: PresentationTransitionOverlayState | null) => void;
10045
+ onSetMode: (mode: ViewerMode) => void;
10046
+ onSetActiveSlideIndex: (index: number) => void;
10047
+ onPlayActionSound?: (soundPath: string) => void;
10048
+ loopContinuously?: boolean;
10049
+ /** Whether to use rehearsed auto-advance timings. When false, slides advance only on click. */
10050
+ useTimings?: boolean;
10051
+ /**
10052
+ * Fired when the user advances past the last slide (no loop, no rehearsal).
10053
+ * The presentation-mode hook uses it for PowerPoint's "End with black
10054
+ * slide" behavior. When absent, advancing past the end clamps as before.
10055
+ */
10056
+ onAdvancePastLastSlide?: () => void;
10057
+ playNextAnimationGroup: () => boolean;
10058
+ clearPresentationTimers: () => void;
10059
+ runPresentationEntranceAnimations: (slideIndex: number) => void;
10060
+ presentationTimersRef: {
10061
+ current: number[];
10062
+ };
10063
+ rehearsing: boolean;
10064
+ recordCurrentSlideTime: (slideIndex: number) => void;
10065
+ setShowRehearsalSummary: (value: boolean) => void;
10066
+ }
10067
+ interface UseSlideNavigationResult {
10068
+ movePresentationSlide: (direction: 1 | -1, trigger?: SlideAdvanceTrigger) => void;
10069
+ navigateToSlide: (slideIndex: number) => void;
10070
+ handlePresentationAction: (action: PptxAction) => void;
10071
+ scheduleAutoAdvanceForSlide: (slideIndex: number) => void;
10072
+ }
10073
+ declare function useSlideNavigation(input: UseSlideNavigationInput): UseSlideNavigationResult;
10074
+ interface UsePresenterWindowInput {
10075
+ currentSlideIndex: number;
10076
+ isPresenterMode: boolean;
10077
+ /** Raw PPTX bytes to share with the audience tab via IndexedDB. */
10078
+ content?: ArrayBuffer | Uint8Array | null;
10079
+ snapshot: PresentationSnapshot;
10080
+ }
10081
+ interface UsePresenterWindowResult {
10082
+ openAudienceWindow: () => boolean;
10083
+ closeAudienceWindow: () => void;
10084
+ isAudienceWindowOpen: () => boolean;
10085
+ syncSlideToAudience: (slideIndex: number) => void;
10086
+ syncStateToAudience: (snapshot: PresentationSnapshot) => void;
10087
+ swapDisplays: () => Promise<boolean>;
10088
+ }
10089
+ declare function usePresenterWindow(input: UsePresenterWindowInput): UsePresenterWindowResult;
10090
+ //#endregion
10091
+ //#region src/viewer/hooks/presentation-mode/useAudienceMode.d.ts
10092
+ interface UseAudienceModeInput {
10093
+ mode: ViewerMode;
10094
+ onSetMode: (mode: ViewerMode) => void;
10095
+ onSetActiveSlideIndex: (index: number) => void;
10096
+ containerRef: React.RefObject<HTMLElement | null>;
10097
+ onSnapshot?: (snapshot: PresentationSnapshot) => void;
10098
+ }
10099
+ /**
10100
+ * When the page was opened with the `#pptx-audience` hash, this hook:
10101
+ * 1. Auto-enters fullscreen presentation mode after content loads
10102
+ * 2. Listens on BroadcastChannel for slide-change messages from the presenter
10103
+ * 3. Exits presentation mode when the presenter sends an exit signal
10104
+ */
10105
+ declare function useAudienceMode(input: UseAudienceModeInput): void;
9766
10106
 
9767
10107
  //#region src/viewer/hooks/useEditorHistory.d.ts
9768
10108
  interface EditorHistoryInput {
@@ -10064,6 +10404,12 @@ interface ViewerCoreState {
10064
10404
  marqueeStateRef: React$1.MutableRefObject<MarqueeSelectionState | null>;
10065
10405
  /** Whether the user is currently performing a freeform drawing stroke. */
10066
10406
  isDrawingRef: React$1.MutableRefObject<boolean>;
10407
+ /**
10408
+ * Interim ("live preview") Y.Doc write channel. Drag/resize and inline
10409
+ * typing publish through it so remote peers see the gesture before it
10410
+ * commits to `slides`; dormant until collaboration attaches a doc.
10411
+ */
10412
+ livePatcher: CollaborationLivePatcher;
10067
10413
  /** Current viewer mode (edit, view, present, master, etc.). */
10068
10414
  mode: ViewerMode;
10069
10415
  setMode: React$1.Dispatch<React$1.SetStateAction<ViewerMode>>;
@@ -10496,6 +10842,13 @@ interface UsePointerHandlersInput {
10496
10842
  updateSlides: (updater: (s: PptxSlide[]) => PptxSlide[]) => void;
10497
10843
  updateElementById: (id: string, updates: Partial<PptxElement>) => void;
10498
10844
  markDirty: () => void;
10845
+ /**
10846
+ * Collaboration live-preview channel. Drag/resize write geometry straight to
10847
+ * the DOM (no React state churn per frame), so without this remote peers saw
10848
+ * nothing until pointer-up. Optional: absent in standalone building-block
10849
+ * compositions, dormant when not collaborating.
10850
+ */
10851
+ livePatcher?: CollaborationLivePatcher;
10499
10852
  }
10500
10853
  //#endregion
10501
10854
  //#region src/viewer/hooks/usePointerHandlers.d.ts
@@ -10829,6 +11182,15 @@ interface UseThemeHandlersInput {
10829
11182
  setSlideMasters: React.Dispatch<React.SetStateAction<Array<Record<string, unknown>>>>;
10830
11183
  slideMasters: Array<Record<string, unknown>>;
10831
11184
  history: EditorHistoryResult;
11185
+ /** Current live slides, re-coloured in place on a scheme-colour change. */
11186
+ setSlides: React.Dispatch<React.SetStateAction<PptxSlide[]>>;
11187
+ /** Current theme, used to derive the previous colour map for re-resolution. */
11188
+ theme: PptxTheme | undefined;
11189
+ /**
11190
+ * Force the history stack to capture the next slides change so an in-place
11191
+ * theme re-colour lands as a single undoable entry (mirrors the AI path).
11192
+ */
11193
+ bumpHistory: () => void;
10832
11194
  }
10833
11195
  interface ThemeHandlersResult {
10834
11196
  handleApplyTheme: (themePath: string, applyToAllMasters: boolean) => Promise<void>;
@@ -11343,6 +11705,8 @@ interface ViewerIntegrationResult {
11343
11705
  autosaveStatus: AutosaveStatus;
11344
11706
  isEncryptedDialogOpen: boolean;
11345
11707
  setIsEncryptedDialogOpen: Dispatch<SetStateAction<boolean>>;
11708
+ /** The loaded core handler, exposed for the AI bridge (`getHandler`). */
11709
+ handlerRef: RefObject<PptxHandler | null>;
11346
11710
  /**
11347
11711
  * Bumped each time the load pipeline finishes applying parsed content to
11348
11712
  * viewer state. Collaboration watches it to re-adopt the shared doc's