pptx-react-viewer 3.18.0 → 3.19.1
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 +111 -0
- package/README.md +22 -0
- package/dist/{AiChatPanel-T2QSCUQR.js → AiChatPanel-DLADHD56.js} +24 -24
- package/dist/AiChatPanel-DLADHD56.js.br +0 -0
- package/dist/AiChatPanel-DLADHD56.js.gz +0 -0
- package/dist/{AiChatPanel-DDZC6IRK.mjs → AiChatPanel-MSALNPYW.mjs} +3 -3
- package/dist/AiChatPanel-MSALNPYW.mjs.br +0 -0
- package/dist/AiChatPanel-MSALNPYW.mjs.gz +0 -0
- package/dist/{Area3DChartScene-WTKQDHC7.mjs → Area3DChartScene-53ZVPYKG.mjs} +1 -1
- package/dist/Area3DChartScene-53ZVPYKG.mjs.br +0 -0
- package/dist/Area3DChartScene-53ZVPYKG.mjs.gz +0 -0
- package/dist/{Area3DChartScene-WEU2MP3B.js → Area3DChartScene-BQQHOYRS.js} +2 -2
- package/dist/Area3DChartScene-BQQHOYRS.js.br +0 -0
- package/dist/Area3DChartScene-BQQHOYRS.js.gz +0 -0
- package/dist/{Bar3DChartScene-A5ICLHXS.mjs → Bar3DChartScene-IN67ZH3P.mjs} +1 -1
- package/dist/{Bar3DChartScene-A5ICLHXS.mjs.br → Bar3DChartScene-IN67ZH3P.mjs.br} +0 -0
- package/dist/Bar3DChartScene-IN67ZH3P.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-25G6TG53.js → Bar3DChartScene-PNQOIOIH.js} +2 -2
- package/dist/Bar3DChartScene-PNQOIOIH.js.br +0 -0
- package/dist/Bar3DChartScene-PNQOIOIH.js.gz +0 -0
- package/dist/{Line3DChartScene-ARCDLHXQ.mjs → Line3DChartScene-4SQUUAOW.mjs} +1 -1
- package/dist/{Line3DChartScene-ARCDLHXQ.mjs.br → Line3DChartScene-4SQUUAOW.mjs.br} +0 -0
- package/dist/Line3DChartScene-4SQUUAOW.mjs.gz +0 -0
- package/dist/{Line3DChartScene-WRZ52Z2Z.js → Line3DChartScene-CFSTMTFH.js} +2 -2
- package/dist/Line3DChartScene-CFSTMTFH.js.br +0 -0
- package/dist/Line3DChartScene-CFSTMTFH.js.gz +0 -0
- package/dist/{Model3DScene-JGUG5NPX.js → Model3DScene-DXNAYZ6P.js} +2 -2
- package/dist/Model3DScene-DXNAYZ6P.js.br +0 -0
- package/dist/Model3DScene-DXNAYZ6P.js.gz +0 -0
- package/dist/{Model3DScene-PBKBL2YU.mjs → Model3DScene-TA55BJY7.mjs} +1 -1
- package/dist/Model3DScene-TA55BJY7.mjs.br +0 -0
- package/dist/Model3DScene-TA55BJY7.mjs.gz +0 -0
- package/dist/{PieChart3DScene-S25DNSRS.js → PieChart3DScene-NCBKTWAO.js} +2 -2
- package/dist/PieChart3DScene-NCBKTWAO.js.br +0 -0
- package/dist/PieChart3DScene-NCBKTWAO.js.gz +0 -0
- package/dist/{PieChart3DScene-ZNKXS62H.mjs → PieChart3DScene-TQOCHJOY.mjs} +1 -1
- package/dist/{PieChart3DScene-ZNKXS62H.mjs.br → PieChart3DScene-TQOCHJOY.mjs.br} +0 -0
- package/dist/PieChart3DScene-TQOCHJOY.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-EBT7RPCX.mjs → SurfaceChart3DScene-7CSF2GPT.mjs} +1 -1
- package/dist/SurfaceChart3DScene-7CSF2GPT.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-7CSF2GPT.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-LXBC3HMV.js → SurfaceChart3DScene-VA6IRLFG.js} +2 -2
- package/dist/SurfaceChart3DScene-VA6IRLFG.js.br +0 -0
- package/dist/SurfaceChart3DScene-VA6IRLFG.js.gz +0 -0
- package/dist/{chunk-GNRVDNCV.mjs → chunk-3KVLOKA6.mjs} +4928 -2647
- package/dist/chunk-3KVLOKA6.mjs.br +0 -0
- package/dist/chunk-3KVLOKA6.mjs.gz +0 -0
- package/dist/{chunk-LJ46KXUV.js → chunk-4WUGOCYU.js} +226 -180
- package/dist/chunk-4WUGOCYU.js.br +0 -0
- package/dist/chunk-4WUGOCYU.js.gz +0 -0
- package/dist/{chunk-WGBXO4LM.js → chunk-AZEDCITO.js} +7284 -1263
- package/dist/chunk-AZEDCITO.js.br +0 -0
- package/dist/chunk-AZEDCITO.js.gz +0 -0
- package/dist/{chunk-5S3A6HL3.mjs → chunk-DNQ3PGGU.mjs} +6218 -219
- package/dist/chunk-DNQ3PGGU.mjs.br +0 -0
- package/dist/chunk-DNQ3PGGU.mjs.gz +0 -0
- package/dist/{chunk-V32F4I45.js → chunk-EJSRXEXA.js} +4982 -2647
- package/dist/chunk-EJSRXEXA.js.br +0 -0
- package/dist/chunk-EJSRXEXA.js.gz +0 -0
- package/dist/{chunk-WRO37U2O.mjs → chunk-LBKKSCVS.mjs} +1 -1
- package/dist/chunk-LBKKSCVS.mjs.br +0 -0
- package/dist/chunk-LBKKSCVS.mjs.gz +0 -0
- package/dist/{chunk-2OCTGK4L.mjs → chunk-RCUPQJVY.mjs} +61 -15
- package/dist/chunk-RCUPQJVY.mjs.br +0 -0
- package/dist/chunk-RCUPQJVY.mjs.gz +0 -0
- package/dist/{chunk-2LTTSFLD.js → chunk-YVZKXCML.js} +5 -5
- package/dist/chunk-YVZKXCML.js.br +0 -0
- package/dist/chunk-YVZKXCML.js.gz +0 -0
- package/dist/{chunk-3KKPRPVE.mjs → chunk-Z3KMGLXL.mjs} +216 -5460
- package/dist/chunk-Z3KMGLXL.mjs.br +0 -0
- package/dist/chunk-Z3KMGLXL.mjs.gz +0 -0
- package/dist/{chunk-6R2EUDJQ.js → chunk-ZHPBQVBK.js} +2024 -7268
- package/dist/chunk-ZHPBQVBK.js.br +0 -0
- package/dist/chunk-ZHPBQVBK.js.gz +0 -0
- package/dist/i18n/de.cjs +3765 -0
- package/dist/i18n/de.cjs.br +0 -0
- package/dist/i18n/de.cjs.gz +0 -0
- package/dist/i18n/de.d.cts +3 -0
- package/dist/i18n/de.d.mts +3 -0
- package/dist/i18n/de.mjs +3738 -0
- package/dist/i18n/de.mjs.br +0 -0
- package/dist/i18n/de.mjs.gz +0 -0
- package/dist/i18n/es.cjs +3765 -0
- package/dist/i18n/es.cjs.br +0 -0
- package/dist/i18n/es.cjs.gz +0 -0
- package/dist/i18n/es.d.cts +3 -0
- package/dist/i18n/es.d.mts +3 -0
- package/dist/i18n/es.mjs +3738 -0
- package/dist/i18n/es.mjs.br +0 -0
- package/dist/i18n/es.mjs.gz +0 -0
- package/dist/i18n/fr.cjs +3765 -0
- package/dist/i18n/fr.cjs.br +0 -0
- package/dist/i18n/fr.cjs.gz +0 -0
- package/dist/i18n/fr.d.cts +3 -0
- package/dist/i18n/fr.d.mts +3 -0
- package/dist/i18n/fr.mjs +3738 -0
- package/dist/i18n/fr.mjs.br +0 -0
- package/dist/i18n/fr.mjs.gz +0 -0
- package/dist/i18n/zh-CN.cjs +3803 -0
- package/dist/i18n/zh-CN.cjs.br +0 -0
- package/dist/i18n/zh-CN.cjs.gz +0 -0
- package/dist/i18n/zh-CN.d.cts +3 -0
- package/dist/i18n/zh-CN.d.mts +3 -0
- package/dist/i18n/zh-CN.mjs +3776 -0
- package/dist/i18n/zh-CN.mjs.br +0 -0
- package/dist/i18n/zh-CN.mjs.gz +0 -0
- package/dist/index.d.ts +65 -4
- package/dist/index.js +49 -45
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +2408 -2055
- package/dist/internals.js +182 -78
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- 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/viewer/index.d.ts +13 -0
- package/dist/viewer/index.js +26 -26
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +44 -4
- package/dist/AiChatPanel-DDZC6IRK.mjs.br +0 -0
- package/dist/AiChatPanel-DDZC6IRK.mjs.gz +0 -0
- package/dist/AiChatPanel-T2QSCUQR.js.br +0 -0
- package/dist/AiChatPanel-T2QSCUQR.js.gz +0 -0
- package/dist/Area3DChartScene-WEU2MP3B.js.br +0 -0
- package/dist/Area3DChartScene-WEU2MP3B.js.gz +0 -0
- package/dist/Area3DChartScene-WTKQDHC7.mjs.br +0 -0
- package/dist/Area3DChartScene-WTKQDHC7.mjs.gz +0 -0
- package/dist/Bar3DChartScene-25G6TG53.js.br +0 -0
- package/dist/Bar3DChartScene-25G6TG53.js.gz +0 -0
- package/dist/Bar3DChartScene-A5ICLHXS.mjs.gz +0 -0
- package/dist/Line3DChartScene-ARCDLHXQ.mjs.gz +0 -0
- package/dist/Line3DChartScene-WRZ52Z2Z.js.br +0 -0
- package/dist/Line3DChartScene-WRZ52Z2Z.js.gz +0 -0
- package/dist/Model3DScene-JGUG5NPX.js.br +0 -0
- package/dist/Model3DScene-JGUG5NPX.js.gz +0 -0
- package/dist/Model3DScene-PBKBL2YU.mjs.br +0 -0
- package/dist/Model3DScene-PBKBL2YU.mjs.gz +0 -0
- package/dist/PieChart3DScene-S25DNSRS.js.br +0 -0
- package/dist/PieChart3DScene-S25DNSRS.js.gz +0 -0
- package/dist/PieChart3DScene-ZNKXS62H.mjs.gz +0 -0
- package/dist/PowerPointViewer-Cde_wzd0.d.ts +0 -21
- package/dist/PowerPointViewer-Cde_wzd0.d.ts.map +0 -1
- package/dist/SurfaceChart3DScene-EBT7RPCX.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-EBT7RPCX.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-LXBC3HMV.js.br +0 -0
- package/dist/SurfaceChart3DScene-LXBC3HMV.js.gz +0 -0
- package/dist/audience-content-store-A8Km8rBo.d.ts +0 -402
- package/dist/audience-content-store-A8Km8rBo.d.ts.map +0 -1
- package/dist/chunk-2LTTSFLD.js.br +0 -0
- package/dist/chunk-2LTTSFLD.js.gz +0 -0
- package/dist/chunk-2OCTGK4L.mjs.br +0 -0
- package/dist/chunk-2OCTGK4L.mjs.gz +0 -0
- package/dist/chunk-3KKPRPVE.mjs.br +0 -0
- package/dist/chunk-3KKPRPVE.mjs.gz +0 -0
- package/dist/chunk-5S3A6HL3.mjs.br +0 -0
- package/dist/chunk-5S3A6HL3.mjs.gz +0 -0
- package/dist/chunk-6R2EUDJQ.js.br +0 -0
- package/dist/chunk-6R2EUDJQ.js.gz +0 -0
- package/dist/chunk-GNRVDNCV.mjs.br +0 -0
- package/dist/chunk-GNRVDNCV.mjs.gz +0 -0
- package/dist/chunk-LJ46KXUV.js.br +0 -0
- package/dist/chunk-LJ46KXUV.js.gz +0 -0
- package/dist/chunk-V32F4I45.js.br +0 -0
- package/dist/chunk-V32F4I45.js.gz +0 -0
- package/dist/chunk-WGBXO4LM.js.br +0 -0
- package/dist/chunk-WGBXO4LM.js.gz +0 -0
- package/dist/chunk-WRO37U2O.mjs.br +0 -0
- package/dist/chunk-WRO37U2O.mjs.gz +0 -0
- package/dist/index-CGKutKk1.d.ts +0 -46
- package/dist/index-CGKutKk1.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/internals.d.ts.map +0 -1
- package/dist/types-BqB2ZCwS.d.ts +0 -836
- package/dist/types-BqB2ZCwS.d.ts.map +0 -1
- package/dist/useViewerBuildingBlocks-4Tj6P8Fm.d.ts +0 -523
- package/dist/useViewerBuildingBlocks-4Tj6P8Fm.d.ts.map +0 -1
- package/dist/viewer/index.d.ts.map +0 -1
package/dist/types-BqB2ZCwS.d.ts
DELETED
|
@@ -1,836 +0,0 @@
|
|
|
1
|
-
import { n as LocaleCatalogEntry } from "./index-CGKutKk1.js";
|
|
2
|
-
import { ConnectorArrowType, PptxAnimationPreset, PptxData, PptxElement, PptxElementAnimation, PptxHandler, PptxSlide, PptxSlideTransition, PptxTheme, ShapeStyle, StrokeDashType, XmlObject } from "pptx-viewer-core";
|
|
3
|
-
import { AccountAuthConfig, CollaborationConfig as CollaborationConfig$1, CollaborationRole, ElementClipboardPayload, PowerPointViewerAPI, ShapeAdjustmentDragState, ShapeAdjustmentHandleDescriptor as ShapeAdjustmentHandleDescriptor$1, THEME_CATALOG, ThemeCatalogEntry, ThemeCatalogEntry as ThemeCatalogEntry$1, ToolbarActionId, ViewerFontSource, ViewerMode as ViewerMode$1, ViewerTheme, ViewerThemeColors, ViewportFitOptions, defaultCssVars, defaultRadius, defaultThemeColors, resolveThemeCatalogEntry, themeToCssVars, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius } from "pptx-viewer-shared";
|
|
4
|
-
import { ChatTransport, LanguageModel, ToolSet, UIMessage } from "ai";
|
|
5
|
-
import "zod";
|
|
6
|
-
import "pptx-viewer-mcp";
|
|
7
|
-
import React$1 from "react";
|
|
8
|
-
import { Doc } from "yjs";
|
|
9
|
-
//#region src/viewer/types-core.d.ts
|
|
10
|
-
/**
|
|
11
|
-
* Union of all shape preset types that the viewer can insert or render.
|
|
12
|
-
* Maps to OOXML `a:prstGeom` preset values (e.g. "rect", "ellipse").
|
|
13
|
-
* Includes basic shapes, arrows, connectors, and freeform paths.
|
|
14
|
-
*/
|
|
15
|
-
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';
|
|
16
|
-
/**
|
|
17
|
-
* Connector geometry presets corresponding to OOXML `a:prstGeom` connector types.
|
|
18
|
-
* Determines the routing style (straight, bent with N segments, or curved).
|
|
19
|
-
*/
|
|
20
|
-
type ConnectorGeometryType = 'straightConnector1' | 'bentConnector2' | 'bentConnector3' | 'bentConnector4' | 'bentConnector5' | 'curvedConnector2' | 'curvedConnector3' | 'curvedConnector4' | 'curvedConnector5';
|
|
21
|
-
/** The pixel dimensions of the slide canvas (presentation slide size). */
|
|
22
|
-
interface CanvasSize {
|
|
23
|
-
/** Width of the canvas in CSS pixels. */
|
|
24
|
-
width: number;
|
|
25
|
-
/** Height of the canvas in CSS pixels. */
|
|
26
|
-
height: number;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Tracks the state of an ongoing element drag operation.
|
|
30
|
-
* Created on pointer-down and destroyed on pointer-up.
|
|
31
|
-
* During the drag, position changes are applied directly to DOM elements
|
|
32
|
-
* for performance (bypassing React state) and committed to state on completion.
|
|
33
|
-
*/
|
|
34
|
-
interface DragState {
|
|
35
|
-
/** ID of the primary element being dragged. */
|
|
36
|
-
elementId: string;
|
|
37
|
-
/** Client X coordinate at the start of the drag. */
|
|
38
|
-
startClientX: number;
|
|
39
|
-
/** Client Y coordinate at the start of the drag. */
|
|
40
|
-
startClientY: number;
|
|
41
|
-
/** Original positions of all selected elements, keyed by element ID. */
|
|
42
|
-
startPositionsById: Record<string, {
|
|
43
|
-
x: number;
|
|
44
|
-
y: number;
|
|
45
|
-
}>;
|
|
46
|
-
/** DOM elements cached at drag-start to avoid per-frame querySelector calls. */
|
|
47
|
-
domEls: Map<string, HTMLElement>;
|
|
48
|
-
/** Whether the pointer has actually moved since the drag started. */
|
|
49
|
-
moved: boolean;
|
|
50
|
-
/** Accumulated delta, stored during DOM-only drag, committed on pointerup. */
|
|
51
|
-
lastDx: number;
|
|
52
|
-
lastDy: number;
|
|
53
|
-
}
|
|
54
|
-
/** Handle used as the resize anchor point (corners + edge midpoints). */
|
|
55
|
-
type ResizeHandle = 'nw' | 'ne' | 'sw' | 'se' | 'n' | 's' | 'e' | 'w';
|
|
56
|
-
/**
|
|
57
|
-
* Tracks the state of an ongoing element resize operation.
|
|
58
|
-
* Uses direct DOM manipulation during the resize for performance,
|
|
59
|
-
* then commits the final geometry to React state on pointer-up.
|
|
60
|
-
*/
|
|
61
|
-
interface ResizeState {
|
|
62
|
-
/** ID of the element being resized. */
|
|
63
|
-
elementId: string;
|
|
64
|
-
/** Client X coordinate at the start of the resize. */
|
|
65
|
-
startClientX: number;
|
|
66
|
-
/** Client Y coordinate at the start of the resize. */
|
|
67
|
-
startClientY: number;
|
|
68
|
-
/** Original X position of the element. */
|
|
69
|
-
startX: number;
|
|
70
|
-
/** Original Y position of the element. */
|
|
71
|
-
startY: number;
|
|
72
|
-
/** Original width of the element. */
|
|
73
|
-
startWidth: number;
|
|
74
|
-
/** Original height of the element. */
|
|
75
|
-
startHeight: number;
|
|
76
|
-
/** Which handle initiated the resize. */
|
|
77
|
-
handle: ResizeHandle;
|
|
78
|
-
/** Whether the pointer has actually moved since the resize started. */
|
|
79
|
-
moved: boolean;
|
|
80
|
-
/** DOM element cached at resize-start to avoid per-frame querySelector calls. */
|
|
81
|
-
domEl: HTMLElement | null;
|
|
82
|
-
/** Accumulated final geometry, committed on pointerup. */
|
|
83
|
-
lastX: number;
|
|
84
|
-
lastY: number;
|
|
85
|
-
lastWidth: number;
|
|
86
|
-
lastHeight: number;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* A snapshot of editor state captured for undo/redo history.
|
|
90
|
-
* Contains the full slide deck state at a point in time so that
|
|
91
|
-
* any editing operation can be reverted or replayed.
|
|
92
|
-
*/
|
|
93
|
-
interface EditorHistorySnapshot {
|
|
94
|
-
width: number;
|
|
95
|
-
height: number;
|
|
96
|
-
activeSlideIndex: number;
|
|
97
|
-
slides: PptxSlide[];
|
|
98
|
-
templateElementsBySlideId: Record<string, PptxElement[]>;
|
|
99
|
-
actionLabel?: string;
|
|
100
|
-
}
|
|
101
|
-
/** Axis-aligned bounding box for an element, used for hit-testing and alignment. */
|
|
102
|
-
interface ElementBounds {
|
|
103
|
-
minX: number;
|
|
104
|
-
minY: number;
|
|
105
|
-
maxX: number;
|
|
106
|
-
maxY: number;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Geometry data for rendering a connector line as an SVG path.
|
|
110
|
-
* Includes start/end coordinates, the SVG path data string,
|
|
111
|
-
* and optional marker (arrowhead) identifiers.
|
|
112
|
-
*/
|
|
113
|
-
interface ConnectorPathGeometry {
|
|
114
|
-
startX: number;
|
|
115
|
-
startY: number;
|
|
116
|
-
endX: number;
|
|
117
|
-
endY: number;
|
|
118
|
-
pathData: string;
|
|
119
|
-
d?: string;
|
|
120
|
-
viewBox?: string;
|
|
121
|
-
startMarkerId?: string;
|
|
122
|
-
endMarkerId?: string;
|
|
123
|
-
}
|
|
124
|
-
/** A named preset shape style used in the Quick Styles gallery. */
|
|
125
|
-
interface ShapeQuickStyle {
|
|
126
|
-
name: string;
|
|
127
|
-
style: Partial<ShapeStyle>;
|
|
128
|
-
}
|
|
129
|
-
//#endregion
|
|
130
|
-
//#region src/theme/context.d.ts
|
|
131
|
-
interface ViewerThemeProviderProps {
|
|
132
|
-
theme?: ViewerTheme;
|
|
133
|
-
children: React.ReactNode;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Provides a `ViewerTheme` to all descendant viewer components.
|
|
137
|
-
*
|
|
138
|
-
* Typically you do **not** need to use this directly; passing a `theme`
|
|
139
|
-
* prop to `<PowerPointViewer>` is sufficient. This provider is exposed
|
|
140
|
-
* for advanced use-cases where you want to wrap multiple viewers or
|
|
141
|
-
* share a theme across a wider subtree.
|
|
142
|
-
*/
|
|
143
|
-
declare function ViewerThemeProvider({ theme, children }: ViewerThemeProviderProps): import("react").JSX.Element;
|
|
144
|
-
/**
|
|
145
|
-
* Returns the active `ViewerTheme` (if any) from the nearest
|
|
146
|
-
* `ViewerThemeProvider`.
|
|
147
|
-
*/
|
|
148
|
-
declare function useViewerTheme(): ViewerTheme | undefined;
|
|
149
|
-
//#endregion
|
|
150
|
-
//#region ../shared/dist/ai/index.d.ts
|
|
151
|
-
//#endregion
|
|
152
|
-
//#region src/ai/change-animator.d.ts
|
|
153
|
-
/** Host-tunable options for how AI edits are animated on the canvas. */
|
|
154
|
-
interface AiChangeAnimationConfig {
|
|
155
|
-
/** Master switch. Default true. */
|
|
156
|
-
enabled?: boolean;
|
|
157
|
-
/** How long the motion + glow plays, in ms. Default 900. */
|
|
158
|
-
durationMs?: number;
|
|
159
|
-
/** Draw the pulsing glow highlight on changed elements. Default true. */
|
|
160
|
-
glow?: boolean;
|
|
161
|
-
/** Glide old->new bounds and cross-fade colours. Default true. */
|
|
162
|
-
tween?: boolean;
|
|
163
|
-
/** Accent colour (any CSS colour) for the glow/ghosts. Default a blue. */
|
|
164
|
-
color?: string;
|
|
165
|
-
}
|
|
166
|
-
//#endregion
|
|
167
|
-
//#region src/ai/config.d.ts
|
|
168
|
-
/** The UI message shape exchanged with the assistant. Alias of the SDK type. */
|
|
169
|
-
type PptxAiUIMessage = UIMessage;
|
|
170
|
-
/**
|
|
171
|
-
* Canonical name of every tool the assistant can call. Document tools mirror the
|
|
172
|
-
* `pptx-viewer-mcp` server exactly (they ARE the same functions, run against the
|
|
173
|
-
* live deck); the viewer-only tools (navigation, deck outline, element/notes
|
|
174
|
-
* readers, table merge) have no MCP counterpart.
|
|
175
|
-
*/
|
|
176
|
-
type PptxAiToolName = 'get_deck_overview' | 'get_slide' | 'get_element' | 'get_speaker_notes' | 'find_text' | 'get_theme' | 'go_to_slide' | 'select_elements' | 'merge_tables' | 'get_metadata' | 'get_layouts' | 'find_placeholders' | 'get_presentation_properties' | 'run_accessibility_check' | 'convert_to_markdown' | 'export_to_json' | 'add_element' | 'update_element' | 'delete_elements' | 'arrange_elements' | 'clone_element' | 'set_element_animation' | 'group_elements' | 'ungroup_elements' | 'batch_update_elements' | 'update_element_style' | 'replace_geometry' | 'set_element_lock' | 'manage_hyperlinks' | 'replace_text' | 'manage_comments' | 'update_table_cells' | 'manage_table_structure' | 'create_chart' | 'update_chart' | 'add_chart_series' | 'remove_chart_series' | 'update_chart_series_data' | 'manage_smart_art' | 'apply_template' | 'add_slide' | 'duplicate_slide' | 'delete_slides' | 'reorder_slides' | 'update_slide_properties' | 'set_slide_transition' | 'apply_theme_preset' | 'update_theme_colors' | 'update_theme_fonts' | 'set_canvas_size' | 'update_metadata' | 'manage_sections' | 'update_presentation_properties' | 'import_from_json' | 'apply_layout';
|
|
177
|
-
type Resolvable<T> = T | (() => T | Promise<T>);
|
|
178
|
-
/** How the assistant reaches a language model. */
|
|
179
|
-
type PptxAiConnection =
|
|
180
|
-
/**
|
|
181
|
-
* Post messages to a host backend route (recommended for production so the
|
|
182
|
-
* provider API key stays server-side). Maps to `DefaultChatTransport`.
|
|
183
|
-
*/
|
|
184
|
-
{
|
|
185
|
-
kind: 'endpoint';
|
|
186
|
-
api: string;
|
|
187
|
-
headers?: Resolvable<Record<string, string>>;
|
|
188
|
-
body?: Resolvable<Record<string, unknown>>;
|
|
189
|
-
credentials?: RequestCredentials;
|
|
190
|
-
fetch?: typeof globalThis.fetch;
|
|
191
|
-
} |
|
|
192
|
-
/**
|
|
193
|
-
* Run a language model in-process in the browser (bring-your-own key /
|
|
194
|
-
* local model). Maps to a `ToolLoopAgent` behind a `DirectChatTransport`.
|
|
195
|
-
*/
|
|
196
|
-
{
|
|
197
|
-
kind: 'model';
|
|
198
|
-
model: LanguageModel;
|
|
199
|
-
system?: string;
|
|
200
|
-
maxSteps?: number;
|
|
201
|
-
} |
|
|
202
|
-
/** Provide a fully-constructed transport (advanced / testing escape hatch). */
|
|
203
|
-
{
|
|
204
|
-
kind: 'transport';
|
|
205
|
-
transport: ChatTransport<PptxAiUIMessage>;
|
|
206
|
-
};
|
|
207
|
-
/** How writes proposed by the assistant reach the document. */
|
|
208
|
-
type PptxAiWritePolicy = 'stage' | 'approve' | 'auto';
|
|
209
|
-
/** Which deck context is fed to the model with each turn. */
|
|
210
|
-
type PptxAiContextStrategy = 'outline' | 'current-slide' | 'none';
|
|
211
|
-
/** Optional per-session history persistence hooks. */
|
|
212
|
-
interface PptxAiHistoryHooks {
|
|
213
|
-
load?(id: string): Promise<PptxAiUIMessage[]>;
|
|
214
|
-
save?(id: string, messages: PptxAiUIMessage[]): Promise<void>;
|
|
215
|
-
}
|
|
216
|
-
/** Complete host configuration for an AI chat session. */
|
|
217
|
-
interface PptxAiConfig {
|
|
218
|
-
connection: PptxAiConnection;
|
|
219
|
-
/** Extra host instructions appended to the base system prompt. */
|
|
220
|
-
systemPromptExtras?: string;
|
|
221
|
-
tools?: {
|
|
222
|
-
/** Allowlist. When set, only these tools are exposed. */
|
|
223
|
-
enabled?: PptxAiToolName[];
|
|
224
|
-
/** Denylist, applied after `enabled`. */
|
|
225
|
-
disabled?: PptxAiToolName[];
|
|
226
|
-
/** Additional host-defined tools merged into the tool set. */
|
|
227
|
-
extra?: ToolSet;
|
|
228
|
-
};
|
|
229
|
-
/** Default `'stage'`. */
|
|
230
|
-
writePolicy?: PptxAiWritePolicy;
|
|
231
|
-
/** Default `'outline'`. */
|
|
232
|
-
contextStrategy?: PptxAiContextStrategy;
|
|
233
|
-
history?: PptxAiHistoryHooks;
|
|
234
|
-
/**
|
|
235
|
-
* How AI edits are animated on the canvas so the user can watch them land
|
|
236
|
-
* (glide old->new, fade/scale in-out, glow-pulse). Omit for the defaults;
|
|
237
|
-
* set `{ enabled: false }` to turn it off.
|
|
238
|
-
*/
|
|
239
|
-
changeAnimation?: AiChangeAnimationConfig;
|
|
240
|
-
onError?(error: Error): void;
|
|
241
|
-
}
|
|
242
|
-
//#endregion
|
|
243
|
-
//#region src/ai/bridge.d.ts
|
|
244
|
-
/** Lightweight, model-friendly summary of the whole deck. */
|
|
245
|
-
interface PptxAiDeckMeta {
|
|
246
|
-
/** Total number of slides. */
|
|
247
|
-
slideCount: number;
|
|
248
|
-
/** Zero-based index of the currently active slide. */
|
|
249
|
-
activeSlideIndex: number;
|
|
250
|
-
/** Deck title, when known (first slide title / core properties). */
|
|
251
|
-
title?: string;
|
|
252
|
-
/** Slide canvas width in CSS pixels. */
|
|
253
|
-
width: number;
|
|
254
|
-
/** Slide canvas height in CSS pixels. */
|
|
255
|
-
height: number;
|
|
256
|
-
}
|
|
257
|
-
/** Severity hint for {@link PptxAiBridge.notify}. */
|
|
258
|
-
type PptxAiNotifyLevel = 'info' | 'success' | 'warning' | 'error';
|
|
259
|
-
/**
|
|
260
|
-
* A target the user has scoped the assistant to: either a whole slide or a
|
|
261
|
-
* single element on a slide. Returned by {@link PptxAiBridge.getFocusedTargets}
|
|
262
|
-
* so the context builder can tell the model exactly what to focus on.
|
|
263
|
-
*/
|
|
264
|
-
type PptxAiFocusedTarget = {
|
|
265
|
-
kind: 'slide';
|
|
266
|
-
slideIndex: number;
|
|
267
|
-
} | {
|
|
268
|
-
kind: 'element';
|
|
269
|
-
slideIndex: number;
|
|
270
|
-
elementId: string;
|
|
271
|
-
};
|
|
272
|
-
/**
|
|
273
|
-
* A pure updater over the deck's slides. It receives a deep clone of the
|
|
274
|
-
* current slides (mutation-safe) and returns the next slides array. The bridge
|
|
275
|
-
* commits the returned array as ONE history entry.
|
|
276
|
-
*/
|
|
277
|
-
type PptxAiSlidesUpdater = (slides: PptxSlide[]) => PptxSlide[];
|
|
278
|
-
/**
|
|
279
|
-
* A pure updater over the whole parsed deck ({@link PptxData}). Mirrors the
|
|
280
|
-
* `pptx-viewer-mcp` tool model (data in, mutated data out) so presentation-level
|
|
281
|
-
* MCP tools (metadata, sections, canvas size, presentation properties, layouts)
|
|
282
|
-
* can be committed as ONE undoable history entry through {@link
|
|
283
|
-
* PptxAiBridge.applyDeckData}. Optional: bindings that only track slide/theme
|
|
284
|
-
* state can omit it, in which case those presentation-level tools report that
|
|
285
|
-
* they are unavailable in this viewer while every slide/theme tool still works.
|
|
286
|
-
*/
|
|
287
|
-
type PptxAiDataUpdater = (data: PptxData) => PptxData;
|
|
288
|
-
/** Field-level updates for a single element, mirroring the MCP update vocab. */
|
|
289
|
-
interface PptxAiElementUpdate {
|
|
290
|
-
x?: number;
|
|
291
|
-
y?: number;
|
|
292
|
-
width?: number;
|
|
293
|
-
height?: number;
|
|
294
|
-
rotation?: number;
|
|
295
|
-
opacity?: number;
|
|
296
|
-
hidden?: boolean;
|
|
297
|
-
flipHorizontal?: boolean;
|
|
298
|
-
flipVertical?: boolean;
|
|
299
|
-
text?: string;
|
|
300
|
-
fontSize?: number;
|
|
301
|
-
fontFamily?: string;
|
|
302
|
-
fontColor?: string;
|
|
303
|
-
bold?: boolean;
|
|
304
|
-
italic?: boolean;
|
|
305
|
-
underline?: boolean;
|
|
306
|
-
align?: 'left' | 'center' | 'right' | 'justify';
|
|
307
|
-
fillColor?: string;
|
|
308
|
-
strokeColor?: string;
|
|
309
|
-
strokeWidth?: number;
|
|
310
|
-
}
|
|
311
|
-
/**
|
|
312
|
-
* Implemented by each binding to expose its live editor to the AI core.
|
|
313
|
-
*
|
|
314
|
-
* Read methods must be cheap and synchronous. Write methods must route through
|
|
315
|
-
* the binding's editor-history layer so AI edits are undoable like manual ones.
|
|
316
|
-
*/
|
|
317
|
-
interface PptxAiBridge {
|
|
318
|
-
/** Return a summary of the whole deck. */
|
|
319
|
-
getDeckMeta(): PptxAiDeckMeta;
|
|
320
|
-
/** Return the deck's slides. Callers must not mutate the returned array. */
|
|
321
|
-
getSlides(): PptxSlide[];
|
|
322
|
-
/** Return the zero-based index of the active slide. */
|
|
323
|
-
getActiveSlideIndex(): number;
|
|
324
|
-
/** Return the resolved presentation theme, when available. */
|
|
325
|
-
getTheme(): PptxTheme | undefined;
|
|
326
|
-
/** Return the underlying core handler, when the binding exposes one. */
|
|
327
|
-
getHandler(): PptxHandler | undefined;
|
|
328
|
-
/** Navigate the viewer to a slide by zero-based index. */
|
|
329
|
-
goToSlide(index: number): void;
|
|
330
|
-
/** Select the given elements on a slide (empty array clears selection). */
|
|
331
|
-
selectElements(slideIndex: number, elementIds: string[]): void;
|
|
332
|
-
/**
|
|
333
|
-
* Apply a slides updater as a single, atomic, undoable history entry. The
|
|
334
|
-
* binding is responsible for cloning current slides before calling
|
|
335
|
-
* `updater` and for installing the result.
|
|
336
|
-
*/
|
|
337
|
-
applySlidesUpdate(updater: PptxAiSlidesUpdater, label: string): void;
|
|
338
|
-
/** Apply field updates to one element as a single history entry. */
|
|
339
|
-
updateElement(slideIndex: number, elementId: string, updates: PptxAiElementUpdate): void;
|
|
340
|
-
/** Apply partial theme updates as a single history entry. */
|
|
341
|
-
applyTheme(updates: Partial<PptxTheme>): void;
|
|
342
|
-
/**
|
|
343
|
-
* Return the full parsed {@link PptxData} for the open deck, with the live
|
|
344
|
-
* (edited) slides and theme overlaid. Enables `pptx-viewer-mcp` tools that
|
|
345
|
-
* read presentation-level state (metadata, sections, layouts, presentation
|
|
346
|
-
* properties). Optional: when absent, the AI core synthesises a minimal
|
|
347
|
-
* PptxData from slides + dimensions, which is enough for every slide/theme
|
|
348
|
-
* tool but not for presentation-level reads.
|
|
349
|
-
*/
|
|
350
|
-
getDeckData?(): PptxData | undefined;
|
|
351
|
-
/**
|
|
352
|
-
* Commit a whole-deck {@link PptxData} mutation as one undoable history entry.
|
|
353
|
-
* Used to apply presentation-level MCP tool results (metadata, sections,
|
|
354
|
-
* canvas size, presentation properties, layouts). Optional: when absent,
|
|
355
|
-
* those tools report they are not supported in this viewer; slide/theme tools
|
|
356
|
-
* are unaffected (they route through {@link PptxAiBridge.applySlidesUpdate}
|
|
357
|
-
* and {@link PptxAiBridge.applyTheme}).
|
|
358
|
-
*/
|
|
359
|
-
applyDeckData?(updater: PptxAiDataUpdater, label: string): void;
|
|
360
|
-
/**
|
|
361
|
-
* Return the slides / elements the user has scoped the assistant to, if any.
|
|
362
|
-
* When present and non-empty, the context builder tells the model to focus on
|
|
363
|
-
* exactly these targets. Optional so existing bridges satisfy the contract
|
|
364
|
-
* without change; a bridge that does not implement it behaves as before (no
|
|
365
|
-
* focus scoping).
|
|
366
|
-
*/
|
|
367
|
-
getFocusedTargets?(): PptxAiFocusedTarget[];
|
|
368
|
-
/** Surface a transient message in the host UI (toast / status line). */
|
|
369
|
-
notify?(message: string, level?: PptxAiNotifyLevel): void;
|
|
370
|
-
}
|
|
371
|
-
//#endregion
|
|
372
|
-
//#region src/viewer/hooks/collaboration/types.d.ts
|
|
373
|
-
/** Connection lifecycle states for the Yjs WebSocket provider. */
|
|
374
|
-
type ConnectionStatus = 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
375
|
-
/**
|
|
376
|
-
* Presence data broadcast to other participants.
|
|
377
|
-
* Cursor position is relative to the slide canvas (0..canvasWidth, 0..canvasHeight).
|
|
378
|
-
*/
|
|
379
|
-
interface UserPresence {
|
|
380
|
-
/** Unique client ID (assigned by Yjs awareness). */
|
|
381
|
-
clientId: number;
|
|
382
|
-
/** Sanitised display name. */
|
|
383
|
-
userName: string;
|
|
384
|
-
/** Optional avatar URL (validated). */
|
|
385
|
-
userAvatar?: string;
|
|
386
|
-
/** Hex colour for the user's cursor ring. */
|
|
387
|
-
userColor: string;
|
|
388
|
-
/** Slide index the user is currently viewing. */
|
|
389
|
-
activeSlideIndex: number;
|
|
390
|
-
/** Cursor X on the canvas (clamped to slide bounds). */
|
|
391
|
-
cursorX: number;
|
|
392
|
-
/** Cursor Y on the canvas (clamped to slide bounds). */
|
|
393
|
-
cursorY: number;
|
|
394
|
-
/** ISO timestamp of last update (for stale-presence cleanup). */
|
|
395
|
-
lastUpdated: string;
|
|
396
|
-
/** Optional currently selected element ID. */
|
|
397
|
-
selectedElementId?: string;
|
|
398
|
-
/** Role in the session (owner, viewer, or collaborator). */
|
|
399
|
-
role?: CollaborationRole;
|
|
400
|
-
}
|
|
401
|
-
/** Value exposed by `CollaborationContext`. */
|
|
402
|
-
interface CollaborationContextValue {
|
|
403
|
-
/** Current WebSocket connection status. */
|
|
404
|
-
status: ConnectionStatus;
|
|
405
|
-
/** Presence data for all remote users (excludes the local user). */
|
|
406
|
-
remoteUsers: UserPresence[];
|
|
407
|
-
/** Broadcast the local user's presence state. */
|
|
408
|
-
broadcastPresence: (update: Partial<Omit<UserPresence, 'clientId'>>) => void;
|
|
409
|
-
/** Total number of connected users (including local). */
|
|
410
|
-
connectedCount: number;
|
|
411
|
-
/** The collaboration config that was provided. */
|
|
412
|
-
config: CollaborationConfig$1;
|
|
413
|
-
/** The Yjs document (for document sync). */
|
|
414
|
-
doc: Doc | null;
|
|
415
|
-
/**
|
|
416
|
-
* Whether the provider completed its initial document sync (or the
|
|
417
|
-
* first-write grace period elapsed). Local doc writes are gated on this.
|
|
418
|
-
*/
|
|
419
|
-
synced: boolean;
|
|
420
|
-
/** Manually retry the WebSocket connection after a timeout or error. */
|
|
421
|
-
retry: () => void;
|
|
422
|
-
}
|
|
423
|
-
//#endregion
|
|
424
|
-
//#region src/viewer/types-ui.d.ts
|
|
425
|
-
/**
|
|
426
|
-
* Base handle interface for file viewer components.
|
|
427
|
-
* Defined locally to avoid dependency on external file-viewer plugin packages.
|
|
428
|
-
* Provides a standard `getContent` method used by the host application to
|
|
429
|
-
* retrieve the current file content (e.g. for saving).
|
|
430
|
-
*/
|
|
431
|
-
interface FileViewerHandle {
|
|
432
|
-
/** Get the current content of the file (for saving) */
|
|
433
|
-
getContent: () => Promise<string | Uint8Array>;
|
|
434
|
-
}
|
|
435
|
-
/** A shape preset entry used in the toolbar shape insertion palette. */
|
|
436
|
-
interface ShapePreset {
|
|
437
|
-
type: SupportedShapeType;
|
|
438
|
-
label: string;
|
|
439
|
-
icon: React$1.ReactNode;
|
|
440
|
-
}
|
|
441
|
-
/** Tracks the position and target element of an open context menu. */
|
|
442
|
-
interface ElementContextMenuState {
|
|
443
|
-
x: number;
|
|
444
|
-
y: number;
|
|
445
|
-
elementId: string;
|
|
446
|
-
}
|
|
447
|
-
/** Identifies an action triggered from the element right-click context menu. */
|
|
448
|
-
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';
|
|
449
|
-
/**
|
|
450
|
-
* State of an active marquee (rubber-band) selection rectangle.
|
|
451
|
-
* Created when the user clicks and drags on the canvas background,
|
|
452
|
-
* and used to compute which elements fall within the selection area.
|
|
453
|
-
*/
|
|
454
|
-
interface MarqueeSelectionState {
|
|
455
|
-
startX: number;
|
|
456
|
-
startY: number;
|
|
457
|
-
currentX: number;
|
|
458
|
-
currentY: number;
|
|
459
|
-
additive: boolean;
|
|
460
|
-
baseSelectionIds?: string[];
|
|
461
|
-
}
|
|
462
|
-
/** Tracks which table cell is selected and/or actively being edited. */
|
|
463
|
-
interface TableCellEditorState {
|
|
464
|
-
rowIndex: number;
|
|
465
|
-
columnIndex: number;
|
|
466
|
-
/** When true the cell has an active text input. */
|
|
467
|
-
isEditing?: boolean;
|
|
468
|
-
/** Optional multi-cell selection (Shift+Click range). Each entry is {row, col}. */
|
|
469
|
-
selectedCells?: Array<{
|
|
470
|
-
row: number;
|
|
471
|
-
col: number;
|
|
472
|
-
}>;
|
|
473
|
-
}
|
|
474
|
-
/** A single parsed table cell with its position, text content, and computed CSS style. */
|
|
475
|
-
interface ParsedTableCell {
|
|
476
|
-
rowIndex: number;
|
|
477
|
-
columnIndex: number;
|
|
478
|
-
text: string;
|
|
479
|
-
style: React$1.CSSProperties;
|
|
480
|
-
rawCell: XmlObject;
|
|
481
|
-
}
|
|
482
|
-
/** Complete parsed table data including row/column structure and all cells. */
|
|
483
|
-
interface ParsedTableData {
|
|
484
|
-
rowCount: number;
|
|
485
|
-
columnCount: number;
|
|
486
|
-
rows: XmlObject[];
|
|
487
|
-
columnPercentages: number[];
|
|
488
|
-
cells: ParsedTableCell[];
|
|
489
|
-
}
|
|
490
|
-
/** Runtime state for a single element's animation during presentation mode. */
|
|
491
|
-
interface PresentationAnimationRuntime {
|
|
492
|
-
elementId: string;
|
|
493
|
-
state: 'hidden' | 'entering' | 'visible';
|
|
494
|
-
animation: PptxElementAnimation;
|
|
495
|
-
}
|
|
496
|
-
/**
|
|
497
|
-
* Groups slides into named sections for the slides pane sidebar.
|
|
498
|
-
* Corresponds to OOXML `p15:section` elements in `presentation.xml`.
|
|
499
|
-
*/
|
|
500
|
-
interface SlideSectionGroup {
|
|
501
|
-
id: string;
|
|
502
|
-
label: string;
|
|
503
|
-
slideIndexes: number[];
|
|
504
|
-
/** Section highlight color from p15:sectionPr. */
|
|
505
|
-
color?: string;
|
|
506
|
-
/** Whether the section should start collapsed (from p15:sectionPr). */
|
|
507
|
-
defaultCollapsed?: boolean;
|
|
508
|
-
}
|
|
509
|
-
/** Alignment direction for distributing/aligning multiple selected elements on the slide. */
|
|
510
|
-
type SlideAlignment = 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom';
|
|
511
|
-
/** Identifies one of the ribbon-style toolbar tabs (home, insert, text, etc.). */
|
|
512
|
-
type ToolbarSection = 'file' | 'home' | 'insert' | 'text' | 'arrange' | 'draw' | 'design' | 'transitions' | 'animations' | 'slideShow' | 'record' | 'review' | 'view' | 'help';
|
|
513
|
-
/** The active drawing/inking tool selected in the Draw toolbar tab. */
|
|
514
|
-
type DrawingTool = 'select' | 'pen' | 'highlighter' | 'eraser' | 'freeform';
|
|
515
|
-
/** A single entry in the keyboard shortcuts help panel. */
|
|
516
|
-
interface ShortcutReferenceItem {
|
|
517
|
-
actionKey: string;
|
|
518
|
-
shortcut: string;
|
|
519
|
-
}
|
|
520
|
-
/** An accessibility audit finding (missing alt text, reading order issues, etc.). */
|
|
521
|
-
interface AccessibilityIssue {
|
|
522
|
-
slideIndex: number;
|
|
523
|
-
elementId?: string;
|
|
524
|
-
severity: 'error' | 'warning' | 'info';
|
|
525
|
-
message: string;
|
|
526
|
-
}
|
|
527
|
-
/** Dropdown option for selecting a connector geometry type. */
|
|
528
|
-
interface ConnectorGeometryOption {
|
|
529
|
-
value: ConnectorGeometryType;
|
|
530
|
-
label: string;
|
|
531
|
-
}
|
|
532
|
-
/** Dropdown option for selecting a connector arrowhead style. */
|
|
533
|
-
interface ConnectorArrowOption {
|
|
534
|
-
value: ConnectorArrowType;
|
|
535
|
-
label: string;
|
|
536
|
-
}
|
|
537
|
-
/** Dropdown option for selecting a stroke dash pattern. */
|
|
538
|
-
interface StrokeDashOption {
|
|
539
|
-
value: StrokeDashType;
|
|
540
|
-
label: string;
|
|
541
|
-
}
|
|
542
|
-
/** Dropdown option for selecting a slide transition type. */
|
|
543
|
-
interface SlideTransitionOption {
|
|
544
|
-
value: NonNullable<PptxSlideTransition['type']>;
|
|
545
|
-
label: string;
|
|
546
|
-
}
|
|
547
|
-
/** Dropdown option for selecting an animation effect preset. */
|
|
548
|
-
interface AnimationPresetOption {
|
|
549
|
-
value: Exclude<PptxAnimationPreset, 'none'>;
|
|
550
|
-
label: string;
|
|
551
|
-
}
|
|
552
|
-
interface PowerPointViewerProps extends ViewportFitOptions {
|
|
553
|
-
/** PowerPoint content as Uint8Array */
|
|
554
|
-
content: Uint8Array;
|
|
555
|
-
/** Licensed fonts supplied by the host application. No fonts are bundled. */
|
|
556
|
-
fonts?: ViewerFontSource[];
|
|
557
|
-
/** Original file path, used for autosave recovery */
|
|
558
|
-
filePath?: string;
|
|
559
|
-
/**
|
|
560
|
-
* Display name of the open document, shown in the PowerPoint-style title
|
|
561
|
-
* bar (e.g. "quarterly-review.pptx"). Falls back to a generic label.
|
|
562
|
-
*/
|
|
563
|
-
fileName?: string;
|
|
564
|
-
/** Callback when content has unsaved changes */
|
|
565
|
-
onDirtyChange?: (isDirty: boolean) => void;
|
|
566
|
-
onContentChange?: (content: Uint8Array) => void;
|
|
567
|
-
/** Callback when active slide changes */
|
|
568
|
-
onActiveSlideChange?: (slideIndex: number) => void;
|
|
569
|
-
/** Callback when the viewer mode changes (e.g. edit to present). */
|
|
570
|
-
onModeChange?: (mode: import('pptx-viewer-shared').ViewerMode) => void;
|
|
571
|
-
/** Callback when the zoom level changes. */
|
|
572
|
-
onZoomChange?: (zoom: number) => void;
|
|
573
|
-
/** Callback when element selection changes. */
|
|
574
|
-
onSelectionChange?: (elementIds: string[]) => void;
|
|
575
|
-
/** Callback when the total slide count changes (slide added/deleted). */
|
|
576
|
-
onSlideCountChange?: (count: number) => void;
|
|
577
|
-
/**
|
|
578
|
-
* Host override for the File ▸ Open action. When provided, the built-in
|
|
579
|
-
* native file picker is bypassed and this is invoked instead; the host is
|
|
580
|
-
* then responsible for supplying a new `content` buffer. When omitted, the
|
|
581
|
-
* viewer opens its own picker and loads the chosen presentation in place.
|
|
582
|
-
*/
|
|
583
|
-
onOpenFile?: () => void;
|
|
584
|
-
/** Whether editing actions are enabled */
|
|
585
|
-
canEdit?: boolean;
|
|
586
|
-
/**
|
|
587
|
-
* Recovery autosave: after an edit the deck is re-serialised (always as a
|
|
588
|
-
* plain, unencrypted package, because recovery has no password) and stashed
|
|
589
|
-
* in the shared IndexedDB store keyed by {@link filePath}. It is a crash-
|
|
590
|
-
* safety net and never replaces the user's real Save: the document stays
|
|
591
|
-
* dirty. On load, a newer snapshot is offered back through a recovery prompt.
|
|
592
|
-
*
|
|
593
|
-
* **The prop is a policy ceiling; the title-bar AutoSave toggle is the user's
|
|
594
|
-
* preference inside it.** `false` turns autosave off and makes the toggle
|
|
595
|
-
* inert (a user cannot switch on what the application forbade). `true` or
|
|
596
|
-
* omitted permits it, and the toggle decides, defaulting to on. Identical in
|
|
597
|
-
* all five bindings; see `resolveAutosaveActivation` in `pptx-viewer-shared`.
|
|
598
|
-
*
|
|
599
|
-
* @default true
|
|
600
|
-
*/
|
|
601
|
-
autosave?: boolean;
|
|
602
|
-
/**
|
|
603
|
-
* Recovery cadence in milliseconds. An explicit value is a host policy and is
|
|
604
|
-
* honoured as given; omit it to follow the user's File > Options > Save >
|
|
605
|
-
* "Save AutoRecover information every N minutes" (two minutes by default).
|
|
606
|
-
*/
|
|
607
|
-
autosaveIntervalMs?: number;
|
|
608
|
-
/** Optional class name */
|
|
609
|
-
className?: string;
|
|
610
|
-
/**
|
|
611
|
-
* Display name used as the author for comments and annotations.
|
|
612
|
-
* Falls back to `collaboration.userName` when collaborating, or `'You'`.
|
|
613
|
-
*/
|
|
614
|
-
authorName?: string;
|
|
615
|
-
/**
|
|
616
|
-
* Theme configuration for customising the viewer's appearance.
|
|
617
|
-
*
|
|
618
|
-
* Accepts partial color overrides, a custom border-radius, and
|
|
619
|
-
* arbitrary CSS custom properties. Unset values fall back to the
|
|
620
|
-
* built-in dark theme.
|
|
621
|
-
*
|
|
622
|
-
* @example
|
|
623
|
-
* ```tsx
|
|
624
|
-
* <PowerPointViewer
|
|
625
|
-
* content={bytes}
|
|
626
|
-
* theme={{
|
|
627
|
-
* colors: { primary: "#6366f1", background: "#0f172a" },
|
|
628
|
-
* radius: "0.75rem",
|
|
629
|
-
* }}
|
|
630
|
-
* />
|
|
631
|
-
* ```
|
|
632
|
-
*
|
|
633
|
-
* @see {@link ViewerTheme} for the full type definition.
|
|
634
|
-
*/
|
|
635
|
-
theme?: ViewerTheme;
|
|
636
|
-
/**
|
|
637
|
-
* Initial key into `availableThemes` (or the built-in `THEME_CATALOG`) for
|
|
638
|
-
* File > Options > Appearance. Ignored once the user picks a different
|
|
639
|
-
* entry in that session, and always overridden by the `theme` prop when
|
|
640
|
-
* both are supplied. Falls back to a persisted `localStorage` choice, then
|
|
641
|
-
* `'default'`.
|
|
642
|
-
*/
|
|
643
|
-
defaultThemeKey?: string;
|
|
644
|
-
/**
|
|
645
|
-
* Theme choices offered by File > Options > Appearance. Defaults to the
|
|
646
|
-
* shared `THEME_CATALOG` (default/light/vermilionLight/vermilionDark).
|
|
647
|
-
*/
|
|
648
|
-
availableThemes?: ThemeCatalogEntry[];
|
|
649
|
-
/**
|
|
650
|
-
* Called when the user picks a theme from File > Options > Appearance.
|
|
651
|
-
* When provided, the host owns persisting the choice (the viewer will not
|
|
652
|
-
* also write it to `localStorage`); otherwise the viewer persists it via
|
|
653
|
-
* the shared `writeStoredViewerPrefs` helper.
|
|
654
|
-
*/
|
|
655
|
-
onThemeChange?: (key: string) => void;
|
|
656
|
-
/**
|
|
657
|
-
* Initial locale code for File > Options > Language. Falls back to a
|
|
658
|
-
* persisted `localStorage` choice, then `'en'`.
|
|
659
|
-
*/
|
|
660
|
-
defaultLocale?: string;
|
|
661
|
-
/**
|
|
662
|
-
* Locale choices offered by File > Options > Language. Defaults to the
|
|
663
|
-
* codes actually registered on the host's `react-i18next` instance
|
|
664
|
-
* (mapped through the shared `LOCALE_CATALOG` for display labels).
|
|
665
|
-
*/
|
|
666
|
-
availableLocales?: LocaleCatalogEntry[];
|
|
667
|
-
/**
|
|
668
|
-
* Called when the user picks a language from File > Options > Language.
|
|
669
|
-
* When provided, the host owns applying and persisting the choice (the
|
|
670
|
-
* viewer will not call `i18n.changeLanguage` or touch `localStorage`
|
|
671
|
-
* itself); otherwise the viewer applies and persists it directly.
|
|
672
|
-
*/
|
|
673
|
-
onLocaleChange?: (code: string) => void;
|
|
674
|
-
/**
|
|
675
|
-
* Optional hook point for File > Account's sign-in section. Disabled by
|
|
676
|
-
* default (renders nothing extra); pass `{ enabled: true, onSignIn }` to
|
|
677
|
-
* surface a real sign-in flow.
|
|
678
|
-
*/
|
|
679
|
-
accountAuth?: AccountAuthConfig;
|
|
680
|
-
/**
|
|
681
|
-
* Optional real-time collaboration configuration.
|
|
682
|
-
*
|
|
683
|
-
* When provided, the viewer enables collaborative editing with live
|
|
684
|
-
* cursors, user presence indicators, and CRDT-based state sync via Yjs.
|
|
685
|
-
* Requires `yjs` and `y-websocket` peer dependencies.
|
|
686
|
-
*
|
|
687
|
-
* @example
|
|
688
|
-
* ```tsx
|
|
689
|
-
* <PowerPointViewer
|
|
690
|
-
* content={bytes}
|
|
691
|
-
* collaboration={{
|
|
692
|
-
* roomId: "my-room-123",
|
|
693
|
-
* serverUrl: "wss://collab.example.com",
|
|
694
|
-
* userName: "Alice",
|
|
695
|
-
* userColor: "#6366f1",
|
|
696
|
-
* }}
|
|
697
|
-
* />
|
|
698
|
-
* ```
|
|
699
|
-
*/
|
|
700
|
-
collaboration?: CollaborationConfig$1;
|
|
701
|
-
/**
|
|
702
|
-
* Callback invoked when the user starts a collaboration session from the
|
|
703
|
-
* Share dialog. The host app should use this to set the `collaboration`
|
|
704
|
-
* prop with the returned config.
|
|
705
|
-
*/
|
|
706
|
-
onStartCollaboration?: (config: CollaborationConfig$1) => void;
|
|
707
|
-
/**
|
|
708
|
-
* Callback invoked when the user stops a collaboration session from the
|
|
709
|
-
* Share dialog. The host app should clear the `collaboration` prop.
|
|
710
|
-
*/
|
|
711
|
-
onStopCollaboration?: () => void;
|
|
712
|
-
/**
|
|
713
|
-
* Default values for the Share dialog fields. The host app should provide
|
|
714
|
-
* these to control the session name, user display name, and server URL.
|
|
715
|
-
* If omitted, the Share dialog fields will be empty and require user input.
|
|
716
|
-
*
|
|
717
|
-
* @example
|
|
718
|
-
* ```tsx
|
|
719
|
-
* <PowerPointViewer
|
|
720
|
-
* shareDefaults={{
|
|
721
|
-
* roomId: "session-abc123",
|
|
722
|
-
* userName: "Alice",
|
|
723
|
-
* serverUrl: "ws://localhost:1234",
|
|
724
|
-
* }}
|
|
725
|
-
* />
|
|
726
|
-
* ```
|
|
727
|
-
*/
|
|
728
|
-
shareDefaults?: {
|
|
729
|
-
roomId?: string;
|
|
730
|
-
userName?: string;
|
|
731
|
-
serverUrl?: string;
|
|
732
|
-
};
|
|
733
|
-
/**
|
|
734
|
-
* Opt in to the Three.js SmartArt renderer. When `true`, SmartArt diagrams
|
|
735
|
-
* render as extruded 3D blocks on a WebGL canvas instead of flat SVG.
|
|
736
|
-
* Requires the optional `three` peer dependency; when it is not installed
|
|
737
|
-
* (or the diagram has no geometry), the viewer transparently falls back to
|
|
738
|
-
* the SVG `SmartArtRenderer`. Default `false`.
|
|
739
|
-
*/
|
|
740
|
-
smartArt3D?: boolean;
|
|
741
|
-
/**
|
|
742
|
-
* Opt in to the interactive Three.js surface-chart renderer. When `true`,
|
|
743
|
-
* `surface`/`surface3D` charts render as a camera-orbitable WebGL mesh
|
|
744
|
-
* (drag to rotate, scroll to zoom) instead of the static SVG isometric
|
|
745
|
-
* projection. Chart marks are not selectable/draggable in this mode.
|
|
746
|
-
* Requires the optional `three` peer dependency; when it is not installed
|
|
747
|
-
* (or the chart has no plottable grid), the viewer transparently falls back
|
|
748
|
-
* to the SVG surface renderer. Default `false`.
|
|
749
|
-
*/
|
|
750
|
-
surfaceChart3D?: boolean;
|
|
751
|
-
/**
|
|
752
|
-
* Opt in to the interactive Three.js bar3D-chart renderer. When `true`,
|
|
753
|
-
* `bar3D` charts render as camera-orbitable real box meshes (drag to
|
|
754
|
-
* rotate, scroll to zoom) instead of the flat SVG oblique-projection
|
|
755
|
-
* illusion. Chart marks are not selectable/draggable in this mode.
|
|
756
|
-
* Requires the optional `three` peer dependency; when it is not installed
|
|
757
|
-
* (or the chart has no plottable grid, or it is a horizontal 3-D Bar), the
|
|
758
|
-
* viewer transparently falls back to the flat SVG bar3D renderer. Default
|
|
759
|
-
* `false`.
|
|
760
|
-
*/
|
|
761
|
-
barChart3D?: boolean;
|
|
762
|
-
/**
|
|
763
|
-
* Opt in to the interactive Three.js line3D-chart renderer. When `true`,
|
|
764
|
-
* `line3D` charts render as a camera-orbitable real tube-path mesh per
|
|
765
|
-
* series, one per depth ("series") plane (drag to rotate, scroll to zoom),
|
|
766
|
-
* instead of the flat SVG oblique-projection illusion. Chart marks are not
|
|
767
|
-
* selectable/draggable in this mode. Requires the optional `three` peer
|
|
768
|
-
* dependency; when it is not installed (or the chart has no plottable
|
|
769
|
-
* grid), the viewer transparently falls back to the flat SVG line3D
|
|
770
|
-
* renderer. Default `false`.
|
|
771
|
-
*/
|
|
772
|
-
lineChart3D?: boolean;
|
|
773
|
-
/**
|
|
774
|
-
* Opt in to the interactive Three.js area3D-chart renderer. When `true`,
|
|
775
|
-
* `area3D` charts render as a camera-orbitable real tube path + filled
|
|
776
|
-
* ribbon mesh per series, one per depth ("series") plane (drag to rotate,
|
|
777
|
-
* scroll to zoom), instead of the flat SVG oblique-projection illusion.
|
|
778
|
-
* Chart marks are not selectable/draggable in this mode. Requires the
|
|
779
|
-
* optional `three` peer dependency; when it is not installed (or the chart
|
|
780
|
-
* has no plottable grid), the viewer transparently falls back to the flat
|
|
781
|
-
* SVG area3D renderer. Default `false`.
|
|
782
|
-
*/
|
|
783
|
-
areaChart3D?: boolean;
|
|
784
|
-
/**
|
|
785
|
-
* Opt in to the interactive Three.js pie3D-chart renderer. When `true`,
|
|
786
|
-
* `pie3D` charts render as camera-orbitable real wedge meshes (drag to
|
|
787
|
-
* rotate, scroll to zoom) instead of the flat SVG oblique-projection
|
|
788
|
-
* illusion. Chart marks are not selectable/draggable in this mode.
|
|
789
|
-
* Requires the optional `three` peer dependency; when it is not installed
|
|
790
|
-
* (or the chart has no plottable series), the viewer transparently falls
|
|
791
|
-
* back to the flat SVG pie3D renderer. Default `false`.
|
|
792
|
-
*/
|
|
793
|
-
pieChart3D?: boolean;
|
|
794
|
-
/**
|
|
795
|
-
* Hide individual toolbar buttons and/or ribbon tabs instead of the whole
|
|
796
|
-
* toolbar. Accepts any mix of button ids (`share`, `broadcast`, `export`,
|
|
797
|
-
* `undo`, `redo`, `record`, `notes`, `fullscreen`, `zoom`, `navigation`)
|
|
798
|
-
* and ribbon-tab ids (`file`, `home`, `insert`, `draw`, `design`,
|
|
799
|
-
* `transitions`, `animations`, `slideShow`, `record`, `review`, `view`,
|
|
800
|
-
* `help`). `zoom` and `navigation` each hide their whole control cluster
|
|
801
|
-
* (zoom in/out/fit; previous/next slide), not each sub-button. `record`
|
|
802
|
-
* is shared between the quick-access Record button and the Record ribbon
|
|
803
|
-
* tab: hiding it hides both. Omitted or empty hides nothing (default,
|
|
804
|
-
* fully backward compatible).
|
|
805
|
-
*
|
|
806
|
-
* @example
|
|
807
|
-
* ```tsx
|
|
808
|
-
* <PowerPointViewer content={bytes} hiddenActions={['share', 'broadcast', 'record']} />
|
|
809
|
-
* ```
|
|
810
|
-
*/
|
|
811
|
-
hiddenActions?: ToolbarActionId[];
|
|
812
|
-
/**
|
|
813
|
-
* Opt in to the built-in AI assistant. When provided, a Sparkles toggle
|
|
814
|
-
* appears in the toolbar and opens a chat panel wired to this config; when
|
|
815
|
-
* omitted, no AI icon renders and no AI code is loaded (the panel and its
|
|
816
|
-
* `@ai-sdk/react` dependency are `React.lazy`-imported only on first open).
|
|
817
|
-
*
|
|
818
|
-
* The host supplies the model connection (a backend `endpoint`, an in-browser
|
|
819
|
-
* `model`, or a custom `transport`) plus optional tool allow/deny lists and a
|
|
820
|
-
* write policy. Requires the optional `ai` and `@ai-sdk/react` peers.
|
|
821
|
-
*
|
|
822
|
-
* @example
|
|
823
|
-
* ```tsx
|
|
824
|
-
* <PowerPointViewer content={bytes} ai={{ connection: { kind: 'model', model } }} />
|
|
825
|
-
* ```
|
|
826
|
-
*
|
|
827
|
-
* @see {@link PptxAiConfig}
|
|
828
|
-
*/
|
|
829
|
-
ai?: PptxAiConfig;
|
|
830
|
-
}
|
|
831
|
-
interface PowerPointViewerHandle extends FileViewerHandle, PowerPointViewerAPI {
|
|
832
|
-
getContent: () => Promise<Uint8Array>;
|
|
833
|
-
}
|
|
834
|
-
//#endregion
|
|
835
|
-
export { DragState as $, PptxAiConnection as A, themeToCssVars as B, CollaborationConfig$1 as C, UserPresence as D, ConnectionStatus as E, useViewerTheme as F, vermilionRadius as G, vermilionDarkTheme as H, THEME_CATALOG as I, ViewerTheme as J, defaultRadius as K, ThemeCatalogEntry$1 as L, PptxAiToolName as M, PptxAiWritePolicy as N, PptxAiBridge as O, ViewerThemeProvider as P, ConnectorPathGeometry as Q, resolveThemeCatalogEntry as R, ToolbarSection as S, CollaborationRole as T, vermilionLightColors as U, vermilionDarkColors as V, vermilionLightTheme as W, CanvasSize as X, ViewerThemeColors as Y, ConnectorGeometryType as Z, SlideAlignment as _, DrawingTool as a, ShapeAdjustmentDragState as at, StrokeDashOption as b, FileViewerHandle as c, SupportedShapeType as ct, ParsedTableData as d, EditorHistorySnapshot as et, PowerPointViewerHandle as f, ShortcutReferenceItem as g, ShapePreset as h, ConnectorGeometryOption as i, ResizeState as it, PptxAiContextStrategy as j, PptxAiConfig as k, MarqueeSelectionState as l, ViewerMode$1 as lt, PresentationAnimationRuntime as m, AnimationPresetOption as n, ElementClipboardPayload as nt, ElementContextMenuAction as o, ShapeAdjustmentHandleDescriptor$1 as ot, PowerPointViewerProps as p, defaultThemeColors as q, ConnectorArrowOption as r, ResizeHandle as rt, ElementContextMenuState as s, ShapeQuickStyle as st, AccessibilityIssue as t, ElementBounds as tt, ParsedTableCell as u, SlideSectionGroup as v, CollaborationContextValue as w, TableCellEditorState as x, SlideTransitionOption as y, defaultCssVars as z };
|
|
836
|
-
//# sourceMappingURL=types-BqB2ZCwS.d.ts.map
|