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