pptx-react-viewer 4.26.0 → 4.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/README.md +3 -0
  3. package/dist/{AiChatPanel-TIJ3MRTR.mjs → AiChatPanel-6EIOUV7J.mjs} +3 -7
  4. package/dist/AiChatPanel-6EIOUV7J.mjs.br +0 -0
  5. package/dist/AiChatPanel-6EIOUV7J.mjs.gz +0 -0
  6. package/dist/{AiChatPanel-PGZDMW4M.js → AiChatPanel-AK6X4NJD.js} +27 -31
  7. package/dist/AiChatPanel-AK6X4NJD.js.br +0 -0
  8. package/dist/AiChatPanel-AK6X4NJD.js.gz +0 -0
  9. package/dist/{Model3DScene-SJGIK2TB.mjs → Model3DScene-EZDCI7TT.mjs} +2 -2
  10. package/dist/Model3DScene-EZDCI7TT.mjs.br +0 -0
  11. package/dist/Model3DScene-EZDCI7TT.mjs.gz +0 -0
  12. package/dist/{Model3DScene-LQBTZGVN.js → Model3DScene-KYIYYLMY.js} +3 -3
  13. package/dist/Model3DScene-KYIYYLMY.js.br +0 -0
  14. package/dist/Model3DScene-KYIYYLMY.js.gz +0 -0
  15. package/dist/{chunk-QJNZZBVF.mjs → chunk-6YOFWVII.mjs} +149 -167
  16. package/dist/chunk-6YOFWVII.mjs.br +0 -0
  17. package/dist/chunk-6YOFWVII.mjs.gz +0 -0
  18. package/dist/{chunk-ZW2WNQN7.js → chunk-7JMO6R6B.js} +1215 -1190
  19. package/dist/chunk-7JMO6R6B.js.br +0 -0
  20. package/dist/chunk-7JMO6R6B.js.gz +0 -0
  21. package/dist/{chunk-VEVEP7VF.js → chunk-CTL42ZRR.js} +533 -272
  22. package/dist/chunk-CTL42ZRR.js.br +0 -0
  23. package/dist/chunk-CTL42ZRR.js.gz +0 -0
  24. package/dist/{chunk-4VNS5WPM.js → chunk-DFFCFNK2.js} +2 -5
  25. package/dist/chunk-DFFCFNK2.js.br +0 -0
  26. package/dist/chunk-DFFCFNK2.js.gz +0 -0
  27. package/dist/{chunk-K564H64A.mjs → chunk-EW45F35P.mjs} +125 -176
  28. package/dist/chunk-EW45F35P.mjs.br +0 -0
  29. package/dist/chunk-EW45F35P.mjs.gz +0 -0
  30. package/dist/{chunk-XGB3TDIC.mjs → chunk-GDQSMJQZ.mjs} +2 -5
  31. package/dist/chunk-GDQSMJQZ.mjs.br +0 -0
  32. package/dist/chunk-GDQSMJQZ.mjs.gz +0 -0
  33. package/dist/{chunk-PW3YOZFA.js → chunk-K3EGXT6W.js} +921 -933
  34. package/dist/chunk-K3EGXT6W.js.br +0 -0
  35. package/dist/chunk-K3EGXT6W.js.gz +0 -0
  36. package/dist/{chunk-USJXG5TE.mjs → chunk-VI575UU6.mjs} +87 -105
  37. package/dist/chunk-VI575UU6.mjs.br +0 -0
  38. package/dist/chunk-VI575UU6.mjs.gz +0 -0
  39. package/dist/i18n.d.ts +1 -46
  40. package/dist/i18n.js +5 -5
  41. package/dist/i18n.js.br +2 -2
  42. package/dist/i18n.js.gz +0 -0
  43. package/dist/i18n.mjs +2 -2
  44. package/dist/i18n.mjs.br +0 -0
  45. package/dist/i18n.mjs.gz +0 -0
  46. package/dist/index.d.ts +28 -3703
  47. package/dist/index.js +96 -97
  48. package/dist/index.js.br +0 -0
  49. package/dist/index.js.gz +0 -0
  50. package/dist/index.mjs +6 -7
  51. package/dist/index.mjs.br +0 -0
  52. package/dist/index.mjs.gz +0 -0
  53. package/dist/internals.d.ts +16 -3848
  54. package/dist/internals.js +114 -115
  55. package/dist/internals.js.br +0 -0
  56. package/dist/internals.js.gz +0 -0
  57. package/dist/internals.mjs +4 -5
  58. package/dist/internals.mjs.br +0 -0
  59. package/dist/internals.mjs.gz +0 -0
  60. package/dist/{chunk-NJYF5KTY.mjs → three.module-2R4ADL7W.mjs} +2 -0
  61. package/dist/three.module-2R4ADL7W.mjs.br +0 -0
  62. package/dist/three.module-2R4ADL7W.mjs.gz +0 -0
  63. package/dist/{chunk-QS3GAPPA.js → three.module-LS32MK23.js} +2 -0
  64. package/dist/three.module-LS32MK23.js.br +0 -0
  65. package/dist/three.module-LS32MK23.js.gz +0 -0
  66. package/dist/viewer/index.d.ts +29 -2633
  67. package/dist/viewer/index.js +35 -37
  68. package/dist/viewer/index.js.br +0 -0
  69. package/dist/viewer/index.js.gz +0 -0
  70. package/dist/viewer/index.mjs +5 -7
  71. package/dist/viewer/index.mjs.br +0 -0
  72. package/dist/viewer/index.mjs.gz +0 -0
  73. package/dist/{y-webrtc-GAHCEZSS.mjs → y-webrtc-6DZI5KUK.mjs} +1 -1
  74. package/dist/y-webrtc-6DZI5KUK.mjs.br +0 -0
  75. package/dist/y-webrtc-6DZI5KUK.mjs.gz +0 -0
  76. package/dist/{y-webrtc-F2H7BRUK.js → y-webrtc-OTRGEYOH.js} +5 -5
  77. package/dist/y-webrtc-OTRGEYOH.js.br +0 -0
  78. package/dist/y-webrtc-OTRGEYOH.js.gz +0 -0
  79. package/dist/{y-websocket-FBMB63F4.js → y-websocket-AWBYMAHL.js} +1 -1
  80. package/dist/y-websocket-AWBYMAHL.js.br +0 -0
  81. package/dist/y-websocket-AWBYMAHL.js.gz +0 -0
  82. package/dist/{y-websocket-MAGDFVLN.mjs → y-websocket-VAKUVRQT.mjs} +1 -1
  83. package/dist/y-websocket-VAKUVRQT.mjs.br +0 -0
  84. package/dist/y-websocket-VAKUVRQT.mjs.gz +0 -0
  85. package/package.json +4 -4
  86. package/dist/AiChatPanel-PGZDMW4M.js.br +0 -0
  87. package/dist/AiChatPanel-PGZDMW4M.js.gz +0 -0
  88. package/dist/AiChatPanel-TIJ3MRTR.mjs.br +0 -0
  89. package/dist/AiChatPanel-TIJ3MRTR.mjs.gz +0 -0
  90. package/dist/GLTFLoader-O7FNKCHG.mjs +0 -2649
  91. package/dist/GLTFLoader-O7FNKCHG.mjs.br +0 -0
  92. package/dist/GLTFLoader-O7FNKCHG.mjs.gz +0 -0
  93. package/dist/GLTFLoader-UM56GMCK.js +0 -2651
  94. package/dist/GLTFLoader-UM56GMCK.js.br +0 -0
  95. package/dist/GLTFLoader-UM56GMCK.js.gz +0 -0
  96. package/dist/Model3DScene-LQBTZGVN.js.br +0 -0
  97. package/dist/Model3DScene-LQBTZGVN.js.gz +0 -0
  98. package/dist/Model3DScene-SJGIK2TB.mjs.br +0 -0
  99. package/dist/Model3DScene-SJGIK2TB.mjs.gz +0 -0
  100. package/dist/OrbitControls-EXEHIXFI.js +0 -922
  101. package/dist/OrbitControls-EXEHIXFI.js.br +0 -0
  102. package/dist/OrbitControls-EXEHIXFI.js.gz +0 -0
  103. package/dist/OrbitControls-PZQ4CBVS.mjs +0 -920
  104. package/dist/OrbitControls-PZQ4CBVS.mjs.br +0 -0
  105. package/dist/OrbitControls-PZQ4CBVS.mjs.gz +0 -0
  106. package/dist/UTIF-6SHLXCNF.js +0 -6402
  107. package/dist/UTIF-6SHLXCNF.js.br +0 -0
  108. package/dist/UTIF-6SHLXCNF.js.gz +0 -0
  109. package/dist/UTIF-CNNXS5Z5.mjs +0 -6400
  110. package/dist/UTIF-CNNXS5Z5.mjs.br +0 -0
  111. package/dist/UTIF-CNNXS5Z5.mjs.gz +0 -0
  112. package/dist/chunk-4VNS5WPM.js.br +0 -0
  113. package/dist/chunk-4VNS5WPM.js.gz +0 -0
  114. package/dist/chunk-6HMJTCFO.js +0 -4247
  115. package/dist/chunk-6HMJTCFO.js.br +0 -0
  116. package/dist/chunk-6HMJTCFO.js.gz +0 -0
  117. package/dist/chunk-DKMPRUXL.mjs +0 -22197
  118. package/dist/chunk-DKMPRUXL.mjs.br +0 -0
  119. package/dist/chunk-DKMPRUXL.mjs.gz +0 -0
  120. package/dist/chunk-K564H64A.mjs.br +0 -0
  121. package/dist/chunk-K564H64A.mjs.gz +0 -0
  122. package/dist/chunk-LCWNHXHZ.mjs +0 -312894
  123. package/dist/chunk-LCWNHXHZ.mjs.br +0 -0
  124. package/dist/chunk-LCWNHXHZ.mjs.gz +0 -0
  125. package/dist/chunk-NJYF5KTY.mjs.br +0 -0
  126. package/dist/chunk-NJYF5KTY.mjs.gz +0 -0
  127. package/dist/chunk-NWZKMLGC.js +0 -22241
  128. package/dist/chunk-NWZKMLGC.js.br +0 -0
  129. package/dist/chunk-NWZKMLGC.js.gz +0 -0
  130. package/dist/chunk-PW3YOZFA.js.br +0 -0
  131. package/dist/chunk-PW3YOZFA.js.gz +0 -0
  132. package/dist/chunk-QJNZZBVF.mjs.br +0 -0
  133. package/dist/chunk-QJNZZBVF.mjs.gz +0 -0
  134. package/dist/chunk-QS3GAPPA.js.br +0 -0
  135. package/dist/chunk-QS3GAPPA.js.gz +0 -0
  136. package/dist/chunk-UHW3R465.js +0 -314151
  137. package/dist/chunk-UHW3R465.js.br +0 -0
  138. package/dist/chunk-UHW3R465.js.gz +0 -0
  139. package/dist/chunk-USJXG5TE.mjs.br +0 -0
  140. package/dist/chunk-USJXG5TE.mjs.gz +0 -0
  141. package/dist/chunk-VEVEP7VF.js.br +0 -0
  142. package/dist/chunk-VEVEP7VF.js.gz +0 -0
  143. package/dist/chunk-XGB3TDIC.mjs.br +0 -0
  144. package/dist/chunk-XGB3TDIC.mjs.gz +0 -0
  145. package/dist/chunk-XLPQM7OJ.mjs +0 -4243
  146. package/dist/chunk-XLPQM7OJ.mjs.br +0 -0
  147. package/dist/chunk-XLPQM7OJ.mjs.gz +0 -0
  148. package/dist/chunk-ZW2WNQN7.js.br +0 -0
  149. package/dist/chunk-ZW2WNQN7.js.gz +0 -0
  150. package/dist/smartart-layouts-5T2QZGLG.js +0 -2494
  151. package/dist/smartart-layouts-5T2QZGLG.js.br +0 -0
  152. package/dist/smartart-layouts-5T2QZGLG.js.gz +0 -0
  153. package/dist/smartart-layouts-UCAFYVFW.mjs +0 -2487
  154. package/dist/smartart-layouts-UCAFYVFW.mjs.br +0 -0
  155. package/dist/smartart-layouts-UCAFYVFW.mjs.gz +0 -0
  156. package/dist/three.module-BLHG4FHZ.js +0 -1783
  157. package/dist/three.module-BLHG4FHZ.js.br +0 -0
  158. package/dist/three.module-BLHG4FHZ.js.gz +0 -0
  159. package/dist/three.module-ZSSMKKHW.mjs +0 -2
  160. package/dist/three.module-ZSSMKKHW.mjs.br +0 -0
  161. package/dist/three.module-ZSSMKKHW.mjs.gz +0 -0
  162. package/dist/y-webrtc-F2H7BRUK.js.br +0 -0
  163. package/dist/y-webrtc-F2H7BRUK.js.gz +0 -0
  164. package/dist/y-webrtc-GAHCEZSS.mjs.br +0 -0
  165. package/dist/y-webrtc-GAHCEZSS.mjs.gz +0 -0
  166. package/dist/y-websocket-FBMB63F4.js.br +0 -0
  167. package/dist/y-websocket-FBMB63F4.js.gz +0 -0
  168. package/dist/y-websocket-MAGDFVLN.mjs.br +0 -0
  169. package/dist/y-websocket-MAGDFVLN.mjs.gz +0 -0
package/dist/index.d.ts CHANGED
@@ -1,3486 +1,16 @@
1
1
  import * as React$1 from 'react';
2
2
  import React$1__default from 'react';
3
- import { PptxTheme, PptxThemeColorRef, PptxLayoutPreview, PptxTransitionType, PptxSlideTransition, PptxElement, PptxSlide, TextSegment, TextStyle, ImagePptxElement, ShapePptxElement, PptxHandler, PptxData, PptxAnimationPreset, PptxNativeAnimation, InkPptxElement, PptxAction, PptxComment, PptxElementAnimation, ConnectorPptxElement, ParsedTableStyleMap, ShapeStyle, PptxLayoutOption, PptxCustomShow, PptxPresentationProperties } from 'ooxml-core/pptx';
3
+ import * as ooxml_ui_pptx from 'ooxml-ui/pptx';
4
+ import { CollaborationRole, CollaborationConfig, ViewportFitOptions, ViewerFontSource, ViewerTheme, ThemeCatalogEntry, AccountAuthConfig, ToolbarActionId, ViewerCustomization, PowerPointViewerAPI, ViewerCustomizationApi, CollaborationLivePatcher, InlineListReadResult, EditorImagePasteOptions, ViewerMode, RulerUnit, ElementAnimationState, ShapeAdjustmentHandleDescriptor, InlineTextEditSnapshot, ZoomNavigationTarget, FieldSubstitutionContext, EditPointsCommandId, EditPointsElementPatch, FreeformToolKind, ElementClipboardPayload, AnimationApplyGroup, InsertChartKind, ChangeCaseMode, SlideTemplateId, CollaborationShellState } from 'ooxml-ui/pptx';
5
+ export { AVATAR_COLOR_SWATCHES, AccountAuthConfig, BACKSTAGE_CARD_IDS, BACKSTAGE_PAGE_IDS, BackstageCustomization, CANVAS_CONTEXT_MENU_COMMAND_IDS, CollaborationConfig, CollaborationShellState, ContextMenuCustomization, DEFAULT_VIEWER_PROFILE, EDITOR_SHORTCUT_ACTION_IDS, ELEMENT_CONTEXT_MENU_COMMAND_IDS, ElementUpdate, ElementUpdateOptions, ExternalCollaborationAwareness, ExternalCollaborationSession, ExternalCollaborationSnapshot, HostCanvasMenuContext, HostElementMenuContext, HostMenuCommand, KeyboardCustomization, LocalStorageUsageSummary, OPTIONS_PAGE_IDS, OPTIONS_SECTION_IDS, OPTIONS_SETTING_IDS, OptionsCustomization, OptionsPageId, OptionsSectionId, OptionsSettingId, OptionsSettingValues, PPTX_OPEN_ACCEPT, PRESENTATION_OPEN_EXTENSIONS, PowerPointViewerAPI, RIBBON_TAB_IDS, ResolvedCustomization, RibbonCustomization, SLIDE_TEMPLATES, SavedPresentationFormat, ShortcutChord, SlideTemplateId, SlideTemplateSpec, StoredViewerPrefs, THEME_CATALOG, TOOLBAR_BUTTON_IDS, ThemeCatalogEntry, ToolbarActionId, ToolbarButtonId, ToolbarTabId, VIEWER_DIALOG_IDS, VIEWER_EXPORT_FORMAT_IDS, VIEWER_FEATURE_IDS, VIEWER_PANEL_IDS, VIEWER_PREFS_STORAGE_KEY, ViewerCustomization, ViewerCustomizationApi, ViewerDialogId, ViewerExportFormatId, ViewerFeatureId, ViewerMode, ViewerPanelId, ViewerProfile, ViewerTheme, ViewerThemeColors, ViewportFitOptions, ViewportFitPadding, buildSlideTemplateContent, buildSlideTemplateSlide, clearAllLocalViewerData, clearStoredViewerPrefs, createImageElementFromFile, defaultCssVars, defaultRadius, defaultThemeColors, describeCollaborationShellState, getLocalStorageUsageSummary, isLegacyBinaryPresentation, isSupportedPresentationFile, presentationBaseName, readStoredViewerPrefs, resolveProfileInitial, resolveThemeCatalogEntry, saveViewerProfile, savedPresentationFileName, themeToCssVars, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius, writeStoredViewerPrefs } from 'ooxml-ui/pptx';
6
+ import { LocaleCatalogEntry } from 'ooxml-ui/pptx/i18n';
7
+ export { LOCALE_CATALOG, LocaleCatalogEntry } from 'ooxml-ui/pptx/i18n';
8
+ import { PptxAiConfig } from 'ooxml-ui/pptx/ai';
9
+ export { PptxAiBridge, PptxAiConfig, PptxAiConnection, PptxAiContextStrategy, PptxAiToolName, PptxAiWritePolicy } from 'ooxml-ui/pptx/ai';
4
10
  import { Doc } from 'yjs';
5
- import { LanguageModel, ChatTransport, UIMessage, ToolSet } from 'ai';
11
+ import { PptxAnimationPreset, PptxNativeAnimation, PptxSlide, PptxElement, TextStyle, InkPptxElement, ShapePptxElement, PptxAction, PptxComment, PptxElementAnimation, ConnectorPptxElement, ParsedTableStyleMap, PptxTheme, ShapeStyle, PptxLayoutOption, PptxLayoutPreview, PptxCustomShow, PptxSlideTransition, PptxPresentationProperties } from 'ooxml-core/pptx';
6
12
  import { Options } from 'html2canvas-pro';
7
13
 
8
- //#endregion
9
- //#region src/i18n/locale-catalog.d.ts
10
- /** One selectable entry in the viewer chrome's built-in language picker (File > Options > Language). */
11
- interface LocaleCatalogEntry {
12
- /** BCP-47-ish locale code, e.g. `'en'`, `'fr'`. Matches `pptx-viewer-locales`' exports. */
13
- code: string;
14
- /** English display name, used before a translation dictionary for the target locale is loaded. */
15
- label: string;
16
- /** The locale's own name for itself, e.g. `'Français'` for `fr`. */
17
- nativeLabel: string;
18
- }
19
- /**
20
- * Built-in language choices offered by File > Options > Language when a host
21
- * doesn't supply its own `availableLocales`. Mirrors the locales shipped by
22
- * the optional `pptx-viewer-locales` package (English needs no dictionary,
23
- * it's the viewer's own baseline).
24
- */
25
- declare const LOCALE_CATALOG: readonly LocaleCatalogEntry[];
26
-
27
- //#region src/theme/types.d.ts
28
- /**
29
- * Theme configuration types for the PowerPoint viewer.
30
- *
31
- * All color values accept any valid CSS color string:
32
- * hex (`#6366f1`), rgb (`rgb(99 102 241)`), hsl (`hsl(239 84% 67%)`),
33
- * oklch (`oklch(0.585 0.233 277)`), named colors, etc.
34
- *
35
- * Framework-agnostic — shared by the React, Vue, and Angular bindings.
36
- */
37
- /**
38
- * Semantic color tokens for the viewer UI.
39
- *
40
- * These map to CSS custom properties (`--pptx-<token>`) and drive all
41
- * UI component colors. The naming follows the shadcn/ui convention so
42
- * that Tailwind + shadcn users get a familiar experience.
43
- */
44
- interface ViewerThemeColors {
45
- /** Page / root background */
46
- background: string;
47
- /** Default text color */
48
- foreground: string;
49
- /** Card / panel surface */
50
- card: string;
51
- /** Text on card surfaces */
52
- cardForeground: string;
53
- /** Popover / dropdown surface */
54
- popover: string;
55
- /** Text inside popovers */
56
- popoverForeground: string;
57
- /** Primary action color (buttons, active indicators) */
58
- primary: string;
59
- /** Text on primary-colored backgrounds */
60
- primaryForeground: string;
61
- /** Secondary / subdued action color */
62
- secondary: string;
63
- /** Text on secondary backgrounds */
64
- secondaryForeground: string;
65
- /** Muted / disabled surface */
66
- muted: string;
67
- /** Text on muted surfaces (also used for secondary text) */
68
- mutedForeground: string;
69
- /** Accent / hover-highlight surface */
70
- accent: string;
71
- /** Text on accent surfaces */
72
- accentForeground: string;
73
- /** Destructive / danger action color */
74
- destructive: string;
75
- /** Text on destructive backgrounds */
76
- destructiveForeground: string;
77
- /** Default border color */
78
- border: string;
79
- /** Input field border color */
80
- input: string;
81
- /** Focus ring color */
82
- ring: string;
83
- }
84
- /**
85
- * Full viewer theme configuration.
86
- *
87
- * Every property is optional — unset values fall back to the built-in
88
- * dark theme defaults.
89
- */
90
- interface ViewerTheme {
91
- /** Semantic UI colors. Each key maps to a `--pptx-<key>` CSS custom property. */
92
- colors?: Partial<ViewerThemeColors>;
93
- /** Base border-radius value (e.g. `"0.5rem"`, `"8px"`). */
94
- radius?: string;
95
- /**
96
- * Escape hatch: arbitrary CSS custom properties to set on the viewer
97
- * root element. Keys should include the `--` prefix.
98
- *
99
- * @example
100
- * ```ts
101
- * { "--my-custom-shadow": "0 4px 12px rgba(0,0,0,0.5)" }
102
- * ```
103
- */
104
- cssVars?: Record<string, string>;
105
- }
106
- //#endregion
107
- //#region src/theme/defaults.d.ts
108
- /**
109
- * Default dark-theme color values.
110
- *
111
- * These correspond to the built-in dark UI of the PowerPoint viewer and
112
- * use Tailwind's gray palette as the neutral scale with indigo as the
113
- * primary accent.
114
- */
115
- declare const defaultThemeColors: ViewerThemeColors;
116
- /** Default border-radius. */
117
- declare const defaultRadius = "0.5rem";
118
- //#endregion
119
- //#region src/theme/css-vars.d.ts
120
- /**
121
- * Convert a `ViewerTheme` into a flat `Record<string, string>` of CSS
122
- * custom properties (including the `--` prefix) ready to be spread onto
123
- * a `style` attribute.
124
- *
125
- * Only properties that differ from the built-in defaults are emitted when
126
- * `omitDefaults` is true (the default).
127
- */
128
- declare function themeToCssVars(theme: ViewerTheme | undefined, omitDefaults?: boolean): Record<string, string>;
129
- /**
130
- * Build the complete set of CSS custom properties with all defaults.
131
- * Useful for generating a full fallback stylesheet.
132
- */
133
- declare function defaultCssVars(): Record<string, string>;
134
- //#endregion
135
- //#region src/theme/presets.d.ts
136
- /**
137
- * Built-in "vermilion" theme presets.
138
- *
139
- * These mirror the pptx-viewer brand used on the documentation site:
140
- * a warm paper canvas in light mode, a dimmed presenter room in dark
141
- * mode, and the vermilion accent in both. Pass one to the viewer's
142
- * `theme` prop (React/Vue) or `provideViewerTheme` (Angular), or spread
143
- * the color objects to derive your own variant.
144
- */
145
- /** Light "paper" palette: a projection screen in a bright room. */
146
- declare const vermilionLightColors: ViewerThemeColors;
147
- /** Dark "presenter" palette: the presenter room with the lights down. */
148
- declare const vermilionDarkColors: ViewerThemeColors;
149
- /** Shared border-radius for the vermilion presets (slightly sharper than the default). */
150
- declare const vermilionRadius = "0.375rem";
151
- /** Light vermilion theme, ready for the viewer's `theme` prop. */
152
- declare const vermilionLightTheme: ViewerTheme;
153
- /** Dark vermilion theme, ready for the viewer's `theme` prop. */
154
- declare const vermilionDarkTheme: ViewerTheme;
155
- //#endregion
156
- //#region src/theme/theme-catalog.d.ts
157
- /** One selectable entry in the viewer chrome's built-in theme picker (File > Options > Appearance). */
158
- interface ThemeCatalogEntry {
159
- /** Stable identifier persisted to storage and passed to `onThemeChange`. */
160
- key: string;
161
- /** `pptx.*` translation key for the entry's display label. */
162
- labelKey: string;
163
- /** The theme to apply, or `undefined` to reset to the built-in default. */
164
- theme: ViewerTheme | undefined;
165
- }
166
- /**
167
- * Built-in theme choices offered by File > Options > Appearance when a host
168
- * doesn't supply its own `availableThemes`. Keep this list short: it's meant
169
- * as a sensible out-of-the-box picker, not a full theme gallery. Hosts that
170
- * want more (or fewer) choices pass their own `availableThemes` prop.
171
- */
172
- declare const THEME_CATALOG: readonly ThemeCatalogEntry[];
173
- /** Look up a catalog entry by key, falling back to `undefined` (the built-in default) if not found. */
174
- declare function resolveThemeCatalogEntry(key: string | undefined, catalog?: readonly ThemeCatalogEntry[]): ViewerTheme | undefined;
175
-
176
- //#region src/render/collaboration-presence.d.ts
177
- /** Connection lifecycle states for the Yjs WebSocket provider. */
178
- type ConnectionStatus$1 = 'disconnected' | 'connecting' | 'connected' | 'error';
179
- /**
180
- * Presence data for a remote collaborator, sanitised from the awareness
181
- * protocol. Returned by {@link sanitizePresence}; coordinates are in unscaled
182
- * slide pixels, clamped to the supplied canvas bounds.
183
- */
184
- interface SanitizedPresence {
185
- clientId: number;
186
- userName: string;
187
- userAvatar?: string;
188
- userColor: string;
189
- activeSlideIndex: number;
190
- cursorX: number;
191
- cursorY: number;
192
- lastUpdated: string;
193
- selectedElementId?: string;
194
- role?: CollaborationRole;
195
- }
196
- //#endregion
197
- //#region src/render/collaboration-presence-publisher.d.ts
198
- /**
199
- * Structural interface for the lazily-imported Yjs awareness surface. Every
200
- * binding's live `y-protocols/awareness` `Awareness` instance satisfies this.
201
- */
202
- interface AwarenessLike {
203
- clientID?: number;
204
- setLocalStateField: (field: string, value: unknown) => void;
205
- getStates: () => Map<number, Record<string, unknown>>;
206
- on: (event: string, cb: () => void) => void;
207
- off?: (event: string, cb: () => void) => void;
208
- }
209
- //#endregion
210
- //#region src/render/collaboration-external-session.d.ts
211
- /** Connection state reported by the host, independent of the viewer lifetime. */
212
- interface ExternalCollaborationSnapshot {
213
- status: ConnectionStatus$1;
214
- /**
215
- * The host has loaded the authoritative document and permits local edits.
216
- * Keep true while offline to allow ordinary Yjs offline edits, or set false
217
- * to suspend writes until a fresh sync. The viewer never infers this from
218
- * `status` and never opens it after a timeout.
219
- */
220
- synced: boolean;
221
- }
222
- /** The public y-protocols Awareness surface needed by a borrowed session. */
223
- interface ExternalCollaborationAwareness extends AwarenessLike {
224
- clientID: number;
225
- getLocalState: () => Record<string, unknown> | null;
226
- setLocalState: (state: Record<string, unknown> | null) => void;
227
- off: (event: string, callback: () => void) => void;
228
- }
229
- /**
230
- * Host-owned Yjs resources. The host creates, connects and destroys them.
231
- * Keep this object and its resources stable for a session; report connection
232
- * changes through subscribe instead of replacing the collaboration config.
233
- */
234
- interface ExternalCollaborationSession {
235
- readonly doc: Doc;
236
- /** Awareness must belong to doc. One viewer publishes slide presence at a time. */
237
- readonly awareness: ExternalCollaborationAwareness;
238
- getSnapshot: () => ExternalCollaborationSnapshot;
239
- /** Subscribe to status or synced changes; return an unsubscribe function. */
240
- subscribe: (listener: () => void) => () => void;
241
- }
242
- //#endregion
243
- //#region src/render/element-update-batch.d.ts
244
- /** A shallow property patch for a top-level element on an ordinary slide. */
245
- interface ElementUpdate {
246
- slideId: string;
247
- elementId: string;
248
- patch: Partial<PptxElement>;
249
- }
250
- interface ElementUpdateOptions {
251
- /** Optional description for the undo entry. */
252
- label?: string;
253
- }
254
- //#endregion
255
- //#region src/types.d.ts
256
- /** Canvas dimensions in pixels. */
257
- interface CanvasSize$1 {
258
- width: number;
259
- height: number;
260
- }
261
- /** Viewer interaction mode: read-only, edit, presentation, or master-view. */
262
- type ViewerMode = 'preview' | 'edit' | 'present' | 'master';
263
- /**
264
- * Framework-agnostic imperative API contract for the PowerPoint viewer.
265
- *
266
- * Each binding (React `forwardRef` handle, Vue `defineExpose`, Angular public
267
- * methods) implements this interface so consumers get a consistent progressive
268
- * API regardless of framework.
269
- */
270
- interface PowerPointViewerAPI {
271
- /** Serialise the current presentation to `.pptx` bytes. */
272
- getContent: () => Promise<Uint8Array>;
273
- /** Navigate to a specific slide by zero-based index. */
274
- goTo: (slideIndex: number) => void;
275
- /** Navigate to the previous slide. */
276
- goPrev: () => void;
277
- /** Navigate to the next slide. */
278
- goNext: () => void;
279
- /** Undo the last editing action. No-op when nothing to undo. */
280
- undo: () => void;
281
- /** Redo the last undone action. No-op when nothing to redo. */
282
- redo: () => void;
283
- /** Whether an undo action is available. */
284
- canUndo: () => boolean;
285
- /** Whether a redo action is available. */
286
- canRedo: () => boolean;
287
- /** Get the current zoom level (1 = 100%). */
288
- getZoom: () => number;
289
- /** Set the zoom level (clamped to min/max bounds). */
290
- setZoom: (level: number) => void;
291
- /** Zoom in by one step. */
292
- zoomIn: () => void;
293
- /** Zoom out by one step. */
294
- zoomOut: () => void;
295
- /** Reset zoom to 100%. */
296
- zoomReset: () => void;
297
- /** Get the current viewer mode. */
298
- getMode: () => ViewerMode;
299
- /** Switch the viewer mode (e.g. 'edit', 'preview', 'present'). */
300
- setMode: (mode: ViewerMode) => void;
301
- /** Get the zero-based active slide index. */
302
- getActiveSlideIndex: () => number;
303
- /** Set the active slide by zero-based index (alias of goTo). */
304
- setActiveSlideIndex: (index: number) => void;
305
- /** Get the total number of slides. */
306
- getSlideCount: () => number;
307
- /** Whether the document has unsaved changes. */
308
- isDirty: () => boolean;
309
- /**
310
- * Get the full slide array. Returns the actual `PptxSlide[]` from the
311
- * internal model with full type information (elements, notes, transitions,
312
- * animations, etc.). The returned reference is a snapshot; mutations are
313
- * not reflected back unless done via the manipulation methods.
314
- */
315
- getSlides: () => readonly PptxSlide[];
316
- /** Get a single slide by zero-based index, or undefined if out of range. */
317
- getSlide: (index: number) => PptxSlide | undefined;
318
- /** Get the currently active slide. */
319
- getActiveSlide: () => PptxSlide | undefined;
320
- /** Add a blank slide after the given index (or at end if omitted). */
321
- addSlide: (afterIndex?: number) => void;
322
- /** Delete slides at the given zero-based indexes. At least one slide is kept. */
323
- deleteSlides: (indexes: number[]) => void;
324
- /** Duplicate slides at the given zero-based indexes. */
325
- duplicateSlides: (indexes: number[]) => void;
326
- /** Move a slide from one position to another. */
327
- moveSlide: (fromIndex: number, toIndex: number) => void;
328
- /** Toggle the hidden flag on slides at the given indexes. */
329
- toggleHideSlides: (indexes: number[]) => void;
330
- /**
331
- * Get the elements on a slide. Defaults to the active slide when
332
- * `slideIndex` is omitted. Returns the full `PptxElement[]` with
333
- * all type-specific properties intact.
334
- */
335
- getElements: (slideIndex?: number) => readonly PptxElement[];
336
- /** Get a single element by ID from the active slide (or a specified slide). */
337
- getElementById: (elementId: string, slideIndex?: number) => PptxElement | undefined;
338
- /**
339
- * Append and select a deep copy on the active ordinary editable slide.
340
- * Assigns fresh element IDs without offsetting the supplied geometry.
341
- * Returns the new root ID, or undefined when insertion is unavailable.
342
- * Uses normal Undo/Redo grouping. Models must be self-contained or refer to
343
- * assets in this document; this does not import foreign PPTX relationships.
344
- */
345
- addElement: (element: PptxElement) => string | undefined;
346
- /**
347
- * Update one or more properties of an element by ID on the active slide.
348
- * Accepts a `Partial<PptxElement>` patch (e.g. `{ x: 100, width: 300 }`).
349
- */
350
- updateElement: (elementId: string, updates: Partial<PptxElement>) => void;
351
- /** Atomically patch ordinary slide elements as one independent undo step. Rejects invalid batches. */
352
- updateElements: (updates: readonly ElementUpdate[], options?: ElementUpdateOptions) => Promise<void>;
353
- /** Delete elements by their IDs from the active slide. */
354
- deleteElements: (elementIds: string[]) => void;
355
- /**
356
- * Duplicate an element on the active slide.
357
- * Returns the new element's ID, or undefined if the source was not found.
358
- */
359
- duplicateElement: (elementId: string) => string | undefined;
360
- /** Get the IDs of currently selected elements. */
361
- getSelectedElementIds: () => string[];
362
- /** Programmatically select elements by their IDs. */
363
- selectElements: (ids: string[]) => void;
364
- /** Clear the current selection. */
365
- clearSelection: () => void;
366
- }
367
- /** Collaboration role within a session. */
368
- type CollaborationRole = 'owner' | 'collaborator' | 'viewer';
369
- /**
370
- * Collaboration transport.
371
- *
372
- * - `'websocket'` (default): y-websocket against `serverUrl`.
373
- * - `'webrtc'`: y-webrtc peer-to-peer; needs no document server. Peers meet
374
- * through the `signaling` servers (WebRTC signaling only, no document data)
375
- * and same-browser tabs additionally sync via BroadcastChannel even without
376
- * any signaling server, which makes this mode usable from static hosting.
377
- */
378
- type CollaborationTransport = 'websocket' | 'webrtc';
379
- /** How the local user entered a collaboration session. */
380
- type CollaborationSessionIntent = 'create' | 'join';
381
- /**
382
- * Real-time collaboration configuration.
383
- *
384
- * The same shape is accepted by every framework binding.
385
- */
386
- interface CollaborationConfig {
387
- /** Unique identifier for the collaboration room (alphanumeric, hyphens, underscores). */
388
- roomId: string;
389
- /**
390
- * WebSocket server URL for the Yjs provider (e.g. "wss://collab.example.com").
391
- * Ignored (may be empty) for `externalSession` or when `transport` is `'webrtc'`.
392
- */
393
- serverUrl: string;
394
- /** Transport to use. Defaults to `'websocket'`. */
395
- transport?: CollaborationTransport;
396
- /**
397
- * Use the host's document, awareness and transport instead of creating a
398
- * provider. Transport, serverUrl, signaling and authToken are ignored. The
399
- * viewer only detaches its listeners and presence on stop; it never destroys
400
- * these resources. Keep this object stable and report readiness via subscribe.
401
- */
402
- externalSession?: ExternalCollaborationSession;
403
- /**
404
- * WebRTC signaling server URLs (only used when `transport` is `'webrtc'`).
405
- * Defaults to y-webrtc's built-in public signaling list. Same-browser tabs
406
- * sync via BroadcastChannel regardless of signaling availability.
407
- */
408
- signaling?: string[];
409
- /** Display name for the local user. */
410
- userName: string;
411
- /** Avatar URL for the local user (optional). */
412
- userAvatar?: string;
413
- /** Hex colour for the local user's cursor/presence indicator. */
414
- userColor?: string;
415
- /** Optional authentication token sent with the WebSocket handshake. */
416
- authToken?: string;
417
- /** Role in the session; defaults to `'collaborator'`. */
418
- role?: CollaborationRole;
419
- /**
420
- * Whether this client created the room or joined an existing room. Providers
421
- * do not use this value, but hosts can use it to avoid publishing local file
422
- * bytes when handling a join request. Omitted values retain the legacy
423
- * create-session behaviour.
424
- */
425
- sessionIntent?: CollaborationSessionIntent;
426
- /**
427
- * Elected-writer write-back callback (Area 3 of the C3 hardening plan).
428
- *
429
- * When the local user has `role: 'owner'`, the binding debounces changes and
430
- * serializes the current Y.Doc state to a PPTX byte array, then calls this
431
- * callback so the host can persist the snapshot. Only one writer (the owner)
432
- * does this; other collaborators never trigger write-back, eliminating the
433
- * last-save-wins problem.
434
- */
435
- onWriteBack?: (bytes: Uint8Array) => void;
436
- /**
437
- * Debounce delay (ms) between the last Y.Doc change and the write-back
438
- * invocation. Defaults to 5000 ms. Set to 0 to write back on every change
439
- * (not recommended for large documents).
440
- */
441
- writeBackDebounceMs?: number;
442
- }
443
- //#endregion
444
- //#region src/render/text-run-style.d.ts
445
- /** A plain CSS style map (keys are CSS properties; binding-agnostic). */
446
- type RunStyle = Record<string, string | number>;
447
- /** One script-tagged piece of a run's text, ready for a binding's nested span. */
448
- interface ScriptFontPiece {
449
- text: string;
450
- /**
451
- * CSS for a nested span wrapping `text`, or `undefined` when this piece
452
- * needs no span at all (its script's font equals the run's own, so plain
453
- * text renders identically). When present it carries the `fontFamily`
454
- * override plus the run's own decoration subset, repeated because
455
- * `text-decoration-*` does not inherit into a nested span (see
456
- * `nestedTextDecorationStyle`).
457
- */
458
- style?: RunStyle;
459
- }
460
- //#endregion
461
- //#region src/render/reflection.d.ts
462
- /**
463
- * CSS `mask-image`/`-webkit-mask-image` value plus the raw `transform` for a
464
- * mirrored reflection sibling. Every value is a ready-to-apply CSS string (or
465
- * `'none'` sentinel avoided - fields are omitted when the browser default
466
- * already matches), so a binding can spread this directly onto its own style
467
- * object with no further per-framework logic.
468
- */
469
- interface ReflectionWrapperStyle {
470
- position: 'absolute';
471
- left: string;
472
- /** `calc(100% + <dist>px)`: sits `@dist` px below the source element's box. */
473
- top: string;
474
- width: string;
475
- height: string;
476
- /** `scale(@sx, @sy)` (the sign of `@sy` IS the mirror) composed with `@kx`/`@ky`/`@rot`. */
477
- transform: string;
478
- /** Anchor point for the transform above, from `@algn` (default `center top`). */
479
- transformOrigin: string;
480
- maskImage: string;
481
- WebkitMaskImage: string;
482
- pointerEvents: 'none';
483
- }
484
- //#endregion
485
- //#region src/render/animation-timeline-build-descriptors.d.ts
486
- /**
487
- * `animation-timeline-build-descriptors` - staged-build (`p:bldChart` /
488
- * `p:bldDgm`) reveal descriptor types, split out of `animation-timeline-types`
489
- * to keep that module under the file-size limit. Re-exported from
490
- * `animation-timeline-types` so existing imports are unaffected.
491
- *
492
- * @module render/animation-timeline-build-descriptors
493
- */
494
- /**
495
- * Normalized staged-reveal mode for a chart graphic frame, derived from the
496
- * OOXML `a:bldChart/@bld` (or `p:bldOleChart/@bld`) token:
497
- * - `asOne` the whole chart appears at once (`allAtOnce`).
498
- * - `bySeries` one data series is revealed per stage (`series`).
499
- * - `byCategory` one category is revealed per stage (`category`).
500
- * - `byElement` one series/category ELEMENT is revealed per stage
501
- * (`seriesElement` / `categoryElement`).
502
- */
503
- type ChartBuildMode = 'asOne' | 'bySeries' | 'byCategory' | 'byElement';
504
- /**
505
- * Normalized staged-reveal mode for a SmartArt diagram, derived from the OOXML
506
- * `a:bldDgm/@bld` or `p:bldDgm/@bld` token:
507
- * - `asOne` the whole diagram appears at once (`whole` / `allAtOnce`).
508
- * - `byOne` one node is revealed per stage (`one`, and the assorted
509
- * `depthBy*` / `breadthBy*` / directional traversals).
510
- * - `byLvl` levels are revealed one element at a time (`lvlOne`).
511
- * - `byLvlAtOnce` a whole level is revealed per stage (`lvlAtOnce`).
512
- */
513
- type DiagramBuildMode = 'asOne' | 'byOne' | 'byLvl' | 'byLvlAtOnce';
514
- /**
515
- * One authored `p:graphicEl` reveal unit resolved onto a chart, per
516
- * `TimelineStepGraphicElement`'s "both indices set" case: a single (series,
517
- * category) cell revealed by a `bldStep="seriesEl"`/`"categoryEl"` effect.
518
- */
519
- interface ChartRevealPoint {
520
- seriesIdx: number;
521
- categoryIdx: number;
522
- }
523
- /**
524
- * Playback-time chart reveal state derived from AUTHORED `p:graphicEl`
525
- * indices (see `chart-reveal-descriptor`'s `resolveChartRevealDescriptor`),
526
- * rather than from click-count/time progress. Present on
527
- * {@link import('./animation-timeline-group').ElementAnimationState.chartReveal}
528
- * only when every fired chart-build step for the element carried index data;
529
- * a renderer prefers this over the progress-based `build`/`ElementBuildState`
530
- * path when present, since it reflects the real authored reveal set (correct
531
- * even for a reversed-order or gapped chart build), and falls back to `build`
532
- * when absent.
533
- */
534
- interface ChartRevealDescriptor {
535
- /**
536
- * Whether the chart's background/axes/gridlines/legend should currently be
537
- * visible: always `true` when the chart's `animateBackground` is `false`
538
- * ("shown throughout"), otherwise `true` from the first revealed stage
539
- * onward.
540
- */
541
- background: boolean;
542
- /** Whole series revealed by a `bldStep="series"` effect. */
543
- series: ReadonlySet<number>;
544
- /** Whole categories revealed by a `bldStep="category"` effect. */
545
- categories: ReadonlySet<number>;
546
- /** Individual cells revealed by a `bldStep="seriesEl"`/`"categoryEl"` effect. */
547
- points: readonly ChartRevealPoint[];
548
- }
549
- /**
550
- * Playback-time SmartArt diagram reveal state derived from AUTHORED
551
- * `p:graphicEl/p:dgm/@id` indices (see `diagram-reveal-descriptor`'s
552
- * `resolveDiagramRevealDescriptor`), rather than from click-count/time
553
- * progress. Present on
554
- * {@link import('./animation-timeline-group').ElementAnimationState.diagramReveal}
555
- * only when every fired diagram-build step for the element carried
556
- * `p:graphicEl` data. A SmartArt renderer prefers this over the
557
- * progress-based `build` / {@link ElementBuildState} path when present, since
558
- * it reflects the real authored reveal set (correct even for a
559
- * reversed-order or by-branch build), and falls back to `build` when absent.
560
- */
561
- interface DiagramRevealDescriptor {
562
- /**
563
- * Whether the diagram's background/connector chrome should currently be
564
- * visible: `true` once any node-revealing or background-revealing
565
- * (`bldStep="bg"`) step has fired.
566
- */
567
- background: boolean;
568
- /** Data-model point ids (`PptxSmartArtNode.id`) revealed so far. */
569
- nodeIds: ReadonlySet<string>;
570
- }
571
- /**
572
- * Playback-time staged-build state surfaced on
573
- * {@link import('./animation-timeline-group').ElementAnimationState}.
574
- * `progress` is the 0..1 fraction of the build revealed at the current
575
- * playback time; a consumer maps it to its own item COUNT (see
576
- * `revealedStageCount`).
577
- */
578
- type ElementBuildState = {
579
- kind: 'chart';
580
- mode: ChartBuildMode;
581
- progress: number;
582
- } | {
583
- kind: 'diagram';
584
- mode: DiagramBuildMode;
585
- progress: number;
586
- };
587
- //#endregion
588
- //#region src/render/animation-text-style-resolve.d.ts
589
- /**
590
- * Framework-neutral text-style override a font-style emphasis effect applies
591
- * on top of its target's own authored per-run bold/italic/underline/size/
592
- * colour. Every binding maps this onto its own text container so it OVERRIDES
593
- * the runs' inline styles (the runs carry explicit inline styles of their
594
- * own, so plain CSS inheritance cannot reach them).
595
- */
596
- interface TextStyleAnimationDescriptor {
597
- bold?: boolean;
598
- italic?: boolean;
599
- underline?: boolean;
600
- /** Relative multiplier against each run's own authored font size. */
601
- fontScale?: number;
602
- color?: string;
603
- }
604
- /** Snapshot of a single element's animation state at a point in the timeline. */
605
- interface ElementAnimationState {
606
- /** Whether the element should be visible. */
607
- visible: boolean;
608
- /** CSS animation shorthand to apply (undefined = no active animation). */
609
- cssAnimation: string | undefined;
610
- /**
611
- * Staged-build reveal state, present only when the active animation builds a
612
- * chart or SmartArt diagram in stages (`p:bldChart` / `p:bldDgm`) rather than
613
- * revealing the whole element at once. A staged renderer multiplies
614
- * `build.progress` (0..1) by its own series / category / level COUNT to
615
- * decide how many stages are revealed at the current playback time; see
616
- * {@link import('./animation-build').revealedStageCount}. Absent for ordinary
617
- * whole-element entrances, so existing renderers are unaffected.
618
- */
619
- build?: ElementBuildState;
620
- /**
621
- * Authored-index chart reveal state (see {@link ChartRevealDescriptor}),
622
- * present only when every fired chart-build step for this element carried
623
- * `p:graphicEl` index data. A chart renderer prefers this over `build` when
624
- * present; `chart-build`'s `resolveRevealedChartData` picks between the two.
625
- */
626
- chartReveal?: {
627
- mode: ChartBuildMode;
628
- descriptor: ChartRevealDescriptor;
629
- };
630
- /**
631
- * Authored-index SmartArt diagram reveal state (see
632
- * {@link DiagramRevealDescriptor}), present only when every fired
633
- * diagram-build step for this element carried `p:graphicEl` node-id data.
634
- * `diagram-build`'s `resolveRevealedSmartArtNodes` prefers this over `build`
635
- * when present.
636
- */
637
- diagramReveal?: {
638
- mode: DiagramBuildMode;
639
- descriptor: DiagramRevealDescriptor;
640
- };
641
- /**
642
- * True when an active `p:animClr` color animation targets this shape's fill.
643
- * A vector renderer should then paint the fill with `fill: inherit` so the
644
- * wrapper-level colour keyframes cascade to the SVG path. Absent/false means
645
- * no active fill-colour animation.
646
- */
647
- animatesFill?: boolean;
648
- /**
649
- * True when an active `p:animClr` color animation targets this shape's
650
- * stroke. A vector renderer should then paint the stroke with
651
- * `stroke: inherit`. Absent/false means no active stroke-colour animation.
652
- */
653
- animatesStroke?: boolean;
654
- /**
655
- * Active discrete font-style / colour / size override (see
656
- * {@link import('./animation-timeline-step').TimelineStep.textStyle}) a
657
- * font-style emphasis effect currently applies to this element's text,
658
- * OVERRIDING the runs' own inline bold/italic/underline/size/colour.
659
- * `animation-playback-engine.ts` writes this on step start and again on
660
- * cleanup (held in full when the effect's `p:cTn/@fill` holds its end
661
- * state, otherwise reverted); a text renderer maps it onto its run markup
662
- * via `buildTextStyleOverrideCss` (`animation-text-style-css.ts`). Absent
663
- * means no font-style emphasis effect is currently active on this element.
664
- */
665
- textStyle?: TextStyleAnimationDescriptor;
666
- }
667
- //#endregion
668
- //#region src/render/motion-path-authoring.d.ts
669
- /**
670
- * The bucket a ribbon gallery click targets. Widens the three preset buckets
671
- * with `motionPath` so a binding's single "apply animation" callback can carry
672
- * a motion-path preset id too, instead of every binding growing a second
673
- * callback threaded through the same six components.
674
- */
675
- type AnimationApplyGroup = 'entrance' | 'emphasis' | 'exit' | 'motionPath';
676
- //#endregion
677
- //#region src/render/slide-templates/slide-template-types.d.ts
678
- /** Discriminated id for every built-in slide template. */
679
- type SlideTemplateId = 'title' | 'titleAndContent' | 'sectionHeader' | 'agenda' | 'twoContent' | 'comparison' | 'quote' | 'timeline' | 'keyMetrics' | 'titleOnly' | 'blank' | 'closing';
680
- /** Catalog entry describing one insertable template for gallery UIs. */
681
- interface SlideTemplateSpec {
682
- /** Stable template identifier. */
683
- id: SlideTemplateId;
684
- /** i18n key for the display name (e.g. `pptx.slideTemplates.title.name`). */
685
- nameKey: string;
686
- /** i18n key for the one-line description shown in the gallery. */
687
- descriptionKey: string;
688
- }
689
- /**
690
- * Options for building a template's slide content.
691
- *
692
- * `scheme` maps theme colour keys (accent1, tx1, bg1, ...) to resolved hex
693
- * values; pass the loaded deck's `themeColorMap` so inserted slides inherit
694
- * the deck look. Missing keys fall back to the Office default scheme.
695
- */
696
- interface SlideTemplateBuildOptions {
697
- /** Target slide width in px (defaults to 1280). */
698
- slideWidth?: number;
699
- /** Target slide height in px (defaults to 720). */
700
- slideHeight?: number;
701
- /** Theme colour key to resolved hex map (e.g. `PptxData.themeColorMap`). */
702
- scheme?: Record<string, string>;
703
- /** Element id factory; index is the element's ordinal within the slide. */
704
- idFor?: (index: number) => string;
705
- /**
706
- * Translator for the placeholder content written onto template slides
707
- * (keys under `pptx.slideTemplates.content.*`). Defaults to the canonical
708
- * English dictionary so untranslated hosts still get sensible text.
709
- */
710
- translate?: (key: string) => string;
711
- }
712
- /** The buildable content of a template: elements plus slide-level fills. */
713
- interface SlideTemplateBuildResult {
714
- /** Fully positioned elements ready to be placed on a new `PptxSlide`. */
715
- elements: PptxElement[];
716
- /** Optional slide background colour (resolved hex). */
717
- backgroundColor?: string;
718
- }
719
- //#endregion
720
- //#region src/render/slide-templates/slide-template-catalog.d.ts
721
- /** Ordered gallery catalogue: one entry per built-in slide template. */
722
- declare const SLIDE_TEMPLATES: readonly SlideTemplateSpec[];
723
- /**
724
- * Build the theme-aware content a template inserts.
725
- *
726
- * Pass the deck's `themeColorMap` (and canvas size) in `options` so the
727
- * inserted slide inherits the deck look; colours also carry `a:schemeClr`
728
- * round-trip nodes so a save re-emits theme references, not literal RGB.
729
- */
730
- declare function buildSlideTemplateContent(id: SlideTemplateId, options?: SlideTemplateBuildOptions): SlideTemplateBuildResult;
731
- /**
732
- * Build a complete draft `PptxSlide` for a template, ready for a binding's
733
- * history-integrated insert path. The caller provides identity (`id`) and
734
- * numbering; elements are fully positioned for the target canvas.
735
- */
736
- declare function buildSlideTemplateSlide(templateId: SlideTemplateId, slideId: string, slideNumber: number, options?: SlideTemplateBuildOptions): PptxSlide;
737
- /** The unit system used for ruler display. */
738
- type RulerUnit = 'inches' | 'centimetres';
739
- /** Framework-neutral picture-bullet source, sizing, and accessible fallback. */
740
- interface PictureBulletMarker {
741
- src?: string;
742
- sizePx: number;
743
- fallbackMarker: string;
744
- accessibleLabel: string;
745
- imageRelId?: string;
746
- }
747
- //#endregion
748
- //#region src/render/text-east-asian-breaks.d.ts
749
- /** Which of the two behaviours a paragraph asks for. */
750
- interface EastAsianBreakOptions {
751
- /** `a:pPr/@hangingPunct="1"`. */
752
- hangingPunctuation: boolean;
753
- /** `a:pPr/@eaLnBrk="0"`: break between any two East Asian characters. */
754
- breakAnywhere: boolean;
755
- }
756
- //#endregion
757
- //#region src/render/text-run-meta.d.ts
758
- /** A run's resolved hyperlink target. */
759
- interface RunHyperlink {
760
- /**
761
- * The URL to hand a click handler. For an internal `ppaction://hlinksldjump`
762
- * the resolved slide index is appended as a `slideIndex` query parameter, so
763
- * the target survives a callback whose only argument is the URL (see
764
- * `parsePpactionUrl`, which reads it back off).
765
- */
766
- url: string;
767
- /**
768
- * A safe, renderable `href` for a plain `<a>`, or `undefined` when the target
769
- * is an internal `ppaction://` action or fails the URL safety check. A
770
- * binding with no click handler renders the run as text in that case, which
771
- * is what every binding did for every link before this field existed.
772
- */
773
- href?: string;
774
- /** `a:hlinkClick/@tooltip`, for the anchor's `title`. */
775
- tooltip?: string;
776
- /**
777
- * `<a target>` for a real (non-`ppaction://`) hyperlink, from
778
- * `a:hlinkClick/@tgtFrame` when authored, else `_blank` (every binding's
779
- * pre-existing hardcoded default). Only meaningful alongside {@link href}.
780
- */
781
- target?: string;
782
- /** `<a rel>` paired with {@link target} (see `resolveHyperlinkTargetAttrs`). */
783
- rel?: string;
784
- /** Resolved target slide for an internal slide jump. */
785
- targetSlideIndex?: number;
786
- /**
787
- * True when the target came from `a:hlinkMouseOver` rather than
788
- * `a:hlinkClick`: PowerPoint follows it on hover, not on click, so a binding
789
- * that renders a plain anchor should not make it look clickable.
790
- */
791
- onHover?: boolean;
792
- }
793
- /** An inline equation run (`m:oMath`), rendered as MathML rather than text. */
794
- interface RunEquation {
795
- /** The raw OMML node, for `convertOmmlToMathMl`. */
796
- xml: Record<string, unknown>;
797
- /** Display number for a numbered equation, without its parentheses. */
798
- number?: string;
799
- }
800
- //#endregion
801
- //#region src/render/text-run-ruby.d.ts
802
- /** A run's phonetic guide, ready to render as `<rt>` above the base text. */
803
- interface RunRuby {
804
- /** The annotation itself (`a:ruby/a:rt`), e.g. the furigana reading. */
805
- text: string;
806
- /** Inline style for the `<rt>` element (size, family, alignment, colour). */
807
- style: RunStyle;
808
- }
809
- //#endregion
810
- //#region src/render/text-tab-run-build.d.ts
811
- /** One tabbed-line piece, ready to spread onto a binding's own span element. */
812
- interface TabbedRunPiece {
813
- text: string;
814
- /**
815
- * CSS for the span that wraps `text`: inline-block layout, this run's own
816
- * decoration repeated, and this piece's own PowerPoint advance-width
817
- * correction as `letter-spacing` (see `buildTabbedLine`). The piece is
818
- * nested inside the run's own span, and neither property inherits the way a
819
- * caller would want: `text-decoration-*` does not inherit into a nested
820
- * element at all (an ancestor's underline is drawn *through* its
821
- * descendants, but each descendant still computes `none` of its own), so a
822
- * caller passes the run's decoration subset (`nestedTextDecorationStyle`) to
823
- * have it repeated here; `letter-spacing` DOES inherit, which is exactly why
824
- * this piece sets it explicitly rather than only when non-zero - the run's
825
- * container span carries its own (wrong, whole-text) correction that would
826
- * otherwise leak in.
827
- */
828
- style: RunStyle;
829
- /** CSS for the leader-fill span preceding this piece, or `undefined` when there is no gap to fill. */
830
- leaderStyle?: RunStyle;
831
- /** Leader glyphs sized to fill `leaderStyle`'s width. Present only alongside `leaderStyle`. */
832
- leaderText?: string;
833
- /**
834
- * `a:rPr/@u="words"` per-word/gap sub-pieces of THIS tab piece's own text
835
- * (see `splitWordsForUnderline`), present only when the run's underline is
836
- * `words`. A tab-separated piece is otherwise rendered as a single span
837
- * (`text` + `style`), which underlines it continuously - correct for a
838
- * one-word piece, but wrong for a piece like `"Hello World"` between two tab
839
- * stops, which needs a gap under the space. A binding renders one SIBLING
840
- * span per entry IN PLACE OF the piece's single `text` span: each entry's
841
- * `style` is the piece's own `style` (the same inline-block layout and
842
- * advance-width correction, so the line measures exactly as before), with
843
- * the underline stripped on a gap entry. They must be siblings, not spans
844
- * nested inside the piece span: an ancestor's underline is drawn through
845
- * every inline descendant, so a nested gap could not lose it. `text`/`style`
846
- * stay the continuous-underline fallback for a binding that does not
847
- * render this field.
848
- */
849
- words?: Array<{
850
- text: string;
851
- style: RunStyle;
852
- }>;
853
- }
854
- /** One `\n`-split line of a run's tabbed text. */
855
- interface TabbedLineRun {
856
- pieces: TabbedRunPiece[];
857
- }
858
- //#endregion
859
- //#region src/render/paragraph-types.d.ts
860
- /** A single rendered run within a paragraph. */
861
- interface ParagraphRun {
862
- text: string;
863
- style: RunStyle;
864
- /**
865
- * The run's hyperlink (`a:hlinkClick` / `a:hlinkMouseOver`), when it has one.
866
- * A binding renders the run inside an `<a href>` when {@link RunHyperlink.href}
867
- * is set, and routes {@link RunHyperlink.url} to its click handler otherwise
868
- * (internal `ppaction://` slide jumps).
869
- */
870
- hyperlink?: RunHyperlink;
871
- /**
872
- * An inline equation (`m:oMath`) this run renders INSTEAD of `text`, which is
873
- * empty for it. Emitted in the run sequence so the maths lands at its
874
- * authored position between the runs around it.
875
- */
876
- equation?: RunEquation;
877
- /**
878
- * The run's phonetic guide (`a:ruby`: furigana, pinyin, bopomofo), when it
879
- * has one. A binding renders `<ruby>{text}<rt style>{ruby.text}</rt></ruby>`;
880
- * a run carrying one is never split per word, so the annotation appears once
881
- * over the whole base run.
882
- *
883
- * Core parsed and saved ruby from the start, but `buildParagraphs` never read
884
- * it, so the annotation rendered in React alone.
885
- */
886
- ruby?: RunRuby;
887
- /**
888
- * Index of the `textSegments` entry (of the override list when one was
889
- * supplied) this run was built from.
890
- *
891
- * Shared splits one authored run into several per-word runs for PowerPoint's
892
- * metric tracking, so this is many-to-one. It is the seam a binding uses to
893
- * reach the facts the neutral model does not carry - React's find-match
894
- * highlights, per-script font spans, tab stops and ruby all key off the
895
- * originating segment - without regrouping the segments itself and drifting
896
- * from the grouping here.
897
- */
898
- segmentIndex?: number;
899
- /**
900
- * Offset of this run's `text` within its segment's RENDERED text (after field
901
- * substitution), so a caller holding per-segment character offsets can map
902
- * them onto the split runs.
903
- */
904
- charStart?: number;
905
- /**
906
- * Per-script (`a:ea`/`a:cs`/`a:sym`) font-fallback pieces for this run's
907
- * text, when a script it contains needs a font distinct from its own. A
908
- * binding renders these as nested spans in place of `text` (see
909
- * `text-script-fonts.ts`); absent for the common single-font case.
910
- */
911
- scriptRuns?: ScriptFontPiece[];
912
- /**
913
- * Measured tab-stop layout for this run's text, present when it contains an
914
- * authored `\t` and the paragraph declares explicit tab stops. A binding
915
- * renders these lines/pieces in place of `text`, honouring per-stop
916
- * alignment and leader glyphs a plain CSS `tab-size` cannot express (see
917
- * `text-tab-run-build.ts`). Absent for the common no-tab case.
918
- */
919
- tabLines?: TabbedLineRun[];
920
- /**
921
- * `a:rPr/@u="words"` word/gap pieces of a RUBY run's base text, present only
922
- * when such a run's underline is `words` (the ordinary per-word split emits
923
- * sibling runs instead; a tab piece carries its own `words`). Same shape as
924
- * `scriptRuns` and rendered the same way, in place of `text`: a word entry
925
- * carries the decoration for its own span, a gap entry is bare text. The
926
- * run's own `style` has the underline stripped when this is set (see
927
- * `paragraph-run-build.ts`).
928
- */
929
- underlineWordPieces?: ScriptFontPiece[];
930
- /** The advance-carrying space after a hanging `、`/`。` (`text-east-asian-breaks`). */
931
- hangingSpace?: true;
932
- /**
933
- * `a:reflection` mirrored-sibling wrapper style for this run (the text-run
934
- * counterpart of a shape/picture's `ComputedEffectStyle.reflection`), or
935
- * `undefined` for the common no-reflection case. A binding renders a sibling
936
- * node just below the run's own, painted with the same text, positioned and
937
- * masked by this style - see `render/reflection.ts`'s
938
- * `getTextReflectionWrapperStyle`.
939
- */
940
- reflection?: ReflectionWrapperStyle;
941
- }
942
- /** A rendered paragraph: runs plus resolved bullet + hanging-indent metadata. */
943
- interface RenderParagraph {
944
- runs: ParagraphRun[];
945
- /** Bullet glyph / number to render before the runs (or `undefined`). */
946
- bulletMarker?: string;
947
- /** Picture marker rendered before runs, or fallback metadata when unresolved. */
948
- bulletPicture?: PictureBulletMarker;
949
- /** Inline style for the bullet marker (font / size / colour). */
950
- bulletStyle: RunStyle;
951
- /** `margin-left` in px for the whole paragraph (hanging-indent layout). */
952
- marginLeftPx?: number;
953
- /** `text-indent` in px (first-line / hanging indent). */
954
- textIndentPx?: number;
955
- /**
956
- * Per-paragraph `line-height` from this paragraph's own `a:pPr > a:lnSpc`.
957
- * A unitless multiplier for proportional spacing (`a:spcPct`) or a `"<n>pt"`
958
- * string for exact spacing (`a:spcPts`). Undefined when the paragraph does
959
- * not override spacing (binding keeps the body-level line-height).
960
- */
961
- lineHeight?: number | string;
962
- /** `margin-top` in px from this paragraph's `a:pPr > a:spcBef` (space before). */
963
- spaceBeforePx?: number;
964
- /** `margin-bottom` in px from this paragraph's `a:pPr > a:spcAft` (space after). */
965
- spaceAfterPx?: number;
966
- /**
967
- * `font-size` in px to set on the paragraph element so its CSS line boxes
968
- * are built from its OWN runs rather than the text body's default size.
969
- * Undefined when the paragraph already matches the body default.
970
- *
971
- * See `resolveParagraphStrutFontSize` for why this is needed: without it a
972
- * paragraph of small runs inside a larger-defaulting body is laid out on
973
- * too-tall lines and overflows its shape.
974
- */
975
- strutFontSizePx?: number;
976
- /**
977
- * True when the paragraph has no runs and no bullet: an authored blank line
978
- * (`<a:p><a:endParaRPr/></a:p>`).
979
- *
980
- * PowerPoint gives such a paragraph a full line box, which is how decks
981
- * space a heading away from the bullet list under it. A binding must render
982
- * something with height for it (a `<br>`), or the gap disappears and the
983
- * block reads as one dense run of text (issue #131, slides 13-14).
984
- */
985
- isEmpty?: boolean;
986
- /**
987
- * Indices of this paragraph's segments in the rendered segment list (the
988
- * override list when one was supplied), in authored order and INCLUDING the
989
- * bullet-marker segment the runs drop.
990
- *
991
- * The seam a binding uses to reach paragraph facts the neutral model does not
992
- * carry, without regrouping the segments itself and drifting from the
993
- * grouping here - which is exactly how React ended up splitting on every
994
- * `"\n"` and treating a soft `a:br` as a paragraph break.
995
- */
996
- segmentIndices: number[];
997
- /**
998
- * True when this paragraph resolves right-to-left (`a:pPr/@rtl`, or the text
999
- * body's default). A binding that mirrors its hanging indent for RTL reads
1000
- * this; the direction itself is already in {@link paragraphStyle}.
1001
- */
1002
- rtl?: boolean;
1003
- /**
1004
- * Extra CSS for the paragraph box, beyond the margin / indent / spacing
1005
- * fields above: this paragraph's own `text-align` (`a:pPr/@algn`), its BiDi
1006
- * `direction`, and the kinsoku line-breaking rules (`@eaLnBrk`,
1007
- * `@latinLnBrk`, `@hangingPunct`). Absent when the paragraph overrides none
1008
- * of them, which is the common case.
1009
- *
1010
- * All three used to be resolved in React's private paragraph renderer only,
1011
- * so a deck that centred one paragraph of a left-aligned body, or set CJK
1012
- * break rules, rendered differently in the other four bindings.
1013
- */
1014
- paragraphStyle?: RunStyle;
1015
- /**
1016
- * `@hangingPunct` / `@eaLnBrk="0"` as resolved for this paragraph. The runs
1017
- * above already carry their pieces; React, which rebuilds each segment's
1018
- * pieces inside one span, re-applies `splitEastAsianBreaks` from this.
1019
- */
1020
- eastAsianBreaks?: EastAsianBreakOptions;
1021
- }
1022
- //#endregion
1023
- //#region src/render/inline-list-types.d.ts
1024
- /** Current editor payload. Missing segments explicitly denotes plain-text fallback. */
1025
- interface InlineTextEditSnapshot {
1026
- elementId: string;
1027
- text: string;
1028
- textSegments?: TextSegment[];
1029
- }
1030
- type InlineListReadResult = {
1031
- kind: 'supported';
1032
- snapshot: InlineTextEditSnapshot;
1033
- paragraphs: RenderParagraph[];
1034
- } | {
1035
- kind: 'unsupported';
1036
- reason: string;
1037
- text: string;
1038
- };
1039
- //#endregion
1040
- //#region src/render/text-field-substitution.d.ts
1041
- /**
1042
- * Text-field placeholder substitution, shared by every binding's text
1043
- * renderer.
1044
- *
1045
- * Pure string logic: resolves OOXML field runs (slide number, date/time,
1046
- * header/footer, document properties, slide title) into their display text.
1047
- * Extracted from the React `viewer/utils/text-field-substitution` module so
1048
- * every binding substitutes identically. The locale-aware datetime engine
1049
- * lives in `text-field-datetime.ts`.
1050
- */
1051
- /** Context for substituting field placeholders (slide number, date/time, header/footer, etc.). */
1052
- interface FieldSubstitutionContext {
1053
- slideNumber?: number;
1054
- dateTimeText?: string;
1055
- /**
1056
- * The deck's master date-field default TYPE (`a:fld/@type` on the slide
1057
- * master's `dt` placeholder, e.g. "datetime2"; see `header-footer-parts.ts`).
1058
- * This is a field TYPE, not a format pattern, and is used ONLY as a
1059
- * fallback for a field authored with the generic, unnumbered `datetime`
1060
- * type - a field that already names its own `datetime1`-`datetime13` type
1061
- * always uses that type, never this one (see `substituteFieldText`).
1062
- */
1063
- dateFormat?: string;
1064
- /** Footer text from PptxHeaderFooter settings. */
1065
- footerText?: string;
1066
- /** Header text from PptxHeaderFooter settings. */
1067
- headerText?: string;
1068
- /** Custom document properties for `docproperty` field substitution (keyed by property name). */
1069
- customProperties?: ReadonlyArray<{
1070
- name: string;
1071
- value: string;
1072
- }>;
1073
- /** Locale string for date/time formatting (e.g. "en-US"). Falls back to browser default. */
1074
- locale?: string;
1075
- /** Title text extracted from the first title placeholder on the slide. */
1076
- slideTitle?: string;
1077
- }
1078
- //#endregion
1079
- //#region src/render/text-case-transform.d.ts
1080
- type ChangeCaseMode = 'sentence' | 'lower' | 'upper' | 'capitalize' | 'toggle';
1081
- //#endregion
1082
- //#region src/render/shape-adjustment-model.d.ts
1083
- /**
1084
- * `shape-adjustment-model`: the vocabulary the adjust-handle modules share.
1085
- *
1086
- * The `a:ahLst` work is split three ways for the repo's file-size budget:
1087
- * `shape-adjustment-probe` measures the geometry, `shape-adjustment-handles`
1088
- * derives the handles from those measurements, and `shape-adjustment-solver`
1089
- * turns a pointer position back into guide values. All three need these types
1090
- * and the one rule that operates purely on them, so they live here and the
1091
- * dependency graph stays a DAG rather than a cycle.
1092
- *
1093
- * @module render/shape-adjustment-model
1094
- */
1095
- /**
1096
- * How a pointer position becomes a guide value, captured once when the gesture
1097
- * starts so `pointermove` stays pure arithmetic.
1098
- */
1099
- interface ShapeAdjustmentSolver {
1100
- /** `linear`: the handle slides. `angular`: it swings about {@link centerX}. */
1101
- kind: 'linear' | 'angular';
1102
- /** Handle position in element-local px at {@link startValue}. */
1103
- anchorX: number;
1104
- anchorY: number;
1105
- /** Element-local px the handle travels per ONE unit of guide value. */
1106
- dirX: number;
1107
- dirY: number;
1108
- /** Pivot for an angular handle (the shape centre). */
1109
- centerX: number;
1110
- centerY: number;
1111
- /** The guide value the anchor was measured at. */
1112
- startValue: number;
1113
- /** Guide-space bounds, taken from the preset's own `pin` clamp. */
1114
- min: number;
1115
- max: number;
1116
- }
1117
- /** One guide a handle drives. */
1118
- interface AdjustmentAxisSolver {
1119
- key: string;
1120
- solver: ShapeAdjustmentSolver;
1121
- }
1122
- /** Descriptor for one draggable adjustment handle (the amber diamond). */
1123
- interface ShapeAdjustmentHandleDescriptor {
1124
- /** The `a:avLst` guide name this handle writes (`adj`, `adj1`, ...). */
1125
- key: string;
1126
- /** Handle x offset in element-local px (origin = element top-left). */
1127
- left: number;
1128
- /** Handle y offset in element-local px. */
1129
- top: number;
1130
- /**
1131
- * Current adjustment value in GUIDE units, not a 0-1 fraction. Most presets
1132
- * range 0..50000 or 0..100000 and the angular ones run to 21,600,000.
1133
- */
1134
- value: number;
1135
- cursor: string;
1136
- /**
1137
- * How this handle's drag resolves, measured off the preset geometry: one
1138
- * entry per `a:avLst` guide it drives (callouts drive two). Absent only for
1139
- * a caller that built a descriptor by hand.
1140
- */
1141
- solvers?: AdjustmentAxisSolver[];
1142
- }
1143
- interface CollaborationShellState {
1144
- canEdit: boolean;
1145
- status: ConnectionStatus$1;
1146
- remoteUsers: readonly SanitizedPresence[];
1147
- connectedCount: number;
1148
- }
1149
- type CollaborationShellTranslate = (key: string, params?: Record<string, string | number>) => string;
1150
- /**
1151
- * One-line, localised status for a custom shell's `role="status"` readout.
1152
- *
1153
- * Every binding's custom-shell demo renders this same string under the same
1154
- * `Collaboration status` label, so the framework-neutral e2e helper that
1155
- * waits for the shell to become editable (`waitForHostEditing`) reads every
1156
- * binding the same way. Three of five demos once phrased it differently and
1157
- * the helper silently skipped them; on vanilla, that let a peer double-click
1158
- * before its edit gate opened.
1159
- */
1160
- declare function describeCollaborationShellState(state: Pick<CollaborationShellState, 'canEdit' | 'status' | 'connectedCount'>, translate: CollaborationShellTranslate): string;
1161
- //#endregion
1162
- //#region src/render/collaboration-text-codec.d.ts
1163
- /**
1164
- * collaboration-text-codec.ts: TextSegment[] <-> Y.Text delta codec used by the
1165
- * collaboration sync layer. Split out of collaboration-sync.ts to keep both
1166
- * modules focused.
1167
- *
1168
- * Exports:
1169
- * - DeltaOp / YTextLike: structural Yjs text interfaces (no yjs import)
1170
- * - encodeTextBody: write TextSegment[] into a live YTextLike
1171
- * - encodeSegmentsToDelta: pure simulation of the delta Y.Text would produce
1172
- * - decodeDelta / decodeTextBody: delta -> TextSegment[]
1173
- * - isYTextLike: runtime guard
1174
- */
1175
- interface DeltaOp {
1176
- insert?: unknown;
1177
- attributes?: Record<string, unknown>;
1178
- }
1179
- interface YTextLike {
1180
- insert: (index: number, text: string, attrs?: Record<string, string>) => void;
1181
- toDelta: () => DeltaOp[];
1182
- toString: () => string;
1183
- }
1184
- //#endregion
1185
- //#region src/render/collaboration-text-merge.d.ts
1186
- /** Y.Text surface needed for in-place edits (delete/format on top of insert). */
1187
- interface YTextEditableLike extends YTextLike {
1188
- delete: (index: number, length: number) => void;
1189
- format: (index: number, length: number, attributes: Record<string, string | null>) => void;
1190
- }
1191
- //#endregion
1192
- //#region src/render/collaboration-text-positions.d.ts
1193
- interface TextPositionCell {
1194
- index: number;
1195
- left?: TextPositionCell;
1196
- right?: TextPositionCell;
1197
- }
1198
- interface TrackedTextPosition {
1199
- /** Internal identity, shared by snapshots that observed the same character. */
1200
- readonly cell: TextPositionCell;
1201
- readonly association: number;
1202
- }
1203
- //#endregion
1204
- //#region src/render/collaboration-text-session-delta.d.ts
1205
- /** Browser edit range mapped to the editor's pre-input encoded coordinates. */
1206
- interface LocalTextReplacement {
1207
- from: number;
1208
- to: number;
1209
- }
1210
- /** Desired UTF-16 units mapped to the editor's previously observed identities. */
1211
- interface TextSessionCorrespondence {
1212
- readonly retainedIndices: readonly (number | null)[];
1213
- /** Old carriers for known paragraph attributes, independently of character identity. */
1214
- readonly paragraphSources?: readonly (number | null)[];
1215
- }
1216
- type LocalTextEdit = LocalTextReplacement | TextSessionCorrespondence;
1217
- //#endregion
1218
- //#region src/render/collaboration-text-session.d.ts
1219
- /** Supplied by the binding's existing Yjs runtime, bound to this exact Y.Text. */
1220
- interface TextSessionPositions<Position> {
1221
- capture: (index: number, association: number) => Position;
1222
- resolve: (position: Position) => number | null;
1223
- /** Synchronize tracked positions once per batch, including in-transaction writes. */
1224
- refresh?: () => boolean | void;
1225
- /** Release only resources created for this session. */
1226
- dispose?: () => void;
1227
- }
1228
- /** Opaque acknowledgement identity for an exact remote snapshot painted by an adapter. */
1229
- interface CollaborationTextSnapshot {
1230
- readonly delta: readonly DeltaOp[];
1231
- }
1232
- interface CollaborationTextSession {
1233
- applyLocalDelta: (delta: readonly DeltaOp[], edit?: LocalTextEdit) => boolean;
1234
- readMerged: () => CollaborationTextSnapshot | undefined;
1235
- adoptMerged: (snapshot: CollaborationTextSnapshot) => boolean;
1236
- /** Capture an offset in the last painted/local draft, not the newer remote string. */
1237
- bookmark: (index: number, association: number) => () => number | null;
1238
- dispose: () => void;
1239
- }
1240
- //#endregion
1241
- //#region src/render/collaboration-sync.d.ts
1242
- interface YMapLike {
1243
- get: (key: string) => unknown;
1244
- set: (key: string, value: unknown) => void;
1245
- delete: (key: string) => void;
1246
- forEach: (cb: (value: unknown, key: string) => void) => void;
1247
- }
1248
- /** Shape of the Yjs transaction passed to (deep) observers. */
1249
- interface YTransactionLike {
1250
- origin?: unknown;
1251
- }
1252
- type YDeepObserver = (events?: unknown, transaction?: YTransactionLike) => void;
1253
- interface YArrayLike {
1254
- readonly length: number;
1255
- get: (index: number) => unknown;
1256
- push: (items: unknown[]) => void;
1257
- delete: (index: number, length?: number) => void;
1258
- insert: (index: number, items: unknown[]) => void;
1259
- toArray: () => unknown[];
1260
- observe: (handler: () => void) => void;
1261
- unobserve: (handler: () => void) => void;
1262
- observeDeep: (handler: YDeepObserver) => void;
1263
- unobserveDeep: (handler: YDeepObserver) => void;
1264
- }
1265
- interface YDocLike {
1266
- getMap: (name: string) => YMapLike;
1267
- getArray: (name: string) => YArrayLike;
1268
- transact: (fn: () => void, origin?: unknown) => void;
1269
- }
1270
- interface YjsFactories {
1271
- createMap: () => YMapLike;
1272
- createArray: () => YArrayLike;
1273
- createText: () => YTextLike;
1274
- /** Track character identities using the binding's existing Yjs runtime. */
1275
- createTextPositions?: (text: YTextEditableLike) => TextSessionPositions<TrackedTextPosition>;
1276
- }
1277
- //#endregion
1278
- //#region src/render/collaboration-live-patch-target.d.ts
1279
- /** Interim geometry for an element mid-gesture. All fields optional. */
1280
- interface LiveGeometryPatch {
1281
- x?: number;
1282
- y?: number;
1283
- width?: number;
1284
- height?: number;
1285
- rotation?: number;
1286
- }
1287
- /** The element's pre-edit rich text, used to remap the interim plain text. */
1288
- interface LiveTextSource {
1289
- textSegments?: TextSegment[];
1290
- textStyle?: TextStyle;
1291
- }
1292
- //#endregion
1293
- //#region src/render/collaboration-text-target.d.ts
1294
- interface CollaborationInlineSnapshot extends CollaborationTextSnapshot {
1295
- readonly inline: InlineTextEditSnapshot;
1296
- }
1297
- /** A mounted editor owns this handle, never the document or its provider. */
1298
- interface CollaborationTextTarget extends CollaborationTextSession {
1299
- readMerged: () => CollaborationInlineSnapshot | undefined;
1300
- /** A bookmark follows character identity rather than a mutable numeric offset. */
1301
- bookmark: (index: number, association: number) => () => number | null;
1302
- }
1303
- interface CollaborationLivePatcher {
1304
- /** Bind a mounted native editor; its handle must be disposed on unmount. */
1305
- beginTextEdit?: (slideId: string | undefined, elementId: string, onChange?: () => void, ownsModel?: (element: PptxElement) => boolean) => CollaborationTextTarget | undefined;
1306
- /** Attach a live doc (or `null` to go dormant). Pending patches are dropped. */
1307
- configure: (doc: YDocLike | null, factories: YjsFactories | null,
1308
- /** Publish synchronously when the host may revoke write readiness at any time. */
1309
- immediate?: boolean) => void;
1310
- /** True when a doc + factories are attached, i.e. patches will be written. */
1311
- isActive: () => boolean;
1312
- /** Queue interim geometry for an element. */
1313
- patchGeometry: (slideId: string | undefined, elementId: string, geometry: LiveGeometryPatch) => void;
1314
- /** Queue interim text for an element (remapped over `source`'s segments). */
1315
- patchText: (slideId: string | undefined, elementId: string, text: string, source?: LiveTextSource) => void;
1316
- /** Write everything queued right now (call on gesture end / edit commit). */
1317
- flush: () => void;
1318
- /** Drop pending work, cancel timers and detach the doc. */
1319
- dispose: () => void;
1320
- }
1321
- /** Everything the Transitions tab's controls currently say. */
1322
- interface RibbonTransitionDraft {
1323
- /** The highlighted gallery entry. */
1324
- type: PptxTransitionType;
1325
- /** Duration field, in seconds. */
1326
- durationSec: number;
1327
- /** Advance Slide > On Mouse Click. */
1328
- advanceOnClick: boolean;
1329
- /** Advance Slide > After (whether the timed advance is armed at all). */
1330
- advanceAfter: boolean;
1331
- /** Advance Slide > After, as the `mm:ss.hh` text the field holds. */
1332
- advanceAfterText: string;
1333
- }
1334
- type BackstagePage = 'home' | 'new' | 'open' | 'info' | 'save' | 'saveAs' | 'print' | 'share' | 'export' | 'close' | 'account' | 'options';
1335
- //#endregion
1336
- //#region src/render/backstage-cards.d.ts
1337
- /**
1338
- * Every action card the File-tab backstage can show, keyed by the operation it
1339
- * triggers rather than by its wording.
1340
- *
1341
- * The five bindings used to hardcode a title and a body string each, which made
1342
- * the whole backstage untranslatable and let the copy drift: the same card
1343
- * carried four different descriptions depending on which binding you opened it
1344
- * in. Both halves now live here as a dictionary key plus an English fallback,
1345
- * so a wording change lands everywhere at once and a translator only has to
1346
- * translate it once.
1347
- */
1348
- type BackstageCardId = 'protect' | 'inspect' | 'embedFonts' | 'signatures' | 'versionHistory' | 'saveAsPptx' | 'saveAsPpsx' | 'saveAsPptm' | 'saveAsPpt' | 'pdf' | 'png' | 'video' | 'gif' | 'json' | 'copyImage' | 'print' | 'share';
1349
- //#endregion
1350
- //#region src/render/toolbar-actions.d.ts
1351
- /**
1352
- * Toolbar action / ribbon-tab visibility: a single, framework-agnostic
1353
- * catalogue of every top-level toolbar button and ribbon tab a host app can
1354
- * independently hide. Each binding exposes a `hiddenActions?: ToolbarActionId[]`
1355
- * prop, threads it down to the relevant render sites, and gates them with
1356
- * `isActionHidden`. Default (`undefined` / `[]`) hides nothing, matching
1357
- * today's always-visible behaviour.
1358
- *
1359
- * `TOOLBAR_TABS` is also the canonical ribbon-tab list/order, replacing the
1360
- * copy hand-duplicated in each binding (React's `TOOLBAR_SECTIONS`, Vue's
1361
- * `ribbon-constants.ts`, Angular's `RIBBON_TABS`, etc.) so the tab set can't
1362
- * drift between bindings. Per-tab icons stay in each binding (icon libraries
1363
- * differ per framework); only id + i18n key + order are shared here.
1364
- */
1365
- /**
1366
- * A single toolbar button/control that can be hidden independently of the
1367
- * ribbon tab it may also appear inside. `zoom` and `navigation` each cover a
1368
- * whole control cluster (zoom in/out/fit, prev/next) rather than each button
1369
- * in it, matching how hosts actually want to hide/keep them as a unit.
1370
- */
1371
- type ToolbarButtonId = 'share' | 'broadcast' | 'export' | 'undo' | 'redo' | 'record' | 'notes' | 'fullscreen' | 'zoom' | 'navigation' | 'mergeShapes' | 'crop';
1372
- /** 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. */
1373
- type ToolbarTabId = 'file' | 'home' | 'insert' | 'draw' | 'design' | 'transitions' | 'animations' | 'slideShow' | 'record' | 'review' | 'view' | 'help';
1374
- type ToolbarActionId = ToolbarButtonId | ToolbarTabId;
1375
- /**
1376
- * PowerPoint's contextual tabs: they join the tab row only while the
1377
- * selection is of their kind (see `contextualTabsForElement` in
1378
- * `ribbon-galleries/`). Kept apart from `ToolbarTabId` because they are not
1379
- * part of the fixed tab order every binding renders.
1380
- */
1381
- type RibbonContextualTabId = 'shapeFormat' | 'pictureFormat' | 'tableDesign' | 'chartDesign' | 'smartArtDesign';
1382
- //#endregion
1383
- //#region src/render/canvas-context-menu-commands.d.ts
1384
- /**
1385
- * The right-click menu for the empty slide canvas (no element under the
1386
- * cursor), as distinct from {@link ./context-menu-commands}'s per-element menu.
1387
- *
1388
- * Right-clicking empty canvas used to do nothing at all in every binding: React
1389
- * and Vue both bailed out early (`getElementIdFromEvent` returns `null`, so the
1390
- * handler just returns) rather than opening a menu, and the other three never
1391
- * wired a handler for it either. PowerPoint offers Paste, Layout, Reset,
1392
- * Format Background and view toggles (Grid and Guides, Ruler) from this menu;
1393
- * this module is the one list every binding renders instead of five omissions.
1394
- *
1395
- * @module render/canvas-context-menu-commands
1396
- */
1397
- /** Every command the empty-canvas context menu can offer, in no particular order. */
1398
- type CanvasContextMenuCommandId = 'paste' | 'layout' | 'reset-slide' | 'format-background' | 'grid-and-guides' | 'ruler';
1399
- //#endregion
1400
- //#region src/render/merge-shapes/merge-shapes-menu.d.ts
1401
- /** The right-click command id for each operation. */
1402
- type MergeShapesCommandId = 'merge-union' | 'merge-combine' | 'merge-fragment' | 'merge-intersect' | 'merge-subtract';
1403
- /** Every command a canvas context menu can offer, in no particular order. */
1404
- 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';
1405
- /** Every command the Edit Points right-click menu can offer. */
1406
- type EditPointsCommandId = 'add-point' | 'delete-point' | 'delete-segment' | 'open-path' | 'close-path' | 'smooth-point' | 'straight-point' | 'corner-point' | 'straight-segment' | 'curved-segment' | 'exit';
1407
- //#endregion
1408
- //#region src/render/edit-points/freeform-tool-geometry.d.ts
1409
- /** The two click-to-place drawing tools. */
1410
- type FreeformToolKind = 'freeformShape' | 'curve';
1411
- //#endregion
1412
- //#region src/render/editor-keymap.d.ts
1413
- /** A logical editor command produced by one key press. */
1414
- 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';
1415
- //#endregion
1416
- //#region src/render/options/viewer-options.d.ts
1417
- /**
1418
- * Full PowerPoint "File > Options" parity model.
1419
- *
1420
- * Groups mirror the ten categories of PowerPoint's Options dialog. Values are
1421
- * flat primitives per group so the dialog panes can be rendered generically
1422
- * from `VIEWER_OPTIONS_SCHEMA` in every binding. The legacy six-toggle
1423
- * `ViewerPreferences` surface stays supported via the mapping helpers below.
1424
- */
1425
- type ScreenTipStyle = 'descriptions' | 'plain' | 'off';
1426
- type DisplayOptimization = 'appearance' | 'compatibility';
1427
- type ImageResolutionPreset = 'highFidelity' | 'ppi330' | 'ppi220' | 'ppi150' | 'ppi96';
1428
- type OpenDocumentsView = 'savedView' | 'normal' | 'outline' | 'slideSorter' | 'notes';
1429
- type DefaultExportFormat = 'pptx' | 'pdf' | 'png';
1430
- type QuickAccessPosition = 'above' | 'below';
1431
- type FeedbackSoundScheme = 'modern' | 'classic';
1432
- type OptionsPrintWhat = 'slides' | 'handouts' | 'notes' | 'outline';
1433
- type OptionsPrintColorMode = 'color' | 'grayscale' | 'blackAndWhite';
1434
- interface ViewerGeneralOptions {
1435
- displayOptimization: DisplayOptimization;
1436
- showMiniToolbar: boolean;
1437
- enableLivePreview: boolean;
1438
- collapseRibbonAutomatically: boolean;
1439
- collapseSearchByDefault: boolean;
1440
- screenTipStyle: ScreenTipStyle;
1441
- userName: string;
1442
- userInitials: string;
1443
- showStartScreen: boolean;
1444
- /**
1445
- * Lets the user hand a local font file to the viewer so decks authored
1446
- * with a font the browser lacks render with the real face.
1447
- *
1448
- * Off by default. The registration reads a file the user picks and adds it
1449
- * to the page's font set for the session, which is a capability a host
1450
- * embedding the viewer should opt into rather than inherit.
1451
- */
1452
- enableCustomFontUpload: boolean;
1453
- }
1454
- interface ViewerProofingOptions {
1455
- autoCorrectTwoInitialCapitals: boolean;
1456
- autoCorrectCapitalizeFirstLetter: boolean;
1457
- autoCorrectCapitalizeDayNames: boolean;
1458
- autoCorrectSmartQuotes: boolean;
1459
- autoCorrectHyphensToDash: boolean;
1460
- autoCorrectFractions: boolean;
1461
- autoCorrectOrdinals: boolean;
1462
- ignoreUppercase: boolean;
1463
- ignoreWordsWithNumbers: boolean;
1464
- ignoreInternetAddresses: boolean;
1465
- flagRepeatedWords: boolean;
1466
- checkSpellingAsYouType: boolean;
1467
- hideSpellingErrors: boolean;
1468
- }
1469
- /**
1470
- * File > Options > Save.
1471
- *
1472
- * Font embedding deliberately has NO entry here. It is owned by the File >
1473
- * Fonts panel, whose toggle is the one the save path reads (see
1474
- * `render/font-embedding`: `describeFontEmbedding` decides the toggle's start
1475
- * position and whether it can do anything at all, `embeddedFontSaveOptions`
1476
- * turns it into the `PptxHandler.save()` slice). This group used to carry a
1477
- * second `embedFonts` boolean, plus an `embedAllFontCharacters` companion, and
1478
- * neither was read by anything: the pane moved a switch that changed no saved
1479
- * byte, while the panel next door moved the real one. Two switches for one
1480
- * setting, one of them lying, is worse than one switch in a less
1481
- * PowerPoint-shaped place.
1482
- */
1483
- interface ViewerSaveOptions {
1484
- autoSave: boolean;
1485
- autoRecoverIntervalMinutes: number;
1486
- keepLastAutoRecoveredVersion: boolean;
1487
- defaultExportFormat: DefaultExportFormat;
1488
- cacheRetentionDays: number;
1489
- clearCacheOnClose: boolean;
1490
- }
1491
- interface ViewerAccessibilityOptions {
1492
- /** Browser speech-recognition language; automatic follows the browser language. */
1493
- subtitleLanguage?: string;
1494
- showAccessibilityStatus: boolean;
1495
- feedbackWithSound: boolean;
1496
- soundScheme: FeedbackSoundScheme;
1497
- showShortcutKeysInScreenTips: boolean;
1498
- reducedMotion: boolean;
1499
- }
1500
- interface ViewerAdvancedOptions {
1501
- autoSelectEntireWord: boolean;
1502
- allowTextDragAndDrop: boolean;
1503
- maximumUndoSteps: number;
1504
- useSmartCutAndPaste: boolean;
1505
- showPasteOptionsButton: boolean;
1506
- imageDefaultResolution: ImageResolutionPreset;
1507
- doNotCompressImages: boolean;
1508
- chartPropertiesFollowDataPoint: boolean;
1509
- recentPresentationsCount: number;
1510
- showVerticalRuler: boolean;
1511
- showGrid: boolean;
1512
- snapToGrid: boolean;
1513
- disableHardwareAcceleration: boolean;
1514
- /**
1515
- * Force every opt-in interactive 3D scene (SmartArt, bar/line/area/pie/
1516
- * surface charts) to fall back to its flat 2D rendering, even when the
1517
- * host has enabled that scene via its own `smartArt3D`/`*Chart3D` prop.
1518
- * A host opting in says "this deck may want 3D"; this is the viewer
1519
- * user's own override for when the WebGL scenes it renders are too much
1520
- * for their machine. See `resolve3DRenderingFlags`.
1521
- */
1522
- disable3DRendering: boolean;
1523
- /**
1524
- * `p:animEffect/@filter="pixelate"` defaults to snapping the element to
1525
- * its end state (`cutIn`/`cutOut`), matching PowerPoint's own behaviour
1526
- * (COM `CreateVideo` frame-diffing shows PowerPoint performs no animation
1527
- * at all for this filter value). This turns on the blocky mosaic reveal
1528
- * this renderer can build instead, for a viewer that would rather show
1529
- * something animating than PowerPoint's own instant swap. See
1530
- * `resolveFilterEffect` in `animation-filter-effects.ts` and
1531
- * `docs/guide/visual-effects.md`.
1532
- */
1533
- pixelateMosaicAnimation: boolean;
1534
- openDocumentsView: OpenDocumentsView;
1535
- slideShowShowMenuOnRightClick: boolean;
1536
- slideShowShowPopupToolbar: boolean;
1537
- slideShowPromptKeepInkAnnotations: boolean;
1538
- slideShowEndWithBlackSlide: boolean;
1539
- printInBackground: boolean;
1540
- printHighQuality: boolean;
1541
- printUseMostRecentSettings: boolean;
1542
- printWhat: OptionsPrintWhat;
1543
- printColorMode: OptionsPrintColorMode;
1544
- printHiddenSlides: boolean;
1545
- printScaleToFit: boolean;
1546
- printFrameSlides: boolean;
1547
- }
1548
- interface ViewerRibbonOptions {
1549
- /** Ribbon tabs unticked in Customize Ribbon. The File tab can never be hidden. */
1550
- hiddenTabIds: ToolbarTabId[];
1551
- }
1552
- interface ViewerQuickAccessOptions {
1553
- visible: boolean;
1554
- position: QuickAccessPosition;
1555
- showCommandLabels: boolean;
1556
- /** Ordered ids from `QUICK_ACCESS_COMMAND_CATALOG`. */
1557
- commandIds: string[];
1558
- }
1559
- interface ViewerTrustOptions {
1560
- openInProtectedView: boolean;
1561
- allowExternalContent: boolean;
1562
- confirmExternalHyperlinks: boolean;
1563
- }
1564
- interface ViewerOptions {
1565
- general: ViewerGeneralOptions;
1566
- proofing: ViewerProofingOptions;
1567
- save: ViewerSaveOptions;
1568
- accessibility: ViewerAccessibilityOptions;
1569
- advanced: ViewerAdvancedOptions;
1570
- ribbon: ViewerRibbonOptions;
1571
- quickAccess: ViewerQuickAccessOptions;
1572
- trust: ViewerTrustOptions;
1573
- }
1574
- type ViewerOptionsGroupId = keyof ViewerOptions;
1575
- type ViewerOptionPrimitive = boolean | number | string;
1576
- type StoredViewerOptions = { [G in ViewerOptionsGroupId]?: Partial<ViewerOptions[G]>; };
1577
- //#endregion
1578
- //#region src/render/options/viewer-options-controls.d.ts
1579
- /**
1580
- * Control/section/tab descriptor types for the File > Options schema, plus
1581
- * the terse constructors the tab-definition modules build panes with.
1582
- */
1583
- type ViewerOptionsTabId = 'general' | 'proofing' | 'save' | 'language' | 'accessibility' | 'advanced' | 'ribbon' | 'quickAccess' | 'addIns' | 'trust';
1584
- //#endregion
1585
- //#region src/render/customization/host-menu-commands.d.ts
1586
- /** Snapshot of the slide on which the host command was offered. */
1587
- interface HostCanvasMenuContext {
1588
- slideIndex: number;
1589
- }
1590
- /** Effective selection, including a single right-clicked element. */
1591
- interface HostElementMenuContext extends HostCanvasMenuContext {
1592
- elementIds: readonly string[];
1593
- }
1594
- /** Plain text labels work identically in every framework. */
1595
- interface HostMenuCommand<C> {
1596
- id: string;
1597
- label: string;
1598
- /** Default: a separate group above the built-in commands. */
1599
- group?: 'top' | 'bottom';
1600
- disabled?: boolean | ((context: C) => boolean);
1601
- onSelect: (context: C) => void;
1602
- }
1603
- //#endregion
1604
- //#region src/render/customization/ribbon-control-catalog.d.ts
1605
- declare const RIBBON_CONTROL_CATALOG: {
1606
- readonly home: {
1607
- readonly clipboard: {
1608
- readonly label: 'Clipboard';
1609
- readonly controls: {
1610
- readonly paste: 'Paste';
1611
- readonly cut: 'Cut';
1612
- readonly copy: 'Copy';
1613
- readonly formatPainter: 'Format Painter';
1614
- };
1615
- };
1616
- readonly slides: {
1617
- readonly label: 'Slides';
1618
- readonly controls: {
1619
- readonly newSlide: 'New Slide';
1620
- readonly layout: 'Layout';
1621
- readonly reset: 'Reset';
1622
- readonly section: 'Section';
1623
- readonly slideTemplates: 'Slide templates';
1624
- };
1625
- };
1626
- readonly font: {
1627
- readonly label: 'Font';
1628
- readonly controls: {
1629
- readonly fontFamily: 'Font';
1630
- readonly fontSize: 'Font Size';
1631
- readonly increaseFontSize: 'Increase Font Size';
1632
- readonly decreaseFontSize: 'Decrease Font Size';
1633
- readonly clearFormatting: 'Clear All Formatting';
1634
- readonly bold: 'Bold';
1635
- readonly italic: 'Italic';
1636
- readonly underline: 'Underline';
1637
- readonly strikethrough: 'Strikethrough';
1638
- readonly shadow: 'Text Shadow';
1639
- readonly characterSpacing: 'Character Spacing';
1640
- readonly changeCase: 'Change Case';
1641
- readonly fontColor: 'Font Color';
1642
- readonly highlightColor: 'Text Highlight Color';
1643
- readonly superscript: 'Superscript';
1644
- readonly subscript: 'Subscript';
1645
- };
1646
- };
1647
- readonly paragraph: {
1648
- readonly label: 'Paragraph';
1649
- readonly controls: {
1650
- readonly bullets: 'Bullets (toggle and gallery)';
1651
- readonly numbering: 'Numbering (toggle and gallery)';
1652
- readonly decreaseIndent: 'Decrease List Level';
1653
- readonly increaseIndent: 'Increase List Level';
1654
- readonly lineSpacing: 'Line Spacing';
1655
- readonly alignLeft: 'Align Left';
1656
- readonly alignCenter: 'Center';
1657
- readonly alignRight: 'Align Right';
1658
- readonly justify: 'Justify';
1659
- readonly columns: 'Columns';
1660
- readonly textDirection: 'Text Direction';
1661
- readonly alignText: 'Align Text';
1662
- };
1663
- };
1664
- readonly drawing: {
1665
- readonly label: 'Drawing';
1666
- readonly controls: {
1667
- readonly shapes: 'Shapes';
1668
- readonly arrange: 'Arrange';
1669
- readonly quickStyles: 'Quick Styles (Shape Styles gallery)';
1670
- readonly shapeFill: 'Shape Fill';
1671
- readonly shapeOutline: 'Shape Outline';
1672
- readonly shapeEffects: 'Shape Effects gallery';
1673
- };
1674
- };
1675
- readonly arrange: {
1676
- readonly label: 'Arrange';
1677
- readonly controls: {
1678
- readonly bringForward: 'Bring Forward';
1679
- readonly sendBackward: 'Send Backward';
1680
- readonly bringToFront: 'Bring to Front';
1681
- readonly sendToBack: 'Send to Back';
1682
- readonly flipHorizontal: 'Flip Horizontal';
1683
- readonly flipVertical: 'Flip Vertical';
1684
- readonly duplicate: 'Duplicate';
1685
- readonly delete: 'Delete';
1686
- readonly group: 'Group';
1687
- readonly ungroup: 'Ungroup';
1688
- readonly align: 'Align';
1689
- readonly mergeShapes: 'Merge Shapes';
1690
- readonly crop: 'Crop';
1691
- readonly outlineWidth: 'Outline width';
1692
- };
1693
- };
1694
- readonly editing: {
1695
- readonly label: 'Editing';
1696
- readonly controls: {
1697
- readonly find: 'Find';
1698
- readonly replace: 'Replace';
1699
- readonly select: 'Select';
1700
- };
1701
- };
1702
- };
1703
- readonly insert: {
1704
- readonly slides: {
1705
- readonly label: 'Slides';
1706
- readonly controls: {
1707
- readonly newSlide: 'New Slide';
1708
- };
1709
- };
1710
- readonly tables: {
1711
- readonly label: 'Tables';
1712
- readonly controls: {
1713
- readonly table: 'Table';
1714
- };
1715
- };
1716
- readonly images: {
1717
- readonly label: 'Images';
1718
- readonly controls: {
1719
- readonly pictures: 'Pictures';
1720
- };
1721
- };
1722
- readonly illustrations: {
1723
- readonly label: 'Illustrations';
1724
- readonly controls: {
1725
- readonly shapes: 'Shapes';
1726
- readonly smartArt: 'SmartArt';
1727
- readonly chart: 'Chart';
1728
- };
1729
- };
1730
- readonly links: {
1731
- readonly label: 'Links';
1732
- readonly controls: {
1733
- readonly link: 'Link';
1734
- readonly action: 'Action button';
1735
- };
1736
- };
1737
- readonly comments: {
1738
- readonly label: 'Comments';
1739
- readonly controls: {
1740
- readonly comment: 'Comment';
1741
- };
1742
- };
1743
- readonly text: {
1744
- readonly label: 'Text';
1745
- readonly controls: {
1746
- readonly textBox: 'Text Box';
1747
- readonly field: 'Header, date, slide number field';
1748
- };
1749
- };
1750
- readonly symbols: {
1751
- readonly label: 'Symbols';
1752
- readonly controls: {
1753
- readonly equation: 'Equation';
1754
- readonly symbol: 'Symbol';
1755
- };
1756
- };
1757
- readonly media: {
1758
- readonly label: 'Media';
1759
- readonly controls: {
1760
- readonly media: 'Video / Audio';
1761
- };
1762
- };
1763
- };
1764
- readonly draw: {
1765
- readonly tools: {
1766
- readonly label: 'Drawing Tools';
1767
- readonly controls: {
1768
- readonly select: 'Select';
1769
- readonly pen: 'Pen';
1770
- readonly highlighter: 'Highlighter';
1771
- readonly freeform: 'Freeform';
1772
- readonly eraser: 'Eraser';
1773
- readonly penColor: 'Pen colour';
1774
- readonly penWidth: 'Pen width';
1775
- };
1776
- };
1777
- readonly convert: {
1778
- readonly label: 'Convert';
1779
- readonly controls: {
1780
- readonly inkToShape: 'Ink to Shape';
1781
- };
1782
- };
1783
- };
1784
- readonly design: {
1785
- readonly themes: {
1786
- readonly label: 'Themes';
1787
- readonly controls: {
1788
- readonly browseThemes: 'Themes gallery';
1789
- readonly editTheme: 'Edit theme';
1790
- };
1791
- };
1792
- readonly variants: {
1793
- readonly label: 'Variants';
1794
- readonly controls: {
1795
- readonly colors: 'Variants: Colors gallery';
1796
- readonly fonts: 'Variants: Fonts gallery';
1797
- };
1798
- };
1799
- readonly customize: {
1800
- readonly label: 'Customize';
1801
- readonly controls: {
1802
- readonly slideSize: 'Slide Size';
1803
- readonly formatBackground: 'Format Background';
1804
- };
1805
- };
1806
- };
1807
- readonly transitions: {
1808
- readonly preview: {
1809
- readonly label: 'Preview';
1810
- readonly controls: {
1811
- readonly preview: 'Preview';
1812
- };
1813
- };
1814
- readonly transitionToThisSlide: {
1815
- readonly label: 'Transition to This Slide';
1816
- readonly controls: {
1817
- readonly gallery: 'Transition gallery';
1818
- readonly effectOptions: 'Effect Options';
1819
- };
1820
- };
1821
- readonly timing: {
1822
- readonly label: 'Timing';
1823
- readonly controls: {
1824
- readonly sound: 'Sound';
1825
- readonly duration: 'Duration';
1826
- readonly applyToAll: 'Apply To All';
1827
- readonly advanceOnClick: 'On Mouse Click';
1828
- readonly advanceAfter: 'After';
1829
- };
1830
- };
1831
- };
1832
- readonly animations: {
1833
- readonly preview: {
1834
- readonly label: 'Preview';
1835
- readonly controls: {
1836
- readonly preview: 'Preview';
1837
- };
1838
- };
1839
- readonly animation: {
1840
- readonly label: 'Animation';
1841
- readonly controls: {
1842
- readonly gallery: 'Animation gallery';
1843
- readonly effectOptions: 'Effect Options';
1844
- };
1845
- };
1846
- readonly motionPath: {
1847
- readonly label: 'Motion Paths';
1848
- readonly controls: {
1849
- readonly gallery: 'Motion path gallery';
1850
- };
1851
- };
1852
- readonly advancedAnimation: {
1853
- readonly label: 'Advanced Animation';
1854
- readonly controls: {
1855
- readonly addAnimation: 'Add Animation';
1856
- readonly animationPane: 'Animation Pane';
1857
- readonly trigger: 'Trigger';
1858
- readonly animationPainter: 'Animation Painter';
1859
- readonly remove: 'Remove animation';
1860
- };
1861
- };
1862
- readonly timing: {
1863
- readonly label: 'Timing';
1864
- readonly controls: {
1865
- readonly start: 'Start';
1866
- readonly duration: 'Duration';
1867
- readonly delay: 'Delay';
1868
- readonly reorder: 'Reorder';
1869
- };
1870
- };
1871
- };
1872
- readonly slideShow: {
1873
- readonly startSlideShow: {
1874
- readonly label: 'Start Slide Show';
1875
- readonly controls: {
1876
- readonly fromBeginning: 'From Beginning';
1877
- readonly fromCurrent: 'From Current Slide';
1878
- readonly customShow: 'Custom Slide Show';
1879
- };
1880
- };
1881
- readonly present: {
1882
- readonly label: 'Present';
1883
- readonly controls: {
1884
- readonly presenterView: 'Presenter View';
1885
- readonly broadcast: 'Present Online';
1886
- };
1887
- };
1888
- readonly setUp: {
1889
- readonly label: 'Set Up';
1890
- readonly controls: {
1891
- readonly setUpSlideShow: 'Set Up Slide Show';
1892
- readonly hideSlide: 'Hide Slide';
1893
- readonly rehearseTimings: 'Rehearse Timings';
1894
- readonly record: 'Record';
1895
- readonly rehearseWithCoach: 'Rehearse with Coach';
1896
- };
1897
- };
1898
- readonly captions: {
1899
- readonly label: 'Captions & Subtitles';
1900
- readonly controls: {
1901
- readonly subtitles: 'Always Use Subtitles';
1902
- readonly subtitleSettings: 'Subtitle Settings';
1903
- };
1904
- };
1905
- };
1906
- readonly record: {
1907
- readonly camera: {
1908
- readonly label: 'Camera';
1909
- readonly controls: {
1910
- readonly cameo: 'Cameo';
1911
- };
1912
- };
1913
- readonly record: {
1914
- readonly label: 'Record';
1915
- readonly controls: {
1916
- readonly fromBeginning: 'From Beginning';
1917
- readonly fromCurrent: 'From Current Slide';
1918
- };
1919
- };
1920
- readonly manage: {
1921
- readonly label: 'Manage';
1922
- readonly controls: {
1923
- readonly clear: 'Clear';
1924
- readonly reset: 'Reset to Cameo';
1925
- };
1926
- };
1927
- readonly help: {
1928
- readonly label: 'Help';
1929
- readonly controls: {
1930
- readonly learnMore: 'Learn more';
1931
- };
1932
- };
1933
- };
1934
- readonly review: {
1935
- readonly proofing: {
1936
- readonly label: 'Proofing';
1937
- readonly controls: {
1938
- readonly spelling: 'Spelling';
1939
- readonly thesaurus: 'Thesaurus';
1940
- };
1941
- };
1942
- readonly accessibility: {
1943
- readonly label: 'Accessibility';
1944
- readonly controls: {
1945
- readonly check: 'Check Accessibility';
1946
- };
1947
- };
1948
- readonly language: {
1949
- readonly label: 'Language';
1950
- readonly controls: {
1951
- readonly translate: 'Translate';
1952
- readonly language: 'Language';
1953
- };
1954
- };
1955
- readonly comments: {
1956
- readonly label: 'Comments';
1957
- readonly controls: {
1958
- readonly newComment: 'New Comment';
1959
- readonly delete: 'Delete';
1960
- readonly previous: 'Previous';
1961
- readonly next: 'Next';
1962
- readonly showComments: 'Show Comments';
1963
- };
1964
- };
1965
- readonly compare: {
1966
- readonly label: 'Compare';
1967
- readonly controls: {
1968
- readonly compare: 'Compare';
1969
- readonly markAllRead: 'Mark all read';
1970
- };
1971
- };
1972
- readonly protect: {
1973
- readonly label: 'Protect';
1974
- readonly controls: {
1975
- readonly readOnly: 'Read-only';
1976
- readonly restrictPermission: 'Restrict Permission';
1977
- };
1978
- };
1979
- readonly ink: {
1980
- readonly label: 'Ink';
1981
- readonly controls: {
1982
- readonly hideInk: 'Hide Ink';
1983
- };
1984
- };
1985
- };
1986
- readonly view: {
1987
- readonly presentationViews: {
1988
- readonly label: 'Presentation Views';
1989
- readonly controls: {
1990
- readonly normal: 'Normal';
1991
- readonly outline: 'Outline View';
1992
- readonly slideSorter: 'Slide Sorter';
1993
- readonly notesPage: 'Notes Page';
1994
- readonly readingView: 'Reading View';
1995
- };
1996
- };
1997
- readonly masterViews: {
1998
- readonly label: 'Master Views';
1999
- readonly controls: {
2000
- readonly slideMaster: 'Slide Master';
2001
- readonly handoutMaster: 'Handout Master';
2002
- readonly notesMaster: 'Notes Master';
2003
- };
2004
- };
2005
- readonly show: {
2006
- readonly label: 'Show';
2007
- readonly controls: {
2008
- readonly ruler: 'Ruler';
2009
- readonly gridlines: 'Gridlines';
2010
- readonly guides: 'Guides';
2011
- readonly snapToGrid: 'Snap to Grid';
2012
- readonly snapToShape: 'Snap to Shape';
2013
- readonly addGuide: 'Add horizontal / vertical guide';
2014
- readonly selectionPane: 'Selection Pane';
2015
- readonly eyedropper: 'Eyedropper';
2016
- readonly notes: 'Notes';
2017
- };
2018
- };
2019
- readonly zoom: {
2020
- readonly label: 'Zoom';
2021
- readonly controls: {
2022
- readonly zoom: 'Zoom';
2023
- readonly fitToWindow: 'Fit to Window';
2024
- };
2025
- };
2026
- readonly window: {
2027
- readonly label: 'Window';
2028
- readonly controls: {
2029
- readonly templateEditing: 'Edit template elements';
2030
- readonly macros: 'Macros';
2031
- };
2032
- };
2033
- };
2034
- readonly help: {
2035
- readonly help: {
2036
- readonly label: 'Help';
2037
- readonly controls: {
2038
- readonly options: 'Options';
2039
- readonly keyboardShortcuts: 'Keyboard shortcuts';
2040
- readonly accessibility: 'Accessibility checker';
2041
- };
2042
- };
2043
- };
2044
- readonly shapeFormat: {
2045
- readonly shapeStyles: {
2046
- readonly label: 'Shape Styles';
2047
- readonly controls: {
2048
- readonly gallery: 'Shape Styles gallery';
2049
- readonly shapeEffects: 'Shape Effects gallery';
2050
- };
2051
- };
2052
- readonly wordArtStyles: {
2053
- readonly label: 'WordArt Styles';
2054
- readonly controls: {
2055
- readonly gallery: 'WordArt Styles gallery';
2056
- };
2057
- };
2058
- };
2059
- readonly pictureFormat: {
2060
- readonly adjust: {
2061
- readonly label: 'Adjust';
2062
- readonly controls: {
2063
- readonly corrections: 'Corrections gallery';
2064
- readonly color: 'Color gallery';
2065
- readonly artisticEffects: 'Artistic Effects gallery';
2066
- };
2067
- };
2068
- readonly pictureStyles: {
2069
- readonly label: 'Picture Styles';
2070
- readonly controls: {
2071
- readonly gallery: 'Picture Styles gallery';
2072
- readonly pictureEffects: 'Picture Effects gallery';
2073
- };
2074
- };
2075
- };
2076
- readonly tableDesign: {
2077
- readonly tableStyles: {
2078
- readonly label: 'Table Styles';
2079
- readonly controls: {
2080
- readonly gallery: 'Table Styles gallery';
2081
- };
2082
- };
2083
- };
2084
- readonly chartDesign: {
2085
- readonly chartLayouts: {
2086
- readonly label: 'Chart Layouts';
2087
- readonly controls: {
2088
- readonly quickLayout: 'Quick Layout gallery';
2089
- };
2090
- };
2091
- readonly chartStyles: {
2092
- readonly label: 'Chart Styles';
2093
- readonly controls: {
2094
- readonly changeColors: 'Change Colors gallery';
2095
- readonly gallery: 'Chart Styles gallery';
2096
- };
2097
- };
2098
- };
2099
- readonly smartArtDesign: {
2100
- readonly createGraphic: {
2101
- readonly label: 'Create Graphic';
2102
- readonly controls: {
2103
- readonly addShape: 'Add Shape';
2104
- readonly addBullet: 'Add Bullet';
2105
- readonly textPane: 'Text Pane';
2106
- readonly promote: 'Promote';
2107
- readonly demote: 'Demote';
2108
- readonly rightToLeft: 'Right to Left';
2109
- readonly moveUp: 'Move Up';
2110
- readonly moveDown: 'Move Down';
2111
- };
2112
- };
2113
- readonly layouts: {
2114
- readonly label: 'Layouts';
2115
- readonly controls: {
2116
- readonly gallery: 'Layouts gallery';
2117
- };
2118
- };
2119
- readonly smartArtStyles: {
2120
- readonly label: 'SmartArt Styles';
2121
- readonly controls: {
2122
- readonly changeColors: 'Change Colors gallery';
2123
- readonly gallery: 'SmartArt Styles gallery';
2124
- };
2125
- };
2126
- readonly reset: {
2127
- readonly label: 'Reset';
2128
- readonly controls: {
2129
- readonly resetGraphic: 'Reset Graphic';
2130
- readonly convert: 'Convert';
2131
- };
2132
- };
2133
- };
2134
- };
2135
- //#endregion
2136
- //#region src/render/customization/ribbon-control-ids.d.ts
2137
- type Catalog = typeof RIBBON_CONTROL_CATALOG;
2138
- /** `<tab>.<group>`, for example `home.font`. */
2139
- type RibbonGroupId = { [T in keyof Catalog]: { [G in keyof Catalog[T]]: `${T & string}.${G & string}`; }[keyof Catalog[T]]; }[keyof Catalog];
2140
- /** `<tab>.<group>.<control>`, for example `home.font.bold`. */
2141
- type RibbonControlId = { [T in keyof Catalog]: { [G in keyof Catalog[T]]: Catalog[T][G] extends {
2142
- controls: infer C;
2143
- } ? `${T & string}.${G & string}.${keyof C & string}` : never; }[keyof Catalog[T]]; }[keyof Catalog];
2144
- //#endregion
2145
- //#region src/render/customization/customization-types.d.ts
2146
- /** Keys of an options group whose value is a primitive (not an array). */
2147
- type PrimitiveKeys<T> = { [K in keyof T]: T[K] extends ViewerOptionPrimitive ? K : never; }[keyof T] & string;
2148
- /**
2149
- * One File > Options setting, addressed as `<group>.<key>`, for example
2150
- * `general.userName` or `advanced.showGrid`. The union is derived from the
2151
- * `ViewerOptions` model itself, so a typo is a compile error.
2152
- */
2153
- type OptionsSettingId = { [G in ViewerOptionsGroupId]: `${G}.${PrimitiveKeys<ViewerOptions[G]>}`; }[ViewerOptionsGroupId];
2154
- /**
2155
- * A File > Options page: the ten PowerPoint categories plus `ai`, the AI
2156
- * assistant page a binding adds when the host configured an assistant.
2157
- */
2158
- type OptionsPageId = ViewerOptionsTabId | 'ai';
2159
- /**
2160
- * One section of an Options page, addressed as `<page>.<section>`, for
2161
- * example `general.personalize` or `advanced.print`. The full list is
2162
- * `OPTIONS_SECTION_IDS` (derived from the schema at runtime).
2163
- */
2164
- type OptionsSectionId = `${ViewerOptionsTabId}.${string}`;
2165
- /** Values a host forces onto settings. */
2166
- type OptionsSettingValues = Partial<Record<OptionsSettingId, ViewerOptionPrimitive>>;
2167
- /** Ribbon and toolbar customisation. */
2168
- interface RibbonCustomization {
2169
- /**
2170
- * Ribbon tabs to remove (the File tab included, unlike Customize Ribbon),
2171
- * and contextual tabs (`shapeFormat`, `pictureFormat`, ...) that should
2172
- * never appear.
2173
- */
2174
- hiddenTabs?: readonly (ToolbarTabId | RibbonContextualTabId)[];
2175
- /** Groups inside a tab to remove, as `<tab>.<group>` (`home.font`). */
2176
- hiddenGroups?: readonly RibbonGroupId[];
2177
- /**
2178
- * Controls to remove: a top-level toolbar button / control cluster
2179
- * (`share`, `zoom`, ...) or any ribbon control as
2180
- * `<tab>.<group>.<control>` (`home.font.bold`).
2181
- */
2182
- hiddenButtons?: readonly (ToolbarButtonId | RibbonControlId)[];
2183
- }
2184
- /** File > Options (the Settings dialog) customisation. */
2185
- interface OptionsCustomization {
2186
- /** Whole pages to remove from the dialog's category rail. */
2187
- hiddenPages?: readonly OptionsPageId[];
2188
- /** Sections (`<page>.<section>`) to remove from their page. */
2189
- hiddenSections?: readonly OptionsSectionId[];
2190
- /** Individual settings (`<group>.<key>`) to remove wherever they appear. */
2191
- hiddenSettings?: readonly OptionsSettingId[];
2192
- /**
2193
- * Settings pinned to a fixed value. The value is forced into the options
2194
- * store, user edits to it are ignored, and the control renders read-only.
2195
- * Add the id to `hiddenSettings` too to lock it invisibly.
2196
- */
2197
- locked?: OptionsSettingValues;
2198
- /**
2199
- * Host defaults: the value a setting starts at when the user has not saved
2200
- * a choice of their own. "Reset" returns to these, not to the built-ins.
2201
- */
2202
- defaults?: OptionsSettingValues;
2203
- }
2204
- /** File tab (backstage) customisation. */
2205
- interface BackstageCustomization {
2206
- /** Navigation entries (pages) to remove from the File tab. */
2207
- hiddenPages?: readonly BackstagePage[];
2208
- /** Action cards to remove from the pages that show them. */
2209
- hiddenCards?: readonly BackstageCardId[];
2210
- }
2211
- /** Right-click menu customisation. */
2212
- interface ContextMenuCustomization {
2213
- /** Additional host commands, independent of the viewer's AI connection. */
2214
- extraElementCommands?: readonly HostMenuCommand<HostElementMenuContext>[];
2215
- extraCanvasCommands?: readonly HostMenuCommand<HostCanvasMenuContext>[];
2216
- /** Entries to remove from the element (right-click on a shape) menu. */
2217
- hiddenElementCommands?: readonly ContextMenuCommandId[];
2218
- /** Entries to remove from the empty-canvas menu. */
2219
- hiddenCanvasCommands?: readonly CanvasContextMenuCommandId[];
2220
- /**
2221
- * Entries to remove from the Edit Points menu (right-click a vertex or a
2222
- * segment while editing a shape's points).
2223
- */
2224
- hiddenEditPointsCommands?: readonly EditPointsCommandId[];
2225
- /** Remove the element context menu entirely. */
2226
- disableElementMenu?: boolean;
2227
- /** Remove the empty-canvas context menu entirely. */
2228
- disableCanvasMenu?: boolean;
2229
- }
2230
- /**
2231
- * A shortcut chord in the form `Mod+Shift+D`: modifiers `Mod` (Ctrl on
2232
- * Windows/Linux, Cmd on macOS), `Ctrl`, `Meta`, `Alt`, `Shift`, joined by `+`,
2233
- * followed by a `KeyboardEvent.key` value (`D`, `Delete`, `ArrowLeft`, `F2`).
2234
- */
2235
- type ShortcutChord = string;
2236
- /** Editor keyboard-shortcut customisation. */
2237
- interface KeyboardCustomization {
2238
- /** Turn every editor shortcut off (the host owns the keyboard). */
2239
- disableAll?: boolean;
2240
- /** Editor commands whose shortcut is turned off. */
2241
- disabled?: readonly EditorKeyActionName[];
2242
- /**
2243
- * Replacement chords per command. A remapped command no longer answers to
2244
- * its built-in chord; it answers to the chord(s) given here instead.
2245
- */
2246
- remap?: Partial<Record<EditorKeyActionName, ShortcutChord | readonly ShortcutChord[]>>;
2247
- }
2248
- /**
2249
- * Chrome regions a host can remove. Each id maps onto one region in every
2250
- * binding; see `VIEWER_PANEL_IDS` for the catalogue.
2251
- */
2252
- type ViewerPanelId = 'statusBar' | 'slidesPane' | 'inspector' | 'notes' | 'quickAccessToolbar' | 'titleBar';
2253
- /** Feature areas that can be switched off as a whole. */
2254
- type ViewerFeatureId = 'ai' | 'collaboration' | 'comments' | 'presentMode' | 'editPoints';
2255
- /**
2256
- * The click-to-place drawing tools of Insert > Shapes > Lines: Freeform:
2257
- * Shape and Curve.
2258
- */
2259
- type ViewerDrawingToolId = FreeformToolKind;
2260
- /** Dialogs (and the entry points that open them) a host can remove. */
2261
- type ViewerDialogId = 'options' | 'share' | 'broadcast' | 'print' | 'export';
2262
- /** Export formats offered by the File > Export page. */
2263
- type ViewerExportFormatId = 'pdf' | 'png' | 'video' | 'gif' | 'json' | 'copyImage';
2264
- /**
2265
- * The whole customisation object. Every field is optional; omitted fields hide
2266
- * nothing and lock nothing.
2267
- */
2268
- interface ViewerCustomization {
2269
- ribbon?: RibbonCustomization;
2270
- options?: OptionsCustomization;
2271
- backstage?: BackstageCustomization;
2272
- contextMenu?: ContextMenuCustomization;
2273
- keyboard?: KeyboardCustomization;
2274
- /** Chrome regions to remove (`true` hides). */
2275
- hiddenPanels?: readonly ViewerPanelId[];
2276
- /** Feature areas to switch off (their buttons, menus, pages and panels). */
2277
- disabledFeatures?: readonly ViewerFeatureId[];
2278
- /** Dialogs to remove, along with every entry point that opens them. */
2279
- hiddenDialogs?: readonly ViewerDialogId[];
2280
- /** Export formats to remove from File > Export. */
2281
- hiddenExportFormats?: readonly ViewerExportFormatId[];
2282
- /** Drawing tools to remove from the Insert > Shapes gallery. */
2283
- hiddenDrawingTools?: readonly ViewerDrawingToolId[];
2284
- }
2285
- //#endregion
2286
- //#region src/render/customization/customization-catalog.d.ts
2287
- declare const RIBBON_TAB_IDS: readonly ToolbarTabId[];
2288
- declare const TOOLBAR_BUTTON_IDS: readonly ["share", "broadcast", "export", "undo", "redo", "record", "notes", "fullscreen", "zoom", "navigation", "mergeShapes", "crop"];
2289
- declare const OPTIONS_PAGE_IDS: readonly OptionsPageId[];
2290
- declare const OPTIONS_SECTION_IDS: readonly OptionsSectionId[];
2291
- declare const OPTIONS_SETTING_IDS: readonly OptionsSettingId[];
2292
- declare const BACKSTAGE_PAGE_IDS: readonly BackstagePage[];
2293
- declare const BACKSTAGE_CARD_IDS: readonly BackstageCardId[];
2294
- declare const ELEMENT_CONTEXT_MENU_COMMAND_IDS: readonly ["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", "merge-union", "merge-combine", "merge-fragment", "merge-intersect", "merge-subtract", "save-as-picture", "edit-alt-text", "size-and-position", "format-shape", "delete"];
2295
- declare const CANVAS_CONTEXT_MENU_COMMAND_IDS: readonly ["paste", "layout", "reset-slide", "format-background", "grid-and-guides", "ruler"];
2296
- declare const EDITOR_SHORTCUT_ACTION_IDS: readonly ["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"];
2297
- declare const VIEWER_PANEL_IDS: readonly ["statusBar", "slidesPane", "inspector", "notes", "quickAccessToolbar", "titleBar"];
2298
- declare const VIEWER_FEATURE_IDS: readonly ["ai", "collaboration", "comments", "presentMode", "editPoints"];
2299
- declare const VIEWER_DIALOG_IDS: readonly ["options", "share", "broadcast", "print", "export"];
2300
- declare const VIEWER_EXPORT_FORMAT_IDS: readonly ["pdf", "png", "video", "gif", "json", "copyImage"];
2301
- //#endregion
2302
- //#region src/render/customization/customization-keymap.d.ts
2303
- /** A parsed `Mod+Shift+D` chord. */
2304
- interface ParsedShortcutChord {
2305
- key: string;
2306
- mod: boolean;
2307
- ctrl: boolean;
2308
- meta: boolean;
2309
- alt: boolean;
2310
- shift: boolean;
2311
- }
2312
- /** The normalised keyboard slice of a resolved customisation. */
2313
- interface ResolvedKeyboardCustomization {
2314
- disableAll: boolean;
2315
- disabled: ReadonlySet<EditorKeyActionName>;
2316
- remap: ReadonlyMap<EditorKeyActionName, readonly ParsedShortcutChord[]>;
2317
- }
2318
- //#endregion
2319
- //#region src/render/customization/customization-resolve.d.ts
2320
- /** The normalised, set-based view of a customisation. Treat as immutable. */
2321
- interface ResolvedCustomization {
2322
- hiddenActions: ReadonlySet<ToolbarActionId>;
2323
- /** Contextual tabs (`shapeFormat`, ...) the host never wants shown. */
2324
- hiddenContextualTabs: ReadonlySet<RibbonContextualTabId>;
2325
- /** Catalogued ribbon groups to hide (`ribbon.hiddenGroups`). */
2326
- hiddenRibbonGroups: ReadonlySet<RibbonGroupId>;
2327
- /** Catalogued ribbon controls to hide (the `<tab>.<group>.<control>` part of `ribbon.hiddenButtons`). */
2328
- hiddenRibbonControls: ReadonlySet<RibbonControlId>;
2329
- hiddenOptionsPages: ReadonlySet<OptionsPageId>;
2330
- hiddenOptionsSections: ReadonlySet<OptionsSectionId>;
2331
- hiddenSettings: ReadonlySet<OptionsSettingId>;
2332
- lockedSettings: OptionsSettingValues;
2333
- defaultSettings: OptionsSettingValues;
2334
- hiddenBackstagePages: ReadonlySet<BackstagePage>;
2335
- hiddenBackstageCards: ReadonlySet<BackstageCardId>;
2336
- hiddenElementCommands: ReadonlySet<ContextMenuCommandId>;
2337
- extraElementCommands: NonNullable<ViewerCustomization['contextMenu']>['extraElementCommands'];
2338
- extraCanvasCommands: NonNullable<ViewerCustomization['contextMenu']>['extraCanvasCommands'];
2339
- hiddenCanvasCommands: ReadonlySet<CanvasContextMenuCommandId>;
2340
- hiddenEditPointsCommands: ReadonlySet<EditPointsCommandId>;
2341
- hiddenDrawingTools: ReadonlySet<ViewerDrawingToolId>;
2342
- elementMenuEnabled: boolean;
2343
- canvasMenuEnabled: boolean;
2344
- hiddenPanels: ReadonlySet<ViewerPanelId>;
2345
- disabledFeatures: ReadonlySet<ViewerFeatureId>;
2346
- hiddenDialogs: ReadonlySet<ViewerDialogId>;
2347
- keyboard: ResolvedKeyboardCustomization;
2348
- }
2349
- //#endregion
2350
- //#region src/render/customization/customization-controller.d.ts
2351
- /** The imperative methods every binding's component handle exposes. */
2352
- interface ViewerCustomizationApi {
2353
- /** The current customisation object (a snapshot; do not mutate). */
2354
- getCustomization(): ViewerCustomization;
2355
- /** Replace the whole customisation. */
2356
- setCustomization(next: ViewerCustomization): void;
2357
- /** Merge a partial customisation (see `mergeCustomization`). */
2358
- updateCustomization(patch: ViewerCustomization): void;
2359
- /** Drop every customisation, back to the stock UI. */
2360
- resetCustomization(): void;
2361
- /** Hide a fixed tab, or stop a contextual tab (`shapeFormat`, ...) from appearing. */
2362
- hideRibbonTab(tab: ToolbarTabId | RibbonContextualTabId): void;
2363
- showRibbonTab(tab: ToolbarTabId | RibbonContextualTabId): void;
2364
- /** Hide a group inside a tab (`home.font`). */
2365
- hideRibbonGroup(group: RibbonGroupId): void;
2366
- showRibbonGroup(group: RibbonGroupId): void;
2367
- /** Hide a top-level toolbar button or any ribbon control (`home.font.bold`). */
2368
- hideToolbarButton(button: ToolbarButtonId | RibbonControlId): void;
2369
- showToolbarButton(button: ToolbarButtonId | RibbonControlId): void;
2370
- /** Alias of `hideToolbarButton` for a ribbon control id. */
2371
- hideRibbonControl(control: RibbonControlId): void;
2372
- showRibbonControl(control: RibbonControlId): void;
2373
- hideOptionsPage(page: OptionsPageId): void;
2374
- showOptionsPage(page: OptionsPageId): void;
2375
- hideOptionsSection(section: OptionsSectionId): void;
2376
- showOptionsSection(section: OptionsSectionId): void;
2377
- hideSetting(setting: OptionsSettingId): void;
2378
- showSetting(setting: OptionsSettingId): void;
2379
- /** Pin a setting to `value`; `hidden` also removes it from the dialog. */
2380
- lockSetting(setting: OptionsSettingId, value: ViewerOptionPrimitive, hidden?: boolean): void;
2381
- unlockSetting(setting: OptionsSettingId): void;
2382
- /** Set (or with `undefined`, clear) the host default for a setting. */
2383
- setSettingDefault(setting: OptionsSettingId, value: ViewerOptionPrimitive | undefined): void;
2384
- hideBackstagePage(page: BackstagePage): void;
2385
- showBackstagePage(page: BackstagePage): void;
2386
- hideBackstageCard(card: BackstageCardId): void;
2387
- showBackstageCard(card: BackstageCardId): void;
2388
- hideContextMenuCommand(command: ContextMenuCommandId): void;
2389
- showContextMenuCommand(command: ContextMenuCommandId): void;
2390
- hideCanvasContextMenuCommand(command: CanvasContextMenuCommandId): void;
2391
- showCanvasContextMenuCommand(command: CanvasContextMenuCommandId): void;
2392
- disableShortcut(action: EditorKeyActionName): void;
2393
- enableShortcut(action: EditorKeyActionName): void;
2394
- /** Move a command onto new chord(s); `undefined` restores the built-in chord. */
2395
- remapShortcut(action: EditorKeyActionName, chords: ShortcutChord | readonly ShortcutChord[] | undefined): void;
2396
- setPanelVisible(panel: ViewerPanelId, visible: boolean): void;
2397
- setFeatureEnabled(feature: ViewerFeatureId, enabled: boolean): void;
2398
- setDialogAvailable(dialog: ViewerDialogId, available: boolean): void;
2399
- }
2400
- //#endregion
2401
- //#region src/render/ribbon-command-view.d.ts
2402
- /** A host supplies translated labels and controlled state; shared owns markup. */
2403
- interface RibbonCommandView {
2404
- id: RibbonControlId;
2405
- label: string;
2406
- icon: string;
2407
- title?: string;
2408
- disabled?: boolean;
2409
- active?: boolean;
2410
- pressed?: boolean;
2411
- expanded?: boolean;
2412
- hidden?: boolean;
2413
- compact?: boolean;
2414
- /** Opens a menu or panel: draws PowerPoint's drop-down chevron after the label. */
2415
- caret?: boolean;
2416
- badge?: number;
2417
- /** Commands with the same column share a vertical stack. */
2418
- column?: number;
2419
- }
2420
- interface RibbonGroupView {
2421
- id: RibbonGroupId;
2422
- label: string;
2423
- commands: readonly RibbonCommandView[];
2424
- }
2425
- /**
2426
- * A font supplied by the host application. The package never ships fonts:
2427
- * applications provide a licensed URL, data URL, or blob URL for their users.
2428
- */
2429
- interface ViewerFontSource {
2430
- family: string;
2431
- src: string;
2432
- format?: 'truetype' | 'opentype' | 'woff' | 'woff2';
2433
- weight?: string | number;
2434
- style?: 'normal' | 'italic';
2435
- }
2436
- //#endregion
2437
- //#region src/render/presentation-file-kinds.d.ts
2438
- /**
2439
- * presentation-file-kinds: the one place that answers "can the viewer open
2440
- * this file?" and "what should the saved copy be called?".
2441
- *
2442
- * ## Why this is a shared decision and not five allow-lists
2443
- *
2444
- * The loader reads more formats than any single UI advertises. Legacy binary
2445
- * `.ppt` (PowerPoint 97-2003) is the sharp example: `PptxHandler.load()` has
2446
- * detected the OLE compound-file container and converted the binary deck
2447
- * through the regular pptx pipeline for some time, but the product kept saying
2448
- * it was unsupported, and a picker that filters the extension out makes a
2449
- * working loader unreachable in practice. Whenever the loader learns a format,
2450
- * exactly one list has to change.
2451
- *
2452
- * ## Read many, write several
2453
- *
2454
- * Input is a superset of output. We READ `.pptx`, `.ppsx`, `.pptm`, `.potx`,
2455
- * legacy binary `.ppt` and portable `pptx-viewer-json`; we WRITE the OpenXML
2456
- * family plus legacy binary `.ppt` (via `ooxml-core/src/pptx/core/ppt/writer/`,
2457
- * a real MS-PPT/OLE2 encoder, not a stub). `savedPresentationFileName`
2458
- * REPLACES the source extension with the extension of the format actually
2459
- * being written rather than keeping the source's: a deck opened as
2460
- * `report.pptx` and saved back as `.ppt` (or vice versa) must have its name
2461
- * agree with its bytes, which is the kind of mismatch PowerPoint itself
2462
- * refuses to open.
2463
- *
2464
- * This module deliberately imports nothing, so any layer (render, export, a
2465
- * binding, a host app) can depend on it without risking an import cycle.
2466
- *
2467
- * @module render/presentation-file-kinds
2468
- */
2469
- /**
2470
- * Extensions the built-in file picker offers, in the order it offers them.
2471
- *
2472
- * `.ppt` is in the list because the loader genuinely handles it, not as a
2473
- * courtesy: see `ooxml-core/src/pptx/core/ppt/` and the `ppt-import` integration
2474
- * suite, which asserts a `.ppt` loads to the same model as the `.pptx` it was
2475
- * exported from.
2476
- */
2477
- declare const PRESENTATION_OPEN_EXTENSIONS: readonly ['.pptx', '.ppsx', '.pptm', '.potx', '.ppt', '.json'];
2478
- /** Comma-separated `accept` attribute for a presentation file input. */
2479
- declare const PPTX_OPEN_ACCEPT: string;
2480
- /**
2481
- * True when a picked / dropped file's name looks like something the loader can
2482
- * open. Use this instead of a hand-rolled `endsWith` chain: a drop handler that
2483
- * disagrees with the picker's `accept` list is a format that is supported by
2484
- * mouse but not by drag, which is how `.ppt` stayed invisible.
2485
- *
2486
- * Extension-only, by design. The real answer comes from the container sniff in
2487
- * `PptxHandler.load()`; this is only the cheap pre-filter a drop target needs
2488
- * before it hands bytes to the loader.
2489
- */
2490
- declare function isSupportedPresentationFile(name: string | null | undefined): boolean;
2491
- /**
2492
- * True for the binary PowerPoint 97-2003 family. `.ppt` itself is now also a
2493
- * SAVE target (see {@link SavedPresentationFormat}); `.pps`/`.pot` (97-2003
2494
- * show/template) remain read-only siblings sharing the same record format.
2495
- */
2496
- declare function isLegacyBinaryPresentation(name: string | null | undefined): boolean;
2497
- /** The formats the save path can produce. */
2498
- type SavedPresentationFormat = 'pptx' | 'ppsx' | 'pptm' | 'ppt';
2499
- /**
2500
- * The stem of a presentation file name: directories and any loadable extension
2501
- * removed. `C:\decks\report.ppt` becomes `report`; a name with no recognised
2502
- * extension is kept whole, so `Untitled Presentation` survives intact rather
2503
- * than losing everything after its last dot.
2504
- */
2505
- declare function presentationBaseName(sourceName: string | null | undefined, fallback?: string): string;
2506
- /**
2507
- * The name a saved copy should be offered under: the source stem plus the
2508
- * extension of the format actually being written.
2509
- *
2510
- * This is what turns `report.ppt` into `report.pptx` on a regular Save As,
2511
- * and `report.pptx` into `report.ppt` when the user explicitly picks the
2512
- * PowerPoint 97-2003 format. Keeping the source extension would mislabel the
2513
- * bytes either way.
2514
- */
2515
- declare function savedPresentationFileName(sourceName: string | null | undefined, format?: SavedPresentationFormat): string;
2516
- //#endregion
2517
- //#region src/render/presentation-session-types.d.ts
2518
- interface PresentationSnapshot {
2519
- slideIndex: number;
2520
- buildStep: number;
2521
- sequence: number;
2522
- blackout: 'none' | 'black' | 'white';
2523
- paused: boolean;
2524
- elapsedMs: number;
2525
- zoom?: PresentationZoomState;
2526
- pointer?: PresentationPointerState;
2527
- inkStrokes?: PresentationInkStroke[];
2528
- /**
2529
- * Whether ink markup is drawn (PowerPoint's Ctrl+M). Undefined means visible,
2530
- * so existing snapshots keep showing their ink. Hiding never discards the
2531
- * strokes, which stay in `inkStrokes` and can be kept on exit.
2532
- */
2533
- inkMarkupVisible?: boolean;
2534
- caption?: string;
2535
- subtitlesVisible?: boolean;
2536
- }
2537
- interface PresentationZoomState {
2538
- scale: number;
2539
- originX: number;
2540
- originY: number;
2541
- }
2542
- type PresentationPointerTool = 'none' | 'laser' | 'pen' | 'highlighter' | 'eraser';
2543
- interface PresentationPointerState {
2544
- tool: PresentationPointerTool;
2545
- x: number;
2546
- y: number;
2547
- color: string;
2548
- }
2549
- interface PresentationInkPoint {
2550
- x: number;
2551
- y: number;
2552
- }
2553
- interface PresentationInkStroke {
2554
- id: string;
2555
- slideIndex: number;
2556
- tool: 'pen' | 'highlighter';
2557
- color: string;
2558
- width: number;
2559
- points: PresentationInkPoint[];
2560
- }
2561
- //#endregion
2562
- //#region src/render/presentation-blackboard.d.ts
2563
- /** Blackout state, as carried by {@link PresentationSnapshot}. */
2564
- type PresentationBlackout = PresentationSnapshot['blackout'];
2565
- //#endregion
2566
- //#region src/render/chrome-controls-state.d.ts
2567
- type ChromeTranslate = (key: string, params?: Record<string, string | number>) => string;
2568
- type ReadOnlyBannerPasswordError = 'wrong-password' | 'unsupported-algorithm';
2569
- interface ReadOnlyBannerViewState {
2570
- /** `ReadOnlyRecommendation.kind`; mirrored onto the host's `data-kind`. */
2571
- kind: string | null;
2572
- /** `ReadOnlyRecommendation.messageKey`, translated by `translate`. */
2573
- messageKey: string;
2574
- /** Swap the Edit anyway / Dismiss pair for the inline password form. */
2575
- passwordPromptOpen?: boolean;
2576
- passwordError?: ReadOnlyBannerPasswordError | null;
2577
- /** Disables the form while a submitted password is being checked. */
2578
- checkingPassword?: boolean;
2579
- translate?: ChromeTranslate;
2580
- }
2581
- interface PasteOptionsViewState {
2582
- /** Right edge of the pasted element in viewport pixels. */
2583
- left: number;
2584
- /** Bottom edge of the pasted element in viewport pixels. */
2585
- top: number;
2586
- translate?: ChromeTranslate;
2587
- }
2588
- interface CompatToastViewItem {
2589
- readonly id: string;
2590
- readonly code: string;
2591
- readonly severity: 'info' | 'warning';
2592
- readonly messageKey: string;
2593
- readonly params?: Readonly<Record<string, string>>;
2594
- }
2595
- interface CompatToastsViewState {
2596
- /** Dismiss-filtered toasts. The element shows the first {@link COMPAT_TOAST_VISIBLE_LIMIT}. */
2597
- toasts: readonly CompatToastViewItem[];
2598
- /** Extra toasts a host already trimmed off the list it passes. */
2599
- overflowCount?: number;
2600
- /** Width of the open right-docked panel (see `compatToastStackStyle`). */
2601
- rightInset?: number;
2602
- /** Live height of the docked notes strip (see `compatToastStackStyle`). */
2603
- bottomInset?: number;
2604
- translate?: ChromeTranslate;
2605
- }
2606
- type DialogFooterVariant = 'secondary' | 'primary' | 'warning' | 'danger';
2607
- type DialogFooterIcon = 'trash' | 'pen' | 'restore' | 'print' | 'check';
2608
- interface DialogFooterAction {
2609
- /** Stable id echoed back in the `dialog-footer-request` intent. */
2610
- id: string;
2611
- /** Already-translated visible label and accessible name. */
2612
- label: string;
2613
- variant?: DialogFooterVariant;
2614
- icon?: DialogFooterIcon;
2615
- disabled?: boolean;
2616
- /** Work in flight: the button is disabled, `aria-busy` and shows a spinner. */
2617
- busy?: boolean;
2618
- /** Tooltip (`title`) for an action whose label needs a longer hint. */
2619
- title?: string;
2620
- /** `start` pins a tertiary action (Remove link, Reset all) to the left edge. */
2621
- align?: 'start' | 'end';
2622
- /** Optional `data-testid` stamped on the button. */
2623
- testId?: string;
2624
- }
2625
- interface DialogFooterViewState {
2626
- actions: readonly DialogFooterAction[];
2627
- }
2628
- type MobileBarId = 'slides' | 'insert' | 'inspector' | 'comments' | 'notes';
2629
- interface MobileBarViewState {
2630
- /** Every button disables at 0 (see `buildBarActions`). */
2631
- slideCount: number;
2632
- /** The button whose sheet is open; reflected as `aria-pressed` and a top pill. */
2633
- activeSheet?: MobileBarId | null;
2634
- /** Comment count on the badge of Comments (`99+` above 99). */
2635
- commentCount?: number;
2636
- /** Buttons dropped entirely, such as Notes when `hiddenActions` hides it. */
2637
- hidden?: readonly MobileBarId[];
2638
- /** Buttons disabled beyond the no-slides rule, such as edit-only ones in view mode. */
2639
- disabled?: readonly MobileBarId[];
2640
- translate?: ChromeTranslate;
2641
- }
2642
- type MobileToolbarId = 'menu' | 'undo' | 'redo' | 'ai' | 'save' | 'present' | 'share';
2643
- interface MobileToolbarViewState {
2644
- /** Menu, Undo, Redo, AI and Share only show while editing. */
2645
- editable: boolean;
2646
- canUndo: boolean;
2647
- canRedo: boolean;
2648
- /** Host opted into the AI assistant; the element draws its toggle. */
2649
- aiVisible?: boolean;
2650
- aiActive?: boolean;
2651
- /** Reflected as `aria-expanded` on Menu when given. */
2652
- menuOpen?: boolean;
2653
- /** Buttons dropped entirely (`hiddenActions`, or Share when the host has none). */
2654
- hidden?: readonly MobileToolbarId[];
2655
- /** Buttons disabled, such as Present while there is nothing to present. */
2656
- disabled?: readonly MobileToolbarId[];
2657
- translate?: ChromeTranslate;
2658
- }
2659
- interface PresentToolbarViewState {
2660
- /** Zero-based slide on screen. */
2661
- current: number;
2662
- total: number;
2663
- /** The armed annotation tool; `none` leaves every tool unpressed. */
2664
- tool: PresentationPointerTool;
2665
- penColor: string;
2666
- highlighterColor: string;
2667
- hasAnnotations: boolean;
2668
- /** With the pen, marks the Blackboard toggle active (`isBlackboardActive`). */
2669
- blackout: PresentationBlackout;
2670
- /** Show the presenter-view toggle (default false). */
2671
- presenterViewVisible?: boolean;
2672
- presenterViewActive?: boolean;
2673
- /** Epoch ms the show started. The element ticks the readout; null shows 00:00. */
2674
- startTime: number | null;
2675
- translate?: ChromeTranslate;
2676
- }
2677
- interface PresenterConsoleViewState {
2678
- /** Ids of toggles that read as on (and the resume / close-window variants). */
2679
- active: readonly string[];
2680
- /** Ids of controls that are disabled. */
2681
- disabled: readonly string[];
2682
- translate?: ChromeTranslate;
2683
- }
2684
- //#endregion
2685
- //#region src/render/insert-chart.d.ts
2686
- /**
2687
- * Dropdown ids for the insert-chart menu. Distinct from `PptxChartType`
2688
- * because PowerPoint offers Column (vertical) and Bar (horizontal) as two
2689
- * entries over the same underlying `'bar'` chart type, and because `'pareto'`
2690
- * has no `PptxChartType` of its own: it is a dropdown entry that resolves to
2691
- * `type: 'histogram'` (see docs/guide/limitations.md's ChartEx row) with a
2692
- * frequency-plus-cumulative-percentage default shape. The other six ChartEx
2693
- * ids (`histogram` through `regionMap`) map one-to-one onto their chart type.
2694
- */
2695
- type InsertChartKind = 'column' | 'bar' | 'line' | 'pie' | 'doughnut' | 'area' | 'scatter' | 'histogram' | 'pareto' | 'funnel' | 'treemap' | 'sunburst' | 'boxWhisker' | 'regionMap';
2696
- /** In-memory clipboard payload stored when an element is copied or cut. */
2697
- interface ElementClipboardPayload {
2698
- element: PptxElement;
2699
- isTemplate: boolean;
2700
- }
2701
- //#endregion
2702
- //#region src/render/image-file-insertion.d.ts
2703
- /**
2704
- * Decode a local image File/Blob into a centred element, fitting the slide
2705
- * without upscaling. Dimensions are slide pixels; image bytes are preserved.
2706
- *
2707
- * Resolves null for unsupported/unreadable images, invalid bounds, cancellation,
2708
- * or unavailable browser APIs. Importing this module is safe outside a browser.
2709
- * No slide, selection, history, clipboard, or network state is changed. The
2710
- * caller must still validate its document/slide destination before committing.
2711
- */
2712
- declare function createImageElementFromFile(file: Blob, canvasSize: CanvasSize$1, signal?: AbortSignal): Promise<ImagePptxElement | null>;
2713
- //#endregion
2714
- //#region src/render/editor-image-paste.d.ts
2715
- /** A currently editable slide. Return null while loading or outside canvas editing. */
2716
- interface EditorImagePasteTarget {
2717
- documentId: object;
2718
- slideId: string;
2719
- canvasSize: CanvasSize$1;
2720
- }
2721
- interface EditorImagePasteOptions {
2722
- getCanvas(): HTMLElement | null;
2723
- getTarget(): EditorImagePasteTarget | null;
2724
- /** Use the normal editor command so selection, dirty state and Undo stay consistent. */
2725
- insertElement(element: ImagePptxElement): void;
2726
- }
2727
- /** One placeholder outline, already positioned in unscaled slide space. */
2728
- interface LayoutPreviewFrame {
2729
- /** Stable key for list rendering. */
2730
- key: string;
2731
- type: string;
2732
- left: number;
2733
- top: number;
2734
- width: number;
2735
- height: number;
2736
- }
2737
- /** Everything a binding needs to render one thumbnail. */
2738
- interface LayoutPreviewGeometry {
2739
- /** Outer box, in CSS pixels. */
2740
- boxWidth: number;
2741
- boxHeight: number;
2742
- /** Inner surface size, in unscaled slide pixels. */
2743
- surfaceWidth: number;
2744
- surfaceHeight: number;
2745
- /** Factor to apply as `transform: scale(...)` on the inner surface. */
2746
- scale: number;
2747
- backgroundColor: string;
2748
- /**
2749
- * Border width for placeholder outlines, pre-divided by {@link scale}.
2750
- *
2751
- * The outlines live inside the scaled surface, so a plain 1.5px border
2752
- * would be multiplied down to a hairline that vanishes at thumbnail size.
2753
- * Dividing here keeps the drawn width constant on screen whatever the
2754
- * slide dimensions are.
2755
- */
2756
- frameBorderWidth: number;
2757
- frames: LayoutPreviewFrame[];
2758
- }
2759
- //#endregion
2760
- //#region src/render/zoom-return-navigation.d.ts
2761
- /**
2762
- * The navigation-relevant fields of a Zoom click target, independent of
2763
- * `zoomType`.
2764
- *
2765
- * `returnToParent` is already resolved to its EFFECTIVE value here (not the
2766
- * raw, possibly-`undefined` `ZoomPptxElement`/`SummaryZoomTarget` field):
2767
- * `CT_ZoomObjectProperties/@returnToParent` (MS-PPTX) is `<xsd:attribute
2768
- * name="returnToParent" type="xsd:boolean" use="optional" default="true"/>`,
2769
- * so an ABSENT attribute means true, not false. Core deliberately stores
2770
- * `undefined` rather than fabricating `true` (so a round-trip never invents
2771
- * an attribute the source never had), which makes `Boolean(x)` the wrong way
2772
- * to read it; the two `resolve*NavigationTarget` functions below are the only
2773
- * place that distinction should be made.
2774
- */
2775
- interface ZoomNavigationTarget {
2776
- targetSlideIndex: number;
2777
- targetSectionId?: string;
2778
- returnToParent: boolean;
2779
- transitionDurationMs?: number;
2780
- }
2781
- //#endregion
2782
- //#region src/render/command-search.d.ts
2783
- /**
2784
- * Command-search data for the PowerPoint-style "Tell me what you want to do"
2785
- * search bar. Provides searchable command entries grouped by category, each
2786
- * mapping a label translation key to a command identifier that bindings can
2787
- * dispatch.
2788
- */
2789
- interface CommandSearchEntry {
2790
- /** Translation key for the display label. */
2791
- labelKey: string;
2792
- /** Command identifier dispatched to the host binding. */
2793
- command: string;
2794
- /** Optional icon hint (binding resolves to framework icon component). */
2795
- icon?: string;
2796
- /** Category grouping key; hosts with their own short list may omit it. */
2797
- category?: 'format' | 'insert' | 'view' | 'slideShow' | 'design' | 'arrange';
2798
- }
2799
- interface SubtitleSettings {
2800
- spokenLanguage: string;
2801
- }
2802
- interface SubtitleSettingsLabels {
2803
- title: string;
2804
- language: string;
2805
- browserLanguage: string;
2806
- description: string;
2807
- apply: string;
2808
- cancel: string;
2809
- }
2810
- //#endregion
2811
- //#region src/render/account.d.ts
2812
- /** Local-only display profile shown in File > Account. Never sent anywhere; purely cosmetic. */
2813
- interface ViewerProfile {
2814
- displayName: string;
2815
- /** CSS color for the avatar bubble background, e.g. `'#c2431f'`. */
2816
- avatarColor: string;
2817
- /** Single character shown in the avatar bubble. Derived from `displayName` when omitted. */
2818
- initial?: string;
2819
- }
2820
- declare const DEFAULT_VIEWER_PROFILE: ViewerProfile;
2821
- /** Suggested avatar color swatches for the Account profile editor. */
2822
- declare const AVATAR_COLOR_SWATCHES: readonly string[];
2823
- /** Derive the avatar-bubble initial from a profile, falling back to `'?'` for an empty name. */
2824
- declare function resolveProfileInitial(profile: ViewerProfile): string;
2825
- /**
2826
- * Optional hook point for hosts that want to wire a real sign-in flow into
2827
- * File > Account. Disabled by default: the Account page renders nothing
2828
- * extra unless a host explicitly opts in by passing `enabled: true`.
2829
- * See docs/guide for wiring instructions.
2830
- */
2831
- interface AccountAuthConfig {
2832
- enabled: boolean;
2833
- onSignIn: () => void;
2834
- signedInUser?: {
2835
- name: string;
2836
- email?: string;
2837
- avatarUrl?: string;
2838
- };
2839
- }
2840
- interface LocalStorageUsageSummary {
2841
- /** Number of presentations with a local autosave/recovery snapshot. */
2842
- presentationCount: number;
2843
- /** Total bytes across every stored snapshot. */
2844
- totalBytes: number;
2845
- }
2846
- /** Summarize local (IndexedDB) storage usage for the Account > Storage & Privacy panel. */
2847
- declare function getLocalStorageUsageSummary(): Promise<LocalStorageUsageSummary>;
2848
- /**
2849
- * Delete every locally stored presentation/recovery snapshot and persisted
2850
- * viewer preference (theme/locale/profile). Irreversible; callers should
2851
- * confirm with the user before invoking this.
2852
- */
2853
- declare function clearAllLocalViewerData(): Promise<void>;
2854
- /** Persist an updated profile via the shared viewer-prefs store. */
2855
- declare function saveViewerProfile(profile: ViewerProfile): void;
2856
- //#endregion
2857
- //#region src/render/viewer-prefs-storage.d.ts
2858
- /**
2859
- * `localStorage`-backed viewer chrome preferences (theme/locale/profile),
2860
- * shared by every binding.
2861
- *
2862
- * This is the persistence layer behind File > Options' Appearance/Language
2863
- * tabs and File > Account's profile editor when a host doesn't supply its
2864
- * own `onThemeChange`/`onLocaleChange`/`onProfileChange` callbacks - i.e. the
2865
- * "standalone" fallback path. Hosts that do wire those callbacks own
2866
- * persistence themselves and this module is never touched.
2867
- */
2868
- declare const VIEWER_PREFS_STORAGE_KEY = "pptx-viewer-prefs";
2869
- interface StoredViewerPrefs {
2870
- /** Key into the shared `THEME_CATALOG` (or a host-supplied `availableThemes` catalog). */
2871
- themeKey?: string;
2872
- /** Locale code, e.g. `'fr'`. */
2873
- localeCode?: string;
2874
- /** Local-only display profile shown in File > Account. */
2875
- profile?: ViewerProfile;
2876
- /** Sparse File > Options diff against `DEFAULT_VIEWER_OPTIONS`. */
2877
- options?: StoredViewerOptions;
2878
- }
2879
- /** Read all persisted viewer preferences. Returns `{}` when unavailable, unset, or corrupt. */
2880
- declare function readStoredViewerPrefs(): StoredViewerPrefs;
2881
- /** Merge `patch` into the persisted viewer preferences. Silently no-ops when storage is unavailable. */
2882
- declare function writeStoredViewerPrefs(patch: Partial<StoredViewerPrefs>): void;
2883
- /** Remove all persisted viewer preferences. Silently no-ops when storage is unavailable. */
2884
- declare function clearStoredViewerPrefs(): void;
2885
- //#endregion
2886
- //#region src/render/ribbon-galleries/gallery-types.d.ts
2887
- /** Every gallery the ribbon offers. */
2888
- 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';
2889
- /** One tile. */
2890
- interface RibbonGalleryItem {
2891
- /** Stable within its gallery; what `applyRibbonGalleryItem` takes. */
2892
- id: string;
2893
- /** i18n key of the tile's accessible name / tooltip. */
2894
- labelKey: string;
2895
- /** `{{name}}` interpolation values for `labelKey`. */
2896
- labelParams?: Readonly<Record<string, string | number>>;
2897
- /** English fallback for bindings whose dictionary lacks `labelKey`. */
2898
- label: string;
2899
- /**
2900
- * A complete, self-contained `<svg>` element (width/height/viewBox set).
2901
- * Built only from catalogue data and theme colours, never from user text,
2902
- * so it is safe to inject as markup.
2903
- */
2904
- previewSvg: string;
2905
- /**
2906
- * CSS `filter` the tile's preview carries (the Picture Adjust galleries),
2907
- * for a host that draws the thumbnail over a real image instead of
2908
- * `previewSvg`. Omitted when the preset has no CSS-expressible preview.
2909
- */
2910
- previewFilter?: string;
2911
- /** True when this entry is what the selection currently carries. */
2912
- applied: boolean;
2913
- }
2914
- /** A titled block of tiles (PowerPoint's "Theme Styles" / "Presets"). */
2915
- interface RibbonGallerySection {
2916
- id: string;
2917
- /** i18n key of the section heading; omitted for an untitled section. */
2918
- titleKey?: string;
2919
- title?: string;
2920
- /** Tiles per row in the dropped-down grid. */
2921
- columns: number;
2922
- /** Preview tile size in CSS px (the SVG's own width/height). */
2923
- tileWidth: number;
2924
- tileHeight: number;
2925
- items: RibbonGalleryItem[];
2926
- }
2927
- interface RibbonGalleryDescriptor {
2928
- id: RibbonGalleryId;
2929
- /** i18n key of the gallery trigger / group caption. */
2930
- labelKey: string;
2931
- label: string;
2932
- sections: RibbonGallerySection[];
2933
- /** True when the selection cannot take this gallery (trigger disabled). */
2934
- disabled: boolean;
2935
- /**
2936
- * Set when the entry is a one-button command (PowerPoint's Add Shape, Reset
2937
- * Graphic, ...) rather than a gallery: the element draws a plain command, a
2938
- * click picks its only item and no panel opens.
2939
- */
2940
- command?: RibbonGalleryCommandView;
2941
- }
2942
- /** How a command-style entry draws (see {@link RibbonGalleryDescriptor.command}). */
2943
- interface RibbonGalleryCommandView {
2944
- /** SVG path data on a 20px grid. */
2945
- iconPath: string;
2946
- /** Icon above the label (PowerPoint's large button) instead of beside it. */
2947
- large?: boolean;
2948
- /** i18n key and English fallback of the tooltip, e.g. why the command is unavailable. */
2949
- hintKey?: string;
2950
- hint?: string;
2951
- }
2952
- //#endregion
2953
- //#region src/render/viewport-fit.d.ts
2954
- /** Unscaled CSS pixels reserved on each side of the ordinary viewer viewport. */
2955
- type ViewportFitPadding = number | {
2956
- horizontal: number;
2957
- vertical: number;
2958
- };
2959
- /** Host layout policy, independent of authored slide dimensions and user zoom. */
2960
- interface ViewportFitOptions {
2961
- /** Per-side padding. Omission keeps the binding's existing decorative allowance. */
2962
- fitPadding?: ViewportFitPadding;
2963
- /** Positive fit-factor ceiling; null allows enlargement without a ceiling. */
2964
- maxFitScale?: number | null;
2965
- }
2966
- /** The element fields an Edit Points commit writes. */
2967
- type EditPointsElementPatch = Pick<ShapePptxElement, 'x' | 'y' | 'width' | 'height' | 'shapeType' | 'shapeAdjustments' | 'pathData' | 'pathWidth' | 'pathHeight' | 'customGeometryPaths' | 'customGeometryRawData' | 'customGeometryAdjustHandlesXY' | 'customGeometryAdjustHandlesPolar' | 'customGeometryConnectionSites' | 'customGeometryTextRect'>;
2968
- type ThemeEditorLabels = Record<string, string>;
2969
- /**
2970
- * Controlled Animations tab state. Hosts own the slide model, selection,
2971
- * history and the inspector; the view only reflects these values.
2972
- */
2973
- interface RibbonAnimationsViewState {
2974
- /** False in read-only hosts: every authoring intent is rejected. */
2975
- editable: boolean;
2976
- /** Whether an element is selected; effects always target one element. */
2977
- hasSelection: boolean;
2978
- /** Whether the Animation Pane (inspector) is open; reflected as pressed. */
2979
- paneOpen?: boolean;
2980
- /** Transient highlight while a host's Preview is playing, where it tracks one. */
2981
- previewActive?: boolean;
2982
- translate?: (key: string) => string;
2983
- }
2984
- //#endregion
2985
- //#region src/render/ribbon-draw-state.d.ts
2986
- type RibbonDrawTool = 'select' | 'pen' | 'highlighter' | 'eraser' | 'freeform';
2987
- interface RibbonDrawViewState {
2988
- tool: RibbonDrawTool;
2989
- color: string;
2990
- width: number;
2991
- editable: boolean;
2992
- recentColors?: readonly string[];
2993
- translate?: (key: string) => string;
2994
- }
2995
- /**
2996
- * Controlled Insert tab state. Native viewers own the selections, every document
2997
- * mutation, the file/shape/SmartArt/equation/hyperlink dialogs and history.
2998
- */
2999
- interface RibbonInsertState {
3000
- editable: boolean;
3001
- /** A hyperlink always attaches to something, so Link tracks the selection. */
3002
- hasSelection: boolean;
3003
- /** The shape preset staged in the Shape picker. */
3004
- shapeType: string;
3005
- /** The chart entry staged in the Chart picker. */
3006
- chartKind: string;
3007
- /** The armed Freeform: Shape / Curve tool. */
3008
- activeFreeformTool?: string | null;
3009
- /** Visible Freeform tools; empty hides the buttons (host customization). */
3010
- freeformTools?: readonly string[];
3011
- /** Hosts without these capabilities hide the control instead of showing a dead one. */
3012
- chartAvailable?: boolean;
3013
- fieldAvailable?: boolean;
3014
- headerFooterAvailable?: boolean;
3015
- translate?: (key: string) => string;
3016
- }
3017
- /** One row of a menu or select; labels are translated by the view unless `label` is set. */
3018
- interface RibbonHomeItem {
3019
- readonly value: string;
3020
- /** Ready-made text (a font family, a layout name); wins over `labelKey`. */
3021
- readonly label?: string;
3022
- readonly labelKey?: string;
3023
- readonly fallback?: string;
3024
- readonly description?: string;
3025
- readonly descriptionKey?: string;
3026
- /** Heading of the group this row opens; consecutive rows share one heading. */
3027
- readonly group?: string;
3028
- readonly groupKey?: string;
3029
- readonly checked?: boolean;
3030
- readonly disabled?: boolean;
3031
- /** Preview typeface of a font row. */
3032
- readonly fontFamily?: string;
3033
- /** Shared artwork key shown before the label (a shape glyph or ribbon icon). */
3034
- readonly icon?: string;
3035
- /** Preserved test or automation hooks (`data-pptx-merge-op`, ...). */
3036
- readonly attrs?: Readonly<Record<string, string>>;
3037
- /** Draws a divider above the row. */
3038
- readonly separator?: boolean;
3039
- }
3040
- interface RibbonHomeControlState {
3041
- disabled?: boolean;
3042
- /** Omit for ordinary commands; a boolean reflects `aria-pressed`. */
3043
- pressed?: boolean;
3044
- /** Reserved for hosts that mirror their own popover; shared popovers set it themselves. */
3045
- expanded?: boolean;
3046
- hidden?: boolean;
3047
- /** Select, number, colour bar and checked menu row. */
3048
- value?: string | number;
3049
- /** Menu or select rows that replace the spec's static ones. */
3050
- items?: readonly RibbonHomeItem[];
3051
- /** Colour popover content; the trigger shows `value` in its bar. */
3052
- colour?: RibbonHomeColourModel;
3053
- /** Layout gallery content. */
3054
- layouts?: RibbonHomeLayoutModel;
3055
- /** Embedded gallery content. */
3056
- gallery?: {
3057
- descriptor: RibbonGalleryDescriptor | undefined;
3058
- disabled?: boolean;
3059
- };
3060
- }
3061
- interface RibbonHomeColourModel {
3062
- /** The deck's theme colour map; the popover derives the theme palette from it. */
3063
- themeColors?: Readonly<Record<string, string>>;
3064
- /** Theme reference of the current colour (highlights its swatch). */
3065
- selectedRef?: PptxThemeColorRef;
3066
- /** Recently used colours, newest first. */
3067
- recent?: readonly string[];
3068
- }
3069
- interface RibbonHomeLayoutModel {
3070
- layouts: readonly {
3071
- path: string;
3072
- name: string;
3073
- }[];
3074
- /** Marks the active tile; omitted by New Slide. */
3075
- current?: string;
3076
- /** Artwork data by layout path; tiles render name-only until it arrives. */
3077
- previews?: Readonly<Record<string, PptxLayoutPreview>> | ReadonlyMap<string, PptxLayoutPreview>;
3078
- }
3079
- /** State key of a control: its id, or `id#part` when several buttons share one id. */
3080
- type RibbonHomeKey = RibbonControlId | `${RibbonControlId}#${string}`;
3081
- interface RibbonHomeViewState {
3082
- /** Missing entries are enabled, unpressed and visible. */
3083
- controls: Readonly<Partial<Record<RibbonHomeKey, RibbonHomeControlState>>>;
3084
- translate?: (key: string) => string;
3085
- }
3086
- /** Controlled View tab state. Native viewers own the values and every side effect. */
3087
- interface RibbonViewState {
3088
- editable: boolean;
3089
- showRulers: boolean;
3090
- showGrid: boolean;
3091
- showGuides: boolean;
3092
- snapToGrid: boolean;
3093
- snapToShape: boolean;
3094
- templateEditing: boolean;
3095
- selectionPaneOpen?: boolean;
3096
- eyedropperActive?: boolean;
3097
- /** Hosts without these capabilities hide the control instead of showing a dead one. */
3098
- selectionPaneAvailable?: boolean;
3099
- eyedropperAvailable?: boolean;
3100
- zoomAvailable?: boolean;
3101
- translate?: (key: string) => string;
3102
- }
3103
- //#endregion
3104
- //#region src/render/ribbon-transitions-state.d.ts
3105
- type RibbonTransitionsTranslate = (key: string, params?: Record<string, string>) => string;
3106
- /** Controlled Transitions tab state. The host derives it from the ACTIVE slide. */
3107
- interface RibbonTransitionsViewState {
3108
- draft: RibbonTransitionDraft;
3109
- /** The slide's transition, used only to list and select the Sound entries. */
3110
- transition?: PptxSlideTransition;
3111
- editable: boolean;
3112
- inspectorOpen?: boolean;
3113
- translate?: RibbonTransitionsTranslate;
3114
- }
3115
- //#endregion
3116
- //#region src/render/status-bar-state.d.ts
3117
- /**
3118
- * Shared model for the bottom status bar (`pptx-ui-status-bar`).
3119
- *
3120
- * The slide counter, save indicator, notes toggle, view-mode buttons and zoom
3121
- * cluster were hand-built five times. The view owns the markup, pressed state
3122
- * and gating; hosts own every effect (notes panel, view switching, zoom).
3123
- */
3124
- type StatusBarTranslate = (key: string, params?: Record<string, string | number>) => string;
3125
- type StatusBarSaveKind = 'idle' | 'saving' | 'error';
3126
- type StatusBarViewMode = 'normal' | 'sorter' | 'slideShow';
3127
- interface StatusBarViewState {
3128
- slideCount: number;
3129
- /** Zero-based active slide; clamped into range for display. */
3130
- activeSlideIndex: number;
3131
- /** Already-translated save indicator, see {@link resolveStatusBarSave}. */
3132
- saveText: string;
3133
- saveKind?: StatusBarSaveKind;
3134
- /** Omit to hide the whole zoom cluster. */
3135
- zoomPercent?: number;
3136
- showNotes?: boolean;
3137
- notesExpanded?: boolean;
3138
- /** Default true. False drops the Normal / Sorter / Slide Show cluster. */
3139
- showViewModes?: boolean;
3140
- /** Default true. */
3141
- showSorter?: boolean;
3142
- /** Default true. */
3143
- showSlideShow?: boolean;
3144
- /** The pressed view button; omit when none is active. */
3145
- viewMode?: StatusBarViewMode;
3146
- translate?: StatusBarTranslate;
3147
- }
3148
- //#endregion
3149
- //#region src/render/notes-toolbar-state.d.ts
3150
- /**
3151
- * Shared model for the speaker-notes formatting toolbar (`pptx-ui-notes-toolbar`).
3152
- *
3153
- * The toolbar owns the buttons, their order, icons, labels, enabled state and
3154
- * the hyperlink popover. Hosts own the contenteditable editor, selection-based
3155
- * edits, history, printing and persistence, and route typed intents to them.
3156
- */
3157
- type NotesToolbarTranslate = (key: string, params?: Record<string, string | number>) => string;
3158
- interface NotesToolbarViewState {
3159
- /** True while the rich (contenteditable) surface is active. Drives the mode button label. */
3160
- rich: boolean;
3161
- /** Enables the formatting buttons. False in the plain editor, where they cannot act. */
3162
- canFormat: boolean;
3163
- /** Shows the Print button. */
3164
- showPrint: boolean;
3165
- /** Disables every button, for example while no slide is selected. */
3166
- disabled?: boolean;
3167
- /** Host translator; keys are the canonical `pptx.notes.*` set. Omitted: keys are shown. */
3168
- translate?: NotesToolbarTranslate;
3169
- }
3170
- //#endregion
3171
- //#region src/render/title-bar-state.d.ts
3172
- type TitleBarTranslate = (key: string, params?: Record<string, string | number>) => string;
3173
- type TitleBarPlacement = 'titleBar' | 'belowRibbon';
3174
- type TitleBarTone = 'idle' | 'saving' | 'error';
3175
- interface TitleBarAutosaveView {
3176
- enabled: boolean;
3177
- /** Default true. False renders the switch inert (host policy `autosave: false`). */
3178
- toggleAvailable?: boolean;
3179
- /** Translation key from `resolveTitleBarStatusKey`. */
3180
- statusKey: string;
3181
- /** Colour of the status text; only meaningful while `enabled`. */
3182
- tone?: TitleBarTone;
3183
- }
3184
- interface TitleBarHistoryState {
3185
- canUndo: boolean;
3186
- canRedo: boolean;
3187
- /** Description of the pending action, e.g. "Delete shape". */
3188
- undoLabel?: string | null;
3189
- redoLabel?: string | null;
3190
- /** Default true. Maps to `hiddenActions: ['undo']`. */
3191
- showUndo?: boolean;
3192
- /** Default true. Maps to `hiddenActions: ['redo']`. */
3193
- showRedo?: boolean;
3194
- }
3195
- interface TitleBarQuickAccessView {
3196
- visible: boolean;
3197
- position: QuickAccessPosition;
3198
- showCommandLabels: boolean;
3199
- /** Ordered catalog ids (File > Options > Quick Access Toolbar). */
3200
- commandIds: readonly string[];
3201
- }
3202
- interface TitleBarViewState {
3203
- /** Edit mode with an editable deck. Gates AutoSave, the strip, status and search. */
3204
- editing: boolean;
3205
- /** Whether the command search shows; hosts pass `editing`. */
3206
- searchVisible: boolean;
3207
- /** Display name; the translated default shows when empty. */
3208
- fileName?: string;
3209
- autosave: TitleBarAutosaveView;
3210
- history: TitleBarHistoryState;
3211
- /** Default true. */
3212
- showSave?: boolean;
3213
- quickAccess: TitleBarQuickAccessView;
3214
- /** Search catalogue; defaults to the shared `COMMAND_SEARCH_ENTRIES`. */
3215
- commands?: readonly CommandSearchEntry[];
3216
- /** Default true. False drops the "Find in Slides" fallback row. */
3217
- contentSearch?: boolean;
3218
- /** ScreenTip rule (Options > General); returning undefined suppresses the title. */
3219
- screenTip?: (label: string) => string | undefined;
3220
- translate?: TitleBarTranslate;
3221
- }
3222
- //#endregion
3223
- //#region src/web-components/theme-editor.d.ts
3224
- interface PptxUiThemeEditorElement extends HTMLElement {
3225
- theme: PptxTheme | undefined;
3226
- labels: ThemeEditorLabels;
3227
- disabled: boolean;
3228
- }
3229
- declare global {
3230
- interface HTMLElementTagNameMap {
3231
- 'pptx-ui-theme-editor': PptxUiThemeEditorElement;
3232
- }
3233
- }
3234
- /** One row of a context menu. Hosts decide `id`, wording, gating and what activation does. */
3235
- interface ContextMenuViewItem {
3236
- /** Stable command id, echoed by `menu-request`. */
3237
- id: string;
3238
- /** Already-translated visible label. */
3239
- label: string;
3240
- /** Draw a rule before this row. */
3241
- separatorBefore?: boolean;
3242
- /** Group heading shown before this row; the row and the ones after it join that group. */
3243
- heading?: string;
3244
- /** Destructive command (Delete): tinted. */
3245
- danger?: boolean;
3246
- /** Offered but unavailable: announced and drawn dim, skipped by arrow keys. */
3247
- disabled?: boolean;
3248
- /** A toggle (Grid and Guides, Ruler) in this state; omitted for one-shot commands. */
3249
- checked?: boolean;
3250
- }
3251
- /** Everything the controlled element needs to draw one menu. */
3252
- interface ContextMenuViewState {
3253
- /** Pointer position, in viewport pixels. The element clamps it into the window. */
3254
- x: number;
3255
- y: number;
3256
- /** Accessible name of the menu. */
3257
- label: string;
3258
- items: readonly ContextMenuViewItem[];
3259
- /**
3260
- * Test-hook attributes copied onto the host element (`data-pptx-context-menu`,
3261
- * `data-pptx-canvas-context-menu`, ...). Only `data-pptx-*` names are accepted.
3262
- */
3263
- markers?: readonly string[];
3264
- /** Stacking order; defaults to {@link CONTEXT_MENU_EDITOR_LAYER}. */
3265
- zIndex?: number;
3266
- /** Move focus onto the first command on open. Default true. */
3267
- autoFocus?: boolean;
3268
- }
3269
- interface PptxUiCompatToastsElement extends HTMLElement {
3270
- state: CompatToastsViewState;
3271
- }
3272
- interface PptxUiDialogFooterElement extends HTMLElement {
3273
- state: DialogFooterViewState;
3274
- /** Move keyboard focus to an action, e.g. the primary one when a dialog opens. */
3275
- focusAction(id: string): void;
3276
- }
3277
- interface PptxUiPasteOptionsElement extends HTMLElement {
3278
- state: PasteOptionsViewState;
3279
- }
3280
- interface PptxUiReadOnlyBannerElement extends HTMLElement {
3281
- state: ReadOnlyBannerViewState;
3282
- }
3283
- interface PptxUiContextMenuElement extends HTMLElement {
3284
- state: ContextMenuViewState;
3285
- }
3286
- declare global {
3287
- interface HTMLElementTagNameMap {
3288
- 'pptx-ui-compat-toasts': PptxUiCompatToastsElement;
3289
- 'pptx-ui-context-menu': PptxUiContextMenuElement;
3290
- 'pptx-ui-dialog-footer': PptxUiDialogFooterElement;
3291
- 'pptx-ui-paste-options': PptxUiPasteOptionsElement;
3292
- 'pptx-ui-read-only-banner': PptxUiReadOnlyBannerElement;
3293
- }
3294
- }
3295
- interface PptxUiMobileBarElement extends HTMLElement {
3296
- state: MobileBarViewState;
3297
- }
3298
- declare global {
3299
- interface HTMLElementTagNameMap {
3300
- 'pptx-ui-mobile-bar': PptxUiMobileBarElement;
3301
- }
3302
- }
3303
- interface PptxUiMobileToolbarElement extends HTMLElement {
3304
- state: MobileToolbarViewState;
3305
- }
3306
- declare global {
3307
- interface HTMLElementTagNameMap {
3308
- 'pptx-ui-mobile-toolbar': PptxUiMobileToolbarElement;
3309
- }
3310
- }
3311
- interface PptxUiPresentToolbarElement extends HTMLElement {
3312
- state: PresentToolbarViewState;
3313
- /** Close an open colour palette, e.g. when the host auto-hides the bar. */
3314
- closePalettes(): void;
3315
- }
3316
- declare global {
3317
- interface HTMLElementTagNameMap {
3318
- 'pptx-ui-present-toolbar': PptxUiPresentToolbarElement;
3319
- }
3320
- }
3321
- interface PptxUiPresenterConsoleElement extends HTMLElement {
3322
- state: PresenterConsoleViewState;
3323
- }
3324
- declare global {
3325
- interface HTMLElementTagNameMap {
3326
- 'pptx-ui-presenter-console': PptxUiPresenterConsoleElement;
3327
- }
3328
- }
3329
- interface PptxUiRibbonAnimationsElement extends HTMLElement {
3330
- state: RibbonAnimationsViewState;
3331
- }
3332
- declare global {
3333
- interface HTMLElementTagNameMap {
3334
- 'pptx-ui-ribbon-animations': PptxUiRibbonAnimationsElement;
3335
- }
3336
- }
3337
- interface PptxUiRibbonDrawElement extends HTMLElement {
3338
- state: RibbonDrawViewState;
3339
- }
3340
- declare global {
3341
- interface HTMLElementTagNameMap {
3342
- 'pptx-ui-ribbon-draw': PptxUiRibbonDrawElement;
3343
- }
3344
- }
3345
- //#endregion
3346
- //#region src/web-components/ribbon-home-layout.d.ts
3347
- /**
3348
- * Draws a layout's real artwork inside a tile's scaled surface. The artwork is
3349
- * element rendering that each binding owns; return a disposer to release it.
3350
- */
3351
- type HomeLayoutArtwork = (preview: PptxLayoutPreview, geometry: LayoutPreviewGeometry, container: HTMLElement) => (() => void) | void;
3352
- interface PptxUiRibbonHomeElement extends HTMLElement {
3353
- state: RibbonHomeViewState;
3354
- /** Draws a layout's real artwork inside a gallery tile; the host owns element rendering. */
3355
- layoutArtwork: HomeLayoutArtwork | undefined;
3356
- /** Wrapper (or button) of a control id. */
3357
- anchor(id: string): HTMLElement | undefined;
3358
- }
3359
- declare global {
3360
- interface HTMLElementTagNameMap {
3361
- 'pptx-ui-ribbon-home-clipboard': PptxUiRibbonHomeElement;
3362
- 'pptx-ui-ribbon-home-font': PptxUiRibbonHomeElement;
3363
- 'pptx-ui-ribbon-home-paragraph': PptxUiRibbonHomeElement;
3364
- 'pptx-ui-ribbon-home-editing': PptxUiRibbonHomeElement;
3365
- 'pptx-ui-ribbon-home-slides': PptxUiRibbonHomeElement;
3366
- 'pptx-ui-ribbon-home-drawing': PptxUiRibbonHomeElement;
3367
- 'pptx-ui-ribbon-home-arrange-align': PptxUiRibbonHomeElement;
3368
- 'pptx-ui-ribbon-home-arrange-flip': PptxUiRibbonHomeElement;
3369
- 'pptx-ui-ribbon-home-arrange-order': PptxUiRibbonHomeElement;
3370
- 'pptx-ui-ribbon-home-arrange-edit': PptxUiRibbonHomeElement;
3371
- 'pptx-ui-ribbon-home-font-picker': PptxUiRibbonHomeElement;
3372
- 'pptx-ui-ribbon-home-arrange-painter': PptxUiRibbonHomeElement;
3373
- 'pptx-ui-ribbon-home-arrange-shape': PptxUiRibbonHomeElement;
3374
- }
3375
- }
3376
- interface PptxUiRibbonTransitionsElement extends HTMLElement {
3377
- state: RibbonTransitionsViewState;
3378
- }
3379
- declare global {
3380
- interface HTMLElementTagNameMap {
3381
- 'pptx-ui-ribbon-transitions': PptxUiRibbonTransitionsElement;
3382
- }
3383
- }
3384
- interface PptxUiRibbonInsertElement extends HTMLElement {
3385
- state: RibbonInsertState;
3386
- /** Return focus to a control by its public id, e.g. after a native dialog closes. */
3387
- focusControl(id: string): void;
3388
- }
3389
- declare global {
3390
- interface HTMLElementTagNameMap {
3391
- 'pptx-ui-ribbon-insert': PptxUiRibbonInsertElement;
3392
- }
3393
- }
3394
- interface PptxUiRibbonViewElement extends HTMLElement {
3395
- state: RibbonViewState;
3396
- }
3397
- declare global {
3398
- interface HTMLElementTagNameMap {
3399
- 'pptx-ui-ribbon-view': PptxUiRibbonViewElement;
3400
- }
3401
- }
3402
- //#endregion
3403
- //#region src/web-components/ribbon-section.d.ts
3404
- interface PptxUiRibbonSectionElement extends HTMLElement {
3405
- groups: readonly RibbonGroupView[];
3406
- }
3407
- declare global {
3408
- interface HTMLElementTagNameMap {
3409
- 'pptx-ui-ribbon-section': PptxUiRibbonSectionElement;
3410
- }
3411
- }
3412
- //#endregion
3413
- //#region src/web-components/ribbon-gallery.d.ts
3414
- type GalleryTranslate = (key: string, params?: Readonly<Record<string, string | number>>) => string;
3415
- interface PptxUiRibbonGalleryElement extends HTMLElement {
3416
- readonly trigger: HTMLButtonElement;
3417
- readonly popup: HTMLElement;
3418
- descriptor: RibbonGalleryDescriptor | undefined;
3419
- translateLabel: GalleryTranslate;
3420
- disabled: boolean;
3421
- open: boolean;
3422
- close(): void;
3423
- }
3424
- declare global {
3425
- interface HTMLElementTagNameMap {
3426
- 'pptx-ui-ribbon-gallery': PptxUiRibbonGalleryElement;
3427
- }
3428
- }
3429
- //#endregion
3430
- //#region src/web-components/subtitle-settings.d.ts
3431
- interface PptxUiSubtitleSettingsElement extends HTMLElement {
3432
- settings: SubtitleSettings;
3433
- labels: SubtitleSettingsLabels;
3434
- languageDisabled: boolean;
3435
- }
3436
- declare global {
3437
- interface HTMLElementTagNameMap {
3438
- 'pptx-ui-subtitle-settings': PptxUiSubtitleSettingsElement;
3439
- }
3440
- }
3441
- interface PptxUiStatusBarElement extends HTMLElement {
3442
- state: StatusBarViewState;
3443
- }
3444
- declare global {
3445
- interface HTMLElementTagNameMap {
3446
- 'pptx-ui-status-bar': PptxUiStatusBarElement;
3447
- }
3448
- }
3449
- interface PptxUiNotesToolbarElement extends HTMLElement {
3450
- state: NotesToolbarViewState;
3451
- }
3452
- declare global {
3453
- interface HTMLElementTagNameMap {
3454
- 'pptx-ui-notes-toolbar': PptxUiNotesToolbarElement;
3455
- }
3456
- }
3457
- interface PptxUiTitleBarElement extends HTMLElement {
3458
- state: TitleBarViewState | undefined;
3459
- placement: TitleBarPlacement;
3460
- }
3461
- declare global {
3462
- interface HTMLElementTagNameMap {
3463
- 'pptx-ui-title-bar': PptxUiTitleBarElement;
3464
- }
3465
- }
3466
- //#endregion
3467
- //#region src/web-components/select-value.d.ts
3468
- /**
3469
- * Public DOM shape of `pptx-ui-select`, used by every binding. The element is ooxml-ui's
3470
- * `office-ui-select` under the pptx tag (see `office-aliases.ts`); it is not a native select.
3471
- */
3472
- interface PptxUiSelectElement extends HTMLElement {
3473
- value: string;
3474
- disabled: boolean;
3475
- readonly options: HTMLOptionElement[];
3476
- selectedIndex: number;
3477
- }
3478
- declare global {
3479
- interface HTMLElementTagNameMap {
3480
- 'pptx-ui-select': PptxUiSelectElement;
3481
- }
3482
- }
3483
-
3484
14
  //#region src/viewer/types-core.d.ts
3485
15
  /**
3486
16
  * Union of all shape preset types that the viewer can insert or render.
@@ -3516,228 +46,6 @@ declare function ViewerThemeProvider({ theme, children }: ViewerThemeProviderPro
3516
46
  */
3517
47
  declare function useViewerTheme(): ViewerTheme | undefined;
3518
48
  //#endregion
3519
- //#region ../shared/dist/ai/index.d.ts
3520
- //#endregion
3521
- //#region src/ai/change-animator.d.ts
3522
- /** Host-tunable options for how AI edits are animated on the canvas. */
3523
- interface AiChangeAnimationConfig {
3524
- /** Master switch. Default true. */
3525
- enabled?: boolean;
3526
- /** How long the motion + glow plays, in ms. Default 900. */
3527
- durationMs?: number;
3528
- /** Draw the pulsing glow highlight on changed elements. Default true. */
3529
- glow?: boolean;
3530
- /** Glide old->new bounds and cross-fade colours. Default true. */
3531
- tween?: boolean;
3532
- /** Accent colour (any CSS colour) for the glow/ghosts. Default a blue. */
3533
- color?: string;
3534
- }
3535
- //#endregion
3536
- //#region src/ai/config.d.ts
3537
- /** The UI message shape exchanged with the assistant. Alias of the SDK type. */
3538
- type PptxAiUIMessage = UIMessage;
3539
- /**
3540
- * Canonical name of every tool the assistant can call. Document tools mirror the
3541
- * `pptx-viewer-mcp` server exactly (they ARE the same functions, run against the
3542
- * live deck); the viewer-only tools (navigation, deck outline, element/notes
3543
- * readers, table merge) have no MCP counterpart.
3544
- */
3545
- 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';
3546
- type Resolvable<T> = T | (() => T | Promise<T>);
3547
- /** How the assistant reaches a language model. */
3548
- type PptxAiConnection =
3549
- /**
3550
- * Post messages to a host backend route (recommended for production so the
3551
- * provider API key stays server-side). Maps to `DefaultChatTransport`.
3552
- */
3553
- {
3554
- kind: 'endpoint';
3555
- api: string;
3556
- headers?: Resolvable<Record<string, string>>;
3557
- body?: Resolvable<Record<string, unknown>>;
3558
- credentials?: RequestCredentials;
3559
- fetch?: typeof globalThis.fetch;
3560
- } |
3561
- /**
3562
- * Run a language model in-process in the browser (bring-your-own key /
3563
- * local model). Maps to a `ToolLoopAgent` behind a `DirectChatTransport`.
3564
- */
3565
- {
3566
- kind: 'model';
3567
- model: LanguageModel;
3568
- system?: string;
3569
- maxSteps?: number;
3570
- } |
3571
- /** Provide a fully-constructed transport (advanced / testing escape hatch). */
3572
- {
3573
- kind: 'transport';
3574
- transport: ChatTransport<PptxAiUIMessage>;
3575
- };
3576
- /** How writes proposed by the assistant reach the document. */
3577
- type PptxAiWritePolicy = 'stage' | 'approve' | 'auto';
3578
- /** Which deck context is fed to the model with each turn. */
3579
- type PptxAiContextStrategy = 'outline' | 'current-slide' | 'none';
3580
- /** Optional per-session history persistence hooks. */
3581
- interface PptxAiHistoryHooks {
3582
- load?(id: string): Promise<PptxAiUIMessage[]>;
3583
- save?(id: string, messages: PptxAiUIMessage[]): Promise<void>;
3584
- }
3585
- /** Complete host configuration for an AI chat session. */
3586
- interface PptxAiConfig {
3587
- connection: PptxAiConnection;
3588
- /** Extra host instructions appended to the base system prompt. */
3589
- systemPromptExtras?: string;
3590
- tools?: {
3591
- /** Allowlist. When set, only these tools are exposed. */
3592
- enabled?: PptxAiToolName[];
3593
- /** Denylist, applied after `enabled`. */
3594
- disabled?: PptxAiToolName[];
3595
- /** Additional host-defined tools merged into the tool set. */
3596
- extra?: ToolSet;
3597
- };
3598
- /** Default `'stage'`. */
3599
- writePolicy?: PptxAiWritePolicy;
3600
- /** Default `'outline'`. */
3601
- contextStrategy?: PptxAiContextStrategy;
3602
- history?: PptxAiHistoryHooks;
3603
- /**
3604
- * How AI edits are animated on the canvas so the user can watch them land
3605
- * (glide old->new, fade/scale in-out, glow-pulse). Omit for the defaults;
3606
- * set `{ enabled: false }` to turn it off.
3607
- */
3608
- changeAnimation?: AiChangeAnimationConfig;
3609
- onError?(error: Error): void;
3610
- }
3611
- //#endregion
3612
- //#region src/ai/bridge.d.ts
3613
- /** Lightweight, model-friendly summary of the whole deck. */
3614
- interface PptxAiDeckMeta {
3615
- /** Total number of slides. */
3616
- slideCount: number;
3617
- /** Zero-based index of the currently active slide. */
3618
- activeSlideIndex: number;
3619
- /** Deck title, when known (first slide title / core properties). */
3620
- title?: string;
3621
- /** Slide canvas width in CSS pixels. */
3622
- width: number;
3623
- /** Slide canvas height in CSS pixels. */
3624
- height: number;
3625
- }
3626
- /** Severity hint for {@link PptxAiBridge.notify}. */
3627
- type PptxAiNotifyLevel = 'info' | 'success' | 'warning' | 'error';
3628
- /**
3629
- * A target the user has scoped the assistant to: either a whole slide or a
3630
- * single element on a slide. Returned by {@link PptxAiBridge.getFocusedTargets}
3631
- * so the context builder can tell the model exactly what to focus on.
3632
- */
3633
- type PptxAiFocusedTarget = {
3634
- kind: 'slide';
3635
- slideIndex: number;
3636
- } | {
3637
- kind: 'element';
3638
- slideIndex: number;
3639
- elementId: string;
3640
- };
3641
- /**
3642
- * A pure updater over the deck's slides. It receives a deep clone of the
3643
- * current slides (mutation-safe) and returns the next slides array. The bridge
3644
- * commits the returned array as ONE history entry.
3645
- */
3646
- type PptxAiSlidesUpdater = (slides: PptxSlide[]) => PptxSlide[];
3647
- /**
3648
- * A pure updater over the whole parsed deck ({@link PptxData}). Mirrors the
3649
- * `pptx-viewer-mcp` tool model (data in, mutated data out) so presentation-level
3650
- * MCP tools (metadata, sections, canvas size, presentation properties, layouts)
3651
- * can be committed as ONE undoable history entry through {@link
3652
- * PptxAiBridge.applyDeckData}. Optional: bindings that only track slide/theme
3653
- * state can omit it, in which case those presentation-level tools report that
3654
- * they are unavailable in this viewer while every slide/theme tool still works.
3655
- */
3656
- type PptxAiDataUpdater = (data: PptxData) => PptxData;
3657
- /** Field-level updates for a single element, mirroring the MCP update vocab. */
3658
- interface PptxAiElementUpdate {
3659
- x?: number;
3660
- y?: number;
3661
- width?: number;
3662
- height?: number;
3663
- rotation?: number;
3664
- opacity?: number;
3665
- hidden?: boolean;
3666
- flipHorizontal?: boolean;
3667
- flipVertical?: boolean;
3668
- text?: string;
3669
- fontSize?: number;
3670
- fontFamily?: string;
3671
- fontColor?: string;
3672
- bold?: boolean;
3673
- italic?: boolean;
3674
- underline?: boolean;
3675
- align?: 'left' | 'center' | 'right' | 'justify';
3676
- fillColor?: string;
3677
- strokeColor?: string;
3678
- strokeWidth?: number;
3679
- }
3680
- /**
3681
- * Implemented by each binding to expose its live editor to the AI core.
3682
- *
3683
- * Read methods must be cheap and synchronous. Write methods must route through
3684
- * the binding's editor-history layer so AI edits are undoable like manual ones.
3685
- */
3686
- interface PptxAiBridge {
3687
- /** Return a summary of the whole deck. */
3688
- getDeckMeta(): PptxAiDeckMeta;
3689
- /** Return the deck's slides. Callers must not mutate the returned array. */
3690
- getSlides(): PptxSlide[];
3691
- /** Return the zero-based index of the active slide. */
3692
- getActiveSlideIndex(): number;
3693
- /** Return the resolved presentation theme, when available. */
3694
- getTheme(): PptxTheme | undefined;
3695
- /** Return the underlying core handler, when the binding exposes one. */
3696
- getHandler(): PptxHandler | undefined;
3697
- /** Navigate the viewer to a slide by zero-based index. */
3698
- goToSlide(index: number): void;
3699
- /** Select the given elements on a slide (empty array clears selection). */
3700
- selectElements(slideIndex: number, elementIds: string[]): void;
3701
- /**
3702
- * Apply a slides updater as a single, atomic, undoable history entry. The
3703
- * binding is responsible for cloning current slides before calling
3704
- * `updater` and for installing the result.
3705
- */
3706
- applySlidesUpdate(updater: PptxAiSlidesUpdater, label: string): void;
3707
- /** Apply field updates to one element as a single history entry. */
3708
- updateElement(slideIndex: number, elementId: string, updates: PptxAiElementUpdate): void;
3709
- /** Apply partial theme updates as a single history entry. */
3710
- applyTheme(updates: Partial<PptxTheme>): void;
3711
- /**
3712
- * Return the full parsed {@link PptxData} for the open deck, with the live
3713
- * (edited) slides and theme overlaid. Enables `pptx-viewer-mcp` tools that
3714
- * read presentation-level state (metadata, sections, layouts, presentation
3715
- * properties). Optional: when absent, the AI core synthesises a minimal
3716
- * PptxData from slides + dimensions, which is enough for every slide/theme
3717
- * tool but not for presentation-level reads.
3718
- */
3719
- getDeckData?(): PptxData | undefined;
3720
- /**
3721
- * Commit a whole-deck {@link PptxData} mutation as one undoable history entry.
3722
- * Used to apply presentation-level MCP tool results (metadata, sections,
3723
- * canvas size, presentation properties, layouts). Optional: when absent,
3724
- * those tools report they are not supported in this viewer; slide/theme tools
3725
- * are unaffected (they route through {@link PptxAiBridge.applySlidesUpdate}
3726
- * and {@link PptxAiBridge.applyTheme}).
3727
- */
3728
- applyDeckData?(updater: PptxAiDataUpdater, label: string): void;
3729
- /**
3730
- * Return the slides / elements the user has scoped the assistant to, if any.
3731
- * When present and non-empty, the context builder tells the model to focus on
3732
- * exactly these targets. Optional so existing bridges satisfy the contract
3733
- * without change; a bridge that does not implement it behaves as before (no
3734
- * focus scoping).
3735
- */
3736
- getFocusedTargets?(): PptxAiFocusedTarget[];
3737
- /** Surface a transient message in the host UI (toast / status line). */
3738
- notify?(message: string, level?: PptxAiNotifyLevel): void;
3739
- }
3740
- //#endregion
3741
49
  //#region src/viewer/hooks/collaboration/types.d.ts
3742
50
  /** Connection lifecycle states for the Yjs WebSocket provider. */
3743
51
  type ConnectionStatus = 'disconnected' | 'connecting' | 'connected' | 'error';
@@ -3848,7 +156,7 @@ interface PowerPointViewerProps extends ViewportFitOptions {
3848
156
  /** Callback when active slide changes */
3849
157
  onActiveSlideChange?: (slideIndex: number) => void;
3850
158
  /** Callback when the viewer mode changes (e.g. edit to present). */
3851
- onModeChange?: (mode: ViewerMode) => void;
159
+ onModeChange?: (mode: ooxml_ui_pptx.ViewerMode) => void;
3852
160
  /** Callback when the zoom level changes. */
3853
161
  onZoomChange?: (zoom: number) => void;
3854
162
  /** Callback when element selection changes. */
@@ -4069,6 +377,23 @@ interface PowerPointViewerProps extends ViewportFitOptions {
4069
377
  * back to the flat SVG pie3D renderer. Default `false`.
4070
378
  */
4071
379
  pieChart3D?: boolean;
380
+ /**
381
+ * Zero-based slide shown after each load, clamped into the deck. Default
382
+ * `0`. Changing it later does not move the current slide; it applies to
383
+ * the next load.
384
+ */
385
+ initialSlide?: number;
386
+ /**
387
+ * Show the editor chrome: title bar, ribbon and toolbar, protected-view
388
+ * and read-only banners, the mobile toolbar and the status bar. Default
389
+ * `true`; `false` leaves the canvas (and the thumbnail pane, if shown).
390
+ */
391
+ showToolbar?: boolean;
392
+ /**
393
+ * Show the slide thumbnail pane. Default `true`. The pane still follows
394
+ * the user's own collapse toggle and the `slidesPane` customisation panel.
395
+ */
396
+ showThumbnails?: boolean;
4072
397
  /**
4073
398
  * Hide individual toolbar buttons and/or ribbon tabs instead of the whole
4074
399
  * toolbar. Accepts any mix of button ids (`share`, `broadcast`, `export`,
@@ -4697,5 +1022,5 @@ declare function SlideTemplatePreview({ templateId, scheme }: SlideTemplatePrevi
4697
1022
  */
4698
1023
  declare function renderToCanvas(element: HTMLElement, options?: Partial<Options>): Promise<HTMLCanvasElement>;
4699
1024
 
4700
- export { AVATAR_COLOR_SWATCHES, BACKSTAGE_CARD_IDS, BACKSTAGE_PAGE_IDS, CANVAS_CONTEXT_MENU_COMMAND_IDS, DEFAULT_VIEWER_PROFILE, EDITOR_SHORTCUT_ACTION_IDS, ELEMENT_CONTEXT_MENU_COMMAND_IDS, LOCALE_CATALOG, OPTIONS_PAGE_IDS, OPTIONS_SECTION_IDS, OPTIONS_SETTING_IDS, PPTX_OPEN_ACCEPT, PRESENTATION_OPEN_EXTENSIONS, PowerPointViewer, RIBBON_TAB_IDS, SLIDE_TEMPLATES, SlideCanvas, SlideTemplateGalleryDialog, SlideTemplatePreview, THEME_CATALOG, TOOLBAR_BUTTON_IDS, Toolbar, VIEWER_DIALOG_IDS, VIEWER_EXPORT_FORMAT_IDS, VIEWER_FEATURE_IDS, VIEWER_PANEL_IDS, VIEWER_PREFS_STORAGE_KEY, ViewerThemeProvider, buildSlideTemplateContent, buildSlideTemplateSlide, clearAllLocalViewerData, clearStoredViewerPrefs, createImageElementFromFile, defaultCssVars, defaultRadius, defaultThemeColors, describeCollaborationShellState, getAnimationInitialStyle, getLocalStorageUsageSummary, isLegacyBinaryPresentation, isSupportedPresentationFile, presentationBaseName, readStoredViewerPrefs, renderToCanvas, resolveProfileInitial, resolveThemeCatalogEntry, saveViewerProfile, savedPresentationFileName, themeToCssVars, useViewerBuildingBlocks, useViewerTheme, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius, writeStoredViewerPrefs };
4701
- export type { AccountAuthConfig, BackstageCustomization, CollaborationConfig, CollaborationContextValue, CollaborationShellState, ContextMenuCustomization, ElementUpdate, ElementUpdateOptions, ExternalCollaborationAwareness, ExternalCollaborationSession, ExternalCollaborationSnapshot, HostCanvasMenuContext, HostElementMenuContext, HostMenuCommand, KeyboardCustomization, LocalStorageUsageSummary, LocaleCatalogEntry, OptionsCustomization, OptionsPageId, OptionsSectionId, OptionsSettingId, OptionsSettingValues, PowerPointViewerAPI, PowerPointViewerHandle, PowerPointViewerProps, PptxAiBridge, PptxAiConfig, PptxAiConnection, PptxAiContextStrategy, PptxAiToolName, PptxAiWritePolicy, ResolvedCustomization, RibbonCustomization, SavedPresentationFormat, ShortcutChord, SlideCanvasProps, SlideTemplateGalleryDialogProps, SlideTemplateId, SlideTemplatePreviewProps, SlideTemplateSpec, StoredViewerPrefs, ThemeCatalogEntry, ToolbarActionId, ToolbarButtonId, ToolbarProps, ToolbarTabId, UseViewerBuildingBlocksInput, ViewerBuildingBlocksResult, ViewerCustomization, ViewerCustomizationApi, ViewerDialogId, ViewerExportFormatId, ViewerFeatureId, ViewerMode, ViewerPanelId, ViewerProfile, ViewerTheme, ViewerThemeColors, ViewportFitOptions, ViewportFitPadding };
1025
+ export { PowerPointViewer, SlideCanvas, SlideTemplateGalleryDialog, SlideTemplatePreview, Toolbar, ViewerThemeProvider, getAnimationInitialStyle, renderToCanvas, useViewerBuildingBlocks, useViewerTheme };
1026
+ export type { CollaborationContextValue, PowerPointViewerHandle, PowerPointViewerProps, SlideCanvasProps, SlideTemplateGalleryDialogProps, SlideTemplatePreviewProps, ToolbarProps, UseViewerBuildingBlocksInput, ViewerBuildingBlocksResult };