pptx-react-viewer 4.13.0 → 4.15.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 (111) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/{AiChatPanel-AQDB2BLO.mjs → AiChatPanel-7OVUGUKW.mjs} +4 -4
  3. package/dist/AiChatPanel-7OVUGUKW.mjs.br +0 -0
  4. package/dist/AiChatPanel-7OVUGUKW.mjs.gz +0 -0
  5. package/dist/{AiChatPanel-VXQUQNZ6.js → AiChatPanel-CDQWJTWL.js} +28 -28
  6. package/dist/AiChatPanel-CDQWJTWL.js.br +0 -0
  7. package/dist/AiChatPanel-CDQWJTWL.js.gz +0 -0
  8. package/dist/{Model3DScene-UHHKYZSK.mjs → Model3DScene-A3CPMFAO.mjs} +1 -1
  9. package/dist/Model3DScene-A3CPMFAO.mjs.br +0 -0
  10. package/dist/Model3DScene-A3CPMFAO.mjs.gz +0 -0
  11. package/dist/{Model3DScene-I6OVMXEE.js → Model3DScene-OLGB7Z7Q.js} +2 -2
  12. package/dist/{Model3DScene-I6OVMXEE.js.br → Model3DScene-OLGB7Z7Q.js.br} +0 -0
  13. package/dist/Model3DScene-OLGB7Z7Q.js.gz +0 -0
  14. package/dist/{chunk-UOS5HJLG.js → chunk-2CSRCH4H.js} +2487 -1321
  15. package/dist/chunk-2CSRCH4H.js.br +0 -0
  16. package/dist/chunk-2CSRCH4H.js.gz +0 -0
  17. package/dist/{chunk-KA24ZRTJ.js → chunk-6ZPXMS64.js} +1517 -1526
  18. package/dist/chunk-6ZPXMS64.js.br +0 -0
  19. package/dist/chunk-6ZPXMS64.js.gz +0 -0
  20. package/dist/{chunk-SLMDLVFV.mjs → chunk-AHJ4ND7Q.mjs} +1 -1
  21. package/dist/chunk-AHJ4ND7Q.mjs.br +0 -0
  22. package/dist/chunk-AHJ4ND7Q.mjs.gz +0 -0
  23. package/dist/{chunk-JUUI5DHB.mjs → chunk-AIWEM7VE.mjs} +2478 -1320
  24. package/dist/chunk-AIWEM7VE.mjs.br +0 -0
  25. package/dist/chunk-AIWEM7VE.mjs.gz +0 -0
  26. package/dist/{chunk-55OLQ7HS.mjs → chunk-CJSIEITL.mjs} +3 -0
  27. package/dist/chunk-CJSIEITL.mjs.br +0 -0
  28. package/dist/chunk-CJSIEITL.mjs.gz +0 -0
  29. package/dist/{chunk-5YW6N5KJ.js → chunk-CNXVOFUW.js} +197 -197
  30. package/dist/chunk-CNXVOFUW.js.br +0 -0
  31. package/dist/chunk-CNXVOFUW.js.gz +0 -0
  32. package/dist/{chunk-HJBTQ234.mjs → chunk-DNWIW75I.mjs} +6 -5
  33. package/dist/chunk-DNWIW75I.mjs.br +0 -0
  34. package/dist/chunk-DNWIW75I.mjs.gz +0 -0
  35. package/dist/{chunk-57RBEPPQ.js → chunk-HGO243GV.js} +818 -816
  36. package/dist/chunk-HGO243GV.js.br +0 -0
  37. package/dist/chunk-HGO243GV.js.gz +0 -0
  38. package/dist/{chunk-5DQNWKOF.mjs → chunk-Q5VQ53R3.mjs} +2 -2
  39. package/dist/chunk-Q5VQ53R3.mjs.br +0 -0
  40. package/dist/chunk-Q5VQ53R3.mjs.gz +0 -0
  41. package/dist/{chunk-C5ZJGQ2F.mjs → chunk-RQCAXUVQ.mjs} +342 -351
  42. package/dist/chunk-RQCAXUVQ.mjs.br +0 -0
  43. package/dist/chunk-RQCAXUVQ.mjs.gz +0 -0
  44. package/dist/{chunk-MXH7RMTF.js → chunk-UP6PJEHM.js} +5 -5
  45. package/dist/chunk-UP6PJEHM.js.br +0 -0
  46. package/dist/chunk-UP6PJEHM.js.gz +0 -0
  47. package/dist/{chunk-HIYK7HPX.js → chunk-XEYB25ZT.js} +3 -0
  48. package/dist/chunk-XEYB25ZT.js.br +0 -0
  49. package/dist/chunk-XEYB25ZT.js.gz +0 -0
  50. package/dist/i18n.js +4 -4
  51. package/dist/i18n.js.br +0 -0
  52. package/dist/i18n.js.gz +0 -0
  53. package/dist/i18n.mjs +1 -1
  54. package/dist/i18n.mjs.br +0 -0
  55. package/dist/i18n.mjs.gz +0 -0
  56. package/dist/index.d.ts +293 -268
  57. package/dist/index.js +63 -63
  58. package/dist/index.js.br +0 -0
  59. package/dist/index.js.gz +0 -0
  60. package/dist/index.mjs +6 -6
  61. package/dist/index.mjs.br +0 -0
  62. package/dist/index.mjs.gz +0 -0
  63. package/dist/internals.d.ts +600 -575
  64. package/dist/internals.js +105 -105
  65. package/dist/internals.js.br +0 -0
  66. package/dist/internals.js.gz +0 -0
  67. package/dist/internals.mjs +4 -4
  68. package/dist/internals.mjs.br +0 -0
  69. package/dist/internals.mjs.gz +0 -0
  70. package/dist/pptx-viewer.css +1 -1
  71. package/dist/pptx-viewer.css.br +0 -0
  72. package/dist/pptx-viewer.css.gz +0 -0
  73. package/dist/viewer/index.d.ts +161 -136
  74. package/dist/viewer/index.js +27 -27
  75. package/dist/viewer/index.js.br +0 -0
  76. package/dist/viewer/index.js.gz +0 -0
  77. package/dist/viewer/index.mjs +6 -6
  78. package/dist/viewer/index.mjs.br +0 -0
  79. package/dist/viewer/index.mjs.gz +0 -0
  80. package/package.json +1 -1
  81. package/dist/AiChatPanel-AQDB2BLO.mjs.br +0 -0
  82. package/dist/AiChatPanel-AQDB2BLO.mjs.gz +0 -0
  83. package/dist/AiChatPanel-VXQUQNZ6.js.br +0 -0
  84. package/dist/AiChatPanel-VXQUQNZ6.js.gz +0 -0
  85. package/dist/Model3DScene-I6OVMXEE.js.gz +0 -0
  86. package/dist/Model3DScene-UHHKYZSK.mjs.br +0 -0
  87. package/dist/Model3DScene-UHHKYZSK.mjs.gz +0 -0
  88. package/dist/chunk-55OLQ7HS.mjs.br +0 -0
  89. package/dist/chunk-55OLQ7HS.mjs.gz +0 -0
  90. package/dist/chunk-57RBEPPQ.js.br +0 -0
  91. package/dist/chunk-57RBEPPQ.js.gz +0 -0
  92. package/dist/chunk-5DQNWKOF.mjs.br +0 -0
  93. package/dist/chunk-5DQNWKOF.mjs.gz +0 -0
  94. package/dist/chunk-5YW6N5KJ.js.br +0 -0
  95. package/dist/chunk-5YW6N5KJ.js.gz +0 -0
  96. package/dist/chunk-C5ZJGQ2F.mjs.br +0 -0
  97. package/dist/chunk-C5ZJGQ2F.mjs.gz +0 -0
  98. package/dist/chunk-HIYK7HPX.js.br +0 -0
  99. package/dist/chunk-HIYK7HPX.js.gz +0 -0
  100. package/dist/chunk-HJBTQ234.mjs.br +0 -0
  101. package/dist/chunk-HJBTQ234.mjs.gz +0 -0
  102. package/dist/chunk-JUUI5DHB.mjs.br +0 -0
  103. package/dist/chunk-JUUI5DHB.mjs.gz +0 -0
  104. package/dist/chunk-KA24ZRTJ.js.br +0 -0
  105. package/dist/chunk-KA24ZRTJ.js.gz +0 -0
  106. package/dist/chunk-MXH7RMTF.js.br +0 -0
  107. package/dist/chunk-MXH7RMTF.js.gz +0 -0
  108. package/dist/chunk-SLMDLVFV.mjs.br +0 -0
  109. package/dist/chunk-SLMDLVFV.mjs.gz +0 -0
  110. package/dist/chunk-UOS5HJLG.js.br +0 -0
  111. package/dist/chunk-UOS5HJLG.js.gz +0 -0
package/dist/index.d.ts CHANGED
@@ -13500,189 +13500,6 @@ interface CollaborationLivePatcher {
13500
13500
  /** Drop pending work, cancel timers and detach the doc. */
13501
13501
  dispose: () => void;
13502
13502
  }
13503
- /**
13504
- * A font supplied by the host application. The package never ships fonts:
13505
- * applications provide a licensed URL, data URL, or blob URL for their users.
13506
- */
13507
- interface ViewerFontSource {
13508
- family: string;
13509
- src: string;
13510
- format?: 'truetype' | 'opentype' | 'woff' | 'woff2';
13511
- weight?: string | number;
13512
- style?: 'normal' | 'italic';
13513
- }
13514
- //#endregion
13515
- //#region src/render/presentation-file-kinds.d.ts
13516
- /**
13517
- * presentation-file-kinds: the one place that answers "can the viewer open
13518
- * this file?" and "what should the saved copy be called?".
13519
- *
13520
- * ## Why this is a shared decision and not five allow-lists
13521
- *
13522
- * The loader reads more formats than any single UI advertises. Legacy binary
13523
- * `.ppt` (PowerPoint 97-2003) is the sharp example: `PptxHandler.load()` has
13524
- * detected the OLE compound-file container and converted the binary deck
13525
- * through the regular pptx pipeline for some time, but the product kept saying
13526
- * it was unsupported, and a picker that filters the extension out makes a
13527
- * working loader unreachable in practice. Whenever the loader learns a format,
13528
- * exactly one list has to change.
13529
- *
13530
- * ## Read many, write several
13531
- *
13532
- * Input is a superset of output. We READ `.pptx`, `.ppsx`, `.pptm`, `.potx`,
13533
- * legacy binary `.ppt` and portable `pptx-viewer-json`; we WRITE the OpenXML
13534
- * family plus legacy binary `.ppt` (via `packages/core/src/core/ppt/writer/`,
13535
- * a real MS-PPT/OLE2 encoder, not a stub). `savedPresentationFileName`
13536
- * REPLACES the source extension with the extension of the format actually
13537
- * being written rather than keeping the source's: a deck opened as
13538
- * `report.pptx` and saved back as `.ppt` (or vice versa) must have its name
13539
- * agree with its bytes, which is the kind of mismatch PowerPoint itself
13540
- * refuses to open.
13541
- *
13542
- * This module deliberately imports nothing, so any layer (render, export, a
13543
- * binding, a host app) can depend on it without risking an import cycle.
13544
- *
13545
- * @module render/presentation-file-kinds
13546
- */
13547
- /**
13548
- * Extensions the built-in file picker offers, in the order it offers them.
13549
- *
13550
- * `.ppt` is in the list because the loader genuinely handles it, not as a
13551
- * courtesy: see `packages/core/src/core/ppt/` and the `ppt-import` integration
13552
- * suite, which asserts a `.ppt` loads to the same model as the `.pptx` it was
13553
- * exported from.
13554
- */
13555
- declare const PRESENTATION_OPEN_EXTENSIONS: readonly ['.pptx', '.ppsx', '.pptm', '.potx', '.ppt', '.json'];
13556
- /** Comma-separated `accept` attribute for a presentation file input. */
13557
- declare const PPTX_OPEN_ACCEPT: string;
13558
- /**
13559
- * True when a picked / dropped file's name looks like something the loader can
13560
- * open. Use this instead of a hand-rolled `endsWith` chain: a drop handler that
13561
- * disagrees with the picker's `accept` list is a format that is supported by
13562
- * mouse but not by drag, which is how `.ppt` stayed invisible.
13563
- *
13564
- * Extension-only, by design. The real answer comes from the container sniff in
13565
- * `PptxHandler.load()`; this is only the cheap pre-filter a drop target needs
13566
- * before it hands bytes to the loader.
13567
- */
13568
- declare function isSupportedPresentationFile(name: string | null | undefined): boolean;
13569
- /**
13570
- * True for the binary PowerPoint 97-2003 family. `.ppt` itself is now also a
13571
- * SAVE target (see {@link SavedPresentationFormat}); `.pps`/`.pot` (97-2003
13572
- * show/template) remain read-only siblings sharing the same record format.
13573
- */
13574
- declare function isLegacyBinaryPresentation(name: string | null | undefined): boolean;
13575
- /** The formats the save path can produce. */
13576
- type SavedPresentationFormat = 'pptx' | 'ppsx' | 'pptm' | 'ppt';
13577
- /**
13578
- * The stem of a presentation file name: directories and any loadable extension
13579
- * removed. `C:\decks\report.ppt` becomes `report`; a name with no recognised
13580
- * extension is kept whole, so `Untitled Presentation` survives intact rather
13581
- * than losing everything after its last dot.
13582
- */
13583
- declare function presentationBaseName(sourceName: string | null | undefined, fallback?: string): string;
13584
- /**
13585
- * The name a saved copy should be offered under: the source stem plus the
13586
- * extension of the format actually being written.
13587
- *
13588
- * This is what turns `report.ppt` into `report.pptx` on a regular Save As,
13589
- * and `report.pptx` into `report.ppt` when the user explicitly picks the
13590
- * PowerPoint 97-2003 format. Keeping the source extension would mislabel the
13591
- * bytes either way.
13592
- */
13593
- declare function savedPresentationFileName(sourceName: string | null | undefined, format?: SavedPresentationFormat): string;
13594
- //#endregion
13595
- //#region src/render/editor-keymap.d.ts
13596
- /** A logical editor command produced by one key press. */
13597
- 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';
13598
- //#endregion
13599
- //#region src/render/merge-shapes/merge-shapes-menu.d.ts
13600
- /** The right-click command id for each operation. */
13601
- type MergeShapesCommandId = 'merge-union' | 'merge-combine' | 'merge-fragment' | 'merge-intersect' | 'merge-subtract';
13602
- /** Every command a canvas context menu can offer, in no particular order. */
13603
- 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';
13604
- //#endregion
13605
- //#region src/render/canvas-context-menu-commands.d.ts
13606
- /**
13607
- * The right-click menu for the empty slide canvas (no element under the
13608
- * cursor), as distinct from {@link ./context-menu-commands}'s per-element menu.
13609
- *
13610
- * Right-clicking empty canvas used to do nothing at all in every binding: React
13611
- * and Vue both bailed out early (`getElementIdFromEvent` returns `null`, so the
13612
- * handler just returns) rather than opening a menu, and the other three never
13613
- * wired a handler for it either. PowerPoint offers Paste, Layout, Reset,
13614
- * Format Background and view toggles (Grid and Guides, Ruler) from this menu;
13615
- * this module is the one list every binding renders instead of five omissions.
13616
- *
13617
- * @module render/canvas-context-menu-commands
13618
- */
13619
- /** Every command the empty-canvas context menu can offer, in no particular order. */
13620
- type CanvasContextMenuCommandId = 'paste' | 'layout' | 'reset-slide' | 'format-background' | 'grid-and-guides' | 'ruler';
13621
- //#endregion
13622
- //#region src/render/insert-chart.d.ts
13623
- /**
13624
- * Dropdown ids for the insert-chart menu. Distinct from `PptxChartType`
13625
- * because PowerPoint offers Column (vertical) and Bar (horizontal) as two
13626
- * entries over the same underlying `'bar'` chart type, and because `'pareto'`
13627
- * has no `PptxChartType` of its own: it is a dropdown entry that resolves to
13628
- * `type: 'histogram'` (see docs/guide/limitations.md's ChartEx row) with a
13629
- * frequency-plus-cumulative-percentage default shape. The other six ChartEx
13630
- * ids (`histogram` through `regionMap`) map one-to-one onto their chart type.
13631
- */
13632
- type InsertChartKind = 'column' | 'bar' | 'line' | 'pie' | 'doughnut' | 'area' | 'scatter' | 'histogram' | 'pareto' | 'funnel' | 'treemap' | 'sunburst' | 'boxWhisker' | 'regionMap';
13633
- /** In-memory clipboard payload stored when an element is copied or cut. */
13634
- interface ElementClipboardPayload {
13635
- element: PptxElement;
13636
- isTemplate: boolean;
13637
- }
13638
- //#endregion
13639
- //#region src/render/image-file-insertion.d.ts
13640
- /**
13641
- * Decode a local image File/Blob into a centred element, fitting the slide
13642
- * without upscaling. Dimensions are slide pixels; image bytes are preserved.
13643
- *
13644
- * Resolves null for unsupported/unreadable images, invalid bounds, cancellation,
13645
- * or unavailable browser APIs. Importing this module is safe outside a browser.
13646
- * No slide, selection, history, clipboard, or network state is changed. The
13647
- * caller must still validate its document/slide destination before committing.
13648
- */
13649
- declare function createImageElementFromFile(file: Blob, canvasSize: CanvasSize$1, signal?: AbortSignal): Promise<ImagePptxElement | null>;
13650
- //#endregion
13651
- //#region src/render/editor-image-paste.d.ts
13652
- /** A currently editable slide. Return null while loading or outside canvas editing. */
13653
- interface EditorImagePasteTarget {
13654
- documentId: object;
13655
- slideId: string;
13656
- canvasSize: CanvasSize$1;
13657
- }
13658
- interface EditorImagePasteOptions {
13659
- getCanvas(): HTMLElement | null;
13660
- getTarget(): EditorImagePasteTarget | null;
13661
- /** Use the normal editor command so selection, dirty state and Undo stay consistent. */
13662
- insertElement(element: ImagePptxElement): void;
13663
- }
13664
- //#endregion
13665
- //#region src/render/zoom-return-navigation.d.ts
13666
- /**
13667
- * The navigation-relevant fields of a Zoom click target, independent of
13668
- * `zoomType`.
13669
- *
13670
- * `returnToParent` is already resolved to its EFFECTIVE value here (not the
13671
- * raw, possibly-`undefined` `ZoomPptxElement`/`SummaryZoomTarget` field):
13672
- * `CT_ZoomObjectProperties/@returnToParent` (MS-PPTX) is `<xsd:attribute
13673
- * name="returnToParent" type="xsd:boolean" use="optional" default="true"/>`,
13674
- * so an ABSENT attribute means true, not false. Core deliberately stores
13675
- * `undefined` rather than fabricating `true` (so a round-trip never invents
13676
- * an attribute the source never had), which makes `Boolean(x)` the wrong way
13677
- * to read it; the two `resolve*NavigationTarget` functions below are the only
13678
- * place that distinction should be made.
13679
- */
13680
- interface ZoomNavigationTarget {
13681
- targetSlideIndex: number;
13682
- targetSectionId?: string;
13683
- returnToParent: boolean;
13684
- transitionDurationMs?: number;
13685
- }
13686
13503
  type BackstagePage = 'home' | 'new' | 'open' | 'info' | 'save' | 'saveAs' | 'print' | 'share' | 'export' | 'close' | 'account' | 'options';
13687
13504
  //#endregion
13688
13505
  //#region src/render/backstage-cards.d.ts
@@ -13699,52 +13516,6 @@ type BackstagePage = 'home' | 'new' | 'open' | 'info' | 'save' | 'saveAs' | 'pri
13699
13516
  */
13700
13517
  type BackstageCardId = 'protect' | 'inspect' | 'embedFonts' | 'signatures' | 'versionHistory' | 'saveAsPptx' | 'saveAsPpsx' | 'saveAsPptm' | 'saveAsPpt' | 'pdf' | 'png' | 'video' | 'gif' | 'json' | 'copyImage' | 'print' | 'share';
13701
13518
  //#endregion
13702
- //#region src/render/account.d.ts
13703
- /** Local-only display profile shown in File > Account. Never sent anywhere; purely cosmetic. */
13704
- interface ViewerProfile {
13705
- displayName: string;
13706
- /** CSS color for the avatar bubble background, e.g. `'#c2431f'`. */
13707
- avatarColor: string;
13708
- /** Single character shown in the avatar bubble. Derived from `displayName` when omitted. */
13709
- initial?: string;
13710
- }
13711
- declare const DEFAULT_VIEWER_PROFILE: ViewerProfile;
13712
- /** Suggested avatar color swatches for the Account profile editor. */
13713
- declare const AVATAR_COLOR_SWATCHES: readonly string[];
13714
- /** Derive the avatar-bubble initial from a profile, falling back to `'?'` for an empty name. */
13715
- declare function resolveProfileInitial(profile: ViewerProfile): string;
13716
- /**
13717
- * Optional hook point for hosts that want to wire a real sign-in flow into
13718
- * File > Account. Disabled by default: the Account page renders nothing
13719
- * extra unless a host explicitly opts in by passing `enabled: true`.
13720
- * See docs/guide for wiring instructions.
13721
- */
13722
- interface AccountAuthConfig {
13723
- enabled: boolean;
13724
- onSignIn: () => void;
13725
- signedInUser?: {
13726
- name: string;
13727
- email?: string;
13728
- avatarUrl?: string;
13729
- };
13730
- }
13731
- interface LocalStorageUsageSummary {
13732
- /** Number of presentations with a local autosave/recovery snapshot. */
13733
- presentationCount: number;
13734
- /** Total bytes across every stored snapshot. */
13735
- totalBytes: number;
13736
- }
13737
- /** Summarize local (IndexedDB) storage usage for the Account > Storage & Privacy panel. */
13738
- declare function getLocalStorageUsageSummary(): Promise<LocalStorageUsageSummary>;
13739
- /**
13740
- * Delete every locally stored presentation/recovery snapshot and persisted
13741
- * viewer preference (theme/locale/profile). Irreversible; callers should
13742
- * confirm with the user before invoking this.
13743
- */
13744
- declare function clearAllLocalViewerData(): Promise<void>;
13745
- /** Persist an updated profile via the shared viewer-prefs store. */
13746
- declare function saveViewerProfile(profile: ViewerProfile): void;
13747
- //#endregion
13748
13519
  //#region src/render/toolbar-actions.d.ts
13749
13520
  /**
13750
13521
  * Toolbar action / ribbon-tab visibility: a single, framework-agnostic
@@ -13778,6 +13549,39 @@ type ToolbarActionId = ToolbarButtonId | ToolbarTabId;
13778
13549
  */
13779
13550
  type RibbonContextualTabId = 'shapeFormat' | 'pictureFormat' | 'tableDesign' | 'chartDesign' | 'smartArtDesign';
13780
13551
  //#endregion
13552
+ //#region src/render/canvas-context-menu-commands.d.ts
13553
+ /**
13554
+ * The right-click menu for the empty slide canvas (no element under the
13555
+ * cursor), as distinct from {@link ./context-menu-commands}'s per-element menu.
13556
+ *
13557
+ * Right-clicking empty canvas used to do nothing at all in every binding: React
13558
+ * and Vue both bailed out early (`getElementIdFromEvent` returns `null`, so the
13559
+ * handler just returns) rather than opening a menu, and the other three never
13560
+ * wired a handler for it either. PowerPoint offers Paste, Layout, Reset,
13561
+ * Format Background and view toggles (Grid and Guides, Ruler) from this menu;
13562
+ * this module is the one list every binding renders instead of five omissions.
13563
+ *
13564
+ * @module render/canvas-context-menu-commands
13565
+ */
13566
+ /** Every command the empty-canvas context menu can offer, in no particular order. */
13567
+ type CanvasContextMenuCommandId = 'paste' | 'layout' | 'reset-slide' | 'format-background' | 'grid-and-guides' | 'ruler';
13568
+ //#endregion
13569
+ //#region src/render/merge-shapes/merge-shapes-menu.d.ts
13570
+ /** The right-click command id for each operation. */
13571
+ type MergeShapesCommandId = 'merge-union' | 'merge-combine' | 'merge-fragment' | 'merge-intersect' | 'merge-subtract';
13572
+ /** Every command a canvas context menu can offer, in no particular order. */
13573
+ 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';
13574
+ /** Every command the Edit Points right-click menu can offer. */
13575
+ type EditPointsCommandId = 'add-point' | 'delete-point' | 'delete-segment' | 'open-path' | 'close-path' | 'smooth-point' | 'straight-point' | 'corner-point' | 'straight-segment' | 'curved-segment' | 'exit';
13576
+ //#endregion
13577
+ //#region src/render/edit-points/freeform-tool-geometry.d.ts
13578
+ /** The two click-to-place drawing tools. */
13579
+ type FreeformToolKind = 'freeformShape' | 'curve';
13580
+ //#endregion
13581
+ //#region src/render/editor-keymap.d.ts
13582
+ /** A logical editor command produced by one key press. */
13583
+ 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';
13584
+ //#endregion
13781
13585
  //#region src/render/options/viewer-options.d.ts
13782
13586
  /**
13783
13587
  * Full PowerPoint "File > Options" parity model.
@@ -13854,6 +13658,8 @@ interface ViewerSaveOptions {
13854
13658
  clearCacheOnClose: boolean;
13855
13659
  }
13856
13660
  interface ViewerAccessibilityOptions {
13661
+ /** Browser speech-recognition language; automatic follows the browser language. */
13662
+ subtitleLanguage?: string;
13857
13663
  showAccessibilityStatus: boolean;
13858
13664
  feedbackWithSound: boolean;
13859
13665
  soundScheme: FeedbackSoundScheme;
@@ -13932,46 +13738,11 @@ interface ViewerOptions {
13932
13738
  advanced: ViewerAdvancedOptions;
13933
13739
  ribbon: ViewerRibbonOptions;
13934
13740
  quickAccess: ViewerQuickAccessOptions;
13935
- trust: ViewerTrustOptions;
13936
- }
13937
- type ViewerOptionsGroupId = keyof ViewerOptions;
13938
- type ViewerOptionPrimitive = boolean | number | string;
13939
- type StoredViewerOptions = { [G in ViewerOptionsGroupId]?: Partial<ViewerOptions[G]>; };
13940
- //#endregion
13941
- //#region src/render/viewer-prefs-storage.d.ts
13942
- /**
13943
- * `localStorage`-backed viewer chrome preferences (theme/locale/profile),
13944
- * shared by every binding.
13945
- *
13946
- * This is the persistence layer behind File > Options' Appearance/Language
13947
- * tabs and File > Account's profile editor when a host doesn't supply its
13948
- * own `onThemeChange`/`onLocaleChange`/`onProfileChange` callbacks - i.e. the
13949
- * "standalone" fallback path. Hosts that do wire those callbacks own
13950
- * persistence themselves and this module is never touched.
13951
- */
13952
- declare const VIEWER_PREFS_STORAGE_KEY = "pptx-viewer-prefs";
13953
- interface StoredViewerPrefs {
13954
- /** Key into the shared `THEME_CATALOG` (or a host-supplied `availableThemes` catalog). */
13955
- themeKey?: string;
13956
- /** Locale code, e.g. `'fr'`. */
13957
- localeCode?: string;
13958
- /** Local-only display profile shown in File > Account. */
13959
- profile?: ViewerProfile;
13960
- /** Sparse File > Options diff against `DEFAULT_VIEWER_OPTIONS`. */
13961
- options?: StoredViewerOptions;
13741
+ trust: ViewerTrustOptions;
13962
13742
  }
13963
- /** Read all persisted viewer preferences. Returns `{}` when unavailable, unset, or corrupt. */
13964
- declare function readStoredViewerPrefs(): StoredViewerPrefs;
13965
- /** Merge `patch` into the persisted viewer preferences. Silently no-ops when storage is unavailable. */
13966
- declare function writeStoredViewerPrefs(patch: Partial<StoredViewerPrefs>): void;
13967
- /** Remove all persisted viewer preferences. Silently no-ops when storage is unavailable. */
13968
- declare function clearStoredViewerPrefs(): void;
13969
- /** Every command the Edit Points right-click menu can offer. */
13970
- type EditPointsCommandId = 'add-point' | 'delete-point' | 'delete-segment' | 'open-path' | 'close-path' | 'smooth-point' | 'straight-point' | 'corner-point' | 'straight-segment' | 'curved-segment' | 'exit';
13971
- //#endregion
13972
- //#region src/render/edit-points/freeform-tool-geometry.d.ts
13973
- /** The two click-to-place drawing tools. */
13974
- type FreeformToolKind = 'freeformShape' | 'curve';
13743
+ type ViewerOptionsGroupId = keyof ViewerOptions;
13744
+ type ViewerOptionPrimitive = boolean | number | string;
13745
+ type StoredViewerOptions = { [G in ViewerOptionsGroupId]?: Partial<ViewerOptions[G]>; };
13975
13746
  //#endregion
13976
13747
  //#region src/render/options/viewer-options-controls.d.ts
13977
13748
  /**
@@ -14743,6 +14514,248 @@ interface ViewerCustomizationApi {
14743
14514
  setFeatureEnabled(feature: ViewerFeatureId, enabled: boolean): void;
14744
14515
  setDialogAvailable(dialog: ViewerDialogId, available: boolean): void;
14745
14516
  }
14517
+ /**
14518
+ * A font supplied by the host application. The package never ships fonts:
14519
+ * applications provide a licensed URL, data URL, or blob URL for their users.
14520
+ */
14521
+ interface ViewerFontSource {
14522
+ family: string;
14523
+ src: string;
14524
+ format?: 'truetype' | 'opentype' | 'woff' | 'woff2';
14525
+ weight?: string | number;
14526
+ style?: 'normal' | 'italic';
14527
+ }
14528
+ //#endregion
14529
+ //#region src/render/presentation-file-kinds.d.ts
14530
+ /**
14531
+ * presentation-file-kinds: the one place that answers "can the viewer open
14532
+ * this file?" and "what should the saved copy be called?".
14533
+ *
14534
+ * ## Why this is a shared decision and not five allow-lists
14535
+ *
14536
+ * The loader reads more formats than any single UI advertises. Legacy binary
14537
+ * `.ppt` (PowerPoint 97-2003) is the sharp example: `PptxHandler.load()` has
14538
+ * detected the OLE compound-file container and converted the binary deck
14539
+ * through the regular pptx pipeline for some time, but the product kept saying
14540
+ * it was unsupported, and a picker that filters the extension out makes a
14541
+ * working loader unreachable in practice. Whenever the loader learns a format,
14542
+ * exactly one list has to change.
14543
+ *
14544
+ * ## Read many, write several
14545
+ *
14546
+ * Input is a superset of output. We READ `.pptx`, `.ppsx`, `.pptm`, `.potx`,
14547
+ * legacy binary `.ppt` and portable `pptx-viewer-json`; we WRITE the OpenXML
14548
+ * family plus legacy binary `.ppt` (via `packages/core/src/core/ppt/writer/`,
14549
+ * a real MS-PPT/OLE2 encoder, not a stub). `savedPresentationFileName`
14550
+ * REPLACES the source extension with the extension of the format actually
14551
+ * being written rather than keeping the source's: a deck opened as
14552
+ * `report.pptx` and saved back as `.ppt` (or vice versa) must have its name
14553
+ * agree with its bytes, which is the kind of mismatch PowerPoint itself
14554
+ * refuses to open.
14555
+ *
14556
+ * This module deliberately imports nothing, so any layer (render, export, a
14557
+ * binding, a host app) can depend on it without risking an import cycle.
14558
+ *
14559
+ * @module render/presentation-file-kinds
14560
+ */
14561
+ /**
14562
+ * Extensions the built-in file picker offers, in the order it offers them.
14563
+ *
14564
+ * `.ppt` is in the list because the loader genuinely handles it, not as a
14565
+ * courtesy: see `packages/core/src/core/ppt/` and the `ppt-import` integration
14566
+ * suite, which asserts a `.ppt` loads to the same model as the `.pptx` it was
14567
+ * exported from.
14568
+ */
14569
+ declare const PRESENTATION_OPEN_EXTENSIONS: readonly ['.pptx', '.ppsx', '.pptm', '.potx', '.ppt', '.json'];
14570
+ /** Comma-separated `accept` attribute for a presentation file input. */
14571
+ declare const PPTX_OPEN_ACCEPT: string;
14572
+ /**
14573
+ * True when a picked / dropped file's name looks like something the loader can
14574
+ * open. Use this instead of a hand-rolled `endsWith` chain: a drop handler that
14575
+ * disagrees with the picker's `accept` list is a format that is supported by
14576
+ * mouse but not by drag, which is how `.ppt` stayed invisible.
14577
+ *
14578
+ * Extension-only, by design. The real answer comes from the container sniff in
14579
+ * `PptxHandler.load()`; this is only the cheap pre-filter a drop target needs
14580
+ * before it hands bytes to the loader.
14581
+ */
14582
+ declare function isSupportedPresentationFile(name: string | null | undefined): boolean;
14583
+ /**
14584
+ * True for the binary PowerPoint 97-2003 family. `.ppt` itself is now also a
14585
+ * SAVE target (see {@link SavedPresentationFormat}); `.pps`/`.pot` (97-2003
14586
+ * show/template) remain read-only siblings sharing the same record format.
14587
+ */
14588
+ declare function isLegacyBinaryPresentation(name: string | null | undefined): boolean;
14589
+ /** The formats the save path can produce. */
14590
+ type SavedPresentationFormat = 'pptx' | 'ppsx' | 'pptm' | 'ppt';
14591
+ /**
14592
+ * The stem of a presentation file name: directories and any loadable extension
14593
+ * removed. `C:\decks\report.ppt` becomes `report`; a name with no recognised
14594
+ * extension is kept whole, so `Untitled Presentation` survives intact rather
14595
+ * than losing everything after its last dot.
14596
+ */
14597
+ declare function presentationBaseName(sourceName: string | null | undefined, fallback?: string): string;
14598
+ /**
14599
+ * The name a saved copy should be offered under: the source stem plus the
14600
+ * extension of the format actually being written.
14601
+ *
14602
+ * This is what turns `report.ppt` into `report.pptx` on a regular Save As,
14603
+ * and `report.pptx` into `report.ppt` when the user explicitly picks the
14604
+ * PowerPoint 97-2003 format. Keeping the source extension would mislabel the
14605
+ * bytes either way.
14606
+ */
14607
+ declare function savedPresentationFileName(sourceName: string | null | undefined, format?: SavedPresentationFormat): string;
14608
+ //#endregion
14609
+ //#region src/render/insert-chart.d.ts
14610
+ /**
14611
+ * Dropdown ids for the insert-chart menu. Distinct from `PptxChartType`
14612
+ * because PowerPoint offers Column (vertical) and Bar (horizontal) as two
14613
+ * entries over the same underlying `'bar'` chart type, and because `'pareto'`
14614
+ * has no `PptxChartType` of its own: it is a dropdown entry that resolves to
14615
+ * `type: 'histogram'` (see docs/guide/limitations.md's ChartEx row) with a
14616
+ * frequency-plus-cumulative-percentage default shape. The other six ChartEx
14617
+ * ids (`histogram` through `regionMap`) map one-to-one onto their chart type.
14618
+ */
14619
+ type InsertChartKind = 'column' | 'bar' | 'line' | 'pie' | 'doughnut' | 'area' | 'scatter' | 'histogram' | 'pareto' | 'funnel' | 'treemap' | 'sunburst' | 'boxWhisker' | 'regionMap';
14620
+ /** In-memory clipboard payload stored when an element is copied or cut. */
14621
+ interface ElementClipboardPayload {
14622
+ element: PptxElement;
14623
+ isTemplate: boolean;
14624
+ }
14625
+ //#endregion
14626
+ //#region src/render/image-file-insertion.d.ts
14627
+ /**
14628
+ * Decode a local image File/Blob into a centred element, fitting the slide
14629
+ * without upscaling. Dimensions are slide pixels; image bytes are preserved.
14630
+ *
14631
+ * Resolves null for unsupported/unreadable images, invalid bounds, cancellation,
14632
+ * or unavailable browser APIs. Importing this module is safe outside a browser.
14633
+ * No slide, selection, history, clipboard, or network state is changed. The
14634
+ * caller must still validate its document/slide destination before committing.
14635
+ */
14636
+ declare function createImageElementFromFile(file: Blob, canvasSize: CanvasSize$1, signal?: AbortSignal): Promise<ImagePptxElement | null>;
14637
+ //#endregion
14638
+ //#region src/render/editor-image-paste.d.ts
14639
+ /** A currently editable slide. Return null while loading or outside canvas editing. */
14640
+ interface EditorImagePasteTarget {
14641
+ documentId: object;
14642
+ slideId: string;
14643
+ canvasSize: CanvasSize$1;
14644
+ }
14645
+ interface EditorImagePasteOptions {
14646
+ getCanvas(): HTMLElement | null;
14647
+ getTarget(): EditorImagePasteTarget | null;
14648
+ /** Use the normal editor command so selection, dirty state and Undo stay consistent. */
14649
+ insertElement(element: ImagePptxElement): void;
14650
+ }
14651
+ //#endregion
14652
+ //#region src/render/zoom-return-navigation.d.ts
14653
+ /**
14654
+ * The navigation-relevant fields of a Zoom click target, independent of
14655
+ * `zoomType`.
14656
+ *
14657
+ * `returnToParent` is already resolved to its EFFECTIVE value here (not the
14658
+ * raw, possibly-`undefined` `ZoomPptxElement`/`SummaryZoomTarget` field):
14659
+ * `CT_ZoomObjectProperties/@returnToParent` (MS-PPTX) is `<xsd:attribute
14660
+ * name="returnToParent" type="xsd:boolean" use="optional" default="true"/>`,
14661
+ * so an ABSENT attribute means true, not false. Core deliberately stores
14662
+ * `undefined` rather than fabricating `true` (so a round-trip never invents
14663
+ * an attribute the source never had), which makes `Boolean(x)` the wrong way
14664
+ * to read it; the two `resolve*NavigationTarget` functions below are the only
14665
+ * place that distinction should be made.
14666
+ */
14667
+ interface ZoomNavigationTarget {
14668
+ targetSlideIndex: number;
14669
+ targetSectionId?: string;
14670
+ returnToParent: boolean;
14671
+ transitionDurationMs?: number;
14672
+ }
14673
+ interface SubtitleSettings {
14674
+ spokenLanguage: string;
14675
+ }
14676
+ interface SubtitleSettingsLabels {
14677
+ title: string;
14678
+ language: string;
14679
+ browserLanguage: string;
14680
+ description: string;
14681
+ apply: string;
14682
+ cancel: string;
14683
+ }
14684
+ //#endregion
14685
+ //#region src/render/account.d.ts
14686
+ /** Local-only display profile shown in File > Account. Never sent anywhere; purely cosmetic. */
14687
+ interface ViewerProfile {
14688
+ displayName: string;
14689
+ /** CSS color for the avatar bubble background, e.g. `'#c2431f'`. */
14690
+ avatarColor: string;
14691
+ /** Single character shown in the avatar bubble. Derived from `displayName` when omitted. */
14692
+ initial?: string;
14693
+ }
14694
+ declare const DEFAULT_VIEWER_PROFILE: ViewerProfile;
14695
+ /** Suggested avatar color swatches for the Account profile editor. */
14696
+ declare const AVATAR_COLOR_SWATCHES: readonly string[];
14697
+ /** Derive the avatar-bubble initial from a profile, falling back to `'?'` for an empty name. */
14698
+ declare function resolveProfileInitial(profile: ViewerProfile): string;
14699
+ /**
14700
+ * Optional hook point for hosts that want to wire a real sign-in flow into
14701
+ * File > Account. Disabled by default: the Account page renders nothing
14702
+ * extra unless a host explicitly opts in by passing `enabled: true`.
14703
+ * See docs/guide for wiring instructions.
14704
+ */
14705
+ interface AccountAuthConfig {
14706
+ enabled: boolean;
14707
+ onSignIn: () => void;
14708
+ signedInUser?: {
14709
+ name: string;
14710
+ email?: string;
14711
+ avatarUrl?: string;
14712
+ };
14713
+ }
14714
+ interface LocalStorageUsageSummary {
14715
+ /** Number of presentations with a local autosave/recovery snapshot. */
14716
+ presentationCount: number;
14717
+ /** Total bytes across every stored snapshot. */
14718
+ totalBytes: number;
14719
+ }
14720
+ /** Summarize local (IndexedDB) storage usage for the Account > Storage & Privacy panel. */
14721
+ declare function getLocalStorageUsageSummary(): Promise<LocalStorageUsageSummary>;
14722
+ /**
14723
+ * Delete every locally stored presentation/recovery snapshot and persisted
14724
+ * viewer preference (theme/locale/profile). Irreversible; callers should
14725
+ * confirm with the user before invoking this.
14726
+ */
14727
+ declare function clearAllLocalViewerData(): Promise<void>;
14728
+ /** Persist an updated profile via the shared viewer-prefs store. */
14729
+ declare function saveViewerProfile(profile: ViewerProfile): void;
14730
+ //#endregion
14731
+ //#region src/render/viewer-prefs-storage.d.ts
14732
+ /**
14733
+ * `localStorage`-backed viewer chrome preferences (theme/locale/profile),
14734
+ * shared by every binding.
14735
+ *
14736
+ * This is the persistence layer behind File > Options' Appearance/Language
14737
+ * tabs and File > Account's profile editor when a host doesn't supply its
14738
+ * own `onThemeChange`/`onLocaleChange`/`onProfileChange` callbacks - i.e. the
14739
+ * "standalone" fallback path. Hosts that do wire those callbacks own
14740
+ * persistence themselves and this module is never touched.
14741
+ */
14742
+ declare const VIEWER_PREFS_STORAGE_KEY = "pptx-viewer-prefs";
14743
+ interface StoredViewerPrefs {
14744
+ /** Key into the shared `THEME_CATALOG` (or a host-supplied `availableThemes` catalog). */
14745
+ themeKey?: string;
14746
+ /** Locale code, e.g. `'fr'`. */
14747
+ localeCode?: string;
14748
+ /** Local-only display profile shown in File > Account. */
14749
+ profile?: ViewerProfile;
14750
+ /** Sparse File > Options diff against `DEFAULT_VIEWER_OPTIONS`. */
14751
+ options?: StoredViewerOptions;
14752
+ }
14753
+ /** Read all persisted viewer preferences. Returns `{}` when unavailable, unset, or corrupt. */
14754
+ declare function readStoredViewerPrefs(): StoredViewerPrefs;
14755
+ /** Merge `patch` into the persisted viewer preferences. Silently no-ops when storage is unavailable. */
14756
+ declare function writeStoredViewerPrefs(patch: Partial<StoredViewerPrefs>): void;
14757
+ /** Remove all persisted viewer preferences. Silently no-ops when storage is unavailable. */
14758
+ declare function clearStoredViewerPrefs(): void;
14746
14759
  //#endregion
14747
14760
  //#region src/render/viewport-fit.d.ts
14748
14761
  /** Unscaled CSS pixels reserved on each side of the ordinary viewer viewport. */
@@ -14760,6 +14773,18 @@ interface ViewportFitOptions {
14760
14773
  /** The element fields an Edit Points commit writes. */
14761
14774
  type EditPointsElementPatch = Pick<ShapePptxElement, 'x' | 'y' | 'width' | 'height' | 'shapeType' | 'shapeAdjustments' | 'pathData' | 'pathWidth' | 'pathHeight' | 'customGeometryPaths' | 'customGeometryRawData' | 'customGeometryAdjustHandlesXY' | 'customGeometryAdjustHandlesPolar' | 'customGeometryConnectionSites' | 'customGeometryTextRect'>;
14762
14775
  //#endregion
14776
+ //#region src/web-components/subtitle-settings.d.ts
14777
+ interface PptxUiSubtitleSettingsElement extends HTMLElement {
14778
+ settings: SubtitleSettings;
14779
+ labels: SubtitleSettingsLabels;
14780
+ languageDisabled: boolean;
14781
+ }
14782
+ declare global {
14783
+ interface HTMLElementTagNameMap {
14784
+ 'pptx-ui-subtitle-settings': PptxUiSubtitleSettingsElement;
14785
+ }
14786
+ }
14787
+ //#endregion
14763
14788
  //#region src/web-components/select-value.d.ts
14764
14789
  /** Public DOM shape used by all bindings; the element is not a native select. */
14765
14790
  interface PptxUiSelectElement extends HTMLElement {