pptx-react-viewer 1.16.2 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/dist/{Model3DScene-DI6FSWDL.mjs → Model3DScene-QHDYQXL2.mjs} +2 -2
  3. package/dist/Model3DScene-QHDYQXL2.mjs.br +0 -0
  4. package/dist/Model3DScene-QHDYQXL2.mjs.gz +0 -0
  5. package/dist/{Model3DScene-PE7L24QK.js → Model3DScene-YA4F63DT.js} +3 -3
  6. package/dist/Model3DScene-YA4F63DT.js.br +0 -0
  7. package/dist/Model3DScene-YA4F63DT.js.gz +0 -0
  8. package/dist/PowerPointViewer-C4d7SKZf.d.ts +21 -0
  9. package/dist/PowerPointViewer-C4d7SKZf.d.ts.map +1 -0
  10. package/dist/{SurfaceChart3DScene-NMLG3BQK.mjs → SurfaceChart3DScene-GUAS2NWQ.mjs} +2 -2
  11. package/dist/SurfaceChart3DScene-GUAS2NWQ.mjs.br +0 -0
  12. package/dist/SurfaceChart3DScene-GUAS2NWQ.mjs.gz +0 -0
  13. package/dist/{SurfaceChart3DScene-AJLD3VW6.js → SurfaceChart3DScene-TGNJHTJQ.js} +3 -3
  14. package/dist/SurfaceChart3DScene-TGNJHTJQ.js.br +0 -0
  15. package/dist/SurfaceChart3DScene-TGNJHTJQ.js.gz +0 -0
  16. package/dist/{chunk-MZYQUURK.js → chunk-3P6O7ZDM.js} +420 -420
  17. package/dist/chunk-3P6O7ZDM.js.br +0 -0
  18. package/dist/chunk-3P6O7ZDM.js.gz +0 -0
  19. package/dist/{chunk-46HNHBHF.mjs → chunk-G22EWPLH.mjs} +134 -4
  20. package/dist/chunk-G22EWPLH.mjs.br +0 -0
  21. package/dist/chunk-G22EWPLH.mjs.gz +0 -0
  22. package/dist/{chunk-WMRS37KQ.js → chunk-JWS3RQKN.js} +160 -28
  23. package/dist/chunk-JWS3RQKN.js.br +0 -0
  24. package/dist/chunk-JWS3RQKN.js.gz +0 -0
  25. package/dist/{chunk-JBCVQFWI.mjs → chunk-LLHFNGAF.mjs} +4 -4
  26. package/dist/chunk-LLHFNGAF.mjs.br +0 -0
  27. package/dist/chunk-LLHFNGAF.mjs.gz +0 -0
  28. package/dist/{chunk-DZF4BNRP.mjs → chunk-LNSHC2Z5.mjs} +117 -156
  29. package/dist/chunk-LNSHC2Z5.mjs.br +0 -0
  30. package/dist/chunk-LNSHC2Z5.mjs.gz +0 -0
  31. package/dist/{chunk-YAQOTVZT.js → chunk-MGLRKGCH.js} +146 -66
  32. package/dist/chunk-MGLRKGCH.js.br +0 -0
  33. package/dist/chunk-MGLRKGCH.js.gz +0 -0
  34. package/dist/{chunk-X7ILBQEY.mjs → chunk-XRYREYXC.mjs} +146 -66
  35. package/dist/chunk-XRYREYXC.mjs.br +0 -0
  36. package/dist/chunk-XRYREYXC.mjs.gz +0 -0
  37. package/dist/{chunk-VRASDGWX.js → chunk-XW5OMXW6.js} +915 -954
  38. package/dist/chunk-XW5OMXW6.js.br +0 -0
  39. package/dist/chunk-XW5OMXW6.js.gz +0 -0
  40. package/dist/{dist-VMFNUFUX.js → dist-2ZAH7U6U.js} +507 -507
  41. package/dist/dist-2ZAH7U6U.js.br +0 -0
  42. package/dist/dist-2ZAH7U6U.js.gz +0 -0
  43. package/dist/{dist-JJ2NI2O3.mjs → dist-MXDC6YTS.mjs} +1 -1
  44. package/dist/dist-MXDC6YTS.mjs.br +0 -0
  45. package/dist/dist-MXDC6YTS.mjs.gz +0 -0
  46. package/dist/hooks-unstable.d.ts +9683 -1886
  47. package/dist/hooks-unstable.d.ts.map +1 -0
  48. package/dist/hooks-unstable.js +74 -74
  49. package/dist/hooks-unstable.js.br +0 -0
  50. package/dist/hooks-unstable.js.gz +0 -0
  51. package/dist/hooks-unstable.mjs +3 -3
  52. package/dist/hooks-unstable.mjs.br +0 -0
  53. package/dist/hooks-unstable.mjs.gz +0 -0
  54. package/dist/i18n.d.ts +27 -1
  55. package/dist/i18n.d.ts.map +1 -0
  56. package/dist/index-XGt7MZpa.d.ts +607 -0
  57. package/dist/index-XGt7MZpa.d.ts.map +1 -0
  58. package/dist/index.d.ts +4753 -10
  59. package/dist/index.d.ts.map +1 -0
  60. package/dist/index.js +18 -18
  61. package/dist/index.js.br +0 -0
  62. package/dist/index.js.gz +0 -0
  63. package/dist/index.mjs +4 -4
  64. package/dist/index.mjs.br +0 -0
  65. package/dist/index.mjs.gz +0 -0
  66. package/dist/types-BK7Nt13M.d.ts +483 -0
  67. package/dist/types-BK7Nt13M.d.ts.map +1 -0
  68. package/dist/viewer/index.d.ts +8008 -88
  69. package/dist/viewer/index.d.ts.map +1 -0
  70. package/dist/viewer/index.js +19 -19
  71. package/dist/viewer/index.js.br +0 -0
  72. package/dist/viewer/index.js.gz +0 -0
  73. package/dist/viewer/index.mjs +4 -4
  74. package/dist/viewer/index.mjs.br +0 -0
  75. package/dist/viewer/index.mjs.gz +0 -0
  76. package/package.json +6 -5
  77. package/dist/Model3DScene-DI6FSWDL.mjs.br +0 -0
  78. package/dist/Model3DScene-DI6FSWDL.mjs.gz +0 -0
  79. package/dist/Model3DScene-PE7L24QK.js.br +0 -0
  80. package/dist/Model3DScene-PE7L24QK.js.gz +0 -0
  81. package/dist/PowerPointViewer-BsaUH3ZT.d.ts +0 -26
  82. package/dist/PowerPointViewer-Nxku67uL.d.mts +0 -26
  83. package/dist/SurfaceChart3DScene-AJLD3VW6.js.br +0 -0
  84. package/dist/SurfaceChart3DScene-AJLD3VW6.js.gz +0 -0
  85. package/dist/SurfaceChart3DScene-NMLG3BQK.mjs.br +0 -0
  86. package/dist/SurfaceChart3DScene-NMLG3BQK.mjs.gz +0 -0
  87. package/dist/chunk-46HNHBHF.mjs.br +0 -0
  88. package/dist/chunk-46HNHBHF.mjs.gz +0 -0
  89. package/dist/chunk-DZF4BNRP.mjs.br +0 -0
  90. package/dist/chunk-DZF4BNRP.mjs.gz +0 -0
  91. package/dist/chunk-JBCVQFWI.mjs.br +0 -0
  92. package/dist/chunk-JBCVQFWI.mjs.gz +0 -0
  93. package/dist/chunk-MZYQUURK.js.br +0 -0
  94. package/dist/chunk-MZYQUURK.js.gz +0 -0
  95. package/dist/chunk-VRASDGWX.js.br +0 -0
  96. package/dist/chunk-VRASDGWX.js.gz +0 -0
  97. package/dist/chunk-WMRS37KQ.js.br +0 -0
  98. package/dist/chunk-WMRS37KQ.js.gz +0 -0
  99. package/dist/chunk-X7ILBQEY.mjs.br +0 -0
  100. package/dist/chunk-X7ILBQEY.mjs.gz +0 -0
  101. package/dist/chunk-YAQOTVZT.js.br +0 -0
  102. package/dist/chunk-YAQOTVZT.js.gz +0 -0
  103. package/dist/dist-JJ2NI2O3.mjs.br +0 -0
  104. package/dist/dist-JJ2NI2O3.mjs.gz +0 -0
  105. package/dist/dist-VMFNUFUX.js.br +0 -0
  106. package/dist/dist-VMFNUFUX.js.gz +0 -0
  107. package/dist/hooks-unstable.d.mts +0 -2300
  108. package/dist/i18n.d.mts +0 -1
  109. package/dist/index.d.mts +0 -46
  110. package/dist/types-ui-NG29h55h.d.mts +0 -712
  111. package/dist/types-ui-NG29h55h.d.ts +0 -712
  112. package/dist/usePresenterWindow-DToCijGy.d.ts +0 -1619
  113. package/dist/usePresenterWindow-DeTm-unp.d.mts +0 -1619
  114. package/dist/viewer/index.d.mts +0 -129
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/lib/canvas-export.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;iBAoCsB,eACrB,SAAS,aACT,UAAS,QAAQ,WACf,QAAQ"}
package/dist/index.js CHANGED
@@ -1,67 +1,67 @@
1
1
  'use strict';
2
2
 
3
- var chunkVRASDGWX_js = require('./chunk-VRASDGWX.js');
4
- var chunkMZYQUURK_js = require('./chunk-MZYQUURK.js');
5
- var chunkWMRS37KQ_js = require('./chunk-WMRS37KQ.js');
3
+ var chunkXW5OMXW6_js = require('./chunk-XW5OMXW6.js');
4
+ var chunk3P6O7ZDM_js = require('./chunk-3P6O7ZDM.js');
5
+ var chunkJWS3RQKN_js = require('./chunk-JWS3RQKN.js');
6
6
  require('./chunk-WGLJ32FW.js');
7
- require('./chunk-YAQOTVZT.js');
7
+ require('./chunk-MGLRKGCH.js');
8
8
  require('./chunk-QGM4M3NI.js');
9
9
 
10
10
 
11
11
 
12
12
  Object.defineProperty(exports, "PowerPointViewer", {
13
13
  enumerable: true,
14
- get: function () { return chunkVRASDGWX_js.PowerPointViewer; }
14
+ get: function () { return chunkXW5OMXW6_js.PowerPointViewer; }
15
15
  });
16
16
  Object.defineProperty(exports, "ViewerThemeProvider", {
17
17
  enumerable: true,
18
- get: function () { return chunkVRASDGWX_js.ViewerThemeProvider; }
18
+ get: function () { return chunkXW5OMXW6_js.ViewerThemeProvider; }
19
19
  });
20
20
  Object.defineProperty(exports, "useViewerTheme", {
21
21
  enumerable: true,
22
- get: function () { return chunkVRASDGWX_js.useViewerTheme; }
22
+ get: function () { return chunkXW5OMXW6_js.useViewerTheme; }
23
23
  });
24
24
  Object.defineProperty(exports, "getAnimationInitialStyle", {
25
25
  enumerable: true,
26
- get: function () { return chunkMZYQUURK_js.getAnimationInitialStyle; }
26
+ get: function () { return chunk3P6O7ZDM_js.getAnimationInitialStyle; }
27
27
  });
28
28
  Object.defineProperty(exports, "renderToCanvas", {
29
29
  enumerable: true,
30
- get: function () { return chunkMZYQUURK_js.renderToCanvas; }
30
+ get: function () { return chunk3P6O7ZDM_js.renderToCanvas; }
31
31
  });
32
32
  Object.defineProperty(exports, "defaultCssVars", {
33
33
  enumerable: true,
34
- get: function () { return chunkWMRS37KQ_js.defaultCssVars; }
34
+ get: function () { return chunkJWS3RQKN_js.defaultCssVars; }
35
35
  });
36
36
  Object.defineProperty(exports, "defaultRadius", {
37
37
  enumerable: true,
38
- get: function () { return chunkWMRS37KQ_js.defaultRadius; }
38
+ get: function () { return chunkJWS3RQKN_js.defaultRadius; }
39
39
  });
40
40
  Object.defineProperty(exports, "defaultThemeColors", {
41
41
  enumerable: true,
42
- get: function () { return chunkWMRS37KQ_js.defaultThemeColors; }
42
+ get: function () { return chunkJWS3RQKN_js.defaultThemeColors; }
43
43
  });
44
44
  Object.defineProperty(exports, "themeToCssVars", {
45
45
  enumerable: true,
46
- get: function () { return chunkWMRS37KQ_js.themeToCssVars; }
46
+ get: function () { return chunkJWS3RQKN_js.themeToCssVars; }
47
47
  });
48
48
  Object.defineProperty(exports, "vermilionDarkColors", {
49
49
  enumerable: true,
50
- get: function () { return chunkWMRS37KQ_js.vermilionDarkColors; }
50
+ get: function () { return chunkJWS3RQKN_js.vermilionDarkColors; }
51
51
  });
52
52
  Object.defineProperty(exports, "vermilionDarkTheme", {
53
53
  enumerable: true,
54
- get: function () { return chunkWMRS37KQ_js.vermilionDarkTheme; }
54
+ get: function () { return chunkJWS3RQKN_js.vermilionDarkTheme; }
55
55
  });
56
56
  Object.defineProperty(exports, "vermilionLightColors", {
57
57
  enumerable: true,
58
- get: function () { return chunkWMRS37KQ_js.vermilionLightColors; }
58
+ get: function () { return chunkJWS3RQKN_js.vermilionLightColors; }
59
59
  });
60
60
  Object.defineProperty(exports, "vermilionLightTheme", {
61
61
  enumerable: true,
62
- get: function () { return chunkWMRS37KQ_js.vermilionLightTheme; }
62
+ get: function () { return chunkJWS3RQKN_js.vermilionLightTheme; }
63
63
  });
64
64
  Object.defineProperty(exports, "vermilionRadius", {
65
65
  enumerable: true,
66
- get: function () { return chunkWMRS37KQ_js.vermilionRadius; }
66
+ get: function () { return chunkJWS3RQKN_js.vermilionRadius; }
67
67
  });
package/dist/index.js.br CHANGED
Binary file
package/dist/index.js.gz CHANGED
Binary file
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- export { PowerPointViewer, ViewerThemeProvider, useViewerTheme } from './chunk-DZF4BNRP.mjs';
2
- export { getAnimationInitialStyle, renderToCanvas } from './chunk-JBCVQFWI.mjs';
3
- export { defaultCssVars, defaultRadius, defaultThemeColors, themeToCssVars, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius } from './chunk-46HNHBHF.mjs';
1
+ export { PowerPointViewer, ViewerThemeProvider, useViewerTheme } from './chunk-LNSHC2Z5.mjs';
2
+ export { getAnimationInitialStyle, renderToCanvas } from './chunk-LLHFNGAF.mjs';
3
+ export { defaultCssVars, defaultRadius, defaultThemeColors, themeToCssVars, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius } from './chunk-G22EWPLH.mjs';
4
4
  import './chunk-HJQZJ3VE.mjs';
5
- import './chunk-X7ILBQEY.mjs';
5
+ import './chunk-XRYREYXC.mjs';
6
6
  import './chunk-6DZX6EAA.mjs';
package/dist/index.mjs.br CHANGED
Binary file
package/dist/index.mjs.gz CHANGED
Binary file
@@ -0,0 +1,483 @@
1
+ import { ConnectorArrowType, PptxAnimationPreset, PptxElement, PptxElementAnimation, PptxSlide, PptxSlideTransition, ShapeStyle, StrokeDashType, XmlObject } from "pptx-viewer-core";
2
+ import { CollaborationConfig as CollaborationConfig$1, CollaborationRole, ElementClipboardPayload, PowerPointViewerAPI, ViewerFontSource, ViewerMode as ViewerMode$1, ViewerTheme, ViewerThemeColors, defaultCssVars, defaultRadius, defaultThemeColors, themeToCssVars, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius } from "pptx-viewer-shared";
3
+ import React$1 from "react";
4
+ import { Doc } from "yjs";
5
+ //#region src/viewer/types-core.d.ts
6
+ /**
7
+ * Union of all shape preset types that the viewer can insert or render.
8
+ * Maps to OOXML `a:prstGeom` preset values (e.g. "rect", "ellipse").
9
+ * Includes basic shapes, arrows, connectors, and freeform paths.
10
+ */
11
+ type SupportedShapeType = 'rect' | 'roundRect' | 'ellipse' | 'triangle' | 'rtTriangle' | 'diamond' | 'cylinder' | 'parallelogram' | 'trapezoid' | 'pentagon' | 'hexagon' | 'octagon' | 'chevron' | 'star5' | 'star6' | 'star8' | 'plus' | 'heart' | 'cloud' | 'sun' | 'moon' | 'pie' | 'plaque' | 'teardrop' | 'line' | 'rtArrow' | 'leftArrow' | 'upArrow' | 'downArrow' | 'connector' | 'freeform';
12
+ /**
13
+ * Connector geometry presets corresponding to OOXML `a:prstGeom` connector types.
14
+ * Determines the routing style (straight, bent with N segments, or curved).
15
+ */
16
+ type ConnectorGeometryType = 'straightConnector1' | 'bentConnector2' | 'bentConnector3' | 'bentConnector4' | 'bentConnector5' | 'curvedConnector2' | 'curvedConnector3' | 'curvedConnector4' | 'curvedConnector5';
17
+ /** The pixel dimensions of the slide canvas (presentation slide size). */
18
+ interface CanvasSize {
19
+ /** Width of the canvas in CSS pixels. */
20
+ width: number;
21
+ /** Height of the canvas in CSS pixels. */
22
+ height: number;
23
+ }
24
+ /**
25
+ * Tracks the state of an ongoing element drag operation.
26
+ * Created on pointer-down and destroyed on pointer-up.
27
+ * During the drag, position changes are applied directly to DOM elements
28
+ * for performance (bypassing React state) and committed to state on completion.
29
+ */
30
+ interface DragState {
31
+ /** ID of the primary element being dragged. */
32
+ elementId: string;
33
+ /** Client X coordinate at the start of the drag. */
34
+ startClientX: number;
35
+ /** Client Y coordinate at the start of the drag. */
36
+ startClientY: number;
37
+ /** Original positions of all selected elements, keyed by element ID. */
38
+ startPositionsById: Record<string, {
39
+ x: number;
40
+ y: number;
41
+ }>;
42
+ /** DOM elements cached at drag-start to avoid per-frame querySelector calls. */
43
+ domEls: Map<string, HTMLElement>;
44
+ /** Whether the pointer has actually moved since the drag started. */
45
+ moved: boolean;
46
+ /** Accumulated delta, stored during DOM-only drag, committed on pointerup. */
47
+ lastDx: number;
48
+ lastDy: number;
49
+ }
50
+ /** Handle used as the resize anchor point (corners + edge midpoints). */
51
+ type ResizeHandle = 'nw' | 'ne' | 'sw' | 'se' | 'n' | 's' | 'e' | 'w';
52
+ /**
53
+ * Tracks the state of an ongoing element resize operation.
54
+ * Uses direct DOM manipulation during the resize for performance,
55
+ * then commits the final geometry to React state on pointer-up.
56
+ */
57
+ interface ResizeState {
58
+ /** ID of the element being resized. */
59
+ elementId: string;
60
+ /** Client X coordinate at the start of the resize. */
61
+ startClientX: number;
62
+ /** Client Y coordinate at the start of the resize. */
63
+ startClientY: number;
64
+ /** Original X position of the element. */
65
+ startX: number;
66
+ /** Original Y position of the element. */
67
+ startY: number;
68
+ /** Original width of the element. */
69
+ startWidth: number;
70
+ /** Original height of the element. */
71
+ startHeight: number;
72
+ /** Which handle initiated the resize. */
73
+ handle: ResizeHandle;
74
+ /** Whether the pointer has actually moved since the resize started. */
75
+ moved: boolean;
76
+ /** DOM element cached at resize-start to avoid per-frame querySelector calls. */
77
+ domEl: HTMLElement | null;
78
+ /** Accumulated final geometry, committed on pointerup. */
79
+ lastX: number;
80
+ lastY: number;
81
+ lastWidth: number;
82
+ lastHeight: number;
83
+ }
84
+ /**
85
+ * Describes the position and value of a shape adjustment handle (yellow diamond).
86
+ * Adjustment handles allow users to modify shape parameters like corner radius,
87
+ * arrow width, etc. without a full resize.
88
+ */
89
+ interface ShapeAdjustmentHandleDescriptor {
90
+ key: string;
91
+ left: number;
92
+ top: number;
93
+ value: number;
94
+ cursor: string;
95
+ }
96
+ /**
97
+ * Tracks the state of an ongoing shape adjustment handle drag.
98
+ * Used when the user drags the yellow diamond handle to alter
99
+ * shape-specific parameters (e.g. corner radius on a rounded rectangle).
100
+ */
101
+ interface ShapeAdjustmentDragState {
102
+ elementId: string;
103
+ key: string;
104
+ shapeType: string;
105
+ startClientX: number;
106
+ startClientY: number;
107
+ startAdjustment: number;
108
+ startWidth: number;
109
+ startHeight: number;
110
+ moved: boolean;
111
+ }
112
+ /**
113
+ * A snapshot of editor state captured for undo/redo history.
114
+ * Contains the full slide deck state at a point in time so that
115
+ * any editing operation can be reverted or replayed.
116
+ */
117
+ interface EditorHistorySnapshot {
118
+ width: number;
119
+ height: number;
120
+ activeSlideIndex: number;
121
+ slides: PptxSlide[];
122
+ templateElementsBySlideId: Record<string, PptxElement[]>;
123
+ actionLabel?: string;
124
+ }
125
+ /** Axis-aligned bounding box for an element, used for hit-testing and alignment. */
126
+ interface ElementBounds {
127
+ minX: number;
128
+ minY: number;
129
+ maxX: number;
130
+ maxY: number;
131
+ }
132
+ /**
133
+ * Geometry data for rendering a connector line as an SVG path.
134
+ * Includes start/end coordinates, the SVG path data string,
135
+ * and optional marker (arrowhead) identifiers.
136
+ */
137
+ interface ConnectorPathGeometry {
138
+ startX: number;
139
+ startY: number;
140
+ endX: number;
141
+ endY: number;
142
+ pathData: string;
143
+ d?: string;
144
+ viewBox?: string;
145
+ startMarkerId?: string;
146
+ endMarkerId?: string;
147
+ }
148
+ /** A named preset shape style used in the Quick Styles gallery. */
149
+ interface ShapeQuickStyle {
150
+ name: string;
151
+ style: Partial<ShapeStyle>;
152
+ }
153
+ //#endregion
154
+ //#region src/theme/context.d.ts
155
+ interface ViewerThemeProviderProps {
156
+ theme?: ViewerTheme;
157
+ children: React.ReactNode;
158
+ }
159
+ /**
160
+ * Provides a `ViewerTheme` to all descendant viewer components.
161
+ *
162
+ * Typically you do **not** need to use this directly; passing a `theme`
163
+ * prop to `<PowerPointViewer>` is sufficient. This provider is exposed
164
+ * for advanced use-cases where you want to wrap multiple viewers or
165
+ * share a theme across a wider subtree.
166
+ */
167
+ declare function ViewerThemeProvider({ theme, children }: ViewerThemeProviderProps): import("react").JSX.Element;
168
+ /**
169
+ * Returns the active `ViewerTheme` (if any) from the nearest
170
+ * `ViewerThemeProvider`.
171
+ */
172
+ declare function useViewerTheme(): ViewerTheme | undefined;
173
+ //#endregion
174
+ //#region src/viewer/hooks/collaboration/types.d.ts
175
+ /** Connection lifecycle states for the Yjs WebSocket provider. */
176
+ type ConnectionStatus = 'disconnected' | 'connecting' | 'connected' | 'error';
177
+ /**
178
+ * Presence data broadcast to other participants.
179
+ * Cursor position is relative to the slide canvas (0..canvasWidth, 0..canvasHeight).
180
+ */
181
+ interface UserPresence {
182
+ /** Unique client ID (assigned by Yjs awareness). */
183
+ clientId: number;
184
+ /** Sanitised display name. */
185
+ userName: string;
186
+ /** Optional avatar URL (validated). */
187
+ userAvatar?: string;
188
+ /** Hex colour for the user's cursor ring. */
189
+ userColor: string;
190
+ /** Slide index the user is currently viewing. */
191
+ activeSlideIndex: number;
192
+ /** Cursor X on the canvas (clamped to slide bounds). */
193
+ cursorX: number;
194
+ /** Cursor Y on the canvas (clamped to slide bounds). */
195
+ cursorY: number;
196
+ /** ISO timestamp of last update (for stale-presence cleanup). */
197
+ lastUpdated: string;
198
+ /** Optional currently selected element ID. */
199
+ selectedElementId?: string;
200
+ /** Role in the session (owner, viewer, or collaborator). */
201
+ role?: CollaborationRole;
202
+ }
203
+ /** Value exposed by `CollaborationContext`. */
204
+ interface CollaborationContextValue {
205
+ /** Current WebSocket connection status. */
206
+ status: ConnectionStatus;
207
+ /** Presence data for all remote users (excludes the local user). */
208
+ remoteUsers: UserPresence[];
209
+ /** Broadcast the local user's presence state. */
210
+ broadcastPresence: (update: Partial<Omit<UserPresence, 'clientId'>>) => void;
211
+ /** Total number of connected users (including local). */
212
+ connectedCount: number;
213
+ /** The collaboration config that was provided. */
214
+ config: CollaborationConfig$1;
215
+ /** The Yjs document (for document sync). */
216
+ doc: Doc | null;
217
+ /**
218
+ * Whether the provider completed its initial document sync (or the
219
+ * first-write grace period elapsed). Local doc writes are gated on this.
220
+ */
221
+ synced: boolean;
222
+ /** Manually retry the WebSocket connection after a timeout or error. */
223
+ retry: () => void;
224
+ }
225
+ //#endregion
226
+ //#region src/viewer/types-ui.d.ts
227
+ /**
228
+ * Base handle interface for file viewer components.
229
+ * Defined locally to avoid dependency on external file-viewer plugin packages.
230
+ * Provides a standard `getContent` method used by the host application to
231
+ * retrieve the current file content (e.g. for saving).
232
+ */
233
+ interface FileViewerHandle {
234
+ /** Get the current content of the file (for saving) */
235
+ getContent: () => Promise<string | Uint8Array>;
236
+ }
237
+ /** A shape preset entry used in the toolbar shape insertion palette. */
238
+ interface ShapePreset {
239
+ type: SupportedShapeType;
240
+ label: string;
241
+ icon: React$1.ReactNode;
242
+ }
243
+ /** Tracks the position and target element of an open context menu. */
244
+ interface ElementContextMenuState {
245
+ x: number;
246
+ y: number;
247
+ elementId: string;
248
+ }
249
+ /** Identifies an action triggered from the element right-click context menu. */
250
+ type ElementContextMenuAction = 'copy' | 'cut' | 'paste' | 'duplicate' | 'delete' | 'bring-forward' | 'send-backward' | 'bring-front' | 'send-back' | 'bringForward' | 'sendBackward' | 'bringToFront' | 'sendToBack' | 'comment' | 'addComment' | 'group' | 'ungroup' | 'editPoints' | 'editHyperlink';
251
+ /**
252
+ * State of an active marquee (rubber-band) selection rectangle.
253
+ * Created when the user clicks and drags on the canvas background,
254
+ * and used to compute which elements fall within the selection area.
255
+ */
256
+ interface MarqueeSelectionState {
257
+ startX: number;
258
+ startY: number;
259
+ currentX: number;
260
+ currentY: number;
261
+ additive: boolean;
262
+ baseSelectionIds?: string[];
263
+ }
264
+ /** Tracks which table cell is selected and/or actively being edited. */
265
+ interface TableCellEditorState {
266
+ rowIndex: number;
267
+ columnIndex: number;
268
+ /** When true the cell has an active text input. */
269
+ isEditing?: boolean;
270
+ /** Optional multi-cell selection (Shift+Click range). Each entry is {row, col}. */
271
+ selectedCells?: Array<{
272
+ row: number;
273
+ col: number;
274
+ }>;
275
+ }
276
+ /** A single parsed table cell with its position, text content, and computed CSS style. */
277
+ interface ParsedTableCell {
278
+ rowIndex: number;
279
+ columnIndex: number;
280
+ text: string;
281
+ style: React$1.CSSProperties;
282
+ rawCell: XmlObject;
283
+ }
284
+ /** Complete parsed table data including row/column structure and all cells. */
285
+ interface ParsedTableData {
286
+ rowCount: number;
287
+ columnCount: number;
288
+ rows: XmlObject[];
289
+ columnPercentages: number[];
290
+ cells: ParsedTableCell[];
291
+ }
292
+ /** Runtime state for a single element's animation during presentation mode. */
293
+ interface PresentationAnimationRuntime {
294
+ elementId: string;
295
+ state: 'hidden' | 'entering' | 'visible';
296
+ animation: PptxElementAnimation;
297
+ }
298
+ /**
299
+ * Groups slides into named sections for the slides pane sidebar.
300
+ * Corresponds to OOXML `p15:section` elements in `presentation.xml`.
301
+ */
302
+ interface SlideSectionGroup {
303
+ id: string;
304
+ label: string;
305
+ slideIndexes: number[];
306
+ /** Section highlight color from p15:sectionPr. */
307
+ color?: string;
308
+ /** Whether the section should start collapsed (from p15:sectionPr). */
309
+ defaultCollapsed?: boolean;
310
+ }
311
+ /** Alignment direction for distributing/aligning multiple selected elements on the slide. */
312
+ type SlideAlignment = 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom';
313
+ /** Identifies one of the ribbon-style toolbar tabs (home, insert, text, etc.). */
314
+ type ToolbarSection = 'file' | 'home' | 'insert' | 'text' | 'arrange' | 'draw' | 'design' | 'transitions' | 'animations' | 'slideShow' | 'record' | 'review' | 'view' | 'help';
315
+ /** The active drawing/inking tool selected in the Draw toolbar tab. */
316
+ type DrawingTool = 'select' | 'pen' | 'highlighter' | 'eraser' | 'freeform';
317
+ /** A single entry in the keyboard shortcuts help panel. */
318
+ interface ShortcutReferenceItem {
319
+ actionKey: string;
320
+ shortcut: string;
321
+ }
322
+ /** An accessibility audit finding (missing alt text, reading order issues, etc.). */
323
+ interface AccessibilityIssue {
324
+ slideIndex: number;
325
+ elementId?: string;
326
+ severity: 'error' | 'warning' | 'info';
327
+ message: string;
328
+ }
329
+ /** Dropdown option for selecting a connector geometry type. */
330
+ interface ConnectorGeometryOption {
331
+ value: ConnectorGeometryType;
332
+ label: string;
333
+ }
334
+ /** Dropdown option for selecting a connector arrowhead style. */
335
+ interface ConnectorArrowOption {
336
+ value: ConnectorArrowType;
337
+ label: string;
338
+ }
339
+ /** Dropdown option for selecting a stroke dash pattern. */
340
+ interface StrokeDashOption {
341
+ value: StrokeDashType;
342
+ label: string;
343
+ }
344
+ /** Dropdown option for selecting a slide transition type. */
345
+ interface SlideTransitionOption {
346
+ value: NonNullable<PptxSlideTransition['type']>;
347
+ label: string;
348
+ }
349
+ /** Dropdown option for selecting an animation effect preset. */
350
+ interface AnimationPresetOption {
351
+ value: Exclude<PptxAnimationPreset, 'none'>;
352
+ label: string;
353
+ }
354
+ interface PowerPointViewerProps {
355
+ /** PowerPoint content as Uint8Array */
356
+ content: Uint8Array;
357
+ /** Licensed fonts supplied by the host application. No fonts are bundled. */
358
+ fonts?: ViewerFontSource[];
359
+ /** Original file path, used for autosave recovery */
360
+ filePath?: string;
361
+ /**
362
+ * Display name of the open document, shown in the PowerPoint-style title
363
+ * bar (e.g. "quarterly-review.pptx"). Falls back to a generic label.
364
+ */
365
+ fileName?: string;
366
+ /** Callback when content has unsaved changes */
367
+ onDirtyChange?: (isDirty: boolean) => void;
368
+ onContentChange?: (content: Uint8Array) => void;
369
+ /** Callback when active slide changes */
370
+ onActiveSlideChange?: (slideIndex: number) => void;
371
+ /** Callback when the viewer mode changes (e.g. edit to present). */
372
+ onModeChange?: (mode: import('pptx-viewer-shared').ViewerMode) => void;
373
+ /** Callback when the zoom level changes. */
374
+ onZoomChange?: (zoom: number) => void;
375
+ /** Callback when element selection changes. */
376
+ onSelectionChange?: (elementIds: string[]) => void;
377
+ /** Callback when the total slide count changes (slide added/deleted). */
378
+ onSlideCountChange?: (count: number) => void;
379
+ /**
380
+ * Host override for the File ▸ Open action. When provided, the built-in
381
+ * native file picker is bypassed and this is invoked instead; the host is
382
+ * then responsible for supplying a new `content` buffer. When omitted, the
383
+ * viewer opens its own picker and loads the chosen presentation in place.
384
+ */
385
+ onOpenFile?: () => void;
386
+ /** Whether editing actions are enabled */
387
+ canEdit?: boolean;
388
+ /** Optional class name */
389
+ className?: string;
390
+ /**
391
+ * Display name used as the author for comments and annotations.
392
+ * Falls back to `collaboration.userName` when collaborating, or `'You'`.
393
+ */
394
+ authorName?: string;
395
+ /**
396
+ * Theme configuration for customising the viewer's appearance.
397
+ *
398
+ * Accepts partial color overrides, a custom border-radius, and
399
+ * arbitrary CSS custom properties. Unset values fall back to the
400
+ * built-in dark theme.
401
+ *
402
+ * @example
403
+ * ```tsx
404
+ * <PowerPointViewer
405
+ * content={bytes}
406
+ * theme={{
407
+ * colors: { primary: "#6366f1", background: "#0f172a" },
408
+ * radius: "0.75rem",
409
+ * }}
410
+ * />
411
+ * ```
412
+ *
413
+ * @see {@link ViewerTheme} for the full type definition.
414
+ */
415
+ theme?: ViewerTheme;
416
+ /**
417
+ * Optional real-time collaboration configuration.
418
+ *
419
+ * When provided, the viewer enables collaborative editing with live
420
+ * cursors, user presence indicators, and CRDT-based state sync via Yjs.
421
+ * Requires `yjs` and `y-websocket` peer dependencies.
422
+ *
423
+ * @example
424
+ * ```tsx
425
+ * <PowerPointViewer
426
+ * content={bytes}
427
+ * collaboration={{
428
+ * roomId: "my-room-123",
429
+ * serverUrl: "wss://collab.example.com",
430
+ * userName: "Alice",
431
+ * userColor: "#6366f1",
432
+ * }}
433
+ * />
434
+ * ```
435
+ */
436
+ collaboration?: CollaborationConfig$1;
437
+ /**
438
+ * Callback invoked when the user starts a collaboration session from the
439
+ * Share dialog. The host app should use this to set the `collaboration`
440
+ * prop with the returned config.
441
+ */
442
+ onStartCollaboration?: (config: CollaborationConfig$1) => void;
443
+ /**
444
+ * Callback invoked when the user stops a collaboration session from the
445
+ * Share dialog. The host app should clear the `collaboration` prop.
446
+ */
447
+ onStopCollaboration?: () => void;
448
+ /**
449
+ * Default values for the Share dialog fields. The host app should provide
450
+ * these to control the session name, user display name, and server URL.
451
+ * If omitted, the Share dialog fields will be empty and require user input.
452
+ *
453
+ * @example
454
+ * ```tsx
455
+ * <PowerPointViewer
456
+ * shareDefaults={{
457
+ * roomId: "session-abc123",
458
+ * userName: "Alice",
459
+ * serverUrl: "ws://localhost:1234",
460
+ * }}
461
+ * />
462
+ * ```
463
+ */
464
+ shareDefaults?: {
465
+ roomId?: string;
466
+ userName?: string;
467
+ serverUrl?: string;
468
+ };
469
+ /**
470
+ * Opt in to the experimental Three.js SmartArt renderer. When `true`,
471
+ * SmartArt diagrams render as extruded 3D blocks on a WebGL canvas instead
472
+ * of flat SVG. Requires the optional `three` peer dependency; when it is not
473
+ * installed (or the diagram has no geometry), the viewer transparently falls
474
+ * back to the SVG `SmartArtRenderer`. Default `false`.
475
+ */
476
+ smartArt3D?: boolean;
477
+ }
478
+ interface PowerPointViewerHandle extends FileViewerHandle, PowerPointViewerAPI {
479
+ getContent: () => Promise<Uint8Array>;
480
+ }
481
+ //#endregion
482
+ export { SupportedShapeType as $, defaultCssVars as A, ViewerThemeColors as B, CollaborationConfig$1 as C, UserPresence as D, ConnectionStatus as E, vermilionLightTheme as F, EditorHistorySnapshot as G, ConnectorGeometryType as H, vermilionRadius as I, ResizeHandle as J, ElementBounds as K, defaultRadius as L, vermilionDarkColors as M, vermilionDarkTheme as N, ViewerThemeProvider as O, vermilionLightColors as P, ShapeQuickStyle as Q, defaultThemeColors as R, ToolbarSection as S, CollaborationRole as T, ConnectorPathGeometry as U, CanvasSize as V, DragState as W, ShapeAdjustmentDragState as X, ResizeState as Y, ShapeAdjustmentHandleDescriptor as Z, SlideAlignment as _, DrawingTool as a, StrokeDashOption as b, FileViewerHandle as c, ParsedTableData as d, ViewerMode$1 as et, PowerPointViewerHandle as f, ShortcutReferenceItem as g, ShapePreset as h, ConnectorGeometryOption as i, themeToCssVars as j, useViewerTheme as k, MarqueeSelectionState as l, PresentationAnimationRuntime as m, AnimationPresetOption as n, ElementContextMenuAction as o, PowerPointViewerProps as p, ElementClipboardPayload as q, ConnectorArrowOption as r, ElementContextMenuState as s, AccessibilityIssue as t, ParsedTableCell as u, SlideSectionGroup as v, CollaborationContextValue as w, TableCellEditorState as x, SlideTransitionOption as y, ViewerTheme as z };
483
+ //# sourceMappingURL=types-BK7Nt13M.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-BK7Nt13M.d.ts","names":[],"sources":["../src/viewer/types-core.ts","../src/theme/context.tsx","../src/viewer/hooks/collaboration/types.ts","../src/viewer/types-ui.ts"],"mappings":";;;;;;;;;;KA+BY;;;;;KAqCA;;UAgBK;;EAEhB;;EAEA;;;;;;;;UAagB;;EAEhB;;EAEA;;EAEA;;EAEA,oBAAoB;IAAiB;IAAW;;;EAEhD,QAAQ,YAAY;;EAEpB;;EAEA;EACA;;;KAIW;;;;;;UAOK;;EAEhB;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA,QAAQ;;EAER;;EAEA,OAAO;;EAEP;EACA;EACA;EACA;;;;;;;UAQgB;EAChB;EACA;EACA;EACA;EACA;;;;;;;UAQgB;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;;UAoBgB;EAChB;EACA;EACA;EACA,QAAQ;EACR,2BAA2B,eAAe;EAC1C;;;UAQgB;EAChB;EACA;EACA;EACA;;;;;;;UAQgB;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;UAQgB;EAChB;EACA,OAAO,QAAQ;;;;UCxOC;EAChB,QAAQ;EACR,UAAU,MAAM;;;;;;;;;;iBAWD,sBAAsB,OAAO,YAAY,2CAAwB,IAAA;;;;;iBAYjE,kBAAkB;;;;KCOtB;;;;;UAUK;;EAEhB;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA,OAAO;;;UAQS;;EAEhB,QAAQ;;EAER,aAAa;;EAEb,oBAAoB,QAAQ,QAAQ,KAAK;;EAEzC;;EAEA,QAAQ;;EAER,KAAK;;;;;EAKL;;EAEA;;;;;;;;;;UC7EgB;;EAEhB,kBAAkB,iBAAiB;;;UAQnB;EAChB,MAAM;EACN;EACA,MAAM,QAAM;;;UAQI;EAChB;EACA;EACA;;;KAIW;;;;;;UA8BK;EAChB;EACA;EACA;EACA;EACA;EACA;;;UAQgB;EAChB;EACA;;EAEA;;EAEA,gBAAgB;IAAQ;IAAa;;;;UAIrB;EAChB;EACA;EACA;EACA,OAAO,QAAM;EACb,SAAS;;;UAIO;EAChB;EACA;EACA,MAAM;EACN;EACA,OAAO;;;UAQS;EAChB;EACA;EACA,WAAW;;;;;;UAWK;EAChB;EACA;EACA;;EAEA;;EAEA;;;KAQW;;KAGA;;KAiBA;;UAOK;EAChB;EACA;;;UAIgB;EAChB;EACA;EACA;EACA;;;UAQgB;EAChB,OAAO;EACP;;;UAIgB;EAChB,OAAO;EACP;;;UAIgB;EAChB,OAAO;EACP;;;UAIgB;EAChB,OAAO,YAAY;EACnB;;;UAIgB;EAChB,OAAO,QAAQ;EACf;;UAOgB;;EAEhB,SAAS;;EAET,QAAQ;;EAER;;;;;EAKA;;EAEA,iBAAiB;EACjB,mBAAmB,SAAS;;EAE5B,uBAAuB;;EAEvB,gBAAgB,mCAAmC;;EAEnD,gBAAgB;;EAEhB,qBAAqB;;EAErB,sBAAsB;;;;;;;EAOtB;;EAGA;;EAEA;;;;;EAMA;;;;;;;;;;;;;;;;;;;;;EAsBA,QAlD4B;;;;;;;;;;;;;;;;;;;;;EAwE5B,gBAAgB;;;;;;EAOhB,wBAAwB,QAAQ;;;;;EAMhC;;;;;;;;;;;;;;;;;EAkBA;IACC;IACA;IACA;;;;;;;;;EAUD;;UAGgB,+BAA+B,kBAAkB;EACjE,kBAAkB,QAAQ"}