pptx-react-viewer 4.26.0 → 4.27.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 +36 -0
- package/dist/{AiChatPanel-TIJ3MRTR.mjs → AiChatPanel-3J6XGIJ4.mjs} +3 -7
- package/dist/AiChatPanel-3J6XGIJ4.mjs.br +0 -0
- package/dist/AiChatPanel-3J6XGIJ4.mjs.gz +0 -0
- package/dist/{AiChatPanel-PGZDMW4M.js → AiChatPanel-EGTSK4T5.js} +27 -31
- package/dist/AiChatPanel-EGTSK4T5.js.br +0 -0
- package/dist/AiChatPanel-EGTSK4T5.js.gz +0 -0
- package/dist/{Model3DScene-SJGIK2TB.mjs → Model3DScene-2V2GQ6FY.mjs} +2 -2
- package/dist/Model3DScene-2V2GQ6FY.mjs.br +0 -0
- package/dist/Model3DScene-2V2GQ6FY.mjs.gz +0 -0
- package/dist/{Model3DScene-LQBTZGVN.js → Model3DScene-Q3XEZSWV.js} +3 -3
- package/dist/Model3DScene-Q3XEZSWV.js.br +2 -0
- package/dist/Model3DScene-Q3XEZSWV.js.gz +0 -0
- package/dist/{UTIF-CNNXS5Z5.mjs → UTIF-RPFRSSC5.mjs} +3 -3
- package/dist/UTIF-RPFRSSC5.mjs.br +0 -0
- package/dist/UTIF-RPFRSSC5.mjs.gz +0 -0
- package/dist/{UTIF-6SHLXCNF.js → UTIF-XWCKRN6V.js} +21 -21
- package/dist/UTIF-XWCKRN6V.js.br +0 -0
- package/dist/UTIF-XWCKRN6V.js.gz +0 -0
- package/dist/{chunk-K564H64A.mjs → chunk-34AXBLYH.mjs} +51 -104
- package/dist/chunk-34AXBLYH.mjs.br +0 -0
- package/dist/chunk-34AXBLYH.mjs.gz +0 -0
- package/dist/{chunk-ZW2WNQN7.js → chunk-5RQTZ376.js} +1207 -1185
- package/dist/chunk-5RQTZ376.js.br +0 -0
- package/dist/chunk-5RQTZ376.js.gz +0 -0
- package/dist/{chunk-XGB3TDIC.mjs → chunk-6DZX6EAA.mjs} +1 -5
- package/dist/chunk-6DZX6EAA.mjs.br +0 -0
- package/dist/chunk-6DZX6EAA.mjs.gz +0 -0
- package/dist/{chunk-PW3YOZFA.js → chunk-MQCBMO6A.js} +909 -923
- package/dist/chunk-MQCBMO6A.js.br +0 -0
- package/dist/chunk-MQCBMO6A.js.gz +0 -0
- package/dist/{chunk-4VNS5WPM.js → chunk-QGM4M3NI.js} +0 -5
- package/dist/chunk-QGM4M3NI.js.br +0 -0
- package/dist/chunk-QGM4M3NI.js.gz +0 -0
- package/dist/{chunk-UHW3R465.js → chunk-TYJZJJZ6.mjs} +13071 -119039
- package/dist/chunk-TYJZJJZ6.mjs.br +0 -0
- package/dist/chunk-TYJZJJZ6.mjs.gz +0 -0
- package/dist/{chunk-LCWNHXHZ.mjs → chunk-WK6JBJCT.js} +13439 -117785
- package/dist/chunk-WK6JBJCT.js.br +0 -0
- package/dist/chunk-WK6JBJCT.js.gz +0 -0
- package/dist/{chunk-QJNZZBVF.mjs → chunk-ZK7UEEXE.mjs} +71 -92
- package/dist/chunk-ZK7UEEXE.mjs.br +0 -0
- package/dist/chunk-ZK7UEEXE.mjs.gz +0 -0
- package/dist/i18n.d.ts +1 -46
- package/dist/i18n.js +5 -5
- package/dist/i18n.js.br +2 -2
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +2 -2
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +11 -3703
- package/dist/index.js +96 -97
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -7
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +5 -3847
- package/dist/internals.js +114 -115
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -5
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/{chunk-NJYF5KTY.mjs → three.module-A6ACXOES.mjs} +2 -0
- package/dist/three.module-A6ACXOES.mjs.br +0 -0
- package/dist/three.module-A6ACXOES.mjs.gz +0 -0
- package/dist/{chunk-QS3GAPPA.js → three.module-IORLGCSX.js} +2 -0
- package/dist/three.module-IORLGCSX.js.br +0 -0
- package/dist/three.module-IORLGCSX.js.gz +0 -0
- package/dist/viewer/index.d.ts +12 -2633
- package/dist/viewer/index.js +35 -37
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -7
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/dist/{y-webrtc-F2H7BRUK.js → y-webrtc-6LID3XZO.js} +5 -5
- package/dist/y-webrtc-6LID3XZO.js.br +0 -0
- package/dist/y-webrtc-6LID3XZO.js.gz +0 -0
- package/dist/{y-webrtc-GAHCEZSS.mjs → y-webrtc-F5IA7T5S.mjs} +1 -1
- package/dist/y-webrtc-F5IA7T5S.mjs.br +0 -0
- package/dist/y-webrtc-F5IA7T5S.mjs.gz +0 -0
- package/dist/{y-websocket-FBMB63F4.js → y-websocket-HOY2HFMH.js} +1 -1
- package/dist/y-websocket-HOY2HFMH.js.br +0 -0
- package/dist/y-websocket-HOY2HFMH.js.gz +0 -0
- package/dist/{y-websocket-MAGDFVLN.mjs → y-websocket-VGLBV2HJ.mjs} +1 -1
- package/dist/y-websocket-VGLBV2HJ.mjs.br +0 -0
- package/dist/y-websocket-VGLBV2HJ.mjs.gz +0 -0
- package/package.json +3 -4
- package/dist/AiChatPanel-PGZDMW4M.js.br +0 -0
- package/dist/AiChatPanel-PGZDMW4M.js.gz +0 -0
- package/dist/AiChatPanel-TIJ3MRTR.mjs.br +0 -0
- package/dist/AiChatPanel-TIJ3MRTR.mjs.gz +0 -0
- package/dist/GLTFLoader-O7FNKCHG.mjs +0 -2649
- package/dist/GLTFLoader-O7FNKCHG.mjs.br +0 -0
- package/dist/GLTFLoader-O7FNKCHG.mjs.gz +0 -0
- package/dist/GLTFLoader-UM56GMCK.js +0 -2651
- package/dist/GLTFLoader-UM56GMCK.js.br +0 -0
- package/dist/GLTFLoader-UM56GMCK.js.gz +0 -0
- package/dist/Model3DScene-LQBTZGVN.js.br +0 -0
- package/dist/Model3DScene-LQBTZGVN.js.gz +0 -0
- package/dist/Model3DScene-SJGIK2TB.mjs.br +0 -0
- package/dist/Model3DScene-SJGIK2TB.mjs.gz +0 -0
- package/dist/OrbitControls-EXEHIXFI.js +0 -922
- package/dist/OrbitControls-EXEHIXFI.js.br +0 -0
- package/dist/OrbitControls-EXEHIXFI.js.gz +0 -0
- package/dist/OrbitControls-PZQ4CBVS.mjs +0 -920
- package/dist/OrbitControls-PZQ4CBVS.mjs.br +0 -0
- package/dist/OrbitControls-PZQ4CBVS.mjs.gz +0 -0
- package/dist/UTIF-6SHLXCNF.js.br +0 -0
- package/dist/UTIF-6SHLXCNF.js.gz +0 -0
- package/dist/UTIF-CNNXS5Z5.mjs.br +0 -0
- package/dist/UTIF-CNNXS5Z5.mjs.gz +0 -0
- package/dist/chunk-4VNS5WPM.js.br +0 -0
- package/dist/chunk-4VNS5WPM.js.gz +0 -0
- package/dist/chunk-6HMJTCFO.js +0 -4247
- package/dist/chunk-6HMJTCFO.js.br +0 -0
- package/dist/chunk-6HMJTCFO.js.gz +0 -0
- package/dist/chunk-DKMPRUXL.mjs +0 -22197
- package/dist/chunk-DKMPRUXL.mjs.br +0 -0
- package/dist/chunk-DKMPRUXL.mjs.gz +0 -0
- package/dist/chunk-K564H64A.mjs.br +0 -0
- package/dist/chunk-K564H64A.mjs.gz +0 -0
- package/dist/chunk-LCWNHXHZ.mjs.br +0 -0
- package/dist/chunk-LCWNHXHZ.mjs.gz +0 -0
- package/dist/chunk-NJYF5KTY.mjs.br +0 -0
- package/dist/chunk-NJYF5KTY.mjs.gz +0 -0
- package/dist/chunk-NWZKMLGC.js +0 -22241
- package/dist/chunk-NWZKMLGC.js.br +0 -0
- package/dist/chunk-NWZKMLGC.js.gz +0 -0
- package/dist/chunk-PW3YOZFA.js.br +0 -0
- package/dist/chunk-PW3YOZFA.js.gz +0 -0
- package/dist/chunk-QJNZZBVF.mjs.br +0 -0
- package/dist/chunk-QJNZZBVF.mjs.gz +0 -0
- package/dist/chunk-QS3GAPPA.js.br +0 -0
- package/dist/chunk-QS3GAPPA.js.gz +0 -0
- package/dist/chunk-UHW3R465.js.br +0 -0
- package/dist/chunk-UHW3R465.js.gz +0 -0
- package/dist/chunk-USJXG5TE.mjs +0 -3915
- package/dist/chunk-USJXG5TE.mjs.br +0 -0
- package/dist/chunk-USJXG5TE.mjs.gz +0 -0
- package/dist/chunk-VEVEP7VF.js +0 -3977
- package/dist/chunk-VEVEP7VF.js.br +0 -0
- package/dist/chunk-VEVEP7VF.js.gz +0 -0
- package/dist/chunk-XGB3TDIC.mjs.br +0 -0
- package/dist/chunk-XGB3TDIC.mjs.gz +0 -0
- package/dist/chunk-XLPQM7OJ.mjs +0 -4243
- package/dist/chunk-XLPQM7OJ.mjs.br +0 -0
- package/dist/chunk-XLPQM7OJ.mjs.gz +0 -0
- package/dist/chunk-ZW2WNQN7.js.br +0 -0
- package/dist/chunk-ZW2WNQN7.js.gz +0 -0
- package/dist/smartart-layouts-5T2QZGLG.js +0 -2494
- package/dist/smartart-layouts-5T2QZGLG.js.br +0 -0
- package/dist/smartart-layouts-5T2QZGLG.js.gz +0 -0
- package/dist/smartart-layouts-UCAFYVFW.mjs +0 -2487
- package/dist/smartart-layouts-UCAFYVFW.mjs.br +0 -0
- package/dist/smartart-layouts-UCAFYVFW.mjs.gz +0 -0
- package/dist/three.module-BLHG4FHZ.js +0 -1783
- package/dist/three.module-BLHG4FHZ.js.br +0 -0
- package/dist/three.module-BLHG4FHZ.js.gz +0 -0
- package/dist/three.module-ZSSMKKHW.mjs +0 -2
- package/dist/three.module-ZSSMKKHW.mjs.br +0 -0
- package/dist/three.module-ZSSMKKHW.mjs.gz +0 -0
- package/dist/y-webrtc-F2H7BRUK.js.br +0 -0
- package/dist/y-webrtc-F2H7BRUK.js.gz +0 -0
- package/dist/y-webrtc-GAHCEZSS.mjs.br +0 -0
- package/dist/y-webrtc-GAHCEZSS.mjs.gz +0 -0
- package/dist/y-websocket-FBMB63F4.js.br +0 -0
- package/dist/y-websocket-FBMB63F4.js.gz +0 -0
- package/dist/y-websocket-MAGDFVLN.mjs.br +0 -0
- package/dist/y-websocket-MAGDFVLN.mjs.gz +0 -0
package/dist/viewer/index.d.ts
CHANGED
|
@@ -1,2413 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import * as ooxml_ui_pptx from 'ooxml-ui/pptx';
|
|
2
|
+
import { CollaborationRole, CollaborationConfig, ViewportFitOptions, ViewerFontSource, ViewerTheme, ThemeCatalogEntry, AccountAuthConfig, ToolbarActionId, ViewerCustomization, PowerPointViewerAPI, ViewerCustomizationApi, BorrowedCollaborationAwareness } from 'ooxml-ui/pptx';
|
|
3
|
+
export { CollaborationConfig, CollaborationRole, ElementClipboardPayload, ExternalCollaborationAwareness, ExternalCollaborationSession, ExternalCollaborationSnapshot, SessionDeck, ShapeAdjustmentDragState, ShapeAdjustmentHandleDescriptor, ViewerMode, clearAudienceContent, forgetSessionDeck, getSessionTabId, loadAudienceContent, loadSessionDeck, rememberSessionDeck, restoreSessionDeck, storeAudienceContent } from 'ooxml-ui/pptx';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import React__default, { RefObject } from 'react';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
* All color values accept any valid CSS color string:
|
|
13
|
-
* hex (`#6366f1`), rgb (`rgb(99 102 241)`), hsl (`hsl(239 84% 67%)`),
|
|
14
|
-
* oklch (`oklch(0.585 0.233 277)`), named colors, etc.
|
|
15
|
-
*
|
|
16
|
-
* Framework-agnostic — shared by the React, Vue, and Angular bindings.
|
|
17
|
-
*/
|
|
18
|
-
/**
|
|
19
|
-
* Semantic color tokens for the viewer UI.
|
|
20
|
-
*
|
|
21
|
-
* These map to CSS custom properties (`--pptx-<token>`) and drive all
|
|
22
|
-
* UI component colors. The naming follows the shadcn/ui convention so
|
|
23
|
-
* that Tailwind + shadcn users get a familiar experience.
|
|
24
|
-
*/
|
|
25
|
-
interface ViewerThemeColors {
|
|
26
|
-
/** Page / root background */
|
|
27
|
-
background: string;
|
|
28
|
-
/** Default text color */
|
|
29
|
-
foreground: string;
|
|
30
|
-
/** Card / panel surface */
|
|
31
|
-
card: string;
|
|
32
|
-
/** Text on card surfaces */
|
|
33
|
-
cardForeground: string;
|
|
34
|
-
/** Popover / dropdown surface */
|
|
35
|
-
popover: string;
|
|
36
|
-
/** Text inside popovers */
|
|
37
|
-
popoverForeground: string;
|
|
38
|
-
/** Primary action color (buttons, active indicators) */
|
|
39
|
-
primary: string;
|
|
40
|
-
/** Text on primary-colored backgrounds */
|
|
41
|
-
primaryForeground: string;
|
|
42
|
-
/** Secondary / subdued action color */
|
|
43
|
-
secondary: string;
|
|
44
|
-
/** Text on secondary backgrounds */
|
|
45
|
-
secondaryForeground: string;
|
|
46
|
-
/** Muted / disabled surface */
|
|
47
|
-
muted: string;
|
|
48
|
-
/** Text on muted surfaces (also used for secondary text) */
|
|
49
|
-
mutedForeground: string;
|
|
50
|
-
/** Accent / hover-highlight surface */
|
|
51
|
-
accent: string;
|
|
52
|
-
/** Text on accent surfaces */
|
|
53
|
-
accentForeground: string;
|
|
54
|
-
/** Destructive / danger action color */
|
|
55
|
-
destructive: string;
|
|
56
|
-
/** Text on destructive backgrounds */
|
|
57
|
-
destructiveForeground: string;
|
|
58
|
-
/** Default border color */
|
|
59
|
-
border: string;
|
|
60
|
-
/** Input field border color */
|
|
61
|
-
input: string;
|
|
62
|
-
/** Focus ring color */
|
|
63
|
-
ring: string;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Full viewer theme configuration.
|
|
67
|
-
*
|
|
68
|
-
* Every property is optional — unset values fall back to the built-in
|
|
69
|
-
* dark theme defaults.
|
|
70
|
-
*/
|
|
71
|
-
interface ViewerTheme {
|
|
72
|
-
/** Semantic UI colors. Each key maps to a `--pptx-<key>` CSS custom property. */
|
|
73
|
-
colors?: Partial<ViewerThemeColors>;
|
|
74
|
-
/** Base border-radius value (e.g. `"0.5rem"`, `"8px"`). */
|
|
75
|
-
radius?: string;
|
|
76
|
-
/**
|
|
77
|
-
* Escape hatch: arbitrary CSS custom properties to set on the viewer
|
|
78
|
-
* root element. Keys should include the `--` prefix.
|
|
79
|
-
*
|
|
80
|
-
* @example
|
|
81
|
-
* ```ts
|
|
82
|
-
* { "--my-custom-shadow": "0 4px 12px rgba(0,0,0,0.5)" }
|
|
83
|
-
* ```
|
|
84
|
-
*/
|
|
85
|
-
cssVars?: Record<string, string>;
|
|
86
|
-
}
|
|
87
|
-
//#endregion
|
|
88
|
-
//#region src/theme/theme-catalog.d.ts
|
|
89
|
-
/** One selectable entry in the viewer chrome's built-in theme picker (File > Options > Appearance). */
|
|
90
|
-
interface ThemeCatalogEntry {
|
|
91
|
-
/** Stable identifier persisted to storage and passed to `onThemeChange`. */
|
|
92
|
-
key: string;
|
|
93
|
-
/** `pptx.*` translation key for the entry's display label. */
|
|
94
|
-
labelKey: string;
|
|
95
|
-
/** The theme to apply, or `undefined` to reset to the built-in default. */
|
|
96
|
-
theme: ViewerTheme | undefined;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
//#region src/render/collaboration-presence.d.ts
|
|
100
|
-
/** Connection lifecycle states for the Yjs WebSocket provider. */
|
|
101
|
-
type ConnectionStatus$1 = 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
102
|
-
//#endregion
|
|
103
|
-
//#region src/render/collaboration-presence-publisher.d.ts
|
|
104
|
-
/**
|
|
105
|
-
* Structural interface for the lazily-imported Yjs awareness surface. Every
|
|
106
|
-
* binding's live `y-protocols/awareness` `Awareness` instance satisfies this.
|
|
107
|
-
*/
|
|
108
|
-
interface AwarenessLike {
|
|
109
|
-
clientID?: number;
|
|
110
|
-
setLocalStateField: (field: string, value: unknown) => void;
|
|
111
|
-
getStates: () => Map<number, Record<string, unknown>>;
|
|
112
|
-
on: (event: string, cb: () => void) => void;
|
|
113
|
-
off?: (event: string, cb: () => void) => void;
|
|
114
|
-
}
|
|
115
|
-
//#endregion
|
|
116
|
-
//#region src/render/collaboration-external-session.d.ts
|
|
117
|
-
/** Connection state reported by the host, independent of the viewer lifetime. */
|
|
118
|
-
interface ExternalCollaborationSnapshot {
|
|
119
|
-
status: ConnectionStatus$1;
|
|
120
|
-
/**
|
|
121
|
-
* The host has loaded the authoritative document and permits local edits.
|
|
122
|
-
* Keep true while offline to allow ordinary Yjs offline edits, or set false
|
|
123
|
-
* to suspend writes until a fresh sync. The viewer never infers this from
|
|
124
|
-
* `status` and never opens it after a timeout.
|
|
125
|
-
*/
|
|
126
|
-
synced: boolean;
|
|
127
|
-
}
|
|
128
|
-
/** The public y-protocols Awareness surface needed by a borrowed session. */
|
|
129
|
-
interface ExternalCollaborationAwareness extends AwarenessLike {
|
|
130
|
-
clientID: number;
|
|
131
|
-
getLocalState: () => Record<string, unknown> | null;
|
|
132
|
-
setLocalState: (state: Record<string, unknown> | null) => void;
|
|
133
|
-
off: (event: string, callback: () => void) => void;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Host-owned Yjs resources. The host creates, connects and destroys them.
|
|
137
|
-
* Keep this object and its resources stable for a session; report connection
|
|
138
|
-
* changes through subscribe instead of replacing the collaboration config.
|
|
139
|
-
*/
|
|
140
|
-
interface ExternalCollaborationSession {
|
|
141
|
-
readonly doc: Doc;
|
|
142
|
-
/** Awareness must belong to doc. One viewer publishes slide presence at a time. */
|
|
143
|
-
readonly awareness: ExternalCollaborationAwareness;
|
|
144
|
-
getSnapshot: () => ExternalCollaborationSnapshot;
|
|
145
|
-
/** Subscribe to status or synced changes; return an unsubscribe function. */
|
|
146
|
-
subscribe: (listener: () => void) => () => void;
|
|
147
|
-
}
|
|
148
|
-
/** Listener/publisher view, deliberately excluding host lifecycle methods. */
|
|
149
|
-
interface BorrowedCollaborationAwareness extends AwarenessLike {
|
|
150
|
-
clientID: number;
|
|
151
|
-
off: (event: string, callback: () => void) => void;
|
|
152
|
-
}
|
|
153
|
-
//#endregion
|
|
154
|
-
//#region src/render/element-update-batch.d.ts
|
|
155
|
-
/** A shallow property patch for a top-level element on an ordinary slide. */
|
|
156
|
-
interface ElementUpdate {
|
|
157
|
-
slideId: string;
|
|
158
|
-
elementId: string;
|
|
159
|
-
patch: Partial<PptxElement>;
|
|
160
|
-
}
|
|
161
|
-
interface ElementUpdateOptions {
|
|
162
|
-
/** Optional description for the undo entry. */
|
|
163
|
-
label?: string;
|
|
164
|
-
}
|
|
165
|
-
/** Viewer interaction mode: read-only, edit, presentation, or master-view. */
|
|
166
|
-
type ViewerMode = 'preview' | 'edit' | 'present' | 'master';
|
|
167
|
-
/**
|
|
168
|
-
* Framework-agnostic imperative API contract for the PowerPoint viewer.
|
|
169
|
-
*
|
|
170
|
-
* Each binding (React `forwardRef` handle, Vue `defineExpose`, Angular public
|
|
171
|
-
* methods) implements this interface so consumers get a consistent progressive
|
|
172
|
-
* API regardless of framework.
|
|
173
|
-
*/
|
|
174
|
-
interface PowerPointViewerAPI {
|
|
175
|
-
/** Serialise the current presentation to `.pptx` bytes. */
|
|
176
|
-
getContent: () => Promise<Uint8Array>;
|
|
177
|
-
/** Navigate to a specific slide by zero-based index. */
|
|
178
|
-
goTo: (slideIndex: number) => void;
|
|
179
|
-
/** Navigate to the previous slide. */
|
|
180
|
-
goPrev: () => void;
|
|
181
|
-
/** Navigate to the next slide. */
|
|
182
|
-
goNext: () => void;
|
|
183
|
-
/** Undo the last editing action. No-op when nothing to undo. */
|
|
184
|
-
undo: () => void;
|
|
185
|
-
/** Redo the last undone action. No-op when nothing to redo. */
|
|
186
|
-
redo: () => void;
|
|
187
|
-
/** Whether an undo action is available. */
|
|
188
|
-
canUndo: () => boolean;
|
|
189
|
-
/** Whether a redo action is available. */
|
|
190
|
-
canRedo: () => boolean;
|
|
191
|
-
/** Get the current zoom level (1 = 100%). */
|
|
192
|
-
getZoom: () => number;
|
|
193
|
-
/** Set the zoom level (clamped to min/max bounds). */
|
|
194
|
-
setZoom: (level: number) => void;
|
|
195
|
-
/** Zoom in by one step. */
|
|
196
|
-
zoomIn: () => void;
|
|
197
|
-
/** Zoom out by one step. */
|
|
198
|
-
zoomOut: () => void;
|
|
199
|
-
/** Reset zoom to 100%. */
|
|
200
|
-
zoomReset: () => void;
|
|
201
|
-
/** Get the current viewer mode. */
|
|
202
|
-
getMode: () => ViewerMode;
|
|
203
|
-
/** Switch the viewer mode (e.g. 'edit', 'preview', 'present'). */
|
|
204
|
-
setMode: (mode: ViewerMode) => void;
|
|
205
|
-
/** Get the zero-based active slide index. */
|
|
206
|
-
getActiveSlideIndex: () => number;
|
|
207
|
-
/** Set the active slide by zero-based index (alias of goTo). */
|
|
208
|
-
setActiveSlideIndex: (index: number) => void;
|
|
209
|
-
/** Get the total number of slides. */
|
|
210
|
-
getSlideCount: () => number;
|
|
211
|
-
/** Whether the document has unsaved changes. */
|
|
212
|
-
isDirty: () => boolean;
|
|
213
|
-
/**
|
|
214
|
-
* Get the full slide array. Returns the actual `PptxSlide[]` from the
|
|
215
|
-
* internal model with full type information (elements, notes, transitions,
|
|
216
|
-
* animations, etc.). The returned reference is a snapshot; mutations are
|
|
217
|
-
* not reflected back unless done via the manipulation methods.
|
|
218
|
-
*/
|
|
219
|
-
getSlides: () => readonly PptxSlide[];
|
|
220
|
-
/** Get a single slide by zero-based index, or undefined if out of range. */
|
|
221
|
-
getSlide: (index: number) => PptxSlide | undefined;
|
|
222
|
-
/** Get the currently active slide. */
|
|
223
|
-
getActiveSlide: () => PptxSlide | undefined;
|
|
224
|
-
/** Add a blank slide after the given index (or at end if omitted). */
|
|
225
|
-
addSlide: (afterIndex?: number) => void;
|
|
226
|
-
/** Delete slides at the given zero-based indexes. At least one slide is kept. */
|
|
227
|
-
deleteSlides: (indexes: number[]) => void;
|
|
228
|
-
/** Duplicate slides at the given zero-based indexes. */
|
|
229
|
-
duplicateSlides: (indexes: number[]) => void;
|
|
230
|
-
/** Move a slide from one position to another. */
|
|
231
|
-
moveSlide: (fromIndex: number, toIndex: number) => void;
|
|
232
|
-
/** Toggle the hidden flag on slides at the given indexes. */
|
|
233
|
-
toggleHideSlides: (indexes: number[]) => void;
|
|
234
|
-
/**
|
|
235
|
-
* Get the elements on a slide. Defaults to the active slide when
|
|
236
|
-
* `slideIndex` is omitted. Returns the full `PptxElement[]` with
|
|
237
|
-
* all type-specific properties intact.
|
|
238
|
-
*/
|
|
239
|
-
getElements: (slideIndex?: number) => readonly PptxElement[];
|
|
240
|
-
/** Get a single element by ID from the active slide (or a specified slide). */
|
|
241
|
-
getElementById: (elementId: string, slideIndex?: number) => PptxElement | undefined;
|
|
242
|
-
/**
|
|
243
|
-
* Append and select a deep copy on the active ordinary editable slide.
|
|
244
|
-
* Assigns fresh element IDs without offsetting the supplied geometry.
|
|
245
|
-
* Returns the new root ID, or undefined when insertion is unavailable.
|
|
246
|
-
* Uses normal Undo/Redo grouping. Models must be self-contained or refer to
|
|
247
|
-
* assets in this document; this does not import foreign PPTX relationships.
|
|
248
|
-
*/
|
|
249
|
-
addElement: (element: PptxElement) => string | undefined;
|
|
250
|
-
/**
|
|
251
|
-
* Update one or more properties of an element by ID on the active slide.
|
|
252
|
-
* Accepts a `Partial<PptxElement>` patch (e.g. `{ x: 100, width: 300 }`).
|
|
253
|
-
*/
|
|
254
|
-
updateElement: (elementId: string, updates: Partial<PptxElement>) => void;
|
|
255
|
-
/** Atomically patch ordinary slide elements as one independent undo step. Rejects invalid batches. */
|
|
256
|
-
updateElements: (updates: readonly ElementUpdate[], options?: ElementUpdateOptions) => Promise<void>;
|
|
257
|
-
/** Delete elements by their IDs from the active slide. */
|
|
258
|
-
deleteElements: (elementIds: string[]) => void;
|
|
259
|
-
/**
|
|
260
|
-
* Duplicate an element on the active slide.
|
|
261
|
-
* Returns the new element's ID, or undefined if the source was not found.
|
|
262
|
-
*/
|
|
263
|
-
duplicateElement: (elementId: string) => string | undefined;
|
|
264
|
-
/** Get the IDs of currently selected elements. */
|
|
265
|
-
getSelectedElementIds: () => string[];
|
|
266
|
-
/** Programmatically select elements by their IDs. */
|
|
267
|
-
selectElements: (ids: string[]) => void;
|
|
268
|
-
/** Clear the current selection. */
|
|
269
|
-
clearSelection: () => void;
|
|
270
|
-
}
|
|
271
|
-
/** Collaboration role within a session. */
|
|
272
|
-
type CollaborationRole = 'owner' | 'collaborator' | 'viewer';
|
|
273
|
-
/**
|
|
274
|
-
* Collaboration transport.
|
|
275
|
-
*
|
|
276
|
-
* - `'websocket'` (default): y-websocket against `serverUrl`.
|
|
277
|
-
* - `'webrtc'`: y-webrtc peer-to-peer; needs no document server. Peers meet
|
|
278
|
-
* through the `signaling` servers (WebRTC signaling only, no document data)
|
|
279
|
-
* and same-browser tabs additionally sync via BroadcastChannel even without
|
|
280
|
-
* any signaling server, which makes this mode usable from static hosting.
|
|
281
|
-
*/
|
|
282
|
-
type CollaborationTransport = 'websocket' | 'webrtc';
|
|
283
|
-
/** How the local user entered a collaboration session. */
|
|
284
|
-
type CollaborationSessionIntent = 'create' | 'join';
|
|
285
|
-
/**
|
|
286
|
-
* Real-time collaboration configuration.
|
|
287
|
-
*
|
|
288
|
-
* The same shape is accepted by every framework binding.
|
|
289
|
-
*/
|
|
290
|
-
interface CollaborationConfig {
|
|
291
|
-
/** Unique identifier for the collaboration room (alphanumeric, hyphens, underscores). */
|
|
292
|
-
roomId: string;
|
|
293
|
-
/**
|
|
294
|
-
* WebSocket server URL for the Yjs provider (e.g. "wss://collab.example.com").
|
|
295
|
-
* Ignored (may be empty) for `externalSession` or when `transport` is `'webrtc'`.
|
|
296
|
-
*/
|
|
297
|
-
serverUrl: string;
|
|
298
|
-
/** Transport to use. Defaults to `'websocket'`. */
|
|
299
|
-
transport?: CollaborationTransport;
|
|
300
|
-
/**
|
|
301
|
-
* Use the host's document, awareness and transport instead of creating a
|
|
302
|
-
* provider. Transport, serverUrl, signaling and authToken are ignored. The
|
|
303
|
-
* viewer only detaches its listeners and presence on stop; it never destroys
|
|
304
|
-
* these resources. Keep this object stable and report readiness via subscribe.
|
|
305
|
-
*/
|
|
306
|
-
externalSession?: ExternalCollaborationSession;
|
|
307
|
-
/**
|
|
308
|
-
* WebRTC signaling server URLs (only used when `transport` is `'webrtc'`).
|
|
309
|
-
* Defaults to y-webrtc's built-in public signaling list. Same-browser tabs
|
|
310
|
-
* sync via BroadcastChannel regardless of signaling availability.
|
|
311
|
-
*/
|
|
312
|
-
signaling?: string[];
|
|
313
|
-
/** Display name for the local user. */
|
|
314
|
-
userName: string;
|
|
315
|
-
/** Avatar URL for the local user (optional). */
|
|
316
|
-
userAvatar?: string;
|
|
317
|
-
/** Hex colour for the local user's cursor/presence indicator. */
|
|
318
|
-
userColor?: string;
|
|
319
|
-
/** Optional authentication token sent with the WebSocket handshake. */
|
|
320
|
-
authToken?: string;
|
|
321
|
-
/** Role in the session; defaults to `'collaborator'`. */
|
|
322
|
-
role?: CollaborationRole;
|
|
323
|
-
/**
|
|
324
|
-
* Whether this client created the room or joined an existing room. Providers
|
|
325
|
-
* do not use this value, but hosts can use it to avoid publishing local file
|
|
326
|
-
* bytes when handling a join request. Omitted values retain the legacy
|
|
327
|
-
* create-session behaviour.
|
|
328
|
-
*/
|
|
329
|
-
sessionIntent?: CollaborationSessionIntent;
|
|
330
|
-
/**
|
|
331
|
-
* Elected-writer write-back callback (Area 3 of the C3 hardening plan).
|
|
332
|
-
*
|
|
333
|
-
* When the local user has `role: 'owner'`, the binding debounces changes and
|
|
334
|
-
* serializes the current Y.Doc state to a PPTX byte array, then calls this
|
|
335
|
-
* callback so the host can persist the snapshot. Only one writer (the owner)
|
|
336
|
-
* does this; other collaborators never trigger write-back, eliminating the
|
|
337
|
-
* last-save-wins problem.
|
|
338
|
-
*/
|
|
339
|
-
onWriteBack?: (bytes: Uint8Array) => void;
|
|
340
|
-
/**
|
|
341
|
-
* Debounce delay (ms) between the last Y.Doc change and the write-back
|
|
342
|
-
* invocation. Defaults to 5000 ms. Set to 0 to write back on every change
|
|
343
|
-
* (not recommended for large documents).
|
|
344
|
-
*/
|
|
345
|
-
writeBackDebounceMs?: number;
|
|
346
|
-
}
|
|
347
|
-
//#endregion
|
|
348
|
-
//#region src/render/shape-adjustment-model.d.ts
|
|
349
|
-
/**
|
|
350
|
-
* `shape-adjustment-model`: the vocabulary the adjust-handle modules share.
|
|
351
|
-
*
|
|
352
|
-
* The `a:ahLst` work is split three ways for the repo's file-size budget:
|
|
353
|
-
* `shape-adjustment-probe` measures the geometry, `shape-adjustment-handles`
|
|
354
|
-
* derives the handles from those measurements, and `shape-adjustment-solver`
|
|
355
|
-
* turns a pointer position back into guide values. All three need these types
|
|
356
|
-
* and the one rule that operates purely on them, so they live here and the
|
|
357
|
-
* dependency graph stays a DAG rather than a cycle.
|
|
358
|
-
*
|
|
359
|
-
* @module render/shape-adjustment-model
|
|
360
|
-
*/
|
|
361
|
-
/**
|
|
362
|
-
* How a pointer position becomes a guide value, captured once when the gesture
|
|
363
|
-
* starts so `pointermove` stays pure arithmetic.
|
|
364
|
-
*/
|
|
365
|
-
interface ShapeAdjustmentSolver {
|
|
366
|
-
/** `linear`: the handle slides. `angular`: it swings about {@link centerX}. */
|
|
367
|
-
kind: 'linear' | 'angular';
|
|
368
|
-
/** Handle position in element-local px at {@link startValue}. */
|
|
369
|
-
anchorX: number;
|
|
370
|
-
anchorY: number;
|
|
371
|
-
/** Element-local px the handle travels per ONE unit of guide value. */
|
|
372
|
-
dirX: number;
|
|
373
|
-
dirY: number;
|
|
374
|
-
/** Pivot for an angular handle (the shape centre). */
|
|
375
|
-
centerX: number;
|
|
376
|
-
centerY: number;
|
|
377
|
-
/** The guide value the anchor was measured at. */
|
|
378
|
-
startValue: number;
|
|
379
|
-
/** Guide-space bounds, taken from the preset's own `pin` clamp. */
|
|
380
|
-
min: number;
|
|
381
|
-
max: number;
|
|
382
|
-
}
|
|
383
|
-
/** One guide a handle drives. */
|
|
384
|
-
interface AdjustmentAxisSolver {
|
|
385
|
-
key: string;
|
|
386
|
-
solver: ShapeAdjustmentSolver;
|
|
387
|
-
}
|
|
388
|
-
/** Descriptor for one draggable adjustment handle (the amber diamond). */
|
|
389
|
-
interface ShapeAdjustmentHandleDescriptor {
|
|
390
|
-
/** The `a:avLst` guide name this handle writes (`adj`, `adj1`, ...). */
|
|
391
|
-
key: string;
|
|
392
|
-
/** Handle x offset in element-local px (origin = element top-left). */
|
|
393
|
-
left: number;
|
|
394
|
-
/** Handle y offset in element-local px. */
|
|
395
|
-
top: number;
|
|
396
|
-
/**
|
|
397
|
-
* Current adjustment value in GUIDE units, not a 0-1 fraction. Most presets
|
|
398
|
-
* range 0..50000 or 0..100000 and the angular ones run to 21,600,000.
|
|
399
|
-
*/
|
|
400
|
-
value: number;
|
|
401
|
-
cursor: string;
|
|
402
|
-
/**
|
|
403
|
-
* How this handle's drag resolves, measured off the preset geometry: one
|
|
404
|
-
* entry per `a:avLst` guide it drives (callouts drive two). Absent only for
|
|
405
|
-
* a caller that built a descriptor by hand.
|
|
406
|
-
*/
|
|
407
|
-
solvers?: AdjustmentAxisSolver[];
|
|
408
|
-
}
|
|
409
|
-
/** Live drag state captured when an adjustment gesture starts. */
|
|
410
|
-
interface ShapeAdjustmentDragState {
|
|
411
|
-
elementId: string;
|
|
412
|
-
key: string;
|
|
413
|
-
shapeType: string;
|
|
414
|
-
startClientX: number;
|
|
415
|
-
startClientY: number;
|
|
416
|
-
startAdjustment: number;
|
|
417
|
-
startWidth: number;
|
|
418
|
-
startHeight: number;
|
|
419
|
-
moved: boolean;
|
|
420
|
-
/** Copied from the descriptor the gesture started on. */
|
|
421
|
-
solvers?: AdjustmentAxisSolver[];
|
|
422
|
-
/**
|
|
423
|
-
* The element's whole `a:avLst` map at gesture start.
|
|
424
|
-
*
|
|
425
|
-
* A binding writes `shapeAdjustments` as one object, so a drag that sent
|
|
426
|
-
* only the guide it changed would DELETE every other authored adjustment on
|
|
427
|
-
* a multi-adjust preset (a `quadArrow` would lose two of its three the first
|
|
428
|
-
* time one was touched).
|
|
429
|
-
*/
|
|
430
|
-
startAdjustments?: Record<string, number>;
|
|
431
|
-
}
|
|
432
|
-
/** Everything the Transitions tab's controls currently say. */
|
|
433
|
-
interface RibbonTransitionDraft {
|
|
434
|
-
/** The highlighted gallery entry. */
|
|
435
|
-
type: PptxTransitionType;
|
|
436
|
-
/** Duration field, in seconds. */
|
|
437
|
-
durationSec: number;
|
|
438
|
-
/** Advance Slide > On Mouse Click. */
|
|
439
|
-
advanceOnClick: boolean;
|
|
440
|
-
/** Advance Slide > After (whether the timed advance is armed at all). */
|
|
441
|
-
advanceAfter: boolean;
|
|
442
|
-
/** Advance Slide > After, as the `mm:ss.hh` text the field holds. */
|
|
443
|
-
advanceAfterText: string;
|
|
444
|
-
}
|
|
445
|
-
type BackstagePage = 'home' | 'new' | 'open' | 'info' | 'save' | 'saveAs' | 'print' | 'share' | 'export' | 'close' | 'account' | 'options';
|
|
446
|
-
//#endregion
|
|
447
|
-
//#region src/render/backstage-cards.d.ts
|
|
448
|
-
/**
|
|
449
|
-
* Every action card the File-tab backstage can show, keyed by the operation it
|
|
450
|
-
* triggers rather than by its wording.
|
|
451
|
-
*
|
|
452
|
-
* The five bindings used to hardcode a title and a body string each, which made
|
|
453
|
-
* the whole backstage untranslatable and let the copy drift: the same card
|
|
454
|
-
* carried four different descriptions depending on which binding you opened it
|
|
455
|
-
* in. Both halves now live here as a dictionary key plus an English fallback,
|
|
456
|
-
* so a wording change lands everywhere at once and a translator only has to
|
|
457
|
-
* translate it once.
|
|
458
|
-
*/
|
|
459
|
-
type BackstageCardId = 'protect' | 'inspect' | 'embedFonts' | 'signatures' | 'versionHistory' | 'saveAsPptx' | 'saveAsPpsx' | 'saveAsPptm' | 'saveAsPpt' | 'pdf' | 'png' | 'video' | 'gif' | 'json' | 'copyImage' | 'print' | 'share';
|
|
460
|
-
//#endregion
|
|
461
|
-
//#region src/render/toolbar-actions.d.ts
|
|
462
|
-
/**
|
|
463
|
-
* Toolbar action / ribbon-tab visibility: a single, framework-agnostic
|
|
464
|
-
* catalogue of every top-level toolbar button and ribbon tab a host app can
|
|
465
|
-
* independently hide. Each binding exposes a `hiddenActions?: ToolbarActionId[]`
|
|
466
|
-
* prop, threads it down to the relevant render sites, and gates them with
|
|
467
|
-
* `isActionHidden`. Default (`undefined` / `[]`) hides nothing, matching
|
|
468
|
-
* today's always-visible behaviour.
|
|
469
|
-
*
|
|
470
|
-
* `TOOLBAR_TABS` is also the canonical ribbon-tab list/order, replacing the
|
|
471
|
-
* copy hand-duplicated in each binding (React's `TOOLBAR_SECTIONS`, Vue's
|
|
472
|
-
* `ribbon-constants.ts`, Angular's `RIBBON_TABS`, etc.) so the tab set can't
|
|
473
|
-
* drift between bindings. Per-tab icons stay in each binding (icon libraries
|
|
474
|
-
* differ per framework); only id + i18n key + order are shared here.
|
|
475
|
-
*/
|
|
476
|
-
/**
|
|
477
|
-
* A single toolbar button/control that can be hidden independently of the
|
|
478
|
-
* ribbon tab it may also appear inside. `zoom` and `navigation` each cover a
|
|
479
|
-
* whole control cluster (zoom in/out/fit, prev/next) rather than each button
|
|
480
|
-
* in it, matching how hosts actually want to hide/keep them as a unit.
|
|
481
|
-
*/
|
|
482
|
-
type ToolbarButtonId = 'share' | 'broadcast' | 'export' | 'undo' | 'redo' | 'record' | 'notes' | 'fullscreen' | 'zoom' | 'navigation' | 'mergeShapes' | 'crop';
|
|
483
|
-
/** A top-level ribbon tab. `record` intentionally shares its id with the quick-access Record button above: both surface the same recording feature, so hiding one hides the other. */
|
|
484
|
-
type ToolbarTabId = 'file' | 'home' | 'insert' | 'draw' | 'design' | 'transitions' | 'animations' | 'slideShow' | 'record' | 'review' | 'view' | 'help';
|
|
485
|
-
type ToolbarActionId = ToolbarButtonId | ToolbarTabId;
|
|
486
|
-
/**
|
|
487
|
-
* PowerPoint's contextual tabs: they join the tab row only while the
|
|
488
|
-
* selection is of their kind (see `contextualTabsForElement` in
|
|
489
|
-
* `ribbon-galleries/`). Kept apart from `ToolbarTabId` because they are not
|
|
490
|
-
* part of the fixed tab order every binding renders.
|
|
491
|
-
*/
|
|
492
|
-
type RibbonContextualTabId = 'shapeFormat' | 'pictureFormat' | 'tableDesign' | 'chartDesign' | 'smartArtDesign';
|
|
493
|
-
//#endregion
|
|
494
|
-
//#region src/render/canvas-context-menu-commands.d.ts
|
|
495
|
-
/**
|
|
496
|
-
* The right-click menu for the empty slide canvas (no element under the
|
|
497
|
-
* cursor), as distinct from {@link ./context-menu-commands}'s per-element menu.
|
|
498
|
-
*
|
|
499
|
-
* Right-clicking empty canvas used to do nothing at all in every binding: React
|
|
500
|
-
* and Vue both bailed out early (`getElementIdFromEvent` returns `null`, so the
|
|
501
|
-
* handler just returns) rather than opening a menu, and the other three never
|
|
502
|
-
* wired a handler for it either. PowerPoint offers Paste, Layout, Reset,
|
|
503
|
-
* Format Background and view toggles (Grid and Guides, Ruler) from this menu;
|
|
504
|
-
* this module is the one list every binding renders instead of five omissions.
|
|
505
|
-
*
|
|
506
|
-
* @module render/canvas-context-menu-commands
|
|
507
|
-
*/
|
|
508
|
-
/** Every command the empty-canvas context menu can offer, in no particular order. */
|
|
509
|
-
type CanvasContextMenuCommandId = 'paste' | 'layout' | 'reset-slide' | 'format-background' | 'grid-and-guides' | 'ruler';
|
|
510
|
-
//#endregion
|
|
511
|
-
//#region src/render/merge-shapes/merge-shapes-menu.d.ts
|
|
512
|
-
/** The right-click command id for each operation. */
|
|
513
|
-
type MergeShapesCommandId = 'merge-union' | 'merge-combine' | 'merge-fragment' | 'merge-intersect' | 'merge-subtract';
|
|
514
|
-
/** Every command a canvas context menu can offer, in no particular order. */
|
|
515
|
-
type ContextMenuCommandId = 'copy' | 'cut' | 'paste' | 'duplicate' | 'edit-text' | 'edit-points' | 'bring-forward' | 'send-backward' | 'bring-front' | 'send-back' | 'ai-ask' | 'ai-fix' | 'comment' | 'hyperlink' | 'table-insert-row-above' | 'table-insert-row-below' | 'table-delete-row' | 'table-insert-col-left' | 'table-insert-col-right' | 'table-delete-col' | 'table-merge-selected' | 'table-merge-right' | 'table-merge-down' | 'table-split' | 'group' | 'ungroup' | 'crop' | MergeShapesCommandId | 'save-as-picture' | 'edit-alt-text' | 'size-and-position' | 'format-shape' | 'delete';
|
|
516
|
-
/** Every command the Edit Points right-click menu can offer. */
|
|
517
|
-
type EditPointsCommandId = 'add-point' | 'delete-point' | 'delete-segment' | 'open-path' | 'close-path' | 'smooth-point' | 'straight-point' | 'corner-point' | 'straight-segment' | 'curved-segment' | 'exit';
|
|
518
|
-
//#endregion
|
|
519
|
-
//#region src/render/edit-points/freeform-tool-geometry.d.ts
|
|
520
|
-
/** The two click-to-place drawing tools. */
|
|
521
|
-
type FreeformToolKind = 'freeformShape' | 'curve';
|
|
522
|
-
//#endregion
|
|
523
|
-
//#region src/render/editor-keymap.d.ts
|
|
524
|
-
/** A logical editor command produced by one key press. */
|
|
525
|
-
type EditorKeyActionName = 'undo' | 'redo' | 'copy' | 'cut' | 'paste' | 'duplicate' | 'delete' | 'selectAll' | 'group' | 'ungroup' | 'nudge' | 'prevSlide' | 'nextSlide' | 'escape' | 'find' | 'findReplace' | 'toggleShortcuts' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignJustify' | 'increaseFontSize' | 'decreaseFontSize' | 'copyFormat' | 'pasteFormat' | 'newSlide' | 'hyperlink' | 'clearFormatting' | 'cycleSelectionNext' | 'cycleSelectionPrev' | 'pasteSpecial';
|
|
526
|
-
//#endregion
|
|
527
|
-
//#region src/render/options/viewer-options.d.ts
|
|
528
|
-
/**
|
|
529
|
-
* Full PowerPoint "File > Options" parity model.
|
|
530
|
-
*
|
|
531
|
-
* Groups mirror the ten categories of PowerPoint's Options dialog. Values are
|
|
532
|
-
* flat primitives per group so the dialog panes can be rendered generically
|
|
533
|
-
* from `VIEWER_OPTIONS_SCHEMA` in every binding. The legacy six-toggle
|
|
534
|
-
* `ViewerPreferences` surface stays supported via the mapping helpers below.
|
|
535
|
-
*/
|
|
536
|
-
type ScreenTipStyle = 'descriptions' | 'plain' | 'off';
|
|
537
|
-
type DisplayOptimization = 'appearance' | 'compatibility';
|
|
538
|
-
type ImageResolutionPreset = 'highFidelity' | 'ppi330' | 'ppi220' | 'ppi150' | 'ppi96';
|
|
539
|
-
type OpenDocumentsView = 'savedView' | 'normal' | 'outline' | 'slideSorter' | 'notes';
|
|
540
|
-
type DefaultExportFormat = 'pptx' | 'pdf' | 'png';
|
|
541
|
-
type QuickAccessPosition = 'above' | 'below';
|
|
542
|
-
type FeedbackSoundScheme = 'modern' | 'classic';
|
|
543
|
-
type OptionsPrintWhat = 'slides' | 'handouts' | 'notes' | 'outline';
|
|
544
|
-
type OptionsPrintColorMode = 'color' | 'grayscale' | 'blackAndWhite';
|
|
545
|
-
interface ViewerGeneralOptions {
|
|
546
|
-
displayOptimization: DisplayOptimization;
|
|
547
|
-
showMiniToolbar: boolean;
|
|
548
|
-
enableLivePreview: boolean;
|
|
549
|
-
collapseRibbonAutomatically: boolean;
|
|
550
|
-
collapseSearchByDefault: boolean;
|
|
551
|
-
screenTipStyle: ScreenTipStyle;
|
|
552
|
-
userName: string;
|
|
553
|
-
userInitials: string;
|
|
554
|
-
showStartScreen: boolean;
|
|
555
|
-
/**
|
|
556
|
-
* Lets the user hand a local font file to the viewer so decks authored
|
|
557
|
-
* with a font the browser lacks render with the real face.
|
|
558
|
-
*
|
|
559
|
-
* Off by default. The registration reads a file the user picks and adds it
|
|
560
|
-
* to the page's font set for the session, which is a capability a host
|
|
561
|
-
* embedding the viewer should opt into rather than inherit.
|
|
562
|
-
*/
|
|
563
|
-
enableCustomFontUpload: boolean;
|
|
564
|
-
}
|
|
565
|
-
interface ViewerProofingOptions {
|
|
566
|
-
autoCorrectTwoInitialCapitals: boolean;
|
|
567
|
-
autoCorrectCapitalizeFirstLetter: boolean;
|
|
568
|
-
autoCorrectCapitalizeDayNames: boolean;
|
|
569
|
-
autoCorrectSmartQuotes: boolean;
|
|
570
|
-
autoCorrectHyphensToDash: boolean;
|
|
571
|
-
autoCorrectFractions: boolean;
|
|
572
|
-
autoCorrectOrdinals: boolean;
|
|
573
|
-
ignoreUppercase: boolean;
|
|
574
|
-
ignoreWordsWithNumbers: boolean;
|
|
575
|
-
ignoreInternetAddresses: boolean;
|
|
576
|
-
flagRepeatedWords: boolean;
|
|
577
|
-
checkSpellingAsYouType: boolean;
|
|
578
|
-
hideSpellingErrors: boolean;
|
|
579
|
-
}
|
|
580
|
-
/**
|
|
581
|
-
* File > Options > Save.
|
|
582
|
-
*
|
|
583
|
-
* Font embedding deliberately has NO entry here. It is owned by the File >
|
|
584
|
-
* Fonts panel, whose toggle is the one the save path reads (see
|
|
585
|
-
* `render/font-embedding`: `describeFontEmbedding` decides the toggle's start
|
|
586
|
-
* position and whether it can do anything at all, `embeddedFontSaveOptions`
|
|
587
|
-
* turns it into the `PptxHandler.save()` slice). This group used to carry a
|
|
588
|
-
* second `embedFonts` boolean, plus an `embedAllFontCharacters` companion, and
|
|
589
|
-
* neither was read by anything: the pane moved a switch that changed no saved
|
|
590
|
-
* byte, while the panel next door moved the real one. Two switches for one
|
|
591
|
-
* setting, one of them lying, is worse than one switch in a less
|
|
592
|
-
* PowerPoint-shaped place.
|
|
593
|
-
*/
|
|
594
|
-
interface ViewerSaveOptions {
|
|
595
|
-
autoSave: boolean;
|
|
596
|
-
autoRecoverIntervalMinutes: number;
|
|
597
|
-
keepLastAutoRecoveredVersion: boolean;
|
|
598
|
-
defaultExportFormat: DefaultExportFormat;
|
|
599
|
-
cacheRetentionDays: number;
|
|
600
|
-
clearCacheOnClose: boolean;
|
|
601
|
-
}
|
|
602
|
-
interface ViewerAccessibilityOptions {
|
|
603
|
-
/** Browser speech-recognition language; automatic follows the browser language. */
|
|
604
|
-
subtitleLanguage?: string;
|
|
605
|
-
showAccessibilityStatus: boolean;
|
|
606
|
-
feedbackWithSound: boolean;
|
|
607
|
-
soundScheme: FeedbackSoundScheme;
|
|
608
|
-
showShortcutKeysInScreenTips: boolean;
|
|
609
|
-
reducedMotion: boolean;
|
|
610
|
-
}
|
|
611
|
-
interface ViewerAdvancedOptions {
|
|
612
|
-
autoSelectEntireWord: boolean;
|
|
613
|
-
allowTextDragAndDrop: boolean;
|
|
614
|
-
maximumUndoSteps: number;
|
|
615
|
-
useSmartCutAndPaste: boolean;
|
|
616
|
-
showPasteOptionsButton: boolean;
|
|
617
|
-
imageDefaultResolution: ImageResolutionPreset;
|
|
618
|
-
doNotCompressImages: boolean;
|
|
619
|
-
chartPropertiesFollowDataPoint: boolean;
|
|
620
|
-
recentPresentationsCount: number;
|
|
621
|
-
showVerticalRuler: boolean;
|
|
622
|
-
showGrid: boolean;
|
|
623
|
-
snapToGrid: boolean;
|
|
624
|
-
disableHardwareAcceleration: boolean;
|
|
625
|
-
/**
|
|
626
|
-
* Force every opt-in interactive 3D scene (SmartArt, bar/line/area/pie/
|
|
627
|
-
* surface charts) to fall back to its flat 2D rendering, even when the
|
|
628
|
-
* host has enabled that scene via its own `smartArt3D`/`*Chart3D` prop.
|
|
629
|
-
* A host opting in says "this deck may want 3D"; this is the viewer
|
|
630
|
-
* user's own override for when the WebGL scenes it renders are too much
|
|
631
|
-
* for their machine. See `resolve3DRenderingFlags`.
|
|
632
|
-
*/
|
|
633
|
-
disable3DRendering: boolean;
|
|
634
|
-
/**
|
|
635
|
-
* `p:animEffect/@filter="pixelate"` defaults to snapping the element to
|
|
636
|
-
* its end state (`cutIn`/`cutOut`), matching PowerPoint's own behaviour
|
|
637
|
-
* (COM `CreateVideo` frame-diffing shows PowerPoint performs no animation
|
|
638
|
-
* at all for this filter value). This turns on the blocky mosaic reveal
|
|
639
|
-
* this renderer can build instead, for a viewer that would rather show
|
|
640
|
-
* something animating than PowerPoint's own instant swap. See
|
|
641
|
-
* `resolveFilterEffect` in `animation-filter-effects.ts` and
|
|
642
|
-
* `docs/guide/visual-effects.md`.
|
|
643
|
-
*/
|
|
644
|
-
pixelateMosaicAnimation: boolean;
|
|
645
|
-
openDocumentsView: OpenDocumentsView;
|
|
646
|
-
slideShowShowMenuOnRightClick: boolean;
|
|
647
|
-
slideShowShowPopupToolbar: boolean;
|
|
648
|
-
slideShowPromptKeepInkAnnotations: boolean;
|
|
649
|
-
slideShowEndWithBlackSlide: boolean;
|
|
650
|
-
printInBackground: boolean;
|
|
651
|
-
printHighQuality: boolean;
|
|
652
|
-
printUseMostRecentSettings: boolean;
|
|
653
|
-
printWhat: OptionsPrintWhat;
|
|
654
|
-
printColorMode: OptionsPrintColorMode;
|
|
655
|
-
printHiddenSlides: boolean;
|
|
656
|
-
printScaleToFit: boolean;
|
|
657
|
-
printFrameSlides: boolean;
|
|
658
|
-
}
|
|
659
|
-
interface ViewerRibbonOptions {
|
|
660
|
-
/** Ribbon tabs unticked in Customize Ribbon. The File tab can never be hidden. */
|
|
661
|
-
hiddenTabIds: ToolbarTabId[];
|
|
662
|
-
}
|
|
663
|
-
interface ViewerQuickAccessOptions {
|
|
664
|
-
visible: boolean;
|
|
665
|
-
position: QuickAccessPosition;
|
|
666
|
-
showCommandLabels: boolean;
|
|
667
|
-
/** Ordered ids from `QUICK_ACCESS_COMMAND_CATALOG`. */
|
|
668
|
-
commandIds: string[];
|
|
669
|
-
}
|
|
670
|
-
interface ViewerTrustOptions {
|
|
671
|
-
openInProtectedView: boolean;
|
|
672
|
-
allowExternalContent: boolean;
|
|
673
|
-
confirmExternalHyperlinks: boolean;
|
|
674
|
-
}
|
|
675
|
-
interface ViewerOptions {
|
|
676
|
-
general: ViewerGeneralOptions;
|
|
677
|
-
proofing: ViewerProofingOptions;
|
|
678
|
-
save: ViewerSaveOptions;
|
|
679
|
-
accessibility: ViewerAccessibilityOptions;
|
|
680
|
-
advanced: ViewerAdvancedOptions;
|
|
681
|
-
ribbon: ViewerRibbonOptions;
|
|
682
|
-
quickAccess: ViewerQuickAccessOptions;
|
|
683
|
-
trust: ViewerTrustOptions;
|
|
684
|
-
}
|
|
685
|
-
type ViewerOptionsGroupId = keyof ViewerOptions;
|
|
686
|
-
type ViewerOptionPrimitive = boolean | number | string;
|
|
687
|
-
//#endregion
|
|
688
|
-
//#region src/render/options/viewer-options-controls.d.ts
|
|
689
|
-
/**
|
|
690
|
-
* Control/section/tab descriptor types for the File > Options schema, plus
|
|
691
|
-
* the terse constructors the tab-definition modules build panes with.
|
|
692
|
-
*/
|
|
693
|
-
type ViewerOptionsTabId = 'general' | 'proofing' | 'save' | 'language' | 'accessibility' | 'advanced' | 'ribbon' | 'quickAccess' | 'addIns' | 'trust';
|
|
694
|
-
//#endregion
|
|
695
|
-
//#region src/render/customization/host-menu-commands.d.ts
|
|
696
|
-
/** Snapshot of the slide on which the host command was offered. */
|
|
697
|
-
interface HostCanvasMenuContext {
|
|
698
|
-
slideIndex: number;
|
|
699
|
-
}
|
|
700
|
-
/** Effective selection, including a single right-clicked element. */
|
|
701
|
-
interface HostElementMenuContext extends HostCanvasMenuContext {
|
|
702
|
-
elementIds: readonly string[];
|
|
703
|
-
}
|
|
704
|
-
/** Plain text labels work identically in every framework. */
|
|
705
|
-
interface HostMenuCommand<C> {
|
|
706
|
-
id: string;
|
|
707
|
-
label: string;
|
|
708
|
-
/** Default: a separate group above the built-in commands. */
|
|
709
|
-
group?: 'top' | 'bottom';
|
|
710
|
-
disabled?: boolean | ((context: C) => boolean);
|
|
711
|
-
onSelect: (context: C) => void;
|
|
712
|
-
}
|
|
713
|
-
//#endregion
|
|
714
|
-
//#region src/render/customization/ribbon-control-catalog.d.ts
|
|
715
|
-
declare const RIBBON_CONTROL_CATALOG: {
|
|
716
|
-
readonly home: {
|
|
717
|
-
readonly clipboard: {
|
|
718
|
-
readonly label: 'Clipboard';
|
|
719
|
-
readonly controls: {
|
|
720
|
-
readonly paste: 'Paste';
|
|
721
|
-
readonly cut: 'Cut';
|
|
722
|
-
readonly copy: 'Copy';
|
|
723
|
-
readonly formatPainter: 'Format Painter';
|
|
724
|
-
};
|
|
725
|
-
};
|
|
726
|
-
readonly slides: {
|
|
727
|
-
readonly label: 'Slides';
|
|
728
|
-
readonly controls: {
|
|
729
|
-
readonly newSlide: 'New Slide';
|
|
730
|
-
readonly layout: 'Layout';
|
|
731
|
-
readonly reset: 'Reset';
|
|
732
|
-
readonly section: 'Section';
|
|
733
|
-
readonly slideTemplates: 'Slide templates';
|
|
734
|
-
};
|
|
735
|
-
};
|
|
736
|
-
readonly font: {
|
|
737
|
-
readonly label: 'Font';
|
|
738
|
-
readonly controls: {
|
|
739
|
-
readonly fontFamily: 'Font';
|
|
740
|
-
readonly fontSize: 'Font Size';
|
|
741
|
-
readonly increaseFontSize: 'Increase Font Size';
|
|
742
|
-
readonly decreaseFontSize: 'Decrease Font Size';
|
|
743
|
-
readonly clearFormatting: 'Clear All Formatting';
|
|
744
|
-
readonly bold: 'Bold';
|
|
745
|
-
readonly italic: 'Italic';
|
|
746
|
-
readonly underline: 'Underline';
|
|
747
|
-
readonly strikethrough: 'Strikethrough';
|
|
748
|
-
readonly shadow: 'Text Shadow';
|
|
749
|
-
readonly characterSpacing: 'Character Spacing';
|
|
750
|
-
readonly changeCase: 'Change Case';
|
|
751
|
-
readonly fontColor: 'Font Color';
|
|
752
|
-
readonly highlightColor: 'Text Highlight Color';
|
|
753
|
-
readonly superscript: 'Superscript';
|
|
754
|
-
readonly subscript: 'Subscript';
|
|
755
|
-
};
|
|
756
|
-
};
|
|
757
|
-
readonly paragraph: {
|
|
758
|
-
readonly label: 'Paragraph';
|
|
759
|
-
readonly controls: {
|
|
760
|
-
readonly bullets: 'Bullets (toggle and gallery)';
|
|
761
|
-
readonly numbering: 'Numbering (toggle and gallery)';
|
|
762
|
-
readonly decreaseIndent: 'Decrease List Level';
|
|
763
|
-
readonly increaseIndent: 'Increase List Level';
|
|
764
|
-
readonly lineSpacing: 'Line Spacing';
|
|
765
|
-
readonly alignLeft: 'Align Left';
|
|
766
|
-
readonly alignCenter: 'Center';
|
|
767
|
-
readonly alignRight: 'Align Right';
|
|
768
|
-
readonly justify: 'Justify';
|
|
769
|
-
readonly columns: 'Columns';
|
|
770
|
-
readonly textDirection: 'Text Direction';
|
|
771
|
-
readonly alignText: 'Align Text';
|
|
772
|
-
};
|
|
773
|
-
};
|
|
774
|
-
readonly drawing: {
|
|
775
|
-
readonly label: 'Drawing';
|
|
776
|
-
readonly controls: {
|
|
777
|
-
readonly shapes: 'Shapes';
|
|
778
|
-
readonly arrange: 'Arrange';
|
|
779
|
-
readonly quickStyles: 'Quick Styles (Shape Styles gallery)';
|
|
780
|
-
readonly shapeFill: 'Shape Fill';
|
|
781
|
-
readonly shapeOutline: 'Shape Outline';
|
|
782
|
-
readonly shapeEffects: 'Shape Effects gallery';
|
|
783
|
-
};
|
|
784
|
-
};
|
|
785
|
-
readonly arrange: {
|
|
786
|
-
readonly label: 'Arrange';
|
|
787
|
-
readonly controls: {
|
|
788
|
-
readonly bringForward: 'Bring Forward';
|
|
789
|
-
readonly sendBackward: 'Send Backward';
|
|
790
|
-
readonly bringToFront: 'Bring to Front';
|
|
791
|
-
readonly sendToBack: 'Send to Back';
|
|
792
|
-
readonly flipHorizontal: 'Flip Horizontal';
|
|
793
|
-
readonly flipVertical: 'Flip Vertical';
|
|
794
|
-
readonly duplicate: 'Duplicate';
|
|
795
|
-
readonly delete: 'Delete';
|
|
796
|
-
readonly group: 'Group';
|
|
797
|
-
readonly ungroup: 'Ungroup';
|
|
798
|
-
readonly align: 'Align';
|
|
799
|
-
readonly mergeShapes: 'Merge Shapes';
|
|
800
|
-
readonly crop: 'Crop';
|
|
801
|
-
readonly outlineWidth: 'Outline width';
|
|
802
|
-
};
|
|
803
|
-
};
|
|
804
|
-
readonly editing: {
|
|
805
|
-
readonly label: 'Editing';
|
|
806
|
-
readonly controls: {
|
|
807
|
-
readonly find: 'Find';
|
|
808
|
-
readonly replace: 'Replace';
|
|
809
|
-
readonly select: 'Select';
|
|
810
|
-
};
|
|
811
|
-
};
|
|
812
|
-
};
|
|
813
|
-
readonly insert: {
|
|
814
|
-
readonly slides: {
|
|
815
|
-
readonly label: 'Slides';
|
|
816
|
-
readonly controls: {
|
|
817
|
-
readonly newSlide: 'New Slide';
|
|
818
|
-
};
|
|
819
|
-
};
|
|
820
|
-
readonly tables: {
|
|
821
|
-
readonly label: 'Tables';
|
|
822
|
-
readonly controls: {
|
|
823
|
-
readonly table: 'Table';
|
|
824
|
-
};
|
|
825
|
-
};
|
|
826
|
-
readonly images: {
|
|
827
|
-
readonly label: 'Images';
|
|
828
|
-
readonly controls: {
|
|
829
|
-
readonly pictures: 'Pictures';
|
|
830
|
-
};
|
|
831
|
-
};
|
|
832
|
-
readonly illustrations: {
|
|
833
|
-
readonly label: 'Illustrations';
|
|
834
|
-
readonly controls: {
|
|
835
|
-
readonly shapes: 'Shapes';
|
|
836
|
-
readonly smartArt: 'SmartArt';
|
|
837
|
-
readonly chart: 'Chart';
|
|
838
|
-
};
|
|
839
|
-
};
|
|
840
|
-
readonly links: {
|
|
841
|
-
readonly label: 'Links';
|
|
842
|
-
readonly controls: {
|
|
843
|
-
readonly link: 'Link';
|
|
844
|
-
readonly action: 'Action button';
|
|
845
|
-
};
|
|
846
|
-
};
|
|
847
|
-
readonly comments: {
|
|
848
|
-
readonly label: 'Comments';
|
|
849
|
-
readonly controls: {
|
|
850
|
-
readonly comment: 'Comment';
|
|
851
|
-
};
|
|
852
|
-
};
|
|
853
|
-
readonly text: {
|
|
854
|
-
readonly label: 'Text';
|
|
855
|
-
readonly controls: {
|
|
856
|
-
readonly textBox: 'Text Box';
|
|
857
|
-
readonly field: 'Header, date, slide number field';
|
|
858
|
-
};
|
|
859
|
-
};
|
|
860
|
-
readonly symbols: {
|
|
861
|
-
readonly label: 'Symbols';
|
|
862
|
-
readonly controls: {
|
|
863
|
-
readonly equation: 'Equation';
|
|
864
|
-
readonly symbol: 'Symbol';
|
|
865
|
-
};
|
|
866
|
-
};
|
|
867
|
-
readonly media: {
|
|
868
|
-
readonly label: 'Media';
|
|
869
|
-
readonly controls: {
|
|
870
|
-
readonly media: 'Video / Audio';
|
|
871
|
-
};
|
|
872
|
-
};
|
|
873
|
-
};
|
|
874
|
-
readonly draw: {
|
|
875
|
-
readonly tools: {
|
|
876
|
-
readonly label: 'Drawing Tools';
|
|
877
|
-
readonly controls: {
|
|
878
|
-
readonly select: 'Select';
|
|
879
|
-
readonly pen: 'Pen';
|
|
880
|
-
readonly highlighter: 'Highlighter';
|
|
881
|
-
readonly freeform: 'Freeform';
|
|
882
|
-
readonly eraser: 'Eraser';
|
|
883
|
-
readonly penColor: 'Pen colour';
|
|
884
|
-
readonly penWidth: 'Pen width';
|
|
885
|
-
};
|
|
886
|
-
};
|
|
887
|
-
readonly convert: {
|
|
888
|
-
readonly label: 'Convert';
|
|
889
|
-
readonly controls: {
|
|
890
|
-
readonly inkToShape: 'Ink to Shape';
|
|
891
|
-
};
|
|
892
|
-
};
|
|
893
|
-
};
|
|
894
|
-
readonly design: {
|
|
895
|
-
readonly themes: {
|
|
896
|
-
readonly label: 'Themes';
|
|
897
|
-
readonly controls: {
|
|
898
|
-
readonly browseThemes: 'Themes gallery';
|
|
899
|
-
readonly editTheme: 'Edit theme';
|
|
900
|
-
};
|
|
901
|
-
};
|
|
902
|
-
readonly variants: {
|
|
903
|
-
readonly label: 'Variants';
|
|
904
|
-
readonly controls: {
|
|
905
|
-
readonly colors: 'Variants: Colors gallery';
|
|
906
|
-
readonly fonts: 'Variants: Fonts gallery';
|
|
907
|
-
};
|
|
908
|
-
};
|
|
909
|
-
readonly customize: {
|
|
910
|
-
readonly label: 'Customize';
|
|
911
|
-
readonly controls: {
|
|
912
|
-
readonly slideSize: 'Slide Size';
|
|
913
|
-
readonly formatBackground: 'Format Background';
|
|
914
|
-
};
|
|
915
|
-
};
|
|
916
|
-
};
|
|
917
|
-
readonly transitions: {
|
|
918
|
-
readonly preview: {
|
|
919
|
-
readonly label: 'Preview';
|
|
920
|
-
readonly controls: {
|
|
921
|
-
readonly preview: 'Preview';
|
|
922
|
-
};
|
|
923
|
-
};
|
|
924
|
-
readonly transitionToThisSlide: {
|
|
925
|
-
readonly label: 'Transition to This Slide';
|
|
926
|
-
readonly controls: {
|
|
927
|
-
readonly gallery: 'Transition gallery';
|
|
928
|
-
readonly effectOptions: 'Effect Options';
|
|
929
|
-
};
|
|
930
|
-
};
|
|
931
|
-
readonly timing: {
|
|
932
|
-
readonly label: 'Timing';
|
|
933
|
-
readonly controls: {
|
|
934
|
-
readonly sound: 'Sound';
|
|
935
|
-
readonly duration: 'Duration';
|
|
936
|
-
readonly applyToAll: 'Apply To All';
|
|
937
|
-
readonly advanceOnClick: 'On Mouse Click';
|
|
938
|
-
readonly advanceAfter: 'After';
|
|
939
|
-
};
|
|
940
|
-
};
|
|
941
|
-
};
|
|
942
|
-
readonly animations: {
|
|
943
|
-
readonly preview: {
|
|
944
|
-
readonly label: 'Preview';
|
|
945
|
-
readonly controls: {
|
|
946
|
-
readonly preview: 'Preview';
|
|
947
|
-
};
|
|
948
|
-
};
|
|
949
|
-
readonly animation: {
|
|
950
|
-
readonly label: 'Animation';
|
|
951
|
-
readonly controls: {
|
|
952
|
-
readonly gallery: 'Animation gallery';
|
|
953
|
-
readonly effectOptions: 'Effect Options';
|
|
954
|
-
};
|
|
955
|
-
};
|
|
956
|
-
readonly motionPath: {
|
|
957
|
-
readonly label: 'Motion Paths';
|
|
958
|
-
readonly controls: {
|
|
959
|
-
readonly gallery: 'Motion path gallery';
|
|
960
|
-
};
|
|
961
|
-
};
|
|
962
|
-
readonly advancedAnimation: {
|
|
963
|
-
readonly label: 'Advanced Animation';
|
|
964
|
-
readonly controls: {
|
|
965
|
-
readonly addAnimation: 'Add Animation';
|
|
966
|
-
readonly animationPane: 'Animation Pane';
|
|
967
|
-
readonly trigger: 'Trigger';
|
|
968
|
-
readonly animationPainter: 'Animation Painter';
|
|
969
|
-
readonly remove: 'Remove animation';
|
|
970
|
-
};
|
|
971
|
-
};
|
|
972
|
-
readonly timing: {
|
|
973
|
-
readonly label: 'Timing';
|
|
974
|
-
readonly controls: {
|
|
975
|
-
readonly start: 'Start';
|
|
976
|
-
readonly duration: 'Duration';
|
|
977
|
-
readonly delay: 'Delay';
|
|
978
|
-
readonly reorder: 'Reorder';
|
|
979
|
-
};
|
|
980
|
-
};
|
|
981
|
-
};
|
|
982
|
-
readonly slideShow: {
|
|
983
|
-
readonly startSlideShow: {
|
|
984
|
-
readonly label: 'Start Slide Show';
|
|
985
|
-
readonly controls: {
|
|
986
|
-
readonly fromBeginning: 'From Beginning';
|
|
987
|
-
readonly fromCurrent: 'From Current Slide';
|
|
988
|
-
readonly customShow: 'Custom Slide Show';
|
|
989
|
-
};
|
|
990
|
-
};
|
|
991
|
-
readonly present: {
|
|
992
|
-
readonly label: 'Present';
|
|
993
|
-
readonly controls: {
|
|
994
|
-
readonly presenterView: 'Presenter View';
|
|
995
|
-
readonly broadcast: 'Present Online';
|
|
996
|
-
};
|
|
997
|
-
};
|
|
998
|
-
readonly setUp: {
|
|
999
|
-
readonly label: 'Set Up';
|
|
1000
|
-
readonly controls: {
|
|
1001
|
-
readonly setUpSlideShow: 'Set Up Slide Show';
|
|
1002
|
-
readonly hideSlide: 'Hide Slide';
|
|
1003
|
-
readonly rehearseTimings: 'Rehearse Timings';
|
|
1004
|
-
readonly record: 'Record';
|
|
1005
|
-
readonly rehearseWithCoach: 'Rehearse with Coach';
|
|
1006
|
-
};
|
|
1007
|
-
};
|
|
1008
|
-
readonly captions: {
|
|
1009
|
-
readonly label: 'Captions & Subtitles';
|
|
1010
|
-
readonly controls: {
|
|
1011
|
-
readonly subtitles: 'Always Use Subtitles';
|
|
1012
|
-
readonly subtitleSettings: 'Subtitle Settings';
|
|
1013
|
-
};
|
|
1014
|
-
};
|
|
1015
|
-
};
|
|
1016
|
-
readonly record: {
|
|
1017
|
-
readonly camera: {
|
|
1018
|
-
readonly label: 'Camera';
|
|
1019
|
-
readonly controls: {
|
|
1020
|
-
readonly cameo: 'Cameo';
|
|
1021
|
-
};
|
|
1022
|
-
};
|
|
1023
|
-
readonly record: {
|
|
1024
|
-
readonly label: 'Record';
|
|
1025
|
-
readonly controls: {
|
|
1026
|
-
readonly fromBeginning: 'From Beginning';
|
|
1027
|
-
readonly fromCurrent: 'From Current Slide';
|
|
1028
|
-
};
|
|
1029
|
-
};
|
|
1030
|
-
readonly manage: {
|
|
1031
|
-
readonly label: 'Manage';
|
|
1032
|
-
readonly controls: {
|
|
1033
|
-
readonly clear: 'Clear';
|
|
1034
|
-
readonly reset: 'Reset to Cameo';
|
|
1035
|
-
};
|
|
1036
|
-
};
|
|
1037
|
-
readonly help: {
|
|
1038
|
-
readonly label: 'Help';
|
|
1039
|
-
readonly controls: {
|
|
1040
|
-
readonly learnMore: 'Learn more';
|
|
1041
|
-
};
|
|
1042
|
-
};
|
|
1043
|
-
};
|
|
1044
|
-
readonly review: {
|
|
1045
|
-
readonly proofing: {
|
|
1046
|
-
readonly label: 'Proofing';
|
|
1047
|
-
readonly controls: {
|
|
1048
|
-
readonly spelling: 'Spelling';
|
|
1049
|
-
readonly thesaurus: 'Thesaurus';
|
|
1050
|
-
};
|
|
1051
|
-
};
|
|
1052
|
-
readonly accessibility: {
|
|
1053
|
-
readonly label: 'Accessibility';
|
|
1054
|
-
readonly controls: {
|
|
1055
|
-
readonly check: 'Check Accessibility';
|
|
1056
|
-
};
|
|
1057
|
-
};
|
|
1058
|
-
readonly language: {
|
|
1059
|
-
readonly label: 'Language';
|
|
1060
|
-
readonly controls: {
|
|
1061
|
-
readonly translate: 'Translate';
|
|
1062
|
-
readonly language: 'Language';
|
|
1063
|
-
};
|
|
1064
|
-
};
|
|
1065
|
-
readonly comments: {
|
|
1066
|
-
readonly label: 'Comments';
|
|
1067
|
-
readonly controls: {
|
|
1068
|
-
readonly newComment: 'New Comment';
|
|
1069
|
-
readonly delete: 'Delete';
|
|
1070
|
-
readonly previous: 'Previous';
|
|
1071
|
-
readonly next: 'Next';
|
|
1072
|
-
readonly showComments: 'Show Comments';
|
|
1073
|
-
};
|
|
1074
|
-
};
|
|
1075
|
-
readonly compare: {
|
|
1076
|
-
readonly label: 'Compare';
|
|
1077
|
-
readonly controls: {
|
|
1078
|
-
readonly compare: 'Compare';
|
|
1079
|
-
readonly markAllRead: 'Mark all read';
|
|
1080
|
-
};
|
|
1081
|
-
};
|
|
1082
|
-
readonly protect: {
|
|
1083
|
-
readonly label: 'Protect';
|
|
1084
|
-
readonly controls: {
|
|
1085
|
-
readonly readOnly: 'Read-only';
|
|
1086
|
-
readonly restrictPermission: 'Restrict Permission';
|
|
1087
|
-
};
|
|
1088
|
-
};
|
|
1089
|
-
readonly ink: {
|
|
1090
|
-
readonly label: 'Ink';
|
|
1091
|
-
readonly controls: {
|
|
1092
|
-
readonly hideInk: 'Hide Ink';
|
|
1093
|
-
};
|
|
1094
|
-
};
|
|
1095
|
-
};
|
|
1096
|
-
readonly view: {
|
|
1097
|
-
readonly presentationViews: {
|
|
1098
|
-
readonly label: 'Presentation Views';
|
|
1099
|
-
readonly controls: {
|
|
1100
|
-
readonly normal: 'Normal';
|
|
1101
|
-
readonly outline: 'Outline View';
|
|
1102
|
-
readonly slideSorter: 'Slide Sorter';
|
|
1103
|
-
readonly notesPage: 'Notes Page';
|
|
1104
|
-
readonly readingView: 'Reading View';
|
|
1105
|
-
};
|
|
1106
|
-
};
|
|
1107
|
-
readonly masterViews: {
|
|
1108
|
-
readonly label: 'Master Views';
|
|
1109
|
-
readonly controls: {
|
|
1110
|
-
readonly slideMaster: 'Slide Master';
|
|
1111
|
-
readonly handoutMaster: 'Handout Master';
|
|
1112
|
-
readonly notesMaster: 'Notes Master';
|
|
1113
|
-
};
|
|
1114
|
-
};
|
|
1115
|
-
readonly show: {
|
|
1116
|
-
readonly label: 'Show';
|
|
1117
|
-
readonly controls: {
|
|
1118
|
-
readonly ruler: 'Ruler';
|
|
1119
|
-
readonly gridlines: 'Gridlines';
|
|
1120
|
-
readonly guides: 'Guides';
|
|
1121
|
-
readonly snapToGrid: 'Snap to Grid';
|
|
1122
|
-
readonly snapToShape: 'Snap to Shape';
|
|
1123
|
-
readonly addGuide: 'Add horizontal / vertical guide';
|
|
1124
|
-
readonly selectionPane: 'Selection Pane';
|
|
1125
|
-
readonly eyedropper: 'Eyedropper';
|
|
1126
|
-
readonly notes: 'Notes';
|
|
1127
|
-
};
|
|
1128
|
-
};
|
|
1129
|
-
readonly zoom: {
|
|
1130
|
-
readonly label: 'Zoom';
|
|
1131
|
-
readonly controls: {
|
|
1132
|
-
readonly zoom: 'Zoom';
|
|
1133
|
-
readonly fitToWindow: 'Fit to Window';
|
|
1134
|
-
};
|
|
1135
|
-
};
|
|
1136
|
-
readonly window: {
|
|
1137
|
-
readonly label: 'Window';
|
|
1138
|
-
readonly controls: {
|
|
1139
|
-
readonly templateEditing: 'Edit template elements';
|
|
1140
|
-
readonly macros: 'Macros';
|
|
1141
|
-
};
|
|
1142
|
-
};
|
|
1143
|
-
};
|
|
1144
|
-
readonly help: {
|
|
1145
|
-
readonly help: {
|
|
1146
|
-
readonly label: 'Help';
|
|
1147
|
-
readonly controls: {
|
|
1148
|
-
readonly options: 'Options';
|
|
1149
|
-
readonly keyboardShortcuts: 'Keyboard shortcuts';
|
|
1150
|
-
readonly accessibility: 'Accessibility checker';
|
|
1151
|
-
};
|
|
1152
|
-
};
|
|
1153
|
-
};
|
|
1154
|
-
readonly shapeFormat: {
|
|
1155
|
-
readonly shapeStyles: {
|
|
1156
|
-
readonly label: 'Shape Styles';
|
|
1157
|
-
readonly controls: {
|
|
1158
|
-
readonly gallery: 'Shape Styles gallery';
|
|
1159
|
-
readonly shapeEffects: 'Shape Effects gallery';
|
|
1160
|
-
};
|
|
1161
|
-
};
|
|
1162
|
-
readonly wordArtStyles: {
|
|
1163
|
-
readonly label: 'WordArt Styles';
|
|
1164
|
-
readonly controls: {
|
|
1165
|
-
readonly gallery: 'WordArt Styles gallery';
|
|
1166
|
-
};
|
|
1167
|
-
};
|
|
1168
|
-
};
|
|
1169
|
-
readonly pictureFormat: {
|
|
1170
|
-
readonly adjust: {
|
|
1171
|
-
readonly label: 'Adjust';
|
|
1172
|
-
readonly controls: {
|
|
1173
|
-
readonly corrections: 'Corrections gallery';
|
|
1174
|
-
readonly color: 'Color gallery';
|
|
1175
|
-
readonly artisticEffects: 'Artistic Effects gallery';
|
|
1176
|
-
};
|
|
1177
|
-
};
|
|
1178
|
-
readonly pictureStyles: {
|
|
1179
|
-
readonly label: 'Picture Styles';
|
|
1180
|
-
readonly controls: {
|
|
1181
|
-
readonly gallery: 'Picture Styles gallery';
|
|
1182
|
-
readonly pictureEffects: 'Picture Effects gallery';
|
|
1183
|
-
};
|
|
1184
|
-
};
|
|
1185
|
-
};
|
|
1186
|
-
readonly tableDesign: {
|
|
1187
|
-
readonly tableStyles: {
|
|
1188
|
-
readonly label: 'Table Styles';
|
|
1189
|
-
readonly controls: {
|
|
1190
|
-
readonly gallery: 'Table Styles gallery';
|
|
1191
|
-
};
|
|
1192
|
-
};
|
|
1193
|
-
};
|
|
1194
|
-
readonly chartDesign: {
|
|
1195
|
-
readonly chartLayouts: {
|
|
1196
|
-
readonly label: 'Chart Layouts';
|
|
1197
|
-
readonly controls: {
|
|
1198
|
-
readonly quickLayout: 'Quick Layout gallery';
|
|
1199
|
-
};
|
|
1200
|
-
};
|
|
1201
|
-
readonly chartStyles: {
|
|
1202
|
-
readonly label: 'Chart Styles';
|
|
1203
|
-
readonly controls: {
|
|
1204
|
-
readonly changeColors: 'Change Colors gallery';
|
|
1205
|
-
readonly gallery: 'Chart Styles gallery';
|
|
1206
|
-
};
|
|
1207
|
-
};
|
|
1208
|
-
};
|
|
1209
|
-
readonly smartArtDesign: {
|
|
1210
|
-
readonly createGraphic: {
|
|
1211
|
-
readonly label: 'Create Graphic';
|
|
1212
|
-
readonly controls: {
|
|
1213
|
-
readonly addShape: 'Add Shape';
|
|
1214
|
-
readonly addBullet: 'Add Bullet';
|
|
1215
|
-
readonly textPane: 'Text Pane';
|
|
1216
|
-
readonly promote: 'Promote';
|
|
1217
|
-
readonly demote: 'Demote';
|
|
1218
|
-
readonly rightToLeft: 'Right to Left';
|
|
1219
|
-
readonly moveUp: 'Move Up';
|
|
1220
|
-
readonly moveDown: 'Move Down';
|
|
1221
|
-
};
|
|
1222
|
-
};
|
|
1223
|
-
readonly layouts: {
|
|
1224
|
-
readonly label: 'Layouts';
|
|
1225
|
-
readonly controls: {
|
|
1226
|
-
readonly gallery: 'Layouts gallery';
|
|
1227
|
-
};
|
|
1228
|
-
};
|
|
1229
|
-
readonly smartArtStyles: {
|
|
1230
|
-
readonly label: 'SmartArt Styles';
|
|
1231
|
-
readonly controls: {
|
|
1232
|
-
readonly changeColors: 'Change Colors gallery';
|
|
1233
|
-
readonly gallery: 'SmartArt Styles gallery';
|
|
1234
|
-
};
|
|
1235
|
-
};
|
|
1236
|
-
readonly reset: {
|
|
1237
|
-
readonly label: 'Reset';
|
|
1238
|
-
readonly controls: {
|
|
1239
|
-
readonly resetGraphic: 'Reset Graphic';
|
|
1240
|
-
readonly convert: 'Convert';
|
|
1241
|
-
};
|
|
1242
|
-
};
|
|
1243
|
-
};
|
|
1244
|
-
};
|
|
1245
|
-
//#endregion
|
|
1246
|
-
//#region src/render/customization/ribbon-control-ids.d.ts
|
|
1247
|
-
type Catalog = typeof RIBBON_CONTROL_CATALOG;
|
|
1248
|
-
/** `<tab>.<group>`, for example `home.font`. */
|
|
1249
|
-
type RibbonGroupId = { [T in keyof Catalog]: { [G in keyof Catalog[T]]: `${T & string}.${G & string}`; }[keyof Catalog[T]]; }[keyof Catalog];
|
|
1250
|
-
/** `<tab>.<group>.<control>`, for example `home.font.bold`. */
|
|
1251
|
-
type RibbonControlId = { [T in keyof Catalog]: { [G in keyof Catalog[T]]: Catalog[T][G] extends {
|
|
1252
|
-
controls: infer C;
|
|
1253
|
-
} ? `${T & string}.${G & string}.${keyof C & string}` : never; }[keyof Catalog[T]]; }[keyof Catalog];
|
|
1254
|
-
//#endregion
|
|
1255
|
-
//#region src/render/customization/customization-types.d.ts
|
|
1256
|
-
/** Keys of an options group whose value is a primitive (not an array). */
|
|
1257
|
-
type PrimitiveKeys<T> = { [K in keyof T]: T[K] extends ViewerOptionPrimitive ? K : never; }[keyof T] & string;
|
|
1258
|
-
/**
|
|
1259
|
-
* One File > Options setting, addressed as `<group>.<key>`, for example
|
|
1260
|
-
* `general.userName` or `advanced.showGrid`. The union is derived from the
|
|
1261
|
-
* `ViewerOptions` model itself, so a typo is a compile error.
|
|
1262
|
-
*/
|
|
1263
|
-
type OptionsSettingId = { [G in ViewerOptionsGroupId]: `${G}.${PrimitiveKeys<ViewerOptions[G]>}`; }[ViewerOptionsGroupId];
|
|
1264
|
-
/**
|
|
1265
|
-
* A File > Options page: the ten PowerPoint categories plus `ai`, the AI
|
|
1266
|
-
* assistant page a binding adds when the host configured an assistant.
|
|
1267
|
-
*/
|
|
1268
|
-
type OptionsPageId = ViewerOptionsTabId | 'ai';
|
|
1269
|
-
/**
|
|
1270
|
-
* One section of an Options page, addressed as `<page>.<section>`, for
|
|
1271
|
-
* example `general.personalize` or `advanced.print`. The full list is
|
|
1272
|
-
* `OPTIONS_SECTION_IDS` (derived from the schema at runtime).
|
|
1273
|
-
*/
|
|
1274
|
-
type OptionsSectionId = `${ViewerOptionsTabId}.${string}`;
|
|
1275
|
-
/** Values a host forces onto settings. */
|
|
1276
|
-
type OptionsSettingValues = Partial<Record<OptionsSettingId, ViewerOptionPrimitive>>;
|
|
1277
|
-
/** Ribbon and toolbar customisation. */
|
|
1278
|
-
interface RibbonCustomization {
|
|
1279
|
-
/**
|
|
1280
|
-
* Ribbon tabs to remove (the File tab included, unlike Customize Ribbon),
|
|
1281
|
-
* and contextual tabs (`shapeFormat`, `pictureFormat`, ...) that should
|
|
1282
|
-
* never appear.
|
|
1283
|
-
*/
|
|
1284
|
-
hiddenTabs?: readonly (ToolbarTabId | RibbonContextualTabId)[];
|
|
1285
|
-
/** Groups inside a tab to remove, as `<tab>.<group>` (`home.font`). */
|
|
1286
|
-
hiddenGroups?: readonly RibbonGroupId[];
|
|
1287
|
-
/**
|
|
1288
|
-
* Controls to remove: a top-level toolbar button / control cluster
|
|
1289
|
-
* (`share`, `zoom`, ...) or any ribbon control as
|
|
1290
|
-
* `<tab>.<group>.<control>` (`home.font.bold`).
|
|
1291
|
-
*/
|
|
1292
|
-
hiddenButtons?: readonly (ToolbarButtonId | RibbonControlId)[];
|
|
1293
|
-
}
|
|
1294
|
-
/** File > Options (the Settings dialog) customisation. */
|
|
1295
|
-
interface OptionsCustomization {
|
|
1296
|
-
/** Whole pages to remove from the dialog's category rail. */
|
|
1297
|
-
hiddenPages?: readonly OptionsPageId[];
|
|
1298
|
-
/** Sections (`<page>.<section>`) to remove from their page. */
|
|
1299
|
-
hiddenSections?: readonly OptionsSectionId[];
|
|
1300
|
-
/** Individual settings (`<group>.<key>`) to remove wherever they appear. */
|
|
1301
|
-
hiddenSettings?: readonly OptionsSettingId[];
|
|
1302
|
-
/**
|
|
1303
|
-
* Settings pinned to a fixed value. The value is forced into the options
|
|
1304
|
-
* store, user edits to it are ignored, and the control renders read-only.
|
|
1305
|
-
* Add the id to `hiddenSettings` too to lock it invisibly.
|
|
1306
|
-
*/
|
|
1307
|
-
locked?: OptionsSettingValues;
|
|
1308
|
-
/**
|
|
1309
|
-
* Host defaults: the value a setting starts at when the user has not saved
|
|
1310
|
-
* a choice of their own. "Reset" returns to these, not to the built-ins.
|
|
1311
|
-
*/
|
|
1312
|
-
defaults?: OptionsSettingValues;
|
|
1313
|
-
}
|
|
1314
|
-
/** File tab (backstage) customisation. */
|
|
1315
|
-
interface BackstageCustomization {
|
|
1316
|
-
/** Navigation entries (pages) to remove from the File tab. */
|
|
1317
|
-
hiddenPages?: readonly BackstagePage[];
|
|
1318
|
-
/** Action cards to remove from the pages that show them. */
|
|
1319
|
-
hiddenCards?: readonly BackstageCardId[];
|
|
1320
|
-
}
|
|
1321
|
-
/** Right-click menu customisation. */
|
|
1322
|
-
interface ContextMenuCustomization {
|
|
1323
|
-
/** Additional host commands, independent of the viewer's AI connection. */
|
|
1324
|
-
extraElementCommands?: readonly HostMenuCommand<HostElementMenuContext>[];
|
|
1325
|
-
extraCanvasCommands?: readonly HostMenuCommand<HostCanvasMenuContext>[];
|
|
1326
|
-
/** Entries to remove from the element (right-click on a shape) menu. */
|
|
1327
|
-
hiddenElementCommands?: readonly ContextMenuCommandId[];
|
|
1328
|
-
/** Entries to remove from the empty-canvas menu. */
|
|
1329
|
-
hiddenCanvasCommands?: readonly CanvasContextMenuCommandId[];
|
|
1330
|
-
/**
|
|
1331
|
-
* Entries to remove from the Edit Points menu (right-click a vertex or a
|
|
1332
|
-
* segment while editing a shape's points).
|
|
1333
|
-
*/
|
|
1334
|
-
hiddenEditPointsCommands?: readonly EditPointsCommandId[];
|
|
1335
|
-
/** Remove the element context menu entirely. */
|
|
1336
|
-
disableElementMenu?: boolean;
|
|
1337
|
-
/** Remove the empty-canvas context menu entirely. */
|
|
1338
|
-
disableCanvasMenu?: boolean;
|
|
1339
|
-
}
|
|
1340
|
-
/**
|
|
1341
|
-
* A shortcut chord in the form `Mod+Shift+D`: modifiers `Mod` (Ctrl on
|
|
1342
|
-
* Windows/Linux, Cmd on macOS), `Ctrl`, `Meta`, `Alt`, `Shift`, joined by `+`,
|
|
1343
|
-
* followed by a `KeyboardEvent.key` value (`D`, `Delete`, `ArrowLeft`, `F2`).
|
|
1344
|
-
*/
|
|
1345
|
-
type ShortcutChord = string;
|
|
1346
|
-
/** Editor keyboard-shortcut customisation. */
|
|
1347
|
-
interface KeyboardCustomization {
|
|
1348
|
-
/** Turn every editor shortcut off (the host owns the keyboard). */
|
|
1349
|
-
disableAll?: boolean;
|
|
1350
|
-
/** Editor commands whose shortcut is turned off. */
|
|
1351
|
-
disabled?: readonly EditorKeyActionName[];
|
|
1352
|
-
/**
|
|
1353
|
-
* Replacement chords per command. A remapped command no longer answers to
|
|
1354
|
-
* its built-in chord; it answers to the chord(s) given here instead.
|
|
1355
|
-
*/
|
|
1356
|
-
remap?: Partial<Record<EditorKeyActionName, ShortcutChord | readonly ShortcutChord[]>>;
|
|
1357
|
-
}
|
|
1358
|
-
/**
|
|
1359
|
-
* Chrome regions a host can remove. Each id maps onto one region in every
|
|
1360
|
-
* binding; see `VIEWER_PANEL_IDS` for the catalogue.
|
|
1361
|
-
*/
|
|
1362
|
-
type ViewerPanelId = 'statusBar' | 'slidesPane' | 'inspector' | 'notes' | 'quickAccessToolbar' | 'titleBar';
|
|
1363
|
-
/** Feature areas that can be switched off as a whole. */
|
|
1364
|
-
type ViewerFeatureId = 'ai' | 'collaboration' | 'comments' | 'presentMode' | 'editPoints';
|
|
1365
|
-
/**
|
|
1366
|
-
* The click-to-place drawing tools of Insert > Shapes > Lines: Freeform:
|
|
1367
|
-
* Shape and Curve.
|
|
1368
|
-
*/
|
|
1369
|
-
type ViewerDrawingToolId = FreeformToolKind;
|
|
1370
|
-
/** Dialogs (and the entry points that open them) a host can remove. */
|
|
1371
|
-
type ViewerDialogId = 'options' | 'share' | 'broadcast' | 'print' | 'export';
|
|
1372
|
-
/** Export formats offered by the File > Export page. */
|
|
1373
|
-
type ViewerExportFormatId = 'pdf' | 'png' | 'video' | 'gif' | 'json' | 'copyImage';
|
|
1374
|
-
/**
|
|
1375
|
-
* The whole customisation object. Every field is optional; omitted fields hide
|
|
1376
|
-
* nothing and lock nothing.
|
|
1377
|
-
*/
|
|
1378
|
-
interface ViewerCustomization {
|
|
1379
|
-
ribbon?: RibbonCustomization;
|
|
1380
|
-
options?: OptionsCustomization;
|
|
1381
|
-
backstage?: BackstageCustomization;
|
|
1382
|
-
contextMenu?: ContextMenuCustomization;
|
|
1383
|
-
keyboard?: KeyboardCustomization;
|
|
1384
|
-
/** Chrome regions to remove (`true` hides). */
|
|
1385
|
-
hiddenPanels?: readonly ViewerPanelId[];
|
|
1386
|
-
/** Feature areas to switch off (their buttons, menus, pages and panels). */
|
|
1387
|
-
disabledFeatures?: readonly ViewerFeatureId[];
|
|
1388
|
-
/** Dialogs to remove, along with every entry point that opens them. */
|
|
1389
|
-
hiddenDialogs?: readonly ViewerDialogId[];
|
|
1390
|
-
/** Export formats to remove from File > Export. */
|
|
1391
|
-
hiddenExportFormats?: readonly ViewerExportFormatId[];
|
|
1392
|
-
/** Drawing tools to remove from the Insert > Shapes gallery. */
|
|
1393
|
-
hiddenDrawingTools?: readonly ViewerDrawingToolId[];
|
|
1394
|
-
}
|
|
1395
|
-
//#endregion
|
|
1396
|
-
//#region src/render/customization/customization-controller.d.ts
|
|
1397
|
-
/** The imperative methods every binding's component handle exposes. */
|
|
1398
|
-
interface ViewerCustomizationApi {
|
|
1399
|
-
/** The current customisation object (a snapshot; do not mutate). */
|
|
1400
|
-
getCustomization(): ViewerCustomization;
|
|
1401
|
-
/** Replace the whole customisation. */
|
|
1402
|
-
setCustomization(next: ViewerCustomization): void;
|
|
1403
|
-
/** Merge a partial customisation (see `mergeCustomization`). */
|
|
1404
|
-
updateCustomization(patch: ViewerCustomization): void;
|
|
1405
|
-
/** Drop every customisation, back to the stock UI. */
|
|
1406
|
-
resetCustomization(): void;
|
|
1407
|
-
/** Hide a fixed tab, or stop a contextual tab (`shapeFormat`, ...) from appearing. */
|
|
1408
|
-
hideRibbonTab(tab: ToolbarTabId | RibbonContextualTabId): void;
|
|
1409
|
-
showRibbonTab(tab: ToolbarTabId | RibbonContextualTabId): void;
|
|
1410
|
-
/** Hide a group inside a tab (`home.font`). */
|
|
1411
|
-
hideRibbonGroup(group: RibbonGroupId): void;
|
|
1412
|
-
showRibbonGroup(group: RibbonGroupId): void;
|
|
1413
|
-
/** Hide a top-level toolbar button or any ribbon control (`home.font.bold`). */
|
|
1414
|
-
hideToolbarButton(button: ToolbarButtonId | RibbonControlId): void;
|
|
1415
|
-
showToolbarButton(button: ToolbarButtonId | RibbonControlId): void;
|
|
1416
|
-
/** Alias of `hideToolbarButton` for a ribbon control id. */
|
|
1417
|
-
hideRibbonControl(control: RibbonControlId): void;
|
|
1418
|
-
showRibbonControl(control: RibbonControlId): void;
|
|
1419
|
-
hideOptionsPage(page: OptionsPageId): void;
|
|
1420
|
-
showOptionsPage(page: OptionsPageId): void;
|
|
1421
|
-
hideOptionsSection(section: OptionsSectionId): void;
|
|
1422
|
-
showOptionsSection(section: OptionsSectionId): void;
|
|
1423
|
-
hideSetting(setting: OptionsSettingId): void;
|
|
1424
|
-
showSetting(setting: OptionsSettingId): void;
|
|
1425
|
-
/** Pin a setting to `value`; `hidden` also removes it from the dialog. */
|
|
1426
|
-
lockSetting(setting: OptionsSettingId, value: ViewerOptionPrimitive, hidden?: boolean): void;
|
|
1427
|
-
unlockSetting(setting: OptionsSettingId): void;
|
|
1428
|
-
/** Set (or with `undefined`, clear) the host default for a setting. */
|
|
1429
|
-
setSettingDefault(setting: OptionsSettingId, value: ViewerOptionPrimitive | undefined): void;
|
|
1430
|
-
hideBackstagePage(page: BackstagePage): void;
|
|
1431
|
-
showBackstagePage(page: BackstagePage): void;
|
|
1432
|
-
hideBackstageCard(card: BackstageCardId): void;
|
|
1433
|
-
showBackstageCard(card: BackstageCardId): void;
|
|
1434
|
-
hideContextMenuCommand(command: ContextMenuCommandId): void;
|
|
1435
|
-
showContextMenuCommand(command: ContextMenuCommandId): void;
|
|
1436
|
-
hideCanvasContextMenuCommand(command: CanvasContextMenuCommandId): void;
|
|
1437
|
-
showCanvasContextMenuCommand(command: CanvasContextMenuCommandId): void;
|
|
1438
|
-
disableShortcut(action: EditorKeyActionName): void;
|
|
1439
|
-
enableShortcut(action: EditorKeyActionName): void;
|
|
1440
|
-
/** Move a command onto new chord(s); `undefined` restores the built-in chord. */
|
|
1441
|
-
remapShortcut(action: EditorKeyActionName, chords: ShortcutChord | readonly ShortcutChord[] | undefined): void;
|
|
1442
|
-
setPanelVisible(panel: ViewerPanelId, visible: boolean): void;
|
|
1443
|
-
setFeatureEnabled(feature: ViewerFeatureId, enabled: boolean): void;
|
|
1444
|
-
setDialogAvailable(dialog: ViewerDialogId, available: boolean): void;
|
|
1445
|
-
}
|
|
1446
|
-
//#endregion
|
|
1447
|
-
//#region src/render/ribbon-command-view.d.ts
|
|
1448
|
-
/** A host supplies translated labels and controlled state; shared owns markup. */
|
|
1449
|
-
interface RibbonCommandView {
|
|
1450
|
-
id: RibbonControlId;
|
|
1451
|
-
label: string;
|
|
1452
|
-
icon: string;
|
|
1453
|
-
title?: string;
|
|
1454
|
-
disabled?: boolean;
|
|
1455
|
-
active?: boolean;
|
|
1456
|
-
pressed?: boolean;
|
|
1457
|
-
expanded?: boolean;
|
|
1458
|
-
hidden?: boolean;
|
|
1459
|
-
compact?: boolean;
|
|
1460
|
-
/** Opens a menu or panel: draws PowerPoint's drop-down chevron after the label. */
|
|
1461
|
-
caret?: boolean;
|
|
1462
|
-
badge?: number;
|
|
1463
|
-
/** Commands with the same column share a vertical stack. */
|
|
1464
|
-
column?: number;
|
|
1465
|
-
}
|
|
1466
|
-
interface RibbonGroupView {
|
|
1467
|
-
id: RibbonGroupId;
|
|
1468
|
-
label: string;
|
|
1469
|
-
commands: readonly RibbonCommandView[];
|
|
1470
|
-
}
|
|
1471
|
-
/**
|
|
1472
|
-
* A font supplied by the host application. The package never ships fonts:
|
|
1473
|
-
* applications provide a licensed URL, data URL, or blob URL for their users.
|
|
1474
|
-
*/
|
|
1475
|
-
interface ViewerFontSource {
|
|
1476
|
-
family: string;
|
|
1477
|
-
src: string;
|
|
1478
|
-
format?: 'truetype' | 'opentype' | 'woff' | 'woff2';
|
|
1479
|
-
weight?: string | number;
|
|
1480
|
-
style?: 'normal' | 'italic';
|
|
1481
|
-
}
|
|
1482
|
-
//#endregion
|
|
1483
|
-
//#region src/render/session-restore.d.ts
|
|
1484
|
-
/**
|
|
1485
|
-
* session-restore: keep the deck a host app has open across a page refresh.
|
|
1486
|
-
*
|
|
1487
|
-
* A host (the demo apps, or any embedder) owns the bytes it hands to the
|
|
1488
|
-
* viewer, so a plain reload drops them and the user lands back on the file
|
|
1489
|
-
* dropzone with their presentation gone. This store remembers the open deck in
|
|
1490
|
-
* IndexedDB and hands it back on the next load.
|
|
1491
|
-
*
|
|
1492
|
-
* Scope is deliberately per-tab: the record is keyed by an id kept in
|
|
1493
|
-
* `sessionStorage`, which survives a reload but NOT a new tab. Refreshing
|
|
1494
|
-
* restores the deck this tab had open, while a second tab opened on the same
|
|
1495
|
-
* origin still starts on the landing page, and two tabs holding different decks
|
|
1496
|
-
* never steal each other's content.
|
|
1497
|
-
*
|
|
1498
|
-
* `restoreSessionDeck` additionally prefers a NEWER autosave snapshot for the
|
|
1499
|
-
* same file (see `./autosave-store`), so a refresh mid-edit comes back with the
|
|
1500
|
-
* edited deck rather than the pristine bytes that were first opened.
|
|
1501
|
-
*
|
|
1502
|
-
* Every operation is best-effort: a blocked IndexedDB, a partitioned
|
|
1503
|
-
* `sessionStorage`, or an exhausted quota degrades to "no restore", never to a
|
|
1504
|
-
* thrown error in the host.
|
|
1505
|
-
*/
|
|
1506
|
-
/** A deck remembered for the current tab. */
|
|
1507
|
-
interface SessionDeck {
|
|
1508
|
-
/** File name the deck was opened under, used as the autosave key. */
|
|
1509
|
-
fileName: string;
|
|
1510
|
-
/** The presentation bytes. */
|
|
1511
|
-
data: Uint8Array;
|
|
1512
|
-
/** When these bytes were remembered (epoch ms). */
|
|
1513
|
-
timestamp: number;
|
|
1514
|
-
}
|
|
1515
|
-
/**
|
|
1516
|
-
* This tab's session id, or `null` when `sessionStorage` is unavailable (a
|
|
1517
|
-
* sandboxed iframe, or a browser with storage disabled).
|
|
1518
|
-
*
|
|
1519
|
-
* @param create Mint and persist an id when the tab does not have one yet.
|
|
1520
|
-
* Reads pass `false` so a fresh tab never claims another tab's record.
|
|
1521
|
-
*/
|
|
1522
|
-
declare function getSessionTabId(create?: boolean): string | null;
|
|
1523
|
-
/**
|
|
1524
|
-
* Remember `data` as the deck this tab has open, so the next load can restore
|
|
1525
|
-
* it. Resolves `false` when the browser refused to store it; callers treat that
|
|
1526
|
-
* as "no restore available later", never as an error.
|
|
1527
|
-
*/
|
|
1528
|
-
declare function rememberSessionDeck(fileName: string, data: Uint8Array): Promise<boolean>;
|
|
1529
|
-
/** The deck remembered for this tab, or `null` when there is nothing to restore. */
|
|
1530
|
-
declare function loadSessionDeck(): Promise<SessionDeck | null>;
|
|
1531
|
-
/** Forget this tab's deck (the host closed it, or handed the tab to another flow). */
|
|
1532
|
-
declare function forgetSessionDeck(): Promise<void>;
|
|
1533
|
-
/**
|
|
1534
|
-
* The deck to reopen on load: this tab's remembered bytes, upgraded to a newer
|
|
1535
|
-
* autosave snapshot of the same file when the viewer wrote one after they were
|
|
1536
|
-
* remembered. Without that upgrade a refresh mid-edit would silently roll the
|
|
1537
|
-
* presentation back to the state it was opened in.
|
|
1538
|
-
*/
|
|
1539
|
-
declare function restoreSessionDeck(): Promise<SessionDeck | null>;
|
|
1540
|
-
//#endregion
|
|
1541
|
-
//#region src/render/presentation-session-types.d.ts
|
|
1542
|
-
interface PresentationSnapshot {
|
|
1543
|
-
slideIndex: number;
|
|
1544
|
-
buildStep: number;
|
|
1545
|
-
sequence: number;
|
|
1546
|
-
blackout: 'none' | 'black' | 'white';
|
|
1547
|
-
paused: boolean;
|
|
1548
|
-
elapsedMs: number;
|
|
1549
|
-
zoom?: PresentationZoomState;
|
|
1550
|
-
pointer?: PresentationPointerState;
|
|
1551
|
-
inkStrokes?: PresentationInkStroke[];
|
|
1552
|
-
/**
|
|
1553
|
-
* Whether ink markup is drawn (PowerPoint's Ctrl+M). Undefined means visible,
|
|
1554
|
-
* so existing snapshots keep showing their ink. Hiding never discards the
|
|
1555
|
-
* strokes, which stay in `inkStrokes` and can be kept on exit.
|
|
1556
|
-
*/
|
|
1557
|
-
inkMarkupVisible?: boolean;
|
|
1558
|
-
caption?: string;
|
|
1559
|
-
subtitlesVisible?: boolean;
|
|
1560
|
-
}
|
|
1561
|
-
interface PresentationZoomState {
|
|
1562
|
-
scale: number;
|
|
1563
|
-
originX: number;
|
|
1564
|
-
originY: number;
|
|
1565
|
-
}
|
|
1566
|
-
type PresentationPointerTool = 'none' | 'laser' | 'pen' | 'highlighter' | 'eraser';
|
|
1567
|
-
interface PresentationPointerState {
|
|
1568
|
-
tool: PresentationPointerTool;
|
|
1569
|
-
x: number;
|
|
1570
|
-
y: number;
|
|
1571
|
-
color: string;
|
|
1572
|
-
}
|
|
1573
|
-
interface PresentationInkPoint {
|
|
1574
|
-
x: number;
|
|
1575
|
-
y: number;
|
|
1576
|
-
}
|
|
1577
|
-
interface PresentationInkStroke {
|
|
1578
|
-
id: string;
|
|
1579
|
-
slideIndex: number;
|
|
1580
|
-
tool: 'pen' | 'highlighter';
|
|
1581
|
-
color: string;
|
|
1582
|
-
width: number;
|
|
1583
|
-
points: PresentationInkPoint[];
|
|
1584
|
-
}
|
|
1585
|
-
/**
|
|
1586
|
-
* Store PPTX content bytes so the audience tab can retrieve them.
|
|
1587
|
-
* Called by the presenter before opening the audience window.
|
|
1588
|
-
*/
|
|
1589
|
-
declare function storeAudienceContent(content: ArrayBuffer | Uint8Array, sessionId?: string): Promise<void>;
|
|
1590
|
-
/**
|
|
1591
|
-
* Load PPTX content bytes stored by the presenter tab.
|
|
1592
|
-
* Returns `null` if nothing is stored.
|
|
1593
|
-
*/
|
|
1594
|
-
declare function loadAudienceContent(sessionId?: string): Promise<Uint8Array | null>;
|
|
1595
|
-
/**
|
|
1596
|
-
* Remove stored audience content (cleanup).
|
|
1597
|
-
*/
|
|
1598
|
-
declare function clearAudienceContent(sessionId?: string): Promise<void>;
|
|
1599
|
-
//#endregion
|
|
1600
|
-
//#region src/render/presentation-blackboard.d.ts
|
|
1601
|
-
/** Blackout state, as carried by {@link PresentationSnapshot}. */
|
|
1602
|
-
type PresentationBlackout = PresentationSnapshot['blackout'];
|
|
1603
|
-
//#endregion
|
|
1604
|
-
//#region src/render/chrome-controls-state.d.ts
|
|
1605
|
-
type ChromeTranslate = (key: string, params?: Record<string, string | number>) => string;
|
|
1606
|
-
type ReadOnlyBannerPasswordError = 'wrong-password' | 'unsupported-algorithm';
|
|
1607
|
-
interface ReadOnlyBannerViewState {
|
|
1608
|
-
/** `ReadOnlyRecommendation.kind`; mirrored onto the host's `data-kind`. */
|
|
1609
|
-
kind: string | null;
|
|
1610
|
-
/** `ReadOnlyRecommendation.messageKey`, translated by `translate`. */
|
|
1611
|
-
messageKey: string;
|
|
1612
|
-
/** Swap the Edit anyway / Dismiss pair for the inline password form. */
|
|
1613
|
-
passwordPromptOpen?: boolean;
|
|
1614
|
-
passwordError?: ReadOnlyBannerPasswordError | null;
|
|
1615
|
-
/** Disables the form while a submitted password is being checked. */
|
|
1616
|
-
checkingPassword?: boolean;
|
|
1617
|
-
translate?: ChromeTranslate;
|
|
1618
|
-
}
|
|
1619
|
-
interface PasteOptionsViewState {
|
|
1620
|
-
/** Right edge of the pasted element in viewport pixels. */
|
|
1621
|
-
left: number;
|
|
1622
|
-
/** Bottom edge of the pasted element in viewport pixels. */
|
|
1623
|
-
top: number;
|
|
1624
|
-
translate?: ChromeTranslate;
|
|
1625
|
-
}
|
|
1626
|
-
interface CompatToastViewItem {
|
|
1627
|
-
readonly id: string;
|
|
1628
|
-
readonly code: string;
|
|
1629
|
-
readonly severity: 'info' | 'warning';
|
|
1630
|
-
readonly messageKey: string;
|
|
1631
|
-
readonly params?: Readonly<Record<string, string>>;
|
|
1632
|
-
}
|
|
1633
|
-
interface CompatToastsViewState {
|
|
1634
|
-
/** Dismiss-filtered toasts. The element shows the first {@link COMPAT_TOAST_VISIBLE_LIMIT}. */
|
|
1635
|
-
toasts: readonly CompatToastViewItem[];
|
|
1636
|
-
/** Extra toasts a host already trimmed off the list it passes. */
|
|
1637
|
-
overflowCount?: number;
|
|
1638
|
-
/** Width of the open right-docked panel (see `compatToastStackStyle`). */
|
|
1639
|
-
rightInset?: number;
|
|
1640
|
-
/** Live height of the docked notes strip (see `compatToastStackStyle`). */
|
|
1641
|
-
bottomInset?: number;
|
|
1642
|
-
translate?: ChromeTranslate;
|
|
1643
|
-
}
|
|
1644
|
-
type DialogFooterVariant = 'secondary' | 'primary' | 'warning' | 'danger';
|
|
1645
|
-
type DialogFooterIcon = 'trash' | 'pen' | 'restore' | 'print' | 'check';
|
|
1646
|
-
interface DialogFooterAction {
|
|
1647
|
-
/** Stable id echoed back in the `dialog-footer-request` intent. */
|
|
1648
|
-
id: string;
|
|
1649
|
-
/** Already-translated visible label and accessible name. */
|
|
1650
|
-
label: string;
|
|
1651
|
-
variant?: DialogFooterVariant;
|
|
1652
|
-
icon?: DialogFooterIcon;
|
|
1653
|
-
disabled?: boolean;
|
|
1654
|
-
/** Work in flight: the button is disabled, `aria-busy` and shows a spinner. */
|
|
1655
|
-
busy?: boolean;
|
|
1656
|
-
/** Tooltip (`title`) for an action whose label needs a longer hint. */
|
|
1657
|
-
title?: string;
|
|
1658
|
-
/** `start` pins a tertiary action (Remove link, Reset all) to the left edge. */
|
|
1659
|
-
align?: 'start' | 'end';
|
|
1660
|
-
/** Optional `data-testid` stamped on the button. */
|
|
1661
|
-
testId?: string;
|
|
1662
|
-
}
|
|
1663
|
-
interface DialogFooterViewState {
|
|
1664
|
-
actions: readonly DialogFooterAction[];
|
|
1665
|
-
}
|
|
1666
|
-
type MobileBarId = 'slides' | 'insert' | 'inspector' | 'comments' | 'notes';
|
|
1667
|
-
interface MobileBarViewState {
|
|
1668
|
-
/** Every button disables at 0 (see `buildBarActions`). */
|
|
1669
|
-
slideCount: number;
|
|
1670
|
-
/** The button whose sheet is open; reflected as `aria-pressed` and a top pill. */
|
|
1671
|
-
activeSheet?: MobileBarId | null;
|
|
1672
|
-
/** Comment count on the badge of Comments (`99+` above 99). */
|
|
1673
|
-
commentCount?: number;
|
|
1674
|
-
/** Buttons dropped entirely, such as Notes when `hiddenActions` hides it. */
|
|
1675
|
-
hidden?: readonly MobileBarId[];
|
|
1676
|
-
/** Buttons disabled beyond the no-slides rule, such as edit-only ones in view mode. */
|
|
1677
|
-
disabled?: readonly MobileBarId[];
|
|
1678
|
-
translate?: ChromeTranslate;
|
|
1679
|
-
}
|
|
1680
|
-
type MobileToolbarId = 'menu' | 'undo' | 'redo' | 'ai' | 'save' | 'present' | 'share';
|
|
1681
|
-
interface MobileToolbarViewState {
|
|
1682
|
-
/** Menu, Undo, Redo, AI and Share only show while editing. */
|
|
1683
|
-
editable: boolean;
|
|
1684
|
-
canUndo: boolean;
|
|
1685
|
-
canRedo: boolean;
|
|
1686
|
-
/** Host opted into the AI assistant; the element draws its toggle. */
|
|
1687
|
-
aiVisible?: boolean;
|
|
1688
|
-
aiActive?: boolean;
|
|
1689
|
-
/** Reflected as `aria-expanded` on Menu when given. */
|
|
1690
|
-
menuOpen?: boolean;
|
|
1691
|
-
/** Buttons dropped entirely (`hiddenActions`, or Share when the host has none). */
|
|
1692
|
-
hidden?: readonly MobileToolbarId[];
|
|
1693
|
-
/** Buttons disabled, such as Present while there is nothing to present. */
|
|
1694
|
-
disabled?: readonly MobileToolbarId[];
|
|
1695
|
-
translate?: ChromeTranslate;
|
|
1696
|
-
}
|
|
1697
|
-
interface PresentToolbarViewState {
|
|
1698
|
-
/** Zero-based slide on screen. */
|
|
1699
|
-
current: number;
|
|
1700
|
-
total: number;
|
|
1701
|
-
/** The armed annotation tool; `none` leaves every tool unpressed. */
|
|
1702
|
-
tool: PresentationPointerTool;
|
|
1703
|
-
penColor: string;
|
|
1704
|
-
highlighterColor: string;
|
|
1705
|
-
hasAnnotations: boolean;
|
|
1706
|
-
/** With the pen, marks the Blackboard toggle active (`isBlackboardActive`). */
|
|
1707
|
-
blackout: PresentationBlackout;
|
|
1708
|
-
/** Show the presenter-view toggle (default false). */
|
|
1709
|
-
presenterViewVisible?: boolean;
|
|
1710
|
-
presenterViewActive?: boolean;
|
|
1711
|
-
/** Epoch ms the show started. The element ticks the readout; null shows 00:00. */
|
|
1712
|
-
startTime: number | null;
|
|
1713
|
-
translate?: ChromeTranslate;
|
|
1714
|
-
}
|
|
1715
|
-
interface PresenterConsoleViewState {
|
|
1716
|
-
/** Ids of toggles that read as on (and the resume / close-window variants). */
|
|
1717
|
-
active: readonly string[];
|
|
1718
|
-
/** Ids of controls that are disabled. */
|
|
1719
|
-
disabled: readonly string[];
|
|
1720
|
-
translate?: ChromeTranslate;
|
|
1721
|
-
}
|
|
1722
|
-
/** In-memory clipboard payload stored when an element is copied or cut. */
|
|
1723
|
-
interface ElementClipboardPayload {
|
|
1724
|
-
element: PptxElement;
|
|
1725
|
-
isTemplate: boolean;
|
|
1726
|
-
}
|
|
1727
|
-
/** One placeholder outline, already positioned in unscaled slide space. */
|
|
1728
|
-
interface LayoutPreviewFrame {
|
|
1729
|
-
/** Stable key for list rendering. */
|
|
1730
|
-
key: string;
|
|
1731
|
-
type: string;
|
|
1732
|
-
left: number;
|
|
1733
|
-
top: number;
|
|
1734
|
-
width: number;
|
|
1735
|
-
height: number;
|
|
1736
|
-
}
|
|
1737
|
-
/** Everything a binding needs to render one thumbnail. */
|
|
1738
|
-
interface LayoutPreviewGeometry {
|
|
1739
|
-
/** Outer box, in CSS pixels. */
|
|
1740
|
-
boxWidth: number;
|
|
1741
|
-
boxHeight: number;
|
|
1742
|
-
/** Inner surface size, in unscaled slide pixels. */
|
|
1743
|
-
surfaceWidth: number;
|
|
1744
|
-
surfaceHeight: number;
|
|
1745
|
-
/** Factor to apply as `transform: scale(...)` on the inner surface. */
|
|
1746
|
-
scale: number;
|
|
1747
|
-
backgroundColor: string;
|
|
1748
|
-
/**
|
|
1749
|
-
* Border width for placeholder outlines, pre-divided by {@link scale}.
|
|
1750
|
-
*
|
|
1751
|
-
* The outlines live inside the scaled surface, so a plain 1.5px border
|
|
1752
|
-
* would be multiplied down to a hairline that vanishes at thumbnail size.
|
|
1753
|
-
* Dividing here keeps the drawn width constant on screen whatever the
|
|
1754
|
-
* slide dimensions are.
|
|
1755
|
-
*/
|
|
1756
|
-
frameBorderWidth: number;
|
|
1757
|
-
frames: LayoutPreviewFrame[];
|
|
1758
|
-
}
|
|
1759
|
-
//#endregion
|
|
1760
|
-
//#region src/render/command-search.d.ts
|
|
1761
|
-
/**
|
|
1762
|
-
* Command-search data for the PowerPoint-style "Tell me what you want to do"
|
|
1763
|
-
* search bar. Provides searchable command entries grouped by category, each
|
|
1764
|
-
* mapping a label translation key to a command identifier that bindings can
|
|
1765
|
-
* dispatch.
|
|
1766
|
-
*/
|
|
1767
|
-
interface CommandSearchEntry {
|
|
1768
|
-
/** Translation key for the display label. */
|
|
1769
|
-
labelKey: string;
|
|
1770
|
-
/** Command identifier dispatched to the host binding. */
|
|
1771
|
-
command: string;
|
|
1772
|
-
/** Optional icon hint (binding resolves to framework icon component). */
|
|
1773
|
-
icon?: string;
|
|
1774
|
-
/** Category grouping key; hosts with their own short list may omit it. */
|
|
1775
|
-
category?: 'format' | 'insert' | 'view' | 'slideShow' | 'design' | 'arrange';
|
|
1776
|
-
}
|
|
1777
|
-
interface SubtitleSettings {
|
|
1778
|
-
spokenLanguage: string;
|
|
1779
|
-
}
|
|
1780
|
-
interface SubtitleSettingsLabels {
|
|
1781
|
-
title: string;
|
|
1782
|
-
language: string;
|
|
1783
|
-
browserLanguage: string;
|
|
1784
|
-
description: string;
|
|
1785
|
-
apply: string;
|
|
1786
|
-
cancel: string;
|
|
1787
|
-
}
|
|
1788
|
-
/**
|
|
1789
|
-
* Optional hook point for hosts that want to wire a real sign-in flow into
|
|
1790
|
-
* File > Account. Disabled by default: the Account page renders nothing
|
|
1791
|
-
* extra unless a host explicitly opts in by passing `enabled: true`.
|
|
1792
|
-
* See docs/guide for wiring instructions.
|
|
1793
|
-
*/
|
|
1794
|
-
interface AccountAuthConfig {
|
|
1795
|
-
enabled: boolean;
|
|
1796
|
-
onSignIn: () => void;
|
|
1797
|
-
signedInUser?: {
|
|
1798
|
-
name: string;
|
|
1799
|
-
email?: string;
|
|
1800
|
-
avatarUrl?: string;
|
|
1801
|
-
};
|
|
1802
|
-
}
|
|
1803
|
-
//#endregion
|
|
1804
|
-
//#region src/render/ribbon-galleries/gallery-types.d.ts
|
|
1805
|
-
/** Every gallery the ribbon offers. */
|
|
1806
|
-
type RibbonGalleryId = 'shapeStyles' | 'shapeEffects' | 'wordArtStyles' | 'pictureStyles' | 'pictureCorrections' | 'pictureColor' | 'pictureArtisticEffects' | 'bullets' | 'numbering' | 'tableStyles' | 'chartStyles' | 'chartColors' | 'chartQuickLayout' | 'smartArtStyles' | 'smartArtColors' | 'smartArtLayouts' | 'smartArtAddShape' | 'smartArtAddBullet' | 'smartArtTextPane' | 'smartArtPromote' | 'smartArtDemote' | 'smartArtRightToLeft' | 'smartArtMoveUp' | 'smartArtMoveDown' | 'smartArtResetGraphic' | 'smartArtConvert' | 'themeColors' | 'themeFonts';
|
|
1807
|
-
/** One tile. */
|
|
1808
|
-
interface RibbonGalleryItem {
|
|
1809
|
-
/** Stable within its gallery; what `applyRibbonGalleryItem` takes. */
|
|
1810
|
-
id: string;
|
|
1811
|
-
/** i18n key of the tile's accessible name / tooltip. */
|
|
1812
|
-
labelKey: string;
|
|
1813
|
-
/** `{{name}}` interpolation values for `labelKey`. */
|
|
1814
|
-
labelParams?: Readonly<Record<string, string | number>>;
|
|
1815
|
-
/** English fallback for bindings whose dictionary lacks `labelKey`. */
|
|
1816
|
-
label: string;
|
|
1817
|
-
/**
|
|
1818
|
-
* A complete, self-contained `<svg>` element (width/height/viewBox set).
|
|
1819
|
-
* Built only from catalogue data and theme colours, never from user text,
|
|
1820
|
-
* so it is safe to inject as markup.
|
|
1821
|
-
*/
|
|
1822
|
-
previewSvg: string;
|
|
1823
|
-
/**
|
|
1824
|
-
* CSS `filter` the tile's preview carries (the Picture Adjust galleries),
|
|
1825
|
-
* for a host that draws the thumbnail over a real image instead of
|
|
1826
|
-
* `previewSvg`. Omitted when the preset has no CSS-expressible preview.
|
|
1827
|
-
*/
|
|
1828
|
-
previewFilter?: string;
|
|
1829
|
-
/** True when this entry is what the selection currently carries. */
|
|
1830
|
-
applied: boolean;
|
|
1831
|
-
}
|
|
1832
|
-
/** A titled block of tiles (PowerPoint's "Theme Styles" / "Presets"). */
|
|
1833
|
-
interface RibbonGallerySection {
|
|
1834
|
-
id: string;
|
|
1835
|
-
/** i18n key of the section heading; omitted for an untitled section. */
|
|
1836
|
-
titleKey?: string;
|
|
1837
|
-
title?: string;
|
|
1838
|
-
/** Tiles per row in the dropped-down grid. */
|
|
1839
|
-
columns: number;
|
|
1840
|
-
/** Preview tile size in CSS px (the SVG's own width/height). */
|
|
1841
|
-
tileWidth: number;
|
|
1842
|
-
tileHeight: number;
|
|
1843
|
-
items: RibbonGalleryItem[];
|
|
1844
|
-
}
|
|
1845
|
-
interface RibbonGalleryDescriptor {
|
|
1846
|
-
id: RibbonGalleryId;
|
|
1847
|
-
/** i18n key of the gallery trigger / group caption. */
|
|
1848
|
-
labelKey: string;
|
|
1849
|
-
label: string;
|
|
1850
|
-
sections: RibbonGallerySection[];
|
|
1851
|
-
/** True when the selection cannot take this gallery (trigger disabled). */
|
|
1852
|
-
disabled: boolean;
|
|
1853
|
-
/**
|
|
1854
|
-
* Set when the entry is a one-button command (PowerPoint's Add Shape, Reset
|
|
1855
|
-
* Graphic, ...) rather than a gallery: the element draws a plain command, a
|
|
1856
|
-
* click picks its only item and no panel opens.
|
|
1857
|
-
*/
|
|
1858
|
-
command?: RibbonGalleryCommandView;
|
|
1859
|
-
}
|
|
1860
|
-
/** How a command-style entry draws (see {@link RibbonGalleryDescriptor.command}). */
|
|
1861
|
-
interface RibbonGalleryCommandView {
|
|
1862
|
-
/** SVG path data on a 20px grid. */
|
|
1863
|
-
iconPath: string;
|
|
1864
|
-
/** Icon above the label (PowerPoint's large button) instead of beside it. */
|
|
1865
|
-
large?: boolean;
|
|
1866
|
-
/** i18n key and English fallback of the tooltip, e.g. why the command is unavailable. */
|
|
1867
|
-
hintKey?: string;
|
|
1868
|
-
hint?: string;
|
|
1869
|
-
}
|
|
1870
|
-
//#endregion
|
|
1871
|
-
//#region src/render/viewport-fit.d.ts
|
|
1872
|
-
/** Unscaled CSS pixels reserved on each side of the ordinary viewer viewport. */
|
|
1873
|
-
type ViewportFitPadding = number | {
|
|
1874
|
-
horizontal: number;
|
|
1875
|
-
vertical: number;
|
|
1876
|
-
};
|
|
1877
|
-
/** Host layout policy, independent of authored slide dimensions and user zoom. */
|
|
1878
|
-
interface ViewportFitOptions {
|
|
1879
|
-
/** Per-side padding. Omission keeps the binding's existing decorative allowance. */
|
|
1880
|
-
fitPadding?: ViewportFitPadding;
|
|
1881
|
-
/** Positive fit-factor ceiling; null allows enlargement without a ceiling. */
|
|
1882
|
-
maxFitScale?: number | null;
|
|
1883
|
-
}
|
|
1884
|
-
type ThemeEditorLabels = Record<string, string>;
|
|
1885
|
-
/**
|
|
1886
|
-
* Controlled Animations tab state. Hosts own the slide model, selection,
|
|
1887
|
-
* history and the inspector; the view only reflects these values.
|
|
1888
|
-
*/
|
|
1889
|
-
interface RibbonAnimationsViewState {
|
|
1890
|
-
/** False in read-only hosts: every authoring intent is rejected. */
|
|
1891
|
-
editable: boolean;
|
|
1892
|
-
/** Whether an element is selected; effects always target one element. */
|
|
1893
|
-
hasSelection: boolean;
|
|
1894
|
-
/** Whether the Animation Pane (inspector) is open; reflected as pressed. */
|
|
1895
|
-
paneOpen?: boolean;
|
|
1896
|
-
/** Transient highlight while a host's Preview is playing, where it tracks one. */
|
|
1897
|
-
previewActive?: boolean;
|
|
1898
|
-
translate?: (key: string) => string;
|
|
1899
|
-
}
|
|
1900
|
-
//#endregion
|
|
1901
|
-
//#region src/render/ribbon-draw-state.d.ts
|
|
1902
|
-
type RibbonDrawTool = 'select' | 'pen' | 'highlighter' | 'eraser' | 'freeform';
|
|
1903
|
-
interface RibbonDrawViewState {
|
|
1904
|
-
tool: RibbonDrawTool;
|
|
1905
|
-
color: string;
|
|
1906
|
-
width: number;
|
|
1907
|
-
editable: boolean;
|
|
1908
|
-
recentColors?: readonly string[];
|
|
1909
|
-
translate?: (key: string) => string;
|
|
1910
|
-
}
|
|
1911
|
-
/**
|
|
1912
|
-
* Controlled Insert tab state. Native viewers own the selections, every document
|
|
1913
|
-
* mutation, the file/shape/SmartArt/equation/hyperlink dialogs and history.
|
|
1914
|
-
*/
|
|
1915
|
-
interface RibbonInsertState {
|
|
1916
|
-
editable: boolean;
|
|
1917
|
-
/** A hyperlink always attaches to something, so Link tracks the selection. */
|
|
1918
|
-
hasSelection: boolean;
|
|
1919
|
-
/** The shape preset staged in the Shape picker. */
|
|
1920
|
-
shapeType: string;
|
|
1921
|
-
/** The chart entry staged in the Chart picker. */
|
|
1922
|
-
chartKind: string;
|
|
1923
|
-
/** The armed Freeform: Shape / Curve tool. */
|
|
1924
|
-
activeFreeformTool?: string | null;
|
|
1925
|
-
/** Visible Freeform tools; empty hides the buttons (host customization). */
|
|
1926
|
-
freeformTools?: readonly string[];
|
|
1927
|
-
/** Hosts without these capabilities hide the control instead of showing a dead one. */
|
|
1928
|
-
chartAvailable?: boolean;
|
|
1929
|
-
fieldAvailable?: boolean;
|
|
1930
|
-
headerFooterAvailable?: boolean;
|
|
1931
|
-
translate?: (key: string) => string;
|
|
1932
|
-
}
|
|
1933
|
-
/** One row of a menu or select; labels are translated by the view unless `label` is set. */
|
|
1934
|
-
interface RibbonHomeItem {
|
|
1935
|
-
readonly value: string;
|
|
1936
|
-
/** Ready-made text (a font family, a layout name); wins over `labelKey`. */
|
|
1937
|
-
readonly label?: string;
|
|
1938
|
-
readonly labelKey?: string;
|
|
1939
|
-
readonly fallback?: string;
|
|
1940
|
-
readonly description?: string;
|
|
1941
|
-
readonly descriptionKey?: string;
|
|
1942
|
-
/** Heading of the group this row opens; consecutive rows share one heading. */
|
|
1943
|
-
readonly group?: string;
|
|
1944
|
-
readonly groupKey?: string;
|
|
1945
|
-
readonly checked?: boolean;
|
|
1946
|
-
readonly disabled?: boolean;
|
|
1947
|
-
/** Preview typeface of a font row. */
|
|
1948
|
-
readonly fontFamily?: string;
|
|
1949
|
-
/** Shared artwork key shown before the label (a shape glyph or ribbon icon). */
|
|
1950
|
-
readonly icon?: string;
|
|
1951
|
-
/** Preserved test or automation hooks (`data-pptx-merge-op`, ...). */
|
|
1952
|
-
readonly attrs?: Readonly<Record<string, string>>;
|
|
1953
|
-
/** Draws a divider above the row. */
|
|
1954
|
-
readonly separator?: boolean;
|
|
1955
|
-
}
|
|
1956
|
-
interface RibbonHomeControlState {
|
|
1957
|
-
disabled?: boolean;
|
|
1958
|
-
/** Omit for ordinary commands; a boolean reflects `aria-pressed`. */
|
|
1959
|
-
pressed?: boolean;
|
|
1960
|
-
/** Reserved for hosts that mirror their own popover; shared popovers set it themselves. */
|
|
1961
|
-
expanded?: boolean;
|
|
1962
|
-
hidden?: boolean;
|
|
1963
|
-
/** Select, number, colour bar and checked menu row. */
|
|
1964
|
-
value?: string | number;
|
|
1965
|
-
/** Menu or select rows that replace the spec's static ones. */
|
|
1966
|
-
items?: readonly RibbonHomeItem[];
|
|
1967
|
-
/** Colour popover content; the trigger shows `value` in its bar. */
|
|
1968
|
-
colour?: RibbonHomeColourModel;
|
|
1969
|
-
/** Layout gallery content. */
|
|
1970
|
-
layouts?: RibbonHomeLayoutModel;
|
|
1971
|
-
/** Embedded gallery content. */
|
|
1972
|
-
gallery?: {
|
|
1973
|
-
descriptor: RibbonGalleryDescriptor | undefined;
|
|
1974
|
-
disabled?: boolean;
|
|
1975
|
-
};
|
|
1976
|
-
}
|
|
1977
|
-
interface RibbonHomeColourModel {
|
|
1978
|
-
/** The deck's theme colour map; the popover derives the theme palette from it. */
|
|
1979
|
-
themeColors?: Readonly<Record<string, string>>;
|
|
1980
|
-
/** Theme reference of the current colour (highlights its swatch). */
|
|
1981
|
-
selectedRef?: PptxThemeColorRef;
|
|
1982
|
-
/** Recently used colours, newest first. */
|
|
1983
|
-
recent?: readonly string[];
|
|
1984
|
-
}
|
|
1985
|
-
interface RibbonHomeLayoutModel {
|
|
1986
|
-
layouts: readonly {
|
|
1987
|
-
path: string;
|
|
1988
|
-
name: string;
|
|
1989
|
-
}[];
|
|
1990
|
-
/** Marks the active tile; omitted by New Slide. */
|
|
1991
|
-
current?: string;
|
|
1992
|
-
/** Artwork data by layout path; tiles render name-only until it arrives. */
|
|
1993
|
-
previews?: Readonly<Record<string, PptxLayoutPreview>> | ReadonlyMap<string, PptxLayoutPreview>;
|
|
1994
|
-
}
|
|
1995
|
-
/** State key of a control: its id, or `id#part` when several buttons share one id. */
|
|
1996
|
-
type RibbonHomeKey = RibbonControlId | `${RibbonControlId}#${string}`;
|
|
1997
|
-
interface RibbonHomeViewState {
|
|
1998
|
-
/** Missing entries are enabled, unpressed and visible. */
|
|
1999
|
-
controls: Readonly<Partial<Record<RibbonHomeKey, RibbonHomeControlState>>>;
|
|
2000
|
-
translate?: (key: string) => string;
|
|
2001
|
-
}
|
|
2002
|
-
/** Controlled View tab state. Native viewers own the values and every side effect. */
|
|
2003
|
-
interface RibbonViewState {
|
|
2004
|
-
editable: boolean;
|
|
2005
|
-
showRulers: boolean;
|
|
2006
|
-
showGrid: boolean;
|
|
2007
|
-
showGuides: boolean;
|
|
2008
|
-
snapToGrid: boolean;
|
|
2009
|
-
snapToShape: boolean;
|
|
2010
|
-
templateEditing: boolean;
|
|
2011
|
-
selectionPaneOpen?: boolean;
|
|
2012
|
-
eyedropperActive?: boolean;
|
|
2013
|
-
/** Hosts without these capabilities hide the control instead of showing a dead one. */
|
|
2014
|
-
selectionPaneAvailable?: boolean;
|
|
2015
|
-
eyedropperAvailable?: boolean;
|
|
2016
|
-
zoomAvailable?: boolean;
|
|
2017
|
-
translate?: (key: string) => string;
|
|
2018
|
-
}
|
|
2019
|
-
//#endregion
|
|
2020
|
-
//#region src/render/ribbon-transitions-state.d.ts
|
|
2021
|
-
type RibbonTransitionsTranslate = (key: string, params?: Record<string, string>) => string;
|
|
2022
|
-
/** Controlled Transitions tab state. The host derives it from the ACTIVE slide. */
|
|
2023
|
-
interface RibbonTransitionsViewState {
|
|
2024
|
-
draft: RibbonTransitionDraft;
|
|
2025
|
-
/** The slide's transition, used only to list and select the Sound entries. */
|
|
2026
|
-
transition?: PptxSlideTransition;
|
|
2027
|
-
editable: boolean;
|
|
2028
|
-
inspectorOpen?: boolean;
|
|
2029
|
-
translate?: RibbonTransitionsTranslate;
|
|
2030
|
-
}
|
|
2031
|
-
//#endregion
|
|
2032
|
-
//#region src/render/status-bar-state.d.ts
|
|
2033
|
-
/**
|
|
2034
|
-
* Shared model for the bottom status bar (`pptx-ui-status-bar`).
|
|
2035
|
-
*
|
|
2036
|
-
* The slide counter, save indicator, notes toggle, view-mode buttons and zoom
|
|
2037
|
-
* cluster were hand-built five times. The view owns the markup, pressed state
|
|
2038
|
-
* and gating; hosts own every effect (notes panel, view switching, zoom).
|
|
2039
|
-
*/
|
|
2040
|
-
type StatusBarTranslate = (key: string, params?: Record<string, string | number>) => string;
|
|
2041
|
-
type StatusBarSaveKind = 'idle' | 'saving' | 'error';
|
|
2042
|
-
type StatusBarViewMode = 'normal' | 'sorter' | 'slideShow';
|
|
2043
|
-
interface StatusBarViewState {
|
|
2044
|
-
slideCount: number;
|
|
2045
|
-
/** Zero-based active slide; clamped into range for display. */
|
|
2046
|
-
activeSlideIndex: number;
|
|
2047
|
-
/** Already-translated save indicator, see {@link resolveStatusBarSave}. */
|
|
2048
|
-
saveText: string;
|
|
2049
|
-
saveKind?: StatusBarSaveKind;
|
|
2050
|
-
/** Omit to hide the whole zoom cluster. */
|
|
2051
|
-
zoomPercent?: number;
|
|
2052
|
-
showNotes?: boolean;
|
|
2053
|
-
notesExpanded?: boolean;
|
|
2054
|
-
/** Default true. False drops the Normal / Sorter / Slide Show cluster. */
|
|
2055
|
-
showViewModes?: boolean;
|
|
2056
|
-
/** Default true. */
|
|
2057
|
-
showSorter?: boolean;
|
|
2058
|
-
/** Default true. */
|
|
2059
|
-
showSlideShow?: boolean;
|
|
2060
|
-
/** The pressed view button; omit when none is active. */
|
|
2061
|
-
viewMode?: StatusBarViewMode;
|
|
2062
|
-
translate?: StatusBarTranslate;
|
|
2063
|
-
}
|
|
2064
|
-
//#endregion
|
|
2065
|
-
//#region src/render/notes-toolbar-state.d.ts
|
|
2066
|
-
/**
|
|
2067
|
-
* Shared model for the speaker-notes formatting toolbar (`pptx-ui-notes-toolbar`).
|
|
2068
|
-
*
|
|
2069
|
-
* The toolbar owns the buttons, their order, icons, labels, enabled state and
|
|
2070
|
-
* the hyperlink popover. Hosts own the contenteditable editor, selection-based
|
|
2071
|
-
* edits, history, printing and persistence, and route typed intents to them.
|
|
2072
|
-
*/
|
|
2073
|
-
type NotesToolbarTranslate = (key: string, params?: Record<string, string | number>) => string;
|
|
2074
|
-
interface NotesToolbarViewState {
|
|
2075
|
-
/** True while the rich (contenteditable) surface is active. Drives the mode button label. */
|
|
2076
|
-
rich: boolean;
|
|
2077
|
-
/** Enables the formatting buttons. False in the plain editor, where they cannot act. */
|
|
2078
|
-
canFormat: boolean;
|
|
2079
|
-
/** Shows the Print button. */
|
|
2080
|
-
showPrint: boolean;
|
|
2081
|
-
/** Disables every button, for example while no slide is selected. */
|
|
2082
|
-
disabled?: boolean;
|
|
2083
|
-
/** Host translator; keys are the canonical `pptx.notes.*` set. Omitted: keys are shown. */
|
|
2084
|
-
translate?: NotesToolbarTranslate;
|
|
2085
|
-
}
|
|
2086
|
-
//#endregion
|
|
2087
|
-
//#region src/render/title-bar-state.d.ts
|
|
2088
|
-
type TitleBarTranslate = (key: string, params?: Record<string, string | number>) => string;
|
|
2089
|
-
type TitleBarPlacement = 'titleBar' | 'belowRibbon';
|
|
2090
|
-
type TitleBarTone = 'idle' | 'saving' | 'error';
|
|
2091
|
-
interface TitleBarAutosaveView {
|
|
2092
|
-
enabled: boolean;
|
|
2093
|
-
/** Default true. False renders the switch inert (host policy `autosave: false`). */
|
|
2094
|
-
toggleAvailable?: boolean;
|
|
2095
|
-
/** Translation key from `resolveTitleBarStatusKey`. */
|
|
2096
|
-
statusKey: string;
|
|
2097
|
-
/** Colour of the status text; only meaningful while `enabled`. */
|
|
2098
|
-
tone?: TitleBarTone;
|
|
2099
|
-
}
|
|
2100
|
-
interface TitleBarHistoryState {
|
|
2101
|
-
canUndo: boolean;
|
|
2102
|
-
canRedo: boolean;
|
|
2103
|
-
/** Description of the pending action, e.g. "Delete shape". */
|
|
2104
|
-
undoLabel?: string | null;
|
|
2105
|
-
redoLabel?: string | null;
|
|
2106
|
-
/** Default true. Maps to `hiddenActions: ['undo']`. */
|
|
2107
|
-
showUndo?: boolean;
|
|
2108
|
-
/** Default true. Maps to `hiddenActions: ['redo']`. */
|
|
2109
|
-
showRedo?: boolean;
|
|
2110
|
-
}
|
|
2111
|
-
interface TitleBarQuickAccessView {
|
|
2112
|
-
visible: boolean;
|
|
2113
|
-
position: QuickAccessPosition;
|
|
2114
|
-
showCommandLabels: boolean;
|
|
2115
|
-
/** Ordered catalog ids (File > Options > Quick Access Toolbar). */
|
|
2116
|
-
commandIds: readonly string[];
|
|
2117
|
-
}
|
|
2118
|
-
interface TitleBarViewState {
|
|
2119
|
-
/** Edit mode with an editable deck. Gates AutoSave, the strip, status and search. */
|
|
2120
|
-
editing: boolean;
|
|
2121
|
-
/** Whether the command search shows; hosts pass `editing`. */
|
|
2122
|
-
searchVisible: boolean;
|
|
2123
|
-
/** Display name; the translated default shows when empty. */
|
|
2124
|
-
fileName?: string;
|
|
2125
|
-
autosave: TitleBarAutosaveView;
|
|
2126
|
-
history: TitleBarHistoryState;
|
|
2127
|
-
/** Default true. */
|
|
2128
|
-
showSave?: boolean;
|
|
2129
|
-
quickAccess: TitleBarQuickAccessView;
|
|
2130
|
-
/** Search catalogue; defaults to the shared `COMMAND_SEARCH_ENTRIES`. */
|
|
2131
|
-
commands?: readonly CommandSearchEntry[];
|
|
2132
|
-
/** Default true. False drops the "Find in Slides" fallback row. */
|
|
2133
|
-
contentSearch?: boolean;
|
|
2134
|
-
/** ScreenTip rule (Options > General); returning undefined suppresses the title. */
|
|
2135
|
-
screenTip?: (label: string) => string | undefined;
|
|
2136
|
-
translate?: TitleBarTranslate;
|
|
2137
|
-
}
|
|
2138
|
-
//#endregion
|
|
2139
|
-
//#region src/web-components/theme-editor.d.ts
|
|
2140
|
-
interface PptxUiThemeEditorElement extends HTMLElement {
|
|
2141
|
-
theme: PptxTheme | undefined;
|
|
2142
|
-
labels: ThemeEditorLabels;
|
|
2143
|
-
disabled: boolean;
|
|
2144
|
-
}
|
|
2145
|
-
declare global {
|
|
2146
|
-
interface HTMLElementTagNameMap {
|
|
2147
|
-
'pptx-ui-theme-editor': PptxUiThemeEditorElement;
|
|
2148
|
-
}
|
|
2149
|
-
}
|
|
2150
|
-
/** One row of a context menu. Hosts decide `id`, wording, gating and what activation does. */
|
|
2151
|
-
interface ContextMenuViewItem {
|
|
2152
|
-
/** Stable command id, echoed by `menu-request`. */
|
|
2153
|
-
id: string;
|
|
2154
|
-
/** Already-translated visible label. */
|
|
2155
|
-
label: string;
|
|
2156
|
-
/** Draw a rule before this row. */
|
|
2157
|
-
separatorBefore?: boolean;
|
|
2158
|
-
/** Group heading shown before this row; the row and the ones after it join that group. */
|
|
2159
|
-
heading?: string;
|
|
2160
|
-
/** Destructive command (Delete): tinted. */
|
|
2161
|
-
danger?: boolean;
|
|
2162
|
-
/** Offered but unavailable: announced and drawn dim, skipped by arrow keys. */
|
|
2163
|
-
disabled?: boolean;
|
|
2164
|
-
/** A toggle (Grid and Guides, Ruler) in this state; omitted for one-shot commands. */
|
|
2165
|
-
checked?: boolean;
|
|
2166
|
-
}
|
|
2167
|
-
/** Everything the controlled element needs to draw one menu. */
|
|
2168
|
-
interface ContextMenuViewState {
|
|
2169
|
-
/** Pointer position, in viewport pixels. The element clamps it into the window. */
|
|
2170
|
-
x: number;
|
|
2171
|
-
y: number;
|
|
2172
|
-
/** Accessible name of the menu. */
|
|
2173
|
-
label: string;
|
|
2174
|
-
items: readonly ContextMenuViewItem[];
|
|
2175
|
-
/**
|
|
2176
|
-
* Test-hook attributes copied onto the host element (`data-pptx-context-menu`,
|
|
2177
|
-
* `data-pptx-canvas-context-menu`, ...). Only `data-pptx-*` names are accepted.
|
|
2178
|
-
*/
|
|
2179
|
-
markers?: readonly string[];
|
|
2180
|
-
/** Stacking order; defaults to {@link CONTEXT_MENU_EDITOR_LAYER}. */
|
|
2181
|
-
zIndex?: number;
|
|
2182
|
-
/** Move focus onto the first command on open. Default true. */
|
|
2183
|
-
autoFocus?: boolean;
|
|
2184
|
-
}
|
|
2185
|
-
interface PptxUiCompatToastsElement extends HTMLElement {
|
|
2186
|
-
state: CompatToastsViewState;
|
|
2187
|
-
}
|
|
2188
|
-
interface PptxUiDialogFooterElement extends HTMLElement {
|
|
2189
|
-
state: DialogFooterViewState;
|
|
2190
|
-
/** Move keyboard focus to an action, e.g. the primary one when a dialog opens. */
|
|
2191
|
-
focusAction(id: string): void;
|
|
2192
|
-
}
|
|
2193
|
-
interface PptxUiPasteOptionsElement extends HTMLElement {
|
|
2194
|
-
state: PasteOptionsViewState;
|
|
2195
|
-
}
|
|
2196
|
-
interface PptxUiReadOnlyBannerElement extends HTMLElement {
|
|
2197
|
-
state: ReadOnlyBannerViewState;
|
|
2198
|
-
}
|
|
2199
|
-
interface PptxUiContextMenuElement extends HTMLElement {
|
|
2200
|
-
state: ContextMenuViewState;
|
|
2201
|
-
}
|
|
2202
|
-
declare global {
|
|
2203
|
-
interface HTMLElementTagNameMap {
|
|
2204
|
-
'pptx-ui-compat-toasts': PptxUiCompatToastsElement;
|
|
2205
|
-
'pptx-ui-context-menu': PptxUiContextMenuElement;
|
|
2206
|
-
'pptx-ui-dialog-footer': PptxUiDialogFooterElement;
|
|
2207
|
-
'pptx-ui-paste-options': PptxUiPasteOptionsElement;
|
|
2208
|
-
'pptx-ui-read-only-banner': PptxUiReadOnlyBannerElement;
|
|
2209
|
-
}
|
|
2210
|
-
}
|
|
2211
|
-
interface PptxUiMobileBarElement extends HTMLElement {
|
|
2212
|
-
state: MobileBarViewState;
|
|
2213
|
-
}
|
|
2214
|
-
declare global {
|
|
2215
|
-
interface HTMLElementTagNameMap {
|
|
2216
|
-
'pptx-ui-mobile-bar': PptxUiMobileBarElement;
|
|
2217
|
-
}
|
|
2218
|
-
}
|
|
2219
|
-
interface PptxUiMobileToolbarElement extends HTMLElement {
|
|
2220
|
-
state: MobileToolbarViewState;
|
|
2221
|
-
}
|
|
2222
|
-
declare global {
|
|
2223
|
-
interface HTMLElementTagNameMap {
|
|
2224
|
-
'pptx-ui-mobile-toolbar': PptxUiMobileToolbarElement;
|
|
2225
|
-
}
|
|
2226
|
-
}
|
|
2227
|
-
interface PptxUiPresentToolbarElement extends HTMLElement {
|
|
2228
|
-
state: PresentToolbarViewState;
|
|
2229
|
-
/** Close an open colour palette, e.g. when the host auto-hides the bar. */
|
|
2230
|
-
closePalettes(): void;
|
|
2231
|
-
}
|
|
2232
|
-
declare global {
|
|
2233
|
-
interface HTMLElementTagNameMap {
|
|
2234
|
-
'pptx-ui-present-toolbar': PptxUiPresentToolbarElement;
|
|
2235
|
-
}
|
|
2236
|
-
}
|
|
2237
|
-
interface PptxUiPresenterConsoleElement extends HTMLElement {
|
|
2238
|
-
state: PresenterConsoleViewState;
|
|
2239
|
-
}
|
|
2240
|
-
declare global {
|
|
2241
|
-
interface HTMLElementTagNameMap {
|
|
2242
|
-
'pptx-ui-presenter-console': PptxUiPresenterConsoleElement;
|
|
2243
|
-
}
|
|
2244
|
-
}
|
|
2245
|
-
interface PptxUiRibbonAnimationsElement extends HTMLElement {
|
|
2246
|
-
state: RibbonAnimationsViewState;
|
|
2247
|
-
}
|
|
2248
|
-
declare global {
|
|
2249
|
-
interface HTMLElementTagNameMap {
|
|
2250
|
-
'pptx-ui-ribbon-animations': PptxUiRibbonAnimationsElement;
|
|
2251
|
-
}
|
|
2252
|
-
}
|
|
2253
|
-
interface PptxUiRibbonDrawElement extends HTMLElement {
|
|
2254
|
-
state: RibbonDrawViewState;
|
|
2255
|
-
}
|
|
2256
|
-
declare global {
|
|
2257
|
-
interface HTMLElementTagNameMap {
|
|
2258
|
-
'pptx-ui-ribbon-draw': PptxUiRibbonDrawElement;
|
|
2259
|
-
}
|
|
2260
|
-
}
|
|
2261
|
-
//#endregion
|
|
2262
|
-
//#region src/web-components/ribbon-home-layout.d.ts
|
|
2263
|
-
/**
|
|
2264
|
-
* Draws a layout's real artwork inside a tile's scaled surface. The artwork is
|
|
2265
|
-
* element rendering that each binding owns; return a disposer to release it.
|
|
2266
|
-
*/
|
|
2267
|
-
type HomeLayoutArtwork = (preview: PptxLayoutPreview, geometry: LayoutPreviewGeometry, container: HTMLElement) => (() => void) | void;
|
|
2268
|
-
interface PptxUiRibbonHomeElement extends HTMLElement {
|
|
2269
|
-
state: RibbonHomeViewState;
|
|
2270
|
-
/** Draws a layout's real artwork inside a gallery tile; the host owns element rendering. */
|
|
2271
|
-
layoutArtwork: HomeLayoutArtwork | undefined;
|
|
2272
|
-
/** Wrapper (or button) of a control id. */
|
|
2273
|
-
anchor(id: string): HTMLElement | undefined;
|
|
2274
|
-
}
|
|
2275
|
-
declare global {
|
|
2276
|
-
interface HTMLElementTagNameMap {
|
|
2277
|
-
'pptx-ui-ribbon-home-clipboard': PptxUiRibbonHomeElement;
|
|
2278
|
-
'pptx-ui-ribbon-home-font': PptxUiRibbonHomeElement;
|
|
2279
|
-
'pptx-ui-ribbon-home-paragraph': PptxUiRibbonHomeElement;
|
|
2280
|
-
'pptx-ui-ribbon-home-editing': PptxUiRibbonHomeElement;
|
|
2281
|
-
'pptx-ui-ribbon-home-slides': PptxUiRibbonHomeElement;
|
|
2282
|
-
'pptx-ui-ribbon-home-drawing': PptxUiRibbonHomeElement;
|
|
2283
|
-
'pptx-ui-ribbon-home-arrange-align': PptxUiRibbonHomeElement;
|
|
2284
|
-
'pptx-ui-ribbon-home-arrange-flip': PptxUiRibbonHomeElement;
|
|
2285
|
-
'pptx-ui-ribbon-home-arrange-order': PptxUiRibbonHomeElement;
|
|
2286
|
-
'pptx-ui-ribbon-home-arrange-edit': PptxUiRibbonHomeElement;
|
|
2287
|
-
'pptx-ui-ribbon-home-font-picker': PptxUiRibbonHomeElement;
|
|
2288
|
-
'pptx-ui-ribbon-home-arrange-painter': PptxUiRibbonHomeElement;
|
|
2289
|
-
'pptx-ui-ribbon-home-arrange-shape': PptxUiRibbonHomeElement;
|
|
2290
|
-
}
|
|
2291
|
-
}
|
|
2292
|
-
interface PptxUiRibbonTransitionsElement extends HTMLElement {
|
|
2293
|
-
state: RibbonTransitionsViewState;
|
|
2294
|
-
}
|
|
2295
|
-
declare global {
|
|
2296
|
-
interface HTMLElementTagNameMap {
|
|
2297
|
-
'pptx-ui-ribbon-transitions': PptxUiRibbonTransitionsElement;
|
|
2298
|
-
}
|
|
2299
|
-
}
|
|
2300
|
-
interface PptxUiRibbonInsertElement extends HTMLElement {
|
|
2301
|
-
state: RibbonInsertState;
|
|
2302
|
-
/** Return focus to a control by its public id, e.g. after a native dialog closes. */
|
|
2303
|
-
focusControl(id: string): void;
|
|
2304
|
-
}
|
|
2305
|
-
declare global {
|
|
2306
|
-
interface HTMLElementTagNameMap {
|
|
2307
|
-
'pptx-ui-ribbon-insert': PptxUiRibbonInsertElement;
|
|
2308
|
-
}
|
|
2309
|
-
}
|
|
2310
|
-
interface PptxUiRibbonViewElement extends HTMLElement {
|
|
2311
|
-
state: RibbonViewState;
|
|
2312
|
-
}
|
|
2313
|
-
declare global {
|
|
2314
|
-
interface HTMLElementTagNameMap {
|
|
2315
|
-
'pptx-ui-ribbon-view': PptxUiRibbonViewElement;
|
|
2316
|
-
}
|
|
2317
|
-
}
|
|
2318
|
-
//#endregion
|
|
2319
|
-
//#region src/web-components/ribbon-section.d.ts
|
|
2320
|
-
interface PptxUiRibbonSectionElement extends HTMLElement {
|
|
2321
|
-
groups: readonly RibbonGroupView[];
|
|
2322
|
-
}
|
|
2323
|
-
declare global {
|
|
2324
|
-
interface HTMLElementTagNameMap {
|
|
2325
|
-
'pptx-ui-ribbon-section': PptxUiRibbonSectionElement;
|
|
2326
|
-
}
|
|
2327
|
-
}
|
|
2328
|
-
//#endregion
|
|
2329
|
-
//#region src/web-components/ribbon-gallery.d.ts
|
|
2330
|
-
type GalleryTranslate = (key: string, params?: Readonly<Record<string, string | number>>) => string;
|
|
2331
|
-
interface PptxUiRibbonGalleryElement extends HTMLElement {
|
|
2332
|
-
readonly trigger: HTMLButtonElement;
|
|
2333
|
-
readonly popup: HTMLElement;
|
|
2334
|
-
descriptor: RibbonGalleryDescriptor | undefined;
|
|
2335
|
-
translateLabel: GalleryTranslate;
|
|
2336
|
-
disabled: boolean;
|
|
2337
|
-
open: boolean;
|
|
2338
|
-
close(): void;
|
|
2339
|
-
}
|
|
2340
|
-
declare global {
|
|
2341
|
-
interface HTMLElementTagNameMap {
|
|
2342
|
-
'pptx-ui-ribbon-gallery': PptxUiRibbonGalleryElement;
|
|
2343
|
-
}
|
|
2344
|
-
}
|
|
2345
|
-
//#endregion
|
|
2346
|
-
//#region src/web-components/subtitle-settings.d.ts
|
|
2347
|
-
interface PptxUiSubtitleSettingsElement extends HTMLElement {
|
|
2348
|
-
settings: SubtitleSettings;
|
|
2349
|
-
labels: SubtitleSettingsLabels;
|
|
2350
|
-
languageDisabled: boolean;
|
|
2351
|
-
}
|
|
2352
|
-
declare global {
|
|
2353
|
-
interface HTMLElementTagNameMap {
|
|
2354
|
-
'pptx-ui-subtitle-settings': PptxUiSubtitleSettingsElement;
|
|
2355
|
-
}
|
|
2356
|
-
}
|
|
2357
|
-
interface PptxUiStatusBarElement extends HTMLElement {
|
|
2358
|
-
state: StatusBarViewState;
|
|
2359
|
-
}
|
|
2360
|
-
declare global {
|
|
2361
|
-
interface HTMLElementTagNameMap {
|
|
2362
|
-
'pptx-ui-status-bar': PptxUiStatusBarElement;
|
|
2363
|
-
}
|
|
2364
|
-
}
|
|
2365
|
-
interface PptxUiNotesToolbarElement extends HTMLElement {
|
|
2366
|
-
state: NotesToolbarViewState;
|
|
2367
|
-
}
|
|
2368
|
-
declare global {
|
|
2369
|
-
interface HTMLElementTagNameMap {
|
|
2370
|
-
'pptx-ui-notes-toolbar': PptxUiNotesToolbarElement;
|
|
2371
|
-
}
|
|
2372
|
-
}
|
|
2373
|
-
interface PptxUiTitleBarElement extends HTMLElement {
|
|
2374
|
-
state: TitleBarViewState | undefined;
|
|
2375
|
-
placement: TitleBarPlacement;
|
|
2376
|
-
}
|
|
2377
|
-
declare global {
|
|
2378
|
-
interface HTMLElementTagNameMap {
|
|
2379
|
-
'pptx-ui-title-bar': PptxUiTitleBarElement;
|
|
2380
|
-
}
|
|
2381
|
-
}
|
|
2382
|
-
//#endregion
|
|
2383
|
-
//#region src/web-components/select-value.d.ts
|
|
2384
|
-
/**
|
|
2385
|
-
* Public DOM shape of `pptx-ui-select`, used by every binding. The element is ooxml-ui's
|
|
2386
|
-
* `office-ui-select` under the pptx tag (see `office-aliases.ts`); it is not a native select.
|
|
2387
|
-
*/
|
|
2388
|
-
interface PptxUiSelectElement extends HTMLElement {
|
|
2389
|
-
value: string;
|
|
2390
|
-
disabled: boolean;
|
|
2391
|
-
readonly options: HTMLOptionElement[];
|
|
2392
|
-
selectedIndex: number;
|
|
2393
|
-
}
|
|
2394
|
-
declare global {
|
|
2395
|
-
interface HTMLElementTagNameMap {
|
|
2396
|
-
'pptx-ui-select': PptxUiSelectElement;
|
|
2397
|
-
}
|
|
2398
|
-
}
|
|
2399
|
-
|
|
2400
|
-
//#endregion
|
|
2401
|
-
//#region src/i18n/locale-catalog.d.ts
|
|
2402
|
-
/** One selectable entry in the viewer chrome's built-in language picker (File > Options > Language). */
|
|
2403
|
-
interface LocaleCatalogEntry {
|
|
2404
|
-
/** BCP-47-ish locale code, e.g. `'en'`, `'fr'`. Matches `pptx-viewer-locales`' exports. */
|
|
2405
|
-
code: string;
|
|
2406
|
-
/** English display name, used before a translation dictionary for the target locale is loaded. */
|
|
2407
|
-
label: string;
|
|
2408
|
-
/** The locale's own name for itself, e.g. `'Français'` for `fr`. */
|
|
2409
|
-
nativeLabel: string;
|
|
2410
|
-
}
|
|
6
|
+
import { LocaleCatalogEntry } from 'ooxml-ui/pptx/i18n';
|
|
7
|
+
import { PptxAnimationPreset, ConnectorArrowType, PptxSlide, PptxElement, XmlObject, PptxElementAnimation, ShapeStyle, PptxSlideTransition, StrokeDashType, PptxNativeAnimation, PptxThemePreset, PptxThemeColorScheme, PptxThemeFontScheme, PptxHandler, PptxData } from 'ooxml-core/pptx';
|
|
8
|
+
import { PptxAiConfig } from 'ooxml-ui/pptx/ai';
|
|
9
|
+
export { PptxAiBridge, PptxAiConfig, PptxAiConnection, PptxAiContextStrategy, PptxAiToolName, PptxAiWritePolicy } from 'ooxml-ui/pptx/ai';
|
|
10
|
+
import * as Y from 'yjs';
|
|
11
|
+
import { Doc } from 'yjs';
|
|
2411
12
|
|
|
2412
13
|
//#region src/viewer/types-core.d.ts
|
|
2413
14
|
/**
|
|
@@ -2530,228 +131,6 @@ interface ShapeQuickStyle {
|
|
|
2530
131
|
style: Partial<ShapeStyle>;
|
|
2531
132
|
}
|
|
2532
133
|
//#endregion
|
|
2533
|
-
//#region ../shared/dist/ai/index.d.ts
|
|
2534
|
-
//#endregion
|
|
2535
|
-
//#region src/ai/change-animator.d.ts
|
|
2536
|
-
/** Host-tunable options for how AI edits are animated on the canvas. */
|
|
2537
|
-
interface AiChangeAnimationConfig {
|
|
2538
|
-
/** Master switch. Default true. */
|
|
2539
|
-
enabled?: boolean;
|
|
2540
|
-
/** How long the motion + glow plays, in ms. Default 900. */
|
|
2541
|
-
durationMs?: number;
|
|
2542
|
-
/** Draw the pulsing glow highlight on changed elements. Default true. */
|
|
2543
|
-
glow?: boolean;
|
|
2544
|
-
/** Glide old->new bounds and cross-fade colours. Default true. */
|
|
2545
|
-
tween?: boolean;
|
|
2546
|
-
/** Accent colour (any CSS colour) for the glow/ghosts. Default a blue. */
|
|
2547
|
-
color?: string;
|
|
2548
|
-
}
|
|
2549
|
-
//#endregion
|
|
2550
|
-
//#region src/ai/config.d.ts
|
|
2551
|
-
/** The UI message shape exchanged with the assistant. Alias of the SDK type. */
|
|
2552
|
-
type PptxAiUIMessage = UIMessage;
|
|
2553
|
-
/**
|
|
2554
|
-
* Canonical name of every tool the assistant can call. Document tools mirror the
|
|
2555
|
-
* `pptx-viewer-mcp` server exactly (they ARE the same functions, run against the
|
|
2556
|
-
* live deck); the viewer-only tools (navigation, deck outline, element/notes
|
|
2557
|
-
* readers, table merge) have no MCP counterpart.
|
|
2558
|
-
*/
|
|
2559
|
-
type PptxAiToolName = 'get_deck_overview' | 'get_slide' | 'get_element' | 'get_speaker_notes' | 'find_text' | 'get_theme' | 'go_to_slide' | 'select_elements' | 'merge_tables' | 'get_metadata' | 'get_layouts' | 'find_placeholders' | 'get_presentation_properties' | 'run_accessibility_check' | 'convert_to_markdown' | 'export_to_json' | 'add_element' | 'update_element' | 'delete_elements' | 'arrange_elements' | 'clone_element' | 'set_element_animation' | 'group_elements' | 'ungroup_elements' | 'batch_update_elements' | 'update_element_style' | 'replace_geometry' | 'set_element_lock' | 'manage_hyperlinks' | 'replace_text' | 'manage_comments' | 'update_table_cells' | 'manage_table_structure' | 'create_chart' | 'update_chart' | 'add_chart_series' | 'remove_chart_series' | 'update_chart_series_data' | 'manage_smart_art' | 'apply_template' | 'add_slide' | 'duplicate_slide' | 'delete_slides' | 'reorder_slides' | 'update_slide_properties' | 'set_slide_transition' | 'apply_theme_preset' | 'update_theme_colors' | 'update_theme_fonts' | 'set_canvas_size' | 'update_metadata' | 'manage_sections' | 'update_presentation_properties' | 'import_from_json' | 'apply_layout';
|
|
2560
|
-
type Resolvable<T> = T | (() => T | Promise<T>);
|
|
2561
|
-
/** How the assistant reaches a language model. */
|
|
2562
|
-
type PptxAiConnection =
|
|
2563
|
-
/**
|
|
2564
|
-
* Post messages to a host backend route (recommended for production so the
|
|
2565
|
-
* provider API key stays server-side). Maps to `DefaultChatTransport`.
|
|
2566
|
-
*/
|
|
2567
|
-
{
|
|
2568
|
-
kind: 'endpoint';
|
|
2569
|
-
api: string;
|
|
2570
|
-
headers?: Resolvable<Record<string, string>>;
|
|
2571
|
-
body?: Resolvable<Record<string, unknown>>;
|
|
2572
|
-
credentials?: RequestCredentials;
|
|
2573
|
-
fetch?: typeof globalThis.fetch;
|
|
2574
|
-
} |
|
|
2575
|
-
/**
|
|
2576
|
-
* Run a language model in-process in the browser (bring-your-own key /
|
|
2577
|
-
* local model). Maps to a `ToolLoopAgent` behind a `DirectChatTransport`.
|
|
2578
|
-
*/
|
|
2579
|
-
{
|
|
2580
|
-
kind: 'model';
|
|
2581
|
-
model: LanguageModel;
|
|
2582
|
-
system?: string;
|
|
2583
|
-
maxSteps?: number;
|
|
2584
|
-
} |
|
|
2585
|
-
/** Provide a fully-constructed transport (advanced / testing escape hatch). */
|
|
2586
|
-
{
|
|
2587
|
-
kind: 'transport';
|
|
2588
|
-
transport: ChatTransport<PptxAiUIMessage>;
|
|
2589
|
-
};
|
|
2590
|
-
/** How writes proposed by the assistant reach the document. */
|
|
2591
|
-
type PptxAiWritePolicy = 'stage' | 'approve' | 'auto';
|
|
2592
|
-
/** Which deck context is fed to the model with each turn. */
|
|
2593
|
-
type PptxAiContextStrategy = 'outline' | 'current-slide' | 'none';
|
|
2594
|
-
/** Optional per-session history persistence hooks. */
|
|
2595
|
-
interface PptxAiHistoryHooks {
|
|
2596
|
-
load?(id: string): Promise<PptxAiUIMessage[]>;
|
|
2597
|
-
save?(id: string, messages: PptxAiUIMessage[]): Promise<void>;
|
|
2598
|
-
}
|
|
2599
|
-
/** Complete host configuration for an AI chat session. */
|
|
2600
|
-
interface PptxAiConfig {
|
|
2601
|
-
connection: PptxAiConnection;
|
|
2602
|
-
/** Extra host instructions appended to the base system prompt. */
|
|
2603
|
-
systemPromptExtras?: string;
|
|
2604
|
-
tools?: {
|
|
2605
|
-
/** Allowlist. When set, only these tools are exposed. */
|
|
2606
|
-
enabled?: PptxAiToolName[];
|
|
2607
|
-
/** Denylist, applied after `enabled`. */
|
|
2608
|
-
disabled?: PptxAiToolName[];
|
|
2609
|
-
/** Additional host-defined tools merged into the tool set. */
|
|
2610
|
-
extra?: ToolSet;
|
|
2611
|
-
};
|
|
2612
|
-
/** Default `'stage'`. */
|
|
2613
|
-
writePolicy?: PptxAiWritePolicy;
|
|
2614
|
-
/** Default `'outline'`. */
|
|
2615
|
-
contextStrategy?: PptxAiContextStrategy;
|
|
2616
|
-
history?: PptxAiHistoryHooks;
|
|
2617
|
-
/**
|
|
2618
|
-
* How AI edits are animated on the canvas so the user can watch them land
|
|
2619
|
-
* (glide old->new, fade/scale in-out, glow-pulse). Omit for the defaults;
|
|
2620
|
-
* set `{ enabled: false }` to turn it off.
|
|
2621
|
-
*/
|
|
2622
|
-
changeAnimation?: AiChangeAnimationConfig;
|
|
2623
|
-
onError?(error: Error): void;
|
|
2624
|
-
}
|
|
2625
|
-
//#endregion
|
|
2626
|
-
//#region src/ai/bridge.d.ts
|
|
2627
|
-
/** Lightweight, model-friendly summary of the whole deck. */
|
|
2628
|
-
interface PptxAiDeckMeta {
|
|
2629
|
-
/** Total number of slides. */
|
|
2630
|
-
slideCount: number;
|
|
2631
|
-
/** Zero-based index of the currently active slide. */
|
|
2632
|
-
activeSlideIndex: number;
|
|
2633
|
-
/** Deck title, when known (first slide title / core properties). */
|
|
2634
|
-
title?: string;
|
|
2635
|
-
/** Slide canvas width in CSS pixels. */
|
|
2636
|
-
width: number;
|
|
2637
|
-
/** Slide canvas height in CSS pixels. */
|
|
2638
|
-
height: number;
|
|
2639
|
-
}
|
|
2640
|
-
/** Severity hint for {@link PptxAiBridge.notify}. */
|
|
2641
|
-
type PptxAiNotifyLevel = 'info' | 'success' | 'warning' | 'error';
|
|
2642
|
-
/**
|
|
2643
|
-
* A target the user has scoped the assistant to: either a whole slide or a
|
|
2644
|
-
* single element on a slide. Returned by {@link PptxAiBridge.getFocusedTargets}
|
|
2645
|
-
* so the context builder can tell the model exactly what to focus on.
|
|
2646
|
-
*/
|
|
2647
|
-
type PptxAiFocusedTarget = {
|
|
2648
|
-
kind: 'slide';
|
|
2649
|
-
slideIndex: number;
|
|
2650
|
-
} | {
|
|
2651
|
-
kind: 'element';
|
|
2652
|
-
slideIndex: number;
|
|
2653
|
-
elementId: string;
|
|
2654
|
-
};
|
|
2655
|
-
/**
|
|
2656
|
-
* A pure updater over the deck's slides. It receives a deep clone of the
|
|
2657
|
-
* current slides (mutation-safe) and returns the next slides array. The bridge
|
|
2658
|
-
* commits the returned array as ONE history entry.
|
|
2659
|
-
*/
|
|
2660
|
-
type PptxAiSlidesUpdater = (slides: PptxSlide[]) => PptxSlide[];
|
|
2661
|
-
/**
|
|
2662
|
-
* A pure updater over the whole parsed deck ({@link PptxData}). Mirrors the
|
|
2663
|
-
* `pptx-viewer-mcp` tool model (data in, mutated data out) so presentation-level
|
|
2664
|
-
* MCP tools (metadata, sections, canvas size, presentation properties, layouts)
|
|
2665
|
-
* can be committed as ONE undoable history entry through {@link
|
|
2666
|
-
* PptxAiBridge.applyDeckData}. Optional: bindings that only track slide/theme
|
|
2667
|
-
* state can omit it, in which case those presentation-level tools report that
|
|
2668
|
-
* they are unavailable in this viewer while every slide/theme tool still works.
|
|
2669
|
-
*/
|
|
2670
|
-
type PptxAiDataUpdater = (data: PptxData) => PptxData;
|
|
2671
|
-
/** Field-level updates for a single element, mirroring the MCP update vocab. */
|
|
2672
|
-
interface PptxAiElementUpdate {
|
|
2673
|
-
x?: number;
|
|
2674
|
-
y?: number;
|
|
2675
|
-
width?: number;
|
|
2676
|
-
height?: number;
|
|
2677
|
-
rotation?: number;
|
|
2678
|
-
opacity?: number;
|
|
2679
|
-
hidden?: boolean;
|
|
2680
|
-
flipHorizontal?: boolean;
|
|
2681
|
-
flipVertical?: boolean;
|
|
2682
|
-
text?: string;
|
|
2683
|
-
fontSize?: number;
|
|
2684
|
-
fontFamily?: string;
|
|
2685
|
-
fontColor?: string;
|
|
2686
|
-
bold?: boolean;
|
|
2687
|
-
italic?: boolean;
|
|
2688
|
-
underline?: boolean;
|
|
2689
|
-
align?: 'left' | 'center' | 'right' | 'justify';
|
|
2690
|
-
fillColor?: string;
|
|
2691
|
-
strokeColor?: string;
|
|
2692
|
-
strokeWidth?: number;
|
|
2693
|
-
}
|
|
2694
|
-
/**
|
|
2695
|
-
* Implemented by each binding to expose its live editor to the AI core.
|
|
2696
|
-
*
|
|
2697
|
-
* Read methods must be cheap and synchronous. Write methods must route through
|
|
2698
|
-
* the binding's editor-history layer so AI edits are undoable like manual ones.
|
|
2699
|
-
*/
|
|
2700
|
-
interface PptxAiBridge {
|
|
2701
|
-
/** Return a summary of the whole deck. */
|
|
2702
|
-
getDeckMeta(): PptxAiDeckMeta;
|
|
2703
|
-
/** Return the deck's slides. Callers must not mutate the returned array. */
|
|
2704
|
-
getSlides(): PptxSlide[];
|
|
2705
|
-
/** Return the zero-based index of the active slide. */
|
|
2706
|
-
getActiveSlideIndex(): number;
|
|
2707
|
-
/** Return the resolved presentation theme, when available. */
|
|
2708
|
-
getTheme(): PptxTheme | undefined;
|
|
2709
|
-
/** Return the underlying core handler, when the binding exposes one. */
|
|
2710
|
-
getHandler(): PptxHandler | undefined;
|
|
2711
|
-
/** Navigate the viewer to a slide by zero-based index. */
|
|
2712
|
-
goToSlide(index: number): void;
|
|
2713
|
-
/** Select the given elements on a slide (empty array clears selection). */
|
|
2714
|
-
selectElements(slideIndex: number, elementIds: string[]): void;
|
|
2715
|
-
/**
|
|
2716
|
-
* Apply a slides updater as a single, atomic, undoable history entry. The
|
|
2717
|
-
* binding is responsible for cloning current slides before calling
|
|
2718
|
-
* `updater` and for installing the result.
|
|
2719
|
-
*/
|
|
2720
|
-
applySlidesUpdate(updater: PptxAiSlidesUpdater, label: string): void;
|
|
2721
|
-
/** Apply field updates to one element as a single history entry. */
|
|
2722
|
-
updateElement(slideIndex: number, elementId: string, updates: PptxAiElementUpdate): void;
|
|
2723
|
-
/** Apply partial theme updates as a single history entry. */
|
|
2724
|
-
applyTheme(updates: Partial<PptxTheme>): void;
|
|
2725
|
-
/**
|
|
2726
|
-
* Return the full parsed {@link PptxData} for the open deck, with the live
|
|
2727
|
-
* (edited) slides and theme overlaid. Enables `pptx-viewer-mcp` tools that
|
|
2728
|
-
* read presentation-level state (metadata, sections, layouts, presentation
|
|
2729
|
-
* properties). Optional: when absent, the AI core synthesises a minimal
|
|
2730
|
-
* PptxData from slides + dimensions, which is enough for every slide/theme
|
|
2731
|
-
* tool but not for presentation-level reads.
|
|
2732
|
-
*/
|
|
2733
|
-
getDeckData?(): PptxData | undefined;
|
|
2734
|
-
/**
|
|
2735
|
-
* Commit a whole-deck {@link PptxData} mutation as one undoable history entry.
|
|
2736
|
-
* Used to apply presentation-level MCP tool results (metadata, sections,
|
|
2737
|
-
* canvas size, presentation properties, layouts). Optional: when absent,
|
|
2738
|
-
* those tools report they are not supported in this viewer; slide/theme tools
|
|
2739
|
-
* are unaffected (they route through {@link PptxAiBridge.applySlidesUpdate}
|
|
2740
|
-
* and {@link PptxAiBridge.applyTheme}).
|
|
2741
|
-
*/
|
|
2742
|
-
applyDeckData?(updater: PptxAiDataUpdater, label: string): void;
|
|
2743
|
-
/**
|
|
2744
|
-
* Return the slides / elements the user has scoped the assistant to, if any.
|
|
2745
|
-
* When present and non-empty, the context builder tells the model to focus on
|
|
2746
|
-
* exactly these targets. Optional so existing bridges satisfy the contract
|
|
2747
|
-
* without change; a bridge that does not implement it behaves as before (no
|
|
2748
|
-
* focus scoping).
|
|
2749
|
-
*/
|
|
2750
|
-
getFocusedTargets?(): PptxAiFocusedTarget[];
|
|
2751
|
-
/** Surface a transient message in the host UI (toast / status line). */
|
|
2752
|
-
notify?(message: string, level?: PptxAiNotifyLevel): void;
|
|
2753
|
-
}
|
|
2754
|
-
//#endregion
|
|
2755
134
|
//#region src/viewer/hooks/collaboration/types.d.ts
|
|
2756
135
|
/** Connection lifecycle states for the Yjs WebSocket provider. */
|
|
2757
136
|
type ConnectionStatus = 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
@@ -2955,7 +334,7 @@ interface PowerPointViewerProps extends ViewportFitOptions {
|
|
|
2955
334
|
/** Callback when active slide changes */
|
|
2956
335
|
onActiveSlideChange?: (slideIndex: number) => void;
|
|
2957
336
|
/** Callback when the viewer mode changes (e.g. edit to present). */
|
|
2958
|
-
onModeChange?: (mode: ViewerMode) => void;
|
|
337
|
+
onModeChange?: (mode: ooxml_ui_pptx.ViewerMode) => void;
|
|
2959
338
|
/** Callback when the zoom level changes. */
|
|
2960
339
|
onZoomChange?: (zoom: number) => void;
|
|
2961
340
|
/** Callback when element selection changes. */
|
|
@@ -3579,5 +958,5 @@ interface CollaborationStatusIndicatorProps {
|
|
|
3579
958
|
}
|
|
3580
959
|
declare function CollaborationStatusIndicator({ status, connectedCount, onRetry }: CollaborationStatusIndicatorProps): React__default.ReactElement;
|
|
3581
960
|
|
|
3582
|
-
export { CollaborationProvider, CollaborationStatusIndicator, PowerPointViewer, RemoteUserCursors, UserAvatarBar,
|
|
3583
|
-
export type { AccessibilityIssue, AnimationPresetOption, CanvasContextMenuState, CanvasSize,
|
|
961
|
+
export { CollaborationProvider, CollaborationStatusIndicator, PowerPointViewer, RemoteUserCursors, UserAvatarBar, getAnimationInitialStyle, isAudienceTab, parseAudienceNonce, useCollaborativeHistory, useCollaborativeState, usePresenceTracking, useThemeSwitching, useYjsProvider };
|
|
962
|
+
export type { AccessibilityIssue, AnimationPresetOption, CanvasContextMenuState, CanvasSize, CollaborationContextValue, CollaborationStatusIndicatorProps, ConnectionStatus, ConnectorArrowOption, ConnectorGeometryOption, ConnectorGeometryType, ConnectorPathGeometry, DragState, DrawingTool, EditorHistorySnapshot, ElementBounds, ElementContextMenuAction, ElementContextMenuState, FileViewerHandle, MarqueeSelectionState, ParsedTableCell, ParsedTableData, PowerPointViewerHandle, PowerPointViewerProps, PresentationAnimationRuntime, RemoteUserCursorsProps, ResizeHandle, ResizeState, ShapePreset, ShapeQuickStyle, ShortcutReferenceItem, SlideAlignment, SlideSectionGroup, SlideTransitionOption, StrokeDashOption, SupportedShapeType, TableCellEditorState, ThemeSwitchingResult, ToolbarSection, UseCollaborativeHistoryResult, UseCollaborativeStateInput, UsePresenceTrackingResult, UseThemeSwitchingInput, UserAvatarBarProps, UserPresence };
|