pptx-react-viewer 4.4.0 → 4.6.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 (136) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/README.md +34 -33
  3. package/dist/{AiChatPanel-UFMSTNCB.js → AiChatPanel-3C7GM6ZF.js} +28 -28
  4. package/dist/AiChatPanel-3C7GM6ZF.js.br +0 -0
  5. package/dist/AiChatPanel-3C7GM6ZF.js.gz +0 -0
  6. package/dist/{AiChatPanel-QJHUDIWT.mjs → AiChatPanel-L7DBCWE3.mjs} +4 -4
  7. package/dist/AiChatPanel-L7DBCWE3.mjs.br +0 -0
  8. package/dist/AiChatPanel-L7DBCWE3.mjs.gz +0 -0
  9. package/dist/{Model3DScene-3GOC5HUS.mjs → Model3DScene-IJ7YYTYU.mjs} +1 -1
  10. package/dist/Model3DScene-IJ7YYTYU.mjs.br +0 -0
  11. package/dist/Model3DScene-IJ7YYTYU.mjs.gz +0 -0
  12. package/dist/{Model3DScene-KXNJBAQD.js → Model3DScene-USKNPWWH.js} +2 -2
  13. package/dist/{Model3DScene-KXNJBAQD.js.br → Model3DScene-USKNPWWH.js.br} +0 -0
  14. package/dist/Model3DScene-USKNPWWH.js.gz +0 -0
  15. package/dist/{chunk-I4D6JQOI.js → chunk-3JUZOKFI.js} +13 -0
  16. package/dist/chunk-3JUZOKFI.js.br +0 -0
  17. package/dist/chunk-3JUZOKFI.js.gz +0 -0
  18. package/dist/{chunk-CSY422LU.js → chunk-5V5SMT5A.js} +5 -5
  19. package/dist/chunk-5V5SMT5A.js.br +0 -0
  20. package/dist/chunk-5V5SMT5A.js.gz +0 -0
  21. package/dist/{chunk-AI6K5EAE.js → chunk-DFSWCVRW.js} +1677 -1207
  22. package/dist/chunk-DFSWCVRW.js.br +0 -0
  23. package/dist/chunk-DFSWCVRW.js.gz +0 -0
  24. package/dist/{chunk-7WWINBGF.js → chunk-FZSYLXJT.js} +3293 -1568
  25. package/dist/chunk-FZSYLXJT.js.br +0 -0
  26. package/dist/chunk-FZSYLXJT.js.gz +0 -0
  27. package/dist/{chunk-YJKR7Z3X.js → chunk-IBHIXBC5.js} +885 -845
  28. package/dist/chunk-IBHIXBC5.js.br +0 -0
  29. package/dist/chunk-IBHIXBC5.js.gz +0 -0
  30. package/dist/{chunk-D3TZOCQP.mjs → chunk-ICEZL4TM.mjs} +3260 -1568
  31. package/dist/chunk-ICEZL4TM.mjs.br +0 -0
  32. package/dist/chunk-ICEZL4TM.mjs.gz +0 -0
  33. package/dist/{chunk-WCHKDZP6.mjs → chunk-INX3E37P.mjs} +73 -33
  34. package/dist/chunk-INX3E37P.mjs.br +0 -0
  35. package/dist/chunk-INX3E37P.mjs.gz +0 -0
  36. package/dist/{chunk-WNFHFFYE.mjs → chunk-K6QHGABT.mjs} +17 -7
  37. package/dist/chunk-K6QHGABT.mjs.br +0 -0
  38. package/dist/chunk-K6QHGABT.mjs.gz +0 -0
  39. package/dist/{chunk-JQXN6PO7.mjs → chunk-OOO4JL2N.mjs} +13 -0
  40. package/dist/chunk-OOO4JL2N.mjs.br +0 -0
  41. package/dist/chunk-OOO4JL2N.mjs.gz +0 -0
  42. package/dist/{chunk-XMKLY2SE.mjs → chunk-VCAQSSGD.mjs} +1 -1
  43. package/dist/chunk-VCAQSSGD.mjs.br +0 -0
  44. package/dist/chunk-VCAQSSGD.mjs.gz +0 -0
  45. package/dist/{chunk-OWTHF5N4.js → chunk-Y4QUVWZC.js} +201 -191
  46. package/dist/chunk-Y4QUVWZC.js.br +0 -0
  47. package/dist/chunk-Y4QUVWZC.js.gz +0 -0
  48. package/dist/{chunk-LUHUYBGW.mjs → chunk-ZAQFTO4P.mjs} +623 -153
  49. package/dist/chunk-ZAQFTO4P.mjs.br +0 -0
  50. package/dist/chunk-ZAQFTO4P.mjs.gz +0 -0
  51. package/dist/i18n/de.cjs +11 -0
  52. package/dist/i18n/de.cjs.br +0 -0
  53. package/dist/i18n/de.cjs.gz +0 -0
  54. package/dist/i18n/de.mjs +11 -0
  55. package/dist/i18n/de.mjs.br +0 -0
  56. package/dist/i18n/de.mjs.gz +0 -0
  57. package/dist/i18n/es.cjs +11 -0
  58. package/dist/i18n/es.cjs.br +0 -0
  59. package/dist/i18n/es.cjs.gz +0 -0
  60. package/dist/i18n/es.mjs +11 -0
  61. package/dist/i18n/es.mjs.br +0 -0
  62. package/dist/i18n/es.mjs.gz +0 -0
  63. package/dist/i18n/fr.cjs +11 -0
  64. package/dist/i18n/fr.cjs.br +0 -0
  65. package/dist/i18n/fr.cjs.gz +0 -0
  66. package/dist/i18n/fr.mjs +11 -0
  67. package/dist/i18n/fr.mjs.br +0 -0
  68. package/dist/i18n/fr.mjs.gz +0 -0
  69. package/dist/i18n/zh-CN.cjs +11 -0
  70. package/dist/i18n/zh-CN.cjs.br +0 -0
  71. package/dist/i18n/zh-CN.cjs.gz +0 -0
  72. package/dist/i18n/zh-CN.mjs +11 -0
  73. package/dist/i18n/zh-CN.mjs.br +0 -0
  74. package/dist/i18n/zh-CN.mjs.gz +0 -0
  75. package/dist/i18n.js +4 -4
  76. package/dist/i18n.js.br +0 -0
  77. package/dist/i18n.js.gz +0 -0
  78. package/dist/i18n.mjs +1 -1
  79. package/dist/i18n.mjs.br +0 -0
  80. package/dist/i18n.mjs.gz +0 -0
  81. package/dist/index.d.ts +311 -4
  82. package/dist/index.js +105 -49
  83. package/dist/index.js.br +0 -0
  84. package/dist/index.js.gz +0 -0
  85. package/dist/index.mjs +6 -6
  86. package/dist/index.mjs.br +0 -0
  87. package/dist/index.mjs.gz +0 -0
  88. package/dist/internals.d.ts +328 -3
  89. package/dist/internals.js +105 -105
  90. package/dist/internals.js.br +0 -0
  91. package/dist/internals.js.gz +0 -0
  92. package/dist/internals.mjs +4 -4
  93. package/dist/internals.mjs.br +0 -0
  94. package/dist/internals.mjs.gz +0 -0
  95. package/dist/pptx-viewer.css +1 -1
  96. package/dist/pptx-viewer.css.br +0 -0
  97. package/dist/pptx-viewer.css.gz +0 -0
  98. package/dist/viewer/index.d.ts +416 -2
  99. package/dist/viewer/index.js +27 -27
  100. package/dist/viewer/index.js.br +0 -0
  101. package/dist/viewer/index.js.gz +0 -0
  102. package/dist/viewer/index.mjs +6 -6
  103. package/dist/viewer/index.mjs.br +0 -0
  104. package/dist/viewer/index.mjs.gz +0 -0
  105. package/package.json +1 -1
  106. package/dist/AiChatPanel-QJHUDIWT.mjs.br +0 -0
  107. package/dist/AiChatPanel-QJHUDIWT.mjs.gz +0 -0
  108. package/dist/AiChatPanel-UFMSTNCB.js.br +0 -0
  109. package/dist/AiChatPanel-UFMSTNCB.js.gz +0 -0
  110. package/dist/Model3DScene-3GOC5HUS.mjs.br +0 -0
  111. package/dist/Model3DScene-3GOC5HUS.mjs.gz +0 -0
  112. package/dist/Model3DScene-KXNJBAQD.js.gz +0 -0
  113. package/dist/chunk-7WWINBGF.js.br +0 -0
  114. package/dist/chunk-7WWINBGF.js.gz +0 -0
  115. package/dist/chunk-AI6K5EAE.js.br +0 -0
  116. package/dist/chunk-AI6K5EAE.js.gz +0 -0
  117. package/dist/chunk-CSY422LU.js.br +0 -0
  118. package/dist/chunk-CSY422LU.js.gz +0 -0
  119. package/dist/chunk-D3TZOCQP.mjs.br +0 -0
  120. package/dist/chunk-D3TZOCQP.mjs.gz +0 -0
  121. package/dist/chunk-I4D6JQOI.js.br +0 -0
  122. package/dist/chunk-I4D6JQOI.js.gz +0 -0
  123. package/dist/chunk-JQXN6PO7.mjs.br +0 -0
  124. package/dist/chunk-JQXN6PO7.mjs.gz +0 -0
  125. package/dist/chunk-LUHUYBGW.mjs.br +0 -0
  126. package/dist/chunk-LUHUYBGW.mjs.gz +0 -0
  127. package/dist/chunk-OWTHF5N4.js.br +0 -0
  128. package/dist/chunk-OWTHF5N4.js.gz +0 -0
  129. package/dist/chunk-WCHKDZP6.mjs.br +0 -0
  130. package/dist/chunk-WCHKDZP6.mjs.gz +0 -0
  131. package/dist/chunk-WNFHFFYE.mjs.br +0 -0
  132. package/dist/chunk-WNFHFFYE.mjs.gz +0 -0
  133. package/dist/chunk-XMKLY2SE.mjs.br +0 -0
  134. package/dist/chunk-XMKLY2SE.mjs.gz +0 -0
  135. package/dist/chunk-YJKR7Z3X.js.br +0 -0
  136. package/dist/chunk-YJKR7Z3X.js.gz +0 -0
@@ -1804,6 +1804,15 @@ interface TextStyle {
1804
1804
  textInnerShadowOffsetX?: number;
1805
1805
  /** Text inner shadow vertical offset in px. */
1806
1806
  textInnerShadowOffsetY?: number;
1807
+ /**
1808
+ * Original inner-shadow colour-choice XML (`a:innerShdw`'s
1809
+ * `a:prstClr`/`a:schemeClr`/`a:srgbClr`/… child), preserved verbatim so an
1810
+ * authored preset or theme colour round-trips instead of always being
1811
+ * re-serialized as a resolved `a:srgbClr`. Mirrors {@link textGlowColorXml}.
1812
+ */
1813
+ textInnerShadowColorXml?: XmlObject;
1814
+ /** Theme colour slot the inner shadow colour resolved from, when it is `a:schemeClr`. */
1815
+ textInnerShadowColorRef?: PptxThemeColorRef;
1807
1816
  /** Preset shadow type from `a:prstShdw/@prst` (e.g. "shdw1"..."shdw20"). */
1808
1817
  textPresetShadowName?: string;
1809
1818
  /** Preset shadow colour as hex string. */
@@ -1816,6 +1825,18 @@ interface TextStyle {
1816
1825
  textPresetShadowDirection?: number;
1817
1826
  /** Text blur effect radius in px (`a:blur`). */
1818
1827
  textBlurRadius?: number;
1828
+ /**
1829
+ * Text soft-edge radius in px (`a:softEdge/@rad`).
1830
+ *
1831
+ * Feathers the glyph's own edges (a uniform blur of the alpha silhouette,
1832
+ * the same effect a shape's `a:softEdge` gives its fill), unrelated to
1833
+ * `a:blur` (which blurs the whole run, colour included) or a shadow. Never
1834
+ * parsed before this field existed, so `a:softEdge` on a run was silently
1835
+ * dropped: PowerPoint fades the glyphs to near-transparent at their
1836
+ * outline (COM-verified, `audit-text` slide 14's "SOFTEDGE" run), while
1837
+ * the viewer painted them fully crisp.
1838
+ */
1839
+ textSoftEdgeRadius?: number;
1819
1840
  /**
1820
1841
  * Raw `a:effectDag` XML node from `a:rPr`, preserved verbatim for
1821
1842
  * round-trip serialisation. Mirrors the shape-level
@@ -3448,6 +3469,15 @@ interface PptxChartHistogramOptions {
3448
3469
  intervalClosed?: 'l' | 'r';
3449
3470
  underflow?: number | 'auto';
3450
3471
  overflow?: number | 'auto';
3472
+ /**
3473
+ * `c:layoutPr/cx:aggregation` was authored instead of `cx:binning`: the
3474
+ * raw rows are CATEGORICAL (a Pareto chart's `clusteredColumn` series
3475
+ * counting occurrences of each authored category, COM-verified against
3476
+ * charts-com.pptx slide 31 / chartEx6.xml), not a numeric range to bin.
3477
+ * Mutually exclusive with `binSize`/`binCount`/`intervalClosed`, which
3478
+ * only apply to a true numeric-value histogram.
3479
+ */
3480
+ aggregateByCategory?: boolean;
3451
3481
  }
3452
3482
  /** Office 2016 ChartEx waterfall series layout options. */
3453
3483
  interface PptxChartWaterfallOptions {
@@ -4112,6 +4142,18 @@ interface PptxChartData {
4112
4142
  * the source" and callers should treat it as `true`. Surface only.
4113
4143
  */
4114
4144
  wireframe?: boolean;
4145
+ /**
4146
+ * Whether the surface chart is the 2-D "top view" projection
4147
+ * (`c:surfaceChart`, PowerPoint's "Contour" / "Wireframe Contour" types)
4148
+ * rather than the 3-D isometric one (`c:surface3DChart`, "3-D Surface" /
4149
+ * "3-D Surface (Wireframe)"). Both element names map to chart type
4150
+ * `"surface"`; this bit is the only thing that tells the renderer which
4151
+ * of the two projections PowerPoint actually drew, since a top-view
4152
+ * surface has no Z-axis at all (only category and series axes) while the
4153
+ * 3-D one draws all three. Surface only; `undefined` for every other
4154
+ * chart type.
4155
+ */
4156
+ surfaceTopView?: boolean;
4115
4157
  /**
4116
4158
  * Scatter presentation mode (`c:scatterChart/c:scatterStyle/@val`).
4117
4159
  *
@@ -12080,7 +12122,7 @@ interface ReflectionWrapperStyle {
12080
12122
  top: string;
12081
12123
  width: string;
12082
12124
  height: string;
12083
- /** Mirror (`scaleY(-1)`) composed with `@sx`/`@sy`/`@kx`/`@ky`/`@rot`. */
12125
+ /** `scale(@sx, @sy)` (the sign of `@sy` IS the mirror) composed with `@kx`/`@ky`/`@rot`. */
12084
12126
  transform: string;
12085
12127
  /** Anchor point for the transform above, from `@algn` (default `center top`). */
12086
12128
  transformOrigin: string;
@@ -13312,6 +13354,27 @@ interface PresentationInkStroke {
13312
13354
  width: number;
13313
13355
  points: PresentationInkPoint[];
13314
13356
  }
13357
+ /** A logical editor command produced by one key press. */
13358
+ 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';
13359
+ /** Every command a canvas context menu can offer, in no particular order. */
13360
+ type ContextMenuCommandId = 'copy' | 'cut' | 'paste' | 'duplicate' | 'edit-text' | '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' | 'save-as-picture' | 'edit-alt-text' | 'size-and-position' | 'format-shape' | 'delete';
13361
+ //#endregion
13362
+ //#region src/render/canvas-context-menu-commands.d.ts
13363
+ /**
13364
+ * The right-click menu for the empty slide canvas (no element under the
13365
+ * cursor), as distinct from {@link ./context-menu-commands}'s per-element menu.
13366
+ *
13367
+ * Right-clicking empty canvas used to do nothing at all in every binding: React
13368
+ * and Vue both bailed out early (`getElementIdFromEvent` returns `null`, so the
13369
+ * handler just returns) rather than opening a menu, and the other three never
13370
+ * wired a handler for it either. PowerPoint offers Paste, Layout, Reset,
13371
+ * Format Background and view toggles (Grid and Guides, Ruler) from this menu;
13372
+ * this module is the one list every binding renders instead of five omissions.
13373
+ *
13374
+ * @module render/canvas-context-menu-commands
13375
+ */
13376
+ /** Every command the empty-canvas context menu can offer, in no particular order. */
13377
+ type CanvasContextMenuCommandId = 'paste' | 'layout' | 'reset-slide' | 'format-background' | 'grid-and-guides' | 'ruler';
13315
13378
  //#endregion
13316
13379
  //#region src/render/paste-special.d.ts
13317
13380
  /** The four paste formats PowerPoint's Paste Options / Paste Special offer. */
@@ -13445,6 +13508,21 @@ interface AutosaveRecoveryPrompt {
13445
13508
  readonly restoreKey: string;
13446
13509
  readonly discardKey: string;
13447
13510
  }
13511
+ type BackstagePage = 'home' | 'new' | 'open' | 'info' | 'save' | 'saveAs' | 'print' | 'share' | 'export' | 'close' | 'account' | 'options';
13512
+ //#endregion
13513
+ //#region src/render/backstage-cards.d.ts
13514
+ /**
13515
+ * Every action card the File-tab backstage can show, keyed by the operation it
13516
+ * triggers rather than by its wording.
13517
+ *
13518
+ * The five bindings used to hardcode a title and a body string each, which made
13519
+ * the whole backstage untranslatable and let the copy drift: the same card
13520
+ * carried four different descriptions depending on which binding you opened it
13521
+ * in. Both halves now live here as a dictionary key plus an English fallback,
13522
+ * so a wording change lands everywhere at once and a translator only has to
13523
+ * translate it once.
13524
+ */
13525
+ type BackstageCardId = 'protect' | 'inspect' | 'embedFonts' | 'signatures' | 'versionHistory' | 'saveAsPptx' | 'saveAsPpsx' | 'saveAsPptm' | 'saveAsPpt' | 'pdf' | 'png' | 'video' | 'gif' | 'json' | 'copyImage' | 'print' | 'share';
13448
13526
  //#endregion
13449
13527
  //#region src/render/master-view.d.ts
13450
13528
  /** Which part the master view is currently pointed at. */
@@ -13750,6 +13828,136 @@ interface PrintSettings {
13750
13828
  scaleToFit?: boolean;
13751
13829
  }
13752
13830
  //#endregion
13831
+ //#region src/render/options/viewer-options-controls.d.ts
13832
+ /**
13833
+ * Control/section/tab descriptor types for the File > Options schema, plus
13834
+ * the terse constructors the tab-definition modules build panes with.
13835
+ */
13836
+ type ViewerOptionsTabId = 'general' | 'proofing' | 'save' | 'language' | 'accessibility' | 'advanced' | 'ribbon' | 'quickAccess' | 'addIns' | 'trust';
13837
+ //#endregion
13838
+ //#region src/render/customization/customization-types.d.ts
13839
+ /** Keys of an options group whose value is a primitive (not an array). */
13840
+ type PrimitiveKeys<T> = { [K in keyof T]: T[K] extends ViewerOptionPrimitive ? K : never; }[keyof T] & string;
13841
+ /**
13842
+ * One File > Options setting, addressed as `<group>.<key>`, for example
13843
+ * `general.userName` or `advanced.showGrid`. The union is derived from the
13844
+ * `ViewerOptions` model itself, so a typo is a compile error.
13845
+ */
13846
+ type OptionsSettingId = { [G in ViewerOptionsGroupId]: `${G}.${PrimitiveKeys<ViewerOptions[G]>}`; }[ViewerOptionsGroupId];
13847
+ /**
13848
+ * A File > Options page: the ten PowerPoint categories plus `ai`, the AI
13849
+ * assistant page a binding adds when the host configured an assistant.
13850
+ */
13851
+ type OptionsPageId = ViewerOptionsTabId | 'ai';
13852
+ /**
13853
+ * One section of an Options page, addressed as `<page>.<section>`, for
13854
+ * example `general.personalize` or `advanced.print`. The full list is
13855
+ * `OPTIONS_SECTION_IDS` (derived from the schema at runtime).
13856
+ */
13857
+ type OptionsSectionId = `${ViewerOptionsTabId}.${string}`;
13858
+ /** Values a host forces onto settings. */
13859
+ type OptionsSettingValues = Partial<Record<OptionsSettingId, ViewerOptionPrimitive>>;
13860
+ /** Ribbon and toolbar customisation. */
13861
+ interface RibbonCustomization {
13862
+ /** Ribbon tabs to remove (the File tab included, unlike Customize Ribbon). */
13863
+ hiddenTabs?: readonly ToolbarTabId[];
13864
+ /** Top-level toolbar buttons / control clusters to remove. */
13865
+ hiddenButtons?: readonly ToolbarButtonId[];
13866
+ }
13867
+ /** File > Options (the Settings dialog) customisation. */
13868
+ interface OptionsCustomization {
13869
+ /** Whole pages to remove from the dialog's category rail. */
13870
+ hiddenPages?: readonly OptionsPageId[];
13871
+ /** Sections (`<page>.<section>`) to remove from their page. */
13872
+ hiddenSections?: readonly OptionsSectionId[];
13873
+ /** Individual settings (`<group>.<key>`) to remove wherever they appear. */
13874
+ hiddenSettings?: readonly OptionsSettingId[];
13875
+ /**
13876
+ * Settings pinned to a fixed value. The value is forced into the options
13877
+ * store, user edits to it are ignored, and the control renders read-only.
13878
+ * Add the id to `hiddenSettings` too to lock it invisibly.
13879
+ */
13880
+ locked?: OptionsSettingValues;
13881
+ /**
13882
+ * Host defaults: the value a setting starts at when the user has not saved
13883
+ * a choice of their own. "Reset" returns to these, not to the built-ins.
13884
+ */
13885
+ defaults?: OptionsSettingValues;
13886
+ }
13887
+ /** File tab (backstage) customisation. */
13888
+ interface BackstageCustomization {
13889
+ /** Navigation entries (pages) to remove from the File tab. */
13890
+ hiddenPages?: readonly BackstagePage[];
13891
+ /** Action cards to remove from the pages that show them. */
13892
+ hiddenCards?: readonly BackstageCardId[];
13893
+ }
13894
+ /** Right-click menu customisation. */
13895
+ interface ContextMenuCustomization {
13896
+ /** Entries to remove from the element (right-click on a shape) menu. */
13897
+ hiddenElementCommands?: readonly ContextMenuCommandId[];
13898
+ /** Entries to remove from the empty-canvas menu. */
13899
+ hiddenCanvasCommands?: readonly CanvasContextMenuCommandId[];
13900
+ /** Remove the element context menu entirely. */
13901
+ disableElementMenu?: boolean;
13902
+ /** Remove the empty-canvas context menu entirely. */
13903
+ disableCanvasMenu?: boolean;
13904
+ }
13905
+ /**
13906
+ * A shortcut chord in the form `Mod+Shift+D`: modifiers `Mod` (Ctrl on
13907
+ * Windows/Linux, Cmd on macOS), `Ctrl`, `Meta`, `Alt`, `Shift`, joined by `+`,
13908
+ * followed by a `KeyboardEvent.key` value (`D`, `Delete`, `ArrowLeft`, `F2`).
13909
+ */
13910
+ type ShortcutChord = string;
13911
+ /** Editor keyboard-shortcut customisation. */
13912
+ interface KeyboardCustomization {
13913
+ /** Turn every editor shortcut off (the host owns the keyboard). */
13914
+ disableAll?: boolean;
13915
+ /** Editor commands whose shortcut is turned off. */
13916
+ disabled?: readonly EditorKeyActionName[];
13917
+ /**
13918
+ * Replacement chords per command. A remapped command no longer answers to
13919
+ * its built-in chord; it answers to the chord(s) given here instead.
13920
+ */
13921
+ remap?: Partial<Record<EditorKeyActionName, ShortcutChord | readonly ShortcutChord[]>>;
13922
+ }
13923
+ /**
13924
+ * Chrome regions a host can remove. Each id maps onto one region in every
13925
+ * binding; see `VIEWER_PANEL_IDS` for the catalogue.
13926
+ */
13927
+ type ViewerPanelId = 'statusBar' | 'slidesPane' | 'inspector' | 'notes' | 'quickAccessToolbar' | 'titleBar';
13928
+ /** Feature areas that can be switched off as a whole. */
13929
+ type ViewerFeatureId = 'ai' | 'collaboration' | 'comments' | 'presentMode';
13930
+ /** Dialogs (and the entry points that open them) a host can remove. */
13931
+ type ViewerDialogId = 'options' | 'share' | 'broadcast' | 'print' | 'export';
13932
+ /** Export formats offered by the File > Export page. */
13933
+ type ViewerExportFormatId = 'pdf' | 'png' | 'video' | 'gif' | 'json' | 'copyImage';
13934
+ /**
13935
+ * The whole customisation object. Every field is optional; omitted fields hide
13936
+ * nothing and lock nothing.
13937
+ */
13938
+ interface ViewerCustomization {
13939
+ ribbon?: RibbonCustomization;
13940
+ options?: OptionsCustomization;
13941
+ backstage?: BackstageCustomization;
13942
+ contextMenu?: ContextMenuCustomization;
13943
+ keyboard?: KeyboardCustomization;
13944
+ /** Chrome regions to remove (`true` hides). */
13945
+ hiddenPanels?: readonly ViewerPanelId[];
13946
+ /** Feature areas to switch off (their buttons, menus, pages and panels). */
13947
+ disabledFeatures?: readonly ViewerFeatureId[];
13948
+ /** Dialogs to remove, along with every entry point that opens them. */
13949
+ hiddenDialogs?: readonly ViewerDialogId[];
13950
+ /** Export formats to remove from File > Export. */
13951
+ hiddenExportFormats?: readonly ViewerExportFormatId[];
13952
+ }
13953
+ //#endregion
13954
+ //#region src/render/options/viewer-options-constraints.d.ts
13955
+ /** Locks and host defaults, both keyed `<group>.<key>`. */
13956
+ interface ViewerOptionsConstraints {
13957
+ locked?: OptionsSettingValues;
13958
+ defaults?: OptionsSettingValues;
13959
+ }
13960
+ //#endregion
13753
13961
  //#region src/render/options/viewer-options-store.d.ts
13754
13962
  /**
13755
13963
  * Framework-neutral store behind the File > Options dialog.
@@ -13793,6 +14001,96 @@ interface ViewerOptionsStore {
13793
14001
  * operation costs a single render instead of one per field.
13794
14002
  */
13795
14003
  batch(write: () => void): void;
14004
+ /**
14005
+ * Apply host constraints (see `ViewerOptionsConstraints`): `locked` values
14006
+ * are forced in and every later write to them is ignored; `defaults`
14007
+ * replace the built-in defaults for settings the user never saved, and
14008
+ * become what `reset` returns to. Replaces any previous constraints.
14009
+ */
14010
+ setConstraints(constraints: ViewerOptionsConstraints): void;
14011
+ /** True when the host locked `<group>.<key>`. */
14012
+ isLocked(group: ViewerOptionsGroupId, key: string): boolean;
14013
+ }
14014
+ //#endregion
14015
+ //#region src/render/customization/customization-keymap.d.ts
14016
+ /** A parsed `Mod+Shift+D` chord. */
14017
+ interface ParsedShortcutChord {
14018
+ key: string;
14019
+ mod: boolean;
14020
+ ctrl: boolean;
14021
+ meta: boolean;
14022
+ alt: boolean;
14023
+ shift: boolean;
14024
+ }
14025
+ /** The normalised keyboard slice of a resolved customisation. */
14026
+ interface ResolvedKeyboardCustomization {
14027
+ disableAll: boolean;
14028
+ disabled: ReadonlySet<EditorKeyActionName>;
14029
+ remap: ReadonlyMap<EditorKeyActionName, readonly ParsedShortcutChord[]>;
14030
+ }
14031
+ //#endregion
14032
+ //#region src/render/customization/customization-resolve.d.ts
14033
+ /** The normalised, set-based view of a customisation. Treat as immutable. */
14034
+ interface ResolvedCustomization {
14035
+ hiddenActions: ReadonlySet<ToolbarActionId>;
14036
+ hiddenOptionsPages: ReadonlySet<OptionsPageId>;
14037
+ hiddenOptionsSections: ReadonlySet<OptionsSectionId>;
14038
+ hiddenSettings: ReadonlySet<OptionsSettingId>;
14039
+ lockedSettings: OptionsSettingValues;
14040
+ defaultSettings: OptionsSettingValues;
14041
+ hiddenBackstagePages: ReadonlySet<BackstagePage>;
14042
+ hiddenBackstageCards: ReadonlySet<BackstageCardId>;
14043
+ hiddenElementCommands: ReadonlySet<ContextMenuCommandId>;
14044
+ hiddenCanvasCommands: ReadonlySet<CanvasContextMenuCommandId>;
14045
+ elementMenuEnabled: boolean;
14046
+ canvasMenuEnabled: boolean;
14047
+ hiddenPanels: ReadonlySet<ViewerPanelId>;
14048
+ disabledFeatures: ReadonlySet<ViewerFeatureId>;
14049
+ hiddenDialogs: ReadonlySet<ViewerDialogId>;
14050
+ keyboard: ResolvedKeyboardCustomization;
14051
+ }
14052
+ //#endregion
14053
+ //#region src/render/customization/customization-controller.d.ts
14054
+ /** The imperative methods every binding's component handle exposes. */
14055
+ interface ViewerCustomizationApi {
14056
+ /** The current customisation object (a snapshot; do not mutate). */
14057
+ getCustomization(): ViewerCustomization;
14058
+ /** Replace the whole customisation. */
14059
+ setCustomization(next: ViewerCustomization): void;
14060
+ /** Merge a partial customisation (see `mergeCustomization`). */
14061
+ updateCustomization(patch: ViewerCustomization): void;
14062
+ /** Drop every customisation, back to the stock UI. */
14063
+ resetCustomization(): void;
14064
+ hideRibbonTab(tab: ToolbarTabId): void;
14065
+ showRibbonTab(tab: ToolbarTabId): void;
14066
+ hideToolbarButton(button: ToolbarButtonId): void;
14067
+ showToolbarButton(button: ToolbarButtonId): void;
14068
+ hideOptionsPage(page: OptionsPageId): void;
14069
+ showOptionsPage(page: OptionsPageId): void;
14070
+ hideOptionsSection(section: OptionsSectionId): void;
14071
+ showOptionsSection(section: OptionsSectionId): void;
14072
+ hideSetting(setting: OptionsSettingId): void;
14073
+ showSetting(setting: OptionsSettingId): void;
14074
+ /** Pin a setting to `value`; `hidden` also removes it from the dialog. */
14075
+ lockSetting(setting: OptionsSettingId, value: ViewerOptionPrimitive, hidden?: boolean): void;
14076
+ unlockSetting(setting: OptionsSettingId): void;
14077
+ /** Set (or with `undefined`, clear) the host default for a setting. */
14078
+ setSettingDefault(setting: OptionsSettingId, value: ViewerOptionPrimitive | undefined): void;
14079
+ hideBackstagePage(page: BackstagePage): void;
14080
+ showBackstagePage(page: BackstagePage): void;
14081
+ hideBackstageCard(card: BackstageCardId): void;
14082
+ showBackstageCard(card: BackstageCardId): void;
14083
+ hideContextMenuCommand(command: ContextMenuCommandId): void;
14084
+ showContextMenuCommand(command: ContextMenuCommandId): void;
14085
+ hideCanvasContextMenuCommand(command: CanvasContextMenuCommandId): void;
14086
+ showCanvasContextMenuCommand(command: CanvasContextMenuCommandId): void;
14087
+ disableShortcut(action: EditorKeyActionName): void;
14088
+ enableShortcut(action: EditorKeyActionName): void;
14089
+ /** Move a command onto new chord(s); `undefined` restores the built-in chord. */
14090
+ remapShortcut(action: EditorKeyActionName, chords: ShortcutChord | readonly ShortcutChord[] | undefined): void;
14091
+ setPanelVisible(panel: ViewerPanelId, visible: boolean): void;
14092
+ setFeatureEnabled(feature: ViewerFeatureId, enabled: boolean): void;
14093
+ setDialogAvailable(dialog: ViewerDialogId, available: boolean): void;
13796
14094
  }
13797
14095
  type ReadOnlyRecommendationKind = 'modifyVerifier' | 'markedFinal' | null;
13798
14096
  interface ReadOnlyRecommendation {
@@ -14055,6 +14353,11 @@ interface ElementContextMenuState {
14055
14353
  y: number;
14056
14354
  elementId: string;
14057
14355
  }
14356
+ /** Tracks the position of an open empty-canvas (no element hit) context menu. */
14357
+ interface CanvasContextMenuState {
14358
+ x: number;
14359
+ y: number;
14360
+ }
14058
14361
  /** Identifies an action triggered from the element right-click context menu. */
14059
14362
  type ElementContextMenuAction = 'copy' | 'cut' | 'paste' | 'duplicate' | 'delete' | 'bring-forward' | 'send-backward' | 'bring-front' | 'send-back' | 'bringForward' | 'sendBackward' | 'bringToFront' | 'sendToBack' | 'comment' | 'addComment' | 'group' | 'ungroup' | 'editPoints' | 'editHyperlink' | 'edit-text' | 'save-as-picture' | 'edit-alt-text' | 'size-and-position' | 'format-shape';
14060
14363
  /**
@@ -14112,7 +14415,7 @@ interface AccessibilityIssue {
14112
14415
  severity: 'error' | 'warning' | 'info';
14113
14416
  message: string;
14114
14417
  }
14115
- interface PowerPointViewerHandle extends FileViewerHandle, PowerPointViewerAPI {
14418
+ interface PowerPointViewerHandle extends FileViewerHandle, PowerPointViewerAPI, ViewerCustomizationApi {
14116
14419
  getContent: () => Promise<Uint8Array>;
14117
14420
  }
14118
14421
 
@@ -14395,6 +14698,7 @@ interface CanvasInteractionHandlers {
14395
14698
  handleElementDoubleClick: (elementId: string, e: React.MouseEvent) => void;
14396
14699
  handleElementMouseDown: (elementId: string, e: React.MouseEvent) => void;
14397
14700
  handleElementContextMenu: (elementId: string, e: React.MouseEvent) => void;
14701
+ handleCanvasContextMenu: (e: React.MouseEvent) => void;
14398
14702
  handleCanvasMouseDown: (e: React.MouseEvent) => void;
14399
14703
  handleResizePointerDown: (elementId: string, e: React.MouseEvent, handle: string) => void;
14400
14704
  handleAdjustmentPointerDown: (elementId: string, e: React.MouseEvent, descriptor: ShapeAdjustmentHandleDescriptor) => void;
@@ -14574,6 +14878,7 @@ interface UseCanvasInteractionsInput {
14574
14878
  setInlineEditingElementId: React.Dispatch<React.SetStateAction<string | null>>;
14575
14879
  setInlineEditingText: React.Dispatch<React.SetStateAction<string>>;
14576
14880
  setContextMenuState: React.Dispatch<React.SetStateAction<ElementContextMenuState | null>>;
14881
+ setCanvasContextMenuState: React.Dispatch<React.SetStateAction<CanvasContextMenuState | null>>;
14577
14882
  setMarqueeSelectionState: React.Dispatch<React.SetStateAction<MarqueeSelectionState | null>>;
14578
14883
  setSnapLines: React.Dispatch<React.SetStateAction<Array<{
14579
14884
  axis: string;
@@ -14743,6 +15048,8 @@ interface UseFindReplaceInput {
14743
15048
  onSetSelectedElementId: (id: string | null) => void;
14744
15049
  onUpdateSlides: (updater: (slides: PptxSlide[]) => PptxSlide[]) => void;
14745
15050
  onMarkDirty: () => void;
15051
+ /** Host keyboard customisation (disabled / remapped Find shortcuts). */
15052
+ keyboard?: ResolvedKeyboardCustomization;
14746
15053
  }
14747
15054
  interface UseFindReplaceResult {
14748
15055
  findReplaceOpen: boolean;
@@ -14760,7 +15067,7 @@ interface UseFindReplaceResult {
14760
15067
  handleReplace: () => void;
14761
15068
  handleReplaceAll: () => void;
14762
15069
  }
14763
- declare function useFindReplace({ slides, mode, onSetActiveSlideIndex, onSetSelectedElementId, onUpdateSlides, onMarkDirty }: UseFindReplaceInput): UseFindReplaceResult;
15070
+ declare function useFindReplace({ slides, mode, onSetActiveSlideIndex, onSetSelectedElementId, onUpdateSlides, onMarkDirty, keyboard }: UseFindReplaceInput): UseFindReplaceResult;
14764
15071
  //#endregion
14765
15072
  //#region src/viewer/components/hyperlink-edit-types.d.ts
14766
15073
  /** The type of hyperlink target. */
@@ -15653,6 +15960,9 @@ interface ViewerUIState {
15653
15960
  setAccessibilityIssues: React.Dispatch<React.SetStateAction<AccessibilityIssue[]>>;
15654
15961
  contextMenuState: ElementContextMenuState | null;
15655
15962
  setContextMenuState: React.Dispatch<React.SetStateAction<ElementContextMenuState | null>>;
15963
+ /** The empty-canvas (no element hit) right-click menu; mutually exclusive with `contextMenuState`. */
15964
+ canvasContextMenuState: CanvasContextMenuState | null;
15965
+ setCanvasContextMenuState: React.Dispatch<React.SetStateAction<CanvasContextMenuState | null>>;
15656
15966
  tableEditorState: TableCellEditorState | null;
15657
15967
  setTableEditorState: React.Dispatch<React.SetStateAction<TableCellEditorState | null>>;
15658
15968
  spellCheckEnabled: boolean;
@@ -15762,6 +16072,8 @@ interface UseEditorOperationsInput {
15762
16072
  handlerRef?: React$1.RefObject<PptxHandler | null> | React$1.MutableRefObject<PptxHandler | null>;
15763
16073
  /** AutoCorrect transform applied to committed inline text edits. */
15764
16074
  transformCommittedText?: (text: string) => string;
16075
+ /** Host keyboard customisation, forwarded to the Find shortcut. */
16076
+ keyboard?: ResolvedKeyboardCustomization;
15765
16077
  }
15766
16078
  interface EditorOperationsResult {
15767
16079
  ops: ElementOperations;
@@ -15865,6 +16177,8 @@ interface SlideCanvasProps {
15865
16177
  onContextMenu: (elementId: string, e: React$1.MouseEvent) => void;
15866
16178
  /** Called when the user presses mouse down on empty canvas space. */
15867
16179
  onCanvasMouseDown?: (e: React$1.MouseEvent) => void;
16180
+ /** Right-click on empty canvas (no element hit); opens the canvas context menu. */
16181
+ onCanvasContextMenu?: (e: React$1.MouseEvent) => void;
15868
16182
  onResizePointerDown: (elementId: string, e: React$1.MouseEvent, handle: string) => void;
15869
16183
  onAdjustmentPointerDown: (elementId: string, e: React$1.MouseEvent, descriptor: ShapeAdjustmentHandleDescriptor) => void;
15870
16184
  /** Commit a new rotation (degrees) when the on-canvas rotate handle is dragged. */
@@ -17341,6 +17655,8 @@ interface UseKeyboardShortcutWiringInput {
17341
17655
  pasteFormatToSelection: (targetIds: string[]) => void;
17342
17656
  /** Ctrl/Cmd+Alt+V: open the Paste Special dialog. */
17343
17657
  onPasteSpecial: () => void;
17658
+ /** Host UI customisation forwarded to `useKeyboardShortcuts`. */
17659
+ customization?: ResolvedCustomization;
17344
17660
  }
17345
17661
  declare function useKeyboardShortcutWiring(input: UseKeyboardShortcutWiringInput): void;
17346
17662
  //#endregion
@@ -17420,6 +17736,10 @@ interface UseViewerIntegrationInput {
17420
17736
  onZoomChange: ((zoom: number) => void) | undefined;
17421
17737
  onSelectionChange: ((ids: string[]) => void) | undefined;
17422
17738
  onSlideCountChange: ((count: number) => void) | undefined;
17739
+ /** Host UI customisation helpers, spread onto the imperative handle. */
17740
+ customizationApi?: ViewerCustomizationApi;
17741
+ /** Resolved host UI customisation, read by the keyboard shortcuts. */
17742
+ customization?: ResolvedCustomization;
17423
17743
  }
17424
17744
  interface ViewerIntegrationResult {
17425
17745
  exportHandlers: IOHandlersResult['exportHandlers'];
@@ -17820,6 +18140,11 @@ interface UseKeyboardShortcutsInput {
17820
18140
  activeTool: DrawingTool;
17821
18141
  /** Whether at least one element is selected. */
17822
18142
  hasSelection: boolean;
18143
+ /**
18144
+ * Host UI customisation: disabled / remapped editor shortcuts, and the
18145
+ * `presentMode` feature gate for F5 / Shift+F5. Omitted customises nothing.
18146
+ */
18147
+ customization?: ResolvedCustomization;
17823
18148
  /** The IDs of the currently selected elements (effective). */
17824
18149
  effectiveSelectedIds: string[];
17825
18150
  onDelete: () => void;