pptx-react-viewer 1.1.5 → 1.1.7
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/dist/{PowerPointViewer-CX0a7wz_.d.mts → PowerPointViewer-C5jGuKGB.d.mts} +3 -1
- package/dist/{PowerPointViewer-CX0a7wz_.d.ts → PowerPointViewer-C5jGuKGB.d.ts} +3 -1
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1575 -515
- package/dist/index.mjs +1577 -517
- package/dist/pptx-viewer.css +1 -1
- package/dist/viewer/index.d.mts +6 -25
- package/dist/viewer/index.d.ts +6 -25
- package/dist/viewer/index.js +1575 -515
- package/dist/viewer/index.mjs +1577 -517
- package/node_modules/emf-converter/package.json +1 -1
- package/node_modules/mtx-decompressor/package.json +1 -1
- package/node_modules/pptx-viewer-core/dist/{SvgExporter-0TxiiorD.d.ts → SvgExporter-BtZczTlB.d.ts} +1 -1
- package/node_modules/pptx-viewer-core/dist/{SvgExporter-BQ4KbRO9.d.mts → SvgExporter-D4mBWJHE.d.mts} +1 -1
- package/node_modules/pptx-viewer-core/dist/cli/index.d.mts +2 -2
- package/node_modules/pptx-viewer-core/dist/cli/index.d.ts +2 -2
- package/node_modules/pptx-viewer-core/dist/cli/index.js +0 -0
- package/node_modules/pptx-viewer-core/dist/cli/index.mjs +0 -0
- package/node_modules/pptx-viewer-core/dist/converter/index.d.mts +3 -3
- package/node_modules/pptx-viewer-core/dist/converter/index.d.ts +3 -3
- package/node_modules/pptx-viewer-core/dist/converter/index.js +0 -0
- package/node_modules/pptx-viewer-core/dist/converter/index.mjs +0 -0
- package/node_modules/pptx-viewer-core/dist/index.d.mts +967 -60
- package/node_modules/pptx-viewer-core/dist/index.d.ts +967 -60
- package/node_modules/pptx-viewer-core/dist/index.js +29613 -16737
- package/node_modules/pptx-viewer-core/dist/index.mjs +29588 -16737
- package/node_modules/pptx-viewer-core/dist/{presentation-ArhfImJ5.d.mts → presentation-nZxgWvXq.d.mts} +875 -27
- package/node_modules/pptx-viewer-core/dist/{presentation-ArhfImJ5.d.ts → presentation-nZxgWvXq.d.ts} +875 -27
- package/node_modules/pptx-viewer-core/dist/{text-operations-CLj-sJyk.d.mts → text-operations-DCTGMltY.d.mts} +1 -1
- package/node_modules/pptx-viewer-core/dist/{text-operations-rhJV-A_W.d.ts → text-operations-DYmhoi7U.d.ts} +1 -1
- package/node_modules/pptx-viewer-core/package.json +1 -1
- package/package.json +4 -4
package/node_modules/pptx-viewer-core/dist/{presentation-ArhfImJ5.d.ts → presentation-nZxgWvXq.d.ts}
RENAMED
|
@@ -98,7 +98,42 @@ interface ShadowEffect {
|
|
|
98
98
|
/** Whether shadow rotates with shape. */
|
|
99
99
|
rotateWithShape?: boolean;
|
|
100
100
|
}
|
|
101
|
-
|
|
101
|
+
/**
|
|
102
|
+
* Strongly-typed parsed XML node from fast-xml-parser.
|
|
103
|
+
*
|
|
104
|
+
* The parser is configured with `attributeNamePrefix: '@_'`,
|
|
105
|
+
* `parseAttributeValue: false`, and `parseTagValue: false`, so attribute and
|
|
106
|
+
* text values are always strings at runtime. This type encodes that:
|
|
107
|
+
*
|
|
108
|
+
* - **Attributes** — keys matching `` `@_${string}` `` return
|
|
109
|
+
* `string | undefined` directly.
|
|
110
|
+
* - **Text content** — `#text` returns `string | undefined`.
|
|
111
|
+
* - **Child elements** — any other string key returns
|
|
112
|
+
* `XmlObject | XmlObject[] | string | undefined`. The union reflects that
|
|
113
|
+
* fast-xml-parser may emit an object (single child), an array (repeated
|
|
114
|
+
* children), or a bare string (text-only element collapsed by the parser).
|
|
115
|
+
*
|
|
116
|
+
* For traversal, prefer the helpers in {@link ./../utils/xml-access} —
|
|
117
|
+
* `xmlChild` / `xmlChildren` / `xmlAttr` / `xmlText` / `xmlPath` — which
|
|
118
|
+
* narrow the union and normalize the single-vs-array duality. Direct
|
|
119
|
+
* indexing works for attributes (typed as string) but chained child access
|
|
120
|
+
* (`obj['p:spPr']?.['a:xfrm']`) requires the helpers or a narrowing cast
|
|
121
|
+
* because TypeScript cannot index into the `XmlObject[] | string` part of
|
|
122
|
+
* the union.
|
|
123
|
+
*/
|
|
124
|
+
interface XmlObject {
|
|
125
|
+
/** Attributes (`@_`-prefixed keys) are always strings at runtime. */
|
|
126
|
+
[attr: `@_${string}`]: string | undefined;
|
|
127
|
+
/** Element text content surfaces under `#text` when present. */
|
|
128
|
+
'#text'?: string;
|
|
129
|
+
/**
|
|
130
|
+
* Child elements keyed by their (namespaced) tag name. fast-xml-parser
|
|
131
|
+
* emits a single object for unique elements, an array for repeated ones,
|
|
132
|
+
* and a bare string for elements collapsed to their text content. Use
|
|
133
|
+
* the helpers in `utils/xml-access` to narrow this union.
|
|
134
|
+
*/
|
|
135
|
+
[child: string]: XmlObject | XmlObject[] | string | undefined;
|
|
136
|
+
}
|
|
102
137
|
/**
|
|
103
138
|
* Discriminant values for the `type` field on {@link PptxElement}.
|
|
104
139
|
*
|
|
@@ -191,7 +226,7 @@ type BevelPresetType = 'circle' | 'relaxedInset' | 'cross' | 'coolSlant' | 'angl
|
|
|
191
226
|
* // => "plastic" — one of: "matte" | "warmMatte" | "plastic" | "metal" | "dkEdge" | …
|
|
192
227
|
* ```
|
|
193
228
|
*/
|
|
194
|
-
type MaterialPresetType = 'matte' | 'warmMatte' | 'plastic' | 'metal' | 'dkEdge' | 'softEdge' | 'flat' | 'softmetal' | 'clear' | 'powder' | 'translucentPowder';
|
|
229
|
+
type MaterialPresetType = 'matte' | 'warmMatte' | 'plastic' | 'metal' | 'dkEdge' | 'softEdge' | 'flat' | 'softmetal' | 'clear' | 'powder' | 'translucentPowder' | 'legacyMatte' | 'legacyPlastic' | 'legacyMetal' | 'legacyWireframe';
|
|
195
230
|
/**
|
|
196
231
|
* 3D text body extrusion/bevel from `a:bodyPr/a:sp3d`.
|
|
197
232
|
*
|
|
@@ -381,6 +416,38 @@ interface TextStyle {
|
|
|
381
416
|
underlineStyle?: UnderlineStyle;
|
|
382
417
|
/** Underline colour as hex string (`a:uFill` / `a:uLn`). When absent, inherits text colour. */
|
|
383
418
|
underlineColor?: string;
|
|
419
|
+
/**
|
|
420
|
+
* When true, the source authored `<a:u val="none"/>` to explicitly suppress
|
|
421
|
+
* underline (rather than omitting the attribute entirely). Preserved so the
|
|
422
|
+
* writer can re-emit the explicit `none` token instead of dropping it.
|
|
423
|
+
*/
|
|
424
|
+
underlineExplicitNone?: boolean;
|
|
425
|
+
/**
|
|
426
|
+
* Underline line properties parsed from `<a:rPr><a:uLn>` — width, dash
|
|
427
|
+
* preset, and end caps. Captured as a typed object so the writer can
|
|
428
|
+
* round-trip the line styling that previously was dropped (only the
|
|
429
|
+
* solidFill colour was carried before).
|
|
430
|
+
*/
|
|
431
|
+
underlineLine?: {
|
|
432
|
+
/** Line width in EMU (raw OOXML) for `a:uLn/@w`. */
|
|
433
|
+
widthEmu?: number;
|
|
434
|
+
/** Compound line type (`a:uLn/@cmpd`). */
|
|
435
|
+
compound?: string;
|
|
436
|
+
/** Cap style (`a:uLn/@cap`). */
|
|
437
|
+
cap?: string;
|
|
438
|
+
/** Pen alignment (`a:uLn/@algn`). */
|
|
439
|
+
algn?: string;
|
|
440
|
+
/** Preset dash value (`a:uLn/a:prstDash/@val`). */
|
|
441
|
+
prstDash?: string;
|
|
442
|
+
/** Raw `a:uLn/a:headEnd` XML preserved verbatim. */
|
|
443
|
+
headEndXml?: XmlObject;
|
|
444
|
+
/** Raw `a:uLn/a:tailEnd` XML preserved verbatim. */
|
|
445
|
+
tailEndXml?: XmlObject;
|
|
446
|
+
};
|
|
447
|
+
/** When `<a:uLnTx/>` is present — underline line follows the text run line. */
|
|
448
|
+
underlineLineFollowsText?: boolean;
|
|
449
|
+
/** When `<a:uFillTx/>` is present — underline fill follows the text run fill. */
|
|
450
|
+
underlineFillFollowsText?: boolean;
|
|
384
451
|
strikethrough?: boolean;
|
|
385
452
|
/** Specific strike type: single or double from `a:rPr/@strike`. */
|
|
386
453
|
strikeType?: 'sngStrike' | 'dblStrike';
|
|
@@ -497,6 +564,12 @@ interface TextStyle {
|
|
|
497
564
|
textWarpAdj2?: number;
|
|
498
565
|
/** Text capitalization style from `a:rPr/@cap`. */
|
|
499
566
|
textCaps?: 'all' | 'small' | 'none';
|
|
567
|
+
/**
|
|
568
|
+
* When true, the source authored `<a:rPr cap="none"/>` explicitly. This
|
|
569
|
+
* differs from {@link textCaps} = `"none"` only because the writer must
|
|
570
|
+
* preserve the explicit token rather than collapse it to omission.
|
|
571
|
+
*/
|
|
572
|
+
textCapsExplicitNone?: boolean;
|
|
500
573
|
/** Symbol font family from `a:sym`. */
|
|
501
574
|
symbolFont?: string;
|
|
502
575
|
/** East Asian font family from `a:ea`. */
|
|
@@ -591,6 +664,14 @@ interface TextStyle {
|
|
|
591
664
|
upright?: boolean;
|
|
592
665
|
/** Compatible line spacing flag (`a:bodyPr/@compatLnSpc`). */
|
|
593
666
|
compatibleLineSpacing?: boolean;
|
|
667
|
+
/**
|
|
668
|
+
* Text body rotation in **degrees** (`a:bodyPr/@rot`).
|
|
669
|
+
*
|
|
670
|
+
* OOXML stores the value as 60000ths of a degree. Positive values rotate
|
|
671
|
+
* the body clockwise. When undefined, the attribute is omitted on save
|
|
672
|
+
* (PowerPoint treats absent `rot` as inherit/none).
|
|
673
|
+
*/
|
|
674
|
+
textBodyRotation?: number;
|
|
594
675
|
/** Text shadow colour as hex string (`a:outerShdw`). */
|
|
595
676
|
textShadowColor?: string;
|
|
596
677
|
/** Text shadow blur radius in px. */
|
|
@@ -662,6 +743,33 @@ interface TextStyle {
|
|
|
662
743
|
text3d?: Text3DStyle;
|
|
663
744
|
/** 3D scene (camera + light rig) settings on the text body (`a:bodyPr/a:scene3d`). */
|
|
664
745
|
textBodyScene3d?: Pptx3DScene;
|
|
746
|
+
/**
|
|
747
|
+
* Raw `<a:extLst>` subtree captured from `<a:bodyPr>`. Preserved verbatim so
|
|
748
|
+
* authored extensions (e.g. content placeholders, custom application data)
|
|
749
|
+
* survive a round-trip even though the engine doesn't interpret them.
|
|
750
|
+
*/
|
|
751
|
+
bodyPropertiesExtLstXml?: XmlObject;
|
|
752
|
+
/**
|
|
753
|
+
* Raw `<a:extLst>` subtree captured from `<a:pPr>`. Only meaningful on the
|
|
754
|
+
* paragraph-level style (paragraphs propagate this via the first segment).
|
|
755
|
+
*/
|
|
756
|
+
paragraphPropertiesExtLstXml?: XmlObject;
|
|
757
|
+
/**
|
|
758
|
+
* Raw `<a:extLst>` subtree captured from `<a:rPr>`. Persisted verbatim on
|
|
759
|
+
* save when present — covers run-level extensions the typed model doesn't
|
|
760
|
+
* model (e.g. `a14:hiddenFill` and similar).
|
|
761
|
+
*/
|
|
762
|
+
runPropertiesExtLstXml?: XmlObject;
|
|
763
|
+
/**
|
|
764
|
+
* Raw `<a:defRPr>` XML node captured from `<a:pPr>`. The schema permits
|
|
765
|
+
* `defRPr` directly inside `pPr` so that paragraph defaults can specify the
|
|
766
|
+
* end-paragraph run formatting; previously this was dropped on save. We
|
|
767
|
+
* persist the parsed XML object so it round-trips verbatim.
|
|
768
|
+
*
|
|
769
|
+
* Only meaningful on the *first* segment of each paragraph (matches the
|
|
770
|
+
* convention used for {@link bulletInfo} / {@link endParaRunProperties}).
|
|
771
|
+
*/
|
|
772
|
+
paragraphDefaultRunPropertiesXml?: XmlObject;
|
|
665
773
|
}
|
|
666
774
|
/**
|
|
667
775
|
* Structured bullet metadata attached to the first {@link TextSegment}
|
|
@@ -702,12 +810,26 @@ interface BulletInfo {
|
|
|
702
810
|
sizePts?: number;
|
|
703
811
|
/** Bullet color as hex string from `a:buClr`. */
|
|
704
812
|
color?: string;
|
|
813
|
+
/**
|
|
814
|
+
* Raw colour-choice XML captured from `<a:buClr>` so that themed bullets
|
|
815
|
+
* (`a:schemeClr`, `a:sysClr`, `a:prstClr`) round-trip with their original
|
|
816
|
+
* identity rather than being flattened to `<a:srgbClr/>` on save.
|
|
817
|
+
*/
|
|
818
|
+
colorXml?: XmlObject;
|
|
705
819
|
/** True when `a:buNone` explicitly suppresses bullets. */
|
|
706
820
|
none?: boolean;
|
|
707
821
|
/** Picture bullet: relationship ID from `a:buBlip` → `a:blip[@r:embed]`. */
|
|
708
822
|
imageRelId?: string;
|
|
709
823
|
/** Picture bullet: data URL of the embedded image. */
|
|
710
824
|
imageDataUrl?: string;
|
|
825
|
+
/**
|
|
826
|
+
* Raw `<a:buBlip>` XML captured at parse time. Carries the full blipFill
|
|
827
|
+
* subtree (`a:tile`, `a:stretch`, `a:srcRect`, `a:blip > a:extLst`) so the
|
|
828
|
+
* writer can emit the complete original definition rather than the bare
|
|
829
|
+
* `a:blip[@r:embed]` mapping. When set, the writer prefers it over
|
|
830
|
+
* {@link imageRelId} for emission.
|
|
831
|
+
*/
|
|
832
|
+
imageBlipFillXml?: XmlObject;
|
|
711
833
|
/** When true, `<a:buFontTx/>` was specified — inherit the bullet font from
|
|
712
834
|
* the run text, not from a buFont declaration. */
|
|
713
835
|
fontInherit?: boolean;
|
|
@@ -743,6 +865,20 @@ interface TextSegment {
|
|
|
743
865
|
fieldType?: string;
|
|
744
866
|
/** When this segment originated from an `a:fld` element, stores the field GUID. */
|
|
745
867
|
fieldGuid?: string;
|
|
868
|
+
/**
|
|
869
|
+
* Original attribute name used to author the field GUID — `'uuid'` for the
|
|
870
|
+
* `a:fld/@uuid` form authored by some legacy producers, `'id'` for the
|
|
871
|
+
* canonical `a:fld/@id` form. Preserved so the writer round-trips whichever
|
|
872
|
+
* spelling the source used (PowerPoint accepts both). Defaults to `'id'`
|
|
873
|
+
* on save when undefined.
|
|
874
|
+
*/
|
|
875
|
+
fieldGuidAttr?: 'uuid' | 'id';
|
|
876
|
+
/**
|
|
877
|
+
* Raw per-field paragraph properties (`a:fld > a:pPr`). The schema permits
|
|
878
|
+
* `pPr` inside an `a:fld` so the field can carry its own paragraph-level
|
|
879
|
+
* formatting; preserved verbatim on save when present.
|
|
880
|
+
*/
|
|
881
|
+
fieldParagraphPropertiesXml?: XmlObject;
|
|
746
882
|
/** Raw OMML XML node for equation segments (from `a14:m` / `m:oMathPara`). */
|
|
747
883
|
equationXml?: Record<string, unknown>;
|
|
748
884
|
/**
|
|
@@ -752,6 +888,21 @@ interface TextSegment {
|
|
|
752
888
|
equationNumber?: string;
|
|
753
889
|
/** Whether this segment represents a paragraph break rather than renderable text. */
|
|
754
890
|
isParagraphBreak?: boolean;
|
|
891
|
+
/**
|
|
892
|
+
* Whether this segment represents a soft line break (`a:br`) rather than
|
|
893
|
+
* a paragraph terminator. Soft line breaks remain inside the same paragraph
|
|
894
|
+
* but force a line wrap and may carry their own run properties.
|
|
895
|
+
*
|
|
896
|
+
* The renderer should treat the segment text as `"\n"` when present.
|
|
897
|
+
*/
|
|
898
|
+
isLineBreak?: true;
|
|
899
|
+
/**
|
|
900
|
+
* Raw `a:rPr` XML for an `a:br` (soft line break) segment, captured verbatim
|
|
901
|
+
* during parse so the writer can re-emit attributes/colours/fonts that the
|
|
902
|
+
* typed model doesn't represent. Only meaningful when {@link isLineBreak}
|
|
903
|
+
* is `true`.
|
|
904
|
+
*/
|
|
905
|
+
breakRunProperties?: Record<string, unknown>;
|
|
755
906
|
/** Structured bullet info for the first segment of a paragraph. */
|
|
756
907
|
bulletInfo?: BulletInfo;
|
|
757
908
|
/**
|
|
@@ -924,6 +1075,8 @@ interface ShapeStyle {
|
|
|
924
1075
|
lineCap?: 'flat' | 'rnd' | 'sq';
|
|
925
1076
|
/** Compound line type (`a:ln/@cmpd`). */
|
|
926
1077
|
compoundLine?: 'sng' | 'dbl' | 'thickThin' | 'thinThick' | 'tri';
|
|
1078
|
+
/** Pen line alignment (`a:ln/@algn`): `ctr` (centre, default) or `in` (inside). */
|
|
1079
|
+
lineAlignment?: 'ctr' | 'in';
|
|
927
1080
|
shadowColor?: string;
|
|
928
1081
|
shadowBlur?: number;
|
|
929
1082
|
shadowOffsetX?: number;
|
|
@@ -1091,6 +1244,101 @@ interface ShapeStyle {
|
|
|
1091
1244
|
*
|
|
1092
1245
|
* @module pptx-types/image
|
|
1093
1246
|
*/
|
|
1247
|
+
/**
|
|
1248
|
+
* Blend mode for `a:blend` container nodes inside an `a:effectDag` (CT_BlendEffect).
|
|
1249
|
+
*
|
|
1250
|
+
* Per ECMA-376 §20.1.8.10, valid values are: `darken`, `lighten`, `mult`,
|
|
1251
|
+
* `over`, `screen`.
|
|
1252
|
+
*/
|
|
1253
|
+
type EffectDagBlendMode = 'darken' | 'lighten' | 'mult' | 'over' | 'screen';
|
|
1254
|
+
/**
|
|
1255
|
+
* Container node kind inside an `a:effectDag` (CT_EffectContainer @type).
|
|
1256
|
+
*
|
|
1257
|
+
* Per ECMA-376 §20.1.8.20, `sib` (sibling) draws each child independently
|
|
1258
|
+
* over the same source; `tree` (tree) chains effects so each sees the output
|
|
1259
|
+
* of its siblings.
|
|
1260
|
+
*/
|
|
1261
|
+
type EffectDagContainerType = 'sib' | 'tree';
|
|
1262
|
+
/**
|
|
1263
|
+
* Typed model of the directed-acyclic effect graph stored in `a:effectDag`.
|
|
1264
|
+
*
|
|
1265
|
+
* The four "structural" container/transform nodes are typed; any other inner
|
|
1266
|
+
* effect (e.g. `a:outerShdw`, `a:glow`, `a:alphaInv`) is preserved verbatim
|
|
1267
|
+
* as a raw XML object via the {@link EffectDagRawLeaf} variant so we never
|
|
1268
|
+
* have to recurse into the full effect taxonomy.
|
|
1269
|
+
*
|
|
1270
|
+
* @example
|
|
1271
|
+
* ```ts
|
|
1272
|
+
* // <a:effectDag>
|
|
1273
|
+
* // <a:cont type="sib">
|
|
1274
|
+
* // <a:blend blend="mult"><a:cont type="tree" /></a:blend>
|
|
1275
|
+
* // </a:cont>
|
|
1276
|
+
* // </a:effectDag>
|
|
1277
|
+
* const dag: EffectDagContainer = {
|
|
1278
|
+
* kind: "cont",
|
|
1279
|
+
* type: "sib",
|
|
1280
|
+
* children: [{
|
|
1281
|
+
* kind: "blend",
|
|
1282
|
+
* mode: "mult",
|
|
1283
|
+
* container: { kind: "cont", type: "tree", children: [] },
|
|
1284
|
+
* }],
|
|
1285
|
+
* };
|
|
1286
|
+
* ```
|
|
1287
|
+
*/
|
|
1288
|
+
type EffectDagNode = EffectDagContainer | EffectDagBlend | EffectDagXfrm | EffectDagRelOff | EffectDagRawLeaf;
|
|
1289
|
+
/** `a:cont` — CT_EffectContainer. Recursive; mirrors the top-level `effectDag`. */
|
|
1290
|
+
interface EffectDagContainer {
|
|
1291
|
+
kind: 'cont';
|
|
1292
|
+
/** `@type` — `sib` or `tree`. */
|
|
1293
|
+
type: EffectDagContainerType;
|
|
1294
|
+
/** Optional `@name` attribute. */
|
|
1295
|
+
name?: string;
|
|
1296
|
+
/** Ordered children. */
|
|
1297
|
+
children: EffectDagNode[];
|
|
1298
|
+
}
|
|
1299
|
+
/** `a:blend` — CT_BlendEffect. Always wraps a single `a:cont` child. */
|
|
1300
|
+
interface EffectDagBlend {
|
|
1301
|
+
kind: 'blend';
|
|
1302
|
+
/** `@blend` attribute. */
|
|
1303
|
+
mode: EffectDagBlendMode;
|
|
1304
|
+
/** Required child `a:cont` container. */
|
|
1305
|
+
container: EffectDagContainer;
|
|
1306
|
+
}
|
|
1307
|
+
/** `a:xfrmEffect` — CT_TransformEffect. Affine transform with no children. */
|
|
1308
|
+
interface EffectDagXfrm {
|
|
1309
|
+
kind: 'xfrmEffect';
|
|
1310
|
+
/** Horizontal scale, percentage * 1000 (e.g. 100000 = 100%). */
|
|
1311
|
+
sx?: number;
|
|
1312
|
+
/** Vertical scale, percentage * 1000. */
|
|
1313
|
+
sy?: number;
|
|
1314
|
+
/** Horizontal skew, degrees * 60000. */
|
|
1315
|
+
kx?: number;
|
|
1316
|
+
/** Vertical skew, degrees * 60000. */
|
|
1317
|
+
ky?: number;
|
|
1318
|
+
/** Horizontal translation in EMU. */
|
|
1319
|
+
tx?: number;
|
|
1320
|
+
/** Vertical translation in EMU. */
|
|
1321
|
+
ty?: number;
|
|
1322
|
+
}
|
|
1323
|
+
/** `a:relOff` — CT_RelativeOffsetEffect. Relative offset in 1000ths of a percent. */
|
|
1324
|
+
interface EffectDagRelOff {
|
|
1325
|
+
kind: 'relOff';
|
|
1326
|
+
/** Horizontal offset, percentage * 1000. */
|
|
1327
|
+
tx?: number;
|
|
1328
|
+
/** Vertical offset, percentage * 1000. */
|
|
1329
|
+
ty?: number;
|
|
1330
|
+
}
|
|
1331
|
+
/**
|
|
1332
|
+
* Catch-all leaf preserving any non-container effect (e.g. `a:outerShdw`,
|
|
1333
|
+
* `a:glow`, `a:alphaInv`) as raw XML. Re-emitted verbatim on save.
|
|
1334
|
+
*/
|
|
1335
|
+
interface EffectDagRawLeaf {
|
|
1336
|
+
kind: 'raw';
|
|
1337
|
+
/** Local element name without the `a:` prefix (e.g. `outerShdw`, `glow`). */
|
|
1338
|
+
tag: string;
|
|
1339
|
+
/** Raw XML object captured at load — preserved verbatim on save. */
|
|
1340
|
+
xml: Record<string, unknown>;
|
|
1341
|
+
}
|
|
1094
1342
|
/**
|
|
1095
1343
|
* Image recolour/adjustment properties parsed from blip extensions.
|
|
1096
1344
|
*
|
|
@@ -1141,6 +1389,71 @@ interface PptxImageEffects {
|
|
|
1141
1389
|
/** Whether the target colour is fully transparent (alpha = 0). */
|
|
1142
1390
|
clrToTransparent?: boolean;
|
|
1143
1391
|
};
|
|
1392
|
+
/**
|
|
1393
|
+
* Alpha inverse effect (`a:alphaInv`). Inverts the alpha channel; an optional
|
|
1394
|
+
* colour child shifts the inversion baseline.
|
|
1395
|
+
*/
|
|
1396
|
+
alphaInv?: {
|
|
1397
|
+
/** Optional baseline colour (hex). */
|
|
1398
|
+
color?: string;
|
|
1399
|
+
};
|
|
1400
|
+
/** Alpha ceiling (`a:alphaCeiling`) — clamps any non-zero alpha to fully opaque. Boolean flag. */
|
|
1401
|
+
alphaCeiling?: boolean;
|
|
1402
|
+
/** Alpha floor (`a:alphaFloor`) — clamps any non-fully-opaque alpha to fully transparent. Boolean flag. */
|
|
1403
|
+
alphaFloor?: boolean;
|
|
1404
|
+
/**
|
|
1405
|
+
* Alpha modulate (`a:alphaMod`). The schema requires a single `cont` (effect
|
|
1406
|
+
* container) child; we preserve the inner XML opaquely for round-trip.
|
|
1407
|
+
*/
|
|
1408
|
+
alphaMod?: {
|
|
1409
|
+
/** Raw opaque XML for the `a:cont` child to preserve on save. */
|
|
1410
|
+
contRawXml?: Record<string, unknown>;
|
|
1411
|
+
};
|
|
1412
|
+
/** Alpha replace (`a:alphaRepl`) — replaces alpha with the given fixed-percent value (0..100). */
|
|
1413
|
+
alphaRepl?: number;
|
|
1414
|
+
/** Alpha bi-level (`a:alphaBiLevel`) — threshold (0..100) above which alpha becomes fully opaque. */
|
|
1415
|
+
alphaBiLevel?: number;
|
|
1416
|
+
/**
|
|
1417
|
+
* Colour replace (`a:clrRepl`) — replaces all colour information in an image
|
|
1418
|
+
* with the given solid colour. Stores the raw colour child to preserve scheme
|
|
1419
|
+
* colour references and modifiers.
|
|
1420
|
+
*/
|
|
1421
|
+
clrRepl?: {
|
|
1422
|
+
/** Resolved hex colour. */
|
|
1423
|
+
color: string;
|
|
1424
|
+
/** Raw opaque colour XML for round-trip. */
|
|
1425
|
+
rawXml?: Record<string, unknown>;
|
|
1426
|
+
};
|
|
1427
|
+
/** Luminance modulation (`a:lum`) — bright/contrast as fixed percentages (0..100). */
|
|
1428
|
+
lum?: {
|
|
1429
|
+
bright?: number;
|
|
1430
|
+
contrast?: number;
|
|
1431
|
+
};
|
|
1432
|
+
/** HSL modulation (`a:hsl`) — hue (0..360 degrees), saturation/luminance (-100..100). */
|
|
1433
|
+
hsl?: {
|
|
1434
|
+
hue?: number;
|
|
1435
|
+
sat?: number;
|
|
1436
|
+
lum?: number;
|
|
1437
|
+
};
|
|
1438
|
+
/** Image-effect tint (`a:tint` inside blip) — hue (0..360), amount (-100..100). */
|
|
1439
|
+
tint?: {
|
|
1440
|
+
hue?: number;
|
|
1441
|
+
amt?: number;
|
|
1442
|
+
};
|
|
1443
|
+
/**
|
|
1444
|
+
* Fill overlay (`a:fillOverlay`) — overlays a fill on top of the blip.
|
|
1445
|
+
* Stores blend mode and the raw inner fill XML for round-trip.
|
|
1446
|
+
*/
|
|
1447
|
+
fillOverlay?: {
|
|
1448
|
+
blend: 'over' | 'mult' | 'screen' | 'darken' | 'lighten';
|
|
1449
|
+
/** Raw opaque fill XML preserved for round-trip. */
|
|
1450
|
+
fillRawXml?: Record<string, unknown>;
|
|
1451
|
+
};
|
|
1452
|
+
/** Blur (`a:blur`) — radius in EMU and grow flag. */
|
|
1453
|
+
blur?: {
|
|
1454
|
+
rad?: number;
|
|
1455
|
+
grow?: boolean;
|
|
1456
|
+
};
|
|
1144
1457
|
}
|
|
1145
1458
|
/**
|
|
1146
1459
|
* Shape names used for crop-to-shape (CSS `clip-path` equivalent).
|
|
@@ -1205,6 +1518,36 @@ interface PptxImageProperties {
|
|
|
1205
1518
|
/** Crop-to-shape — CSS clip-path shape name. */
|
|
1206
1519
|
cropShape?: PptxCropShape;
|
|
1207
1520
|
}
|
|
1521
|
+
declare module './text' {
|
|
1522
|
+
interface TextStyle {
|
|
1523
|
+
/**
|
|
1524
|
+
* Raw `a:effectDag` XML node from `a:rPr`, preserved verbatim for
|
|
1525
|
+
* round-trip serialisation. Mirrors the shape-level
|
|
1526
|
+
* {@link import('./shape-style').ShapeStyle.effectDagXml} field.
|
|
1527
|
+
*/
|
|
1528
|
+
textEffectDagXml?: XmlObject;
|
|
1529
|
+
/**
|
|
1530
|
+
* Typed effect graph parsed from `textEffectDagXml`. The four structural
|
|
1531
|
+
* container nodes (`a:cont`, `a:blend`, `a:xfrmEffect`, `a:relOff`) are
|
|
1532
|
+
* fully typed; any other leaf effect is captured as
|
|
1533
|
+
* {@link EffectDagRawLeaf} so we never have to recurse into the full
|
|
1534
|
+
* effect taxonomy.
|
|
1535
|
+
*/
|
|
1536
|
+
textEffectDagTree?: EffectDagContainer;
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
declare module './shape-style' {
|
|
1540
|
+
interface ShapeStyle {
|
|
1541
|
+
/**
|
|
1542
|
+
* Typed effect graph parsed from {@link ShapeStyle.effectDagXml}. The four
|
|
1543
|
+
* structural container nodes (`a:cont`, `a:blend`, `a:xfrmEffect`,
|
|
1544
|
+
* `a:relOff`) are fully typed; any other leaf effect (e.g. `a:outerShdw`,
|
|
1545
|
+
* `a:glow`, `a:alphaInv`) is captured as {@link EffectDagRawLeaf} so we
|
|
1546
|
+
* never have to recurse into the full effect taxonomy.
|
|
1547
|
+
*/
|
|
1548
|
+
effectDagTree?: EffectDagContainer;
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1208
1551
|
|
|
1209
1552
|
/**
|
|
1210
1553
|
* Geometry types: adjustment handles, custom geometry points, segments,
|
|
@@ -1341,6 +1684,112 @@ interface CustomGeometryRawData {
|
|
|
1341
1684
|
/** Raw `a:rect` XML content (text rectangle). */
|
|
1342
1685
|
rectXml?: unknown;
|
|
1343
1686
|
}
|
|
1687
|
+
/**
|
|
1688
|
+
* XY-style adjustment handle (`a:ahXY`) on a custom geometry.
|
|
1689
|
+
*
|
|
1690
|
+
* Allows interactive editing of one or two guide values constrained to a
|
|
1691
|
+
* rectangular range. Coordinates are formula references (e.g. `"adj1"`,
|
|
1692
|
+
* `"w/2"`, `"0"`) preserved verbatim so they can re-emit unchanged.
|
|
1693
|
+
*
|
|
1694
|
+
* @example
|
|
1695
|
+
* ```ts
|
|
1696
|
+
* const handle: AdjustHandleXY = {
|
|
1697
|
+
* gdRefX: "adj1",
|
|
1698
|
+
* minX: "0",
|
|
1699
|
+
* maxX: "w",
|
|
1700
|
+
* posX: "adj1",
|
|
1701
|
+
* posY: "h/2",
|
|
1702
|
+
* };
|
|
1703
|
+
* // => satisfies AdjustHandleXY
|
|
1704
|
+
* ```
|
|
1705
|
+
*/
|
|
1706
|
+
interface AdjustHandleXY {
|
|
1707
|
+
/** Guide reference for the X axis (`@_gdRefX`). */
|
|
1708
|
+
gdRefX?: string;
|
|
1709
|
+
/** Guide reference for the Y axis (`@_gdRefY`). */
|
|
1710
|
+
gdRefY?: string;
|
|
1711
|
+
/** Minimum X value, as a formula reference (`@_minX`). */
|
|
1712
|
+
minX?: string;
|
|
1713
|
+
/** Maximum X value (`@_maxX`). */
|
|
1714
|
+
maxX?: string;
|
|
1715
|
+
/** Minimum Y value (`@_minY`). */
|
|
1716
|
+
minY?: string;
|
|
1717
|
+
/** Maximum Y value (`@_maxY`). */
|
|
1718
|
+
maxY?: string;
|
|
1719
|
+
/** Handle position X (formula or literal) from `a:pos/@_x`. */
|
|
1720
|
+
posX?: string;
|
|
1721
|
+
/** Handle position Y from `a:pos/@_y`. */
|
|
1722
|
+
posY?: string;
|
|
1723
|
+
}
|
|
1724
|
+
/**
|
|
1725
|
+
* Polar-style adjustment handle (`a:ahPolar`) on a custom geometry.
|
|
1726
|
+
*
|
|
1727
|
+
* Drives a guide via radial distance and angle rather than XY coordinates.
|
|
1728
|
+
*
|
|
1729
|
+
* @example
|
|
1730
|
+
* ```ts
|
|
1731
|
+
* const handle: AdjustHandlePolar = {
|
|
1732
|
+
* gdRefR: "adj1",
|
|
1733
|
+
* gdRefAng: "adj2",
|
|
1734
|
+
* posX: "wd2",
|
|
1735
|
+
* posY: "hd2",
|
|
1736
|
+
* };
|
|
1737
|
+
* // => satisfies AdjustHandlePolar
|
|
1738
|
+
* ```
|
|
1739
|
+
*/
|
|
1740
|
+
interface AdjustHandlePolar {
|
|
1741
|
+
/** Guide reference for the radial distance (`@_gdRefR`). */
|
|
1742
|
+
gdRefR?: string;
|
|
1743
|
+
/** Guide reference for the angle (`@_gdRefAng`). */
|
|
1744
|
+
gdRefAng?: string;
|
|
1745
|
+
/** Minimum radial value (`@_minR`). */
|
|
1746
|
+
minR?: string;
|
|
1747
|
+
/** Maximum radial value (`@_maxR`). */
|
|
1748
|
+
maxR?: string;
|
|
1749
|
+
/** Minimum angle (`@_minAng`). */
|
|
1750
|
+
minAng?: string;
|
|
1751
|
+
/** Maximum angle (`@_maxAng`). */
|
|
1752
|
+
maxAng?: string;
|
|
1753
|
+
/** Handle position X from `a:pos/@_x`. */
|
|
1754
|
+
posX?: string;
|
|
1755
|
+
/** Handle position Y from `a:pos/@_y`. */
|
|
1756
|
+
posY?: string;
|
|
1757
|
+
}
|
|
1758
|
+
/**
|
|
1759
|
+
* Connection site (`a:cxn`) on a custom geometry.
|
|
1760
|
+
*
|
|
1761
|
+
* Defines a point on a custom shape that connectors may snap to.
|
|
1762
|
+
*
|
|
1763
|
+
* @example
|
|
1764
|
+
* ```ts
|
|
1765
|
+
* const cxn: ConnectionSite = { ang: "0", posX: "0", posY: "hd2" };
|
|
1766
|
+
* // => satisfies ConnectionSite
|
|
1767
|
+
* ```
|
|
1768
|
+
*/
|
|
1769
|
+
interface ConnectionSite {
|
|
1770
|
+
/** Approach angle (`@_ang`) — formula or literal degree-1/60000 value. */
|
|
1771
|
+
ang?: string;
|
|
1772
|
+
/** Site position X from `a:pos/@_x`. */
|
|
1773
|
+
posX?: string;
|
|
1774
|
+
/** Site position Y from `a:pos/@_y`. */
|
|
1775
|
+
posY?: string;
|
|
1776
|
+
}
|
|
1777
|
+
/**
|
|
1778
|
+
* Typed text rectangle (`a:rect`) on a custom geometry.
|
|
1779
|
+
*
|
|
1780
|
+
* Each edge is the formula or literal string preserved from the source XML
|
|
1781
|
+
* (`"l"`, `"t"`, `"r"`, `"b"`, or any guide name / formula).
|
|
1782
|
+
*/
|
|
1783
|
+
interface CustomGeometryTextRect {
|
|
1784
|
+
/** Left edge formula reference (`@_l`). */
|
|
1785
|
+
l?: string;
|
|
1786
|
+
/** Top edge (`@_t`). */
|
|
1787
|
+
t?: string;
|
|
1788
|
+
/** Right edge (`@_r`). */
|
|
1789
|
+
r?: string;
|
|
1790
|
+
/** Bottom edge (`@_b`). */
|
|
1791
|
+
b?: string;
|
|
1792
|
+
}
|
|
1344
1793
|
/**
|
|
1345
1794
|
* Custom (non-preset) geometry path — only on shapes and pictures.
|
|
1346
1795
|
*
|
|
@@ -1368,6 +1817,25 @@ interface PptxCustomPathProperties {
|
|
|
1368
1817
|
customGeometryPaths?: CustomGeometryPath[];
|
|
1369
1818
|
/** Raw a:gdLst/a:ahLst/a:cxnLst/a:rect XML preserved for round-trip serialization. */
|
|
1370
1819
|
customGeometryRawData?: CustomGeometryRawData;
|
|
1820
|
+
/**
|
|
1821
|
+
* Typed XY adjustment handles parsed from `a:custGeom/a:ahLst/a:ahXY`.
|
|
1822
|
+
* SDK-built shapes can populate this and the writer will emit `<a:ahXY>` entries
|
|
1823
|
+
* even when no raw XML was preserved.
|
|
1824
|
+
*/
|
|
1825
|
+
customGeometryAdjustHandlesXY?: AdjustHandleXY[];
|
|
1826
|
+
/**
|
|
1827
|
+
* Typed polar adjustment handles parsed from `a:custGeom/a:ahLst/a:ahPolar`.
|
|
1828
|
+
*/
|
|
1829
|
+
customGeometryAdjustHandlesPolar?: AdjustHandlePolar[];
|
|
1830
|
+
/**
|
|
1831
|
+
* Typed connection sites parsed from `a:custGeom/a:cxnLst/a:cxn`.
|
|
1832
|
+
*/
|
|
1833
|
+
customGeometryConnectionSites?: ConnectionSite[];
|
|
1834
|
+
/**
|
|
1835
|
+
* Typed text rectangle parsed from `a:custGeom/a:rect`. When present this is
|
|
1836
|
+
* preferred over {@link customGeometryRawData}'s `rectXml` on save.
|
|
1837
|
+
*/
|
|
1838
|
+
customGeometryTextRect?: CustomGeometryTextRect;
|
|
1371
1839
|
}
|
|
1372
1840
|
|
|
1373
1841
|
/**
|
|
@@ -1385,7 +1853,7 @@ interface PptxCustomPathProperties {
|
|
|
1385
1853
|
* // => "bar" — one of: "bar" | "line" | "pie" | "doughnut" | "area" | "scatter" | …
|
|
1386
1854
|
* ```
|
|
1387
1855
|
*/
|
|
1388
|
-
type PptxChartType = 'bar' | 'line' | 'pie' | 'doughnut' | 'area' | 'scatter' | 'bubble' | 'radar' | 'stock' | 'bar3D' | 'line3D' | 'pie3D' | 'area3D' | 'surface' | 'histogram' | 'waterfall' | 'funnel' | 'treemap' | 'sunburst' | 'boxWhisker' | 'regionMap' | 'combo' | 'unknown';
|
|
1856
|
+
type PptxChartType = 'bar' | 'line' | 'pie' | 'ofPie' | 'doughnut' | 'area' | 'scatter' | 'bubble' | 'radar' | 'stock' | 'bar3D' | 'line3D' | 'pie3D' | 'area3D' | 'surface' | 'histogram' | 'waterfall' | 'funnel' | 'treemap' | 'sunburst' | 'boxWhisker' | 'regionMap' | 'combo' | 'unknown';
|
|
1389
1857
|
/**
|
|
1390
1858
|
* Supported trendline regression types.
|
|
1391
1859
|
*
|
|
@@ -1666,6 +2134,69 @@ interface PptxExternalData {
|
|
|
1666
2134
|
/** Raw binary data of the embedded xlsx workbook (from ppt/embeddings/). */
|
|
1667
2135
|
embeddedWorkbookData?: Uint8Array;
|
|
1668
2136
|
}
|
|
2137
|
+
/**
|
|
2138
|
+
* Options specific to the OOXML "Pie of Pie" / "Bar of Pie" chart
|
|
2139
|
+
* (`c:ofPieChart`, ECMA-376 §21.2.2.126 / CT_OfPieChart).
|
|
2140
|
+
*
|
|
2141
|
+
* The primary discriminator is {@link ofPieType}: `"pie"` produces a
|
|
2142
|
+
* pie-of-pie chart whose secondary plot is itself a pie, while `"bar"`
|
|
2143
|
+
* produces a bar-of-pie chart whose secondary plot is a horizontal bar.
|
|
2144
|
+
*
|
|
2145
|
+
* - {@link splitType} chooses the split rule.
|
|
2146
|
+
* - {@link splitPos} is the threshold value used by `pos`/`val`/`percent`.
|
|
2147
|
+
* - {@link secondPieSize} controls the secondary plot's size (5–200%).
|
|
2148
|
+
* - {@link serLines} toggles the leader lines connecting the plots.
|
|
2149
|
+
* - {@link gapWidth} is the gap between the plots in percent (0–500).
|
|
2150
|
+
*/
|
|
2151
|
+
interface PptxChartOfPieOptions {
|
|
2152
|
+
ofPieType: 'pie' | 'bar';
|
|
2153
|
+
splitType?: 'auto' | 'cust' | 'percent' | 'pos' | 'val';
|
|
2154
|
+
splitPos?: number;
|
|
2155
|
+
custSplit?: number[];
|
|
2156
|
+
secondPieSize?: number;
|
|
2157
|
+
serLines?: boolean;
|
|
2158
|
+
gapWidth?: number;
|
|
2159
|
+
}
|
|
2160
|
+
/**
|
|
2161
|
+
* 3D viewing parameters for a chart (`c:view3D`, ECMA-376 §21.2.2.228 /
|
|
2162
|
+
* CT_View3D).
|
|
2163
|
+
*
|
|
2164
|
+
* All fields are optional and round-trip verbatim.
|
|
2165
|
+
*
|
|
2166
|
+
* - {@link rotX} — X-axis rotation in degrees (-90…90).
|
|
2167
|
+
* - {@link rotY} — Y-axis rotation in degrees (0…360).
|
|
2168
|
+
* - {@link depthPercent} — chart depth as a percentage of base width.
|
|
2169
|
+
* - {@link rAngAx} — `true` if axes meet at right angles.
|
|
2170
|
+
* - {@link perspective} — perspective angle in degrees (0…240).
|
|
2171
|
+
* - {@link hPercent} — height as a percentage of chart width.
|
|
2172
|
+
*/
|
|
2173
|
+
interface PptxChartView3D {
|
|
2174
|
+
rotX?: number;
|
|
2175
|
+
rotY?: number;
|
|
2176
|
+
depthPercent?: number;
|
|
2177
|
+
rAngAx?: boolean;
|
|
2178
|
+
perspective?: number;
|
|
2179
|
+
hPercent?: number;
|
|
2180
|
+
}
|
|
2181
|
+
/**
|
|
2182
|
+
* Chart "chrome" flags from `c:chart` that round-trip cleanly even when
|
|
2183
|
+
* rendering ignores them.
|
|
2184
|
+
*
|
|
2185
|
+
* - {@link autoTitleDeleted} — `c:autoTitleDeleted/@val`. Suppresses the
|
|
2186
|
+
* auto-generated title for single-series charts.
|
|
2187
|
+
* - {@link dispBlanksAs} — `c:dispBlanksAs/@val`. How blank cells
|
|
2188
|
+
* render: `"gap"`, `"zero"`, or `"span"`.
|
|
2189
|
+
* - {@link showDLblsOverMax} — `c:showDLblsOverMax/@val`. Keeps data
|
|
2190
|
+
* labels visible for points exceeding the value-axis maximum.
|
|
2191
|
+
*
|
|
2192
|
+
* `c:plotVisOnly` lives on {@link PptxChartData.plotVisibleOnly} and is
|
|
2193
|
+
* intentionally not duplicated here.
|
|
2194
|
+
*/
|
|
2195
|
+
interface PptxChartChrome {
|
|
2196
|
+
autoTitleDeleted?: boolean;
|
|
2197
|
+
dispBlanksAs?: 'gap' | 'zero' | 'span';
|
|
2198
|
+
showDLblsOverMax?: boolean;
|
|
2199
|
+
}
|
|
1669
2200
|
/** Parsed data extracted from an embedded xlsx workbook. */
|
|
1670
2201
|
interface PptxEmbeddedWorkbookData {
|
|
1671
2202
|
/** Category labels from the first column/row. */
|
|
@@ -1759,6 +2290,52 @@ interface PptxChartData {
|
|
|
1759
2290
|
* - `"acrossLinear"` — gradient across series
|
|
1760
2291
|
*/
|
|
1761
2292
|
colorMethod?: 'cycle' | 'withinLinear' | 'acrossLinear';
|
|
2293
|
+
/**
|
|
2294
|
+
* Pie-of-pie / Bar-of-pie options (`c:ofPieChart`, CT_OfPieChart).
|
|
2295
|
+
*
|
|
2296
|
+
* Present only when {@link chartType} is `"ofPie"`. Carries the split
|
|
2297
|
+
* configuration, secondary plot size, and serLines flag so that an
|
|
2298
|
+
* `ofPieChart` element can be re-emitted on save with full fidelity.
|
|
2299
|
+
*/
|
|
2300
|
+
ofPieOptions?: PptxChartOfPieOptions;
|
|
2301
|
+
/**
|
|
2302
|
+
* 3D viewing parameters (`c:view3D`, CT_View3D).
|
|
2303
|
+
*
|
|
2304
|
+
* Parsed from and emitted to `c:chart/c:view3D`. Absent when the
|
|
2305
|
+
* chart XML has no `c:view3D` element.
|
|
2306
|
+
*/
|
|
2307
|
+
view3D?: PptxChartView3D;
|
|
2308
|
+
/**
|
|
2309
|
+
* Top-level chart chrome flags (`c:autoTitleDeleted`,
|
|
2310
|
+
* `c:dispBlanksAs`, `c:showDLblsOverMax`).
|
|
2311
|
+
*
|
|
2312
|
+
* Each flag is omitted from the emitted XML when absent on the
|
|
2313
|
+
* source data, so absence does not produce empty `<c:…/>` placeholders.
|
|
2314
|
+
*/
|
|
2315
|
+
chartChrome?: PptxChartChrome;
|
|
2316
|
+
/**
|
|
2317
|
+
* Raw `c:userShapes` XML subtree (a drawing tree) preserved verbatim.
|
|
2318
|
+
*
|
|
2319
|
+
* `c:userShapes` references a separate drawing part containing
|
|
2320
|
+
* shapes drawn over the chart. The reference is preserved as-is so
|
|
2321
|
+
* that round-trip save re-emits the original element without
|
|
2322
|
+
* attempting to parse the nested drawing tree.
|
|
2323
|
+
*/
|
|
2324
|
+
userShapesXml?: unknown;
|
|
2325
|
+
/**
|
|
2326
|
+
* Raw `c:pivotFmts` XML subtree preserved verbatim.
|
|
2327
|
+
*
|
|
2328
|
+
* `c:pivotFmts` carries a list of `c:pivotFmt` formatting overrides
|
|
2329
|
+
* for charts whose data originates from a PivotTable. Preserved
|
|
2330
|
+
* verbatim for round-trip fidelity.
|
|
2331
|
+
*/
|
|
2332
|
+
pivotFmtsXml?: unknown;
|
|
2333
|
+
/**
|
|
2334
|
+
* Color-map override (`c:clrMapOvr`) carrying 12 attributes that
|
|
2335
|
+
* remap theme colour roles for this chart only. Preserved as a flat
|
|
2336
|
+
* `attribute → value` map for round-trip fidelity.
|
|
2337
|
+
*/
|
|
2338
|
+
clrMapOvr?: Record<string, string>;
|
|
1762
2339
|
}
|
|
1763
2340
|
|
|
1764
2341
|
/**
|
|
@@ -2072,8 +2649,8 @@ interface PptxTableCellStyle {
|
|
|
2072
2649
|
borderRightColor?: string;
|
|
2073
2650
|
align?: 'left' | 'center' | 'right' | 'justify';
|
|
2074
2651
|
vAlign?: 'top' | 'middle' | 'bottom';
|
|
2075
|
-
/** Text direction from `a:tcPr/@vert
|
|
2076
|
-
textDirection?: '
|
|
2652
|
+
/** Text direction from `a:tcPr/@vert` (spec values from CT_TextVerticalType). */
|
|
2653
|
+
textDirection?: 'vert' | 'vert270' | 'eaVert' | 'wordArtVert' | 'wordArtVertRtl' | 'mongolianVert';
|
|
2077
2654
|
/** Cell left margin in px (from a:tcPr > a:tcMar > a:marL). */
|
|
2078
2655
|
marginLeft?: number;
|
|
2079
2656
|
/** Cell right margin in px. */
|
|
@@ -2172,6 +2749,14 @@ interface PptxTableCell {
|
|
|
2172
2749
|
vMerge?: boolean;
|
|
2173
2750
|
/** Whether this cell is horizontally merged with the cell to the left (gridSpan continuation). */
|
|
2174
2751
|
hMerge?: boolean;
|
|
2752
|
+
/**
|
|
2753
|
+
* Opaque round-trip storage for `a:tcPr` attributes that don't yet have
|
|
2754
|
+
* typed equivalents on {@link PptxTableCellStyle} (e.g. `horzOverflow`,
|
|
2755
|
+
* `anchorCtr`, `headers`, `hideSlicers`, `slicerCacheId`). Keys are the
|
|
2756
|
+
* raw XML attribute names without the `@_` prefix used by
|
|
2757
|
+
* fast-xml-parser. Re-emitted verbatim by the save writer when present.
|
|
2758
|
+
*/
|
|
2759
|
+
extraAttributes?: Record<string, string>;
|
|
2175
2760
|
}
|
|
2176
2761
|
/**
|
|
2177
2762
|
* A single table row with an optional height and an array of cells.
|
|
@@ -2235,6 +2820,8 @@ interface PptxTableData {
|
|
|
2235
2820
|
bandRowCycle?: number;
|
|
2236
2821
|
/** Number of columns per banding group (default 1). */
|
|
2237
2822
|
bandColCycle?: number;
|
|
2823
|
+
/** Right-to-left table layout from `a:tblPr/@rtl`. */
|
|
2824
|
+
rtl?: boolean;
|
|
2238
2825
|
}
|
|
2239
2826
|
/**
|
|
2240
2827
|
* A single fill reference within a table style section.
|
|
@@ -2288,11 +2875,26 @@ interface ParsedTableStyleText {
|
|
|
2288
2875
|
/** Font colour shade (0-100 000). */
|
|
2289
2876
|
fontShade?: number;
|
|
2290
2877
|
}
|
|
2878
|
+
/**
|
|
2879
|
+
* Table background style (CT_TableBackgroundStyle, ECMA-376 §21.1.3.7).
|
|
2880
|
+
*
|
|
2881
|
+
* Corresponds to the `<a:tblBg>` child of `<a:tblStyle>`. Currently
|
|
2882
|
+
* captures only the resolved scheme-fill colour (verbatim XML for fill
|
|
2883
|
+
* / effect references is preserved separately by the save path).
|
|
2884
|
+
*/
|
|
2885
|
+
interface ParsedTableBackground {
|
|
2886
|
+
/** Solid fill (resolved from `a:fill > a:solidFill > a:schemeClr`). */
|
|
2887
|
+
fill?: ParsedTableStyleFill;
|
|
2888
|
+
/** Has an `a:effectLst` child that should be round-tripped. */
|
|
2889
|
+
hasEffectLst?: boolean;
|
|
2890
|
+
}
|
|
2291
2891
|
interface ParsedTableStyleEntry {
|
|
2292
2892
|
styleId: string;
|
|
2293
2893
|
styleName?: string;
|
|
2294
2894
|
/** Dominant accent key derived from fills (e.g. `accent1`). */
|
|
2295
2895
|
accentKey?: string;
|
|
2896
|
+
/** Table-level background (`<a:tblBg>`). */
|
|
2897
|
+
tableBackground?: ParsedTableBackground;
|
|
2296
2898
|
wholeTblFill?: ParsedTableStyleFill;
|
|
2297
2899
|
band1HFill?: ParsedTableStyleFill;
|
|
2298
2900
|
band2HFill?: ParsedTableStyleFill;
|
|
@@ -2302,6 +2904,11 @@ interface ParsedTableStyleEntry {
|
|
|
2302
2904
|
lastRowFill?: ParsedTableStyleFill;
|
|
2303
2905
|
firstColFill?: ParsedTableStyleFill;
|
|
2304
2906
|
lastColFill?: ParsedTableStyleFill;
|
|
2907
|
+
/** Corner cell fills (`<a:seCell>`, `<a:swCell>`, `<a:neCell>`, `<a:nwCell>`). */
|
|
2908
|
+
seCellFill?: ParsedTableStyleFill;
|
|
2909
|
+
swCellFill?: ParsedTableStyleFill;
|
|
2910
|
+
neCellFill?: ParsedTableStyleFill;
|
|
2911
|
+
nwCellFill?: ParsedTableStyleFill;
|
|
2305
2912
|
/** Per-role text styling from a:tcTxStyle. */
|
|
2306
2913
|
wholeTblText?: ParsedTableStyleText;
|
|
2307
2914
|
firstRowText?: ParsedTableStyleText;
|
|
@@ -2312,6 +2919,10 @@ interface ParsedTableStyleEntry {
|
|
|
2312
2919
|
band2HText?: ParsedTableStyleText;
|
|
2313
2920
|
band1VText?: ParsedTableStyleText;
|
|
2314
2921
|
band2VText?: ParsedTableStyleText;
|
|
2922
|
+
seCellText?: ParsedTableStyleText;
|
|
2923
|
+
swCellText?: ParsedTableStyleText;
|
|
2924
|
+
neCellText?: ParsedTableStyleText;
|
|
2925
|
+
nwCellText?: ParsedTableStyleText;
|
|
2315
2926
|
}
|
|
2316
2927
|
/**
|
|
2317
2928
|
* Map of GUID → table style entry.
|
|
@@ -2353,7 +2964,7 @@ type ParsedTableStyleMap = Record<string, ParsedTableStyleEntry>;
|
|
|
2353
2964
|
* // => "morph" — one of 40+ transition effects
|
|
2354
2965
|
* ```
|
|
2355
2966
|
*/
|
|
2356
|
-
type PptxTransitionType = 'none' | 'cut' | 'fade' | 'push' | 'wipe' | 'split' | 'randomBar' | 'blinds' | 'checker' | 'circle' | 'comb' | 'cover' | 'diamond' | 'dissolve' | 'plus' | 'pull' | 'random' | 'strips' | 'uncover' | 'wedge' | 'wheel' | 'zoom' | 'newsflash' | 'morph' | 'conveyor' | 'doors' | 'ferris' | 'flash' | 'flythrough' | 'gallery' | 'glitter' | 'honeycomb' | 'pan' | 'prism' | 'reveal' | 'ripple' | 'shred' | 'switch' | 'vortex' | 'warp' | 'wheelReverse' | 'window';
|
|
2967
|
+
type PptxTransitionType = 'none' | 'cut' | 'fade' | 'push' | 'wipe' | 'split' | 'randomBar' | 'blinds' | 'checker' | 'circle' | 'comb' | 'cover' | 'diamond' | 'dissolve' | 'plus' | 'pull' | 'random' | 'strips' | 'uncover' | 'wedge' | 'wheel' | 'zoom' | 'newsflash' | 'morph' | 'conveyor' | 'doors' | 'ferris' | 'flash' | 'flythrough' | 'gallery' | 'glitter' | 'honeycomb' | 'pan' | 'prism' | 'reveal' | 'ripple' | 'shred' | 'switch' | 'vortex' | 'warp' | 'wheelReverse' | 'window' | 'cube' | 'flip' | 'rotate' | 'orbit';
|
|
2357
2968
|
/** Cardinal direction tokens from OOXML transition `@_dir`. */
|
|
2358
2969
|
type PptxTransitionDirection4 = 'l' | 'r' | 'u' | 'd';
|
|
2359
2970
|
/** 8-way direction tokens (cardinal + diagonal) for cover/uncover. */
|
|
@@ -2400,6 +3011,11 @@ interface PptxSlideTransition {
|
|
|
2400
3011
|
soundPath?: string;
|
|
2401
3012
|
/** Human-readable sound file name (extracted from soundPath). */
|
|
2402
3013
|
soundFileName?: string;
|
|
3014
|
+
/**
|
|
3015
|
+
* When true, the transition stops the currently-playing sound (OOXML `p:sndAc/p:endSnd`).
|
|
3016
|
+
* Mutually exclusive with `soundRId`/`soundPath` (which use `p:stSnd`).
|
|
3017
|
+
*/
|
|
3018
|
+
stopSound?: boolean;
|
|
2403
3019
|
/** Preserved sound-action XML node from `p:sndAc` for lossless round-trip. */
|
|
2404
3020
|
rawSoundAction?: XmlObject;
|
|
2405
3021
|
/** Preserved extension-list XML node from `p:extLst` within the transition for lossless round-trip. */
|
|
@@ -2429,6 +3045,13 @@ type PptxAnimationTimingCurve = 'ease' | 'ease-in' | 'ease-out' | 'linear';
|
|
|
2429
3045
|
type PptxAnimationRepeatMode = 'untilNextClick' | 'untilEndOfSlide';
|
|
2430
3046
|
/** Animation trigger type from OOXML `p:cTn`. */
|
|
2431
3047
|
type PptxAnimationTrigger = 'onClick' | 'onShapeClick' | 'onHover' | 'afterPrevious' | 'withPrevious' | 'afterDelay';
|
|
3048
|
+
/**
|
|
3049
|
+
* Native animation kind. The historic shape-targeted preset animations are
|
|
3050
|
+
* implicitly the default kind (`undefined`). Media animations (`p:audio`,
|
|
3051
|
+
* `p:video`) emit dedicated entries so playback order on the slide timeline
|
|
3052
|
+
* is preserved alongside other animations.
|
|
3053
|
+
*/
|
|
3054
|
+
type PptxNativeAnimationKind = 'media';
|
|
2432
3055
|
/**
|
|
2433
3056
|
* Parsed native animation record from `p:timing / p:tnLst`.
|
|
2434
3057
|
*
|
|
@@ -2470,12 +3093,32 @@ interface PptxNativeAnimation {
|
|
|
2470
3093
|
motionOrigin?: string;
|
|
2471
3094
|
/** Whether the element auto-rotates to follow the motion path tangent (`p:animMotion/@rAng` = "0"). */
|
|
2472
3095
|
motionPathRotateAuto?: boolean;
|
|
2473
|
-
/**
|
|
3096
|
+
/** Path edit mode from `p:animMotion/@pathEditMode` (e.g. "relative", "fixed"). */
|
|
3097
|
+
motionPathEditMode?: string;
|
|
3098
|
+
/** Comma-separated point-types string from `p:animMotion/@ptsTypes`. */
|
|
3099
|
+
motionPtsTypes?: string;
|
|
3100
|
+
/** Rotation angle in degrees for `p:animRot/@by` (converted from 60000ths). */
|
|
2474
3101
|
rotationBy?: number;
|
|
2475
|
-
/**
|
|
3102
|
+
/** Starting rotation angle in degrees for `p:animRot/@from` (converted from 60000ths). */
|
|
3103
|
+
rotationFrom?: number;
|
|
3104
|
+
/** Ending rotation angle in degrees for `p:animRot/@to` (converted from 60000ths). */
|
|
3105
|
+
rotationTo?: number;
|
|
3106
|
+
/** X scale factor (percentage / 100) for `p:animScale/p:by/@x`. */
|
|
2476
3107
|
scaleByX?: number;
|
|
2477
|
-
/** Y scale factor (percentage / 100) for `p:animScale`. */
|
|
3108
|
+
/** Y scale factor (percentage / 100) for `p:animScale/p:by/@y`. */
|
|
2478
3109
|
scaleByY?: number;
|
|
3110
|
+
/** Starting X scale factor for `p:animScale/p:from/@x`. */
|
|
3111
|
+
scaleFromX?: number;
|
|
3112
|
+
/** Starting Y scale factor for `p:animScale/p:from/@y`. */
|
|
3113
|
+
scaleFromY?: number;
|
|
3114
|
+
/** Ending X scale factor for `p:animScale/p:to/@x`. */
|
|
3115
|
+
scaleToX?: number;
|
|
3116
|
+
/** Ending Y scale factor for `p:animScale/p:to/@y`. */
|
|
3117
|
+
scaleToY?: number;
|
|
3118
|
+
/** Whether `p:animScale/@zoomContents` was set ("1"/"true"). */
|
|
3119
|
+
scaleZoomContents?: boolean;
|
|
3120
|
+
/** Parsed `p:tav` keyframes from `p:tavLst` (CT_TLAnimVariantList). */
|
|
3121
|
+
keyframes?: PptxAnimationKeyframe[];
|
|
2479
3122
|
/** Repeat count (e.g. `2`, `Infinity` for indefinite). */
|
|
2480
3123
|
repeatCount?: number;
|
|
2481
3124
|
/** Whether the animation plays in reverse after completion. */
|
|
@@ -2510,6 +3153,73 @@ interface PptxNativeAnimation {
|
|
|
2510
3153
|
commandString?: string;
|
|
2511
3154
|
/** Iteration configuration from `p:iterate`. */
|
|
2512
3155
|
iterate?: PptxAnimationIterate;
|
|
3156
|
+
/**
|
|
3157
|
+
* Discriminator for non-preset animation kinds. When `undefined`, the
|
|
3158
|
+
* entry represents the default shape-effect animation. The `'media'`
|
|
3159
|
+
* kind represents a `p:audio` / `p:video` timing node, captured here so
|
|
3160
|
+
* playback order in the timeline is preserved alongside other animations.
|
|
3161
|
+
*/
|
|
3162
|
+
kind?: PptxNativeAnimationKind;
|
|
3163
|
+
/**
|
|
3164
|
+
* For `kind === 'media'`, identifies whether this is an audio or video
|
|
3165
|
+
* media node so writers know which OOXML element to re-emit.
|
|
3166
|
+
*/
|
|
3167
|
+
mediaType?: 'audio' | 'video';
|
|
3168
|
+
/**
|
|
3169
|
+
* SmartArt build attribute (`p:bldDgm/@bld`) when this animation is
|
|
3170
|
+
* associated with a SmartArt diagram build. Common values include
|
|
3171
|
+
* `whole`, `one`, `lvlOne`, `lvlAtOnce`.
|
|
3172
|
+
*/
|
|
3173
|
+
smartArtBuild?: string;
|
|
3174
|
+
/**
|
|
3175
|
+
* Graphic-frame build attribute (`p:bldGraphic/@bld`) when this animation
|
|
3176
|
+
* is associated with a generic graphic frame build (charts, tables, etc.
|
|
3177
|
+
* that aren't OLE charts).
|
|
3178
|
+
*/
|
|
3179
|
+
graphicBuild?: string;
|
|
3180
|
+
/**
|
|
3181
|
+
* Opaque map of `p:cTn` attributes that don't have a typed home on this
|
|
3182
|
+
* interface but must round-trip through parse → save. Keys are stored
|
|
3183
|
+
* verbatim including the `@_` prefix used by the underlying XML parser
|
|
3184
|
+
* (e.g. `@_evtFilter`, `@_display`, `@_masterRel`, `@_nodePh`,
|
|
3185
|
+
* `@_endSync`, `@_progress`). The `subTnLst` child element is also
|
|
3186
|
+
* preserved here under the literal key `p:subTnLst`. The `afterEffect`
|
|
3187
|
+
* attribute is surfaced separately as a typed boolean ({@link afterEffect})
|
|
3188
|
+
* because it changes write semantics for subsequent timing nodes.
|
|
3189
|
+
*/
|
|
3190
|
+
cTnAttributes?: Record<string, unknown>;
|
|
3191
|
+
/**
|
|
3192
|
+
* Whether the OOXML `p:cTn/@afterEffect` flag is set. Indicates this node
|
|
3193
|
+
* runs after the parent effect's main body has completed; affects how
|
|
3194
|
+
* subsequent peer nodes are sequenced when serialised back to OOXML.
|
|
3195
|
+
*/
|
|
3196
|
+
afterEffect?: boolean;
|
|
3197
|
+
}
|
|
3198
|
+
/**
|
|
3199
|
+
* Single keyframe parsed from a `p:tav` element (CT_TLTimeAnimateValue).
|
|
3200
|
+
*
|
|
3201
|
+
* Each entry in a `p:tavLst` has a time fraction (`@_tm`, in 1000ths of the
|
|
3202
|
+
* total duration; or the literal "indefinite" / "large") and a typed value
|
|
3203
|
+
* child under `p:val/p:strVal|p:boolVal|p:intVal|p:fltVal|p:clrVal`.
|
|
3204
|
+
*
|
|
3205
|
+
* @see ECMA-376 §19.5.30 CT_TLAnimVariantList / §19.5.92 CT_TLTimeAnimateValue
|
|
3206
|
+
*/
|
|
3207
|
+
interface PptxAnimationKeyframe {
|
|
3208
|
+
/**
|
|
3209
|
+
* Time fraction. A finite number is the OOXML `@_tm` integer (0–100000
|
|
3210
|
+
* for percentage, where 100000 = 100% of duration). A string preserves
|
|
3211
|
+
* special tokens ("indefinite", "large").
|
|
3212
|
+
*/
|
|
3213
|
+
tm: number | string;
|
|
3214
|
+
/** Decoded keyframe value. */
|
|
3215
|
+
value: string | boolean | number;
|
|
3216
|
+
/** Discriminant indicating which `p:val` child carried the value. */
|
|
3217
|
+
valueType: 'str' | 'bool' | 'int' | 'flt' | 'clr';
|
|
3218
|
+
/**
|
|
3219
|
+
* Optional formula carried on `p:tav/@_fmla`. Preserved for round-trip
|
|
3220
|
+
* fidelity; consumers may use it to drive computed animation values.
|
|
3221
|
+
*/
|
|
3222
|
+
fmla?: string;
|
|
2513
3223
|
}
|
|
2514
3224
|
/** Color animation data parsed from `p:animClr`. */
|
|
2515
3225
|
interface PptxColorAnimation {
|
|
@@ -2517,11 +3227,22 @@ interface PptxColorAnimation {
|
|
|
2517
3227
|
colorSpace: 'hsl' | 'rgb';
|
|
2518
3228
|
/** Direction for HSL interpolation: "cw" (clockwise) or "ccw". */
|
|
2519
3229
|
direction?: 'cw' | 'ccw';
|
|
3230
|
+
/**
|
|
3231
|
+
* Optional `p:animClr/@path` value preserved for round-trip. When set,
|
|
3232
|
+
* the colour sweep follows a path-based interpolation rather than the
|
|
3233
|
+
* straight cw/ccw arc. ECMA-376 §19.5.13 documents this attribute as a
|
|
3234
|
+
* companion to `@dir` for HSL colour-space animations.
|
|
3235
|
+
*/
|
|
3236
|
+
path?: string;
|
|
2520
3237
|
/** Starting color as hex string. */
|
|
2521
3238
|
fromColor?: string;
|
|
2522
3239
|
/** Ending color as hex string. */
|
|
2523
3240
|
toColor?: string;
|
|
2524
|
-
/**
|
|
3241
|
+
/**
|
|
3242
|
+
* Color delta (for "by" animations) as hex string. For HSL colour-space
|
|
3243
|
+
* animations the value encodes a delta over hue/sat/lum and is preserved
|
|
3244
|
+
* verbatim from the source.
|
|
3245
|
+
*/
|
|
2525
3246
|
byColor?: string;
|
|
2526
3247
|
/**
|
|
2527
3248
|
* Target attribute from `p:attrNameLst` (e.g. "fillcolor", "style.color",
|
|
@@ -2635,6 +3356,13 @@ interface PptxElementAnimation {
|
|
|
2635
3356
|
afterAnimationColor?: string;
|
|
2636
3357
|
/** SVG motion path string for custom motion path animations. */
|
|
2637
3358
|
motionPath?: string;
|
|
3359
|
+
/**
|
|
3360
|
+
* Path edit mode for `p:animMotion/@pathEditMode`. Defaults to "relative"
|
|
3361
|
+
* when emitted without an explicit value.
|
|
3362
|
+
*/
|
|
3363
|
+
motionPathEditMode?: string;
|
|
3364
|
+
/** Comma-separated point-types string for `p:animMotion/@ptsTypes`. */
|
|
3365
|
+
motionPtsTypes?: string;
|
|
2638
3366
|
/** Sound relationship ID to play when animation triggers (`p:stSnd`). */
|
|
2639
3367
|
soundRId?: string;
|
|
2640
3368
|
/** Resolved sound file path from relationship. */
|
|
@@ -3133,6 +3861,16 @@ interface PptxElementBase {
|
|
|
3133
3861
|
actionHover?: PptxAction;
|
|
3134
3862
|
/** Shape lock attributes parsed from `p:cNvSpPr/a:spLocks`. */
|
|
3135
3863
|
locks?: PptxShapeLocks;
|
|
3864
|
+
/**
|
|
3865
|
+
* Opaque `<a:ext>` children captured from the shape's `<a:extLst>` whose
|
|
3866
|
+
* URI is not recognised by a typed extractor (hidden fill/line, image
|
|
3867
|
+
* effects, …). Preserved verbatim and re-emitted on save so unknown
|
|
3868
|
+
* vendor extensions survive a round-trip.
|
|
3869
|
+
*
|
|
3870
|
+
* Mirrors the existing `effectDagXml` / `endParaRunProperties` raw-XML
|
|
3871
|
+
* preservation pattern.
|
|
3872
|
+
*/
|
|
3873
|
+
extLstXml?: XmlObject[];
|
|
3136
3874
|
}
|
|
3137
3875
|
/**
|
|
3138
3876
|
* Text content mixin — present on text boxes and shapes.
|
|
@@ -3271,20 +4009,6 @@ interface PlaceholderDefaults {
|
|
|
3271
4009
|
promptText?: string;
|
|
3272
4010
|
}
|
|
3273
4011
|
|
|
3274
|
-
/**
|
|
3275
|
-
* Concrete element types (one per `type` discriminant) and the
|
|
3276
|
-
* {@link PptxElement} discriminated union.
|
|
3277
|
-
*
|
|
3278
|
-
* Narrow on `element.type` to access variant-specific properties:
|
|
3279
|
-
* ```ts
|
|
3280
|
-
* if (element.type === "image") {
|
|
3281
|
-
* console.log(element.imageData); // ImagePptxElement-only
|
|
3282
|
-
* }
|
|
3283
|
-
* ```
|
|
3284
|
-
*
|
|
3285
|
-
* @module pptx-types/elements
|
|
3286
|
-
*/
|
|
3287
|
-
|
|
3288
4012
|
/**
|
|
3289
4013
|
* A text box — a plain rectangle containing text, typically with no
|
|
3290
4014
|
* visible fill or stroke.
|
|
@@ -3369,6 +4093,21 @@ interface ImagePptxElement extends PptxElementBase, PptxShapeProperties, PptxCus
|
|
|
3369
4093
|
interface PicturePptxElement extends PptxElementBase, PptxShapeProperties, PptxCustomPathProperties, PptxImageProperties {
|
|
3370
4094
|
type: 'picture';
|
|
3371
4095
|
}
|
|
4096
|
+
/**
|
|
4097
|
+
* A single unrecognised `<a:graphicData>/<a:extLst>/<a:ext>` extension on a
|
|
4098
|
+
* graphicFrame, captured verbatim so the round-trip can preserve future or
|
|
4099
|
+
* vendor-specific markup that the parser doesn't yet understand.
|
|
4100
|
+
*
|
|
4101
|
+
* The XML is preserved as a fast-xml-parser object tree (the same shape as
|
|
4102
|
+
* `rawXml` on other elements) so the save layer can re-emit it through the
|
|
4103
|
+
* existing builder without lossy string manipulation.
|
|
4104
|
+
*/
|
|
4105
|
+
interface PptxGraphicFrameExtension {
|
|
4106
|
+
/** The `@_uri` attribute identifying the extension (e.g. `{C3CD43...}`). */
|
|
4107
|
+
uri: string;
|
|
4108
|
+
/** Parsed XML payload of the extension, suitable for re-serialization. */
|
|
4109
|
+
xml: XmlObject;
|
|
4110
|
+
}
|
|
3372
4111
|
/**
|
|
3373
4112
|
* A table embedded via a `<p:graphicFrame>`.
|
|
3374
4113
|
*
|
|
@@ -3391,6 +4130,11 @@ interface TablePptxElement extends PptxElementBase {
|
|
|
3391
4130
|
type: 'table';
|
|
3392
4131
|
/** Parsed table cell data for editing. */
|
|
3393
4132
|
tableData?: PptxTableData;
|
|
4133
|
+
/**
|
|
4134
|
+
* Unrecognised extensions captured from `a:graphicData/a:extLst` so they
|
|
4135
|
+
* round-trip losslessly. See {@link PptxGraphicFrameExtension}.
|
|
4136
|
+
*/
|
|
4137
|
+
extensionXml?: PptxGraphicFrameExtension[];
|
|
3394
4138
|
}
|
|
3395
4139
|
/**
|
|
3396
4140
|
* A chart embedded via a `<p:graphicFrame>`.
|
|
@@ -3401,6 +4145,8 @@ interface TablePptxElement extends PptxElementBase {
|
|
|
3401
4145
|
interface ChartPptxElement extends PptxElementBase {
|
|
3402
4146
|
type: 'chart';
|
|
3403
4147
|
chartData?: PptxChartData;
|
|
4148
|
+
/** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
|
|
4149
|
+
extensionXml?: PptxGraphicFrameExtension[];
|
|
3404
4150
|
}
|
|
3405
4151
|
/**
|
|
3406
4152
|
* A SmartArt diagram embedded via a `<p:graphicFrame>`.
|
|
@@ -3411,6 +4157,8 @@ interface ChartPptxElement extends PptxElementBase {
|
|
|
3411
4157
|
interface SmartArtPptxElement extends PptxElementBase {
|
|
3412
4158
|
type: 'smartArt';
|
|
3413
4159
|
smartArtData?: PptxSmartArtData;
|
|
4160
|
+
/** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
|
|
4161
|
+
extensionXml?: PptxGraphicFrameExtension[];
|
|
3414
4162
|
}
|
|
3415
4163
|
/**
|
|
3416
4164
|
* Recognised OLE object application types derived from `progId` / `clsId`.
|
|
@@ -3458,6 +4206,14 @@ interface OlePptxElement extends PptxElementBase {
|
|
|
3458
4206
|
previewImage?: string;
|
|
3459
4207
|
/** Decoded preview image as a data-URL. */
|
|
3460
4208
|
previewImageData?: string;
|
|
4209
|
+
/** Whether the OLE object is shown as an icon (`p:oleObj/@showAsIcon`). */
|
|
4210
|
+
oleShowAsIcon?: boolean;
|
|
4211
|
+
/** Authored display width of the OLE object preview, in EMU (`@imgW`). */
|
|
4212
|
+
oleImgW?: number;
|
|
4213
|
+
/** Authored display height of the OLE object preview, in EMU (`@imgH`). */
|
|
4214
|
+
oleImgH?: number;
|
|
4215
|
+
/** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
|
|
4216
|
+
extensionXml?: PptxGraphicFrameExtension[];
|
|
3461
4217
|
}
|
|
3462
4218
|
/**
|
|
3463
4219
|
* An audio or video media element.
|
|
@@ -3519,6 +4275,13 @@ interface MediaPptxElement extends PptxElementBase {
|
|
|
3519
4275
|
captionTracks?: MediaCaptionTrack[];
|
|
3520
4276
|
/** Whether the media source is missing/broken (file not found in archive). */
|
|
3521
4277
|
mediaMissing?: boolean;
|
|
4278
|
+
/**
|
|
4279
|
+
* Whether the media is linked (external `r:link`) rather than embedded
|
|
4280
|
+
* (`r:embed`). Defaults to embedded when undefined.
|
|
4281
|
+
*/
|
|
4282
|
+
isLinked?: boolean;
|
|
4283
|
+
/** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
|
|
4284
|
+
extensionXml?: PptxGraphicFrameExtension[];
|
|
3522
4285
|
}
|
|
3523
4286
|
/**
|
|
3524
4287
|
* A group container that holds child elements.
|
|
@@ -3570,6 +4333,8 @@ interface InkPptxElement extends PptxElementBase {
|
|
|
3570
4333
|
* variable-width strokes that reflect stylus/pen pressure.
|
|
3571
4334
|
*/
|
|
3572
4335
|
inkPointPressures?: number[][];
|
|
4336
|
+
/** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
|
|
4337
|
+
extensionXml?: PptxGraphicFrameExtension[];
|
|
3573
4338
|
}
|
|
3574
4339
|
/**
|
|
3575
4340
|
* A single ink stroke within a {@link ContentPartPptxElement}.
|
|
@@ -3641,10 +4406,14 @@ interface Model3DPptxElement extends PptxElementBase, PptxImageProperties {
|
|
|
3641
4406
|
modelMimeType?: string;
|
|
3642
4407
|
/** Poster/preview image shown when 3D rendering is unavailable. */
|
|
3643
4408
|
posterImage?: string;
|
|
4409
|
+
/** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
|
|
4410
|
+
extensionXml?: PptxGraphicFrameExtension[];
|
|
3644
4411
|
}
|
|
3645
4412
|
/** An element whose type is not recognised by the parser. */
|
|
3646
4413
|
interface UnknownPptxElement extends PptxElementBase {
|
|
3647
4414
|
type: 'unknown';
|
|
4415
|
+
/** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
|
|
4416
|
+
extensionXml?: PptxGraphicFrameExtension[];
|
|
3648
4417
|
}
|
|
3649
4418
|
/**
|
|
3650
4419
|
* A single element on a PPTX slide.
|
|
@@ -3785,8 +4554,14 @@ interface PptxThemeFontScheme {
|
|
|
3785
4554
|
* ```
|
|
3786
4555
|
*/
|
|
3787
4556
|
interface PptxThemeFillStyle {
|
|
3788
|
-
/**
|
|
3789
|
-
|
|
4557
|
+
/**
|
|
4558
|
+
* Discriminator for the fill type.
|
|
4559
|
+
*
|
|
4560
|
+
* `'group'` corresponds to `<a:grpFill/>` — a fill that inherits the
|
|
4561
|
+
* containing group shape's fill at render time. Captured for round-trip
|
|
4562
|
+
* preservation in `fmtScheme/fillStyleLst`.
|
|
4563
|
+
*/
|
|
4564
|
+
kind: 'solid' | 'gradient' | 'pattern' | 'none' | 'group';
|
|
3790
4565
|
/** Pre-resolved colour (may be `undefined` when `phClr`-dependent). */
|
|
3791
4566
|
color?: string;
|
|
3792
4567
|
opacity?: number;
|
|
@@ -3993,6 +4768,8 @@ interface PptxNotesMaster {
|
|
|
3993
4768
|
elements?: PptxElement[];
|
|
3994
4769
|
/** Header/footer flags from `<p:hf>` on the notes master (P-H3). */
|
|
3995
4770
|
headerFooter?: PptxHeaderFooterFlags;
|
|
4771
|
+
/** Colour map from `<p:clrMap>` (12 alias attributes). Applied at save time. */
|
|
4772
|
+
clrMap?: Record<string, string>;
|
|
3996
4773
|
}
|
|
3997
4774
|
/**
|
|
3998
4775
|
* Parsed handout master from `ppt/handoutMasters/handoutMaster1.xml`.
|
|
@@ -4024,6 +4801,8 @@ interface PptxHandoutMaster {
|
|
|
4024
4801
|
slidesPerPage?: number;
|
|
4025
4802
|
/** Header/footer flags from `<p:hf>` on the handout master (P-H3). */
|
|
4026
4803
|
headerFooter?: PptxHeaderFooterFlags;
|
|
4804
|
+
/** Colour map from `<p:clrMap>` (12 alias attributes). Applied at save time. */
|
|
4805
|
+
clrMap?: Record<string, string>;
|
|
4027
4806
|
}
|
|
4028
4807
|
/**
|
|
4029
4808
|
* Active tab within the master view sidebar.
|
|
@@ -4075,6 +4854,11 @@ interface PptxSlideMaster {
|
|
|
4075
4854
|
txStyles?: PptxMasterTextStyles;
|
|
4076
4855
|
/** Header/footer flags from `<p:hf>` on this master (P-H3). */
|
|
4077
4856
|
headerFooter?: PptxHeaderFooterFlags;
|
|
4857
|
+
/**
|
|
4858
|
+
* Colour map from `<p:clrMap>` (12 alias attributes: bg1/tx1/bg2/tx2,
|
|
4859
|
+
* accent1-6, hlink, folHlink). Applied at save time when present.
|
|
4860
|
+
*/
|
|
4861
|
+
clrMap?: Record<string, string>;
|
|
4078
4862
|
}
|
|
4079
4863
|
/**
|
|
4080
4864
|
* Per-level paragraph properties for a text style category.
|
|
@@ -4301,6 +5085,32 @@ interface PptxActiveXControl {
|
|
|
4301
5085
|
/** Raw XML for round-trip preservation. */
|
|
4302
5086
|
rawXml?: XmlObject;
|
|
4303
5087
|
}
|
|
5088
|
+
/**
|
|
5089
|
+
* Pattern fill on a slide background.
|
|
5090
|
+
*
|
|
5091
|
+
* Mirrors the `<a:pattFill>` choice inside `<p:bgPr>`. Renderers should
|
|
5092
|
+
* draw a 2-colour preset pattern (e.g. `dkDnDiag`, `pct50`).
|
|
5093
|
+
*
|
|
5094
|
+
* ECMA-376 §20.1.8.47.
|
|
5095
|
+
*
|
|
5096
|
+
* @example
|
|
5097
|
+
* ```ts
|
|
5098
|
+
* const pattern: PptxSlideBackgroundPattern = {
|
|
5099
|
+
* preset: "ltDnDiag",
|
|
5100
|
+
* fgColor: "#4472C4",
|
|
5101
|
+
* bgColor: "#FFFFFF",
|
|
5102
|
+
* };
|
|
5103
|
+
* // => satisfies PptxSlideBackgroundPattern
|
|
5104
|
+
* ```
|
|
5105
|
+
*/
|
|
5106
|
+
interface PptxSlideBackgroundPattern {
|
|
5107
|
+
/** DrawingML preset pattern token (`@_prst`). */
|
|
5108
|
+
preset: string;
|
|
5109
|
+
/** Foreground colour resolved to `#RRGGBB`. */
|
|
5110
|
+
fgColor?: string;
|
|
5111
|
+
/** Background colour resolved to `#RRGGBB`. */
|
|
5112
|
+
bgColor?: string;
|
|
5113
|
+
}
|
|
4304
5114
|
/**
|
|
4305
5115
|
* A single slide in a parsed PPTX presentation.
|
|
4306
5116
|
*
|
|
@@ -4324,6 +5134,8 @@ interface PptxSlide {
|
|
|
4324
5134
|
id: string;
|
|
4325
5135
|
rId: string;
|
|
4326
5136
|
sourceSlideId?: string;
|
|
5137
|
+
/** Optional author-supplied slide name (set via `SlideBuilder.setName`). */
|
|
5138
|
+
name?: string;
|
|
4327
5139
|
layoutPath?: string;
|
|
4328
5140
|
layoutName?: string;
|
|
4329
5141
|
slideNumber: number;
|
|
@@ -4334,6 +5146,26 @@ interface PptxSlide {
|
|
|
4334
5146
|
backgroundColor?: string;
|
|
4335
5147
|
backgroundImage?: string;
|
|
4336
5148
|
backgroundGradient?: string;
|
|
5149
|
+
/**
|
|
5150
|
+
* Pattern fill on the slide background (`<a:pattFill>` inside `<p:bgPr>`).
|
|
5151
|
+
*
|
|
5152
|
+
* When present, renderers should draw a real two-colour pattern using
|
|
5153
|
+
* the named DrawingML preset (e.g. `"ltDnDiag"`, `"pct50"`). The flat
|
|
5154
|
+
* `backgroundColor` field is left set to the foreground colour for
|
|
5155
|
+
* fallback rendering paths that don't understand patterns.
|
|
5156
|
+
*
|
|
5157
|
+
* ECMA-376 §20.1.8.47.
|
|
5158
|
+
*/
|
|
5159
|
+
backgroundPattern?: PptxSlideBackgroundPattern;
|
|
5160
|
+
/**
|
|
5161
|
+
* `<p:bgPr/@shadeToTitle>` — boolean flag instructing the renderer to
|
|
5162
|
+
* shade the background toward the title placeholder colour. Captured
|
|
5163
|
+
* for lossless round-trip; the React renderer currently treats it as
|
|
5164
|
+
* a passthrough hint.
|
|
5165
|
+
*
|
|
5166
|
+
* ECMA-376 §19.3.1.2 (CT_BackgroundProperties).
|
|
5167
|
+
*/
|
|
5168
|
+
backgroundShadeToTitle?: boolean;
|
|
4337
5169
|
transition?: PptxSlideTransition;
|
|
4338
5170
|
animations?: PptxElementAnimation[];
|
|
4339
5171
|
/** Native OOXML animation data parsed from `p:timing`. */
|
|
@@ -4343,6 +5175,20 @@ interface PptxSlide {
|
|
|
4343
5175
|
notes?: string;
|
|
4344
5176
|
/** Rich text segments for the slide notes (preserves formatting). */
|
|
4345
5177
|
notesSegments?: TextSegment[];
|
|
5178
|
+
/**
|
|
5179
|
+
* Parsed shapes from the notes slide's `<p:cSld>/<p:spTree>` so the full
|
|
5180
|
+
* notes-page shape tree can be inspected and mutated, not just the body
|
|
5181
|
+
* placeholder text. When undefined, the existing notes XML is left
|
|
5182
|
+
* untouched on save and only `notes` / `notesSegments` are written.
|
|
5183
|
+
*/
|
|
5184
|
+
notesShapes?: PptxElement[];
|
|
5185
|
+
/**
|
|
5186
|
+
* Per-notes-slide colour map override parsed from `<p:notes>/<p:clrMapOvr>`.
|
|
5187
|
+
* Captured for lossless round-trip of the notes-slide's colour scheme.
|
|
5188
|
+
*/
|
|
5189
|
+
notesClrMapOverride?: Record<string, string>;
|
|
5190
|
+
/** Optional `<p:cSld @name>` value of the notes slide, for round-trip. */
|
|
5191
|
+
notesCSldName?: string;
|
|
4346
5192
|
comments?: PptxComment[];
|
|
4347
5193
|
warnings?: PptxCompatibilityWarning[];
|
|
4348
5194
|
rawXml?: XmlObject;
|
|
@@ -4382,6 +5228,8 @@ interface PptxLayoutOption {
|
|
|
4382
5228
|
name: string;
|
|
4383
5229
|
/** Standard layout type from `p:sldLayout/@type` (e.g. "obj", "twoColTx", "blank"). */
|
|
4384
5230
|
type?: string;
|
|
5231
|
+
/** ZIP path of the slide master this layout belongs to. */
|
|
5232
|
+
masterPath?: string;
|
|
4385
5233
|
}
|
|
4386
5234
|
/**
|
|
4387
5235
|
* Header, footer, date-time, and slide-number placeholders.
|
|
@@ -4794,4 +5642,4 @@ interface PptxEmbeddedFont {
|
|
|
4794
5642
|
originalPartBytes?: Uint8Array;
|
|
4795
5643
|
}
|
|
4796
5644
|
|
|
4797
|
-
export { type
|
|
5645
|
+
export { type ShapeStyle as $, type PptxSlideMaster as A, type PptxSlideLayout as B, type ConnectorPptxElement as C, type PptxTagCollection as D, type PptxPhotoAlbum as E, type PptxKinsoku as F, type PptxModifyVerifier as G, type PptxViewProperties as H, type InkPptxElement as I, type ParsedTableStyleMap as J, type PptxEmbeddedFont as K, type PptxExportOptions as L, type PptxThemeFormatScheme as M, type TextSegment as N, type PptxComment as O, type PptxElement as P, type PptxSlideBackgroundPattern as Q, type PptxSlideTransition as R, type ShapePptxElement as S, type TextPptxElement as T, type PptxElementAnimation as U, type PptxNativeAnimation as V, type PptxCustomerData as W, type XmlObject as X, type PptxActiveXControl as Y, type ZoomPptxElement as Z, type AnimationCondition as _, type PptxElementWithShapeStyle as a, type ImagePptxElement as a$, type TextStyle as a0, type ElementAction as a1, type PptxAction as a2, type OleObjectType as a3, type PptxSmartArtNode as a4, type SmartArtLayoutType as a5, type PptxSmartArtDrawingShape as a6, type PptxChartDataTable as a7, type PptxChartLineStyle as a8, type PptxChartErrBars as a9, type OlePptxElement as aA, type GroupPptxElement as aB, type PlaceholderTextLevelStyle as aC, type PptxChartOfPieOptions as aD, type PptxChartView3D as aE, type PptxChartChrome as aF, type PptxChartSeries as aG, type SmartArtPptxElement as aH, type GeometryAdjustmentHandle as aI, type CustomGeometryRawData as aJ, type AdjustHandleXY as aK, type AdjustHandlePolar as aL, type ConnectionSite as aM, type CustomGeometryTextRect as aN, type CustomGeometryPath as aO, type BulletInfo as aP, type PptxShapeLocks as aQ, type PptxTextStyleLevels as aR, type PptxThemeFillStyle as aS, type PptxThemeLineStyle as aT, type PptxThemeEffectStyle as aU, type PptxSmartArtChrome as aV, type PptxSmartArtColorTransform as aW, type PptxSmartArtQuickStyle as aX, type PptxExternalData as aY, type CustomGeometryPoint as aZ, type ChartPptxElement as a_, type PptxChartTrendline as aa, type PptxChartMarker as ab, type PptxChartDataLabel as ac, type PptxChartDataPoint as ad, type PptxChartShapeProps as ae, type PptxChart3DSurface as af, type PptxChartAxisFormatting as ag, type PptxEmbeddedWorkbookData as ah, type PptxDrawingGuide as ai, type PptxTableCellStyle as aj, type PptxCustomXmlPart as ak, type PptxCommentAuthor as al, type MediaPptxElement as am, type PptxTableData as an, type PptxTheme as ao, type PptxThemeOption as ap, type PlaceholderDefaults as aq, type PptxMasterTextStyles as ar, type PptxThemeObjectDefaults as as, type ParsedTableStyleFill as at, type ParsedTableBackground as au, type ParsedTableStyleText as av, type PptxImageEffects as aw, type MediaBookmark as ax, type PptxChartStyle as ay, type TablePptxElement as az, type PptxElementWithText as b, type PptxTextWarpPreset as b$, type ActionButtonPreset as b0, type AnimationConditionEvent as b1, type BevelPresetType as b2, type ConnectorConnectionPoint as b3, type ContentPartInkStroke as b4, type ContentPartPptxElement as b5, type CustomGeometrySegment as b6, type EffectDagBlend as b7, type EffectDagBlendMode as b8, type EffectDagContainer as b9, type PptxChartMarkerSymbol as bA, type PptxChartTrendlineType as bB, type PptxColorAnimation as bC, type PptxCommonSlideViewProperties as bD, type PptxCropShape as bE, type PptxCustomPathProperties as bF, type PptxElementBase as bG, type PptxElementType as bH, type PptxExportFormat as bI, type PptxGraphicFrameExtension as bJ, type PptxHeaderFooterFlags as bK, type PptxImageProperties as bL, type PptxMediaType as bM, type PptxNativeAnimationKind as bN, type PptxNormalViewProperties as bO, type PptxRestoredRegion as bP, type PptxShapeProperties as bQ, type PptxSmartArtConnection as bR, type PptxSplitDirection as bS, type PptxSplitOrientation as bT, type PptxStripDirection as bU, type PptxTableCell as bV, type PptxTableRow as bW, type PptxTag as bX, type PptxTextAnimationTarget as bY, type PptxTextBuildType as bZ, type PptxTextProperties as b_, type EffectDagContainerType as ba, type EffectDagNode as bb, type EffectDagRawLeaf as bc, type EffectDagRelOff as bd, type EffectDagXfrm as be, type ElementActionType as bf, type MasterViewTab as bg, type MaterialPresetType as bh, type MediaCaptionTrack as bi, type MediaMetadata as bj, type Model3DPptxElement as bk, type ParsedTableStyleEntry as bl, type PicturePptxElement as bm, type Pptx3DScene as bn, type Pptx3DShape as bo, type PptxAfterAnimationAction as bp, type PptxAnimationDirection as bq, type PptxAnimationIterate as br, type PptxAnimationKeyframe as bs, type PptxAnimationRepeatMode as bt, type PptxAnimationSequence as bu, type PptxAnimationTimingCurve as bv, type PptxChartAxisNumFmt as bw, type PptxChartErrBarDir as bx, type PptxChartErrBarType as by, type PptxChartErrValType as bz, type PptxImageLikeElement as c, type PptxThemeFontGroup as c0, type PptxTransitionDirection4 as c1, type PptxTransitionDirection8 as c2, type PptxViewOrigin as c3, type PptxViewScale as c4, type ShadowEffect as c5, type SmartArtColorScheme as c6, type SmartArtLayout as c7, type SmartArtStyle as c8, THEME_COLOR_SCHEME_KEYS as c9, TRANSITION_VALID_DIRECTIONS as ca, type Text3DStyle as cb, type UnderlineStyle as cc, type UnknownPptxElement as cd, type PptxThemeColorScheme as d, type PptxThemeFontScheme as e, type PptxAnimationPreset as f, type PptxAnimationTrigger as g, type StrokeDashType as h, type ConnectorArrowType as i, type PptxTransitionType as j, type PptxChartType as k, type PptxSlide as l, type PptxData as m, type PptxCompatibilityWarning as n, type PptxLayoutOption as o, type PptxChartData as p, type PptxSmartArtData as q, type PptxHeaderFooter as r, type PptxPresentationProperties as s, type PptxCustomShow as t, type PptxSection as u, type PptxCoreProperties as v, type PptxAppProperties as w, type PptxCustomProperty as x, type PptxNotesMaster as y, type PptxHandoutMaster as z };
|