pptx-react-viewer 4.49.0 → 4.51.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 (124) hide show
  1. package/CHANGELOG.md +125 -0
  2. package/README.md +38 -4
  3. package/dist/{AiChatPanel-S4WNQCY4.js → AiChatPanel-EV22O7UO.js} +19 -20
  4. package/dist/AiChatPanel-EV22O7UO.js.br +0 -0
  5. package/dist/AiChatPanel-EV22O7UO.js.gz +0 -0
  6. package/dist/{AiChatPanel-NKTBHT5B.mjs → AiChatPanel-R323KNGN.mjs} +1 -2
  7. package/dist/AiChatPanel-R323KNGN.mjs.br +0 -0
  8. package/dist/AiChatPanel-R323KNGN.mjs.gz +0 -0
  9. package/dist/{chunk-Z62JFXMZ.mjs → chunk-ACFR4LFQ.mjs} +577 -1028
  10. package/dist/chunk-ACFR4LFQ.mjs.br +0 -0
  11. package/dist/chunk-ACFR4LFQ.mjs.gz +0 -0
  12. package/dist/chunk-DDJ634MV.js.br +0 -0
  13. package/dist/chunk-DDJ634MV.js.gz +0 -0
  14. package/dist/{chunk-YKLL2Z33.mjs → chunk-ETJ752B5.mjs} +597 -1871
  15. package/dist/chunk-ETJ752B5.mjs.br +0 -0
  16. package/dist/chunk-ETJ752B5.mjs.gz +0 -0
  17. package/dist/chunk-QIUK53JR.mjs.br +0 -0
  18. package/dist/chunk-QIUK53JR.mjs.gz +0 -0
  19. package/dist/{chunk-ME5QRTVS.js → chunk-V3XADJ2O.js} +763 -1214
  20. package/dist/chunk-V3XADJ2O.js.br +0 -0
  21. package/dist/chunk-V3XADJ2O.js.gz +0 -0
  22. package/dist/{chunk-2ZXXHNNR.js → chunk-VI5DQRQZ.js} +2052 -3325
  23. package/dist/chunk-VI5DQRQZ.js.br +0 -0
  24. package/dist/chunk-VI5DQRQZ.js.gz +0 -0
  25. package/dist/{chunk-JAI42EXQ.js → chunk-Z22RD3E2.js} +41 -12
  26. package/dist/chunk-Z22RD3E2.js.br +0 -0
  27. package/dist/chunk-Z22RD3E2.js.gz +0 -0
  28. package/dist/{chunk-PFV626ED.mjs → chunk-ZCGYPCZM.mjs} +37 -8
  29. package/dist/chunk-ZCGYPCZM.mjs.br +0 -0
  30. package/dist/chunk-ZCGYPCZM.mjs.gz +0 -0
  31. package/dist/i18n/de.cjs +1138 -221
  32. package/dist/i18n/de.cjs.br +0 -0
  33. package/dist/i18n/de.cjs.gz +0 -0
  34. package/dist/i18n/de.mjs +1138 -221
  35. package/dist/i18n/de.mjs.br +0 -0
  36. package/dist/i18n/de.mjs.gz +0 -0
  37. package/dist/i18n/es.cjs +1138 -221
  38. package/dist/i18n/es.cjs.br +0 -0
  39. package/dist/i18n/es.cjs.gz +0 -0
  40. package/dist/i18n/es.mjs +1138 -221
  41. package/dist/i18n/es.mjs.br +0 -0
  42. package/dist/i18n/es.mjs.gz +0 -0
  43. package/dist/i18n/fr.cjs +1138 -221
  44. package/dist/i18n/fr.cjs.br +0 -0
  45. package/dist/i18n/fr.cjs.gz +0 -0
  46. package/dist/i18n/fr.mjs +1138 -221
  47. package/dist/i18n/fr.mjs.br +0 -0
  48. package/dist/i18n/fr.mjs.gz +0 -0
  49. package/dist/i18n/zh-CN.cjs +1138 -221
  50. package/dist/i18n/zh-CN.cjs.br +0 -0
  51. package/dist/i18n/zh-CN.cjs.gz +0 -0
  52. package/dist/i18n/zh-CN.mjs +1138 -221
  53. package/dist/i18n/zh-CN.mjs.br +0 -0
  54. package/dist/i18n/zh-CN.mjs.gz +0 -0
  55. package/dist/index.d.ts +56 -27
  56. package/dist/index.js +28 -24
  57. package/dist/index.js.br +0 -0
  58. package/dist/index.js.gz +0 -0
  59. package/dist/index.mjs +3 -3
  60. package/dist/index.mjs.br +0 -0
  61. package/dist/index.mjs.gz +0 -0
  62. package/dist/internals.d.ts +105 -94
  63. package/dist/internals.js +81 -81
  64. package/dist/internals.js.br +0 -0
  65. package/dist/internals.js.gz +0 -0
  66. package/dist/internals.mjs +2 -2
  67. package/dist/internals.mjs.br +0 -0
  68. package/dist/internals.mjs.gz +0 -0
  69. package/dist/pptx-viewer-canvas.css +1 -1
  70. package/dist/pptx-viewer-canvas.css.br +0 -0
  71. package/dist/pptx-viewer-canvas.css.gz +0 -0
  72. package/dist/pptx-viewer.css +1 -1
  73. package/dist/pptx-viewer.css.br +0 -0
  74. package/dist/pptx-viewer.css.gz +0 -0
  75. package/dist/viewer/index.d.ts +58 -24
  76. package/dist/viewer/index.js +23 -19
  77. package/dist/viewer/index.js.br +0 -0
  78. package/dist/viewer/index.js.gz +0 -0
  79. package/dist/viewer/index.mjs +3 -3
  80. package/dist/viewer/index.mjs.br +0 -0
  81. package/dist/viewer/index.mjs.gz +0 -0
  82. package/dist/{y-webrtc-2H7UYAQD.mjs → y-webrtc-HRGGVQZH.mjs} +1 -1
  83. package/dist/y-webrtc-HRGGVQZH.mjs.br +0 -0
  84. package/dist/y-webrtc-HRGGVQZH.mjs.gz +0 -0
  85. package/dist/{y-webrtc-DVPQNFLL.js → y-webrtc-QVVT5PCK.js} +124 -124
  86. package/dist/y-webrtc-QVVT5PCK.js.br +0 -0
  87. package/dist/y-webrtc-QVVT5PCK.js.gz +0 -0
  88. package/dist/{y-websocket-WORVRRQS.mjs → y-websocket-46M6UFI7.mjs} +1 -1
  89. package/dist/y-websocket-46M6UFI7.mjs.br +0 -0
  90. package/dist/y-websocket-46M6UFI7.mjs.gz +0 -0
  91. package/dist/{y-websocket-TN4OKPXQ.js → y-websocket-EDOMWMAD.js} +78 -78
  92. package/dist/y-websocket-EDOMWMAD.js.br +0 -0
  93. package/dist/y-websocket-EDOMWMAD.js.gz +0 -0
  94. package/package.json +3 -3
  95. package/dist/AiChatPanel-NKTBHT5B.mjs.br +0 -0
  96. package/dist/AiChatPanel-NKTBHT5B.mjs.gz +0 -0
  97. package/dist/AiChatPanel-S4WNQCY4.js.br +0 -0
  98. package/dist/AiChatPanel-S4WNQCY4.js.gz +0 -0
  99. package/dist/chunk-2ZXXHNNR.js.br +0 -0
  100. package/dist/chunk-2ZXXHNNR.js.gz +0 -0
  101. package/dist/chunk-3VVZGHHY.mjs.br +0 -0
  102. package/dist/chunk-3VVZGHHY.mjs.gz +0 -0
  103. package/dist/chunk-JAI42EXQ.js.br +0 -0
  104. package/dist/chunk-JAI42EXQ.js.gz +0 -0
  105. package/dist/chunk-ME5QRTVS.js.br +0 -0
  106. package/dist/chunk-ME5QRTVS.js.gz +0 -0
  107. package/dist/chunk-NUNDT6EL.js.br +0 -0
  108. package/dist/chunk-NUNDT6EL.js.gz +0 -0
  109. package/dist/chunk-PFV626ED.mjs.br +0 -0
  110. package/dist/chunk-PFV626ED.mjs.gz +0 -0
  111. package/dist/chunk-YKLL2Z33.mjs.br +0 -0
  112. package/dist/chunk-YKLL2Z33.mjs.gz +0 -0
  113. package/dist/chunk-Z62JFXMZ.mjs.br +0 -0
  114. package/dist/chunk-Z62JFXMZ.mjs.gz +0 -0
  115. package/dist/y-webrtc-2H7UYAQD.mjs.br +0 -0
  116. package/dist/y-webrtc-2H7UYAQD.mjs.gz +0 -0
  117. package/dist/y-webrtc-DVPQNFLL.js.br +0 -0
  118. package/dist/y-webrtc-DVPQNFLL.js.gz +0 -0
  119. package/dist/y-websocket-TN4OKPXQ.js.br +0 -0
  120. package/dist/y-websocket-TN4OKPXQ.js.gz +0 -0
  121. package/dist/y-websocket-WORVRRQS.mjs.br +0 -0
  122. package/dist/y-websocket-WORVRRQS.mjs.gz +0 -0
  123. package/dist/{chunk-NUNDT6EL.js → chunk-DDJ634MV.js} +436 -436
  124. package/dist/{chunk-3VVZGHHY.mjs → chunk-QIUK53JR.mjs} +436 -436
Binary file
Binary file
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React$1 from 'react';
2
- import React$1__default from 'react';
2
+ import React$1__default, { ReactNode, ReactElement } from 'react';
3
3
  import * as ooxml_ui_pptx 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';
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, PptxAutosaveStatus } 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';
@@ -302,21 +302,21 @@ interface PowerPointViewerProps extends ViewportFitOptions {
302
302
  */
303
303
  onThemeChange?: (key: string) => void;
304
304
  /**
305
- * Initial locale code for File > Options > Language. Falls back to a
306
- * persisted `localStorage` choice, then `'en'`.
305
+ * Initial locale code for File > Options > Language. Falls back to a persisted `localStorage`
306
+ * choice, then `'en'`. Ignored inside a `PptxI18nProvider`, whose `locale` is the language.
307
307
  */
308
308
  defaultLocale?: string;
309
309
  /**
310
- * Locale choices offered by File > Options > Language. Defaults to the
311
- * codes actually registered on the host's `react-i18next` instance
312
- * (mapped through the shared `LOCALE_CATALOG` for display labels).
310
+ * Locale choices offered by File > Options > Language. Defaults to the codes registered on the
311
+ * host's `react-i18next` instance. Inside a `PptxI18nProvider` there is no default: pass two or
312
+ * more, together with `onLocaleChange`, to show the Language category.
313
313
  */
314
314
  availableLocales?: LocaleCatalogEntry[];
315
315
  /**
316
- * Called when the user picks a language from File > Options > Language.
317
- * When provided, the host owns applying and persisting the choice (the
318
- * viewer will not call `i18n.changeLanguage` or touch `localStorage`
319
- * itself); otherwise the viewer applies and persists it directly.
316
+ * Called when the user picks a language from File > Options > Language. When provided, the
317
+ * host owns applying and persisting the choice; otherwise the viewer applies and persists it
318
+ * itself. Inside a `PptxI18nProvider` the host always owns the language: without this callback
319
+ * the Language category is left out.
320
320
  */
321
321
  onLocaleChange?: (code: string) => void;
322
322
  /**
@@ -546,6 +546,45 @@ declare function getAnimationInitialStyle(preset: PptxAnimationPreset | undefine
546
546
  * access (e.g. serialising the current content for saving).
547
547
  */
548
548
  declare const PowerPointViewer: React$1.ForwardRefExoticComponent<PowerPointViewerProps & React$1.RefAttributes<PowerPointViewerHandle>>;
549
+ //#endregion
550
+ //#region src/viewer/i18n/types.d.ts
551
+ /** What the viewer passes `translate`: exactly the params of the call. */
552
+ interface PptxTranslateParams {
553
+ readonly defaultValue?: string;
554
+ readonly count?: number;
555
+ readonly [name: string]: unknown;
556
+ }
557
+ /**
558
+ * A host translator for {@link PptxI18nProvider}: the text for a viewer key (`pptx.*`) in the
559
+ * host's active language. Return the key itself, an empty string, `null` or `undefined` for "no
560
+ * translation": the viewer then shows its built-in English text.
561
+ */
562
+ type PptxTranslate = (key: string, params?: PptxTranslateParams) => string | null | undefined;
563
+ //#endregion
564
+ //#region src/viewer/i18n/provider.d.ts
565
+ interface PptxI18nProviderProps {
566
+ /**
567
+ * Translates a viewer key; see {@link PptxTranslate}. Keep it referentially stable (a
568
+ * module-level function or `useCallback`): the viewer re-translates, re-rendering and re-running
569
+ * every translated effect, whenever `translate` or `locale` changes. To pick up messages loaded
570
+ * later for the same language, pass a new function.
571
+ */
572
+ readonly translate: PptxTranslate;
573
+ /**
574
+ * The host's active language: what the viewer reports and File > Options > Language shows as
575
+ * selected. A change re-translates the viewer, also when `translate` stays the same.
576
+ */
577
+ readonly locale: string;
578
+ readonly children?: ReactNode;
579
+ }
580
+ /**
581
+ * Translates every viewer component below it (`PowerPointViewer` and the standalone building
582
+ * blocks) through the host's own i18n library instead of react-i18next. A `PowerPointViewer`
583
+ * reads the provider nearest above it; a provider rendered inside the viewer is ignored, so the
584
+ * whole viewer shares one language. React only: the other bindings translate through their
585
+ * framework's i18n library or a `messages` dictionary.
586
+ */
587
+ declare function PptxI18nProvider({ translate, locale, children }: PptxI18nProviderProps): ReactElement;
549
588
 
550
589
  //#region src/viewer/components/toolbar/toolbar-types.d.ts
551
590
  interface ToolbarProps {
@@ -617,6 +656,8 @@ interface ToolbarProps {
617
656
  onAddShape: () => void;
618
657
  onAddTable: (rows?: number, columns?: number) => void;
619
658
  onAddChart?: (chartKind: InsertChartKind) => void;
659
+ /** Opens the Insert Chart dialog; without it the Chart menu leaves "Insert Chart..." out. */
660
+ onOpenChartDialog?: () => void;
620
661
  onAddSmartArt: () => void;
621
662
  onAddEquation: () => void;
622
663
  onAddActionButton: (shapeType: string) => void;
@@ -1001,20 +1042,8 @@ interface SlideCanvasProps {
1001
1042
  }
1002
1043
  //#endregion
1003
1044
  //#region src/viewer/hooks/useAutosave.d.ts
1004
- type AutosaveStatus = {
1005
- state: 'idle';
1006
- } | {
1007
- state: 'disabled';
1008
- reason: string;
1009
- } | {
1010
- state: 'saving';
1011
- } | {
1012
- state: 'saved';
1013
- timestamp: number;
1014
- } | {
1015
- state: 'error';
1016
- message: string;
1017
- };
1045
+ /** The one autosave status every binding renders (`PptxAutosaveStatus` in `ooxml-ui/pptx`). */
1046
+ type AutosaveStatus = PptxAutosaveStatus;
1018
1047
  //#endregion
1019
1048
  //#region src/viewer/hooks/useViewerBuildingBlocks-types.d.ts
1020
1049
  interface UseViewerBuildingBlocksInput extends ViewportFitOptions {
@@ -1127,5 +1156,5 @@ declare function SlideTemplatePreview({ templateId, scheme }: SlideTemplatePrevi
1127
1156
  */
1128
1157
  declare function renderToCanvas(element: HTMLElement, options?: Partial<Options>): Promise<HTMLCanvasElement>;
1129
1158
 
1130
- export { PowerPointViewer, SlideCanvas, SlideTemplateGalleryDialog, SlideTemplatePreview, Toolbar, ViewerThemeProvider, getAnimationInitialStyle, renderToCanvas, useViewerBuildingBlocks, useViewerTheme };
1131
- export type { CollaborationContextValue, PowerPointViewerHandle, PowerPointViewerProps, SlideCanvasProps, SlideTemplateGalleryDialogProps, SlideTemplatePreviewProps, ToolbarProps, UseViewerBuildingBlocksInput, ViewerBuildingBlocksResult, ViewerLoadDetail };
1159
+ export { PowerPointViewer, PptxI18nProvider, SlideCanvas, SlideTemplateGalleryDialog, SlideTemplatePreview, Toolbar, ViewerThemeProvider, getAnimationInitialStyle, renderToCanvas, useViewerBuildingBlocks, useViewerTheme };
1160
+ export type { CollaborationContextValue, PowerPointViewerHandle, PowerPointViewerProps, PptxI18nProviderProps, PptxTranslate, PptxTranslateParams, SlideCanvasProps, SlideTemplateGalleryDialogProps, SlideTemplatePreviewProps, ToolbarProps, UseViewerBuildingBlocksInput, ViewerBuildingBlocksResult, ViewerLoadDetail };
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunk2ZXXHNNR_js = require('./chunk-2ZXXHNNR.js');
4
- var chunkME5QRTVS_js = require('./chunk-ME5QRTVS.js');
5
- var chunkJAI42EXQ_js = require('./chunk-JAI42EXQ.js');
3
+ var chunkVI5DQRQZ_js = require('./chunk-VI5DQRQZ.js');
4
+ var chunkV3XADJ2O_js = require('./chunk-V3XADJ2O.js');
5
+ var chunkZ22RD3E2_js = require('./chunk-Z22RD3E2.js');
6
6
  require('./chunk-PIRHQTI4.js');
7
7
  var pptx = require('ooxml-ui/pptx');
8
8
  var i18n = require('ooxml-ui/pptx/i18n');
@@ -11,87 +11,91 @@ var i18n = require('ooxml-ui/pptx/i18n');
11
11
 
12
12
  Object.defineProperty(exports, "PowerPointViewer", {
13
13
  enumerable: true,
14
- get: function () { return chunk2ZXXHNNR_js.PowerPointViewer; }
14
+ get: function () { return chunkVI5DQRQZ_js.PowerPointViewer; }
15
+ });
16
+ Object.defineProperty(exports, "PptxI18nProvider", {
17
+ enumerable: true,
18
+ get: function () { return chunkVI5DQRQZ_js.PptxI18nProvider; }
15
19
  });
16
20
  Object.defineProperty(exports, "SlideCanvas", {
17
21
  enumerable: true,
18
- get: function () { return chunk2ZXXHNNR_js.SlideCanvas; }
22
+ get: function () { return chunkVI5DQRQZ_js.SlideCanvas; }
19
23
  });
20
24
  Object.defineProperty(exports, "SlideTemplateGalleryDialog", {
21
25
  enumerable: true,
22
- get: function () { return chunk2ZXXHNNR_js.SlideTemplateGalleryDialog; }
26
+ get: function () { return chunkVI5DQRQZ_js.SlideTemplateGalleryDialog; }
23
27
  });
24
28
  Object.defineProperty(exports, "SlideTemplatePreview", {
25
29
  enumerable: true,
26
- get: function () { return chunk2ZXXHNNR_js.SlideTemplatePreview; }
30
+ get: function () { return chunkVI5DQRQZ_js.SlideTemplatePreview; }
27
31
  });
28
32
  Object.defineProperty(exports, "THEME_CATALOG", {
29
33
  enumerable: true,
30
- get: function () { return chunk2ZXXHNNR_js.THEME_CATALOG; }
34
+ get: function () { return chunkVI5DQRQZ_js.THEME_CATALOG; }
31
35
  });
32
36
  Object.defineProperty(exports, "Toolbar", {
33
37
  enumerable: true,
34
- get: function () { return chunk2ZXXHNNR_js.Toolbar; }
38
+ get: function () { return chunkVI5DQRQZ_js.Toolbar; }
35
39
  });
36
40
  Object.defineProperty(exports, "ViewerThemeProvider", {
37
41
  enumerable: true,
38
- get: function () { return chunk2ZXXHNNR_js.ViewerThemeProvider; }
42
+ get: function () { return chunkVI5DQRQZ_js.ViewerThemeProvider; }
39
43
  });
40
44
  Object.defineProperty(exports, "defaultCssVars", {
41
45
  enumerable: true,
42
- get: function () { return chunk2ZXXHNNR_js.defaultCssVars; }
46
+ get: function () { return chunkVI5DQRQZ_js.defaultCssVars; }
43
47
  });
44
48
  Object.defineProperty(exports, "defaultRadius", {
45
49
  enumerable: true,
46
- get: function () { return chunk2ZXXHNNR_js.defaultRadius; }
50
+ get: function () { return chunkVI5DQRQZ_js.defaultRadius; }
47
51
  });
48
52
  Object.defineProperty(exports, "defaultThemeColors", {
49
53
  enumerable: true,
50
- get: function () { return chunk2ZXXHNNR_js.defaultThemeColors; }
54
+ get: function () { return chunkVI5DQRQZ_js.defaultThemeColors; }
51
55
  });
52
56
  Object.defineProperty(exports, "resolveThemeCatalogEntry", {
53
57
  enumerable: true,
54
- get: function () { return chunk2ZXXHNNR_js.resolveThemeCatalogEntry; }
58
+ get: function () { return chunkVI5DQRQZ_js.resolveThemeCatalogEntry; }
55
59
  });
56
60
  Object.defineProperty(exports, "themeToCssVars", {
57
61
  enumerable: true,
58
- get: function () { return chunk2ZXXHNNR_js.themeToCssVars; }
62
+ get: function () { return chunkVI5DQRQZ_js.themeToCssVars; }
59
63
  });
60
64
  Object.defineProperty(exports, "useViewerTheme", {
61
65
  enumerable: true,
62
- get: function () { return chunk2ZXXHNNR_js.useViewerTheme; }
66
+ get: function () { return chunkVI5DQRQZ_js.useViewerTheme; }
63
67
  });
64
68
  Object.defineProperty(exports, "vermilionDarkColors", {
65
69
  enumerable: true,
66
- get: function () { return chunk2ZXXHNNR_js.vermilionDarkColors; }
70
+ get: function () { return chunkVI5DQRQZ_js.vermilionDarkColors; }
67
71
  });
68
72
  Object.defineProperty(exports, "vermilionDarkTheme", {
69
73
  enumerable: true,
70
- get: function () { return chunk2ZXXHNNR_js.vermilionDarkTheme; }
74
+ get: function () { return chunkVI5DQRQZ_js.vermilionDarkTheme; }
71
75
  });
72
76
  Object.defineProperty(exports, "vermilionLightColors", {
73
77
  enumerable: true,
74
- get: function () { return chunk2ZXXHNNR_js.vermilionLightColors; }
78
+ get: function () { return chunkVI5DQRQZ_js.vermilionLightColors; }
75
79
  });
76
80
  Object.defineProperty(exports, "vermilionLightTheme", {
77
81
  enumerable: true,
78
- get: function () { return chunk2ZXXHNNR_js.vermilionLightTheme; }
82
+ get: function () { return chunkVI5DQRQZ_js.vermilionLightTheme; }
79
83
  });
80
84
  Object.defineProperty(exports, "vermilionRadius", {
81
85
  enumerable: true,
82
- get: function () { return chunk2ZXXHNNR_js.vermilionRadius; }
86
+ get: function () { return chunkVI5DQRQZ_js.vermilionRadius; }
83
87
  });
84
88
  Object.defineProperty(exports, "renderToCanvas", {
85
89
  enumerable: true,
86
- get: function () { return chunkME5QRTVS_js.renderToCanvas; }
90
+ get: function () { return chunkV3XADJ2O_js.renderToCanvas; }
87
91
  });
88
92
  Object.defineProperty(exports, "useViewerBuildingBlocks", {
89
93
  enumerable: true,
90
- get: function () { return chunkME5QRTVS_js.useViewerBuildingBlocks; }
94
+ get: function () { return chunkV3XADJ2O_js.useViewerBuildingBlocks; }
91
95
  });
92
96
  Object.defineProperty(exports, "getAnimationInitialStyle", {
93
97
  enumerable: true,
94
- get: function () { return chunkJAI42EXQ_js.getAnimationInitialStyle; }
98
+ get: function () { return chunkZ22RD3E2_js.getAnimationInitialStyle; }
95
99
  });
96
100
  Object.defineProperty(exports, "AVATAR_COLOR_SWATCHES", {
97
101
  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-YKLL2Z33.mjs';
2
- export { renderToCanvas, useViewerBuildingBlocks } from './chunk-Z62JFXMZ.mjs';
3
- export { getAnimationInitialStyle } from './chunk-PFV626ED.mjs';
1
+ export { PowerPointViewer, PptxI18nProvider, SlideCanvas, SlideTemplateGalleryDialog, SlideTemplatePreview, THEME_CATALOG, Toolbar, ViewerThemeProvider, defaultCssVars, defaultRadius, defaultThemeColors, resolveThemeCatalogEntry, themeToCssVars, useViewerTheme, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius } from './chunk-ETJ752B5.mjs';
2
+ export { renderToCanvas, useViewerBuildingBlocks } from './chunk-ACFR4LFQ.mjs';
3
+ export { getAnimationInitialStyle } from './chunk-ZCGYPCZM.mjs';
4
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,10 +1,10 @@
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';
1
+ import { CollaborationRole, CollaborationConfig, PowerPointViewerAPI, ViewerCustomizationApi, PptxAutosaveStatus, ShapeAdjustmentHandleDescriptor, ChangeCaseMode, ResolvedKeyboardCustomization, FindResult, EditorImagePasteOptions, InsertChartKind, InsertChartOptions, PasteSpecialFormat, SlidePasteRequest, SlideTemplateId, MorphTransitionPlan, ElementAnimationState, ZoomNavigationTarget, PresentationSnapshot, DocumentStorage, InlineTextDraftSink, ViewerMode, ShapeAdjustmentDragState, GestureKind, PointerLike, 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
4
  import { CollaborationWriteBackState } from 'ooxml-core/collab';
5
5
  import * as Y from 'yjs';
6
6
  import { Doc } from 'yjs';
7
- import React$1, { Dispatch, SetStateAction, MutableRefObject, RefObject, ForwardedRef } from 'react';
7
+ import React$1, { MutableRefObject, Dispatch, SetStateAction, RefObject, ForwardedRef } from 'react';
8
8
 
9
9
  //#region src/viewer/types-core.d.ts
10
10
  /**
@@ -305,6 +305,8 @@ interface ToolbarProps {
305
305
  onAddShape: () => void;
306
306
  onAddTable: (rows?: number, columns?: number) => void;
307
307
  onAddChart?: (chartKind: InsertChartKind) => void;
308
+ /** Opens the Insert Chart dialog; without it the Chart menu leaves "Insert Chart..." out. */
309
+ onOpenChartDialog?: () => void;
308
310
  onAddSmartArt: () => void;
309
311
  onAddEquation: () => void;
310
312
  onAddActionButton: (shapeType: string) => void;
@@ -516,6 +518,73 @@ interface InlineEditingState {
516
518
  registerInlineEditReader?: (elementId: string, read: () => InlineListReadResult) => () => void;
517
519
  }
518
520
  //#endregion
521
+ //#region src/viewer/hooks/pointer-handler-types.d.ts
522
+ interface UsePointerHandlersInput {
523
+ editorScale: number;
524
+ canvasStageRef: React.RefObject<HTMLDivElement | null>;
525
+ canvasSize: CanvasSize$1;
526
+ activeSlide: PptxSlide | undefined;
527
+ activeSlideIndex: number;
528
+ gridSpacingPx: number;
529
+ dragStateRef: React.MutableRefObject<DragState | null>;
530
+ resizeStateRef: React.MutableRefObject<ResizeState | null>;
531
+ shapeAdjustmentDragStateRef: React.MutableRefObject<ShapeAdjustmentDragState | null>;
532
+ marqueeStateRef: React.MutableRefObject<MarqueeSelectionState | null>;
533
+ /**
534
+ * Set on pointer-up when a drag/resize/adjustment gesture actually moved the
535
+ * element, so the click handler can tell a genuine "click an already-selected
536
+ * element to edit it" apart from the trailing click a completed gesture
537
+ * leaves behind. See {@link import('./viewer-core-state-types').ViewerCoreState.justInteractedRef}.
538
+ */
539
+ justInteractedRef: React.MutableRefObject<boolean>;
540
+ /** When true, pointer commits target the per-slide template store. */
541
+ editTemplateMode: boolean;
542
+ snapToGrid: boolean;
543
+ snapToShape: boolean;
544
+ guides: Array<{
545
+ id: string;
546
+ axis: 'h' | 'v';
547
+ position: number;
548
+ }>;
549
+ /** Template (master/layout) elements for the active slide (drag/marquee source while editing templates). */
550
+ templateElements: PptxElement[];
551
+ elementLookup: Map<string, PptxElement>;
552
+ setMarqueeSelectionState: React.Dispatch<React.SetStateAction<MarqueeSelectionState | null>>;
553
+ setSnapLines: React.Dispatch<React.SetStateAction<Array<{
554
+ axis: string;
555
+ position: number;
556
+ }>>>;
557
+ setTemplateElementsBySlideId: React.Dispatch<React.SetStateAction<Record<string, PptxElement[]>>>;
558
+ setPointerCommitNonce: React.Dispatch<React.SetStateAction<number>>;
559
+ effectiveSelectedIds: string[];
560
+ applySelection: (primaryId: string | null, ids?: string[]) => void;
561
+ clearSelection: () => void;
562
+ updateSlides: (updater: (s: PptxSlide[]) => PptxSlide[]) => void;
563
+ updateElementById: (id: string, updates: Partial<PptxElement>) => void;
564
+ markDirty: () => void;
565
+ /**
566
+ * Collaboration live-preview channel. Drag/resize write geometry straight to
567
+ * the DOM (no React state churn per frame), so without this remote peers saw
568
+ * nothing until pointer-up. Optional: absent in standalone building-block
569
+ * compositions, dormant when not collaborating.
570
+ */
571
+ livePatcher?: CollaborationLivePatcher;
572
+ /**
573
+ * Receives the canvas's move/resize gesture controller (see
574
+ * canvas-gestures.ts) so the press handlers can start it. Optional: a
575
+ * composition without it still arms and disarms the gesture records.
576
+ */
577
+ gestureRef?: React.MutableRefObject<CanvasGestures | null>;
578
+ }
579
+ //#endregion
580
+ //#region src/viewer/hooks/canvas-gestures.d.ts
581
+ interface CanvasGestures {
582
+ /** Start the gesture armed in `dragStateRef` (move) or `resizeStateRef` (resize). */
583
+ begin(kind: Exclude<GestureKind, 'rotate'>, id: string, pointer: PointerLike): void;
584
+ isActive(): boolean;
585
+ dispose(): void;
586
+ }
587
+ //#endregion
519
588
  //#region src/viewer/hooks/canvas-interaction-types.d.ts
520
589
  /**
521
590
  * Shared type for canvas interaction handler signatures.
@@ -552,7 +621,8 @@ interface EditorHistoryInput {
552
621
  error: string | null;
553
622
  /**
554
623
  * Undo-stack depth (File > Options > Advanced > "Maximum number of undos",
555
- * resolved via the shared `resolveHistoryDepth`). Defaults to 120.
624
+ * resolved via the shared `resolveHistoryDepth`). Defaults to the shared
625
+ * `DEFAULT_EDITOR_HISTORY_DEPTH`.
556
626
  */
557
627
  maxHistoryEntries?: number;
558
628
  hasActivePointerInteraction: () => boolean;
@@ -714,6 +784,8 @@ interface UseCanvasInteractionsInput {
714
784
  * `ViewerCoreState.justInteractedRef`.
715
785
  */
716
786
  justInteractedRef: React.MutableRefObject<boolean>;
787
+ /** The move/resize gesture controller a press starts (set by `usePointerHandlers`). */
788
+ gestureRef?: React.MutableRefObject<CanvasGestures | null>;
717
789
  setInlineEditingElementId: React.Dispatch<React.SetStateAction<string | null>>;
718
790
  setInlineEditingText: React.Dispatch<React.SetStateAction<string>>;
719
791
  setContextMenuState: React.Dispatch<React.SetStateAction<ElementContextMenuState | null>>;
@@ -949,7 +1021,7 @@ interface InsertElementHandlers {
949
1021
  handleAddTextBox: () => void;
950
1022
  handleAddShape: () => void;
951
1023
  handleAddTable: (rows?: number, columns?: number) => void;
952
- handleAddChart: (chartKind: InsertChartKind) => void;
1024
+ handleAddChart: (chartKind: InsertChartKind, options?: InsertChartOptions) => void;
953
1025
  handleInsertSmartArt: (layout: SmartArtLayout, defaultItems: string[]) => void;
954
1026
  handleInsertEquation: (omml: Record<string, unknown>) => void;
955
1027
  handleUpdateEquation: (omml: Record<string, unknown>) => void;
@@ -1421,6 +1493,9 @@ interface ViewerDialogsResult {
1421
1493
  /** Whether the Insert SmartArt dialog is visible. */
1422
1494
  isSmartArtDialogOpen: boolean;
1423
1495
  setIsSmartArtDialogOpen: React.Dispatch<React.SetStateAction<boolean>>;
1496
+ /** Whether the Insert Chart dialog is visible. */
1497
+ isChartDialogOpen: boolean;
1498
+ setIsChartDialogOpen: React.Dispatch<React.SetStateAction<boolean>>;
1424
1499
  /** Whether the equation (MathML/OMML) editor dialog is visible. */
1425
1500
  isEquationDialogOpen: boolean;
1426
1501
  setIsEquationDialogOpen: React.Dispatch<React.SetStateAction<boolean>>;
@@ -1569,6 +1644,8 @@ interface ViewerCoreState extends InlineEditingState, EditPointsModeState {
1569
1644
  mediaInputRef: React$1.RefObject<HTMLInputElement | null>;
1570
1645
  /** Mutable ref mirroring `activeSlideIndex` for use in event handlers that must not re-subscribe on index change. */
1571
1646
  activeSlideIndexRef: React$1.MutableRefObject<number>;
1647
+ /** The autosave engine, which receives in-progress inline text (set by useAutosave). */
1648
+ autosaveDraftSinkRef: React$1.MutableRefObject<InlineTextDraftSink | null>;
1572
1649
  /** Tracks the in-progress drag operation (move) for element(s). */
1573
1650
  dragStateRef: React$1.MutableRefObject<DragState | null>;
1574
1651
  /** Tracks the in-progress resize operation for an element. */
@@ -1594,6 +1671,11 @@ interface ViewerCoreState extends InlineEditingState, EditPointsModeState {
1594
1671
  * that made a single Ctrl+Z look like it did nothing.
1595
1672
  */
1596
1673
  justInteractedRef: React$1.MutableRefObject<boolean>;
1674
+ /**
1675
+ * The canvas's move/resize gesture controller, set by `usePointerHandlers`
1676
+ * and started by the press handlers (see canvas-gestures.ts).
1677
+ */
1678
+ gestureControllerRef: React$1.MutableRefObject<CanvasGestures | null>;
1597
1679
  /**
1598
1680
  * Interim ("live preview") Y.Doc write channel. Drag/resize and inline
1599
1681
  * typing publish through it so remote peers see the gesture before it
@@ -2179,20 +2261,8 @@ interface SlideCanvasProps {
2179
2261
  }
2180
2262
  //#endregion
2181
2263
  //#region src/viewer/hooks/useAutosave.d.ts
2182
- type AutosaveStatus = {
2183
- state: 'idle';
2184
- } | {
2185
- state: 'disabled';
2186
- reason: string;
2187
- } | {
2188
- state: 'saving';
2189
- } | {
2190
- state: 'saved';
2191
- timestamp: number;
2192
- } | {
2193
- state: 'error';
2194
- message: string;
2195
- };
2264
+ /** The one autosave status every binding renders (`PptxAutosaveStatus` in `ooxml-ui/pptx`). */
2265
+ type AutosaveStatus = PptxAutosaveStatus;
2196
2266
  interface UseAutosaveInput {
2197
2267
  /** Whether the document has unsaved changes. */
2198
2268
  isDirty: boolean;
@@ -2204,9 +2274,8 @@ interface UseAutosaveInput {
2204
2274
  * Autosave interval in seconds.
2205
2275
  *
2206
2276
  * @deprecated Pass {@link intervalMs} instead. Seconds cannot express the
2207
- * short cadence a host may legitimately ask for, and the shared clamp it went
2208
- * through raised anything under 10s back to 10s, so an explicit host policy
2209
- * was silently overruled. Ignored when `intervalMs` is given.
2277
+ * short cadence a host may legitimately ask for. Ignored when `intervalMs`
2278
+ * is given.
2210
2279
  */
2211
2280
  intervalSeconds?: number;
2212
2281
  /**
@@ -2223,18 +2292,18 @@ interface UseAutosaveInput {
2223
2292
  /** Host storage; its recovery methods replace IndexedDB when it has them. */
2224
2293
  storage?: DocumentStorage;
2225
2294
  /**
2226
- * The values a snapshot is built from, read fresh on each tick.
2227
- *
2228
- * `isDirty` stays true from the first edit until the user performs a real
2229
- * save, so on its own it makes the timer re-serialize and rewrite an
2230
- * identical deck every N seconds forever. Vue, Svelte and Vanilla never had
2231
- * that problem because they debounce on the slides array being reassigned;
2232
- * this is the same trigger, and `shouldWriteAutosaveSnapshot` writes
2233
- * whenever it is unsure. Omit it and every tick writes, as before.
2295
+ * The values a snapshot is built from (reassigned, never mutated), read on
2296
+ * every render. While `isDirty`, a change in any of them is an edit that
2297
+ * starts the AutoRecover interval; unchanged values never cause a rewrite.
2298
+ * Omit it and only the clean-to-dirty transition counts as an edit.
2234
2299
  */
2235
2300
  getChangeSources?: () => readonly unknown[];
2236
2301
  /** Called with the serialised deck after each snapshot is written (the host's `onAutosave`). */
2237
2302
  onSaved?: ((data: Uint8Array) => void) | undefined;
2303
+ /** Receives the engine so in-progress inline text counts as an edit (`reportInlineTextDraft`). */
2304
+ inlineDraftSinkRef?: MutableRefObject<InlineTextDraftSink | null>;
2305
+ /** The element whose inline editor is open; a closed editor's draft is dropped. */
2306
+ getInlineEditingId?: () => string | null;
2238
2307
  }
2239
2308
  interface UseAutosaveResult {
2240
2309
  /** Current autosave status for display in the StatusBar. */
@@ -2499,7 +2568,7 @@ interface UseYjsProviderInput {
2499
2568
  config?: CollaborationConfig;
2500
2569
  }
2501
2570
  interface UseYjsProviderResult {
2502
- /** Current WebSocket connection status. */
2571
+ /** Current connection status. */
2503
2572
  status: ConnectionStatus$1;
2504
2573
  /** The Yjs awareness instance (null until connected). */
2505
2574
  awareness: Awareness | null;
@@ -2511,24 +2580,19 @@ interface UseYjsProviderResult {
2511
2580
  * Whether the provider completed its initial document sync. Local doc
2512
2581
  * writes should be gated on this so a late joiner never seeds its
2513
2582
  * bootstrap deck into a room whose content has not arrived yet. Websocket
2514
- * flips it on the provider's 'synced' event; webrtc flips it on peer sync
2515
- * or after {@link INITIAL_SYNC_GRACE_MS} (a lone fresh-room peer never
2516
- * receives a sync event).
2583
+ * flips it on the provider's sync event; webrtc on peer sync or after the
2584
+ * grace period (a lone fresh-room peer never receives a sync event).
2517
2585
  */
2518
2586
  synced: boolean;
2519
2587
  /** Manually retry the connection after a timeout or error. */
2520
2588
  retry: () => void;
2521
2589
  }
2522
2590
  /**
2523
- * Lazily loads `yjs` and `y-websocket`, creates a Y.Doc and
2524
- * WebSocketProvider, and tracks the connection lifecycle.
2591
+ * Lazily loads `yjs` and the transport, creates a Y.Doc and provider, and
2592
+ * tracks the connection lifecycle through the shared session controller.
2593
+ * The Yjs packages are dynamically imported so they are fully tree-shaken
2594
+ * when collaboration is not enabled.
2525
2595
  *
2526
- * If the connection does not succeed within {@link CONNECTION_TIMEOUT_MS},
2527
- * the provider is torn down and status moves to `'error'`. The consumer
2528
- * can call `retry()` to attempt a fresh connection.
2529
- *
2530
- * The Yjs packages are dynamically imported so they are fully
2531
- * tree-shaken when collaboration is not enabled.
2532
2596
  * This low-level hook owns built-in transports only. Use useCollaborativeState
2533
2597
  * (or the full/headless viewer) to attach a host-owned external session.
2534
2598
  */
@@ -2915,59 +2979,6 @@ interface UseLoadContentResult {
2915
2979
  }
2916
2980
  declare function useLoadContent({ content, clearSelection, history, setSlides, setTemplateElementsBySlideId, mediaDataUrls, setCanvasSize, setSlideSizeEmu, setHeaderFooter, setFirstSlideNumber, setLayoutOptions, setSlideMasters, setModernCommentAuthors, setRecentColors, setTheme, setTableStyleMap, setTableStylesDefaultId, setTableStylesToDelete, setThemeOptions, setCustomShows, setActiveCustomShowId, setSections, setPresentationProperties, setViewProperties, setNotesMaster, setHandoutMaster, setNotesCanvasSize, setCustomProperties, setTagCollections, setCoreProperties, setAppProperties, setEmbeddedFonts, setActiveSlideIndex, setHasMacros, setHasDigitalSignatures, setDigitalSignatureCount, setGuides, setReadOnlyRecommendation, setModifyVerifier, setCompatToasts, setLoading, setError, setIsDirty, setIsEncrypted, onContentApplied, allowExternalImages, initialSlide }: UseLoadContentInput): UseLoadContentResult;
2917
2981
  //#endregion
2918
- //#region src/viewer/hooks/pointer-handler-types.d.ts
2919
- interface UsePointerHandlersInput {
2920
- editorScale: number;
2921
- canvasStageRef: React.RefObject<HTMLDivElement | null>;
2922
- canvasSize: CanvasSize$1;
2923
- activeSlide: PptxSlide | undefined;
2924
- activeSlideIndex: number;
2925
- gridSpacingPx: number;
2926
- dragStateRef: React.MutableRefObject<DragState | null>;
2927
- resizeStateRef: React.MutableRefObject<ResizeState | null>;
2928
- shapeAdjustmentDragStateRef: React.MutableRefObject<ShapeAdjustmentDragState | null>;
2929
- marqueeStateRef: React.MutableRefObject<MarqueeSelectionState | null>;
2930
- /**
2931
- * Set on pointer-up when a drag/resize/adjustment gesture actually moved the
2932
- * element, so the click handler can tell a genuine "click an already-selected
2933
- * element to edit it" apart from the trailing click a completed gesture
2934
- * leaves behind. See {@link import('./viewer-core-state-types').ViewerCoreState.justInteractedRef}.
2935
- */
2936
- justInteractedRef: React.MutableRefObject<boolean>;
2937
- /** When true, pointer commits target the per-slide template store. */
2938
- editTemplateMode: boolean;
2939
- snapToGrid: boolean;
2940
- snapToShape: boolean;
2941
- guides: Array<{
2942
- id: string;
2943
- axis: 'h' | 'v';
2944
- position: number;
2945
- }>;
2946
- /** Template (master/layout) elements for the active slide (drag/marquee source while editing templates). */
2947
- templateElements: PptxElement[];
2948
- elementLookup: Map<string, PptxElement>;
2949
- setMarqueeSelectionState: React.Dispatch<React.SetStateAction<MarqueeSelectionState | null>>;
2950
- setSnapLines: React.Dispatch<React.SetStateAction<Array<{
2951
- axis: string;
2952
- position: number;
2953
- }>>>;
2954
- setTemplateElementsBySlideId: React.Dispatch<React.SetStateAction<Record<string, PptxElement[]>>>;
2955
- setPointerCommitNonce: React.Dispatch<React.SetStateAction<number>>;
2956
- effectiveSelectedIds: string[];
2957
- applySelection: (primaryId: string | null, ids?: string[]) => void;
2958
- clearSelection: () => void;
2959
- updateSlides: (updater: (s: PptxSlide[]) => PptxSlide[]) => void;
2960
- updateElementById: (id: string, updates: Partial<PptxElement>) => void;
2961
- markDirty: () => void;
2962
- /**
2963
- * Collaboration live-preview channel. Drag/resize write geometry straight to
2964
- * the DOM (no React state churn per frame), so without this remote peers saw
2965
- * nothing until pointer-up. Optional: absent in standalone building-block
2966
- * compositions, dormant when not collaborating.
2967
- */
2968
- livePatcher?: CollaborationLivePatcher;
2969
- }
2970
- //#endregion
2971
2982
  //#region src/viewer/hooks/usePointerHandlers.d.ts
2972
2983
  declare function usePointerHandlers(input: UsePointerHandlersInput): void;
2973
2984
  //#endregion