pptx-react-viewer 1.23.0 → 1.24.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 +6 -0
- package/README.md +27 -0
- package/dist/{Model3DScene-4XNBDASE.mjs → Model3DScene-QTNGCODM.mjs} +2 -2
- package/dist/Model3DScene-QTNGCODM.mjs.br +0 -0
- package/dist/Model3DScene-QTNGCODM.mjs.gz +0 -0
- package/dist/{Model3DScene-AQS7KDM4.js → Model3DScene-RD4XEC3F.js} +3 -3
- package/dist/Model3DScene-RD4XEC3F.js.br +0 -0
- package/dist/Model3DScene-RD4XEC3F.js.gz +0 -0
- package/dist/{PowerPointViewer-DFTatVS4.d.ts → PowerPointViewer-CnADroqZ.d.ts} +2 -2
- package/dist/{PowerPointViewer-DFTatVS4.d.ts.map → PowerPointViewer-CnADroqZ.d.ts.map} +1 -1
- package/dist/{SurfaceChart3DScene-K7ZDXDBL.mjs → SurfaceChart3DScene-VKS3ELTU.mjs} +2 -2
- package/dist/SurfaceChart3DScene-VKS3ELTU.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-VKS3ELTU.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-HA2SD6BY.js → SurfaceChart3DScene-YR3GX4X6.js} +3 -3
- package/dist/SurfaceChart3DScene-YR3GX4X6.js.br +0 -0
- package/dist/SurfaceChart3DScene-YR3GX4X6.js.gz +0 -0
- package/dist/{types-Da1M5VBY.d.ts → animation-timeline-CEJJLFqK.d.ts} +3 -3
- package/dist/animation-timeline-CEJJLFqK.d.ts.map +1 -0
- package/dist/{chunk-LS2AIX2H.js → chunk-3YMK5VLS.js} +26707 -26744
- package/dist/chunk-3YMK5VLS.js.br +0 -0
- package/dist/chunk-3YMK5VLS.js.gz +0 -0
- package/dist/{chunk-H5RREYCO.js → chunk-GKST4OS7.js} +1270 -454
- package/dist/chunk-GKST4OS7.js.br +0 -0
- package/dist/chunk-GKST4OS7.js.gz +0 -0
- package/dist/{chunk-2DXNTVFV.js → chunk-I5SO5OV4.js} +69 -71
- package/dist/chunk-I5SO5OV4.js.br +0 -0
- package/dist/chunk-I5SO5OV4.js.gz +0 -0
- package/dist/{chunk-I42XL2WU.mjs → chunk-KPT54MHG.mjs} +40 -42
- package/dist/chunk-KPT54MHG.mjs.br +0 -0
- package/dist/chunk-KPT54MHG.mjs.gz +0 -0
- package/dist/{chunk-MS6S6YYR.js → chunk-KV3EOLP3.js} +50785 -50553
- package/dist/chunk-KV3EOLP3.js.br +0 -0
- package/dist/chunk-KV3EOLP3.js.gz +0 -0
- package/dist/{chunk-AFWMAFWR.mjs → chunk-LDZQNYWL.mjs} +50784 -50554
- package/dist/chunk-LDZQNYWL.mjs.br +0 -0
- package/dist/chunk-LDZQNYWL.mjs.gz +0 -0
- package/dist/{chunk-36NC56XG.mjs → chunk-PUQ6GIOM.mjs} +26099 -26138
- package/dist/chunk-PUQ6GIOM.mjs.br +0 -0
- package/dist/chunk-PUQ6GIOM.mjs.gz +0 -0
- package/dist/{chunk-LFEVG3ED.mjs → chunk-YJVMOX2Y.mjs} +819 -5
- package/dist/chunk-YJVMOX2Y.mjs.br +0 -0
- package/dist/chunk-YJVMOX2Y.mjs.gz +0 -0
- package/dist/{dist-5KQQ6GP2.mjs → dist-A3OATMOE.mjs} +1 -1
- package/dist/dist-A3OATMOE.mjs.br +0 -0
- package/dist/dist-A3OATMOE.mjs.gz +0 -0
- package/dist/{dist-CVSSAFDL.js → dist-XF3QJAEF.js} +568 -560
- package/dist/dist-XF3QJAEF.js.br +0 -0
- package/dist/dist-XF3QJAEF.js.gz +0 -0
- package/dist/hooks-unstable.d.ts +407 -37
- package/dist/hooks-unstable.d.ts.map +1 -1
- package/dist/hooks-unstable.js +80 -76
- package/dist/hooks-unstable.js.br +0 -0
- package/dist/hooks-unstable.js.gz +0 -0
- package/dist/hooks-unstable.mjs +3 -3
- package/dist/hooks-unstable.mjs.br +0 -0
- package/dist/hooks-unstable.mjs.gz +0 -0
- package/dist/{index-COgh2UTL.d.ts → index-hm2FF-FU.d.ts} +3 -3
- package/dist/{index-COgh2UTL.d.ts.map → index-hm2FF-FU.d.ts.map} +1 -1
- package/dist/index.d.ts +865 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -30
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/useViewerBuildingBlocks-ll3_ncCH.d.ts +378 -0
- package/dist/useViewerBuildingBlocks-ll3_ncCH.d.ts.map +1 -0
- 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 +4 -4
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/Model3DScene-4XNBDASE.mjs.br +0 -0
- package/dist/Model3DScene-4XNBDASE.mjs.gz +0 -0
- package/dist/Model3DScene-AQS7KDM4.js.br +0 -0
- package/dist/Model3DScene-AQS7KDM4.js.gz +0 -0
- package/dist/SurfaceChart3DScene-HA2SD6BY.js.br +0 -0
- package/dist/SurfaceChart3DScene-HA2SD6BY.js.gz +0 -0
- package/dist/SurfaceChart3DScene-K7ZDXDBL.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-K7ZDXDBL.mjs.gz +0 -0
- package/dist/chunk-2DXNTVFV.js.br +0 -0
- package/dist/chunk-2DXNTVFV.js.gz +0 -0
- package/dist/chunk-36NC56XG.mjs.br +0 -0
- package/dist/chunk-36NC56XG.mjs.gz +0 -0
- package/dist/chunk-AFWMAFWR.mjs.br +0 -0
- package/dist/chunk-AFWMAFWR.mjs.gz +0 -0
- package/dist/chunk-H5RREYCO.js.br +0 -0
- package/dist/chunk-H5RREYCO.js.gz +0 -0
- package/dist/chunk-I42XL2WU.mjs.br +0 -0
- package/dist/chunk-I42XL2WU.mjs.gz +0 -0
- package/dist/chunk-LFEVG3ED.mjs.br +0 -0
- package/dist/chunk-LFEVG3ED.mjs.gz +0 -0
- package/dist/chunk-LS2AIX2H.js.br +0 -0
- package/dist/chunk-LS2AIX2H.js.gz +0 -0
- package/dist/chunk-MS6S6YYR.js.br +0 -0
- package/dist/chunk-MS6S6YYR.js.gz +0 -0
- package/dist/dist-5KQQ6GP2.mjs.br +0 -0
- package/dist/dist-5KQQ6GP2.mjs.gz +0 -0
- package/dist/dist-CVSSAFDL.js.br +0 -0
- package/dist/dist-CVSSAFDL.js.gz +0 -0
- package/dist/types-Da1M5VBY.d.ts.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import React$1__default from 'react';
|
|
3
3
|
import { Options } from 'html2canvas-pro';
|
|
4
4
|
|
|
5
5
|
//#region src/core/types/actions.d.ts
|
|
@@ -3709,6 +3709,126 @@ interface PptxTableData {
|
|
|
3709
3709
|
/** Right-to-left table layout from `a:tblPr/@rtl`. */
|
|
3710
3710
|
rtl?: boolean;
|
|
3711
3711
|
}
|
|
3712
|
+
/**
|
|
3713
|
+
* A single fill reference within a table style section.
|
|
3714
|
+
*
|
|
3715
|
+
* @example
|
|
3716
|
+
* ```ts
|
|
3717
|
+
* const fill: ParsedTableStyleFill = {
|
|
3718
|
+
* schemeColor: "accent1",
|
|
3719
|
+
* tint: 40000, // 40% tint
|
|
3720
|
+
* };
|
|
3721
|
+
* // => satisfies ParsedTableStyleFill
|
|
3722
|
+
* ```
|
|
3723
|
+
*/
|
|
3724
|
+
interface ParsedTableStyleFill {
|
|
3725
|
+
/** Theme colour key (e.g. `accent1`, `dk1`). */
|
|
3726
|
+
schemeColor: string;
|
|
3727
|
+
/** Tint value (0-100 000). */
|
|
3728
|
+
tint?: number;
|
|
3729
|
+
/** Shade value (0-100 000). */
|
|
3730
|
+
shade?: number;
|
|
3731
|
+
}
|
|
3732
|
+
/**
|
|
3733
|
+
* A single entry in the parsed table style map.
|
|
3734
|
+
*
|
|
3735
|
+
* Contains fill colours for whole-table, banded rows/columns, first/last
|
|
3736
|
+
* row, and first/last column sections.
|
|
3737
|
+
*
|
|
3738
|
+
* @example
|
|
3739
|
+
* ```ts
|
|
3740
|
+
* const entry: ParsedTableStyleEntry = {
|
|
3741
|
+
* styleId: "{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}",
|
|
3742
|
+
* styleName: "Medium Style 2 - Accent 1",
|
|
3743
|
+
* accentKey: "accent1",
|
|
3744
|
+
* wholeTblFill: { schemeColor: "accent1", tint: 20000 },
|
|
3745
|
+
* band1HFill: { schemeColor: "accent1", tint: 40000 },
|
|
3746
|
+
* firstRowFill: { schemeColor: "accent1" },
|
|
3747
|
+
* };
|
|
3748
|
+
* // => satisfies ParsedTableStyleEntry
|
|
3749
|
+
* ```
|
|
3750
|
+
*/
|
|
3751
|
+
/** Text properties from a:tcTxStyle in a table style section. */
|
|
3752
|
+
interface ParsedTableStyleText {
|
|
3753
|
+
/** Font bold. */
|
|
3754
|
+
bold?: boolean;
|
|
3755
|
+
/** Font italic. */
|
|
3756
|
+
italic?: boolean;
|
|
3757
|
+
/** Font colour as theme scheme key. */
|
|
3758
|
+
fontSchemeColor?: string;
|
|
3759
|
+
/** Font colour tint (0-100 000). */
|
|
3760
|
+
fontTint?: number;
|
|
3761
|
+
/** Font colour shade (0-100 000). */
|
|
3762
|
+
fontShade?: number;
|
|
3763
|
+
}
|
|
3764
|
+
/**
|
|
3765
|
+
* Table background style (CT_TableBackgroundStyle, ECMA-376 §21.1.3.7).
|
|
3766
|
+
*
|
|
3767
|
+
* Corresponds to the `<a:tblBg>` child of `<a:tblStyle>`. Currently
|
|
3768
|
+
* captures only the resolved scheme-fill colour (verbatim XML for fill
|
|
3769
|
+
* / effect references is preserved separately by the save path).
|
|
3770
|
+
*/
|
|
3771
|
+
interface ParsedTableBackground {
|
|
3772
|
+
/** Solid fill (resolved from `a:fill > a:solidFill > a:schemeClr`). */
|
|
3773
|
+
fill?: ParsedTableStyleFill;
|
|
3774
|
+
/** Has an `a:effectLst` child that should be round-tripped. */
|
|
3775
|
+
hasEffectLst?: boolean;
|
|
3776
|
+
}
|
|
3777
|
+
interface ParsedTableStyleEntry {
|
|
3778
|
+
styleId: string;
|
|
3779
|
+
styleName?: string;
|
|
3780
|
+
/** Dominant accent key derived from fills (e.g. `accent1`). */
|
|
3781
|
+
accentKey?: string;
|
|
3782
|
+
/** Table-level background (`<a:tblBg>`). */
|
|
3783
|
+
tableBackground?: ParsedTableBackground;
|
|
3784
|
+
wholeTblFill?: ParsedTableStyleFill;
|
|
3785
|
+
band1HFill?: ParsedTableStyleFill;
|
|
3786
|
+
band2HFill?: ParsedTableStyleFill;
|
|
3787
|
+
band1VFill?: ParsedTableStyleFill;
|
|
3788
|
+
band2VFill?: ParsedTableStyleFill;
|
|
3789
|
+
firstRowFill?: ParsedTableStyleFill;
|
|
3790
|
+
lastRowFill?: ParsedTableStyleFill;
|
|
3791
|
+
firstColFill?: ParsedTableStyleFill;
|
|
3792
|
+
lastColFill?: ParsedTableStyleFill;
|
|
3793
|
+
/** Corner cell fills (`<a:seCell>`, `<a:swCell>`, `<a:neCell>`, `<a:nwCell>`). */
|
|
3794
|
+
seCellFill?: ParsedTableStyleFill;
|
|
3795
|
+
swCellFill?: ParsedTableStyleFill;
|
|
3796
|
+
neCellFill?: ParsedTableStyleFill;
|
|
3797
|
+
nwCellFill?: ParsedTableStyleFill;
|
|
3798
|
+
/** Per-role text styling from a:tcTxStyle. */
|
|
3799
|
+
wholeTblText?: ParsedTableStyleText;
|
|
3800
|
+
firstRowText?: ParsedTableStyleText;
|
|
3801
|
+
lastRowText?: ParsedTableStyleText;
|
|
3802
|
+
firstColText?: ParsedTableStyleText;
|
|
3803
|
+
lastColText?: ParsedTableStyleText;
|
|
3804
|
+
band1HText?: ParsedTableStyleText;
|
|
3805
|
+
band2HText?: ParsedTableStyleText;
|
|
3806
|
+
band1VText?: ParsedTableStyleText;
|
|
3807
|
+
band2VText?: ParsedTableStyleText;
|
|
3808
|
+
seCellText?: ParsedTableStyleText;
|
|
3809
|
+
swCellText?: ParsedTableStyleText;
|
|
3810
|
+
neCellText?: ParsedTableStyleText;
|
|
3811
|
+
nwCellText?: ParsedTableStyleText;
|
|
3812
|
+
}
|
|
3813
|
+
/**
|
|
3814
|
+
* Map of GUID → table style entry.
|
|
3815
|
+
*
|
|
3816
|
+
* Parsed from `ppt/tableStyles.xml` and indexed by the style GUID
|
|
3817
|
+
* referenced in `a:tblPr@tblStyle`.
|
|
3818
|
+
*
|
|
3819
|
+
* @example
|
|
3820
|
+
* ```ts
|
|
3821
|
+
* const styles: ParsedTableStyleMap = {
|
|
3822
|
+
* "{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}": {
|
|
3823
|
+
* styleId: "{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}",
|
|
3824
|
+
* styleName: "Medium Style 2 - Accent 1",
|
|
3825
|
+
* accentKey: "accent1",
|
|
3826
|
+
* },
|
|
3827
|
+
* };
|
|
3828
|
+
* // => satisfies ParsedTableStyleMap
|
|
3829
|
+
* ```
|
|
3830
|
+
*/
|
|
3831
|
+
type ParsedTableStyleMap = Record<string, ParsedTableStyleEntry>;
|
|
3712
3832
|
//#endregion
|
|
3713
3833
|
//#region src/core/types/elements.d.ts
|
|
3714
3834
|
/**
|
|
@@ -4656,6 +4776,268 @@ interface PptxCompatibilityWarning {
|
|
|
4656
4776
|
elementId?: string;
|
|
4657
4777
|
xmlPath?: string;
|
|
4658
4778
|
}
|
|
4779
|
+
/**
|
|
4780
|
+
* Resolved hex values for the 12 theme colour slots.
|
|
4781
|
+
*
|
|
4782
|
+
* @example
|
|
4783
|
+
* ```ts
|
|
4784
|
+
* const scheme: PptxThemeColorScheme = {
|
|
4785
|
+
* dk1: "#000000", lt1: "#FFFFFF",
|
|
4786
|
+
* dk2: "#1F497D", lt2: "#EEECE1",
|
|
4787
|
+
* accent1: "#4F81BD", accent2: "#C0504D",
|
|
4788
|
+
* accent3: "#9BBB59", accent4: "#8064A2",
|
|
4789
|
+
* accent5: "#4BACC6", accent6: "#F79646",
|
|
4790
|
+
* hlink: "#0000FF", folHlink: "#800080",
|
|
4791
|
+
* };
|
|
4792
|
+
* // => satisfies PptxThemeColorScheme
|
|
4793
|
+
* ```
|
|
4794
|
+
*/
|
|
4795
|
+
interface PptxThemeColorScheme {
|
|
4796
|
+
dk1: string;
|
|
4797
|
+
lt1: string;
|
|
4798
|
+
dk2: string;
|
|
4799
|
+
lt2: string;
|
|
4800
|
+
accent1: string;
|
|
4801
|
+
accent2: string;
|
|
4802
|
+
accent3: string;
|
|
4803
|
+
accent4: string;
|
|
4804
|
+
accent5: string;
|
|
4805
|
+
accent6: string;
|
|
4806
|
+
hlink: string;
|
|
4807
|
+
folHlink: string;
|
|
4808
|
+
}
|
|
4809
|
+
/**
|
|
4810
|
+
* A font-family triplet for major or minor theme fonts.
|
|
4811
|
+
*
|
|
4812
|
+
* Supports Latin, East Asian, and Complex Script font families.
|
|
4813
|
+
*
|
|
4814
|
+
* @example
|
|
4815
|
+
* ```ts
|
|
4816
|
+
* const fonts: PptxThemeFontGroup = {
|
|
4817
|
+
* latin: "Calibri Light",
|
|
4818
|
+
* eastAsia: "MS PGothic",
|
|
4819
|
+
* complexScript: "Arial",
|
|
4820
|
+
* };
|
|
4821
|
+
* // => satisfies PptxThemeFontGroup
|
|
4822
|
+
* ```
|
|
4823
|
+
*/
|
|
4824
|
+
interface PptxThemeFontGroup {
|
|
4825
|
+
latin?: string;
|
|
4826
|
+
eastAsia?: string;
|
|
4827
|
+
complexScript?: string;
|
|
4828
|
+
/**
|
|
4829
|
+
* Per-script typeface overrides (`<a:font script="Hans|Hant|Arab|Hebr|
|
|
4830
|
+
* Thai|Beng|Gujr|Khmr|Knda|…"/>` per ECMA-376 §20.1.4.1.16). Keyed by
|
|
4831
|
+
* the four-letter ISO 15924 script tag from the `script` attribute.
|
|
4832
|
+
*
|
|
4833
|
+
* Phase 4 Stream A / M4.
|
|
4834
|
+
*/
|
|
4835
|
+
byScript?: Record<string, string>;
|
|
4836
|
+
}
|
|
4837
|
+
/**
|
|
4838
|
+
* Theme font scheme — major (headings) and minor (body) font families.
|
|
4839
|
+
*
|
|
4840
|
+
* @example
|
|
4841
|
+
* ```ts
|
|
4842
|
+
* const scheme: PptxThemeFontScheme = {
|
|
4843
|
+
* majorFont: { latin: "Calibri Light" },
|
|
4844
|
+
* minorFont: { latin: "Calibri", eastAsia: "MS PGothic" },
|
|
4845
|
+
* };
|
|
4846
|
+
* // => satisfies PptxThemeFontScheme
|
|
4847
|
+
* ```
|
|
4848
|
+
*/
|
|
4849
|
+
interface PptxThemeFontScheme {
|
|
4850
|
+
majorFont?: PptxThemeFontGroup;
|
|
4851
|
+
minorFont?: PptxThemeFontGroup;
|
|
4852
|
+
}
|
|
4853
|
+
/**
|
|
4854
|
+
* A single fill style entry from the theme format scheme.
|
|
4855
|
+
* Each entry is one of: solid, gradient, pattern, or no fill.
|
|
4856
|
+
* The raw XML node is also stored so that `phClr` substitution can happen
|
|
4857
|
+
* at resolution time.
|
|
4858
|
+
*
|
|
4859
|
+
* @example
|
|
4860
|
+
* ```ts
|
|
4861
|
+
* const solidFill: PptxThemeFillStyle = {
|
|
4862
|
+
* kind: "solid",
|
|
4863
|
+
* color: "#4F81BD",
|
|
4864
|
+
* opacity: 1,
|
|
4865
|
+
* };
|
|
4866
|
+
*
|
|
4867
|
+
* const gradientFill: PptxThemeFillStyle = {
|
|
4868
|
+
* kind: "gradient",
|
|
4869
|
+
* gradientAngle: 90,
|
|
4870
|
+
* gradientType: "linear",
|
|
4871
|
+
* gradientStops: [
|
|
4872
|
+
* { color: "#4F81BD", position: 0 },
|
|
4873
|
+
* { color: "#1F497D", position: 1 },
|
|
4874
|
+
* ],
|
|
4875
|
+
* };
|
|
4876
|
+
* // => satisfies PptxThemeFillStyle
|
|
4877
|
+
* ```
|
|
4878
|
+
*/
|
|
4879
|
+
interface PptxThemeFillStyle {
|
|
4880
|
+
/**
|
|
4881
|
+
* Discriminator for the fill type.
|
|
4882
|
+
*
|
|
4883
|
+
* `'group'` corresponds to `<a:grpFill/>` — a fill that inherits the
|
|
4884
|
+
* containing group shape's fill at render time. Captured for round-trip
|
|
4885
|
+
* preservation in `fmtScheme/fillStyleLst`.
|
|
4886
|
+
*/
|
|
4887
|
+
kind: 'solid' | 'gradient' | 'pattern' | 'none' | 'group';
|
|
4888
|
+
/** Pre-resolved colour (may be `undefined` when `phClr`-dependent). */
|
|
4889
|
+
color?: string;
|
|
4890
|
+
opacity?: number;
|
|
4891
|
+
/** Gradient-specific fields (only present when `kind === "gradient"`). */
|
|
4892
|
+
gradientStops?: Array<{
|
|
4893
|
+
color: string;
|
|
4894
|
+
position: number;
|
|
4895
|
+
opacity?: number;
|
|
4896
|
+
}>;
|
|
4897
|
+
gradientAngle?: number;
|
|
4898
|
+
gradientType?: 'linear' | 'radial';
|
|
4899
|
+
gradientCss?: string;
|
|
4900
|
+
/** Pattern-specific fields (only present when `kind === "pattern"`). */
|
|
4901
|
+
patternPreset?: string;
|
|
4902
|
+
patternBackgroundColor?: string;
|
|
4903
|
+
/** Raw XML node preserved for `phClr` re-resolution. */
|
|
4904
|
+
rawNode?: unknown;
|
|
4905
|
+
}
|
|
4906
|
+
/**
|
|
4907
|
+
* A single line style entry from `a:lnStyleLst`.
|
|
4908
|
+
* Provides width, dash, join, cap, and optional fill colour.
|
|
4909
|
+
*
|
|
4910
|
+
* @example
|
|
4911
|
+
* ```ts
|
|
4912
|
+
* const line: PptxThemeLineStyle = {
|
|
4913
|
+
* width: 1.5,
|
|
4914
|
+
* color: "#4F81BD",
|
|
4915
|
+
* dash: "solid",
|
|
4916
|
+
* lineJoin: "round",
|
|
4917
|
+
* lineCap: "flat",
|
|
4918
|
+
* };
|
|
4919
|
+
* // => satisfies PptxThemeLineStyle
|
|
4920
|
+
* ```
|
|
4921
|
+
*/
|
|
4922
|
+
interface PptxThemeLineStyle {
|
|
4923
|
+
/** Line width in pixels (converted from EMU). */
|
|
4924
|
+
width?: number;
|
|
4925
|
+
color?: string;
|
|
4926
|
+
opacity?: number;
|
|
4927
|
+
dash?: string;
|
|
4928
|
+
lineJoin?: 'round' | 'bevel' | 'miter';
|
|
4929
|
+
lineCap?: 'flat' | 'rnd' | 'sq';
|
|
4930
|
+
compoundLine?: 'sng' | 'dbl' | 'thickThin' | 'thinThick' | 'tri';
|
|
4931
|
+
/** Raw XML node preserved for `phClr` re-resolution. */
|
|
4932
|
+
rawNode?: unknown;
|
|
4933
|
+
}
|
|
4934
|
+
/**
|
|
4935
|
+
* A single effect style entry from `a:effectStyleLst`.
|
|
4936
|
+
* Each entry may define shadow, glow, soft-edge, reflection, blur,
|
|
4937
|
+
* and optionally a 3-D scene/shape.
|
|
4938
|
+
*
|
|
4939
|
+
* @example
|
|
4940
|
+
* ```ts
|
|
4941
|
+
* const dropShadow: PptxThemeEffectStyle = {
|
|
4942
|
+
* shadowColor: "#000000",
|
|
4943
|
+
* shadowBlur: 4,
|
|
4944
|
+
* shadowOffsetX: 2,
|
|
4945
|
+
* shadowOffsetY: 3,
|
|
4946
|
+
* shadowOpacity: 0.4,
|
|
4947
|
+
* };
|
|
4948
|
+
* // => satisfies PptxThemeEffectStyle
|
|
4949
|
+
* ```
|
|
4950
|
+
*/
|
|
4951
|
+
interface PptxThemeEffectStyle {
|
|
4952
|
+
shadowColor?: string;
|
|
4953
|
+
shadowBlur?: number;
|
|
4954
|
+
shadowOffsetX?: number;
|
|
4955
|
+
shadowOffsetY?: number;
|
|
4956
|
+
shadowOpacity?: number;
|
|
4957
|
+
glowColor?: string;
|
|
4958
|
+
glowRadius?: number;
|
|
4959
|
+
glowOpacity?: number;
|
|
4960
|
+
softEdgeRadius?: number;
|
|
4961
|
+
innerShadowColor?: string;
|
|
4962
|
+
innerShadowOpacity?: number;
|
|
4963
|
+
innerShadowBlur?: number;
|
|
4964
|
+
innerShadowOffsetX?: number;
|
|
4965
|
+
innerShadowOffsetY?: number;
|
|
4966
|
+
reflectionBlurRadius?: number;
|
|
4967
|
+
reflectionStartOpacity?: number;
|
|
4968
|
+
reflectionEndOpacity?: number;
|
|
4969
|
+
reflectionEndPosition?: number;
|
|
4970
|
+
reflectionDirection?: number;
|
|
4971
|
+
reflectionRotation?: number;
|
|
4972
|
+
reflectionDistance?: number;
|
|
4973
|
+
/** 3D scene/camera from `a:scene3d` on the effect style (idx 3 typically). */
|
|
4974
|
+
scene3d?: Pptx3DScene;
|
|
4975
|
+
/** 3D shape extrusion/bevel from `a:sp3d` on the effect style (idx 3 typically). */
|
|
4976
|
+
shape3d?: Pptx3DShape;
|
|
4977
|
+
/** Raw XML node preserved for `phClr` re-resolution. */
|
|
4978
|
+
rawNode?: unknown;
|
|
4979
|
+
}
|
|
4980
|
+
/**
|
|
4981
|
+
* The full parsed format scheme from `a:fmtScheme` inside `a:themeElements`.
|
|
4982
|
+
* Contains three fill style lists and one line/effect style list each,
|
|
4983
|
+
* at three intensity levels: subtle (idx 1), moderate (idx 2), intense (idx 3).
|
|
4984
|
+
*
|
|
4985
|
+
* OOXML reference indices:
|
|
4986
|
+
* - fillStyleLst: idx 1-3 (used by `a:fillRef @idx` 1-3)
|
|
4987
|
+
* - lnStyleLst: idx 1-3 (used by `a:lnRef @idx` 1-3)
|
|
4988
|
+
* - effectStyleLst: idx 1-3 (used by `a:effectRef @idx` 1-3)
|
|
4989
|
+
* - bgFillStyleLst: idx 1-3 (used by `a:fillRef @idx` 1001-1003)
|
|
4990
|
+
*
|
|
4991
|
+
* @example
|
|
4992
|
+
* ```ts
|
|
4993
|
+
* const fmt: PptxThemeFormatScheme = {
|
|
4994
|
+
* name: "Office",
|
|
4995
|
+
* fillStyles: [solidFill, gradientFill, intenseFill],
|
|
4996
|
+
* lineStyles: [thinLine, mediumLine, thickLine],
|
|
4997
|
+
* effectStyles: [subtle, moderate, intense],
|
|
4998
|
+
* backgroundFillStyles: [solidBg, gradientBg, intenseBg],
|
|
4999
|
+
* };
|
|
5000
|
+
* // => satisfies PptxThemeFormatScheme
|
|
5001
|
+
* ```
|
|
5002
|
+
*/
|
|
5003
|
+
interface PptxThemeFormatScheme {
|
|
5004
|
+
/** The `@name` attribute of the format scheme. */
|
|
5005
|
+
name?: string;
|
|
5006
|
+
/** Fill styles at indices 1-3 (subtle, moderate, intense). */
|
|
5007
|
+
fillStyles: PptxThemeFillStyle[];
|
|
5008
|
+
/** Line styles at indices 1-3. */
|
|
5009
|
+
lineStyles: PptxThemeLineStyle[];
|
|
5010
|
+
/** Effect styles at indices 1-3. */
|
|
5011
|
+
effectStyles: PptxThemeEffectStyle[];
|
|
5012
|
+
/** Background fill styles at indices 1-3 (referenced via idx 1001-1003). */
|
|
5013
|
+
backgroundFillStyles: PptxThemeFillStyle[];
|
|
5014
|
+
}
|
|
5015
|
+
/**
|
|
5016
|
+
* Full parsed theme object available to renderers.
|
|
5017
|
+
*
|
|
5018
|
+
* @example
|
|
5019
|
+
* ```ts
|
|
5020
|
+
* const theme: PptxTheme = {
|
|
5021
|
+
* name: "Office Theme",
|
|
5022
|
+
* colorScheme: { dk1: "#000", lt1: "#FFF", /* … *\/ },
|
|
5023
|
+
* fontScheme: {
|
|
5024
|
+
* majorFont: { latin: "Calibri Light" },
|
|
5025
|
+
* minorFont: { latin: "Calibri" },
|
|
5026
|
+
* },
|
|
5027
|
+
* };
|
|
5028
|
+
* // => satisfies PptxTheme
|
|
5029
|
+
* ```
|
|
5030
|
+
*/
|
|
5031
|
+
interface PptxTheme {
|
|
5032
|
+
/** Theme name from `a:theme @name`. */
|
|
5033
|
+
name?: string;
|
|
5034
|
+
/** Resolved colour scheme. */
|
|
5035
|
+
colorScheme?: PptxThemeColorScheme;
|
|
5036
|
+
/** Resolved font scheme. */
|
|
5037
|
+
fontScheme?: PptxThemeFontScheme;
|
|
5038
|
+
/** Format scheme — fill, line, effect and background fill style matrices. */
|
|
5039
|
+
formatScheme?: PptxThemeFormatScheme;
|
|
5040
|
+
}
|
|
4659
5041
|
//#endregion
|
|
4660
5042
|
//#region src/core/types/transition.d.ts
|
|
4661
5043
|
/**
|
|
@@ -4911,6 +5293,32 @@ interface PptxSlideSyncProperties {
|
|
|
4911
5293
|
partPath?: string;
|
|
4912
5294
|
relationshipId?: string;
|
|
4913
5295
|
}
|
|
5296
|
+
/**
|
|
5297
|
+
* A named custom slide show (`p:custShowLst / p:custShow`).
|
|
5298
|
+
*
|
|
5299
|
+
* Custom shows define ordered subsets of slides that can be presented
|
|
5300
|
+
* independently of the full deck.
|
|
5301
|
+
*
|
|
5302
|
+
* @example
|
|
5303
|
+
* ```ts
|
|
5304
|
+
* const show: PptxCustomShow = {
|
|
5305
|
+
* name: "Executive Summary",
|
|
5306
|
+
* id: "0",
|
|
5307
|
+
* slideRIds: ["rId2", "rId5", "rId8"],
|
|
5308
|
+
* };
|
|
5309
|
+
* // => satisfies PptxCustomShow
|
|
5310
|
+
* ```
|
|
5311
|
+
*/
|
|
5312
|
+
interface PptxCustomShow {
|
|
5313
|
+
/** Custom show name. */
|
|
5314
|
+
name: string;
|
|
5315
|
+
/** Custom show id. */
|
|
5316
|
+
id: string;
|
|
5317
|
+
/** Ordered list of slide relationship IDs included in this custom show. */
|
|
5318
|
+
slideRIds: string[];
|
|
5319
|
+
/** Original `p:custShow` subtree used to preserve unmodelled attributes and extensions. */
|
|
5320
|
+
rawXml?: XmlObject;
|
|
5321
|
+
}
|
|
4914
5322
|
|
|
4915
5323
|
//#region src/theme/types.d.ts
|
|
4916
5324
|
/**
|
|
@@ -5226,6 +5634,49 @@ interface CollaborationConfig {
|
|
|
5226
5634
|
*/
|
|
5227
5635
|
writeBackDebounceMs?: number;
|
|
5228
5636
|
}
|
|
5637
|
+
/** Snapshot of a single element's animation state at a point in the timeline. */
|
|
5638
|
+
interface ElementAnimationState {
|
|
5639
|
+
/** Whether the element should be visible. */
|
|
5640
|
+
visible: boolean;
|
|
5641
|
+
/** CSS animation shorthand to apply (undefined = no active animation). */
|
|
5642
|
+
cssAnimation: string | undefined;
|
|
5643
|
+
}
|
|
5644
|
+
/** The unit system used for ruler display. */
|
|
5645
|
+
type RulerUnit = 'inches' | 'centimetres';
|
|
5646
|
+
//#endregion
|
|
5647
|
+
//#region src/render/text-field-substitution.d.ts
|
|
5648
|
+
/**
|
|
5649
|
+
* Text-field placeholder substitution, shared by every binding's text
|
|
5650
|
+
* renderer.
|
|
5651
|
+
*
|
|
5652
|
+
* Pure string logic: resolves OOXML field runs (slide number, date/time,
|
|
5653
|
+
* header/footer, document properties, slide title) into their display text.
|
|
5654
|
+
* Extracted from the React `viewer/utils/text-field-substitution` module so
|
|
5655
|
+
* every binding substitutes identically.
|
|
5656
|
+
*/
|
|
5657
|
+
/** Context for substituting field placeholders (slide number, date/time, header/footer, etc.). */
|
|
5658
|
+
interface FieldSubstitutionContext {
|
|
5659
|
+
slideNumber?: number;
|
|
5660
|
+
dateTimeText?: string;
|
|
5661
|
+
/** OOXML date-format pattern from header/footer settings (e.g. "M/d/yyyy"). */
|
|
5662
|
+
dateFormat?: string;
|
|
5663
|
+
/** Footer text from PptxHeaderFooter settings. */
|
|
5664
|
+
footerText?: string;
|
|
5665
|
+
/** Header text from PptxHeaderFooter settings. */
|
|
5666
|
+
headerText?: string;
|
|
5667
|
+
/** Custom document properties for `docproperty` field substitution (keyed by property name). */
|
|
5668
|
+
customProperties?: ReadonlyArray<{
|
|
5669
|
+
name: string;
|
|
5670
|
+
value: string;
|
|
5671
|
+
}>;
|
|
5672
|
+
/** Locale string for date/time formatting (e.g. "en-US"). Falls back to browser default. */
|
|
5673
|
+
locale?: string;
|
|
5674
|
+
/** Title text extracted from the first title placeholder on the slide. */
|
|
5675
|
+
slideTitle?: string;
|
|
5676
|
+
}
|
|
5677
|
+
//#endregion
|
|
5678
|
+
//#region src/render/text-case-transform.d.ts
|
|
5679
|
+
type ChangeCaseMode = 'sentence' | 'lower' | 'upper' | 'capitalize' | 'toggle';
|
|
5229
5680
|
/**
|
|
5230
5681
|
* A font supplied by the host application. The package never ships fonts:
|
|
5231
5682
|
* applications provide a licensed URL, data URL, or blob URL for their users.
|
|
@@ -5237,6 +5688,11 @@ interface ViewerFontSource {
|
|
|
5237
5688
|
weight?: string | number;
|
|
5238
5689
|
style?: 'normal' | 'italic';
|
|
5239
5690
|
}
|
|
5691
|
+
/** In-memory clipboard payload stored when an element is copied or cut. */
|
|
5692
|
+
interface ElementClipboardPayload {
|
|
5693
|
+
element: PptxElement;
|
|
5694
|
+
isTemplate: boolean;
|
|
5695
|
+
}
|
|
5240
5696
|
//#endregion
|
|
5241
5697
|
//#region src/render/account.d.ts
|
|
5242
5698
|
/** Local-only display profile shown in File > Account. Never sent anywhere; purely cosmetic. */
|
|
@@ -5356,6 +5812,20 @@ interface LocaleCatalogEntry {
|
|
|
5356
5812
|
*/
|
|
5357
5813
|
declare const LOCALE_CATALOG: readonly LocaleCatalogEntry[];
|
|
5358
5814
|
|
|
5815
|
+
//#region src/viewer/types-core.d.ts
|
|
5816
|
+
/**
|
|
5817
|
+
* Union of all shape preset types that the viewer can insert or render.
|
|
5818
|
+
* Maps to OOXML `a:prstGeom` preset values (e.g. "rect", "ellipse").
|
|
5819
|
+
* Includes basic shapes, arrows, connectors, and freeform paths.
|
|
5820
|
+
*/
|
|
5821
|
+
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';
|
|
5822
|
+
/** The pixel dimensions of the slide canvas (presentation slide size). */
|
|
5823
|
+
interface CanvasSize {
|
|
5824
|
+
/** Width of the canvas in CSS pixels. */
|
|
5825
|
+
width: number;
|
|
5826
|
+
/** Height of the canvas in CSS pixels. */
|
|
5827
|
+
height: number;
|
|
5828
|
+
}
|
|
5359
5829
|
//#endregion
|
|
5360
5830
|
//#region src/theme/context.d.ts
|
|
5361
5831
|
interface ViewerThemeProviderProps {
|
|
@@ -5370,7 +5840,7 @@ interface ViewerThemeProviderProps {
|
|
|
5370
5840
|
* for advanced use-cases where you want to wrap multiple viewers or
|
|
5371
5841
|
* share a theme across a wider subtree.
|
|
5372
5842
|
*/
|
|
5373
|
-
declare function ViewerThemeProvider({ theme, children }: ViewerThemeProviderProps):
|
|
5843
|
+
declare function ViewerThemeProvider({ theme, children }: ViewerThemeProviderProps): React$1.JSX.Element;
|
|
5374
5844
|
/**
|
|
5375
5845
|
* Returns the active `ViewerTheme` (if any) from the nearest
|
|
5376
5846
|
* `ViewerThemeProvider`.
|
|
@@ -5388,6 +5858,35 @@ interface FileViewerHandle {
|
|
|
5388
5858
|
/** Get the current content of the file (for saving) */
|
|
5389
5859
|
getContent: () => Promise<string | Uint8Array>;
|
|
5390
5860
|
}
|
|
5861
|
+
/**
|
|
5862
|
+
* State of an active marquee (rubber-band) selection rectangle.
|
|
5863
|
+
* Created when the user clicks and drags on the canvas background,
|
|
5864
|
+
* and used to compute which elements fall within the selection area.
|
|
5865
|
+
*/
|
|
5866
|
+
interface MarqueeSelectionState {
|
|
5867
|
+
startX: number;
|
|
5868
|
+
startY: number;
|
|
5869
|
+
currentX: number;
|
|
5870
|
+
currentY: number;
|
|
5871
|
+
additive: boolean;
|
|
5872
|
+
baseSelectionIds?: string[];
|
|
5873
|
+
}
|
|
5874
|
+
/** Tracks which table cell is selected and/or actively being edited. */
|
|
5875
|
+
interface TableCellEditorState {
|
|
5876
|
+
rowIndex: number;
|
|
5877
|
+
columnIndex: number;
|
|
5878
|
+
/** When true the cell has an active text input. */
|
|
5879
|
+
isEditing?: boolean;
|
|
5880
|
+
/** Optional multi-cell selection (Shift+Click range). Each entry is {row, col}. */
|
|
5881
|
+
selectedCells?: Array<{
|
|
5882
|
+
row: number;
|
|
5883
|
+
col: number;
|
|
5884
|
+
}>;
|
|
5885
|
+
}
|
|
5886
|
+
/** Identifies one of the ribbon-style toolbar tabs (home, insert, text, etc.). */
|
|
5887
|
+
type ToolbarSection = 'file' | 'home' | 'insert' | 'text' | 'arrange' | 'draw' | 'design' | 'transitions' | 'animations' | 'slideShow' | 'record' | 'review' | 'view' | 'help';
|
|
5888
|
+
/** The active drawing/inking tool selected in the Draw toolbar tab. */
|
|
5889
|
+
type DrawingTool = 'select' | 'pen' | 'highlighter' | 'eraser' | 'freeform';
|
|
5391
5890
|
interface PowerPointViewerProps {
|
|
5392
5891
|
/** PowerPoint content as Uint8Array */
|
|
5393
5892
|
content: Uint8Array;
|
|
@@ -5578,8 +6077,361 @@ interface PowerPointViewerHandle extends FileViewerHandle, PowerPointViewerAPI {
|
|
|
5578
6077
|
getContent: () => Promise<Uint8Array>;
|
|
5579
6078
|
}
|
|
5580
6079
|
|
|
6080
|
+
//#region src/viewer/hooks/useAutosave.d.ts
|
|
6081
|
+
type AutosaveStatus = {
|
|
6082
|
+
state: 'idle';
|
|
6083
|
+
} | {
|
|
6084
|
+
state: 'disabled';
|
|
6085
|
+
reason: string;
|
|
6086
|
+
} | {
|
|
6087
|
+
state: 'saving';
|
|
6088
|
+
} | {
|
|
6089
|
+
state: 'saved';
|
|
6090
|
+
timestamp: number;
|
|
6091
|
+
} | {
|
|
6092
|
+
state: 'error';
|
|
6093
|
+
message: string;
|
|
6094
|
+
};
|
|
6095
|
+
//#endregion
|
|
6096
|
+
//#region src/viewer/utils/table-band-style.d.ts
|
|
6097
|
+
/** Context for resolving table style colours from the theme. */
|
|
6098
|
+
interface TableStyleContext {
|
|
6099
|
+
tableStyleMap?: ParsedTableStyleMap;
|
|
6100
|
+
theme?: PptxTheme;
|
|
6101
|
+
}
|
|
6102
|
+
//#endregion
|
|
6103
|
+
//#region src/viewer/components/canvas/canvas-types.d.ts
|
|
6104
|
+
interface ZoomViewport {
|
|
6105
|
+
canvasViewportRef: React$1__default.RefObject<HTMLDivElement | null>;
|
|
6106
|
+
editWrapperRef: React$1__default.RefObject<HTMLDivElement | null>;
|
|
6107
|
+
canvasStageRef: React$1__default.RefObject<HTMLDivElement | null>;
|
|
6108
|
+
editorScale: number;
|
|
6109
|
+
}
|
|
6110
|
+
interface SlideCanvasProps {
|
|
6111
|
+
activeSlide: PptxSlide | undefined;
|
|
6112
|
+
templateElements: PptxElement[];
|
|
6113
|
+
canvasSize: CanvasSize;
|
|
6114
|
+
zoom: ZoomViewport;
|
|
6115
|
+
mode: ViewerMode;
|
|
6116
|
+
canEdit: boolean;
|
|
6117
|
+
editTemplateMode: boolean;
|
|
6118
|
+
selectedElementIdSet: Set<string>;
|
|
6119
|
+
selectedElement: PptxElement | null;
|
|
6120
|
+
inlineEditingElementId: string | null;
|
|
6121
|
+
inlineEditingText: string;
|
|
6122
|
+
spellCheckEnabled: boolean;
|
|
6123
|
+
mediaDataUrls: Map<string, string>;
|
|
6124
|
+
tableEditorState: TableCellEditorState | null;
|
|
6125
|
+
marqueeSelectionState: MarqueeSelectionState | null;
|
|
6126
|
+
snapLines: Array<{
|
|
6127
|
+
axis: string;
|
|
6128
|
+
position: number;
|
|
6129
|
+
}>;
|
|
6130
|
+
showGrid: boolean;
|
|
6131
|
+
/** Grid spacing in CSS px (derived from PPTX gridSpacing EMUs). */
|
|
6132
|
+
gridSpacingPx?: number;
|
|
6133
|
+
showRulers: boolean;
|
|
6134
|
+
/** Unit system for rulers (default: inches). */
|
|
6135
|
+
rulerUnit?: RulerUnit;
|
|
6136
|
+
guides: Array<{
|
|
6137
|
+
id: string;
|
|
6138
|
+
axis: 'h' | 'v';
|
|
6139
|
+
position: number;
|
|
6140
|
+
}>;
|
|
6141
|
+
presentationElementStates?: Map<string, ElementAnimationState>;
|
|
6142
|
+
presentationKeyframesCss?: string;
|
|
6143
|
+
onClick: (elementId: string, e: React$1__default.MouseEvent) => void;
|
|
6144
|
+
onDoubleClick: (elementId: string, e: React$1__default.MouseEvent) => void;
|
|
6145
|
+
onMouseDown: (elementId: string, e: React$1__default.MouseEvent) => void;
|
|
6146
|
+
onContextMenu: (elementId: string, e: React$1__default.MouseEvent) => void;
|
|
6147
|
+
/** Called when the user presses mouse down on empty canvas space. */
|
|
6148
|
+
onCanvasMouseDown?: (e: React$1__default.MouseEvent) => void;
|
|
6149
|
+
onResizePointerDown: (elementId: string, e: React$1__default.MouseEvent, handle: string) => void;
|
|
6150
|
+
onAdjustmentPointerDown: (elementId: string, e: React$1__default.MouseEvent) => void;
|
|
6151
|
+
/** Commit a new rotation (degrees) when the on-canvas rotate handle is dragged. */
|
|
6152
|
+
onRotate?: (elementId: string, rotationDeg: number) => void;
|
|
6153
|
+
onInlineEditChange: (text: string) => void;
|
|
6154
|
+
onInlineEditCommit: () => void;
|
|
6155
|
+
onInlineEditCancel: () => void;
|
|
6156
|
+
onTableCellSelect: (cell: Omit<TableCellEditorState, 'elementId'> | null, elementId: string) => void;
|
|
6157
|
+
/** Called when an edited table cell should be committed. */
|
|
6158
|
+
onCommitCellEdit?: (elementId: string, rowIndex: number, colIndex: number, text: string) => void;
|
|
6159
|
+
/**
|
|
6160
|
+
* Commit a partial update to a SmartArt element from inline (on-canvas) node
|
|
6161
|
+
* editing. Routed to the same element-update path the inspector uses (undo/redo
|
|
6162
|
+
* + dirty marking). When absent, inline SmartArt editing is disabled.
|
|
6163
|
+
*/
|
|
6164
|
+
onUpdateSmartArtElement?: (elementId: string, updates: Partial<PptxElement>) => void;
|
|
6165
|
+
/**
|
|
6166
|
+
* Apply a text-style toggle (Ctrl/Cmd+B/I/U) to the element being
|
|
6167
|
+
* inline-edited. Routed to the same updateSelectedTextStyle path as the
|
|
6168
|
+
* toolbar. When absent, the inline formatting shortcuts are inert.
|
|
6169
|
+
*/
|
|
6170
|
+
onFormatText?: (updates: Partial<TextStyle>) => void;
|
|
6171
|
+
/** Called when table column widths are resized. */
|
|
6172
|
+
onResizeTableColumns?: (elementId: string, newWidths: number[]) => void;
|
|
6173
|
+
/** Called when a table row is resized. */
|
|
6174
|
+
onResizeTableRow?: (elementId: string, rowIndex: number, newHeight: number) => void;
|
|
6175
|
+
/** Find & Replace results (all matches across all slides). */
|
|
6176
|
+
findResults?: Array<{
|
|
6177
|
+
slideIndex: number;
|
|
6178
|
+
elementId: string;
|
|
6179
|
+
segmentIndex: number;
|
|
6180
|
+
startOffset: number;
|
|
6181
|
+
length: number;
|
|
6182
|
+
}>;
|
|
6183
|
+
/** Index of the currently focused find result (-1 for none). */
|
|
6184
|
+
findResultIndex?: number;
|
|
6185
|
+
/** Index of the currently visible slide (needed to filter find results). */
|
|
6186
|
+
activeSlideIndex?: number;
|
|
6187
|
+
/** Currently active drawing tool ("select" means no drawing overlay). */
|
|
6188
|
+
activeTool?: DrawingTool;
|
|
6189
|
+
/** Stroke colour for pen / highlighter. */
|
|
6190
|
+
drawingColor?: string;
|
|
6191
|
+
/** Stroke width for pen / highlighter. */
|
|
6192
|
+
drawingWidth?: number;
|
|
6193
|
+
/** Ref that is true while a pointer stroke is in progress. */
|
|
6194
|
+
isDrawingRef?: React$1__default.RefObject<boolean>;
|
|
6195
|
+
/** Called when a completed ink stroke should be added to the slide. */
|
|
6196
|
+
onAddInkElement?: (ink: InkPptxElement) => void;
|
|
6197
|
+
/** Called when a freeform drawing stroke should be added as a shape element. */
|
|
6198
|
+
onAddFreeformShape?: (shape: ShapePptxElement) => void;
|
|
6199
|
+
/** Called when the eraser tool removes an ink element. */
|
|
6200
|
+
onEraseInkElement?: (elementId: string) => void;
|
|
6201
|
+
/** Called when a shape-level action is clicked (e.g. slide jump, URL). */
|
|
6202
|
+
onActionClick?: (elementId: string, action: PptxAction) => void;
|
|
6203
|
+
/** Called when a text-level hyperlink is clicked. */
|
|
6204
|
+
onHyperlinkClick?: (url: string) => void;
|
|
6205
|
+
/** Comments for the current slide (used for on-canvas markers). */
|
|
6206
|
+
comments?: PptxComment[];
|
|
6207
|
+
/** Whether to show comment markers on the slide canvas. */
|
|
6208
|
+
showCommentMarkers?: boolean;
|
|
6209
|
+
/** Called when a comment marker is clicked. */
|
|
6210
|
+
onCommentMarkerClick?: (commentId: string) => void;
|
|
6211
|
+
onMoveGuide?: (guideId: string, position: number) => void;
|
|
6212
|
+
onDeleteGuide?: (guideId: string) => void;
|
|
6213
|
+
onCreateGuideFromRuler?: (axis: 'h' | 'v', positionPx: number) => void;
|
|
6214
|
+
/** When true, shows connection sites on shapes and enables connector drawing. */
|
|
6215
|
+
connectorCreationMode?: boolean;
|
|
6216
|
+
/** Called when a new connector is created between two shapes. */
|
|
6217
|
+
onCreateConnector?: (connector: ConnectorPptxElement) => void;
|
|
6218
|
+
/** All slides in the presentation (for zoom element thumbnails). */
|
|
6219
|
+
allSlides?: readonly PptxSlide[];
|
|
6220
|
+
/** Callback fired when a zoom element is clicked in presentation mode. */
|
|
6221
|
+
onZoomClick?: (targetSlideIndex: number, returnSlideIndex: number) => void;
|
|
6222
|
+
/** Index of the current slide (for zoom return navigation). */
|
|
6223
|
+
sourceSlideIndex?: number;
|
|
6224
|
+
/** Context for text field placeholder substitution (slide number, header/footer, etc.). */
|
|
6225
|
+
fieldContext?: FieldSubstitutionContext;
|
|
6226
|
+
/** Theme + table style map for resolving table band/header colours. */
|
|
6227
|
+
tableStyleContext?: TableStyleContext;
|
|
6228
|
+
/** Optional collaboration cursor overlay rendered on top of the canvas. */
|
|
6229
|
+
collaborationOverlay?: React$1__default.ReactNode;
|
|
6230
|
+
}
|
|
6231
|
+
//#endregion
|
|
6232
|
+
//#region src/viewer/components/toolbar/toolbar-types.d.ts
|
|
6233
|
+
interface ToolbarProps {
|
|
6234
|
+
fileName?: string;
|
|
6235
|
+
mode: ViewerMode;
|
|
6236
|
+
canEdit: boolean;
|
|
6237
|
+
isNarrowViewport: boolean;
|
|
6238
|
+
isSidebarCollapsed: boolean;
|
|
6239
|
+
isInspectorPaneOpen: boolean;
|
|
6240
|
+
isCompactToolbarOpen: boolean;
|
|
6241
|
+
toolbarSection: ToolbarSection;
|
|
6242
|
+
scale: number;
|
|
6243
|
+
canUndo: boolean;
|
|
6244
|
+
canRedo: boolean;
|
|
6245
|
+
undoLabel: string | undefined;
|
|
6246
|
+
redoLabel: string | undefined;
|
|
6247
|
+
findReplaceOpen: boolean;
|
|
6248
|
+
selectedElement: PptxElement | null;
|
|
6249
|
+
tableEditorState?: TableCellEditorState | null;
|
|
6250
|
+
editTemplateMode: boolean;
|
|
6251
|
+
newShapeType: SupportedShapeType;
|
|
6252
|
+
activeTool: DrawingTool;
|
|
6253
|
+
drawingColor: string;
|
|
6254
|
+
drawingWidth: number;
|
|
6255
|
+
clipboardPayload: ElementClipboardPayload | null;
|
|
6256
|
+
onSetMode: (mode: ViewerMode) => void;
|
|
6257
|
+
onToggleSidebar: () => void;
|
|
6258
|
+
onToggleInspector: () => void;
|
|
6259
|
+
/** Opens the inspector pane and switches to the properties tab (for animation panel). */
|
|
6260
|
+
onOpenAnimationPanel: () => void;
|
|
6261
|
+
/** Adds an animation preset to the selected element. */
|
|
6262
|
+
onAddAnimation?: (preset: string, group: 'entrance' | 'emphasis' | 'exit') => void;
|
|
6263
|
+
/** Removes all animations from the selected element. */
|
|
6264
|
+
onRemoveAnimation?: () => void;
|
|
6265
|
+
onToggleCompactToolbar: () => void;
|
|
6266
|
+
onSetToolbarSection: (section: ToolbarSection) => void;
|
|
6267
|
+
onZoomIn: () => void;
|
|
6268
|
+
onZoomOut: () => void;
|
|
6269
|
+
onZoomToFit: () => void;
|
|
6270
|
+
onUndo: () => void;
|
|
6271
|
+
onRedo: () => void;
|
|
6272
|
+
onToggleFindReplace: () => void;
|
|
6273
|
+
onSetNewShapeType: (type: SupportedShapeType) => void;
|
|
6274
|
+
onAddTextBox: () => void;
|
|
6275
|
+
onAddShape: () => void;
|
|
6276
|
+
onAddTable: () => void;
|
|
6277
|
+
onAddChart?: (chartType: PptxChartType) => void;
|
|
6278
|
+
onAddSmartArt: () => void;
|
|
6279
|
+
onAddEquation: () => void;
|
|
6280
|
+
onAddActionButton: (shapeType: string) => void;
|
|
6281
|
+
onInsertField?: (fieldType: string, value?: string) => void;
|
|
6282
|
+
onOpenHeaderFooter?: () => void;
|
|
6283
|
+
onOpenImagePicker: () => void;
|
|
6284
|
+
onOpenMediaPicker: () => void;
|
|
6285
|
+
onSetActiveTool: (tool: DrawingTool) => void;
|
|
6286
|
+
onSetDrawingColor: (color: string) => void;
|
|
6287
|
+
onSetDrawingWidth: (width: number) => void;
|
|
6288
|
+
onSetEditTemplateMode: (mode: boolean) => void;
|
|
6289
|
+
spellCheckEnabled: boolean;
|
|
6290
|
+
showGrid: boolean;
|
|
6291
|
+
showRulers: boolean;
|
|
6292
|
+
snapToGrid: boolean;
|
|
6293
|
+
snapToShape: boolean;
|
|
6294
|
+
onSetSpellCheckEnabled: (enabled: boolean) => void;
|
|
6295
|
+
onSetShowGrid: (enabled: boolean) => void;
|
|
6296
|
+
onSetShowRulers: (enabled: boolean) => void;
|
|
6297
|
+
onSetSnapToGrid: (enabled: boolean) => void;
|
|
6298
|
+
onSetSnapToShape: (enabled: boolean) => void;
|
|
6299
|
+
onAddGuide: (axis: 'h' | 'v') => void;
|
|
6300
|
+
onAlignElements: (align: string) => void;
|
|
6301
|
+
onDistributeElements: (axis: string) => void;
|
|
6302
|
+
canDistribute: boolean;
|
|
6303
|
+
onCopy: () => void;
|
|
6304
|
+
onCut: () => void;
|
|
6305
|
+
onPaste: () => void;
|
|
6306
|
+
onFlip: (direction: 'horizontal' | 'vertical') => void;
|
|
6307
|
+
onMoveLayer: (direction: string) => void;
|
|
6308
|
+
onMoveLayerToEdge: (direction: string) => void;
|
|
6309
|
+
onDuplicate: () => void;
|
|
6310
|
+
onDelete: () => void;
|
|
6311
|
+
/** Open another presentation (File ▸ Open). Hidden when not provided. */
|
|
6312
|
+
onOpenFile?: () => void;
|
|
6313
|
+
onOpenRecentFile?: (key: string) => void;
|
|
6314
|
+
onCreatePresentation: (templateId: string) => void;
|
|
6315
|
+
onExportPng: () => void;
|
|
6316
|
+
onExportPdf: () => void;
|
|
6317
|
+
onExportVideo: () => void;
|
|
6318
|
+
onExportGif: () => void;
|
|
6319
|
+
onPackageForSharing: () => void;
|
|
6320
|
+
onOpenShareDialog?: () => void;
|
|
6321
|
+
onSaveAsPptx: () => void;
|
|
6322
|
+
onSaveAsPpsx: () => void;
|
|
6323
|
+
onSaveAsPptm: () => void;
|
|
6324
|
+
hasMacros: boolean;
|
|
6325
|
+
onCopySlideAsImage: () => void;
|
|
6326
|
+
onPrint: () => void;
|
|
6327
|
+
onToggleShortcuts: () => void;
|
|
6328
|
+
onOpenSettings?: () => void;
|
|
6329
|
+
onRunAccessibilityCheck: () => void;
|
|
6330
|
+
onToggleSlideSorter: () => void;
|
|
6331
|
+
onUpdateTextStyle: (updates: Partial<TextStyle>) => void;
|
|
6332
|
+
/** Rewrite the selected text's characters (PowerPoint's Aa "Change Case" dropdown). */
|
|
6333
|
+
onTransformTextCase: (mode: ChangeCaseMode) => void;
|
|
6334
|
+
isOverflowMenuOpen: boolean;
|
|
6335
|
+
onSetOverflowMenuOpen: (open: boolean) => void;
|
|
6336
|
+
layoutOptions: Array<{
|
|
6337
|
+
path: string;
|
|
6338
|
+
name: string;
|
|
6339
|
+
}>;
|
|
6340
|
+
onInsertSlideFromLayout: (path: string, name?: string) => void;
|
|
6341
|
+
customShows: PptxCustomShow[];
|
|
6342
|
+
activeCustomShowId: string | null;
|
|
6343
|
+
onSetActiveCustomShowId: (id: string | null) => void;
|
|
6344
|
+
onCreateCustomShow: () => void;
|
|
6345
|
+
onRenameActiveCustomShow: () => void;
|
|
6346
|
+
onDeleteActiveCustomShow: () => void;
|
|
6347
|
+
onToggleCurrentSlideInActiveShow: () => void;
|
|
6348
|
+
isCurrentSlideInActiveShow: boolean;
|
|
6349
|
+
onToggleVersionHistory?: () => void;
|
|
6350
|
+
onOpenPasswordProtection?: () => void;
|
|
6351
|
+
onOpenDocumentProperties?: () => void;
|
|
6352
|
+
onOpenFontEmbedding?: () => void;
|
|
6353
|
+
onOpenDigitalSignatures?: () => void;
|
|
6354
|
+
onEnterMasterView: () => void;
|
|
6355
|
+
onCloseMasterView: () => void;
|
|
6356
|
+
onEnterPresenterView?: () => void;
|
|
6357
|
+
onEnterRehearsalMode?: () => void;
|
|
6358
|
+
onToggleThemeEditor: () => void;
|
|
6359
|
+
isThemeEditorOpen: boolean;
|
|
6360
|
+
onToggleThemeGallery: () => void;
|
|
6361
|
+
isThemeGalleryOpen: boolean;
|
|
6362
|
+
onCompare?: () => void;
|
|
6363
|
+
onToggleComments?: () => void;
|
|
6364
|
+
isCommentsPanelOpen?: boolean;
|
|
6365
|
+
spellCheckActive?: boolean;
|
|
6366
|
+
slideCommentCount?: number;
|
|
6367
|
+
formatPainterActive?: boolean;
|
|
6368
|
+
onToggleFormatPainter?: () => void;
|
|
6369
|
+
canActivateFormatPainter?: boolean;
|
|
6370
|
+
isSelectionPaneOpen?: boolean;
|
|
6371
|
+
onToggleSelectionPane?: () => void;
|
|
6372
|
+
eyedropperActive?: boolean;
|
|
6373
|
+
onToggleEyedropper?: () => void;
|
|
6374
|
+
onOpenSetUpSlideShow?: () => void;
|
|
6375
|
+
onOpenBroadcastDialog?: () => void;
|
|
6376
|
+
onToggleSubtitles?: () => void;
|
|
6377
|
+
showSubtitles?: boolean;
|
|
6378
|
+
activeSlide?: PptxSlide;
|
|
6379
|
+
onTransitionChange: (updates: Partial<PptxSlideTransition>) => void;
|
|
6380
|
+
onApplyTransitionToAll: () => void;
|
|
6381
|
+
/** Host-supplied list of toolbar buttons/ribbon tabs to hide. See `PowerPointViewerProps.hiddenActions`. */
|
|
6382
|
+
hiddenActions?: readonly ToolbarActionId[];
|
|
6383
|
+
}
|
|
6384
|
+
//#endregion
|
|
6385
|
+
//#region src/viewer/hooks/useViewerBuildingBlocks.d.ts
|
|
6386
|
+
interface UseViewerBuildingBlocksInput {
|
|
6387
|
+
/** PPTX content as ArrayBuffer/Uint8Array, or null/undefined while no file is loaded. */
|
|
6388
|
+
content: ArrayBuffer | Uint8Array | null | undefined;
|
|
6389
|
+
/** Whether editing actions are enabled. Defaults to false (view-only). */
|
|
6390
|
+
canEdit?: boolean;
|
|
6391
|
+
/** Original file path, used for autosave recovery. */
|
|
6392
|
+
filePath?: string;
|
|
6393
|
+
/** Display name for the toolbar's file-name-aware controls (e.g. title bar hosts build themselves). */
|
|
6394
|
+
fileName?: string;
|
|
6395
|
+
/** Whether the built-in autosave-to-localStorage recovery timer is active. Defaults to true. */
|
|
6396
|
+
autosaveEnabled?: boolean;
|
|
6397
|
+
/** Display name used as the author for comments. */
|
|
6398
|
+
userName?: string;
|
|
6399
|
+
/** Host-supplied list of toolbar buttons/ribbon tabs to hide. */
|
|
6400
|
+
hiddenActions?: readonly ToolbarActionId[];
|
|
6401
|
+
/** Imperative handle ref, exposing the same `PowerPointViewerHandle` API `PowerPointViewer` does. */
|
|
6402
|
+
handle?: React.ForwardedRef<PowerPointViewerHandle>;
|
|
6403
|
+
onContentChange?: (content: Uint8Array) => void;
|
|
6404
|
+
onDirtyChange?: (dirty: boolean) => void;
|
|
6405
|
+
onActiveSlideChange?: (index: number) => void;
|
|
6406
|
+
onModeChange?: (mode: ViewerMode) => void;
|
|
6407
|
+
onZoomChange?: (zoom: number) => void;
|
|
6408
|
+
onSelectionChange?: (ids: string[]) => void;
|
|
6409
|
+
onSlideCountChange?: (count: number) => void;
|
|
6410
|
+
/** Fired by the toolbar's "Settings" button; the host owns rendering that dialog. */
|
|
6411
|
+
onOpenSettings?: () => void;
|
|
6412
|
+
/** Fired by the toolbar's "Header & Footer" button; the host owns rendering that panel. */
|
|
6413
|
+
onOpenHeaderFooter?: () => void;
|
|
6414
|
+
/** Fired by the toolbar's "Share" button; the host owns rendering that dialog. */
|
|
6415
|
+
onOpenShareDialog?: () => void;
|
|
6416
|
+
}
|
|
6417
|
+
interface ViewerBuildingBlocksResult {
|
|
6418
|
+
/** Flat, self-contained props for the standalone `<Toolbar>` component. */
|
|
6419
|
+
toolbarProps: ToolbarProps;
|
|
6420
|
+
/** Flat, self-contained props for the standalone `<SlideCanvas>` component. */
|
|
6421
|
+
canvasProps: SlideCanvasProps;
|
|
6422
|
+
/** Current viewer mode (edit, view, present, master). */
|
|
6423
|
+
mode: ViewerMode;
|
|
6424
|
+
/** True while the initial parse of `content` is in progress. */
|
|
6425
|
+
loading: boolean;
|
|
6426
|
+
/** Parse error message, or null. */
|
|
6427
|
+
error: string | null;
|
|
6428
|
+
/** Current autosave-to-localStorage recovery status. */
|
|
6429
|
+
autosaveStatus: AutosaveStatus;
|
|
6430
|
+
}
|
|
6431
|
+
declare function useViewerBuildingBlocks(input: UseViewerBuildingBlocksInput): ViewerBuildingBlocksResult;
|
|
6432
|
+
|
|
5581
6433
|
//#region src/viewer/utils/animation-effects.d.ts
|
|
5582
|
-
declare function getAnimationInitialStyle(preset: PptxAnimationPreset | undefined, nativeAnimation?: PptxNativeAnimation):
|
|
6434
|
+
declare function getAnimationInitialStyle(preset: PptxAnimationPreset | undefined, nativeAnimation?: PptxNativeAnimation): React$1__default.CSSProperties;
|
|
5583
6435
|
//#endregion
|
|
5584
6436
|
//#region src/viewer/PowerPointViewer.d.ts
|
|
5585
6437
|
/**
|
|
@@ -5591,8 +6443,14 @@ declare function getAnimationInitialStyle(preset: PptxAnimationPreset | undefine
|
|
|
5591
6443
|
* Uses `forwardRef` to expose a `PowerPointViewerHandle` for imperative
|
|
5592
6444
|
* access (e.g. serialising the current content for saving).
|
|
5593
6445
|
*/
|
|
5594
|
-
declare const PowerPointViewer:
|
|
6446
|
+
declare const PowerPointViewer: React$1.ForwardRefExoticComponent<PowerPointViewerProps & React$1.RefAttributes<PowerPointViewerHandle>>;
|
|
5595
6447
|
|
|
6448
|
+
//#region src/viewer/components/Toolbar.d.ts
|
|
6449
|
+
declare function Toolbar(p: ToolbarProps): React$1__default.ReactElement;
|
|
6450
|
+
//#endregion
|
|
6451
|
+
//#region src/viewer/components/SlideCanvas.d.ts
|
|
6452
|
+
declare function SlideCanvas({ activeSlide, templateElements, canvasSize, zoom, mode, canEdit, editTemplateMode, selectedElementIdSet, selectedElement, inlineEditingElementId, inlineEditingText, spellCheckEnabled, mediaDataUrls, tableEditorState, marqueeSelectionState, snapLines, showGrid, gridSpacingPx, showRulers, rulerUnit, guides, presentationElementStates, presentationKeyframesCss, onClick, onDoubleClick, onMouseDown, onContextMenu, onCanvasMouseDown, onResizePointerDown, onAdjustmentPointerDown, onRotate, onInlineEditChange, onInlineEditCommit, onInlineEditCancel, onTableCellSelect, onCommitCellEdit, onUpdateSmartArtElement, onFormatText, onResizeTableColumns, onResizeTableRow, findResults, findResultIndex, activeSlideIndex, activeTool, drawingColor, drawingWidth, isDrawingRef, onAddInkElement, onAddFreeformShape, onEraseInkElement, onActionClick, onHyperlinkClick, comments, showCommentMarkers, onCommentMarkerClick, onMoveGuide, onDeleteGuide, onCreateGuideFromRuler, connectorCreationMode, onCreateConnector, allSlides, onZoomClick, sourceSlideIndex, fieldContext, tableStyleContext, collaborationOverlay }: SlideCanvasProps): React$1.JSX.Element;
|
|
6453
|
+
//#endregion
|
|
5596
6454
|
//#region src/lib/canvas-export.d.ts
|
|
5597
6455
|
/**
|
|
5598
6456
|
* A drop-in replacement for `html2canvas(element, options)` that first
|
|
@@ -5612,5 +6470,5 @@ declare const PowerPointViewer: react.ForwardRefExoticComponent<PowerPointViewer
|
|
|
5612
6470
|
*/
|
|
5613
6471
|
declare function renderToCanvas(element: HTMLElement, options?: Partial<Options>): Promise<HTMLCanvasElement>;
|
|
5614
6472
|
|
|
5615
|
-
export { AVATAR_COLOR_SWATCHES, DEFAULT_VIEWER_PROFILE, LOCALE_CATALOG, PowerPointViewer, THEME_CATALOG, VIEWER_PREFS_STORAGE_KEY, ViewerThemeProvider, clearAllLocalViewerData, clearStoredViewerPrefs, defaultCssVars, defaultRadius, defaultThemeColors, getAnimationInitialStyle, getLocalStorageUsageSummary, readStoredViewerPrefs, renderToCanvas, resolveProfileInitial, resolveThemeCatalogEntry, saveViewerProfile, themeToCssVars, useViewerTheme, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius, writeStoredViewerPrefs };
|
|
5616
|
-
export type { AccountAuthConfig, LocalStorageUsageSummary, LocaleCatalogEntry, PowerPointViewerAPI, PowerPointViewerHandle, PowerPointViewerProps, StoredViewerPrefs, ThemeCatalogEntry, ToolbarActionId, ToolbarButtonId, ToolbarTabId, ViewerMode, ViewerProfile, ViewerTheme, ViewerThemeColors };
|
|
6473
|
+
export { AVATAR_COLOR_SWATCHES, DEFAULT_VIEWER_PROFILE, LOCALE_CATALOG, PowerPointViewer, SlideCanvas, THEME_CATALOG, Toolbar, VIEWER_PREFS_STORAGE_KEY, ViewerThemeProvider, clearAllLocalViewerData, clearStoredViewerPrefs, defaultCssVars, defaultRadius, defaultThemeColors, getAnimationInitialStyle, getLocalStorageUsageSummary, readStoredViewerPrefs, renderToCanvas, resolveProfileInitial, resolveThemeCatalogEntry, saveViewerProfile, themeToCssVars, useViewerBuildingBlocks, useViewerTheme, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius, writeStoredViewerPrefs };
|
|
6474
|
+
export type { AccountAuthConfig, LocalStorageUsageSummary, LocaleCatalogEntry, PowerPointViewerAPI, PowerPointViewerHandle, PowerPointViewerProps, SlideCanvasProps, StoredViewerPrefs, ThemeCatalogEntry, ToolbarActionId, ToolbarButtonId, ToolbarProps, ToolbarTabId, UseViewerBuildingBlocksInput, ViewerBuildingBlocksResult, ViewerMode, ViewerProfile, ViewerTheme, ViewerThemeColors };
|