pptx-react-viewer 1.11.0 → 1.12.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 +10 -0
- package/README.md +2 -0
- package/dist/PowerPointViewer-BzsjqMzg.d.mts +26 -0
- package/dist/PowerPointViewer-C2a7iXAK.d.ts +26 -0
- package/dist/hooks-unstable.d.mts +2294 -0
- package/dist/hooks-unstable.d.ts +2294 -0
- package/dist/hooks-unstable.js +4891 -0
- package/dist/hooks-unstable.js.br +0 -0
- package/dist/hooks-unstable.js.gz +0 -0
- package/dist/hooks-unstable.mjs +4891 -0
- package/dist/hooks-unstable.mjs.br +0 -0
- package/dist/hooks-unstable.mjs.gz +0 -0
- package/dist/i18n.js +1 -1
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +324 -318
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +324 -318
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/{PowerPointViewer-88hWoBGx.d.mts → types-ui-DlsqFx7_.d.mts} +126 -23
- package/dist/{PowerPointViewer-88hWoBGx.d.ts → types-ui-DlsqFx7_.d.ts} +126 -23
- package/dist/usePresenterWindow-BKx5DLJy.d.ts +1619 -0
- package/dist/usePresenterWindow-BQwzr87T.d.mts +1619 -0
- package/dist/viewer/index.d.mts +10 -1604
- package/dist/viewer/index.d.ts +10 -1604
- package/dist/viewer/index.js +324 -318
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +324 -318
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +6 -1
|
@@ -0,0 +1,2294 @@
|
|
|
1
|
+
import { l, P, r, R, a2, A, ap, J, aq, t, u, s, y, z, x, D, v, w, K, bk, B, $, a0, k, ca, I, S, m, d, e, N, o } from './presentation-CLc4eS3z.js';
|
|
2
|
+
import { d as CanvasSize, E as EditorHistorySnapshot, q as PresentationAnimationRuntime, H as ElementAnimationState, V as ViewerMode, D as DragState, r as ResizeState, S as ShapeAdjustmentDragState, M as MarqueeSelectionState, B as SupportedShapeType, l as ElementClipboardPayload, G as ToolbarSection, A as AccessibilityIssue, n as ElementContextMenuState, T as TableCellEditorState, j as DrawingTool, m as ElementContextMenuAction, I as PrintSettings, J as CompareResult, x as SlideSectionGroup, a as PowerPointViewerHandle, C as CollaborationConfig, K as DeviceOrientation, L as TouchGestureCallbacks } from './types-ui-DlsqFx7_.js';
|
|
3
|
+
export { N as MOBILE_BREAKPOINT, O as TABLET_BREAKPOINT } from './types-ui-DlsqFx7_.js';
|
|
4
|
+
import React__default, { Dispatch, SetStateAction, RefObject, MutableRefObject, ForwardedRef } from 'react';
|
|
5
|
+
import { P as PptxHandler, M as MergeShapeOperation, k as PptxSaveFormat, a as CollaborationContextValue } from './usePresenterWindow-BKx5DLJy.js';
|
|
6
|
+
export { C as ConnectionStatus, T as ThemeSwitchingResult, l as UseCollaborativeHistoryInput, b as UseCollaborativeHistoryResult, c as UseCollaborativeStateInput, m as UsePresenceTrackingInput, d as UsePresenceTrackingResult, n as UsePresenterWindowInput, o as UsePresenterWindowResult, e as UseThemeSwitchingInput, p as UseYjsProviderInput, q as UseYjsProviderResult, U as UserPresence, u as useCollaborativeHistory, f as useCollaborativeState, g as usePresenceTracking, r as usePresenterWindow, h as useThemeSwitching, j as useYjsProvider } from './usePresenterWindow-BKx5DLJy.js';
|
|
7
|
+
import { Doc } from 'yjs';
|
|
8
|
+
import './theme/index.js';
|
|
9
|
+
import 'y-protocols/awareness';
|
|
10
|
+
|
|
11
|
+
interface EditorHistoryInput {
|
|
12
|
+
slides: l[];
|
|
13
|
+
canvasSize: CanvasSize;
|
|
14
|
+
activeSlideIndex: number;
|
|
15
|
+
templateElementsBySlideId: Record<string, P[]>;
|
|
16
|
+
selectedElementId: string | null;
|
|
17
|
+
selectedElementIds: string[];
|
|
18
|
+
editTemplateMode: boolean;
|
|
19
|
+
headerFooter: r;
|
|
20
|
+
loading: boolean;
|
|
21
|
+
error: string | null;
|
|
22
|
+
hasActivePointerInteraction: () => boolean;
|
|
23
|
+
pointerCommitNonce: number;
|
|
24
|
+
setSlides: (slides: l[]) => void;
|
|
25
|
+
setCanvasSize: (size: CanvasSize) => void;
|
|
26
|
+
setActiveSlideIndex: (index: number) => void;
|
|
27
|
+
setTemplateElementsBySlideId: (map: Record<string, P[]>) => void;
|
|
28
|
+
setSelectedElementId: (id: string | null) => void;
|
|
29
|
+
setSelectedElementIds: (ids: string[]) => void;
|
|
30
|
+
setEditTemplateMode: (mode: boolean) => void;
|
|
31
|
+
setHeaderFooter: (hf: r) => void;
|
|
32
|
+
}
|
|
33
|
+
interface EditorHistoryResult {
|
|
34
|
+
canUndo: boolean;
|
|
35
|
+
canRedo: boolean;
|
|
36
|
+
undoLabel: string | undefined;
|
|
37
|
+
redoLabel: string | undefined;
|
|
38
|
+
handleUndo: () => void;
|
|
39
|
+
handleRedo: () => void;
|
|
40
|
+
resetHistory: () => void;
|
|
41
|
+
markDirty: () => void;
|
|
42
|
+
buildHistorySnapshot: (actionLabel?: string) => EditorHistorySnapshot;
|
|
43
|
+
}
|
|
44
|
+
declare function useEditorHistory(input: EditorHistoryInput): EditorHistoryResult;
|
|
45
|
+
|
|
46
|
+
/** Axis-aligned bounding box used by zoom / viewport helpers. */
|
|
47
|
+
interface SelectionBounds {
|
|
48
|
+
minX: number;
|
|
49
|
+
minY: number;
|
|
50
|
+
maxX: number;
|
|
51
|
+
maxY: number;
|
|
52
|
+
}
|
|
53
|
+
interface UseZoomViewportInput {
|
|
54
|
+
canvasSize: CanvasSize;
|
|
55
|
+
selectedElements: P[];
|
|
56
|
+
}
|
|
57
|
+
interface UseZoomViewportResult {
|
|
58
|
+
editWrapperRef: React.RefObject<HTMLDivElement | null>;
|
|
59
|
+
canvasStageRef: React.RefObject<HTMLDivElement | null>;
|
|
60
|
+
canvasViewportRef: React.RefObject<HTMLDivElement | null>;
|
|
61
|
+
renderScaleRef: React.MutableRefObject<number>;
|
|
62
|
+
scale: number;
|
|
63
|
+
setScale: (scale: number) => void;
|
|
64
|
+
editorDimensions: CanvasSize | null;
|
|
65
|
+
setEditorDimensions: (dims: CanvasSize | null) => void;
|
|
66
|
+
fitScale: number;
|
|
67
|
+
editorScale: number;
|
|
68
|
+
handleZoomIn: () => void;
|
|
69
|
+
handleZoomOut: () => void;
|
|
70
|
+
handleResetZoom: () => void;
|
|
71
|
+
handleZoomToFit: () => void;
|
|
72
|
+
handleZoomToSelection: () => void;
|
|
73
|
+
handleWheel: (e: WheelEvent) => void;
|
|
74
|
+
centerBoundsInViewport: (bounds: SelectionBounds, nextScale: number) => void;
|
|
75
|
+
getCanvasPointFromClient: (clientX: number, clientY: number) => {
|
|
76
|
+
x: number;
|
|
77
|
+
y: number;
|
|
78
|
+
} | null;
|
|
79
|
+
}
|
|
80
|
+
declare function useZoomViewport({ canvasSize, selectedElements, }: UseZoomViewportInput): UseZoomViewportResult;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* State describing the transition overlay that plays while advancing into a
|
|
84
|
+
* slide that carries a `p:transition`. The outgoing slide is snapshotted into
|
|
85
|
+
* an animated overlay layer while the incoming slide renders underneath on the
|
|
86
|
+
* main stage; the overlay tears down once `durationMs` elapses.
|
|
87
|
+
*/
|
|
88
|
+
interface PresentationTransitionOverlayState {
|
|
89
|
+
/** Index of the leaving slide, rendered (animated) in the overlay layer. */
|
|
90
|
+
outgoingSlideIndex: number;
|
|
91
|
+
/** Index of the arriving slide, already live on the main stage. */
|
|
92
|
+
incomingSlideIndex: number;
|
|
93
|
+
/** The incoming slide's transition definition (drives the CSS animation). */
|
|
94
|
+
transition: R;
|
|
95
|
+
/** Resolved transition duration (ms). */
|
|
96
|
+
durationMs: number;
|
|
97
|
+
}
|
|
98
|
+
interface UsePresentationModeInput {
|
|
99
|
+
mode: ViewerMode;
|
|
100
|
+
slides: l[];
|
|
101
|
+
visibleSlideIndexes: number[];
|
|
102
|
+
activeSlideIndex: number;
|
|
103
|
+
containerRef: React.RefObject<HTMLElement | null>;
|
|
104
|
+
/** Raw PPTX bytes: forwarded to audience window for content sharing. */
|
|
105
|
+
content?: ArrayBuffer | Uint8Array | null;
|
|
106
|
+
onSetMode: (mode: ViewerMode) => void;
|
|
107
|
+
onSetActiveSlideIndex: (index: number) => void;
|
|
108
|
+
onPlayActionSound?: (soundPath: string) => void;
|
|
109
|
+
/** Called when L key is pressed during presentation. */
|
|
110
|
+
onToggleLaser?: () => void;
|
|
111
|
+
/** Called when P key is pressed during presentation. */
|
|
112
|
+
onTogglePen?: () => void;
|
|
113
|
+
/** Called when E key is pressed during presentation. */
|
|
114
|
+
onToggleEraser?: () => void;
|
|
115
|
+
/** Called when Ctrl+M is pressed during presentation. */
|
|
116
|
+
onToggleToolbar?: () => void;
|
|
117
|
+
/** Called to persist rehearsal timings into slide transitions. */
|
|
118
|
+
onSaveRehearsalTimings?: (timings: Record<number, number>) => void;
|
|
119
|
+
/** Whether to loop continuously (kiosk or explicit loop setting). */
|
|
120
|
+
loopContinuously?: boolean;
|
|
121
|
+
/** Whether to play animations during the slide show (false = skip all animations). */
|
|
122
|
+
showWithAnimation?: boolean;
|
|
123
|
+
/** Whether to use rehearsed auto-advance timings (false = manual advance only). */
|
|
124
|
+
useTimings?: boolean;
|
|
125
|
+
}
|
|
126
|
+
interface UsePresentationModeResult {
|
|
127
|
+
presentationSlideIndex: number;
|
|
128
|
+
setPresentationSlideIndex: (index: number) => void;
|
|
129
|
+
presentationSlideVisible: boolean;
|
|
130
|
+
/** Active slide-transition overlay, or `null` when no transition is playing. */
|
|
131
|
+
transitionOverlay: PresentationTransitionOverlayState | null;
|
|
132
|
+
/** Tear down the transition overlay once its animation completes. */
|
|
133
|
+
handleTransitionOverlayComplete: () => void;
|
|
134
|
+
presentationAnimations: PresentationAnimationRuntime[];
|
|
135
|
+
presentationElementStates: Map<string, ElementAnimationState>;
|
|
136
|
+
presentationKeyframesCss: string;
|
|
137
|
+
clearPresentationTimers: () => void;
|
|
138
|
+
runPresentationEntranceAnimations: (slideIndex: number) => void;
|
|
139
|
+
movePresentationSlide: (direction: 1 | -1) => void;
|
|
140
|
+
navigateToSlide: (slideIndex: number) => void;
|
|
141
|
+
handlePresentationAction: (action: a2) => void;
|
|
142
|
+
/**
|
|
143
|
+
* Handle a shape click in presentation mode. If the shape is an interactive
|
|
144
|
+
* trigger, play its animation sequence. Returns `true` if handled.
|
|
145
|
+
*/
|
|
146
|
+
handleInteractiveShapeClick: (shapeId: string) => boolean;
|
|
147
|
+
/** Set of shape IDs that are interactive sequence triggers on the current slide. */
|
|
148
|
+
interactiveTriggerShapeIds: ReadonlySet<string>;
|
|
149
|
+
/** Set of shape IDs that are hover animation triggers on the current slide. */
|
|
150
|
+
hoverTriggerShapeIds: ReadonlySet<string>;
|
|
151
|
+
/** Handle hover start on a shape. If the shape has a hover sequence, play it. Returns `true` if handled. */
|
|
152
|
+
handleHoverStart: (shapeId: string) => boolean;
|
|
153
|
+
/** Handle hover end on a shape. Resets the hover sequence for replay. */
|
|
154
|
+
handleHoverEnd: (shapeId: string) => void;
|
|
155
|
+
/** Must be called from a user-gesture handler (click) to satisfy browser fullscreen policy. */
|
|
156
|
+
enterPresentMode: () => void;
|
|
157
|
+
/** Whether presenter view (split-screen with notes) is active instead of fullscreen. */
|
|
158
|
+
presenterMode: boolean;
|
|
159
|
+
/** Enter presenter view mode (no fullscreen, shows notes panel). */
|
|
160
|
+
enterPresenterView: () => void;
|
|
161
|
+
/** Toggle between fullscreen and presenter view during presentation. */
|
|
162
|
+
togglePresenterView: () => void;
|
|
163
|
+
/** Timestamp (ms) when the presentation started: used for elapsed timer. */
|
|
164
|
+
presentationStartTime: number | null;
|
|
165
|
+
/** Whether the current presentation session is in rehearse-timings mode. */
|
|
166
|
+
rehearsing: boolean;
|
|
167
|
+
/** Enter rehearse-timings mode (fullscreen presentation + timing HUD). */
|
|
168
|
+
enterRehearsalMode: () => void;
|
|
169
|
+
/** Recorded timings in ms, keyed by slide index. Populated during rehearsal. */
|
|
170
|
+
recordedTimings: Record<number, number>;
|
|
171
|
+
/** Timestamp when the current slide started (ms since epoch). */
|
|
172
|
+
slideStartTime: number | null;
|
|
173
|
+
/** Whether the rehearsal summary dialog should be shown. */
|
|
174
|
+
showRehearsalSummary: boolean;
|
|
175
|
+
/** Dismiss the rehearsal summary (discard timings). */
|
|
176
|
+
dismissRehearsalSummary: () => void;
|
|
177
|
+
/** Save recorded timings into each slide's transition.advanceAfterMs. */
|
|
178
|
+
saveRehearsalTimings: () => void;
|
|
179
|
+
/** Whether rehearsal timer is paused. */
|
|
180
|
+
rehearsalPaused: boolean;
|
|
181
|
+
/** Toggle the rehearsal timer pause state. */
|
|
182
|
+
toggleRehearsalPause: () => void;
|
|
183
|
+
/** Handle a zoom element click in presentation mode. */
|
|
184
|
+
handleZoomClick: (targetSlideIndex: number, returnSlideIndex: number) => void;
|
|
185
|
+
/** Ref holding the slide index to return to after zoom navigation. */
|
|
186
|
+
zoomReturnSlideIndex: React.RefObject<number | null>;
|
|
187
|
+
/** Navigate back to the zoom summary slide. Returns true if navigation occurred. */
|
|
188
|
+
returnToZoomSlide: () => boolean;
|
|
189
|
+
/** Clear the stored zoom return index. */
|
|
190
|
+
clearZoomReturn: () => void;
|
|
191
|
+
/** Open the audience display in a separate browser window. Returns `true` if successful. */
|
|
192
|
+
openAudienceWindow: () => boolean;
|
|
193
|
+
/** Close the audience display window. */
|
|
194
|
+
closeAudienceWindow: () => void;
|
|
195
|
+
/** Whether the audience window is currently open. */
|
|
196
|
+
isAudienceWindowOpen: () => boolean;
|
|
197
|
+
/** Send a slide index to the audience window explicitly. */
|
|
198
|
+
syncSlideToAudience: (slideIndex: number) => void;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
declare function usePresentationMode(input: UsePresentationModeInput): UsePresentationModeResult;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Types for presentation annotation state.
|
|
205
|
+
*/
|
|
206
|
+
type PresentationTool = 'none' | 'laser' | 'pen' | 'highlighter' | 'eraser';
|
|
207
|
+
interface AnnotationStroke {
|
|
208
|
+
id: string;
|
|
209
|
+
points: Array<{
|
|
210
|
+
x: number;
|
|
211
|
+
y: number;
|
|
212
|
+
}>;
|
|
213
|
+
color: string;
|
|
214
|
+
width: number;
|
|
215
|
+
opacity: number;
|
|
216
|
+
}
|
|
217
|
+
interface LaserPosition {
|
|
218
|
+
x: number;
|
|
219
|
+
y: number;
|
|
220
|
+
}
|
|
221
|
+
/** Annotations grouped by slide index. */
|
|
222
|
+
type SlideAnnotationMap = Map<number, AnnotationStroke[]>;
|
|
223
|
+
interface UsePresentationAnnotationsInput {
|
|
224
|
+
isActive: boolean;
|
|
225
|
+
/** Current slide index: used to track which slide annotations belong to. */
|
|
226
|
+
activeSlideIndex: number;
|
|
227
|
+
}
|
|
228
|
+
interface UsePresentationAnnotationsResult {
|
|
229
|
+
presentationTool: PresentationTool;
|
|
230
|
+
setPresentationTool: (tool: PresentationTool) => void;
|
|
231
|
+
penColor: string;
|
|
232
|
+
setPenColor: (color: string) => void;
|
|
233
|
+
highlighterColor: string;
|
|
234
|
+
setHighlighterColor: (color: string) => void;
|
|
235
|
+
annotationStrokes: AnnotationStroke[];
|
|
236
|
+
currentStroke: AnnotationStroke | null;
|
|
237
|
+
laserPosition: LaserPosition | null;
|
|
238
|
+
toolbarVisible: boolean;
|
|
239
|
+
setToolbarVisible: (visible: boolean) => void;
|
|
240
|
+
handlePointerDown: (x: number, y: number) => void;
|
|
241
|
+
handlePointerMove: (x: number, y: number) => void;
|
|
242
|
+
handlePointerUp: () => void;
|
|
243
|
+
handleLaserMove: (x: number, y: number) => void;
|
|
244
|
+
handleLaserLeave: () => void;
|
|
245
|
+
clearAnnotations: () => void;
|
|
246
|
+
eraseAtPoint: (x: number, y: number) => void;
|
|
247
|
+
/** All annotations across all slides (for persistence on exit). */
|
|
248
|
+
allSlideAnnotations: SlideAnnotationMap;
|
|
249
|
+
/** Whether any annotations exist across all slides. */
|
|
250
|
+
hasAnyAnnotations: boolean;
|
|
251
|
+
/** Clear all annotations across all slides. */
|
|
252
|
+
clearAllAnnotations: () => void;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
declare function usePresentationAnnotations(input: UsePresentationAnnotationsInput): UsePresentationAnnotationsResult;
|
|
256
|
+
|
|
257
|
+
interface FindResult {
|
|
258
|
+
slideIndex: number;
|
|
259
|
+
elementId: string;
|
|
260
|
+
segmentIndex: number;
|
|
261
|
+
startOffset: number;
|
|
262
|
+
length: number;
|
|
263
|
+
}
|
|
264
|
+
interface UseFindReplaceInput {
|
|
265
|
+
slides: l[];
|
|
266
|
+
mode: string;
|
|
267
|
+
onSetActiveSlideIndex: (index: number) => void;
|
|
268
|
+
onSetSelectedElementId: (id: string | null) => void;
|
|
269
|
+
onUpdateSlides: (updater: (slides: l[]) => l[]) => void;
|
|
270
|
+
onMarkDirty: () => void;
|
|
271
|
+
}
|
|
272
|
+
interface UseFindReplaceResult {
|
|
273
|
+
findReplaceOpen: boolean;
|
|
274
|
+
setFindReplaceOpen: (open: boolean) => void;
|
|
275
|
+
findQuery: string;
|
|
276
|
+
setFindQuery: (query: string) => void;
|
|
277
|
+
replaceQuery: string;
|
|
278
|
+
setReplaceQuery: (query: string) => void;
|
|
279
|
+
findMatchCase: boolean;
|
|
280
|
+
setFindMatchCase: (matchCase: boolean) => void;
|
|
281
|
+
findResults: FindResult[];
|
|
282
|
+
findResultIndex: number;
|
|
283
|
+
performFind: () => void;
|
|
284
|
+
navigateFindResult: (direction: 1 | -1) => void;
|
|
285
|
+
handleReplace: () => void;
|
|
286
|
+
handleReplaceAll: () => void;
|
|
287
|
+
}
|
|
288
|
+
declare function useFindReplace({ slides, mode, onSetActiveSlideIndex, onSetSelectedElementId, onUpdateSlides, onMarkDirty, }: UseFindReplaceInput): UseFindReplaceResult;
|
|
289
|
+
|
|
290
|
+
interface SheetDismissDragHandlers {
|
|
291
|
+
onPointerDown: (e: React__default.PointerEvent) => void;
|
|
292
|
+
onPointerMove: (e: React__default.PointerEvent) => void;
|
|
293
|
+
onPointerUp: (e: React__default.PointerEvent) => void;
|
|
294
|
+
onPointerCancel: (e: React__default.PointerEvent) => void;
|
|
295
|
+
}
|
|
296
|
+
interface SheetDismissDrag {
|
|
297
|
+
/** Current downward drag offset in px (0 when not dragging). */
|
|
298
|
+
dragY: number;
|
|
299
|
+
/** True while a pointer drag is in progress. */
|
|
300
|
+
dragging: boolean;
|
|
301
|
+
/** Spread onto the drag handle / header to make a bottom sheet swipe-dismissable. */
|
|
302
|
+
handlers: SheetDismissDragHandlers;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Shared drag-to-dismiss logic for mobile bottom sheets. Dragging the grab
|
|
306
|
+
* region down past `threshold` px invokes `onClose`; anything less snaps back.
|
|
307
|
+
*
|
|
308
|
+
* Centralising this keeps every sheet (menu, slides, inspector/format,
|
|
309
|
+
* comments) consistent: previously only the `MobileSheet`-based sheets could
|
|
310
|
+
* be swiped closed while the inspector's handle was purely decorative.
|
|
311
|
+
*/
|
|
312
|
+
declare function useSheetDismissDrag(onClose: () => void, threshold?: number): SheetDismissDrag;
|
|
313
|
+
|
|
314
|
+
interface ModalDismissDragHandlers {
|
|
315
|
+
onPointerDown: (e: React__default.PointerEvent) => void;
|
|
316
|
+
onPointerMove: (e: React__default.PointerEvent) => void;
|
|
317
|
+
onPointerUp: (e: React__default.PointerEvent) => void;
|
|
318
|
+
onPointerCancel: (e: React__default.PointerEvent) => void;
|
|
319
|
+
}
|
|
320
|
+
interface ModalDismissDrag {
|
|
321
|
+
/** Spread onto the panel element to follow the drag and snap back. */
|
|
322
|
+
panelStyle: React__default.CSSProperties | undefined;
|
|
323
|
+
/** Spread onto the header / title bar to make the dialog swipe-dismissable. */
|
|
324
|
+
handlers: ModalDismissDragHandlers;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Swipe-down-to-dismiss for centered modal dialogs. Mirrors the bottom-sheet
|
|
328
|
+
* gesture but tuned for dialogs:
|
|
329
|
+
* - touch/pen only — a desktop mouse never starts a drag, so click/select on
|
|
330
|
+
* the header is unaffected;
|
|
331
|
+
* - drags that begin on an interactive control (the × close button, inputs,
|
|
332
|
+
* links) are ignored so those keep working;
|
|
333
|
+
* - dragging the header down past `threshold` px invokes `onClose`.
|
|
334
|
+
*/
|
|
335
|
+
declare function useModalDismissDrag(onClose: () => void, threshold?: number): ModalDismissDrag;
|
|
336
|
+
|
|
337
|
+
interface UseCommentsInput {
|
|
338
|
+
slides: l[];
|
|
339
|
+
activeSlideIndex: number;
|
|
340
|
+
canEdit: boolean;
|
|
341
|
+
userName?: string;
|
|
342
|
+
selectedElementId?: string | null;
|
|
343
|
+
onUpdateSlides: (updater: (slides: l[]) => l[]) => void;
|
|
344
|
+
onMarkDirty: () => void;
|
|
345
|
+
}
|
|
346
|
+
interface UseCommentsResult {
|
|
347
|
+
commentDraftBySlideId: Record<string, string>;
|
|
348
|
+
editingCommentIdBySlideId: Record<string, string | null>;
|
|
349
|
+
commentEditDraftByCommentId: Record<string, string>;
|
|
350
|
+
replyingToCommentId: string | null;
|
|
351
|
+
replyDraftByCommentId: Record<string, string>;
|
|
352
|
+
handleCommentDraftChange: (slideId: string, draft: string) => void;
|
|
353
|
+
handleAddSlideComment: (slideIndex: number) => void;
|
|
354
|
+
handleDeleteSlideComment: (slideIndex: number, commentId: string) => void;
|
|
355
|
+
handleStartCommentEdit: (slideId: string, commentId: string) => void;
|
|
356
|
+
handleCancelCommentEdit: (slideId: string) => void;
|
|
357
|
+
handleSaveCommentEdit: (slideIndex: number, commentId: string) => void;
|
|
358
|
+
handleSetCommentEditDraft: (commentId: string, draft: string) => void;
|
|
359
|
+
handleToggleCommentResolved: (slideIndex: number, commentId: string) => void;
|
|
360
|
+
handleStartReply: (slideIndex: number, commentId: string) => void;
|
|
361
|
+
handleCancelReply: () => void;
|
|
362
|
+
handleReplyDraftChange: (commentId: string, draft: string) => void;
|
|
363
|
+
handleSubmitReply: (slideIndex: number, commentId: string) => void;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
declare function useComments({ slides, canEdit, userName, selectedElementId, onUpdateSlides, onMarkDirty, }: UseCommentsInput): UseCommentsResult;
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Input parameters for the {@link useViewerCoreState} hook.
|
|
370
|
+
*
|
|
371
|
+
* @property content - Raw binary content of the PPTX file to load. `null`/`undefined` when no file is loaded yet.
|
|
372
|
+
* @property canEdit - Whether the viewer allows editing operations (false for read-only mode).
|
|
373
|
+
*/
|
|
374
|
+
interface UseViewerCoreStateInput {
|
|
375
|
+
content: ArrayBuffer | Uint8Array | null | undefined;
|
|
376
|
+
canEdit: boolean;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* The full output shape of {@link useViewerCoreState}.
|
|
380
|
+
*
|
|
381
|
+
* This interface exposes every ref, state value, setter, and derived field
|
|
382
|
+
* that comprises the core viewer state. It is merged with {@link ViewerUIState}
|
|
383
|
+
* inside {@link useViewerState} to produce the unified {@link ViewerState}.
|
|
384
|
+
*/
|
|
385
|
+
interface ViewerCoreState {
|
|
386
|
+
/** Ref to the outermost container `<div>` wrapping the viewer. */
|
|
387
|
+
containerRef: React__default.RefObject<HTMLDivElement | null>;
|
|
388
|
+
/** Hidden `<input type="file">` used to trigger image file selection. */
|
|
389
|
+
imageInputRef: React__default.RefObject<HTMLInputElement | null>;
|
|
390
|
+
/** Hidden `<input type="file">` used to trigger audio/video file selection. */
|
|
391
|
+
mediaInputRef: React__default.RefObject<HTMLInputElement | null>;
|
|
392
|
+
/** Mutable ref mirroring `activeSlideIndex` for use in event handlers that must not re-subscribe on index change. */
|
|
393
|
+
activeSlideIndexRef: React__default.MutableRefObject<number>;
|
|
394
|
+
/** Mutable ref mirroring `inlineEditingElementId`: always current without waiting for a re-render. */
|
|
395
|
+
inlineEditingElementIdRef: React__default.MutableRefObject<string | null>;
|
|
396
|
+
/** Mutable ref mirroring `inlineEditingText`: always current without waiting for a re-render. */
|
|
397
|
+
inlineEditingTextRef: React__default.MutableRefObject<string>;
|
|
398
|
+
/** Tracks the in-progress drag operation (move) for element(s). */
|
|
399
|
+
dragStateRef: React__default.MutableRefObject<DragState | null>;
|
|
400
|
+
/** Tracks the in-progress resize operation for an element. */
|
|
401
|
+
resizeStateRef: React__default.MutableRefObject<ResizeState | null>;
|
|
402
|
+
/** Tracks the in-progress shape adjustment handle drag. */
|
|
403
|
+
shapeAdjustmentDragStateRef: React__default.MutableRefObject<ShapeAdjustmentDragState | null>;
|
|
404
|
+
/** Tracks the in-progress marquee (lasso) selection rectangle. */
|
|
405
|
+
marqueeStateRef: React__default.MutableRefObject<MarqueeSelectionState | null>;
|
|
406
|
+
/** Whether the user is currently performing a freeform drawing stroke. */
|
|
407
|
+
isDrawingRef: React__default.MutableRefObject<boolean>;
|
|
408
|
+
/** Current viewer mode (edit, view, present, master, etc.). */
|
|
409
|
+
mode: ViewerMode;
|
|
410
|
+
setMode: React__default.Dispatch<React__default.SetStateAction<ViewerMode>>;
|
|
411
|
+
/** Whether the presentation content is currently being loaded/parsed. */
|
|
412
|
+
loading: boolean;
|
|
413
|
+
setLoading: React__default.Dispatch<React__default.SetStateAction<boolean>>;
|
|
414
|
+
/** Non-null when an error occurred during loading or processing. */
|
|
415
|
+
error: string | null;
|
|
416
|
+
setError: React__default.Dispatch<React__default.SetStateAction<string | null>>;
|
|
417
|
+
/** The ordered array of all slides in the presentation. */
|
|
418
|
+
slides: l[];
|
|
419
|
+
setSlides: React__default.Dispatch<React__default.SetStateAction<l[]>>;
|
|
420
|
+
/** Layout/master placeholder elements keyed by slide id, used for template rendering. */
|
|
421
|
+
templateElementsBySlideId: Record<string, P[]>;
|
|
422
|
+
setTemplateElementsBySlideId: React__default.Dispatch<React__default.SetStateAction<Record<string, P[]>>>;
|
|
423
|
+
/** Width and height of the slide canvas in CSS pixels. */
|
|
424
|
+
canvasSize: CanvasSize;
|
|
425
|
+
setCanvasSize: React__default.Dispatch<React__default.SetStateAction<CanvasSize>>;
|
|
426
|
+
/** Zero-based index of the currently active (visible) slide. */
|
|
427
|
+
activeSlideIndex: number;
|
|
428
|
+
setActiveSlideIndex: React__default.Dispatch<React__default.SetStateAction<number>>;
|
|
429
|
+
/** ID of the single primarily-selected element (null when nothing is selected). */
|
|
430
|
+
selectedElementId: string | null;
|
|
431
|
+
setSelectedElementId: React__default.Dispatch<React__default.SetStateAction<string | null>>;
|
|
432
|
+
/** IDs for multi-selection (non-empty when multiple elements are selected). */
|
|
433
|
+
selectedElementIds: string[];
|
|
434
|
+
setSelectedElementIds: React__default.Dispatch<React__default.SetStateAction<string[]>>;
|
|
435
|
+
/** Whether unsaved changes exist in the presentation. */
|
|
436
|
+
isDirty: boolean;
|
|
437
|
+
setIsDirty: React__default.Dispatch<React__default.SetStateAction<boolean>>;
|
|
438
|
+
/** ID of the element whose text is currently being edited inline on the canvas. */
|
|
439
|
+
inlineEditingElementId: string | null;
|
|
440
|
+
setInlineEditingElementId: React__default.Dispatch<React__default.SetStateAction<string | null>>;
|
|
441
|
+
/** The current inline-editing text content (mirrored from the editor). */
|
|
442
|
+
inlineEditingText: string;
|
|
443
|
+
setInlineEditingText: React__default.Dispatch<React__default.SetStateAction<string>>;
|
|
444
|
+
/** Whether the user is editing template/layout elements rather than slide elements. */
|
|
445
|
+
editTemplateMode: boolean;
|
|
446
|
+
setEditTemplateMode: React__default.Dispatch<React__default.SetStateAction<boolean>>;
|
|
447
|
+
/** The shape type to use when the user draws the next new shape. */
|
|
448
|
+
newShapeType: SupportedShapeType;
|
|
449
|
+
setNewShapeType: React__default.Dispatch<React__default.SetStateAction<SupportedShapeType>>;
|
|
450
|
+
/** In-memory clipboard payload for internal copy/paste of elements. */
|
|
451
|
+
clipboardPayload: ElementClipboardPayload | null;
|
|
452
|
+
setClipboardPayload: React__default.Dispatch<React__default.SetStateAction<ElementClipboardPayload | null>>;
|
|
453
|
+
/** Monotonically-increasing nonce bumped after each pointer commit to trigger re-renders. */
|
|
454
|
+
pointerCommitNonce: number;
|
|
455
|
+
setPointerCommitNonce: React__default.Dispatch<React__default.SetStateAction<number>>;
|
|
456
|
+
/** Header/footer configuration for the presentation. */
|
|
457
|
+
headerFooter: r;
|
|
458
|
+
setHeaderFooter: React__default.Dispatch<React__default.SetStateAction<r>>;
|
|
459
|
+
/** Available slide layout options (path + display name). */
|
|
460
|
+
layoutOptions: Array<{
|
|
461
|
+
path: string;
|
|
462
|
+
name: string;
|
|
463
|
+
}>;
|
|
464
|
+
setLayoutOptions: React__default.Dispatch<React__default.SetStateAction<Array<{
|
|
465
|
+
path: string;
|
|
466
|
+
name: string;
|
|
467
|
+
}>>>;
|
|
468
|
+
/** All slide masters parsed from the presentation. */
|
|
469
|
+
slideMasters: A[];
|
|
470
|
+
setSlideMasters: React__default.Dispatch<React__default.SetStateAction<A[]>>;
|
|
471
|
+
/** The currently active theme applied to the presentation. */
|
|
472
|
+
theme: ap | undefined;
|
|
473
|
+
setTheme: React__default.Dispatch<React__default.SetStateAction<ap | undefined>>;
|
|
474
|
+
/** Parsed table style definitions from `ppt/tableStyles.xml`. */
|
|
475
|
+
tableStyleMap: J | undefined;
|
|
476
|
+
setTableStyleMap: React__default.Dispatch<React__default.SetStateAction<J | undefined>>;
|
|
477
|
+
/** Available theme presets the user can switch between. */
|
|
478
|
+
themeOptions: aq[];
|
|
479
|
+
setThemeOptions: React__default.Dispatch<React__default.SetStateAction<aq[]>>;
|
|
480
|
+
/** Custom slide shows defined in the presentation. */
|
|
481
|
+
customShows: t[];
|
|
482
|
+
setCustomShows: React__default.Dispatch<React__default.SetStateAction<t[]>>;
|
|
483
|
+
/** ID of the currently active custom show, or null for normal show. */
|
|
484
|
+
activeCustomShowId: string | null;
|
|
485
|
+
setActiveCustomShowId: React__default.Dispatch<React__default.SetStateAction<string | null>>;
|
|
486
|
+
/** Slide sections for organizational grouping. */
|
|
487
|
+
sections: u[];
|
|
488
|
+
setSections: React__default.Dispatch<React__default.SetStateAction<u[]>>;
|
|
489
|
+
/** Presentation-level properties (loop, show type, subtitles, etc.). */
|
|
490
|
+
presentationProperties: s;
|
|
491
|
+
setPresentationProperties: React__default.Dispatch<React__default.SetStateAction<s>>;
|
|
492
|
+
/** Notes master slide definition (background, elements, styles). */
|
|
493
|
+
notesMaster: y | undefined;
|
|
494
|
+
setNotesMaster: React__default.Dispatch<React__default.SetStateAction<y | undefined>>;
|
|
495
|
+
/** Handout master definition for print handout layouts. */
|
|
496
|
+
handoutMaster: z | undefined;
|
|
497
|
+
setHandoutMaster: React__default.Dispatch<React__default.SetStateAction<z | undefined>>;
|
|
498
|
+
/** Canvas dimensions for the notes page view (may differ from slide canvas). */
|
|
499
|
+
notesCanvasSize: CanvasSize | undefined;
|
|
500
|
+
setNotesCanvasSize: React__default.Dispatch<React__default.SetStateAction<CanvasSize | undefined>>;
|
|
501
|
+
/** User-defined custom document properties. */
|
|
502
|
+
customProperties: x[];
|
|
503
|
+
setCustomProperties: React__default.Dispatch<React__default.SetStateAction<x[]>>;
|
|
504
|
+
/** Tag collections associated with slides or elements. */
|
|
505
|
+
tagCollections: D[];
|
|
506
|
+
setTagCollections: React__default.Dispatch<React__default.SetStateAction<D[]>>;
|
|
507
|
+
/** OPC core properties (title, author, created date, etc.). */
|
|
508
|
+
coreProperties: v | undefined;
|
|
509
|
+
setCoreProperties: React__default.Dispatch<React__default.SetStateAction<v | undefined>>;
|
|
510
|
+
/** Application-level properties (company, version, etc.). */
|
|
511
|
+
appProperties: w | undefined;
|
|
512
|
+
setAppProperties: React__default.Dispatch<React__default.SetStateAction<w | undefined>>;
|
|
513
|
+
/** Fonts embedded within the PPTX file. */
|
|
514
|
+
embeddedFonts: K[];
|
|
515
|
+
setEmbeddedFonts: React__default.Dispatch<React__default.SetStateAction<K[]>>;
|
|
516
|
+
/** Whether the loaded presentation contains VBA macros. */
|
|
517
|
+
hasMacros: boolean;
|
|
518
|
+
setHasMacros: React__default.Dispatch<React__default.SetStateAction<boolean>>;
|
|
519
|
+
/** Whether the loaded presentation contains digital signatures. */
|
|
520
|
+
hasDigitalSignatures: boolean;
|
|
521
|
+
setHasDigitalSignatures: React__default.Dispatch<React__default.SetStateAction<boolean>>;
|
|
522
|
+
/** Number of digital signatures detected. */
|
|
523
|
+
digitalSignatureCount: number;
|
|
524
|
+
setDigitalSignatureCount: React__default.Dispatch<React__default.SetStateAction<number>>;
|
|
525
|
+
/** Zero-based index of the selected slide master in master view. */
|
|
526
|
+
activeMasterIndex: number;
|
|
527
|
+
setActiveMasterIndex: React__default.Dispatch<React__default.SetStateAction<number>>;
|
|
528
|
+
/** Index of the selected layout within the active master, or null when viewing the master itself. */
|
|
529
|
+
activeLayoutIndex: number | null;
|
|
530
|
+
setActiveLayoutIndex: React__default.Dispatch<React__default.SetStateAction<number | null>>;
|
|
531
|
+
/** The mode the viewer was in before entering master view (to restore on close). */
|
|
532
|
+
preMasterMode: ViewerMode;
|
|
533
|
+
setPreMasterMode: React__default.Dispatch<React__default.SetStateAction<ViewerMode>>;
|
|
534
|
+
/** Active tab within the master view: slides (default), notes, or handout. */
|
|
535
|
+
masterViewTab: bk;
|
|
536
|
+
setMasterViewTab: React__default.Dispatch<React__default.SetStateAction<bk>>;
|
|
537
|
+
/** Handout slides-per-page setting (1, 2, 3, 4, 6, or 9). */
|
|
538
|
+
handoutSlidesPerPage: number;
|
|
539
|
+
setHandoutSlidesPerPage: React__default.Dispatch<React__default.SetStateAction<number>>;
|
|
540
|
+
/** The slide object at `activeSlideIndex`, or undefined if out of bounds. */
|
|
541
|
+
activeSlide: l | undefined;
|
|
542
|
+
/** Template (layout/master placeholder) elements for the active slide. */
|
|
543
|
+
templateElements: P[];
|
|
544
|
+
/** Fast id-to-element lookup map covering both slide and template elements. */
|
|
545
|
+
elementLookup: Map<string, P>;
|
|
546
|
+
/** The single primarily-selected element, resolved from `selectedElementId`. */
|
|
547
|
+
selectedElement: P | null;
|
|
548
|
+
/** Union of `selectedElementIds` and `selectedElementId`: the canonical list of selected ids. */
|
|
549
|
+
effectiveSelectedIds: string[];
|
|
550
|
+
/** Set form of `effectiveSelectedIds` for O(1) membership checks. */
|
|
551
|
+
selectedElementIdSet: Set<string>;
|
|
552
|
+
/** Resolved element objects for all selected ids. */
|
|
553
|
+
selectedElements: P[];
|
|
554
|
+
/** The currently active master in master view. */
|
|
555
|
+
activeMaster: A | undefined;
|
|
556
|
+
/** The currently active layout in master view. */
|
|
557
|
+
activeLayout: B | undefined;
|
|
558
|
+
/** Elements for the currently active master or layout in master view. */
|
|
559
|
+
masterViewElements: P[];
|
|
560
|
+
/** Elements for the notes master (when notes tab is active). */
|
|
561
|
+
notesMasterElements: P[];
|
|
562
|
+
/** Elements for the handout master (when handout tab is active). */
|
|
563
|
+
handoutMasterElements: P[];
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Initializes and returns the core viewer state (refs, useState values,
|
|
568
|
+
* and derived element/master state).
|
|
569
|
+
*
|
|
570
|
+
* @param _input - Content and edit-mode flag (used by upstream wiring; the
|
|
571
|
+
* hook itself does not consume them directly; they flow through
|
|
572
|
+
* useContentLifecycle).
|
|
573
|
+
* @returns A {@link ViewerCoreState} object containing every ref, state
|
|
574
|
+
* value, setter, and derived field.
|
|
575
|
+
*/
|
|
576
|
+
declare function useViewerCoreState(_input: UseViewerCoreStateInput): ViewerCoreState;
|
|
577
|
+
|
|
578
|
+
interface ViewerUIState {
|
|
579
|
+
isCompactToolbarOpen: boolean;
|
|
580
|
+
setIsCompactToolbarOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
581
|
+
toolbarSection: ToolbarSection;
|
|
582
|
+
setToolbarSection: React.Dispatch<React.SetStateAction<ToolbarSection>>;
|
|
583
|
+
isSlidesPaneOpen: boolean;
|
|
584
|
+
setIsSlidesPaneOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
585
|
+
isInspectorPaneOpen: boolean;
|
|
586
|
+
setIsInspectorPaneOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
587
|
+
isSlideNotesCollapsed: boolean;
|
|
588
|
+
setIsSlideNotesCollapsed: React.Dispatch<React.SetStateAction<boolean>>;
|
|
589
|
+
isOverflowMenuOpen: boolean;
|
|
590
|
+
setIsOverflowMenuOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
591
|
+
isSidebarCollapsed: boolean;
|
|
592
|
+
setIsSidebarCollapsed: React.Dispatch<React.SetStateAction<boolean>>;
|
|
593
|
+
sidebarPanelMode: string;
|
|
594
|
+
setSidebarPanelMode: React.Dispatch<React.SetStateAction<string>>;
|
|
595
|
+
showSlideSorter: boolean;
|
|
596
|
+
setShowSlideSorter: React.Dispatch<React.SetStateAction<boolean>>;
|
|
597
|
+
isShortcutHelpOpen: boolean;
|
|
598
|
+
setIsShortcutHelpOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
599
|
+
isAccessibilityPanelOpen: boolean;
|
|
600
|
+
setIsAccessibilityPanelOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
601
|
+
accessibilityIssues: AccessibilityIssue[];
|
|
602
|
+
setAccessibilityIssues: React.Dispatch<React.SetStateAction<AccessibilityIssue[]>>;
|
|
603
|
+
contextMenuState: ElementContextMenuState | null;
|
|
604
|
+
setContextMenuState: React.Dispatch<React.SetStateAction<ElementContextMenuState | null>>;
|
|
605
|
+
tableEditorState: TableCellEditorState | null;
|
|
606
|
+
setTableEditorState: React.Dispatch<React.SetStateAction<TableCellEditorState | null>>;
|
|
607
|
+
spellCheckEnabled: boolean;
|
|
608
|
+
setSpellCheckEnabled: React.Dispatch<React.SetStateAction<boolean>>;
|
|
609
|
+
showGrid: boolean;
|
|
610
|
+
setShowGrid: React.Dispatch<React.SetStateAction<boolean>>;
|
|
611
|
+
showRulers: boolean;
|
|
612
|
+
setShowRulers: React.Dispatch<React.SetStateAction<boolean>>;
|
|
613
|
+
snapToGrid: boolean;
|
|
614
|
+
setSnapToGrid: React.Dispatch<React.SetStateAction<boolean>>;
|
|
615
|
+
snapToShape: boolean;
|
|
616
|
+
setSnapToShape: React.Dispatch<React.SetStateAction<boolean>>;
|
|
617
|
+
guides: Array<{
|
|
618
|
+
id: string;
|
|
619
|
+
axis: 'h' | 'v';
|
|
620
|
+
position: number;
|
|
621
|
+
}>;
|
|
622
|
+
setGuides: React.Dispatch<React.SetStateAction<Array<{
|
|
623
|
+
id: string;
|
|
624
|
+
axis: 'h' | 'v';
|
|
625
|
+
position: number;
|
|
626
|
+
}>>>;
|
|
627
|
+
marqueeSelectionState: MarqueeSelectionState | null;
|
|
628
|
+
setMarqueeSelectionState: React.Dispatch<React.SetStateAction<MarqueeSelectionState | null>>;
|
|
629
|
+
snapLines: Array<{
|
|
630
|
+
axis: string;
|
|
631
|
+
position: number;
|
|
632
|
+
}>;
|
|
633
|
+
setSnapLines: React.Dispatch<React.SetStateAction<Array<{
|
|
634
|
+
axis: string;
|
|
635
|
+
position: number;
|
|
636
|
+
}>>>;
|
|
637
|
+
mediaDataUrls: Map<string, string>;
|
|
638
|
+
setMediaDataUrls: React.Dispatch<React.SetStateAction<Map<string, string>>>;
|
|
639
|
+
activeTool: DrawingTool;
|
|
640
|
+
setActiveTool: React.Dispatch<React.SetStateAction<DrawingTool>>;
|
|
641
|
+
drawingColor: string;
|
|
642
|
+
setDrawingColor: React.Dispatch<React.SetStateAction<string>>;
|
|
643
|
+
drawingWidth: number;
|
|
644
|
+
setDrawingWidth: React.Dispatch<React.SetStateAction<number>>;
|
|
645
|
+
isThemeEditorOpen: boolean;
|
|
646
|
+
setIsThemeEditorOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
647
|
+
isThemeGalleryOpen: boolean;
|
|
648
|
+
setIsThemeGalleryOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
649
|
+
formatPainterActive: boolean;
|
|
650
|
+
setFormatPainterActive: React.Dispatch<React.SetStateAction<boolean>>;
|
|
651
|
+
isSelectionPaneOpen: boolean;
|
|
652
|
+
setIsSelectionPaneOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
653
|
+
eyedropperActive: boolean;
|
|
654
|
+
setEyedropperActive: React.Dispatch<React.SetStateAction<boolean>>;
|
|
655
|
+
}
|
|
656
|
+
declare function useViewerUIState(): ViewerUIState;
|
|
657
|
+
|
|
658
|
+
/**
|
|
659
|
+
* Input parameters for the {@link useViewerState} hook.
|
|
660
|
+
*
|
|
661
|
+
* @property content - Raw PPTX binary data, or null/undefined when no file is loaded.
|
|
662
|
+
* @property canEdit - Whether the viewer should enable editing capabilities.
|
|
663
|
+
*/
|
|
664
|
+
interface UseViewerStateInput {
|
|
665
|
+
content: ArrayBuffer | Uint8Array | null | undefined;
|
|
666
|
+
canEdit: boolean;
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* The unified viewer state: intersection of core state (slides, elements,
|
|
670
|
+
* refs, presentation metadata) and UI state (panel toggles, tools, grid/snap).
|
|
671
|
+
*/
|
|
672
|
+
type ViewerState = ViewerCoreState & ViewerUIState;
|
|
673
|
+
/**
|
|
674
|
+
* Composes core and UI state into a single unified state object.
|
|
675
|
+
*
|
|
676
|
+
* This hook is the entry point consumed by the main PowerPointViewer component.
|
|
677
|
+
* It merges the results of two sub-hooks into one spread so downstream hooks
|
|
678
|
+
* can accept a single `ViewerState` parameter.
|
|
679
|
+
*
|
|
680
|
+
* @param input - The binary content and edit-mode flag.
|
|
681
|
+
* @returns The merged {@link ViewerState} containing every ref, state value, and setter.
|
|
682
|
+
*/
|
|
683
|
+
declare function useViewerState(input: UseViewerStateInput): ViewerState;
|
|
684
|
+
|
|
685
|
+
interface UseLoadContentInput {
|
|
686
|
+
content: ArrayBuffer | Uint8Array | null | undefined;
|
|
687
|
+
clearSelection: () => void;
|
|
688
|
+
history: EditorHistoryResult;
|
|
689
|
+
setSlides: React.Dispatch<React.SetStateAction<l[]>>;
|
|
690
|
+
setTemplateElementsBySlideId: React.Dispatch<React.SetStateAction<Record<string, P[]>>>;
|
|
691
|
+
mediaDataUrls: Map<string, string>;
|
|
692
|
+
setCanvasSize: React.Dispatch<React.SetStateAction<CanvasSize>>;
|
|
693
|
+
setHeaderFooter: React.Dispatch<React.SetStateAction<r>>;
|
|
694
|
+
setLayoutOptions: React.Dispatch<React.SetStateAction<Array<{
|
|
695
|
+
path: string;
|
|
696
|
+
name: string;
|
|
697
|
+
}>>>;
|
|
698
|
+
setSlideMasters: React.Dispatch<React.SetStateAction<A[]>>;
|
|
699
|
+
setTheme: React.Dispatch<React.SetStateAction<ap | undefined>>;
|
|
700
|
+
setTableStyleMap: React.Dispatch<React.SetStateAction<J | undefined>>;
|
|
701
|
+
setThemeOptions: React.Dispatch<React.SetStateAction<aq[]>>;
|
|
702
|
+
setCustomShows: React.Dispatch<React.SetStateAction<t[]>>;
|
|
703
|
+
setSections: React.Dispatch<React.SetStateAction<u[]>>;
|
|
704
|
+
setPresentationProperties: React.Dispatch<React.SetStateAction<s>>;
|
|
705
|
+
setNotesMaster: React.Dispatch<React.SetStateAction<y | undefined>>;
|
|
706
|
+
setHandoutMaster: React.Dispatch<React.SetStateAction<z | undefined>>;
|
|
707
|
+
setNotesCanvasSize: React.Dispatch<React.SetStateAction<CanvasSize | undefined>>;
|
|
708
|
+
setCustomProperties: React.Dispatch<React.SetStateAction<x[]>>;
|
|
709
|
+
setTagCollections: React.Dispatch<React.SetStateAction<D[]>>;
|
|
710
|
+
setCoreProperties: React.Dispatch<React.SetStateAction<v | undefined>>;
|
|
711
|
+
setAppProperties: React.Dispatch<React.SetStateAction<w | undefined>>;
|
|
712
|
+
setEmbeddedFonts: React.Dispatch<React.SetStateAction<K[]>>;
|
|
713
|
+
setActiveSlideIndex: React.Dispatch<React.SetStateAction<number>>;
|
|
714
|
+
setHasMacros: React.Dispatch<React.SetStateAction<boolean>>;
|
|
715
|
+
setHasDigitalSignatures: React.Dispatch<React.SetStateAction<boolean>>;
|
|
716
|
+
setDigitalSignatureCount: React.Dispatch<React.SetStateAction<number>>;
|
|
717
|
+
setGuides: React.Dispatch<React.SetStateAction<Array<{
|
|
718
|
+
id: string;
|
|
719
|
+
axis: 'h' | 'v';
|
|
720
|
+
position: number;
|
|
721
|
+
}>>>;
|
|
722
|
+
setLoading: React.Dispatch<React.SetStateAction<boolean>>;
|
|
723
|
+
setError: React.Dispatch<React.SetStateAction<string | null>>;
|
|
724
|
+
setIsDirty: React.Dispatch<React.SetStateAction<boolean>>;
|
|
725
|
+
setIsEncrypted: React.Dispatch<React.SetStateAction<boolean>>;
|
|
726
|
+
}
|
|
727
|
+
interface UseLoadContentResult {
|
|
728
|
+
handlerRef: React.MutableRefObject<PptxHandler | null>;
|
|
729
|
+
}
|
|
730
|
+
declare function useLoadContent({ content, clearSelection, history, setSlides, setTemplateElementsBySlideId, mediaDataUrls, setCanvasSize, setHeaderFooter, setLayoutOptions, setSlideMasters, setTheme, setTableStyleMap, setThemeOptions, setCustomShows, setSections, setPresentationProperties, setNotesMaster, setHandoutMaster, setNotesCanvasSize, setCustomProperties, setTagCollections, setCoreProperties, setAppProperties, setEmbeddedFonts, setActiveSlideIndex, setHasMacros, setHasDigitalSignatures, setDigitalSignatureCount, setGuides, setLoading, setError, setIsDirty, setIsEncrypted, }: UseLoadContentInput): UseLoadContentResult;
|
|
731
|
+
|
|
732
|
+
type AutosaveStatus = {
|
|
733
|
+
state: 'idle';
|
|
734
|
+
} | {
|
|
735
|
+
state: 'disabled';
|
|
736
|
+
reason: string;
|
|
737
|
+
} | {
|
|
738
|
+
state: 'saving';
|
|
739
|
+
} | {
|
|
740
|
+
state: 'saved';
|
|
741
|
+
timestamp: number;
|
|
742
|
+
} | {
|
|
743
|
+
state: 'error';
|
|
744
|
+
message: string;
|
|
745
|
+
};
|
|
746
|
+
interface UseAutosaveInput {
|
|
747
|
+
/** Whether the document has unsaved changes. */
|
|
748
|
+
isDirty: boolean;
|
|
749
|
+
/** File path or name of the currently-open PPTX. Required for autosave to work. */
|
|
750
|
+
filePath: string | undefined;
|
|
751
|
+
/** Serialise current editor state to a Uint8Array. */
|
|
752
|
+
serializeSlides: () => Promise<Uint8Array | null>;
|
|
753
|
+
/** Autosave interval in seconds (default 120). */
|
|
754
|
+
intervalSeconds?: number;
|
|
755
|
+
/** Whether autosave is enabled. */
|
|
756
|
+
enabled?: boolean;
|
|
757
|
+
}
|
|
758
|
+
interface UseAutosaveResult {
|
|
759
|
+
/** Current autosave status for display in the StatusBar. */
|
|
760
|
+
autosaveStatus: AutosaveStatus;
|
|
761
|
+
/** Manually trigger an autosave right now. */
|
|
762
|
+
triggerAutosave: () => Promise<void>;
|
|
763
|
+
}
|
|
764
|
+
declare function useAutosave(input: UseAutosaveInput): UseAutosaveResult;
|
|
765
|
+
|
|
766
|
+
interface UseElementOperationsInput {
|
|
767
|
+
slides: l[];
|
|
768
|
+
activeSlide: l | undefined;
|
|
769
|
+
activeSlideIndex: number;
|
|
770
|
+
selectedElement: P | null;
|
|
771
|
+
selectedElementId: string | null;
|
|
772
|
+
/** When true, element operations target the template store, not slide.elements. */
|
|
773
|
+
editTemplateMode: boolean;
|
|
774
|
+
/** Template (master/layout) elements for the active slide. */
|
|
775
|
+
templateElements: P[];
|
|
776
|
+
history: EditorHistoryResult;
|
|
777
|
+
setSlides: React.Dispatch<React.SetStateAction<l[]>>;
|
|
778
|
+
setTemplateElementsBySlideId: React.Dispatch<React.SetStateAction<Record<string, P[]>>>;
|
|
779
|
+
setSelectedElementId: React.Dispatch<React.SetStateAction<string | null>>;
|
|
780
|
+
setSelectedElementIds: React.Dispatch<React.SetStateAction<string[]>>;
|
|
781
|
+
setInlineEditingElementId: React.Dispatch<React.SetStateAction<string | null>>;
|
|
782
|
+
setContextMenuState: React.Dispatch<React.SetStateAction<ElementContextMenuState | null>>;
|
|
783
|
+
}
|
|
784
|
+
interface ElementOperations {
|
|
785
|
+
applySelection: (primaryId: string | null, ids?: string[]) => void;
|
|
786
|
+
clearSelection: () => void;
|
|
787
|
+
updateElementById: (elementId: string, updates: Partial<P>) => void;
|
|
788
|
+
updateSelectedElement: (updates: Partial<P>) => void;
|
|
789
|
+
updateSelectedShapeStyle: (updates: Partial<$>) => void;
|
|
790
|
+
updateSelectedTextStyle: (updates: Partial<a0>) => void;
|
|
791
|
+
updateSlides: (updater: (s: l[]) => l[]) => void;
|
|
792
|
+
/**
|
|
793
|
+
* The element list currently being edited: the template store for the active
|
|
794
|
+
* slide while edit-template mode is on, otherwise the active slide's elements.
|
|
795
|
+
*/
|
|
796
|
+
activeElements: P[];
|
|
797
|
+
/**
|
|
798
|
+
* Replace the active element list (template store or slide.elements depending
|
|
799
|
+
* on edit-template mode). Does not mark the document dirty; callers do.
|
|
800
|
+
*/
|
|
801
|
+
updateActiveElements: (updater: (els: P[]) => P[]) => void;
|
|
802
|
+
serializeSlides: () => Promise<Uint8Array | null>;
|
|
803
|
+
}
|
|
804
|
+
declare function useElementOperations(input: UseElementOperationsInput): ElementOperations;
|
|
805
|
+
|
|
806
|
+
interface UseSectionOperationsInput {
|
|
807
|
+
sections: u[];
|
|
808
|
+
setSections: React.Dispatch<React.SetStateAction<u[]>>;
|
|
809
|
+
slides: l[];
|
|
810
|
+
setSlides: React.Dispatch<React.SetStateAction<l[]>>;
|
|
811
|
+
markDirty: () => void;
|
|
812
|
+
}
|
|
813
|
+
interface SectionOperations {
|
|
814
|
+
addSection: (name: string, afterSlideIndex: number) => void;
|
|
815
|
+
renameSection: (sectionId: string, newName: string) => void;
|
|
816
|
+
deleteSection: (sectionId: string) => void;
|
|
817
|
+
moveSectionUp: (sectionId: string) => void;
|
|
818
|
+
moveSectionDown: (sectionId: string) => void;
|
|
819
|
+
moveSlidesToSection: (slideIndexes: number[], targetSectionId: string) => void;
|
|
820
|
+
}
|
|
821
|
+
declare function useSectionOperations(input: UseSectionOperationsInput): SectionOperations;
|
|
822
|
+
|
|
823
|
+
/**
|
|
824
|
+
* Shared types for the usePointerHandlers hook and its extracted helpers.
|
|
825
|
+
*/
|
|
826
|
+
|
|
827
|
+
interface UsePointerHandlersInput {
|
|
828
|
+
editorScale: number;
|
|
829
|
+
canvasStageRef: React.RefObject<HTMLDivElement | null>;
|
|
830
|
+
canvasSize: CanvasSize;
|
|
831
|
+
activeSlide: l | undefined;
|
|
832
|
+
activeSlideIndex: number;
|
|
833
|
+
gridSpacingPx: number;
|
|
834
|
+
dragStateRef: React.MutableRefObject<DragState | null>;
|
|
835
|
+
resizeStateRef: React.MutableRefObject<ResizeState | null>;
|
|
836
|
+
shapeAdjustmentDragStateRef: React.MutableRefObject<ShapeAdjustmentDragState | null>;
|
|
837
|
+
marqueeStateRef: React.MutableRefObject<MarqueeSelectionState | null>;
|
|
838
|
+
/** When true, pointer commits target the per-slide template store. */
|
|
839
|
+
editTemplateMode: boolean;
|
|
840
|
+
snapToGrid: boolean;
|
|
841
|
+
snapToShape: boolean;
|
|
842
|
+
guides: Array<{
|
|
843
|
+
id: string;
|
|
844
|
+
axis: 'h' | 'v';
|
|
845
|
+
position: number;
|
|
846
|
+
}>;
|
|
847
|
+
/** Template (master/layout) elements for the active slide (drag/marquee source while editing templates). */
|
|
848
|
+
templateElements: P[];
|
|
849
|
+
elementLookup: Map<string, P>;
|
|
850
|
+
setMarqueeSelectionState: React.Dispatch<React.SetStateAction<MarqueeSelectionState | null>>;
|
|
851
|
+
setSnapLines: React.Dispatch<React.SetStateAction<Array<{
|
|
852
|
+
axis: string;
|
|
853
|
+
position: number;
|
|
854
|
+
}>>>;
|
|
855
|
+
setTemplateElementsBySlideId: React.Dispatch<React.SetStateAction<Record<string, P[]>>>;
|
|
856
|
+
setPointerCommitNonce: React.Dispatch<React.SetStateAction<number>>;
|
|
857
|
+
effectiveSelectedIds: string[];
|
|
858
|
+
applySelection: (primaryId: string | null, ids?: string[]) => void;
|
|
859
|
+
clearSelection: () => void;
|
|
860
|
+
updateSlides: (updater: (s: l[]) => l[]) => void;
|
|
861
|
+
updateElementById: (id: string, updates: Partial<P>) => void;
|
|
862
|
+
markDirty: () => void;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
declare function usePointerHandlers(input: UsePointerHandlersInput): void;
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* Shared type for canvas interaction handler signatures.
|
|
869
|
+
*/
|
|
870
|
+
interface CanvasInteractionHandlers {
|
|
871
|
+
handleElementClick: (elementId: string, e: React.MouseEvent) => void;
|
|
872
|
+
handleElementDoubleClick: (elementId: string, e: React.MouseEvent) => void;
|
|
873
|
+
handleElementMouseDown: (elementId: string, e: React.MouseEvent) => void;
|
|
874
|
+
handleElementContextMenu: (elementId: string, e: React.MouseEvent) => void;
|
|
875
|
+
handleCanvasMouseDown: (e: React.MouseEvent) => void;
|
|
876
|
+
handleResizePointerDown: (elementId: string, e: React.MouseEvent, handle: string) => void;
|
|
877
|
+
handleAdjustmentPointerDown: (elementId: string, e: React.MouseEvent) => void;
|
|
878
|
+
/** Commit a new rotation (degrees) for an element from the on-canvas rotate handle. */
|
|
879
|
+
handleRotate: (elementId: string, rotationDeg: number) => void;
|
|
880
|
+
/** Commit an inline (on-canvas) SmartArt node edit through the element-update path. */
|
|
881
|
+
handleUpdateSmartArtElement: (elementId: string, updates: Partial<P>) => void;
|
|
882
|
+
/** Apply a text-style toggle (Ctrl/Cmd+B/I/U) to the element being inline-edited. */
|
|
883
|
+
handleFormatText: (updates: Partial<a0>) => void;
|
|
884
|
+
handleInlineEditCommit: () => void;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
interface UseCanvasInteractionsInput {
|
|
888
|
+
mode: ViewerMode;
|
|
889
|
+
canEdit: boolean;
|
|
890
|
+
canvasSize: CanvasSize;
|
|
891
|
+
activeSlideIndex: number;
|
|
892
|
+
selectedElementId: string | null;
|
|
893
|
+
selectedElementIds: string[];
|
|
894
|
+
selectedElementIdSet: Set<string>;
|
|
895
|
+
inlineEditingElementId: string | null;
|
|
896
|
+
effectiveSelectedIds: string[];
|
|
897
|
+
elementLookup: Map<string, P>;
|
|
898
|
+
activeTool: string;
|
|
899
|
+
editTemplateMode: boolean;
|
|
900
|
+
editorScale: number;
|
|
901
|
+
canvasStageRef: React.RefObject<HTMLDivElement | null>;
|
|
902
|
+
dragStateRef: React.MutableRefObject<DragState | null>;
|
|
903
|
+
resizeStateRef: React.MutableRefObject<ResizeState | null>;
|
|
904
|
+
shapeAdjustmentDragStateRef: React.MutableRefObject<ShapeAdjustmentDragState | null>;
|
|
905
|
+
marqueeStateRef: React.MutableRefObject<MarqueeSelectionState | null>;
|
|
906
|
+
setInlineEditingElementId: React.Dispatch<React.SetStateAction<string | null>>;
|
|
907
|
+
setInlineEditingText: React.Dispatch<React.SetStateAction<string>>;
|
|
908
|
+
setContextMenuState: React.Dispatch<React.SetStateAction<ElementContextMenuState | null>>;
|
|
909
|
+
setMarqueeSelectionState: React.Dispatch<React.SetStateAction<MarqueeSelectionState | null>>;
|
|
910
|
+
setSnapLines: React.Dispatch<React.SetStateAction<Array<{
|
|
911
|
+
axis: string;
|
|
912
|
+
position: number;
|
|
913
|
+
}>>>;
|
|
914
|
+
inlineEditingText: string;
|
|
915
|
+
ops: ElementOperations;
|
|
916
|
+
history: EditorHistoryResult;
|
|
917
|
+
presentationHandleAction: (action: Record<string, unknown>) => void;
|
|
918
|
+
setEditingEquationOmml: (omml: Record<string, unknown> | null) => void;
|
|
919
|
+
setIsEquationDialogOpen: (open: boolean) => void;
|
|
920
|
+
/** Bumped after a committed on-canvas edit so the history hook snapshots it. */
|
|
921
|
+
setPointerCommitNonce?: React.Dispatch<React.SetStateAction<number>>;
|
|
922
|
+
}
|
|
923
|
+
declare function useCanvasInteractions(input: UseCanvasInteractionsInput): CanvasInteractionHandlers;
|
|
924
|
+
|
|
925
|
+
/** The type of hyperlink target. */
|
|
926
|
+
type HyperlinkTargetType = 'url' | 'email' | 'slide' | 'file' | 'action';
|
|
927
|
+
/** Supported action verbs for action hyperlinks. */
|
|
928
|
+
type HyperlinkActionVerb = 'nextSlide' | 'prevSlide' | 'firstSlide' | 'lastSlide' | 'endShow';
|
|
929
|
+
/** Data model for the hyperlink editor dialog. */
|
|
930
|
+
interface HyperlinkEditData {
|
|
931
|
+
targetType: HyperlinkTargetType;
|
|
932
|
+
url: string;
|
|
933
|
+
tooltip: string;
|
|
934
|
+
emailAddress: string;
|
|
935
|
+
emailSubject: string;
|
|
936
|
+
slideNumber: number;
|
|
937
|
+
filePath: string;
|
|
938
|
+
actionVerb: HyperlinkActionVerb;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
/**
|
|
942
|
+
* useInsertElements: Handlers for inserting new elements (text, shape,
|
|
943
|
+
* table, SmartArt, equation, field, action button, ink, freeform)
|
|
944
|
+
* and image/media file picking.
|
|
945
|
+
*/
|
|
946
|
+
|
|
947
|
+
interface UseInsertElementsInput {
|
|
948
|
+
activeSlide: l | undefined;
|
|
949
|
+
activeSlideIndex: number;
|
|
950
|
+
canvasSize: CanvasSize;
|
|
951
|
+
newShapeType: SupportedShapeType;
|
|
952
|
+
selectedElements: P[];
|
|
953
|
+
ops: ElementOperations;
|
|
954
|
+
history: EditorHistoryResult;
|
|
955
|
+
}
|
|
956
|
+
interface InsertElementHandlers {
|
|
957
|
+
handleAddTextBox: () => void;
|
|
958
|
+
handleAddShape: () => void;
|
|
959
|
+
handleAddTable: () => void;
|
|
960
|
+
handleAddChart: (chartType: k) => void;
|
|
961
|
+
handleInsertSmartArt: (layout: ca, defaultItems: string[]) => void;
|
|
962
|
+
handleInsertEquation: (omml: Record<string, unknown>) => void;
|
|
963
|
+
handleUpdateEquation: (omml: Record<string, unknown>) => void;
|
|
964
|
+
handleHyperlinkConfirm: (data: HyperlinkEditData) => void;
|
|
965
|
+
handleInsertField: (fieldType: string, value?: string) => void;
|
|
966
|
+
handleAddActionButton: (shapeType: string) => void;
|
|
967
|
+
handleAddInkElement: (ink: I) => void;
|
|
968
|
+
handleAddFreeformShape: (shape: S) => void;
|
|
969
|
+
handleEraseInkElement: (elementId: string) => void;
|
|
970
|
+
handleImageFileChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
971
|
+
handleMediaFileChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
972
|
+
}
|
|
973
|
+
declare function useInsertElements(input: UseInsertElementsInput): InsertElementHandlers;
|
|
974
|
+
|
|
975
|
+
/**
|
|
976
|
+
* Shared types for the useElementManipulation hook and its sub-hooks.
|
|
977
|
+
*/
|
|
978
|
+
|
|
979
|
+
interface UseElementManipulationInput {
|
|
980
|
+
activeSlide: l | undefined;
|
|
981
|
+
activeSlideIndex: number;
|
|
982
|
+
selectedElement: P | null;
|
|
983
|
+
effectiveSelectedIds: string[];
|
|
984
|
+
selectedElements: P[];
|
|
985
|
+
selectedElementIdSet: Set<string>;
|
|
986
|
+
elementLookup: Map<string, P>;
|
|
987
|
+
editTemplateMode: boolean;
|
|
988
|
+
clipboardPayload: {
|
|
989
|
+
element: P;
|
|
990
|
+
isTemplate: boolean;
|
|
991
|
+
} | null;
|
|
992
|
+
setClipboardPayload: React.Dispatch<React.SetStateAction<{
|
|
993
|
+
element: P;
|
|
994
|
+
isTemplate: boolean;
|
|
995
|
+
} | null>>;
|
|
996
|
+
setSelectedElementIds: React.Dispatch<React.SetStateAction<string[]>>;
|
|
997
|
+
setIsInspectorPaneOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
998
|
+
setSidebarPanelMode: React.Dispatch<React.SetStateAction<string>>;
|
|
999
|
+
ops: ElementOperations;
|
|
1000
|
+
history: EditorHistoryResult;
|
|
1001
|
+
onOpenHyperlinkDialog: () => void;
|
|
1002
|
+
}
|
|
1003
|
+
interface ElementManipulationHandlers {
|
|
1004
|
+
handleCopy: () => void;
|
|
1005
|
+
handleCut: () => void;
|
|
1006
|
+
handlePaste: () => void;
|
|
1007
|
+
handleDuplicate: () => void;
|
|
1008
|
+
handleGroupElements: () => void;
|
|
1009
|
+
handleUngroupElement: () => void;
|
|
1010
|
+
handleDelete: () => void;
|
|
1011
|
+
handleFlip: (direction: 'horizontal' | 'vertical') => void;
|
|
1012
|
+
handleAlignElements: (align: string) => void;
|
|
1013
|
+
handleDistributeElements: (axis: string) => void;
|
|
1014
|
+
canDistribute: boolean;
|
|
1015
|
+
handleMoveLayer: (direction: string) => void;
|
|
1016
|
+
handleMoveLayerToEdge: (direction: string) => void;
|
|
1017
|
+
handleMergeShapes: (operation: MergeShapeOperation) => void;
|
|
1018
|
+
canMergeShapes: boolean;
|
|
1019
|
+
handleContextMenuAction: (action: ElementContextMenuAction) => void;
|
|
1020
|
+
}
|
|
1021
|
+
interface ClipboardHandlers {
|
|
1022
|
+
handleCopy: () => void;
|
|
1023
|
+
handleCut: () => void;
|
|
1024
|
+
handlePaste: () => void;
|
|
1025
|
+
handleDuplicate: () => void;
|
|
1026
|
+
handleDelete: () => void;
|
|
1027
|
+
}
|
|
1028
|
+
interface GroupAlignLayerHandlers {
|
|
1029
|
+
handleGroupElements: () => void;
|
|
1030
|
+
handleUngroupElement: () => void;
|
|
1031
|
+
handleFlip: (direction: 'horizontal' | 'vertical') => void;
|
|
1032
|
+
handleAlignElements: (align: string) => void;
|
|
1033
|
+
handleDistributeElements: (axis: string) => void;
|
|
1034
|
+
canDistribute: boolean;
|
|
1035
|
+
handleMoveLayer: (direction: string) => void;
|
|
1036
|
+
handleMoveLayerToEdge: (direction: string) => void;
|
|
1037
|
+
handleMergeShapes: (operation: MergeShapeOperation) => void;
|
|
1038
|
+
canMergeShapes: boolean;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
declare function useElementManipulation(input: UseElementManipulationInput): ElementManipulationHandlers;
|
|
1042
|
+
|
|
1043
|
+
/**
|
|
1044
|
+
* useSlideManagement: Slide CRUD operations: add, move, delete,
|
|
1045
|
+
* duplicate, toggle-hide, insert-from-layout, and context menu.
|
|
1046
|
+
*/
|
|
1047
|
+
|
|
1048
|
+
interface UseSlideManagementInput {
|
|
1049
|
+
slides: l[];
|
|
1050
|
+
activeSlide: l | undefined;
|
|
1051
|
+
activeSlideIndex: number;
|
|
1052
|
+
setActiveSlideIndex: React__default.Dispatch<React__default.SetStateAction<number>>;
|
|
1053
|
+
ops: ElementOperations;
|
|
1054
|
+
history: EditorHistoryResult;
|
|
1055
|
+
/** Ref to the loaded PPTX handler; `current` is null before initial load. */
|
|
1056
|
+
handlerRef?: React__default.RefObject<PptxHandler | null> | React__default.MutableRefObject<PptxHandler | null>;
|
|
1057
|
+
}
|
|
1058
|
+
interface SlideManagementHandlers {
|
|
1059
|
+
handleAddSlide: () => void;
|
|
1060
|
+
handleMoveSlide: (fromIndex: number, toIndex: number) => void;
|
|
1061
|
+
handleSlideContextMenu: (e: React__default.MouseEvent, index: number) => void;
|
|
1062
|
+
handleDeleteSlides: (indexes: number[]) => void;
|
|
1063
|
+
handleDuplicateSlides: (indexes: number[]) => void;
|
|
1064
|
+
handleToggleHideSlides: (indexes: number[]) => void;
|
|
1065
|
+
handleInsertSlideFromLayout: (layoutPath: string, layoutName?: string) => void;
|
|
1066
|
+
}
|
|
1067
|
+
declare function useSlideManagement(input: UseSlideManagementInput): SlideManagementHandlers;
|
|
1068
|
+
|
|
1069
|
+
interface UseTableOperationsInput {
|
|
1070
|
+
selectedElement: P | null;
|
|
1071
|
+
tableEditorState: TableCellEditorState | null;
|
|
1072
|
+
elementLookup: Map<string, P>;
|
|
1073
|
+
setTableEditorState: Dispatch<SetStateAction<TableCellEditorState | null>>;
|
|
1074
|
+
ops: ElementOperations;
|
|
1075
|
+
history: EditorHistoryResult;
|
|
1076
|
+
}
|
|
1077
|
+
interface TableStructHandlers {
|
|
1078
|
+
handleCommitCellEdit: (elementId: string, rowIndex: number, colIndex: number, text: string) => void;
|
|
1079
|
+
handleUpdateCellTextStyle: (styleUpdates: Record<string, unknown>) => void;
|
|
1080
|
+
handleResizeTableColumns: (elementId: string, newWidths: number[]) => void;
|
|
1081
|
+
handleResizeTableRow: (elementId: string, rowIndex: number, newHeight: number) => void;
|
|
1082
|
+
handleInsertTableRow: (position: 'above' | 'below') => void;
|
|
1083
|
+
handleDeleteTableRow: () => void;
|
|
1084
|
+
handleInsertTableColumn: (position: 'left' | 'right') => void;
|
|
1085
|
+
handleDeleteTableColumn: () => void;
|
|
1086
|
+
}
|
|
1087
|
+
interface TableMergeHandlers {
|
|
1088
|
+
handleMergeCellRight: () => void;
|
|
1089
|
+
handleMergeCellDown: () => void;
|
|
1090
|
+
handleMergeSelectedCells: () => void;
|
|
1091
|
+
handleSplitCell: () => void;
|
|
1092
|
+
}
|
|
1093
|
+
type TableOperationHandlers = TableStructHandlers & TableMergeHandlers;
|
|
1094
|
+
|
|
1095
|
+
/**
|
|
1096
|
+
* useTableOperations: Cell editing, column / row resize, insert / delete
|
|
1097
|
+
* rows/columns, cell merge / split for table elements.
|
|
1098
|
+
*/
|
|
1099
|
+
|
|
1100
|
+
declare function useTableOperations(input: UseTableOperationsInput): TableOperationHandlers;
|
|
1101
|
+
|
|
1102
|
+
interface UseExportHandlersInput {
|
|
1103
|
+
slides: l[];
|
|
1104
|
+
/** Separated master/layout (template) elements, merged back at save time. */
|
|
1105
|
+
templateElementsBySlideId: Record<string, P[]>;
|
|
1106
|
+
activeSlide: l | undefined;
|
|
1107
|
+
activeSlideIndex: number;
|
|
1108
|
+
filePath: string | undefined;
|
|
1109
|
+
canvasStageRef: RefObject<HTMLDivElement | null>;
|
|
1110
|
+
setActiveSlideIndex: Dispatch<SetStateAction<number>>;
|
|
1111
|
+
handlerRef: RefObject<PptxHandler | null>;
|
|
1112
|
+
serializeSlides: () => Promise<Uint8Array | null>;
|
|
1113
|
+
/** State from the viewer needed for save-as */
|
|
1114
|
+
headerFooter: Record<string, unknown>;
|
|
1115
|
+
presentationProperties: Record<string, unknown>;
|
|
1116
|
+
customShows: Array<{
|
|
1117
|
+
id: string;
|
|
1118
|
+
name: string;
|
|
1119
|
+
slideRIds: string[];
|
|
1120
|
+
}>;
|
|
1121
|
+
sections: Array<{
|
|
1122
|
+
id: string;
|
|
1123
|
+
name: string;
|
|
1124
|
+
color?: string;
|
|
1125
|
+
collapsed?: boolean;
|
|
1126
|
+
}>;
|
|
1127
|
+
coreProperties: Record<string, unknown> | null;
|
|
1128
|
+
appProperties: Record<string, unknown> | null;
|
|
1129
|
+
customProperties: Array<Record<string, unknown>>;
|
|
1130
|
+
notesMaster: Record<string, unknown> | undefined;
|
|
1131
|
+
handoutMaster: Record<string, unknown> | undefined;
|
|
1132
|
+
guides: Array<{
|
|
1133
|
+
id: string;
|
|
1134
|
+
axis: 'h' | 'v';
|
|
1135
|
+
position: number;
|
|
1136
|
+
}>;
|
|
1137
|
+
activeSlideIndexForGuides: number;
|
|
1138
|
+
password?: string;
|
|
1139
|
+
}
|
|
1140
|
+
interface ExportHandlersResult {
|
|
1141
|
+
handleExportPng: () => Promise<void>;
|
|
1142
|
+
handleExportPdf: () => Promise<void>;
|
|
1143
|
+
handleExportNotesPdf: () => Promise<void>;
|
|
1144
|
+
handleCopySlideAsImage: () => Promise<void>;
|
|
1145
|
+
handleExportVideo: () => Promise<void>;
|
|
1146
|
+
handleExportGif: () => Promise<void>;
|
|
1147
|
+
handlePackageForSharing: () => Promise<void>;
|
|
1148
|
+
handleSaveAsFormat: (format: PptxSaveFormat) => Promise<void>;
|
|
1149
|
+
handleSaveAsPptx: () => void;
|
|
1150
|
+
handleSaveAsPpsx: () => void;
|
|
1151
|
+
handleSaveAsPptm: () => void;
|
|
1152
|
+
handleCancelExport: () => void;
|
|
1153
|
+
exportModalOpen: boolean;
|
|
1154
|
+
exportModalTitle: string;
|
|
1155
|
+
exportProgress: number;
|
|
1156
|
+
exportStatusMessage: string;
|
|
1157
|
+
}
|
|
1158
|
+
/** Controls for the shared export-progress modal, passed to sub-hooks. */
|
|
1159
|
+
interface ExportModalControls {
|
|
1160
|
+
setExportModalOpen: (open: boolean) => void;
|
|
1161
|
+
setExportModalTitle: (title: string) => void;
|
|
1162
|
+
setExportProgress: (progress: number) => void;
|
|
1163
|
+
setExportStatusMessage: (message: string) => void;
|
|
1164
|
+
exportAbortRef: MutableRefObject<AbortController | null>;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
declare function useExportHandlers(input: UseExportHandlersInput): ExportHandlersResult;
|
|
1168
|
+
|
|
1169
|
+
interface UsePrintHandlersInput {
|
|
1170
|
+
slides: l[];
|
|
1171
|
+
activeSlideIndex: number;
|
|
1172
|
+
canvasStageRef: RefObject<HTMLDivElement | null>;
|
|
1173
|
+
setActiveSlideIndex: React.Dispatch<React.SetStateAction<number>>;
|
|
1174
|
+
/** Parsed PPTX data (needed for SVG print path). Optional for backward compat. */
|
|
1175
|
+
pptxData?: m;
|
|
1176
|
+
}
|
|
1177
|
+
interface PrintHandlersResult {
|
|
1178
|
+
handlePrint: () => void;
|
|
1179
|
+
handlePrintWithSettings: (settings: PrintSettings) => Promise<void>;
|
|
1180
|
+
handlePrintSvg: (settings: PrintSettings) => Promise<void>;
|
|
1181
|
+
isPrintDialogOpen: boolean;
|
|
1182
|
+
setIsPrintDialogOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
1183
|
+
}
|
|
1184
|
+
declare function usePrintHandlers(input: UsePrintHandlersInput): PrintHandlersResult;
|
|
1185
|
+
|
|
1186
|
+
interface UseThemeHandlersInput {
|
|
1187
|
+
handlerRef: RefObject<PptxHandler | null>;
|
|
1188
|
+
serializeSlides: () => Promise<Uint8Array | null>;
|
|
1189
|
+
setContent: React.Dispatch<React.SetStateAction<ArrayBuffer | Uint8Array | null>>;
|
|
1190
|
+
onContentChange: ((data: Uint8Array) => void) | undefined;
|
|
1191
|
+
setTheme: React.Dispatch<React.SetStateAction<Record<string, unknown> | null>>;
|
|
1192
|
+
setSlideMasters: React.Dispatch<React.SetStateAction<Array<Record<string, unknown>>>>;
|
|
1193
|
+
slideMasters: Array<Record<string, unknown>>;
|
|
1194
|
+
history: EditorHistoryResult;
|
|
1195
|
+
}
|
|
1196
|
+
interface ThemeHandlersResult {
|
|
1197
|
+
handleApplyTheme: (themePath: string, applyToAllMasters: boolean) => Promise<void>;
|
|
1198
|
+
handleUpdateThemeColorScheme: (colorScheme: d) => Promise<void>;
|
|
1199
|
+
handleUpdateThemeFontScheme: (fontScheme: e) => Promise<void>;
|
|
1200
|
+
handleUpdateThemeName: (name: string) => Promise<void>;
|
|
1201
|
+
handleApplyThemeToPresentation: () => Promise<void>;
|
|
1202
|
+
handleApplyThemeData: (colorScheme: d, fontScheme: e, themeName?: string) => Promise<void>;
|
|
1203
|
+
handleSetTemplateBackground: (path: string, backgroundColor: string | undefined) => void;
|
|
1204
|
+
handleGetTemplateBackgroundColor: (path: string) => string | undefined;
|
|
1205
|
+
/** Return theme parts discovered in the loaded PPTX archive. */
|
|
1206
|
+
handleGetAvailableThemes: () => Promise<aq[]>;
|
|
1207
|
+
/**
|
|
1208
|
+
* Switch the presentation to an existing theme by its archive path,
|
|
1209
|
+
* update all slide masters, and refresh the serialised content.
|
|
1210
|
+
*/
|
|
1211
|
+
handleSwitchTheme: (themePath: string) => Promise<void>;
|
|
1212
|
+
}
|
|
1213
|
+
declare function useThemeHandlers(input: UseThemeHandlersInput): ThemeHandlersResult;
|
|
1214
|
+
|
|
1215
|
+
interface UsePropertyHandlersInput {
|
|
1216
|
+
slides: l[];
|
|
1217
|
+
activeSlideIndex: number;
|
|
1218
|
+
canvasSize: CanvasSize;
|
|
1219
|
+
setContent: React.Dispatch<React.SetStateAction<ArrayBuffer | Uint8Array | null>>;
|
|
1220
|
+
setPresentationProperties: React.Dispatch<React.SetStateAction<s>>;
|
|
1221
|
+
setCoreProperties: React.Dispatch<React.SetStateAction<v | null>>;
|
|
1222
|
+
setAppProperties: React.Dispatch<React.SetStateAction<w | null>>;
|
|
1223
|
+
setCustomProperties: React.Dispatch<React.SetStateAction<x[]>>;
|
|
1224
|
+
setSlides: React.Dispatch<React.SetStateAction<l[]>>;
|
|
1225
|
+
setIsDirty: React.Dispatch<React.SetStateAction<boolean>>;
|
|
1226
|
+
ops: ElementOperations;
|
|
1227
|
+
history: EditorHistoryResult;
|
|
1228
|
+
}
|
|
1229
|
+
interface PropertyHandlersResult {
|
|
1230
|
+
handleUpdateNotes: (text: string, segments?: N[]) => void;
|
|
1231
|
+
handleUpdateSlide: (updates: Partial<l>) => void;
|
|
1232
|
+
handleUpdatePresentationProperties: (updates: Partial<s>) => void;
|
|
1233
|
+
handleUpdateCoreProperties: (updates: Partial<v>) => void;
|
|
1234
|
+
handleUpdateAppProperties: (updates: Partial<w>) => void;
|
|
1235
|
+
handleUpdateCustomProperties: (next: x[]) => void;
|
|
1236
|
+
handleRestoreVersion: (versionData: Uint8Array) => void;
|
|
1237
|
+
handleCompare: () => Promise<void>;
|
|
1238
|
+
handleAcceptSlide: (di: number) => void;
|
|
1239
|
+
handleRejectSlide: (di: number) => void;
|
|
1240
|
+
handleAcceptAllSlides: () => void;
|
|
1241
|
+
isVersionHistoryOpen: boolean;
|
|
1242
|
+
setIsVersionHistoryOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
1243
|
+
isComparePanelOpen: boolean;
|
|
1244
|
+
setIsComparePanelOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
1245
|
+
compareResult: CompareResult | null;
|
|
1246
|
+
usedFontFamilies: string[];
|
|
1247
|
+
}
|
|
1248
|
+
declare function usePropertyHandlers(input: UsePropertyHandlersInput): PropertyHandlersResult;
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* Types for the {@link useViewerDialogs} hook.
|
|
1252
|
+
*
|
|
1253
|
+
* Describes the input dependencies and the output shape for all dialog-related
|
|
1254
|
+
* state and handlers in the viewer (SmartArt, equation editor, master view,
|
|
1255
|
+
* custom shows, password protection, accessibility checks, etc.).
|
|
1256
|
+
*
|
|
1257
|
+
* @module viewer-dialog-types
|
|
1258
|
+
*/
|
|
1259
|
+
|
|
1260
|
+
/**
|
|
1261
|
+
* Input dependencies required by the {@link useViewerDialogs} hook.
|
|
1262
|
+
*
|
|
1263
|
+
* Collects references to core state, setters, and the editor history
|
|
1264
|
+
* so the hook can manage dialog visibility, master view transitions,
|
|
1265
|
+
* guide creation, custom show CRUD, and accessibility checking.
|
|
1266
|
+
*/
|
|
1267
|
+
interface UseViewerDialogsInput {
|
|
1268
|
+
/** Current viewer mode (edit, view, present, master). */
|
|
1269
|
+
mode: ViewerMode;
|
|
1270
|
+
/** All slides in the presentation. */
|
|
1271
|
+
slides: l[];
|
|
1272
|
+
/** The currently active slide, or undefined. */
|
|
1273
|
+
activeSlide: l | undefined;
|
|
1274
|
+
/** Zero-based index of the active slide. */
|
|
1275
|
+
activeSlideIndex: number;
|
|
1276
|
+
/** Slide canvas dimensions (used for guide positioning). */
|
|
1277
|
+
canvasSize: CanvasSize;
|
|
1278
|
+
/** Ref to the container element (used for viewport width detection). */
|
|
1279
|
+
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
1280
|
+
/** Custom shows defined in the presentation. */
|
|
1281
|
+
customShows: Array<{
|
|
1282
|
+
id: string;
|
|
1283
|
+
name: string;
|
|
1284
|
+
slideRIds: string[];
|
|
1285
|
+
}>;
|
|
1286
|
+
/** ID of the currently active custom show. */
|
|
1287
|
+
activeCustomShowId: string | null;
|
|
1288
|
+
/** Setter for custom shows. */
|
|
1289
|
+
setCustomShows: React.Dispatch<React.SetStateAction<Array<{
|
|
1290
|
+
id: string;
|
|
1291
|
+
name: string;
|
|
1292
|
+
slideRIds: string[];
|
|
1293
|
+
}>>>;
|
|
1294
|
+
/** Setter for the active custom show id. */
|
|
1295
|
+
setActiveCustomShowId: React.Dispatch<React.SetStateAction<string | null>>;
|
|
1296
|
+
/** Setter for the slide guides array. */
|
|
1297
|
+
setGuides: React.Dispatch<React.SetStateAction<Array<{
|
|
1298
|
+
id: string;
|
|
1299
|
+
axis: 'h' | 'v';
|
|
1300
|
+
position: number;
|
|
1301
|
+
}>>>;
|
|
1302
|
+
/** Setter for presentation-level properties. */
|
|
1303
|
+
setPresentationProperties: React.Dispatch<React.SetStateAction<s>>;
|
|
1304
|
+
/** Setter for accessibility issue results. */
|
|
1305
|
+
setAccessibilityIssues: React.Dispatch<React.SetStateAction<Array<{
|
|
1306
|
+
slideIndex: number;
|
|
1307
|
+
elementId: string;
|
|
1308
|
+
severity: 'error' | 'warning' | 'info';
|
|
1309
|
+
message: string;
|
|
1310
|
+
}>>>;
|
|
1311
|
+
/** Setter to open/close the accessibility panel. */
|
|
1312
|
+
setIsAccessibilityPanelOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
1313
|
+
/** Setter for the viewer mode. */
|
|
1314
|
+
setMode: React.Dispatch<React.SetStateAction<ViewerMode>>;
|
|
1315
|
+
/** Setter for the pre-master-view mode (used to restore on close). */
|
|
1316
|
+
setPreMasterMode: React.Dispatch<React.SetStateAction<ViewerMode>>;
|
|
1317
|
+
/** Setter for the active master index. */
|
|
1318
|
+
setActiveMasterIndex: React.Dispatch<React.SetStateAction<number>>;
|
|
1319
|
+
/** Setter for the active layout index within a master. */
|
|
1320
|
+
setActiveLayoutIndex: React.Dispatch<React.SetStateAction<number | null>>;
|
|
1321
|
+
/** Setter for the primary selected element id. */
|
|
1322
|
+
setSelectedElementId: React.Dispatch<React.SetStateAction<string | null>>;
|
|
1323
|
+
/** Setter for the multi-selection element ids. */
|
|
1324
|
+
setSelectedElementIds: React.Dispatch<React.SetStateAction<string[]>>;
|
|
1325
|
+
/** The mode the viewer was in before entering master view. */
|
|
1326
|
+
preMasterMode: ViewerMode;
|
|
1327
|
+
/** Whether the presentation contains digital signatures (triggers strip warning on edit). */
|
|
1328
|
+
hasDigitalSignatures: boolean;
|
|
1329
|
+
/** Whether there are unsaved modifications. */
|
|
1330
|
+
isDirty: boolean;
|
|
1331
|
+
/** Editor history instance (used for markDirty on settings changes). */
|
|
1332
|
+
history: EditorHistoryResult;
|
|
1333
|
+
}
|
|
1334
|
+
/**
|
|
1335
|
+
* Output shape of the {@link useViewerDialogs} hook.
|
|
1336
|
+
*
|
|
1337
|
+
* Provides boolean state + setters for every dialog/modal, plus handler
|
|
1338
|
+
* callbacks for master view navigation, guide creation, custom show management,
|
|
1339
|
+
* slide-show settings, password, and accessibility.
|
|
1340
|
+
*/
|
|
1341
|
+
interface ViewerDialogsResult {
|
|
1342
|
+
/** Whether the Insert SmartArt dialog is visible. */
|
|
1343
|
+
isSmartArtDialogOpen: boolean;
|
|
1344
|
+
setIsSmartArtDialogOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
1345
|
+
/** Whether the equation (MathML/OMML) editor dialog is visible. */
|
|
1346
|
+
isEquationDialogOpen: boolean;
|
|
1347
|
+
setIsEquationDialogOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
1348
|
+
/** Whether the hyperlink editor dialog is visible. */
|
|
1349
|
+
isHyperlinkDialogOpen: boolean;
|
|
1350
|
+
setIsHyperlinkDialogOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
1351
|
+
/** Whether the set/remove password dialog is visible. */
|
|
1352
|
+
isPasswordDialogOpen: boolean;
|
|
1353
|
+
setIsPasswordDialogOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
1354
|
+
/** Whether the document properties dialog is visible. */
|
|
1355
|
+
isDocPropsDialogOpen: boolean;
|
|
1356
|
+
setIsDocPropsDialogOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
1357
|
+
/** Whether the font embedding panel is visible. */
|
|
1358
|
+
isFontEmbeddingOpen: boolean;
|
|
1359
|
+
setIsFontEmbeddingOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
1360
|
+
/** Whether the digital signatures detail dialog is visible. */
|
|
1361
|
+
isDigitalSigDialogOpen: boolean;
|
|
1362
|
+
setIsDigitalSigDialogOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
1363
|
+
/** Whether the "signatures will be stripped" warning dialog is visible. */
|
|
1364
|
+
isSignatureStrippedDialogOpen: boolean;
|
|
1365
|
+
setIsSignatureStrippedDialogOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
1366
|
+
/** Whether the "Set Up Slide Show" configuration dialog is visible. */
|
|
1367
|
+
isSetUpSlideShowOpen: boolean;
|
|
1368
|
+
setIsSetUpSlideShowOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
1369
|
+
/** Whether the broadcast (share screen) dialog is visible. */
|
|
1370
|
+
isBroadcastDialogOpen: boolean;
|
|
1371
|
+
setIsBroadcastDialogOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
1372
|
+
/** Whether the presentation is currently password-protected. */
|
|
1373
|
+
isPasswordProtected: boolean;
|
|
1374
|
+
/** The active password, or null when the presentation is not protected. */
|
|
1375
|
+
presentationPassword: string | null;
|
|
1376
|
+
/** OMML data for the equation currently being edited, or null. */
|
|
1377
|
+
editingEquationOmml: Record<string, unknown> | null;
|
|
1378
|
+
setEditingEquationOmml: React.Dispatch<React.SetStateAction<Record<string, unknown> | null>>;
|
|
1379
|
+
/** Whether font embedding is enabled for save. */
|
|
1380
|
+
embedFontsEnabled: boolean;
|
|
1381
|
+
setEmbedFontsEnabled: React.Dispatch<React.SetStateAction<boolean>>;
|
|
1382
|
+
/** True when the container is narrower than 768px (triggers compact layout). */
|
|
1383
|
+
isNarrowViewport: boolean;
|
|
1384
|
+
/** Switches the viewer to master view mode, preserving the previous mode for restoration. */
|
|
1385
|
+
handleEnterMasterView: () => void;
|
|
1386
|
+
/** Exits master view and restores the previous mode. */
|
|
1387
|
+
handleCloseMasterView: () => void;
|
|
1388
|
+
/**
|
|
1389
|
+
* Selects a slide master by index and clears layout/element selection.
|
|
1390
|
+
* @param index - Zero-based index into the `slideMasters` array.
|
|
1391
|
+
*/
|
|
1392
|
+
handleSelectMaster: (index: number) => void;
|
|
1393
|
+
/**
|
|
1394
|
+
* Selects a specific layout within a master.
|
|
1395
|
+
* @param masterIndex - Zero-based master index.
|
|
1396
|
+
* @param layoutIndex - Zero-based layout index within that master.
|
|
1397
|
+
*/
|
|
1398
|
+
handleSelectLayout: (masterIndex: number, layoutIndex: number) => void;
|
|
1399
|
+
/**
|
|
1400
|
+
* Adds a horizontal or vertical guide at the canvas center.
|
|
1401
|
+
* @param axis - "h" for horizontal, "v" for vertical.
|
|
1402
|
+
*/
|
|
1403
|
+
handleAddGuide: (axis: 'h' | 'v') => void;
|
|
1404
|
+
/** Creates a new empty custom show and makes it active. */
|
|
1405
|
+
handleCreateCustomShow: () => void;
|
|
1406
|
+
/** Prompts to rename the currently active custom show. */
|
|
1407
|
+
handleRenameActiveCustomShow: () => void;
|
|
1408
|
+
/** Deletes the currently active custom show. */
|
|
1409
|
+
handleDeleteActiveCustomShow: () => void;
|
|
1410
|
+
/** Adds or removes the current slide from the active custom show. */
|
|
1411
|
+
handleToggleCurrentSlideInActiveShow: () => void;
|
|
1412
|
+
/** Whether the current slide is included in the active custom show. */
|
|
1413
|
+
isCurrentSlideInActiveShow: boolean;
|
|
1414
|
+
/**
|
|
1415
|
+
* Persists updated presentation properties (loop, range, show type, etc.).
|
|
1416
|
+
* @param props - The new presentation properties to save.
|
|
1417
|
+
*/
|
|
1418
|
+
handleSaveSlideShowSettings: (props: s) => void;
|
|
1419
|
+
/** Toggles the subtitle overlay during presentation mode. */
|
|
1420
|
+
handleToggleSubtitles: () => void;
|
|
1421
|
+
/**
|
|
1422
|
+
* Sets a password on the presentation.
|
|
1423
|
+
* @param password - The password string to apply.
|
|
1424
|
+
*/
|
|
1425
|
+
handleSetPassword: (password: string) => void;
|
|
1426
|
+
/** Removes password protection from the presentation. */
|
|
1427
|
+
handleRemovePassword: () => void;
|
|
1428
|
+
/** Runs an accessibility check across all slides and opens the results panel. */
|
|
1429
|
+
handleRunAccessibilityCheck: () => void;
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
declare function useViewerDialogs(input: UseViewerDialogsInput): ViewerDialogsResult;
|
|
1433
|
+
|
|
1434
|
+
interface UseDerivedSlideStateInput {
|
|
1435
|
+
slides: l[];
|
|
1436
|
+
sections: Array<{
|
|
1437
|
+
id: string;
|
|
1438
|
+
name: string;
|
|
1439
|
+
collapsed?: boolean;
|
|
1440
|
+
color?: string;
|
|
1441
|
+
}>;
|
|
1442
|
+
customShows: Array<{
|
|
1443
|
+
id: string;
|
|
1444
|
+
name: string;
|
|
1445
|
+
slideRIds: string[];
|
|
1446
|
+
}>;
|
|
1447
|
+
activeCustomShowId: string | null;
|
|
1448
|
+
mode: ViewerMode;
|
|
1449
|
+
activeLayout: B | undefined;
|
|
1450
|
+
activeMaster: A | undefined;
|
|
1451
|
+
presentationGridSpacing: {
|
|
1452
|
+
cx: number;
|
|
1453
|
+
} | undefined;
|
|
1454
|
+
}
|
|
1455
|
+
interface DerivedSlideState {
|
|
1456
|
+
gridSpacingPx: number;
|
|
1457
|
+
visibleSlideIndexes: number[];
|
|
1458
|
+
slideSectionGroups: SlideSectionGroup[];
|
|
1459
|
+
masterPseudoSlide: l | undefined;
|
|
1460
|
+
}
|
|
1461
|
+
declare function useDerivedSlideState(input: UseDerivedSlideStateInput): DerivedSlideState;
|
|
1462
|
+
|
|
1463
|
+
interface UseAnnotationHandlersInput {
|
|
1464
|
+
mode: ViewerMode;
|
|
1465
|
+
presentation: UsePresentationModeResult;
|
|
1466
|
+
annotations: UsePresentationAnnotationsResult;
|
|
1467
|
+
history: EditorHistoryResult;
|
|
1468
|
+
setMode: React.Dispatch<React.SetStateAction<ViewerMode>>;
|
|
1469
|
+
setSlides: React.Dispatch<React.SetStateAction<l[]>>;
|
|
1470
|
+
}
|
|
1471
|
+
interface AnnotationHandlersResult {
|
|
1472
|
+
showKeepAnnotationsDialog: boolean;
|
|
1473
|
+
handleSetMode: (nextMode: ViewerMode) => void;
|
|
1474
|
+
handleKeepAnnotations: () => void;
|
|
1475
|
+
handleDiscardAnnotations: () => void;
|
|
1476
|
+
handleEnterPresenterView: () => void;
|
|
1477
|
+
handleEnterRehearsalMode: () => void;
|
|
1478
|
+
}
|
|
1479
|
+
declare function useAnnotationHandlers(input: UseAnnotationHandlersInput): AnnotationHandlersResult;
|
|
1480
|
+
|
|
1481
|
+
interface UseSerializeInput {
|
|
1482
|
+
slides: l[];
|
|
1483
|
+
/** Separated master/layout (template) elements, merged back at save time. */
|
|
1484
|
+
templateElementsBySlideId: Record<string, P[]>;
|
|
1485
|
+
activeSlideIndex: number;
|
|
1486
|
+
guides: Array<{
|
|
1487
|
+
id: string;
|
|
1488
|
+
axis: 'h' | 'v';
|
|
1489
|
+
position: number;
|
|
1490
|
+
}>;
|
|
1491
|
+
headerFooter: r;
|
|
1492
|
+
presentationProperties: s;
|
|
1493
|
+
customShows: Array<{
|
|
1494
|
+
id: string;
|
|
1495
|
+
name: string;
|
|
1496
|
+
slideRIds: string[];
|
|
1497
|
+
}>;
|
|
1498
|
+
sections: u[];
|
|
1499
|
+
coreProperties: v | undefined;
|
|
1500
|
+
appProperties: w | undefined;
|
|
1501
|
+
customProperties: x[];
|
|
1502
|
+
notesMaster: y | undefined;
|
|
1503
|
+
handoutMaster: z | undefined;
|
|
1504
|
+
handlerRef: React__default.RefObject<PptxHandler | null>;
|
|
1505
|
+
inlineEditingElementIdRef: React__default.MutableRefObject<string | null>;
|
|
1506
|
+
inlineEditingTextRef: React__default.MutableRefObject<string>;
|
|
1507
|
+
password?: string;
|
|
1508
|
+
}
|
|
1509
|
+
declare function useSerialize(input: UseSerializeInput): () => Promise<Uint8Array | null>;
|
|
1510
|
+
|
|
1511
|
+
interface UseRecoveryDetectionInput {
|
|
1512
|
+
filePath: string | undefined;
|
|
1513
|
+
loading: boolean;
|
|
1514
|
+
error: string | null;
|
|
1515
|
+
slideCount: number;
|
|
1516
|
+
openVersionHistory: () => void;
|
|
1517
|
+
}
|
|
1518
|
+
declare function useRecoveryDetection(input: UseRecoveryDetectionInput): void;
|
|
1519
|
+
|
|
1520
|
+
interface UsePresentationSetupInput {
|
|
1521
|
+
mode: ViewerMode;
|
|
1522
|
+
slides: l[];
|
|
1523
|
+
visibleSlideIndexes: number[];
|
|
1524
|
+
activeSlideIndex: number;
|
|
1525
|
+
containerRef: React.RefObject<HTMLElement | null>;
|
|
1526
|
+
/** Raw PPTX bytes: forwarded to audience window for content sharing. */
|
|
1527
|
+
content?: ArrayBuffer | Uint8Array | null;
|
|
1528
|
+
mediaDataUrls: Map<string, string>;
|
|
1529
|
+
presentationProperties: {
|
|
1530
|
+
loopContinuously?: boolean;
|
|
1531
|
+
showType?: string;
|
|
1532
|
+
showWithAnimation?: boolean;
|
|
1533
|
+
advanceMode?: 'manual' | 'useTimings';
|
|
1534
|
+
};
|
|
1535
|
+
setMode: React.Dispatch<React.SetStateAction<ViewerMode>>;
|
|
1536
|
+
setActiveSlideIndex: React.Dispatch<React.SetStateAction<number>>;
|
|
1537
|
+
setSlides: React.Dispatch<React.SetStateAction<l[]>>;
|
|
1538
|
+
history: EditorHistoryResult;
|
|
1539
|
+
}
|
|
1540
|
+
interface PresentationSetupResult {
|
|
1541
|
+
presentation: UsePresentationModeResult;
|
|
1542
|
+
annotations: UsePresentationAnnotationsResult;
|
|
1543
|
+
actionSoundHandlerRef: React.MutableRefObject<PptxHandler | null>;
|
|
1544
|
+
}
|
|
1545
|
+
declare function usePresentationSetup(input: UsePresentationSetupInput): PresentationSetupResult;
|
|
1546
|
+
|
|
1547
|
+
interface UseEditorOperationsInput {
|
|
1548
|
+
state: ViewerState;
|
|
1549
|
+
history: EditorHistoryResult;
|
|
1550
|
+
zoom: {
|
|
1551
|
+
editorScale: number;
|
|
1552
|
+
canvasStageRef: React__default.RefObject<HTMLDivElement | null>;
|
|
1553
|
+
};
|
|
1554
|
+
mode: ViewerMode;
|
|
1555
|
+
canEdit: boolean;
|
|
1556
|
+
slides: l[];
|
|
1557
|
+
activeSlide: l | undefined;
|
|
1558
|
+
activeSlideIndex: number;
|
|
1559
|
+
selectedElement: P | null;
|
|
1560
|
+
selectedElementId: string | null;
|
|
1561
|
+
selectedElementIds: string[];
|
|
1562
|
+
canvasSize: CanvasSize;
|
|
1563
|
+
dialogs: ViewerDialogsResult;
|
|
1564
|
+
presentation: UsePresentationModeResult;
|
|
1565
|
+
/** Display name for comment authoring. */
|
|
1566
|
+
userName?: string;
|
|
1567
|
+
/** Ref to the loaded PPTX handler; populated by the content-lifecycle hook. */
|
|
1568
|
+
handlerRef?: React__default.RefObject<PptxHandler | null> | React__default.MutableRefObject<PptxHandler | null>;
|
|
1569
|
+
}
|
|
1570
|
+
interface EditorOperationsResult {
|
|
1571
|
+
ops: ElementOperations;
|
|
1572
|
+
sectionOps: SectionOperations;
|
|
1573
|
+
findReplace: ReturnType<typeof useFindReplace>;
|
|
1574
|
+
comments: ReturnType<typeof useComments>;
|
|
1575
|
+
canvasHandlers: CanvasInteractionHandlers;
|
|
1576
|
+
insertHandlers: InsertElementHandlers;
|
|
1577
|
+
manipulation: ElementManipulationHandlers;
|
|
1578
|
+
slideOps: SlideManagementHandlers;
|
|
1579
|
+
tableOps: TableOperationHandlers;
|
|
1580
|
+
}
|
|
1581
|
+
declare function useEditorOperations(input: UseEditorOperationsInput): EditorOperationsResult;
|
|
1582
|
+
|
|
1583
|
+
interface UseIOHandlersInput {
|
|
1584
|
+
state: ViewerState;
|
|
1585
|
+
slides: l[];
|
|
1586
|
+
activeSlideIndex: number;
|
|
1587
|
+
canvasSize: CanvasSize;
|
|
1588
|
+
filePath: string | undefined;
|
|
1589
|
+
history: EditorHistoryResult;
|
|
1590
|
+
ops: ElementOperations;
|
|
1591
|
+
zoom: {
|
|
1592
|
+
canvasStageRef: React__default.RefObject<HTMLDivElement | null>;
|
|
1593
|
+
};
|
|
1594
|
+
handlerRef: React__default.RefObject<PptxHandler | null>;
|
|
1595
|
+
serializeSlides: () => Promise<Uint8Array | null>;
|
|
1596
|
+
setContent: React__default.Dispatch<React__default.SetStateAction<ArrayBuffer | Uint8Array | null>>;
|
|
1597
|
+
onContentChange: ((content: Uint8Array) => void) | undefined;
|
|
1598
|
+
password?: string;
|
|
1599
|
+
}
|
|
1600
|
+
interface IOHandlersResult {
|
|
1601
|
+
exportHandlers: ExportHandlersResult;
|
|
1602
|
+
printHandlers: PrintHandlersResult;
|
|
1603
|
+
themeHandlers: ThemeHandlersResult;
|
|
1604
|
+
propertyHandlers: PropertyHandlersResult;
|
|
1605
|
+
}
|
|
1606
|
+
declare function useIOHandlers(input: UseIOHandlersInput): IOHandlersResult;
|
|
1607
|
+
|
|
1608
|
+
interface UseContentLifecycleInput {
|
|
1609
|
+
content: ArrayBuffer | Uint8Array | null;
|
|
1610
|
+
filePath: string | undefined;
|
|
1611
|
+
/** AutoSave toggle state; when false the recovery autosave timer is off. */
|
|
1612
|
+
autosaveEnabled?: boolean;
|
|
1613
|
+
slides: l[];
|
|
1614
|
+
state: ViewerState;
|
|
1615
|
+
history: EditorHistoryResult;
|
|
1616
|
+
ops: ElementOperations;
|
|
1617
|
+
actionSoundHandlerRef: React__default.MutableRefObject<PptxHandler | null>;
|
|
1618
|
+
setIsEncryptedDialogOpen: React__default.Dispatch<React__default.SetStateAction<boolean>>;
|
|
1619
|
+
password?: string;
|
|
1620
|
+
}
|
|
1621
|
+
interface ContentLifecycleResult {
|
|
1622
|
+
handlerRef: React__default.RefObject<PptxHandler | null>;
|
|
1623
|
+
serializeSlides: () => Promise<Uint8Array | null>;
|
|
1624
|
+
autosaveStatus: AutosaveStatus;
|
|
1625
|
+
}
|
|
1626
|
+
declare function useContentLifecycle(input: UseContentLifecycleInput): ContentLifecycleResult;
|
|
1627
|
+
|
|
1628
|
+
/**
|
|
1629
|
+
* useKeyboardShortcutWiring: Wires the composed editor results into the
|
|
1630
|
+
* generic `useKeyboardShortcuts` hook. Keeps the orchestrator lean.
|
|
1631
|
+
*/
|
|
1632
|
+
|
|
1633
|
+
interface UseKeyboardShortcutWiringInput {
|
|
1634
|
+
state: ViewerState;
|
|
1635
|
+
mode: ViewerMode;
|
|
1636
|
+
canEdit: boolean;
|
|
1637
|
+
slides: l[];
|
|
1638
|
+
activeSlide: l | undefined;
|
|
1639
|
+
ops: ElementOperations;
|
|
1640
|
+
manipulation: ElementManipulationHandlers;
|
|
1641
|
+
history: EditorHistoryResult;
|
|
1642
|
+
}
|
|
1643
|
+
declare function useKeyboardShortcutWiring(input: UseKeyboardShortcutWiringInput): void;
|
|
1644
|
+
|
|
1645
|
+
interface UseViewerIntegrationInput {
|
|
1646
|
+
state: ViewerState;
|
|
1647
|
+
zoom: UseZoomViewportResult;
|
|
1648
|
+
history: EditorHistoryResult;
|
|
1649
|
+
presentation: PresentationSetupResult['presentation'];
|
|
1650
|
+
annotations: PresentationSetupResult['annotations'];
|
|
1651
|
+
actionSoundHandlerRef: PresentationSetupResult['actionSoundHandlerRef'];
|
|
1652
|
+
editorOps: EditorOperationsResult;
|
|
1653
|
+
dialogs: ViewerDialogsResult;
|
|
1654
|
+
gridSpacingPx: number;
|
|
1655
|
+
content: ArrayBuffer | Uint8Array | null;
|
|
1656
|
+
filePath: string | undefined;
|
|
1657
|
+
/** AutoSave toggle state from the title bar. */
|
|
1658
|
+
autosaveEnabled: boolean;
|
|
1659
|
+
canEdit: boolean;
|
|
1660
|
+
mode: ViewerState['mode'];
|
|
1661
|
+
slides: l[];
|
|
1662
|
+
activeSlide: l | undefined;
|
|
1663
|
+
activeSlideIndex: number;
|
|
1664
|
+
canvasSize: ViewerState['canvasSize'];
|
|
1665
|
+
loading: boolean;
|
|
1666
|
+
error: string | null;
|
|
1667
|
+
ref: ForwardedRef<PowerPointViewerHandle>;
|
|
1668
|
+
setContent: Dispatch<SetStateAction<ArrayBuffer | Uint8Array | null>>;
|
|
1669
|
+
onContentChange: ((content: Uint8Array) => void) | undefined;
|
|
1670
|
+
onDirtyChange: ((dirty: boolean) => void) | undefined;
|
|
1671
|
+
onActiveSlideChange: ((index: number) => void) | undefined;
|
|
1672
|
+
onModeChange: ((mode: ViewerMode) => void) | undefined;
|
|
1673
|
+
onZoomChange: ((zoom: number) => void) | undefined;
|
|
1674
|
+
onSelectionChange: ((ids: string[]) => void) | undefined;
|
|
1675
|
+
onSlideCountChange: ((count: number) => void) | undefined;
|
|
1676
|
+
}
|
|
1677
|
+
interface ViewerIntegrationResult {
|
|
1678
|
+
exportHandlers: IOHandlersResult['exportHandlers'];
|
|
1679
|
+
printHandlers: IOHandlersResult['printHandlers'];
|
|
1680
|
+
themeHandlers: IOHandlersResult['themeHandlers'];
|
|
1681
|
+
propertyHandlers: IOHandlersResult['propertyHandlers'];
|
|
1682
|
+
showKeepAnnotationsDialog: AnnotationHandlersResult['showKeepAnnotationsDialog'];
|
|
1683
|
+
handleSetMode: AnnotationHandlersResult['handleSetMode'];
|
|
1684
|
+
handleKeepAnnotations: AnnotationHandlersResult['handleKeepAnnotations'];
|
|
1685
|
+
handleDiscardAnnotations: AnnotationHandlersResult['handleDiscardAnnotations'];
|
|
1686
|
+
handleEnterPresenterView: AnnotationHandlersResult['handleEnterPresenterView'];
|
|
1687
|
+
handleEnterRehearsalMode: AnnotationHandlersResult['handleEnterRehearsalMode'];
|
|
1688
|
+
autosaveStatus: AutosaveStatus;
|
|
1689
|
+
isEncryptedDialogOpen: boolean;
|
|
1690
|
+
setIsEncryptedDialogOpen: Dispatch<SetStateAction<boolean>>;
|
|
1691
|
+
}
|
|
1692
|
+
declare function useViewerIntegration(input: UseViewerIntegrationInput): ViewerIntegrationResult;
|
|
1693
|
+
|
|
1694
|
+
interface UseReducedMotionResult {
|
|
1695
|
+
/** Whether the OS reports prefers-reduced-motion: reduce. */
|
|
1696
|
+
osReducedMotion: boolean;
|
|
1697
|
+
/** Whether the user has manually toggled reduced motion on. */
|
|
1698
|
+
manualReducedMotion: boolean;
|
|
1699
|
+
/** Effective value: true when either OS or manual toggle is active. */
|
|
1700
|
+
reducedMotion: boolean;
|
|
1701
|
+
/** Toggle the manual override on/off. */
|
|
1702
|
+
toggleReducedMotion: () => void;
|
|
1703
|
+
/** Set the manual override to a specific value. */
|
|
1704
|
+
setManualReducedMotion: (value: boolean) => void;
|
|
1705
|
+
}
|
|
1706
|
+
/**
|
|
1707
|
+
* Detects the OS `prefers-reduced-motion` media query and provides a
|
|
1708
|
+
* manual toggle for users who want to disable animations in the viewer
|
|
1709
|
+
* without changing their OS settings.
|
|
1710
|
+
*
|
|
1711
|
+
* @returns {@link UseReducedMotionResult}
|
|
1712
|
+
*/
|
|
1713
|
+
declare function useReducedMotion(): UseReducedMotionResult;
|
|
1714
|
+
|
|
1715
|
+
/**
|
|
1716
|
+
* useYjsDocumentSync -- Syncs PptxSlide[] state with a Yjs Y.Doc using the
|
|
1717
|
+
* granular `pptx:slides` Y.Array structure (one Y.Map per slide, per-element
|
|
1718
|
+
* Y.Maps, and Y.Text for textSegments). This matches the schema defined by
|
|
1719
|
+
* PptxCodec in packages/tools so all bindings and the codec are interoperable.
|
|
1720
|
+
*
|
|
1721
|
+
* Write-back (Area 3): when the collaboration role is `'owner'`, the hook
|
|
1722
|
+
* debounces Y.Doc changes and calls `config.onWriteBack` with the serialized
|
|
1723
|
+
* PPTX bytes so the host can persist a durable snapshot.
|
|
1724
|
+
*/
|
|
1725
|
+
|
|
1726
|
+
interface UseYjsDocumentSyncInput {
|
|
1727
|
+
/** The Yjs document (from useYjsProvider). null when not collaborating. */
|
|
1728
|
+
doc: Doc | null;
|
|
1729
|
+
/** Current slides state. */
|
|
1730
|
+
slides: l[];
|
|
1731
|
+
/** Separated master/layout (template) elements, merged back on write-back. */
|
|
1732
|
+
templateElementsBySlideId: Record<string, P[]>;
|
|
1733
|
+
/** React state setter for slides. */
|
|
1734
|
+
setSlides: React.Dispatch<React.SetStateAction<l[]>>;
|
|
1735
|
+
/** Whether collaboration is active (status === 'connected'). */
|
|
1736
|
+
isConnected: boolean;
|
|
1737
|
+
/**
|
|
1738
|
+
* Whether the provider completed its initial document sync. Local -> doc
|
|
1739
|
+
* writes are gated on this so a late joiner never seeds its bootstrap deck
|
|
1740
|
+
* into a room whose real content has not arrived yet. Defaults to true for
|
|
1741
|
+
* callers that manage sync readiness themselves.
|
|
1742
|
+
*/
|
|
1743
|
+
isSynced?: boolean;
|
|
1744
|
+
/** Collaboration config (for role and write-back). */
|
|
1745
|
+
config?: Pick<CollaborationConfig, 'role' | 'onWriteBack' | 'writeBackDebounceMs'>;
|
|
1746
|
+
/**
|
|
1747
|
+
* Return the source PPTX bytes for write-back serialization. Only called
|
|
1748
|
+
* when role === 'owner' and onWriteBack is set.
|
|
1749
|
+
*/
|
|
1750
|
+
getSourceBytes?: () => Uint8Array | null;
|
|
1751
|
+
}
|
|
1752
|
+
declare function useYjsDocumentSync({ doc, slides, templateElementsBySlideId, setSlides, isConnected, isSynced, config, getSourceBytes, }: UseYjsDocumentSyncInput): void;
|
|
1753
|
+
|
|
1754
|
+
interface UseBroadcastFollowerInput {
|
|
1755
|
+
/** The collaboration context (null when collaboration is disabled). */
|
|
1756
|
+
collab: CollaborationContextValue | null;
|
|
1757
|
+
/** Current local active slide index. */
|
|
1758
|
+
activeSlideIndex: number;
|
|
1759
|
+
/** Setter for the active slide index. */
|
|
1760
|
+
setActiveSlideIndex: (index: number) => void;
|
|
1761
|
+
/** Total number of slides (for bounds checking). */
|
|
1762
|
+
slideCount: number;
|
|
1763
|
+
/**
|
|
1764
|
+
* When true, auto-follow stands down (e.g. the local user is manually
|
|
1765
|
+
* following a specific peer via the follow bar). Defaults to false.
|
|
1766
|
+
*/
|
|
1767
|
+
paused?: boolean;
|
|
1768
|
+
}
|
|
1769
|
+
declare function useBroadcastFollower({ collab, activeSlideIndex, setActiveSlideIndex, slideCount, paused, }: UseBroadcastFollowerInput): void;
|
|
1770
|
+
|
|
1771
|
+
interface UseFollowModeInput {
|
|
1772
|
+
/** The collaboration context (null when collaboration is disabled). */
|
|
1773
|
+
collab: CollaborationContextValue | null;
|
|
1774
|
+
/** Current local active slide index. */
|
|
1775
|
+
activeSlideIndex: number;
|
|
1776
|
+
/** Setter for the active slide index. */
|
|
1777
|
+
setActiveSlideIndex: (index: number) => void;
|
|
1778
|
+
/** Total number of slides (for bounds checking). */
|
|
1779
|
+
slideCount: number;
|
|
1780
|
+
}
|
|
1781
|
+
interface UseFollowModeResult {
|
|
1782
|
+
/** The clientId currently being followed, or null. */
|
|
1783
|
+
followedClientId: number | null;
|
|
1784
|
+
/** Follow the given peer, or `null` to stop following. */
|
|
1785
|
+
followUser: (clientId: number | null) => void;
|
|
1786
|
+
}
|
|
1787
|
+
declare function useFollowMode({ collab, activeSlideIndex, setActiveSlideIndex, slideCount, }: UseFollowModeInput): UseFollowModeResult;
|
|
1788
|
+
|
|
1789
|
+
/**
|
|
1790
|
+
* Input for {@link useLayoutSwitching}.
|
|
1791
|
+
*/
|
|
1792
|
+
interface UseLayoutSwitchingInput {
|
|
1793
|
+
/** Current PPTX handler instance (may be null before load). */
|
|
1794
|
+
handler: PptxHandler | null;
|
|
1795
|
+
/** Current slides array. */
|
|
1796
|
+
slides: l[];
|
|
1797
|
+
/** Index of the currently active slide. */
|
|
1798
|
+
activeSlideIndex: number;
|
|
1799
|
+
/** Element operations for updating the slides array. */
|
|
1800
|
+
ops: ElementOperations;
|
|
1801
|
+
/** Editor history for marking dirty state. */
|
|
1802
|
+
history: EditorHistoryResult;
|
|
1803
|
+
}
|
|
1804
|
+
/**
|
|
1805
|
+
* Result returned by {@link useLayoutSwitching}.
|
|
1806
|
+
*/
|
|
1807
|
+
interface LayoutSwitchingResult {
|
|
1808
|
+
/** Available layouts for the active slide (populated after calling `loadAvailableLayouts`). */
|
|
1809
|
+
availableLayouts: o[];
|
|
1810
|
+
/** Whether a layout operation is in progress. */
|
|
1811
|
+
isLoading: boolean;
|
|
1812
|
+
/** Load the available layouts for the current slide. */
|
|
1813
|
+
loadAvailableLayouts: () => Promise<void>;
|
|
1814
|
+
/** Apply a layout to the active slide by its archive path. */
|
|
1815
|
+
applyLayout: (layoutPath: string) => Promise<void>;
|
|
1816
|
+
/** The current slide's layout path (if known). */
|
|
1817
|
+
currentLayoutPath: string | undefined;
|
|
1818
|
+
}
|
|
1819
|
+
/**
|
|
1820
|
+
* Hook that provides layout switching capabilities for the editor.
|
|
1821
|
+
*
|
|
1822
|
+
* @example
|
|
1823
|
+
* ```tsx
|
|
1824
|
+
* const { availableLayouts, applyLayout, loadAvailableLayouts } =
|
|
1825
|
+
* useLayoutSwitching({ handler, slides, activeSlideIndex, ops, history });
|
|
1826
|
+
*
|
|
1827
|
+
* // Load layouts when the user opens a layout picker
|
|
1828
|
+
* await loadAvailableLayouts();
|
|
1829
|
+
*
|
|
1830
|
+
* // Switch to a different layout
|
|
1831
|
+
* await applyLayout("ppt/slideLayouts/slideLayout3.xml");
|
|
1832
|
+
* ```
|
|
1833
|
+
*/
|
|
1834
|
+
declare function useLayoutSwitching(input: UseLayoutSwitchingInput): LayoutSwitchingResult;
|
|
1835
|
+
|
|
1836
|
+
interface VirtualizedSlidesOptions {
|
|
1837
|
+
/** Total number of slide items. */
|
|
1838
|
+
totalItems: number;
|
|
1839
|
+
/** Estimated height of each slide item in pixels. */
|
|
1840
|
+
itemHeight: number;
|
|
1841
|
+
/** Number of extra items to render above/below the viewport. */
|
|
1842
|
+
overscan?: number;
|
|
1843
|
+
}
|
|
1844
|
+
interface VirtualizedRange {
|
|
1845
|
+
/** The first index to render (inclusive). */
|
|
1846
|
+
startIndex: number;
|
|
1847
|
+
/** The last index to render (inclusive). */
|
|
1848
|
+
endIndex: number;
|
|
1849
|
+
/** Total height of the virtual container (for scrollbar sizing). */
|
|
1850
|
+
totalHeight: number;
|
|
1851
|
+
/** Offset (top padding) to position the rendered window correctly. */
|
|
1852
|
+
offsetY: number;
|
|
1853
|
+
/** The visible range without overscan (for analytics/testing). */
|
|
1854
|
+
visibleRange: {
|
|
1855
|
+
start: number;
|
|
1856
|
+
end: number;
|
|
1857
|
+
};
|
|
1858
|
+
}
|
|
1859
|
+
interface VirtualizedSlidesResult extends VirtualizedRange {
|
|
1860
|
+
/** Ref to attach to the scroll container element. */
|
|
1861
|
+
scrollContainerRef: React.RefObject<HTMLDivElement | null>;
|
|
1862
|
+
/** Call this to scroll a specific index into view. */
|
|
1863
|
+
scrollToIndex: (index: number, behavior?: ScrollBehavior) => void;
|
|
1864
|
+
}
|
|
1865
|
+
/**
|
|
1866
|
+
* Compute the rendered index range given scroll state and item dimensions.
|
|
1867
|
+
*
|
|
1868
|
+
* This is a pure function with no React or DOM dependencies so it can
|
|
1869
|
+
* be unit-tested without `renderHook` or a DOM environment.
|
|
1870
|
+
*/
|
|
1871
|
+
declare function computeVirtualRange(totalItems: number, itemHeight: number, scrollTop: number, viewportHeight: number, overscan?: number): VirtualizedRange;
|
|
1872
|
+
declare function useVirtualizedSlides({ totalItems, itemHeight, overscan, }: VirtualizedSlidesOptions): VirtualizedSlidesResult;
|
|
1873
|
+
|
|
1874
|
+
/** Minimum touch target size (px) per WCAG accessibility guidelines. */
|
|
1875
|
+
declare const MIN_TOUCH_TARGET = 44;
|
|
1876
|
+
interface UseIsMobileResult {
|
|
1877
|
+
/** True when container/viewport width is below 768px. */
|
|
1878
|
+
isMobile: boolean;
|
|
1879
|
+
/** True when container/viewport width is 768..1023px. */
|
|
1880
|
+
isTablet: boolean;
|
|
1881
|
+
/** True when container/viewport width is >= 1024px. */
|
|
1882
|
+
isDesktop: boolean;
|
|
1883
|
+
/** True on devices with touch capability. */
|
|
1884
|
+
isTouchDevice: boolean;
|
|
1885
|
+
/** Current device orientation (portrait or landscape). */
|
|
1886
|
+
orientation: DeviceOrientation;
|
|
1887
|
+
/** True when the virtual keyboard is likely visible (viewport height shrank significantly). */
|
|
1888
|
+
isVirtualKeyboardOpen: boolean;
|
|
1889
|
+
/** The measured container width in pixels. */
|
|
1890
|
+
containerWidth: number;
|
|
1891
|
+
}
|
|
1892
|
+
interface UseIsMobileInput {
|
|
1893
|
+
/** Optional ref to the container element for container-based breakpoints. */
|
|
1894
|
+
containerRef?: React.RefObject<HTMLElement | null>;
|
|
1895
|
+
}
|
|
1896
|
+
declare function useIsMobile(input?: UseIsMobileInput): UseIsMobileResult;
|
|
1897
|
+
|
|
1898
|
+
interface UseTouchGesturesInput {
|
|
1899
|
+
/** The element to attach touch listeners to. */
|
|
1900
|
+
targetRef: React.RefObject<HTMLElement | null>;
|
|
1901
|
+
/** Current zoom scale: used as the baseline for pinch gestures. */
|
|
1902
|
+
currentScale: number;
|
|
1903
|
+
/** Callbacks for gesture events. */
|
|
1904
|
+
callbacks: TouchGestureCallbacks;
|
|
1905
|
+
/** Set to false to disable all gesture handling. Default: true. */
|
|
1906
|
+
enabled?: boolean;
|
|
1907
|
+
}
|
|
1908
|
+
declare function useTouchGestures(input: UseTouchGesturesInput): void;
|
|
1909
|
+
|
|
1910
|
+
interface UseKeyboardInsetsResult {
|
|
1911
|
+
/** CSS pixels the on-screen keyboard currently covers (0 when closed). */
|
|
1912
|
+
keyboardInset: number;
|
|
1913
|
+
/** True when the inset is large enough to count as an open keyboard. */
|
|
1914
|
+
isKeyboardOpen: boolean;
|
|
1915
|
+
}
|
|
1916
|
+
declare function useKeyboardInsets(enabled?: boolean): UseKeyboardInsetsResult;
|
|
1917
|
+
|
|
1918
|
+
/**
|
|
1919
|
+
* useClipboardHandlers: Copy, cut, paste, duplicate, and delete handlers
|
|
1920
|
+
* extracted from useElementManipulation.
|
|
1921
|
+
*/
|
|
1922
|
+
|
|
1923
|
+
interface ClipboardInput {
|
|
1924
|
+
activeSlide: l | undefined;
|
|
1925
|
+
activeSlideIndex: number;
|
|
1926
|
+
selectedElement: P | null;
|
|
1927
|
+
effectiveSelectedIds: string[];
|
|
1928
|
+
editTemplateMode: boolean;
|
|
1929
|
+
clipboardPayload: {
|
|
1930
|
+
element: P;
|
|
1931
|
+
isTemplate: boolean;
|
|
1932
|
+
} | null;
|
|
1933
|
+
setClipboardPayload: React.Dispatch<React.SetStateAction<{
|
|
1934
|
+
element: P;
|
|
1935
|
+
isTemplate: boolean;
|
|
1936
|
+
} | null>>;
|
|
1937
|
+
ops: ElementOperations;
|
|
1938
|
+
history: EditorHistoryResult;
|
|
1939
|
+
}
|
|
1940
|
+
declare function useClipboardHandlers(input: ClipboardInput): ClipboardHandlers;
|
|
1941
|
+
|
|
1942
|
+
interface UseDerivedElementStateInput {
|
|
1943
|
+
slides: l[];
|
|
1944
|
+
activeSlideIndex: number;
|
|
1945
|
+
templateElementsBySlideId: Record<string, P[]>;
|
|
1946
|
+
selectedElementId: string | null;
|
|
1947
|
+
selectedElementIds: string[];
|
|
1948
|
+
slideMasters: A[];
|
|
1949
|
+
activeMasterIndex: number;
|
|
1950
|
+
activeLayoutIndex: number | null;
|
|
1951
|
+
notesMaster: y | undefined;
|
|
1952
|
+
handoutMaster: z | undefined;
|
|
1953
|
+
}
|
|
1954
|
+
interface DerivedElementState {
|
|
1955
|
+
activeSlide: l | undefined;
|
|
1956
|
+
templateElements: P[];
|
|
1957
|
+
elementLookup: Map<string, P>;
|
|
1958
|
+
selectedElement: P | null;
|
|
1959
|
+
effectiveSelectedIds: string[];
|
|
1960
|
+
selectedElementIdSet: Set<string>;
|
|
1961
|
+
selectedElements: P[];
|
|
1962
|
+
activeMaster: A | undefined;
|
|
1963
|
+
activeLayout: B | undefined;
|
|
1964
|
+
masterViewElements: P[];
|
|
1965
|
+
notesMasterElements: P[];
|
|
1966
|
+
handoutMasterElements: P[];
|
|
1967
|
+
}
|
|
1968
|
+
declare function useDerivedElementState(input: UseDerivedElementStateInput): DerivedElementState;
|
|
1969
|
+
|
|
1970
|
+
interface UseDialogCustomShowsInput {
|
|
1971
|
+
activeSlide: l | undefined;
|
|
1972
|
+
customShows: Array<{
|
|
1973
|
+
id: string;
|
|
1974
|
+
name: string;
|
|
1975
|
+
slideRIds: string[];
|
|
1976
|
+
}>;
|
|
1977
|
+
activeCustomShowId: string | null;
|
|
1978
|
+
setCustomShows: React.Dispatch<React.SetStateAction<Array<{
|
|
1979
|
+
id: string;
|
|
1980
|
+
name: string;
|
|
1981
|
+
slideRIds: string[];
|
|
1982
|
+
}>>>;
|
|
1983
|
+
setActiveCustomShowId: React.Dispatch<React.SetStateAction<string | null>>;
|
|
1984
|
+
history: EditorHistoryResult;
|
|
1985
|
+
}
|
|
1986
|
+
interface UseDialogCustomShowsResult {
|
|
1987
|
+
handleCreateCustomShow: () => void;
|
|
1988
|
+
handleRenameActiveCustomShow: () => void;
|
|
1989
|
+
handleDeleteActiveCustomShow: () => void;
|
|
1990
|
+
handleToggleCurrentSlideInActiveShow: () => void;
|
|
1991
|
+
isCurrentSlideInActiveShow: boolean;
|
|
1992
|
+
}
|
|
1993
|
+
declare function useDialogCustomShows(input: UseDialogCustomShowsInput): UseDialogCustomShowsResult;
|
|
1994
|
+
|
|
1995
|
+
interface UseExportSaveAsInput {
|
|
1996
|
+
slides: l[];
|
|
1997
|
+
/** Separated master/layout (template) elements, merged back at save time. */
|
|
1998
|
+
templateElementsBySlideId: Record<string, P[]>;
|
|
1999
|
+
filePath: string | undefined;
|
|
2000
|
+
handlerRef: RefObject<PptxHandler | null>;
|
|
2001
|
+
serializeSlides: () => Promise<Uint8Array | null>;
|
|
2002
|
+
headerFooter: Record<string, unknown>;
|
|
2003
|
+
presentationProperties: Record<string, unknown>;
|
|
2004
|
+
customShows: Array<{
|
|
2005
|
+
id: string;
|
|
2006
|
+
name: string;
|
|
2007
|
+
slideRIds: string[];
|
|
2008
|
+
}>;
|
|
2009
|
+
sections: Array<{
|
|
2010
|
+
id: string;
|
|
2011
|
+
name: string;
|
|
2012
|
+
color?: string;
|
|
2013
|
+
collapsed?: boolean;
|
|
2014
|
+
}>;
|
|
2015
|
+
coreProperties: Record<string, unknown> | null;
|
|
2016
|
+
appProperties: Record<string, unknown> | null;
|
|
2017
|
+
customProperties: Array<Record<string, unknown>>;
|
|
2018
|
+
notesMaster: Record<string, unknown> | undefined;
|
|
2019
|
+
handoutMaster: Record<string, unknown> | undefined;
|
|
2020
|
+
guides: Array<{
|
|
2021
|
+
id: string;
|
|
2022
|
+
axis: 'h' | 'v';
|
|
2023
|
+
position: number;
|
|
2024
|
+
}>;
|
|
2025
|
+
activeSlideIndexForGuides: number;
|
|
2026
|
+
modalControls: ExportModalControls;
|
|
2027
|
+
password?: string;
|
|
2028
|
+
}
|
|
2029
|
+
interface ExportSaveAsResult {
|
|
2030
|
+
handlePackageForSharing: () => Promise<void>;
|
|
2031
|
+
handleSaveAsFormat: (format: PptxSaveFormat) => Promise<void>;
|
|
2032
|
+
handleSaveAsPptx: () => void;
|
|
2033
|
+
handleSaveAsPpsx: () => void;
|
|
2034
|
+
handleSaveAsPptm: () => void;
|
|
2035
|
+
}
|
|
2036
|
+
declare function useExportSaveAs(input: UseExportSaveAsInput): ExportSaveAsResult;
|
|
2037
|
+
|
|
2038
|
+
interface UseFontInjectionInput {
|
|
2039
|
+
embeddedFonts: K[];
|
|
2040
|
+
slides: l[];
|
|
2041
|
+
}
|
|
2042
|
+
declare function useFontInjection({ embeddedFonts, slides }: UseFontInjectionInput): void;
|
|
2043
|
+
|
|
2044
|
+
/**
|
|
2045
|
+
* useGroupAlignLayerHandlers: Group/ungroup, flip, alignment,
|
|
2046
|
+
* layer-order, and merge shapes handlers extracted from useElementManipulation.
|
|
2047
|
+
*/
|
|
2048
|
+
|
|
2049
|
+
interface GroupAlignLayerInput {
|
|
2050
|
+
activeSlide: l | undefined;
|
|
2051
|
+
activeSlideIndex: number;
|
|
2052
|
+
selectedElement: P | null;
|
|
2053
|
+
effectiveSelectedIds: string[];
|
|
2054
|
+
selectedElements: P[];
|
|
2055
|
+
elementLookup: Map<string, P>;
|
|
2056
|
+
setSelectedElementIds: React.Dispatch<React.SetStateAction<string[]>>;
|
|
2057
|
+
ops: ElementOperations;
|
|
2058
|
+
history: EditorHistoryResult;
|
|
2059
|
+
}
|
|
2060
|
+
declare function useGroupAlignLayerHandlers(input: GroupAlignLayerInput): GroupAlignLayerHandlers;
|
|
2061
|
+
|
|
2062
|
+
interface UseKeyboardShortcutsInput {
|
|
2063
|
+
/** Container element ref: used to scope the listener. */
|
|
2064
|
+
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
2065
|
+
mode: ViewerMode;
|
|
2066
|
+
canEdit: boolean;
|
|
2067
|
+
/** Whether any element is currently being inline-edited (text box). */
|
|
2068
|
+
inlineEditingElementId: string | null;
|
|
2069
|
+
/** Whether a table cell is being edited. */
|
|
2070
|
+
tableEditorState: TableCellEditorState | null;
|
|
2071
|
+
/** Current drawing tool: shortcuts are suppressed when drawing. */
|
|
2072
|
+
activeTool: DrawingTool;
|
|
2073
|
+
/** Whether at least one element is selected. */
|
|
2074
|
+
hasSelection: boolean;
|
|
2075
|
+
/** The IDs of the currently selected elements (effective). */
|
|
2076
|
+
effectiveSelectedIds: string[];
|
|
2077
|
+
onDelete: () => void;
|
|
2078
|
+
onCopy: () => void;
|
|
2079
|
+
onCut: () => void;
|
|
2080
|
+
onPaste: () => void;
|
|
2081
|
+
onDuplicate: () => void;
|
|
2082
|
+
onUndo: () => void;
|
|
2083
|
+
onRedo: () => void;
|
|
2084
|
+
onSelectAll: () => void;
|
|
2085
|
+
onEscape: () => void;
|
|
2086
|
+
/** Move selected elements by (dx, dy). */
|
|
2087
|
+
onNudge: (dx: number, dy: number) => void;
|
|
2088
|
+
/** Navigate to previous visible slide (edit mode, no selection). */
|
|
2089
|
+
onPrevSlide?: () => void;
|
|
2090
|
+
/** Navigate to next visible slide (edit mode, no selection). */
|
|
2091
|
+
onNextSlide?: () => void;
|
|
2092
|
+
}
|
|
2093
|
+
declare function useKeyboardShortcuts(input: UseKeyboardShortcutsInput): void;
|
|
2094
|
+
|
|
2095
|
+
/** Input for the merge shapes handler. */
|
|
2096
|
+
interface MergeShapesHandlerInput {
|
|
2097
|
+
activeSlide: l | undefined;
|
|
2098
|
+
activeSlideIndex: number;
|
|
2099
|
+
selectedElements: P[];
|
|
2100
|
+
effectiveSelectedIds: string[];
|
|
2101
|
+
setSelectedElementIds: React.Dispatch<React.SetStateAction<string[]>>;
|
|
2102
|
+
ops: ElementOperations;
|
|
2103
|
+
history: EditorHistoryResult;
|
|
2104
|
+
}
|
|
2105
|
+
/** Handlers returned by the merge shapes hook. */
|
|
2106
|
+
interface MergeShapesHandlers {
|
|
2107
|
+
handleMergeShapes: (operation: MergeShapeOperation) => void;
|
|
2108
|
+
canMergeShapes: boolean;
|
|
2109
|
+
}
|
|
2110
|
+
declare function useMergeShapesHandler(input: MergeShapesHandlerInput): MergeShapesHandlers;
|
|
2111
|
+
|
|
2112
|
+
interface ResizablePanelSizes {
|
|
2113
|
+
leftWidth: number;
|
|
2114
|
+
rightWidth: number;
|
|
2115
|
+
bottomHeight: number;
|
|
2116
|
+
}
|
|
2117
|
+
interface UseResizablePanelsResult extends ResizablePanelSizes {
|
|
2118
|
+
onResizeLeft: (delta: number) => void;
|
|
2119
|
+
onResizeRight: (delta: number) => void;
|
|
2120
|
+
onResizeBottom: (delta: number) => void;
|
|
2121
|
+
}
|
|
2122
|
+
declare function useResizablePanels(): UseResizablePanelsResult;
|
|
2123
|
+
|
|
2124
|
+
interface UseSwipeNavigationInput {
|
|
2125
|
+
/** Whether swipe navigation is active. */
|
|
2126
|
+
enabled: boolean;
|
|
2127
|
+
/** Advance to the next slide (swipe left). */
|
|
2128
|
+
onNext: () => void;
|
|
2129
|
+
/** Go to the previous slide (swipe right). */
|
|
2130
|
+
onPrev: () => void;
|
|
2131
|
+
}
|
|
2132
|
+
interface UseSwipeNavigationResult {
|
|
2133
|
+
onTouchStart: (e: React__default.TouchEvent) => void;
|
|
2134
|
+
onTouchEnd: (e: React__default.TouchEvent) => void;
|
|
2135
|
+
}
|
|
2136
|
+
declare function useSwipeNavigation(input: UseSwipeNavigationInput): UseSwipeNavigationResult;
|
|
2137
|
+
|
|
2138
|
+
interface UseAnimationPlaybackInput {
|
|
2139
|
+
slides: l[];
|
|
2140
|
+
onPlayActionSound?: (soundPath: string) => void;
|
|
2141
|
+
/** When false, all animations are skipped (elements shown immediately). */
|
|
2142
|
+
showWithAnimation?: boolean;
|
|
2143
|
+
}
|
|
2144
|
+
interface UseAnimationPlaybackResult {
|
|
2145
|
+
presentationAnimations: PresentationAnimationRuntime[];
|
|
2146
|
+
presentationElementStates: Map<string, ElementAnimationState>;
|
|
2147
|
+
presentationKeyframesCss: string;
|
|
2148
|
+
interactiveTriggerShapeIds: ReadonlySet<string>;
|
|
2149
|
+
hoverTriggerShapeIds: ReadonlySet<string>;
|
|
2150
|
+
clearPresentationTimers: () => void;
|
|
2151
|
+
playNextAnimationGroup: () => boolean;
|
|
2152
|
+
handleInteractiveShapeClick: (shapeId: string) => boolean;
|
|
2153
|
+
handleHoverStart: (shapeId: string) => boolean;
|
|
2154
|
+
handleHoverEnd: (shapeId: string) => void;
|
|
2155
|
+
runPresentationEntranceAnimations: (slideIndex: number) => void;
|
|
2156
|
+
/** Exposed so the orchestrator can schedule additional timers (e.g. auto-advance). */
|
|
2157
|
+
presentationTimersRef: React.RefObject<number[]>;
|
|
2158
|
+
}
|
|
2159
|
+
declare function useAnimationPlayback(input: UseAnimationPlaybackInput): UseAnimationPlaybackResult;
|
|
2160
|
+
|
|
2161
|
+
interface UseRehearsalTimingsInput {
|
|
2162
|
+
containerRef: React.RefObject<HTMLElement | null>;
|
|
2163
|
+
onSetMode: (mode: ViewerMode) => void;
|
|
2164
|
+
onSaveRehearsalTimings?: (timings: Record<number, number>) => void;
|
|
2165
|
+
setPresentationStartTime: (time: number | null) => void;
|
|
2166
|
+
setPresenterMode: (mode: boolean) => void;
|
|
2167
|
+
}
|
|
2168
|
+
interface UseRehearsalTimingsResult {
|
|
2169
|
+
rehearsing: boolean;
|
|
2170
|
+
setRehearsing: React.Dispatch<React.SetStateAction<boolean>>;
|
|
2171
|
+
recordedTimings: Record<number, number>;
|
|
2172
|
+
slideStartTime: number | null;
|
|
2173
|
+
showRehearsalSummary: boolean;
|
|
2174
|
+
setShowRehearsalSummary: React.Dispatch<React.SetStateAction<boolean>>;
|
|
2175
|
+
rehearsalPaused: boolean;
|
|
2176
|
+
recordCurrentSlideTime: (slideIndex: number) => void;
|
|
2177
|
+
dismissRehearsalSummary: () => void;
|
|
2178
|
+
saveRehearsalTimings: () => void;
|
|
2179
|
+
enterRehearsalMode: () => void;
|
|
2180
|
+
toggleRehearsalPause: () => void;
|
|
2181
|
+
}
|
|
2182
|
+
declare function useRehearsalTimings(input: UseRehearsalTimingsInput): UseRehearsalTimingsResult;
|
|
2183
|
+
|
|
2184
|
+
interface UsePresentationKeyboardInput {
|
|
2185
|
+
mode: ViewerMode;
|
|
2186
|
+
movePresentationSlide: (direction: 1 | -1) => void;
|
|
2187
|
+
onSetMode: (mode: ViewerMode) => void;
|
|
2188
|
+
onToggleLaser?: () => void;
|
|
2189
|
+
onTogglePen?: () => void;
|
|
2190
|
+
onToggleEraser?: () => void;
|
|
2191
|
+
onToggleToolbar?: () => void;
|
|
2192
|
+
/** Toggle between presenter view (split-screen with notes) and fullscreen. */
|
|
2193
|
+
onTogglePresenterView?: () => void;
|
|
2194
|
+
rehearsing: boolean;
|
|
2195
|
+
recordCurrentSlideTime: (slideIndex: number) => void;
|
|
2196
|
+
presentationSlideIndex: number;
|
|
2197
|
+
setShowRehearsalSummary: (value: boolean) => void;
|
|
2198
|
+
}
|
|
2199
|
+
/**
|
|
2200
|
+
* Registers keyboard shortcuts for presentation mode: arrow/space
|
|
2201
|
+
* for slide navigation, Escape to exit, and annotation tool toggles.
|
|
2202
|
+
*/
|
|
2203
|
+
declare function usePresentationKeyboard(input: UsePresentationKeyboardInput): void;
|
|
2204
|
+
|
|
2205
|
+
interface UseSlideNavigationInput {
|
|
2206
|
+
slides: l[];
|
|
2207
|
+
visibleSlideIndexes: number[];
|
|
2208
|
+
presentationSlideIndex: number;
|
|
2209
|
+
setPresentationSlideIndex: (index: number) => void;
|
|
2210
|
+
setPresentationSlideVisible: (visible: boolean) => void;
|
|
2211
|
+
setTransitionOverlay: (state: PresentationTransitionOverlayState | null) => void;
|
|
2212
|
+
onSetMode: (mode: ViewerMode) => void;
|
|
2213
|
+
onSetActiveSlideIndex: (index: number) => void;
|
|
2214
|
+
onPlayActionSound?: (soundPath: string) => void;
|
|
2215
|
+
loopContinuously?: boolean;
|
|
2216
|
+
/** Whether to use rehearsed auto-advance timings. When false, slides advance only on click. */
|
|
2217
|
+
useTimings?: boolean;
|
|
2218
|
+
playNextAnimationGroup: () => boolean;
|
|
2219
|
+
clearPresentationTimers: () => void;
|
|
2220
|
+
runPresentationEntranceAnimations: (slideIndex: number) => void;
|
|
2221
|
+
presentationTimersRef: {
|
|
2222
|
+
current: number[];
|
|
2223
|
+
};
|
|
2224
|
+
rehearsing: boolean;
|
|
2225
|
+
recordCurrentSlideTime: (slideIndex: number) => void;
|
|
2226
|
+
setShowRehearsalSummary: (value: boolean) => void;
|
|
2227
|
+
}
|
|
2228
|
+
interface UseSlideNavigationResult {
|
|
2229
|
+
movePresentationSlide: (direction: 1 | -1) => void;
|
|
2230
|
+
navigateToSlide: (slideIndex: number) => void;
|
|
2231
|
+
handlePresentationAction: (action: a2) => void;
|
|
2232
|
+
scheduleAutoAdvanceForSlide: (slideIndex: number) => void;
|
|
2233
|
+
}
|
|
2234
|
+
declare function useSlideNavigation(input: UseSlideNavigationInput): UseSlideNavigationResult;
|
|
2235
|
+
|
|
2236
|
+
/**
|
|
2237
|
+
* Input for the useZoomNavigation sub-hook.
|
|
2238
|
+
*/
|
|
2239
|
+
interface UseZoomNavigationInput {
|
|
2240
|
+
/** Navigate to a specific slide index. */
|
|
2241
|
+
navigateToSlide: (slideIndex: number) => void;
|
|
2242
|
+
}
|
|
2243
|
+
/**
|
|
2244
|
+
* Return type for the useZoomNavigation sub-hook.
|
|
2245
|
+
*/
|
|
2246
|
+
interface UseZoomNavigationResult {
|
|
2247
|
+
/**
|
|
2248
|
+
* Handle a zoom element click. Navigates to the target slide and
|
|
2249
|
+
* stores the return slide index so we can go back later.
|
|
2250
|
+
*/
|
|
2251
|
+
handleZoomClick: (targetSlideIndex: number, returnSlideIndex: number) => void;
|
|
2252
|
+
/**
|
|
2253
|
+
* The slide index to return to after a zoom navigation, or `null` if
|
|
2254
|
+
* there is no pending return.
|
|
2255
|
+
*/
|
|
2256
|
+
zoomReturnSlideIndex: React.RefObject<number | null>;
|
|
2257
|
+
/**
|
|
2258
|
+
* Navigate back to the zoom summary slide (if a return index is set).
|
|
2259
|
+
* Returns `true` if navigation occurred, `false` otherwise.
|
|
2260
|
+
*/
|
|
2261
|
+
returnToZoomSlide: () => boolean;
|
|
2262
|
+
/**
|
|
2263
|
+
* Clear the stored return index (e.g. when the user manually navigates
|
|
2264
|
+
* away from the zoomed section).
|
|
2265
|
+
*/
|
|
2266
|
+
clearZoomReturn: () => void;
|
|
2267
|
+
}
|
|
2268
|
+
/**
|
|
2269
|
+
* Sub-hook that manages zoom element navigation in presentation mode.
|
|
2270
|
+
*
|
|
2271
|
+
* When a zoom element is clicked, this hook:
|
|
2272
|
+
* 1. Navigates to the target slide
|
|
2273
|
+
* 2. Stores the "return" slide index
|
|
2274
|
+
*
|
|
2275
|
+
* The caller can later use `returnToZoomSlide()` to navigate back to
|
|
2276
|
+
* the summary zoom slide.
|
|
2277
|
+
*/
|
|
2278
|
+
declare function useZoomNavigation(input: UseZoomNavigationInput): UseZoomNavigationResult;
|
|
2279
|
+
|
|
2280
|
+
interface UseAudienceModeInput {
|
|
2281
|
+
mode: ViewerMode;
|
|
2282
|
+
onSetMode: (mode: ViewerMode) => void;
|
|
2283
|
+
onSetActiveSlideIndex: (index: number) => void;
|
|
2284
|
+
containerRef: React.RefObject<HTMLElement | null>;
|
|
2285
|
+
}
|
|
2286
|
+
/**
|
|
2287
|
+
* When the page was opened with the `#pptx-audience` hash, this hook:
|
|
2288
|
+
* 1. Auto-enters fullscreen presentation mode after content loads
|
|
2289
|
+
* 2. Listens on BroadcastChannel for slide-change messages from the presenter
|
|
2290
|
+
* 3. Exits presentation mode when the presenter sends an exit signal
|
|
2291
|
+
*/
|
|
2292
|
+
declare function useAudienceMode(input: UseAudienceModeInput): void;
|
|
2293
|
+
|
|
2294
|
+
export { type AnnotationHandlersResult, type AnnotationStroke, type AutosaveStatus, type CanvasInteractionHandlers, CollaborationConfig, CollaborationContextValue, type ContentLifecycleResult, type DerivedElementState, type DerivedSlideState, DeviceOrientation, type EditorHistoryInput, type EditorHistoryResult, type EditorOperationsResult, type ElementManipulationHandlers, type ElementOperations, type ExportHandlersResult, type ExportSaveAsResult, type IOHandlersResult, type InsertElementHandlers, type LayoutSwitchingResult, MIN_TOUCH_TARGET, type MergeShapesHandlerInput, type MergeShapesHandlers, type ModalDismissDrag, type ModalDismissDragHandlers, type PresentationSetupResult, type PresentationTool, type PrintHandlersResult, type PropertyHandlersResult, type SectionOperations, type SheetDismissDrag, type SheetDismissDragHandlers, type SlideManagementHandlers, type TableOperationHandlers, type ThemeHandlersResult, TouchGestureCallbacks, type UseAnimationPlaybackInput, type UseAnimationPlaybackResult, type UseAnnotationHandlersInput, type UseAutosaveInput, type UseAutosaveResult, type UseBroadcastFollowerInput, type UseCanvasInteractionsInput, type UseContentLifecycleInput, type UseDerivedElementStateInput, type UseDerivedSlideStateInput, type UseDialogCustomShowsInput, type UseDialogCustomShowsResult, type UseEditorOperationsInput, type UseElementManipulationInput, type UseElementOperationsInput, type UseExportHandlersInput, type UseExportSaveAsInput, type UseFollowModeInput, type UseFollowModeResult, type UseFontInjectionInput, type UseIOHandlersInput, type UseInsertElementsInput, type UseIsMobileInput, type UseIsMobileResult, type UseKeyboardInsetsResult, type UseKeyboardShortcutWiringInput, type UseKeyboardShortcutsInput, type UseLayoutSwitchingInput, type UseLoadContentInput, type UseLoadContentResult, type UsePointerHandlersInput, type UsePresentationAnnotationsResult, type UsePresentationSetupInput, type UsePrintHandlersInput, type UsePropertyHandlersInput, type UseRecoveryDetectionInput, type UseReducedMotionResult, type UseRehearsalTimingsInput, type UseRehearsalTimingsResult, type UseResizablePanelsResult, type UseSectionOperationsInput, type UseSerializeInput, type UseSlideManagementInput, type UseSlideNavigationInput, type UseSlideNavigationResult, type UseSwipeNavigationInput, type UseSwipeNavigationResult, type UseTableOperationsInput, type UseThemeHandlersInput, type UseTouchGesturesInput, type UseViewerCoreStateInput, type UseViewerDialogsInput, type UseViewerIntegrationInput, type UseViewerStateInput, type UseYjsDocumentSyncInput, type UseZoomNavigationInput, type UseZoomNavigationResult, type ViewerCoreState, type ViewerDialogsResult, type ViewerIntegrationResult, type ViewerState, type ViewerUIState, type VirtualizedRange, type VirtualizedSlidesOptions, type VirtualizedSlidesResult, computeVirtualRange, useAnimationPlayback, useAnnotationHandlers, useAudienceMode, useAutosave, useBroadcastFollower, useCanvasInteractions, useClipboardHandlers, useComments, useContentLifecycle, useDerivedElementState, useDerivedSlideState, useDialogCustomShows, useEditorHistory, useEditorOperations, useElementManipulation, useElementOperations, useExportHandlers, useExportSaveAs, useFindReplace, useFollowMode, useFontInjection, useGroupAlignLayerHandlers, useIOHandlers, useInsertElements, useIsMobile, useKeyboardInsets, useKeyboardShortcutWiring, useKeyboardShortcuts, useLayoutSwitching, useLoadContent, useMergeShapesHandler, useModalDismissDrag, usePointerHandlers, usePresentationAnnotations, usePresentationKeyboard, usePresentationMode, usePresentationSetup, usePrintHandlers, usePropertyHandlers, useRecoveryDetection, useReducedMotion, useRehearsalTimings, useResizablePanels, useSectionOperations, useSerialize, useSheetDismissDrag, useSlideManagement, useSlideNavigation, useSwipeNavigation, useTableOperations, useThemeHandlers, useTouchGestures, useViewerCoreState, useViewerDialogs, useViewerIntegration, useViewerState, useViewerUIState, useVirtualizedSlides, useYjsDocumentSync, useZoomNavigation, useZoomViewport };
|