pptx-react-viewer 4.51.1 → 4.52.1
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/{AiChatPanel-EV22O7UO.js → AiChatPanel-7GJQ66GR.js} +19 -19
- package/dist/AiChatPanel-7GJQ66GR.js.br +0 -0
- package/dist/AiChatPanel-7GJQ66GR.js.gz +0 -0
- package/dist/{AiChatPanel-R323KNGN.mjs → AiChatPanel-AI75AT6C.mjs} +1 -1
- package/dist/AiChatPanel-AI75AT6C.mjs.br +0 -0
- package/dist/AiChatPanel-AI75AT6C.mjs.gz +0 -0
- package/dist/{chunk-YJ4DAS4V.js → chunk-2AM5YYWI.js} +586 -615
- package/dist/chunk-2AM5YYWI.js.br +0 -0
- package/dist/chunk-2AM5YYWI.js.gz +0 -0
- package/dist/{chunk-Z22RD3E2.js → chunk-3TN5SUQR.js} +4 -1
- package/dist/chunk-3TN5SUQR.js.br +0 -0
- package/dist/chunk-3TN5SUQR.js.gz +0 -0
- package/dist/{chunk-V4DY4IWP.mjs → chunk-6436YER5.mjs} +390 -420
- package/dist/chunk-6436YER5.mjs.br +0 -0
- package/dist/chunk-6436YER5.mjs.gz +0 -0
- package/dist/{chunk-ZCGYPCZM.mjs → chunk-ID37Y3HG.mjs} +4 -1
- package/dist/chunk-ID37Y3HG.mjs.br +0 -0
- package/dist/chunk-ID37Y3HG.mjs.gz +0 -0
- package/dist/{chunk-VRX5NJY2.js → chunk-JUH4YPMU.js} +1702 -1616
- package/dist/chunk-JUH4YPMU.js.br +0 -0
- package/dist/chunk-JUH4YPMU.js.gz +0 -0
- package/dist/{chunk-KCUXY7DE.mjs → chunk-L77POU5D.mjs} +216 -130
- package/dist/chunk-L77POU5D.mjs.br +0 -0
- package/dist/chunk-L77POU5D.mjs.gz +0 -0
- package/dist/i18n/de.cjs +1 -24
- package/dist/i18n/de.cjs.br +0 -0
- package/dist/i18n/de.cjs.gz +0 -0
- package/dist/i18n/de.mjs +1 -24
- package/dist/i18n/de.mjs.br +0 -0
- package/dist/i18n/de.mjs.gz +0 -0
- package/dist/i18n/es.cjs +1 -24
- package/dist/i18n/es.cjs.br +0 -0
- package/dist/i18n/es.cjs.gz +0 -0
- package/dist/i18n/es.mjs +1 -24
- package/dist/i18n/es.mjs.br +0 -0
- package/dist/i18n/es.mjs.gz +0 -0
- package/dist/i18n/fr.cjs +1 -24
- package/dist/i18n/fr.cjs.br +0 -0
- package/dist/i18n/fr.cjs.gz +0 -0
- package/dist/i18n/fr.mjs +1 -24
- package/dist/i18n/fr.mjs.br +0 -0
- package/dist/i18n/fr.mjs.gz +0 -0
- package/dist/i18n/zh-CN.cjs +0 -23
- package/dist/i18n/zh-CN.cjs.br +0 -0
- package/dist/i18n/zh-CN.cjs.gz +0 -0
- package/dist/i18n/zh-CN.mjs +0 -23
- package/dist/i18n/zh-CN.mjs.br +0 -0
- package/dist/i18n/zh-CN.mjs.gz +0 -0
- package/dist/index.d.ts +14 -2
- package/dist/index.js +25 -25
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +85 -23
- package/dist/internals.js +81 -81
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +2 -2
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.d.ts +13 -1
- package/dist/viewer/index.js +20 -20
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +3 -3
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +3 -3
- package/dist/AiChatPanel-EV22O7UO.js.br +0 -0
- package/dist/AiChatPanel-EV22O7UO.js.gz +0 -0
- package/dist/AiChatPanel-R323KNGN.mjs.br +0 -0
- package/dist/AiChatPanel-R323KNGN.mjs.gz +0 -0
- package/dist/chunk-KCUXY7DE.mjs.br +0 -0
- package/dist/chunk-KCUXY7DE.mjs.gz +0 -0
- package/dist/chunk-V4DY4IWP.mjs.br +0 -0
- package/dist/chunk-V4DY4IWP.mjs.gz +0 -0
- package/dist/chunk-VRX5NJY2.js.br +0 -0
- package/dist/chunk-VRX5NJY2.js.gz +0 -0
- package/dist/chunk-YJ4DAS4V.js.br +0 -0
- package/dist/chunk-YJ4DAS4V.js.gz +0 -0
- package/dist/chunk-Z22RD3E2.js.br +0 -0
- package/dist/chunk-Z22RD3E2.js.gz +0 -0
- package/dist/chunk-ZCGYPCZM.mjs.br +0 -0
- package/dist/chunk-ZCGYPCZM.mjs.gz +0 -0
package/dist/internals.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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';
|
|
1
|
+
import { CollaborationRole, CollaborationConfig, HistoryTheme, 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, GoogleFontsOption, 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
|
-
import { PptxSlide, PptxElement, PptxElementAnimation, TextStyle, PptxHeaderFooter, ShapeStyle, PptxCommentMention, SmartArtLayout, InkPptxElement, ShapePptxElement, MergeShapeOperation, PptxSlideTransition, PptxAction,
|
|
3
|
+
import { PptxSlide, PptxElement, PptxElementAnimation, TextStyle, PptxHeaderFooter, PptxTheme, PptxSlideMaster, ShapeStyle, PptxCommentMention, SmartArtLayout, InkPptxElement, ShapePptxElement, MergeShapeOperation, PptxSlideTransition, PptxAction, PptxModernCommentAuthor, 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';
|
|
@@ -91,6 +91,8 @@ interface EditorHistorySnapshot {
|
|
|
91
91
|
activeSlideIndex: number;
|
|
92
92
|
slides: PptxSlide[];
|
|
93
93
|
templateElementsBySlideId: Record<string, PptxElement[]>;
|
|
94
|
+
/** The theme at that point, so undoing a theme pick puts the theme back with the slides. */
|
|
95
|
+
theme?: HistoryTheme;
|
|
94
96
|
actionLabel?: string;
|
|
95
97
|
}
|
|
96
98
|
//#endregion
|
|
@@ -639,6 +641,22 @@ interface EditorHistoryInput {
|
|
|
639
641
|
* Slide or a notes edit left the flag false and crash recovery never ran.
|
|
640
642
|
*/
|
|
641
643
|
onDirty?: () => void;
|
|
644
|
+
/**
|
|
645
|
+
* The deck's theme. Its colour scheme, font scheme and name are recorded with every snapshot,
|
|
646
|
+
* so a theme pick is an undo step like any other edit.
|
|
647
|
+
*/
|
|
648
|
+
theme?: PptxTheme | undefined;
|
|
649
|
+
/**
|
|
650
|
+
* The slide masters. The theme part each one uses is recorded with the theme, so a theme
|
|
651
|
+
* applied by path is an undo step too, and its Undo points the masters back.
|
|
652
|
+
*/
|
|
653
|
+
slideMasters?: readonly PptxSlideMaster[] | undefined;
|
|
654
|
+
/**
|
|
655
|
+
* Put a recorded theme back (an undo or redo crossing a theme change). The slides come back
|
|
656
|
+
* with the snapshot; the theme has to be written to the handler's theme part too, which this
|
|
657
|
+
* hook cannot reach, so the theme handlers do it.
|
|
658
|
+
*/
|
|
659
|
+
onRestoreTheme?: (theme: HistoryTheme) => void;
|
|
642
660
|
setSlides: (slides: PptxSlide[]) => void;
|
|
643
661
|
setCanvasSize: (size: CanvasSize$1) => void;
|
|
644
662
|
setActiveSlideIndex: (index: number) => void;
|
|
@@ -649,7 +667,12 @@ interface EditorHistoryInput {
|
|
|
649
667
|
setHeaderFooter: (hf: PptxHeaderFooter) => void;
|
|
650
668
|
}
|
|
651
669
|
interface EditorHistoryResult {
|
|
652
|
-
|
|
670
|
+
/**
|
|
671
|
+
* Commit `slides` as one undo step. Pass `nextSlideMasters` when the same commit replaces the
|
|
672
|
+
* slide masters (a slide paste brings its own): the step's after state records their theme
|
|
673
|
+
* parts, so the masters arriving a render later are not read as a second step.
|
|
674
|
+
*/
|
|
675
|
+
commitSlides: (slides: PptxSlide[], label?: string, beforeSlides?: PptxSlide[], nextSlideMasters?: readonly PptxSlideMaster[]) => void;
|
|
653
676
|
canUndo: boolean;
|
|
654
677
|
canRedo: boolean;
|
|
655
678
|
undoLabel: string | undefined;
|
|
@@ -657,6 +680,11 @@ interface EditorHistoryResult {
|
|
|
657
680
|
handleUndo: () => void;
|
|
658
681
|
handleRedo: () => void;
|
|
659
682
|
resetHistory: () => void;
|
|
683
|
+
/**
|
|
684
|
+
* Drop the undo and redo steps that would bring back a state `reaches` matches, with the steps
|
|
685
|
+
* behind them: a Slide Master view command removed a layout the package cannot get back.
|
|
686
|
+
*/
|
|
687
|
+
forgetHistory: (reaches: (snapshot: EditorHistorySnapshot) => boolean) => void;
|
|
660
688
|
/**
|
|
661
689
|
* Pause (`true`) and resume (`false`) change tracking. A gallery hover preview swaps the
|
|
662
690
|
* slides in for a moment; while tracking is held that is neither an undo step nor an edit, and
|
|
@@ -664,6 +692,15 @@ interface EditorHistoryResult {
|
|
|
664
692
|
*/
|
|
665
693
|
holdTracking: (held: boolean) => void;
|
|
666
694
|
markDirty: () => void;
|
|
695
|
+
/**
|
|
696
|
+
* Run `apply` without arming the undo tracker: the edits it makes show at
|
|
697
|
+
* once but are no undo step and leave the dirty flag alone, and the next
|
|
698
|
+
* committed edit records the state from before them. A colour picker drag
|
|
699
|
+
* applies its shades this way (shared `createLiveColorInput`), so the drag
|
|
700
|
+
* is one undo step when it settles. Synchronous: only edits made inside
|
|
701
|
+
* `apply` are exempt.
|
|
702
|
+
*/
|
|
703
|
+
withoutUndoStep: (apply: () => void) => void;
|
|
667
704
|
buildHistorySnapshot: (actionLabel?: string) => EditorHistorySnapshot;
|
|
668
705
|
}
|
|
669
706
|
declare function useEditorHistory(input: EditorHistoryInput): EditorHistoryResult;
|
|
@@ -957,8 +994,11 @@ declare function useElementManipulation(input: UseElementManipulationInput): Ele
|
|
|
957
994
|
interface UseFindReplaceInput {
|
|
958
995
|
slides: PptxSlide[];
|
|
959
996
|
mode: string;
|
|
960
|
-
|
|
961
|
-
|
|
997
|
+
/**
|
|
998
|
+
* Go to a match's slide and select its element there (null for a speaker-notes match), in one
|
|
999
|
+
* step: the viewer's `showSlideSelection`, which keeps the selection across the slide change.
|
|
1000
|
+
*/
|
|
1001
|
+
onShowMatch: (slideIndex: number, elementId: string | null) => void;
|
|
962
1002
|
onUpdateSlides: (updater: (slides: PptxSlide[]) => PptxSlide[]) => void;
|
|
963
1003
|
onMarkDirty: () => void;
|
|
964
1004
|
/** Host keyboard customisation (disabled / remapped Find shortcuts). */
|
|
@@ -979,14 +1019,14 @@ interface UseFindReplaceResult {
|
|
|
979
1019
|
setFindIncludeChartData: (value: boolean) => void;
|
|
980
1020
|
setFindIncludeNotes: (value: boolean) => void;
|
|
981
1021
|
setFindMatchCase: (matchCase: boolean) => void;
|
|
982
|
-
findResults: FindResult[];
|
|
1022
|
+
findResults: readonly FindResult[];
|
|
983
1023
|
findResultIndex: number;
|
|
984
1024
|
performFind: () => void;
|
|
985
1025
|
navigateFindResult: (direction: 1 | -1) => void;
|
|
986
1026
|
handleReplace: () => void;
|
|
987
1027
|
handleReplaceAll: () => void;
|
|
988
1028
|
}
|
|
989
|
-
declare function useFindReplace({ slides, mode,
|
|
1029
|
+
declare function useFindReplace({ slides, mode, onShowMatch, onUpdateSlides, onMarkDirty, keyboard }: UseFindReplaceInput): UseFindReplaceResult;
|
|
990
1030
|
//#endregion
|
|
991
1031
|
//#region src/viewer/components/hyperlink-edit-types.d.ts
|
|
992
1032
|
/** The type of hyperlink target. */
|
|
@@ -1617,6 +1657,14 @@ interface EditPointsModeState {
|
|
|
1617
1657
|
setActiveFreeformTool: (tool: FreeformToolKind | null) => void;
|
|
1618
1658
|
}
|
|
1619
1659
|
//#endregion
|
|
1660
|
+
//#region src/viewer/hooks/useSlideChangeSelection.d.ts
|
|
1661
|
+
interface SlideChangeSelection {
|
|
1662
|
+
/** The slide the last {@link showSlideSelection} selected on, until the next slide change. */
|
|
1663
|
+
slideSelectionRef: MutableRefObject<number | null>;
|
|
1664
|
+
/** Go to `slideIndex` and select `elementId` there (nothing, for null), across the slide change. */
|
|
1665
|
+
showSlideSelection: (slideIndex: number, elementId: string | null) => void;
|
|
1666
|
+
}
|
|
1667
|
+
//#endregion
|
|
1620
1668
|
//#region src/viewer/hooks/viewer-core-state-types.d.ts
|
|
1621
1669
|
/**
|
|
1622
1670
|
* Input parameters for the {@link useViewerCoreState} hook.
|
|
@@ -1635,7 +1683,7 @@ interface UseViewerCoreStateInput {
|
|
|
1635
1683
|
* that comprises the core viewer state. It is merged with {@link ViewerUIState}
|
|
1636
1684
|
* inside {@link useViewerState} to produce the unified {@link ViewerState}.
|
|
1637
1685
|
*/
|
|
1638
|
-
interface ViewerCoreState extends InlineEditingState, EditPointsModeState {
|
|
1686
|
+
interface ViewerCoreState extends InlineEditingState, EditPointsModeState, SlideChangeSelection {
|
|
1639
1687
|
/** Ref to the outermost container `<div>` wrapping the viewer. */
|
|
1640
1688
|
containerRef: React$1.RefObject<HTMLDivElement | null>;
|
|
1641
1689
|
/** Hidden `<input type="file">` used to trigger image file selection. */
|
|
@@ -2192,7 +2240,7 @@ interface SlideCanvasProps {
|
|
|
2192
2240
|
/** Called when a table row is resized. */
|
|
2193
2241
|
onResizeTableRow?: (elementId: string, rowIndex: number, newHeight: number) => void;
|
|
2194
2242
|
/** Find & Replace results (all matches across all slides). */
|
|
2195
|
-
findResults?:
|
|
2243
|
+
findResults?: ReadonlyArray<{
|
|
2196
2244
|
slideIndex: number;
|
|
2197
2245
|
elementId: string;
|
|
2198
2246
|
segmentIndex: number;
|
|
@@ -2332,6 +2380,8 @@ interface UseViewerBuildingBlocksInput extends ViewportFitOptions {
|
|
|
2332
2380
|
* the handle's `goTo` to move an open deck.
|
|
2333
2381
|
*/
|
|
2334
2382
|
initialSlide?: number;
|
|
2383
|
+
/** As `PowerPointViewer`'s `googleFonts`: the Google Fonts fallback policy (off, or a self-hosted mirror). */
|
|
2384
|
+
googleFonts?: GoogleFontsOption;
|
|
2335
2385
|
/** Whether the built-in autosave-to-localStorage recovery timer is active. Defaults to true. */
|
|
2336
2386
|
autosaveEnabled?: boolean;
|
|
2337
2387
|
/** Display name used as the author for comments. */
|
|
@@ -3182,11 +3232,21 @@ declare function useExportHandlers(input: UseExportHandlersInput): ExportHandler
|
|
|
3182
3232
|
//#endregion
|
|
3183
3233
|
//#region src/viewer/hooks/usePrintHandlers.d.ts
|
|
3184
3234
|
interface UsePrintHandlersInput {
|
|
3235
|
+
/** The editable slides (template elements partitioned out, as the viewer state holds them). */
|
|
3185
3236
|
slides: PptxSlide[];
|
|
3186
3237
|
activeSlideIndex: number;
|
|
3187
3238
|
canvasStageRef: RefObject<HTMLDivElement | null>;
|
|
3188
3239
|
setActiveSlideIndex: React.Dispatch<React.SetStateAction<number>>;
|
|
3189
|
-
/**
|
|
3240
|
+
/** Slide size in CSS pixels: the vector slides are exported at it. */
|
|
3241
|
+
canvasSize: CanvasSize$1;
|
|
3242
|
+
/**
|
|
3243
|
+
* The layout and master elements partitioned out of each slide, merged back
|
|
3244
|
+
* for the vector export and the outline (`buildSaveSlides`).
|
|
3245
|
+
*/
|
|
3246
|
+
templateElementsBySlideId?: Record<string, PptxElement[]>;
|
|
3247
|
+
/** The deck's handout master, painted on every handouts page. */
|
|
3248
|
+
handoutMaster?: PptxHandoutMaster;
|
|
3249
|
+
/** @deprecated Pass `canvasSize` and `handoutMaster`; only its `handoutMaster` is still read. */
|
|
3190
3250
|
pptxData?: PptxData;
|
|
3191
3251
|
}
|
|
3192
3252
|
interface PrintHandlersResult {
|
|
@@ -3201,13 +3261,14 @@ declare function usePrintHandlers(input: UsePrintHandlersInput): PrintHandlersRe
|
|
|
3201
3261
|
//#region src/viewer/hooks/useThemeHandlers.d.ts
|
|
3202
3262
|
interface UseThemeHandlersInput {
|
|
3203
3263
|
handlerRef: RefObject<PptxHandler | null>;
|
|
3204
|
-
serializeSlides: () => Promise<Uint8Array | null>;
|
|
3205
|
-
setContent: React.Dispatch<React.SetStateAction<ArrayBuffer | Uint8Array | null>>;
|
|
3206
|
-
onContentChange: ((data: Uint8Array) => void) | undefined;
|
|
3207
3264
|
setTheme: React.Dispatch<React.SetStateAction<Record<string, unknown> | null>>;
|
|
3208
3265
|
setSlideMasters: React.Dispatch<React.SetStateAction<Array<Record<string, unknown>>>>;
|
|
3209
3266
|
slideMasters: Array<Record<string, unknown>>;
|
|
3267
|
+
/** The deck's theme parts as loaded; an undo back to the loaded theme restores its name. */
|
|
3268
|
+
themeOptions?: PptxThemeOption[];
|
|
3210
3269
|
history: EditorHistoryResult;
|
|
3270
|
+
/** The live slides, which a theme applied by path re-themes in place. */
|
|
3271
|
+
slides: PptxSlide[];
|
|
3211
3272
|
/** Current live slides, re-coloured in place on a scheme-colour change. */
|
|
3212
3273
|
setSlides: React.Dispatch<React.SetStateAction<PptxSlide[]>>;
|
|
3213
3274
|
/**
|
|
@@ -3234,13 +3295,15 @@ interface ThemeHandlersResult {
|
|
|
3234
3295
|
handleUpdateThemeName: (name: string) => Promise<void>;
|
|
3235
3296
|
handleApplyThemeToPresentation: () => Promise<void>;
|
|
3236
3297
|
handleApplyThemeData: (colorScheme: PptxThemeColorScheme, fontScheme: PptxThemeFontScheme, themeName?: string) => Promise<void>;
|
|
3298
|
+
/** Undo or redo crossed a theme change: put that theme back (see `useEditorHistory`). */
|
|
3299
|
+
handleRestoreHistoryTheme: (theme: HistoryTheme) => Promise<void>;
|
|
3237
3300
|
handleSetTemplateBackground: (path: string, backgroundColor: string | undefined) => void;
|
|
3238
3301
|
handleGetTemplateBackgroundColor: (path: string) => string | undefined;
|
|
3239
3302
|
/** Return theme parts discovered in the loaded PPTX archive. */
|
|
3240
3303
|
handleGetAvailableThemes: () => Promise<PptxThemeOption[]>;
|
|
3241
3304
|
/**
|
|
3242
|
-
* Switch
|
|
3243
|
-
*
|
|
3305
|
+
* Switch every slide master to an existing theme part by its archive path, in place, as one
|
|
3306
|
+
* undo step.
|
|
3244
3307
|
*/
|
|
3245
3308
|
handleSwitchTheme: (themePath: string) => Promise<void>;
|
|
3246
3309
|
}
|
|
@@ -3503,14 +3566,7 @@ interface UseIOHandlersInput {
|
|
|
3503
3566
|
* output format, so the downloaded file carries every save option Save does.
|
|
3504
3567
|
*/
|
|
3505
3568
|
serializeSlides: SerializeSlides;
|
|
3506
|
-
/**
|
|
3507
|
-
* Plaintext serialisation for bytes the viewer feeds straight back into its
|
|
3508
|
-
* own loader. "Apply theme" does exactly that, and the loader has no password
|
|
3509
|
-
* to offer, so it must never receive an encrypted package.
|
|
3510
|
-
*/
|
|
3511
|
-
serializeForRecovery: () => Promise<Uint8Array | null>;
|
|
3512
3569
|
setContent: React$1.Dispatch<React$1.SetStateAction<ArrayBuffer | Uint8Array | null>>;
|
|
3513
|
-
onContentChange: ((content: Uint8Array) => void) | undefined;
|
|
3514
3570
|
/** The host's `onPropertiesChange` (document-properties edits). */
|
|
3515
3571
|
onPropertiesChange?: ((updates: Partial<PptxCoreProperties>) => void) | undefined;
|
|
3516
3572
|
/** The host's `onNotesUpdate` (speaker-notes edits). */
|
|
@@ -3571,6 +3627,8 @@ interface UseContentLifecycleInput {
|
|
|
3571
3627
|
allowExternalImages?: boolean;
|
|
3572
3628
|
/** Forwarded to {@link useLoadContent}: the host `initialSlide` prop. */
|
|
3573
3629
|
initialSlide?: number;
|
|
3630
|
+
/** Forwarded to {@link useFontInjection}: the host `googleFonts` prop. */
|
|
3631
|
+
googleFonts?: GoogleFontsOption;
|
|
3574
3632
|
/** Forwarded to {@link useLoadContent}: see `useReadOnlyRecommendationState`. */
|
|
3575
3633
|
setReadOnlyRecommendation: React$1.Dispatch<React$1.SetStateAction<ReadOnlyRecommendation>>;
|
|
3576
3634
|
/** Forwarded to {@link useLoadContent}: see `useReadOnlyRecommendationState`. */
|
|
@@ -3673,6 +3731,8 @@ interface UseViewerIntegrationInput {
|
|
|
3673
3731
|
allowExternalImages?: boolean;
|
|
3674
3732
|
/** Host `initialSlide` prop: the slide shown after each load; forwarded to `useContentLifecycle`. */
|
|
3675
3733
|
initialSlide?: number;
|
|
3734
|
+
/** Host `googleFonts` prop: the Google Fonts fallback policy; forwarded to `useFontInjection`. */
|
|
3735
|
+
googleFonts?: GoogleFontsOption;
|
|
3676
3736
|
/** Forwarded to `useContentLifecycle` -> `useLoadContent`: see `useReadOnlyRecommendationState`. */
|
|
3677
3737
|
setReadOnlyRecommendation: Dispatch<SetStateAction<ReadOnlyRecommendation>>;
|
|
3678
3738
|
/** Forwarded to `useContentLifecycle` -> `useLoadContent`: see `useReadOnlyRecommendationState`. */
|
|
@@ -4102,8 +4162,10 @@ declare function useExportSaveAs(input: UseExportSaveAsInput): ExportSaveAsResul
|
|
|
4102
4162
|
interface UseFontInjectionInput {
|
|
4103
4163
|
embeddedFonts: PptxEmbeddedFont[];
|
|
4104
4164
|
slides: PptxSlide[];
|
|
4165
|
+
/** Host `googleFonts` policy: unset loads from Google, `false` disables, `{ baseUrl }` mirrors. */
|
|
4166
|
+
googleFonts?: GoogleFontsOption;
|
|
4105
4167
|
}
|
|
4106
|
-
declare function useFontInjection({ embeddedFonts, slides }: UseFontInjectionInput): void;
|
|
4168
|
+
declare function useFontInjection({ embeddedFonts, slides, googleFonts }: UseFontInjectionInput): void;
|
|
4107
4169
|
//#endregion
|
|
4108
4170
|
//#region src/viewer/hooks/useGroupAlignLayerHandlers.d.ts
|
|
4109
4171
|
interface GroupAlignLayerInput {
|