pptx-react-viewer 4.74.0 → 4.76.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 (126) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +1 -1
  3. package/dist/{AiChatPanel-PLQ3NBTK.js → AiChatPanel-4V7QB5Z3.js} +19 -19
  4. package/dist/AiChatPanel-4V7QB5Z3.js.br +0 -0
  5. package/dist/AiChatPanel-4V7QB5Z3.js.gz +0 -0
  6. package/dist/{AiChatPanel-E7CJSTW7.mjs → AiChatPanel-6ML3VLIX.mjs} +1 -1
  7. package/dist/AiChatPanel-6ML3VLIX.mjs.br +0 -0
  8. package/dist/AiChatPanel-6ML3VLIX.mjs.gz +0 -0
  9. package/dist/ai.js +2 -2
  10. package/dist/ai.js.br +0 -0
  11. package/dist/ai.js.gz +0 -0
  12. package/dist/ai.mjs +1 -1
  13. package/dist/ai.mjs.br +0 -0
  14. package/dist/ai.mjs.gz +0 -0
  15. package/dist/{chunk-P2COO2QO.js → chunk-6GFSF2ML.js} +65 -13
  16. package/dist/chunk-6GFSF2ML.js.br +0 -0
  17. package/dist/chunk-6GFSF2ML.js.gz +0 -0
  18. package/dist/chunk-FFTZYNL4.mjs +2 -0
  19. package/dist/chunk-FFTZYNL4.mjs.br +6 -0
  20. package/dist/chunk-FFTZYNL4.mjs.gz +0 -0
  21. package/dist/chunk-LWGPHJHC.js +151 -0
  22. package/dist/chunk-LWGPHJHC.js.br +0 -0
  23. package/dist/chunk-LWGPHJHC.js.gz +0 -0
  24. package/dist/{chunk-LVEFHZ76.js → chunk-MU3BIZ2U.js} +1 -1
  25. package/dist/chunk-MU3BIZ2U.js.br +0 -0
  26. package/dist/chunk-MU3BIZ2U.js.gz +0 -0
  27. package/dist/{chunk-FBSPQYRE.mjs → chunk-N3YK2BCA.mjs} +61 -14
  28. package/dist/chunk-N3YK2BCA.mjs.br +0 -0
  29. package/dist/chunk-N3YK2BCA.mjs.gz +0 -0
  30. package/dist/{chunk-SQ7OASDY.mjs → chunk-OC4RP2CB.mjs} +590 -392
  31. package/dist/chunk-OC4RP2CB.mjs.br +0 -0
  32. package/dist/chunk-OC4RP2CB.mjs.gz +0 -0
  33. package/dist/chunk-P2IEKYVG.js +29 -0
  34. package/dist/chunk-P2IEKYVG.js.br +0 -0
  35. package/dist/chunk-P2IEKYVG.js.gz +0 -0
  36. package/dist/{chunk-CRC3V4UG.mjs → chunk-PPOGAZ53.mjs} +646 -263
  37. package/dist/chunk-PPOGAZ53.mjs.br +0 -0
  38. package/dist/chunk-PPOGAZ53.mjs.gz +0 -0
  39. package/dist/{chunk-JZE6BORE.mjs → chunk-RMEWSJZU.mjs} +1 -1
  40. package/dist/chunk-RMEWSJZU.mjs.br +0 -0
  41. package/dist/chunk-RMEWSJZU.mjs.gz +0 -0
  42. package/dist/{chunk-XG4WSJ4O.js → chunk-SEIVQGH5.js} +1632 -1240
  43. package/dist/chunk-SEIVQGH5.js.br +0 -0
  44. package/dist/chunk-SEIVQGH5.js.gz +0 -0
  45. package/dist/{chunk-D4WC35PL.js → chunk-XTYBIJ2S.js} +1136 -939
  46. package/dist/chunk-XTYBIJ2S.js.br +0 -0
  47. package/dist/chunk-XTYBIJ2S.js.gz +0 -0
  48. package/dist/chunk-Y53EC3JU.mjs +27 -0
  49. package/dist/chunk-Y53EC3JU.mjs.br +0 -0
  50. package/dist/chunk-Y53EC3JU.mjs.gz +0 -0
  51. package/dist/i18n/de.cjs +5 -0
  52. package/dist/i18n/de.cjs.br +0 -0
  53. package/dist/i18n/de.cjs.gz +0 -0
  54. package/dist/i18n/de.mjs +5 -0
  55. package/dist/i18n/de.mjs.br +0 -0
  56. package/dist/i18n/de.mjs.gz +0 -0
  57. package/dist/i18n/es.cjs +5 -0
  58. package/dist/i18n/es.cjs.br +0 -0
  59. package/dist/i18n/es.cjs.gz +0 -0
  60. package/dist/i18n/es.mjs +5 -0
  61. package/dist/i18n/es.mjs.br +0 -0
  62. package/dist/i18n/es.mjs.gz +0 -0
  63. package/dist/i18n/fr.cjs +5 -0
  64. package/dist/i18n/fr.cjs.br +0 -0
  65. package/dist/i18n/fr.cjs.gz +0 -0
  66. package/dist/i18n/fr.mjs +5 -0
  67. package/dist/i18n/fr.mjs.br +0 -0
  68. package/dist/i18n/fr.mjs.gz +0 -0
  69. package/dist/i18n/zh-CN.cjs +5 -0
  70. package/dist/i18n/zh-CN.cjs.br +0 -0
  71. package/dist/i18n/zh-CN.cjs.gz +0 -0
  72. package/dist/i18n/zh-CN.mjs +5 -0
  73. package/dist/i18n/zh-CN.mjs.br +0 -0
  74. package/dist/i18n/zh-CN.mjs.gz +0 -0
  75. package/dist/index.d.ts +76 -26
  76. package/dist/index.js +126 -126
  77. package/dist/index.js.br +0 -0
  78. package/dist/index.js.gz +0 -0
  79. package/dist/index.mjs +6 -6
  80. package/dist/index.mjs.br +0 -0
  81. package/dist/index.mjs.gz +0 -0
  82. package/dist/internals.d.ts +52 -24
  83. package/dist/internals.js +82 -81
  84. package/dist/internals.js.br +0 -0
  85. package/dist/internals.js.gz +0 -0
  86. package/dist/internals.mjs +3 -2
  87. package/dist/internals.mjs.br +0 -0
  88. package/dist/internals.mjs.gz +0 -0
  89. package/dist/no-i18next.d.ts +1343 -0
  90. package/dist/no-i18next.js +251 -0
  91. package/dist/no-i18next.js.br +0 -0
  92. package/dist/no-i18next.js.gz +0 -0
  93. package/dist/no-i18next.mjs +6 -0
  94. package/dist/no-i18next.mjs.br +0 -0
  95. package/dist/no-i18next.mjs.gz +0 -0
  96. package/dist/pptx-viewer.css +1 -1
  97. package/dist/pptx-viewer.css.br +0 -0
  98. package/dist/pptx-viewer.css.gz +0 -0
  99. package/dist/viewer/index.d.ts +37 -18
  100. package/dist/viewer/index.js +25 -24
  101. package/dist/viewer/index.js.br +0 -0
  102. package/dist/viewer/index.js.gz +0 -0
  103. package/dist/viewer/index.mjs +5 -4
  104. package/dist/viewer/index.mjs.br +0 -0
  105. package/dist/viewer/index.mjs.gz +0 -0
  106. package/package.json +9 -4
  107. package/dist/AiChatPanel-E7CJSTW7.mjs.br +0 -0
  108. package/dist/AiChatPanel-E7CJSTW7.mjs.gz +0 -0
  109. package/dist/AiChatPanel-PLQ3NBTK.js.br +0 -0
  110. package/dist/AiChatPanel-PLQ3NBTK.js.gz +0 -0
  111. package/dist/chunk-CRC3V4UG.mjs.br +0 -0
  112. package/dist/chunk-CRC3V4UG.mjs.gz +0 -0
  113. package/dist/chunk-D4WC35PL.js.br +0 -0
  114. package/dist/chunk-D4WC35PL.js.gz +0 -0
  115. package/dist/chunk-FBSPQYRE.mjs.br +0 -0
  116. package/dist/chunk-FBSPQYRE.mjs.gz +0 -0
  117. package/dist/chunk-JZE6BORE.mjs.br +0 -0
  118. package/dist/chunk-JZE6BORE.mjs.gz +0 -0
  119. package/dist/chunk-LVEFHZ76.js.br +0 -0
  120. package/dist/chunk-LVEFHZ76.js.gz +0 -0
  121. package/dist/chunk-P2COO2QO.js.br +0 -0
  122. package/dist/chunk-P2COO2QO.js.gz +0 -0
  123. package/dist/chunk-SQ7OASDY.mjs.br +0 -0
  124. package/dist/chunk-SQ7OASDY.mjs.gz +0 -0
  125. package/dist/chunk-XG4WSJ4O.js.br +0 -0
  126. package/dist/chunk-XG4WSJ4O.js.gz +0 -0
@@ -0,0 +1,1343 @@
1
+ import * as ooxml_ui_pptx from 'ooxml-ui/pptx';
2
+ import { CollaborationRole, CollaborationConfig, ViewportFitOptions, ViewerFontSource, CanvasSize, DocumentStorage, CloudFileProvider, ViewerAutosaveStatus, AutosaveRecord, ConnectionStatus, ViewerTheme, ThemeCatalogEntry, AccountAuthConfig, CollaborationInput, GoogleFontsOption, ListConversionScope, ToolbarActionId, RibbonAddInTab, ViewerCustomization, PptxLoadLimits, PowerPointViewerAPI, ViewerCustomizationApi, CollaborationLivePatcher, InlineListReadResult, EditorImagePasteOptions, ViewerMode, RulerUnit, ElementAnimationState, ShapeAdjustmentHandleDescriptor, InlineTextEditSnapshot, ZoomNavigationTarget, FieldSubstitutionContext, EditPointsCommandId, EditPointsElementPatch, FreeformToolKind, RibbonDisplayController, ElementClipboardPayload, AnimationApplyGroup, InsertChartKind, ChangeCaseMode, SlideTemplateId, ReviewCommentsHost, UseViewerBuildingBlocksActionsOptions, SlidesPaneLayoutGalleryRequest, CollaborationShellState, PptxAutosaveStatus, ViewerBuildingBlockActions } from 'ooxml-ui/pptx';
3
+ export { AVATAR_COLOR_SWATCHES, AccountAuthConfig, BACKSTAGE_CARD_IDS, BACKSTAGE_PAGE_IDS, BackstageCustomization, BuildingBlockActionId, BuildingBlockActionState, BuildingBlockFailureCode, BuildingBlockFindReplace, BuildingBlockLayoutActions, BuildingBlockRequest, BuildingBlockResult, CANVAS_CONTEXT_MENU_COMMAND_IDS, CollaborationConfig, CollaborationShellState, ContextMenuCustomization, DEFAULT_VIEWER_PROFILE, DocumentPropertiesActions, DocumentPropertiesPatch, EDITOR_SHORTCUT_ACTION_IDS, ELEMENT_CONTEXT_MENU_COMMAND_IDS, ElementUpdate, ElementUpdateOptions, ExternalCollaborationAwareness, ExternalCollaborationSession, ExternalCollaborationSnapshot, FontEmbeddingActions, HostCanvasMenuContext, HostElementMenuContext, HostFileLimits, HostMenuCommand, HostSignatureInfo, KeyboardCustomization, ListConversionScope, LocalStorageUsageSummary, OPTIONS_PAGE_IDS, OPTIONS_SECTION_IDS, OPTIONS_SETTING_IDS, OptionsCustomization, OptionsPageId, OptionsSectionId, OptionsSettingId, OptionsSettingValues, PPTX_OPEN_ACCEPT, PRESENTATION_OPEN_EXTENSIONS, PasswordProtectionActions, PowerPointViewerAPI, RIBBON_TAB_IDS, ResolvedCustomization, RibbonCustomization, SLIDE_TEMPLATES, SavedPresentationFormat, ShortcutChord, SignatureActions, SlideTemplateId, SlideTemplateSpec, SlidesPaneLayoutGalleryRequest, StoredViewerPrefs, THEME_CATALOG, TOOLBAR_BUTTON_IDS, ThemeCatalogEntry, ToolbarActionId, ToolbarButtonId, ToolbarTabId, VIEWER_DIALOG_IDS, VIEWER_EXPORT_FORMAT_IDS, VIEWER_FEATURE_IDS, VIEWER_PANEL_IDS, VIEWER_PREFS_STORAGE_KEY, ViewerBuildingBlockActions, ViewerCustomization, ViewerCustomizationApi, ViewerDialogId, ViewerExportFormatId, ViewerFeatureId, ViewerMode, ViewerPanelId, ViewerProfile, ViewerTheme, ViewerThemeColors, ViewportFitOptions, ViewportFitPadding, buildSlideTemplateContent, buildSlideTemplateSlide, clearAllLocalViewerData, clearStoredViewerPrefs, createImageElementFromFile, defaultCssVars, defaultRadius, defaultThemeColors, describeCollaborationShellState, getLocalStorageUsageSummary, isLegacyBinaryPresentation, isSupportedPresentationFile, presentationBaseName, readStoredViewerPrefs, resolveProfileInitial, resolveThemeCatalogEntry, saveViewerProfile, savedPresentationFileName, themeToCssVars, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius, writeStoredViewerPrefs } from 'ooxml-ui/pptx';
4
+ import * as React$1 from 'react';
5
+ import React$1__default, { ReactNode, ReactElement } from 'react';
6
+ import { PptxCoreProperties, PptxAnimationPreset, PptxNativeAnimation, PptxElement, PptxSlide, TextStyle, InkPptxElement, ShapePptxElement, PptxAction, PptxComment, PptxElementAnimation, ConnectorPptxElement, ParsedTableStyleMap, PptxTheme, ShapeStyle, PptxLayoutOption, PptxLayoutPreview, PptxCustomShow, PptxSlideTransition, PptxPresentationProperties } from 'ooxml-core/pptx';
7
+ import { CollaborationWriteBackState, CollaborationState } from 'ooxml-core/collab';
8
+ export { CollaborationState } from 'ooxml-core/collab';
9
+ import { PptxAiConfig } from 'ooxml-ui/pptx/ai';
10
+ export { PptxAiBridge, PptxAiConfig, PptxAiConnection, PptxAiContextStrategy, PptxAiToolName, PptxAiWritePolicy } from 'ooxml-ui/pptx/ai';
11
+ import { PptxAiAssistant } from 'ooxml-ui/pptx/ai/host';
12
+ export { PptxAiAssistant } from 'ooxml-ui/pptx/ai/host';
13
+ import { LocaleCatalogEntry } from 'ooxml-ui/pptx/i18n';
14
+ export { LOCALE_CATALOG, LocaleCatalogEntry } from 'ooxml-ui/pptx/i18n';
15
+ import { Doc } from 'yjs';
16
+ import { Options } from 'html2canvas-pro';
17
+
18
+ /** What the viewer passes `translate`: exactly the params of the call. */
19
+ interface PptxTranslateParams {
20
+ readonly defaultValue?: string;
21
+ readonly count?: number;
22
+ readonly [name: string]: unknown;
23
+ }
24
+ /**
25
+ * A host translator for {@link PptxI18nProvider}: the text for a viewer key (`pptx.*`) in the
26
+ * host's active language. Return the key itself, an empty string, `null` or `undefined` for "no
27
+ * translation": the viewer then shows its built-in English text.
28
+ */
29
+ type PptxTranslate = (key: string, params?: PptxTranslateParams) => string | null | undefined;
30
+ /**
31
+ * Union of all shape preset types that the viewer can insert or render.
32
+ * Maps to OOXML `a:prstGeom` preset values (e.g. "rect", "ellipse").
33
+ * Includes basic shapes, arrows, connectors, and freeform paths.
34
+ */
35
+ 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';
36
+ /** The pixel dimensions of the slide canvas (presentation slide size). */
37
+ interface CanvasSize$1 {
38
+ /** Width of the canvas in CSS pixels. */
39
+ width: number;
40
+ /** Height of the canvas in CSS pixels. */
41
+ height: number;
42
+ }
43
+ interface ViewerThemeProviderProps {
44
+ theme?: ViewerTheme;
45
+ children: React.ReactNode;
46
+ }
47
+ /**
48
+ * Provides a `ViewerTheme` to all descendant viewer components.
49
+ *
50
+ * Typically you do **not** need to use this directly; passing a `theme`
51
+ * prop to `<PowerPointViewer>` is sufficient. This provider is exposed
52
+ * for advanced use-cases where you want to wrap multiple viewers or
53
+ * share a theme across a wider subtree.
54
+ */
55
+ declare function ViewerThemeProvider({ theme, children }: ViewerThemeProviderProps): React$1.JSX.Element;
56
+ /**
57
+ * Returns the active `ViewerTheme` (if any) from the nearest
58
+ * `ViewerThemeProvider`.
59
+ */
60
+ declare function useViewerTheme(): ViewerTheme | undefined;
61
+ /** Connection lifecycle states for the Yjs WebSocket provider. */
62
+ type ConnectionStatus$1 = 'disconnected' | 'connecting' | 'connected' | 'error';
63
+ /**
64
+ * Presence data broadcast to other participants.
65
+ * Cursor position is relative to the slide canvas (0..canvasWidth, 0..canvasHeight).
66
+ */
67
+ interface UserPresence {
68
+ /** Unique client ID (assigned by Yjs awareness). */
69
+ clientId: number;
70
+ /** Sanitised display name. */
71
+ userName: string;
72
+ /** Optional avatar URL (validated). */
73
+ userAvatar?: string;
74
+ /** Hex colour for the user's cursor ring. */
75
+ userColor: string;
76
+ /** Slide index the user is currently viewing. */
77
+ activeSlideIndex: number;
78
+ /** Cursor X on the canvas (clamped to slide bounds). */
79
+ cursorX: number;
80
+ /** Cursor Y on the canvas (clamped to slide bounds). */
81
+ cursorY: number;
82
+ /** ISO timestamp of last update (for stale-presence cleanup). */
83
+ lastUpdated: string;
84
+ /** Optional currently selected element ID. */
85
+ selectedElementId?: string;
86
+ /** Role in the session (owner, viewer, or collaborator). */
87
+ role?: CollaborationRole;
88
+ }
89
+ /** Value exposed by `CollaborationContext`. */
90
+ interface CollaborationContextValue {
91
+ /** Current WebSocket connection status. */
92
+ status: ConnectionStatus$1;
93
+ /** Presence data for all remote users (excludes the local user). */
94
+ remoteUsers: UserPresence[];
95
+ /** Broadcast the local user's presence state. */
96
+ broadcastPresence: (update: Partial<Omit<UserPresence, 'clientId'>>) => void;
97
+ /** Total number of connected users (including local). */
98
+ connectedCount: number;
99
+ /** The collaboration config that was provided. */
100
+ config: CollaborationConfig;
101
+ /** The Yjs document (for document sync). */
102
+ doc: Doc | null;
103
+ /**
104
+ * Whether the provider completed its initial document sync (or the
105
+ * first-write grace period elapsed). Local doc writes are gated on this.
106
+ */
107
+ synced: boolean;
108
+ /** Manually retry the WebSocket connection after a timeout or error. */
109
+ retry: () => void;
110
+ /** The local awareness client id, once the session has one. */
111
+ clientId?: number | null;
112
+ /** The owner's write-back status, as the document sync last reported it. */
113
+ writeBack?: CollaborationWriteBackState | undefined;
114
+ /** Called by the document sync with the write-back status (undefined clears it). */
115
+ reportWriteBack?: (state: CollaborationWriteBackState | undefined) => void;
116
+ }
117
+ /** What `onLoad` reports: the same detail the Svelte and vanilla bindings send. */
118
+ interface ViewerLoadDetail {
119
+ slideCount: number;
120
+ canvasSize: CanvasSize;
121
+ }
122
+ /**
123
+ * Base handle interface for file viewer components.
124
+ * Defined locally to avoid dependency on external file-viewer plugin packages.
125
+ * Provides a standard `getContent` method used by the host application to
126
+ * retrieve the current file content (e.g. for saving).
127
+ */
128
+ interface FileViewerHandle {
129
+ /** Get the current content of the file (for saving) */
130
+ getContent: () => Promise<string | Uint8Array>;
131
+ }
132
+ /**
133
+ * State of an active marquee (rubber-band) selection rectangle.
134
+ * Created when the user clicks and drags on the canvas background,
135
+ * and used to compute which elements fall within the selection area.
136
+ */
137
+ interface MarqueeSelectionState {
138
+ startX: number;
139
+ startY: number;
140
+ currentX: number;
141
+ currentY: number;
142
+ additive: boolean;
143
+ baseSelectionIds?: string[];
144
+ }
145
+ /** Tracks which table cell is selected and/or actively being edited. */
146
+ interface TableCellEditorState {
147
+ rowIndex: number;
148
+ columnIndex: number;
149
+ /** When true the cell has an active text input. */
150
+ isEditing?: boolean;
151
+ /** Optional multi-cell selection (Shift+Click range). Each entry is {row, col}. */
152
+ selectedCells?: Array<{
153
+ row: number;
154
+ col: number;
155
+ }>;
156
+ }
157
+ /**
158
+ * Groups slides into named sections for the slides pane sidebar.
159
+ * Corresponds to OOXML `p15:section` elements in `presentation.xml`.
160
+ */
161
+ interface SlideSectionGroup {
162
+ id: string;
163
+ label: string;
164
+ slideIndexes: number[];
165
+ /** Section highlight color from p15:sectionPr. */
166
+ color?: string;
167
+ /** Whether the section should start collapsed (from p15:sectionPr). */
168
+ defaultCollapsed?: boolean;
169
+ }
170
+ /** Identifies one of the ribbon-style toolbar tabs (home, insert, text, etc.). */
171
+ type ToolbarSection = 'file' | 'home' | 'insert' | 'text' | 'arrange' | 'draw' | 'design' | 'transitions' | 'animations' | 'slideShow' | 'record' | 'review' | 'view' | 'help';
172
+ /** The active drawing/inking tool selected in the Draw toolbar tab. */
173
+ type DrawingTool = 'select' | 'pen' | 'highlighter' | 'eraser' | 'freeform';
174
+ interface PowerPointViewerProps extends ViewportFitOptions {
175
+ /** PowerPoint content as Uint8Array */
176
+ content: Uint8Array;
177
+ /** Licensed fonts supplied by the host application. No fonts are bundled. */
178
+ fonts?: ViewerFontSource[];
179
+ /** Original file path, used for autosave recovery */
180
+ filePath?: string;
181
+ /**
182
+ * Display name of the open document, shown in the PowerPoint-style title
183
+ * bar (e.g. "quarterly-review.pptx"). Falls back to a generic label.
184
+ */
185
+ fileName?: string;
186
+ /** Callback when content has unsaved changes */
187
+ onDirtyChange?: (isDirty: boolean) => void;
188
+ onContentChange?: (content: Uint8Array) => void;
189
+ /** Callback when active slide changes */
190
+ onActiveSlideChange?: (slideIndex: number) => void;
191
+ /** Fired before following a link; return false to cancel its default action. */
192
+ onHyperlinkClick?: ooxml_ui_pptx.HyperlinkClickHandler;
193
+ /** Callback when the viewer mode changes (e.g. edit to present). */
194
+ onModeChange?: (mode: ooxml_ui_pptx.ViewerMode) => void;
195
+ /** Callback when the zoom level changes. */
196
+ onZoomChange?: (zoom: number) => void;
197
+ /**
198
+ * Ribbon Display Options, the starting mode: `always` docks the tabs and commands above the
199
+ * slide (the default), `tabs` shows only the tab row (a chosen tab lays its commands over the
200
+ * slide until a press elsewhere or Escape), `fullScreen` hides the title bar and the ribbon
201
+ * until the strip at the top is pressed. Changing it later applies the mode without calling
202
+ * `onRibbonDisplayChange`.
203
+ */
204
+ ribbonDisplay?: ooxml_ui_pptx.RibbonDisplayMode;
205
+ /**
206
+ * Called when the user picks a Ribbon Display Option (the menu, Ctrl+F1, a double click on a
207
+ * tab). Not called when the host changes `ribbonDisplay`.
208
+ */
209
+ onRibbonDisplayChange?: (mode: ooxml_ui_pptx.RibbonDisplayMode) => void;
210
+ /** Callback when element selection changes. */
211
+ onSelectionChange?: (elementIds: string[]) => void;
212
+ /** Callback when the total slide count changes (slide added/deleted). */
213
+ onSlideCountChange?: (count: number) => void;
214
+ /**
215
+ * Fired each time a presentation finishes loading without an error, with the slide count
216
+ * and canvas size.
217
+ */
218
+ onLoad?: (detail: ViewerLoadDetail) => void;
219
+ /** Fired once per distinct load failure, and for each failed Save / Save As, with a human-readable message. */
220
+ onError?: (message: string) => void;
221
+ /**
222
+ * Host override for the File ▸ Open action. When provided, the built-in
223
+ * native file picker is bypassed and this is invoked instead; the host is
224
+ * then responsible for supplying a new `content` buffer. When omitted, the
225
+ * viewer opens its own picker and loads the chosen presentation in place.
226
+ */
227
+ onOpenFile?: () => void;
228
+ /** Whether editing actions are enabled */
229
+ canEdit?: boolean;
230
+ /**
231
+ * Makes the deck read-only (default `false`). It is the inverse of the edit switch: true wins
232
+ * over it, false only lifts this restriction, so editing still needs the edit switch and
233
+ * is never granted over a collaboration `viewer` role or `capabilities.edit`.
234
+ */
235
+ readOnly?: boolean;
236
+ /**
237
+ * Recovery autosave: after an edit the deck is re-serialised (always as a
238
+ * plain, unencrypted package, because recovery has no password) and stashed
239
+ * in the shared IndexedDB store keyed by {@link filePath}. It is a crash-
240
+ * safety net and never replaces the user's real Save: the document stays
241
+ * dirty. On load, a newer snapshot is offered back through a recovery prompt.
242
+ *
243
+ * **The prop is a policy ceiling; the title-bar AutoSave toggle is the user's
244
+ * preference inside it.** `false` turns autosave off and makes the toggle
245
+ * inert (a user cannot switch on what the application forbade). `true` or
246
+ * omitted permits it, and the toggle decides, defaulting to on. Identical in
247
+ * all five bindings; see `resolveAutosaveActivation` in `pptx-viewer-shared`.
248
+ *
249
+ * @default true
250
+ */
251
+ autosave?: boolean;
252
+ /**
253
+ * Recovery cadence in milliseconds. An explicit value is a host policy and is
254
+ * honoured as given; omit it to follow the user's File > Options > Save >
255
+ * "Save AutoRecover information every N minutes" (two minutes by default).
256
+ */
257
+ autosaveIntervalMs?: number;
258
+ /**
259
+ * Host-owned storage (`DocumentStorage` from `ooxml-core/embedding`). When set,
260
+ * Save and Save As hand the bytes to `storage.save()` instead of downloading
261
+ * them, and recovery autosave snapshots go to the storage's recovery methods
262
+ * (`readRecovery` / `writeRecovery` / `clearRecovery`) instead of IndexedDB
263
+ * when it provides them.
264
+ */
265
+ storage?: DocumentStorage;
266
+ /**
267
+ * Cloud places for File > Open (OneDrive through `createOneDriveFileProvider` from
268
+ * `ooxml-core/embedding/onedrive`, or a provider of your own). When non-empty, the Open page
269
+ * lists "This device" and one place per provider. A file opened from a place loads like a
270
+ * normal open (read-only when the service does not allow editing, or when `canEdit` /
271
+ * `readOnly` already forbid it); File > Save, Save As and recovery of that document go to the
272
+ * file's own storage instead of `storage`, until another document is loaded.
273
+ */
274
+ fileProviders?: readonly CloudFileProvider[];
275
+ /** Fired with the serialised deck each time a recovery autosave snapshot is written. */
276
+ onAutosave?: (content: Uint8Array) => void;
277
+ /** Fired when the user enables or disables autosave (title bar or File > Options). */
278
+ onAutosaveToggle?: (enabled: boolean) => void;
279
+ /** Fired on every autosave lifecycle transition (`idle`, `saving`, `saved`, `error`). */
280
+ onAutosaveStatus?: (status: ViewerAutosaveStatus) => void;
281
+ /**
282
+ * Fired when a recovery snapshot left by a previous session is found for this deck. The
283
+ * built-in recovery prompt is shown as well.
284
+ */
285
+ onAutosaveRecovery?: (record: AutosaveRecord) => void;
286
+ /** Fired after any committed document edit (move, resize, text, undo, redo, ...). */
287
+ onChange?: () => void;
288
+ /** Fired with the changed fields when the user saves the document properties dialog. */
289
+ onPropertiesChange?: (updates: Partial<PptxCoreProperties>) => void;
290
+ /** Fired with the new speaker-notes text when the user edits the notes of a slide. */
291
+ onNotesUpdate?: (notes: string) => void;
292
+ /** Fired when presentation (slide show) mode is entered (`true`) or left (`false`). */
293
+ onPresentationChange?: (presenting: boolean) => void;
294
+ /** Fired on every collaboration connection-status transition. */
295
+ onCollaborationStatus?: (status: ConnectionStatus) => void;
296
+ /** Optional class name */
297
+ className?: string;
298
+ /**
299
+ * Display name used as the author for comments and annotations.
300
+ * Falls back to `collaboration.userName` when collaborating, or `'You'`.
301
+ */
302
+ authorName?: string;
303
+ /**
304
+ * Theme configuration for customising the viewer's appearance.
305
+ *
306
+ * Accepts partial color overrides, a custom border-radius, and
307
+ * arbitrary CSS custom properties. Unset values fall back to the
308
+ * built-in dark theme.
309
+ *
310
+ * @example
311
+ * ```tsx
312
+ * <PowerPointViewer
313
+ * content={bytes}
314
+ * theme={{
315
+ * colors: { primary: "#6366f1", background: "#0f172a" },
316
+ * radius: "0.75rem",
317
+ * }}
318
+ * />
319
+ * ```
320
+ *
321
+ * @see {@link ViewerTheme} for the full type definition.
322
+ */
323
+ theme?: ViewerTheme;
324
+ /**
325
+ * Initial key into `availableThemes` (or the built-in `THEME_CATALOG`) for
326
+ * File > Options > Appearance. Ignored once the user picks a different
327
+ * entry in that session, and always overridden by the `theme` prop when
328
+ * both are supplied. Falls back to a persisted `localStorage` choice, then
329
+ * `'default'`.
330
+ */
331
+ defaultThemeKey?: string;
332
+ /**
333
+ * Theme choices offered by File > Options > Appearance. Defaults to the
334
+ * shared `THEME_CATALOG` (default/light/vermilionLight/vermilionDark).
335
+ */
336
+ availableThemes?: ThemeCatalogEntry[];
337
+ /**
338
+ * Called when the user picks a theme from File > Options > Appearance.
339
+ * When provided, the host owns persisting the choice (the viewer will not
340
+ * also write it to `localStorage`); otherwise the viewer persists it via
341
+ * the shared `writeStoredViewerPrefs` helper.
342
+ */
343
+ onThemeChange?: (key: string) => void;
344
+ /**
345
+ * Initial locale code for File > Options > Language. Falls back to a persisted `localStorage`
346
+ * choice, then `'en'`. Ignored inside a `PptxI18nProvider`, whose `locale` is the language.
347
+ * Without a provider it applies only while the viewer reads a configured react-i18next
348
+ * instance; with neither (for example `pptx-react-viewer/no-i18next` on its own) the viewer
349
+ * shows its built-in English text and ignores it.
350
+ */
351
+ defaultLocale?: string;
352
+ /**
353
+ * Locale choices offered by File > Options > Language. Without a provider they default to the
354
+ * codes registered on the host's `react-i18next` instance, and have no effect when the viewer
355
+ * reads no configured instance (see `defaultLocale`). Inside a `PptxI18nProvider` there is no
356
+ * default: pass two or more, together with `onLocaleChange`, to show the Language category.
357
+ */
358
+ availableLocales?: LocaleCatalogEntry[];
359
+ /**
360
+ * Called when the user picks a language from File > Options > Language. When provided, the
361
+ * host owns applying and persisting the choice; otherwise the viewer applies and persists it
362
+ * itself. Inside a `PptxI18nProvider` the host always owns the language: without this callback
363
+ * the Language category is left out. Without a provider, when the viewer reads no configured
364
+ * react-i18next instance (see `defaultLocale`), the Language category is left out and this is
365
+ * never called.
366
+ */
367
+ onLocaleChange?: (code: string) => void;
368
+ /**
369
+ * Optional hook point for File > Account's sign-in section. Disabled by
370
+ * default (renders nothing extra); pass `{ enabled: true, onSignIn }` to
371
+ * surface a real sign-in flow.
372
+ */
373
+ accountAuth?: AccountAuthConfig;
374
+ /**
375
+ * Optional real-time collaboration configuration.
376
+ *
377
+ * When provided, the viewer enables collaborative editing with live
378
+ * cursors, user presence indicators, and CRDT-based state sync via Yjs.
379
+ * Requires `yjs` and `y-websocket` peer dependencies.
380
+ *
381
+ * @example
382
+ * ```tsx
383
+ * <PowerPointViewer
384
+ * content={bytes}
385
+ * collaboration={{
386
+ * roomId: "my-room-123",
387
+ * serverUrl: "wss://collab.example.com",
388
+ * userName: "Alice",
389
+ * userColor: "#6366f1",
390
+ * }}
391
+ * />
392
+ * ```
393
+ */
394
+ collaboration?: CollaborationInput;
395
+ /**
396
+ * Callback invoked when the user starts a collaboration session from the
397
+ * Share dialog. The host app should use this to set the `collaboration`
398
+ * prop with the returned config.
399
+ */
400
+ onStartCollaboration?: (config: CollaborationConfig) => void;
401
+ /**
402
+ * Callback invoked when the user stops a collaboration session from the
403
+ * Share dialog. The host app should clear the `collaboration` prop.
404
+ */
405
+ onStopCollaboration?: () => void;
406
+ /**
407
+ * Reports the shared `CollaborationState` (the contract Word, Excel and Visio
408
+ * use): called when a session starts or stops (the off state), and when its
409
+ * connection status, synced flag or people change. Works for viewer-owned and
410
+ * host-owned (`collaboration.session`) sessions; unchanged states are not repeated.
411
+ */
412
+ onCollaborationChange?: (state: CollaborationState) => void;
413
+ /**
414
+ * Default values for the Share dialog fields. The host app should provide
415
+ * these to control the session name, user display name, and server URL.
416
+ * If omitted, the Share dialog fields will be empty and require user input.
417
+ *
418
+ * @example
419
+ * ```tsx
420
+ * <PowerPointViewer
421
+ * shareDefaults={{
422
+ * roomId: "session-abc123",
423
+ * userName: "Alice",
424
+ * serverUrl: "ws://localhost:1234",
425
+ * }}
426
+ * />
427
+ * ```
428
+ */
429
+ shareDefaults?: {
430
+ roomId?: string;
431
+ userName?: string;
432
+ serverUrl?: string;
433
+ };
434
+ /**
435
+ * Opt in to the Three.js SmartArt renderer. When `true`, SmartArt diagrams
436
+ * render as extruded 3D blocks on a WebGL canvas instead of flat SVG.
437
+ * Requires the optional `three` peer dependency; when it is not installed
438
+ * (or the diagram has no geometry), the viewer transparently falls back to
439
+ * the SVG `SmartArtRenderer`. Default `false`.
440
+ */
441
+ smartArt3D?: boolean;
442
+ /**
443
+ * Opt in to the interactive Three.js surface-chart renderer. When `true`,
444
+ * `surface`/`surface3D` charts render as a WebGL mesh
445
+ * instead of the static SVG isometric
446
+ * projection. Chart marks are not selectable/draggable in this mode.
447
+ * Requires the optional `three` peer dependency; when it is not installed
448
+ * (or the chart has no plottable grid), the viewer transparently falls back
449
+ * to the SVG surface renderer. Default `false`.
450
+ */
451
+ surfaceChart3D?: boolean;
452
+ /**
453
+ * Opt in to the interactive Three.js bar3D-chart renderer. When `true`,
454
+ * `bar3D` charts render as real box meshes instead of the flat SVG oblique-projection
455
+ * illusion. Chart marks are not selectable/draggable in this mode.
456
+ * Requires the optional `three` peer dependency; when it is not installed
457
+ * (or the chart has no plottable grid, or it is a horizontal 3-D Bar), the
458
+ * viewer transparently falls back to the flat SVG bar3D renderer. Default
459
+ * `false`.
460
+ */
461
+ barChart3D?: boolean;
462
+ /**
463
+ * Opt in to the interactive Three.js line3D-chart renderer. When `true`,
464
+ * `line3D` charts render as a real tube-path mesh per
465
+ * series, one per depth ("series") plane,
466
+ * instead of the flat SVG oblique-projection illusion. Chart marks are not
467
+ * selectable/draggable in this mode. Requires the optional `three` peer
468
+ * dependency; when it is not installed (or the chart has no plottable
469
+ * grid), the viewer transparently falls back to the flat SVG line3D
470
+ * renderer. Default `false`.
471
+ */
472
+ lineChart3D?: boolean;
473
+ /**
474
+ * Opt in to the interactive Three.js area3D-chart renderer. When `true`,
475
+ * `area3D` charts render as a real tube path + filled
476
+ * ribbon mesh per series, one per depth ("series") plane, instead of the flat SVG oblique-projection illusion.
477
+ * Chart marks are not selectable/draggable in this mode. Requires the
478
+ * optional `three` peer dependency; when it is not installed (or the chart
479
+ * has no plottable grid), the viewer transparently falls back to the flat
480
+ * SVG area3D renderer. Default `false`.
481
+ */
482
+ areaChart3D?: boolean;
483
+ /**
484
+ * Opt in to the interactive Three.js pie3D-chart renderer. When `true`,
485
+ * `pie3D` charts render as real wedge meshes instead of the flat SVG oblique-projection
486
+ * illusion. Chart marks are not selectable/draggable in this mode.
487
+ * Requires the optional `three` peer dependency; when it is not installed
488
+ * (or the chart has no plottable series), the viewer transparently falls
489
+ * back to the flat SVG pie3D renderer. Default `false`.
490
+ */
491
+ pieChart3D?: boolean;
492
+ /**
493
+ * Zero-based slide shown after each load, clamped into the deck. Default
494
+ * `0`. Changing it later does not move the current slide; it applies to
495
+ * the next load.
496
+ */
497
+ initialSlide?: number;
498
+ /**
499
+ * Google Fonts fallback for deck fonts that are neither installed nor
500
+ * embedded. Unset: File > Options > Trust Center > "Download fonts that
501
+ * are not installed or embedded" decides (on by default: the viewer
502
+ * loads them from `fonts.googleapis.com`). Any other value locks that
503
+ * option: off for `false` or an invalid `baseUrl`, on for a mirror.
504
+ * `false`: no request goes to Google (`fonts.googleapis.com` or
505
+ * `fonts.gstatic.com`); text uses installed, embedded or fallback fonts.
506
+ * `{ baseUrl }`: requests go to a self-hosted mirror of the Google Fonts
507
+ * CSS2 API instead, so the user's browser never contacts Google. An
508
+ * invalid `baseUrl` disables the fallback (with a console warning).
509
+ */
510
+ googleFonts?: GoogleFontsOption;
511
+ /**
512
+ * How far Bullets / Numbering reach from a bare caret (no text selected).
513
+ * `'paragraph'` (default, PowerPoint behaviour): only the caret's paragraph
514
+ * changes. `'list'` (Word / Google Docs behaviour): when the caret's
515
+ * paragraph is already a list item and the command switches it between
516
+ * bullets and numbering, every adjacent item of that list converts with it.
517
+ * A range selection always affects only the paragraphs it touches.
518
+ */
519
+ listConversionScope?: ListConversionScope;
520
+ /**
521
+ * Show the editor chrome: title bar, ribbon and toolbar, protected-view
522
+ * and read-only banners, the mobile toolbar and the status bar. Default
523
+ * `true`; `false` leaves the canvas (and the thumbnail pane, if shown).
524
+ */
525
+ showToolbar?: boolean;
526
+ /**
527
+ * Show the slide thumbnail pane. Default `true`. The pane still follows
528
+ * the user's own collapse toggle and the `slidesPane` customisation panel.
529
+ */
530
+ showThumbnails?: boolean;
531
+ /**
532
+ * Show the compatibility warning toast stack after a load. Default `true`.
533
+ * `false` hides the stack only; the warnings are still collected.
534
+ */
535
+ showCompatibilityToasts?: boolean;
536
+ /**
537
+ * Hide individual toolbar buttons and/or ribbon tabs instead of the whole
538
+ * toolbar. Accepts any mix of button ids (`share`, `broadcast`, `export`,
539
+ * `undo`, `redo`, `record`, `notes`, `fullscreen`, `zoom`, `navigation`)
540
+ * and ribbon-tab ids (`file`, `home`, `insert`, `draw`, `design`,
541
+ * `transitions`, `animations`, `slideShow`, `record`, `review`, `view`,
542
+ * `help`). `zoom` and `navigation` each hide their whole control cluster
543
+ * (zoom in/out/fit; previous/next slide), not each sub-button. `record`
544
+ * is shared between the quick-access Record button and the Record ribbon
545
+ * tab: hiding it hides both. Omitted or empty hides nothing (default,
546
+ * fully backward compatible).
547
+ *
548
+ * @example
549
+ * ```tsx
550
+ * <PowerPointViewer content={bytes} hiddenActions={['share', 'broadcast', 'record']} />
551
+ * ```
552
+ */
553
+ hiddenActions?: ToolbarActionId[];
554
+ /**
555
+ * Ribbon tabs the host adds after Help, as an Office add-in does. Each
556
+ * command runs its `run` callback and dispatches a bubbling
557
+ * `office-ribbon-add-in` DOM event (`{ tab, command }`) from the viewer. A
558
+ * tab cannot take the id of a built-in tab, and a drop-down (`items`) is
559
+ * drawn as its items. The desktop ribbon shows them; the phone toolbar does not.
560
+ *
561
+ * @example
562
+ * ```tsx
563
+ * <PowerPointViewer
564
+ * content={bytes}
565
+ * ribbonAddIns={[{ id: 'reports', label: 'Reports', groups: [
566
+ * { label: 'Export', commands: [{ id: 'export', label: 'Export', run: exportReport }] },
567
+ * ] }]}
568
+ * />
569
+ * ```
570
+ */
571
+ ribbonAddIns?: readonly RibbonAddInTab[];
572
+ /**
573
+ * Opt in to the built-in AI assistant. When provided, a Sparkles toggle
574
+ * appears in the toolbar and opens a chat panel; when omitted, no AI icon
575
+ * renders and no AI code is loaded (the panel and its `@ai-sdk/react`
576
+ * dependency are `React.lazy`-imported only on first open).
577
+ *
578
+ * Pass a plain `PptxAiConfig` (supported and not deprecated), or the opaque
579
+ * handle `createAiAssistant(config)` returns (from `pptx-react-viewer/ai`, the
580
+ * opt-in entry that brings the chat panel). Both open the same panel. Only a
581
+ * value from `createAiAssistant` is read as a handle; any other value is a
582
+ * plain config, which the viewer does not validate. The config supplies the
583
+ * model connection (a backend `endpoint`, an in-browser `model`, or a custom
584
+ * `transport`) plus optional tool allow/deny lists and a write policy.
585
+ * Requires the optional `ai` and `@ai-sdk/react` peers.
586
+ *
587
+ * @example
588
+ * ```tsx
589
+ * import { createAiAssistant } from 'pptx-react-viewer/ai';
590
+ *
591
+ * const assistant = createAiAssistant({ connection: { kind: 'endpoint', api: '/api/chat' } });
592
+ * <PowerPointViewer content={bytes} ai={assistant} />
593
+ * ```
594
+ *
595
+ * @see {@link PptxAiConfig}
596
+ */
597
+ ai?: PptxAiConfig | PptxAiAssistant;
598
+ /**
599
+ * Framework-neutral UI customisation. See docs/guide/customization.md.
600
+ * Unioned with `hiddenActions`. A new object replaces the whole
601
+ * customisation, including edits made through the handle helpers.
602
+ */
603
+ /** Initial inspector visibility; omitted preserves the desktop/mobile default. */
604
+ inspectorInitiallyOpen?: boolean;
605
+ customization?: ViewerCustomization;
606
+ /**
607
+ * Host switch for content a deck links from another server (http(s)
608
+ * relationship targets): pictures, picture fills and bullets, video, audio
609
+ * and poster frames. `false`: none of it is fetched. `true`: it is allowed.
610
+ * Either value locks File > Options > Trust Center > "Allow external
611
+ * content" to match; unset keeps the user's choice there. Google Fonts
612
+ * requests are separate (see `googleFonts`).
613
+ * A change applies from the next load.
614
+ */
615
+ allowExternalContent?: boolean;
616
+ /**
617
+ * Bounds on the work loading a deck may do, for hosts that show untrusted
618
+ * decks: `maxInputBytes`, `maxUncompressedBytes`, `maxEntries`, `maxSlides`
619
+ * and `maxShapes` (see `PptxLoadLimits`). Unset keeps the core defaults
620
+ * (500 MiB inflated, 65,536 ZIP entries, no other limit). A deck over a
621
+ * limit shows the load-error screen with the limit and the deck's value.
622
+ * A change applies from the next load.
623
+ */
624
+ limits?: PptxLoadLimits;
625
+ }
626
+ interface PowerPointViewerHandle extends FileViewerHandle, PowerPointViewerAPI, ViewerCustomizationApi {
627
+ getContent: () => Promise<Uint8Array>;
628
+ }
629
+
630
+ declare function getAnimationInitialStyle(preset: PptxAnimationPreset | undefined, nativeAnimation?: PptxNativeAnimation): React$1__default.CSSProperties;
631
+ /**
632
+ * Root React component for the PowerPoint viewer/editor.
633
+ *
634
+ * Accepts binary `.pptx` content and renders a full-featured editor with
635
+ * slide canvas, toolbar, inspector panels, presentation mode, and more.
636
+ *
637
+ * Uses `forwardRef` to expose a `PowerPointViewerHandle` for imperative
638
+ * access (e.g. serialising the current content for saving).
639
+ */
640
+ declare const PowerPointViewer: React$1.ForwardRefExoticComponent<PowerPointViewerProps & React$1.RefAttributes<PowerPointViewerHandle>>;
641
+ interface PptxI18nProviderProps {
642
+ /**
643
+ * Translates a viewer key; see {@link PptxTranslate}. Keep it referentially stable (a
644
+ * module-level function or `useCallback`): the viewer re-translates, re-rendering and re-running
645
+ * every translated effect, whenever `translate` or `locale` changes. To pick up messages loaded
646
+ * later for the same language, pass a new function.
647
+ */
648
+ readonly translate: PptxTranslate;
649
+ /**
650
+ * The host's active language: what the viewer reports and File > Options > Language shows as
651
+ * selected. A change re-translates the viewer, also when `translate` stays the same.
652
+ */
653
+ readonly locale: string;
654
+ readonly children?: ReactNode;
655
+ }
656
+ /**
657
+ * Translates every viewer component below it (`PowerPointViewer` and the standalone building
658
+ * blocks) through the host's own i18n library instead of react-i18next. A `PowerPointViewer`
659
+ * reads the provider nearest above it; a provider rendered inside the viewer is ignored, so the
660
+ * whole viewer shares one language. React only: the other bindings translate through their
661
+ * framework's i18n library or a `messages` dictionary.
662
+ */
663
+ declare function PptxI18nProvider({ translate, locale, children }: PptxI18nProviderProps): ReactElement;
664
+
665
+ interface ToolbarProps {
666
+ fileName?: string;
667
+ mode: ViewerMode;
668
+ canEdit: boolean;
669
+ /**
670
+ * True when `canEdit` is false because Trust Center > "Open presentations
671
+ * in Protected View" is on (not because the host itself withheld edit
672
+ * permission). Turns the toolbar's read-only badge into an "Enable
673
+ * Editing" action.
674
+ */
675
+ isProtectedView?: boolean;
676
+ /** Drops the Protected View override for this session. Only offered when `isProtectedView` is true. */
677
+ onEnableEditing?: () => void;
678
+ /**
679
+ * The viewer's Ribbon Display Options controller. Optional: a ribbon rendered on its own
680
+ * stays in the default "always" mode.
681
+ */
682
+ ribbonDisplay?: RibbonDisplayController;
683
+ isNarrowViewport: boolean;
684
+ isSidebarCollapsed: boolean;
685
+ isInspectorPaneOpen: boolean;
686
+ isCompactToolbarOpen: boolean;
687
+ toolbarSection: ToolbarSection;
688
+ scale: number;
689
+ canUndo: boolean;
690
+ canRedo: boolean;
691
+ undoLabel: string | undefined;
692
+ redoLabel: string | undefined;
693
+ findReplaceOpen: boolean;
694
+ selectedElement: PptxElement | null;
695
+ tableEditorState?: TableCellEditorState | null;
696
+ editTemplateMode: boolean;
697
+ newShapeType: SupportedShapeType;
698
+ /** The armed Freeform: Shape / Curve tool, or null. */
699
+ activeFreeformTool?: FreeformToolKind | null;
700
+ activeTool: DrawingTool;
701
+ drawingColor: string;
702
+ drawingWidth: number;
703
+ clipboardPayload: ElementClipboardPayload | null;
704
+ onSetMode: (mode: ViewerMode) => void;
705
+ /**
706
+ * PowerPoint's "From Beginning" (F5): enters the show on the show's FIRST
707
+ * slide regardless of the currently active slide, unlike `onSetMode`
708
+ * ('present') which enters "From Current Slide". Falls back to
709
+ * `onSetMode('present')` when omitted.
710
+ */
711
+ onPresentFromBeginning?: () => void;
712
+ onToggleSidebar: () => void;
713
+ onToggleInspector: () => void;
714
+ /** Opens the inspector pane and switches to the properties tab (for animation panel). */
715
+ onOpenAnimationPanel: () => void;
716
+ /**
717
+ * Adds an animation to the selected element. For the three preset buckets
718
+ * `preset` is a `PptxAnimationPreset`; for `motionPath` it is a motion-path
719
+ * catalogue id.
720
+ */
721
+ onAddAnimation?: (preset: string, group: AnimationApplyGroup) => void;
722
+ /** Removes all animations from the selected element. */
723
+ onRemoveAnimation?: () => void;
724
+ onToggleCompactToolbar: () => void;
725
+ onSetToolbarSection: (section: ToolbarSection) => void;
726
+ onZoomIn: () => void;
727
+ onZoomOut: () => void;
728
+ onZoomToFit: () => void;
729
+ onUndo: () => void;
730
+ onRedo: () => void;
731
+ onToggleFindReplace: () => void;
732
+ onSetNewShapeType: (type: SupportedShapeType) => void;
733
+ /** Arm (or, with null, disarm) a Freeform: Shape / Curve tool. */
734
+ onArmFreeformTool?: (tool: FreeformToolKind | null) => void;
735
+ onAddTextBox: () => void;
736
+ onAddShape: () => void;
737
+ onAddTable: (rows?: number, columns?: number) => void;
738
+ onAddChart?: (chartKind: InsertChartKind) => void;
739
+ /** Opens the Insert Chart dialog; without it the Chart menu leaves "Insert Chart..." out. */
740
+ onOpenChartDialog?: () => void;
741
+ onAddSmartArt: () => void;
742
+ onAddEquation: () => void;
743
+ onAddActionButton: (shapeType: string) => void;
744
+ onInsertField?: (fieldType: string, value?: string) => void;
745
+ onOpenHeaderFooter?: () => void;
746
+ onOpenImagePicker: () => void;
747
+ onOpenMediaPicker: () => void;
748
+ onSetActiveTool: (tool: DrawingTool) => void;
749
+ onSetDrawingColor: (color: string) => void;
750
+ onSetDrawingWidth: (width: number) => void;
751
+ onSetEditTemplateMode: (mode: boolean) => void;
752
+ spellCheckEnabled: boolean;
753
+ showGrid: boolean;
754
+ showRulers: boolean;
755
+ /** Whether the drawing guides are painted on the canvas (View ▸ Guides). */
756
+ showGuides: boolean;
757
+ snapToGrid: boolean;
758
+ snapToShape: boolean;
759
+ onSetSpellCheckEnabled: (enabled: boolean) => void;
760
+ onSetShowGrid: (enabled: boolean) => void;
761
+ onSetShowRulers: (enabled: boolean) => void;
762
+ onSetShowGuides: (enabled: boolean) => void;
763
+ onSetSnapToGrid: (enabled: boolean) => void;
764
+ onSetSnapToShape: (enabled: boolean) => void;
765
+ onAddGuide: (axis: 'h' | 'v') => void;
766
+ onAlignElements: (align: string) => void;
767
+ onDistributeElements: (axis: string) => void;
768
+ canDistribute: boolean;
769
+ onCopy: () => void;
770
+ onCut: () => void;
771
+ onPaste: () => void;
772
+ onFlip: (direction: 'horizontal' | 'vertical') => void;
773
+ onMoveLayer: (direction: string) => void;
774
+ onMoveLayerToEdge: (direction: string) => void;
775
+ /** Combine the multi-selection into one group element. */
776
+ onGroupElements: () => void;
777
+ /** Dissolve the selected group back into its children. */
778
+ onUngroupElement: () => void;
779
+ /** Patch the selected element's shape style (outline width, fill, ...). */
780
+ onUpdateElementStyle: (updates: Partial<ShapeStyle>) => void;
781
+ /** How many elements the multi-select currently holds. */
782
+ selectedCount: number;
783
+ /** Whether every selected element allows `a:spLocks/@noGrp` grouping. */
784
+ selectionGroupable: boolean;
785
+ /** Open the hyperlink editor for the current selection. */
786
+ onOpenHyperlinkDialog: () => void;
787
+ onDuplicate: () => void;
788
+ onDelete: () => void;
789
+ /** Open another presentation (File ▸ Open). Hidden when not provided. */
790
+ onOpenFile?: () => void;
791
+ onOpenRecentFile?: (key: string) => void;
792
+ onCreatePresentation: (templateId: string) => void;
793
+ onExportPng: () => void;
794
+ onExportPdf: () => void;
795
+ onExportVideo: () => void;
796
+ onExportGif: () => void;
797
+ onExportJson: () => void;
798
+ onOpenShareDialog?: () => void;
799
+ /** File > Save (the backstage Save item): reported to host storage as `save`, not Save As. */
800
+ onSave?: () => void;
801
+ onSaveAsPptx: () => void;
802
+ onSaveAsPpsx: () => void;
803
+ onSaveAsPptm: () => void;
804
+ onSaveAsPpt: () => void;
805
+ hasMacros: boolean;
806
+ onCopySlideAsImage: () => void;
807
+ onPrint: () => void;
808
+ onToggleShortcuts: () => void;
809
+ onOpenSettings?: () => void;
810
+ onRunAccessibilityCheck: () => void;
811
+ onToggleSlideSorter: () => void;
812
+ /**
813
+ * View > Normal: leave whichever alternate view (slide sorter, reading,
814
+ * outline, master) is open and return to the ordinary editing canvas.
815
+ */
816
+ onGoToNormalView?: () => void;
817
+ /** Enter PowerPoint's Reading View (full window, not the fullscreen show). */
818
+ onOpenReadingView: () => void;
819
+ /** Enter PowerPoint's Outline view: the deck as editable indented text. */
820
+ onOpenOutlineView: () => void;
821
+ onUpdateTextStyle: (updates: Partial<TextStyle>) => void;
822
+ /** Bullets / Numbering for the selected text element (shared paragraph bullet toggle). */
823
+ onToggleBullets: (kind: 'bullet' | 'numbered') => void;
824
+ /** Rewrite the selected text's characters (PowerPoint's Aa "Change Case" dropdown). */
825
+ onTransformTextCase: (mode: ChangeCaseMode) => void;
826
+ isOverflowMenuOpen: boolean;
827
+ onSetOverflowMenuOpen: (open: boolean) => void;
828
+ layoutOptions: PptxLayoutOption[];
829
+ /** `layoutPath` of the active slide, marking the current gallery tile. */
830
+ currentLayoutPath?: string;
831
+ /** Supplies gallery artwork; without it the menus stay name-only. */
832
+ loadLayoutPreviews?: () => Promise<PptxLayoutPreview[]>;
833
+ /** Theme major/minor latin faces, leading the font dropdown. */
834
+ themeFonts?: {
835
+ heading?: string;
836
+ body?: string;
837
+ };
838
+ /** Families the deck embeds, offered as their own dropdown group. */
839
+ embeddedFontFamilies?: readonly string[];
840
+ /** Families registered this session via File > Options > Fonts. */
841
+ customFontFamilies?: readonly string[];
842
+ onInsertSlideFromLayout: (path: string, name?: string) => void;
843
+ /** Re-map the active slide onto another of its master's layouts. */
844
+ onApplyLayout?: (path: string) => void;
845
+ /** Insert a pre-designed starter slide from the template gallery. */
846
+ onInsertSlideFromTemplate?: (templateId: SlideTemplateId) => void;
847
+ /** Deck scheme map so template gallery previews show the deck theme. */
848
+ templateScheme?: Record<string, string>;
849
+ customShows: PptxCustomShow[];
850
+ activeCustomShowId: string | null;
851
+ onSetActiveCustomShowId: (id: string | null) => void;
852
+ onCreateCustomShow: () => void;
853
+ onRenameActiveCustomShow: () => void;
854
+ onDeleteActiveCustomShow: () => void;
855
+ onToggleCurrentSlideInActiveShow: () => void;
856
+ isCurrentSlideInActiveShow: boolean;
857
+ onToggleVersionHistory?: () => void;
858
+ onOpenPasswordProtection?: () => void;
859
+ onOpenDocumentProperties?: () => void;
860
+ /** Design > Slide Size: reveal the inspector card that owns the slide size. */
861
+ onOpenSlideSize?: () => void;
862
+ onOpenFontEmbedding?: () => void;
863
+ onOpenDigitalSignatures?: () => void;
864
+ onEnterMasterView: () => void;
865
+ onCloseMasterView: () => void;
866
+ onEnterPresenterView?: () => void;
867
+ onEnterRehearsalMode?: () => void;
868
+ onToggleThemeEditor: () => void;
869
+ isThemeEditorOpen: boolean;
870
+ onToggleThemeGallery: () => void;
871
+ isThemeGalleryOpen: boolean;
872
+ onCompare?: () => void;
873
+ onToggleComments?: () => void;
874
+ isCommentsPanelOpen?: boolean;
875
+ /** The phone Insert sheet (opened from the bottom bar) and how it asks to close. */
876
+ isMobileInsertOpen?: boolean;
877
+ onCloseMobileInsert?: () => void;
878
+ spellCheckActive?: boolean;
879
+ slideCommentCount?: number;
880
+ /** Review > Comments Previous / Next / Delete: the deck's slides and how to rewrite them. */
881
+ reviewComments?: ReviewCommentsHost;
882
+ formatPainterActive?: boolean;
883
+ onToggleFormatPainter?: () => void;
884
+ canActivateFormatPainter?: boolean;
885
+ isSelectionPaneOpen?: boolean;
886
+ onToggleSelectionPane?: () => void;
887
+ eyedropperActive?: boolean;
888
+ onToggleEyedropper?: () => void;
889
+ onOpenSetUpSlideShow?: () => void;
890
+ /** Slide Show > Custom Slide Show: open the Custom Shows dialog. */
891
+ onOpenCustomShows?: () => void;
892
+ /** PowerPoint's Hide Slide toggle for the active slide (Slide Show tab). */
893
+ onToggleHideSlide?: () => void;
894
+ /** Whether the active slide is hidden, for Hide Slide's pressed state. */
895
+ activeSlideHidden?: boolean;
896
+ onOpenBroadcastDialog?: () => void;
897
+ onToggleSubtitles?: () => void;
898
+ showSubtitles?: boolean;
899
+ activeSlide?: PptxSlide;
900
+ onTransitionChange: (updates: Partial<PptxSlideTransition>) => void;
901
+ onApplyTransitionToAll: () => void;
902
+ /**
903
+ * Home > Slides > Reset: re-apply the active slide's own layout, restoring
904
+ * inherited placeholder geometry. Undeclared until now, which is why
905
+ * `SlidesGroup` bound `undefined` and the button did nothing.
906
+ */
907
+ onResetSlide?: () => void;
908
+ /** Home > Slides > Section: start a new section at the active slide. */
909
+ onAddSection?: () => void;
910
+ /** Home > Editing > Select > Select All (every element on the active slide). */
911
+ onSelectAll?: () => void;
912
+ /**
913
+ * Slide Show > Options: what the four checkboxes read, and how a tick is
914
+ * committed. See shared `ribbon-slide-show-options`.
915
+ */
916
+ presentationProperties?: PptxPresentationProperties;
917
+ onPresentationPropertiesChange?: (updates: Partial<PptxPresentationProperties>) => void;
918
+ /** Host-supplied list of toolbar buttons/ribbon tabs to hide. See `PowerPointViewerProps.hiddenActions`. */
919
+ hiddenActions?: readonly ToolbarActionId[];
920
+ /** File > Options > Advanced > "Quickly access this number of Recent Documents". */
921
+ recentPresentationsCount?: number;
922
+ /** Whether the AI assistant is available (the host passed the `ai` prop). */
923
+ aiEnabled?: boolean;
924
+ /** Whether the AI assistant panel is currently open. */
925
+ isAiPanelOpen?: boolean;
926
+ /** Toggle the AI assistant panel. */
927
+ onToggleAiPanel?: () => void;
928
+ /**
929
+ * Run a Quick Access command beyond the dedicated Save/Undo/Redo trio, by
930
+ * catalog id. Used for the below-ribbon strip when Options > Quick Access
931
+ * Toolbar > position is "below" (the same handler `TitleBar` uses for its
932
+ * own inline strip when position is "above").
933
+ */
934
+ onQuickCommand?: (id: string) => void;
935
+ }
936
+ type CanvasImagePasteHandlers = Pick<EditorImagePasteOptions, 'getTarget' | 'insertElement'>;
937
+ /**
938
+ * Table band / header / emphasis styling for the React table renderer.
939
+ *
940
+ * The resolution itself (`ppt/tableStyles.xml` lookup, whole-table and banded
941
+ * fills, header / total / first / last emphasis, `a:fontRef@idx` font resolution,
942
+ * gradient and pattern fills) lives in `pptx-viewer-shared`, so every binding
943
+ * paints a table the same way. This module is the React adapter: it narrows the
944
+ * element, maps the theme onto the shared context, and hands back a
945
+ * `CSSProperties` object.
946
+ *
947
+ * @module viewer/utils/table-band-style
948
+ */
949
+ /** Context for resolving table style colours from the theme. */
950
+ interface TableStyleContext {
951
+ tableStyleMap?: ParsedTableStyleMap;
952
+ theme?: PptxTheme;
953
+ }
954
+ /** Identifies the element omitted after a React client render or lifecycle error. */
955
+ interface ElementRenderErrorContext {
956
+ elementId: string;
957
+ elementType: PptxElement['type'];
958
+ slideId?: string;
959
+ }
960
+ type ElementRenderErrorHandler = (error: Error, context: ElementRenderErrorContext) => void;
961
+ /** Wiring for Edit Points and the Freeform: Shape / Curve tools. */
962
+ interface OutlineAuthoringProps {
963
+ /** The shape in Edit Points mode, or null. */
964
+ editPointsElementId: string | null;
965
+ /** Edit Points menu commands the host hid. */
966
+ hiddenEditPointsCommands?: ReadonlySet<EditPointsCommandId>;
967
+ /** Apply one Edit Points edit (one undo step). */
968
+ onCommitEditPoints: (elementId: string, patch: EditPointsElementPatch) => void;
969
+ onExitEditPoints: () => void;
970
+ /** The armed drawing tool, or null. */
971
+ freeformTool: FreeformToolKind | null;
972
+ /** Insert a drawn freeform (the tool then disarms). */
973
+ onFreeformCommit: (element: ShapePptxElement) => void;
974
+ onFreeformCancel: () => void;
975
+ }
976
+ interface ZoomViewport {
977
+ canvasViewportRef: React$1__default.RefObject<HTMLDivElement | null>;
978
+ /** Optional mount notification for hook-owned fit and wheel listeners. */
979
+ setCanvasViewportNode?: React$1__default.RefCallback<HTMLDivElement>;
980
+ editWrapperRef: React$1__default.RefObject<HTMLDivElement | null>;
981
+ canvasStageRef: React$1__default.RefObject<HTMLDivElement | null>;
982
+ editorScale: number;
983
+ }
984
+ interface SlideCanvasProps {
985
+ /** Reports an element omitted after a React render/lifecycle error; defaults to console.error. */
986
+ onElementRenderError?: ElementRenderErrorHandler;
987
+ /** The viewer-owned live channel; absent for static/custom non-collaborative canvases. */
988
+ livePatcher?: CollaborationLivePatcher;
989
+ registerInlineEditReader?: (elementId: string, read: () => InlineListReadResult) => () => void;
990
+ /** Native image paste commands supplied by the stock or headless editor. */
991
+ imagePaste?: CanvasImagePasteHandlers;
992
+ activeSlide: PptxSlide | undefined;
993
+ templateElements: PptxElement[];
994
+ canvasSize: CanvasSize$1;
995
+ zoom: ZoomViewport;
996
+ mode: ViewerMode;
997
+ canEdit: boolean;
998
+ editTemplateMode: boolean;
999
+ selectedElementIdSet: Set<string>;
1000
+ selectedElement: PptxElement | null;
1001
+ inlineEditingElementId: string | null;
1002
+ inlineEditingText: string;
1003
+ spellCheckEnabled: boolean;
1004
+ mediaDataUrls: Map<string, string>;
1005
+ tableEditorState: TableCellEditorState | null;
1006
+ marqueeSelectionState: MarqueeSelectionState | null;
1007
+ snapLines: Array<{
1008
+ axis: string;
1009
+ position: number;
1010
+ }>;
1011
+ showGrid: boolean;
1012
+ /** Grid spacing in CSS px (derived from PPTX gridSpacing EMUs). */
1013
+ gridSpacingPx?: number;
1014
+ showRulers: boolean;
1015
+ /** Unit system for rulers (default: inches). */
1016
+ rulerUnit?: RulerUnit;
1017
+ guides: Array<{
1018
+ id: string;
1019
+ axis: 'h' | 'v';
1020
+ position: number;
1021
+ }>;
1022
+ presentationElementStates?: Map<string, ElementAnimationState>;
1023
+ presentationKeyframesCss?: string;
1024
+ onClick: (elementId: string, e: React$1__default.MouseEvent) => void;
1025
+ onDoubleClick: (elementId: string, e: React$1__default.MouseEvent) => void;
1026
+ onMouseDown: (elementId: string, e: React$1__default.MouseEvent) => void;
1027
+ onContextMenu: (elementId: string, e: React$1__default.MouseEvent) => void;
1028
+ /** Called when the user presses mouse down on empty canvas space. */
1029
+ onCanvasMouseDown?: (e: React$1__default.MouseEvent) => void;
1030
+ /** Right-click on empty canvas (no element hit); opens the canvas context menu. */
1031
+ onCanvasContextMenu?: (e: React$1__default.MouseEvent) => void;
1032
+ onResizePointerDown: (elementId: string, e: React$1__default.MouseEvent, handle: string) => void;
1033
+ onAdjustmentPointerDown: (elementId: string, e: React$1__default.MouseEvent, descriptor: ShapeAdjustmentHandleDescriptor) => void;
1034
+ /** Commit a new rotation (degrees) when the on-canvas rotate handle is dragged. */
1035
+ onRotate?: (elementId: string, rotationDeg: number) => void;
1036
+ onInlineEditChange: (text: string, snapshot?: InlineTextEditSnapshot) => void;
1037
+ onInlineEditCommit: () => void;
1038
+ onInlineEditCancel: () => void;
1039
+ onTableCellSelect: (cell: Omit<TableCellEditorState, 'elementId'> | null, elementId: string) => void;
1040
+ /** Called when an edited table cell should be committed. */
1041
+ onCommitCellEdit?: (elementId: string, rowIndex: number, colIndex: number, text: string) => void;
1042
+ /**
1043
+ * Commit a partial update to a SmartArt element from inline (on-canvas) node
1044
+ * editing. Routed to the same element-update path the inspector uses (undo/redo
1045
+ * + dirty marking). When absent, inline SmartArt editing is disabled.
1046
+ */
1047
+ onUpdateSmartArtElement?: (elementId: string, updates: Partial<PptxElement>) => void;
1048
+ /**
1049
+ * Apply a text-style toggle (Ctrl/Cmd+B/I/U) to the element being
1050
+ * inline-edited. Routed to the same updateSelectedTextStyle path as the
1051
+ * toolbar. When absent, the inline formatting shortcuts are inert.
1052
+ */
1053
+ onFormatText?: (updates: Partial<TextStyle>) => void;
1054
+ /** Called when table column widths are resized. */
1055
+ onResizeTableColumns?: (elementId: string, newWidths: number[]) => void;
1056
+ /** Called when a table row is resized. */
1057
+ onResizeTableRow?: (elementId: string, rowIndex: number, newHeight: number) => void;
1058
+ /** Find & Replace results (all matches across all slides). */
1059
+ findResults?: ReadonlyArray<{
1060
+ slideIndex: number;
1061
+ elementId: string;
1062
+ segmentIndex: number;
1063
+ startOffset: number;
1064
+ length: number;
1065
+ }>;
1066
+ /** Index of the currently focused find result (-1 for none). */
1067
+ findResultIndex?: number;
1068
+ /** Index of the currently visible slide (needed to filter find results). */
1069
+ activeSlideIndex?: number;
1070
+ /** Currently active drawing tool ("select" means no drawing overlay). */
1071
+ activeTool?: DrawingTool;
1072
+ /** Stroke colour for pen / highlighter. */
1073
+ drawingColor?: string;
1074
+ /** Stroke width for pen / highlighter. */
1075
+ drawingWidth?: number;
1076
+ /** Ref that is true while a pointer stroke is in progress. */
1077
+ isDrawingRef?: React$1__default.RefObject<boolean>;
1078
+ /** Called when a completed ink stroke should be added to the slide. */
1079
+ onAddInkElement?: (ink: InkPptxElement) => void;
1080
+ /** Called when a freeform drawing stroke should be added as a shape element. */
1081
+ onAddFreeformShape?: (shape: ShapePptxElement) => void;
1082
+ /** Called when the eraser tool removes an ink element. */
1083
+ onEraseInkElement?: (elementId: string) => void;
1084
+ /** Called when a shape-level action is clicked (e.g. slide jump, URL). */
1085
+ onActionClick?: (elementId: string, action: PptxAction) => void;
1086
+ /** Called when a text-level hyperlink is clicked. */
1087
+ onHyperlinkClick?: (url: string) => void;
1088
+ /** Comments for the current slide (used for on-canvas markers). */
1089
+ comments?: PptxComment[];
1090
+ /** Whether to show comment markers on the slide canvas. */
1091
+ showCommentMarkers?: boolean;
1092
+ /** Called when a comment marker is clicked. */
1093
+ onCommentMarkerClick?: (commentId: string) => void;
1094
+ onMoveGuide?: (guideId: string, position: number) => void;
1095
+ onDeleteGuide?: (guideId: string) => void;
1096
+ onCreateGuideFromRuler?: (axis: 'h' | 'v', positionPx: number) => void;
1097
+ /**
1098
+ * Commits the slide's animation list after an on-canvas motion-path edit
1099
+ * (dragging the path's end handle). Absent means the path is drawn but
1100
+ * read-only.
1101
+ */
1102
+ onUpdateSlideAnimations?: (animations: PptxElementAnimation[]) => void;
1103
+ /** When true, shows connection sites on shapes and enables connector drawing. */
1104
+ connectorCreationMode?: boolean;
1105
+ /** Called when a new connector is created between two shapes. */
1106
+ onCreateConnector?: (connector: ConnectorPptxElement) => void;
1107
+ /** All slides in the presentation (for zoom element thumbnails). */
1108
+ allSlides?: readonly PptxSlide[];
1109
+ /** Callback fired when a zoom element is clicked in presentation mode. */
1110
+ onZoomClick?: (target: ZoomNavigationTarget, returnSlideIndex: number) => void;
1111
+ /** Index of the current slide (for zoom return navigation). */
1112
+ sourceSlideIndex?: number;
1113
+ /** Context for text field placeholder substitution (slide number, header/footer, etc.). */
1114
+ fieldContext?: FieldSubstitutionContext;
1115
+ /** Theme + table style map for resolving table band/header colours. */
1116
+ tableStyleContext?: TableStyleContext;
1117
+ /** Optional collaboration cursor overlay rendered on top of the canvas. */
1118
+ collaborationOverlay?: React$1__default.ReactNode;
1119
+ /**
1120
+ * When true, the stage marks itself `data-pptx-ai-active` so element colour
1121
+ * changes tween while the AI assistant is working (see AiFocusHighlightOverlay).
1122
+ */
1123
+ aiActive?: boolean;
1124
+ outlineAuthoring?: OutlineAuthoringProps;
1125
+ }
1126
+ interface SlidesPaneSidebarProps {
1127
+ /** Reports an element omitted from a thumbnail; defaults to console.error. */
1128
+ onElementRenderError?: ElementRenderErrorHandler;
1129
+ slides: PptxSlide[];
1130
+ templateElementsBySlideId: Record<string, PptxElement[]>;
1131
+ activeSlideIndex: number;
1132
+ canvasSize: CanvasSize$1;
1133
+ sectionGroups: SlideSectionGroup[];
1134
+ isOpen: boolean;
1135
+ canEdit: boolean;
1136
+ onSelectSlide: (index: number) => void;
1137
+ onSlideContextMenu: (e: React$1__default.MouseEvent, index: number) => void;
1138
+ onMoveSlide: (fromIndex: number, toIndex: number) => void;
1139
+ onAddSlide: () => void;
1140
+ onAddSlideAfter: (index: number) => void;
1141
+ onDuplicateSlides: (indexes: number[]) => void;
1142
+ onDeleteSlides: (indexes: number[]) => void;
1143
+ onHideSlides: (indexes: number[]) => void;
1144
+ /** Makes `index` active, then opens the Layout gallery anchored at (x, y). */
1145
+ onOpenLayoutForSlide: (index: number, x: number, y: number) => void;
1146
+ onCollapse: () => void;
1147
+ onAddSection?: (name: string, afterSlideIndex: number) => void;
1148
+ onRenameSection?: (sectionId: string, newName: string) => void;
1149
+ onDeleteSection?: (sectionId: string) => void;
1150
+ onMoveSectionUp?: (sectionId: string) => void;
1151
+ onMoveSectionDown?: (sectionId: string) => void;
1152
+ /**
1153
+ * Persist the collapse flag onto the section model, so it round-trips
1154
+ * through save exactly as it does in the other four bindings.
1155
+ */
1156
+ onToggleSectionCollapse?: (sectionId: string) => void;
1157
+ /** Recorded rehearsal timings in ms, keyed by slide index. */
1158
+ rehearsalTimings?: Record<number, number>;
1159
+ /** Width of the panel in pixels (for resizable panels). */
1160
+ panelWidth?: number;
1161
+ /**
1162
+ * Presentation-wide field context (date/header/footer/custom props) so
1163
+ * thumbnails substitute the same field placeholders as the canvas.
1164
+ */
1165
+ fieldContext?: FieldSubstitutionContext;
1166
+ /** Theme + table style map so thumbnails resolve table band/header colours. */
1167
+ tableStyleContext?: TableStyleContext;
1168
+ }
1169
+ /** The one autosave status every binding renders (`PptxAutosaveStatus` in `ooxml-ui/pptx`). */
1170
+ type AutosaveStatus = PptxAutosaveStatus;
1171
+ interface UseViewerBuildingBlocksInput extends ViewportFitOptions, UseViewerBuildingBlocksActionsOptions {
1172
+ /** Reports an element omitted after a React render/lifecycle error; defaults to console.error. */
1173
+ onElementRenderError?: ElementRenderErrorHandler;
1174
+ /** Optional collaboration, including a host-owned document and presence session. */
1175
+ collaboration?: CollaborationInput;
1176
+ /** PPTX content as ArrayBuffer/Uint8Array, or null/undefined while no file is loaded. */
1177
+ content: ArrayBuffer | Uint8Array | null | undefined;
1178
+ /** Whether editing actions are enabled. Defaults to false (view-only). */
1179
+ canEdit?: boolean;
1180
+ /** Original file path, used for autosave recovery. */
1181
+ filePath?: string;
1182
+ /** Display name for the toolbar's file-name-aware controls (e.g. title bar hosts build themselves). */
1183
+ fileName?: string;
1184
+ /**
1185
+ * Zero-based slide shown after each load, clamped into the deck, as `PowerPointViewer`'s
1186
+ * `initialSlide`. It is applied in the same render that shows the loaded deck, so slide 1 is
1187
+ * never shown first. Changing it later applies to the next load, not the current slide; use
1188
+ * the handle's `goTo` to move an open deck.
1189
+ */
1190
+ initialSlide?: number;
1191
+ /** As `PowerPointViewer`'s `googleFonts`: the Google Fonts fallback policy (off, or a self-hosted mirror). */
1192
+ googleFonts?: GoogleFontsOption;
1193
+ /**
1194
+ * As `PowerPointViewer`'s `listConversionScope`: how far Bullets / Numbering reach from a
1195
+ * bare caret. `'paragraph'` (default, PowerPoint behaviour) changes only the caret's
1196
+ * paragraph; `'list'` (Word / Google Docs behaviour) converts the whole adjacent list when
1197
+ * the caret switches a list paragraph between bullets and numbering.
1198
+ */
1199
+ listConversionScope?: ListConversionScope;
1200
+ /**
1201
+ * As `PowerPointViewer`'s `allowExternalContent`: `false` fetches no linked
1202
+ * http(s) content, `true` allows it, either value locks the Trust Center
1203
+ * setting; unset keeps the user's choice. A change applies from the next load.
1204
+ */
1205
+ allowExternalContent?: boolean;
1206
+ /**
1207
+ * As `PowerPointViewer`'s `limits`: bounds on loading a deck (input and
1208
+ * inflated size, ZIP entries, slides, shapes); unset keeps the core
1209
+ * defaults. A change applies from the next load.
1210
+ */
1211
+ limits?: PptxLoadLimits;
1212
+ /** Whether the built-in autosave-to-localStorage recovery timer is active. Defaults to true. */
1213
+ autosaveEnabled?: boolean;
1214
+ /** Display name used as the author for comments. */
1215
+ userName?: string;
1216
+ /** Host-supplied list of toolbar buttons/ribbon tabs to hide. */
1217
+ hiddenActions?: readonly ToolbarActionId[];
1218
+ /** Imperative handle ref, exposing the same `PowerPointViewerHandle` API `PowerPointViewer` does. */
1219
+ handle?: React$1__default.ForwardedRef<PowerPointViewerHandle>;
1220
+ onContentChange?: (content: Uint8Array) => void;
1221
+ onDirtyChange?: (dirty: boolean) => void;
1222
+ onActiveSlideChange?: (index: number) => void;
1223
+ onModeChange?: (mode: ViewerMode) => void;
1224
+ onZoomChange?: (zoom: number) => void;
1225
+ onSelectionChange?: (ids: string[]) => void;
1226
+ onSlideCountChange?: (count: number) => void;
1227
+ /** Fired by the toolbar's "Settings" button; the host owns rendering that dialog. */
1228
+ onOpenSettings?: () => void;
1229
+ /** Fired by the toolbar's "Header & Footer" button; the host owns rendering that panel. */
1230
+ onOpenHeaderFooter?: () => void;
1231
+ /** Fired by the toolbar's "Share" button; the host owns rendering that dialog. */
1232
+ onOpenShareDialog?: () => void;
1233
+ /**
1234
+ * Fired by the "Layout" entry of a slide's context menu in `<SlidesPane>`,
1235
+ * after that slide is made active; the host owns rendering the Layout
1236
+ * gallery (for example anchored at the click point).
1237
+ */
1238
+ onOpenLayoutGallery?: (request: SlidesPaneLayoutGalleryRequest) => void;
1239
+ }
1240
+ interface ViewerBuildingBlocksResult {
1241
+ /** Connection and presence state for a custom status bar, or null when disabled. */
1242
+ collaboration: CollaborationContextValue | null;
1243
+ /**
1244
+ * Effective edit permission plus connection/presence counts, in the shape
1245
+ * every binding's custom shell receives (Vue/Svelte `shellState`, Angular
1246
+ * `state()`, Vanilla `getState()`); pass it to
1247
+ * `describeCollaborationShellState` for a localised status line.
1248
+ */
1249
+ shellState: CollaborationShellState;
1250
+ /** Flat, self-contained props for the standalone `<Toolbar>` component. */
1251
+ toolbarProps: ToolbarProps;
1252
+ /** Flat, self-contained props for the standalone `<SlideCanvas>` component. */
1253
+ canvasProps: SlideCanvasProps;
1254
+ /**
1255
+ * Flat, self-contained props for the standalone `<SlidesPane>` component:
1256
+ * the slide thumbnail rail `PowerPointViewer` shows beside the canvas.
1257
+ * Its open state is the toolbar's sidebar toggle.
1258
+ */
1259
+ slidesPaneProps: SlidesPaneSidebarProps;
1260
+ /**
1261
+ * The effective mode, as every binding's building blocks report it: `preview` while the blocks
1262
+ * may not edit (no `canEdit`, a collaboration viewer role), otherwise the viewer's mode (`edit`,
1263
+ * `present`, `master`). `toolbarProps.mode` and `canvasProps.mode` keep the viewer's own mode.
1264
+ */
1265
+ mode: ViewerMode;
1266
+ /** True while the initial parse of `content` is in progress. */
1267
+ loading: boolean;
1268
+ /** Parse error message, or null. */
1269
+ error: string | null;
1270
+ /** Current autosave-to-localStorage recovery status. */
1271
+ autosaveStatus: AutosaveStatus;
1272
+ /**
1273
+ * Operations and state for finishing picker, dialog and layout workflows from host-rendered
1274
+ * controls: image / media insertion, hyperlink, SmartArt and equation editing, Find / Replace
1275
+ * and layout apply / reset, plus which actions can run now. See `docs/react/hooks.md`.
1276
+ */
1277
+ actions: ViewerBuildingBlockActions;
1278
+ }
1279
+ declare function useViewerBuildingBlocks(input: UseViewerBuildingBlocksInput): ViewerBuildingBlocksResult;
1280
+
1281
+ declare function Toolbar(p: ToolbarProps): React$1__default.ReactElement;
1282
+ declare function SlideCanvas(props: SlideCanvasProps): React$1.JSX.Element;
1283
+ declare function SlidesPaneSidebar(props: SlidesPaneSidebarProps): React$1__default.ReactElement;
1284
+ /**
1285
+ * A static, scaled-down drawing of one slide, as the slides pane shows it. It renders from the
1286
+ * slide model, so it follows unsaved edits. Feed it from `slidesPaneProps`:
1287
+ * `templateElementsBySlideId[slide.id]`, `canvasSize`, `fieldContext` and `tableStyleContext`.
1288
+ */
1289
+ interface SlideThumbnailProps {
1290
+ /** Reports an element omitted from this preview; defaults to console.error. */
1291
+ onElementRenderError?: ElementRenderErrorHandler;
1292
+ /** The slide to draw. A different slide object (every edit makes one) redraws it. */
1293
+ slide: PptxSlide;
1294
+ /** The slide's inherited layout and master elements, drawn beneath its own. */
1295
+ templateElements: PptxElement[];
1296
+ canvasSize: CanvasSize$1;
1297
+ /**
1298
+ * Thumbnail width in pixels; the height follows the deck's aspect ratio. Set it to fill a host
1299
+ * strip without the pane's frame. Omitted, the thumbnail is the pane width with a border.
1300
+ */
1301
+ previewWidth?: number;
1302
+ /** Presentation-wide field context (date/header/footer/custom props). */
1303
+ fieldContext?: FieldSubstitutionContext;
1304
+ /** Theme + table style map for resolving table band/header colours. */
1305
+ tableStyleContext?: TableStyleContext;
1306
+ }
1307
+ declare function SlideThumbnailImpl({ slide, templateElements, canvasSize, previewWidth, fieldContext, tableStyleContext, onElementRenderError }: SlideThumbnailProps): React$1__default.ReactElement;
1308
+ declare const SlideThumbnail: React$1__default.MemoExoticComponent<typeof SlideThumbnailImpl>;
1309
+ interface SlideTemplateGalleryDialogProps {
1310
+ isOpen: boolean;
1311
+ onClose: () => void;
1312
+ onInsert: (templateId: SlideTemplateId) => void;
1313
+ /** Optional deck scheme so previews show the deck's theme colours. */
1314
+ scheme?: Record<string, string>;
1315
+ }
1316
+ declare function SlideTemplateGalleryDialog({ isOpen, onClose, onInsert, scheme }: SlideTemplateGalleryDialogProps): React$1__default.ReactElement | null;
1317
+ interface SlideTemplatePreviewProps {
1318
+ onElementRenderError?: ElementRenderErrorHandler;
1319
+ templateId: SlideTemplateId;
1320
+ /** Optional deck scheme so the preview shows the deck's theme colours. */
1321
+ scheme?: Record<string, string>;
1322
+ }
1323
+ declare function SlideTemplatePreview({ templateId, scheme, onElementRenderError }: SlideTemplatePreviewProps): React$1__default.ReactElement;
1324
+ /**
1325
+ * A drop-in replacement for `html2canvas(element, options)` that first
1326
+ * resolves any oklch / oklab / lch / lab / color() values in the cloned
1327
+ * DOM to rgb()/hex, preventing parse errors in html2canvas <= 1.x.
1328
+ *
1329
+ * Three-pronged approach:
1330
+ * 1. Patch `<style>` elements to replace oklch in CSS custom properties.
1331
+ * 2. Resolve `:root` / `<body>` inline custom properties.
1332
+ * 3. Walk every element and convert computed colour values to sRGB.
1333
+ *
1334
+ * Usage:
1335
+ * ```ts
1336
+ * import { renderToCanvas } from "./canvas-export";
1337
+ * const canvas = await renderToCanvas(element, { scale: 2 });
1338
+ * ```
1339
+ */
1340
+ declare function renderToCanvas(element: HTMLElement, options?: Partial<Options>): Promise<HTMLCanvasElement>;
1341
+
1342
+ export { PowerPointViewer, PptxI18nProvider, SlideCanvas, SlideTemplateGalleryDialog, SlideTemplatePreview, SlideThumbnail, SlidesPaneSidebar as SlidesPane, Toolbar, ViewerThemeProvider, getAnimationInitialStyle, renderToCanvas, useViewerBuildingBlocks, useViewerTheme };
1343
+ export type { CollaborationContextValue, ElementRenderErrorContext, ElementRenderErrorHandler, PowerPointViewerHandle, PowerPointViewerProps, PptxI18nProviderProps, PptxTranslate, PptxTranslateParams, SlideCanvasProps, SlideTemplateGalleryDialogProps, SlideTemplatePreviewProps, SlideThumbnailProps, SlidesPaneSidebarProps as SlidesPaneProps, ToolbarProps, UseViewerBuildingBlocksInput, ViewerBuildingBlocksResult, ViewerLoadDetail };