ooxml-core 1.47.0 → 1.48.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PptxHandler-6UQWMUVU.cjs +14 -0
- package/dist/{PptxHandler-NXHZ6ITL.mjs → PptxHandler-PLSH2BAS.mjs} +2 -2
- package/dist/PptxHandler-QLKZVYCG.mjs +5 -0
- package/dist/{PresentationBuilder-URSPID7L.mjs → PresentationBuilder-3QXOJNRO.mjs} +2 -2
- package/dist/{PresentationBuilder-IK6NIK6T.cjs → PresentationBuilder-CRBFFHNW.cjs} +6 -6
- package/dist/{PresentationBuilder-LHQ333UL.mjs → PresentationBuilder-DQ3XFU4R.mjs} +3 -3
- package/dist/{chunk-QHR726W3.mjs → chunk-32K7JG2Z.mjs} +1 -1
- package/dist/{chunk-APCA7N6Q.cjs → chunk-7RCBSNXT.cjs} +3 -3
- package/dist/{chunk-6MU4WKHS.mjs → chunk-CXIDPUT6.mjs} +1 -1
- package/dist/{chunk-553WFEHD.mjs → chunk-EKEE6BTU.mjs} +638 -50
- package/dist/{chunk-XVEJS7HN.mjs → chunk-IKFTITJ7.mjs} +4 -4
- package/dist/{chunk-7L6ZAA5Y.mjs → chunk-K5G6MV37.mjs} +2 -2
- package/dist/{chunk-4GPLQEEC.cjs → chunk-RRA262A6.cjs} +1926 -1326
- package/dist/{chunk-5HNRZOBX.mjs → chunk-WAYEYX4G.mjs} +1 -1
- package/dist/{chunk-Z734BYYR.mjs → chunk-WLKOLTBH.mjs} +653 -53
- package/dist/pptx/automation/index.cjs +45094 -44442
- package/dist/pptx/automation/index.d.ts +5 -12
- package/dist/pptx/automation/index.d.ts.map +1 -1
- package/dist/pptx/automation/index.mjs +5 -5
- package/dist/pptx/automation/schemas/chart-formatting-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/chart-formatting-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/chart-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/chart-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/chart-user-shape-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/chart-user-shape-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/element-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/element-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/export-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/export-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/geometry-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/geometry-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/hyperlink-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/hyperlink-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/index.d.ts +8 -8
- package/dist/pptx/automation/schemas/index.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/json-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/json-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/layout-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/layout-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/lock-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/lock-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/metadata-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/metadata-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/ole-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/ole-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/presentation-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/presentation-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/section-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/section-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/slide-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/slide-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/smartart-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/smartart-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/table-style-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/table-style-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/template-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/template-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/theme-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/theme-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/validation-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/validation-schemas.d.ts.map +1 -1
- package/dist/pptx/chunks/color-primitives-DHyz14D9.d.ts +151 -0
- package/dist/pptx/chunks/color-primitives-DHyz14D9.d.ts.map +1 -0
- package/dist/pptx/chunks/{index--HBUyILF.d.ts → index-7tA9HqRL.d.ts} +10060 -1223
- package/dist/pptx/chunks/index-7tA9HqRL.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-Dr3iIPt9.d.ts → index-CAzt1jbx.d.ts} +4 -5
- package/dist/pptx/chunks/index-CAzt1jbx.d.ts.map +1 -0
- package/dist/pptx/chunks/{schemas-LHsDbVOw.d.ts → index-CyAgQ2zG.d.ts} +6 -2
- package/dist/pptx/chunks/index-CyAgQ2zG.d.ts.map +1 -0
- package/dist/pptx/chunks/index-cJSPBkU1.d.ts +185 -0
- package/dist/pptx/chunks/index-cJSPBkU1.d.ts.map +1 -0
- package/dist/pptx/chunks/index-cr_sgz1w.d.ts +94 -0
- package/dist/pptx/chunks/index-cr_sgz1w.d.ts.map +1 -0
- package/dist/pptx/chunks/presentation-Be108jrz.d.ts +12521 -0
- package/dist/pptx/chunks/presentation-Be108jrz.d.ts.map +1 -0
- package/dist/pptx/chunks/{inspection-status-TKac7eqb.d.ts → signature-inspection-status-TKac7eqb.d.ts} +1 -1
- package/dist/pptx/chunks/signature-inspection-status-TKac7eqb.d.ts.map +1 -0
- package/dist/pptx/chunks/text-operations-a1cqBYk9.d.ts +111 -0
- package/dist/pptx/chunks/text-operations-a1cqBYk9.d.ts.map +1 -0
- package/dist/pptx/cli/index.cjs +746 -94
- package/dist/pptx/cli/index.d.ts +17 -1
- package/dist/pptx/cli/index.d.ts.map +1 -1
- package/dist/pptx/cli/index.mjs +4 -4
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/converter/index.mjs +2 -2
- package/dist/pptx/editor/ai/table-merge.d.ts +16 -0
- package/dist/pptx/editor/ai/table-merge.d.ts.map +1 -1
- package/dist/pptx/editor/loader/element-patch-walker.d.ts +15 -0
- package/dist/pptx/editor/loader/element-patch-walker.d.ts.map +1 -1
- package/dist/pptx/editor/loader/lazy-image-resolution.d.ts +15 -0
- package/dist/pptx/editor/loader/lazy-image-resolution.d.ts.map +1 -1
- package/dist/pptx/editor/loader/load-content-helpers.d.ts +7 -0
- package/dist/pptx/editor/loader/load-content-helpers.d.ts.map +1 -1
- package/dist/pptx/editor/loader/table-style-image-paths.d.ts +20 -0
- package/dist/pptx/editor/loader/table-style-image-paths.d.ts.map +1 -1
- package/dist/pptx/editor/loader/text-fill-image-paths.d.ts +19 -0
- package/dist/pptx/editor/loader/text-fill-image-paths.d.ts.map +1 -1
- package/dist/pptx/editor/render/bullet-autonum.d.ts +14 -0
- package/dist/pptx/editor/render/bullet-list.d.ts +8 -0
- package/dist/pptx/editor/render/bullet-list.d.ts.map +1 -1
- package/dist/pptx/editor/render/bullet-toggle.d.ts +4 -0
- package/dist/pptx/editor/render/bullet-toggle.d.ts.map +1 -1
- package/dist/pptx/editor/render/chart-user-shape-edit.d.ts +12 -0
- package/dist/pptx/editor/render/chart-user-shape-edit.d.ts.map +1 -1
- package/dist/pptx/editor/render/clone.d.ts +20 -0
- package/dist/pptx/editor/render/clone.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-assets.d.ts +17 -0
- package/dist/pptx/editor/render/collaboration-live-patch-target.d.ts +9 -0
- package/dist/pptx/editor/render/collaboration-live-patch-target.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-reconcile.d.ts +21 -0
- package/dist/pptx/editor/render/collaboration-reconcile.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-sync.d.ts +32 -4
- package/dist/pptx/editor/render/collaboration-sync.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-text-codec.d.ts +33 -2
- package/dist/pptx/editor/render/collaboration-text-codec.d.ts.map +1 -0
- package/dist/pptx/editor/render/collaboration-text-merge.d.ts +36 -2
- package/dist/pptx/editor/render/collaboration-text-merge.d.ts.map +1 -0
- package/dist/pptx/editor/render/collaboration-text-native-edit.d.ts +2 -2
- package/dist/pptx/editor/render/collaboration-text-positions.d.ts +34 -2
- package/dist/pptx/editor/render/collaboration-text-positions.d.ts.map +1 -0
- package/dist/pptx/editor/render/collaboration-text-projection.d.ts +1 -1
- package/dist/pptx/editor/render/collaboration-text-session-apply.d.ts +3 -3
- package/dist/pptx/editor/render/collaboration-text-session-delta.d.ts +36 -2
- package/dist/pptx/editor/render/collaboration-text-session-delta.d.ts.map +1 -0
- package/dist/pptx/editor/render/collaboration-text-session-paragraph.d.ts +1 -1
- package/dist/pptx/editor/render/collaboration-text-session.d.ts +40 -2
- package/dist/pptx/editor/render/collaboration-text-session.d.ts.map +1 -0
- package/dist/pptx/editor/render/collaboration-text-snapshot-positions.d.ts +2 -2
- package/dist/pptx/editor/render/custom-show-operations.cjs +2 -2
- package/dist/pptx/editor/render/custom-show-operations.d.ts +14 -0
- package/dist/pptx/editor/render/custom-show-operations.d.ts.map +1 -1
- package/dist/pptx/editor/render/custom-show-operations.mjs +1 -1
- package/dist/pptx/editor/render/deck-save-encryption.d.ts +24 -0
- package/dist/pptx/editor/render/deck-save-encryption.d.ts.map +1 -1
- package/dist/pptx/editor/render/element-locks.d.ts +25 -0
- package/dist/pptx/editor/render/element-locks.d.ts.map +1 -1
- package/dist/pptx/editor/render/element-operations.d.ts +11 -0
- package/dist/pptx/editor/render/element-operations.d.ts.map +1 -1
- package/dist/pptx/editor/render/element.d.ts +12 -0
- package/dist/pptx/editor/render/element.d.ts.map +1 -1
- package/dist/pptx/editor/render/find-replace.cjs +15 -15
- package/dist/pptx/editor/render/find-replace.d.ts +8 -2
- package/dist/pptx/editor/render/find-replace.d.ts.map +1 -1
- package/dist/pptx/editor/render/find-replace.mjs +2 -2
- package/dist/pptx/editor/render/font-family-update.d.ts +32 -1
- package/dist/pptx/editor/render/font-family-update.d.ts.map +1 -1
- package/dist/pptx/editor/render/group-drill.d.ts +26 -0
- package/dist/pptx/editor/render/group-drill.d.ts.map +1 -1
- package/dist/pptx/editor/render/group-ops.d.ts +24 -0
- package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts +21 -1
- package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts.map +1 -1
- package/dist/pptx/editor/render/remap-text.d.ts +5 -0
- package/dist/pptx/editor/render/remap-text.d.ts.map +1 -1
- package/dist/pptx/editor/render/section-operations.d.ts +14 -0
- package/dist/pptx/editor/render/section-operations.d.ts.map +1 -1
- package/dist/pptx/editor/render/slide-background-patch.d.ts +15 -0
- package/dist/pptx/editor/render/slide-background-patch.d.ts.map +1 -1
- package/dist/pptx/editor/render/slide-operations.cjs +9 -9
- package/dist/pptx/editor/render/slide-operations.d.ts +12 -0
- package/dist/pptx/editor/render/slide-operations.d.ts.map +1 -1
- package/dist/pptx/editor/render/slide-operations.mjs +3 -3
- package/dist/pptx/editor/render/slide-search.d.ts +6 -0
- package/dist/pptx/editor/render/slide-search.d.ts.map +1 -1
- package/dist/pptx/editor/render/slide-size-rescale.d.ts +18 -0
- package/dist/pptx/editor/render/slide-size-rescale.d.ts.map +1 -1
- package/dist/pptx/editor/render/slide-transition-edits.d.ts +15 -0
- package/dist/pptx/editor/render/slide-transition-edits.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-cell-edit.d.ts +8 -0
- package/dist/pptx/editor/render/table-cell-edit.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-cell-merge.d.ts +15 -0
- package/dist/pptx/editor/render/table-cell-merge.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-data-grid-ops.d.ts +26 -0
- package/dist/pptx/editor/render/table-data-grid-ops.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-layout.d.ts +3 -1
- package/dist/pptx/editor/render/table-layout.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-merge.d.ts +16 -0
- package/dist/pptx/editor/render/table-merge.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-style-editor-descriptor.d.ts +13 -0
- package/dist/pptx/editor/render/table-style-editor-descriptor.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-style-editor-edit.d.ts +13 -0
- package/dist/pptx/editor/render/table-style-editor-edit.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-style-editor-parts.d.ts +10 -0
- package/dist/pptx/editor/render/table-style-editor-parts.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-style-map-edits.d.ts +20 -0
- package/dist/pptx/editor/render/table-style-map-edits.d.ts.map +1 -1
- package/dist/pptx/editor/render/text-content-style.d.ts +2 -1
- package/dist/pptx/editor/render/text-content-style.d.ts.map +1 -1
- package/dist/pptx/editor/render/text-runs-style-patch.d.ts +2 -2
- package/dist/pptx/editor/render/text-segment-paragraph-break.d.ts +23 -0
- package/dist/pptx/editor/render/text-segment-paragraph-break.d.ts.map +1 -1
- package/dist/pptx/editor/render/text-style-scope.d.ts +20 -2
- package/dist/pptx/editor/render/text-style-scope.d.ts.map +1 -1
- package/dist/pptx/editor/render/text-theme.d.ts +11 -0
- package/dist/pptx/editor/render/text-theme.d.ts.map +1 -1
- package/dist/pptx/editor/render/theme-editor-presets.d.ts +9 -0
- package/dist/pptx/editor/render/theme-editor-presets.d.ts.map +1 -1
- package/dist/pptx/editor/render/update-text-segment-style.d.ts +2 -1
- package/dist/pptx/editor/render/update-text-segment-style.d.ts.map +1 -1
- package/dist/pptx/index.cjs +34610 -33974
- package/dist/pptx/index.d.ts +24 -10
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/node/index.d.ts +17 -1
- package/dist/pptx/node/index.d.ts.map +1 -1
- package/dist/pptx/signature-node/index.d.ts +8 -1
- package/dist/pptx/signature-node/index.d.ts.map +1 -1
- package/dist/pptx/smartart-layouts/index.d.ts +8 -1
- package/dist/pptx/smartart-layouts/index.d.ts.map +1 -1
- package/dist/pptx/ui/index.d.ts +2 -0
- package/dist/pptx/ui/index.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/PptxHandler-JX62VKU4.cjs +0 -14
- package/dist/PptxHandler-SUGLNSZI.mjs +0 -5
- package/dist/pptx/chunks/collaboration-text-codec-1VmwD3yq.d.ts +0 -34
- package/dist/pptx/chunks/collaboration-text-codec-1VmwD3yq.d.ts.map +0 -1
- package/dist/pptx/chunks/collaboration-text-merge-B-tth-0W.d.ts +0 -19
- package/dist/pptx/chunks/collaboration-text-merge-B-tth-0W.d.ts.map +0 -1
- package/dist/pptx/chunks/collaboration-text-positions-D-1Jo1Fz.d.ts +0 -34
- package/dist/pptx/chunks/collaboration-text-positions-D-1Jo1Fz.d.ts.map +0 -1
- package/dist/pptx/chunks/collaboration-text-session-CWHTaWF4.d.ts +0 -41
- package/dist/pptx/chunks/collaboration-text-session-CWHTaWF4.d.ts.map +0 -1
- package/dist/pptx/chunks/collaboration-text-session-delta-Dxzybssp.d.ts +0 -37
- package/dist/pptx/chunks/collaboration-text-session-delta-Dxzybssp.d.ts.map +0 -1
- package/dist/pptx/chunks/elements-B4Z6N-Gz.d.ts +0 -3993
- package/dist/pptx/chunks/elements-B4Z6N-Gz.d.ts.map +0 -1
- package/dist/pptx/chunks/index--HBUyILF.d.ts.map +0 -1
- package/dist/pptx/chunks/index-BDVzSboe.d.ts +0 -9746
- package/dist/pptx/chunks/index-BDVzSboe.d.ts.map +0 -1
- package/dist/pptx/chunks/index-Dr3iIPt9.d.ts.map +0 -1
- package/dist/pptx/chunks/inspection-status-TKac7eqb.d.ts.map +0 -1
- package/dist/pptx/chunks/schemas-LHsDbVOw.d.ts.map +0 -1
- package/dist/pptx/chunks/smart-art-DB37AsFP.d.ts +0 -1817
- package/dist/pptx/chunks/smart-art-DB37AsFP.d.ts.map +0 -1
- package/dist/pptx/chunks/table-BfgZfw5R.d.ts +0 -1359
- package/dist/pptx/chunks/table-BfgZfw5R.d.ts.map +0 -1
- package/dist/pptx/chunks/text-operations-CVHXOSit.d.ts +0 -3363
- package/dist/pptx/chunks/text-operations-CVHXOSit.d.ts.map +0 -1
- package/dist/pptx/chunks/text-t_wJ2OwM.d.ts +0 -1452
- package/dist/pptx/chunks/text-t_wJ2OwM.d.ts.map +0 -1
- /package/dist/{chunk-WFN6ZU7N.cjs → chunk-HBQBS7PO.cjs} +0 -0
- /package/dist/{chunk-DEDK2J57.mjs → chunk-I5REMIZR.mjs} +0 -0
|
@@ -1,3993 +0,0 @@
|
|
|
1
|
-
import { T as PptxShapeLocks, i as TextStyle, k as XmlObject, r as TextSegment } from "./text-t_wJ2OwM.js";
|
|
2
|
-
import { Gt as PptxCustomPathProperties, Wt as GeometryAdjustmentHandle, n as PptxSmartArtData } from "./smart-art-DB37AsFP.js";
|
|
3
|
-
import { E as ShapeStyle, v as PptxTableData } from "./table-BfgZfw5R.js";
|
|
4
|
-
/**
|
|
5
|
-
* Image recolour/adjustment properties parsed from blip extensions.
|
|
6
|
-
*
|
|
7
|
-
* These effects are stored in the OpenXML `<a:blip>` extension list
|
|
8
|
-
* and applied non-destructively to the original image data.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* const fx: PptxImageEffects = {
|
|
13
|
-
* brightness: 20,
|
|
14
|
-
* contrast: -10,
|
|
15
|
-
* grayscale: true,
|
|
16
|
-
* };
|
|
17
|
-
* // => { brightness: 20, contrast: -10, grayscale: true } satisfies PptxImageEffects
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* One `a14:foregroundMark` / `a14:backgroundMark` polyline hint recorded while
|
|
22
|
-
* the user painted over the picture in PowerPoint's "Remove Background" mode.
|
|
23
|
-
* Coordinates are 0..1 fractions of the image.
|
|
24
|
-
*/
|
|
25
|
-
interface PptxBackgroundRemovalMark {
|
|
26
|
-
x1: number;
|
|
27
|
-
y1: number;
|
|
28
|
-
x2: number;
|
|
29
|
-
y2: number;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* PowerPoint "Remove Background" state (`a14:backgroundRemoval`).
|
|
33
|
-
*
|
|
34
|
-
* The four edges are the RETAINED rectangle as 0..1 fractions of the image
|
|
35
|
-
* (OOXML stores them as per-100000 relative units), and the mark lists are the
|
|
36
|
-
* segmentation hints the user painted.
|
|
37
|
-
*
|
|
38
|
-
* **This is edit-time metadata, not a render instruction.** PowerPoint bakes the
|
|
39
|
-
* removal into the bitmap referenced by the main `a:blip/@r:embed` and keeps the
|
|
40
|
-
* pristine original in `a14:imgLayer/@r:embed`. Verified against PowerPoint COM:
|
|
41
|
-
* a slide exported with and without this element is byte-identical. A renderer
|
|
42
|
-
* that clips to the retained rectangle would clip an image whose background has
|
|
43
|
-
* already been removed.
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```ts
|
|
47
|
-
* const removal: PptxBackgroundRemoval = { top: 0.12, bottom: 0.88, left: 0.07, right: 0.93 };
|
|
48
|
-
* // => retains the middle of the image; the marks list stays empty
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
/**
|
|
52
|
-
* Snapshot of the a14 Corrections / Color panel values as they were read from
|
|
53
|
-
* the file, kept on {@link PptxImageEffects.prerenderedCorrections} so a
|
|
54
|
-
* renderer can tell a baked-in value from one changed in this library.
|
|
55
|
-
*/
|
|
56
|
-
interface PptxImagePrerenderedCorrections {
|
|
57
|
-
sharpenSoften?: {
|
|
58
|
-
amount: number;
|
|
59
|
-
};
|
|
60
|
-
brightnessContrast?: {
|
|
61
|
-
bright?: number;
|
|
62
|
-
contrast?: number;
|
|
63
|
-
};
|
|
64
|
-
colorTemperature?: {
|
|
65
|
-
colorTemp: number;
|
|
66
|
-
};
|
|
67
|
-
colorSaturation?: {
|
|
68
|
-
sat: number;
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
interface PptxBackgroundRemoval {
|
|
72
|
-
/** Top edge of the retained rectangle (0..1 fraction of the image height). */
|
|
73
|
-
top: number;
|
|
74
|
-
/** Bottom edge of the retained rectangle (0..1 fraction of the image height). */
|
|
75
|
-
bottom: number;
|
|
76
|
-
/** Left edge of the retained rectangle (0..1 fraction of the image width). */
|
|
77
|
-
left: number;
|
|
78
|
-
/** Right edge of the retained rectangle (0..1 fraction of the image width). */
|
|
79
|
-
right: number;
|
|
80
|
-
/** Strokes marking regions the user forced to be foreground. */
|
|
81
|
-
foregroundMarks?: PptxBackgroundRemovalMark[];
|
|
82
|
-
/** Strokes marking regions the user forced to be background. */
|
|
83
|
-
backgroundMarks?: PptxBackgroundRemovalMark[];
|
|
84
|
-
/** Original effect XML, retained for lossless re-emission. */
|
|
85
|
-
rawXml?: XmlObject;
|
|
86
|
-
}
|
|
87
|
-
interface PptxImageEffects {
|
|
88
|
-
/** Brightness adjustment (-100 to 100). */
|
|
89
|
-
brightness?: number;
|
|
90
|
-
/** Contrast adjustment (-100 to 100). */
|
|
91
|
-
contrast?: number;
|
|
92
|
-
/** Duotone colour pair. */
|
|
93
|
-
duotone?: {
|
|
94
|
-
color1: string;
|
|
95
|
-
color2: string;
|
|
96
|
-
/** Original effect XML, retained while the resolved colours are unchanged. */
|
|
97
|
-
rawXml?: XmlObject;
|
|
98
|
-
};
|
|
99
|
-
/** Grayscale flag. */
|
|
100
|
-
grayscale?: boolean;
|
|
101
|
-
/** Saturation adjustment (-100 to 100). */
|
|
102
|
-
saturation?: number;
|
|
103
|
-
/** Color wash overlay. */
|
|
104
|
-
colorWash?: {
|
|
105
|
-
color: string;
|
|
106
|
-
opacity: number;
|
|
107
|
-
};
|
|
108
|
-
/** Artistic effect name (blur, pencilGrayscale, paintStrokes, etc.). */
|
|
109
|
-
artisticEffect?: string;
|
|
110
|
-
/** Artistic effect radius/amount, normalised to 0..100. */
|
|
111
|
-
artisticRadius?: number;
|
|
112
|
-
/**
|
|
113
|
-
* Every numeric attribute of the source `a14:artistic*` element, raw and
|
|
114
|
-
* un-normalised (`trans`, `pencilSize`, `crackSpacing`, …). The attribute set
|
|
115
|
-
* differs per effect, so this is the lossless companion to the single
|
|
116
|
-
* {@link PptxImageEffects.artisticRadius} number.
|
|
117
|
-
*/
|
|
118
|
-
artisticParams?: Record<string, number>;
|
|
119
|
-
/**
|
|
120
|
-
* Name of the artistic effect ALREADY baked into the image data, which a
|
|
121
|
-
* renderer must not apply a second time. Set from the `a14` blip extension,
|
|
122
|
-
* which PowerPoint writes alongside a pre-rendered bitmap (see
|
|
123
|
-
* {@link PptxBackgroundRemoval}), and normally equal to
|
|
124
|
-
* {@link PptxImageEffects.artisticEffect}.
|
|
125
|
-
*
|
|
126
|
-
* It records the NAME rather than a boolean so that picking a different
|
|
127
|
-
* effect in this library's inspector (which patches `artisticEffect` alone)
|
|
128
|
-
* still renders: the two names then differ.
|
|
129
|
-
*/
|
|
130
|
-
artisticPrerenderedEffect?: string;
|
|
131
|
-
/**
|
|
132
|
-
* PowerPoint "Remove Background" state (`a14:backgroundRemoval`). Edit-time
|
|
133
|
-
* metadata: the removal is already baked into the image data.
|
|
134
|
-
*/
|
|
135
|
-
backgroundRemoval?: PptxBackgroundRemoval;
|
|
136
|
-
/**
|
|
137
|
-
* `a14:imgLayer/@r:embed`: relationship id of the PRISTINE original image
|
|
138
|
-
* the baked effects were derived from (PowerPoint stores it as an HD Photo
|
|
139
|
-
* `.wdp` part, which browsers cannot decode).
|
|
140
|
-
*/
|
|
141
|
-
originalImageRelId?: string;
|
|
142
|
-
/**
|
|
143
|
-
* PowerPoint 2010+ Corrections panel "Sharpen/Soften"
|
|
144
|
-
* (`a14:sharpenSoften/@amount`). Raw as the XML carries it: 1/1000ths of a
|
|
145
|
-
* percent, `-100000` (fully softened) .. `100000` (fully sharpened).
|
|
146
|
-
* Edit-time metadata like the artistic effects: PowerPoint bakes the result
|
|
147
|
-
* into the stored bitmap.
|
|
148
|
-
*/
|
|
149
|
-
sharpenSoften?: {
|
|
150
|
-
amount: number;
|
|
151
|
-
};
|
|
152
|
-
/**
|
|
153
|
-
* PowerPoint 2010+ Corrections panel "Brightness/Contrast"
|
|
154
|
-
* (`a14:brightnessContrast/@bright`, `@contrast`). Raw 1/1000ths of a
|
|
155
|
-
* percent, `-100000` .. `100000`. Distinct from the legacy `a:blip/@bright`
|
|
156
|
-
* + `@contrast` pair in {@link PptxImageEffects.brightness} /
|
|
157
|
-
* {@link PptxImageEffects.contrast}, which PowerPoint 2007 wrote and which
|
|
158
|
-
* a renderer still applies.
|
|
159
|
-
*/
|
|
160
|
-
brightnessContrast?: {
|
|
161
|
-
bright?: number;
|
|
162
|
-
contrast?: number;
|
|
163
|
-
};
|
|
164
|
-
/**
|
|
165
|
-
* PowerPoint 2010+ Color panel "Color Tone"
|
|
166
|
-
* (`a14:colorTemperature/@colorTemp`). Raw Kelvin value, `1500` .. `11500`;
|
|
167
|
-
* `6500` is neutral.
|
|
168
|
-
*/
|
|
169
|
-
colorTemperature?: {
|
|
170
|
-
colorTemp: number;
|
|
171
|
-
};
|
|
172
|
-
/**
|
|
173
|
-
* PowerPoint 2010+ Color panel "Color Saturation" (`a14:saturation/@sat`).
|
|
174
|
-
* Raw 1/1000ths of a percent: `100000` is unchanged, `0` is grayscale,
|
|
175
|
-
* `400000` the maximum. Named `colorSaturation` because
|
|
176
|
-
* {@link PptxImageEffects.saturation} is the viewer-side -100..100 knob
|
|
177
|
-
* that has no OOXML counterpart.
|
|
178
|
-
*/
|
|
179
|
-
colorSaturation?: {
|
|
180
|
-
sat: number;
|
|
181
|
-
};
|
|
182
|
-
/**
|
|
183
|
-
* The Corrections / Color panel values ALREADY baked into the image data,
|
|
184
|
-
* which a renderer must not apply a second time. The a14 counterpart of
|
|
185
|
-
* {@link PptxImageEffects.artisticPrerenderedEffect}: PowerPoint writes the
|
|
186
|
-
* corrected bitmap to the main `a:blip` and keeps the pristine original in
|
|
187
|
-
* `a14:imgLayer` (measured on a real deck: the stored PNG is a monotone tonal
|
|
188
|
-
* transform of the `.wdp` original, slope 0.7 for `contrast="-40000"`).
|
|
189
|
-
*
|
|
190
|
-
* Holds the VALUES rather than a boolean so that changing one of the four
|
|
191
|
-
* fields in this library's inspector still renders: a field that differs
|
|
192
|
-
* from its snapshot is applied, one that matches is skipped.
|
|
193
|
-
*/
|
|
194
|
-
prerenderedCorrections?: PptxImagePrerenderedCorrections;
|
|
195
|
-
/** Alpha modulation fixed: non-negative percentage (100 means unchanged opacity). */
|
|
196
|
-
alphaModFix?: number;
|
|
197
|
-
/** Original alpha modulation fixed node, including foreign attributes. */
|
|
198
|
-
alphaModFixRawXml?: XmlObject;
|
|
199
|
-
/** Bi-level threshold: converts to 1-bit black/white (0-100). */
|
|
200
|
-
biLevel?: number;
|
|
201
|
-
/** Colour change: swap one colour range for another (used for transparency keying). */
|
|
202
|
-
clrChange?: {
|
|
203
|
-
clrFrom: string;
|
|
204
|
-
clrTo: string;
|
|
205
|
-
/** Whether the target colour is fully transparent (alpha = 0). */
|
|
206
|
-
clrToTransparent?: boolean;
|
|
207
|
-
/** Original effect XML, including colour transforms and extensions. */
|
|
208
|
-
rawXml?: XmlObject;
|
|
209
|
-
};
|
|
210
|
-
/** Original grayscale node, including extension or foreign attributes. */
|
|
211
|
-
grayscaleRawXml?: XmlObject;
|
|
212
|
-
/** Original bi-level node, including extension or foreign attributes. */
|
|
213
|
-
biLevelRawXml?: XmlObject;
|
|
214
|
-
/**
|
|
215
|
-
* Alpha inverse effect (`a:alphaInv`). Inverts the alpha channel; an optional
|
|
216
|
-
* colour child shifts the inversion baseline.
|
|
217
|
-
*/
|
|
218
|
-
alphaInv?: {
|
|
219
|
-
/** Optional baseline colour (hex). */
|
|
220
|
-
color?: string;
|
|
221
|
-
/** Original effect XML, including colour transforms and foreign attributes. */
|
|
222
|
-
rawXml?: XmlObject;
|
|
223
|
-
};
|
|
224
|
-
/** Alpha ceiling (`a:alphaCeiling`): clamps any non-zero alpha to fully opaque. Boolean flag. */
|
|
225
|
-
alphaCeiling?: boolean;
|
|
226
|
-
/** Original alpha ceiling node, including foreign attributes. */
|
|
227
|
-
alphaCeilingRawXml?: XmlObject;
|
|
228
|
-
/** Alpha floor (`a:alphaFloor`): clamps any non-fully-opaque alpha to fully transparent. Boolean flag. */
|
|
229
|
-
alphaFloor?: boolean;
|
|
230
|
-
/** Original alpha floor node, including foreign attributes. */
|
|
231
|
-
alphaFloorRawXml?: XmlObject;
|
|
232
|
-
/**
|
|
233
|
-
* Alpha modulate (`a:alphaMod`). The schema requires a single `cont` (effect
|
|
234
|
-
* container) child; we preserve the inner XML opaquely for round-trip.
|
|
235
|
-
*/
|
|
236
|
-
alphaMod?: {
|
|
237
|
-
/** Raw opaque XML for the `a:cont` child to preserve on save. */
|
|
238
|
-
contRawXml?: Record<string, unknown>;
|
|
239
|
-
/** Original effect XML, including foreign attributes. */
|
|
240
|
-
rawXml?: XmlObject;
|
|
241
|
-
/**
|
|
242
|
-
* Multiplicative alpha percentage (0..100+), read from a nested
|
|
243
|
-
* `<a:alphaModFix>` inside `contRawXml` when present - the common
|
|
244
|
-
* real-world shape of `a:alphaMod` (`<a:cont><a:alphaModFix amt="…"/>
|
|
245
|
-
* </a:cont>`). Derived/read-only: a renderer multiplies the source alpha
|
|
246
|
-
* by this, distinct from the top-level {@link alphaModFix} sibling
|
|
247
|
-
* effect. Not written back independently on save; `contRawXml` is what
|
|
248
|
-
* round-trips.
|
|
249
|
-
*/
|
|
250
|
-
amt?: number;
|
|
251
|
-
};
|
|
252
|
-
/** Alpha replace (`a:alphaRepl`): replaces alpha with the given fixed-percent value (0..100). */
|
|
253
|
-
alphaRepl?: number;
|
|
254
|
-
/** Original alpha replace node, including foreign attributes. */
|
|
255
|
-
alphaReplRawXml?: XmlObject;
|
|
256
|
-
/** Alpha bi-level (`a:alphaBiLevel`): threshold (0..100) above which alpha becomes fully opaque. */
|
|
257
|
-
alphaBiLevel?: number;
|
|
258
|
-
/** Original alpha bi-level node, including foreign attributes. */
|
|
259
|
-
alphaBiLevelRawXml?: XmlObject;
|
|
260
|
-
/**
|
|
261
|
-
* Colour replace (`a:clrRepl`): replaces all colour information in an image
|
|
262
|
-
* with the given solid colour. Stores the raw colour child to preserve scheme
|
|
263
|
-
* colour references and modifiers.
|
|
264
|
-
*/
|
|
265
|
-
clrRepl?: {
|
|
266
|
-
/** Resolved hex colour. */
|
|
267
|
-
color: string;
|
|
268
|
-
/** Raw opaque colour XML for round-trip. */
|
|
269
|
-
rawXml?: Record<string, unknown>;
|
|
270
|
-
};
|
|
271
|
-
/** Luminance modulation (`a:lum`): bright/contrast as fixed percentages (0..100). */
|
|
272
|
-
lum?: {
|
|
273
|
-
bright?: number;
|
|
274
|
-
contrast?: number;
|
|
275
|
-
};
|
|
276
|
-
/** HSL modulation (`a:hsl`): hue (0..360 degrees), saturation/luminance (-100..100). */
|
|
277
|
-
hsl?: {
|
|
278
|
-
hue?: number;
|
|
279
|
-
sat?: number;
|
|
280
|
-
lum?: number;
|
|
281
|
-
};
|
|
282
|
-
/** Image-effect tint (`a:tint` inside blip): hue (0..360), amount (-100..100). */
|
|
283
|
-
tint?: {
|
|
284
|
-
hue?: number;
|
|
285
|
-
amt?: number;
|
|
286
|
-
};
|
|
287
|
-
/**
|
|
288
|
-
* Fill overlay (`a:fillOverlay`): overlays a fill on top of the blip.
|
|
289
|
-
* Stores blend mode and the raw inner fill XML for round-trip.
|
|
290
|
-
*/
|
|
291
|
-
fillOverlay?: {
|
|
292
|
-
blend: 'over' | 'mult' | 'screen' | 'darken' | 'lighten';
|
|
293
|
-
/** Raw opaque fill XML preserved for round-trip. */
|
|
294
|
-
fillRawXml?: Record<string, unknown>;
|
|
295
|
-
/**
|
|
296
|
-
* Resolved hex colour, when the overlay fill is a plain `a:solidFill`
|
|
297
|
-
* (the common case for a picture-style colour overlay). `undefined` for
|
|
298
|
-
* a gradient/pattern/picture overlay fill - see {@link resolvedGradient} /
|
|
299
|
-
* {@link resolvedPattern} instead. `fillRawXml` still round-trips
|
|
300
|
-
* losslessly regardless of which of the three resolved.
|
|
301
|
-
*/
|
|
302
|
-
resolvedColor?: string;
|
|
303
|
-
/** Resolved opacity (0-1) of the `a:solidFill` overlay colour, when resolved. */
|
|
304
|
-
resolvedOpacity?: number;
|
|
305
|
-
/**
|
|
306
|
-
* Resolved gradient, when the overlay fill is `a:gradFill`. A renderer
|
|
307
|
-
* composites this as an SVG paint server (`<linearGradient>` /
|
|
308
|
-
* `<radialGradient>`) rather than a flat flood colour.
|
|
309
|
-
*/
|
|
310
|
-
resolvedGradient?: {
|
|
311
|
-
type: 'linear' | 'radial';
|
|
312
|
-
/** Gradient angle in degrees (`a:lin/@ang`), for a linear gradient. */
|
|
313
|
-
angle?: number;
|
|
314
|
-
stops: Array<{
|
|
315
|
-
color: string;
|
|
316
|
-
position: number;
|
|
317
|
-
opacity?: number;
|
|
318
|
-
}>;
|
|
319
|
-
};
|
|
320
|
-
/**
|
|
321
|
-
* Resolved preset pattern, when the overlay fill is `a:pattFill`. A
|
|
322
|
-
* renderer composites this as a tiled SVG paint server.
|
|
323
|
-
*/
|
|
324
|
-
resolvedPattern?: {
|
|
325
|
-
preset: string;
|
|
326
|
-
foreground?: string;
|
|
327
|
-
background?: string;
|
|
328
|
-
};
|
|
329
|
-
};
|
|
330
|
-
/** Blur (`a:blur`): radius in EMU and grow flag. */
|
|
331
|
-
blur?: {
|
|
332
|
-
rad?: number;
|
|
333
|
-
grow?: boolean;
|
|
334
|
-
};
|
|
335
|
-
}
|
|
336
|
-
/**
|
|
337
|
-
* Shape names used for crop-to-shape (CSS `clip-path` equivalent).
|
|
338
|
-
*
|
|
339
|
-
* @example
|
|
340
|
-
* ```ts
|
|
341
|
-
* const shape: PptxCropShape = "ellipse";
|
|
342
|
-
* // => "ellipse": one of: none | ellipse | roundedRect | triangle | diamond | pentagon | hexagon | star
|
|
343
|
-
* ```
|
|
344
|
-
*/
|
|
345
|
-
type PptxCropShape = 'none' | 'ellipse' | 'roundedRect' | 'triangle' | 'diamond' | 'pentagon' | 'hexagon' | 'star';
|
|
346
|
-
/**
|
|
347
|
-
* Image content mixin: present on image and picture elements.
|
|
348
|
-
*
|
|
349
|
-
* Contains the decoded image data (base64 data URL or archive path),
|
|
350
|
-
* alt text, crop insets, tiling settings, and image effects.
|
|
351
|
-
*
|
|
352
|
-
* @example
|
|
353
|
-
* ```ts
|
|
354
|
-
* const props: PptxImageProperties = {
|
|
355
|
-
* imagePath: "ppt/media/image1.png",
|
|
356
|
-
* altText: "Company logo",
|
|
357
|
-
* cropLeft: 0.05,
|
|
358
|
-
* cropRight: 0.05,
|
|
359
|
-
* };
|
|
360
|
-
* // => { imagePath: "ppt/media/image1.png", altText: "Company logo", cropLeft: 0.05, cropRight: 0.05 }
|
|
361
|
-
* ```
|
|
362
|
-
*/
|
|
363
|
-
interface PptxImageProperties {
|
|
364
|
-
/** Base64 data-URL for the decoded image. */
|
|
365
|
-
imageData?: string;
|
|
366
|
-
/** Path within the PPTX ZIP archive. */
|
|
367
|
-
imagePath?: string;
|
|
368
|
-
/** Base64 data-URL for an SVG variant (from blip extension asvg:svgBlip). Preferred over raster when available. */
|
|
369
|
-
svgData?: string;
|
|
370
|
-
/** Path to the SVG file within the PPTX ZIP archive. */
|
|
371
|
-
svgPath?: string;
|
|
372
|
-
/** Alt text / description from `p:cNvPr/@descr`. */
|
|
373
|
-
altText?: string;
|
|
374
|
-
/** Crop from left edge as 0..1 fraction (OOXML `a:srcRect/@l`). */
|
|
375
|
-
cropLeft?: number;
|
|
376
|
-
/** Crop from top edge as 0..1 fraction (OOXML `a:srcRect/@t`). */
|
|
377
|
-
cropTop?: number;
|
|
378
|
-
/** Crop from right edge as 0..1 fraction (OOXML `a:srcRect/@r`). */
|
|
379
|
-
cropRight?: number;
|
|
380
|
-
/** Crop from bottom edge as 0..1 fraction (OOXML `a:srcRect/@b`). */
|
|
381
|
-
cropBottom?: number;
|
|
382
|
-
/**
|
|
383
|
-
* Stretch target inset from the left frame edge as a signed fraction
|
|
384
|
-
* (OOXML `a:stretch/a:fillRect/@l`). Unlike `cropLeft` (which selects a
|
|
385
|
-
* region of the SOURCE bitmap), a fill-rect selects the region of the
|
|
386
|
-
* FRAME the whole image is stretched into; negative values push the
|
|
387
|
-
* image beyond the frame edge, and the overflow is clipped.
|
|
388
|
-
*/
|
|
389
|
-
fillRectLeft?: number;
|
|
390
|
-
/** Stretch target inset from the top frame edge (`a:fillRect/@t`). */
|
|
391
|
-
fillRectTop?: number;
|
|
392
|
-
/** Stretch target inset from the right frame edge (`a:fillRect/@r`). */
|
|
393
|
-
fillRectRight?: number;
|
|
394
|
-
/** Stretch target inset from the bottom frame edge (`a:fillRect/@b`). */
|
|
395
|
-
fillRectBottom?: number;
|
|
396
|
-
/** Image tiling offset X in px. */
|
|
397
|
-
tileOffsetX?: number;
|
|
398
|
-
/** Image tiling offset Y in px. */
|
|
399
|
-
tileOffsetY?: number;
|
|
400
|
-
/** Image tiling scale X as percentage (100 = 100%). */
|
|
401
|
-
tileScaleX?: number;
|
|
402
|
-
/** Image tiling scale Y as percentage (100 = 100%). */
|
|
403
|
-
tileScaleY?: number;
|
|
404
|
-
/** Image tiling flip mode. */
|
|
405
|
-
tileFlip?: 'none' | 'x' | 'y' | 'xy';
|
|
406
|
-
/** Image tiling alignment. */
|
|
407
|
-
tileAlignment?: string;
|
|
408
|
-
/**
|
|
409
|
-
* Print-resolution hint in DPI (`a:blipFill/@dpi`). PowerPoint records this
|
|
410
|
-
* when it downsamples an embedded image for a target print quality; it has
|
|
411
|
-
* no on-screen rendering effect (a `0`/absent value means "use the source
|
|
412
|
-
* image's native resolution"). Parsed for round-trip / API fidelity only.
|
|
413
|
-
*/
|
|
414
|
-
dpi?: number;
|
|
415
|
-
/** Image recolour/artistic effect properties. */
|
|
416
|
-
imageEffects?: PptxImageEffects;
|
|
417
|
-
/**
|
|
418
|
-
* Crop-to-shape (CSS clip-path shape name).
|
|
419
|
-
*
|
|
420
|
-
* PowerPoint implements "Crop to Shape" by writing the picture's own
|
|
421
|
-
* `a:prstGeom`, so this is a typed view over `shapeType`: on load it is
|
|
422
|
-
* derived from the preset (`ellipse` -> `'ellipse'`, `roundRect` ->
|
|
423
|
-
* `'roundedRect'`, `star5` -> `'star'`, ...; see
|
|
424
|
-
* `utils/crop-shape-geometry`), and on save a changed value rewrites the
|
|
425
|
-
* preset. `'none'` / `undefined` leaves the geometry alone.
|
|
426
|
-
*/
|
|
427
|
-
cropShape?: PptxCropShape;
|
|
428
|
-
}
|
|
429
|
-
/** Format-neutral CT_ManualLayout values. Raw extensions stay with the source XML model. */
|
|
430
|
-
interface ChartManualLayout {
|
|
431
|
-
layoutTarget?: 'inner' | 'outer';
|
|
432
|
-
xMode?: 'edge' | 'factor';
|
|
433
|
-
yMode?: 'edge' | 'factor';
|
|
434
|
-
widthMode?: 'edge' | 'factor';
|
|
435
|
-
heightMode?: 'edge' | 'factor';
|
|
436
|
-
x?: number;
|
|
437
|
-
y?: number;
|
|
438
|
-
width?: number;
|
|
439
|
-
height?: number;
|
|
440
|
-
}
|
|
441
|
-
/** The readable name of a trendline type (`exp` -> `exponential`). */
|
|
442
|
-
type ChartTrendlineKind = 'linear' | 'exponential' | 'logarithmic' | 'polynomial' | 'power' | 'movingAvg';
|
|
443
|
-
/** ST_ErrDir. */
|
|
444
|
-
type ChartErrorBarDirection = 'x' | 'y';
|
|
445
|
-
/** ST_ErrBarType: both sides, the negative side or the positive side. */
|
|
446
|
-
type ChartErrorBarType = 'both' | 'minus' | 'plus';
|
|
447
|
-
/** ST_ErrValType: how the error amount is calculated. */
|
|
448
|
-
type ChartErrorValueType = 'cust' | 'fixedVal' | 'percentage' | 'stdDev' | 'stdErr';
|
|
449
|
-
/** Tick-mark placement from ChartML `ST_TickMark`. */
|
|
450
|
-
type PptxChartTickMark = 'cross' | 'in' | 'none' | 'out';
|
|
451
|
-
/** Typed axis tick and category/date label controls. */
|
|
452
|
-
interface PptxChartAxisLabelFormatting {
|
|
453
|
-
/** Primary and secondary tick-mark placement. */
|
|
454
|
-
majorTickMark?: PptxChartTickMark;
|
|
455
|
-
minorTickMark?: PptxChartTickMark;
|
|
456
|
-
/** Tick-label position from ChartML `ST_TickLblPos`. */
|
|
457
|
-
tickLblPos?: 'high' | 'low' | 'nextTo' | 'none';
|
|
458
|
-
/** Automatic category/date axis behavior (`c:auto`). */
|
|
459
|
-
auto?: boolean;
|
|
460
|
-
/** Category-axis label alignment (`c:lblAlgn`). */
|
|
461
|
-
labelAlignment?: 'ctr' | 'l' | 'r';
|
|
462
|
-
/** Category/date label distance, from 0 through 1000 percent. */
|
|
463
|
-
labelOffset?: number;
|
|
464
|
-
/** Number of category/date labels between rendered labels. */
|
|
465
|
-
tickLabelSkip?: number;
|
|
466
|
-
/** Number of category/date tick positions between major tick marks. */
|
|
467
|
-
tickMarkSkip?: number;
|
|
468
|
-
/** Suppress multi-level category labels (`c:noMultiLvlLbl`). */
|
|
469
|
-
noMultiLevelLabels?: boolean;
|
|
470
|
-
}
|
|
471
|
-
/** OOXML `a:fillToRect`, as 0-1 insets from each edge. */
|
|
472
|
-
interface RectPathGradientFillToRect {
|
|
473
|
-
l: number;
|
|
474
|
-
t: number;
|
|
475
|
-
r: number;
|
|
476
|
-
b: number;
|
|
477
|
-
}
|
|
478
|
-
interface ChartGradientFill {
|
|
479
|
-
type: 'linear' | 'radial';
|
|
480
|
-
stops: Array<{
|
|
481
|
-
color: string;
|
|
482
|
-
position: number;
|
|
483
|
-
opacity?: number;
|
|
484
|
-
}>;
|
|
485
|
-
angle?: number;
|
|
486
|
-
scaled?: boolean;
|
|
487
|
-
interpolation?: 'sigma-gamma22';
|
|
488
|
-
focalPoint?: {
|
|
489
|
-
x: number;
|
|
490
|
-
y: number;
|
|
491
|
-
};
|
|
492
|
-
path?: string;
|
|
493
|
-
fillToRect?: RectPathGradientFillToRect;
|
|
494
|
-
}
|
|
495
|
-
/**
|
|
496
|
-
* Chart-formatting types that don't fit an existing, owned type module for
|
|
497
|
-
* this wave (`types/chart.ts` is owned elsewhere; see its own module doc).
|
|
498
|
-
* Despite the file name, `PptxChartDataPointPicture` is a CLASSIC (`c:`)
|
|
499
|
-
* construct, not ChartEx (`cx:`) - it landed here only because it needs a
|
|
500
|
-
* home outside `chart.ts`.
|
|
501
|
-
*
|
|
502
|
-
* @module pptx-types/chart-ex
|
|
503
|
-
*/
|
|
504
|
-
/** `c:dPt/c:pictureOptions/c:pictureFormat/@val` (ST_PictureFormat). */
|
|
505
|
-
type PptxChartPictureFormat = 'stretch' | 'stack' | 'stackScale';
|
|
506
|
-
/**
|
|
507
|
-
* Per-data-point picture-fill flags (`c:dPt/c:pictureOptions`): PowerPoint's
|
|
508
|
-
* "Picture or texture fill" with "Stack"/"Stretch" semantics on a bar/column
|
|
509
|
-
* data point, distinct from the point's plain `c:spPr` solid/gradient fill.
|
|
510
|
-
*
|
|
511
|
-
* `c:pictureOptions` is optional: a point/series whose `c:spPr` carries a bare
|
|
512
|
-
* `a:blipFill` with NO `c:pictureOptions` sibling at all is still a fully
|
|
513
|
-
* legal, common picture fill (PowerPoint's own default "stretch, no stack"
|
|
514
|
-
* when the format pane never touched the stack settings); `parseChartDataPointPicture`
|
|
515
|
-
* synthesizes this descriptor (`pictureFormat: 'stretch'`) in that case so the
|
|
516
|
-
* SAME render pipeline resolves it, rather than silently dropping the fill.
|
|
517
|
-
*
|
|
518
|
-
* The flags parse purely (`parseChartDataPointPicture` in
|
|
519
|
-
* `utils/chart-datapoint-serializer.ts`); {@link imageUrl} is a separate,
|
|
520
|
-
* later addition populated by the runtime (`PptxHandlerRuntimeChartParsing.ts`)
|
|
521
|
-
* once the sibling `c:spPr/a:blipFill/a:blip`'s `r:embed`/`r:link` is resolved
|
|
522
|
-
* against the chart part's relationships, since that resolution needs zip/file
|
|
523
|
-
* access the pure parser does not have.
|
|
524
|
-
*/
|
|
525
|
-
interface PptxChartDataPointPicture {
|
|
526
|
-
/** Apply the picture to the front face of a 3-D bar/column (`c:applyToFront`). */
|
|
527
|
-
applyToFront?: boolean;
|
|
528
|
-
/** Apply the picture to the side faces of a 3-D bar/column (`c:applyToSides`). */
|
|
529
|
-
applyToSides?: boolean;
|
|
530
|
-
/** Apply the picture to the end face of a 3-D bar/column (`c:applyToEnd`). */
|
|
531
|
-
applyToEnd?: boolean;
|
|
532
|
-
/** Stretch, or stack repeated tiles at their natural size (or scaled). */
|
|
533
|
-
pictureFormat?: PptxChartPictureFormat;
|
|
534
|
-
/** Height, in points, of one repeated picture tile for "stack"/"stackScale" (`c:pictureStackUnit/@val`). */
|
|
535
|
-
pictureStackUnit?: number;
|
|
536
|
-
/**
|
|
537
|
-
* Resolved picture source (a `data:`/`blob:` URL) for the point's sibling
|
|
538
|
-
* `c:spPr/a:blipFill/a:blip`. Populated by the runtime after relationship
|
|
539
|
-
* resolution (C2-G9 render half); absent until then, and absent entirely
|
|
540
|
-
* when the point has no picture fill or the image could not be resolved.
|
|
541
|
-
*/
|
|
542
|
-
imageUrl?: string;
|
|
543
|
-
/**
|
|
544
|
-
* Effective opacity (0-1) from the blip's `a:alphaModFix/@amt` (a
|
|
545
|
-
* thousandths-of-a-percent value, so `amt="60000"` is `0.6`). `undefined`
|
|
546
|
-
* when the blip carries no `alphaModFix`, meaning fully opaque.
|
|
547
|
-
*/
|
|
548
|
-
opacity?: number;
|
|
549
|
-
}
|
|
550
|
-
type ChartFormatTarget = {
|
|
551
|
-
kind: 'chartArea';
|
|
552
|
-
} | {
|
|
553
|
-
kind: 'plotArea';
|
|
554
|
-
} | {
|
|
555
|
-
kind: 'title';
|
|
556
|
-
} | {
|
|
557
|
-
kind: 'legend';
|
|
558
|
-
} | {
|
|
559
|
-
kind: 'axis';
|
|
560
|
-
axisIndex: number;
|
|
561
|
-
} | {
|
|
562
|
-
kind: 'majorGridlines';
|
|
563
|
-
axisIndex: number;
|
|
564
|
-
} | {
|
|
565
|
-
kind: 'minorGridlines';
|
|
566
|
-
axisIndex: number;
|
|
567
|
-
} | {
|
|
568
|
-
kind: 'series';
|
|
569
|
-
seriesIndex: number;
|
|
570
|
-
} | {
|
|
571
|
-
kind: 'dataLabels';
|
|
572
|
-
seriesIndex?: number;
|
|
573
|
-
};
|
|
574
|
-
/** A {@link ChartFormatTarget} as a stable string. */
|
|
575
|
-
type ChartFormatTargetKey = string;
|
|
576
|
-
/** The key of `target`. */
|
|
577
|
-
declare function chartFormatTargetKey(target: ChartFormatTarget): ChartFormatTargetKey;
|
|
578
|
-
/** Parses a key back into a target, or `undefined` for an unknown key. */
|
|
579
|
-
declare function parseChartFormatTargetKey(key: ChartFormatTargetKey): ChartFormatTarget | undefined;
|
|
580
|
-
/**
|
|
581
|
-
* The chart element a Format pane targets.
|
|
582
|
-
*
|
|
583
|
-
* Axis and gridline targets name the axis by its index in
|
|
584
|
-
* `PptxChartData.axes`; series and data-label targets by the series index in
|
|
585
|
-
* `PptxChartData.series`. A data-label target without a series index covers
|
|
586
|
-
* every series (the chart-level "Data Labels" entry of the element picker).
|
|
587
|
-
*/
|
|
588
|
-
type PptxChartFormatTarget = ChartFormatTarget;
|
|
589
|
-
/**
|
|
590
|
-
* A {@link PptxChartFormatTarget} as a stable string (`chartArea`, `axis:1`,
|
|
591
|
-
* `series:0`, `dataLabels`, `dataLabels:2`, ...), used as the record key.
|
|
592
|
-
*/
|
|
593
|
-
type PptxChartFormatTargetKey = ChartFormatTargetKey;
|
|
594
|
-
/** `a:pattFill`: a preset pattern (`ST_PresetPatternVal`) in two colours. */
|
|
595
|
-
interface PptxChartPatternFill {
|
|
596
|
-
/** `@prst`, e.g. `pct20`, `ltUpDiag`, `smGrid`. */
|
|
597
|
-
preset: string;
|
|
598
|
-
/** Foreground (`a:fgClr`), `#RRGGBB`. */
|
|
599
|
-
foreground: string;
|
|
600
|
-
/** Background (`a:bgClr`), `#RRGGBB`. */
|
|
601
|
-
background: string;
|
|
602
|
-
}
|
|
603
|
-
/** `a:blipFill`: a picture fill. */
|
|
604
|
-
interface PptxChartPictureFill {
|
|
605
|
-
/**
|
|
606
|
-
* The image as a `data:` URL, what the renderer paints and what the save
|
|
607
|
-
* path embeds as a new media part. Absent until a loaded picture's
|
|
608
|
-
* relationship has been resolved.
|
|
609
|
-
*/
|
|
610
|
-
src?: string;
|
|
611
|
-
/**
|
|
612
|
-
* The chart part's relationship id (`a:blip/@r:embed`) of a loaded picture.
|
|
613
|
-
* A picture chosen in the pane has none until it is saved.
|
|
614
|
-
*/
|
|
615
|
-
relId?: string;
|
|
616
|
-
/** `a:tile` instead of `a:stretch` (PowerPoint's "Tile picture as texture"). */
|
|
617
|
-
tile?: boolean;
|
|
618
|
-
/** 0 through 100, written as `a:blip/a:alphaModFix/@amt`. */
|
|
619
|
-
transparency?: number;
|
|
620
|
-
}
|
|
621
|
-
/** Fill of a chart element (Fill section). */
|
|
622
|
-
interface PptxChartElementFill {
|
|
623
|
-
/**
|
|
624
|
-
* `none`: `a:noFill`. `solid`: `a:solidFill`. `gradient`: `a:gradFill`.
|
|
625
|
-
* `pattern`: `a:pattFill`. `picture`: `a:blipFill`. `automatic`: no fill
|
|
626
|
-
* element, so the chart style decides (PowerPoint's "Automatic").
|
|
627
|
-
*/
|
|
628
|
-
kind: 'none' | 'solid' | 'gradient' | 'pattern' | 'picture' | 'automatic';
|
|
629
|
-
/** `#RRGGBB`, for `solid`. */
|
|
630
|
-
color?: string;
|
|
631
|
-
/** 0 (opaque) through 100 (clear), written as `a:alpha`. */
|
|
632
|
-
transparency?: number;
|
|
633
|
-
/** For `gradient`. */
|
|
634
|
-
gradient?: ChartGradientFill;
|
|
635
|
-
/** For `pattern`. */
|
|
636
|
-
pattern?: PptxChartPatternFill;
|
|
637
|
-
/** For `picture`. */
|
|
638
|
-
picture?: PptxChartPictureFill;
|
|
639
|
-
}
|
|
640
|
-
/** Line end decoration (`a:headEnd` / `a:tailEnd` `@type`). */
|
|
641
|
-
type PptxChartLineEndType = 'none' | 'triangle' | 'stealth' | 'diamond' | 'oval' | 'arrow';
|
|
642
|
-
/** Border or line of a chart element (Border / Line section). */
|
|
643
|
-
interface PptxChartElementLine {
|
|
644
|
-
/**
|
|
645
|
-
* `none`: `a:ln/a:noFill`. `solid`: `a:ln/a:solidFill`. `gradient`:
|
|
646
|
-
* `a:ln/a:gradFill`. `automatic`: no line fill.
|
|
647
|
-
*/
|
|
648
|
-
kind: 'none' | 'solid' | 'gradient' | 'automatic';
|
|
649
|
-
color?: string;
|
|
650
|
-
/** For `gradient`. */
|
|
651
|
-
gradient?: ChartGradientFill;
|
|
652
|
-
/** 0 through 100, written as `a:alpha`. */
|
|
653
|
-
transparency?: number;
|
|
654
|
-
/** Width in points (`a:ln/@w`, EMU on disk). */
|
|
655
|
-
width?: number;
|
|
656
|
-
/** `a:prstDash/@val` (`solid`, `dash`, `sysDot`, `lgDashDot`, ...). */
|
|
657
|
-
dash?: string;
|
|
658
|
-
/** `a:ln/@cmpd`. */
|
|
659
|
-
compound?: 'sng' | 'dbl' | 'thickThin' | 'thinThick' | 'tri';
|
|
660
|
-
/** `a:ln/@cap`. */
|
|
661
|
-
cap?: 'rnd' | 'sq' | 'flat';
|
|
662
|
-
/** `a:round` / `a:bevel` / `a:miter`. */
|
|
663
|
-
join?: 'round' | 'bevel' | 'miter';
|
|
664
|
-
/** `a:headEnd/@type`. */
|
|
665
|
-
beginArrow?: PptxChartLineEndType;
|
|
666
|
-
/** `a:tailEnd/@type`. */
|
|
667
|
-
endArrow?: PptxChartLineEndType;
|
|
668
|
-
}
|
|
669
|
-
/** `a:outerShdw`. */
|
|
670
|
-
interface PptxChartElementShadow {
|
|
671
|
-
color: string;
|
|
672
|
-
/** 0 through 100. */
|
|
673
|
-
transparency?: number;
|
|
674
|
-
/** Blur radius in points. */
|
|
675
|
-
blur: number;
|
|
676
|
-
/** Distance in points. */
|
|
677
|
-
distance: number;
|
|
678
|
-
/** Direction in degrees, clockwise from the positive x axis. */
|
|
679
|
-
angle: number;
|
|
680
|
-
}
|
|
681
|
-
/** `a:glow`. */
|
|
682
|
-
interface PptxChartElementGlow {
|
|
683
|
-
color: string;
|
|
684
|
-
/** 0 through 100. */
|
|
685
|
-
transparency?: number;
|
|
686
|
-
/** Radius (size) in points. */
|
|
687
|
-
radius: number;
|
|
688
|
-
}
|
|
689
|
-
/** Effects section: each `null` removes the effect, `undefined` leaves it as authored. */
|
|
690
|
-
interface PptxChartElementEffects {
|
|
691
|
-
shadow?: PptxChartElementShadow | null;
|
|
692
|
-
glow?: PptxChartElementGlow | null;
|
|
693
|
-
/** Soft-edge radius in points (`a:softEdge/@rad`). */
|
|
694
|
-
softEdge?: number | null;
|
|
695
|
-
}
|
|
696
|
-
/** `ST_BevelPresetType`. */
|
|
697
|
-
type PptxChartBevelType = 'relaxedInset' | 'circle' | 'slope' | 'cross' | 'angle' | 'softRound' | 'convex' | 'coolSlant' | 'divot' | 'riblet' | 'hardEdge' | 'artDeco';
|
|
698
|
-
/** `a:bevelT` / `a:bevelB`. */
|
|
699
|
-
interface PptxChartBevel {
|
|
700
|
-
type: PptxChartBevelType;
|
|
701
|
-
/** Width in points (`@w`). */
|
|
702
|
-
width: number;
|
|
703
|
-
/** Height in points (`@h`). */
|
|
704
|
-
height: number;
|
|
705
|
-
}
|
|
706
|
-
/**
|
|
707
|
-
* 3-D Format section: `a:sp3d` (bevels, depth, contour, material) and the
|
|
708
|
-
* lighting rig of `a:scene3d`. Each `null` removes the setting, `undefined`
|
|
709
|
-
* leaves it as authored.
|
|
710
|
-
*/
|
|
711
|
-
interface PptxChartElementThreeD {
|
|
712
|
-
bevelTop?: PptxChartBevel | null;
|
|
713
|
-
bevelBottom?: PptxChartBevel | null;
|
|
714
|
-
/** Depth (`@extrusionH`, points) and its colour (`a:extrusionClr`). */
|
|
715
|
-
depth?: {
|
|
716
|
-
size: number;
|
|
717
|
-
color?: string;
|
|
718
|
-
} | null;
|
|
719
|
-
/** Contour (`@contourW`, points) and its colour (`a:contourClr`). */
|
|
720
|
-
contour?: {
|
|
721
|
-
size: number;
|
|
722
|
-
color?: string;
|
|
723
|
-
} | null;
|
|
724
|
-
/** `@prstMaterial` (`ST_PresetMaterialType`, e.g. `warmMatte`, `metal`, `plastic`). */
|
|
725
|
-
material?: string | null;
|
|
726
|
-
/** `a:scene3d/a:lightRig/@rig` (`ST_LightRigType`, e.g. `threePt`, `balanced`). */
|
|
727
|
-
lighting?: string | null;
|
|
728
|
-
}
|
|
729
|
-
/** Text fill of the Text Options pane (`a:defRPr` / `a:rPr` fill). */
|
|
730
|
-
interface PptxChartTextFill {
|
|
731
|
-
kind: 'none' | 'solid' | 'gradient' | 'automatic';
|
|
732
|
-
color?: string;
|
|
733
|
-
transparency?: number;
|
|
734
|
-
gradient?: ChartGradientFill;
|
|
735
|
-
}
|
|
736
|
-
/** Text outline (`a:defRPr/a:ln`). */
|
|
737
|
-
interface PptxChartTextOutline {
|
|
738
|
-
kind: 'none' | 'solid' | 'automatic';
|
|
739
|
-
color?: string;
|
|
740
|
-
transparency?: number;
|
|
741
|
-
/** Width in points. */
|
|
742
|
-
width?: number;
|
|
743
|
-
dash?: string;
|
|
744
|
-
}
|
|
745
|
-
/**
|
|
746
|
-
* Text Options of an element with text (title, legend, axis labels, data
|
|
747
|
-
* labels, or the chart area for every chart text): `c:txPr` (and a title's
|
|
748
|
-
* rich text runs). Each `null` removes the setting, `undefined` leaves it.
|
|
749
|
-
*/
|
|
750
|
-
interface PptxChartElementText {
|
|
751
|
-
fill?: PptxChartTextFill;
|
|
752
|
-
outline?: PptxChartTextOutline;
|
|
753
|
-
/** Text shadow and glow (`a:defRPr/a:effectLst`). */
|
|
754
|
-
effects?: Pick<PptxChartElementEffects, 'shadow' | 'glow'>;
|
|
755
|
-
/** Custom angle in degrees (`a:bodyPr/@rot`). */
|
|
756
|
-
rotation?: number | null;
|
|
757
|
-
/** Text direction (`a:bodyPr/@vert`). */
|
|
758
|
-
direction?: 'horz' | 'vert' | 'vert270' | 'wordArtVert' | null;
|
|
759
|
-
/** Vertical alignment (`a:bodyPr/@anchor`). */
|
|
760
|
-
anchor?: 't' | 'ctr' | 'b' | null;
|
|
761
|
-
}
|
|
762
|
-
/**
|
|
763
|
-
* The pane edits recorded for one element. Each section present replaces
|
|
764
|
-
* that part of the element's `c:spPr`; an absent section is left as authored.
|
|
765
|
-
* `reset` (Reset to Match Style) drops the element's `c:spPr` so the chart
|
|
766
|
-
* style draws it again; later edits recorded after a reset apply on top.
|
|
767
|
-
*/
|
|
768
|
-
interface PptxChartElementFormat {
|
|
769
|
-
fill?: PptxChartElementFill;
|
|
770
|
-
line?: PptxChartElementLine;
|
|
771
|
-
effects?: PptxChartElementEffects;
|
|
772
|
-
threeD?: PptxChartElementThreeD;
|
|
773
|
-
text?: PptxChartElementText;
|
|
774
|
-
reset?: boolean;
|
|
775
|
-
}
|
|
776
|
-
/** Element formats by target key. */
|
|
777
|
-
type PptxChartElementFormats = Record<PptxChartFormatTargetKey, PptxChartElementFormat>;
|
|
778
|
-
interface PptxChartPivotFormat {
|
|
779
|
-
index: number;
|
|
780
|
-
/**
|
|
781
|
-
* Typed projection of `spPr` (fill/stroke colour, stroke width, dash
|
|
782
|
-
* style). When the parser is given a colour resolver (the normal case: the
|
|
783
|
-
* runtime always supplies one), both a literal `a:srgbClr` and an
|
|
784
|
-
* `a:schemeClr` theme reference (with its `lumMod`/`lumOff`/`tint`/`shade`
|
|
785
|
-
* modifiers) resolve to a hex colour here, the same theme +
|
|
786
|
-
* `c:clrMapOvr` chain the rest of chart parsing uses. Without a resolver
|
|
787
|
-
* (e.g. a hand-built `PptxChartPivotFormat` with no theme to resolve
|
|
788
|
-
* against), only the literal case resolves. Either way the authored node
|
|
789
|
-
* is byte-preserved through {@link shapePropertiesXml} until this field is
|
|
790
|
-
* set to something that no longer matches what re-parses off the current
|
|
791
|
-
* XML; setting it then re-derives `shapePropertiesXml` on save (merged
|
|
792
|
-
* onto whatever was already authored, keeping an unrelated schemeClr
|
|
793
|
-
* reference alive when the colour itself is unchanged) unless
|
|
794
|
-
* `shapePropertiesXml` is set explicitly, which wins.
|
|
795
|
-
*/
|
|
796
|
-
shapeProperties?: PptxChartShapeProps;
|
|
797
|
-
/**
|
|
798
|
-
* Typed projection of `txPr`'s `a:p/a:pPr/a:defRPr` (size/bold/italic/
|
|
799
|
-
* colour/family), the same shape a legend entry or data-table's text
|
|
800
|
-
* override models. Colour resolution mirrors {@link shapeProperties}
|
|
801
|
-
* (theme-resolved `schemeClr` when a colour resolver is supplied, literal
|
|
802
|
-
* `srgbClr` otherwise). See {@link txPrXml} for the raw fallback.
|
|
803
|
-
*/
|
|
804
|
-
textStyle?: PptxChartLegendTextStyle;
|
|
805
|
-
/**
|
|
806
|
-
* Typed projection of `marker` (symbol/size/spPr). See {@link markerXml}
|
|
807
|
-
* for the raw fallback.
|
|
808
|
-
*/
|
|
809
|
-
marker?: PptxChartMarker;
|
|
810
|
-
shapePropertiesXml?: XmlObject | null;
|
|
811
|
-
txPrXml?: XmlObject | null;
|
|
812
|
-
markerXml?: XmlObject | null;
|
|
813
|
-
dataLabelXml?: XmlObject | null;
|
|
814
|
-
extensionListXml?: XmlObject | null;
|
|
815
|
-
rawXml?: XmlObject;
|
|
816
|
-
}
|
|
817
|
-
/** Editable classic ChartML `c:pivotFmts` collection. */
|
|
818
|
-
interface PptxChartPivotFormats {
|
|
819
|
-
formats: PptxChartPivotFormat[];
|
|
820
|
-
rawXml?: XmlObject;
|
|
821
|
-
}
|
|
822
|
-
/** Editable classic ChartML `c:pivotSource` metadata. */
|
|
823
|
-
interface PptxChartPivotSource {
|
|
824
|
-
/** Pivot table reference stored as `c:name` text. */
|
|
825
|
-
name: string;
|
|
826
|
-
/** Required unsigned format identifier stored in `c:fmtId/@val`. */
|
|
827
|
-
formatId: number;
|
|
828
|
-
/** Internal source subtree used to preserve extensions and foreign markup. */
|
|
829
|
-
rawXml?: XmlObject;
|
|
830
|
-
}
|
|
831
|
-
/** Headers and footers used when a classic ChartML chart is printed. */
|
|
832
|
-
interface PptxChartPrintHeaderFooter {
|
|
833
|
-
oddHeader?: string;
|
|
834
|
-
oddFooter?: string;
|
|
835
|
-
evenHeader?: string;
|
|
836
|
-
evenFooter?: string;
|
|
837
|
-
firstHeader?: string;
|
|
838
|
-
firstFooter?: string;
|
|
839
|
-
alignWithMargins?: boolean;
|
|
840
|
-
differentOddEven?: boolean;
|
|
841
|
-
differentFirst?: boolean;
|
|
842
|
-
/** Original subtree retained for foreign attributes and extension children. */
|
|
843
|
-
rawXml?: unknown;
|
|
844
|
-
}
|
|
845
|
-
/** Required page margins from ChartML `c:pageMargins`, measured in inches. */
|
|
846
|
-
interface PptxChartPageMargins {
|
|
847
|
-
left: number;
|
|
848
|
-
right: number;
|
|
849
|
-
top: number;
|
|
850
|
-
bottom: number;
|
|
851
|
-
header: number;
|
|
852
|
-
footer: number;
|
|
853
|
-
/** Original leaf retained for foreign attributes. */
|
|
854
|
-
rawXml?: unknown;
|
|
855
|
-
}
|
|
856
|
-
/** Printer page configuration from ChartML `c:pageSetup`. */
|
|
857
|
-
interface PptxChartPageSetup {
|
|
858
|
-
paperSize?: number;
|
|
859
|
-
firstPageNumber?: number;
|
|
860
|
-
orientation?: 'default' | 'portrait' | 'landscape';
|
|
861
|
-
blackAndWhite?: boolean;
|
|
862
|
-
draft?: boolean;
|
|
863
|
-
useFirstPageNumber?: boolean;
|
|
864
|
-
horizontalDpi?: number;
|
|
865
|
-
verticalDpi?: number;
|
|
866
|
-
copies?: number;
|
|
867
|
-
/**
|
|
868
|
-
* Custom paper height, used when {@link paperSize} is `0`
|
|
869
|
-
* (`c:pageSetup/@paperHeight`, ST_PositiveUniversalMeasure, e.g. `"297mm"`).
|
|
870
|
-
* Kept as the raw measure string rather than converted, matching how the
|
|
871
|
-
* schema stores it.
|
|
872
|
-
*/
|
|
873
|
-
paperHeight?: string;
|
|
874
|
-
/** Custom paper width, used when {@link paperSize} is `0` (`@paperWidth`). */
|
|
875
|
-
paperWidth?: string;
|
|
876
|
-
/** Original leaf retained for foreign attributes. */
|
|
877
|
-
rawXml?: unknown;
|
|
878
|
-
}
|
|
879
|
-
/** Editable `c:printSettings` content from a classic ChartML chart space. */
|
|
880
|
-
interface PptxChartPrintSettings {
|
|
881
|
-
headerFooter?: PptxChartPrintHeaderFooter | null;
|
|
882
|
-
pageMargins?: PptxChartPageMargins | null;
|
|
883
|
-
pageSetup?: PptxChartPageSetup | null;
|
|
884
|
-
/** `null` removes the legacy header/footer drawing relationship element. */
|
|
885
|
-
legacyDrawingHeaderFooterRelationshipId?: string | null;
|
|
886
|
-
/** Original subtree retained for unknown and extension content. */
|
|
887
|
-
rawXml?: unknown;
|
|
888
|
-
}
|
|
889
|
-
/** Editable classic ChartML `c:protection` settings. */
|
|
890
|
-
interface PptxChartProtection {
|
|
891
|
-
/** Prevent editing the chart object. */
|
|
892
|
-
chartObject?: boolean | null;
|
|
893
|
-
/** Prevent editing the chart data. */
|
|
894
|
-
data?: boolean | null;
|
|
895
|
-
/** Prevent editing chart formatting. */
|
|
896
|
-
formatting?: boolean | null;
|
|
897
|
-
/** Prevent selecting chart elements. */
|
|
898
|
-
selection?: boolean | null;
|
|
899
|
-
/** Prevent chart user-interface operations. */
|
|
900
|
-
userInterface?: boolean | null;
|
|
901
|
-
/** Internal source subtree used to preserve foreign markup during edits. */
|
|
902
|
-
rawXml?: XmlObject;
|
|
903
|
-
}
|
|
904
|
-
/** Chart elements consumed by the current Office chart painters. */
|
|
905
|
-
declare const CHART_STYLE_PARTS: readonly ['title', 'axisTitle', 'categoryAxis', 'valueAxis', 'legend', 'dataLabel', 'dataPoint', 'dataPointLine', 'gridlineMajor', 'gridlineMinor', 'chartArea', 'plotArea'];
|
|
906
|
-
type ChartStylePart = (typeof CHART_STYLE_PARTS)[number];
|
|
907
|
-
/** Resolved subset consumed by existing chart painters, with sizes and widths in points. */
|
|
908
|
-
interface ResolvedChartStyleEntry {
|
|
909
|
-
fontSize?: number;
|
|
910
|
-
bold?: boolean;
|
|
911
|
-
italic?: boolean;
|
|
912
|
-
underline?: boolean;
|
|
913
|
-
color?: string;
|
|
914
|
-
lineColor?: string;
|
|
915
|
-
lineWidth?: number;
|
|
916
|
-
fillColor?: string;
|
|
917
|
-
}
|
|
918
|
-
type ResolvedChartStyleDefinition = Partial<Record<ChartStylePart, ResolvedChartStyleEntry>>;
|
|
919
|
-
/**
|
|
920
|
-
* Chart title rich-text run type, split out of `types/chart.ts` (already at
|
|
921
|
-
* the repo's file-size limit) to keep that module from growing further.
|
|
922
|
-
*
|
|
923
|
-
* @module pptx-types/chart-title
|
|
924
|
-
*/
|
|
925
|
-
/**
|
|
926
|
-
* One run of a chart title's rich text (`c:title/c:tx/c:rich/a:p/a:r`).
|
|
927
|
-
*
|
|
928
|
-
* The flat `PptxChartData.title` field only ever captured the FIRST run's
|
|
929
|
-
* text with no per-run formatting; `titleRuns` (when present) is the
|
|
930
|
-
* lossless, multi-run replacement parsed from the same `c:rich` body. Absent
|
|
931
|
-
* when the title has no rich text at all (an empty/auto title, or one
|
|
932
|
-
* authored as a linked-cell reference).
|
|
933
|
-
*/
|
|
934
|
-
interface PptxChartTitleRun {
|
|
935
|
-
/** This run's text (`a:t`). */
|
|
936
|
-
text: string;
|
|
937
|
-
/** `a:rPr/@_b`. */
|
|
938
|
-
bold?: boolean;
|
|
939
|
-
/** `a:rPr/@_i`. */
|
|
940
|
-
italic?: boolean;
|
|
941
|
-
/**
|
|
942
|
-
* Font size in POINTS (`a:rPr/@_sz`, hundredths of a point / 100), matching
|
|
943
|
-
* `PptxChartLegendTextStyle.fontSize`'s convention rather than the pixel
|
|
944
|
-
* convention `TextStyle.fontSize` uses for slide text.
|
|
945
|
-
*/
|
|
946
|
-
fontSize?: number;
|
|
947
|
-
/** Resolved hex colour (e.g. `"#FF0000"`) from `a:rPr/a:solidFill`. */
|
|
948
|
-
color?: string;
|
|
949
|
-
}
|
|
950
|
-
/** A single paragraph of overlay-shape text with light formatting. */
|
|
951
|
-
interface PptxChartUserShapeParagraph {
|
|
952
|
-
/** Joined run text of the paragraph. */
|
|
953
|
-
text: string;
|
|
954
|
-
/** Font size in points (`a:rPr/@sz` divided by 100), when present. */
|
|
955
|
-
fontSize?: number;
|
|
956
|
-
/** Whether the first run is bold (`a:rPr/@b`). */
|
|
957
|
-
bold?: boolean;
|
|
958
|
-
/** Whether the first run is italic (`a:rPr/@i`). */
|
|
959
|
-
italic?: boolean;
|
|
960
|
-
/** Resolved run colour hex (e.g. `"#FF0000"`), when present. */
|
|
961
|
-
color?: string;
|
|
962
|
-
/** Paragraph alignment (`a:pPr/@algn`): left / centre / right. */
|
|
963
|
-
align?: 'l' | 'ctr' | 'r';
|
|
964
|
-
}
|
|
965
|
-
/**
|
|
966
|
-
* The DrawingML 2D group transform (`a:xfrm` inside `cdr:grpSpPr`) that
|
|
967
|
-
* anchors a `grpSp`'s own box ({@link off}/{@link ext}) and establishes the
|
|
968
|
-
* coordinate space its children are expressed in ({@link chOff}/{@link
|
|
969
|
-
* chExt}), all in EMU. A child's position within the group is mapped into
|
|
970
|
-
* the group's own box via
|
|
971
|
-
* `frac = (child.off - chOff) / chExt`, then applied to the enclosing
|
|
972
|
-
* anchor's box; see `flattenChartUserShapes` in
|
|
973
|
-
* `chart-user-shapes-parser.ts`.
|
|
974
|
-
*/
|
|
975
|
-
interface PptxChartUserShapeGroupTransform {
|
|
976
|
-
/** The group's own position in its parent's coordinate space, in EMU. */
|
|
977
|
-
off: {
|
|
978
|
-
x: number;
|
|
979
|
-
y: number;
|
|
980
|
-
};
|
|
981
|
-
/** The group's own size in its parent's coordinate space, in EMU. */
|
|
982
|
-
ext: {
|
|
983
|
-
cx: number;
|
|
984
|
-
cy: number;
|
|
985
|
-
};
|
|
986
|
-
/** Origin of the child coordinate space (`a:chOff`), in EMU. */
|
|
987
|
-
chOff: {
|
|
988
|
-
x: number;
|
|
989
|
-
y: number;
|
|
990
|
-
};
|
|
991
|
-
/** Size of the child coordinate space (`a:chExt`), in EMU. */
|
|
992
|
-
chExt: {
|
|
993
|
-
cx: number;
|
|
994
|
-
cy: number;
|
|
995
|
-
};
|
|
996
|
-
/**
|
|
997
|
-
* The group's own rotation in degrees (`a:xfrm/@rot`, stored in 60,000ths
|
|
998
|
-
* of a degree), when present. Rotates the whole group, and everything
|
|
999
|
-
* grouped inside it, as a rigid body about the CENTRE of the group's own
|
|
1000
|
-
* box ({@link off}/{@link ext}); see `flattenChartUserShapes` in
|
|
1001
|
-
* `chart-user-shapes-parser.ts` for how this composes onto each contained
|
|
1002
|
-
* leaf's own {@link PptxChartUserShapeGroupChild.rotation}. Verified
|
|
1003
|
-
* against real PowerPoint (COM): a `cdr:grpSp`'s `cdr:grpSpPr/a:xfrm` does
|
|
1004
|
-
* carry `rot` the same way an ordinary shape's does.
|
|
1005
|
-
*/
|
|
1006
|
-
rotation?: number;
|
|
1007
|
-
/** The group's own horizontal flip (`a:xfrm/@flipH`), when present; composes onto children by XOR, see {@link rotation}'s doc. */
|
|
1008
|
-
flipH?: boolean;
|
|
1009
|
-
/** The group's own vertical flip (`a:xfrm/@flipV`), when present; composes onto children by XOR, see {@link rotation}'s doc. */
|
|
1010
|
-
flipV?: boolean;
|
|
1011
|
-
}
|
|
1012
|
-
/**
|
|
1013
|
-
* One shape grouped inside a `cdr:grpSp` (or a nested `cdr:grpSp` itself).
|
|
1014
|
-
* Unlike a top-level {@link PptxChartUserShape}, a group child has no
|
|
1015
|
-
* drawing anchor of its own: its position is expressed in its parent
|
|
1016
|
-
* group's child coordinate space via {@link off}/{@link ext} (EMU, read
|
|
1017
|
-
* from the child's own `a:xfrm`), not as a chart-relative fraction.
|
|
1018
|
-
*/
|
|
1019
|
-
interface PptxChartUserShapeGroupChild {
|
|
1020
|
-
/** Shape kind, same vocabulary as {@link PptxChartUserShape.kind}. */
|
|
1021
|
-
kind: 'sp' | 'cxnSp' | 'pic' | 'grpSp' | 'graphicFrame';
|
|
1022
|
-
/** Position within the parent group's child coordinate space, in EMU. */
|
|
1023
|
-
off: {
|
|
1024
|
-
x: number;
|
|
1025
|
-
y: number;
|
|
1026
|
-
};
|
|
1027
|
-
/** Size within the parent group's child coordinate space, in EMU. */
|
|
1028
|
-
ext: {
|
|
1029
|
-
cx: number;
|
|
1030
|
-
cy: number;
|
|
1031
|
-
};
|
|
1032
|
-
/** Preset geometry name (`a:prstGeom/@prst`), defaulting to `"rect"`. */
|
|
1033
|
-
prst?: string;
|
|
1034
|
-
/** Resolved solid-fill hex colour, when present. */
|
|
1035
|
-
fill?: string;
|
|
1036
|
-
/** Resolved line/stroke hex colour, when present. */
|
|
1037
|
-
stroke?: string;
|
|
1038
|
-
/** Line width in points (`a:ln/@w` divided by 12700), when present. */
|
|
1039
|
-
strokeWidth?: number;
|
|
1040
|
-
/** Text paragraphs of the shape's `txBody`, when present. */
|
|
1041
|
-
paragraphs?: PptxChartUserShapeParagraph[];
|
|
1042
|
-
/**
|
|
1043
|
-
* A `pic` child's alt text (`cdr:nvPicPr/cdr:cNvPr/@descr`), when present.
|
|
1044
|
-
* Editable independently of {@link rawXml}'s otherwise-verbatim content:
|
|
1045
|
-
* the serializer patches only this attribute onto the cloned raw node.
|
|
1046
|
-
*/
|
|
1047
|
-
altText?: string;
|
|
1048
|
-
/**
|
|
1049
|
-
* This child's OWN rotation in degrees (`a:xfrm/@rot`), when present.
|
|
1050
|
-
* Composes with every enclosing group's own
|
|
1051
|
-
* {@link PptxChartUserShapeGroupTransform.rotation} (added) to produce the
|
|
1052
|
-
* leaf's final on-screen rotation; see `flattenChartUserShapes`.
|
|
1053
|
-
*/
|
|
1054
|
-
rotation?: number;
|
|
1055
|
-
/** This child's OWN horizontal flip (`a:xfrm/@flipH`); composes with an ancestor group's flip by XOR. */
|
|
1056
|
-
flipH?: boolean;
|
|
1057
|
-
/** This child's OWN vertical flip (`a:xfrm/@flipV`); composes with an ancestor group's flip by XOR. */
|
|
1058
|
-
flipV?: boolean;
|
|
1059
|
-
/**
|
|
1060
|
-
* Verbatim source XML of a `pic`/`graphicFrame` child, or of this node
|
|
1061
|
-
* itself when `kind === 'grpSp'` and the nested group is untouched since
|
|
1062
|
-
* parse. See {@link PptxChartUserShape.rawXml}'s doc for the same
|
|
1063
|
-
* contract one level up.
|
|
1064
|
-
*/
|
|
1065
|
-
rawXml?: XmlObject;
|
|
1066
|
-
/** Present when `kind === 'grpSp'`: this nested group's own transform. */
|
|
1067
|
-
transform?: PptxChartUserShapeGroupTransform;
|
|
1068
|
-
/** Present when `kind === 'grpSp'`: this nested group's own children. */
|
|
1069
|
-
children?: PptxChartUserShapeGroupChild[];
|
|
1070
|
-
}
|
|
1071
|
-
/**
|
|
1072
|
-
* A parsed chart-overlay shape positioned by a drawing anchor.
|
|
1073
|
-
*
|
|
1074
|
-
* Position is expressed as chart-relative fractions in {@link from}. For a
|
|
1075
|
-
* `relSizeAnchor` the opposite corner is {@link to} (also fractional); for an
|
|
1076
|
-
* `absSizeAnchor` the extent is {@link ext} in EMU.
|
|
1077
|
-
*/
|
|
1078
|
-
interface PptxChartUserShape {
|
|
1079
|
-
/**
|
|
1080
|
-
* Shape kind: text/preset shape, connector, picture, a group of the
|
|
1081
|
-
* above (`grpSp`, with its own {@link transform} and {@link children},
|
|
1082
|
-
* nested arbitrarily; use `flattenChartUserShapes` from
|
|
1083
|
-
* `chart-user-shapes-parser.ts` to get a flat, render-ready leaf list
|
|
1084
|
-
* with the group transform already applied), or a bare placeholder for
|
|
1085
|
-
* a `graphicFrame` anchor child (deep content such as a nested chart or
|
|
1086
|
-
* table is out of scope; it only keeps the anchor's space accounted for
|
|
1087
|
-
* instead of the whole overlay disappearing).
|
|
1088
|
-
*/
|
|
1089
|
-
kind: 'sp' | 'cxnSp' | 'pic' | 'grpSp' | 'graphicFrame';
|
|
1090
|
-
/** Anchor kind that positioned the shape. */
|
|
1091
|
-
anchor: 'rel' | 'abs';
|
|
1092
|
-
/** Top-left corner as chart-relative fractions (0-1). */
|
|
1093
|
-
from: {
|
|
1094
|
-
x: number;
|
|
1095
|
-
y: number;
|
|
1096
|
-
};
|
|
1097
|
-
/** Bottom-right corner as chart-relative fractions (0-1); relSizeAnchor only. */
|
|
1098
|
-
to?: {
|
|
1099
|
-
x: number;
|
|
1100
|
-
y: number;
|
|
1101
|
-
};
|
|
1102
|
-
/** Extent in EMU (cx, cy); absSizeAnchor only. */
|
|
1103
|
-
ext?: {
|
|
1104
|
-
cx: number;
|
|
1105
|
-
cy: number;
|
|
1106
|
-
};
|
|
1107
|
-
/** Preset geometry name (`a:prstGeom/@prst`), defaulting to `"rect"`. */
|
|
1108
|
-
prst?: string;
|
|
1109
|
-
/** Resolved solid-fill hex colour, when present. */
|
|
1110
|
-
fill?: string;
|
|
1111
|
-
/** Resolved line/stroke hex colour, when present. */
|
|
1112
|
-
stroke?: string;
|
|
1113
|
-
/** Line width in points (`a:ln/@w` divided by 12700), when present. */
|
|
1114
|
-
strokeWidth?: number;
|
|
1115
|
-
/** Text paragraphs of the shape's `txBody`, when present. */
|
|
1116
|
-
paragraphs?: PptxChartUserShapeParagraph[];
|
|
1117
|
-
/**
|
|
1118
|
-
* A `pic` anchor's alt text (`cdr:nvPicPr/cdr:cNvPr/@descr`), when
|
|
1119
|
-
* present. Editable independently of {@link rawXml}'s otherwise-verbatim
|
|
1120
|
-
* content: the serializer patches only this attribute onto the cloned
|
|
1121
|
-
* raw node, so a picture's blip and other markup are untouched.
|
|
1122
|
-
*/
|
|
1123
|
-
altText?: string;
|
|
1124
|
-
/**
|
|
1125
|
-
* This shape's OWN rotation in degrees (`a:xfrm/@rot`, on `spPr/a:xfrm`
|
|
1126
|
-
* for `sp`/`cxnSp`/`pic`, or directly on a top-level `graphicFrame`'s own
|
|
1127
|
-
* `a:xfrm`), when present. A top-level anchor's position/size is governed
|
|
1128
|
-
* by {@link from}/{@link to}/{@link ext}, never by this `a:xfrm`'s own
|
|
1129
|
-
* `off`/`ext` (see {@link rawXml}'s doc), but `rot`/`flipH`/`flipV` on that
|
|
1130
|
-
* same `a:xfrm` DO apply visually: verified against real PowerPoint (COM),
|
|
1131
|
-
* which writes e.g. `<a:xfrm rot="1800000"><a:off .../><a:ext .../></a:xfrm>`
|
|
1132
|
-
* on a rotated overlay shape's `spPr`, with the `off`/`ext` values
|
|
1133
|
-
* unrelated to the anchor's own `cdr:from`/`cdr:to`.
|
|
1134
|
-
*/
|
|
1135
|
-
rotation?: number;
|
|
1136
|
-
/** This shape's OWN horizontal flip (`a:xfrm/@flipH`); see {@link rotation}'s doc. */
|
|
1137
|
-
flipH?: boolean;
|
|
1138
|
-
/** This shape's OWN vertical flip (`a:xfrm/@flipV`); see {@link rotation}'s doc. */
|
|
1139
|
-
flipV?: boolean;
|
|
1140
|
-
/**
|
|
1141
|
-
* Verbatim source XML of a `pic` or `graphicFrame` anchor child (the
|
|
1142
|
-
* `cdr:pic` / `cdr:graphicFrame` node itself, not the enclosing anchor),
|
|
1143
|
-
* or of the `cdr:grpSp` node itself when `kind === 'grpSp'` and the
|
|
1144
|
-
* group is untouched since parse (byte-identical passthrough). None of
|
|
1145
|
-
* these three kinds have a reconstructable typed representation that is
|
|
1146
|
-
* guaranteed lossless (a picture's blip reference, a nested chart/table's
|
|
1147
|
-
* graphic content, or a group's exact child ordering/ids), so the
|
|
1148
|
-
* serializer re-emits this verbatim when present instead of a lossy
|
|
1149
|
-
* rebuild. Editing a shape inside a group (via the SDK's path-based
|
|
1150
|
-
* overlay operations) clears the group's `rawXml` so the serializer
|
|
1151
|
-
* regenerates it from {@link transform}/{@link children} instead. Absent
|
|
1152
|
-
* for `sp`/`cxnSp`, which round-trip losslessly through their typed
|
|
1153
|
-
* fields above.
|
|
1154
|
-
*/
|
|
1155
|
-
rawXml?: XmlObject;
|
|
1156
|
-
/** Present when `kind === 'grpSp'`: the group's own transform. */
|
|
1157
|
-
transform?: PptxChartUserShapeGroupTransform;
|
|
1158
|
-
/** Present when `kind === 'grpSp'`: the grouped children, nested arbitrarily. */
|
|
1159
|
-
children?: PptxChartUserShapeGroupChild[];
|
|
1160
|
-
}
|
|
1161
|
-
/**
|
|
1162
|
-
* Supported chart type discriminators.
|
|
1163
|
-
*
|
|
1164
|
-
* @example
|
|
1165
|
-
* ```ts
|
|
1166
|
-
* const type: PptxChartType = "bar";
|
|
1167
|
-
* // => "bar": one of: "bar" | "line" | "pie" | "doughnut" | "area" | "scatter" | …
|
|
1168
|
-
* ```
|
|
1169
|
-
*/
|
|
1170
|
-
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';
|
|
1171
|
-
/**
|
|
1172
|
-
* Bar series direction (OOXML `ST_BarDir`): `"col"` is a vertical column
|
|
1173
|
-
* chart, `"bar"` a horizontal bar chart.
|
|
1174
|
-
*
|
|
1175
|
-
* @example
|
|
1176
|
-
* ```ts
|
|
1177
|
-
* const dir: PptxChartBarDirection = "col";
|
|
1178
|
-
* // => "col" - one of: "col" | "bar"
|
|
1179
|
-
* ```
|
|
1180
|
-
*/
|
|
1181
|
-
type PptxChartBarDirection = 'col' | 'bar';
|
|
1182
|
-
/**
|
|
1183
|
-
* 3-D bar/column shape (OOXML `ST_Shape`, `c:bar3DChart/c:shape/@val` or a
|
|
1184
|
-
* per-series `c:ser/c:shape` override). `coneToMax` / `pyramidToMax` scale
|
|
1185
|
-
* the cone/pyramid so it reaches full height at the value axis maximum,
|
|
1186
|
-
* appearing truncated below it; the plain `cone`/`pyramid` always come to a
|
|
1187
|
-
* full point at the bar's own value.
|
|
1188
|
-
*
|
|
1189
|
-
* @example
|
|
1190
|
-
* ```ts
|
|
1191
|
-
* const shape: PptxBar3DShape = "cylinder";
|
|
1192
|
-
* // => "cylinder", one of: "box" | "cone" | "coneToMax" | "cylinder" | "pyramid" | "pyramidToMax"
|
|
1193
|
-
* ```
|
|
1194
|
-
*/
|
|
1195
|
-
type PptxBar3DShape = 'box' | 'cone' | 'coneToMax' | 'cylinder' | 'pyramid' | 'pyramidToMax';
|
|
1196
|
-
/**
|
|
1197
|
-
* Supported trendline regression types: the neutral chart model's readable
|
|
1198
|
-
* trendline kinds (`ChartTrendlineKind` in `ooxml-core/chart`).
|
|
1199
|
-
*
|
|
1200
|
-
* @example
|
|
1201
|
-
* ```ts
|
|
1202
|
-
* const type: PptxChartTrendlineType = "linear";
|
|
1203
|
-
* // => "linear": one of: "linear" | "exponential" | "logarithmic" | "polynomial" | "power" | "movingAvg"
|
|
1204
|
-
* ```
|
|
1205
|
-
*/
|
|
1206
|
-
type PptxChartTrendlineType = ChartTrendlineKind;
|
|
1207
|
-
/**
|
|
1208
|
-
* Configuration for a chart trendline (regression line).
|
|
1209
|
-
*
|
|
1210
|
-
* @example
|
|
1211
|
-
* ```ts
|
|
1212
|
-
* const trendline: PptxChartTrendline = {
|
|
1213
|
-
* trendlineType: "linear",
|
|
1214
|
-
* displayEq: true,
|
|
1215
|
-
* displayRSq: true,
|
|
1216
|
-
* color: "#FF0000",
|
|
1217
|
-
* };
|
|
1218
|
-
* // => satisfies PptxChartTrendline
|
|
1219
|
-
* ```
|
|
1220
|
-
*/
|
|
1221
|
-
interface PptxChartTrendline {
|
|
1222
|
-
trendlineType: PptxChartTrendlineType;
|
|
1223
|
-
name?: string;
|
|
1224
|
-
order?: number;
|
|
1225
|
-
period?: number;
|
|
1226
|
-
forward?: number;
|
|
1227
|
-
backward?: number;
|
|
1228
|
-
intercept?: number;
|
|
1229
|
-
displayRSq?: boolean;
|
|
1230
|
-
displayEq?: boolean;
|
|
1231
|
-
color?: string;
|
|
1232
|
-
/** Trendline width in points (`c:trendline/c:spPr/a:ln/@w`, EMU / 12700). */
|
|
1233
|
-
lineWidth?: number;
|
|
1234
|
-
/** Trendline dash style (`c:trendline/c:spPr/a:ln/a:prstDash/@val`). */
|
|
1235
|
-
lineDashStyle?: string;
|
|
1236
|
-
label?: PptxChartTrendlineLabel | null;
|
|
1237
|
-
}
|
|
1238
|
-
/** Typed, commonly edited properties of `c:trendlineLbl`. */
|
|
1239
|
-
interface PptxChartTrendlineLabel {
|
|
1240
|
-
layout?: PptxChartManualLayout;
|
|
1241
|
-
numberFormatCode?: string;
|
|
1242
|
-
sourceLinked?: boolean;
|
|
1243
|
-
}
|
|
1244
|
-
/** Error-bar direction axis (`ChartErrorBarDirection` in `ooxml-core/chart`). */
|
|
1245
|
-
type PptxChartErrBarDir = ChartErrorBarDirection;
|
|
1246
|
-
/** Error-bar display type: both sides, negative only, or positive only (`ChartErrorBarType`). */
|
|
1247
|
-
type PptxChartErrBarType = ChartErrorBarType;
|
|
1248
|
-
/**
|
|
1249
|
-
* How the error-bar value is calculated (`ChartErrorValueType` in `ooxml-core/chart`).
|
|
1250
|
-
*
|
|
1251
|
-
* @example
|
|
1252
|
-
* ```ts
|
|
1253
|
-
* const valType: PptxChartErrValType = "percentage";
|
|
1254
|
-
* // => "percentage": one of: "cust" | "fixedVal" | "percentage" | "stdDev" | "stdErr"
|
|
1255
|
-
* ```
|
|
1256
|
-
*/
|
|
1257
|
-
type PptxChartErrValType = ChartErrorValueType;
|
|
1258
|
-
/**
|
|
1259
|
-
* Error bars for a chart series.
|
|
1260
|
-
*
|
|
1261
|
-
* @example
|
|
1262
|
-
* ```ts
|
|
1263
|
-
* const bars: PptxChartErrBars = {
|
|
1264
|
-
* direction: "y",
|
|
1265
|
-
* barType: "both",
|
|
1266
|
-
* valType: "percentage",
|
|
1267
|
-
* val: 5,
|
|
1268
|
-
* };
|
|
1269
|
-
* // => satisfies PptxChartErrBars
|
|
1270
|
-
* ```
|
|
1271
|
-
*/
|
|
1272
|
-
interface PptxChartErrBars {
|
|
1273
|
-
direction: PptxChartErrBarDir;
|
|
1274
|
-
barType: PptxChartErrBarType;
|
|
1275
|
-
valType: PptxChartErrValType;
|
|
1276
|
-
val?: number;
|
|
1277
|
-
customPlus?: number[];
|
|
1278
|
-
customMinus?: number[];
|
|
1279
|
-
noEndCap?: boolean;
|
|
1280
|
-
color?: string;
|
|
1281
|
-
/** Error-bar line width in points (`c:errBars/c:spPr/a:ln/@w`, EMU / 12700). */
|
|
1282
|
-
width?: number;
|
|
1283
|
-
/** Error-bar line dash style (`c:errBars/c:spPr/a:ln/a:prstDash/@val`). */
|
|
1284
|
-
dashStyle?: string;
|
|
1285
|
-
}
|
|
1286
|
-
/**
|
|
1287
|
-
* Visibility flags for the chart data table (axes + legend keys).
|
|
1288
|
-
*
|
|
1289
|
-
* @example
|
|
1290
|
-
* ```ts
|
|
1291
|
-
* const dt: PptxChartDataTable = {
|
|
1292
|
-
* showHorzBorder: true,
|
|
1293
|
-
* showVertBorder: true,
|
|
1294
|
-
* showOutline: true,
|
|
1295
|
-
* showKeys: true,
|
|
1296
|
-
* };
|
|
1297
|
-
* // => satisfies PptxChartDataTable
|
|
1298
|
-
* ```
|
|
1299
|
-
*/
|
|
1300
|
-
interface PptxChartDataTable {
|
|
1301
|
-
showHorzBorder?: boolean;
|
|
1302
|
-
showVertBorder?: boolean;
|
|
1303
|
-
showOutline?: boolean;
|
|
1304
|
-
showKeys?: boolean;
|
|
1305
|
-
/** Table border/fill formatting (`c:dTable/c:spPr`). */
|
|
1306
|
-
spPr?: PptxChartShapeProps;
|
|
1307
|
-
/**
|
|
1308
|
-
* Cell text defaults (`c:dTable/c:txPr/a:p/a:pPr/a:defRPr`). Reuses the same
|
|
1309
|
-
* shape as a legend entry's text override since both are a flat paragraph
|
|
1310
|
-
* default-run-property style (size/bold/italic/font/colour).
|
|
1311
|
-
*/
|
|
1312
|
-
txPr?: PptxChartLegendTextStyle;
|
|
1313
|
-
}
|
|
1314
|
-
/**
|
|
1315
|
-
* Line appearance for chart helper lines (drop lines, hi-low lines).
|
|
1316
|
-
*
|
|
1317
|
-
* @example
|
|
1318
|
-
* ```ts
|
|
1319
|
-
* const style: PptxChartLineStyle = {
|
|
1320
|
-
* color: "#AAAAAA",
|
|
1321
|
-
* width: 1,
|
|
1322
|
-
* dashStyle: "dash",
|
|
1323
|
-
* };
|
|
1324
|
-
* // => satisfies PptxChartLineStyle
|
|
1325
|
-
* ```
|
|
1326
|
-
*/
|
|
1327
|
-
interface PptxChartLineStyle {
|
|
1328
|
-
color?: string;
|
|
1329
|
-
width?: number;
|
|
1330
|
-
dashStyle?: string;
|
|
1331
|
-
}
|
|
1332
|
-
/** Marker symbol types for line/scatter chart data points. */
|
|
1333
|
-
type PptxChartMarkerSymbol = 'circle' | 'dash' | 'diamond' | 'dot' | 'none' | 'picture' | 'plus' | 'square' | 'star' | 'triangle' | 'x' | 'auto';
|
|
1334
|
-
/**
|
|
1335
|
-
* `ST_ScatterStyle` (ECMA-376 §21.2.3.40): how a scatter chart joins its points.
|
|
1336
|
-
* `line`/`lineMarker` connect them with straight segments, `smooth`/
|
|
1337
|
-
* `smoothMarker` with a bezier, `marker`/`none` not at all.
|
|
1338
|
-
*/
|
|
1339
|
-
type PptxChartScatterStyle = 'none' | 'line' | 'lineMarker' | 'marker' | 'smooth' | 'smoothMarker';
|
|
1340
|
-
/** Shape properties extracted from c:spPr for chart formatting. */
|
|
1341
|
-
/**
|
|
1342
|
-
* A gradient fill from a chart `c:spPr/a:gradFill` (chart area, plot area,
|
|
1343
|
-
* series or data point). Positions are 0..100 and stop `opacity` 0..1 (absent
|
|
1344
|
-
* means opaque); a linear gradient's `angle` is in degrees clockwise from
|
|
1345
|
-
* left-to-right (`a:lin/@ang`, so 90 is top to bottom); a radial (`a:path`)
|
|
1346
|
-
* gradient centres on `focalPoint` (0..1 fractions of the box), the middle
|
|
1347
|
-
* when absent.
|
|
1348
|
-
*/
|
|
1349
|
-
type PptxChartGradientFill = ChartGradientFill;
|
|
1350
|
-
interface PptxChartShapeProps {
|
|
1351
|
-
fillColor?: string;
|
|
1352
|
-
strokeColor?: string;
|
|
1353
|
-
strokeWidth?: number;
|
|
1354
|
-
/** Line dash style (a:prstDash/@val), e.g. 'solid', 'dash', 'dot', 'lgDash'. */
|
|
1355
|
-
strokeDashStyle?: string;
|
|
1356
|
-
/**
|
|
1357
|
-
* `a:ln/a:noFill`: the line is explicitly not drawn. Not the same as having
|
|
1358
|
-
* no line formatting, which leaves the renderer's default line in place.
|
|
1359
|
-
*/
|
|
1360
|
-
lineNoFill?: boolean;
|
|
1361
|
-
}
|
|
1362
|
-
/** Up/down bar formatting on line and stock charts (`c:upDownBars`). */
|
|
1363
|
-
interface PptxChartUpDownBars {
|
|
1364
|
-
/** Gap between bars as a percentage, constrained to 0 through 500. */
|
|
1365
|
-
gapWidth?: number;
|
|
1366
|
-
upBars?: PptxChartShapeProps;
|
|
1367
|
-
downBars?: PptxChartShapeProps;
|
|
1368
|
-
}
|
|
1369
|
-
/** Marker appearance on a chart series or data point. */
|
|
1370
|
-
interface PptxChartMarker {
|
|
1371
|
-
symbol: PptxChartMarkerSymbol;
|
|
1372
|
-
/** Marker size in points, constrained by ST_MarkerSize to 2 through 72. */
|
|
1373
|
-
size?: number;
|
|
1374
|
-
spPr?: PptxChartShapeProps;
|
|
1375
|
-
}
|
|
1376
|
-
/** Per-data-point formatting override (c:dPt). */
|
|
1377
|
-
interface PptxChartDataPoint {
|
|
1378
|
-
idx: number;
|
|
1379
|
-
spPr?: PptxChartShapeProps;
|
|
1380
|
-
/**
|
|
1381
|
-
* Per-point gradient fill (`c:dPt/c:spPr/a:gradFill`): one bar, column or
|
|
1382
|
-
* slice painted with its own gradient. Takes precedence over
|
|
1383
|
-
* `spPr.fillColor` and round-trips with the same lossless rules as
|
|
1384
|
-
* {@link PptxChartSeries.gradientFill}; ignored for line-drawn series. Set
|
|
1385
|
-
* it through `setChartDataPointGradient`.
|
|
1386
|
-
*/
|
|
1387
|
-
gradientFill?: PptxChartGradientFill;
|
|
1388
|
-
explosion?: number;
|
|
1389
|
-
invertIfNegative?: boolean;
|
|
1390
|
-
marker?: PptxChartMarker;
|
|
1391
|
-
/** Render a bubble-chart point with a 3-D appearance. */
|
|
1392
|
-
bubble3D?: boolean;
|
|
1393
|
-
/** Per-point picture-fill flags (`c:dPt/c:pictureOptions`). */
|
|
1394
|
-
picture?: PptxChartDataPointPicture;
|
|
1395
|
-
/**
|
|
1396
|
-
* A picture fill implied by a bare `c:dPt/c:spPr/a:blipFill` with NO
|
|
1397
|
-
* sibling `c:pictureOptions` at all: still a fully legal "stretch, no
|
|
1398
|
-
* stack" picture fill, just one PowerPoint's format pane never touched the
|
|
1399
|
-
* stack settings for. Render-derived only: unlike {@link picture}, this is
|
|
1400
|
-
* never written back on save (the original, untouched `c:spPr` already
|
|
1401
|
-
* round-trips verbatim), so populating it can never desync the saved file
|
|
1402
|
-
* from what was authored. See `chart-datapoint-picture.ts`'s
|
|
1403
|
-
* `parseImplicitBlipPictureFill`.
|
|
1404
|
-
*/
|
|
1405
|
-
impliedPicture?: PptxChartDataPointPicture;
|
|
1406
|
-
/**
|
|
1407
|
-
* This point's identity GUID (`c:dPt/c:extLst/c:ext/c16:uniqueId/@val`,
|
|
1408
|
-
* the Office 2014+ `{C3380CC4-5D6E-409C-BE32-E72D297353CC}` chart
|
|
1409
|
-
* extension), read-only here: an edited point keeps its existing
|
|
1410
|
-
* `c:extLst` as passthrough (see `chart-datapoint-serializer.ts`), so this
|
|
1411
|
-
* field exists for introspection rather than round-trip.
|
|
1412
|
-
*/
|
|
1413
|
-
uniqueId?: string;
|
|
1414
|
-
}
|
|
1415
|
-
/** Schema values accepted by `c:dLblPos`. */
|
|
1416
|
-
type PptxChartDataLabelPosition = 'bestFit' | 'b' | 'ctr' | 'inBase' | 'inEnd' | 'l' | 'outEnd' | 'r' | 't';
|
|
1417
|
-
/**
|
|
1418
|
-
* `c15:dlblRangeCache`/`c15:datalabelsRange` (CT_SeriesDataLabelsRange):
|
|
1419
|
-
* PowerPoint 2013+'s "Value From Cells" custom label source, one cell range
|
|
1420
|
-
* supplying every label in a group (chart-type or series `c:dLbls`), with a
|
|
1421
|
-
* cache aligned to point order. See `utils/chart-data-labels-range.ts`.
|
|
1422
|
-
*/
|
|
1423
|
-
interface PptxChartDataLabelsRange {
|
|
1424
|
-
/** `c15:f`: the cell range formula (e.g. `Sheet1!$D$2:$D$5`). */
|
|
1425
|
-
formula: string;
|
|
1426
|
-
/** `c15:dlblRangeCache`: cached label text, index-aligned with data points. */
|
|
1427
|
-
cache: string[];
|
|
1428
|
-
}
|
|
1429
|
-
/** Individual data label override (c:dLbl). */
|
|
1430
|
-
interface PptxChartDataLabel {
|
|
1431
|
-
idx: number;
|
|
1432
|
-
/** Suppress this data point's automatically generated label. */
|
|
1433
|
-
deleted?: boolean;
|
|
1434
|
-
showVal?: boolean;
|
|
1435
|
-
showCatName?: boolean;
|
|
1436
|
-
showSerName?: boolean;
|
|
1437
|
-
showPercent?: boolean;
|
|
1438
|
-
showLegendKey?: boolean;
|
|
1439
|
-
showBubbleSize?: boolean;
|
|
1440
|
-
position?: PptxChartDataLabelPosition;
|
|
1441
|
-
text?: string;
|
|
1442
|
-
/**
|
|
1443
|
-
* {@link text} was read from the cells of a "Value From Cells" range, not
|
|
1444
|
-
* from a literal `c:tx`. The save path keeps such a label linked to its
|
|
1445
|
-
* cells and writes no `c:tx`; clear this to save the text as literal.
|
|
1446
|
-
*/
|
|
1447
|
-
textFromCells?: boolean;
|
|
1448
|
-
separator?: string;
|
|
1449
|
-
showLeaderLines?: boolean;
|
|
1450
|
-
/**
|
|
1451
|
-
* Per-label number-format override (`c:dLbl/c:numFmt/@formatCode`), taking
|
|
1452
|
-
* precedence over the chart-level {@link PptxChartDataLabelOptions.numberFormat}
|
|
1453
|
-
* and the series' own {@link PptxChartSeries.numberFormat} when set.
|
|
1454
|
-
*/
|
|
1455
|
-
numberFormat?: string;
|
|
1456
|
-
/**
|
|
1457
|
-
* Manually dragged label position (`c:dLbl/c:layout/c:manualLayout`), the
|
|
1458
|
-
* same CT_ManualLayout shape used for title/legend/plotArea. `null`
|
|
1459
|
-
* explicitly clears a drag back to the automatic position.
|
|
1460
|
-
*/
|
|
1461
|
-
layout?: PptxChartManualLayout | null;
|
|
1462
|
-
/**
|
|
1463
|
-
* This label's own font (`c:dLbl/c:txPr/a:p/a:pPr/a:defRPr`, or ChartEx
|
|
1464
|
-
* `cx:dataLabel/cx:txPr`), taking precedence over the chart/series-level
|
|
1465
|
-
* {@link PptxChartDataLabelOptions.txPr} when set. Reuses the legend
|
|
1466
|
-
* entry's flat text-style shape since both are the same
|
|
1467
|
-
* `.../a:p/a:pPr/a:defRPr` default-run-property style.
|
|
1468
|
-
*/
|
|
1469
|
-
txPr?: PptxChartLegendTextStyle;
|
|
1470
|
-
/**
|
|
1471
|
-
* Font of this label's literal rich text (`c:dLbl/c:tx/c:rich`): the first
|
|
1472
|
-
* run's `a:rPr` over its paragraph's `a:pPr/a:defRPr`. PowerPoint draws
|
|
1473
|
-
* {@link text} with these run properties, so each field set here wins over
|
|
1474
|
-
* the same field of {@link txPr}. Parsed for drawing only; saving does not
|
|
1475
|
-
* write it back from here.
|
|
1476
|
-
*/
|
|
1477
|
-
richTextStyle?: PptxChartLegendTextStyle;
|
|
1478
|
-
/**
|
|
1479
|
-
* This label's own shape formatting (`c:dLbl/c:spPr`): fill/line colour,
|
|
1480
|
-
* width, and dash style for the label's callout box, taking precedence
|
|
1481
|
-
* over any chart/series-level default when set.
|
|
1482
|
-
*/
|
|
1483
|
-
spPr?: PptxChartShapeProps;
|
|
1484
|
-
/**
|
|
1485
|
-
* `c15:xForSave`: this override exists only so its properties survive a
|
|
1486
|
-
* save/reload round trip; PowerPoint merges it back onto the series'
|
|
1487
|
-
* default label on load. Round-tripped as-is (an edited chart keeps an
|
|
1488
|
-
* existing point's whole `extLst`, this flag included); introspection
|
|
1489
|
-
* only otherwise. See `utils/chart-data-labels-range.ts`.
|
|
1490
|
-
*/
|
|
1491
|
-
savedForCompatibilityOnly?: boolean;
|
|
1492
|
-
}
|
|
1493
|
-
/** Axis number format. */
|
|
1494
|
-
interface PptxChartAxisNumFmt {
|
|
1495
|
-
formatCode: string;
|
|
1496
|
-
sourceLinked?: boolean;
|
|
1497
|
-
}
|
|
1498
|
-
/** Typed contents of a value-axis display-unit label (`c:dispUnitsLbl`). */
|
|
1499
|
-
interface PptxChartDisplayUnitsLabel {
|
|
1500
|
-
/** Literal label text. Omit to preserve the source text subtree. */
|
|
1501
|
-
text?: string;
|
|
1502
|
-
/** Manual label placement. `null` removes only the manual layout. */
|
|
1503
|
-
layout?: PptxChartManualLayout | null;
|
|
1504
|
-
/** Label shape formatting. `null` removes `c:spPr`. */
|
|
1505
|
-
spPr?: PptxChartShapeProps | null;
|
|
1506
|
-
/**
|
|
1507
|
-
* The label's own run font, when it carries a distinct `txPr` from the
|
|
1508
|
-
* axis's own (ChartEx `cx:unitsLabel/cx:txPr`; classic `c:dispUnitsLbl`
|
|
1509
|
-
* has no equivalent child, so this is only ever populated from a ChartEx
|
|
1510
|
-
* axis).
|
|
1511
|
-
*/
|
|
1512
|
-
fontFamily?: string;
|
|
1513
|
-
fontSize?: number;
|
|
1514
|
-
fontBold?: boolean;
|
|
1515
|
-
fontColor?: string;
|
|
1516
|
-
}
|
|
1517
|
-
/** Axis formatting for category, value, or date axes. */
|
|
1518
|
-
interface PptxChartAxisFormatting extends PptxChartAxisLabelFormatting {
|
|
1519
|
-
axisType: 'catAx' | 'valAx' | 'dateAx' | 'serAx';
|
|
1520
|
-
/** Axis position: "b" (bottom), "l" (left), "r" (right), "t" (top). */
|
|
1521
|
-
axPos?: 'b' | 'l' | 'r' | 't';
|
|
1522
|
-
/** Unique axis identifier (c:axId/@val) used to link series to axes. */
|
|
1523
|
-
axisId?: number;
|
|
1524
|
-
/** Cross-axis identifier: the axis this axis crosses. */
|
|
1525
|
-
crossAxisId?: number;
|
|
1526
|
-
/** Automatic crossing mode (`c:crosses`). Mutually exclusive with `crossesAt`. */
|
|
1527
|
-
crosses?: 'autoZero' | 'min' | 'max';
|
|
1528
|
-
/** Explicit crossing value (`c:crossesAt`). Units depend on the axis type. */
|
|
1529
|
-
crossesAt?: number;
|
|
1530
|
-
/** Whether a value axis crosses between or at category tick marks. */
|
|
1531
|
-
crossBetween?: 'between' | 'midCat';
|
|
1532
|
-
numFmt?: PptxChartAxisNumFmt;
|
|
1533
|
-
titleText?: string;
|
|
1534
|
-
spPr?: PptxChartShapeProps;
|
|
1535
|
-
fontFamily?: string;
|
|
1536
|
-
/** East Asian typeface of the axis text (`a:ea/@typeface`). */
|
|
1537
|
-
eastAsiaFontFamily?: string;
|
|
1538
|
-
fontSize?: number;
|
|
1539
|
-
fontBold?: boolean;
|
|
1540
|
-
fontColor?: string;
|
|
1541
|
-
/** Whether major gridlines are present (`c:majorGridlines`). */
|
|
1542
|
-
majorGridlines?: boolean;
|
|
1543
|
-
/** Whether minor gridlines are present (`c:minorGridlines`). */
|
|
1544
|
-
minorGridlines?: boolean;
|
|
1545
|
-
majorGridlinesSpPr?: PptxChartShapeProps;
|
|
1546
|
-
minorGridlinesSpPr?: PptxChartShapeProps;
|
|
1547
|
-
/** Minimum axis value override (c:min/@val). */
|
|
1548
|
-
min?: number;
|
|
1549
|
-
/** Maximum axis value override (c:max/@val). */
|
|
1550
|
-
max?: number;
|
|
1551
|
-
/** Axis value direction (`c:scaling/c:orientation/@val`). */
|
|
1552
|
-
orientation?: 'minMax' | 'maxMin';
|
|
1553
|
-
/**
|
|
1554
|
-
* Whether the axis is deleted/hidden (c:delete/@val). Written for generated
|
|
1555
|
-
* charts (absent means shown) and reconciled on save for loaded ones.
|
|
1556
|
-
*/
|
|
1557
|
-
deleted?: boolean;
|
|
1558
|
-
/**
|
|
1559
|
-
* Display units for value axis (c:dispUnits/c:builtInUnit/@val).
|
|
1560
|
-
* When set to 'custom', the actual divisor is in {@link displayUnitsValue}.
|
|
1561
|
-
*/
|
|
1562
|
-
displayUnits?: 'hundreds' | 'thousands' | 'tenThousands' | 'hundredThousands' | 'millions' | 'tenMillions' | 'hundredMillions' | 'billions' | 'trillions' | 'custom';
|
|
1563
|
-
/** Custom display unit divisor value (c:dispUnits/c:custUnit/@val). Only used when displayUnits is 'custom'. */
|
|
1564
|
-
displayUnitsValue?: number;
|
|
1565
|
-
/**
|
|
1566
|
-
* Display-unit label contents (`c:dispUnits/c:dispUnitsLbl`). A string is
|
|
1567
|
-
* retained as a compatibility shorthand for `{ text: string }`; `null`
|
|
1568
|
-
* explicitly removes the label.
|
|
1569
|
-
*/
|
|
1570
|
-
displayUnitsLabel?: string | PptxChartDisplayUnitsLabel | null;
|
|
1571
|
-
/** Whether logarithmic scaling is enabled (presence of c:scaling/c:logBase). */
|
|
1572
|
-
logScale?: boolean;
|
|
1573
|
-
/** Logarithmic base value (c:scaling/c:logBase/@val), typically 10 or e. */
|
|
1574
|
-
logBase?: number;
|
|
1575
|
-
/** Major-unit interval between primary tick marks (c:majorUnit/@val). */
|
|
1576
|
-
majorUnit?: number;
|
|
1577
|
-
/** Minor-unit interval between secondary tick marks (c:minorUnit/@val). */
|
|
1578
|
-
minorUnit?: number;
|
|
1579
|
-
/** Calendar unit used to interpret date-axis serial values. */
|
|
1580
|
-
baseTimeUnit?: 'days' | 'months' | 'years';
|
|
1581
|
-
majorTimeUnit?: 'days' | 'months' | 'years';
|
|
1582
|
-
minorTimeUnit?: 'days' | 'months' | 'years';
|
|
1583
|
-
}
|
|
1584
|
-
/** 3D wall or floor element formatting. */
|
|
1585
|
-
interface PptxChart3DSurface {
|
|
1586
|
-
thickness?: number;
|
|
1587
|
-
spPr?: PptxChartShapeProps;
|
|
1588
|
-
}
|
|
1589
|
-
/**
|
|
1590
|
-
* One colour band for a surface chart (`c:bandFmts/c:bandFmt`,
|
|
1591
|
-
* ECMA-376 §21.2.2.19 / CT_BandFmt). `index` is the band's position
|
|
1592
|
-
* (`c:idx/@val`) among the value axis's major-unit bands, in authored order.
|
|
1593
|
-
*/
|
|
1594
|
-
interface PptxChartBandFmt {
|
|
1595
|
-
index: number;
|
|
1596
|
-
spPr?: PptxChartShapeProps;
|
|
1597
|
-
}
|
|
1598
|
-
/** Office 2016 ChartEx box-and-whisker series layout options. */
|
|
1599
|
-
interface PptxChartBoxWhiskerOptions {
|
|
1600
|
-
quartileMethod?: 'inclusive' | 'exclusive';
|
|
1601
|
-
showMeanLine?: boolean;
|
|
1602
|
-
showMeanMarker?: boolean;
|
|
1603
|
-
/** Show non-outlier (inner) data points. */
|
|
1604
|
-
showInnerPoints?: boolean;
|
|
1605
|
-
showOutlierPoints?: boolean;
|
|
1606
|
-
}
|
|
1607
|
-
/** Office 2016 ChartEx histogram and Pareto series layout options. */
|
|
1608
|
-
interface PptxChartHistogramOptions {
|
|
1609
|
-
/** Maps to `clusteredColumn` for histogram columns or `paretoLine`. */
|
|
1610
|
-
layout?: 'histogram' | 'pareto';
|
|
1611
|
-
/** Exactly one of binSize and binCount is emitted by the ChartEx writer. */
|
|
1612
|
-
binSize?: number;
|
|
1613
|
-
binCount?: number;
|
|
1614
|
-
intervalClosed?: 'l' | 'r';
|
|
1615
|
-
underflow?: number | 'auto';
|
|
1616
|
-
overflow?: number | 'auto';
|
|
1617
|
-
/**
|
|
1618
|
-
* `c:layoutPr/cx:aggregation` was authored instead of `cx:binning`: the
|
|
1619
|
-
* raw rows are CATEGORICAL (a Pareto chart's `clusteredColumn` series
|
|
1620
|
-
* counting occurrences of each authored category, COM-verified against
|
|
1621
|
-
* charts-com.pptx slide 31 / chartEx6.xml), not a numeric range to bin.
|
|
1622
|
-
* Mutually exclusive with `binSize`/`binCount`/`intervalClosed`, which
|
|
1623
|
-
* only apply to a true numeric-value histogram.
|
|
1624
|
-
*/
|
|
1625
|
-
aggregateByCategory?: boolean;
|
|
1626
|
-
}
|
|
1627
|
-
/** Office 2016 ChartEx waterfall series layout options. */
|
|
1628
|
-
interface PptxChartWaterfallOptions {
|
|
1629
|
-
/** Zero-based data point indexes rendered as absolute subtotal or total bars. */
|
|
1630
|
-
subtotalIndices?: number[];
|
|
1631
|
-
/** Whether connector lines are visible between adjacent bars. */
|
|
1632
|
-
connectorLines?: boolean;
|
|
1633
|
-
}
|
|
1634
|
-
/**
|
|
1635
|
-
* A single breakpoint in a ChartEx colour-by-value scale
|
|
1636
|
-
* (`cx:valueColorPositions/cx:colorPosition`). `kind` selects which of
|
|
1637
|
-
* CT_ColorPosition's union members was authored; `value` is absent for
|
|
1638
|
-
* `min`/`max` (they are implicit endpoints) and required otherwise.
|
|
1639
|
-
*/
|
|
1640
|
-
interface PptxCxValueColorPosition {
|
|
1641
|
-
kind: 'min' | 'max' | 'number' | 'percent';
|
|
1642
|
-
value?: number;
|
|
1643
|
-
}
|
|
1644
|
-
/** Office 2016 ChartEx geographic series dimensions and layout options. */
|
|
1645
|
-
interface PptxChartRegionMapOptions {
|
|
1646
|
-
fixedColor?: string;
|
|
1647
|
-
/**
|
|
1648
|
-
* Colour-by-value gradient stops (`cx:valueColors/cx:colors/cx:color`),
|
|
1649
|
-
* resolved to hex, 2 or 3 entries (matching PowerPoint's two- and
|
|
1650
|
-
* three-colour scale UI). Paired index-for-index with
|
|
1651
|
-
* {@link valueColorPositions} when both are present.
|
|
1652
|
-
*/
|
|
1653
|
-
valueColors?: string[];
|
|
1654
|
-
/** Gradient breakpoints for {@link valueColors} (`cx:valueColorPositions`). */
|
|
1655
|
-
valueColorPositions?: PptxCxValueColorPosition[];
|
|
1656
|
-
/** Optional provider entity identifiers aligned with categories and values. */
|
|
1657
|
-
entityIds?: string[];
|
|
1658
|
-
/** Original `cx:pt/@idx` values for category points. */
|
|
1659
|
-
categorySourceIndices?: number[];
|
|
1660
|
-
/** Original `cx:pt/@idx` values for colour-value points. */
|
|
1661
|
-
valueSourceIndices?: number[];
|
|
1662
|
-
/** Original `cx:pt/@idx` values for entity-ID points. */
|
|
1663
|
-
entityIdSourceIndices?: number[];
|
|
1664
|
-
regionLabelLayout?: 'none' | 'bestFitOnly' | 'showAll';
|
|
1665
|
-
projectionType?: 'mercator' | 'miller' | 'robinson' | 'albers';
|
|
1666
|
-
viewedRegionType?: 'dataOnly' | 'postalCode' | 'county' | 'state' | 'countryRegion' | 'countryRegionList' | 'world';
|
|
1667
|
-
cultureLanguage?: string;
|
|
1668
|
-
/** ISO-3166-1 alpha-2 region code. */
|
|
1669
|
-
cultureRegion?: string;
|
|
1670
|
-
attribution?: string;
|
|
1671
|
-
/** Opaque authored provider cache under `cx:geography/cx:geoCache`. */
|
|
1672
|
-
geographyCache?: XmlObject;
|
|
1673
|
-
/** Neutral raw source cache retained for the shared renderer. */
|
|
1674
|
-
geographyCacheXml?: string;
|
|
1675
|
-
}
|
|
1676
|
-
/** Layout for parent category labels in a hierarchical ChartEx treemap. */
|
|
1677
|
-
type PptxChartParentLabelLayout = 'none' | 'banner' | 'overlapping';
|
|
1678
|
-
/** Per-series layout options for an Office 2016+ ChartEx treemap. */
|
|
1679
|
-
interface PptxChartTreemapOptions {
|
|
1680
|
-
parentLabelLayout?: PptxChartParentLabelLayout;
|
|
1681
|
-
}
|
|
1682
|
-
/**
|
|
1683
|
-
* A single data series within a chart.
|
|
1684
|
-
*
|
|
1685
|
-
* @example
|
|
1686
|
-
* ```ts
|
|
1687
|
-
* const series: PptxChartSeries = {
|
|
1688
|
-
* name: "Revenue",
|
|
1689
|
-
* values: [100, 120, 140],
|
|
1690
|
-
* color: "#4F81BD",
|
|
1691
|
-
* trendlines: [{ trendlineType: "linear" }],
|
|
1692
|
-
* };
|
|
1693
|
-
* // => satisfies PptxChartSeries
|
|
1694
|
-
* ```
|
|
1695
|
-
*/
|
|
1696
|
-
interface PptxChartSeries {
|
|
1697
|
-
name: string;
|
|
1698
|
-
/**
|
|
1699
|
-
* This series' own `c:ser/c:idx/@val`. PowerPoint keys per-series identity
|
|
1700
|
-
* (data-point picking, and the automatic marker-symbol cycle when no
|
|
1701
|
-
* `c:marker/c:symbol` is authored) off this value, NOT off the series'
|
|
1702
|
-
* position in this array: a series can be reordered (`c:order`) without its
|
|
1703
|
-
* `idx` changing, and a chart with a deleted/filtered series leaves a gap
|
|
1704
|
-
* (e.g. idx 1, 2 with no idx 0). Absent only for chart kinds this parser
|
|
1705
|
-
* does not tag (rare); render code that needs it should fall back to the
|
|
1706
|
-
* array position.
|
|
1707
|
-
*/
|
|
1708
|
-
idx?: number;
|
|
1709
|
-
values: number[];
|
|
1710
|
-
/**
|
|
1711
|
-
* Series gradient fill (`c:ser/c:spPr/a:gradFill`), painted on every mark
|
|
1712
|
-
* of the series that has no per-point override.
|
|
1713
|
-
*
|
|
1714
|
-
* Written back on save for area-filled chart types (bar, area, pie,
|
|
1715
|
-
* doughnut, ofPie, bubble, surface and their 3-D variants, and such series
|
|
1716
|
-
* inside a combo): when set it takes precedence over {@link color} and
|
|
1717
|
-
* replaces the series' fill choice; clearing it removes the authored
|
|
1718
|
-
* `a:gradFill`. A loaded gradient the model still describes round-trips
|
|
1719
|
-
* byte-for-byte, theme colours included. Ignored for line-drawn series
|
|
1720
|
-
* (line, line3D, scatter, radar, stock), which have no fillable area. Set
|
|
1721
|
-
* it through `setChartSeriesGradient` to get validation and the
|
|
1722
|
-
* colour/gradient "last action wins" behaviour.
|
|
1723
|
-
*/
|
|
1724
|
-
gradientFill?: PptxChartGradientFill;
|
|
1725
|
-
/**
|
|
1726
|
-
* Outline gradient of a line-drawn series (`c:ser/c:spPr/a:ln/a:gradFill`),
|
|
1727
|
-
* the stroke PowerPoint paints along the series line. Read for rendering
|
|
1728
|
-
* only (the viewer paints linear ones); the authored `a:ln` is left as
|
|
1729
|
-
* loaded on save.
|
|
1730
|
-
*/
|
|
1731
|
-
lineGradientFill?: PptxChartGradientFill;
|
|
1732
|
-
/**
|
|
1733
|
-
* Per-series x values from `c:ser/c:xVal` (scatter and bubble series only).
|
|
1734
|
-
*
|
|
1735
|
-
* Every `CT_ScatterSer` / `CT_BubbleSer` carries its OWN `c:xVal`, so two
|
|
1736
|
-
* series in one scatter chart routinely plot against different x ranges (the
|
|
1737
|
-
* normal case for measurement data). Reading the x values off the first
|
|
1738
|
-
* series and reusing them everywhere plotted every series against series 1's
|
|
1739
|
-
* x axis. Absent for category-axis chart kinds, where
|
|
1740
|
-
* {@link PptxChartData.categories} is the x axis.
|
|
1741
|
-
*/
|
|
1742
|
-
xValues?: number[];
|
|
1743
|
-
/**
|
|
1744
|
-
* Per-series bubble sizes from `c:ser/c:bubbleSize` (bubble series only),
|
|
1745
|
-
* aligned index-for-index with {@link values}.
|
|
1746
|
-
*
|
|
1747
|
-
* `CT_BubbleSer` carries x, y AND size, so a one-series bubble chart is fully
|
|
1748
|
-
* specified. Absent when the source omits `c:bubbleSize`.
|
|
1749
|
-
*/
|
|
1750
|
-
bubbleSizes?: number[];
|
|
1751
|
-
/**
|
|
1752
|
-
* Series-level data-label content flags from `c:ser/c:dLbls`.
|
|
1753
|
-
*
|
|
1754
|
-
* PowerPoint writes the flags a user picks in "Format Data Labels" onto the
|
|
1755
|
-
* SERIES, and leaves the chart-type-level `c:dLbls` all-zero, so reading only
|
|
1756
|
-
* the chart-level group reports "show nothing" for a chart that visibly shows
|
|
1757
|
-
* percentages. These override {@link PptxChartStyle.dataLabels}.
|
|
1758
|
-
*/
|
|
1759
|
-
dataLabelOptions?: PptxChartDataLabelOptions;
|
|
1760
|
-
/**
|
|
1761
|
-
* Whether the series line is explicitly suppressed
|
|
1762
|
-
* (`c:ser/c:spPr/a:ln/a:noFill`). Line-drawn kinds (line, scatter, radar)
|
|
1763
|
-
* use this to decide whether to draw a connecting line at all; a marker-only
|
|
1764
|
-
* scatter is authored as `scatterStyle="lineMarker"` PLUS this flag, never by
|
|
1765
|
-
* changing the scatter style.
|
|
1766
|
-
*/
|
|
1767
|
-
lineNoFill?: boolean;
|
|
1768
|
-
/**
|
|
1769
|
-
* Series line width in points (`c:ser/c:spPr/a:ln/@w`, EMU / 12700).
|
|
1770
|
-
* `undefined` when the series authors none; the renderer then keeps its
|
|
1771
|
-
* own default width.
|
|
1772
|
-
*/
|
|
1773
|
-
lineWidth?: number;
|
|
1774
|
-
/**
|
|
1775
|
-
* Series line preset dash (`c:ser/c:spPr/a:ln/a:prstDash/@val`, e.g.
|
|
1776
|
-
* `sysDot`, `dash`). `undefined` (or `solid`) draws a solid line.
|
|
1777
|
-
*/
|
|
1778
|
-
lineDashStyle?: string;
|
|
1779
|
-
/**
|
|
1780
|
-
* Blank-value mask aligned index-for-index with {@link values}: `true` marks
|
|
1781
|
-
* a category whose numeric cache point (`c:numCache/c:pt`) was absent or
|
|
1782
|
-
* empty, i.e. a genuine blank rather than a real `0`. Present only when the
|
|
1783
|
-
* source series actually contains blanks; when set, blank slots in
|
|
1784
|
-
* {@link values} carry `0` as a placeholder. Renderers honour
|
|
1785
|
-
* `c:dispBlanksAs` (gap / zero / span) using this mask.
|
|
1786
|
-
*/
|
|
1787
|
-
blanks?: boolean[];
|
|
1788
|
-
/**
|
|
1789
|
-
* ECMA-376 number-format code for this series' values, resolved from
|
|
1790
|
-
* `c:ser/c:dLbls/c:numFmt/@formatCode` and falling back to the value cache's
|
|
1791
|
-
* own `c:numCache/c:formatCode` (which is what `@sourceLinked="1"` means).
|
|
1792
|
-
* Data labels render through it: a percentage series caches fractions, so
|
|
1793
|
-
* without the code `0.52` reaches the label where PowerPoint shows `52%`.
|
|
1794
|
-
*/
|
|
1795
|
-
numberFormat?: string;
|
|
1796
|
-
color?: string;
|
|
1797
|
-
trendlines?: PptxChartTrendline[];
|
|
1798
|
-
errBars?: PptxChartErrBars[];
|
|
1799
|
-
dataPoints?: PptxChartDataPoint[];
|
|
1800
|
-
marker?: PptxChartMarker;
|
|
1801
|
-
dataLabels?: PptxChartDataLabel[];
|
|
1802
|
-
explosion?: number;
|
|
1803
|
-
/**
|
|
1804
|
-
* Series-level `c:invertIfNegative`: when true, bar/column data points with a
|
|
1805
|
-
* negative value are drawn with an inverted (lightened) fill. A per-point
|
|
1806
|
-
* `c:dPt/c:invertIfNegative` overrides this for that point. Absent when the
|
|
1807
|
-
* source XML omits the flag.
|
|
1808
|
-
*/
|
|
1809
|
-
invertIfNegative?: boolean;
|
|
1810
|
-
/**
|
|
1811
|
-
* Whether this line/scatter series is drawn with bezier smoothing
|
|
1812
|
-
* (`c:ser/c:smooth/@val`). Absent when the source XML omits `c:smooth`.
|
|
1813
|
-
*/
|
|
1814
|
-
smooth?: boolean;
|
|
1815
|
-
/** Axis ID this series is plotted against (links to PptxChartAxisFormatting.axisId). */
|
|
1816
|
-
axisId?: number;
|
|
1817
|
-
/**
|
|
1818
|
-
* Per-series chart type, used for combo charts where individual series are
|
|
1819
|
-
* plotted with different chart types (e.g. a bar series and a line series in
|
|
1820
|
-
* the same chart). Maps to the OOXML chart-type container that holds the
|
|
1821
|
-
* series (`c:barChart`, `c:lineChart`, etc.). Omitted for single-type charts,
|
|
1822
|
-
* where the chart-level {@link PptxChartData.chartType} applies to every
|
|
1823
|
-
* series.
|
|
1824
|
-
*/
|
|
1825
|
-
seriesChartType?: PptxChartType;
|
|
1826
|
-
/**
|
|
1827
|
-
* Per-series 3-D bar/column shape override (`c:ser/c:shape`), legal only
|
|
1828
|
-
* inside a bar3D chart-type container. Overrides {@link PptxChartData.barShape}
|
|
1829
|
-
* for this series alone.
|
|
1830
|
-
*/
|
|
1831
|
-
shape?: PptxBar3DShape;
|
|
1832
|
-
boxWhiskerOptions?: PptxChartBoxWhiskerOptions;
|
|
1833
|
-
histogramOptions?: PptxChartHistogramOptions;
|
|
1834
|
-
waterfallOptions?: PptxChartWaterfallOptions;
|
|
1835
|
-
regionMapOptions?: PptxChartRegionMapOptions;
|
|
1836
|
-
treemapOptions?: PptxChartTreemapOptions;
|
|
1837
|
-
/**
|
|
1838
|
-
* Series-level picture-fill flags (`c:ser/c:pictureOptions`), legal
|
|
1839
|
-
* wherever a per-point `c:dPt/c:pictureOptions` is (CT_BarSer): paints
|
|
1840
|
-
* EVERY point in the series with one picture unless a `c:dPt` overrides it
|
|
1841
|
-
* for that point alone. A point's own {@link PptxChartDataPoint.picture}
|
|
1842
|
-
* takes precedence entirely (not merged field-by-field) when it resolves
|
|
1843
|
-
* its own image; renderers fall back to this series-level picture only
|
|
1844
|
-
* when the point has none of its own.
|
|
1845
|
-
*/
|
|
1846
|
-
picture?: PptxChartDataPointPicture;
|
|
1847
|
-
/**
|
|
1848
|
-
* A picture fill implied by a bare `c:ser/c:spPr/a:blipFill` with NO
|
|
1849
|
-
* sibling `c:pictureOptions` at all. See
|
|
1850
|
-
* {@link PptxChartDataPoint.impliedPicture}'s doc comment: same
|
|
1851
|
-
* render-only, never-serialized-back convention, at the series level.
|
|
1852
|
-
*/
|
|
1853
|
-
impliedPicture?: PptxChartDataPointPicture;
|
|
1854
|
-
/**
|
|
1855
|
-
* This series' identity GUID (`c:ser/c:extLst/c:ext/c16:uniqueId/@val`,
|
|
1856
|
-
* the Office 2014+ `{C3380CC4-5D6E-409C-BE32-E72D297353CC}` chart
|
|
1857
|
-
* extension). PowerPoint uses it to track a series across edits and
|
|
1858
|
-
* collaborators independent of its `c:idx`/`c:order` position (the same
|
|
1859
|
-
* role animation targeting and CRDT reconciliation need). An edited
|
|
1860
|
-
* existing series keeps its own `c:extLst` as passthrough; a NEW series
|
|
1861
|
-
* added by cloning an existing one as a template is given a freshly
|
|
1862
|
-
* generated id rather than duplicating the template's (see
|
|
1863
|
-
* `regenerateClonedUniqueId` in `chart-series-identity.ts`), since two
|
|
1864
|
-
* series sharing one identity is exactly what this extension exists to
|
|
1865
|
-
* prevent.
|
|
1866
|
-
*/
|
|
1867
|
-
uniqueId?: string;
|
|
1868
|
-
}
|
|
1869
|
-
/**
|
|
1870
|
-
* A series PowerPoint's "Chart Filters" feature hid from the plot while
|
|
1871
|
-
* keeping it in the workbook (`c:<type>Chart/c:extLst/c:ext
|
|
1872
|
-
* [@uri={02D57815-91ED-43cb-92C2-25804820EDAC}]/c15:filtered<Type>Series
|
|
1873
|
-
* /c15:ser`). Read-mostly: {@link PptxChartData.filteredSeries} exists for
|
|
1874
|
-
* introspection (AI tools, "unhide filtered series" UI) and round-trips as
|
|
1875
|
-
* passthrough through the preserved chart XML when untouched. See
|
|
1876
|
-
* `utils/chart-filtered-series.ts` for the parse rules and the idx-collision
|
|
1877
|
-
* fix this modelling enables on save.
|
|
1878
|
-
*/
|
|
1879
|
-
interface PptxChartFilteredSeries {
|
|
1880
|
-
/** `c15:ser/c:idx/@val`, the workbook column position this series still occupies. */
|
|
1881
|
-
idx: number;
|
|
1882
|
-
/** `c15:ser/c:order/@val`, defaulting to {@link idx} when absent. */
|
|
1883
|
-
order: number;
|
|
1884
|
-
/** Series name, from the hidden series' own `c:tx` cache. */
|
|
1885
|
-
name?: string;
|
|
1886
|
-
/** Category labels, from the hidden series' own `c:cat` cache. */
|
|
1887
|
-
categories?: string[];
|
|
1888
|
-
/** Data values, from the hidden series' own `c:val` cache. */
|
|
1889
|
-
values?: number[];
|
|
1890
|
-
/** This hidden series' own identity GUID (`c16:uniqueId`), when present. */
|
|
1891
|
-
uniqueId?: string;
|
|
1892
|
-
/**
|
|
1893
|
-
* A full snapshot of the series as it looked the moment it was hidden
|
|
1894
|
-
* (`render/chart-ext-editor-actions.ts`'s `hideChartSeries`), so
|
|
1895
|
-
* `restoreFilteredSeries` can bring it back exactly as it was: full fill/
|
|
1896
|
-
* line formatting, marker, data-label options, everything, not just the
|
|
1897
|
-
* bare name/values/idx the other fields above capture.
|
|
1898
|
-
*
|
|
1899
|
-
* NOT derived from XML and NEVER written to disk (the save writer,
|
|
1900
|
-
* `chart-filtered-series-writer.ts`, only reads the named fields above):
|
|
1901
|
-
* this exists purely for the live "Chart Filters" hide/show round-trip
|
|
1902
|
-
* within one editing session. A filtered series read from an actually
|
|
1903
|
-
* parsed file (one that was already hidden when opened) has no snapshot
|
|
1904
|
-
* to draw on, since real PowerPoint's `c15:ser` node is parsed only for
|
|
1905
|
-
* the fields above (`chart-filtered-series.ts`'s `parseOneFilteredSeries`);
|
|
1906
|
-
* `restoreFilteredSeries` falls back to reconstructing a bare series from
|
|
1907
|
-
* those for that case, same as before this field existed.
|
|
1908
|
-
*/
|
|
1909
|
-
originalSeries?: PptxChartSeries;
|
|
1910
|
-
}
|
|
1911
|
-
/**
|
|
1912
|
-
* Chart-level data-label options (`c:dLbls` directly under a chart-type
|
|
1913
|
-
* container, applying to every series). Mirrors the OOXML `c:show*` flags
|
|
1914
|
-
* and `c:dLblPos`.
|
|
1915
|
-
*/
|
|
1916
|
-
interface PptxChartDataLabelOptions {
|
|
1917
|
-
/** Label box fill/outline (`c:dLbls/c:spPr`), see `chart-data-label-box.ts`. */
|
|
1918
|
-
labelShape?: PptxChartShapeProps;
|
|
1919
|
-
/** Callout geometry of the label box (`c15:spPr/a:prstGeom/@prst`, e.g. `wedgeRectCallout`). */
|
|
1920
|
-
calloutShape?: string;
|
|
1921
|
-
/** The chart15 extension's `c15:showLeaderLines`, which wins for a moved label's leader line. */
|
|
1922
|
-
extLeaderLines?: boolean;
|
|
1923
|
-
/** Show the numeric value (`c:showVal`). */
|
|
1924
|
-
showValue?: boolean;
|
|
1925
|
-
/** Show the category name (`c:showCatName`). */
|
|
1926
|
-
showCategory?: boolean;
|
|
1927
|
-
/** Show the series name (`c:showSerName`). */
|
|
1928
|
-
showSeriesName?: boolean;
|
|
1929
|
-
/** Show the percentage (`c:showPercent`, pie/doughnut). */
|
|
1930
|
-
showPercent?: boolean;
|
|
1931
|
-
/** Show the legend key swatch (`c:showLegendKey`). */
|
|
1932
|
-
showLegendKey?: boolean;
|
|
1933
|
-
/** Show bubble size (`c:showBubbleSize`). */
|
|
1934
|
-
showBubbleSize?: boolean;
|
|
1935
|
-
/** Text placed between combined label components (`c:separator`). */
|
|
1936
|
-
separator?: string;
|
|
1937
|
-
/** Show leader lines where supported (`c:showLeaderLines`). */
|
|
1938
|
-
showLeaderLines?: boolean;
|
|
1939
|
-
/**
|
|
1940
|
-
* Leader-line stroke styling for offset (pie/doughnut `outEnd`/`bestFit`)
|
|
1941
|
-
* labels. Resolved from the base `c:leaderLines/c:spPr` when present, else
|
|
1942
|
-
* falling back to the Office 2013+ chart15 extension's mirror
|
|
1943
|
-
* (`c:extLst/c:ext/c15:leaderLines/c:spPr`, uri
|
|
1944
|
-
* `{CE6537A1-D6FC-4f65-9D91-7224C49458BB}`), which is the one PowerPoint
|
|
1945
|
-
* itself treats as authoritative when both are present. Confirmed against
|
|
1946
|
-
* `e2e/fixtures/issue-132-gradient-fill.pptx` and
|
|
1947
|
-
* `e2e/fixtures/issue-132-hr-deck.pptx`, both of which write only the
|
|
1948
|
-
* extension form. `undefined` leaves the renderer's own default leader-line
|
|
1949
|
-
* stroke.
|
|
1950
|
-
*/
|
|
1951
|
-
leaderLineStyle?: PptxChartShapeProps;
|
|
1952
|
-
/**
|
|
1953
|
-
* Label position (`c:dLblPos`). Valid values depend on the chart type
|
|
1954
|
-
* (`ctr`, `inEnd`, `inBase`, `outEnd`, `bestFit`, `l`, `r`, `t`, `b`).
|
|
1955
|
-
* Omit to let PowerPoint use the type default.
|
|
1956
|
-
*/
|
|
1957
|
-
position?: PptxChartDataLabelPosition;
|
|
1958
|
-
/**
|
|
1959
|
-
* Chart-level number-format override (`c:dLbls/c:numFmt/@formatCode`),
|
|
1960
|
-
* applied to every label of the series/chart-type unless a per-point
|
|
1961
|
-
* {@link PptxChartDataLabel.numberFormat} overrides it.
|
|
1962
|
-
*/
|
|
1963
|
-
numberFormat?: string;
|
|
1964
|
-
/**
|
|
1965
|
-
* Default font for every label at this level (`c:dLbls/c:txPr`, or
|
|
1966
|
-
* ChartEx `cx:dataLabels/cx:txPr`), overridden by a per-point
|
|
1967
|
-
* {@link PptxChartDataLabel.txPr} when set. `c:dLbls` at the chart-type
|
|
1968
|
-
* level and the series level cascade the same way the show flags do
|
|
1969
|
-
* (point > series > chart-type).
|
|
1970
|
-
*/
|
|
1971
|
-
txPr?: PptxChartLegendTextStyle;
|
|
1972
|
-
/**
|
|
1973
|
-
* PowerPoint 2013+ "Value From Cells", series-wide form
|
|
1974
|
-
* (`c15:datalabelsRange`, chart15 uri `{CE6537A1-...}`): one cell range
|
|
1975
|
-
* supplies every label in this group, aligned by point index. A
|
|
1976
|
-
* SERIES-WIDE alternative to the per-point `c15:dlblFieldTable` mechanism
|
|
1977
|
-
* (already resolved into {@link PptxChartDataLabel.text} at parse time).
|
|
1978
|
-
* See `utils/chart-data-labels-range.ts`.
|
|
1979
|
-
*/
|
|
1980
|
-
dataLabelsRange?: PptxChartDataLabelsRange;
|
|
1981
|
-
/**
|
|
1982
|
-
* `c15:showDataLabelsRange` at the SAME level as {@link dataLabelsRange}:
|
|
1983
|
-
* whether every label in this group resolves through the range's cache.
|
|
1984
|
-
* Distinct from the per-point {@link PptxChartDataLabel} flag of the same
|
|
1985
|
-
* XML name. Only meaningful when {@link dataLabelsRange} is set.
|
|
1986
|
-
*/
|
|
1987
|
-
showDataLabelsRange?: boolean;
|
|
1988
|
-
}
|
|
1989
|
-
/** Typed text defaults for a single chart legend entry. */
|
|
1990
|
-
interface PptxChartLegendTextStyle {
|
|
1991
|
-
fontFamily?: string;
|
|
1992
|
-
/**
|
|
1993
|
-
* East Asian typeface (`a:ea/@typeface`). PowerPoint draws CJK characters
|
|
1994
|
-
* in this face and everything else in {@link fontFamily}.
|
|
1995
|
-
*/
|
|
1996
|
-
eastAsiaFontFamily?: string;
|
|
1997
|
-
fontSize?: number;
|
|
1998
|
-
bold?: boolean;
|
|
1999
|
-
italic?: boolean;
|
|
2000
|
-
color?: string;
|
|
2001
|
-
}
|
|
2002
|
-
/** Per-series legend entry override (`c:legendEntry`). */
|
|
2003
|
-
interface PptxChartLegendEntry {
|
|
2004
|
-
index: number;
|
|
2005
|
-
deleted?: boolean;
|
|
2006
|
-
textStyle?: PptxChartLegendTextStyle;
|
|
2007
|
-
}
|
|
2008
|
-
/**
|
|
2009
|
-
* Style / formatting metadata for a chart.
|
|
2010
|
-
*
|
|
2011
|
-
* @example
|
|
2012
|
-
* ```ts
|
|
2013
|
-
* const style: PptxChartStyle = {
|
|
2014
|
-
* styleId: 2,
|
|
2015
|
-
* hasLegend: true,
|
|
2016
|
-
* legendPosition: "b",
|
|
2017
|
-
* hasDataLabels: true,
|
|
2018
|
-
* };
|
|
2019
|
-
* // => satisfies PptxChartStyle
|
|
2020
|
-
* ```
|
|
2021
|
-
*/
|
|
2022
|
-
interface PptxChartStyle {
|
|
2023
|
-
/** Chart style index from `c:style/@val`. */
|
|
2024
|
-
styleId?: number;
|
|
2025
|
-
/** Whether the chart has a visible legend. */
|
|
2026
|
-
hasLegend?: boolean;
|
|
2027
|
-
/**
|
|
2028
|
-
* Legend position (t, b, l, r, tr), exactly as written. Absent when the
|
|
2029
|
-
* legend declares none, which PowerPoint draws on the right; the default is
|
|
2030
|
-
* left to the renderer so a save never adds a `c:legendPos` the source lacked.
|
|
2031
|
-
*/
|
|
2032
|
-
legendPosition?: string;
|
|
2033
|
-
/**
|
|
2034
|
-
* Whether the legend floats over the plot instead of reserving space beside
|
|
2035
|
-
* it. Classic charts read `c:legend/c:overlay`, and PowerPoint treats a
|
|
2036
|
-
* missing element as an overlay for every position (measured with
|
|
2037
|
-
* PowerPoint 16: `IncludeInLayout` is false). ChartEx charts read
|
|
2038
|
-
* `cx:legend/@overlay` only when present. Absent when unknown.
|
|
2039
|
-
*/
|
|
2040
|
-
legendOverlay?: boolean;
|
|
2041
|
-
/** Per-series visibility and text-style overrides. */
|
|
2042
|
-
legendEntries?: PptxChartLegendEntry[];
|
|
2043
|
-
/**
|
|
2044
|
-
* The legend's own default text style (`c:legend/c:txPr`), falling back to
|
|
2045
|
-
* the chart-wide default (`c:chartSpace/c:txPr`) when the legend has none
|
|
2046
|
-
* of its own. Applies to every legend entry that has no per-entry
|
|
2047
|
-
* `c:legendEntry/c:txPr` override (see {@link PptxChartLegendEntry.textStyle}),
|
|
2048
|
-
* which always wins over this chart-level default.
|
|
2049
|
-
*/
|
|
2050
|
-
legendTextStyle?: PptxChartLegendTextStyle;
|
|
2051
|
-
/**
|
|
2052
|
-
* The chart-wide default text style: `c:chartSpace/c:txPr` over the theme's
|
|
2053
|
-
* minor (body) fonts. PowerPoint uses it for any chart text whose own
|
|
2054
|
-
* `txPr` leaves a field unset, such as axis labels and data labels. Not
|
|
2055
|
-
* written back on save: the authored `c:txPr` is kept as it is.
|
|
2056
|
-
*/
|
|
2057
|
-
textStyle?: PptxChartLegendTextStyle;
|
|
2058
|
-
/** Whether the chart has a title. */
|
|
2059
|
-
hasTitle?: boolean;
|
|
2060
|
-
/** Whether gridlines are visible. */
|
|
2061
|
-
hasGridlines?: boolean;
|
|
2062
|
-
/**
|
|
2063
|
-
* Chart-area fill from `c:chartSpace/c:spPr`: a resolved colour, or the
|
|
2064
|
-
* literal `'none'` when the source declares `<a:noFill/>`. Absent when the
|
|
2065
|
-
* chart says nothing, in which case the renderer picks its own default.
|
|
2066
|
-
* PowerPoint decks routinely set `a:noFill` so the chart floats on the slide
|
|
2067
|
-
* background; painting a panel behind it boxes the chart in.
|
|
2068
|
-
*/
|
|
2069
|
-
chartAreaFill?: string;
|
|
2070
|
-
/** Plot-area fill from `c:plotArea/c:spPr`. See {@link chartAreaFill}. */
|
|
2071
|
-
plotAreaFill?: string;
|
|
2072
|
-
/** Chart-area gradient (`c:chartSpace/c:spPr/a:gradFill`); wins over {@link chartAreaFill}. */
|
|
2073
|
-
chartAreaGradient?: PptxChartGradientFill;
|
|
2074
|
-
/** Plot-area gradient (`c:plotArea/c:spPr/a:gradFill`); wins over {@link plotAreaFill}. */
|
|
2075
|
-
plotAreaGradient?: PptxChartGradientFill;
|
|
2076
|
-
/**
|
|
2077
|
-
* Chart-area border from `c:chartSpace/c:spPr/a:ln`: a resolved colour, or
|
|
2078
|
-
* `'none'` for `a:ln/a:noFill`. Absent when the chart says nothing.
|
|
2079
|
-
* Written for generated charts and reconciled on save for loaded ones,
|
|
2080
|
-
* together with {@link chartAreaFill} and {@link chartAreaGradient}.
|
|
2081
|
-
*/
|
|
2082
|
-
chartAreaBorder?: string;
|
|
2083
|
-
/** Plot-area border from `c:plotArea/c:spPr/a:ln`. See {@link chartAreaBorder}. */
|
|
2084
|
-
plotAreaBorder?: string;
|
|
2085
|
-
/** Whether data labels are shown. */
|
|
2086
|
-
hasDataLabels?: boolean;
|
|
2087
|
-
/** Chart-level data-label content/position options (when `hasDataLabels`). */
|
|
2088
|
-
dataLabels?: PptxChartDataLabelOptions;
|
|
2089
|
-
/**
|
|
2090
|
-
* Font styling for the chart's own title (`c:title/c:txPr`), edited via
|
|
2091
|
-
* `applyChartTitleStyleToXml` (chart-title-style-serializer.ts). Distinct
|
|
2092
|
-
* from an axis title's styling (`PptxChartAxisFormatting.fontFamily` etc.).
|
|
2093
|
-
*/
|
|
2094
|
-
titleFontFamily?: string;
|
|
2095
|
-
/** East Asian typeface of the title (`a:ea/@typeface`). */
|
|
2096
|
-
titleEastAsiaFontFamily?: string;
|
|
2097
|
-
titleFontSize?: number;
|
|
2098
|
-
titleFontBold?: boolean;
|
|
2099
|
-
titleFontColor?: string;
|
|
2100
|
-
/** Title text-box fill/border (`c:title/c:spPr`). `null` removes it. */
|
|
2101
|
-
titleSpPr?: PptxChartShapeProps | null;
|
|
2102
|
-
}
|
|
2103
|
-
/**
|
|
2104
|
-
* External data source reference for a chart (c:externalData).
|
|
2105
|
-
*
|
|
2106
|
-
* Charts can reference an external Excel workbook via a relationship ID
|
|
2107
|
-
* that points to an external file (TargetMode="External"). The
|
|
2108
|
-
* `autoUpdate` flag indicates whether the chart should refresh its
|
|
2109
|
-
* cached data from the external source on open.
|
|
2110
|
-
*
|
|
2111
|
-
* @example
|
|
2112
|
-
* ```ts
|
|
2113
|
-
* const ext: PptxExternalData = {
|
|
2114
|
-
* relId: "rId2",
|
|
2115
|
-
* targetPath: "file:///C:/Data/budget.xlsx",
|
|
2116
|
-
* autoUpdate: true,
|
|
2117
|
-
* };
|
|
2118
|
-
* // => satisfies PptxExternalData
|
|
2119
|
-
* ```
|
|
2120
|
-
*/
|
|
2121
|
-
interface PptxExternalData {
|
|
2122
|
-
/** Whether the relationship has TargetMode="External". */
|
|
2123
|
-
isExternal?: boolean;
|
|
2124
|
-
/** Relationship ID referencing the external data source in the chart .rels. */
|
|
2125
|
-
relId: string;
|
|
2126
|
-
/** Resolved external file path or URL from the relationship target. */
|
|
2127
|
-
targetPath?: string;
|
|
2128
|
-
/** Whether to auto-update data from the external source on open. */
|
|
2129
|
-
autoUpdate?: boolean;
|
|
2130
|
-
/** Raw binary data of the embedded xlsx workbook (from ppt/embeddings/). */
|
|
2131
|
-
embeddedWorkbookData?: Uint8Array;
|
|
2132
|
-
}
|
|
2133
|
-
/**
|
|
2134
|
-
* Options specific to the OOXML "Pie of Pie" / "Bar of Pie" chart
|
|
2135
|
-
* (`c:ofPieChart`, ECMA-376 §21.2.2.126 / CT_OfPieChart).
|
|
2136
|
-
*
|
|
2137
|
-
* The primary discriminator is {@link ofPieType}: `"pie"` produces a
|
|
2138
|
-
* pie-of-pie chart whose secondary plot is itself a pie, while `"bar"`
|
|
2139
|
-
* produces a bar-of-pie chart whose secondary plot is a horizontal bar.
|
|
2140
|
-
*
|
|
2141
|
-
* - {@link splitType} chooses the split rule.
|
|
2142
|
-
* - {@link splitPos} is the threshold value used by `pos`/`val`/`percent`.
|
|
2143
|
-
* - {@link secondPieSize} controls the secondary plot's size (5–200%).
|
|
2144
|
-
* - {@link serLines} toggles the leader lines connecting the plots.
|
|
2145
|
-
* - {@link gapWidth} is the gap between the plots in percent (0–500).
|
|
2146
|
-
*/
|
|
2147
|
-
interface PptxChartOfPieOptions {
|
|
2148
|
-
ofPieType: 'pie' | 'bar';
|
|
2149
|
-
splitType?: 'auto' | 'cust' | 'percent' | 'pos' | 'val';
|
|
2150
|
-
splitPos?: number;
|
|
2151
|
-
custSplit?: number[];
|
|
2152
|
-
secondPieSize?: number;
|
|
2153
|
-
serLines?: boolean;
|
|
2154
|
-
gapWidth?: number;
|
|
2155
|
-
}
|
|
2156
|
-
/** Classic `c:bubbleChart` options from CT_BubbleChart. */
|
|
2157
|
-
interface PptxBubbleChartOptions {
|
|
2158
|
-
bubble3D?: boolean;
|
|
2159
|
-
/** Bubble diameter scale in percent, constrained to 0 through 300. */
|
|
2160
|
-
bubbleScale?: number;
|
|
2161
|
-
showNegativeBubbles?: boolean;
|
|
2162
|
-
sizeRepresents?: 'area' | 'w';
|
|
2163
|
-
}
|
|
2164
|
-
/**
|
|
2165
|
-
* 3D viewing parameters for a chart (`c:view3D`, ECMA-376 §21.2.2.228 /
|
|
2166
|
-
* CT_View3D).
|
|
2167
|
-
*
|
|
2168
|
-
* All fields are optional and round-trip verbatim.
|
|
2169
|
-
*
|
|
2170
|
-
* - {@link rotX}: X-axis rotation in degrees (-90…90).
|
|
2171
|
-
* - {@link rotY}: Y-axis rotation in degrees (0…360).
|
|
2172
|
-
* - {@link depthPercent}: chart depth as a percentage of base width.
|
|
2173
|
-
* - {@link rAngAx}: `true` if axes meet at right angles.
|
|
2174
|
-
* - {@link perspective}: perspective angle in degrees (0…240).
|
|
2175
|
-
* - {@link hPercent}: height as a percentage of chart width.
|
|
2176
|
-
*/
|
|
2177
|
-
interface PptxChartView3D {
|
|
2178
|
-
rotX?: number;
|
|
2179
|
-
rotY?: number;
|
|
2180
|
-
depthPercent?: number;
|
|
2181
|
-
rAngAx?: boolean;
|
|
2182
|
-
perspective?: number;
|
|
2183
|
-
hPercent?: number;
|
|
2184
|
-
}
|
|
2185
|
-
/**
|
|
2186
|
-
* Chart "chrome" flags from `c:chart` that round-trip cleanly even when
|
|
2187
|
-
* rendering ignores them.
|
|
2188
|
-
*
|
|
2189
|
-
* - {@link autoTitleDeleted}: `c:autoTitleDeleted/@val`. Suppresses the
|
|
2190
|
-
* auto-generated title for single-series charts.
|
|
2191
|
-
* - {@link dispBlanksAs}: `c:dispBlanksAs/@val`. How blank cells
|
|
2192
|
-
* render: `"gap"`, `"zero"`, or `"span"`.
|
|
2193
|
-
* - {@link showDLblsOverMax}: `c:showDLblsOverMax/@val`. Keeps data
|
|
2194
|
-
* labels visible for points exceeding the value-axis maximum.
|
|
2195
|
-
* - {@link dispNaAsBlank}: the Office 2017+ chart extension
|
|
2196
|
-
* `c:extLst/c:ext/c16r3:dataDisplayOptions16/c16r3:dispNaAsBlank/@val`
|
|
2197
|
-
* (uri `{56B9EC1D-385E-4148-901F-78D8002777C0}`), PowerPoint's "Show #N/A
|
|
2198
|
-
* as an empty cell" chart option. Confirmed against real corpus markup
|
|
2199
|
-
* (`e2e/fixtures/chart-data-fidelity.pptx`).
|
|
2200
|
-
*
|
|
2201
|
-
* `c:plotVisOnly` lives on {@link PptxChartData.plotVisibleOnly} and is
|
|
2202
|
-
* intentionally not duplicated here.
|
|
2203
|
-
*/
|
|
2204
|
-
interface PptxChartChrome {
|
|
2205
|
-
autoTitleDeleted?: boolean;
|
|
2206
|
-
dispBlanksAs?: 'gap' | 'zero' | 'span';
|
|
2207
|
-
showDLblsOverMax?: boolean;
|
|
2208
|
-
dispNaAsBlank?: boolean;
|
|
2209
|
-
}
|
|
2210
|
-
/** Manual chart placement from `c:layout/c:manualLayout` (CT_ManualLayout). */
|
|
2211
|
-
interface PptxChartManualLayout extends ChartManualLayout {
|
|
2212
|
-
/**
|
|
2213
|
-
* Raw `c:extLst` (CT_ExtensionList) of the `c:manualLayout`, captured
|
|
2214
|
-
* verbatim so it round-trips through the typed model. Without this, a dirty
|
|
2215
|
-
* write of an edited layout would drop the extension list (the manual node
|
|
2216
|
-
* is rebuilt from the typed fields). Emitted as the trailing child, matching
|
|
2217
|
-
* the CT_ManualLayout schema order.
|
|
2218
|
-
*/
|
|
2219
|
-
ext?: XmlObject;
|
|
2220
|
-
}
|
|
2221
|
-
/**
|
|
2222
|
-
* Typed manual layouts for chart regions that accept `c:layout`.
|
|
2223
|
-
* A `null` region removes its manual layout without removing extensions.
|
|
2224
|
-
*/
|
|
2225
|
-
interface PptxChartLayouts {
|
|
2226
|
-
title?: PptxChartManualLayout | null;
|
|
2227
|
-
plotArea?: PptxChartManualLayout | null;
|
|
2228
|
-
legend?: PptxChartManualLayout | null;
|
|
2229
|
-
}
|
|
2230
|
-
/** Parsed data extracted from an embedded xlsx workbook. */
|
|
2231
|
-
interface PptxEmbeddedWorkbookData {
|
|
2232
|
-
/** Category labels from the first column/row. */
|
|
2233
|
-
categories: string[];
|
|
2234
|
-
/** Data series extracted from worksheet cells. */
|
|
2235
|
-
series: Array<{
|
|
2236
|
-
name: string;
|
|
2237
|
-
values: number[];
|
|
2238
|
-
}>;
|
|
2239
|
-
/** Whether the workbook uses the 1904 date system. */
|
|
2240
|
-
date1904?: boolean;
|
|
2241
|
-
}
|
|
2242
|
-
/** Raw numeric category cache used by a classic ChartML date axis. */
|
|
2243
|
-
interface PptxChartDateCategories {
|
|
2244
|
-
values: number[];
|
|
2245
|
-
/** False/default uses Excel's 1900 date system; true uses the 1904 system. */
|
|
2246
|
-
date1904?: boolean;
|
|
2247
|
-
/** Number format copied from the numeric category cache. */
|
|
2248
|
-
formatCode?: string;
|
|
2249
|
-
}
|
|
2250
|
-
/**
|
|
2251
|
-
* Complete parsed chart data for a {@link ChartPptxElement}.
|
|
2252
|
-
*
|
|
2253
|
-
* @example
|
|
2254
|
-
* ```ts
|
|
2255
|
-
* const chart: PptxChartData = {
|
|
2256
|
-
* title: "Q4 Sales",
|
|
2257
|
-
* chartType: "bar",
|
|
2258
|
-
* categories: ["Jan", "Feb", "Mar"],
|
|
2259
|
-
* series: [
|
|
2260
|
-
* { name: "Revenue", values: [100, 120, 140] },
|
|
2261
|
-
* ],
|
|
2262
|
-
* grouping: "clustered",
|
|
2263
|
-
* style: { hasLegend: true, legendPosition: "b" },
|
|
2264
|
-
* };
|
|
2265
|
-
* // => satisfies PptxChartData
|
|
2266
|
-
* ```
|
|
2267
|
-
*/
|
|
2268
|
-
interface PptxChartData {
|
|
2269
|
-
/** ChartEx category-axis gap as a percentage of funnel bar height; absent uses Office's 33. */
|
|
2270
|
-
funnelGapWidth?: number;
|
|
2271
|
-
title?: string;
|
|
2272
|
-
/**
|
|
2273
|
-
* Rich-text runs of the title, parsed from `c:title/c:tx/c:rich` (issue:
|
|
2274
|
-
* chart title rich text). Lossless multi-run alternative to the flat
|
|
2275
|
-
* {@link title}: when present, the writer serialises every run's own
|
|
2276
|
-
* bold/italic/size/color; when absent, save falls back to the flat
|
|
2277
|
-
* `title` path as before. Only populated for a classic (`c:`) chart's
|
|
2278
|
-
* rich (typed) title, not a ChartEx (`cx:`) title or one authored as a
|
|
2279
|
-
* linked-cell reference.
|
|
2280
|
-
*/
|
|
2281
|
-
titleRuns?: PptxChartTitleRun[];
|
|
2282
|
-
/** Whether parsed title text can be replaced without changing its source or paragraph structure. */
|
|
2283
|
-
titleTextEditable?: boolean;
|
|
2284
|
-
/** Label sources passed atomic embedded-workbook preflight at load. */
|
|
2285
|
-
dataLabelTextEditable?: boolean;
|
|
2286
|
-
/** Source dimensions captured by label preflight, invalidated by structural edits. */
|
|
2287
|
-
dataLabelSourceShape?: {
|
|
2288
|
-
categoryCount: number;
|
|
2289
|
-
seriesValueCounts: number[];
|
|
2290
|
-
};
|
|
2291
|
-
/** Require transactional workbook write-back for label search edits. */
|
|
2292
|
-
dataLabelTextOnly?: boolean;
|
|
2293
|
-
/** A text-only title edit: retain the authored rich XML and change only run text on save. */
|
|
2294
|
-
titleTextOnly?: boolean;
|
|
2295
|
-
/** Run-style snapshot used to stop a text-only edit from masking later formatting changes. */
|
|
2296
|
-
titleTextOnlyStyles?: Omit<PptxChartTitleRun, 'text'>[];
|
|
2297
|
-
chartType: PptxChartType;
|
|
2298
|
-
categories: string[];
|
|
2299
|
-
/**
|
|
2300
|
-
* Hierarchical category levels in source XML order, for both ChartEx
|
|
2301
|
-
* hierarchy charts (`cx:multiLvlStrRef`) and classic multi-level category
|
|
2302
|
-
* axes (`c:cat/c:multiLvlStrRef`, e.g. a PowerPoint Quarter > Month
|
|
2303
|
-
* grouping). Level 0 contains the leaf labels and remains mirrored by
|
|
2304
|
-
* {@link categories} for consumers that only understand a flat category
|
|
2305
|
-
* axis. Parent (grouping) levels are forward-filled: a blank cache slot
|
|
2306
|
-
* continues the previous group's label, matching how the source stores a
|
|
2307
|
-
* merged category header sparsely.
|
|
2308
|
-
*/
|
|
2309
|
-
categoryLevels?: string[][];
|
|
2310
|
-
dateCategories?: PptxChartDateCategories;
|
|
2311
|
-
series: PptxChartSeries[];
|
|
2312
|
-
/**
|
|
2313
|
-
* Series hidden from the plot by PowerPoint's "Chart Filters" feature
|
|
2314
|
-
* (Series tab) but still present in the workbook, aggregated across every
|
|
2315
|
-
* chart-type container (combo charts can carry more than one). Absent
|
|
2316
|
-
* when the chart has no such extension. See {@link PptxChartFilteredSeries}.
|
|
2317
|
-
*/
|
|
2318
|
-
filteredSeries?: PptxChartFilteredSeries[];
|
|
2319
|
-
/**
|
|
2320
|
-
* `c15:filteredSeriesTitle`: the auto-generated series title text (e.g.
|
|
2321
|
-
* "Series 3") PowerPoint preserved when the chart filter hid the series
|
|
2322
|
-
* whose data would otherwise have supplied it. See
|
|
2323
|
-
* `utils/chart-ext-titles.ts`. Read-mostly like {@link filteredSeries}.
|
|
2324
|
-
*/
|
|
2325
|
-
filteredSeriesTitle?: string;
|
|
2326
|
-
/**
|
|
2327
|
-
* `c15:filteredCategoryTitle`: the auto-numbered category labels ("1",
|
|
2328
|
-
* "2", "3", ...) PowerPoint preserved when the chart filter hid the
|
|
2329
|
-
* category axis source entirely. See `utils/chart-ext-titles.ts`.
|
|
2330
|
-
*/
|
|
2331
|
-
filteredCategoryTitle?: string[];
|
|
2332
|
-
/** Chart style/formatting metadata. */
|
|
2333
|
-
style?: PptxChartStyle;
|
|
2334
|
-
/** Grouping mode for bar/area/line charts: 'clustered' | 'stacked' | 'percentStacked' */
|
|
2335
|
-
grouping?: 'clustered' | 'stacked' | 'percentStacked';
|
|
2336
|
-
/**
|
|
2337
|
-
* The source `c:grouping` was `standard`, which {@link grouping} folds into
|
|
2338
|
-
* `'clustered'` (a 2D bar chart draws the two the same). A 3D chart draws
|
|
2339
|
-
* `standard` differently: each series on its own depth row. The writer
|
|
2340
|
-
* emits `standard` again while `grouping` is still `'clustered'`, so the
|
|
2341
|
-
* chart round-trips unchanged.
|
|
2342
|
-
*/
|
|
2343
|
-
groupingStandard?: boolean;
|
|
2344
|
-
/**
|
|
2345
|
-
* Whether the first (or only) series varies its point colours
|
|
2346
|
-
* (`c:varyColors/@val`). Pie/doughnut default this on; single-series
|
|
2347
|
-
* bar/column honour it by giving each point a distinct palette colour.
|
|
2348
|
-
* Absent when the source XML omits `c:varyColors`.
|
|
2349
|
-
*/
|
|
2350
|
-
varyColors?: boolean;
|
|
2351
|
-
/**
|
|
2352
|
-
* Pie/doughnut start angle in degrees clockwise from 12 o'clock
|
|
2353
|
-
* (`c:firstSliceAng/@val`, `ST_FirstSliceAng`, 0 through 360). Absent uses
|
|
2354
|
-
* the default 0. Written for generated pie and doughnut charts and
|
|
2355
|
-
* reconciled on save for loaded ones (see `utils/chart-group-options.ts`).
|
|
2356
|
-
*/
|
|
2357
|
-
firstSliceAngle?: number;
|
|
2358
|
-
/**
|
|
2359
|
-
* Doughnut hole diameter as a percentage of the outer diameter
|
|
2360
|
-
* (`c:holeSize/@val`, `ST_HoleSize`, 1 through 90). Absent uses the
|
|
2361
|
-
* renderer default; a generated doughnut writes 50. Reconciled on save for
|
|
2362
|
-
* loaded charts.
|
|
2363
|
-
*/
|
|
2364
|
-
doughnutHoleSize?: number;
|
|
2365
|
-
/**
|
|
2366
|
-
* Bar series direction (`c:barDir/@val`): `"col"` draws vertical columns,
|
|
2367
|
-
* `"bar"` draws horizontal bars. Absent means `"col"` (PowerPoint's own
|
|
2368
|
-
* default), so only horizontal bar charts need to carry the field.
|
|
2369
|
-
*/
|
|
2370
|
-
barDirection?: PptxChartBarDirection;
|
|
2371
|
-
/**
|
|
2372
|
-
* 3-D bar/column shape (`c:bar3DChart/c:shape/@val`). Bar3D only; a plain
|
|
2373
|
-
* bar chart has no `c:shape` element. A per-series `c:ser/c:shape`
|
|
2374
|
-
* ({@link PptxChartSeries.shape}) overrides this for that series.
|
|
2375
|
-
*/
|
|
2376
|
-
barShape?: PptxBar3DShape;
|
|
2377
|
-
/**
|
|
2378
|
-
* Radar chart drawing style (`c:radarChart/c:radarStyle/@val`). `standard`
|
|
2379
|
-
* draws an outline only, `marker` adds markers at each vertex (PowerPoint's
|
|
2380
|
-
* own default for every radar chart it authors), and `filled` paints the
|
|
2381
|
-
* enclosed polygon with the series fill and omits markers. Radar only.
|
|
2382
|
-
*/
|
|
2383
|
-
radarStyle?: 'standard' | 'marker' | 'filled';
|
|
2384
|
-
/**
|
|
2385
|
-
* Whether a surface chart renders as a wireframe grid rather than a solid
|
|
2386
|
-
* coloured surface (`c:surfaceChart/c:wireframe/@val` or
|
|
2387
|
-
* `c:surface3DChart/c:wireframe/@val`, both modeled as chart type
|
|
2388
|
-
* `"surface"`). A `CT_Boolean` element: absent from the source XML
|
|
2389
|
-
* defaults to `true` per schema, so `undefined` here means "not present in
|
|
2390
|
-
* the source" and callers should treat it as `true`. Surface only.
|
|
2391
|
-
*/
|
|
2392
|
-
wireframe?: boolean;
|
|
2393
|
-
/**
|
|
2394
|
-
* Whether the surface chart is the 2-D "top view" projection
|
|
2395
|
-
* (`c:surfaceChart`, PowerPoint's "Contour" / "Wireframe Contour" types)
|
|
2396
|
-
* rather than the 3-D isometric one (`c:surface3DChart`, "3-D Surface" /
|
|
2397
|
-
* "3-D Surface (Wireframe)"). Both element names map to chart type
|
|
2398
|
-
* `"surface"`; this bit is the only thing that tells the renderer which
|
|
2399
|
-
* of the two projections PowerPoint actually drew, since a top-view
|
|
2400
|
-
* surface has no Z-axis at all (only category and series axes) while the
|
|
2401
|
-
* 3-D one draws all three. Surface only; `undefined` for every other
|
|
2402
|
-
* chart type.
|
|
2403
|
-
*/
|
|
2404
|
-
surfaceTopView?: boolean;
|
|
2405
|
-
/**
|
|
2406
|
-
* Scatter presentation mode (`c:scatterChart/c:scatterStyle/@val`).
|
|
2407
|
-
*
|
|
2408
|
-
* `lineMarker` (PowerPoint's own default for every scatter it writes) and
|
|
2409
|
-
* `smoothMarker` draw a connecting line; `marker` and `none` do not. Whether
|
|
2410
|
-
* the MARKERS appear is decided separately by `c:marker/c:symbol`, and
|
|
2411
|
-
* whether the LINE appears is further gated by
|
|
2412
|
-
* {@link PptxChartSeries.lineNoFill} - PowerPoint expresses "markers only" as
|
|
2413
|
-
* `lineMarker` plus an `a:ln/a:noFill`, not as `marker`.
|
|
2414
|
-
*/
|
|
2415
|
-
scatterStyle?: PptxChartScatterStyle;
|
|
2416
|
-
/**
|
|
2417
|
-
* Bar/column gap between category clusters as a percentage of bar width
|
|
2418
|
-
* (`c:gapWidth/@val`, `ST_GapAmount`, 0 through 500). Absent uses the
|
|
2419
|
-
* renderer default; a generated bar chart writes 150. Reconciled on save
|
|
2420
|
-
* for loaded charts.
|
|
2421
|
-
*/
|
|
2422
|
-
barGapWidth?: number;
|
|
2423
|
-
/**
|
|
2424
|
-
* Clustered bar/column overlap between series within a category as a
|
|
2425
|
-
* percentage (`c:overlap/@val`, `ST_Overlap`, -100 through 100). Absent
|
|
2426
|
-
* uses 0. `c:bar3DChart` has no overlap. Written for generated charts and
|
|
2427
|
-
* reconciled on save for loaded ones.
|
|
2428
|
-
*/
|
|
2429
|
-
barOverlap?: number;
|
|
2430
|
-
/** Internal: path to the chart XML part in the PPTX archive (for round-trip save). */
|
|
2431
|
-
chartPartPath?: string;
|
|
2432
|
-
/** Internal: relationship ID linking the graphic frame to the chart part. */
|
|
2433
|
-
chartRelationshipId?: string;
|
|
2434
|
-
/** `null` explicitly removes an existing ChartML data table. */
|
|
2435
|
-
dataTable?: PptxChartDataTable | null;
|
|
2436
|
-
/** `null` explicitly removes an existing `c:dropLines` element. */
|
|
2437
|
-
dropLines?: PptxChartLineStyle | null;
|
|
2438
|
-
/** `null` explicitly removes an existing `c:hiLowLines` element. */
|
|
2439
|
-
hiLowLines?: PptxChartLineStyle | null;
|
|
2440
|
-
/** `null` explicitly removes an existing up/down-bars container. */
|
|
2441
|
-
upDownBars?: PptxChartUpDownBars | null;
|
|
2442
|
-
axes?: PptxChartAxisFormatting[];
|
|
2443
|
-
floor?: PptxChart3DSurface;
|
|
2444
|
-
sideWall?: PptxChart3DSurface;
|
|
2445
|
-
backWall?: PptxChart3DSurface;
|
|
2446
|
-
/** Per-band surface-chart colour overrides (`c:surfaceChart/c:bandFmts`). */
|
|
2447
|
-
bandFmts?: PptxChartBandFmt[];
|
|
2448
|
-
/** External data source reference (c:externalData) linking to an external workbook. */
|
|
2449
|
-
externalData?: PptxExternalData;
|
|
2450
|
-
/**
|
|
2451
|
-
* Parsed data from the embedded xlsx workbook (from ppt/embeddings/).
|
|
2452
|
-
*
|
|
2453
|
-
* When a chart references an embedded Excel workbook via `c:externalData`,
|
|
2454
|
-
* the xlsx is parsed to extract categories and series. This data serves as
|
|
2455
|
-
* a fallback when the chart XML's cached series data is empty or incomplete.
|
|
2456
|
-
*/
|
|
2457
|
-
embeddedWorkbookData?: PptxEmbeddedWorkbookData;
|
|
2458
|
-
/**
|
|
2459
|
-
* Pivot table data source reference (c:pivotSource).
|
|
2460
|
-
*
|
|
2461
|
-
* When present, the chart's data originates from a PivotTable.
|
|
2462
|
-
* The chart still renders using its cached series data; this field
|
|
2463
|
-
* is metadata about the data origin, preserved for round-trip fidelity.
|
|
2464
|
-
*/
|
|
2465
|
-
pivotSource?: PptxChartPivotSource | null;
|
|
2466
|
-
/**
|
|
2467
|
-
* Whether only visible cells are plotted (c:plotVisOnly).
|
|
2468
|
-
* When `true` (the default), hidden cells are excluded from the chart.
|
|
2469
|
-
* When `false`, hidden data IS plotted.
|
|
2470
|
-
*/
|
|
2471
|
-
plotVisibleOnly?: boolean;
|
|
2472
|
-
/**
|
|
2473
|
-
* Color palette extracted from the chart's Office 2013+ color style part
|
|
2474
|
-
* (`chartColorStyle*.xml`). When present, this palette takes priority over
|
|
2475
|
-
* the `c:style/@val`-derived palette in `getChartStylePalette`.
|
|
2476
|
-
*
|
|
2477
|
-
* Each entry is a resolved hex colour string (e.g. `"#4472C4"`).
|
|
2478
|
-
*/
|
|
2479
|
-
colorPalette?: string[];
|
|
2480
|
-
/**
|
|
2481
|
-
* The deck theme's `accent1` to `accent6` as resolved hex colours (`#RRGGBB`),
|
|
2482
|
-
* recorded at load for rendering only and never written on save. A chart with
|
|
2483
|
-
* no colour-style part paints its `c:style` palette over these accents, as
|
|
2484
|
-
* PowerPoint does; absent when the theme does not define all six.
|
|
2485
|
-
*/
|
|
2486
|
-
themeAccentColors?: string[];
|
|
2487
|
-
/**
|
|
2488
|
-
* Color cycling method from the chart color style part's `meth` attribute.
|
|
2489
|
-
*
|
|
2490
|
-
* - `"cycle"`: repeat the palette colours in order (default)
|
|
2491
|
-
* - `"withinLinear"`: gradient within each series
|
|
2492
|
-
* - `"acrossLinear"`: gradient across series
|
|
2493
|
-
*/
|
|
2494
|
-
colorMethod?: 'cycle' | 'withinLinear' | 'acrossLinear';
|
|
2495
|
-
/** Internal source color-style part path used for lossless dirty saves. */
|
|
2496
|
-
colorStylePartPath?: string;
|
|
2497
|
-
/** Internal parsed palette snapshot used to detect actual edits. */
|
|
2498
|
-
colorStyleOriginalPalette?: string[];
|
|
2499
|
-
/** Internal parsed method snapshot used to detect actual edits. */
|
|
2500
|
-
colorStyleOriginalMethod?: 'cycle' | 'withinLinear' | 'acrossLinear';
|
|
2501
|
-
/**
|
|
2502
|
-
* Pie-of-pie / Bar-of-pie options (`c:ofPieChart`, CT_OfPieChart).
|
|
2503
|
-
*
|
|
2504
|
-
* Present only when {@link chartType} is `"ofPie"`. Carries the split
|
|
2505
|
-
* configuration, secondary plot size, and serLines flag so that an
|
|
2506
|
-
* `ofPieChart` element can be re-emitted on save with full fidelity.
|
|
2507
|
-
*/
|
|
2508
|
-
ofPieOptions?: PptxChartOfPieOptions;
|
|
2509
|
-
/** Classic bubble-chart display options (`c:bubbleChart`). */
|
|
2510
|
-
bubbleOptions?: PptxBubbleChartOptions;
|
|
2511
|
-
/**
|
|
2512
|
-
* 3D viewing parameters (`c:view3D`, CT_View3D).
|
|
2513
|
-
*
|
|
2514
|
-
* Parsed from and emitted to `c:chart/c:view3D`. Absent when the
|
|
2515
|
-
* chart XML has no `c:view3D` element.
|
|
2516
|
-
*/
|
|
2517
|
-
view3D?: PptxChartView3D;
|
|
2518
|
-
/**
|
|
2519
|
-
* Top-level chart chrome flags (`c:autoTitleDeleted`,
|
|
2520
|
-
* `c:dispBlanksAs`, `c:showDLblsOverMax`).
|
|
2521
|
-
*
|
|
2522
|
-
* Each flag is omitted from the emitted XML when absent on the
|
|
2523
|
-
* source data, so absence does not produce empty `<c:…/>` placeholders.
|
|
2524
|
-
*/
|
|
2525
|
-
chartChrome?: PptxChartChrome;
|
|
2526
|
-
/** `c:chartSpace/c:printSettings`; `null` removes the container on save. */
|
|
2527
|
-
printSettings?: PptxChartPrintSettings | null;
|
|
2528
|
-
/** `c:chartSpace/c:protection`; `null` removes the container on save. */
|
|
2529
|
-
protection?: PptxChartProtection | null;
|
|
2530
|
-
/** Editable manual placement for the title, plot area, and legend. */
|
|
2531
|
-
layouts?: PptxChartLayouts;
|
|
2532
|
-
/**
|
|
2533
|
-
* Raw `c:userShapes` XML subtree (a drawing tree) preserved verbatim.
|
|
2534
|
-
*
|
|
2535
|
-
* `c:userShapes` references a separate drawing part containing
|
|
2536
|
-
* shapes drawn over the chart. The reference is preserved as-is so
|
|
2537
|
-
* that round-trip save re-emits the original element without
|
|
2538
|
-
* attempting to parse the nested drawing tree.
|
|
2539
|
-
*/
|
|
2540
|
-
userShapesXml?: unknown;
|
|
2541
|
-
/**
|
|
2542
|
-
* Parsed, renderable drawing-overlay shapes resolved from the separate
|
|
2543
|
-
* drawing part referenced by `c:userShapes/@r:id`
|
|
2544
|
-
* (`ppt/drawings/drawingN.xml`). Each entry carries chart-relative anchor
|
|
2545
|
-
* geometry plus light shape/text formatting so the viewer can render an
|
|
2546
|
-
* overlay on top of the chart plot. Render-only: {@link userShapesXml}
|
|
2547
|
-
* remains the source of truth for round-trip save.
|
|
2548
|
-
*/
|
|
2549
|
-
userShapes?: PptxChartUserShape[];
|
|
2550
|
-
/**
|
|
2551
|
-
* Raw `c:pivotFmts` XML subtree preserved verbatim.
|
|
2552
|
-
*
|
|
2553
|
-
* `c:pivotFmts` carries a list of `c:pivotFmt` formatting overrides
|
|
2554
|
-
* for charts whose data originates from a PivotTable. Preserved
|
|
2555
|
-
* verbatim for round-trip fidelity.
|
|
2556
|
-
*/
|
|
2557
|
-
/** Typed pivot-chart format persistence; `null` removes `c:pivotFmts`. */
|
|
2558
|
-
pivotFormats?: PptxChartPivotFormats | null;
|
|
2559
|
-
/**
|
|
2560
|
-
* Color-map override (`c:clrMapOvr`) carrying 12 attributes that
|
|
2561
|
-
* remap theme colour roles for this chart only. Modeled as a flat
|
|
2562
|
-
* `attribute -> value` map (e.g. `{ bg1: 'lt1', accent1: 'accent2' }`)
|
|
2563
|
-
* so unknown/future attributes round-trip without code changes.
|
|
2564
|
-
* `null` explicitly removes an existing `c:clrMapOvr`; an empty object
|
|
2565
|
-
* is treated the same as `null` on save.
|
|
2566
|
-
*/
|
|
2567
|
-
clrMapOvr?: Record<string, string> | null;
|
|
2568
|
-
/**
|
|
2569
|
-
* Whether the chart's own cached numeric values use the 1904 date epoch
|
|
2570
|
-
* (`c:chartSpace/c:date1904/@val`). Independent of, and authoritative over,
|
|
2571
|
-
* any embedded workbook's `workbookPr/@date1904` (a chart can lack an
|
|
2572
|
-
* embedded workbook entirely, or its cache can legitimately differ from the
|
|
2573
|
-
* workbook's current setting). Absent when the source XML omits the
|
|
2574
|
-
* element, in which case the 1900 system applies (the schema default).
|
|
2575
|
-
*/
|
|
2576
|
-
date1904?: boolean;
|
|
2577
|
-
/**
|
|
2578
|
-
* PowerPoint's "Rounded corners" chart-area option
|
|
2579
|
-
* (`c:chartSpace/c:roundedCorners/@val`). Absent when the source XML omits
|
|
2580
|
-
* the element; PowerPoint then draws rounded corners, so square corners
|
|
2581
|
-
* need an explicit `false`. Written for generated charts when set, and
|
|
2582
|
-
* reconciled on save for loaded ones.
|
|
2583
|
-
*/
|
|
2584
|
-
roundedCorners?: boolean;
|
|
2585
|
-
/**
|
|
2586
|
-
* 3-D chart depth/spacing along the series axis, as a percentage
|
|
2587
|
-
* (`c:gapDepth/@val`, `ST_GapAmount`, 0 through 500). Legal on
|
|
2588
|
-
* `bar3D`/`area3D`/`line3D`/`surface` chart-type containers only. Read-only
|
|
2589
|
-
* for rendering: save round-trips it via the preserved chart XML rather
|
|
2590
|
-
* than a typed edit path.
|
|
2591
|
-
*/
|
|
2592
|
-
gapDepth?: number;
|
|
2593
|
-
/**
|
|
2594
|
-
* Parsed Office 2013+ chart-style part (`ppt/charts/style#.xml`,
|
|
2595
|
-
* `cs:chartStyle`), providing per-element font/line/fill defaults for
|
|
2596
|
-
* whichever built-in "Chart Styles" gallery entry ({@link PptxChartStyle.styleId})
|
|
2597
|
-
* is active. Absent when the chart has no such part (common for
|
|
2598
|
-
* automation-authored charts, where PowerPoint still implies style 2's
|
|
2599
|
-
* look via its own bundled defaults).
|
|
2600
|
-
*/
|
|
2601
|
-
chartStyleDefinition?: ResolvedChartStyleDefinition;
|
|
2602
|
-
/**
|
|
2603
|
-
* Format-pane edits per chart element (fill transparency, line details,
|
|
2604
|
-
* effects, legend/axis/data-label boxes), written into each element's
|
|
2605
|
-
* `c:spPr` on save. Absent on a chart the panes never touched. See
|
|
2606
|
-
* `types/chart-element-format.ts`.
|
|
2607
|
-
*/
|
|
2608
|
-
elementFormats?: PptxChartElementFormats;
|
|
2609
|
-
}
|
|
2610
|
-
/**
|
|
2611
|
-
* Discriminator for embedded media element types.
|
|
2612
|
-
*
|
|
2613
|
-
* @example
|
|
2614
|
-
* ```ts
|
|
2615
|
-
* const kind: PptxMediaType = "video";
|
|
2616
|
-
* // => "video" — one of: "video" | "audio" | "unknown"
|
|
2617
|
-
* ```
|
|
2618
|
-
*/
|
|
2619
|
-
type PptxMediaType = 'video' | 'audio' | 'unknown';
|
|
2620
|
-
type PptxMediaReferenceKind = 'audioCd' | 'wavAudioFile' | 'audioFile' | 'videoFile' | 'quickTimeFile';
|
|
2621
|
-
interface PptxAudioCdPosition {
|
|
2622
|
-
track: number;
|
|
2623
|
-
time?: number;
|
|
2624
|
-
/** Original `st` or `end` node, retained for lossless edits. */
|
|
2625
|
-
rawXml?: XmlObject;
|
|
2626
|
-
}
|
|
2627
|
-
/**
|
|
2628
|
-
* A named bookmark within a media clip timeline.
|
|
2629
|
-
*
|
|
2630
|
-
* @example
|
|
2631
|
-
* ```ts
|
|
2632
|
-
* const bm: MediaBookmark = {
|
|
2633
|
-
* id: "bm1",
|
|
2634
|
-
* time: 12.5,
|
|
2635
|
-
* label: "Intro ends",
|
|
2636
|
-
* };
|
|
2637
|
-
* // => satisfies MediaBookmark
|
|
2638
|
-
* ```
|
|
2639
|
-
*/
|
|
2640
|
-
interface MediaBookmark {
|
|
2641
|
-
id: string;
|
|
2642
|
-
/** Position in seconds from the start of the clip. */
|
|
2643
|
-
time: number;
|
|
2644
|
-
/** User-visible label for this bookmark. */
|
|
2645
|
-
label: string;
|
|
2646
|
-
}
|
|
2647
|
-
/**
|
|
2648
|
-
* Runtime-extracted metadata about a media clip (populated from HTMLMediaElement).
|
|
2649
|
-
*
|
|
2650
|
-
* @example
|
|
2651
|
-
* ```ts
|
|
2652
|
-
* const meta: MediaMetadata = {
|
|
2653
|
-
* duration: 120.5,
|
|
2654
|
-
* videoWidth: 1920,
|
|
2655
|
-
* videoHeight: 1080,
|
|
2656
|
-
* codecInfo: "video/mp4; codecs=\"avc1.640028\"",
|
|
2657
|
-
* };
|
|
2658
|
-
* // => satisfies MediaMetadata
|
|
2659
|
-
* ```
|
|
2660
|
-
*/
|
|
2661
|
-
interface MediaMetadata {
|
|
2662
|
-
/** Duration in seconds. */
|
|
2663
|
-
duration?: number;
|
|
2664
|
-
/** Video width in pixels (video only). */
|
|
2665
|
-
videoWidth?: number;
|
|
2666
|
-
/** Video height in pixels (video only). */
|
|
2667
|
-
videoHeight?: number;
|
|
2668
|
-
/** MIME type / codec string reported by the browser. */
|
|
2669
|
-
codecInfo?: string;
|
|
2670
|
-
}
|
|
2671
|
-
/**
|
|
2672
|
-
* A closed-caption / subtitle track associated with a media element.
|
|
2673
|
-
*
|
|
2674
|
-
* @example
|
|
2675
|
-
* ```ts
|
|
2676
|
-
* const track: MediaCaptionTrack = {
|
|
2677
|
-
* id: "t1",
|
|
2678
|
-
* label: "English",
|
|
2679
|
-
* language: "en",
|
|
2680
|
-
* kind: "subtitles",
|
|
2681
|
-
* isDefault: true,
|
|
2682
|
-
* };
|
|
2683
|
-
* // => satisfies MediaCaptionTrack
|
|
2684
|
-
* ```
|
|
2685
|
-
*/
|
|
2686
|
-
interface MediaCaptionTrack {
|
|
2687
|
-
/** Unique ID for this track. */
|
|
2688
|
-
id: string;
|
|
2689
|
-
/** Human-readable label (e.g. "English", "Spanish"). */
|
|
2690
|
-
label: string;
|
|
2691
|
-
/** BCP-47 language code (e.g. "en", "es"). */
|
|
2692
|
-
language: string;
|
|
2693
|
-
/** Track kind: subtitles, captions, or descriptions. */
|
|
2694
|
-
kind: 'subtitles' | 'captions' | 'descriptions';
|
|
2695
|
-
/** Data URL or path to the VTT/SRT content within the PPTX archive. */
|
|
2696
|
-
src?: string;
|
|
2697
|
-
/** Inline VTT content (for embedded captions). */
|
|
2698
|
-
content?: string;
|
|
2699
|
-
/** Whether this track is the default/active one. */
|
|
2700
|
-
isDefault?: boolean;
|
|
2701
|
-
}
|
|
2702
|
-
/**
|
|
2703
|
-
* Action types: hyperlinks, slide jumps, macros, and action buttons.
|
|
2704
|
-
*
|
|
2705
|
-
* @module pptx-types/actions
|
|
2706
|
-
*/
|
|
2707
|
-
/**
|
|
2708
|
-
* A parsed shape-level action from `a:hlinkClick` or `a:hlinkHover`.
|
|
2709
|
-
*
|
|
2710
|
-
* @example
|
|
2711
|
-
* ```ts
|
|
2712
|
-
* const link: PptxAction = {
|
|
2713
|
-
* url: "https://example.com",
|
|
2714
|
-
* tooltip: "Visit Example",
|
|
2715
|
-
* highlightClick: true,
|
|
2716
|
-
* };
|
|
2717
|
-
*
|
|
2718
|
-
* const slideJump: PptxAction = {
|
|
2719
|
-
* action: "ppaction://hlinksldjump",
|
|
2720
|
-
* targetSlideIndex: 3,
|
|
2721
|
-
* };
|
|
2722
|
-
* // => satisfies PptxAction
|
|
2723
|
-
* ```
|
|
2724
|
-
*/
|
|
2725
|
-
interface PptxAction {
|
|
2726
|
-
/** Relationship ID referencing the action target. */
|
|
2727
|
-
rId?: string;
|
|
2728
|
-
/** OOXML action string (e.g. `ppaction://hlinksldjump`). */
|
|
2729
|
-
action?: string;
|
|
2730
|
-
/** Tooltip text shown on hover. */
|
|
2731
|
-
tooltip?: string;
|
|
2732
|
-
/** Whether the shape should highlight on click. */
|
|
2733
|
-
highlightClick?: boolean;
|
|
2734
|
-
/** Resolved URL or file path from the slide relationship map. */
|
|
2735
|
-
url?: string;
|
|
2736
|
-
/** Zero-based index into the slides array for internal slide jumps. */
|
|
2737
|
-
targetSlideIndex?: number;
|
|
2738
|
-
/** Relationship ID of an optional click sound (`a:snd/@r:embed`). */
|
|
2739
|
-
soundRId?: string;
|
|
2740
|
-
/** Resolved media target path for the optional click sound. */
|
|
2741
|
-
soundPath?: string;
|
|
2742
|
-
/**
|
|
2743
|
-
* `CT_Hyperlink/@endSnd` (ECMA-376 20.1.2.2.23): PowerPoint's Action
|
|
2744
|
-
* Settings "Stop previous sound" checkbox. Round-tripped for now (issue
|
|
2745
|
-
* G14); not yet wired into playback.
|
|
2746
|
-
*/
|
|
2747
|
-
endSnd?: boolean;
|
|
2748
|
-
}
|
|
2749
|
-
/**
|
|
2750
|
-
* High-level action type for the action settings UI.
|
|
2751
|
-
* Maps to OOXML `ppaction://` verbs + external URLs.
|
|
2752
|
-
*
|
|
2753
|
-
* @example
|
|
2754
|
-
* ```ts
|
|
2755
|
-
* const type: ElementActionType = "slide";
|
|
2756
|
-
* // => "slide": one of: "none" | "url" | "slide" | "firstSlide" | "lastSlide" | "prevSlide" | "nextSlide" | "endShow" | "lastViewed" | "customShow" | "openFile" | "openPresentation" | "playMedia" | "oleVerb"
|
|
2757
|
-
* ```
|
|
2758
|
-
*/
|
|
2759
|
-
type ElementActionType = 'none' | 'url' | 'slide' | 'firstSlide' | 'lastSlide' | 'prevSlide' | 'nextSlide' | 'endShow' |
|
|
2760
|
-
/** `ppaction://hlinkshowjump?jump=lastslideviewed` - back to the last slide the audience saw. */
|
|
2761
|
-
'lastViewed' |
|
|
2762
|
-
/** `ppaction://customshow?id=N[&return=true]` - jump into a named custom show. */
|
|
2763
|
-
'customShow' |
|
|
2764
|
-
/** `ppaction://hlinkfile` - open an external file via the action's `r:id`. */
|
|
2765
|
-
'openFile' |
|
|
2766
|
-
/** `ppaction://hlinkpres` - open another presentation via the action's `r:id`. */
|
|
2767
|
-
'openPresentation' |
|
|
2768
|
-
/** `ppaction://media` - play (or toggle) the element's own embedded media. */
|
|
2769
|
-
'playMedia' |
|
|
2770
|
-
/** `ppaction://ole?verb=N` - run a numbered OLE verb on an embedded object. */
|
|
2771
|
-
'oleVerb' |
|
|
2772
|
-
/**
|
|
2773
|
-
* `ppaction://program` - PowerPoint's "Run program:" action; the program
|
|
2774
|
-
* path resolves via the hyperlink's `r:id` relationship, the same shape
|
|
2775
|
-
* as `hlinkfile` (issue G15).
|
|
2776
|
-
*/
|
|
2777
|
-
'runProgram';
|
|
2778
|
-
/**
|
|
2779
|
-
* User-facing action configuration stored on an element.
|
|
2780
|
-
* This is a convenience wrapper around the lower-level `PptxAction` that maps
|
|
2781
|
-
* to/from OOXML hyperlink/action attributes.
|
|
2782
|
-
*
|
|
2783
|
-
* @example
|
|
2784
|
-
* ```ts
|
|
2785
|
-
* const action: ElementAction = {
|
|
2786
|
-
* trigger: "click",
|
|
2787
|
-
* type: "url",
|
|
2788
|
-
* url: "https://example.com",
|
|
2789
|
-
* };
|
|
2790
|
-
*
|
|
2791
|
-
* const jumpToSlide: ElementAction = {
|
|
2792
|
-
* trigger: "click",
|
|
2793
|
-
* type: "slide",
|
|
2794
|
-
* slideIndex: 5,
|
|
2795
|
-
* };
|
|
2796
|
-
* // => satisfies ElementAction
|
|
2797
|
-
* ```
|
|
2798
|
-
*/
|
|
2799
|
-
interface ElementAction {
|
|
2800
|
-
/** When the action fires. */
|
|
2801
|
-
trigger: 'click' | 'hover';
|
|
2802
|
-
/** What kind of action to perform. */
|
|
2803
|
-
type: ElementActionType;
|
|
2804
|
-
/** External URL (for 'url' type), or the resolved external target (for 'openFile' / 'openPresentation'). */
|
|
2805
|
-
url?: string;
|
|
2806
|
-
/** Zero-based slide index (for 'slide' type). */
|
|
2807
|
-
slideIndex?: number;
|
|
2808
|
-
/** Custom show identifier (for 'customShow' type), from `ppaction://customshow?id=`. */
|
|
2809
|
-
customShowId?: string;
|
|
2810
|
-
/** Whether the show returns to its origin after the custom show ends (`&return=true`), for 'customShow'. */
|
|
2811
|
-
returnAfter?: boolean;
|
|
2812
|
-
/** OLE verb number (for 'oleVerb' type), from `ppaction://ole?verb=`. */
|
|
2813
|
-
oleVerb?: number;
|
|
2814
|
-
}
|
|
2815
|
-
/**
|
|
2816
|
-
* Preset action button definition (OOXML built-in action button shapes).
|
|
2817
|
-
*
|
|
2818
|
-
* @example
|
|
2819
|
-
* ```ts
|
|
2820
|
-
* const btn: ActionButtonPreset = {
|
|
2821
|
-
* shapeType: "actionButtonBackPrevious",
|
|
2822
|
-
* label: "Back",
|
|
2823
|
-
* defaultAction: "prevSlide",
|
|
2824
|
-
* iconPath: "M 0 0 L 10 5 L 0 10 Z",
|
|
2825
|
-
* };
|
|
2826
|
-
* // => satisfies ActionButtonPreset
|
|
2827
|
-
* ```
|
|
2828
|
-
*/
|
|
2829
|
-
interface ActionButtonPreset {
|
|
2830
|
-
/** OOXML preset geometry name (e.g. 'actionButtonBackPrevious'). */
|
|
2831
|
-
shapeType: string;
|
|
2832
|
-
/** Human-readable label. */
|
|
2833
|
-
label: string;
|
|
2834
|
-
/** Default action type pre-configured on the button. */
|
|
2835
|
-
defaultAction: ElementActionType;
|
|
2836
|
-
/** SVG path data for the icon rendered inside the button. */
|
|
2837
|
-
iconPath: string;
|
|
2838
|
-
}
|
|
2839
|
-
/**
|
|
2840
|
-
* Properties shared by **every** element on a slide.
|
|
2841
|
-
*
|
|
2842
|
-
* Position and size are in pixels (converted from EMU at parse time).
|
|
2843
|
-
* Optional properties apply to subsets of elements or may be absent in
|
|
2844
|
-
* the original OOXML.
|
|
2845
|
-
*
|
|
2846
|
-
* @example
|
|
2847
|
-
* ```ts
|
|
2848
|
-
* const base: PptxElementBase = {
|
|
2849
|
-
* id: "el_001",
|
|
2850
|
-
* x: 100, y: 50,
|
|
2851
|
-
* width: 400, height: 200,
|
|
2852
|
-
* rotation: 15,
|
|
2853
|
-
* opacity: 0.9,
|
|
2854
|
-
* };
|
|
2855
|
-
* // => satisfies PptxElementBase
|
|
2856
|
-
* ```
|
|
2857
|
-
*/
|
|
2858
|
-
interface PptxElementBase {
|
|
2859
|
-
id: string;
|
|
2860
|
-
/**
|
|
2861
|
-
* The shape's native OOXML id from `p:cNvPr/@id` (an unsigned integer, as a
|
|
2862
|
-
* string), captured on load. Distinct from {@link id}, which is a synthetic
|
|
2863
|
-
* positional identity (`${slidePath}-shape-${index}`) the loader assigns for
|
|
2864
|
-
* selection / undo / template tracking. Animations target shapes by this
|
|
2865
|
-
* native id (`p:spTgt/@spid`), so it is the stable key used to reconcile an
|
|
2866
|
-
* animation to the element it animates across a save/reload round trip.
|
|
2867
|
-
* Absent on SDK-created elements until one is minted at save time.
|
|
2868
|
-
*/
|
|
2869
|
-
shapeId?: string;
|
|
2870
|
-
/** Element name from `cNvPr/@name`. Used for morph transition matching via the `!!` naming convention. */
|
|
2871
|
-
name?: string;
|
|
2872
|
-
/**
|
|
2873
|
-
* `p:nvSpPr/p:nvPr/p:ph/@type` (lower-cased) when the shape is a placeholder:
|
|
2874
|
-
* `title`, `ctrtitle`, `body`, `subtitle`, `ftr`, `dt`, `sldnum`, ...
|
|
2875
|
-
*
|
|
2876
|
-
* Captured on load so consumers can tell a footer placeholder from a text box
|
|
2877
|
-
* without re-walking `rawXml`. Absent on non-placeholder shapes and on
|
|
2878
|
-
* SDK-created elements.
|
|
2879
|
-
*/
|
|
2880
|
-
placeholderType?: string;
|
|
2881
|
-
/**
|
|
2882
|
-
* `p:nvSpPr/p:nvPr/p:ph/@sz` (lower-cased): `"full"`, `"half"`, or
|
|
2883
|
-
* `"quarter"`. Captured on load for round-trip completeness. Per
|
|
2884
|
-
* ECMA-376 §19.3.1.36 (CT_Placeholder) this size hint is only meaningful
|
|
2885
|
-
* when NO `a:xfrm` exists anywhere in the placeholder's inheritance
|
|
2886
|
-
* chain (slide -> layout -> master); every real-world corpus placeholder
|
|
2887
|
-
* that carries `@sz` already has an explicit `a:xfrm` at the master
|
|
2888
|
-
* level, so no renderer currently derives a size from this field.
|
|
2889
|
-
*/
|
|
2890
|
-
placeholderSz?: string;
|
|
2891
|
-
/**
|
|
2892
|
-
* `p:nvSpPr/p:nvPr/p:ph/@orient` (only `"vert"` is meaningful per
|
|
2893
|
-
* `ST_Direction`). Captured on load for round-trip completeness. In
|
|
2894
|
-
* practice every placeholder observed with `orient="vert"` also carries
|
|
2895
|
-
* an explicit `a:bodyPr/@vert`, which already drives vertical-text
|
|
2896
|
-
* rendering, so this field is not currently read by any renderer.
|
|
2897
|
-
*/
|
|
2898
|
-
placeholderOrient?: 'vert';
|
|
2899
|
-
x: number;
|
|
2900
|
-
y: number;
|
|
2901
|
-
width: number;
|
|
2902
|
-
height: number;
|
|
2903
|
-
/**
|
|
2904
|
-
* The exact EMU integer `x` was parsed from (the `a:off/@_x` this
|
|
2905
|
-
* element's own `a:xfrm` carried on load), when the parser could resolve
|
|
2906
|
-
* one. `x` itself is always `Math.round(xEmu / EMU_PER_PX)` at parse
|
|
2907
|
-
* time, but that rounding is lossy: re-deriving EMU from `x` on save
|
|
2908
|
-
* (`Math.round(x * EMU_PER_PX)`) can drift from the original value by up
|
|
2909
|
-
* to half a pixel's worth of EMU on every load/save cycle even when
|
|
2910
|
-
* nothing touched this element. Kept alongside `x` (not instead of it) so
|
|
2911
|
-
* every consumer that only cares about on-screen position is unaffected;
|
|
2912
|
-
* only the save-side xfrm writer (`resolveXfrmEmu` in
|
|
2913
|
-
* `xfrm-emu-resolution.ts`) reads this, and only when `x` still equals
|
|
2914
|
-
* `Math.round(xEmu / EMU_PER_PX)` (i.e. nothing moved this element since
|
|
2915
|
-
* load) does it re-emit `xEmu` verbatim instead of re-quantizing `x`.
|
|
2916
|
-
* `undefined` for an SDK-created element or one whose transform could not
|
|
2917
|
-
* be resolved to a usable `a:off` on load.
|
|
2918
|
-
*/
|
|
2919
|
-
xEmu?: number;
|
|
2920
|
-
/** The exact EMU integer `y` was parsed from (`a:off/@_y`). See {@link xEmu}. */
|
|
2921
|
-
yEmu?: number;
|
|
2922
|
-
/** The exact EMU integer `width` was parsed from (`a:ext/@_cx`). See {@link xEmu}. */
|
|
2923
|
-
widthEmu?: number;
|
|
2924
|
-
/** The exact EMU integer `height` was parsed from (`a:ext/@_cy`). See {@link xEmu}. */
|
|
2925
|
-
heightEmu?: number;
|
|
2926
|
-
/** Resolved load-time transform for a shape with no own a:xfrm. Used only to detect edits. */
|
|
2927
|
-
inheritedTransform?: Pick<PptxElementBase, 'x' | 'y' | 'width' | 'height' | 'rotation' | 'skewX' | 'skewY' | 'flipHorizontal' | 'flipVertical'>;
|
|
2928
|
-
rotation?: number;
|
|
2929
|
-
/** Skew along the X axis in degrees (parsed from `@_skewX` in 1/60000ths of a degree). */
|
|
2930
|
-
skewX?: number;
|
|
2931
|
-
/** Skew along the Y axis in degrees (parsed from `@_skewY` in 1/60000ths of a degree). */
|
|
2932
|
-
skewY?: number;
|
|
2933
|
-
flipHorizontal?: boolean;
|
|
2934
|
-
flipVertical?: boolean;
|
|
2935
|
-
/** Whether this element is hidden (used by the Elements Panel visibility toggle). */
|
|
2936
|
-
hidden?: boolean;
|
|
2937
|
-
/** Element-level opacity (0-1). */
|
|
2938
|
-
opacity?: number;
|
|
2939
|
-
rawXml?: XmlObject;
|
|
2940
|
-
/** Shape-level click action (from `a:hlinkClick` on `p:cNvPr`). */
|
|
2941
|
-
actionClick?: PptxAction;
|
|
2942
|
-
/** Shape-level hover action (from `a:hlinkHover` on `p:cNvPr`). */
|
|
2943
|
-
actionHover?: PptxAction;
|
|
2944
|
-
/** Shape lock attributes parsed from `p:cNvSpPr/a:spLocks`. */
|
|
2945
|
-
locks?: PptxShapeLocks;
|
|
2946
|
-
/**
|
|
2947
|
-
* Opaque `<a:ext>` children captured from the shape's `<a:extLst>` whose
|
|
2948
|
-
* URI is not recognised by a typed extractor (hidden fill/line, image
|
|
2949
|
-
* effects, …). Preserved verbatim and re-emitted on save so unknown
|
|
2950
|
-
* vendor extensions survive a round-trip.
|
|
2951
|
-
*
|
|
2952
|
-
* Mirrors the existing `effectDagXml` / `endParaRunProperties` raw-XML
|
|
2953
|
-
* preservation pattern.
|
|
2954
|
-
*/
|
|
2955
|
-
extLstXml?: XmlObject[];
|
|
2956
|
-
}
|
|
2957
|
-
/**
|
|
2958
|
-
* Text content mixin — present on text boxes and shapes.
|
|
2959
|
-
*
|
|
2960
|
-
* Shapes can contain text overlaid on the shape geometry, so both
|
|
2961
|
-
* `TextPptxElement` and `ShapePptxElement` extend this interface.
|
|
2962
|
-
*
|
|
2963
|
-
* @example
|
|
2964
|
-
* ```ts
|
|
2965
|
-
* const props: PptxTextProperties = {
|
|
2966
|
-
* text: "Hello World",
|
|
2967
|
-
* textStyle: { fontSize: 24, bold: true, color: "#333333" },
|
|
2968
|
-
* };
|
|
2969
|
-
* // => satisfies PptxTextProperties
|
|
2970
|
-
* ```
|
|
2971
|
-
*/
|
|
2972
|
-
interface PptxTextProperties {
|
|
2973
|
-
text?: string;
|
|
2974
|
-
textStyle?: TextStyle;
|
|
2975
|
-
/** Rich text segments with individual styling. */
|
|
2976
|
-
textSegments?: TextSegment[];
|
|
2977
|
-
/** Per-paragraph indentation (marginLeft, indent) for multi-level bullet support. */
|
|
2978
|
-
paragraphIndents?: Array<{
|
|
2979
|
-
marginLeft?: number;
|
|
2980
|
-
indent?: number;
|
|
2981
|
-
}>;
|
|
2982
|
-
/** Placeholder prompt text inherited from layout/master (e.g. "Click to add title"). Shown as a greyed-out hint when the shape has no user-entered text. */
|
|
2983
|
-
promptText?: string;
|
|
2984
|
-
/**
|
|
2985
|
-
* The string {@link text} was INHERITED from, when this is a header / footer /
|
|
2986
|
-
* date / slide-number placeholder whose own body the file leaves empty.
|
|
2987
|
-
*
|
|
2988
|
-
* PowerPoint keeps the footer string on the slide master and writes each
|
|
2989
|
-
* slide's copy of the `ftr` placeholder empty, so the empty body means
|
|
2990
|
-
* "render the master's footer here". Rendering needs the resolved string, but
|
|
2991
|
-
* SAVING it into the slide would pin that slide to today's master text and
|
|
2992
|
-
* silently detach it from the Header & Footer dialog. The save writer
|
|
2993
|
-
* therefore leaves the authored empty body alone while `text` still equals
|
|
2994
|
-
* this value, and writes a genuine per-slide override once it does not.
|
|
2995
|
-
*/
|
|
2996
|
-
inheritedPlaceholderText?: string;
|
|
2997
|
-
/** Linked text box chain ID from `a:bodyPr > a:linkedTxbx/@id` or `a:txbx > a:linkedTxbx/@id`. Text overflows from one linked frame to the next. */
|
|
2998
|
-
linkedTxbxId?: number;
|
|
2999
|
-
/** Sequence number within a linked text box chain (0-based). */
|
|
3000
|
-
linkedTxbxSeq?: number;
|
|
3001
|
-
}
|
|
3002
|
-
/**
|
|
3003
|
-
* Shape styling & geometry mixin — present on shapes, connectors, and images.
|
|
3004
|
-
*
|
|
3005
|
-
* @example
|
|
3006
|
-
* ```ts
|
|
3007
|
-
* const props: PptxShapeProperties = {
|
|
3008
|
-
* shapeType: "roundRect",
|
|
3009
|
-
* shapeStyle: { fillColor: "#0055AA", strokeWidth: 2 },
|
|
3010
|
-
* shapeAdjustments: { adj: 16667 },
|
|
3011
|
-
* };
|
|
3012
|
-
* // => satisfies PptxShapeProperties
|
|
3013
|
-
* ```
|
|
3014
|
-
*/
|
|
3015
|
-
interface PptxShapeProperties {
|
|
3016
|
-
shapeStyle?: ShapeStyle;
|
|
3017
|
-
/** Preset geometry name, e.g. "rect", "ellipse", "roundRect". */
|
|
3018
|
-
shapeType?: string;
|
|
3019
|
-
/** Geometry adjustment values, e.g. `{ adj: 16667 }`. */
|
|
3020
|
-
shapeAdjustments?: Record<string, number>;
|
|
3021
|
-
/** Adjustment handles for interactive shape modification (yellow diamond handles). */
|
|
3022
|
-
adjustmentHandles?: GeometryAdjustmentHandle[];
|
|
3023
|
-
}
|
|
3024
|
-
/**
|
|
3025
|
-
* Text styling for a single indent level (0–8) inside a placeholder’s
|
|
3026
|
-
* `a:lstStyle`.
|
|
3027
|
-
*
|
|
3028
|
-
* Used during placeholder inheritance to fill in defaults for font,
|
|
3029
|
-
* bullet, and spacing properties the slide element does not override.
|
|
3030
|
-
*
|
|
3031
|
-
* @example
|
|
3032
|
-
* ```ts
|
|
3033
|
-
* const level0: PlaceholderTextLevelStyle = {
|
|
3034
|
-
* fontSize: 32,
|
|
3035
|
-
* bold: true,
|
|
3036
|
-
* bulletChar: "•",
|
|
3037
|
-
* };
|
|
3038
|
-
* // => satisfies PlaceholderTextLevelStyle
|
|
3039
|
-
* ```
|
|
3040
|
-
*/
|
|
3041
|
-
interface PlaceholderTextLevelStyle {
|
|
3042
|
-
fontFamily?: string;
|
|
3043
|
-
/**
|
|
3044
|
-
* The RAW `a:defRPr/a:latin/@typeface` string (verbatim: a theme alias
|
|
3045
|
-
* such as `+mj-lt`/`+mn-lt`, or a literal face name) {@link fontFamily}
|
|
3046
|
-
* was resolved from. Master/layout text styles are parsed once and
|
|
3047
|
-
* cached, so `fontFamily` is a resolved-for-display snapshot; re-emitting
|
|
3048
|
-
* it as the literal name on every save (the master-level analogue of
|
|
3049
|
-
* `colorChoiceXml` below) flattens the theme alias the moment ANYTHING
|
|
3050
|
-
* about the deck is rewritten, even when this level was never touched.
|
|
3051
|
-
* Absent when the level declares no `a:latin`.
|
|
3052
|
-
*/
|
|
3053
|
-
fontTypefaceXml?: string;
|
|
3054
|
-
/**
|
|
3055
|
-
* Snapshot of {@link fontFamily} exactly as parsed, before any edit. The
|
|
3056
|
-
* save path diffs the live value against this: unchanged means re-emit
|
|
3057
|
-
* {@link fontTypefaceXml} verbatim (preserve the alias); different means
|
|
3058
|
-
* a genuine edit, so the new literal name is written instead.
|
|
3059
|
-
*/
|
|
3060
|
-
resolvedFontFamily?: string;
|
|
3061
|
-
fontSize?: number;
|
|
3062
|
-
bold?: boolean;
|
|
3063
|
-
italic?: boolean;
|
|
3064
|
-
color?: string;
|
|
3065
|
-
/**
|
|
3066
|
-
* The `a:defRPr/a:solidFill` node this level's {@link color} came from.
|
|
3067
|
-
*
|
|
3068
|
-
* Master and layout text styles are parsed and cached before any slide is,
|
|
3069
|
-
* so a scheme alias such as `tx1` was resolved through the map that was
|
|
3070
|
-
* active then. A slide carrying `p:clrMapOvr` routes the same alias
|
|
3071
|
-
* somewhere else, so the alias has to be resolved again against the slide
|
|
3072
|
-
* that is inheriting it; {@link color} is only the reading taken at parse
|
|
3073
|
-
* time. Absent when the level declares no colour, or declares a literal one.
|
|
3074
|
-
*/
|
|
3075
|
-
colorChoiceXml?: XmlObject;
|
|
3076
|
-
bulletChar?: string;
|
|
3077
|
-
bulletAutoNumType?: string;
|
|
3078
|
-
bulletFontFamily?: string;
|
|
3079
|
-
bulletSizePercent?: number;
|
|
3080
|
-
/** Bullet colour from `a:buClr` as hex string. */
|
|
3081
|
-
bulletColor?: string;
|
|
3082
|
-
/**
|
|
3083
|
-
* The colour-choice node inside `a:buClr` this level's {@link bulletColor}
|
|
3084
|
-
* resolved from (`a:schemeClr` / `a:sysClr` / `a:prstClr` / `a:srgbClr`,
|
|
3085
|
-
* transforms included), mirroring `BulletInfo.colorXml`. Re-emitted
|
|
3086
|
-
* verbatim on save so a themed bullet is not downgraded to a literal
|
|
3087
|
-
* `a:srgbClr`. Absent when the level declares no bullet colour.
|
|
3088
|
-
*/
|
|
3089
|
-
bulletColorXml?: XmlObject;
|
|
3090
|
-
/** Bullet size in points from `a:buSzPts`. */
|
|
3091
|
-
bulletSizePts?: number;
|
|
3092
|
-
/** True when `a:buNone` is present at this level. */
|
|
3093
|
-
bulletNone?: boolean;
|
|
3094
|
-
marginLeft?: number;
|
|
3095
|
-
/** Paragraph right margin in px (from `@_marR` EMU). */
|
|
3096
|
-
marginRight?: number;
|
|
3097
|
-
indent?: number;
|
|
3098
|
-
/**
|
|
3099
|
-
* Paragraph alignment as a `TextStyle['align']` token (`left`, `center`,
|
|
3100
|
-
* `right`, `justify`, `justLow`, `dist`, `thaiDist`), never the raw OOXML
|
|
3101
|
-
* `@algn` value.
|
|
3102
|
-
*/
|
|
3103
|
-
alignment?: string;
|
|
3104
|
-
/** Right-to-left paragraph direction (`@rtl`). */
|
|
3105
|
-
rtl?: boolean;
|
|
3106
|
-
/** Tab stops from `a:tabLst/a:tab` (positions in px). */
|
|
3107
|
-
tabStops?: TextStyle['tabStops'];
|
|
3108
|
-
lineSpacing?: number;
|
|
3109
|
-
lineSpacingExactPt?: number;
|
|
3110
|
-
/**
|
|
3111
|
-
* Space before the paragraph in px, resolved from EITHER `a:spcPts`
|
|
3112
|
-
* (absolute) or `a:spcPct` (a percentage of this level's own `a:defRPr`
|
|
3113
|
-
* font size) - the OOXML source is not distinguishable from this field
|
|
3114
|
-
* alone. See {@link spaceBeforePercent} / {@link resolvedSpaceBefore}.
|
|
3115
|
-
*/
|
|
3116
|
-
spaceBefore?: number;
|
|
3117
|
-
spaceAfter?: number;
|
|
3118
|
-
/**
|
|
3119
|
-
* Snapshot of {@link spaceBefore} / {@link spaceAfter} exactly as parsed.
|
|
3120
|
-
* Diffed the same way as {@link resolvedFontFamily}: unchanged means the
|
|
3121
|
-
* writer re-emits the ORIGINAL form (`a:spcPct` when
|
|
3122
|
-
* {@link spaceBeforePercent} / {@link spaceAfterPercent} is set); a value
|
|
3123
|
-
* that has since moved away from the snapshot is a genuine edit and is
|
|
3124
|
-
* always written as `a:spcPts`, since an editor works in absolute units.
|
|
3125
|
-
*/
|
|
3126
|
-
resolvedSpaceBefore?: number;
|
|
3127
|
-
resolvedSpaceAfter?: number;
|
|
3128
|
-
/**
|
|
3129
|
-
* The raw `a:spcPct` fraction (e.g. `0.2` for 20%) {@link spaceBefore} /
|
|
3130
|
-
* {@link spaceAfter} was resolved from, when the source used percentage
|
|
3131
|
-
* spacing rather than `a:spcPts`. Absent when the source used `a:spcPts`
|
|
3132
|
-
* (or authored no spacing at all).
|
|
3133
|
-
*/
|
|
3134
|
-
spaceBeforePercent?: number;
|
|
3135
|
-
spaceAfterPercent?: number;
|
|
3136
|
-
/** Default tab interval in CSS pixels (`a:lvlXpPr/@defTabSz`). */
|
|
3137
|
-
defaultTabSize?: number;
|
|
3138
|
-
/** Whether East Asian line-breaking rules are enabled. */
|
|
3139
|
-
eaLineBreak?: boolean;
|
|
3140
|
-
/** Whether Latin line-breaking rules are enabled. */
|
|
3141
|
-
latinLineBreak?: boolean;
|
|
3142
|
-
/** Font vertical alignment within the text line. */
|
|
3143
|
-
fontAlignment?: string;
|
|
3144
|
-
/** Whether end punctuation may hang outside the text frame. */
|
|
3145
|
-
hangingPunctuation?: boolean;
|
|
3146
|
-
}
|
|
3147
|
-
/**
|
|
3148
|
-
* Pre-parsed placeholder defaults extracted from a layout or master shape
|
|
3149
|
-
* that carries a `<p:ph>` element.
|
|
3150
|
-
*
|
|
3151
|
-
* Used to fill in inherited text styles, bullet definitions, font sizes,
|
|
3152
|
-
* and body properties that the slide shape does not explicitly override.
|
|
3153
|
-
*
|
|
3154
|
-
* @example
|
|
3155
|
-
* ```ts
|
|
3156
|
-
* const defaults: PlaceholderDefaults = {
|
|
3157
|
-
* type: "title",
|
|
3158
|
-
* levelStyles: {
|
|
3159
|
-
* 0: { fontSize: 36, bold: true, alignment: "left" },
|
|
3160
|
-
* },
|
|
3161
|
-
* };
|
|
3162
|
-
* // => satisfies PlaceholderDefaults
|
|
3163
|
-
* ```
|
|
3164
|
-
*/
|
|
3165
|
-
interface PlaceholderDefaults {
|
|
3166
|
-
/** Placeholder type: 'title', 'body', 'ctrTitle', 'subTitle', 'dt', 'ftr', 'sldNum', etc. */
|
|
3167
|
-
type: string;
|
|
3168
|
-
/** Placeholder index (when present). */
|
|
3169
|
-
idx?: number;
|
|
3170
|
-
bodyInsetLeft?: number;
|
|
3171
|
-
bodyInsetTop?: number;
|
|
3172
|
-
bodyInsetRight?: number;
|
|
3173
|
-
bodyInsetBottom?: number;
|
|
3174
|
-
textAnchor?: string;
|
|
3175
|
-
autoFit?: boolean;
|
|
3176
|
-
/** Explicit autofit mode from OOXML body properties. See {@link TextStyle.autoFitMode}. */
|
|
3177
|
-
autoFitMode?: 'shrink' | 'normal' | 'none';
|
|
3178
|
-
/** Font scale percentage for normAutofit (e.g. 0.9 = 90%). Only meaningful when autoFit is true. */
|
|
3179
|
-
autoFitFontScale?: number;
|
|
3180
|
-
/** Line spacing reduction for normAutofit (e.g. 0.2 = reduce by 20%). Only meaningful when autoFit is true. */
|
|
3181
|
-
autoFitLineSpacingReduction?: number;
|
|
3182
|
-
textWrap?: string;
|
|
3183
|
-
/** Level-specific text styles keyed 0-8. */
|
|
3184
|
-
levelStyles?: Record<number, PlaceholderTextLevelStyle>;
|
|
3185
|
-
/** Prompt text extracted from the layout/master placeholder (e.g. "Click to add title"). */
|
|
3186
|
-
promptText?: string;
|
|
3187
|
-
}
|
|
3188
|
-
/**
|
|
3189
|
-
* Authored scene data of a PowerPoint 3D model (`am3d:model3d`, namespace
|
|
3190
|
-
* `http://schemas.microsoft.com/office/drawing/2017/model3d`).
|
|
3191
|
-
*
|
|
3192
|
-
* This is a read-only parsed view: the untouched XML stays on the element's
|
|
3193
|
-
* `rawXml`, so the camera, transform and lights round-trip on save.
|
|
3194
|
-
*/
|
|
3195
|
-
/** A 3D point or vector. Points are in EMU; direction vectors are unit-less. */
|
|
3196
|
-
interface Model3DVec3 {
|
|
3197
|
-
x: number;
|
|
3198
|
-
y: number;
|
|
3199
|
-
z: number;
|
|
3200
|
-
}
|
|
3201
|
-
/** `am3d:camera`. Positions are EMU, `fovDeg` is in degrees. */
|
|
3202
|
-
interface Model3DCamera {
|
|
3203
|
-
position?: Model3DVec3;
|
|
3204
|
-
/** Up vector (`am3d:up`), unit-less. */
|
|
3205
|
-
up?: Model3DVec3;
|
|
3206
|
-
/** Look-at target point (`am3d:lookAt`), EMU. */
|
|
3207
|
-
lookAt?: Model3DVec3;
|
|
3208
|
-
projection: 'perspective' | 'orthographic';
|
|
3209
|
-
/** Vertical field of view in degrees (perspective only). */
|
|
3210
|
-
fovDeg?: number;
|
|
3211
|
-
/** Orthographic view scale (orthographic only), when authored. */
|
|
3212
|
-
orthoScale?: number;
|
|
3213
|
-
}
|
|
3214
|
-
/** `am3d:trans`: how the model sits in the scene. Offsets are EMU. */
|
|
3215
|
-
interface Model3DTransformData {
|
|
3216
|
-
/** `meterPerModelUnit` as a plain ratio. */
|
|
3217
|
-
meterPerModelUnit?: number;
|
|
3218
|
-
preTranslate?: Model3DVec3;
|
|
3219
|
-
scale?: Model3DVec3;
|
|
3220
|
-
/** Euler rotation in degrees about each axis (`am3d:rot`). */
|
|
3221
|
-
rotationDeg?: Model3DVec3;
|
|
3222
|
-
postTranslate?: Model3DVec3;
|
|
3223
|
-
}
|
|
3224
|
-
/** One authored light (`am3d:ambientLight`, `ptLight`, `spotLight`, `dirLight`). */
|
|
3225
|
-
interface Model3DLightData {
|
|
3226
|
-
kind: 'ambient' | 'point' | 'spot' | 'directional';
|
|
3227
|
-
/** `#rrggbb`, when the light has an authored colour. */
|
|
3228
|
-
color?: string;
|
|
3229
|
-
/** `am3d:illuminance` as a plain ratio. */
|
|
3230
|
-
illuminance?: number;
|
|
3231
|
-
position?: Model3DVec3;
|
|
3232
|
-
direction?: Model3DVec3;
|
|
3233
|
-
/** Spot cone angle in degrees, when authored. */
|
|
3234
|
-
spotAngleDeg?: number;
|
|
3235
|
-
}
|
|
3236
|
-
/** Everything parsed from an `am3d:model3d` scene. */
|
|
3237
|
-
interface Model3DSceneData {
|
|
3238
|
-
camera?: Model3DCamera;
|
|
3239
|
-
transform?: Model3DTransformData;
|
|
3240
|
-
lights: Model3DLightData[];
|
|
3241
|
-
/** `am3d:objViewport/@viewportSz` in EMU. */
|
|
3242
|
-
viewportSizeEmu?: number;
|
|
3243
|
-
}
|
|
3244
|
-
/**
|
|
3245
|
-
* Accessibility metadata from `p:cNvPr/a:extLst`'s "Mark as decorative"
|
|
3246
|
-
* vendor extension (issue G16). PowerPoint's Alt Text pane writes
|
|
3247
|
-
* `a:ext[@uri='{C183D7F6-B498-43B3-948B-1728B52AA6E4}']/adec:decorative
|
|
3248
|
-
* val="1"` when a shape or image is marked decorative; mixed into the
|
|
3249
|
-
* element variants whose `p:cNvPr` that pane covers.
|
|
3250
|
-
*/
|
|
3251
|
-
interface PptxAccessibilityProperties {
|
|
3252
|
-
/**
|
|
3253
|
-
* Whether the element is marked decorative. When true, alt text /
|
|
3254
|
-
* aria-label / Markdown export should skip describing the element even
|
|
3255
|
-
* when {@link PptxImageProperties.altText} (or similar) is present.
|
|
3256
|
-
*/
|
|
3257
|
-
isDecorative?: boolean;
|
|
3258
|
-
}
|
|
3259
|
-
/**
|
|
3260
|
-
* Accessibility description/title from `p:cNvPr/@descr` / `@title` on a
|
|
3261
|
-
* plain shape, text box or connector (`p:sp` / `p:cxnSp`). The same pair of
|
|
3262
|
-
* attributes already round-trips for a graphic frame (see
|
|
3263
|
-
* {@link TablePptxElement.altText}) and, `descr` only, for a picture
|
|
3264
|
-
* ({@link PptxImageProperties.altText}); this mixin extends it to the three
|
|
3265
|
-
* element kinds whose PowerPoint Alt Text pane data was previously dropped
|
|
3266
|
-
* on load because neither field existed on the model.
|
|
3267
|
-
*/
|
|
3268
|
-
interface PptxNonVisualDescription {
|
|
3269
|
-
/** `p:cNvPr/@descr`. */
|
|
3270
|
-
altText?: string;
|
|
3271
|
-
/** `p:cNvPr/@title`. */
|
|
3272
|
-
title?: string;
|
|
3273
|
-
}
|
|
3274
|
-
/**
|
|
3275
|
-
* `a:cNvPicPr/@preferRelativeResize` (issue G13), a picture-only non-visual
|
|
3276
|
-
* property distinct from `a:picLocks`.
|
|
3277
|
-
*/
|
|
3278
|
-
interface PptxPictureNonVisualProperties {
|
|
3279
|
-
/**
|
|
3280
|
-
* `a:cNvPicPr/@preferRelativeResize` (ST_Boolean, defaults to `true` when
|
|
3281
|
-
* absent). Controls whether a picture's crop rectangle is reinterpreted
|
|
3282
|
-
* relative to the picture's ORIGINAL dimensions or its CURRENT
|
|
3283
|
-
* (already-resized) dimensions when it is resized again after being
|
|
3284
|
-
* cropped. Parsed and round-tripped for now; not yet wired into
|
|
3285
|
-
* resize-after-crop arithmetic (this app always uses current-size
|
|
3286
|
-
* semantics, which only diverges from `preferRelativeResize="0"` on a
|
|
3287
|
-
* second resize after a crop).
|
|
3288
|
-
*/
|
|
3289
|
-
preferRelativeResize?: boolean;
|
|
3290
|
-
}
|
|
3291
|
-
/**
|
|
3292
|
-
* A text box — a plain rectangle containing text, typically with no
|
|
3293
|
-
* visible fill or stroke.
|
|
3294
|
-
*
|
|
3295
|
-
* @example
|
|
3296
|
-
* ```ts
|
|
3297
|
-
* const title: TextPptxElement = {
|
|
3298
|
-
* type: "text",
|
|
3299
|
-
* id: "txt_1", x: 50, y: 30, width: 800, height: 60,
|
|
3300
|
-
* text: "Welcome",
|
|
3301
|
-
* textStyle: { fontSize: 36, bold: true },
|
|
3302
|
-
* };
|
|
3303
|
-
* // => satisfies TextPptxElement
|
|
3304
|
-
* ```
|
|
3305
|
-
*/
|
|
3306
|
-
interface TextPptxElement extends PptxElementBase, PptxTextProperties, PptxShapeProperties, PptxNonVisualDescription {
|
|
3307
|
-
type: 'text';
|
|
3308
|
-
}
|
|
3309
|
-
/**
|
|
3310
|
-
* A shape — may contain text and custom geometry (preset or freeform).
|
|
3311
|
-
*
|
|
3312
|
-
* @example
|
|
3313
|
-
* ```ts
|
|
3314
|
-
* const rect: ShapePptxElement = {
|
|
3315
|
-
* type: "shape",
|
|
3316
|
-
* id: "shp_1", x: 100, y: 200, width: 300, height: 150,
|
|
3317
|
-
* shapeType: "roundRect",
|
|
3318
|
-
* shapeStyle: { fillColor: "#00AA55" },
|
|
3319
|
-
* text: "OK",
|
|
3320
|
-
* };
|
|
3321
|
-
* // => satisfies ShapePptxElement
|
|
3322
|
-
* ```
|
|
3323
|
-
*/
|
|
3324
|
-
interface ShapePptxElement extends PptxElementBase, PptxTextProperties, PptxShapeProperties, PptxCustomPathProperties, PptxAccessibilityProperties, PptxNonVisualDescription {
|
|
3325
|
-
type: 'shape';
|
|
3326
|
-
}
|
|
3327
|
-
/**
|
|
3328
|
-
* A connector (straight, bent, or curved line between shapes).
|
|
3329
|
-
*
|
|
3330
|
-
* Connector endpoints can snap to specific shapes via
|
|
3331
|
-
* `shapeStyle.connectorStartConnection` / `connectorEndConnection`.
|
|
3332
|
-
*
|
|
3333
|
-
* @example
|
|
3334
|
-
* ```ts
|
|
3335
|
-
* const line: ConnectorPptxElement = {
|
|
3336
|
-
* type: "connector",
|
|
3337
|
-
* id: "cxn_1", x: 100, y: 100, width: 200, height: 0,
|
|
3338
|
-
* shapeStyle: {
|
|
3339
|
-
* strokeColor: "#333",
|
|
3340
|
-
* connectorEndArrow: "triangle",
|
|
3341
|
-
* },
|
|
3342
|
-
* };
|
|
3343
|
-
* // => satisfies ConnectorPptxElement
|
|
3344
|
-
* ```
|
|
3345
|
-
*/
|
|
3346
|
-
interface ConnectorPptxElement extends PptxElementBase, PptxTextProperties, PptxShapeProperties, PptxNonVisualDescription {
|
|
3347
|
-
type: 'connector';
|
|
3348
|
-
}
|
|
3349
|
-
/**
|
|
3350
|
-
* An image element from an OOXML `<p:pic>` node with `type: "image"`.
|
|
3351
|
-
*
|
|
3352
|
-
* @example
|
|
3353
|
-
* ```ts
|
|
3354
|
-
* const img: ImagePptxElement = {
|
|
3355
|
-
* type: "image",
|
|
3356
|
-
* id: "img_1", x: 0, y: 0, width: 960, height: 540,
|
|
3357
|
-
* imagePath: "ppt/media/image1.png",
|
|
3358
|
-
* altText: "Background scenery",
|
|
3359
|
-
* };
|
|
3360
|
-
* // => satisfies ImagePptxElement
|
|
3361
|
-
* ```
|
|
3362
|
-
*/
|
|
3363
|
-
interface ImagePptxElement extends PptxElementBase, PptxShapeProperties, PptxCustomPathProperties, PptxImageProperties, PptxAccessibilityProperties, PptxPictureNonVisualProperties {
|
|
3364
|
-
type: 'image';
|
|
3365
|
-
}
|
|
3366
|
-
/**
|
|
3367
|
-
* A picture element from an OOXML `<p:pic>` node with `type: "picture"`.
|
|
3368
|
-
*
|
|
3369
|
-
* Functionally identical to {@link ImagePptxElement} but distinguished by
|
|
3370
|
-
* the `type` discriminant for semantic clarity.
|
|
3371
|
-
*/
|
|
3372
|
-
interface PicturePptxElement extends PptxElementBase, PptxShapeProperties, PptxCustomPathProperties, PptxImageProperties, PptxAccessibilityProperties, PptxPictureNonVisualProperties {
|
|
3373
|
-
type: 'picture';
|
|
3374
|
-
}
|
|
3375
|
-
/**
|
|
3376
|
-
* A single unrecognised `<a:graphicData>/<a:extLst>/<a:ext>` extension on a
|
|
3377
|
-
* graphicFrame, captured verbatim so the round-trip can preserve future or
|
|
3378
|
-
* vendor-specific markup that the parser doesn't yet understand.
|
|
3379
|
-
*
|
|
3380
|
-
* The XML is preserved as a fast-xml-parser object tree (the same shape as
|
|
3381
|
-
* `rawXml` on other elements) so the save layer can re-emit it through the
|
|
3382
|
-
* existing builder without lossy string manipulation.
|
|
3383
|
-
*/
|
|
3384
|
-
interface PptxGraphicFrameExtension {
|
|
3385
|
-
/** The `@_uri` attribute identifying the extension (e.g. `{C3CD43...}`). */
|
|
3386
|
-
uri: string;
|
|
3387
|
-
/** Parsed XML payload of the extension, suitable for re-serialization. */
|
|
3388
|
-
xml: XmlObject;
|
|
3389
|
-
}
|
|
3390
|
-
/**
|
|
3391
|
-
* A table embedded via a `<p:graphicFrame>`.
|
|
3392
|
-
*
|
|
3393
|
-
* @example
|
|
3394
|
-
* ```ts
|
|
3395
|
-
* const tbl: TablePptxElement = {
|
|
3396
|
-
* type: "table",
|
|
3397
|
-
* id: "tbl_1", x: 50, y: 200, width: 860, height: 300,
|
|
3398
|
-
* tableData: {
|
|
3399
|
-
* rows: [
|
|
3400
|
-
* { cells: [{ text: "Name" }, { text: "Score" }] },
|
|
3401
|
-
* { cells: [{ text: "Alice" }, { text: "95" }] },
|
|
3402
|
-
* ],
|
|
3403
|
-
* },
|
|
3404
|
-
* };
|
|
3405
|
-
* // => satisfies TablePptxElement
|
|
3406
|
-
* ```
|
|
3407
|
-
*/
|
|
3408
|
-
interface TablePptxElement extends PptxElementBase {
|
|
3409
|
-
type: 'table';
|
|
3410
|
-
/** Parsed table cell data for editing. */
|
|
3411
|
-
tableData?: PptxTableData;
|
|
3412
|
-
/**
|
|
3413
|
-
* Accessibility description from `p:nvGraphicFramePr/p:cNvPr/@descr`, the
|
|
3414
|
-
* same non-visual-properties attribute a picture's alt text comes from.
|
|
3415
|
-
*/
|
|
3416
|
-
altText?: string;
|
|
3417
|
-
/** Accessibility title from `p:nvGraphicFramePr/p:cNvPr/@title`. */
|
|
3418
|
-
title?: string;
|
|
3419
|
-
/**
|
|
3420
|
-
* Unrecognised extensions captured from `a:graphicData/a:extLst` so they
|
|
3421
|
-
* round-trip losslessly. See {@link PptxGraphicFrameExtension}.
|
|
3422
|
-
*/
|
|
3423
|
-
extensionXml?: PptxGraphicFrameExtension[];
|
|
3424
|
-
}
|
|
3425
|
-
/**
|
|
3426
|
-
* A chart embedded via a `<p:graphicFrame>`.
|
|
3427
|
-
*
|
|
3428
|
-
* Chart data is parsed from the related `chartN.xml` / `chartExN.xml`
|
|
3429
|
-
* parts inside the PPTX archive.
|
|
3430
|
-
*/
|
|
3431
|
-
interface ChartPptxElement extends PptxElementBase {
|
|
3432
|
-
type: 'chart';
|
|
3433
|
-
chartData?: PptxChartData;
|
|
3434
|
-
/** Accessibility description from `p:nvGraphicFramePr/p:cNvPr/@descr`. */
|
|
3435
|
-
altText?: string;
|
|
3436
|
-
/** Accessibility title from `p:nvGraphicFramePr/p:cNvPr/@title`. */
|
|
3437
|
-
title?: string;
|
|
3438
|
-
/** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
|
|
3439
|
-
extensionXml?: PptxGraphicFrameExtension[];
|
|
3440
|
-
}
|
|
3441
|
-
/**
|
|
3442
|
-
* A SmartArt diagram embedded via a `<p:graphicFrame>`.
|
|
3443
|
-
*
|
|
3444
|
-
* SmartArt data is extracted from `dgm:dataModel` parts. The editor
|
|
3445
|
-
* supports real structural editing (adding, removing and reordering nodes,
|
|
3446
|
-
* editing node text, and switching layout presets) with a lossless
|
|
3447
|
-
* `ptLst` round-trip. When the file carries PowerPoint's own pre-computed
|
|
3448
|
-
* drawing part, that exact layout is used; otherwise an algorithmic layout
|
|
3449
|
-
* engine approximates it, so complex custom layouts may not match
|
|
3450
|
-
* PowerPoint pixel-for-pixel.
|
|
3451
|
-
*/
|
|
3452
|
-
interface SmartArtPptxElement extends PptxElementBase {
|
|
3453
|
-
type: 'smartArt';
|
|
3454
|
-
smartArtData?: PptxSmartArtData;
|
|
3455
|
-
/** Accessibility description from `p:nvGraphicFramePr/p:cNvPr/@descr`. */
|
|
3456
|
-
altText?: string;
|
|
3457
|
-
/** Accessibility title from `p:nvGraphicFramePr/p:cNvPr/@title`. */
|
|
3458
|
-
title?: string;
|
|
3459
|
-
/** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
|
|
3460
|
-
extensionXml?: PptxGraphicFrameExtension[];
|
|
3461
|
-
}
|
|
3462
|
-
/**
|
|
3463
|
-
* Recognised OLE object application types derived from `progId` / `clsId`.
|
|
3464
|
-
*
|
|
3465
|
-
* Used to show type-specific icons and previews in the editor.
|
|
3466
|
-
*/
|
|
3467
|
-
type OleObjectType = 'excel' | 'word' | 'powerpoint' | 'pdf' | 'visio' | 'mathtype' | 'package' | 'unknown';
|
|
3468
|
-
/**
|
|
3469
|
-
* An OLE (Object Linking and Embedding) object.
|
|
3470
|
-
*
|
|
3471
|
-
* OLE objects can be embedded Excel sheets, Word documents, PDFs, Visio
|
|
3472
|
-
* diagrams, MathType equations, or generic "packages". They carry a
|
|
3473
|
-
* preview image for display and optional binary data for extraction.
|
|
3474
|
-
*
|
|
3475
|
-
* @example
|
|
3476
|
-
* ```ts
|
|
3477
|
-
* const ole: OlePptxElement = {
|
|
3478
|
-
* type: "ole",
|
|
3479
|
-
* id: "ole_1", x: 100, y: 200, width: 400, height: 300,
|
|
3480
|
-
* oleObjectType: "excel",
|
|
3481
|
-
* oleProgId: "Excel.Sheet.12",
|
|
3482
|
-
* fileName: "budget.xlsx",
|
|
3483
|
-
* };
|
|
3484
|
-
* // => satisfies OlePptxElement
|
|
3485
|
-
* ```
|
|
3486
|
-
*/
|
|
3487
|
-
interface OlePptxElement extends PptxElementBase {
|
|
3488
|
-
type: 'ole';
|
|
3489
|
-
oleTarget?: string;
|
|
3490
|
-
oleProgId?: string;
|
|
3491
|
-
oleName?: string;
|
|
3492
|
-
/** CLSID of the OLE object (from `@_classid`). */
|
|
3493
|
-
oleClsId?: string;
|
|
3494
|
-
/** Detected application type (excel, word, pdf, etc.). */
|
|
3495
|
-
oleObjectType?: OleObjectType;
|
|
3496
|
-
/** File extension for the embedded binary (e.g. "xlsx", "docx"). */
|
|
3497
|
-
oleFileExtension?: string;
|
|
3498
|
-
/** Original file name when available. */
|
|
3499
|
-
fileName?: string;
|
|
3500
|
-
/** Whether this is a linked (vs. embedded) object. */
|
|
3501
|
-
isLinked?: boolean;
|
|
3502
|
-
/** External file path for linked OLE objects (TargetMode="External"). */
|
|
3503
|
-
externalPath?: string;
|
|
3504
|
-
/** Data-URL or path for the OLE preview image. */
|
|
3505
|
-
previewImage?: string;
|
|
3506
|
-
/** Decoded preview image as a data-URL. */
|
|
3507
|
-
previewImageData?: string;
|
|
3508
|
-
/** Whether the OLE object is shown as an icon (`p:oleObj/@showAsIcon`). */
|
|
3509
|
-
oleShowAsIcon?: boolean;
|
|
3510
|
-
/** Authored display width of the OLE object preview, in EMU (`@imgW`). */
|
|
3511
|
-
oleImgW?: number;
|
|
3512
|
-
/** Authored display height of the OLE object preview, in EMU (`@imgH`). */
|
|
3513
|
-
oleImgH?: number;
|
|
3514
|
-
/**
|
|
3515
|
-
* The recovered embedded payload as a data-URL (e.g.
|
|
3516
|
-
* `data:application/vnd...;base64,...`), suitable for download or
|
|
3517
|
-
* open-in-new-tab. For a generic "Package" OLE object this is the unwrapped
|
|
3518
|
-
* inner file; for a plain embedded file (e.g. `.xlsx`) it is that file
|
|
3519
|
-
* directly. Undefined when the embedding is missing or unreadable.
|
|
3520
|
-
*
|
|
3521
|
-
* Stored as a data-URL string to mirror how images store decoded bytes
|
|
3522
|
-
* ({@link ImagePptxElement.imageData}) and to stay serialization-safe.
|
|
3523
|
-
*/
|
|
3524
|
-
oleEmbeddedData?: string;
|
|
3525
|
-
/** Original file name of the embedded payload when recoverable. */
|
|
3526
|
-
oleEmbeddedFileName?: string;
|
|
3527
|
-
/** MIME type of the embedded payload, derived from its extension/ProgID. */
|
|
3528
|
-
oleEmbeddedMimeType?: string;
|
|
3529
|
-
/** Size of the embedded payload in bytes. */
|
|
3530
|
-
oleEmbeddedByteSize?: number;
|
|
3531
|
-
/**
|
|
3532
|
-
* `p:link/@followColorScheme` (`ST_OleObjectFollowColorScheme`): whether a
|
|
3533
|
-
* LINKED OLE object's icon recolours to match the presentation theme.
|
|
3534
|
-
* Only meaningful when {@link isLinked} is `true`. ECMA-376 §19.3.1.28.
|
|
3535
|
-
*/
|
|
3536
|
-
oleFollowColorScheme?: 'none' | 'full' | 'textAndBackground';
|
|
3537
|
-
/**
|
|
3538
|
-
* `p:link/@updateAutomatic` (`CT_OleObjectLink`, ECMA-376 §19.3.2.4):
|
|
3539
|
-
* whether a LINKED OLE object refreshes automatically from its source
|
|
3540
|
-
* (PowerPoint's Edit Links dialog "Automatic" vs. "Manual" radio buttons).
|
|
3541
|
-
* Only meaningful when {@link isLinked} is `true`. The schema default is
|
|
3542
|
-
* `false`; `undefined` means the source authored no explicit value.
|
|
3543
|
-
*/
|
|
3544
|
-
oleUpdateAutomatic?: boolean;
|
|
3545
|
-
/**
|
|
3546
|
-
* Set by the in-viewer OLE content editors (`ole-edit-api.ts`) whenever
|
|
3547
|
-
* `oleEmbeddedData` and/or `previewImageData` have been changed in memory
|
|
3548
|
-
* and still need to be written back into the saved package. Never
|
|
3549
|
-
* authored from a parsed file; purely an in-memory save signal, mirroring
|
|
3550
|
-
* `PptxSlide.isDirty`. The save writer clears it once the pending write
|
|
3551
|
-
* has been queued.
|
|
3552
|
-
*/
|
|
3553
|
-
oleContentDirty?: boolean;
|
|
3554
|
-
/** Accessibility description from `p:nvGraphicFramePr/p:cNvPr/@descr`. */
|
|
3555
|
-
altText?: string;
|
|
3556
|
-
/** Accessibility title from `p:nvGraphicFramePr/p:cNvPr/@title`. */
|
|
3557
|
-
title?: string;
|
|
3558
|
-
/** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
|
|
3559
|
-
extensionXml?: PptxGraphicFrameExtension[];
|
|
3560
|
-
}
|
|
3561
|
-
/**
|
|
3562
|
-
* An audio or video media element.
|
|
3563
|
-
*
|
|
3564
|
-
* Media elements reference files inside the PPTX archive
|
|
3565
|
-
* (`mediaPath`) and may include trim points, poster frames, and
|
|
3566
|
-
* playback settings for presentation mode.
|
|
3567
|
-
*
|
|
3568
|
-
* @example
|
|
3569
|
-
* ```ts
|
|
3570
|
-
* const video: MediaPptxElement = {
|
|
3571
|
-
* type: "media",
|
|
3572
|
-
* id: "vid_1", x: 50, y: 100, width: 640, height: 360,
|
|
3573
|
-
* mediaType: "video",
|
|
3574
|
-
* mediaPath: "ppt/media/media1.mp4",
|
|
3575
|
-
* autoPlay: true,
|
|
3576
|
-
* volume: 0.8,
|
|
3577
|
-
* };
|
|
3578
|
-
* // => satisfies MediaPptxElement
|
|
3579
|
-
* ```
|
|
3580
|
-
*/
|
|
3581
|
-
interface MediaPptxElement extends PptxElementBase {
|
|
3582
|
-
type: 'media';
|
|
3583
|
-
mediaType?: PptxMediaType;
|
|
3584
|
-
mediaPath?: string;
|
|
3585
|
-
mediaData?: string;
|
|
3586
|
-
mediaMimeType?: string;
|
|
3587
|
-
mediaReferenceKind?: PptxMediaReferenceKind;
|
|
3588
|
-
mediaReferenceName?: string;
|
|
3589
|
-
/** Explicit DrawingML `audioFile/@contentType` value when present. */
|
|
3590
|
-
mediaReferenceContentType?: string;
|
|
3591
|
-
audioCdStart?: PptxAudioCdPosition;
|
|
3592
|
-
audioCdEnd?: PptxAudioCdPosition;
|
|
3593
|
-
rawMediaReferenceXml?: XmlObject;
|
|
3594
|
-
/** Trim start in milliseconds (from p:cMediaNode p:cTn @st). */
|
|
3595
|
-
trimStartMs?: number;
|
|
3596
|
-
/** Trim end in milliseconds (from p:cMediaNode p:cTn @end). */
|
|
3597
|
-
trimEndMs?: number;
|
|
3598
|
-
/** Path to the poster/preview image inside the ZIP. */
|
|
3599
|
-
posterFramePath?: string;
|
|
3600
|
-
/** Base64 data-URL for the poster frame image. */
|
|
3601
|
-
posterFrameData?: string;
|
|
3602
|
-
/** Poster source crop from the left edge as a 0..1 fraction. */
|
|
3603
|
-
cropLeft?: number;
|
|
3604
|
-
/** Poster source crop from the top edge as a 0..1 fraction. */
|
|
3605
|
-
cropTop?: number;
|
|
3606
|
-
/** Poster source crop from the right edge as a 0..1 fraction. */
|
|
3607
|
-
cropRight?: number;
|
|
3608
|
-
/** Poster source crop from the bottom edge as a 0..1 fraction. */
|
|
3609
|
-
cropBottom?: number;
|
|
3610
|
-
/** Poster stretch-target inset from the left frame edge. */
|
|
3611
|
-
fillRectLeft?: number;
|
|
3612
|
-
/** Poster stretch-target inset from the top frame edge. */
|
|
3613
|
-
fillRectTop?: number;
|
|
3614
|
-
/** Poster stretch-target inset from the right frame edge. */
|
|
3615
|
-
fillRectRight?: number;
|
|
3616
|
-
/** Poster stretch-target inset from the bottom frame edge. */
|
|
3617
|
-
fillRectBottom?: number;
|
|
3618
|
-
/** Whether media should play full-screen during presentation. */
|
|
3619
|
-
fullScreen?: boolean;
|
|
3620
|
-
/** Whether media should loop continuously. */
|
|
3621
|
-
loop?: boolean;
|
|
3622
|
-
/** Fade-in duration in seconds. */
|
|
3623
|
-
fadeInDuration?: number;
|
|
3624
|
-
/** Fade-out duration in seconds. */
|
|
3625
|
-
fadeOutDuration?: number;
|
|
3626
|
-
/** Playback volume (0 to 1). */
|
|
3627
|
-
volume?: number;
|
|
3628
|
-
/** Whether media auto-plays on slide entry. */
|
|
3629
|
-
autoPlay?: boolean;
|
|
3630
|
-
/** Whether audio continues playing across slide transitions (presentation mode). */
|
|
3631
|
-
playAcrossSlides?: boolean;
|
|
3632
|
-
/** Hide the element when media is not actively playing. */
|
|
3633
|
-
hideWhenNotPlaying?: boolean;
|
|
3634
|
-
/** Named time bookmarks within the clip. */
|
|
3635
|
-
bookmarks?: MediaBookmark[];
|
|
3636
|
-
/** Playback speed multiplier (1 = normal, 2 = double, 0.5 = half). */
|
|
3637
|
-
playbackSpeed?: number;
|
|
3638
|
-
/** Runtime-extracted metadata (duration, resolution, codec). */
|
|
3639
|
-
metadata?: MediaMetadata;
|
|
3640
|
-
/** Closed caption / subtitle tracks. */
|
|
3641
|
-
captionTracks?: MediaCaptionTrack[];
|
|
3642
|
-
/** Whether the media source is missing/broken (file not found in archive). */
|
|
3643
|
-
mediaMissing?: boolean;
|
|
3644
|
-
/**
|
|
3645
|
-
* Whether the media is linked (external `r:link`) rather than embedded
|
|
3646
|
-
* (`r:embed`). Defaults to embedded when undefined.
|
|
3647
|
-
*/
|
|
3648
|
-
isLinked?: boolean;
|
|
3649
|
-
/**
|
|
3650
|
-
* Accessibility description. Read from `p:nvGraphicFramePr/p:cNvPr/@descr`
|
|
3651
|
-
* for the `p:graphicFrame`-shaped (SDK-created) media form, or from
|
|
3652
|
-
* `p:nvPicPr/p:cNvPr/@descr` for the `p:pic`-shaped media form (real
|
|
3653
|
-
* PowerPoint's usual authoring shape for a video/audio placeholder); see
|
|
3654
|
-
* `PptxHandlerRuntimePictureParsing.ts`.
|
|
3655
|
-
*/
|
|
3656
|
-
altText?: string;
|
|
3657
|
-
/** Accessibility title, from the same `@title` attribute on whichever `p:cNvPr` the media form uses. Same scope note as {@link altText}. */
|
|
3658
|
-
title?: string;
|
|
3659
|
-
/** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
|
|
3660
|
-
extensionXml?: PptxGraphicFrameExtension[];
|
|
3661
|
-
}
|
|
3662
|
-
/**
|
|
3663
|
-
* A group container that holds child elements.
|
|
3664
|
-
*
|
|
3665
|
-
* Children inherit the group’s transform, so moving/resizing the group
|
|
3666
|
-
* affects all children proportionally.
|
|
3667
|
-
*
|
|
3668
|
-
* @example
|
|
3669
|
-
* ```ts
|
|
3670
|
-
* const group: GroupPptxElement = {
|
|
3671
|
-
* type: "group",
|
|
3672
|
-
* id: "grp_1", x: 0, y: 0, width: 960, height: 540,
|
|
3673
|
-
* children: [textEl, shapeEl],
|
|
3674
|
-
* };
|
|
3675
|
-
* // => satisfies GroupPptxElement
|
|
3676
|
-
* ```
|
|
3677
|
-
*/
|
|
3678
|
-
interface GroupPptxElement extends PptxElementBase {
|
|
3679
|
-
type: 'group';
|
|
3680
|
-
/** Child elements contained within this group. */
|
|
3681
|
-
children: PptxElement[];
|
|
3682
|
-
/** Fill style extracted from the group's `p:grpSpPr`, used for `a:grpFill` inheritance. */
|
|
3683
|
-
groupFill?: ShapeStyle;
|
|
3684
|
-
/**
|
|
3685
|
-
* The SAME `p:grpSpPr` extraction as {@link groupFill}, kept whenever the
|
|
3686
|
-
* group carries a `p:grpSpPr` at all, regardless of whether it resolved to
|
|
3687
|
-
* a paintable fill.
|
|
3688
|
-
*
|
|
3689
|
-
* `groupFill` is `undefined` unless the group has a real fill, because
|
|
3690
|
-
* `getGroupChildParentFill`/`groupChildInheritedFill` (the `a:grpFill`
|
|
3691
|
-
* inheritance chain) must keep chaining through an ancestor's fill when
|
|
3692
|
-
* THIS group has none of its own. A group whose `p:grpSpPr` authors only
|
|
3693
|
-
* `a:effectLst` (shadow/glow/soft-edge/reflection, no fill) needs those
|
|
3694
|
-
* effects to still reach the renderer, so they are kept here under a name
|
|
3695
|
-
* that carries no fill-inheritance meaning. Currently only reflection is
|
|
3696
|
-
* read from it (`getComputedEffectStyle`); the rest of `a:effectLst` on a
|
|
3697
|
-
* group remains unsupported.
|
|
3698
|
-
*/
|
|
3699
|
-
groupEffectStyle?: ShapeStyle;
|
|
3700
|
-
/**
|
|
3701
|
-
* Exact EMU the group's own `a:chOff`/`a:chExt` (the coordinate space its
|
|
3702
|
-
* CHILDREN are authored in) were parsed from, alongside {@link
|
|
3703
|
-
* PptxElementBase.xEmu} etc for the group's own placement in its PARENT's
|
|
3704
|
-
* space. `undefined` when the source carried no usable `a:chOff`/`a:chExt`
|
|
3705
|
-
* (an SDK-created group, or one whose `a:xfrm` had no child-space data).
|
|
3706
|
-
*
|
|
3707
|
-
* Used by `group-xfrm-preservation.ts`'s `hasCapturedChildSpace` to decide
|
|
3708
|
-
* whether this group's original `a:chOff`/`a:chExt` can be re-emitted
|
|
3709
|
-
* verbatim (always true once captured, regardless of whether anything in
|
|
3710
|
-
* the subtree has moved or resized - only its DIRECT children's
|
|
3711
|
-
* `a:off`/`a:ext` are recomputed, via `invertChildIntoGroupSpace`, when
|
|
3712
|
-
* something changed), instead of the normalized `chOff 0,0` / `chExt ==
|
|
3713
|
-
* ext` space the writer falls back to when this is `undefined` (or
|
|
3714
|
-
* degenerate). See `group-shape-geometry.ts`'s module doc for why a group
|
|
3715
|
-
* needs two coordinate systems at all.
|
|
3716
|
-
*/
|
|
3717
|
-
chOffXEmu?: number;
|
|
3718
|
-
/** See {@link chOffXEmu}. */
|
|
3719
|
-
chOffYEmu?: number;
|
|
3720
|
-
/** See {@link chOffXEmu}. */
|
|
3721
|
-
chExtWidthEmu?: number;
|
|
3722
|
-
/** See {@link chOffXEmu}. */
|
|
3723
|
-
chExtHeightEmu?: number;
|
|
3724
|
-
}
|
|
3725
|
-
/**
|
|
3726
|
-
* A freehand ink / drawing stroke captured with a stylus or mouse.
|
|
3727
|
-
*
|
|
3728
|
-
* Ink strokes are stored as SVG path data strings. Each path may
|
|
3729
|
-
* have independent colour, width, and opacity.
|
|
3730
|
-
*/
|
|
3731
|
-
interface InkPptxElement extends PptxElementBase {
|
|
3732
|
-
type: 'ink';
|
|
3733
|
-
/** SVG path data for ink strokes. */
|
|
3734
|
-
inkPaths: string[];
|
|
3735
|
-
/** Per-path stroke colours. */
|
|
3736
|
-
inkColors?: string[];
|
|
3737
|
-
/** Per-path stroke widths. */
|
|
3738
|
-
inkWidths?: number[];
|
|
3739
|
-
/** Per-path opacities (0-1). */
|
|
3740
|
-
inkOpacities?: number[];
|
|
3741
|
-
/** Drawing tool used: pen, highlighter, or eraser. */
|
|
3742
|
-
inkTool?: 'pen' | 'highlighter' | 'eraser';
|
|
3743
|
-
/**
|
|
3744
|
-
* Per-path arrays of per-point pressure values (0-1).
|
|
3745
|
-
*
|
|
3746
|
-
* Each entry corresponds to the path at the same index in `inkPaths`.
|
|
3747
|
-
* Each inner array contains one pressure value per sampled point along
|
|
3748
|
-
* the stroke. When present, the renderer uses these values to produce
|
|
3749
|
-
* variable-width strokes that reflect stylus/pen pressure.
|
|
3750
|
-
*/
|
|
3751
|
-
inkPointPressures?: number[][];
|
|
3752
|
-
/**
|
|
3753
|
-
* Per-path arrays of per-point pen-tilt lean direction (degrees, straight
|
|
3754
|
-
* from `PointerEvent.tiltX` on supporting hardware).
|
|
3755
|
-
*
|
|
3756
|
-
* Each entry corresponds to the path at the same index in `inkPaths`, and
|
|
3757
|
-
* is paired positionally with {@link inkPointTiltY}. Present only when at
|
|
3758
|
-
* least one point in the stroke reported a genuinely non-zero tilt: a
|
|
3759
|
-
* device that never reports tilt (a mouse, or a stylus with no tilt
|
|
3760
|
-
* sensor) leaves both arrays absent, the same way `inkPointPressures` is
|
|
3761
|
-
* omitted when pressure never varies. When present, the renderer converts
|
|
3762
|
-
* the raw `(tiltX, tiltY)` vector into a lean angle + magnitude (see
|
|
3763
|
-
* `pptx-viewer-shared`'s `tiltChannelsFromVectors`) and widens the stroke
|
|
3764
|
-
* perpendicular to the lean direction, approximating a chisel-tip
|
|
3765
|
-
* calligraphy nib.
|
|
3766
|
-
*/
|
|
3767
|
-
inkPointTiltX?: number[][];
|
|
3768
|
-
/** Per-path, per-point pen-tilt lean direction (degrees), paired with {@link inkPointTiltX}. */
|
|
3769
|
-
inkPointTiltY?: number[][];
|
|
3770
|
-
/** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
|
|
3771
|
-
extensionXml?: PptxGraphicFrameExtension[];
|
|
3772
|
-
}
|
|
3773
|
-
/**
|
|
3774
|
-
* A single ink stroke within a {@link ContentPartPptxElement}.
|
|
3775
|
-
*/
|
|
3776
|
-
interface ContentPartInkStroke {
|
|
3777
|
-
path: string;
|
|
3778
|
-
color: string;
|
|
3779
|
-
width: number;
|
|
3780
|
-
opacity: number;
|
|
3781
|
-
/**
|
|
3782
|
-
* Per-point pressure values (0-1) for this stroke.
|
|
3783
|
-
*
|
|
3784
|
-
* When present, the renderer uses these values to produce
|
|
3785
|
-
* variable-width strokes that reflect stylus/pen pressure.
|
|
3786
|
-
*/
|
|
3787
|
-
pressures?: number[];
|
|
3788
|
-
/**
|
|
3789
|
-
* Per-point pen-tilt lean direction (radians), decoded from the source
|
|
3790
|
-
* InkML's `OTx`/`OTy` tilt-offset channels or its `AZIMUTH` channel.
|
|
3791
|
-
*
|
|
3792
|
-
* When present (paired with {@link tiltMagnitudes}), the renderer widens
|
|
3793
|
-
* each point perpendicular to the lean direction, approximating a
|
|
3794
|
-
* calligraphic (chisel-tip) nib. Absent when the source declared no tilt
|
|
3795
|
-
* channel, in which case rendering is unaffected.
|
|
3796
|
-
*/
|
|
3797
|
-
tiltAngles?: number[];
|
|
3798
|
-
/**
|
|
3799
|
-
* Per-point pen-tilt strength (0 upright, 1 maximally leaned), paired with
|
|
3800
|
-
* {@link tiltAngles}.
|
|
3801
|
-
*/
|
|
3802
|
-
tiltMagnitudes?: number[];
|
|
3803
|
-
/**
|
|
3804
|
-
* Which InkML channel pair {@link tiltAngles}/{@link tiltMagnitudes} were
|
|
3805
|
-
* decoded from: `'azimuthAltitude'` when the source declared `AZIMUTH`
|
|
3806
|
-
* (optionally paired with `ALTITUDE`); omitted (implying `OTx`/`OTy`, i.e.
|
|
3807
|
-
* `'vector'`) otherwise, including for tilt this library itself captured
|
|
3808
|
-
* from the Draw tool's `PointerEvent.tiltX`/`tiltY`.
|
|
3809
|
-
*
|
|
3810
|
-
* A save that has to rewrite this content part's InkML (see
|
|
3811
|
-
* `inkml-content-part-writer.ts`) uses this to re-declare the SAME channel
|
|
3812
|
-
* pair the file already used, rather than always converting to `OTx`/`OTy`;
|
|
3813
|
-
* the rendered lean is identical either way; only the written channel
|
|
3814
|
-
* NAMES differ.
|
|
3815
|
-
*/
|
|
3816
|
-
tiltEncoding?: 'vector' | 'azimuthAltitude';
|
|
3817
|
-
/**
|
|
3818
|
-
* Per-point timestamps (milliseconds), decoded from the source InkML
|
|
3819
|
-
* trace's `T` channel when it declared one.
|
|
3820
|
-
*
|
|
3821
|
-
* Absent for the overwhelming majority of real decks: PowerPoint's own
|
|
3822
|
-
* SaveAs output declares only `X`/`Y` and has no per-point time channel at
|
|
3823
|
-
* all (see `contentpart-real-ink-roundtrip.test.ts`'s fixture), so this is
|
|
3824
|
-
* populated only for InkML sources that genuinely author one (a captured
|
|
3825
|
-
* digitizer session, OneNote, a Surface Hub export). When present, ink
|
|
3826
|
-
* replay ("watch the ink get drawn") uses each stroke's own first/last
|
|
3827
|
-
* timestamp to time its reveal instead of the fixed per-stroke cascade; see
|
|
3828
|
-
* `pptx-viewer-shared`'s `render/ink-replay-timeline.ts`.
|
|
3829
|
-
*/
|
|
3830
|
-
pointTimestamps?: number[];
|
|
3831
|
-
}
|
|
3832
|
-
/**
|
|
3833
|
-
* A content-part element wrapped in `mc:AlternateContent`.
|
|
3834
|
-
*
|
|
3835
|
-
* Typically contains ink strokes from modern PowerPoint pen/highlighter.
|
|
3836
|
-
*/
|
|
3837
|
-
interface ContentPartPptxElement extends PptxElementBase {
|
|
3838
|
-
type: 'contentPart';
|
|
3839
|
-
/** Ink strokes contained in this content part. */
|
|
3840
|
-
inkStrokes?: ContentPartInkStroke[];
|
|
3841
|
-
/** Package path of the related InkML part. */
|
|
3842
|
-
inkPartPath?: string;
|
|
3843
|
-
/** Parsed InkML root retained for unknown-node preservation on dirty save. */
|
|
3844
|
-
inkPartRawXml?: XmlObject;
|
|
3845
|
-
}
|
|
3846
|
-
/**
|
|
3847
|
-
* A Slide Zoom or Section Zoom element (PowerPoint Zoom Object).
|
|
3848
|
-
*
|
|
3849
|
-
* Zoom elements display a live thumbnail of the target slide and
|
|
3850
|
-
* navigate to it on click during presentation mode.
|
|
3851
|
-
*
|
|
3852
|
-
* @example
|
|
3853
|
-
* ```ts
|
|
3854
|
-
* const zoom: ZoomPptxElement = {
|
|
3855
|
-
* type: "zoom",
|
|
3856
|
-
* id: "zm_1", x: 300, y: 200, width: 200, height: 120,
|
|
3857
|
-
* zoomType: "slide",
|
|
3858
|
-
* targetSlideIndex: 5,
|
|
3859
|
-
* };
|
|
3860
|
-
* // => satisfies ZoomPptxElement
|
|
3861
|
-
* ```
|
|
3862
|
-
*/
|
|
3863
|
-
interface ZoomPptxElement extends PptxElementBase, PptxImageProperties {
|
|
3864
|
-
type: 'zoom';
|
|
3865
|
-
/** Type of zoom: slide-level, section-level, or a multi-section summary. */
|
|
3866
|
-
zoomType: 'slide' | 'section' | 'summary';
|
|
3867
|
-
/** Zero-based index of the target slide. */
|
|
3868
|
-
targetSlideIndex: number;
|
|
3869
|
-
/** Section ID for section zoom. */
|
|
3870
|
-
targetSectionId?: string;
|
|
3871
|
-
/** Ordered section tiles in a Summary Zoom container. */
|
|
3872
|
-
summaryTargets?: SummaryZoomTarget[];
|
|
3873
|
-
/** Layout mode authored on the Summary Zoom container. */
|
|
3874
|
-
summaryLayout?: 'grid' | 'fixed';
|
|
3875
|
-
/**
|
|
3876
|
-
* `zmPr/@returnToParent` (MS-PPTX `CT_ZoomObjectProperties`, shared by all
|
|
3877
|
-
* three Zoom kinds): whether continuing forward from the destination slide
|
|
3878
|
-
* during a live show returns to this Zoom's origin slide instead of
|
|
3879
|
-
* advancing linearly through the deck. The schema declares `<xsd:attribute
|
|
3880
|
-
* name="returnToParent" type="xsd:boolean" use="optional" default="true"/>`,
|
|
3881
|
-
* so an ABSENT attribute means `true`, not `false`. This codebase still
|
|
3882
|
-
* leaves the field `undefined` (rather than fabricating `true`) when the
|
|
3883
|
-
* source XML omits it, so a round-trip never invents an attribute the
|
|
3884
|
-
* source never had; a CONSUMER of this field (playback, e.g.
|
|
3885
|
-
* `pptx-viewer-shared`'s `resolveZoomNavigationTarget`) must read
|
|
3886
|
-
* `returnToParent !== false`, not `Boolean(returnToParent)`, to get the
|
|
3887
|
-
* spec-correct effective value. For `zoomType: 'summary'`, this mirrors the
|
|
3888
|
-
* first tile's own value; see {@link SummaryZoomTarget.returnToParent} for
|
|
3889
|
-
* the per-tile value.
|
|
3890
|
-
*/
|
|
3891
|
-
returnToParent?: boolean;
|
|
3892
|
-
/**
|
|
3893
|
-
* `zmPr/@transitionDur` (MS-PPTX `CT_ZoomObjectProperties`): the
|
|
3894
|
-
* zoom-transition length in milliseconds. PowerPoint's own writer emits a
|
|
3895
|
-
* unitless decimal-millisecond value for every OOXML `ST_UniversalTimeOffset`
|
|
3896
|
-
* this codebase has observed (see the media-trim/-fade parsers), so this
|
|
3897
|
-
* follows the same convention rather than the full TIMEOFFSET grammar's
|
|
3898
|
-
* unit suffixes. Undefined uses the destination slide's own transition.
|
|
3899
|
-
* For `zoomType: 'summary'`, this mirrors the first tile's own value; see
|
|
3900
|
-
* {@link SummaryZoomTarget.transitionDurationMs} for the per-tile value.
|
|
3901
|
-
*/
|
|
3902
|
-
transitionDurationMs?: number;
|
|
3903
|
-
}
|
|
3904
|
-
/** A single section tile within a PowerPoint Summary Zoom container. */
|
|
3905
|
-
interface SummaryZoomTarget extends PptxImageProperties {
|
|
3906
|
-
sectionId: string;
|
|
3907
|
-
targetSlideIndex: number;
|
|
3908
|
-
x: number;
|
|
3909
|
-
y: number;
|
|
3910
|
-
width: number;
|
|
3911
|
-
height: number;
|
|
3912
|
-
title?: string;
|
|
3913
|
-
description?: string;
|
|
3914
|
-
offsetFactorX?: number;
|
|
3915
|
-
offsetFactorY?: number;
|
|
3916
|
-
scaleFactorX?: number;
|
|
3917
|
-
scaleFactorY?: number;
|
|
3918
|
-
/** This tile's own `zmPr/@returnToParent`; see {@link ZoomPptxElement.returnToParent}. */
|
|
3919
|
-
returnToParent?: boolean;
|
|
3920
|
-
/** This tile's own `zmPr/@transitionDur` in milliseconds; see {@link ZoomPptxElement.transitionDurationMs}. */
|
|
3921
|
-
transitionDurationMs?: number;
|
|
3922
|
-
rawXml?: XmlObject;
|
|
3923
|
-
}
|
|
3924
|
-
/**
|
|
3925
|
-
* A 3D model object embedded via `p16:model3D` inside an
|
|
3926
|
-
* `mc:AlternateContent` block (PowerPoint 365+).
|
|
3927
|
-
*
|
|
3928
|
-
* The element carries the path to the `.glb`/`.gltf` binary inside
|
|
3929
|
-
* the ZIP and a poster/fallback image for rendering in viewers that
|
|
3930
|
-
* do not support interactive 3D.
|
|
3931
|
-
*/
|
|
3932
|
-
interface Model3DPptxElement extends PptxElementBase, PptxImageProperties {
|
|
3933
|
-
type: 'model3d';
|
|
3934
|
-
/** Path to the 3D model file inside the ZIP. */
|
|
3935
|
-
modelPath?: string;
|
|
3936
|
-
/** Base64 data URL of the 3D model binary. */
|
|
3937
|
-
modelData?: string;
|
|
3938
|
-
/** MIME type of the model (e.g. "model/gltf-binary"). */
|
|
3939
|
-
modelMimeType?: string;
|
|
3940
|
-
/** Poster/preview image shown when 3D rendering is unavailable. */
|
|
3941
|
-
posterImage?: string;
|
|
3942
|
-
/**
|
|
3943
|
-
* Authored camera, model transform and lights (`am3d:camera`, `am3d:trans`,
|
|
3944
|
-
* lights). Read-only view: the XML round-trips via `rawXml`.
|
|
3945
|
-
*/
|
|
3946
|
-
scene?: Model3DSceneData;
|
|
3947
|
-
/** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
|
|
3948
|
-
extensionXml?: PptxGraphicFrameExtension[];
|
|
3949
|
-
}
|
|
3950
|
-
/** An element whose type is not recognised by the parser. */
|
|
3951
|
-
interface UnknownPptxElement extends PptxElementBase {
|
|
3952
|
-
type: 'unknown';
|
|
3953
|
-
/** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
|
|
3954
|
-
extensionXml?: PptxGraphicFrameExtension[];
|
|
3955
|
-
}
|
|
3956
|
-
/**
|
|
3957
|
-
* A single element on a PPTX slide.
|
|
3958
|
-
*
|
|
3959
|
-
* This is a **discriminated union**: narrow on `element.type` to access
|
|
3960
|
-
* variant-specific properties like `imageData` (image/picture), `pathData`
|
|
3961
|
-
* (shape), or `textSegments` (text/shape).
|
|
3962
|
-
*/
|
|
3963
|
-
type PptxElement = TextPptxElement | ShapePptxElement | ConnectorPptxElement | ImagePptxElement | PicturePptxElement | TablePptxElement | ChartPptxElement | SmartArtPptxElement | OlePptxElement | MediaPptxElement | GroupPptxElement | InkPptxElement | ContentPartPptxElement | ZoomPptxElement | Model3DPptxElement | UnknownPptxElement;
|
|
3964
|
-
/**
|
|
3965
|
-
* Discriminant values for the `type` field on {@link PptxElement}.
|
|
3966
|
-
*
|
|
3967
|
-
* DERIVED from the union on purpose. This alias used to be a hand-written list
|
|
3968
|
-
* of string literals living in `types/common.ts`, and it drifted: two element
|
|
3969
|
-
* types (`contentPart` and `model3d`) were added to {@link PptxElement} without
|
|
3970
|
-
* being added to the list, so every consumer that keyed a registry or a switch
|
|
3971
|
-
* off the alias was silently blind to ink content parts and 3D models while
|
|
3972
|
-
* still type-checking. Deriving it makes that class of drift impossible, at the
|
|
3973
|
-
* cost of nothing: the resolved type is identical.
|
|
3974
|
-
*
|
|
3975
|
-
* Narrow on this type to access variant-specific properties.
|
|
3976
|
-
*
|
|
3977
|
-
* @example
|
|
3978
|
-
* ```ts
|
|
3979
|
-
* function isImage(el: PptxElement): el is ImagePptxElement {
|
|
3980
|
-
* return el.type === "image";
|
|
3981
|
-
* }
|
|
3982
|
-
* // => type guard narrowing PptxElement to ImagePptxElement
|
|
3983
|
-
* ```
|
|
3984
|
-
*/
|
|
3985
|
-
type PptxElementType = PptxElement['type'];
|
|
3986
|
-
/** Elements that can contain text content (text boxes, shapes, and connectors). */
|
|
3987
|
-
type PptxElementWithText = TextPptxElement | ShapePptxElement | ConnectorPptxElement;
|
|
3988
|
-
/** Elements that carry shape styling (fill, stroke, geometry). */
|
|
3989
|
-
type PptxElementWithShapeStyle = TextPptxElement | ShapePptxElement | ConnectorPptxElement | ImagePptxElement | PicturePptxElement;
|
|
3990
|
-
/** Elements that hold raster image data. */
|
|
3991
|
-
type PptxImageLikeElement = ImagePptxElement | PicturePptxElement;
|
|
3992
|
-
export { PptxChartAxisNumFmt as $, PptxChartPageMargins as $t, Model3DLightData as A, PptxBackgroundRemoval as An, PptxChartScatterStyle as At, ElementAction as B, PptxChartView3D as Bt, SmartArtPptxElement as C, PptxChartTextOutline as Cn, PptxChartLineStyle as Ct, UnknownPptxElement as D, PptxChartPictureFormat as Dn, PptxChartOfPieOptions as Dt, TextPptxElement as E, PptxChartDataPointPicture as En, PptxChartMarkerSymbol as Et, PlaceholderTextLevelStyle as F, PptxImageProperties as Fn, PptxChartTrendline as Ft, MediaMetadata as G, PptxChartUserShape as Gt, PptxAction as H, PptxCxValueColorPosition as Ht, PptxElementBase as I, PptxChartTrendlineLabel as It, PptxMediaType as J, PptxChartUserShapeParagraph as Jt, PptxAudioCdPosition as K, PptxChartUserShapeGroupChild as Kt, PptxShapeProperties as L, PptxChartTrendlineType as Lt, Model3DTransformData as M, PptxCropShape as Mn, PptxChartShapeProps as Mt, Model3DVec3 as N, PptxImageEffects as Nn, PptxChartStyle as Nt, ZoomPptxElement as O, PptxChartAxisLabelFormatting as On, PptxChartParentLabelLayout as Ot, PlaceholderDefaults as P, PptxImagePrerenderedCorrections as Pn, PptxChartTreemapOptions as Pt, PptxChartAxisFormatting as Q, PptxChartProtection as Qt, PptxTextProperties as R, PptxChartType as Rt, ShapePptxElement as S, PptxChartTextFill as Sn, PptxChartLegendTextStyle as St, TablePptxElement as T, parseChartFormatTargetKey as Tn, PptxChartMarker as Tt, MediaBookmark as U, PptxEmbeddedWorkbookData as Ut, ElementActionType as V, PptxChartWaterfallOptions as Vt, MediaCaptionTrack as W, PptxExternalData as Wt, PptxBubbleChartOptions as X, ResolvedChartStyleDefinition as Xt, PptxBar3DShape as Y, PptxChartTitleRun as Yt, PptxChart3DSurface as Z, ResolvedChartStyleEntry as Zt, PptxElementWithText as _, PptxChartFormatTarget as _n, PptxChartFilteredSeries as _t, GroupPptxElement as a, PptxChartPivotFormats as an, PptxChartDataLabel as at, PptxNonVisualDescription as b, PptxChartPatternFill as bn, PptxChartLayouts as bt, MediaPptxElement as c, PptxChartElementEffects as cn, PptxChartDataLabelsRange as ct, OlePptxElement as d, PptxChartElementFormats as dn, PptxChartDateCategories as dt, PptxChartPageSetup as en, PptxChartBandFmt as et, PicturePptxElement as f, PptxChartElementGlow as fn, PptxChartDisplayUnitsLabel as ft, PptxElementWithShapeStyle as g, PptxChartElementThreeD as gn, PptxChartErrValType as gt, PptxElementType as h, PptxChartElementText as hn, PptxChartErrBars as ht, ContentPartPptxElement as i, PptxChartPivotFormat as in, PptxChartData as it, Model3DSceneData as j, PptxBackgroundRemovalMark as jn, PptxChartSeries as jt, Model3DCamera as k, PptxChartTickMark as kn, PptxChartRegionMapOptions as kt, Model3DPptxElement as l, PptxChartElementFill as ln, PptxChartDataPoint as lt, PptxElement as m, PptxChartElementShadow as mn, PptxChartErrBarType as mt, ConnectorPptxElement as n, PptxChartPrintSettings as nn, PptxChartBoxWhiskerOptions as nt, ImagePptxElement as o, PptxChartBevel as on, PptxChartDataLabelOptions as ot, PptxAccessibilityProperties as p, PptxChartElementLine as pn, PptxChartErrBarDir as pt, PptxMediaReferenceKind as q, PptxChartUserShapeGroupTransform as qt, ContentPartInkStroke as r, PptxChartPivotSource as rn, PptxChartChrome as rt, InkPptxElement as s, PptxChartBevelType as sn, PptxChartDataLabelPosition as st, ChartPptxElement as t, PptxChartPrintHeaderFooter as tn, PptxChartBarDirection as tt, OleObjectType as u, PptxChartElementFormat as un, PptxChartDataTable as ut, PptxGraphicFrameExtension as v, PptxChartFormatTargetKey as vn, PptxChartGradientFill as vt, SummaryZoomTarget as w, chartFormatTargetKey as wn, PptxChartManualLayout as wt, PptxPictureNonVisualProperties as x, PptxChartPictureFill as xn, PptxChartLegendEntry as xt, PptxImageLikeElement as y, PptxChartLineEndType as yn, PptxChartHistogramOptions as yt, ActionButtonPreset as z, PptxChartUpDownBars as zt };
|
|
3993
|
-
//# sourceMappingURL=elements-B4Z6N-Gz.d.ts.map
|