pptx-svelte-viewer 3.7.0 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/{AiChatPanel-vYzaXNFz.js → AiChatPanel-yqg_BJme.js} +1 -1
- package/dist/{export-xK6ID6BD.js → export-zAcr-4rr.js} +36382 -32399
- package/dist/i18n.js +1 -1
- package/dist/index.d.ts +534 -38
- package/dist/index.js +2 -2
- package/dist/pptx-svelte-viewer.css +1 -1
- package/dist/{translator-DWcErYB3.js → translator-Cxn32Y3A.js} +54 -27
- package/dist/viewer/ai/ai-bridge.d.ts +25 -1
- package/dist/viewer/ai/ai-bridge.d.ts.map +1 -1
- package/dist/viewer/collab/collaboration-deps.d.ts +8 -1
- package/dist/viewer/collab/collaboration-deps.d.ts.map +1 -1
- package/dist/viewer/collab/collaboration.svelte.d.ts.map +1 -1
- package/dist/viewer/components/chart-drag.svelte.d.ts.map +1 -1
- package/dist/viewer/editor/editor-document-lifecycle.d.ts.map +1 -1
- package/dist/viewer/editor/editor-document-state.d.ts +7 -2
- package/dist/viewer/editor/editor-document-state.d.ts.map +1 -1
- package/dist/viewer/editor/editor-format-mutations.d.ts +10 -6
- package/dist/viewer/editor/editor-format-mutations.d.ts.map +1 -1
- package/dist/viewer/editor/editor-state.svelte.d.ts +20 -1
- package/dist/viewer/editor/editor-state.svelte.d.ts.map +1 -1
- package/dist/viewer/index.d.ts +656 -38
- package/dist/viewer/index.js +1 -1
- package/dist/viewer/presentation/animation-playback.svelte.d.ts.map +1 -1
- package/dist/viewer/render/smart-art-3d-view.d.ts.map +1 -1
- package/dist/viewer/render/smartart-view.d.ts +9 -6
- package/dist/viewer/render/smartart-view.d.ts.map +1 -1
- package/dist/viewer/state/create-viewer-state-ai.svelte.d.ts.map +1 -1
- package/dist/viewer/state/create-viewer-state-collab.svelte.d.ts.map +1 -1
- package/dist/viewer/state/create-viewer-state.svelte.d.ts.map +1 -1
- package/dist/viewer/state/inspector-deck.d.ts +12 -1
- package/dist/viewer/state/inspector-deck.d.ts.map +1 -1
- package/dist/viewer/state/presentation-loader.svelte.d.ts +8 -0
- package/dist/viewer/state/presentation-loader.svelte.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -571,6 +571,44 @@ interface PptxCustomPathProperties {
|
|
|
571
571
|
customGeometryTextRect?: CustomGeometryTextRect;
|
|
572
572
|
}
|
|
573
573
|
//#endregion
|
|
574
|
+
//#region src/core/types/color-ref.d.ts
|
|
575
|
+
/**
|
|
576
|
+
* Theme colour references: the typed counterpart of `<a:schemeClr>`.
|
|
577
|
+
*
|
|
578
|
+
* A colour picked from the theme palette is remembered as a scheme slot plus
|
|
579
|
+
* PowerPoint's luminance variants rather than as the sRGB it currently
|
|
580
|
+
* resolves to, so a later theme change re-colours the shape (and a saved file
|
|
581
|
+
* keeps `<a:schemeClr>` instead of a canonical `<a:srgbClr>`).
|
|
582
|
+
*
|
|
583
|
+
* @module types/color-ref
|
|
584
|
+
*/
|
|
585
|
+
/**
|
|
586
|
+
* The scheme slot names `a:schemeClr/@val` accepts (ECMA-376 `ST_SchemeColorIndex`).
|
|
587
|
+
* `bg1`/`tx1`/`bg2`/`tx2` are the colour-map aliases a slide resolves through
|
|
588
|
+
* `p:clrMap`; `phClr` is the placeholder colour used inside a theme's style
|
|
589
|
+
* matrix and is never chosen from a picker.
|
|
590
|
+
*/
|
|
591
|
+
type PptxThemeColorSchemeName = 'dk1' | 'lt1' | 'dk2' | 'lt2' | 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'accent5' | 'accent6' | 'hlink' | 'folHlink' | 'bg1' | 'tx1' | 'bg2' | 'tx2' | 'phClr';
|
|
592
|
+
/**
|
|
593
|
+
* A theme colour choice. Every transform is a 0..1 fraction of the OOXML
|
|
594
|
+
* percentage (`lumMod val="20000"` is `lumMod: 0.2`), matching how the parser
|
|
595
|
+
* reads them, and is applied in the order `a:schemeClr` children are written:
|
|
596
|
+
* `tint`, `shade`, `lumMod`, `lumOff`, `alpha`.
|
|
597
|
+
*/
|
|
598
|
+
interface PptxThemeColorRef {
|
|
599
|
+
scheme: PptxThemeColorSchemeName;
|
|
600
|
+
/** `a:lumMod`: multiply HSL luminance (PowerPoint's "Lighter/Darker" rows). */
|
|
601
|
+
lumMod?: number;
|
|
602
|
+
/** `a:lumOff`: add to HSL luminance after `lumMod` ("Lighter N%" rows). */
|
|
603
|
+
lumOff?: number;
|
|
604
|
+
/** `a:tint`: blend towards white. */
|
|
605
|
+
tint?: number;
|
|
606
|
+
/** `a:shade`: blend towards black. */
|
|
607
|
+
shade?: number;
|
|
608
|
+
/** `a:alpha`: opacity fraction (1 = opaque). */
|
|
609
|
+
alpha?: number;
|
|
610
|
+
}
|
|
611
|
+
//#endregion
|
|
574
612
|
//#region src/core/types/effect-dag.d.ts
|
|
575
613
|
type EffectDagBlendMode = 'darken' | 'lighten' | 'mult' | 'over' | 'screen';
|
|
576
614
|
type EffectDagContainerType = 'sib' | 'tree';
|
|
@@ -860,6 +898,15 @@ interface ShapeStyle {
|
|
|
860
898
|
* back to canonical `<a:srgbClr>`.
|
|
861
899
|
*/
|
|
862
900
|
fillColorXml?: XmlObject;
|
|
901
|
+
/**
|
|
902
|
+
* Typed theme colour reference for the fill, set when {@link fillColorXml}
|
|
903
|
+
* is a plain `a:schemeClr` (see `themeColorRefFromColorChoice`). When
|
|
904
|
+
* present it WINS on save: the writer emits `<a:schemeClr>` from this ref
|
|
905
|
+
* instead of the resolved {@link fillColor}, so the fill keeps following
|
|
906
|
+
* the theme palette after a later theme change. `undefined` means the fill
|
|
907
|
+
* is a plain hex (or a colour kind a ref cannot express).
|
|
908
|
+
*/
|
|
909
|
+
fillColorRef?: PptxThemeColorRef;
|
|
863
910
|
fillGradient?: string;
|
|
864
911
|
/** Original `gradFill` XML retained for unknown-child and extension round-tripping. */
|
|
865
912
|
fillGradientXml?: XmlObject;
|
|
@@ -894,6 +941,12 @@ interface ShapeStyle {
|
|
|
894
941
|
opacity?: number;
|
|
895
942
|
/** Raw XML colour node preserved for round-trip (e.g. a:schemeClr with transforms). */
|
|
896
943
|
originalColorXml?: XmlObject;
|
|
944
|
+
/**
|
|
945
|
+
* Typed theme colour reference for this stop, set when
|
|
946
|
+
* {@link originalColorXml} is a plain `a:schemeClr`. Wins on save, same
|
|
947
|
+
* as {@link ShapeStyle.fillColorRef}.
|
|
948
|
+
*/
|
|
949
|
+
colorRef?: PptxThemeColorRef;
|
|
897
950
|
}>;
|
|
898
951
|
fillGradientAngle?: number;
|
|
899
952
|
fillGradientType?: 'linear' | 'radial';
|
|
@@ -940,6 +993,12 @@ interface ShapeStyle {
|
|
|
940
993
|
* round-trip serialisation. See {@link fillColorXml} for the rationale.
|
|
941
994
|
*/
|
|
942
995
|
strokeColorXml?: XmlObject;
|
|
996
|
+
/**
|
|
997
|
+
* Typed theme colour reference for the outline, mirroring
|
|
998
|
+
* {@link fillColorRef}: set when {@link strokeColorXml} is a plain
|
|
999
|
+
* `a:schemeClr`, and wins on save.
|
|
1000
|
+
*/
|
|
1001
|
+
strokeColorRef?: PptxThemeColorRef;
|
|
943
1002
|
/**
|
|
944
1003
|
* Kind of fill painted on the outline (`a:ln` child). Distinguishes a solid
|
|
945
1004
|
* outline from a gradient/pattern/none outline so save can emit the correct
|
|
@@ -1443,6 +1502,15 @@ interface TextStyle {
|
|
|
1443
1502
|
* verbatim when the resolved {@link color} still matches this node.
|
|
1444
1503
|
*/
|
|
1445
1504
|
colorXml?: XmlObject;
|
|
1505
|
+
/**
|
|
1506
|
+
* Typed theme colour reference for the run's text colour, set when
|
|
1507
|
+
* {@link colorXml} is a plain `a:schemeClr` (see
|
|
1508
|
+
* `themeColorRefFromColorChoice`). When present it WINS on save: the
|
|
1509
|
+
* writer emits `<a:schemeClr>` from this ref instead of the resolved
|
|
1510
|
+
* {@link color}, so the text keeps following the theme palette after a
|
|
1511
|
+
* later theme change.
|
|
1512
|
+
*/
|
|
1513
|
+
colorRef?: PptxThemeColorRef;
|
|
1446
1514
|
align?: 'left' | 'center' | 'right' | 'justify' | 'justLow' | 'dist' | 'thaiDist';
|
|
1447
1515
|
/**
|
|
1448
1516
|
* Vertical text-box anchor (`a:bodyPr/@anchor`, `ST_TextAnchoringType`).
|
|
@@ -1868,6 +1936,12 @@ interface BulletInfo {
|
|
|
1868
1936
|
* identity rather than being flattened to `<a:srgbClr/>` on save.
|
|
1869
1937
|
*/
|
|
1870
1938
|
colorXml?: XmlObject;
|
|
1939
|
+
/**
|
|
1940
|
+
* Typed theme colour reference for the bullet colour, set when
|
|
1941
|
+
* {@link colorXml} is a plain `a:schemeClr`. Wins on save, same as
|
|
1942
|
+
* {@link TextStyle.colorRef}.
|
|
1943
|
+
*/
|
|
1944
|
+
colorRef?: PptxThemeColorRef;
|
|
1871
1945
|
/** True when `a:buNone` explicitly suppresses bullets. */
|
|
1872
1946
|
none?: boolean;
|
|
1873
1947
|
/** Picture bullet: relationship ID from `a:buBlip` → `a:blip[@r:embed]`. */
|
|
@@ -2320,7 +2394,38 @@ interface PptxChartDataPointPicture {
|
|
|
2320
2394
|
//#region src/core/types/chart-pivot-format.d.ts
|
|
2321
2395
|
interface PptxChartPivotFormat {
|
|
2322
2396
|
index: number;
|
|
2397
|
+
/**
|
|
2398
|
+
* Typed projection of `spPr` (fill/stroke colour, stroke width, dash
|
|
2399
|
+
* style). When the parser is given a colour resolver (the normal case: the
|
|
2400
|
+
* runtime always supplies one), both a literal `a:srgbClr` and an
|
|
2401
|
+
* `a:schemeClr` theme reference (with its `lumMod`/`lumOff`/`tint`/`shade`
|
|
2402
|
+
* modifiers) resolve to a hex colour here, the same theme +
|
|
2403
|
+
* `c:clrMapOvr` chain the rest of chart parsing uses. Without a resolver
|
|
2404
|
+
* (e.g. a hand-built `PptxChartPivotFormat` with no theme to resolve
|
|
2405
|
+
* against), only the literal case resolves. Either way the authored node
|
|
2406
|
+
* is byte-preserved through {@link shapePropertiesXml} until this field is
|
|
2407
|
+
* set to something that no longer matches what re-parses off the current
|
|
2408
|
+
* XML; setting it then re-derives `shapePropertiesXml` on save (merged
|
|
2409
|
+
* onto whatever was already authored, keeping an unrelated schemeClr
|
|
2410
|
+
* reference alive when the colour itself is unchanged) unless
|
|
2411
|
+
* `shapePropertiesXml` is set explicitly, which wins.
|
|
2412
|
+
*/
|
|
2413
|
+
shapeProperties?: PptxChartShapeProps;
|
|
2414
|
+
/**
|
|
2415
|
+
* Typed projection of `txPr`'s `a:p/a:pPr/a:defRPr` (size/bold/italic/
|
|
2416
|
+
* colour/family), the same shape a legend entry or data-table's text
|
|
2417
|
+
* override models. Colour resolution mirrors {@link shapeProperties}
|
|
2418
|
+
* (theme-resolved `schemeClr` when a colour resolver is supplied, literal
|
|
2419
|
+
* `srgbClr` otherwise). See {@link txPrXml} for the raw fallback.
|
|
2420
|
+
*/
|
|
2421
|
+
textStyle?: PptxChartLegendTextStyle;
|
|
2422
|
+
/**
|
|
2423
|
+
* Typed projection of `marker` (symbol/size/spPr). See {@link markerXml}
|
|
2424
|
+
* for the raw fallback.
|
|
2425
|
+
*/
|
|
2426
|
+
marker?: PptxChartMarker;
|
|
2323
2427
|
shapePropertiesXml?: XmlObject | null;
|
|
2428
|
+
txPrXml?: XmlObject | null;
|
|
2324
2429
|
markerXml?: XmlObject | null;
|
|
2325
2430
|
dataLabelXml?: XmlObject | null;
|
|
2326
2431
|
extensionListXml?: XmlObject | null;
|
|
@@ -2479,21 +2584,40 @@ interface PptxChartStyleDefinition {
|
|
|
2479
2584
|
plotArea?: PptxChartStylePartEntry;
|
|
2480
2585
|
}
|
|
2481
2586
|
//#endregion
|
|
2482
|
-
//#region src/core/types/chart-
|
|
2587
|
+
//#region src/core/types/chart-title.d.ts
|
|
2483
2588
|
/**
|
|
2484
|
-
*
|
|
2589
|
+
* Chart title rich-text run type, split out of `types/chart.ts` (already at
|
|
2590
|
+
* the repo's file-size limit) to keep that module from growing further.
|
|
2485
2591
|
*
|
|
2486
|
-
*
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
*
|
|
2490
|
-
* top of the chart plot. These interfaces describe the parsed, renderable
|
|
2491
|
-
* overlay model. The raw reference is preserved separately on
|
|
2492
|
-
* {@link PptxChartData.userShapesXml} for verbatim round-trip save; this model
|
|
2493
|
-
* is render-only.
|
|
2592
|
+
* @module pptx-types/chart-title
|
|
2593
|
+
*/
|
|
2594
|
+
/**
|
|
2595
|
+
* One run of a chart title's rich text (`c:title/c:tx/c:rich/a:p/a:r`).
|
|
2494
2596
|
*
|
|
2495
|
-
*
|
|
2597
|
+
* The flat `PptxChartData.title` field only ever captured the FIRST run's
|
|
2598
|
+
* text with no per-run formatting; `titleRuns` (when present) is the
|
|
2599
|
+
* lossless, multi-run replacement parsed from the same `c:rich` body. Absent
|
|
2600
|
+
* when the title has no rich text at all (an empty/auto title, or one
|
|
2601
|
+
* authored as a linked-cell reference).
|
|
2496
2602
|
*/
|
|
2603
|
+
interface PptxChartTitleRun {
|
|
2604
|
+
/** This run's text (`a:t`). */
|
|
2605
|
+
text: string;
|
|
2606
|
+
/** `a:rPr/@_b`. */
|
|
2607
|
+
bold?: boolean;
|
|
2608
|
+
/** `a:rPr/@_i`. */
|
|
2609
|
+
italic?: boolean;
|
|
2610
|
+
/**
|
|
2611
|
+
* Font size in POINTS (`a:rPr/@_sz`, hundredths of a point / 100), matching
|
|
2612
|
+
* `PptxChartLegendTextStyle.fontSize`'s convention rather than the pixel
|
|
2613
|
+
* convention `TextStyle.fontSize` uses for slide text.
|
|
2614
|
+
*/
|
|
2615
|
+
fontSize?: number;
|
|
2616
|
+
/** Resolved hex colour (e.g. `"#FF0000"`) from `a:rPr/a:solidFill`. */
|
|
2617
|
+
color?: string;
|
|
2618
|
+
}
|
|
2619
|
+
//#endregion
|
|
2620
|
+
//#region src/core/types/chart-user-shapes.d.ts
|
|
2497
2621
|
/** A single paragraph of overlay-shape text with light formatting. */
|
|
2498
2622
|
interface PptxChartUserShapeParagraph {
|
|
2499
2623
|
/** Joined run text of the paragraph. */
|
|
@@ -2509,6 +2633,80 @@ interface PptxChartUserShapeParagraph {
|
|
|
2509
2633
|
/** Paragraph alignment (`a:pPr/@algn`): left / centre / right. */
|
|
2510
2634
|
align?: 'l' | 'ctr' | 'r';
|
|
2511
2635
|
}
|
|
2636
|
+
/**
|
|
2637
|
+
* The DrawingML 2D group transform (`a:xfrm` inside `cdr:grpSpPr`) that
|
|
2638
|
+
* anchors a `grpSp`'s own box ({@link off}/{@link ext}) and establishes the
|
|
2639
|
+
* coordinate space its children are expressed in ({@link chOff}/{@link
|
|
2640
|
+
* chExt}), all in EMU. A child's position within the group is mapped into
|
|
2641
|
+
* the group's own box via
|
|
2642
|
+
* `frac = (child.off - chOff) / chExt`, then applied to the enclosing
|
|
2643
|
+
* anchor's box; see `flattenChartUserShapes` in
|
|
2644
|
+
* `chart-user-shapes-parser.ts`.
|
|
2645
|
+
*/
|
|
2646
|
+
interface PptxChartUserShapeGroupTransform {
|
|
2647
|
+
/** The group's own position in its parent's coordinate space, in EMU. */
|
|
2648
|
+
off: {
|
|
2649
|
+
x: number;
|
|
2650
|
+
y: number;
|
|
2651
|
+
};
|
|
2652
|
+
/** The group's own size in its parent's coordinate space, in EMU. */
|
|
2653
|
+
ext: {
|
|
2654
|
+
cx: number;
|
|
2655
|
+
cy: number;
|
|
2656
|
+
};
|
|
2657
|
+
/** Origin of the child coordinate space (`a:chOff`), in EMU. */
|
|
2658
|
+
chOff: {
|
|
2659
|
+
x: number;
|
|
2660
|
+
y: number;
|
|
2661
|
+
};
|
|
2662
|
+
/** Size of the child coordinate space (`a:chExt`), in EMU. */
|
|
2663
|
+
chExt: {
|
|
2664
|
+
cx: number;
|
|
2665
|
+
cy: number;
|
|
2666
|
+
};
|
|
2667
|
+
}
|
|
2668
|
+
/**
|
|
2669
|
+
* One shape grouped inside a `cdr:grpSp` (or a nested `cdr:grpSp` itself).
|
|
2670
|
+
* Unlike a top-level {@link PptxChartUserShape}, a group child has no
|
|
2671
|
+
* drawing anchor of its own: its position is expressed in its parent
|
|
2672
|
+
* group's child coordinate space via {@link off}/{@link ext} (EMU, read
|
|
2673
|
+
* from the child's own `a:xfrm`), not as a chart-relative fraction.
|
|
2674
|
+
*/
|
|
2675
|
+
interface PptxChartUserShapeGroupChild {
|
|
2676
|
+
/** Shape kind, same vocabulary as {@link PptxChartUserShape.kind}. */
|
|
2677
|
+
kind: 'sp' | 'cxnSp' | 'pic' | 'grpSp' | 'graphicFrame';
|
|
2678
|
+
/** Position within the parent group's child coordinate space, in EMU. */
|
|
2679
|
+
off: {
|
|
2680
|
+
x: number;
|
|
2681
|
+
y: number;
|
|
2682
|
+
};
|
|
2683
|
+
/** Size within the parent group's child coordinate space, in EMU. */
|
|
2684
|
+
ext: {
|
|
2685
|
+
cx: number;
|
|
2686
|
+
cy: number;
|
|
2687
|
+
};
|
|
2688
|
+
/** Preset geometry name (`a:prstGeom/@prst`), defaulting to `"rect"`. */
|
|
2689
|
+
prst?: string;
|
|
2690
|
+
/** Resolved solid-fill hex colour, when present. */
|
|
2691
|
+
fill?: string;
|
|
2692
|
+
/** Resolved line/stroke hex colour, when present. */
|
|
2693
|
+
stroke?: string;
|
|
2694
|
+
/** Line width in points (`a:ln/@w` divided by 12700), when present. */
|
|
2695
|
+
strokeWidth?: number;
|
|
2696
|
+
/** Text paragraphs of the shape's `txBody`, when present. */
|
|
2697
|
+
paragraphs?: PptxChartUserShapeParagraph[];
|
|
2698
|
+
/**
|
|
2699
|
+
* Verbatim source XML of a `pic`/`graphicFrame` child, or of this node
|
|
2700
|
+
* itself when `kind === 'grpSp'` and the nested group is untouched since
|
|
2701
|
+
* parse. See {@link PptxChartUserShape.rawXml}'s doc for the same
|
|
2702
|
+
* contract one level up.
|
|
2703
|
+
*/
|
|
2704
|
+
rawXml?: XmlObject;
|
|
2705
|
+
/** Present when `kind === 'grpSp'`: this nested group's own transform. */
|
|
2706
|
+
transform?: PptxChartUserShapeGroupTransform;
|
|
2707
|
+
/** Present when `kind === 'grpSp'`: this nested group's own children. */
|
|
2708
|
+
children?: PptxChartUserShapeGroupChild[];
|
|
2709
|
+
}
|
|
2512
2710
|
/**
|
|
2513
2711
|
* A parsed chart-overlay shape positioned by a drawing anchor.
|
|
2514
2712
|
*
|
|
@@ -2519,12 +2717,13 @@ interface PptxChartUserShapeParagraph {
|
|
|
2519
2717
|
interface PptxChartUserShape {
|
|
2520
2718
|
/**
|
|
2521
2719
|
* Shape kind: text/preset shape, connector, picture, a group of the
|
|
2522
|
-
* above (`grpSp`,
|
|
2523
|
-
*
|
|
2524
|
-
*
|
|
2525
|
-
*
|
|
2526
|
-
*
|
|
2527
|
-
*
|
|
2720
|
+
* above (`grpSp`, with its own {@link transform} and {@link children},
|
|
2721
|
+
* nested arbitrarily; use `flattenChartUserShapes` from
|
|
2722
|
+
* `chart-user-shapes-parser.ts` to get a flat, render-ready leaf list
|
|
2723
|
+
* with the group transform already applied), or a bare placeholder for
|
|
2724
|
+
* a `graphicFrame` anchor child (deep content such as a nested chart or
|
|
2725
|
+
* table is out of scope; it only keeps the anchor's space accounted for
|
|
2726
|
+
* instead of the whole overlay disappearing).
|
|
2528
2727
|
*/
|
|
2529
2728
|
kind: 'sp' | 'cxnSp' | 'pic' | 'grpSp' | 'graphicFrame';
|
|
2530
2729
|
/** Anchor kind that positioned the shape. */
|
|
@@ -2554,6 +2753,26 @@ interface PptxChartUserShape {
|
|
|
2554
2753
|
strokeWidth?: number;
|
|
2555
2754
|
/** Text paragraphs of the shape's `txBody`, when present. */
|
|
2556
2755
|
paragraphs?: PptxChartUserShapeParagraph[];
|
|
2756
|
+
/**
|
|
2757
|
+
* Verbatim source XML of a `pic` or `graphicFrame` anchor child (the
|
|
2758
|
+
* `cdr:pic` / `cdr:graphicFrame` node itself, not the enclosing anchor),
|
|
2759
|
+
* or of the `cdr:grpSp` node itself when `kind === 'grpSp'` and the
|
|
2760
|
+
* group is untouched since parse (byte-identical passthrough). None of
|
|
2761
|
+
* these three kinds have a reconstructable typed representation that is
|
|
2762
|
+
* guaranteed lossless (a picture's blip reference, a nested chart/table's
|
|
2763
|
+
* graphic content, or a group's exact child ordering/ids), so the
|
|
2764
|
+
* serializer re-emits this verbatim when present instead of a lossy
|
|
2765
|
+
* rebuild. Editing a shape inside a group (via the SDK's path-based
|
|
2766
|
+
* overlay operations) clears the group's `rawXml` so the serializer
|
|
2767
|
+
* regenerates it from {@link transform}/{@link children} instead. Absent
|
|
2768
|
+
* for `sp`/`cxnSp`, which round-trip losslessly through their typed
|
|
2769
|
+
* fields above.
|
|
2770
|
+
*/
|
|
2771
|
+
rawXml?: XmlObject;
|
|
2772
|
+
/** Present when `kind === 'grpSp'`: the group's own transform. */
|
|
2773
|
+
transform?: PptxChartUserShapeGroupTransform;
|
|
2774
|
+
/** Present when `kind === 'grpSp'`: the grouped children, nested arbitrarily. */
|
|
2775
|
+
children?: PptxChartUserShapeGroupChild[];
|
|
2557
2776
|
}
|
|
2558
2777
|
//#endregion
|
|
2559
2778
|
//#region src/core/types/chart.d.ts
|
|
@@ -2627,6 +2846,10 @@ interface PptxChartTrendline {
|
|
|
2627
2846
|
displayRSq?: boolean;
|
|
2628
2847
|
displayEq?: boolean;
|
|
2629
2848
|
color?: string;
|
|
2849
|
+
/** Trendline width in points (`c:trendline/c:spPr/a:ln/@w`, EMU / 12700). */
|
|
2850
|
+
lineWidth?: number;
|
|
2851
|
+
/** Trendline dash style (`c:trendline/c:spPr/a:ln/a:prstDash/@val`). */
|
|
2852
|
+
lineDashStyle?: string;
|
|
2630
2853
|
label?: PptxChartTrendlineLabel | null;
|
|
2631
2854
|
}
|
|
2632
2855
|
/** Typed, commonly edited properties of `c:trendlineLbl`. */
|
|
@@ -2672,6 +2895,10 @@ interface PptxChartErrBars {
|
|
|
2672
2895
|
customMinus?: number[];
|
|
2673
2896
|
noEndCap?: boolean;
|
|
2674
2897
|
color?: string;
|
|
2898
|
+
/** Error-bar line width in points (`c:errBars/c:spPr/a:ln/@w`, EMU / 12700). */
|
|
2899
|
+
width?: number;
|
|
2900
|
+
/** Error-bar line dash style (`c:errBars/c:spPr/a:ln/a:prstDash/@val`). */
|
|
2901
|
+
dashStyle?: string;
|
|
2675
2902
|
}
|
|
2676
2903
|
/**
|
|
2677
2904
|
* Visibility flags for the chart data table (axes + legend keys).
|
|
@@ -2798,6 +3025,12 @@ interface PptxChartDataLabel {
|
|
|
2798
3025
|
* `.../a:p/a:pPr/a:defRPr` default-run-property style.
|
|
2799
3026
|
*/
|
|
2800
3027
|
txPr?: PptxChartLegendTextStyle;
|
|
3028
|
+
/**
|
|
3029
|
+
* This label's own shape formatting (`c:dLbl/c:spPr`): fill/line colour,
|
|
3030
|
+
* width, and dash style for the label's callout box, taking precedence
|
|
3031
|
+
* over any chart/series-level default when set.
|
|
3032
|
+
*/
|
|
3033
|
+
spPr?: PptxChartShapeProps;
|
|
2801
3034
|
}
|
|
2802
3035
|
/** Axis number format. */
|
|
2803
3036
|
interface PptxChartAxisNumFmt {
|
|
@@ -3361,6 +3594,16 @@ interface PptxChartDateCategories {
|
|
|
3361
3594
|
*/
|
|
3362
3595
|
interface PptxChartData {
|
|
3363
3596
|
title?: string;
|
|
3597
|
+
/**
|
|
3598
|
+
* Rich-text runs of the title, parsed from `c:title/c:tx/c:rich` (issue:
|
|
3599
|
+
* chart title rich text). Lossless multi-run alternative to the flat
|
|
3600
|
+
* {@link title}: when present, the writer serialises every run's own
|
|
3601
|
+
* bold/italic/size/color; when absent, save falls back to the flat
|
|
3602
|
+
* `title` path as before. Only populated for a classic (`c:`) chart's
|
|
3603
|
+
* rich (typed) title, not a ChartEx (`cx:`) title or one authored as a
|
|
3604
|
+
* linked-cell reference.
|
|
3605
|
+
*/
|
|
3606
|
+
titleRuns?: PptxChartTitleRun[];
|
|
3364
3607
|
chartType: PptxChartType;
|
|
3365
3608
|
categories: string[];
|
|
3366
3609
|
/**
|
|
@@ -3452,8 +3695,10 @@ interface PptxChartData {
|
|
|
3452
3695
|
chartRelationshipId?: string;
|
|
3453
3696
|
/** `null` explicitly removes an existing ChartML data table. */
|
|
3454
3697
|
dataTable?: PptxChartDataTable | null;
|
|
3455
|
-
dropLines
|
|
3456
|
-
|
|
3698
|
+
/** `null` explicitly removes an existing `c:dropLines` element. */
|
|
3699
|
+
dropLines?: PptxChartLineStyle | null;
|
|
3700
|
+
/** `null` explicitly removes an existing `c:hiLowLines` element. */
|
|
3701
|
+
hiLowLines?: PptxChartLineStyle | null;
|
|
3457
3702
|
/** `null` explicitly removes an existing up/down-bars container. */
|
|
3458
3703
|
upDownBars?: PptxChartUpDownBars | null;
|
|
3459
3704
|
axes?: PptxChartAxisFormatting[];
|
|
@@ -3568,10 +3813,13 @@ interface PptxChartData {
|
|
|
3568
3813
|
pivotFormats?: PptxChartPivotFormats | null;
|
|
3569
3814
|
/**
|
|
3570
3815
|
* Color-map override (`c:clrMapOvr`) carrying 12 attributes that
|
|
3571
|
-
* remap theme colour roles for this chart only.
|
|
3572
|
-
* `attribute
|
|
3816
|
+
* remap theme colour roles for this chart only. Modeled as a flat
|
|
3817
|
+
* `attribute -> value` map (e.g. `{ bg1: 'lt1', accent1: 'accent2' }`)
|
|
3818
|
+
* so unknown/future attributes round-trip without code changes.
|
|
3819
|
+
* `null` explicitly removes an existing `c:clrMapOvr`; an empty object
|
|
3820
|
+
* is treated the same as `null` on save.
|
|
3573
3821
|
*/
|
|
3574
|
-
clrMapOvr?: Record<string, string
|
|
3822
|
+
clrMapOvr?: Record<string, string> | null;
|
|
3575
3823
|
/**
|
|
3576
3824
|
* Whether the chart's own cached numeric values use the 1904 date epoch
|
|
3577
3825
|
* (`c:chartSpace/c:date1904/@val`). Independent of, and authoritative over,
|
|
@@ -4948,13 +5196,55 @@ interface PptxSmartArtData {
|
|
|
4948
5196
|
drawingDirty?: boolean;
|
|
4949
5197
|
}
|
|
4950
5198
|
//#endregion
|
|
4951
|
-
//#region src/core/types/table.d.ts
|
|
5199
|
+
//#region src/core/types/table-style-edit.d.ts
|
|
5200
|
+
/**
|
|
5201
|
+
* A `a:fillRef`/`a:lnRef`/`a:effectRef`-style style-matrix reference: an
|
|
5202
|
+
* index into the theme's format scheme (`a:fmtScheme/a:fillStyleLst`, 1-based
|
|
5203
|
+
* per ECMA-376 §20.1.4.1.12) plus an optional colour transform child.
|
|
5204
|
+
*
|
|
5205
|
+
* Distinct from an already-resolved {@link ParsedTableStyleFill}: a fill ref
|
|
5206
|
+
* points AT a theme style-matrix entry rather than carrying a colour choice
|
|
5207
|
+
* directly, though the two commonly appear together (`<a:fillRef idx="2">
|
|
5208
|
+
* <a:schemeClr val="accent1"/></a:fillRef>`).
|
|
5209
|
+
*
|
|
5210
|
+
* @example
|
|
5211
|
+
* ```ts
|
|
5212
|
+
* const ref: ParsedTableFillRef = { idx: 2, color: { schemeColor: 'accent1' } };
|
|
5213
|
+
* // => satisfies ParsedTableFillRef
|
|
5214
|
+
* ```
|
|
5215
|
+
*/
|
|
5216
|
+
interface ParsedTableFillRef {
|
|
5217
|
+
/** 1-based index into the theme format scheme's fill style list. */
|
|
5218
|
+
idx: number;
|
|
5219
|
+
/** Colour transform child (`a:schemeClr`/`a:srgbClr`) applied to the referenced style. */
|
|
5220
|
+
color?: ParsedTableStyleFill;
|
|
5221
|
+
}
|
|
4952
5222
|
/**
|
|
4953
|
-
*
|
|
4954
|
-
*
|
|
5223
|
+
* One leaf (or `effectDag`-wrapped) node of an `a:effectLst`/`a:effectDag`
|
|
5224
|
+
* effect chain, kept mostly opaque: {@link kind} names the OOXML element so a
|
|
5225
|
+
* consumer can recognise common effects (`outerShdw`, `glow`, `softEdge`,
|
|
5226
|
+
* `reflection`, `blur`, `innerShdw`, `prstShdw`, `fillOverlay`, `alphaModFix`,
|
|
5227
|
+
* `alphaInv`, `grayscl`, `biLevel`, `duotone`, `hsl`, `lum`, `tint`) without
|
|
5228
|
+
* this module re-deriving the full shape-effect taxonomy already modelled on
|
|
5229
|
+
* `ShapeStyle`; {@link xml} preserves the node verbatim for lossless re-emit.
|
|
4955
5230
|
*
|
|
4956
|
-
* @
|
|
5231
|
+
* @example
|
|
5232
|
+
* ```ts
|
|
5233
|
+
* const effect: ParsedTableStyleEffect = {
|
|
5234
|
+
* kind: 'outerShdw',
|
|
5235
|
+
* xml: { '@_blurRad': '40000', '@_dist': '20000', '@_dir': '5400000' },
|
|
5236
|
+
* };
|
|
5237
|
+
* // => satisfies ParsedTableStyleEffect
|
|
5238
|
+
* ```
|
|
4957
5239
|
*/
|
|
5240
|
+
interface ParsedTableStyleEffect {
|
|
5241
|
+
/** The OOXML element's local name, e.g. `outerShdw`, `glow`, `softEdge`. */
|
|
5242
|
+
kind: string;
|
|
5243
|
+
/** Verbatim XML node (attributes + children) for lossless round-trip. */
|
|
5244
|
+
xml: XmlObject;
|
|
5245
|
+
}
|
|
5246
|
+
//#endregion
|
|
5247
|
+
//#region src/core/types/table.d.ts
|
|
4958
5248
|
/**
|
|
4959
5249
|
* Per-cell visual style for a table cell.
|
|
4960
5250
|
*
|
|
@@ -4991,6 +5281,14 @@ interface PptxTableCellStyle {
|
|
|
4991
5281
|
* future expansion alongside the run-properties round-trip path.
|
|
4992
5282
|
*/
|
|
4993
5283
|
colorXml?: XmlObject;
|
|
5284
|
+
/**
|
|
5285
|
+
* Typed theme colour reference for the cell text colour, set when
|
|
5286
|
+
* {@link colorXml} is a plain `a:schemeClr`. Wins on save, mirroring
|
|
5287
|
+
* `TextStyle.colorRef`. Distinct from {@link ParsedTableStyleFill.schemeColor},
|
|
5288
|
+
* which describes a `ppt/tableStyles.xml` section fill rather than an
|
|
5289
|
+
* individual cell override.
|
|
5290
|
+
*/
|
|
5291
|
+
colorRef?: PptxThemeColorRef;
|
|
4994
5292
|
backgroundColor?: string;
|
|
4995
5293
|
/**
|
|
4996
5294
|
* Raw XML colour-choice node preserved from cell `a:tcPr/a:solidFill` for
|
|
@@ -4998,6 +5296,12 @@ interface PptxTableCellStyle {
|
|
|
4998
5296
|
* {@link backgroundColor} still matches the original colour.
|
|
4999
5297
|
*/
|
|
5000
5298
|
backgroundColorXml?: XmlObject;
|
|
5299
|
+
/**
|
|
5300
|
+
* Typed theme colour reference for the cell fill, set when
|
|
5301
|
+
* {@link backgroundColorXml} is a plain `a:schemeClr`. Wins on save,
|
|
5302
|
+
* mirroring `ShapeStyle.fillColorRef`.
|
|
5303
|
+
*/
|
|
5304
|
+
backgroundColorRef?: PptxThemeColorRef;
|
|
5001
5305
|
borderColor?: string;
|
|
5002
5306
|
/** Top border width in px. */
|
|
5003
5307
|
borderTopWidth?: number;
|
|
@@ -5311,12 +5615,14 @@ interface PptxTableData {
|
|
|
5311
5615
|
*/
|
|
5312
5616
|
tableFill?: ParsedTableStyleFill;
|
|
5313
5617
|
/**
|
|
5314
|
-
*
|
|
5315
|
-
* independent of the referenced table style
|
|
5316
|
-
*
|
|
5317
|
-
*
|
|
5618
|
+
* `a:tblPr`'s own `a:effectLst` (or `a:effectDag`) effect chain,
|
|
5619
|
+
* independent of the referenced table style, decomposed into a typed
|
|
5620
|
+
* sequence of {@link ParsedTableStyleEffect} nodes (issue G6). Each node
|
|
5621
|
+
* keeps its own XML verbatim for lossless round-trip; empty array is
|
|
5622
|
+
* normalised to `undefined` by the parser so `tableEffects` is only ever
|
|
5623
|
+
* present when there is at least one effect.
|
|
5318
5624
|
*/
|
|
5319
|
-
tableEffects?:
|
|
5625
|
+
tableEffects?: ParsedTableStyleEffect[];
|
|
5320
5626
|
}
|
|
5321
5627
|
/**
|
|
5322
5628
|
* A single fill reference within a table style section.
|
|
@@ -5492,13 +5798,20 @@ interface ParsedTableStyleBorders {
|
|
|
5492
5798
|
/**
|
|
5493
5799
|
* Table background style (CT_TableBackgroundStyle, ECMA-376 §21.1.3.7).
|
|
5494
5800
|
*
|
|
5495
|
-
* Corresponds to the `<a:tblBg>` child of `<a:tblStyle>`.
|
|
5496
|
-
*
|
|
5497
|
-
*
|
|
5801
|
+
* Corresponds to the `<a:tblBg>` child of `<a:tblStyle>`. Captures the
|
|
5802
|
+
* resolved scheme-fill colour, an unresolved style-matrix `a:fillRef`, and a
|
|
5803
|
+
* presence flag for effects (verbatim XML for the effect list is preserved
|
|
5804
|
+
* separately by the save path).
|
|
5498
5805
|
*/
|
|
5499
5806
|
interface ParsedTableBackground {
|
|
5500
5807
|
/** Solid fill (resolved from `a:fill > a:solidFill > a:schemeClr`). */
|
|
5501
5808
|
fill?: ParsedTableStyleFill;
|
|
5809
|
+
/**
|
|
5810
|
+
* Style-matrix fill reference (`<a:fillRef idx="N">...</a:fillRef>`),
|
|
5811
|
+
* mutually exclusive with {@link fill} (`a:fill` is the choice sibling of
|
|
5812
|
+
* `a:fillRef` in `CT_TableBackgroundStyle`).
|
|
5813
|
+
*/
|
|
5814
|
+
fillRef?: ParsedTableFillRef;
|
|
5502
5815
|
/** Has an `a:effectLst` child that should be round-tripped. */
|
|
5503
5816
|
hasEffectLst?: boolean;
|
|
5504
5817
|
}
|
|
@@ -5612,6 +5925,21 @@ interface PptxAccessibilityProperties {
|
|
|
5612
5925
|
*/
|
|
5613
5926
|
isDecorative?: boolean;
|
|
5614
5927
|
}
|
|
5928
|
+
/**
|
|
5929
|
+
* Accessibility description/title from `p:cNvPr/@descr` / `@title` on a
|
|
5930
|
+
* plain shape, text box or connector (`p:sp` / `p:cxnSp`). The same pair of
|
|
5931
|
+
* attributes already round-trips for a graphic frame (see
|
|
5932
|
+
* {@link TablePptxElement.altText}) and, `descr` only, for a picture
|
|
5933
|
+
* ({@link PptxImageProperties.altText}); this mixin extends it to the three
|
|
5934
|
+
* element kinds whose PowerPoint Alt Text pane data was previously dropped
|
|
5935
|
+
* on load because neither field existed on the model.
|
|
5936
|
+
*/
|
|
5937
|
+
interface PptxNonVisualDescription {
|
|
5938
|
+
/** `p:cNvPr/@descr`. */
|
|
5939
|
+
altText?: string;
|
|
5940
|
+
/** `p:cNvPr/@title`. */
|
|
5941
|
+
title?: string;
|
|
5942
|
+
}
|
|
5615
5943
|
/**
|
|
5616
5944
|
* `a:cNvPicPr/@preferRelativeResize` (issue G13), a picture-only non-visual
|
|
5617
5945
|
* property distinct from `a:picLocks`.
|
|
@@ -5644,7 +5972,7 @@ interface PptxPictureNonVisualProperties {
|
|
|
5644
5972
|
* // => satisfies TextPptxElement
|
|
5645
5973
|
* ```
|
|
5646
5974
|
*/
|
|
5647
|
-
interface TextPptxElement extends PptxElementBase, PptxTextProperties, PptxShapeProperties {
|
|
5975
|
+
interface TextPptxElement extends PptxElementBase, PptxTextProperties, PptxShapeProperties, PptxNonVisualDescription {
|
|
5648
5976
|
type: 'text';
|
|
5649
5977
|
}
|
|
5650
5978
|
/**
|
|
@@ -5662,7 +5990,7 @@ interface TextPptxElement extends PptxElementBase, PptxTextProperties, PptxShape
|
|
|
5662
5990
|
* // => satisfies ShapePptxElement
|
|
5663
5991
|
* ```
|
|
5664
5992
|
*/
|
|
5665
|
-
interface ShapePptxElement extends PptxElementBase, PptxTextProperties, PptxShapeProperties, PptxCustomPathProperties, PptxAccessibilityProperties {
|
|
5993
|
+
interface ShapePptxElement extends PptxElementBase, PptxTextProperties, PptxShapeProperties, PptxCustomPathProperties, PptxAccessibilityProperties, PptxNonVisualDescription {
|
|
5666
5994
|
type: 'shape';
|
|
5667
5995
|
}
|
|
5668
5996
|
/**
|
|
@@ -5684,7 +6012,7 @@ interface ShapePptxElement extends PptxElementBase, PptxTextProperties, PptxShap
|
|
|
5684
6012
|
* // => satisfies ConnectorPptxElement
|
|
5685
6013
|
* ```
|
|
5686
6014
|
*/
|
|
5687
|
-
interface ConnectorPptxElement extends PptxElementBase, PptxTextProperties, PptxShapeProperties {
|
|
6015
|
+
interface ConnectorPptxElement extends PptxElementBase, PptxTextProperties, PptxShapeProperties, PptxNonVisualDescription {
|
|
5688
6016
|
type: 'connector';
|
|
5689
6017
|
}
|
|
5690
6018
|
/**
|
|
@@ -5750,6 +6078,13 @@ interface TablePptxElement extends PptxElementBase {
|
|
|
5750
6078
|
type: 'table';
|
|
5751
6079
|
/** Parsed table cell data for editing. */
|
|
5752
6080
|
tableData?: PptxTableData;
|
|
6081
|
+
/**
|
|
6082
|
+
* Accessibility description from `p:nvGraphicFramePr/p:cNvPr/@descr`, the
|
|
6083
|
+
* same non-visual-properties attribute a picture's alt text comes from.
|
|
6084
|
+
*/
|
|
6085
|
+
altText?: string;
|
|
6086
|
+
/** Accessibility title from `p:nvGraphicFramePr/p:cNvPr/@title`. */
|
|
6087
|
+
title?: string;
|
|
5753
6088
|
/**
|
|
5754
6089
|
* Unrecognised extensions captured from `a:graphicData/a:extLst` so they
|
|
5755
6090
|
* round-trip losslessly. See {@link PptxGraphicFrameExtension}.
|
|
@@ -5765,6 +6100,10 @@ interface TablePptxElement extends PptxElementBase {
|
|
|
5765
6100
|
interface ChartPptxElement extends PptxElementBase {
|
|
5766
6101
|
type: 'chart';
|
|
5767
6102
|
chartData?: PptxChartData;
|
|
6103
|
+
/** Accessibility description from `p:nvGraphicFramePr/p:cNvPr/@descr`. */
|
|
6104
|
+
altText?: string;
|
|
6105
|
+
/** Accessibility title from `p:nvGraphicFramePr/p:cNvPr/@title`. */
|
|
6106
|
+
title?: string;
|
|
5768
6107
|
/** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
|
|
5769
6108
|
extensionXml?: PptxGraphicFrameExtension[];
|
|
5770
6109
|
}
|
|
@@ -5782,6 +6121,10 @@ interface ChartPptxElement extends PptxElementBase {
|
|
|
5782
6121
|
interface SmartArtPptxElement extends PptxElementBase {
|
|
5783
6122
|
type: 'smartArt';
|
|
5784
6123
|
smartArtData?: PptxSmartArtData;
|
|
6124
|
+
/** Accessibility description from `p:nvGraphicFramePr/p:cNvPr/@descr`. */
|
|
6125
|
+
altText?: string;
|
|
6126
|
+
/** Accessibility title from `p:nvGraphicFramePr/p:cNvPr/@title`. */
|
|
6127
|
+
title?: string;
|
|
5785
6128
|
/** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
|
|
5786
6129
|
extensionXml?: PptxGraphicFrameExtension[];
|
|
5787
6130
|
}
|
|
@@ -5868,6 +6211,10 @@ interface OlePptxElement extends PptxElementBase {
|
|
|
5868
6211
|
* `false`; `undefined` means the source authored no explicit value.
|
|
5869
6212
|
*/
|
|
5870
6213
|
oleUpdateAutomatic?: boolean;
|
|
6214
|
+
/** Accessibility description from `p:nvGraphicFramePr/p:cNvPr/@descr`. */
|
|
6215
|
+
altText?: string;
|
|
6216
|
+
/** Accessibility title from `p:nvGraphicFramePr/p:cNvPr/@title`. */
|
|
6217
|
+
title?: string;
|
|
5871
6218
|
/** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
|
|
5872
6219
|
extensionXml?: PptxGraphicFrameExtension[];
|
|
5873
6220
|
}
|
|
@@ -5959,6 +6306,15 @@ interface MediaPptxElement extends PptxElementBase {
|
|
|
5959
6306
|
* (`r:embed`). Defaults to embedded when undefined.
|
|
5960
6307
|
*/
|
|
5961
6308
|
isLinked?: boolean;
|
|
6309
|
+
/**
|
|
6310
|
+
* Accessibility description from `p:nvGraphicFramePr/p:cNvPr/@descr`.
|
|
6311
|
+
* Only populated for the `p:graphicFrame`-shaped (SDK-created) media
|
|
6312
|
+
* form; a `p:pic`-shaped media element's alt text is not currently
|
|
6313
|
+
* parsed (see `PptxHandlerRuntimePictureParsing.ts`).
|
|
6314
|
+
*/
|
|
6315
|
+
altText?: string;
|
|
6316
|
+
/** Accessibility title from `p:nvGraphicFramePr/p:cNvPr/@title`. Same scope note as {@link altText}. */
|
|
6317
|
+
title?: string;
|
|
5962
6318
|
/** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
|
|
5963
6319
|
extensionXml?: PptxGraphicFrameExtension[];
|
|
5964
6320
|
}
|
|
@@ -6465,7 +6821,20 @@ interface PptxAnimationGraphicElementTarget {
|
|
|
6465
6821
|
seriesIdx?: number;
|
|
6466
6822
|
/** `@_categoryIdx`, 0-based category index, when the target is category-scoped. */
|
|
6467
6823
|
categoryIdx?: number;
|
|
6468
|
-
/**
|
|
6824
|
+
/**
|
|
6825
|
+
* `p:dgm/@_id` (CT_TLBuildDiagram, ECMA-376 S19.5.10): the diagram DATA MODEL
|
|
6826
|
+
* point id (`dgm:pt/@modelId`) this per-stage effect reveals, when a
|
|
6827
|
+
* `p:bldDgm` build authors one effect per node instead of a single staged
|
|
6828
|
+
* reveal. `dgm`-kind targets only; a `chart`-kind target never carries this.
|
|
6829
|
+
* Matches `PptxSmartArtNode.id` (parsed from the same `@modelId`), so a
|
|
6830
|
+
* diagram renderer can reveal the exact authored node.
|
|
6831
|
+
*/
|
|
6832
|
+
id?: string;
|
|
6833
|
+
/**
|
|
6834
|
+
* `@_bldStep`: `ST_TLChartBuildStep` (`category` / `categoryEl` / `series` /
|
|
6835
|
+
* `seriesEl`) for a `chart`-kind target, or `ST_TLDiagramBuildStep`
|
|
6836
|
+
* (`sp` / `bg`) for a `dgm`-kind target.
|
|
6837
|
+
*/
|
|
6469
6838
|
bldStep?: string;
|
|
6470
6839
|
}
|
|
6471
6840
|
/**
|
|
@@ -6915,6 +7284,34 @@ interface PptxNativeAnimation {
|
|
|
6915
7284
|
* `childStyle`, a legacy compatibility hint. Round-tripped only.
|
|
6916
7285
|
*/
|
|
6917
7286
|
cBhvrOverride?: 'normal' | 'childStyle';
|
|
7287
|
+
/**
|
|
7288
|
+
* `p:set` discrete attribute assignments composed alongside this effect
|
|
7289
|
+
* (ECMA-376 S19.5.79 CT_TLSetBehavior): an instantaneous (non-interpolated)
|
|
7290
|
+
* value change, as opposed to {@link attributeAnimations}'s `p:anim`
|
|
7291
|
+
* keyframe ramps. PowerPoint authors several font-style emphasis effects
|
|
7292
|
+
* this way (Bold Reveal, Underline, Bold Flash, Change Font Size), since
|
|
7293
|
+
* "on/off" or "size N" has nothing to interpolate. Not yet consulted by
|
|
7294
|
+
* shared playback (round-trip/typed-model only so far).
|
|
7295
|
+
*/
|
|
7296
|
+
setAnimations?: PptxSetAnimation[];
|
|
7297
|
+
}
|
|
7298
|
+
/**
|
|
7299
|
+
* One `p:set` discrete (non-interpolated) attribute assignment composed
|
|
7300
|
+
* alongside an authored effect. See {@link PptxNativeAnimation.setAnimations}.
|
|
7301
|
+
*
|
|
7302
|
+
* @see ECMA-376 S19.5.79 CT_TLSetBehavior
|
|
7303
|
+
*/
|
|
7304
|
+
interface PptxSetAnimation {
|
|
7305
|
+
/** Lowercased target attribute from `p:cBhvr/p:attrNameLst/p:attrName`. */
|
|
7306
|
+
attrName: string;
|
|
7307
|
+
/** Decoded value from `p:to` (same variant shape as a `p:tav/p:val`). */
|
|
7308
|
+
value: string | boolean | number;
|
|
7309
|
+
/** Discriminant indicating which `p:to` child carried the value. */
|
|
7310
|
+
valueType: 'str' | 'bool' | 'int' | 'flt' | 'clr';
|
|
7311
|
+
/** Duration from this behaviour's nested `p:cTn/@dur`. */
|
|
7312
|
+
durationMs?: number;
|
|
7313
|
+
/** Start offset from this behaviour's nested `p:stCondLst`. */
|
|
7314
|
+
delayMs?: number;
|
|
6918
7315
|
}
|
|
6919
7316
|
/**
|
|
6920
7317
|
* Parsed `p:animEffect/@filter` (+ `@transition`) descriptor. ECMA-376
|
|
@@ -7182,6 +7579,16 @@ interface PptxElementAnimation {
|
|
|
7182
7579
|
* OOXML equivalent and is not required for playback.
|
|
7183
7580
|
*/
|
|
7184
7581
|
soundFileName?: string;
|
|
7582
|
+
/**
|
|
7583
|
+
* Per-build-level timing template(s) from the {@link sequence}'s own
|
|
7584
|
+
* `p:bldP/p:tmplLst` (ECMA-376 §19.5.84), carried over from the loaded
|
|
7585
|
+
* `PptxNativeAnimation.buildTemplates` this element animation was derived
|
|
7586
|
+
* from so a full timing-tree rebuild (`PptxAnimationWriteService`'s
|
|
7587
|
+
* `buildTimingXml`, when the slide had no prior `p:timing`) can re-emit
|
|
7588
|
+
* them instead of silently dropping the deck's authored per-level
|
|
7589
|
+
* defaults. Absent when {@link sequence} carries no such template.
|
|
7590
|
+
*/
|
|
7591
|
+
buildTemplates?: PptxTimingTemplate[];
|
|
7185
7592
|
}
|
|
7186
7593
|
/**
|
|
7187
7594
|
* A read-only anchor representing one of the deck's own effect groups: a
|
|
@@ -8098,6 +8505,22 @@ interface PptxActiveXControl {
|
|
|
8098
8505
|
name?: string;
|
|
8099
8506
|
/** Shape ID this control is linked to (from @spid). */
|
|
8100
8507
|
shapeId?: string;
|
|
8508
|
+
/**
|
|
8509
|
+
* `p:control/@showAsIcon` (CT_Control, ECMA-376 S19.3.1.2): whether the
|
|
8510
|
+
* control renders as its static icon rather than its live appearance.
|
|
8511
|
+
* `undefined` when the source authored no explicit value (schema default
|
|
8512
|
+
* `false`).
|
|
8513
|
+
*/
|
|
8514
|
+
showAsIcon?: boolean;
|
|
8515
|
+
/**
|
|
8516
|
+
* `p:control/@imgW` in EMU (ST_PositiveCoordinate32): the width the host
|
|
8517
|
+
* reserves for the control's icon/preview image. Distinct from
|
|
8518
|
+
* {@link width}, which is the fallback `p:pic`'s own `a:ext/@cx` in px;
|
|
8519
|
+
* `imgW`/`imgH` are direct attributes on `p:control` itself.
|
|
8520
|
+
*/
|
|
8521
|
+
imgWidthEmu?: number;
|
|
8522
|
+
/** `p:control/@imgH` in EMU (ST_PositiveCoordinate32). @see imgWidthEmu */
|
|
8523
|
+
imgHeightEmu?: number;
|
|
8101
8524
|
/** X position (px) of the control's fallback picture, if present. */
|
|
8102
8525
|
x?: number;
|
|
8103
8526
|
/** Y position (px) of the control's fallback picture, if present. */
|
|
@@ -8554,6 +8977,34 @@ interface PptxPhotoAlbum {
|
|
|
8554
8977
|
layout?: string;
|
|
8555
8978
|
/** Frame style applied to each photo (e.g. "frameStyle1"). */
|
|
8556
8979
|
frame?: string;
|
|
8980
|
+
/**
|
|
8981
|
+
* `p:photoAlbum/@isPhoto` (ECMA-376 S19.2.1.27, CT_PhotoAlbum): whether
|
|
8982
|
+
* the pictures placed by the album wizard are real photographs, as
|
|
8983
|
+
* opposed to clip art or other embedded images. `undefined` when the
|
|
8984
|
+
* source authored no explicit value (schema default `false`); this is a
|
|
8985
|
+
* purely declarative wizard-provenance flag, not something this library
|
|
8986
|
+
* gates any layout/frame behaviour on.
|
|
8987
|
+
*/
|
|
8988
|
+
isPhoto?: boolean;
|
|
8989
|
+
}
|
|
8990
|
+
/**
|
|
8991
|
+
* A recognizer-owned `p:smartTags` reference from `presentation.xml`
|
|
8992
|
+
* (CT_SmartTags, ECMA-376 S19.2.1.42): a bare relationship id pointing at a
|
|
8993
|
+
* legacy Office "Smart Tags" recognizer part, distinct from the
|
|
8994
|
+
* user-authored `p:tags` construct (see {@link PptxTagCollection}).
|
|
8995
|
+
*
|
|
8996
|
+
* This library has no data model for recognizer part CONTENT (there is no
|
|
8997
|
+
* way to create, inspect, or edit one through the public API), so this type
|
|
8998
|
+
* only captures enough to preserve an authored reference losslessly: the
|
|
8999
|
+
* relationship id and, when resolvable, the target part path.
|
|
9000
|
+
*/
|
|
9001
|
+
interface PptxSmartTagsReference {
|
|
9002
|
+
/** Relationship id from `p:smartTags/@r:id`. */
|
|
9003
|
+
relId: string;
|
|
9004
|
+
/** Resolved ZIP path of the referenced recognizer part, when resolvable. */
|
|
9005
|
+
targetPath?: string;
|
|
9006
|
+
/** Raw `p:smartTags` XML retained for lossless round-trip. */
|
|
9007
|
+
rawXml?: XmlObject;
|
|
8557
9008
|
}
|
|
8558
9009
|
/**
|
|
8559
9010
|
* East Asian line-break (kinsoku) settings from `p:kinsoku` in `presentation.xml`.
|
|
@@ -8618,6 +9069,13 @@ interface PptxData {
|
|
|
8618
9069
|
themeOptions?: PptxThemeOption[];
|
|
8619
9070
|
/** Parsed table style definitions from `ppt/tableStyles.xml`. */
|
|
8620
9071
|
tableStyleMap?: ParsedTableStyleMap;
|
|
9072
|
+
/**
|
|
9073
|
+
* The current default table style GUID (`ppt/tableStyles.xml`'s
|
|
9074
|
+
* `a:tblStyleLst/@def`): the style PowerPoint applies to a newly inserted
|
|
9075
|
+
* table. Matches `PptxSaveOptions.tableStylesDefaultId` so a save call
|
|
9076
|
+
* that omits it can fall back to what was loaded.
|
|
9077
|
+
*/
|
|
9078
|
+
tableStylesDefaultId?: string;
|
|
8621
9079
|
/** Whether the presentation is password-protected. */
|
|
8622
9080
|
isPasswordProtected?: boolean;
|
|
8623
9081
|
/** Embedded font data (name + binary data URL) extracted from the presentation. */
|
|
@@ -8677,6 +9135,14 @@ interface PptxData {
|
|
|
8677
9135
|
modifyVerifier?: PptxModifyVerifier;
|
|
8678
9136
|
/** Photo album metadata from `p:photoAlbum` in `presentation.xml`. */
|
|
8679
9137
|
photoAlbum?: PptxPhotoAlbum;
|
|
9138
|
+
/**
|
|
9139
|
+
* Legacy Smart Tags recognizer reference from `p:smartTags` in
|
|
9140
|
+
* `presentation.xml`. Read-only: there is no data model for the
|
|
9141
|
+
* recognizer part's own content, so this exists to make the reference
|
|
9142
|
+
* inspectable and to prove it survives a save (the owning part and its
|
|
9143
|
+
* relationship are preserved passively, like any other unmodelled part).
|
|
9144
|
+
*/
|
|
9145
|
+
smartTags?: PptxSmartTagsReference;
|
|
8680
9146
|
/** East Asian line-break settings from `p:kinsoku` in `presentation.xml`. */
|
|
8681
9147
|
kinsoku?: PptxKinsoku;
|
|
8682
9148
|
/** Custom XML data parts from `customXml/` in the OPC package. */
|
|
@@ -8841,6 +9307,14 @@ type FillInput = {
|
|
|
8841
9307
|
type: 'solid';
|
|
8842
9308
|
color: string;
|
|
8843
9309
|
opacity?: number;
|
|
9310
|
+
/**
|
|
9311
|
+
* A theme colour to use instead of a plain hex. When set, the shape
|
|
9312
|
+
* saves as `<a:schemeClr>` (e.g. `{ scheme: 'accent1', lumMod: 0.8 }`
|
|
9313
|
+
* for "Accent 1, Lighter 80%") so it keeps following the theme after a
|
|
9314
|
+
* later theme change; `color` still supplies the immediate resolved
|
|
9315
|
+
* hex for renderers that read it directly.
|
|
9316
|
+
*/
|
|
9317
|
+
themeColorRef?: PptxThemeColorRef;
|
|
8844
9318
|
} | {
|
|
8845
9319
|
type: 'gradient';
|
|
8846
9320
|
/**
|
|
@@ -8876,6 +9350,8 @@ interface StrokeInput {
|
|
|
8876
9350
|
opacity?: number;
|
|
8877
9351
|
join?: 'round' | 'bevel' | 'miter';
|
|
8878
9352
|
cap?: 'flat' | 'rnd' | 'sq';
|
|
9353
|
+
/** A theme colour for the outline; see {@link FillInput}'s `themeColorRef`. */
|
|
9354
|
+
themeColorRef?: PptxThemeColorRef;
|
|
8879
9355
|
}
|
|
8880
9356
|
interface ShadowInput {
|
|
8881
9357
|
color?: string;
|
|
@@ -8892,6 +9368,8 @@ interface TextStyleInput {
|
|
|
8892
9368
|
underline?: boolean;
|
|
8893
9369
|
strikethrough?: boolean;
|
|
8894
9370
|
color?: string;
|
|
9371
|
+
/** A theme colour for the run; see {@link FillInput}'s `themeColorRef`. */
|
|
9372
|
+
themeColorRef?: PptxThemeColorRef;
|
|
8895
9373
|
alignment?: 'left' | 'center' | 'right' | 'justify';
|
|
8896
9374
|
verticalAlignment?: 'top' | 'middle' | 'bottom';
|
|
8897
9375
|
lineSpacing?: number;
|
|
@@ -9519,6 +9997,24 @@ interface PptxHandlerSaveOptions {
|
|
|
9519
9997
|
* part untouched.
|
|
9520
9998
|
*/
|
|
9521
9999
|
tableStyles?: ParsedTableStyleMap;
|
|
10000
|
+
/**
|
|
10001
|
+
* Set `ppt/tableStyles.xml`'s `<a:tblStyleLst @def>` to this style GUID
|
|
10002
|
+
* (normalised to uppercase-with-braces). `undefined` preserves the
|
|
10003
|
+
* existing default; there is no removal form (`@def` is required by the
|
|
10004
|
+
* schema and PowerPoint always points it at a real style). No-op when the
|
|
10005
|
+
* archive has no `ppt/tableStyles.xml`, same as {@link tableStyles}.
|
|
10006
|
+
*/
|
|
10007
|
+
tableStylesDefaultId?: string;
|
|
10008
|
+
/**
|
|
10009
|
+
* Style GUIDs to remove from `ppt/tableStyles.xml` entirely, kept as a
|
|
10010
|
+
* separate opt-in list rather than inferred from omission on
|
|
10011
|
+
* {@link tableStyles}: that map is documented as safe to pass a PARTIAL
|
|
10012
|
+
* edit (only the entries a caller actually touched), so treating every
|
|
10013
|
+
* GUID missing from it as "delete this" would silently destroy untouched
|
|
10014
|
+
* styles on an ordinary targeted edit. A GUID here that is also the
|
|
10015
|
+
* current (or newly requested) default is left in place and skipped.
|
|
10016
|
+
*/
|
|
10017
|
+
tableStylesToDelete?: string[];
|
|
9522
10018
|
/**
|
|
9523
10019
|
* Target output format.
|
|
9524
10020
|
* - `'pptx'` (default): Standard presentation.
|