pptx-react-viewer 4.37.0 → 4.39.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.
- package/CHANGELOG.md +74 -0
- package/dist/{chunk-L4E5A5DE.js → chunk-2LNWGZPT.js} +2157 -2013
- package/dist/chunk-2LNWGZPT.js.br +0 -0
- package/dist/chunk-2LNWGZPT.js.gz +0 -0
- package/dist/{chunk-RZIXD6X7.mjs → chunk-5XBS7MCX.mjs} +53 -13
- package/dist/chunk-5XBS7MCX.mjs.br +0 -0
- package/dist/chunk-5XBS7MCX.mjs.gz +0 -0
- package/dist/{chunk-YAODOVJY.js → chunk-HOKZJLT5.js} +52 -10
- package/dist/chunk-HOKZJLT5.js.br +0 -0
- package/dist/chunk-HOKZJLT5.js.gz +0 -0
- package/dist/{chunk-RXN5Q6CJ.mjs → chunk-TYULCCA6.mjs} +1183 -1039
- package/dist/chunk-TYULCCA6.mjs.br +0 -0
- package/dist/chunk-TYULCCA6.mjs.gz +0 -0
- package/dist/i18n/de.cjs +629 -42
- package/dist/i18n/de.cjs.br +0 -0
- package/dist/i18n/de.cjs.gz +0 -0
- package/dist/i18n/de.mjs +629 -42
- package/dist/i18n/de.mjs.br +0 -0
- package/dist/i18n/de.mjs.gz +0 -0
- package/dist/i18n/es.cjs +629 -42
- package/dist/i18n/es.cjs.br +0 -0
- package/dist/i18n/es.cjs.gz +0 -0
- package/dist/i18n/es.mjs +629 -42
- package/dist/i18n/es.mjs.br +0 -0
- package/dist/i18n/es.mjs.gz +0 -0
- package/dist/i18n/fr.cjs +632 -42
- package/dist/i18n/fr.cjs.br +0 -0
- package/dist/i18n/fr.cjs.gz +0 -0
- package/dist/i18n/fr.mjs +632 -42
- package/dist/i18n/fr.mjs.br +0 -0
- package/dist/i18n/fr.mjs.gz +0 -0
- package/dist/i18n/zh-CN.cjs +640 -53
- package/dist/i18n/zh-CN.cjs.br +0 -0
- package/dist/i18n/zh-CN.cjs.gz +0 -0
- package/dist/i18n/zh-CN.mjs +640 -53
- package/dist/i18n/zh-CN.mjs.br +0 -0
- package/dist/i18n/zh-CN.mjs.gz +0 -0
- package/dist/index.d.ts +22 -5
- package/dist/index.js +22 -22
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +37 -29
- package/dist/internals.js +80 -80
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +1 -1
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/viewer/index.d.ts +17 -3
- package/dist/viewer/index.js +17 -17
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +2 -2
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +3 -3
- package/dist/chunk-L4E5A5DE.js.br +0 -0
- package/dist/chunk-L4E5A5DE.js.gz +0 -0
- package/dist/chunk-RXN5Q6CJ.mjs.br +0 -0
- package/dist/chunk-RXN5Q6CJ.mjs.gz +0 -0
- package/dist/chunk-RZIXD6X7.mjs.br +0 -0
- package/dist/chunk-RZIXD6X7.mjs.gz +0 -0
- package/dist/chunk-YAODOVJY.js.br +0 -0
- package/dist/chunk-YAODOVJY.js.gz +0 -0
package/dist/i18n/zh-CN.mjs.br
CHANGED
|
Binary file
|
package/dist/i18n/zh-CN.mjs.gz
CHANGED
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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, ViewerTheme, ThemeCatalogEntry, AccountAuthConfig, 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, ViewerTheme, ThemeCatalogEntry, AccountAuthConfig, 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';
|
|
@@ -19,7 +19,7 @@ import { Options } from 'html2canvas-pro';
|
|
|
19
19
|
*/
|
|
20
20
|
type SupportedShapeType = 'rect' | 'roundRect' | 'ellipse' | 'triangle' | 'rtTriangle' | 'diamond' | 'cylinder' | 'parallelogram' | 'trapezoid' | 'pentagon' | 'hexagon' | 'octagon' | 'chevron' | 'star5' | 'star6' | 'star8' | 'plus' | 'heart' | 'cloud' | 'sun' | 'moon' | 'pie' | 'plaque' | 'teardrop' | 'line' | 'rtArrow' | 'leftArrow' | 'upArrow' | 'downArrow' | 'connector' | 'freeform';
|
|
21
21
|
/** The pixel dimensions of the slide canvas (presentation slide size). */
|
|
22
|
-
interface CanvasSize {
|
|
22
|
+
interface CanvasSize$1 {
|
|
23
23
|
/** Width of the canvas in CSS pixels. */
|
|
24
24
|
width: number;
|
|
25
25
|
/** Height of the canvas in CSS pixels. */
|
|
@@ -98,6 +98,13 @@ interface CollaborationContextValue {
|
|
|
98
98
|
retry: () => void;
|
|
99
99
|
}
|
|
100
100
|
//#endregion
|
|
101
|
+
//#region src/viewer/hooks/useLoadNotifications.d.ts
|
|
102
|
+
/** What `onLoad` reports: the same detail the Svelte and vanilla bindings send. */
|
|
103
|
+
interface ViewerLoadDetail {
|
|
104
|
+
slideCount: number;
|
|
105
|
+
canvasSize: CanvasSize;
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
101
108
|
//#region src/viewer/types-ui.d.ts
|
|
102
109
|
/**
|
|
103
110
|
* Base handle interface for file viewer components.
|
|
@@ -165,6 +172,13 @@ interface PowerPointViewerProps extends ViewportFitOptions {
|
|
|
165
172
|
onSelectionChange?: (elementIds: string[]) => void;
|
|
166
173
|
/** Callback when the total slide count changes (slide added/deleted). */
|
|
167
174
|
onSlideCountChange?: (count: number) => void;
|
|
175
|
+
/**
|
|
176
|
+
* Fired each time a presentation finishes loading without an error, with the slide count
|
|
177
|
+
* and canvas size.
|
|
178
|
+
*/
|
|
179
|
+
onLoad?: (detail: ViewerLoadDetail) => void;
|
|
180
|
+
/** Fired once per distinct load failure, with a human-readable message. */
|
|
181
|
+
onError?: (message: string) => void;
|
|
168
182
|
/**
|
|
169
183
|
* Host override for the File ▸ Open action. When provided, the built-in
|
|
170
184
|
* native file picker is bypassed and this is invoked instead; the host is
|
|
@@ -551,7 +565,7 @@ interface ToolbarProps {
|
|
|
551
565
|
onArmFreeformTool?: (tool: FreeformToolKind | null) => void;
|
|
552
566
|
onAddTextBox: () => void;
|
|
553
567
|
onAddShape: () => void;
|
|
554
|
-
onAddTable: () => void;
|
|
568
|
+
onAddTable: (rows?: number, columns?: number) => void;
|
|
555
569
|
onAddChart?: (chartKind: InsertChartKind) => void;
|
|
556
570
|
onAddSmartArt: () => void;
|
|
557
571
|
onAddEquation: () => void;
|
|
@@ -685,6 +699,9 @@ interface ToolbarProps {
|
|
|
685
699
|
onCompare?: () => void;
|
|
686
700
|
onToggleComments?: () => void;
|
|
687
701
|
isCommentsPanelOpen?: boolean;
|
|
702
|
+
/** The phone Insert sheet (opened from the bottom bar) and how it asks to close. */
|
|
703
|
+
isMobileInsertOpen?: boolean;
|
|
704
|
+
onCloseMobileInsert?: () => void;
|
|
688
705
|
spellCheckActive?: boolean;
|
|
689
706
|
slideCommentCount?: number;
|
|
690
707
|
/** Review > Comments Previous / Next / Delete: the deck's slides and how to rewrite them. */
|
|
@@ -798,7 +815,7 @@ interface SlideCanvasProps {
|
|
|
798
815
|
imagePaste?: CanvasImagePasteHandlers;
|
|
799
816
|
activeSlide: PptxSlide | undefined;
|
|
800
817
|
templateElements: PptxElement[];
|
|
801
|
-
canvasSize: CanvasSize;
|
|
818
|
+
canvasSize: CanvasSize$1;
|
|
802
819
|
zoom: ZoomViewport;
|
|
803
820
|
mode: ViewerMode;
|
|
804
821
|
canEdit: boolean;
|
|
@@ -1052,4 +1069,4 @@ declare function SlideTemplatePreview({ templateId, scheme }: SlideTemplatePrevi
|
|
|
1052
1069
|
declare function renderToCanvas(element: HTMLElement, options?: Partial<Options>): Promise<HTMLCanvasElement>;
|
|
1053
1070
|
|
|
1054
1071
|
export { PowerPointViewer, SlideCanvas, SlideTemplateGalleryDialog, SlideTemplatePreview, Toolbar, ViewerThemeProvider, getAnimationInitialStyle, renderToCanvas, useViewerBuildingBlocks, useViewerTheme };
|
|
1055
|
-
export type { CollaborationContextValue, PowerPointViewerHandle, PowerPointViewerProps, SlideCanvasProps, SlideTemplateGalleryDialogProps, SlideTemplatePreviewProps, ToolbarProps, UseViewerBuildingBlocksInput, ViewerBuildingBlocksResult };
|
|
1072
|
+
export type { CollaborationContextValue, PowerPointViewerHandle, PowerPointViewerProps, SlideCanvasProps, SlideTemplateGalleryDialogProps, SlideTemplatePreviewProps, ToolbarProps, UseViewerBuildingBlocksInput, ViewerBuildingBlocksResult, ViewerLoadDetail };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk2LNWGZPT_js = require('./chunk-2LNWGZPT.js');
|
|
4
|
+
var chunkHOKZJLT5_js = require('./chunk-HOKZJLT5.js');
|
|
5
5
|
var chunk43TOUP5U_js = require('./chunk-43TOUP5U.js');
|
|
6
6
|
require('./chunk-W2IMY5SY.js');
|
|
7
7
|
var pptx = require('ooxml-ui/pptx');
|
|
@@ -11,83 +11,83 @@ var i18n = require('ooxml-ui/pptx/i18n');
|
|
|
11
11
|
|
|
12
12
|
Object.defineProperty(exports, "PowerPointViewer", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunk2LNWGZPT_js.PowerPointViewer; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "SlideCanvas", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunk2LNWGZPT_js.SlideCanvas; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "SlideTemplateGalleryDialog", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunk2LNWGZPT_js.SlideTemplateGalleryDialog; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "SlideTemplatePreview", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunk2LNWGZPT_js.SlideTemplatePreview; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "THEME_CATALOG", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunk2LNWGZPT_js.THEME_CATALOG; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "Toolbar", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunk2LNWGZPT_js.Toolbar; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "ViewerThemeProvider", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunk2LNWGZPT_js.ViewerThemeProvider; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "defaultCssVars", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunk2LNWGZPT_js.defaultCssVars; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "defaultRadius", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunk2LNWGZPT_js.defaultRadius; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "defaultThemeColors", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunk2LNWGZPT_js.defaultThemeColors; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "resolveThemeCatalogEntry", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunk2LNWGZPT_js.resolveThemeCatalogEntry; }
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "themeToCssVars", {
|
|
57
57
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunk2LNWGZPT_js.themeToCssVars; }
|
|
59
59
|
});
|
|
60
60
|
Object.defineProperty(exports, "useViewerTheme", {
|
|
61
61
|
enumerable: true,
|
|
62
|
-
get: function () { return
|
|
62
|
+
get: function () { return chunk2LNWGZPT_js.useViewerTheme; }
|
|
63
63
|
});
|
|
64
64
|
Object.defineProperty(exports, "vermilionDarkColors", {
|
|
65
65
|
enumerable: true,
|
|
66
|
-
get: function () { return
|
|
66
|
+
get: function () { return chunk2LNWGZPT_js.vermilionDarkColors; }
|
|
67
67
|
});
|
|
68
68
|
Object.defineProperty(exports, "vermilionDarkTheme", {
|
|
69
69
|
enumerable: true,
|
|
70
|
-
get: function () { return
|
|
70
|
+
get: function () { return chunk2LNWGZPT_js.vermilionDarkTheme; }
|
|
71
71
|
});
|
|
72
72
|
Object.defineProperty(exports, "vermilionLightColors", {
|
|
73
73
|
enumerable: true,
|
|
74
|
-
get: function () { return
|
|
74
|
+
get: function () { return chunk2LNWGZPT_js.vermilionLightColors; }
|
|
75
75
|
});
|
|
76
76
|
Object.defineProperty(exports, "vermilionLightTheme", {
|
|
77
77
|
enumerable: true,
|
|
78
|
-
get: function () { return
|
|
78
|
+
get: function () { return chunk2LNWGZPT_js.vermilionLightTheme; }
|
|
79
79
|
});
|
|
80
80
|
Object.defineProperty(exports, "vermilionRadius", {
|
|
81
81
|
enumerable: true,
|
|
82
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunk2LNWGZPT_js.vermilionRadius; }
|
|
83
83
|
});
|
|
84
84
|
Object.defineProperty(exports, "renderToCanvas", {
|
|
85
85
|
enumerable: true,
|
|
86
|
-
get: function () { return
|
|
86
|
+
get: function () { return chunkHOKZJLT5_js.renderToCanvas; }
|
|
87
87
|
});
|
|
88
88
|
Object.defineProperty(exports, "useViewerBuildingBlocks", {
|
|
89
89
|
enumerable: true,
|
|
90
|
-
get: function () { return
|
|
90
|
+
get: function () { return chunkHOKZJLT5_js.useViewerBuildingBlocks; }
|
|
91
91
|
});
|
|
92
92
|
Object.defineProperty(exports, "getAnimationInitialStyle", {
|
|
93
93
|
enumerable: true,
|
package/dist/index.js.br
CHANGED
|
Binary file
|
package/dist/index.js.gz
CHANGED
|
Binary file
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { PowerPointViewer, SlideCanvas, SlideTemplateGalleryDialog, SlideTemplatePreview, THEME_CATALOG, Toolbar, ViewerThemeProvider, defaultCssVars, defaultRadius, defaultThemeColors, resolveThemeCatalogEntry, themeToCssVars, useViewerTheme, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius } from './chunk-
|
|
2
|
-
export { renderToCanvas, useViewerBuildingBlocks } from './chunk-
|
|
1
|
+
export { PowerPointViewer, SlideCanvas, SlideTemplateGalleryDialog, SlideTemplatePreview, THEME_CATALOG, Toolbar, ViewerThemeProvider, defaultCssVars, defaultRadius, defaultThemeColors, resolveThemeCatalogEntry, themeToCssVars, useViewerTheme, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius } from './chunk-TYULCCA6.mjs';
|
|
2
|
+
export { renderToCanvas, useViewerBuildingBlocks } from './chunk-5XBS7MCX.mjs';
|
|
3
3
|
export { getAnimationInitialStyle } from './chunk-UC2VQORY.mjs';
|
|
4
4
|
import './chunk-Q3DHYOLK.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';
|
package/dist/index.mjs.br
CHANGED
|
Binary file
|
package/dist/index.mjs.gz
CHANGED
|
Binary file
|
package/dist/internals.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ import React$1, { Dispatch, SetStateAction, MutableRefObject, RefObject, Forward
|
|
|
13
13
|
*/
|
|
14
14
|
type SupportedShapeType = 'rect' | 'roundRect' | 'ellipse' | 'triangle' | 'rtTriangle' | 'diamond' | 'cylinder' | 'parallelogram' | 'trapezoid' | 'pentagon' | 'hexagon' | 'octagon' | 'chevron' | 'star5' | 'star6' | 'star8' | 'plus' | 'heart' | 'cloud' | 'sun' | 'moon' | 'pie' | 'plaque' | 'teardrop' | 'line' | 'rtArrow' | 'leftArrow' | 'upArrow' | 'downArrow' | 'connector' | 'freeform';
|
|
15
15
|
/** The pixel dimensions of the slide canvas (presentation slide size). */
|
|
16
|
-
interface CanvasSize {
|
|
16
|
+
interface CanvasSize$1 {
|
|
17
17
|
/** Width of the canvas in CSS pixels. */
|
|
18
18
|
width: number;
|
|
19
19
|
/** Height of the canvas in CSS pixels. */
|
|
@@ -296,7 +296,7 @@ interface ToolbarProps {
|
|
|
296
296
|
onArmFreeformTool?: (tool: FreeformToolKind | null) => void;
|
|
297
297
|
onAddTextBox: () => void;
|
|
298
298
|
onAddShape: () => void;
|
|
299
|
-
onAddTable: () => void;
|
|
299
|
+
onAddTable: (rows?: number, columns?: number) => void;
|
|
300
300
|
onAddChart?: (chartKind: InsertChartKind) => void;
|
|
301
301
|
onAddSmartArt: () => void;
|
|
302
302
|
onAddEquation: () => void;
|
|
@@ -430,6 +430,9 @@ interface ToolbarProps {
|
|
|
430
430
|
onCompare?: () => void;
|
|
431
431
|
onToggleComments?: () => void;
|
|
432
432
|
isCommentsPanelOpen?: boolean;
|
|
433
|
+
/** The phone Insert sheet (opened from the bottom bar) and how it asks to close. */
|
|
434
|
+
isMobileInsertOpen?: boolean;
|
|
435
|
+
onCloseMobileInsert?: () => void;
|
|
433
436
|
spellCheckActive?: boolean;
|
|
434
437
|
slideCommentCount?: number;
|
|
435
438
|
/** Review > Comments Previous / Next / Delete: the deck's slides and how to rewrite them. */
|
|
@@ -529,7 +532,7 @@ interface CanvasInteractionHandlers {
|
|
|
529
532
|
//#region src/viewer/hooks/useEditorHistory.d.ts
|
|
530
533
|
interface EditorHistoryInput {
|
|
531
534
|
slides: PptxSlide[];
|
|
532
|
-
canvasSize: CanvasSize;
|
|
535
|
+
canvasSize: CanvasSize$1;
|
|
533
536
|
activeSlideIndex: number;
|
|
534
537
|
templateElementsBySlideId: Record<string, PptxElement[]>;
|
|
535
538
|
selectedElementId: string | null;
|
|
@@ -558,7 +561,7 @@ interface EditorHistoryInput {
|
|
|
558
561
|
*/
|
|
559
562
|
onDirty?: () => void;
|
|
560
563
|
setSlides: (slides: PptxSlide[]) => void;
|
|
561
|
-
setCanvasSize: (size: CanvasSize) => void;
|
|
564
|
+
setCanvasSize: (size: CanvasSize$1) => void;
|
|
562
565
|
setActiveSlideIndex: (index: number) => void;
|
|
563
566
|
setTemplateElementsBySlideId: (map: Record<string, PptxElement[]>) => void;
|
|
564
567
|
setSelectedElementId: (id: string | null) => void;
|
|
@@ -667,7 +670,7 @@ declare function useElementOperations(input: UseElementOperationsInput): Element
|
|
|
667
670
|
interface UseCanvasInteractionsInput {
|
|
668
671
|
mode: ViewerMode;
|
|
669
672
|
canEdit: boolean;
|
|
670
|
-
canvasSize: CanvasSize;
|
|
673
|
+
canvasSize: CanvasSize$1;
|
|
671
674
|
activeSlideIndex: number;
|
|
672
675
|
selectedElementId: string | null;
|
|
673
676
|
selectedElementIds: string[];
|
|
@@ -919,7 +922,7 @@ interface HyperlinkEditData {
|
|
|
919
922
|
interface UseInsertElementsInput {
|
|
920
923
|
activeSlide: PptxSlide | undefined;
|
|
921
924
|
activeSlideIndex: number;
|
|
922
|
-
canvasSize: CanvasSize;
|
|
925
|
+
canvasSize: CanvasSize$1;
|
|
923
926
|
newShapeType: SupportedShapeType;
|
|
924
927
|
selectedElements: PptxElement[];
|
|
925
928
|
ops: ElementOperations;
|
|
@@ -930,7 +933,7 @@ interface InsertElementHandlers {
|
|
|
930
933
|
addElement: (element: PptxElement) => void;
|
|
931
934
|
handleAddTextBox: () => void;
|
|
932
935
|
handleAddShape: () => void;
|
|
933
|
-
handleAddTable: () => void;
|
|
936
|
+
handleAddTable: (rows?: number, columns?: number) => void;
|
|
934
937
|
handleAddChart: (chartKind: InsertChartKind) => void;
|
|
935
938
|
handleInsertSmartArt: (layout: SmartArtLayout, defaultItems: string[]) => void;
|
|
936
939
|
handleInsertEquation: (omml: Record<string, unknown>) => void;
|
|
@@ -1329,7 +1332,7 @@ interface UseViewerDialogsInput {
|
|
|
1329
1332
|
/** Zero-based index of the active slide. */
|
|
1330
1333
|
activeSlideIndex: number;
|
|
1331
1334
|
/** Slide canvas dimensions (used for guide positioning). */
|
|
1332
|
-
canvasSize: CanvasSize;
|
|
1335
|
+
canvasSize: CanvasSize$1;
|
|
1333
1336
|
/** Ref to the container element (used for viewport width detection). */
|
|
1334
1337
|
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
1335
1338
|
/** Custom shows defined in the presentation. */
|
|
@@ -1600,8 +1603,8 @@ interface ViewerCoreState extends InlineEditingState, EditPointsModeState {
|
|
|
1600
1603
|
templateElementsBySlideId: Record<string, PptxElement[]>;
|
|
1601
1604
|
setTemplateElementsBySlideId: React$1.Dispatch<React$1.SetStateAction<Record<string, PptxElement[]>>>;
|
|
1602
1605
|
/** Width and height of the slide canvas in CSS pixels. */
|
|
1603
|
-
canvasSize: CanvasSize;
|
|
1604
|
-
setCanvasSize: React$1.Dispatch<React$1.SetStateAction<CanvasSize>>;
|
|
1606
|
+
canvasSize: CanvasSize$1;
|
|
1607
|
+
setCanvasSize: React$1.Dispatch<React$1.SetStateAction<CanvasSize$1>>;
|
|
1605
1608
|
/**
|
|
1606
1609
|
* `p:sldSz` in EMU, seeded from the loaded deck and updated by Design >
|
|
1607
1610
|
* Slide Size. It is what a save persists: the pixel `canvasSize` above
|
|
@@ -1704,8 +1707,8 @@ interface ViewerCoreState extends InlineEditingState, EditPointsModeState {
|
|
|
1704
1707
|
handoutMaster: PptxHandoutMaster | undefined;
|
|
1705
1708
|
setHandoutMaster: React$1.Dispatch<React$1.SetStateAction<PptxHandoutMaster | undefined>>;
|
|
1706
1709
|
/** Canvas dimensions for the notes page view (may differ from slide canvas). */
|
|
1707
|
-
notesCanvasSize: CanvasSize | undefined;
|
|
1708
|
-
setNotesCanvasSize: React$1.Dispatch<React$1.SetStateAction<CanvasSize | undefined>>;
|
|
1710
|
+
notesCanvasSize: CanvasSize$1 | undefined;
|
|
1711
|
+
setNotesCanvasSize: React$1.Dispatch<React$1.SetStateAction<CanvasSize$1 | undefined>>;
|
|
1709
1712
|
/** User-defined custom document properties. */
|
|
1710
1713
|
customProperties: PptxCustomProperty[];
|
|
1711
1714
|
setCustomProperties: React$1.Dispatch<React$1.SetStateAction<PptxCustomProperty[]>>;
|
|
@@ -1792,6 +1795,9 @@ interface ViewerUIState {
|
|
|
1792
1795
|
setToolbarSection: React.Dispatch<React.SetStateAction<ToolbarSection>>;
|
|
1793
1796
|
isSlidesPaneOpen: boolean;
|
|
1794
1797
|
setIsSlidesPaneOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
1798
|
+
/** The phone Insert sheet (bottom bar > Insert). */
|
|
1799
|
+
isMobileInsertOpen: boolean;
|
|
1800
|
+
setIsMobileInsertOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
1795
1801
|
isInspectorPaneOpen: boolean;
|
|
1796
1802
|
setIsInspectorPaneOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
1797
1803
|
isSlideNotesCollapsed: boolean;
|
|
@@ -1921,7 +1927,7 @@ interface UseEditorOperationsInput {
|
|
|
1921
1927
|
selectedElement: PptxElement | null;
|
|
1922
1928
|
selectedElementId: string | null;
|
|
1923
1929
|
selectedElementIds: string[];
|
|
1924
|
-
canvasSize: CanvasSize;
|
|
1930
|
+
canvasSize: CanvasSize$1;
|
|
1925
1931
|
dialogs: ViewerDialogsResult;
|
|
1926
1932
|
presentation: UsePresentationModeResult;
|
|
1927
1933
|
/** Display name for comment authoring. */
|
|
@@ -2016,7 +2022,7 @@ interface SlideCanvasProps {
|
|
|
2016
2022
|
imagePaste?: CanvasImagePasteHandlers;
|
|
2017
2023
|
activeSlide: PptxSlide | undefined;
|
|
2018
2024
|
templateElements: PptxElement[];
|
|
2019
|
-
canvasSize: CanvasSize;
|
|
2025
|
+
canvasSize: CanvasSize$1;
|
|
2020
2026
|
zoom: ZoomViewport;
|
|
2021
2027
|
mode: ViewerMode;
|
|
2022
2028
|
canEdit: boolean;
|
|
@@ -2634,7 +2640,7 @@ interface SelectionBounds {
|
|
|
2634
2640
|
maxY: number;
|
|
2635
2641
|
}
|
|
2636
2642
|
interface UseZoomViewportInput extends ViewportFitOptions {
|
|
2637
|
-
canvasSize: CanvasSize;
|
|
2643
|
+
canvasSize: CanvasSize$1;
|
|
2638
2644
|
selectedElements: PptxElement[];
|
|
2639
2645
|
}
|
|
2640
2646
|
interface UseZoomViewportResult {
|
|
@@ -2646,8 +2652,8 @@ interface UseZoomViewportResult {
|
|
|
2646
2652
|
renderScaleRef: React.MutableRefObject<number>;
|
|
2647
2653
|
scale: number;
|
|
2648
2654
|
setScale: (scale: number) => void;
|
|
2649
|
-
editorDimensions: CanvasSize | null;
|
|
2650
|
-
setEditorDimensions: (dims: CanvasSize | null) => void;
|
|
2655
|
+
editorDimensions: CanvasSize$1 | null;
|
|
2656
|
+
setEditorDimensions: (dims: CanvasSize$1 | null) => void;
|
|
2651
2657
|
fitScale: number;
|
|
2652
2658
|
editorScale: number;
|
|
2653
2659
|
handleZoomIn: () => void;
|
|
@@ -2789,7 +2795,7 @@ interface UseLoadContentInput {
|
|
|
2789
2795
|
setSlides: React.Dispatch<React.SetStateAction<PptxSlide[]>>;
|
|
2790
2796
|
setTemplateElementsBySlideId: React.Dispatch<React.SetStateAction<Record<string, PptxElement[]>>>;
|
|
2791
2797
|
mediaDataUrls: Map<string, string>;
|
|
2792
|
-
setCanvasSize: React.Dispatch<React.SetStateAction<CanvasSize>>;
|
|
2798
|
+
setCanvasSize: React.Dispatch<React.SetStateAction<CanvasSize$1>>;
|
|
2793
2799
|
/** Seeds the EMU `p:sldSz` that a save persists (see `ViewerCoreState.slideSizeEmu`). */
|
|
2794
2800
|
setSlideSizeEmu: React.Dispatch<React.SetStateAction<SlideSizeEmu | undefined>>;
|
|
2795
2801
|
setHeaderFooter: React.Dispatch<React.SetStateAction<PptxHeaderFooter>>;
|
|
@@ -2819,7 +2825,7 @@ interface UseLoadContentInput {
|
|
|
2819
2825
|
setViewProperties: React.Dispatch<React.SetStateAction<PptxViewProperties | undefined>>;
|
|
2820
2826
|
setNotesMaster: React.Dispatch<React.SetStateAction<PptxNotesMaster | undefined>>;
|
|
2821
2827
|
setHandoutMaster: React.Dispatch<React.SetStateAction<PptxHandoutMaster | undefined>>;
|
|
2822
|
-
setNotesCanvasSize: React.Dispatch<React.SetStateAction<CanvasSize | undefined>>;
|
|
2828
|
+
setNotesCanvasSize: React.Dispatch<React.SetStateAction<CanvasSize$1 | undefined>>;
|
|
2823
2829
|
setCustomProperties: React.Dispatch<React.SetStateAction<PptxCustomProperty[]>>;
|
|
2824
2830
|
setTagCollections: React.Dispatch<React.SetStateAction<PptxTagCollection[]>>;
|
|
2825
2831
|
setCoreProperties: React.Dispatch<React.SetStateAction<PptxCoreProperties | undefined>>;
|
|
@@ -2877,7 +2883,7 @@ declare function useLoadContent({ content, clearSelection, history, setSlides, s
|
|
|
2877
2883
|
interface UsePointerHandlersInput {
|
|
2878
2884
|
editorScale: number;
|
|
2879
2885
|
canvasStageRef: React.RefObject<HTMLDivElement | null>;
|
|
2880
|
-
canvasSize: CanvasSize;
|
|
2886
|
+
canvasSize: CanvasSize$1;
|
|
2881
2887
|
activeSlide: PptxSlide | undefined;
|
|
2882
2888
|
activeSlideIndex: number;
|
|
2883
2889
|
gridSpacingPx: number;
|
|
@@ -2938,7 +2944,7 @@ interface UseSerializeInput {
|
|
|
2938
2944
|
editTemplateMode?: boolean;
|
|
2939
2945
|
masterViewTarget?: MasterViewTarget | null;
|
|
2940
2946
|
/** The pixel canvas the raw Slide Size W/H inputs edit. */
|
|
2941
|
-
canvasSize: CanvasSize;
|
|
2947
|
+
canvasSize: CanvasSize$1;
|
|
2942
2948
|
/**
|
|
2943
2949
|
* The EMU `p:sldSz` the viewer is holding (seeded on load, replaced by a
|
|
2944
2950
|
* preset/orientation pick). Passed with `canvasSize` to
|
|
@@ -3067,7 +3073,7 @@ interface UseExportHandlersInput {
|
|
|
3067
3073
|
/** Live theme, carried into the deck-JSON export document. */
|
|
3068
3074
|
theme: PptxTheme | undefined;
|
|
3069
3075
|
/** Slide canvas size in CSS pixels, carried into the deck-JSON export. */
|
|
3070
|
-
canvasSize: CanvasSize;
|
|
3076
|
+
canvasSize: CanvasSize$1;
|
|
3071
3077
|
/** The EMU `p:sldSz` the viewer holds, for the deck-JSON export's slide size. */
|
|
3072
3078
|
slideSizeEmu?: SlideSizeEmu | undefined;
|
|
3073
3079
|
/**
|
|
@@ -3182,7 +3188,7 @@ declare function useThemeHandlers(input: UseThemeHandlersInput): ThemeHandlersRe
|
|
|
3182
3188
|
interface UsePropertyHandlersInput {
|
|
3183
3189
|
slides: PptxSlide[];
|
|
3184
3190
|
activeSlideIndex: number;
|
|
3185
|
-
canvasSize: CanvasSize;
|
|
3191
|
+
canvasSize: CanvasSize$1;
|
|
3186
3192
|
setContent: React.Dispatch<React.SetStateAction<ArrayBuffer | Uint8Array | null>>;
|
|
3187
3193
|
setPresentationProperties: React.Dispatch<React.SetStateAction<PptxPresentationProperties>>;
|
|
3188
3194
|
setCoreProperties: React.Dispatch<React.SetStateAction<PptxCoreProperties | null>>;
|
|
@@ -3410,7 +3416,7 @@ interface UseIOHandlersInput {
|
|
|
3410
3416
|
state: ViewerState;
|
|
3411
3417
|
slides: PptxSlide[];
|
|
3412
3418
|
activeSlideIndex: number;
|
|
3413
|
-
canvasSize: CanvasSize;
|
|
3419
|
+
canvasSize: CanvasSize$1;
|
|
3414
3420
|
filePath: string | undefined;
|
|
3415
3421
|
history: EditorHistoryResult;
|
|
3416
3422
|
ops: ElementOperations;
|
|
@@ -3645,6 +3651,8 @@ interface ViewerIntegrationResult {
|
|
|
3645
3651
|
recovery: UseRecoveryDetectionResult;
|
|
3646
3652
|
isEncryptedDialogOpen: boolean;
|
|
3647
3653
|
setIsEncryptedDialogOpen: Dispatch<SetStateAction<boolean>>;
|
|
3654
|
+
/** Stable `PowerPointViewerAPI` view of the live handle (region `context.viewer`). */
|
|
3655
|
+
viewerApi: PowerPointViewerAPI;
|
|
3648
3656
|
/** The loaded core handler, exposed for the AI bridge (`getHandler`). */
|
|
3649
3657
|
handlerRef: RefObject<PptxHandler | null>;
|
|
3650
3658
|
/**
|
|
@@ -3971,7 +3979,7 @@ interface UseExportSaveAsInput {
|
|
|
3971
3979
|
/** Live theme, carried into the deck-JSON export document. */
|
|
3972
3980
|
theme: PptxTheme | undefined;
|
|
3973
3981
|
/** Slide canvas size in CSS pixels, carried into the deck-JSON export. */
|
|
3974
|
-
canvasSize: CanvasSize;
|
|
3982
|
+
canvasSize: CanvasSize$1;
|
|
3975
3983
|
/** The EMU `p:sldSz` the viewer holds; see `UseExportHandlersInput`. */
|
|
3976
3984
|
slideSizeEmu?: SlideSizeEmu | undefined;
|
|
3977
3985
|
}
|
|
@@ -4426,7 +4434,7 @@ interface PresentationTransitionOverlayProps {
|
|
|
4426
4434
|
/** Template/master elements that belong to the outgoing slide. */
|
|
4427
4435
|
templateElements: PptxElement[];
|
|
4428
4436
|
/** Canvas dimensions (slide width × height in EMU-derived px). */
|
|
4429
|
-
canvasSize: CanvasSize;
|
|
4437
|
+
canvasSize: CanvasSize$1;
|
|
4430
4438
|
/** Transition definition from the incoming slide. */
|
|
4431
4439
|
transition: PptxSlideTransition;
|
|
4432
4440
|
/** Resolved transition duration in ms. */
|
|
@@ -4467,7 +4475,7 @@ declare function PresentationTransitionOverlay({ outgoingSlide, templateElements
|
|
|
4467
4475
|
//#endregion
|
|
4468
4476
|
//#region src/viewer/components/MorphTransitionOverlay.d.ts
|
|
4469
4477
|
interface MorphTransitionOverlayProps {
|
|
4470
|
-
canvasSize: CanvasSize;
|
|
4478
|
+
canvasSize: CanvasSize$1;
|
|
4471
4479
|
scale: number;
|
|
4472
4480
|
morphPlan: MorphTransitionPlan;
|
|
4473
4481
|
outgoingSlide: PptxSlide;
|
|
@@ -4491,7 +4499,7 @@ declare function MorphTransitionOverlay({ canvasSize, scale, morphPlan, outgoing
|
|
|
4491
4499
|
interface SlideLayerProps {
|
|
4492
4500
|
slide: PptxSlide;
|
|
4493
4501
|
templateElements: PptxElement[];
|
|
4494
|
-
canvasSize: CanvasSize;
|
|
4502
|
+
canvasSize: CanvasSize$1;
|
|
4495
4503
|
}
|
|
4496
4504
|
declare function SlideLayer({ slide, templateElements, canvasSize }: SlideLayerProps): React$1.ReactElement;
|
|
4497
4505
|
//#endregion
|
|
@@ -4500,7 +4508,7 @@ interface FragmentedTransitionLayerProps {
|
|
|
4500
4508
|
layer: FragmentedLayer;
|
|
4501
4509
|
slide: PptxSlide;
|
|
4502
4510
|
templateElements: PptxElement[];
|
|
4503
|
-
canvasSize: CanvasSize;
|
|
4511
|
+
canvasSize: CanvasSize$1;
|
|
4504
4512
|
scale: number;
|
|
4505
4513
|
zIndex: number;
|
|
4506
4514
|
layerName: 'outgoing' | 'incoming';
|