pptx-react-viewer 1.25.5 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/README.md +1 -1
- package/dist/AiChatPanel-BRGQCYZM.mjs +1087 -0
- package/dist/AiChatPanel-BRGQCYZM.mjs.br +0 -0
- package/dist/AiChatPanel-BRGQCYZM.mjs.gz +0 -0
- package/dist/AiChatPanel-PW5OT25Z.js +1089 -0
- package/dist/AiChatPanel-PW5OT25Z.js.br +0 -0
- package/dist/AiChatPanel-PW5OT25Z.js.gz +0 -0
- package/dist/{GLTFLoader-NMAS6VRH.mjs → GLTFLoader-374ZNTXW.mjs} +1 -1
- package/dist/GLTFLoader-374ZNTXW.mjs.br +0 -0
- package/dist/GLTFLoader-374ZNTXW.mjs.gz +0 -0
- package/dist/{GLTFLoader-GP55DVVS.js → GLTFLoader-Q7BHCGAW.js} +1 -1
- package/dist/GLTFLoader-Q7BHCGAW.js.br +0 -0
- package/dist/GLTFLoader-Q7BHCGAW.js.gz +0 -0
- package/dist/{Model3DScene-Y5ABLO7K.js → Model3DScene-JCGYRKXM.js} +4 -4
- package/dist/Model3DScene-JCGYRKXM.js.br +0 -0
- package/dist/Model3DScene-JCGYRKXM.js.gz +0 -0
- package/dist/{Model3DScene-XVYOISVJ.mjs → Model3DScene-TEF362W2.mjs} +3 -3
- package/dist/Model3DScene-TEF362W2.mjs.br +0 -0
- package/dist/Model3DScene-TEF362W2.mjs.gz +0 -0
- package/dist/{OrbitControls-VH6KILH7.js → OrbitControls-SMYCPLXO.js} +1 -1
- package/dist/OrbitControls-SMYCPLXO.js.br +3 -0
- package/dist/OrbitControls-SMYCPLXO.js.gz +0 -0
- package/dist/{OrbitControls-F5XPYD2Z.mjs → OrbitControls-ZTGHPI5G.mjs} +1 -1
- package/dist/OrbitControls-ZTGHPI5G.mjs.br +0 -0
- package/dist/{OrbitControls-F5XPYD2Z.mjs.gz → OrbitControls-ZTGHPI5G.mjs.gz} +0 -0
- package/dist/{PowerPointViewer-CnADroqZ.d.ts → PowerPointViewer-gmU5rc7K.d.ts} +2 -2
- package/dist/PowerPointViewer-gmU5rc7K.d.ts.map +1 -0
- package/dist/{SmartArt3DScene-WQIDFZ7X.mjs → SmartArt3DScene-XCFVGCXE.mjs} +1 -1
- package/dist/SmartArt3DScene-XCFVGCXE.mjs.br +0 -0
- package/dist/SmartArt3DScene-XCFVGCXE.mjs.gz +0 -0
- package/dist/{SmartArt3DScene-HCQBDRAM.js → SmartArt3DScene-ZO3KFDI2.js} +1 -1
- package/dist/SmartArt3DScene-ZO3KFDI2.js.br +0 -0
- package/dist/SmartArt3DScene-ZO3KFDI2.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-WMY5JTW4.js → SurfaceChart3DScene-2SHCYZVC.js} +4 -4
- package/dist/{SurfaceChart3DScene-WMY5JTW4.js.br → SurfaceChart3DScene-2SHCYZVC.js.br} +0 -0
- package/dist/SurfaceChart3DScene-2SHCYZVC.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-RXZADECL.mjs → SurfaceChart3DScene-UPDCIMJM.mjs} +3 -3
- package/dist/SurfaceChart3DScene-UPDCIMJM.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-UPDCIMJM.mjs.gz +0 -0
- package/dist/{animation-timeline-CEJJLFqK.d.ts → animation-timeline-eb5z0SHW.d.ts} +250 -8
- package/dist/animation-timeline-eb5z0SHW.d.ts.map +1 -0
- package/dist/{chunk-M3SIFXWD.mjs → chunk-2X72MOPZ.mjs} +65 -0
- package/dist/chunk-2X72MOPZ.mjs.br +0 -0
- package/dist/chunk-2X72MOPZ.mjs.gz +0 -0
- package/dist/{chunk-QGM4M3NI.js → chunk-4VNS5WPM.js} +5 -0
- package/dist/chunk-4VNS5WPM.js.br +0 -0
- package/dist/chunk-4VNS5WPM.js.gz +0 -0
- package/dist/{chunk-F4WPQRZU.mjs → chunk-5XLLRPMV.mjs} +6901 -14355
- package/dist/chunk-5XLLRPMV.mjs.br +0 -0
- package/dist/chunk-5XLLRPMV.mjs.gz +0 -0
- package/dist/{chunk-FOMF7POV.mjs → chunk-6YXLGMTN.mjs} +2493 -1588
- package/dist/chunk-6YXLGMTN.mjs.br +0 -0
- package/dist/chunk-6YXLGMTN.mjs.gz +0 -0
- package/dist/chunk-B6NRDUHJ.mjs +8029 -0
- package/dist/chunk-B6NRDUHJ.mjs.br +0 -0
- package/dist/chunk-B6NRDUHJ.mjs.gz +0 -0
- package/dist/chunk-BHVCED34.mjs +16664 -0
- package/dist/chunk-BHVCED34.mjs.br +0 -0
- package/dist/chunk-BHVCED34.mjs.gz +0 -0
- package/dist/{chunk-IPYAN574.js → chunk-CLNGAVNH.js} +2495 -1587
- package/dist/chunk-CLNGAVNH.js.br +0 -0
- package/dist/chunk-CLNGAVNH.js.gz +0 -0
- package/dist/{chunk-2EFVXYNA.js → chunk-CUUYYYC5.js} +65 -0
- package/dist/chunk-CUUYYYC5.js.br +0 -0
- package/dist/chunk-CUUYYYC5.js.gz +0 -0
- package/dist/{chunk-L4ZADJOM.mjs → chunk-L63RAVM7.mjs} +1285 -150
- package/dist/chunk-L63RAVM7.mjs.br +0 -0
- package/dist/chunk-L63RAVM7.mjs.gz +0 -0
- package/dist/{chunk-7CSBUYRN.js → chunk-LFXG7SGG.js} +2073 -938
- package/dist/chunk-LFXG7SGG.js.br +0 -0
- package/dist/chunk-LFXG7SGG.js.gz +0 -0
- package/dist/{chunk-TEN35NUX.js → chunk-OKOJVSKJ.js} +3512 -403
- package/dist/chunk-OKOJVSKJ.js.br +0 -0
- package/dist/chunk-OKOJVSKJ.js.gz +0 -0
- package/dist/{chunk-FVQDRA5N.mjs → chunk-R2N2UYT7.mjs} +3455 -362
- package/dist/chunk-R2N2UYT7.mjs.br +0 -0
- package/dist/chunk-R2N2UYT7.mjs.gz +0 -0
- package/dist/chunk-SYPHGLIB.js +16701 -0
- package/dist/chunk-SYPHGLIB.js.br +0 -0
- package/dist/chunk-SYPHGLIB.js.gz +0 -0
- package/dist/{chunk-6DZX6EAA.mjs → chunk-XGB3TDIC.mjs} +5 -1
- package/dist/chunk-XGB3TDIC.mjs.br +0 -0
- package/dist/chunk-XGB3TDIC.mjs.gz +0 -0
- package/dist/chunk-ZB4NZRCI.js +11111 -0
- package/dist/chunk-ZB4NZRCI.js.br +0 -0
- package/dist/chunk-ZB4NZRCI.js.gz +0 -0
- package/dist/chunk-ZKDE3HJI.js +8121 -0
- package/dist/chunk-ZKDE3HJI.js.br +0 -0
- package/dist/chunk-ZKDE3HJI.js.gz +0 -0
- package/dist/{dist-755SJ3ZH.js → dist-4LUVI3SW.js} +578 -566
- package/dist/dist-4LUVI3SW.js.br +0 -0
- package/dist/dist-4LUVI3SW.js.gz +0 -0
- package/dist/dist-J6PC54PZ.mjs +2 -0
- package/dist/dist-J6PC54PZ.mjs.br +0 -0
- package/dist/dist-J6PC54PZ.mjs.gz +0 -0
- package/dist/i18n.js +5 -5
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +2 -2
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/{index-J6IuHQ2_.d.ts → index-a8wcFjRJ.d.ts} +4 -4
- package/dist/{index-J6IuHQ2_.d.ts.map → index-a8wcFjRJ.d.ts.map} +1 -1
- package/dist/index.d.ts +3030 -220
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +41 -39
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +8 -6
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/{hooks-unstable.d.ts → internals.d.ts} +1238 -974
- package/dist/internals.d.ts.map +1 -0
- package/dist/{hooks-unstable.js → internals.js} +81 -80
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/{hooks-unstable.mjs → internals.mjs} +6 -5
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/{three.module-7CXEVRKB.mjs → three.module-AC7ESV4W.mjs} +1 -1
- package/dist/three.module-AC7ESV4W.mjs.br +0 -0
- package/dist/three.module-AC7ESV4W.mjs.gz +0 -0
- package/dist/{three.module-CPZZFD2Q.js → three.module-GNNNRIMK.js} +1 -1
- package/dist/three.module-GNNNRIMK.js.br +0 -0
- package/dist/three.module-GNNNRIMK.js.gz +0 -0
- package/dist/{useViewerBuildingBlocks-ll3_ncCH.d.ts → useViewerBuildingBlocks-CjureTRf.d.ts} +185 -174
- package/dist/useViewerBuildingBlocks-CjureTRf.d.ts.map +1 -0
- package/dist/viewer/index.d.ts +469 -52
- package/dist/viewer/index.d.ts.map +1 -1
- package/dist/viewer/index.js +35 -33
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +8 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/dist/{y-webrtc-6CRYHAXH.mjs → y-webrtc-DGVURJIF.mjs} +1 -1
- package/dist/y-webrtc-DGVURJIF.mjs.br +0 -0
- package/dist/y-webrtc-DGVURJIF.mjs.gz +0 -0
- package/dist/{y-webrtc-QCZF75JW.js → y-webrtc-YN53KW3J.js} +5 -5
- package/dist/y-webrtc-YN53KW3J.js.br +0 -0
- package/dist/y-webrtc-YN53KW3J.js.gz +0 -0
- package/dist/{y-websocket-QJEM6VOB.js → y-websocket-HZCIQLM6.js} +1 -1
- package/dist/y-websocket-HZCIQLM6.js.br +0 -0
- package/dist/y-websocket-HZCIQLM6.js.gz +0 -0
- package/dist/{y-websocket-57Q3RNHC.mjs → y-websocket-P5LTAJ5T.mjs} +1 -1
- package/dist/y-websocket-P5LTAJ5T.mjs.br +0 -0
- package/dist/y-websocket-P5LTAJ5T.mjs.gz +0 -0
- package/dist/{yjs-Y7IYUWOG.mjs → yjs-FKGX4QHS.mjs} +1 -1
- package/dist/yjs-FKGX4QHS.mjs.br +0 -0
- package/dist/yjs-FKGX4QHS.mjs.gz +0 -0
- package/dist/{yjs-UH3EPF3C.js → yjs-HBLSEMHP.js} +1 -1
- package/dist/yjs-HBLSEMHP.js.br +0 -0
- package/dist/yjs-HBLSEMHP.js.gz +0 -0
- package/package.json +19 -7
- package/dist/GLTFLoader-GP55DVVS.js.br +0 -0
- package/dist/GLTFLoader-GP55DVVS.js.gz +0 -0
- package/dist/GLTFLoader-NMAS6VRH.mjs.br +0 -0
- package/dist/GLTFLoader-NMAS6VRH.mjs.gz +0 -0
- package/dist/Model3DScene-XVYOISVJ.mjs.br +0 -0
- package/dist/Model3DScene-XVYOISVJ.mjs.gz +0 -0
- package/dist/Model3DScene-Y5ABLO7K.js.br +0 -0
- package/dist/Model3DScene-Y5ABLO7K.js.gz +0 -0
- package/dist/OrbitControls-F5XPYD2Z.mjs.br +0 -0
- package/dist/OrbitControls-VH6KILH7.js.br +0 -2
- package/dist/OrbitControls-VH6KILH7.js.gz +0 -0
- package/dist/PowerPointViewer-CnADroqZ.d.ts.map +0 -1
- package/dist/SmartArt3DScene-HCQBDRAM.js.br +0 -0
- package/dist/SmartArt3DScene-HCQBDRAM.js.gz +0 -0
- package/dist/SmartArt3DScene-WQIDFZ7X.mjs.br +0 -0
- package/dist/SmartArt3DScene-WQIDFZ7X.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-RXZADECL.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-RXZADECL.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-WMY5JTW4.js.gz +0 -0
- package/dist/animation-timeline-CEJJLFqK.d.ts.map +0 -1
- package/dist/chunk-2EFVXYNA.js.br +0 -0
- package/dist/chunk-2EFVXYNA.js.gz +0 -0
- package/dist/chunk-6DZX6EAA.mjs.br +0 -0
- package/dist/chunk-6DZX6EAA.mjs.gz +0 -0
- package/dist/chunk-7CSBUYRN.js.br +0 -0
- package/dist/chunk-7CSBUYRN.js.gz +0 -0
- package/dist/chunk-E55Q4AC7.js +0 -18639
- package/dist/chunk-E55Q4AC7.js.br +0 -0
- package/dist/chunk-E55Q4AC7.js.gz +0 -0
- package/dist/chunk-F4WPQRZU.mjs.br +0 -0
- package/dist/chunk-F4WPQRZU.mjs.gz +0 -0
- package/dist/chunk-FOMF7POV.mjs.br +0 -0
- package/dist/chunk-FOMF7POV.mjs.gz +0 -0
- package/dist/chunk-FVQDRA5N.mjs.br +0 -0
- package/dist/chunk-FVQDRA5N.mjs.gz +0 -0
- package/dist/chunk-IPYAN574.js.br +0 -0
- package/dist/chunk-IPYAN574.js.gz +0 -0
- package/dist/chunk-L4ZADJOM.mjs.br +0 -0
- package/dist/chunk-L4ZADJOM.mjs.gz +0 -0
- package/dist/chunk-M3SIFXWD.mjs.br +0 -0
- package/dist/chunk-M3SIFXWD.mjs.gz +0 -0
- package/dist/chunk-QGM4M3NI.js.br +0 -0
- package/dist/chunk-QGM4M3NI.js.gz +0 -0
- package/dist/chunk-TEN35NUX.js.br +0 -0
- package/dist/chunk-TEN35NUX.js.gz +0 -0
- package/dist/dist-755SJ3ZH.js.br +0 -0
- package/dist/dist-755SJ3ZH.js.gz +0 -0
- package/dist/dist-FFWP5NQZ.mjs +0 -2
- package/dist/dist-FFWP5NQZ.mjs.br +0 -0
- package/dist/dist-FFWP5NQZ.mjs.gz +0 -0
- package/dist/hooks-unstable.d.ts.map +0 -1
- package/dist/hooks-unstable.js.br +0 -0
- package/dist/hooks-unstable.js.gz +0 -0
- package/dist/hooks-unstable.mjs.br +0 -0
- package/dist/hooks-unstable.mjs.gz +0 -0
- package/dist/three.module-7CXEVRKB.mjs.br +0 -0
- package/dist/three.module-7CXEVRKB.mjs.gz +0 -0
- package/dist/three.module-CPZZFD2Q.js.br +0 -0
- package/dist/three.module-CPZZFD2Q.js.gz +0 -0
- package/dist/useViewerBuildingBlocks-ll3_ncCH.d.ts.map +0 -1
- package/dist/y-webrtc-6CRYHAXH.mjs.br +0 -0
- package/dist/y-webrtc-6CRYHAXH.mjs.gz +0 -0
- package/dist/y-webrtc-QCZF75JW.js.br +0 -0
- package/dist/y-webrtc-QCZF75JW.js.gz +0 -0
- package/dist/y-websocket-57Q3RNHC.mjs.br +0 -0
- package/dist/y-websocket-57Q3RNHC.mjs.gz +0 -0
- package/dist/y-websocket-QJEM6VOB.js.br +0 -0
- package/dist/y-websocket-QJEM6VOB.js.gz +0 -0
- package/dist/yjs-UH3EPF3C.js.br +0 -0
- package/dist/yjs-UH3EPF3C.js.gz +0 -0
- package/dist/yjs-Y7IYUWOG.mjs.br +0 -0
- 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 "./
|
|
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 "./
|
|
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
|
|
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`
|
|
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';
|
|
@@ -8740,1029 +8982,1040 @@ interface PowerPointViewerHandle extends FileViewerHandle, PowerPointViewerAPI {
|
|
|
8740
8982
|
getContent: () => Promise<Uint8Array>;
|
|
8741
8983
|
}
|
|
8742
8984
|
|
|
8743
|
-
//#region src/viewer/
|
|
8744
|
-
|
|
8745
|
-
|
|
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 {
|
|
8985
|
+
//#region src/viewer/components/toolbar/toolbar-types.d.ts
|
|
8986
|
+
interface ToolbarProps {
|
|
8987
|
+
fileName?: string;
|
|
8771
8988
|
mode: ViewerMode;
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8989
|
+
canEdit: boolean;
|
|
8990
|
+
isNarrowViewport: boolean;
|
|
8991
|
+
isSidebarCollapsed: boolean;
|
|
8992
|
+
isInspectorPaneOpen: boolean;
|
|
8993
|
+
isCompactToolbarOpen: boolean;
|
|
8994
|
+
toolbarSection: ToolbarSection;
|
|
8995
|
+
scale: number;
|
|
8996
|
+
canUndo: boolean;
|
|
8997
|
+
canRedo: boolean;
|
|
8998
|
+
undoLabel: string | undefined;
|
|
8999
|
+
redoLabel: string | undefined;
|
|
9000
|
+
findReplaceOpen: boolean;
|
|
9001
|
+
selectedElement: PptxElement | null;
|
|
9002
|
+
tableEditorState?: TableCellEditorState | null;
|
|
9003
|
+
editTemplateMode: boolean;
|
|
9004
|
+
newShapeType: SupportedShapeType;
|
|
9005
|
+
activeTool: DrawingTool;
|
|
9006
|
+
drawingColor: string;
|
|
9007
|
+
drawingWidth: number;
|
|
9008
|
+
clipboardPayload: ElementClipboardPayload | null;
|
|
8778
9009
|
onSetMode: (mode: ViewerMode) => void;
|
|
8779
|
-
|
|
8780
|
-
|
|
8781
|
-
|
|
8782
|
-
|
|
8783
|
-
|
|
8784
|
-
|
|
8785
|
-
|
|
8786
|
-
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
|
|
8792
|
-
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
|
|
8796
|
-
|
|
8797
|
-
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
8802
|
-
|
|
8803
|
-
|
|
8804
|
-
|
|
8805
|
-
|
|
8806
|
-
|
|
8807
|
-
|
|
8808
|
-
|
|
8809
|
-
|
|
8810
|
-
|
|
8811
|
-
|
|
8812
|
-
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
|
|
8818
|
-
|
|
8819
|
-
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
|
|
8823
|
-
|
|
8824
|
-
|
|
8825
|
-
|
|
8826
|
-
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
|
|
8831
|
-
|
|
8832
|
-
|
|
8833
|
-
|
|
8834
|
-
|
|
8835
|
-
|
|
8836
|
-
|
|
8837
|
-
|
|
8838
|
-
|
|
8839
|
-
|
|
8840
|
-
|
|
8841
|
-
|
|
8842
|
-
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
|
|
8852
|
-
|
|
8853
|
-
|
|
8854
|
-
|
|
8855
|
-
|
|
8856
|
-
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
|
|
8860
|
-
|
|
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>;
|
|
8898
|
-
}
|
|
8899
|
-
//#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;
|
|
8910
|
-
}
|
|
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>;
|
|
8919
|
-
/**
|
|
8920
|
-
* Apply a custom colour scheme (and optional font scheme) to the
|
|
8921
|
-
* current presentation.
|
|
8922
|
-
*/
|
|
8923
|
-
switchToCustom: (colorScheme: PptxThemeColorScheme, fontScheme?: PptxThemeFontScheme, themeName?: string) => Promise<void>;
|
|
8924
|
-
/**
|
|
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.
|
|
8927
|
-
*/
|
|
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;
|
|
8986
|
-
/**
|
|
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.
|
|
8994
|
-
*/
|
|
8995
|
-
emit(name: N, args: Array<any>): void;
|
|
8996
|
-
destroy(): void;
|
|
8997
|
-
}
|
|
8998
|
-
//#endregion
|
|
8999
|
-
//#region ../../node_modules/.bun/y-protocols@1.0.7+253afa400b9c0a30/node_modules/y-protocols/awareness.d.ts
|
|
9000
|
-
/**
|
|
9001
|
-
* @typedef {Object} MetaClientState
|
|
9002
|
-
* @property {number} MetaClientState.clock
|
|
9003
|
-
* @property {number} MetaClientState.lastUpdated unix timestamp
|
|
9004
|
-
*/
|
|
9005
|
-
/**
|
|
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>}
|
|
9022
|
-
*/
|
|
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
|
-
}>;
|
|
9040
|
-
/**
|
|
9041
|
-
* @type {Map<number, MetaClientState>}
|
|
9042
|
-
*/
|
|
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;
|
|
9057
|
-
/**
|
|
9058
|
-
* @param {string} field
|
|
9059
|
-
* @param {any} value
|
|
9060
|
-
*/
|
|
9061
|
-
setLocalStateField(field: string, value: any): void;
|
|
9062
|
-
/**
|
|
9063
|
-
* @return {Map<number,Object<string,any>>}
|
|
9064
|
-
*/
|
|
9065
|
-
getStates(): Map<number, {
|
|
9066
|
-
[x: string]: any;
|
|
9010
|
+
onToggleSidebar: () => void;
|
|
9011
|
+
onToggleInspector: () => void;
|
|
9012
|
+
/** Opens the inspector pane and switches to the properties tab (for animation panel). */
|
|
9013
|
+
onOpenAnimationPanel: () => void;
|
|
9014
|
+
/** Adds an animation preset to the selected element. */
|
|
9015
|
+
onAddAnimation?: (preset: string, group: 'entrance' | 'emphasis' | 'exit') => void;
|
|
9016
|
+
/** Removes all animations from the selected element. */
|
|
9017
|
+
onRemoveAnimation?: () => void;
|
|
9018
|
+
onToggleCompactToolbar: () => void;
|
|
9019
|
+
onSetToolbarSection: (section: ToolbarSection) => void;
|
|
9020
|
+
onZoomIn: () => void;
|
|
9021
|
+
onZoomOut: () => void;
|
|
9022
|
+
onZoomToFit: () => void;
|
|
9023
|
+
onUndo: () => void;
|
|
9024
|
+
onRedo: () => void;
|
|
9025
|
+
onToggleFindReplace: () => void;
|
|
9026
|
+
onSetNewShapeType: (type: SupportedShapeType) => void;
|
|
9027
|
+
onAddTextBox: () => void;
|
|
9028
|
+
onAddShape: () => void;
|
|
9029
|
+
onAddTable: () => void;
|
|
9030
|
+
onAddChart?: (chartType: PptxChartType) => void;
|
|
9031
|
+
onAddSmartArt: () => void;
|
|
9032
|
+
onAddEquation: () => void;
|
|
9033
|
+
onAddActionButton: (shapeType: string) => void;
|
|
9034
|
+
onInsertField?: (fieldType: string, value?: string) => void;
|
|
9035
|
+
onOpenHeaderFooter?: () => void;
|
|
9036
|
+
onOpenImagePicker: () => void;
|
|
9037
|
+
onOpenMediaPicker: () => void;
|
|
9038
|
+
onSetActiveTool: (tool: DrawingTool) => void;
|
|
9039
|
+
onSetDrawingColor: (color: string) => void;
|
|
9040
|
+
onSetDrawingWidth: (width: number) => void;
|
|
9041
|
+
onSetEditTemplateMode: (mode: boolean) => void;
|
|
9042
|
+
spellCheckEnabled: boolean;
|
|
9043
|
+
showGrid: boolean;
|
|
9044
|
+
showRulers: boolean;
|
|
9045
|
+
snapToGrid: boolean;
|
|
9046
|
+
snapToShape: boolean;
|
|
9047
|
+
onSetSpellCheckEnabled: (enabled: boolean) => void;
|
|
9048
|
+
onSetShowGrid: (enabled: boolean) => void;
|
|
9049
|
+
onSetShowRulers: (enabled: boolean) => void;
|
|
9050
|
+
onSetSnapToGrid: (enabled: boolean) => void;
|
|
9051
|
+
onSetSnapToShape: (enabled: boolean) => void;
|
|
9052
|
+
onAddGuide: (axis: 'h' | 'v') => void;
|
|
9053
|
+
onAlignElements: (align: string) => void;
|
|
9054
|
+
onDistributeElements: (axis: string) => void;
|
|
9055
|
+
canDistribute: boolean;
|
|
9056
|
+
onCopy: () => void;
|
|
9057
|
+
onCut: () => void;
|
|
9058
|
+
onPaste: () => void;
|
|
9059
|
+
onFlip: (direction: 'horizontal' | 'vertical') => void;
|
|
9060
|
+
onMoveLayer: (direction: string) => void;
|
|
9061
|
+
onMoveLayerToEdge: (direction: string) => void;
|
|
9062
|
+
onDuplicate: () => void;
|
|
9063
|
+
onDelete: () => void;
|
|
9064
|
+
/** Open another presentation (File ▸ Open). Hidden when not provided. */
|
|
9065
|
+
onOpenFile?: () => void;
|
|
9066
|
+
onOpenRecentFile?: (key: string) => void;
|
|
9067
|
+
onCreatePresentation: (templateId: string) => void;
|
|
9068
|
+
onExportPng: () => void;
|
|
9069
|
+
onExportPdf: () => void;
|
|
9070
|
+
onExportVideo: () => void;
|
|
9071
|
+
onExportGif: () => void;
|
|
9072
|
+
onPackageForSharing: () => void;
|
|
9073
|
+
onOpenShareDialog?: () => void;
|
|
9074
|
+
onSaveAsPptx: () => void;
|
|
9075
|
+
onSaveAsPpsx: () => void;
|
|
9076
|
+
onSaveAsPptm: () => void;
|
|
9077
|
+
hasMacros: boolean;
|
|
9078
|
+
onCopySlideAsImage: () => void;
|
|
9079
|
+
onPrint: () => void;
|
|
9080
|
+
onToggleShortcuts: () => void;
|
|
9081
|
+
onOpenSettings?: () => void;
|
|
9082
|
+
onRunAccessibilityCheck: () => void;
|
|
9083
|
+
onToggleSlideSorter: () => void;
|
|
9084
|
+
onUpdateTextStyle: (updates: Partial<TextStyle>) => void;
|
|
9085
|
+
/** Rewrite the selected text's characters (PowerPoint's Aa "Change Case" dropdown). */
|
|
9086
|
+
onTransformTextCase: (mode: ChangeCaseMode) => void;
|
|
9087
|
+
isOverflowMenuOpen: boolean;
|
|
9088
|
+
onSetOverflowMenuOpen: (open: boolean) => void;
|
|
9089
|
+
layoutOptions: Array<{
|
|
9090
|
+
path: string;
|
|
9091
|
+
name: string;
|
|
9067
9092
|
}>;
|
|
9093
|
+
onInsertSlideFromLayout: (path: string, name?: string) => void;
|
|
9094
|
+
customShows: PptxCustomShow[];
|
|
9095
|
+
activeCustomShowId: string | null;
|
|
9096
|
+
onSetActiveCustomShowId: (id: string | null) => void;
|
|
9097
|
+
onCreateCustomShow: () => void;
|
|
9098
|
+
onRenameActiveCustomShow: () => void;
|
|
9099
|
+
onDeleteActiveCustomShow: () => void;
|
|
9100
|
+
onToggleCurrentSlideInActiveShow: () => void;
|
|
9101
|
+
isCurrentSlideInActiveShow: boolean;
|
|
9102
|
+
onToggleVersionHistory?: () => void;
|
|
9103
|
+
onOpenPasswordProtection?: () => void;
|
|
9104
|
+
onOpenDocumentProperties?: () => void;
|
|
9105
|
+
onOpenFontEmbedding?: () => void;
|
|
9106
|
+
onOpenDigitalSignatures?: () => void;
|
|
9107
|
+
onEnterMasterView: () => void;
|
|
9108
|
+
onCloseMasterView: () => void;
|
|
9109
|
+
onEnterPresenterView?: () => void;
|
|
9110
|
+
onEnterRehearsalMode?: () => void;
|
|
9111
|
+
onToggleThemeEditor: () => void;
|
|
9112
|
+
isThemeEditorOpen: boolean;
|
|
9113
|
+
onToggleThemeGallery: () => void;
|
|
9114
|
+
isThemeGalleryOpen: boolean;
|
|
9115
|
+
onCompare?: () => void;
|
|
9116
|
+
onToggleComments?: () => void;
|
|
9117
|
+
isCommentsPanelOpen?: boolean;
|
|
9118
|
+
spellCheckActive?: boolean;
|
|
9119
|
+
slideCommentCount?: number;
|
|
9120
|
+
formatPainterActive?: boolean;
|
|
9121
|
+
onToggleFormatPainter?: () => void;
|
|
9122
|
+
canActivateFormatPainter?: boolean;
|
|
9123
|
+
isSelectionPaneOpen?: boolean;
|
|
9124
|
+
onToggleSelectionPane?: () => void;
|
|
9125
|
+
eyedropperActive?: boolean;
|
|
9126
|
+
onToggleEyedropper?: () => void;
|
|
9127
|
+
onOpenSetUpSlideShow?: () => void;
|
|
9128
|
+
onOpenBroadcastDialog?: () => void;
|
|
9129
|
+
onToggleSubtitles?: () => void;
|
|
9130
|
+
showSubtitles?: boolean;
|
|
9131
|
+
activeSlide?: PptxSlide;
|
|
9132
|
+
onTransitionChange: (updates: Partial<PptxSlideTransition>) => void;
|
|
9133
|
+
onApplyTransitionToAll: () => void;
|
|
9134
|
+
/** Host-supplied list of toolbar buttons/ribbon tabs to hide. See `PowerPointViewerProps.hiddenActions`. */
|
|
9135
|
+
hiddenActions?: readonly ToolbarActionId[];
|
|
9136
|
+
/** Whether the AI assistant is available (the host passed the `ai` prop). */
|
|
9137
|
+
aiEnabled?: boolean;
|
|
9138
|
+
/** Whether the AI assistant panel is currently open. */
|
|
9139
|
+
isAiPanelOpen?: boolean;
|
|
9140
|
+
/** Toggle the AI assistant panel. */
|
|
9141
|
+
onToggleAiPanel?: () => void;
|
|
9068
9142
|
}
|
|
9069
|
-
type MetaClientState = {
|
|
9070
|
-
clock: number;
|
|
9071
|
-
/**
|
|
9072
|
-
* unix timestamp
|
|
9073
|
-
*/
|
|
9074
|
-
lastUpdated: number;
|
|
9075
|
-
};
|
|
9076
|
-
//#endregion
|
|
9077
|
-
//#region src/viewer/hooks/collaboration/useYjsProvider.d.ts
|
|
9078
|
-
interface UseYjsProviderInput {
|
|
9079
|
-
/**
|
|
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.
|
|
9083
|
-
*/
|
|
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;
|
|
9095
|
-
/**
|
|
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).
|
|
9102
|
-
*/
|
|
9103
|
-
synced: boolean;
|
|
9104
|
-
/** Manually retry the connection after a timeout or error. */
|
|
9105
|
-
retry: () => void;
|
|
9106
|
-
}
|
|
9107
|
-
/**
|
|
9108
|
-
* Lazily loads `yjs` and `y-websocket`, creates a Y.Doc and
|
|
9109
|
-
* WebSocketProvider, and tracks the connection lifecycle.
|
|
9110
|
-
*
|
|
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.
|
|
9114
|
-
*
|
|
9115
|
-
* The Yjs packages are dynamically imported so they are fully
|
|
9116
|
-
* tree-shaken when collaboration is not enabled.
|
|
9117
|
-
*/
|
|
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;
|
|
9139
9143
|
//#endregion
|
|
9140
|
-
//#region src/viewer/
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
* tree shape; it produces a dormant value (no transport, empty presence)
|
|
9146
|
-
* while config is absent.
|
|
9147
|
-
*/
|
|
9148
|
-
config?: CollaborationConfig;
|
|
9149
|
-
canvasWidth: number;
|
|
9150
|
-
canvasHeight: number;
|
|
9144
|
+
//#region src/viewer/utils/table-band-style.d.ts
|
|
9145
|
+
/** Context for resolving table style colours from the theme. */
|
|
9146
|
+
interface TableStyleContext {
|
|
9147
|
+
tableStyleMap?: ParsedTableStyleMap;
|
|
9148
|
+
theme?: PptxTheme;
|
|
9151
9149
|
}
|
|
9152
|
-
declare function useCollaborativeState({ config, canvasWidth, canvasHeight }: UseCollaborativeStateInput): CollaborationContextValue | null;
|
|
9153
9150
|
//#endregion
|
|
9154
|
-
//#region src/viewer/
|
|
9155
|
-
interface
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9160
|
-
/** Standard history redo function. */
|
|
9161
|
-
handleRedo: () => void;
|
|
9162
|
-
/** Whether undo is available. */
|
|
9163
|
-
canUndo: boolean;
|
|
9164
|
-
/** Whether redo is available. */
|
|
9165
|
-
canRedo: boolean;
|
|
9166
|
-
}
|
|
9167
|
-
interface UseCollaborativeHistoryResult {
|
|
9168
|
-
/** Undo the last local change. */
|
|
9169
|
-
handleUndo: () => void;
|
|
9170
|
-
/** Redo the last undone local change. */
|
|
9171
|
-
handleRedo: () => void;
|
|
9172
|
-
/** Whether undo is available. */
|
|
9173
|
-
canUndo: boolean;
|
|
9174
|
-
/** Whether redo is available. */
|
|
9175
|
-
canRedo: boolean;
|
|
9151
|
+
//#region src/viewer/components/canvas/canvas-types.d.ts
|
|
9152
|
+
interface ZoomViewport {
|
|
9153
|
+
canvasViewportRef: React$1.RefObject<HTMLDivElement | null>;
|
|
9154
|
+
editWrapperRef: React$1.RefObject<HTMLDivElement | null>;
|
|
9155
|
+
canvasStageRef: React$1.RefObject<HTMLDivElement | null>;
|
|
9156
|
+
editorScale: number;
|
|
9176
9157
|
}
|
|
9177
|
-
|
|
9178
|
-
|
|
9179
|
-
|
|
9180
|
-
|
|
9181
|
-
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
|
|
9186
|
-
|
|
9187
|
-
|
|
9188
|
-
|
|
9189
|
-
|
|
9190
|
-
|
|
9191
|
-
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
|
|
9195
|
-
|
|
9196
|
-
|
|
9197
|
-
|
|
9198
|
-
/**
|
|
9199
|
-
|
|
9158
|
+
interface SlideCanvasProps {
|
|
9159
|
+
activeSlide: PptxSlide | undefined;
|
|
9160
|
+
templateElements: PptxElement[];
|
|
9161
|
+
canvasSize: CanvasSize;
|
|
9162
|
+
zoom: ZoomViewport;
|
|
9163
|
+
mode: ViewerMode;
|
|
9164
|
+
canEdit: boolean;
|
|
9165
|
+
editTemplateMode: boolean;
|
|
9166
|
+
selectedElementIdSet: Set<string>;
|
|
9167
|
+
selectedElement: PptxElement | null;
|
|
9168
|
+
inlineEditingElementId: string | null;
|
|
9169
|
+
inlineEditingText: string;
|
|
9170
|
+
spellCheckEnabled: boolean;
|
|
9171
|
+
mediaDataUrls: Map<string, string>;
|
|
9172
|
+
tableEditorState: TableCellEditorState | null;
|
|
9173
|
+
marqueeSelectionState: MarqueeSelectionState | null;
|
|
9174
|
+
snapLines: Array<{
|
|
9175
|
+
axis: string;
|
|
9176
|
+
position: number;
|
|
9177
|
+
}>;
|
|
9178
|
+
showGrid: boolean;
|
|
9179
|
+
/** Grid spacing in CSS px (derived from PPTX gridSpacing EMUs). */
|
|
9180
|
+
gridSpacingPx?: number;
|
|
9181
|
+
showRulers: boolean;
|
|
9182
|
+
/** Unit system for rulers (default: inches). */
|
|
9183
|
+
rulerUnit?: RulerUnit;
|
|
9184
|
+
guides: Array<{
|
|
9185
|
+
id: string;
|
|
9186
|
+
axis: 'h' | 'v';
|
|
9187
|
+
position: number;
|
|
9188
|
+
}>;
|
|
9189
|
+
presentationElementStates?: Map<string, ElementAnimationState>;
|
|
9190
|
+
presentationKeyframesCss?: string;
|
|
9191
|
+
onClick: (elementId: string, e: React$1.MouseEvent) => void;
|
|
9192
|
+
onDoubleClick: (elementId: string, e: React$1.MouseEvent) => void;
|
|
9193
|
+
onMouseDown: (elementId: string, e: React$1.MouseEvent) => void;
|
|
9194
|
+
onContextMenu: (elementId: string, e: React$1.MouseEvent) => void;
|
|
9195
|
+
/** Called when the user presses mouse down on empty canvas space. */
|
|
9196
|
+
onCanvasMouseDown?: (e: React$1.MouseEvent) => void;
|
|
9197
|
+
onResizePointerDown: (elementId: string, e: React$1.MouseEvent, handle: string) => void;
|
|
9198
|
+
onAdjustmentPointerDown: (elementId: string, e: React$1.MouseEvent) => void;
|
|
9199
|
+
/** Commit a new rotation (degrees) when the on-canvas rotate handle is dragged. */
|
|
9200
|
+
onRotate?: (elementId: string, rotationDeg: number) => void;
|
|
9201
|
+
onInlineEditChange: (text: string) => void;
|
|
9202
|
+
onInlineEditCommit: () => void;
|
|
9203
|
+
onInlineEditCancel: () => void;
|
|
9204
|
+
onTableCellSelect: (cell: Omit<TableCellEditorState, 'elementId'> | null, elementId: string) => void;
|
|
9205
|
+
/** Called when an edited table cell should be committed. */
|
|
9206
|
+
onCommitCellEdit?: (elementId: string, rowIndex: number, colIndex: number, text: string) => void;
|
|
9200
9207
|
/**
|
|
9201
|
-
*
|
|
9202
|
-
*
|
|
9208
|
+
* Commit a partial update to a SmartArt element from inline (on-canvas) node
|
|
9209
|
+
* editing. Routed to the same element-update path the inspector uses (undo/redo
|
|
9210
|
+
* + dirty marking). When absent, inline SmartArt editing is disabled.
|
|
9203
9211
|
*/
|
|
9204
|
-
|
|
9212
|
+
onUpdateSmartArtElement?: (elementId: string, updates: Partial<PptxElement>) => void;
|
|
9205
9213
|
/**
|
|
9206
|
-
*
|
|
9207
|
-
*
|
|
9208
|
-
*
|
|
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.
|
|
9214
|
+
* Apply a text-style toggle (Ctrl/Cmd+B/I/U) to the element being
|
|
9215
|
+
* inline-edited. Routed to the same updateSelectedTextStyle path as the
|
|
9216
|
+
* toolbar. When absent, the inline formatting shortcuts are inert.
|
|
9211
9217
|
*/
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
|
|
9215
|
-
|
|
9216
|
-
|
|
9217
|
-
|
|
9218
|
-
|
|
9219
|
-
|
|
9220
|
-
|
|
9221
|
-
|
|
9222
|
-
|
|
9223
|
-
|
|
9224
|
-
|
|
9225
|
-
|
|
9218
|
+
onFormatText?: (updates: Partial<TextStyle>) => void;
|
|
9219
|
+
/** Called when table column widths are resized. */
|
|
9220
|
+
onResizeTableColumns?: (elementId: string, newWidths: number[]) => void;
|
|
9221
|
+
/** Called when a table row is resized. */
|
|
9222
|
+
onResizeTableRow?: (elementId: string, rowIndex: number, newHeight: number) => void;
|
|
9223
|
+
/** Find & Replace results (all matches across all slides). */
|
|
9224
|
+
findResults?: Array<{
|
|
9225
|
+
slideIndex: number;
|
|
9226
|
+
elementId: string;
|
|
9227
|
+
segmentIndex: number;
|
|
9228
|
+
startOffset: number;
|
|
9229
|
+
length: number;
|
|
9230
|
+
}>;
|
|
9231
|
+
/** Index of the currently focused find result (-1 for none). */
|
|
9232
|
+
findResultIndex?: number;
|
|
9233
|
+
/** Index of the currently visible slide (needed to filter find results). */
|
|
9234
|
+
activeSlideIndex?: number;
|
|
9235
|
+
/** Currently active drawing tool ("select" means no drawing overlay). */
|
|
9236
|
+
activeTool?: DrawingTool;
|
|
9237
|
+
/** Stroke colour for pen / highlighter. */
|
|
9238
|
+
drawingColor?: string;
|
|
9239
|
+
/** Stroke width for pen / highlighter. */
|
|
9240
|
+
drawingWidth?: number;
|
|
9241
|
+
/** Ref that is true while a pointer stroke is in progress. */
|
|
9242
|
+
isDrawingRef?: React$1.RefObject<boolean>;
|
|
9243
|
+
/** Called when a completed ink stroke should be added to the slide. */
|
|
9244
|
+
onAddInkElement?: (ink: InkPptxElement) => void;
|
|
9245
|
+
/** Called when a freeform drawing stroke should be added as a shape element. */
|
|
9246
|
+
onAddFreeformShape?: (shape: ShapePptxElement) => void;
|
|
9247
|
+
/** Called when the eraser tool removes an ink element. */
|
|
9248
|
+
onEraseInkElement?: (elementId: string) => void;
|
|
9249
|
+
/** Called when a shape-level action is clicked (e.g. slide jump, URL). */
|
|
9250
|
+
onActionClick?: (elementId: string, action: PptxAction) => void;
|
|
9251
|
+
/** Called when a text-level hyperlink is clicked. */
|
|
9252
|
+
onHyperlinkClick?: (url: string) => void;
|
|
9253
|
+
/** Comments for the current slide (used for on-canvas markers). */
|
|
9254
|
+
comments?: PptxComment[];
|
|
9255
|
+
/** Whether to show comment markers on the slide canvas. */
|
|
9256
|
+
showCommentMarkers?: boolean;
|
|
9257
|
+
/** Called when a comment marker is clicked. */
|
|
9258
|
+
onCommentMarkerClick?: (commentId: string) => void;
|
|
9259
|
+
onMoveGuide?: (guideId: string, position: number) => void;
|
|
9260
|
+
onDeleteGuide?: (guideId: string) => void;
|
|
9261
|
+
onCreateGuideFromRuler?: (axis: 'h' | 'v', positionPx: number) => void;
|
|
9262
|
+
/** When true, shows connection sites on shapes and enables connector drawing. */
|
|
9263
|
+
connectorCreationMode?: boolean;
|
|
9264
|
+
/** Called when a new connector is created between two shapes. */
|
|
9265
|
+
onCreateConnector?: (connector: ConnectorPptxElement) => void;
|
|
9266
|
+
/** All slides in the presentation (for zoom element thumbnails). */
|
|
9267
|
+
allSlides?: readonly PptxSlide[];
|
|
9268
|
+
/** Callback fired when a zoom element is clicked in presentation mode. */
|
|
9269
|
+
onZoomClick?: (targetSlideIndex: number, returnSlideIndex: number) => void;
|
|
9270
|
+
/** Index of the current slide (for zoom return navigation). */
|
|
9271
|
+
sourceSlideIndex?: number;
|
|
9272
|
+
/** Context for text field placeholder substitution (slide number, header/footer, etc.). */
|
|
9273
|
+
fieldContext?: FieldSubstitutionContext;
|
|
9274
|
+
/** Theme + table style map for resolving table band/header colours. */
|
|
9275
|
+
tableStyleContext?: TableStyleContext;
|
|
9276
|
+
/** Optional collaboration cursor overlay rendered on top of the canvas. */
|
|
9277
|
+
collaborationOverlay?: React$1.ReactNode;
|
|
9226
9278
|
/**
|
|
9227
|
-
* When true,
|
|
9228
|
-
*
|
|
9279
|
+
* When true, the stage marks itself `data-pptx-ai-active` so element colour
|
|
9280
|
+
* changes tween while the AI assistant is working (see AiFocusHighlightOverlay).
|
|
9229
9281
|
*/
|
|
9230
|
-
|
|
9282
|
+
aiActive?: boolean;
|
|
9231
9283
|
}
|
|
9232
|
-
declare function useBroadcastFollower({ collab, activeSlideIndex, setActiveSlideIndex, slideCount, paused }: UseBroadcastFollowerInput): void;
|
|
9233
9284
|
//#endregion
|
|
9234
|
-
//#region src/viewer/hooks/
|
|
9235
|
-
|
|
9236
|
-
|
|
9237
|
-
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
|
|
9243
|
-
|
|
9285
|
+
//#region src/viewer/hooks/useAutosave.d.ts
|
|
9286
|
+
type AutosaveStatus = {
|
|
9287
|
+
state: 'idle';
|
|
9288
|
+
} | {
|
|
9289
|
+
state: 'disabled';
|
|
9290
|
+
reason: string;
|
|
9291
|
+
} | {
|
|
9292
|
+
state: 'saving';
|
|
9293
|
+
} | {
|
|
9294
|
+
state: 'saved';
|
|
9295
|
+
timestamp: number;
|
|
9296
|
+
} | {
|
|
9297
|
+
state: 'error';
|
|
9298
|
+
message: string;
|
|
9299
|
+
};
|
|
9300
|
+
interface UseAutosaveInput {
|
|
9301
|
+
/** Whether the document has unsaved changes. */
|
|
9302
|
+
isDirty: boolean;
|
|
9303
|
+
/** File path or name of the currently-open PPTX. Required for autosave to work. */
|
|
9304
|
+
filePath: string | undefined;
|
|
9305
|
+
/** Serialise current editor state to a Uint8Array. */
|
|
9306
|
+
serializeSlides: () => Promise<Uint8Array | null>;
|
|
9307
|
+
/** Autosave interval in seconds (default 120). */
|
|
9308
|
+
intervalSeconds?: number;
|
|
9309
|
+
/** Whether autosave is enabled. */
|
|
9310
|
+
enabled?: boolean;
|
|
9244
9311
|
}
|
|
9245
|
-
interface
|
|
9246
|
-
/**
|
|
9247
|
-
|
|
9248
|
-
/**
|
|
9249
|
-
|
|
9312
|
+
interface UseAutosaveResult {
|
|
9313
|
+
/** Current autosave status for display in the StatusBar. */
|
|
9314
|
+
autosaveStatus: AutosaveStatus;
|
|
9315
|
+
/** Manually trigger an autosave right now. */
|
|
9316
|
+
triggerAutosave: () => Promise<void>;
|
|
9250
9317
|
}
|
|
9251
|
-
declare function
|
|
9318
|
+
declare function useAutosave(input: UseAutosaveInput): UseAutosaveResult;
|
|
9252
9319
|
//#endregion
|
|
9253
|
-
//#region src/viewer/hooks/
|
|
9254
|
-
interface
|
|
9320
|
+
//#region src/viewer/hooks/useViewerBuildingBlocks.d.ts
|
|
9321
|
+
interface UseViewerBuildingBlocksInput {
|
|
9322
|
+
/** PPTX content as ArrayBuffer/Uint8Array, or null/undefined while no file is loaded. */
|
|
9323
|
+
content: ArrayBuffer | Uint8Array | null | undefined;
|
|
9324
|
+
/** Whether editing actions are enabled. Defaults to false (view-only). */
|
|
9325
|
+
canEdit?: boolean;
|
|
9326
|
+
/** Original file path, used for autosave recovery. */
|
|
9327
|
+
filePath?: string;
|
|
9328
|
+
/** Display name for the toolbar's file-name-aware controls (e.g. title bar hosts build themselves). */
|
|
9329
|
+
fileName?: string;
|
|
9330
|
+
/** Whether the built-in autosave-to-localStorage recovery timer is active. Defaults to true. */
|
|
9331
|
+
autosaveEnabled?: boolean;
|
|
9332
|
+
/** Display name used as the author for comments. */
|
|
9333
|
+
userName?: string;
|
|
9334
|
+
/** Host-supplied list of toolbar buttons/ribbon tabs to hide. */
|
|
9335
|
+
hiddenActions?: readonly ToolbarActionId[];
|
|
9336
|
+
/** Imperative handle ref, exposing the same `PowerPointViewerHandle` API `PowerPointViewer` does. */
|
|
9337
|
+
handle?: React.ForwardedRef<PowerPointViewerHandle>;
|
|
9338
|
+
onContentChange?: (content: Uint8Array) => void;
|
|
9339
|
+
onDirtyChange?: (dirty: boolean) => void;
|
|
9340
|
+
onActiveSlideChange?: (index: number) => void;
|
|
9341
|
+
onModeChange?: (mode: ViewerMode) => void;
|
|
9342
|
+
onZoomChange?: (zoom: number) => void;
|
|
9343
|
+
onSelectionChange?: (ids: string[]) => void;
|
|
9344
|
+
onSlideCountChange?: (count: number) => void;
|
|
9345
|
+
/** Fired by the toolbar's "Settings" button; the host owns rendering that dialog. */
|
|
9346
|
+
onOpenSettings?: () => void;
|
|
9347
|
+
/** Fired by the toolbar's "Header & Footer" button; the host owns rendering that panel. */
|
|
9348
|
+
onOpenHeaderFooter?: () => void;
|
|
9349
|
+
/** Fired by the toolbar's "Share" button; the host owns rendering that dialog. */
|
|
9350
|
+
onOpenShareDialog?: () => void;
|
|
9351
|
+
}
|
|
9352
|
+
interface ViewerBuildingBlocksResult {
|
|
9353
|
+
/** Flat, self-contained props for the standalone `<Toolbar>` component. */
|
|
9354
|
+
toolbarProps: ToolbarProps;
|
|
9355
|
+
/** Flat, self-contained props for the standalone `<SlideCanvas>` component. */
|
|
9356
|
+
canvasProps: SlideCanvasProps;
|
|
9357
|
+
/** Current viewer mode (edit, view, present, master). */
|
|
9358
|
+
mode: ViewerMode;
|
|
9359
|
+
/** True while the initial parse of `content` is in progress. */
|
|
9360
|
+
loading: boolean;
|
|
9361
|
+
/** Parse error message, or null. */
|
|
9362
|
+
error: string | null;
|
|
9363
|
+
/** Current autosave-to-localStorage recovery status. */
|
|
9364
|
+
autosaveStatus: AutosaveStatus;
|
|
9365
|
+
}
|
|
9366
|
+
declare function useViewerBuildingBlocks(input: UseViewerBuildingBlocksInput): ViewerBuildingBlocksResult;
|
|
9367
|
+
|
|
9368
|
+
//#region src/viewer/hooks/presentation-mode/types.d.ts
|
|
9369
|
+
/**
|
|
9370
|
+
* How a forward/backward slide advance was requested.
|
|
9371
|
+
*
|
|
9372
|
+
* - `'click'`: a click/tap on the slide surface (PowerPoint's "On Mouse Click"
|
|
9373
|
+
* advance). This is the only trigger governed by `advanceOnClick`.
|
|
9374
|
+
* - `'explicit'`: keyboard, navigation buttons, action triggers, and timed
|
|
9375
|
+
* auto-advance. These always navigate regardless of `advanceOnClick`, matching
|
|
9376
|
+
* PowerPoint (arrow keys / Next always work even when click-advance is off).
|
|
9377
|
+
*/
|
|
9378
|
+
type SlideAdvanceTrigger = 'click' | 'explicit';
|
|
9379
|
+
/**
|
|
9380
|
+
* State describing the transition overlay that plays while advancing into a
|
|
9381
|
+
* slide that carries a `p:transition`. The outgoing slide is snapshotted into
|
|
9382
|
+
* an animated overlay layer while the incoming slide renders underneath on the
|
|
9383
|
+
* main stage; the overlay tears down once `durationMs` elapses.
|
|
9384
|
+
*/
|
|
9385
|
+
interface PresentationTransitionOverlayState {
|
|
9386
|
+
/** Index of the leaving slide, rendered (animated) in the overlay layer. */
|
|
9387
|
+
outgoingSlideIndex: number;
|
|
9388
|
+
/** Index of the arriving slide, already live on the main stage. */
|
|
9389
|
+
incomingSlideIndex: number;
|
|
9390
|
+
/** The incoming slide's transition definition (drives the CSS animation). */
|
|
9391
|
+
transition: PptxSlideTransition;
|
|
9392
|
+
/** Resolved transition duration (ms). */
|
|
9393
|
+
durationMs: number;
|
|
9394
|
+
}
|
|
9395
|
+
interface UsePresentationModeInput {
|
|
9396
|
+
mode: ViewerMode;
|
|
9255
9397
|
slides: PptxSlide[];
|
|
9256
|
-
|
|
9257
|
-
|
|
9398
|
+
visibleSlideIndexes: number[];
|
|
9399
|
+
activeSlideIndex: number;
|
|
9400
|
+
containerRef: React.RefObject<HTMLElement | null>;
|
|
9401
|
+
/** Raw PPTX bytes: forwarded to audience window for content sharing. */
|
|
9402
|
+
content?: ArrayBuffer | Uint8Array | null;
|
|
9403
|
+
onSetMode: (mode: ViewerMode) => void;
|
|
9404
|
+
onSetActiveSlideIndex: (index: number) => void;
|
|
9405
|
+
/**
|
|
9406
|
+
* Play a sound file for an action/transition. When `options.loop` is true the
|
|
9407
|
+
* audio repeats until the next animation sound plays or the show exits
|
|
9408
|
+
* (used for transition sounds flagged with `soundLoop`).
|
|
9409
|
+
*/
|
|
9410
|
+
onPlayActionSound?: (soundPath: string, options?: {
|
|
9411
|
+
loop?: boolean;
|
|
9412
|
+
}) => void;
|
|
9413
|
+
/** Called when L key is pressed during presentation. */
|
|
9414
|
+
onToggleLaser?: () => void;
|
|
9415
|
+
/** Called when P key is pressed during presentation. */
|
|
9416
|
+
onTogglePen?: () => void;
|
|
9417
|
+
/** Called when E key is pressed during presentation. */
|
|
9418
|
+
onToggleEraser?: () => void;
|
|
9419
|
+
/** Called when Ctrl+M is pressed during presentation. */
|
|
9420
|
+
onToggleToolbar?: () => void;
|
|
9421
|
+
/** Called to persist rehearsal timings into slide transitions. */
|
|
9422
|
+
onSaveRehearsalTimings?: (timings: Record<number, number>) => void;
|
|
9423
|
+
/** Whether to loop continuously (kiosk or explicit loop setting). */
|
|
9424
|
+
loopContinuously?: boolean;
|
|
9425
|
+
/** Whether to play animations during the slide show (false = skip all animations). */
|
|
9258
9426
|
showWithAnimation?: boolean;
|
|
9427
|
+
/** Whether to use rehearsed auto-advance timings (false = manual advance only). */
|
|
9428
|
+
useTimings?: boolean;
|
|
9429
|
+
/**
|
|
9430
|
+
* Options > Advanced > "End with black slide". When true (PowerPoint's
|
|
9431
|
+
* default), advancing past the last slide shows a black end-of-show
|
|
9432
|
+
* screen; the next advance (or a click on it) exits. When false,
|
|
9433
|
+
* advancing past the last slide exits the show directly.
|
|
9434
|
+
*/
|
|
9435
|
+
endWithBlackSlide?: boolean;
|
|
9259
9436
|
}
|
|
9260
|
-
interface
|
|
9437
|
+
interface UsePresentationModeResult {
|
|
9438
|
+
presentationSlideIndex: number;
|
|
9439
|
+
setPresentationSlideIndex: (index: number) => void;
|
|
9440
|
+
presentationSlideVisible: boolean;
|
|
9441
|
+
/** Active slide-transition overlay, or `null` when no transition is playing. */
|
|
9442
|
+
transitionOverlay: PresentationTransitionOverlayState | null;
|
|
9443
|
+
/** Tear down the transition overlay once its animation completes. */
|
|
9444
|
+
handleTransitionOverlayComplete: () => void;
|
|
9261
9445
|
presentationAnimations: PresentationAnimationRuntime[];
|
|
9262
9446
|
presentationElementStates: Map<string, ElementAnimationState>;
|
|
9263
9447
|
presentationKeyframesCss: string;
|
|
9264
|
-
interactiveTriggerShapeIds: ReadonlySet<string>;
|
|
9265
|
-
hoverTriggerShapeIds: ReadonlySet<string>;
|
|
9266
9448
|
clearPresentationTimers: () => void;
|
|
9267
|
-
|
|
9449
|
+
runPresentationEntranceAnimations: (slideIndex: number) => void;
|
|
9450
|
+
/** True while the black "End of slide show" screen is displayed. */
|
|
9451
|
+
endOfShowVisible: boolean;
|
|
9452
|
+
movePresentationSlide: (direction: 1 | -1, trigger?: SlideAdvanceTrigger) => void;
|
|
9453
|
+
navigateToSlide: (slideIndex: number) => void;
|
|
9454
|
+
handlePresentationAction: (action: PptxAction) => void;
|
|
9455
|
+
/**
|
|
9456
|
+
* Handle a shape click in presentation mode. If the shape is an interactive
|
|
9457
|
+
* trigger, play its animation sequence. Returns `true` if handled.
|
|
9458
|
+
*/
|
|
9268
9459
|
handleInteractiveShapeClick: (shapeId: string) => boolean;
|
|
9460
|
+
/** Set of shape IDs that are interactive sequence triggers on the current slide. */
|
|
9461
|
+
interactiveTriggerShapeIds: ReadonlySet<string>;
|
|
9462
|
+
/** Set of shape IDs that are hover animation triggers on the current slide. */
|
|
9463
|
+
hoverTriggerShapeIds: ReadonlySet<string>;
|
|
9464
|
+
/** Handle hover start on a shape. If the shape has a hover sequence, play it. Returns `true` if handled. */
|
|
9269
9465
|
handleHoverStart: (shapeId: string) => boolean;
|
|
9466
|
+
/** Handle hover end on a shape. Resets the hover sequence for replay. */
|
|
9270
9467
|
handleHoverEnd: (shapeId: string) => void;
|
|
9271
|
-
|
|
9272
|
-
|
|
9273
|
-
|
|
9274
|
-
|
|
9275
|
-
|
|
9276
|
-
|
|
9277
|
-
|
|
9278
|
-
|
|
9279
|
-
|
|
9280
|
-
|
|
9281
|
-
|
|
9282
|
-
setPresentationStartTime: (time: number | null) => void;
|
|
9283
|
-
setPresenterMode: (mode: boolean) => void;
|
|
9284
|
-
}
|
|
9285
|
-
interface UseRehearsalTimingsResult {
|
|
9468
|
+
/** Must be called from a user-gesture handler (click) to satisfy browser fullscreen policy. */
|
|
9469
|
+
enterPresentMode: () => void;
|
|
9470
|
+
/** Whether presenter view (split-screen with notes) is active instead of fullscreen. */
|
|
9471
|
+
presenterMode: boolean;
|
|
9472
|
+
/** Enter presenter view mode (no fullscreen, shows notes panel). */
|
|
9473
|
+
enterPresenterView: () => void;
|
|
9474
|
+
/** Toggle between fullscreen and presenter view during presentation. */
|
|
9475
|
+
togglePresenterView: () => void;
|
|
9476
|
+
/** Timestamp (ms) when the presentation started: used for elapsed timer. */
|
|
9477
|
+
presentationStartTime: number | null;
|
|
9478
|
+
/** Whether the current presentation session is in rehearse-timings mode. */
|
|
9286
9479
|
rehearsing: boolean;
|
|
9287
|
-
|
|
9480
|
+
/** Enter rehearse-timings mode (fullscreen presentation + timing HUD). */
|
|
9481
|
+
enterRehearsalMode: () => void;
|
|
9482
|
+
/** Recorded timings in ms, keyed by slide index. Populated during rehearsal. */
|
|
9288
9483
|
recordedTimings: Record<number, number>;
|
|
9484
|
+
/** Timestamp when the current slide started (ms since epoch). */
|
|
9289
9485
|
slideStartTime: number | null;
|
|
9486
|
+
/** Whether the rehearsal summary dialog should be shown. */
|
|
9290
9487
|
showRehearsalSummary: boolean;
|
|
9291
|
-
|
|
9292
|
-
rehearsalPaused: boolean;
|
|
9293
|
-
recordCurrentSlideTime: (slideIndex: number) => void;
|
|
9488
|
+
/** Dismiss the rehearsal summary (discard timings). */
|
|
9294
9489
|
dismissRehearsalSummary: () => void;
|
|
9490
|
+
/** Save recorded timings into each slide's transition.advanceAfterMs. */
|
|
9295
9491
|
saveRehearsalTimings: () => void;
|
|
9296
|
-
|
|
9492
|
+
/** Whether rehearsal timer is paused. */
|
|
9493
|
+
rehearsalPaused: boolean;
|
|
9494
|
+
/** Toggle the rehearsal timer pause state. */
|
|
9297
9495
|
toggleRehearsalPause: () => void;
|
|
9496
|
+
/** Handle a zoom element click in presentation mode. */
|
|
9497
|
+
handleZoomClick: (targetSlideIndex: number, returnSlideIndex: number) => void;
|
|
9498
|
+
/** Ref holding the slide index to return to after zoom navigation. */
|
|
9499
|
+
zoomReturnSlideIndex: React.RefObject<number | null>;
|
|
9500
|
+
/** Navigate back to the zoom summary slide. Returns true if navigation occurred. */
|
|
9501
|
+
returnToZoomSlide: () => boolean;
|
|
9502
|
+
/** Clear the stored zoom return index. */
|
|
9503
|
+
clearZoomReturn: () => void;
|
|
9504
|
+
/** Open the audience display in a separate browser window. Returns `true` if successful. */
|
|
9505
|
+
openAudienceWindow: () => boolean;
|
|
9506
|
+
/** Close the audience display window. */
|
|
9507
|
+
closeAudienceWindow: () => void;
|
|
9508
|
+
/** Whether the audience window is currently open. */
|
|
9509
|
+
isAudienceWindowOpen: () => boolean;
|
|
9510
|
+
/** Send a slide index to the audience window explicitly. */
|
|
9511
|
+
syncSlideToAudience: (slideIndex: number) => void;
|
|
9512
|
+
syncStateToAudience: (snapshot: PresentationSnapshot) => void;
|
|
9513
|
+
presenterSnapshot: PresentationSnapshot;
|
|
9514
|
+
setPresenterBlackout: (blackout: PresentationSnapshot['blackout']) => void;
|
|
9515
|
+
togglePresenterTimer: () => void;
|
|
9516
|
+
resetPresenterTimer: () => void;
|
|
9517
|
+
stepPresenterZoom: (direction: 1 | -1) => void;
|
|
9518
|
+
resetPresenterZoom: () => void;
|
|
9519
|
+
setPresenterCaption: (caption: string) => void;
|
|
9520
|
+
setPresenterSubtitlesVisible: (visible: boolean) => void;
|
|
9521
|
+
updatePresenterSnapshot: (patch: Partial<PresentationSnapshot>) => void;
|
|
9522
|
+
swapPresenterDisplays: () => Promise<boolean>;
|
|
9298
9523
|
}
|
|
9299
|
-
declare function useRehearsalTimings(input: UseRehearsalTimingsInput): UseRehearsalTimingsResult;
|
|
9300
9524
|
//#endregion
|
|
9301
|
-
//#region src/viewer/hooks/
|
|
9302
|
-
interface
|
|
9303
|
-
|
|
9304
|
-
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
|
|
9308
|
-
|
|
9309
|
-
|
|
9310
|
-
|
|
9311
|
-
|
|
9312
|
-
|
|
9313
|
-
|
|
9314
|
-
|
|
9315
|
-
|
|
9316
|
-
|
|
9317
|
-
|
|
9525
|
+
//#region src/viewer/hooks/useThemeSwitching.d.ts
|
|
9526
|
+
interface UseThemeSwitchingInput {
|
|
9527
|
+
/** Ref to the PptxHandler instance. */
|
|
9528
|
+
handlerRef: RefObject<PptxHandler | null>;
|
|
9529
|
+
/** Current parsed presentation data (null when nothing is loaded). */
|
|
9530
|
+
data: PptxData | null;
|
|
9531
|
+
/** Callback to update the presentation data after theme switch. */
|
|
9532
|
+
onDataChange: (newData: PptxData) => void;
|
|
9533
|
+
/** Optional callback fired when theme switch completes successfully. */
|
|
9534
|
+
onThemeChanged?: (preset: PptxThemePreset) => void;
|
|
9535
|
+
}
|
|
9536
|
+
interface ThemeSwitchingResult {
|
|
9537
|
+
/** All available built-in theme presets. */
|
|
9538
|
+
presets: readonly PptxThemePreset[];
|
|
9539
|
+
/**
|
|
9540
|
+
* Apply a theme preset to the current presentation.
|
|
9541
|
+
* Updates both the in-memory ZIP and all resolved element colours.
|
|
9542
|
+
*/
|
|
9543
|
+
switchToPreset: (preset: PptxThemePreset) => Promise<void>;
|
|
9544
|
+
/**
|
|
9545
|
+
* Apply a custom colour scheme (and optional font scheme) to the
|
|
9546
|
+
* current presentation.
|
|
9547
|
+
*/
|
|
9548
|
+
switchToCustom: (colorScheme: PptxThemeColorScheme, fontScheme?: PptxThemeFontScheme, themeName?: string) => Promise<void>;
|
|
9549
|
+
/**
|
|
9550
|
+
* Get the preset matching the current presentation theme (if any).
|
|
9551
|
+
* Returns undefined if the current theme does not match a built-in preset.
|
|
9552
|
+
*/
|
|
9553
|
+
currentPreset: PptxThemePreset | undefined;
|
|
9554
|
+
}
|
|
9555
|
+
/**
|
|
9556
|
+
* React hook providing theme switching capabilities for the PowerPoint viewer.
|
|
9557
|
+
*
|
|
9558
|
+
* @example
|
|
9559
|
+
* ```tsx
|
|
9560
|
+
* const { presets, switchToPreset, currentPreset } = useThemeSwitching({
|
|
9561
|
+
* handlerRef,
|
|
9562
|
+
* data,
|
|
9563
|
+
* onDataChange: setData,
|
|
9564
|
+
* });
|
|
9565
|
+
*
|
|
9566
|
+
* return (
|
|
9567
|
+
* <div>
|
|
9568
|
+
* {presets.map(preset => (
|
|
9569
|
+
* <button
|
|
9570
|
+
* key={preset.id}
|
|
9571
|
+
* onClick={() => switchToPreset(preset)}
|
|
9572
|
+
* aria-pressed={preset.id === currentPreset?.id}
|
|
9573
|
+
* >
|
|
9574
|
+
* {preset.name}
|
|
9575
|
+
* </button>
|
|
9576
|
+
* ))}
|
|
9577
|
+
* </div>
|
|
9578
|
+
* );
|
|
9579
|
+
* ```
|
|
9580
|
+
*/
|
|
9581
|
+
declare function useThemeSwitching(input: UseThemeSwitchingInput): ThemeSwitchingResult;
|
|
9582
|
+
//#endregion
|
|
9583
|
+
//#region ../../node_modules/.bun/lib0@0.2.117/node_modules/lib0/observable.d.ts
|
|
9584
|
+
/**
|
|
9585
|
+
* Handles named events.
|
|
9586
|
+
*
|
|
9587
|
+
* @deprecated
|
|
9588
|
+
* @template N
|
|
9589
|
+
*/
|
|
9590
|
+
declare class Observable<N> {
|
|
9591
|
+
/**
|
|
9592
|
+
* Some desc.
|
|
9593
|
+
* @type {Map<N, any>}
|
|
9594
|
+
*/
|
|
9595
|
+
_observers: Map<N, any>;
|
|
9596
|
+
/**
|
|
9597
|
+
* @param {N} name
|
|
9598
|
+
* @param {function} f
|
|
9599
|
+
*/
|
|
9600
|
+
on(name: N, f: Function): void;
|
|
9601
|
+
/**
|
|
9602
|
+
* @param {N} name
|
|
9603
|
+
* @param {function} f
|
|
9604
|
+
*/
|
|
9605
|
+
once(name: N, f: Function): void;
|
|
9606
|
+
/**
|
|
9607
|
+
* @param {N} name
|
|
9608
|
+
* @param {function} f
|
|
9609
|
+
*/
|
|
9610
|
+
off(name: N, f: Function): void;
|
|
9611
|
+
/**
|
|
9612
|
+
* Emit a named event. All registered event listeners that listen to the
|
|
9613
|
+
* specified name will receive the event.
|
|
9614
|
+
*
|
|
9615
|
+
* @todo This should catch exceptions
|
|
9616
|
+
*
|
|
9617
|
+
* @param {N} name The event name.
|
|
9618
|
+
* @param {Array<any>} args The arguments that are applied to the event listener.
|
|
9619
|
+
*/
|
|
9620
|
+
emit(name: N, args: Array<any>): void;
|
|
9621
|
+
destroy(): void;
|
|
9622
|
+
}
|
|
9623
|
+
//#endregion
|
|
9624
|
+
//#region ../../node_modules/.bun/y-protocols@1.0.7+253afa400b9c0a30/node_modules/y-protocols/awareness.d.ts
|
|
9625
|
+
/**
|
|
9626
|
+
* @typedef {Object} MetaClientState
|
|
9627
|
+
* @property {number} MetaClientState.clock
|
|
9628
|
+
* @property {number} MetaClientState.lastUpdated unix timestamp
|
|
9629
|
+
*/
|
|
9630
|
+
/**
|
|
9631
|
+
* The Awareness class implements a simple shared state protocol that can be used for non-persistent data like awareness information
|
|
9632
|
+
* (cursor, username, status, ..). Each client can update its own local state and listen to state changes of
|
|
9633
|
+
* remote clients. Every client may set a state of a remote peer to `null` to mark the client as offline.
|
|
9634
|
+
*
|
|
9635
|
+
* Each client is identified by a unique client id (something we borrow from `doc.clientID`). A client can override
|
|
9636
|
+
* its own state by propagating a message with an increasing timestamp (`clock`). If such a message is received, it is
|
|
9637
|
+
* applied if the known state of that client is older than the new state (`clock < newClock`). If a client thinks that
|
|
9638
|
+
* a remote client is offline, it may propagate a message with
|
|
9639
|
+
* `{ clock: currentClientClock, state: null, client: remoteClient }`. If such a
|
|
9640
|
+
* message is received, and the known clock of that client equals the received clock, it will override the state with `null`.
|
|
9641
|
+
*
|
|
9642
|
+
* Before a client disconnects, it should propagate a `null` state with an updated clock.
|
|
9643
|
+
*
|
|
9644
|
+
* Awareness states must be updated every 30 seconds. Otherwise the Awareness instance will delete the client state.
|
|
9645
|
+
*
|
|
9646
|
+
* @extends {Observable<string>}
|
|
9647
|
+
*/
|
|
9648
|
+
declare class Awareness extends Observable<string> {
|
|
9649
|
+
/**
|
|
9650
|
+
* @param {Y.Doc} doc
|
|
9651
|
+
*/
|
|
9652
|
+
constructor(doc: Y.Doc);
|
|
9653
|
+
doc: Y.Doc;
|
|
9654
|
+
/**
|
|
9655
|
+
* @type {number}
|
|
9656
|
+
*/
|
|
9657
|
+
clientID: number;
|
|
9658
|
+
/**
|
|
9659
|
+
* Maps from client id to client state
|
|
9660
|
+
* @type {Map<number, Object<string, any>>}
|
|
9661
|
+
*/
|
|
9662
|
+
states: Map<number, {
|
|
9663
|
+
[x: string]: any;
|
|
9664
|
+
}>;
|
|
9665
|
+
/**
|
|
9666
|
+
* @type {Map<number, MetaClientState>}
|
|
9667
|
+
*/
|
|
9668
|
+
meta: Map<number, MetaClientState>;
|
|
9669
|
+
_checkInterval: any;
|
|
9670
|
+
/**
|
|
9671
|
+
* @return {Object<string,any>|null}
|
|
9672
|
+
*/
|
|
9673
|
+
getLocalState(): {
|
|
9674
|
+
[x: string]: any;
|
|
9675
|
+
} | null;
|
|
9676
|
+
/**
|
|
9677
|
+
* @param {Object<string,any>|null} state
|
|
9678
|
+
*/
|
|
9679
|
+
setLocalState(state: {
|
|
9680
|
+
[x: string]: any;
|
|
9681
|
+
} | null): void;
|
|
9682
|
+
/**
|
|
9683
|
+
* @param {string} field
|
|
9684
|
+
* @param {any} value
|
|
9685
|
+
*/
|
|
9686
|
+
setLocalStateField(field: string, value: any): void;
|
|
9687
|
+
/**
|
|
9688
|
+
* @return {Map<number,Object<string,any>>}
|
|
9689
|
+
*/
|
|
9690
|
+
getStates(): Map<number, {
|
|
9691
|
+
[x: string]: any;
|
|
9692
|
+
}>;
|
|
9318
9693
|
}
|
|
9319
|
-
|
|
9320
|
-
|
|
9321
|
-
|
|
9322
|
-
|
|
9323
|
-
|
|
9694
|
+
type MetaClientState = {
|
|
9695
|
+
clock: number;
|
|
9696
|
+
/**
|
|
9697
|
+
* unix timestamp
|
|
9698
|
+
*/
|
|
9699
|
+
lastUpdated: number;
|
|
9700
|
+
};
|
|
9324
9701
|
//#endregion
|
|
9325
|
-
//#region src/viewer/hooks/
|
|
9326
|
-
interface
|
|
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;
|
|
9702
|
+
//#region src/viewer/hooks/collaboration/useYjsProvider.d.ts
|
|
9703
|
+
interface UseYjsProviderInput {
|
|
9339
9704
|
/**
|
|
9340
|
-
*
|
|
9341
|
-
*
|
|
9342
|
-
*
|
|
9705
|
+
* Collaboration config, or `undefined` when collaboration is inactive. The
|
|
9706
|
+
* hook is always called (React hook rules) but stays fully dormant, never
|
|
9707
|
+
* opening a transport, while config is absent.
|
|
9343
9708
|
*/
|
|
9344
|
-
|
|
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>;
|
|
9709
|
+
config?: CollaborationConfig;
|
|
9376
9710
|
}
|
|
9377
|
-
|
|
9378
|
-
|
|
9379
|
-
|
|
9380
|
-
|
|
9381
|
-
|
|
9382
|
-
|
|
9383
|
-
|
|
9384
|
-
|
|
9385
|
-
|
|
9711
|
+
interface UseYjsProviderResult {
|
|
9712
|
+
/** Current WebSocket connection status. */
|
|
9713
|
+
status: ConnectionStatus;
|
|
9714
|
+
/** The Yjs awareness instance (null until connected). */
|
|
9715
|
+
awareness: Awareness | null;
|
|
9716
|
+
/** The Yjs document (null until initialised). */
|
|
9717
|
+
doc: Doc | null;
|
|
9718
|
+
/** Local awareness client ID. */
|
|
9719
|
+
clientId: number | null;
|
|
9720
|
+
/**
|
|
9721
|
+
* Whether the provider completed its initial document sync. Local doc
|
|
9722
|
+
* writes should be gated on this so a late joiner never seeds its
|
|
9723
|
+
* bootstrap deck into a room whose content has not arrived yet. Websocket
|
|
9724
|
+
* flips it on the provider's 'synced' event; webrtc flips it on peer sync
|
|
9725
|
+
* or after {@link INITIAL_SYNC_GRACE_MS} (a lone fresh-room peer never
|
|
9726
|
+
* receives a sync event).
|
|
9727
|
+
*/
|
|
9728
|
+
synced: boolean;
|
|
9729
|
+
/** Manually retry the connection after a timeout or error. */
|
|
9730
|
+
retry: () => void;
|
|
9386
9731
|
}
|
|
9387
9732
|
/**
|
|
9388
|
-
*
|
|
9389
|
-
*
|
|
9390
|
-
*
|
|
9391
|
-
*
|
|
9733
|
+
* Lazily loads `yjs` and `y-websocket`, creates a Y.Doc and
|
|
9734
|
+
* WebSocketProvider, and tracks the connection lifecycle.
|
|
9735
|
+
*
|
|
9736
|
+
* If the connection does not succeed within {@link CONNECTION_TIMEOUT_MS},
|
|
9737
|
+
* the provider is torn down and status moves to `'error'`. The consumer
|
|
9738
|
+
* can call `retry()` to attempt a fresh connection.
|
|
9739
|
+
*
|
|
9740
|
+
* The Yjs packages are dynamically imported so they are fully
|
|
9741
|
+
* tree-shaken when collaboration is not enabled.
|
|
9392
9742
|
*/
|
|
9393
|
-
declare function
|
|
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
|
-
}
|
|
9743
|
+
declare function useYjsProvider({ config }: UseYjsProviderInput): UseYjsProviderResult;
|
|
9436
9744
|
//#endregion
|
|
9437
|
-
//#region src/viewer/
|
|
9438
|
-
interface
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
|
|
9745
|
+
//#region src/viewer/hooks/collaboration/usePresenceTracking.d.ts
|
|
9746
|
+
interface UsePresenceTrackingInput {
|
|
9747
|
+
awareness: Awareness | null;
|
|
9748
|
+
localClientId: number | null;
|
|
9749
|
+
userName: string;
|
|
9750
|
+
userColor: string;
|
|
9751
|
+
userAvatar?: string;
|
|
9752
|
+
/** Role in the session (broadcaster, viewer, or collaborator). */
|
|
9753
|
+
role?: string;
|
|
9754
|
+
canvasWidth: number;
|
|
9755
|
+
canvasHeight: number;
|
|
9443
9756
|
}
|
|
9444
|
-
interface
|
|
9445
|
-
|
|
9446
|
-
|
|
9447
|
-
|
|
9448
|
-
|
|
9449
|
-
|
|
9450
|
-
|
|
9451
|
-
|
|
9452
|
-
|
|
9453
|
-
|
|
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;
|
|
9757
|
+
interface UsePresenceTrackingResult {
|
|
9758
|
+
/** Presence data for all remote users (excludes local). */
|
|
9759
|
+
remoteUsers: UserPresence[];
|
|
9760
|
+
/** Broadcast a partial presence update for the local user. */
|
|
9761
|
+
broadcastPresence: (update: Partial<Omit<UserPresence, 'clientId'>>) => void;
|
|
9762
|
+
}
|
|
9763
|
+
declare function usePresenceTracking({ awareness, localClientId, userName, userColor, userAvatar, role, canvasWidth, canvasHeight }: UsePresenceTrackingInput): UsePresenceTrackingResult;
|
|
9764
|
+
//#endregion
|
|
9765
|
+
//#region src/viewer/hooks/collaboration/useCollaborativeState.d.ts
|
|
9766
|
+
interface UseCollaborativeStateInput {
|
|
9499
9767
|
/**
|
|
9500
|
-
*
|
|
9501
|
-
*
|
|
9502
|
-
*
|
|
9768
|
+
* Collaboration config, or `undefined` when collaboration is inactive. The
|
|
9769
|
+
* hook is always called so the surrounding provider keeps a stable React
|
|
9770
|
+
* tree shape; it produces a dormant value (no transport, empty presence)
|
|
9771
|
+
* while config is absent.
|
|
9503
9772
|
*/
|
|
9504
|
-
|
|
9505
|
-
|
|
9506
|
-
|
|
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;
|
|
9773
|
+
config?: CollaborationConfig;
|
|
9774
|
+
canvasWidth: number;
|
|
9775
|
+
canvasHeight: number;
|
|
9564
9776
|
}
|
|
9777
|
+
declare function useCollaborativeState({ config, canvasWidth, canvasHeight }: UseCollaborativeStateInput): CollaborationContextValue | null;
|
|
9565
9778
|
//#endregion
|
|
9566
|
-
//#region src/viewer/
|
|
9567
|
-
interface
|
|
9568
|
-
|
|
9569
|
-
|
|
9570
|
-
|
|
9571
|
-
|
|
9572
|
-
|
|
9573
|
-
|
|
9574
|
-
|
|
9575
|
-
toolbarSection: ToolbarSection;
|
|
9576
|
-
scale: number;
|
|
9779
|
+
//#region src/viewer/hooks/collaboration/useCollaborativeHistory.d.ts
|
|
9780
|
+
interface UseCollaborativeHistoryInput {
|
|
9781
|
+
/** The local user's client ID (from Yjs awareness). */
|
|
9782
|
+
localClientId: number | null;
|
|
9783
|
+
/** Standard history undo function. */
|
|
9784
|
+
handleUndo: () => void;
|
|
9785
|
+
/** Standard history redo function. */
|
|
9786
|
+
handleRedo: () => void;
|
|
9787
|
+
/** Whether undo is available. */
|
|
9577
9788
|
canUndo: boolean;
|
|
9789
|
+
/** Whether redo is available. */
|
|
9578
9790
|
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[];
|
|
9717
9791
|
}
|
|
9792
|
+
interface UseCollaborativeHistoryResult {
|
|
9793
|
+
/** Undo the last local change. */
|
|
9794
|
+
handleUndo: () => void;
|
|
9795
|
+
/** Redo the last undone local change. */
|
|
9796
|
+
handleRedo: () => void;
|
|
9797
|
+
/** Whether undo is available. */
|
|
9798
|
+
canUndo: boolean;
|
|
9799
|
+
/** Whether redo is available. */
|
|
9800
|
+
canRedo: boolean;
|
|
9801
|
+
}
|
|
9802
|
+
declare function useCollaborativeHistory({ localClientId: _localClientId, handleUndo, handleRedo, canUndo, canRedo }: UseCollaborativeHistoryInput): UseCollaborativeHistoryResult;
|
|
9803
|
+
//#endregion
|
|
9804
|
+
//#region src/viewer/hooks/collaboration/useYjsDocumentSync.d.ts
|
|
9805
|
+
interface UseYjsDocumentSyncInput {
|
|
9806
|
+
/** The Yjs document (from useYjsProvider). null when not collaborating. */
|
|
9807
|
+
doc: Doc | null;
|
|
9808
|
+
/** Current slides state. */
|
|
9809
|
+
slides: PptxSlide[];
|
|
9810
|
+
/** Separated master/layout (template) elements, merged back on write-back. */
|
|
9811
|
+
templateElementsBySlideId: Record<string, PptxElement[]>;
|
|
9812
|
+
/** React state setter for slides. */
|
|
9813
|
+
setSlides: React.Dispatch<React.SetStateAction<PptxSlide[]>>;
|
|
9814
|
+
/** Whether collaboration is active (status === 'connected'). */
|
|
9815
|
+
isConnected: boolean;
|
|
9816
|
+
/**
|
|
9817
|
+
* Whether the provider completed its initial document sync. Local -> doc
|
|
9818
|
+
* writes are gated on this so a late joiner never seeds its bootstrap deck
|
|
9819
|
+
* into a room whose real content has not arrived yet. Defaults to true for
|
|
9820
|
+
* callers that manage sync readiness themselves.
|
|
9821
|
+
*/
|
|
9822
|
+
isSynced?: boolean;
|
|
9823
|
+
/** Collaboration config (for role and write-back). */
|
|
9824
|
+
config?: Pick<CollaborationConfig, 'role' | 'onWriteBack' | 'writeBackDebounceMs'>;
|
|
9825
|
+
/**
|
|
9826
|
+
* Return the source PPTX bytes for write-back serialization. Only called
|
|
9827
|
+
* when role === 'owner' and onWriteBack is set.
|
|
9828
|
+
*/
|
|
9829
|
+
getSourceBytes?: () => Uint8Array | null;
|
|
9830
|
+
/**
|
|
9831
|
+
* Monotonic counter bumped each time the content-load pipeline finishes
|
|
9832
|
+
* applying a parsed deck to viewer state. A local load that lands while the
|
|
9833
|
+
* shared doc already holds slides (a late joiner's bootstrap deck parsing
|
|
9834
|
+
* after the room state arrived) would silently clobber the synced slides;
|
|
9835
|
+
* each bump re-adopts the doc's slides when the room has content.
|
|
9836
|
+
*/
|
|
9837
|
+
loadVersion?: number;
|
|
9838
|
+
}
|
|
9839
|
+
declare function useYjsDocumentSync({ doc, slides, templateElementsBySlideId, setSlides, isConnected, isSynced, config, getSourceBytes, loadVersion }: UseYjsDocumentSyncInput): void;
|
|
9718
9840
|
//#endregion
|
|
9719
|
-
//#region src/viewer/hooks/
|
|
9720
|
-
interface
|
|
9721
|
-
/**
|
|
9722
|
-
|
|
9723
|
-
/**
|
|
9724
|
-
|
|
9725
|
-
/**
|
|
9726
|
-
|
|
9727
|
-
/**
|
|
9728
|
-
|
|
9729
|
-
/**
|
|
9730
|
-
|
|
9731
|
-
|
|
9732
|
-
|
|
9733
|
-
|
|
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;
|
|
9841
|
+
//#region src/viewer/hooks/collaboration/useBroadcastFollower.d.ts
|
|
9842
|
+
interface UseBroadcastFollowerInput {
|
|
9843
|
+
/** The collaboration context (null when collaboration is disabled). */
|
|
9844
|
+
collab: CollaborationContextValue | null;
|
|
9845
|
+
/** Current local active slide index. */
|
|
9846
|
+
activeSlideIndex: number;
|
|
9847
|
+
/** Setter for the active slide index. */
|
|
9848
|
+
setActiveSlideIndex: (index: number) => void;
|
|
9849
|
+
/** Total number of slides (for bounds checking). */
|
|
9850
|
+
slideCount: number;
|
|
9851
|
+
/**
|
|
9852
|
+
* When true, auto-follow stands down (e.g. the local user is manually
|
|
9853
|
+
* following a specific peer via the follow bar). Defaults to false.
|
|
9854
|
+
*/
|
|
9855
|
+
paused?: boolean;
|
|
9750
9856
|
}
|
|
9751
|
-
|
|
9752
|
-
|
|
9753
|
-
|
|
9754
|
-
|
|
9755
|
-
|
|
9756
|
-
|
|
9857
|
+
declare function useBroadcastFollower({ collab, activeSlideIndex, setActiveSlideIndex, slideCount, paused }: UseBroadcastFollowerInput): void;
|
|
9858
|
+
//#endregion
|
|
9859
|
+
//#region src/viewer/hooks/collaboration/useFollowMode.d.ts
|
|
9860
|
+
interface UseFollowModeInput {
|
|
9861
|
+
/** The collaboration context (null when collaboration is disabled). */
|
|
9862
|
+
collab: CollaborationContextValue | null;
|
|
9863
|
+
/** Current local active slide index. */
|
|
9864
|
+
activeSlideIndex: number;
|
|
9865
|
+
/** Setter for the active slide index. */
|
|
9866
|
+
setActiveSlideIndex: (index: number) => void;
|
|
9867
|
+
/** Total number of slides (for bounds checking). */
|
|
9868
|
+
slideCount: number;
|
|
9869
|
+
}
|
|
9870
|
+
interface UseFollowModeResult {
|
|
9871
|
+
/** The clientId currently being followed, or null. */
|
|
9872
|
+
followedClientId: number | null;
|
|
9873
|
+
/** Follow the given peer, or `null` to stop following. */
|
|
9874
|
+
followUser: (clientId: number | null) => void;
|
|
9875
|
+
}
|
|
9876
|
+
declare function useFollowMode({ collab, activeSlideIndex, setActiveSlideIndex, slideCount }: UseFollowModeInput): UseFollowModeResult;
|
|
9877
|
+
//#endregion
|
|
9878
|
+
//#region src/viewer/hooks/presentation-mode/useAnimationPlayback.d.ts
|
|
9879
|
+
interface UseAnimationPlaybackInput {
|
|
9880
|
+
slides: PptxSlide[];
|
|
9881
|
+
onPlayActionSound?: (soundPath: string) => void;
|
|
9882
|
+
/** When false, all animations are skipped (elements shown immediately). */
|
|
9883
|
+
showWithAnimation?: boolean;
|
|
9884
|
+
}
|
|
9885
|
+
interface UseAnimationPlaybackResult {
|
|
9886
|
+
presentationAnimations: PresentationAnimationRuntime[];
|
|
9887
|
+
presentationElementStates: Map<string, ElementAnimationState>;
|
|
9888
|
+
presentationKeyframesCss: string;
|
|
9889
|
+
interactiveTriggerShapeIds: ReadonlySet<string>;
|
|
9890
|
+
hoverTriggerShapeIds: ReadonlySet<string>;
|
|
9891
|
+
clearPresentationTimers: () => void;
|
|
9892
|
+
playNextAnimationGroup: () => boolean;
|
|
9893
|
+
handleInteractiveShapeClick: (shapeId: string) => boolean;
|
|
9894
|
+
handleHoverStart: (shapeId: string) => boolean;
|
|
9895
|
+
handleHoverEnd: (shapeId: string) => void;
|
|
9896
|
+
runPresentationEntranceAnimations: (slideIndex: number) => void;
|
|
9897
|
+
/** Exposed so the orchestrator can schedule additional timers (e.g. auto-advance). */
|
|
9898
|
+
presentationTimersRef: React.RefObject<number[]>;
|
|
9899
|
+
}
|
|
9900
|
+
declare function useAnimationPlayback(input: UseAnimationPlaybackInput): UseAnimationPlaybackResult;
|
|
9901
|
+
//#endregion
|
|
9902
|
+
//#region src/viewer/hooks/presentation-mode/useRehearsalTimings.d.ts
|
|
9903
|
+
interface UseRehearsalTimingsInput {
|
|
9904
|
+
containerRef: React.RefObject<HTMLElement | null>;
|
|
9905
|
+
onSetMode: (mode: ViewerMode) => void;
|
|
9906
|
+
onSaveRehearsalTimings?: (timings: Record<number, number>) => void;
|
|
9907
|
+
setPresentationStartTime: (time: number | null) => void;
|
|
9908
|
+
setPresenterMode: (mode: boolean) => void;
|
|
9909
|
+
}
|
|
9910
|
+
interface UseRehearsalTimingsResult {
|
|
9911
|
+
rehearsing: boolean;
|
|
9912
|
+
setRehearsing: React.Dispatch<React.SetStateAction<boolean>>;
|
|
9913
|
+
recordedTimings: Record<number, number>;
|
|
9914
|
+
slideStartTime: number | null;
|
|
9915
|
+
showRehearsalSummary: boolean;
|
|
9916
|
+
setShowRehearsalSummary: React.Dispatch<React.SetStateAction<boolean>>;
|
|
9917
|
+
rehearsalPaused: boolean;
|
|
9918
|
+
recordCurrentSlideTime: (slideIndex: number) => void;
|
|
9919
|
+
dismissRehearsalSummary: () => void;
|
|
9920
|
+
saveRehearsalTimings: () => void;
|
|
9921
|
+
enterRehearsalMode: () => void;
|
|
9922
|
+
toggleRehearsalPause: () => void;
|
|
9923
|
+
}
|
|
9924
|
+
declare function useRehearsalTimings(input: UseRehearsalTimingsInput): UseRehearsalTimingsResult;
|
|
9925
|
+
//#endregion
|
|
9926
|
+
//#region src/viewer/hooks/presentation-mode/usePresentationKeyboard.d.ts
|
|
9927
|
+
interface UsePresentationKeyboardInput {
|
|
9757
9928
|
mode: ViewerMode;
|
|
9758
|
-
|
|
9759
|
-
|
|
9760
|
-
|
|
9761
|
-
|
|
9762
|
-
|
|
9763
|
-
|
|
9929
|
+
movePresentationSlide: (direction: 1 | -1) => void;
|
|
9930
|
+
onSetMode: (mode: ViewerMode) => void;
|
|
9931
|
+
onToggleLaser?: () => void;
|
|
9932
|
+
onTogglePen?: () => void;
|
|
9933
|
+
onToggleEraser?: () => void;
|
|
9934
|
+
onToggleToolbar?: () => void;
|
|
9935
|
+
/** Toggle between presenter view (split-screen with notes) and fullscreen. */
|
|
9936
|
+
onTogglePresenterView?: () => void;
|
|
9937
|
+
onToggleBlackScreen?: () => void;
|
|
9938
|
+
onToggleWhiteScreen?: () => void;
|
|
9939
|
+
rehearsing: boolean;
|
|
9940
|
+
recordCurrentSlideTime: (slideIndex: number) => void;
|
|
9941
|
+
presentationSlideIndex: number;
|
|
9942
|
+
setShowRehearsalSummary: (value: boolean) => void;
|
|
9764
9943
|
}
|
|
9765
|
-
|
|
9944
|
+
/**
|
|
9945
|
+
* Registers keyboard shortcuts for presentation mode: arrow/space
|
|
9946
|
+
* for slide navigation, Escape to exit, and annotation tool toggles.
|
|
9947
|
+
*/
|
|
9948
|
+
declare function usePresentationKeyboard(input: UsePresentationKeyboardInput): void;
|
|
9949
|
+
//#endregion
|
|
9950
|
+
//#region src/viewer/hooks/presentation-mode/useSlideNavigation.d.ts
|
|
9951
|
+
interface UseSlideNavigationInput {
|
|
9952
|
+
slides: PptxSlide[];
|
|
9953
|
+
visibleSlideIndexes: number[];
|
|
9954
|
+
presentationSlideIndex: number;
|
|
9955
|
+
setPresentationSlideIndex: (index: number) => void;
|
|
9956
|
+
setPresentationSlideVisible: (visible: boolean) => void;
|
|
9957
|
+
setTransitionOverlay: (state: PresentationTransitionOverlayState | null) => void;
|
|
9958
|
+
onSetMode: (mode: ViewerMode) => void;
|
|
9959
|
+
onSetActiveSlideIndex: (index: number) => void;
|
|
9960
|
+
onPlayActionSound?: (soundPath: string) => void;
|
|
9961
|
+
loopContinuously?: boolean;
|
|
9962
|
+
/** Whether to use rehearsed auto-advance timings. When false, slides advance only on click. */
|
|
9963
|
+
useTimings?: boolean;
|
|
9964
|
+
/**
|
|
9965
|
+
* Fired when the user advances past the last slide (no loop, no rehearsal).
|
|
9966
|
+
* The presentation-mode hook uses it for PowerPoint's "End with black
|
|
9967
|
+
* slide" behavior. When absent, advancing past the end clamps as before.
|
|
9968
|
+
*/
|
|
9969
|
+
onAdvancePastLastSlide?: () => void;
|
|
9970
|
+
playNextAnimationGroup: () => boolean;
|
|
9971
|
+
clearPresentationTimers: () => void;
|
|
9972
|
+
runPresentationEntranceAnimations: (slideIndex: number) => void;
|
|
9973
|
+
presentationTimersRef: {
|
|
9974
|
+
current: number[];
|
|
9975
|
+
};
|
|
9976
|
+
rehearsing: boolean;
|
|
9977
|
+
recordCurrentSlideTime: (slideIndex: number) => void;
|
|
9978
|
+
setShowRehearsalSummary: (value: boolean) => void;
|
|
9979
|
+
}
|
|
9980
|
+
interface UseSlideNavigationResult {
|
|
9981
|
+
movePresentationSlide: (direction: 1 | -1, trigger?: SlideAdvanceTrigger) => void;
|
|
9982
|
+
navigateToSlide: (slideIndex: number) => void;
|
|
9983
|
+
handlePresentationAction: (action: PptxAction) => void;
|
|
9984
|
+
scheduleAutoAdvanceForSlide: (slideIndex: number) => void;
|
|
9985
|
+
}
|
|
9986
|
+
declare function useSlideNavigation(input: UseSlideNavigationInput): UseSlideNavigationResult;
|
|
9987
|
+
interface UsePresenterWindowInput {
|
|
9988
|
+
currentSlideIndex: number;
|
|
9989
|
+
isPresenterMode: boolean;
|
|
9990
|
+
/** Raw PPTX bytes to share with the audience tab via IndexedDB. */
|
|
9991
|
+
content?: ArrayBuffer | Uint8Array | null;
|
|
9992
|
+
snapshot: PresentationSnapshot;
|
|
9993
|
+
}
|
|
9994
|
+
interface UsePresenterWindowResult {
|
|
9995
|
+
openAudienceWindow: () => boolean;
|
|
9996
|
+
closeAudienceWindow: () => void;
|
|
9997
|
+
isAudienceWindowOpen: () => boolean;
|
|
9998
|
+
syncSlideToAudience: (slideIndex: number) => void;
|
|
9999
|
+
syncStateToAudience: (snapshot: PresentationSnapshot) => void;
|
|
10000
|
+
swapDisplays: () => Promise<boolean>;
|
|
10001
|
+
}
|
|
10002
|
+
declare function usePresenterWindow(input: UsePresenterWindowInput): UsePresenterWindowResult;
|
|
10003
|
+
//#endregion
|
|
10004
|
+
//#region src/viewer/hooks/presentation-mode/useAudienceMode.d.ts
|
|
10005
|
+
interface UseAudienceModeInput {
|
|
10006
|
+
mode: ViewerMode;
|
|
10007
|
+
onSetMode: (mode: ViewerMode) => void;
|
|
10008
|
+
onSetActiveSlideIndex: (index: number) => void;
|
|
10009
|
+
containerRef: React.RefObject<HTMLElement | null>;
|
|
10010
|
+
onSnapshot?: (snapshot: PresentationSnapshot) => void;
|
|
10011
|
+
}
|
|
10012
|
+
/**
|
|
10013
|
+
* When the page was opened with the `#pptx-audience` hash, this hook:
|
|
10014
|
+
* 1. Auto-enters fullscreen presentation mode after content loads
|
|
10015
|
+
* 2. Listens on BroadcastChannel for slide-change messages from the presenter
|
|
10016
|
+
* 3. Exits presentation mode when the presenter sends an exit signal
|
|
10017
|
+
*/
|
|
10018
|
+
declare function useAudienceMode(input: UseAudienceModeInput): void;
|
|
9766
10019
|
|
|
9767
10020
|
//#region src/viewer/hooks/useEditorHistory.d.ts
|
|
9768
10021
|
interface EditorHistoryInput {
|
|
@@ -10829,6 +11082,15 @@ interface UseThemeHandlersInput {
|
|
|
10829
11082
|
setSlideMasters: React.Dispatch<React.SetStateAction<Array<Record<string, unknown>>>>;
|
|
10830
11083
|
slideMasters: Array<Record<string, unknown>>;
|
|
10831
11084
|
history: EditorHistoryResult;
|
|
11085
|
+
/** Current live slides, re-coloured in place on a scheme-colour change. */
|
|
11086
|
+
setSlides: React.Dispatch<React.SetStateAction<PptxSlide[]>>;
|
|
11087
|
+
/** Current theme, used to derive the previous colour map for re-resolution. */
|
|
11088
|
+
theme: PptxTheme | undefined;
|
|
11089
|
+
/**
|
|
11090
|
+
* Force the history stack to capture the next slides change so an in-place
|
|
11091
|
+
* theme re-colour lands as a single undoable entry (mirrors the AI path).
|
|
11092
|
+
*/
|
|
11093
|
+
bumpHistory: () => void;
|
|
10832
11094
|
}
|
|
10833
11095
|
interface ThemeHandlersResult {
|
|
10834
11096
|
handleApplyTheme: (themePath: string, applyToAllMasters: boolean) => Promise<void>;
|
|
@@ -11343,6 +11605,8 @@ interface ViewerIntegrationResult {
|
|
|
11343
11605
|
autosaveStatus: AutosaveStatus;
|
|
11344
11606
|
isEncryptedDialogOpen: boolean;
|
|
11345
11607
|
setIsEncryptedDialogOpen: Dispatch<SetStateAction<boolean>>;
|
|
11608
|
+
/** The loaded core handler, exposed for the AI bridge (`getHandler`). */
|
|
11609
|
+
handlerRef: RefObject<PptxHandler | null>;
|
|
11346
11610
|
/**
|
|
11347
11611
|
* Bumped each time the load pipeline finishes applying parsed content to
|
|
11348
11612
|
* viewer state. Collaboration watches it to re-adopt the shared doc's
|