pptx-vanilla-viewer 2.6.0 → 2.7.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/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import "jszip";
3
3
  import { ChatTransport, LanguageModel, ToolSet, UIMessage } from "ai";
4
4
  import "pptx-viewer-mcp";
5
5
  import { Options } from "html2canvas-pro";
6
- //#region ../core/dist/text-operations-BB__gyrk.d.ts
6
+ //#region ../core/dist/text-operations-Duo3PfvM.d.ts
7
7
  //#region src/core/types/actions.d.ts
8
8
  /**
9
9
  * Action types: hyperlinks, slide jumps, macros, and action buttons.
@@ -639,6 +639,44 @@ interface PptxCustomPathProperties {
639
639
  customGeometryTextRect?: CustomGeometryTextRect;
640
640
  }
641
641
  //#endregion
642
+ //#region src/core/types/color-ref.d.ts
643
+ /**
644
+ * Theme colour references: the typed counterpart of `<a:schemeClr>`.
645
+ *
646
+ * A colour picked from the theme palette is remembered as a scheme slot plus
647
+ * PowerPoint's luminance variants rather than as the sRGB it currently
648
+ * resolves to, so a later theme change re-colours the shape (and a saved file
649
+ * keeps `<a:schemeClr>` instead of a canonical `<a:srgbClr>`).
650
+ *
651
+ * @module types/color-ref
652
+ */
653
+ /**
654
+ * The scheme slot names `a:schemeClr/@val` accepts (ECMA-376 `ST_SchemeColorIndex`).
655
+ * `bg1`/`tx1`/`bg2`/`tx2` are the colour-map aliases a slide resolves through
656
+ * `p:clrMap`; `phClr` is the placeholder colour used inside a theme's style
657
+ * matrix and is never chosen from a picker.
658
+ */
659
+ type PptxThemeColorSchemeName = 'dk1' | 'lt1' | 'dk2' | 'lt2' | 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'accent5' | 'accent6' | 'hlink' | 'folHlink' | 'bg1' | 'tx1' | 'bg2' | 'tx2' | 'phClr';
660
+ /**
661
+ * A theme colour choice. Every transform is a 0..1 fraction of the OOXML
662
+ * percentage (`lumMod val="20000"` is `lumMod: 0.2`), matching how the parser
663
+ * reads them, and is applied in the order `a:schemeClr` children are written:
664
+ * `tint`, `shade`, `lumMod`, `lumOff`, `alpha`.
665
+ */
666
+ interface PptxThemeColorRef {
667
+ scheme: PptxThemeColorSchemeName;
668
+ /** `a:lumMod`: multiply HSL luminance (PowerPoint's "Lighter/Darker" rows). */
669
+ lumMod?: number;
670
+ /** `a:lumOff`: add to HSL luminance after `lumMod` ("Lighter N%" rows). */
671
+ lumOff?: number;
672
+ /** `a:tint`: blend towards white. */
673
+ tint?: number;
674
+ /** `a:shade`: blend towards black. */
675
+ shade?: number;
676
+ /** `a:alpha`: opacity fraction (1 = opaque). */
677
+ alpha?: number;
678
+ }
679
+ //#endregion
642
680
  //#region src/core/types/effect-dag.d.ts
643
681
  type EffectDagBlendMode = 'darken' | 'lighten' | 'mult' | 'over' | 'screen';
644
682
  type EffectDagContainerType = 'sib' | 'tree';
@@ -928,6 +966,15 @@ interface ShapeStyle {
928
966
  * back to canonical `<a:srgbClr>`.
929
967
  */
930
968
  fillColorXml?: XmlObject;
969
+ /**
970
+ * Typed theme colour reference for the fill, set when {@link fillColorXml}
971
+ * is a plain `a:schemeClr` (see `themeColorRefFromColorChoice`). When
972
+ * present it WINS on save: the writer emits `<a:schemeClr>` from this ref
973
+ * instead of the resolved {@link fillColor}, so the fill keeps following
974
+ * the theme palette after a later theme change. `undefined` means the fill
975
+ * is a plain hex (or a colour kind a ref cannot express).
976
+ */
977
+ fillColorRef?: PptxThemeColorRef;
931
978
  fillGradient?: string;
932
979
  /** Original `gradFill` XML retained for unknown-child and extension round-tripping. */
933
980
  fillGradientXml?: XmlObject;
@@ -962,6 +1009,12 @@ interface ShapeStyle {
962
1009
  opacity?: number;
963
1010
  /** Raw XML colour node preserved for round-trip (e.g. a:schemeClr with transforms). */
964
1011
  originalColorXml?: XmlObject;
1012
+ /**
1013
+ * Typed theme colour reference for this stop, set when
1014
+ * {@link originalColorXml} is a plain `a:schemeClr`. Wins on save, same
1015
+ * as {@link ShapeStyle.fillColorRef}.
1016
+ */
1017
+ colorRef?: PptxThemeColorRef;
965
1018
  }>;
966
1019
  fillGradientAngle?: number;
967
1020
  fillGradientType?: 'linear' | 'radial';
@@ -1008,6 +1061,12 @@ interface ShapeStyle {
1008
1061
  * round-trip serialisation. See {@link fillColorXml} for the rationale.
1009
1062
  */
1010
1063
  strokeColorXml?: XmlObject;
1064
+ /**
1065
+ * Typed theme colour reference for the outline, mirroring
1066
+ * {@link fillColorRef}: set when {@link strokeColorXml} is a plain
1067
+ * `a:schemeClr`, and wins on save.
1068
+ */
1069
+ strokeColorRef?: PptxThemeColorRef;
1011
1070
  /**
1012
1071
  * Kind of fill painted on the outline (`a:ln` child). Distinguishes a solid
1013
1072
  * outline from a gradient/pattern/none outline so save can emit the correct
@@ -1511,6 +1570,15 @@ interface TextStyle {
1511
1570
  * verbatim when the resolved {@link color} still matches this node.
1512
1571
  */
1513
1572
  colorXml?: XmlObject;
1573
+ /**
1574
+ * Typed theme colour reference for the run's text colour, set when
1575
+ * {@link colorXml} is a plain `a:schemeClr` (see
1576
+ * `themeColorRefFromColorChoice`). When present it WINS on save: the
1577
+ * writer emits `<a:schemeClr>` from this ref instead of the resolved
1578
+ * {@link color}, so the text keeps following the theme palette after a
1579
+ * later theme change.
1580
+ */
1581
+ colorRef?: PptxThemeColorRef;
1514
1582
  align?: 'left' | 'center' | 'right' | 'justify' | 'justLow' | 'dist' | 'thaiDist';
1515
1583
  /**
1516
1584
  * Vertical text-box anchor (`a:bodyPr/@anchor`, `ST_TextAnchoringType`).
@@ -1936,6 +2004,12 @@ interface BulletInfo {
1936
2004
  * identity rather than being flattened to `<a:srgbClr/>` on save.
1937
2005
  */
1938
2006
  colorXml?: XmlObject;
2007
+ /**
2008
+ * Typed theme colour reference for the bullet colour, set when
2009
+ * {@link colorXml} is a plain `a:schemeClr`. Wins on save, same as
2010
+ * {@link TextStyle.colorRef}.
2011
+ */
2012
+ colorRef?: PptxThemeColorRef;
1939
2013
  /** True when `a:buNone` explicitly suppresses bullets. */
1940
2014
  none?: boolean;
1941
2015
  /** Picture bullet: relationship ID from `a:buBlip` → `a:blip[@r:embed]`. */
@@ -2547,6 +2621,39 @@ interface PptxChartStyleDefinition {
2547
2621
  plotArea?: PptxChartStylePartEntry;
2548
2622
  }
2549
2623
  //#endregion
2624
+ //#region src/core/types/chart-title.d.ts
2625
+ /**
2626
+ * Chart title rich-text run type, split out of `types/chart.ts` (already at
2627
+ * the repo's file-size limit) to keep that module from growing further.
2628
+ *
2629
+ * @module pptx-types/chart-title
2630
+ */
2631
+ /**
2632
+ * One run of a chart title's rich text (`c:title/c:tx/c:rich/a:p/a:r`).
2633
+ *
2634
+ * The flat `PptxChartData.title` field only ever captured the FIRST run's
2635
+ * text with no per-run formatting; `titleRuns` (when present) is the
2636
+ * lossless, multi-run replacement parsed from the same `c:rich` body. Absent
2637
+ * when the title has no rich text at all (an empty/auto title, or one
2638
+ * authored as a linked-cell reference).
2639
+ */
2640
+ interface PptxChartTitleRun {
2641
+ /** This run's text (`a:t`). */
2642
+ text: string;
2643
+ /** `a:rPr/@_b`. */
2644
+ bold?: boolean;
2645
+ /** `a:rPr/@_i`. */
2646
+ italic?: boolean;
2647
+ /**
2648
+ * Font size in POINTS (`a:rPr/@_sz`, hundredths of a point / 100), matching
2649
+ * `PptxChartLegendTextStyle.fontSize`'s convention rather than the pixel
2650
+ * convention `TextStyle.fontSize` uses for slide text.
2651
+ */
2652
+ fontSize?: number;
2653
+ /** Resolved hex colour (e.g. `"#FF0000"`) from `a:rPr/a:solidFill`. */
2654
+ color?: string;
2655
+ }
2656
+ //#endregion
2550
2657
  //#region src/core/types/chart-user-shapes.d.ts
2551
2658
  /**
2552
2659
  * Types for chart drawing-overlay shapes (`c:userShapes`).
@@ -2695,6 +2802,10 @@ interface PptxChartTrendline {
2695
2802
  displayRSq?: boolean;
2696
2803
  displayEq?: boolean;
2697
2804
  color?: string;
2805
+ /** Trendline width in points (`c:trendline/c:spPr/a:ln/@w`, EMU / 12700). */
2806
+ lineWidth?: number;
2807
+ /** Trendline dash style (`c:trendline/c:spPr/a:ln/a:prstDash/@val`). */
2808
+ lineDashStyle?: string;
2698
2809
  label?: PptxChartTrendlineLabel | null;
2699
2810
  }
2700
2811
  /** Typed, commonly edited properties of `c:trendlineLbl`. */
@@ -2740,6 +2851,10 @@ interface PptxChartErrBars {
2740
2851
  customMinus?: number[];
2741
2852
  noEndCap?: boolean;
2742
2853
  color?: string;
2854
+ /** Error-bar line width in points (`c:errBars/c:spPr/a:ln/@w`, EMU / 12700). */
2855
+ width?: number;
2856
+ /** Error-bar line dash style (`c:errBars/c:spPr/a:ln/a:prstDash/@val`). */
2857
+ dashStyle?: string;
2743
2858
  }
2744
2859
  /**
2745
2860
  * Visibility flags for the chart data table (axes + legend keys).
@@ -2866,6 +2981,12 @@ interface PptxChartDataLabel {
2866
2981
  * `.../a:p/a:pPr/a:defRPr` default-run-property style.
2867
2982
  */
2868
2983
  txPr?: PptxChartLegendTextStyle;
2984
+ /**
2985
+ * This label's own shape formatting (`c:dLbl/c:spPr`): fill/line colour,
2986
+ * width, and dash style for the label's callout box, taking precedence
2987
+ * over any chart/series-level default when set.
2988
+ */
2989
+ spPr?: PptxChartShapeProps;
2869
2990
  }
2870
2991
  /** Axis number format. */
2871
2992
  interface PptxChartAxisNumFmt {
@@ -3429,6 +3550,16 @@ interface PptxChartDateCategories {
3429
3550
  */
3430
3551
  interface PptxChartData {
3431
3552
  title?: string;
3553
+ /**
3554
+ * Rich-text runs of the title, parsed from `c:title/c:tx/c:rich` (issue:
3555
+ * chart title rich text). Lossless multi-run alternative to the flat
3556
+ * {@link title}: when present, the writer serialises every run's own
3557
+ * bold/italic/size/color; when absent, save falls back to the flat
3558
+ * `title` path as before. Only populated for a classic (`c:`) chart's
3559
+ * rich (typed) title, not a ChartEx (`cx:`) title or one authored as a
3560
+ * linked-cell reference.
3561
+ */
3562
+ titleRuns?: PptxChartTitleRun[];
3432
3563
  chartType: PptxChartType;
3433
3564
  categories: string[];
3434
3565
  /**
@@ -3520,8 +3651,10 @@ interface PptxChartData {
3520
3651
  chartRelationshipId?: string;
3521
3652
  /** `null` explicitly removes an existing ChartML data table. */
3522
3653
  dataTable?: PptxChartDataTable | null;
3523
- dropLines?: PptxChartLineStyle;
3524
- hiLowLines?: PptxChartLineStyle;
3654
+ /** `null` explicitly removes an existing `c:dropLines` element. */
3655
+ dropLines?: PptxChartLineStyle | null;
3656
+ /** `null` explicitly removes an existing `c:hiLowLines` element. */
3657
+ hiLowLines?: PptxChartLineStyle | null;
3525
3658
  /** `null` explicitly removes an existing up/down-bars container. */
3526
3659
  upDownBars?: PptxChartUpDownBars | null;
3527
3660
  axes?: PptxChartAxisFormatting[];
@@ -3636,10 +3769,13 @@ interface PptxChartData {
3636
3769
  pivotFormats?: PptxChartPivotFormats | null;
3637
3770
  /**
3638
3771
  * Color-map override (`c:clrMapOvr`) carrying 12 attributes that
3639
- * remap theme colour roles for this chart only. Preserved as a flat
3640
- * `attribute value` map for round-trip fidelity.
3772
+ * remap theme colour roles for this chart only. Modeled as a flat
3773
+ * `attribute -> value` map (e.g. `{ bg1: 'lt1', accent1: 'accent2' }`)
3774
+ * so unknown/future attributes round-trip without code changes.
3775
+ * `null` explicitly removes an existing `c:clrMapOvr`; an empty object
3776
+ * is treated the same as `null` on save.
3641
3777
  */
3642
- clrMapOvr?: Record<string, string>;
3778
+ clrMapOvr?: Record<string, string> | null;
3643
3779
  /**
3644
3780
  * Whether the chart's own cached numeric values use the 1904 date epoch
3645
3781
  * (`c:chartSpace/c:date1904/@val`). Independent of, and authoritative over,
@@ -5016,13 +5152,55 @@ interface PptxSmartArtData {
5016
5152
  drawingDirty?: boolean;
5017
5153
  }
5018
5154
  //#endregion
5019
- //#region src/core/types/table.d.ts
5155
+ //#region src/core/types/table-style-edit.d.ts
5020
5156
  /**
5021
- * Table types: cell styling, cell data, rows, table data, and the parsed
5022
- * table style map from `ppt/tableStyles.xml`.
5157
+ * A `a:fillRef`/`a:lnRef`/`a:effectRef`-style style-matrix reference: an
5158
+ * index into the theme's format scheme (`a:fmtScheme/a:fillStyleLst`, 1-based
5159
+ * per ECMA-376 §20.1.4.1.12) plus an optional colour transform child.
5160
+ *
5161
+ * Distinct from an already-resolved {@link ParsedTableStyleFill}: a fill ref
5162
+ * points AT a theme style-matrix entry rather than carrying a colour choice
5163
+ * directly, though the two commonly appear together (`<a:fillRef idx="2">
5164
+ * <a:schemeClr val="accent1"/></a:fillRef>`).
5023
5165
  *
5024
- * @module pptx-types/table
5166
+ * @example
5167
+ * ```ts
5168
+ * const ref: ParsedTableFillRef = { idx: 2, color: { schemeColor: 'accent1' } };
5169
+ * // => satisfies ParsedTableFillRef
5170
+ * ```
5025
5171
  */
5172
+ interface ParsedTableFillRef {
5173
+ /** 1-based index into the theme format scheme's fill style list. */
5174
+ idx: number;
5175
+ /** Colour transform child (`a:schemeClr`/`a:srgbClr`) applied to the referenced style. */
5176
+ color?: ParsedTableStyleFill;
5177
+ }
5178
+ /**
5179
+ * One leaf (or `effectDag`-wrapped) node of an `a:effectLst`/`a:effectDag`
5180
+ * effect chain, kept mostly opaque: {@link kind} names the OOXML element so a
5181
+ * consumer can recognise common effects (`outerShdw`, `glow`, `softEdge`,
5182
+ * `reflection`, `blur`, `innerShdw`, `prstShdw`, `fillOverlay`, `alphaModFix`,
5183
+ * `alphaInv`, `grayscl`, `biLevel`, `duotone`, `hsl`, `lum`, `tint`) without
5184
+ * this module re-deriving the full shape-effect taxonomy already modelled on
5185
+ * `ShapeStyle`; {@link xml} preserves the node verbatim for lossless re-emit.
5186
+ *
5187
+ * @example
5188
+ * ```ts
5189
+ * const effect: ParsedTableStyleEffect = {
5190
+ * kind: 'outerShdw',
5191
+ * xml: { '@_blurRad': '40000', '@_dist': '20000', '@_dir': '5400000' },
5192
+ * };
5193
+ * // => satisfies ParsedTableStyleEffect
5194
+ * ```
5195
+ */
5196
+ interface ParsedTableStyleEffect {
5197
+ /** The OOXML element's local name, e.g. `outerShdw`, `glow`, `softEdge`. */
5198
+ kind: string;
5199
+ /** Verbatim XML node (attributes + children) for lossless round-trip. */
5200
+ xml: XmlObject;
5201
+ }
5202
+ //#endregion
5203
+ //#region src/core/types/table.d.ts
5026
5204
  /**
5027
5205
  * Per-cell visual style for a table cell.
5028
5206
  *
@@ -5059,6 +5237,14 @@ interface PptxTableCellStyle {
5059
5237
  * future expansion alongside the run-properties round-trip path.
5060
5238
  */
5061
5239
  colorXml?: XmlObject;
5240
+ /**
5241
+ * Typed theme colour reference for the cell text colour, set when
5242
+ * {@link colorXml} is a plain `a:schemeClr`. Wins on save, mirroring
5243
+ * `TextStyle.colorRef`. Distinct from {@link ParsedTableStyleFill.schemeColor},
5244
+ * which describes a `ppt/tableStyles.xml` section fill rather than an
5245
+ * individual cell override.
5246
+ */
5247
+ colorRef?: PptxThemeColorRef;
5062
5248
  backgroundColor?: string;
5063
5249
  /**
5064
5250
  * Raw XML colour-choice node preserved from cell `a:tcPr/a:solidFill` for
@@ -5066,6 +5252,12 @@ interface PptxTableCellStyle {
5066
5252
  * {@link backgroundColor} still matches the original colour.
5067
5253
  */
5068
5254
  backgroundColorXml?: XmlObject;
5255
+ /**
5256
+ * Typed theme colour reference for the cell fill, set when
5257
+ * {@link backgroundColorXml} is a plain `a:schemeClr`. Wins on save,
5258
+ * mirroring `ShapeStyle.fillColorRef`.
5259
+ */
5260
+ backgroundColorRef?: PptxThemeColorRef;
5069
5261
  borderColor?: string;
5070
5262
  /** Top border width in px. */
5071
5263
  borderTopWidth?: number;
@@ -5379,12 +5571,14 @@ interface PptxTableData {
5379
5571
  */
5380
5572
  tableFill?: ParsedTableStyleFill;
5381
5573
  /**
5382
- * Whether `a:tblPr` carries its own `a:effectLst`/`a:effectDag`,
5383
- * independent of the referenced table style. Presence-only: the concrete
5384
- * effect is not yet rendered, and the raw XML round-trips separately via
5385
- * whatever preserves `a:tblPr`'s unrecognised children (issue G6).
5574
+ * `a:tblPr`'s own `a:effectLst` (or `a:effectDag`) effect chain,
5575
+ * independent of the referenced table style, decomposed into a typed
5576
+ * sequence of {@link ParsedTableStyleEffect} nodes (issue G6). Each node
5577
+ * keeps its own XML verbatim for lossless round-trip; empty array is
5578
+ * normalised to `undefined` by the parser so `tableEffects` is only ever
5579
+ * present when there is at least one effect.
5386
5580
  */
5387
- tableEffects?: boolean;
5581
+ tableEffects?: ParsedTableStyleEffect[];
5388
5582
  }
5389
5583
  /**
5390
5584
  * A single fill reference within a table style section.
@@ -5560,13 +5754,20 @@ interface ParsedTableStyleBorders {
5560
5754
  /**
5561
5755
  * Table background style (CT_TableBackgroundStyle, ECMA-376 §21.1.3.7).
5562
5756
  *
5563
- * Corresponds to the `<a:tblBg>` child of `<a:tblStyle>`. Currently
5564
- * captures only the resolved scheme-fill colour (verbatim XML for fill
5565
- * / effect references is preserved separately by the save path).
5757
+ * Corresponds to the `<a:tblBg>` child of `<a:tblStyle>`. Captures the
5758
+ * resolved scheme-fill colour, an unresolved style-matrix `a:fillRef`, and a
5759
+ * presence flag for effects (verbatim XML for the effect list is preserved
5760
+ * separately by the save path).
5566
5761
  */
5567
5762
  interface ParsedTableBackground {
5568
5763
  /** Solid fill (resolved from `a:fill > a:solidFill > a:schemeClr`). */
5569
5764
  fill?: ParsedTableStyleFill;
5765
+ /**
5766
+ * Style-matrix fill reference (`<a:fillRef idx="N">...</a:fillRef>`),
5767
+ * mutually exclusive with {@link fill} (`a:fill` is the choice sibling of
5768
+ * `a:fillRef` in `CT_TableBackgroundStyle`).
5769
+ */
5770
+ fillRef?: ParsedTableFillRef;
5570
5771
  /** Has an `a:effectLst` child that should be round-tripped. */
5571
5772
  hasEffectLst?: boolean;
5572
5773
  }
@@ -5818,6 +6019,13 @@ interface TablePptxElement extends PptxElementBase {
5818
6019
  type: 'table';
5819
6020
  /** Parsed table cell data for editing. */
5820
6021
  tableData?: PptxTableData;
6022
+ /**
6023
+ * Accessibility description from `p:nvGraphicFramePr/p:cNvPr/@descr`, the
6024
+ * same non-visual-properties attribute a picture's alt text comes from.
6025
+ */
6026
+ altText?: string;
6027
+ /** Accessibility title from `p:nvGraphicFramePr/p:cNvPr/@title`. */
6028
+ title?: string;
5821
6029
  /**
5822
6030
  * Unrecognised extensions captured from `a:graphicData/a:extLst` so they
5823
6031
  * round-trip losslessly. See {@link PptxGraphicFrameExtension}.
@@ -5833,6 +6041,10 @@ interface TablePptxElement extends PptxElementBase {
5833
6041
  interface ChartPptxElement extends PptxElementBase {
5834
6042
  type: 'chart';
5835
6043
  chartData?: PptxChartData;
6044
+ /** Accessibility description from `p:nvGraphicFramePr/p:cNvPr/@descr`. */
6045
+ altText?: string;
6046
+ /** Accessibility title from `p:nvGraphicFramePr/p:cNvPr/@title`. */
6047
+ title?: string;
5836
6048
  /** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
5837
6049
  extensionXml?: PptxGraphicFrameExtension[];
5838
6050
  }
@@ -5850,6 +6062,10 @@ interface ChartPptxElement extends PptxElementBase {
5850
6062
  interface SmartArtPptxElement extends PptxElementBase {
5851
6063
  type: 'smartArt';
5852
6064
  smartArtData?: PptxSmartArtData;
6065
+ /** Accessibility description from `p:nvGraphicFramePr/p:cNvPr/@descr`. */
6066
+ altText?: string;
6067
+ /** Accessibility title from `p:nvGraphicFramePr/p:cNvPr/@title`. */
6068
+ title?: string;
5853
6069
  /** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
5854
6070
  extensionXml?: PptxGraphicFrameExtension[];
5855
6071
  }
@@ -5936,6 +6152,10 @@ interface OlePptxElement extends PptxElementBase {
5936
6152
  * `false`; `undefined` means the source authored no explicit value.
5937
6153
  */
5938
6154
  oleUpdateAutomatic?: boolean;
6155
+ /** Accessibility description from `p:nvGraphicFramePr/p:cNvPr/@descr`. */
6156
+ altText?: string;
6157
+ /** Accessibility title from `p:nvGraphicFramePr/p:cNvPr/@title`. */
6158
+ title?: string;
5939
6159
  /** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
5940
6160
  extensionXml?: PptxGraphicFrameExtension[];
5941
6161
  }
@@ -6027,6 +6247,15 @@ interface MediaPptxElement extends PptxElementBase {
6027
6247
  * (`r:embed`). Defaults to embedded when undefined.
6028
6248
  */
6029
6249
  isLinked?: boolean;
6250
+ /**
6251
+ * Accessibility description from `p:nvGraphicFramePr/p:cNvPr/@descr`.
6252
+ * Only populated for the `p:graphicFrame`-shaped (SDK-created) media
6253
+ * form; a `p:pic`-shaped media element's alt text is not currently
6254
+ * parsed (see `PptxHandlerRuntimePictureParsing.ts`).
6255
+ */
6256
+ altText?: string;
6257
+ /** Accessibility title from `p:nvGraphicFramePr/p:cNvPr/@title`. Same scope note as {@link altText}. */
6258
+ title?: string;
6030
6259
  /** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
6031
6260
  extensionXml?: PptxGraphicFrameExtension[];
6032
6261
  }
@@ -6543,7 +6772,20 @@ interface PptxAnimationGraphicElementTarget {
6543
6772
  seriesIdx?: number;
6544
6773
  /** `@_categoryIdx`, 0-based category index, when the target is category-scoped. */
6545
6774
  categoryIdx?: number;
6546
- /** `@_bldStep` (ST_TLChartBuildStep): `category` / `categoryEl` / `series` / `seriesEl`. */
6775
+ /**
6776
+ * `p:dgm/@_id` (CT_TLBuildDiagram, ECMA-376 S19.5.10): the diagram DATA MODEL
6777
+ * point id (`dgm:pt/@modelId`) this per-stage effect reveals, when a
6778
+ * `p:bldDgm` build authors one effect per node instead of a single staged
6779
+ * reveal. `dgm`-kind targets only; a `chart`-kind target never carries this.
6780
+ * Matches `PptxSmartArtNode.id` (parsed from the same `@modelId`), so a
6781
+ * diagram renderer can reveal the exact authored node.
6782
+ */
6783
+ id?: string;
6784
+ /**
6785
+ * `@_bldStep`: `ST_TLChartBuildStep` (`category` / `categoryEl` / `series` /
6786
+ * `seriesEl`) for a `chart`-kind target, or `ST_TLDiagramBuildStep`
6787
+ * (`sp` / `bg`) for a `dgm`-kind target.
6788
+ */
6547
6789
  bldStep?: string;
6548
6790
  }
6549
6791
  /**
@@ -6993,6 +7235,34 @@ interface PptxNativeAnimation {
6993
7235
  * `childStyle`, a legacy compatibility hint. Round-tripped only.
6994
7236
  */
6995
7237
  cBhvrOverride?: 'normal' | 'childStyle';
7238
+ /**
7239
+ * `p:set` discrete attribute assignments composed alongside this effect
7240
+ * (ECMA-376 S19.5.79 CT_TLSetBehavior): an instantaneous (non-interpolated)
7241
+ * value change, as opposed to {@link attributeAnimations}'s `p:anim`
7242
+ * keyframe ramps. PowerPoint authors several font-style emphasis effects
7243
+ * this way (Bold Reveal, Underline, Bold Flash, Change Font Size), since
7244
+ * "on/off" or "size N" has nothing to interpolate. Not yet consulted by
7245
+ * shared playback (round-trip/typed-model only so far).
7246
+ */
7247
+ setAnimations?: PptxSetAnimation[];
7248
+ }
7249
+ /**
7250
+ * One `p:set` discrete (non-interpolated) attribute assignment composed
7251
+ * alongside an authored effect. See {@link PptxNativeAnimation.setAnimations}.
7252
+ *
7253
+ * @see ECMA-376 S19.5.79 CT_TLSetBehavior
7254
+ */
7255
+ interface PptxSetAnimation {
7256
+ /** Lowercased target attribute from `p:cBhvr/p:attrNameLst/p:attrName`. */
7257
+ attrName: string;
7258
+ /** Decoded value from `p:to` (same variant shape as a `p:tav/p:val`). */
7259
+ value: string | boolean | number;
7260
+ /** Discriminant indicating which `p:to` child carried the value. */
7261
+ valueType: 'str' | 'bool' | 'int' | 'flt' | 'clr';
7262
+ /** Duration from this behaviour's nested `p:cTn/@dur`. */
7263
+ durationMs?: number;
7264
+ /** Start offset from this behaviour's nested `p:stCondLst`. */
7265
+ delayMs?: number;
6996
7266
  }
6997
7267
  /**
6998
7268
  * Parsed `p:animEffect/@filter` (+ `@transition`) descriptor. ECMA-376
@@ -7260,6 +7530,16 @@ interface PptxElementAnimation {
7260
7530
  * OOXML equivalent and is not required for playback.
7261
7531
  */
7262
7532
  soundFileName?: string;
7533
+ /**
7534
+ * Per-build-level timing template(s) from the {@link sequence}'s own
7535
+ * `p:bldP/p:tmplLst` (ECMA-376 §19.5.84), carried over from the loaded
7536
+ * `PptxNativeAnimation.buildTemplates` this element animation was derived
7537
+ * from so a full timing-tree rebuild (`PptxAnimationWriteService`'s
7538
+ * `buildTimingXml`, when the slide had no prior `p:timing`) can re-emit
7539
+ * them instead of silently dropping the deck's authored per-level
7540
+ * defaults. Absent when {@link sequence} carries no such template.
7541
+ */
7542
+ buildTemplates?: PptxTimingTemplate[];
7263
7543
  }
7264
7544
  /**
7265
7545
  * A read-only anchor representing one of the deck's own effect groups: a
@@ -8176,6 +8456,22 @@ interface PptxActiveXControl {
8176
8456
  name?: string;
8177
8457
  /** Shape ID this control is linked to (from @spid). */
8178
8458
  shapeId?: string;
8459
+ /**
8460
+ * `p:control/@showAsIcon` (CT_Control, ECMA-376 S19.3.1.2): whether the
8461
+ * control renders as its static icon rather than its live appearance.
8462
+ * `undefined` when the source authored no explicit value (schema default
8463
+ * `false`).
8464
+ */
8465
+ showAsIcon?: boolean;
8466
+ /**
8467
+ * `p:control/@imgW` in EMU (ST_PositiveCoordinate32): the width the host
8468
+ * reserves for the control's icon/preview image. Distinct from
8469
+ * {@link width}, which is the fallback `p:pic`'s own `a:ext/@cx` in px;
8470
+ * `imgW`/`imgH` are direct attributes on `p:control` itself.
8471
+ */
8472
+ imgWidthEmu?: number;
8473
+ /** `p:control/@imgH` in EMU (ST_PositiveCoordinate32). @see imgWidthEmu */
8474
+ imgHeightEmu?: number;
8179
8475
  /** X position (px) of the control's fallback picture, if present. */
8180
8476
  x?: number;
8181
8477
  /** Y position (px) of the control's fallback picture, if present. */
@@ -8632,6 +8928,34 @@ interface PptxPhotoAlbum {
8632
8928
  layout?: string;
8633
8929
  /** Frame style applied to each photo (e.g. "frameStyle1"). */
8634
8930
  frame?: string;
8931
+ /**
8932
+ * `p:photoAlbum/@isPhoto` (ECMA-376 S19.2.1.27, CT_PhotoAlbum): whether
8933
+ * the pictures placed by the album wizard are real photographs, as
8934
+ * opposed to clip art or other embedded images. `undefined` when the
8935
+ * source authored no explicit value (schema default `false`); this is a
8936
+ * purely declarative wizard-provenance flag, not something this library
8937
+ * gates any layout/frame behaviour on.
8938
+ */
8939
+ isPhoto?: boolean;
8940
+ }
8941
+ /**
8942
+ * A recognizer-owned `p:smartTags` reference from `presentation.xml`
8943
+ * (CT_SmartTags, ECMA-376 S19.2.1.42): a bare relationship id pointing at a
8944
+ * legacy Office "Smart Tags" recognizer part, distinct from the
8945
+ * user-authored `p:tags` construct (see {@link PptxTagCollection}).
8946
+ *
8947
+ * This library has no data model for recognizer part CONTENT (there is no
8948
+ * way to create, inspect, or edit one through the public API), so this type
8949
+ * only captures enough to preserve an authored reference losslessly: the
8950
+ * relationship id and, when resolvable, the target part path.
8951
+ */
8952
+ interface PptxSmartTagsReference {
8953
+ /** Relationship id from `p:smartTags/@r:id`. */
8954
+ relId: string;
8955
+ /** Resolved ZIP path of the referenced recognizer part, when resolvable. */
8956
+ targetPath?: string;
8957
+ /** Raw `p:smartTags` XML retained for lossless round-trip. */
8958
+ rawXml?: XmlObject;
8635
8959
  }
8636
8960
  /**
8637
8961
  * East Asian line-break (kinsoku) settings from `p:kinsoku` in `presentation.xml`.
@@ -8696,6 +9020,13 @@ interface PptxData {
8696
9020
  themeOptions?: PptxThemeOption[];
8697
9021
  /** Parsed table style definitions from `ppt/tableStyles.xml`. */
8698
9022
  tableStyleMap?: ParsedTableStyleMap;
9023
+ /**
9024
+ * The current default table style GUID (`ppt/tableStyles.xml`'s
9025
+ * `a:tblStyleLst/@def`): the style PowerPoint applies to a newly inserted
9026
+ * table. Matches `PptxSaveOptions.tableStylesDefaultId` so a save call
9027
+ * that omits it can fall back to what was loaded.
9028
+ */
9029
+ tableStylesDefaultId?: string;
8699
9030
  /** Whether the presentation is password-protected. */
8700
9031
  isPasswordProtected?: boolean;
8701
9032
  /** Embedded font data (name + binary data URL) extracted from the presentation. */
@@ -8755,6 +9086,14 @@ interface PptxData {
8755
9086
  modifyVerifier?: PptxModifyVerifier;
8756
9087
  /** Photo album metadata from `p:photoAlbum` in `presentation.xml`. */
8757
9088
  photoAlbum?: PptxPhotoAlbum;
9089
+ /**
9090
+ * Legacy Smart Tags recognizer reference from `p:smartTags` in
9091
+ * `presentation.xml`. Read-only: there is no data model for the
9092
+ * recognizer part's own content, so this exists to make the reference
9093
+ * inspectable and to prove it survives a save (the owning part and its
9094
+ * relationship are preserved passively, like any other unmodelled part).
9095
+ */
9096
+ smartTags?: PptxSmartTagsReference;
8758
9097
  /** East Asian line-break settings from `p:kinsoku` in `presentation.xml`. */
8759
9098
  kinsoku?: PptxKinsoku;
8760
9099
  /** Custom XML data parts from `customXml/` in the OPC package. */
@@ -8883,7 +9222,7 @@ interface PptxEmbeddedFont {
8883
9222
  originalPartBytes?: Uint8Array;
8884
9223
  }
8885
9224
  //#endregion
8886
- //#region ../core/dist/index-YjWgLS6-.d.ts
9225
+ //#region ../core/dist/index-Coh2DmEv.d.ts
8887
9226
  //#region src/core/types/theme-presets.d.ts
8888
9227
  /**
8889
9228
  * A complete theme preset that can be applied to a presentation.
@@ -8920,6 +9259,14 @@ type FillInput = {
8920
9259
  type: 'solid';
8921
9260
  color: string;
8922
9261
  opacity?: number;
9262
+ /**
9263
+ * A theme colour to use instead of a plain hex. When set, the shape
9264
+ * saves as `<a:schemeClr>` (e.g. `{ scheme: 'accent1', lumMod: 0.8 }`
9265
+ * for "Accent 1, Lighter 80%") so it keeps following the theme after a
9266
+ * later theme change; `color` still supplies the immediate resolved
9267
+ * hex for renderers that read it directly.
9268
+ */
9269
+ themeColorRef?: PptxThemeColorRef;
8923
9270
  } | {
8924
9271
  type: 'gradient';
8925
9272
  /**
@@ -8955,6 +9302,8 @@ interface StrokeInput {
8955
9302
  opacity?: number;
8956
9303
  join?: 'round' | 'bevel' | 'miter';
8957
9304
  cap?: 'flat' | 'rnd' | 'sq';
9305
+ /** A theme colour for the outline; see {@link FillInput}'s `themeColorRef`. */
9306
+ themeColorRef?: PptxThemeColorRef;
8958
9307
  }
8959
9308
  interface ShadowInput {
8960
9309
  color?: string;
@@ -8971,6 +9320,8 @@ interface TextStyleInput {
8971
9320
  underline?: boolean;
8972
9321
  strikethrough?: boolean;
8973
9322
  color?: string;
9323
+ /** A theme colour for the run; see {@link FillInput}'s `themeColorRef`. */
9324
+ themeColorRef?: PptxThemeColorRef;
8974
9325
  alignment?: 'left' | 'center' | 'right' | 'justify';
8975
9326
  verticalAlignment?: 'top' | 'middle' | 'bottom';
8976
9327
  lineSpacing?: number;
@@ -9598,6 +9949,24 @@ interface PptxHandlerSaveOptions {
9598
9949
  * part untouched.
9599
9950
  */
9600
9951
  tableStyles?: ParsedTableStyleMap;
9952
+ /**
9953
+ * Set `ppt/tableStyles.xml`'s `<a:tblStyleLst @def>` to this style GUID
9954
+ * (normalised to uppercase-with-braces). `undefined` preserves the
9955
+ * existing default; there is no removal form (`@def` is required by the
9956
+ * schema and PowerPoint always points it at a real style). No-op when the
9957
+ * archive has no `ppt/tableStyles.xml`, same as {@link tableStyles}.
9958
+ */
9959
+ tableStylesDefaultId?: string;
9960
+ /**
9961
+ * Style GUIDs to remove from `ppt/tableStyles.xml` entirely, kept as a
9962
+ * separate opt-in list rather than inferred from omission on
9963
+ * {@link tableStyles}: that map is documented as safe to pass a PARTIAL
9964
+ * edit (only the entries a caller actually touched), so treating every
9965
+ * GUID missing from it as "delete this" would silently destroy untouched
9966
+ * styles on an ordinary targeted edit. A GUID here that is also the
9967
+ * current (or newly requested) default is left in place and skipped.
9968
+ */
9969
+ tableStylesToDelete?: string[];
9601
9970
  /**
9602
9971
  * Target output format.
9603
9972
  * - `'pptx'` (default): Standard presentation.
@@ -10712,6 +11081,27 @@ interface ChartRevealDescriptor {
10712
11081
  /** Individual cells revealed by a `bldStep="seriesEl"`/`"categoryEl"` effect. */
10713
11082
  points: readonly ChartRevealPoint[];
10714
11083
  }
11084
+ /**
11085
+ * Playback-time SmartArt diagram reveal state derived from AUTHORED
11086
+ * `p:graphicEl/p:dgm/@id` indices (see `diagram-reveal-descriptor`'s
11087
+ * `resolveDiagramRevealDescriptor`), rather than from click-count/time
11088
+ * progress. Present on {@link ElementAnimationState.diagramReveal} only when
11089
+ * every fired diagram-build step for the element carried `p:graphicEl` data.
11090
+ * A SmartArt renderer prefers this over the progress-based `build` /
11091
+ * {@link ElementBuildState} path when present, since it reflects the real
11092
+ * authored reveal set (correct even for a reversed-order or by-branch build),
11093
+ * and falls back to `build` when absent.
11094
+ */
11095
+ interface DiagramRevealDescriptor {
11096
+ /**
11097
+ * Whether the diagram's background/connector chrome should currently be
11098
+ * visible: `true` once any node-revealing or background-revealing
11099
+ * (`bldStep="bg"`) step has fired.
11100
+ */
11101
+ background: boolean;
11102
+ /** Data-model point ids (`PptxSmartArtNode.id`) revealed so far. */
11103
+ nodeIds: ReadonlySet<string>;
11104
+ }
10715
11105
  /**
10716
11106
  * Playback-time staged-build state surfaced on {@link ElementAnimationState}.
10717
11107
  * `progress` is the 0..1 fraction of the build revealed at the current playback
@@ -10752,6 +11142,17 @@ interface ElementAnimationState {
10752
11142
  mode: ChartBuildMode;
10753
11143
  descriptor: ChartRevealDescriptor;
10754
11144
  };
11145
+ /**
11146
+ * Authored-index SmartArt diagram reveal state (see
11147
+ * {@link DiagramRevealDescriptor}), present only when every fired
11148
+ * diagram-build step for this element carried `p:graphicEl` node-id data.
11149
+ * `diagram-build`'s `resolveRevealedSmartArtNodes` prefers this over `build`
11150
+ * when present.
11151
+ */
11152
+ diagramReveal?: {
11153
+ mode: DiagramBuildMode;
11154
+ descriptor: DiagramRevealDescriptor;
11155
+ };
10755
11156
  /**
10756
11157
  * True when an active `p:animClr` color animation targets this shape's fill.
10757
11158
  * A vector renderer should then paint the fill with `fill: inherit` so the
@@ -11152,6 +11553,13 @@ interface GradientStop {
11152
11553
  color: string;
11153
11554
  position: number;
11154
11555
  opacity?: number;
11556
+ /**
11557
+ * Theme colour identity for this stop, mirroring
11558
+ * `ShapeStyle.fillColorRef`. Set by a theme-swatch pick so the stop keeps
11559
+ * following the theme after a later theme change; cleared by a custom hex
11560
+ * pick, which has no theme identity.
11561
+ */
11562
+ colorRef?: PptxThemeColorRef;
11155
11563
  }
11156
11564
  /** The editable gradient state surfaced to the component. */
11157
11565
  interface GradientState {
@@ -12327,7 +12735,7 @@ interface TextActions {
12327
12735
  changeFontSize(delta: number): void;
12328
12736
  setFontSize(size: number): void;
12329
12737
  setFontFamily(family: string): void;
12330
- setTextColor(color: string): void;
12738
+ setTextColor(color: string, ref?: PptxThemeColorRef): void;
12331
12739
  setHighlightColor(color: string): void;
12332
12740
  setCharacterSpacing(value: number): void;
12333
12741
  changeCase(mode: ChangeCaseMode): void;
@@ -12413,8 +12821,8 @@ interface EditActions extends TextActions, ArrangeActions, ClipboardActions, Sli
12413
12821
  masterView: MasterViewCrudActions;
12414
12822
  comments: CommentActions;
12415
12823
  toggleFormatPainter(): void;
12416
- setShapeFill(color: string): void;
12417
- setShapeStroke(color: string): void;
12824
+ setShapeFill(color: string, ref?: PptxThemeColorRef): void;
12825
+ setShapeStroke(color: string, ref?: PptxThemeColorRef): void;
12418
12826
  setShapeStrokeWidth(width: number): void;
12419
12827
  setShapeStyle(patch: Partial<ShapeStyle>): void;
12420
12828
  setShapeType(shapeType: string): void;
@@ -12507,7 +12915,11 @@ interface InspectorState {
12507
12915
  height: number;
12508
12916
  rotation: number;
12509
12917
  fillColor: string | undefined;
12918
+ /** Theme ref for `fillColor`, if any (highlights the matching theme swatch). */
12919
+ fillColorRef: PptxThemeColorRef | undefined;
12510
12920
  strokeColor: string | undefined;
12921
+ /** Theme ref for `strokeColor`, if any (highlights the matching theme swatch). */
12922
+ strokeColorRef: PptxThemeColorRef | undefined;
12511
12923
  strokeWidth: number;
12512
12924
  shapeStyle: ShapeStyle | undefined;
12513
12925
  shapeType: string | undefined;
@@ -12594,6 +13006,12 @@ interface InspectorState {
12594
13006
  * colours" row under the fill/stroke/text colour pickers.
12595
13007
  */
12596
13008
  recentColors: readonly string[];
13009
+ /**
13010
+ * The deck's resolved theme colour map (scheme key -> hex), feeding the
13011
+ * "Theme Colors" grid under the fill/stroke colour pickers. `undefined`
13012
+ * before a theme has loaded.
13013
+ */
13014
+ themeColorMap: Record<string, string> | undefined;
12597
13015
  }
12598
13016
  /**
12599
13017
  * Deck/slide-level state for the inspector's Elements and Comments tabs plus
@@ -12939,6 +13357,8 @@ interface RibbonSelectionState {
12939
13357
  customFontFamilies?: readonly string[];
12940
13358
  /** B6: the deck's `p:clrMru`, most-recent-first; feeds every swatch picker's row. */
12941
13359
  recentColors?: readonly string[];
13360
+ /** The deck's resolved theme colour map, feeding the font-colour "Theme Colors" grid. */
13361
+ themeColorMap?: Record<string, string>;
12942
13362
  }
12943
13363
  //#endregion
12944
13364
  //#region src/viewer/ui/mobile-action-sheets.d.ts