pptx-react-viewer 4.45.0 → 4.47.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 (126) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +5 -2
  3. package/dist/{AiChatPanel-Z5VHI4WA.mjs → AiChatPanel-6S4LWXGM.mjs} +2 -2
  4. package/dist/AiChatPanel-6S4LWXGM.mjs.br +0 -0
  5. package/dist/AiChatPanel-6S4LWXGM.mjs.gz +0 -0
  6. package/dist/{AiChatPanel-TGZQBH3L.js → AiChatPanel-IEM43TTZ.js} +10 -10
  7. package/dist/AiChatPanel-IEM43TTZ.js.br +0 -0
  8. package/dist/AiChatPanel-IEM43TTZ.js.gz +0 -0
  9. package/dist/{Model3DScene-5HLXSIIK.js → Model3DScene-CCIG67DJ.js} +1 -1
  10. package/dist/Model3DScene-CCIG67DJ.js.br +0 -0
  11. package/dist/Model3DScene-CCIG67DJ.js.gz +0 -0
  12. package/dist/{Model3DScene-MSC4LEKG.mjs → Model3DScene-NUJH2UKM.mjs} +1 -1
  13. package/dist/Model3DScene-NUJH2UKM.mjs.br +0 -0
  14. package/dist/Model3DScene-NUJH2UKM.mjs.gz +0 -0
  15. package/dist/{chunk-FBN7UFW2.mjs → chunk-BVQSH5SS.mjs} +36 -43
  16. package/dist/chunk-BVQSH5SS.mjs.br +0 -0
  17. package/dist/chunk-BVQSH5SS.mjs.gz +0 -0
  18. package/dist/{chunk-66APV3YZ.mjs → chunk-HDOR67HF.mjs} +258 -130
  19. package/dist/chunk-HDOR67HF.mjs.br +0 -0
  20. package/dist/chunk-HDOR67HF.mjs.gz +0 -0
  21. package/dist/{chunk-VJZJESNT.js → chunk-MA2BI7LX.js} +45 -61
  22. package/dist/chunk-MA2BI7LX.js.br +0 -0
  23. package/dist/chunk-MA2BI7LX.js.gz +0 -0
  24. package/dist/{chunk-2YCROYR6.js → chunk-MRSGNERC.js} +432 -302
  25. package/dist/chunk-MRSGNERC.js.br +0 -0
  26. package/dist/chunk-MRSGNERC.js.gz +0 -0
  27. package/dist/{chunk-VUE3EPTJ.mjs → chunk-OWZSRPAH.mjs} +248 -162
  28. package/dist/chunk-OWZSRPAH.mjs.br +0 -0
  29. package/dist/chunk-OWZSRPAH.mjs.gz +0 -0
  30. package/dist/{chunk-W2IMY5SY.js → chunk-PIRHQTI4.js} +0 -2
  31. package/dist/chunk-PIRHQTI4.js.br +0 -0
  32. package/dist/chunk-PIRHQTI4.js.gz +0 -0
  33. package/dist/{chunk-KUQRWMIK.js → chunk-SSANGQ35.js} +550 -464
  34. package/dist/chunk-SSANGQ35.js.br +0 -0
  35. package/dist/chunk-SSANGQ35.js.gz +0 -0
  36. package/dist/{chunk-Q3DHYOLK.mjs → chunk-UV2HVMKZ.mjs} +1 -2
  37. package/dist/chunk-UV2HVMKZ.mjs.br +0 -0
  38. package/dist/chunk-UV2HVMKZ.mjs.gz +0 -0
  39. package/dist/i18n.js +1 -1
  40. package/dist/i18n.js.br +2 -2
  41. package/dist/i18n.js.gz +0 -0
  42. package/dist/i18n.mjs +1 -1
  43. package/dist/i18n.mjs.br +1 -1
  44. package/dist/i18n.mjs.gz +0 -0
  45. package/dist/index.d.ts +47 -6
  46. package/dist/index.js +25 -25
  47. package/dist/index.js.br +0 -0
  48. package/dist/index.js.gz +0 -0
  49. package/dist/index.mjs +4 -4
  50. package/dist/index.mjs.br +0 -0
  51. package/dist/index.mjs.gz +0 -0
  52. package/dist/internals.d.ts +74 -8
  53. package/dist/internals.js +82 -82
  54. package/dist/internals.js.br +0 -0
  55. package/dist/internals.js.gz +0 -0
  56. package/dist/internals.mjs +3 -3
  57. package/dist/internals.mjs.br +0 -0
  58. package/dist/internals.mjs.gz +0 -0
  59. package/dist/pptx-viewer-canvas.css +2 -0
  60. package/dist/pptx-viewer-canvas.css.br +0 -0
  61. package/dist/pptx-viewer-canvas.css.gz +0 -0
  62. package/dist/pptx-viewer.css +1 -1
  63. package/dist/pptx-viewer.css.br +0 -0
  64. package/dist/pptx-viewer.css.gz +0 -0
  65. package/dist/{three.module-JPZUM7AI.mjs → three.module-EBJVANGB.mjs} +1 -1
  66. package/dist/three.module-EBJVANGB.mjs.br +0 -0
  67. package/dist/three.module-EBJVANGB.mjs.gz +0 -0
  68. package/dist/{three.module-RIUI7P3J.js → three.module-MBFHAT6M.js} +1 -1
  69. package/dist/three.module-MBFHAT6M.js.br +0 -0
  70. package/dist/three.module-MBFHAT6M.js.gz +0 -0
  71. package/dist/viewer/index.d.ts +49 -10
  72. package/dist/viewer/index.js +20 -20
  73. package/dist/viewer/index.js.br +0 -0
  74. package/dist/viewer/index.js.gz +0 -0
  75. package/dist/viewer/index.mjs +4 -4
  76. package/dist/viewer/index.mjs.br +0 -0
  77. package/dist/viewer/index.mjs.gz +0 -0
  78. package/dist/{y-webrtc-CCA4HVZZ.mjs → y-webrtc-2H7UYAQD.mjs} +1 -1
  79. package/dist/y-webrtc-2H7UYAQD.mjs.br +0 -0
  80. package/dist/y-webrtc-2H7UYAQD.mjs.gz +0 -0
  81. package/dist/{y-webrtc-MB5ZXFBA.js → y-webrtc-DVPQNFLL.js} +5 -5
  82. package/dist/y-webrtc-DVPQNFLL.js.br +0 -0
  83. package/dist/y-webrtc-DVPQNFLL.js.gz +0 -0
  84. package/dist/{y-websocket-JQQZVAMX.js → y-websocket-TN4OKPXQ.js} +1 -1
  85. package/dist/y-websocket-TN4OKPXQ.js.br +0 -0
  86. package/dist/y-websocket-TN4OKPXQ.js.gz +0 -0
  87. package/dist/{y-websocket-SCLLNICY.mjs → y-websocket-WORVRRQS.mjs} +1 -1
  88. package/dist/y-websocket-WORVRRQS.mjs.br +0 -0
  89. package/dist/y-websocket-WORVRRQS.mjs.gz +0 -0
  90. package/package.json +7 -5
  91. package/dist/AiChatPanel-TGZQBH3L.js.br +0 -0
  92. package/dist/AiChatPanel-TGZQBH3L.js.gz +0 -0
  93. package/dist/AiChatPanel-Z5VHI4WA.mjs.br +0 -0
  94. package/dist/AiChatPanel-Z5VHI4WA.mjs.gz +0 -0
  95. package/dist/Model3DScene-5HLXSIIK.js.br +0 -0
  96. package/dist/Model3DScene-5HLXSIIK.js.gz +0 -0
  97. package/dist/Model3DScene-MSC4LEKG.mjs.br +0 -0
  98. package/dist/Model3DScene-MSC4LEKG.mjs.gz +0 -0
  99. package/dist/chunk-2YCROYR6.js.br +0 -0
  100. package/dist/chunk-2YCROYR6.js.gz +0 -0
  101. package/dist/chunk-66APV3YZ.mjs.br +0 -0
  102. package/dist/chunk-66APV3YZ.mjs.gz +0 -0
  103. package/dist/chunk-FBN7UFW2.mjs.br +0 -0
  104. package/dist/chunk-FBN7UFW2.mjs.gz +0 -0
  105. package/dist/chunk-KUQRWMIK.js.br +0 -0
  106. package/dist/chunk-KUQRWMIK.js.gz +0 -0
  107. package/dist/chunk-Q3DHYOLK.mjs.br +0 -0
  108. package/dist/chunk-Q3DHYOLK.mjs.gz +0 -0
  109. package/dist/chunk-VJZJESNT.js.br +0 -0
  110. package/dist/chunk-VJZJESNT.js.gz +0 -0
  111. package/dist/chunk-VUE3EPTJ.mjs.br +0 -0
  112. package/dist/chunk-VUE3EPTJ.mjs.gz +0 -0
  113. package/dist/chunk-W2IMY5SY.js.br +0 -0
  114. package/dist/chunk-W2IMY5SY.js.gz +0 -0
  115. package/dist/three.module-JPZUM7AI.mjs.br +0 -0
  116. package/dist/three.module-JPZUM7AI.mjs.gz +0 -0
  117. package/dist/three.module-RIUI7P3J.js.br +0 -0
  118. package/dist/three.module-RIUI7P3J.js.gz +0 -0
  119. package/dist/y-webrtc-CCA4HVZZ.mjs.br +0 -0
  120. package/dist/y-webrtc-CCA4HVZZ.mjs.gz +0 -0
  121. package/dist/y-webrtc-MB5ZXFBA.js.br +0 -0
  122. package/dist/y-webrtc-MB5ZXFBA.js.gz +0 -0
  123. package/dist/y-websocket-JQQZVAMX.js.br +0 -0
  124. package/dist/y-websocket-JQQZVAMX.js.gz +0 -0
  125. package/dist/y-websocket-SCLLNICY.mjs.br +0 -0
  126. package/dist/y-websocket-SCLLNICY.mjs.gz +0 -0
Binary file
Binary file
@@ -25,7 +25,6 @@ var __copyProps = (to, from, except, desc) => {
25
25
  }
26
26
  return to;
27
27
  };
28
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
29
28
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
30
29
  // If the importer is in node compatibility mode or this is not an ESM
31
30
  // file that has been converted to a CommonJS file using a Babel-
@@ -35,4 +34,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
35
34
  mod
36
35
  ));
37
36
 
38
- export { __commonJS, __reExport, __require, __toESM };
37
+ export { __commonJS, __require, __toESM };
Binary file
Binary file
package/dist/i18n.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- require('./chunk-W2IMY5SY.js');
3
+ require('./chunk-PIRHQTI4.js');
4
4
  var i18n = require('ooxml-ui/pptx/i18n');
5
5
 
6
6
 
package/dist/i18n.js.br CHANGED
@@ -1,2 +1,2 @@
1
- ����ƞ-qK��wl`��b��]�@��k�����/4#؄$���P��T�B� �^ޅ�t]����~�R�m&�A��'c��_��>��q��:�
2
- p����R��M3,|#*
1
+ ����tc/����b�h`��bdc'/��z 9��_hF� I6�6�(Y�6�n<�� W�#z��k\o����6�� p�o����q��I)�q��z�p���k[��ğN�߈
2
+ FC����qH�Q�{ŧ�-�_���M�׎Qg���Y�4G���h�S�</�;?NSMn\ U9���E�j�vp
package/dist/i18n.js.gz CHANGED
Binary file
package/dist/i18n.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import './chunk-Q3DHYOLK.mjs';
1
+ import './chunk-UV2HVMKZ.mjs';
2
2
  export { LOCALE_CATALOG, keyToLabel, translationsEn } from 'ooxml-ui/pptx/i18n';
package/dist/i18n.mjs.br CHANGED
@@ -1,3 +1,3 @@
1
- �7�import './chunk-Q3DHYOLK.mjs';
1
+ �7�import './chunk-UV2HVMKZ.mjs';
2
2
  export { LOCALE_CATALOG, keyToLabel, translationsEn } from 'ooxml-ui/pptx/i18n';
3
3
  
package/dist/i18n.mjs.gz CHANGED
Binary file
package/dist/index.d.ts CHANGED
@@ -1,16 +1,16 @@
1
1
  import * as React$1 from 'react';
2
2
  import React$1__default from 'react';
3
3
  import * as ooxml_ui_pptx from 'ooxml-ui/pptx';
4
- import { CollaborationRole, CollaborationConfig, ViewportFitOptions, ViewerFontSource, CanvasSize, ViewerTheme, ThemeCatalogEntry, AccountAuthConfig, CollaborationInput, ToolbarActionId, RibbonAddInTab, ViewerCustomization, PowerPointViewerAPI, ViewerCustomizationApi, CollaborationLivePatcher, InlineListReadResult, EditorImagePasteOptions, ViewerMode, RulerUnit, ElementAnimationState, ShapeAdjustmentHandleDescriptor, InlineTextEditSnapshot, ZoomNavigationTarget, FieldSubstitutionContext, EditPointsCommandId, EditPointsElementPatch, FreeformToolKind, ElementClipboardPayload, AnimationApplyGroup, InsertChartKind, ChangeCaseMode, SlideTemplateId, ReviewCommentsHost, CollaborationShellState } from 'ooxml-ui/pptx';
4
+ import { CollaborationRole, CollaborationConfig, ViewportFitOptions, ViewerFontSource, CanvasSize, DocumentStorage, ViewerAutosaveStatus, AutosaveRecord, ConnectionStatus, ViewerTheme, ThemeCatalogEntry, AccountAuthConfig, CollaborationInput, ToolbarActionId, RibbonAddInTab, ViewerCustomization, PowerPointViewerAPI, ViewerCustomizationApi, CollaborationLivePatcher, InlineListReadResult, EditorImagePasteOptions, ViewerMode, RulerUnit, ElementAnimationState, ShapeAdjustmentHandleDescriptor, InlineTextEditSnapshot, ZoomNavigationTarget, FieldSubstitutionContext, EditPointsCommandId, EditPointsElementPatch, FreeformToolKind, ElementClipboardPayload, AnimationApplyGroup, InsertChartKind, ChangeCaseMode, SlideTemplateId, ReviewCommentsHost, CollaborationShellState } from 'ooxml-ui/pptx';
5
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
6
  import { LocaleCatalogEntry } from 'ooxml-ui/pptx/i18n';
7
7
  export { LOCALE_CATALOG, LocaleCatalogEntry } from 'ooxml-ui/pptx/i18n';
8
- import { CollaborationState } from 'ooxml-core/collab';
8
+ import { PptxCoreProperties, PptxAnimationPreset, PptxNativeAnimation, PptxSlide, PptxElement, TextStyle, InkPptxElement, ShapePptxElement, PptxAction, PptxComment, PptxElementAnimation, ConnectorPptxElement, ParsedTableStyleMap, PptxTheme, ShapeStyle, PptxLayoutOption, PptxLayoutPreview, PptxCustomShow, PptxSlideTransition, PptxPresentationProperties } from 'ooxml-core/pptx';
9
+ import { CollaborationWriteBackState, CollaborationState } from 'ooxml-core/collab';
9
10
  export { CollaborationState } from 'ooxml-core/collab';
10
11
  import { PptxAiConfig } from 'ooxml-ui/pptx/ai';
11
12
  export { PptxAiBridge, PptxAiConfig, PptxAiConnection, PptxAiContextStrategy, PptxAiToolName, PptxAiWritePolicy } from 'ooxml-ui/pptx/ai';
12
13
  import { Doc } from 'yjs';
13
- import { PptxAnimationPreset, PptxNativeAnimation, PptxSlide, PptxElement, TextStyle, InkPptxElement, ShapePptxElement, PptxAction, PptxComment, PptxElementAnimation, ConnectorPptxElement, ParsedTableStyleMap, PptxTheme, ShapeStyle, PptxLayoutOption, PptxLayoutPreview, PptxCustomShow, PptxSlideTransition, PptxPresentationProperties } from 'ooxml-core/pptx';
14
14
  import { Options } from 'html2canvas-pro';
15
15
 
16
16
  //#region src/viewer/types-core.d.ts
@@ -50,7 +50,7 @@ declare function useViewerTheme(): ViewerTheme | undefined;
50
50
  //#endregion
51
51
  //#region src/viewer/hooks/collaboration/types.d.ts
52
52
  /** Connection lifecycle states for the Yjs WebSocket provider. */
53
- type ConnectionStatus = 'disconnected' | 'connecting' | 'connected' | 'error';
53
+ type ConnectionStatus$1 = 'disconnected' | 'connecting' | 'connected' | 'error';
54
54
  /**
55
55
  * Presence data broadcast to other participants.
56
56
  * Cursor position is relative to the slide canvas (0..canvasWidth, 0..canvasHeight).
@@ -80,7 +80,7 @@ interface UserPresence {
80
80
  /** Value exposed by `CollaborationContext`. */
81
81
  interface CollaborationContextValue {
82
82
  /** Current WebSocket connection status. */
83
- status: ConnectionStatus;
83
+ status: ConnectionStatus$1;
84
84
  /** Presence data for all remote users (excludes the local user). */
85
85
  remoteUsers: UserPresence[];
86
86
  /** Broadcast the local user's presence state. */
@@ -100,6 +100,10 @@ interface CollaborationContextValue {
100
100
  retry: () => void;
101
101
  /** The local awareness client id, once the session has one. */
102
102
  clientId?: number | null;
103
+ /** The owner's write-back status, as the document sync last reported it. */
104
+ writeBack?: CollaborationWriteBackState | undefined;
105
+ /** Called by the document sync with the write-back status (undefined clears it). */
106
+ reportWriteBack?: (state: CollaborationWriteBackState | undefined) => void;
103
107
  }
104
108
  //#endregion
105
109
  //#region src/viewer/hooks/useLoadNotifications.d.ts
@@ -181,7 +185,7 @@ interface PowerPointViewerProps extends ViewportFitOptions {
181
185
  * and canvas size.
182
186
  */
183
187
  onLoad?: (detail: ViewerLoadDetail) => void;
184
- /** Fired once per distinct load failure, with a human-readable message. */
188
+ /** Fired once per distinct load failure, and for each failed Save / Save As, with a human-readable message. */
185
189
  onError?: (message: string) => void;
186
190
  /**
187
191
  * Host override for the File ▸ Open action. When provided, the built-in
@@ -192,6 +196,12 @@ interface PowerPointViewerProps extends ViewportFitOptions {
192
196
  onOpenFile?: () => void;
193
197
  /** Whether editing actions are enabled */
194
198
  canEdit?: boolean;
199
+ /**
200
+ * Makes the deck read-only (default `false`). It is the inverse of the edit switch: true wins
201
+ * over it, false only lifts this restriction, so editing still needs the edit switch and
202
+ * is never granted over a collaboration `viewer` role or `capabilities.edit`.
203
+ */
204
+ readOnly?: boolean;
195
205
  /**
196
206
  * Recovery autosave: after an edit the deck is re-serialised (always as a
197
207
  * plain, unencrypted package, because recovery has no password) and stashed
@@ -214,6 +224,35 @@ interface PowerPointViewerProps extends ViewportFitOptions {
214
224
  * "Save AutoRecover information every N minutes" (two minutes by default).
215
225
  */
216
226
  autosaveIntervalMs?: number;
227
+ /**
228
+ * Host-owned storage (`DocumentStorage` from `ooxml-core/embedding`). When set,
229
+ * Save and Save As hand the bytes to `storage.save()` instead of downloading
230
+ * them, and recovery autosave snapshots go to the storage's recovery methods
231
+ * (`readRecovery` / `writeRecovery` / `clearRecovery`) instead of IndexedDB
232
+ * when it provides them.
233
+ */
234
+ storage?: DocumentStorage;
235
+ /** Fired with the serialised deck each time a recovery autosave snapshot is written. */
236
+ onAutosave?: (content: Uint8Array) => void;
237
+ /** Fired when the user enables or disables autosave (title bar or File > Options). */
238
+ onAutosaveToggle?: (enabled: boolean) => void;
239
+ /** Fired on every autosave lifecycle transition (`idle`, `saving`, `saved`, `error`). */
240
+ onAutosaveStatus?: (status: ViewerAutosaveStatus) => void;
241
+ /**
242
+ * Fired when a recovery snapshot left by a previous session is found for this deck. The
243
+ * built-in recovery prompt is shown as well.
244
+ */
245
+ onAutosaveRecovery?: (record: AutosaveRecord) => void;
246
+ /** Fired after any committed document edit (move, resize, text, undo, redo, ...). */
247
+ onChange?: () => void;
248
+ /** Fired with the changed fields when the user saves the document properties dialog. */
249
+ onPropertiesChange?: (updates: Partial<PptxCoreProperties>) => void;
250
+ /** Fired with the new speaker-notes text when the user edits the notes of a slide. */
251
+ onNotesUpdate?: (notes: string) => void;
252
+ /** Fired when presentation (slide show) mode is entered (`true`) or left (`false`). */
253
+ onPresentationChange?: (presenting: boolean) => void;
254
+ /** Fired on every collaboration connection-status transition. */
255
+ onCollaborationStatus?: (status: ConnectionStatus) => void;
217
256
  /** Optional class name */
218
257
  className?: string;
219
258
  /**
@@ -636,6 +675,8 @@ interface ToolbarProps {
636
675
  onExportGif: () => void;
637
676
  onExportJson: () => void;
638
677
  onOpenShareDialog?: () => void;
678
+ /** File > Save (the backstage Save item): reported to host storage as `save`, not Save As. */
679
+ onSave?: () => void;
639
680
  onSaveAsPptx: () => void;
640
681
  onSaveAsPpsx: () => void;
641
682
  onSaveAsPptm: () => void;
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkKUQRWMIK_js = require('./chunk-KUQRWMIK.js');
4
- var chunk2YCROYR6_js = require('./chunk-2YCROYR6.js');
5
- var chunkVJZJESNT_js = require('./chunk-VJZJESNT.js');
6
- require('./chunk-W2IMY5SY.js');
3
+ var chunkSSANGQ35_js = require('./chunk-SSANGQ35.js');
4
+ var chunkMRSGNERC_js = require('./chunk-MRSGNERC.js');
5
+ var chunkMA2BI7LX_js = require('./chunk-MA2BI7LX.js');
6
+ require('./chunk-PIRHQTI4.js');
7
7
  var pptx = require('ooxml-ui/pptx');
8
8
  var i18n = require('ooxml-ui/pptx/i18n');
9
9
 
@@ -11,87 +11,87 @@ var i18n = require('ooxml-ui/pptx/i18n');
11
11
 
12
12
  Object.defineProperty(exports, "PowerPointViewer", {
13
13
  enumerable: true,
14
- get: function () { return chunkKUQRWMIK_js.PowerPointViewer; }
14
+ get: function () { return chunkSSANGQ35_js.PowerPointViewer; }
15
15
  });
16
16
  Object.defineProperty(exports, "SlideCanvas", {
17
17
  enumerable: true,
18
- get: function () { return chunkKUQRWMIK_js.SlideCanvas; }
18
+ get: function () { return chunkSSANGQ35_js.SlideCanvas; }
19
19
  });
20
20
  Object.defineProperty(exports, "SlideTemplateGalleryDialog", {
21
21
  enumerable: true,
22
- get: function () { return chunkKUQRWMIK_js.SlideTemplateGalleryDialog; }
22
+ get: function () { return chunkSSANGQ35_js.SlideTemplateGalleryDialog; }
23
23
  });
24
24
  Object.defineProperty(exports, "SlideTemplatePreview", {
25
25
  enumerable: true,
26
- get: function () { return chunkKUQRWMIK_js.SlideTemplatePreview; }
26
+ get: function () { return chunkSSANGQ35_js.SlideTemplatePreview; }
27
27
  });
28
28
  Object.defineProperty(exports, "THEME_CATALOG", {
29
29
  enumerable: true,
30
- get: function () { return chunkKUQRWMIK_js.THEME_CATALOG; }
30
+ get: function () { return chunkSSANGQ35_js.THEME_CATALOG; }
31
31
  });
32
32
  Object.defineProperty(exports, "Toolbar", {
33
33
  enumerable: true,
34
- get: function () { return chunkKUQRWMIK_js.Toolbar; }
34
+ get: function () { return chunkSSANGQ35_js.Toolbar; }
35
35
  });
36
36
  Object.defineProperty(exports, "ViewerThemeProvider", {
37
37
  enumerable: true,
38
- get: function () { return chunkKUQRWMIK_js.ViewerThemeProvider; }
38
+ get: function () { return chunkSSANGQ35_js.ViewerThemeProvider; }
39
39
  });
40
40
  Object.defineProperty(exports, "defaultCssVars", {
41
41
  enumerable: true,
42
- get: function () { return chunkKUQRWMIK_js.defaultCssVars; }
42
+ get: function () { return chunkSSANGQ35_js.defaultCssVars; }
43
43
  });
44
44
  Object.defineProperty(exports, "defaultRadius", {
45
45
  enumerable: true,
46
- get: function () { return chunkKUQRWMIK_js.defaultRadius; }
46
+ get: function () { return chunkSSANGQ35_js.defaultRadius; }
47
47
  });
48
48
  Object.defineProperty(exports, "defaultThemeColors", {
49
49
  enumerable: true,
50
- get: function () { return chunkKUQRWMIK_js.defaultThemeColors; }
50
+ get: function () { return chunkSSANGQ35_js.defaultThemeColors; }
51
51
  });
52
52
  Object.defineProperty(exports, "resolveThemeCatalogEntry", {
53
53
  enumerable: true,
54
- get: function () { return chunkKUQRWMIK_js.resolveThemeCatalogEntry; }
54
+ get: function () { return chunkSSANGQ35_js.resolveThemeCatalogEntry; }
55
55
  });
56
56
  Object.defineProperty(exports, "themeToCssVars", {
57
57
  enumerable: true,
58
- get: function () { return chunkKUQRWMIK_js.themeToCssVars; }
58
+ get: function () { return chunkSSANGQ35_js.themeToCssVars; }
59
59
  });
60
60
  Object.defineProperty(exports, "useViewerTheme", {
61
61
  enumerable: true,
62
- get: function () { return chunkKUQRWMIK_js.useViewerTheme; }
62
+ get: function () { return chunkSSANGQ35_js.useViewerTheme; }
63
63
  });
64
64
  Object.defineProperty(exports, "vermilionDarkColors", {
65
65
  enumerable: true,
66
- get: function () { return chunkKUQRWMIK_js.vermilionDarkColors; }
66
+ get: function () { return chunkSSANGQ35_js.vermilionDarkColors; }
67
67
  });
68
68
  Object.defineProperty(exports, "vermilionDarkTheme", {
69
69
  enumerable: true,
70
- get: function () { return chunkKUQRWMIK_js.vermilionDarkTheme; }
70
+ get: function () { return chunkSSANGQ35_js.vermilionDarkTheme; }
71
71
  });
72
72
  Object.defineProperty(exports, "vermilionLightColors", {
73
73
  enumerable: true,
74
- get: function () { return chunkKUQRWMIK_js.vermilionLightColors; }
74
+ get: function () { return chunkSSANGQ35_js.vermilionLightColors; }
75
75
  });
76
76
  Object.defineProperty(exports, "vermilionLightTheme", {
77
77
  enumerable: true,
78
- get: function () { return chunkKUQRWMIK_js.vermilionLightTheme; }
78
+ get: function () { return chunkSSANGQ35_js.vermilionLightTheme; }
79
79
  });
80
80
  Object.defineProperty(exports, "vermilionRadius", {
81
81
  enumerable: true,
82
- get: function () { return chunkKUQRWMIK_js.vermilionRadius; }
82
+ get: function () { return chunkSSANGQ35_js.vermilionRadius; }
83
83
  });
84
84
  Object.defineProperty(exports, "renderToCanvas", {
85
85
  enumerable: true,
86
- get: function () { return chunk2YCROYR6_js.renderToCanvas; }
86
+ get: function () { return chunkMRSGNERC_js.renderToCanvas; }
87
87
  });
88
88
  Object.defineProperty(exports, "useViewerBuildingBlocks", {
89
89
  enumerable: true,
90
- get: function () { return chunk2YCROYR6_js.useViewerBuildingBlocks; }
90
+ get: function () { return chunkMRSGNERC_js.useViewerBuildingBlocks; }
91
91
  });
92
92
  Object.defineProperty(exports, "getAnimationInitialStyle", {
93
93
  enumerable: true,
94
- get: function () { return chunkVJZJESNT_js.getAnimationInitialStyle; }
94
+ get: function () { return chunkMA2BI7LX_js.getAnimationInitialStyle; }
95
95
  });
96
96
  Object.defineProperty(exports, "AVATAR_COLOR_SWATCHES", {
97
97
  enumerable: true,
package/dist/index.js.br CHANGED
Binary file
package/dist/index.js.gz CHANGED
Binary file
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- export { PowerPointViewer, SlideCanvas, SlideTemplateGalleryDialog, SlideTemplatePreview, THEME_CATALOG, Toolbar, ViewerThemeProvider, defaultCssVars, defaultRadius, defaultThemeColors, resolveThemeCatalogEntry, themeToCssVars, useViewerTheme, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius } from './chunk-VUE3EPTJ.mjs';
2
- export { renderToCanvas, useViewerBuildingBlocks } from './chunk-66APV3YZ.mjs';
3
- export { getAnimationInitialStyle } from './chunk-FBN7UFW2.mjs';
4
- import './chunk-Q3DHYOLK.mjs';
1
+ export { PowerPointViewer, SlideCanvas, SlideTemplateGalleryDialog, SlideTemplatePreview, THEME_CATALOG, Toolbar, ViewerThemeProvider, defaultCssVars, defaultRadius, defaultThemeColors, resolveThemeCatalogEntry, themeToCssVars, useViewerTheme, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius } from './chunk-OWZSRPAH.mjs';
2
+ export { renderToCanvas, useViewerBuildingBlocks } from './chunk-HDOR67HF.mjs';
3
+ export { getAnimationInitialStyle } from './chunk-BVQSH5SS.mjs';
4
+ import './chunk-UV2HVMKZ.mjs';
5
5
  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, OPTIONS_PAGE_IDS, OPTIONS_SECTION_IDS, OPTIONS_SETTING_IDS, PPTX_OPEN_ACCEPT, PRESENTATION_OPEN_EXTENSIONS, RIBBON_TAB_IDS, SLIDE_TEMPLATES, TOOLBAR_BUTTON_IDS, VIEWER_DIALOG_IDS, VIEWER_EXPORT_FORMAT_IDS, VIEWER_FEATURE_IDS, VIEWER_PANEL_IDS, VIEWER_PREFS_STORAGE_KEY, buildSlideTemplateContent, buildSlideTemplateSlide, clearAllLocalViewerData, clearStoredViewerPrefs, createImageElementFromFile, describeCollaborationShellState, getLocalStorageUsageSummary, isLegacyBinaryPresentation, isSupportedPresentationFile, presentationBaseName, readStoredViewerPrefs, resolveProfileInitial, saveViewerProfile, savedPresentationFileName, writeStoredViewerPrefs } from 'ooxml-ui/pptx';
6
6
  export { LOCALE_CATALOG } from 'ooxml-ui/pptx/i18n';
package/dist/index.mjs.br CHANGED
Binary file
package/dist/index.mjs.gz CHANGED
Binary file
@@ -1,6 +1,7 @@
1
- import { CollaborationRole, CollaborationConfig, PowerPointViewerAPI, ViewerCustomizationApi, ShapeAdjustmentHandleDescriptor, ChangeCaseMode, ResolvedKeyboardCustomization, FindResult, EditorImagePasteOptions, InsertChartKind, PasteSpecialFormat, SlidePasteRequest, SlideTemplateId, MorphTransitionPlan, ElementAnimationState, ZoomNavigationTarget, PresentationSnapshot, ViewerMode, ShapeAdjustmentDragState, InlineTextEditSnapshot, InlineListReadResult, FreeformToolKind, CollaborationLivePatcher, SlideSizeEmu, ElementClipboardPayload, CropSession, FontEmbeddingDescriptor, MasterViewTarget, ViewportFitOptions, CollaborationInput, ToolbarActionId, CollaborationShellState, AnimationApplyGroup, ReviewCommentsHost, RulerUnit, FieldSubstitutionContext, EditPointsCommandId, EditPointsElementPatch, PresentationPointerTool, RunProgramNotice, BorrowedCollaborationAwareness, CollabLoadOrigin, AuthoredSlideRange, FragmentedLayer, PrintSettings, ThemeEditorEdit, CompareResult, ReadOnlyRecommendation, CompatibilityWarningToast, DeviceOrientation, ResolvedCustomization, DeckSavePurpose, ZoomExcursion, TouchGestureCallbacks, ViewerOptionsStore, ViewerOptions, AutosaveRecoveryPrompt, VirtualizedRange, ToolbarTabId } from 'ooxml-ui/pptx';
1
+ import { CollaborationRole, CollaborationConfig, PowerPointViewerAPI, ViewerCustomizationApi, ShapeAdjustmentHandleDescriptor, ChangeCaseMode, ResolvedKeyboardCustomization, FindResult, EditorImagePasteOptions, InsertChartKind, PasteSpecialFormat, SlidePasteRequest, SlideTemplateId, MorphTransitionPlan, ElementAnimationState, ZoomNavigationTarget, PresentationSnapshot, DocumentStorage, ViewerMode, ShapeAdjustmentDragState, InlineTextEditSnapshot, InlineListReadResult, FreeformToolKind, CollaborationLivePatcher, SlideSizeEmu, ElementClipboardPayload, CropSession, FontEmbeddingDescriptor, MasterViewTarget, ViewportFitOptions, CollaborationInput, ToolbarActionId, CollaborationShellState, AnimationApplyGroup, ReviewCommentsHost, RulerUnit, FieldSubstitutionContext, EditPointsCommandId, EditPointsElementPatch, PresentationPointerTool, RunProgramNotice, BorrowedCollaborationAwareness, CollabLoadOrigin, AuthoredSlideRange, DocumentSaveReason, FragmentedLayer, PrintSettings, ThemeEditorEdit, CompareResult, ReadOnlyRecommendation, CompatibilityWarningToast, DeviceOrientation, ResolvedCustomization, AutosaveRecord, DeckSavePurpose, ZoomExcursion, TouchGestureCallbacks, ViewerAutosaveStatus, ViewerOptionsStore, ViewerOptions, AutosaveRecoveryPrompt, VirtualizedRange, ToolbarTabId } from 'ooxml-ui/pptx';
2
2
  export { CINEMATIC_TRANSITION_KEYFRAMES, CollaborationConfig, DEFAULT_MORPH_DURATION_MS, DEFAULT_TRANSITION_DURATION_MS, DeviceOrientation, EASE, INSTANT, MOBILE_BREAKPOINT, P14_TRANSITION_KEYFRAMES, P14_TRANSITION_KEYFRAMES_2, P14_TRANSITION_KEYFRAMES_ALL, RANDOM_ELIGIBLE_TYPES, ResolvedDirection, ResolvedDirection8, SLIDE_TRANSITION_KEYFRAMES, SLIDE_TRANSITION_KEYFRAMES_CSS, SlideTransitionAnimations, TABLET_BREAKPOINT, TRANSITION_SPEED_DURATION_MS, TouchGestureCallbacks, VirtualizedRange, WHEEL_SPOKE_COUNTS, computeVirtualRange, getCinematicTransitionAnimations, getP14TransitionAnimations, getSlideTransitionAnimations, resolveDirection, resolveDirection8, resolveOrientation, resolveSlideTransition, resolveTransitionDurationMs, resolveWheelSpokeCount } from 'ooxml-ui/pptx';
3
3
  import { PptxSlide, PptxElement, PptxElementAnimation, TextStyle, PptxHeaderFooter, ShapeStyle, PptxCommentMention, SmartArtLayout, InkPptxElement, ShapePptxElement, MergeShapeOperation, PptxSlideTransition, PptxAction, PptxSlideMaster, PptxModernCommentAuthor, PptxTheme, ParsedTableStyleMap, PptxThemeOption, PptxCustomShow, PptxSection, PptxPresentationProperties, PptxViewProperties, PptxNotesMaster, PptxHandoutMaster, PptxCustomProperty, PptxTagCollection, PptxCoreProperties, PptxAppProperties, PptxEmbeddedFont, MasterViewTab, PptxSlideLayout, PptxHandler, PptxLayoutOption, PptxLayoutPreview, PptxComment, ConnectorPptxElement, PptxThemePreset, PptxThemeColorScheme, PptxThemeFontScheme, PptxData, PptxHandlerSaveOptions, PptxSaveFormat, TextSegment, PptxModifyVerifier } from 'ooxml-core/pptx';
4
+ import { CollaborationWriteBackState } from 'ooxml-core/collab';
4
5
  import * as Y from 'yjs';
5
6
  import { Doc } from 'yjs';
6
7
  import React$1, { Dispatch, SetStateAction, MutableRefObject, RefObject, ForwardedRef } from 'react';
@@ -95,7 +96,7 @@ interface EditorHistorySnapshot {
95
96
  //#endregion
96
97
  //#region src/viewer/hooks/collaboration/types.d.ts
97
98
  /** Connection lifecycle states for the Yjs WebSocket provider. */
98
- type ConnectionStatus = 'disconnected' | 'connecting' | 'connected' | 'error';
99
+ type ConnectionStatus$1 = 'disconnected' | 'connecting' | 'connected' | 'error';
99
100
  /**
100
101
  * Presence data broadcast to other participants.
101
102
  * Cursor position is relative to the slide canvas (0..canvasWidth, 0..canvasHeight).
@@ -125,7 +126,7 @@ interface UserPresence {
125
126
  /** Value exposed by `CollaborationContext`. */
126
127
  interface CollaborationContextValue {
127
128
  /** Current WebSocket connection status. */
128
- status: ConnectionStatus;
129
+ status: ConnectionStatus$1;
129
130
  /** Presence data for all remote users (excludes the local user). */
130
131
  remoteUsers: UserPresence[];
131
132
  /** Broadcast the local user's presence state. */
@@ -145,6 +146,10 @@ interface CollaborationContextValue {
145
146
  retry: () => void;
146
147
  /** The local awareness client id, once the session has one. */
147
148
  clientId?: number | null;
149
+ /** The owner's write-back status, as the document sync last reported it. */
150
+ writeBack?: CollaborationWriteBackState | undefined;
151
+ /** Called by the document sync with the write-back status (undefined clears it). */
152
+ reportWriteBack?: (state: CollaborationWriteBackState | undefined) => void;
148
153
  }
149
154
  //#endregion
150
155
  //#region src/viewer/types-ui.d.ts
@@ -358,6 +363,8 @@ interface ToolbarProps {
358
363
  onExportGif: () => void;
359
364
  onExportJson: () => void;
360
365
  onOpenShareDialog?: () => void;
366
+ /** File > Save (the backstage Save item): reported to host storage as `save`, not Save As. */
367
+ onSave?: () => void;
361
368
  onSaveAsPptx: () => void;
362
369
  onSaveAsPpsx: () => void;
363
370
  onSaveAsPptm: () => void;
@@ -2213,6 +2220,8 @@ interface UseAutosaveInput {
2213
2220
  * `resolveAutosaveActivation`, NOT the raw title-bar toggle.
2214
2221
  */
2215
2222
  enabled?: boolean;
2223
+ /** Host storage; its recovery methods replace IndexedDB when it has them. */
2224
+ storage?: DocumentStorage;
2216
2225
  /**
2217
2226
  * The values a snapshot is built from, read fresh on each tick.
2218
2227
  *
@@ -2224,6 +2233,8 @@ interface UseAutosaveInput {
2224
2233
  * whenever it is unsure. Omit it and every tick writes, as before.
2225
2234
  */
2226
2235
  getChangeSources?: () => readonly unknown[];
2236
+ /** Called with the serialised deck after each snapshot is written (the host's `onAutosave`). */
2237
+ onSaved?: ((data: Uint8Array) => void) | undefined;
2227
2238
  }
2228
2239
  interface UseAutosaveResult {
2229
2240
  /** Current autosave status for display in the StatusBar. */
@@ -2489,7 +2500,7 @@ interface UseYjsProviderInput {
2489
2500
  }
2490
2501
  interface UseYjsProviderResult {
2491
2502
  /** Current WebSocket connection status. */
2492
- status: ConnectionStatus;
2503
+ status: ConnectionStatus$1;
2493
2504
  /** The Yjs awareness instance (null until connected). */
2494
2505
  awareness: Awareness | null;
2495
2506
  /** The Yjs document (null until initialised). */
@@ -2590,7 +2601,7 @@ interface UseYjsDocumentSyncInput {
2590
2601
  setSlides: React.Dispatch<React.SetStateAction<PptxSlide[]>>;
2591
2602
  isConnected: boolean;
2592
2603
  isSynced?: boolean;
2593
- config?: Pick<CollaborationConfig, 'role' | 'onWriteBack' | 'writeBackDebounceMs' | 'externalSession' | 'sessionIntent'>;
2604
+ config?: Pick<CollaborationConfig, 'role' | 'onWriteBack' | 'writeBackDebounceMs' | 'writeBackRetry' | 'externalSession' | 'sessionIntent'>;
2594
2605
  getSourceBytes?: () => Uint8Array | null;
2595
2606
  getSaveOptions?: () => PptxHandlerSaveOptions;
2596
2607
  loadVersion?: number;
@@ -2598,6 +2609,8 @@ interface UseYjsDocumentSyncInput {
2598
2609
  /** External readiness owns this channel together with full-deck writes. */
2599
2610
  livePatcher?: CollaborationLivePatcher;
2600
2611
  onReadOnlyChange?: (readOnly: boolean) => void;
2612
+ /** Receives the owner's write-back status (undefined when the session ends). */
2613
+ onWriteBackStatus?: (state: CollaborationWriteBackState | undefined) => void;
2601
2614
  }
2602
2615
  declare function useYjsDocumentSync(input: UseYjsDocumentSyncInput): void;
2603
2616
  //#endregion
@@ -3075,6 +3088,10 @@ interface UseExportHandlersInput {
3075
3088
  activeSlide: PptxSlide | undefined;
3076
3089
  activeSlideIndex: number;
3077
3090
  filePath: string | undefined;
3091
+ /** Host `storage` prop: Save / Save As go to `storage.save()` instead of a download. */
3092
+ storage?: DocumentStorage | undefined;
3093
+ /** A Save / Save As failed (serialising, or the host's storage rejected). */
3094
+ onSaveError?: ((error: unknown) => void) | undefined;
3078
3095
  canvasStageRef: RefObject<HTMLDivElement | null>;
3079
3096
  setActiveSlideIndex: Dispatch<SetStateAction<number>>;
3080
3097
  /**
@@ -3131,7 +3148,13 @@ interface ExportHandlersResult {
3131
3148
  handleExportVideo: () => Promise<void>;
3132
3149
  handleExportGif: () => Promise<void>;
3133
3150
  handleExportJson: () => void;
3134
- handleSaveAsFormat: (format: PptxSaveFormat) => Promise<void>;
3151
+ /**
3152
+ * Writes `format`. `reason` is the command that ran (Save As by default); resolves false when
3153
+ * nothing was saved (no deck yet, or the save or the host's storage failed).
3154
+ */
3155
+ handleSaveAsFormat: (format: PptxSaveFormat, reason?: DocumentSaveReason) => Promise<boolean | void>;
3156
+ /** File > Save: writes `.pptx`, reported to host storage as `save`. */
3157
+ handleSave: () => void;
3135
3158
  handleSaveAsPptx: () => void;
3136
3159
  handleSaveAsPpsx: () => void;
3137
3160
  handleSaveAsPptm: () => void;
@@ -3226,6 +3249,10 @@ interface UsePropertyHandlersInput {
3226
3249
  setIsDirty: React.Dispatch<React.SetStateAction<boolean>>;
3227
3250
  ops: ElementOperations;
3228
3251
  history: EditorHistoryResult;
3252
+ /** The host's `onPropertiesChange`: the fields a document-properties edit changed. */
3253
+ onPropertiesChange?: ((updates: Partial<PptxCoreProperties>) => void) | undefined;
3254
+ /** The host's `onNotesUpdate`: the new speaker-notes text of the active slide. */
3255
+ onNotesUpdate?: ((notes: string) => void) | undefined;
3229
3256
  }
3230
3257
  interface PropertyHandlersResult {
3231
3258
  handleUpdateNotes: (text: string, segments?: TextSegment[]) => void;
@@ -3336,6 +3363,10 @@ interface UseRecoveryDetectionInput {
3336
3363
  * an earlier configuration left behind. Defaults to true.
3337
3364
  */
3338
3365
  autosaveAllowed?: boolean;
3366
+ /** Host storage; the snapshot is read from its recovery methods when it has them. */
3367
+ storage?: DocumentStorage;
3368
+ /** Called with the stored record when a recovery snapshot is offered (the host's `onAutosaveRecovery`). */
3369
+ onOffered?: ((record: AutosaveRecord) => void) | undefined;
3339
3370
  /** Load the recovered bytes into the viewer. */
3340
3371
  onRestore?: (bytes: Uint8Array) => void;
3341
3372
  /** Legacy behaviour: also open the Version History panel when one is found. */
@@ -3446,6 +3477,10 @@ interface UseIOHandlersInput {
3446
3477
  activeSlideIndex: number;
3447
3478
  canvasSize: CanvasSize$1;
3448
3479
  filePath: string | undefined;
3480
+ /** Host `storage` prop, forwarded to the Save / Save As handlers. */
3481
+ storage?: DocumentStorage | undefined;
3482
+ /** Reports a failed Save / Save As to the host and the user. */
3483
+ onSaveError?: ((error: unknown) => void) | undefined;
3449
3484
  history: EditorHistoryResult;
3450
3485
  ops: ElementOperations;
3451
3486
  zoom: {
@@ -3465,6 +3500,10 @@ interface UseIOHandlersInput {
3465
3500
  serializeForRecovery: () => Promise<Uint8Array | null>;
3466
3501
  setContent: React$1.Dispatch<React$1.SetStateAction<ArrayBuffer | Uint8Array | null>>;
3467
3502
  onContentChange: ((content: Uint8Array) => void) | undefined;
3503
+ /** The host's `onPropertiesChange` (document-properties edits). */
3504
+ onPropertiesChange?: ((updates: Partial<PptxCoreProperties>) => void) | undefined;
3505
+ /** The host's `onNotesUpdate` (speaker-notes edits). */
3506
+ onNotesUpdate?: ((notes: string) => void) | undefined;
3468
3507
  /** File > Options > Advanced > "Image Size and Quality" raster-scale multiplier. */
3469
3508
  imageExportScale?: number;
3470
3509
  /**
@@ -3498,6 +3537,10 @@ interface UseContentLifecycleInput {
3498
3537
  * Options > Save AutoRecover cadence > 120s default).
3499
3538
  */
3500
3539
  autosaveIntervalMs?: number;
3540
+ /** Host `storage` prop: recovery snapshots go to its recovery methods when it has them. */
3541
+ storage?: DocumentStorage;
3542
+ /** The host's `onAutosave`: called with the bytes of each recovery snapshot written. */
3543
+ onAutosave?: ((data: Uint8Array) => void) | undefined;
3501
3544
  /**
3502
3545
  * File > Fonts > "Embed fonts in the file". Forwarded to `useSerialize`, so
3503
3546
  * turning it off actually strips the embedded font data on the next save.
@@ -3600,6 +3643,10 @@ interface UseViewerIntegrationInput {
3600
3643
  * verdict (host `autosave` prop as a ceiling, title-bar toggle inside it).
3601
3644
  */
3602
3645
  autosaveEnabled: boolean;
3646
+ /** Host `storage` prop: Save goes to it, and so do recovery snapshots when it keeps them. */
3647
+ storage?: DocumentStorage;
3648
+ /** A Save / Save As failed: report it to the host and the user. */
3649
+ onSaveError?: (error: unknown) => void;
3603
3650
  /**
3604
3651
  * Whether the host permits autosave at all. Only the recovery prompt needs
3605
3652
  * this separately from `autosaveEnabled`: a user who merely switched the
@@ -3658,6 +3705,18 @@ interface UseViewerIntegrationInput {
3658
3705
  onZoomChange: ((zoom: number) => void) | undefined;
3659
3706
  onSelectionChange: ((ids: string[]) => void) | undefined;
3660
3707
  onSlideCountChange: ((count: number) => void) | undefined;
3708
+ /** The host's `onAutosave`: bytes of each recovery snapshot written. */
3709
+ onAutosave?: ((content: Uint8Array) => void) | undefined;
3710
+ /** The host's `onAutosaveStatus`: every autosave lifecycle transition. */
3711
+ onAutosaveStatus?: ((status: ViewerAutosaveStatus) => void) | undefined;
3712
+ /** The host's `onAutosaveRecovery`: a recovery snapshot was offered. */
3713
+ onAutosaveRecovery?: ((record: AutosaveRecord) => void) | undefined;
3714
+ /** The host's `onPropertiesChange`: a document-properties edit. */
3715
+ onPropertiesChange?: ((updates: Partial<PptxCoreProperties>) => void) | undefined;
3716
+ /** The host's `onNotesUpdate`: a speaker-notes edit. */
3717
+ onNotesUpdate?: ((notes: string) => void) | undefined;
3718
+ /** The host's `onPresentationChange`: slide show mode entered or left. */
3719
+ onPresentationChange?: ((presenting: boolean) => void) | undefined;
3661
3720
  /** Host UI customisation helpers, spread onto the imperative handle. */
3662
3721
  customizationApi?: ViewerCustomizationApi;
3663
3722
  /** Resolved host UI customisation, read by the keyboard shortcuts. */
@@ -3987,6 +4046,10 @@ interface UseExportSaveAsInput {
3987
4046
  /** Separated master/layout (template) elements, merged back at save time. */
3988
4047
  templateElementsBySlideId: Record<string, PptxElement[]>;
3989
4048
  filePath: string | undefined;
4049
+ /** Host `storage` prop: when set, the saved bytes go to `storage.save()`, not a download. */
4050
+ storage?: DocumentStorage | undefined;
4051
+ /** Reports a failed Save / Save As (serialising, or the host's storage rejected). */
4052
+ onSaveError?: ((error: unknown) => void) | undefined;
3990
4053
  /** `useSerialize`'s callback: the one place save options are assembled. */
3991
4054
  serializeSlides: SerializeSlides;
3992
4055
  /** Presentation-level state, carried into the deck-JSON export document. */
@@ -4013,7 +4076,10 @@ interface UseExportSaveAsInput {
4013
4076
  }
4014
4077
  interface ExportSaveAsResult {
4015
4078
  handleExportJson: () => void;
4016
- handleSaveAsFormat: (format: PptxSaveFormat) => Promise<void>;
4079
+ /** Resolves false when nothing was saved (no deck yet, or the save or the host's storage failed). */
4080
+ handleSaveAsFormat: (format: PptxSaveFormat, reason?: DocumentSaveReason) => Promise<boolean | void>;
4081
+ /** File > Save: `.pptx`, reported to host storage as `save`. */
4082
+ handleSave: () => void;
4017
4083
  handleSaveAsPptx: () => void;
4018
4084
  handleSaveAsPpsx: () => void;
4019
4085
  handleSaveAsPptm: () => void;
@@ -4544,4 +4610,4 @@ interface FragmentedTransitionLayerProps {
4544
4610
  declare function FragmentedTransitionLayer({ layer, slide, templateElements, canvasSize, scale, zIndex, layerName }: FragmentedTransitionLayerProps): React$1.ReactElement;
4545
4611
 
4546
4612
  export { FragmentedTransitionLayer, MIN_TOUCH_TARGET, MorphTransitionOverlay, PresentationTransitionOverlay, SlideLayer, computeToolbarVisibility, useAnimationPlayback, useAnnotationHandlers, useAudienceMode, useAutosave, useBroadcastFollower, useCanvasInteractions, useClipboardHandlers, useCollaborativeHistory, useCollaborativeState, useComments, useContentLifecycle, useDerivedElementState, useDerivedSlideState, useDialogCustomShows, useEditorHistory, useEditorOperations, useElementManipulation, useElementOperations, useExportHandlers, useExportSaveAs, useFindReplace, useFollowMode, useFontInjection, useGroupAlignLayerHandlers, useIOHandlers, useInsertElements, useIsMobile, useKeyboardInsets, useKeyboardShortcutWiring, useKeyboardShortcuts, useLayoutSwitching, useLoadContent, useMergeShapesHandler, useModalDismissDrag, usePointerHandlers, usePresenceTracking, usePresentationAnnotations, usePresentationKeyboard, usePresentationMode, usePresentationSetup, usePresenterWindow, usePrintHandlers, usePropertyHandlers, useRecoveryDetection, useReducedMotion, useRehearsalTimings, useResizablePanels, useSectionOperations, useSerialize, useSheetDismissDrag, useSlideManagement, useSlideNavigation, useSwipeNavigation, useTableOperations, useThemeHandlers, useThemeSwitching, useToolbarVisibility, useTouchGestures, useViewerBuildingBlocks, useViewerCoreState, useViewerDialogs, useViewerIntegration, useViewerOptions, useViewerState, useViewerUIState, useVirtualizedSlides, useYjsDocumentSync, useYjsProvider, useZoomNavigation, useZoomViewport };
4547
- export type { AnnotationHandlersResult, AnnotationStroke, AutosaveStatus, CanvasInteractionHandlers, CollaborationContextValue, ConnectionStatus, ContentLifecycleResult, DerivedElementState, DerivedSlideState, EditorHistoryInput, EditorHistoryResult, EditorOperationsResult, ElementManipulationHandlers, ElementOperations, ExportHandlersResult, ExportSaveAsResult, FragmentedTransitionLayerProps, IOHandlersResult, InsertElementHandlers, LayoutSwitchingResult, MergeShapesHandlerInput, MergeShapesHandlers, ModalDismissDrag, ModalDismissDragHandlers, MorphTransitionOverlayProps, PresentationSetupResult, PresentationTool, PresentationTransitionOverlayProps, PrintHandlersResult, PropertyHandlersResult, SectionOperations, SheetDismissDrag, SheetDismissDragHandlers, SlideLayerProps, SlideManagementHandlers, TableOperationHandlers, ThemeHandlersResult, ThemeSwitchingResult, ToolbarVisibility, UseAnimationPlaybackInput, UseAnimationPlaybackResult, UseAnnotationHandlersInput, UseAutosaveInput, UseAutosaveResult, UseBroadcastFollowerInput, UseCanvasInteractionsInput, UseCollaborativeHistoryInput, UseCollaborativeHistoryResult, UseCollaborativeStateInput, UseContentLifecycleInput, UseDerivedElementStateInput, UseDerivedSlideStateInput, UseDialogCustomShowsInput, UseDialogCustomShowsResult, UseEditorOperationsInput, UseElementManipulationInput, UseElementOperationsInput, UseExportHandlersInput, UseExportSaveAsInput, UseFollowModeInput, UseFollowModeResult, UseFontInjectionInput, UseIOHandlersInput, UseInsertElementsInput, UseIsMobileResult, UseKeyboardInsetsResult, UseKeyboardShortcutWiringInput, UseKeyboardShortcutsInput, UseLayoutSwitchingInput, UseLoadContentInput, UseLoadContentResult, UsePointerHandlersInput, UsePresenceTrackingInput, UsePresenceTrackingResult, UsePresentationAnnotationsResult, UsePresentationSetupInput, UsePresenterWindowInput, UsePresenterWindowResult, UsePrintHandlersInput, UsePropertyHandlersInput, UseRecoveryDetectionInput, UseReducedMotionResult, UseRehearsalTimingsInput, UseRehearsalTimingsResult, UseResizablePanelsResult, UseSectionOperationsInput, UseSerializeInput, UseSlideManagementInput, UseSlideNavigationInput, UseSlideNavigationResult, UseSwipeNavigationInput, UseSwipeNavigationResult, UseTableOperationsInput, UseThemeHandlersInput, UseThemeSwitchingInput, UseTouchGesturesInput, UseViewerBuildingBlocksInput, UseViewerCoreStateInput, UseViewerDialogsInput, UseViewerIntegrationInput, UseViewerOptionsResult, UseViewerStateInput, UseYjsDocumentSyncInput, UseYjsProviderInput, UseYjsProviderResult, UseZoomNavigationInput, UseZoomNavigationResult, UserPresence, ViewerBuildingBlocksResult, ViewerCoreState, ViewerDialogsResult, ViewerIntegrationResult, ViewerState, ViewerUIState, VirtualizedSlidesOptions, VirtualizedSlidesResult };
4613
+ export type { AnnotationHandlersResult, AnnotationStroke, AutosaveStatus, CanvasInteractionHandlers, CollaborationContextValue, ConnectionStatus$1 as ConnectionStatus, ContentLifecycleResult, DerivedElementState, DerivedSlideState, EditorHistoryInput, EditorHistoryResult, EditorOperationsResult, ElementManipulationHandlers, ElementOperations, ExportHandlersResult, ExportSaveAsResult, FragmentedTransitionLayerProps, IOHandlersResult, InsertElementHandlers, LayoutSwitchingResult, MergeShapesHandlerInput, MergeShapesHandlers, ModalDismissDrag, ModalDismissDragHandlers, MorphTransitionOverlayProps, PresentationSetupResult, PresentationTool, PresentationTransitionOverlayProps, PrintHandlersResult, PropertyHandlersResult, SectionOperations, SheetDismissDrag, SheetDismissDragHandlers, SlideLayerProps, SlideManagementHandlers, TableOperationHandlers, ThemeHandlersResult, ThemeSwitchingResult, ToolbarVisibility, UseAnimationPlaybackInput, UseAnimationPlaybackResult, UseAnnotationHandlersInput, UseAutosaveInput, UseAutosaveResult, UseBroadcastFollowerInput, UseCanvasInteractionsInput, UseCollaborativeHistoryInput, UseCollaborativeHistoryResult, UseCollaborativeStateInput, UseContentLifecycleInput, UseDerivedElementStateInput, UseDerivedSlideStateInput, UseDialogCustomShowsInput, UseDialogCustomShowsResult, UseEditorOperationsInput, UseElementManipulationInput, UseElementOperationsInput, UseExportHandlersInput, UseExportSaveAsInput, UseFollowModeInput, UseFollowModeResult, UseFontInjectionInput, UseIOHandlersInput, UseInsertElementsInput, UseIsMobileResult, UseKeyboardInsetsResult, UseKeyboardShortcutWiringInput, UseKeyboardShortcutsInput, UseLayoutSwitchingInput, UseLoadContentInput, UseLoadContentResult, UsePointerHandlersInput, UsePresenceTrackingInput, UsePresenceTrackingResult, UsePresentationAnnotationsResult, UsePresentationSetupInput, UsePresenterWindowInput, UsePresenterWindowResult, UsePrintHandlersInput, UsePropertyHandlersInput, UseRecoveryDetectionInput, UseReducedMotionResult, UseRehearsalTimingsInput, UseRehearsalTimingsResult, UseResizablePanelsResult, UseSectionOperationsInput, UseSerializeInput, UseSlideManagementInput, UseSlideNavigationInput, UseSlideNavigationResult, UseSwipeNavigationInput, UseSwipeNavigationResult, UseTableOperationsInput, UseThemeHandlersInput, UseThemeSwitchingInput, UseTouchGesturesInput, UseViewerBuildingBlocksInput, UseViewerCoreStateInput, UseViewerDialogsInput, UseViewerIntegrationInput, UseViewerOptionsResult, UseViewerStateInput, UseYjsDocumentSyncInput, UseYjsProviderInput, UseYjsProviderResult, UseZoomNavigationInput, UseZoomNavigationResult, UserPresence, ViewerBuildingBlocksResult, ViewerCoreState, ViewerDialogsResult, ViewerIntegrationResult, ViewerState, ViewerUIState, VirtualizedSlidesOptions, VirtualizedSlidesResult };