pptx-vanilla-viewer 1.24.0 → 2.0.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-howQtVDz.d.ts
6
+ //#region ../core/dist/text-operations-mlsQMjIC.d.ts
7
7
  //#region src/core/types/actions.d.ts
8
8
  /**
9
9
  * Action types: hyperlinks, slide jumps, macros, and action buttons.
@@ -785,6 +785,13 @@ interface Pptx3DScene {
785
785
  * ```
786
786
  */
787
787
  interface Pptx3DShape {
788
+ /**
789
+ * Position of the shape along the Z axis, in EMU (`a:sp3d/@z`, default 0).
790
+ * Independent of {@link extrusionHeight}: it moves the whole shape forward
791
+ * or back in 3D space rather than adding depth to it, most commonly used to
792
+ * stack several shapes at different depths under one `a:scene3d` camera.
793
+ */
794
+ positionZ?: number;
788
795
  /** Extrusion height in EMU. */
789
796
  extrusionHeight?: number;
790
797
  /** Extrusion colour. */
@@ -1325,12 +1332,12 @@ interface TextStyle {
1325
1332
  resolvedParagraphGeometry?: TextStyle;
1326
1333
  fontFamily?: string;
1327
1334
  fontSize?: number;
1328
- /** When true, renderer should shrink text to fit the shape bounds. */
1335
+ /** When true, some form of autofit is in effect; see {@link autoFitMode} for which. */
1329
1336
  autoFit?: boolean;
1330
1337
  /** Explicit autofit mode from OOXML body properties.
1331
- * - 'shrink': `a:spAutoFit` — shrink text on overflow
1332
- * - 'normal': `a:normAutofit` — normal auto-fit (with optional fontScale)
1333
- * - 'none': `a:noAutofit` — explicitly no auto-fit (text overflows)
1338
+ * - 'shrink': `a:spAutoFit` - resize the SHAPE to fit the text (never the font)
1339
+ * - 'normal': `a:normAutofit` - shrink the TEXT to fit the shape (via `fontScale`/`lnSpcReduction`)
1340
+ * - 'none': `a:noAutofit` - explicitly no auto-fit (text overflows)
1334
1341
  * - undefined: no autofit element present (inherit from layout/master)
1335
1342
  */
1336
1343
  autoFitMode?: 'shrink' | 'normal' | 'none';
@@ -1721,6 +1728,18 @@ interface TextStyle {
1721
1728
  textBodyScene3d?: Pptx3DScene;
1722
1729
  /** Raw `a:scene3d` subtree used to preserve extensions and unmodelled children. */
1723
1730
  textBodyScene3dXml?: XmlObject;
1731
+ /**
1732
+ * `a:bodyPr/a:flatTx` - an explicit "render this text flat" marker. `sp3d`
1733
+ * and `flatTx` are a mutually exclusive OOXML choice (`EG_Text3D`), so a
1734
+ * shape/run that overrides an inherited 3D text body with `<a:flatTx/>`
1735
+ * carries no `text3d` of its own; without this explicit flag a later
1736
+ * inheritance merge has no signal to stop `text3d`/`textBodyScene3d` from
1737
+ * an ancestor (layout/master) leaking back in, the way `noFill` stops an
1738
+ * inherited fill. A renderer must short-circuit 3D-text application
1739
+ * whenever this is `true`, regardless of what `text3d`/`textBodyScene3d`
1740
+ * otherwise hold.
1741
+ */
1742
+ flatText?: boolean;
1724
1743
  /**
1725
1744
  * Raw `<a:extLst>` subtree captured from `<a:bodyPr>`. Preserved verbatim so
1726
1745
  * authored extensions (e.g. content placeholders, custom application data)
@@ -1996,6 +2015,24 @@ interface PptxElementBase {
1996
2015
  * SDK-created elements.
1997
2016
  */
1998
2017
  placeholderType?: string;
2018
+ /**
2019
+ * `p:nvSpPr/p:nvPr/p:ph/@sz` (lower-cased): `"full"`, `"half"`, or
2020
+ * `"quarter"`. Captured on load for round-trip completeness. Per
2021
+ * ECMA-376 §19.3.1.36 (CT_Placeholder) this size hint is only meaningful
2022
+ * when NO `a:xfrm` exists anywhere in the placeholder's inheritance
2023
+ * chain (slide -> layout -> master); every real-world corpus placeholder
2024
+ * that carries `@sz` already has an explicit `a:xfrm` at the master
2025
+ * level, so no renderer currently derives a size from this field.
2026
+ */
2027
+ placeholderSz?: string;
2028
+ /**
2029
+ * `p:nvSpPr/p:nvPr/p:ph/@orient` (only `"vert"` is meaningful per
2030
+ * `ST_Direction`). Captured on load for round-trip completeness. In
2031
+ * practice every placeholder observed with `orient="vert"` also carries
2032
+ * an explicit `a:bodyPr/@vert`, which already drives vertical-text
2033
+ * rendering, so this field is not currently read by any renderer.
2034
+ */
2035
+ placeholderOrient?: 'vert';
1999
2036
  x: number;
2000
2037
  y: number;
2001
2038
  width: number;
@@ -2458,6 +2495,14 @@ interface PptxChartDataTable {
2458
2495
  showVertBorder?: boolean;
2459
2496
  showOutline?: boolean;
2460
2497
  showKeys?: boolean;
2498
+ /** Table border/fill formatting (`c:dTable/c:spPr`). */
2499
+ spPr?: PptxChartShapeProps;
2500
+ /**
2501
+ * Cell text defaults (`c:dTable/c:txPr/a:p/a:pPr/a:defRPr`). Reuses the same
2502
+ * shape as a legend entry's text override since both are a flat paragraph
2503
+ * default-run-property style (size/bold/italic/font/colour).
2504
+ */
2505
+ txPr?: PptxChartLegendTextStyle;
2461
2506
  }
2462
2507
  /**
2463
2508
  * Line appearance for chart helper lines (drop lines, hi-low lines).
@@ -2616,6 +2661,15 @@ interface PptxChart3DSurface {
2616
2661
  thickness?: number;
2617
2662
  spPr?: PptxChartShapeProps;
2618
2663
  }
2664
+ /**
2665
+ * One colour band for a surface chart (`c:bandFmts/c:bandFmt`,
2666
+ * ECMA-376 §21.2.2.19 / CT_BandFmt). `index` is the band's position
2667
+ * (`c:idx/@val`) among the value axis's major-unit bands, in authored order.
2668
+ */
2669
+ interface PptxChartBandFmt {
2670
+ index: number;
2671
+ spPr?: PptxChartShapeProps;
2672
+ }
2619
2673
  /** Office 2016 ChartEx box-and-whisker series layout options. */
2620
2674
  interface PptxChartBoxWhiskerOptions {
2621
2675
  quartileMethod?: 'inclusive' | 'exclusive';
@@ -3031,9 +3085,14 @@ interface PptxChartData {
3031
3085
  chartType: PptxChartType;
3032
3086
  categories: string[];
3033
3087
  /**
3034
- * Hierarchical category levels in source XML order for ChartEx hierarchy charts.
3035
- * Level 0 contains the leaf labels and remains mirrored by {@link categories}
3036
- * for consumers that only understand a flat category axis.
3088
+ * Hierarchical category levels in source XML order, for both ChartEx
3089
+ * hierarchy charts (`cx:multiLvlStrRef`) and classic multi-level category
3090
+ * axes (`c:cat/c:multiLvlStrRef`, e.g. a PowerPoint Quarter > Month
3091
+ * grouping). Level 0 contains the leaf labels and remains mirrored by
3092
+ * {@link categories} for consumers that only understand a flat category
3093
+ * axis. Parent (grouping) levels are forward-filled: a blank cache slot
3094
+ * continues the previous group's label, matching how the source stores a
3095
+ * merged category header sparsely.
3037
3096
  */
3038
3097
  categoryLevels?: string[][];
3039
3098
  dateCategories?: PptxChartDateCategories;
@@ -3100,6 +3159,8 @@ interface PptxChartData {
3100
3159
  floor?: PptxChart3DSurface;
3101
3160
  sideWall?: PptxChart3DSurface;
3102
3161
  backWall?: PptxChart3DSurface;
3162
+ /** Per-band surface-chart colour overrides (`c:surfaceChart/c:bandFmts`). */
3163
+ bandFmts?: PptxChartBandFmt[];
3103
3164
  /** External data source reference (c:externalData) linking to an external workbook. */
3104
3165
  externalData?: PptxExternalData;
3105
3166
  /**
@@ -3377,6 +3438,16 @@ interface PptxImageEffects {
3377
3438
  contRawXml?: Record<string, unknown>;
3378
3439
  /** Original effect XML, including foreign attributes. */
3379
3440
  rawXml?: XmlObject;
3441
+ /**
3442
+ * Multiplicative alpha percentage (0..100+), read from a nested
3443
+ * `<a:alphaModFix>` inside `contRawXml` when present - the common
3444
+ * real-world shape of `a:alphaMod` (`<a:cont><a:alphaModFix amt="…"/>
3445
+ * </a:cont>`). Derived/read-only: a renderer multiplies the source alpha
3446
+ * by this, distinct from the top-level {@link alphaModFix} sibling
3447
+ * effect. Not written back independently on save; `contRawXml` is what
3448
+ * round-trips.
3449
+ */
3450
+ amt?: number;
3380
3451
  };
3381
3452
  /** Alpha replace (`a:alphaRepl`) — replaces alpha with the given fixed-percent value (0..100). */
3382
3453
  alphaRepl?: number;
@@ -3421,6 +3492,40 @@ interface PptxImageEffects {
3421
3492
  blend: 'over' | 'mult' | 'screen' | 'darken' | 'lighten';
3422
3493
  /** Raw opaque fill XML preserved for round-trip. */
3423
3494
  fillRawXml?: Record<string, unknown>;
3495
+ /**
3496
+ * Resolved hex colour, when the overlay fill is a plain `a:solidFill`
3497
+ * (the common case for a picture-style colour overlay). `undefined` for
3498
+ * a gradient/pattern/picture overlay fill - see {@link resolvedGradient} /
3499
+ * {@link resolvedPattern} instead. `fillRawXml` still round-trips
3500
+ * losslessly regardless of which of the three resolved.
3501
+ */
3502
+ resolvedColor?: string;
3503
+ /** Resolved opacity (0-1) of the `a:solidFill` overlay colour, when resolved. */
3504
+ resolvedOpacity?: number;
3505
+ /**
3506
+ * Resolved gradient, when the overlay fill is `a:gradFill`. A renderer
3507
+ * composites this as an SVG paint server (`<linearGradient>` /
3508
+ * `<radialGradient>`) rather than a flat flood colour.
3509
+ */
3510
+ resolvedGradient?: {
3511
+ type: 'linear' | 'radial';
3512
+ /** Gradient angle in degrees (`a:lin/@ang`), for a linear gradient. */
3513
+ angle?: number;
3514
+ stops: Array<{
3515
+ color: string;
3516
+ position: number;
3517
+ opacity?: number;
3518
+ }>;
3519
+ };
3520
+ /**
3521
+ * Resolved preset pattern, when the overlay fill is `a:pattFill`. A
3522
+ * renderer composites this as a tiled SVG paint server.
3523
+ */
3524
+ resolvedPattern?: {
3525
+ preset: string;
3526
+ foreground?: string;
3527
+ background?: string;
3528
+ };
3424
3529
  };
3425
3530
  /** Blur (`a:blur`) — radius in EMU and grow flag. */
3426
3531
  blur?: {
@@ -3500,6 +3605,13 @@ interface PptxImageProperties {
3500
3605
  tileFlip?: 'none' | 'x' | 'y' | 'xy';
3501
3606
  /** Image tiling alignment. */
3502
3607
  tileAlignment?: string;
3608
+ /**
3609
+ * Print-resolution hint in DPI (`a:blipFill/@dpi`). PowerPoint records this
3610
+ * when it downsamples an embedded image for a target print quality; it has
3611
+ * no on-screen rendering effect (a `0`/absent value means "use the source
3612
+ * image's native resolution"). Parsed for round-trip / API fidelity only.
3613
+ */
3614
+ dpi?: number;
3503
3615
  /** Image recolour/artistic effect properties. */
3504
3616
  imageEffects?: PptxImageEffects;
3505
3617
  /** Crop-to-shape — CSS clip-path shape name. */
@@ -3680,6 +3792,25 @@ interface PptxSmartArtChoose {
3680
3792
  } | null;
3681
3793
  rawXml?: XmlObject;
3682
3794
  }
3795
+ /** A single `dgm:adj/@val` adjustment, keyed by its `@idx` (1-based, like `a:gd`). */
3796
+ interface PptxSmartArtShapeAdjustment {
3797
+ index: number;
3798
+ value: number;
3799
+ }
3800
+ /**
3801
+ * Typed DiagramML CT_Shape data (`dgm:shape`) attached to a layout node: the
3802
+ * per-node preset geometry override real (and third-party/custom) layout
3803
+ * definitions use so a layoutNode can be e.g. an ellipse or a chevron instead
3804
+ * of the arranger family's hardcoded default shape.
3805
+ */
3806
+ interface PptxSmartArtLayoutNodeShape {
3807
+ /** `dgm:shape/@type`: a preset geometry name (`roundRect`, `ellipse`, `chevron`, `conn`, ...). */
3808
+ presetGeometry?: string;
3809
+ /** `dgm:adjLst/dgm:adj` entries (adjustment index -> value, as authored). */
3810
+ adjustments?: PptxSmartArtShapeAdjustment[];
3811
+ /** `dgm:shape/@hideGeom`: the shape is present only to size text, never painted. */
3812
+ hideGeometry?: boolean;
3813
+ }
3683
3814
  /** Identity and ordering metadata from DiagramML CT_LayoutNode. */
3684
3815
  interface PptxSmartArtLayoutNode {
3685
3816
  name?: string;
@@ -3691,6 +3822,8 @@ interface PptxSmartArtLayoutNode {
3691
3822
  choose?: PptxSmartArtChoose[];
3692
3823
  constraints?: PptxSmartArtConstraint[];
3693
3824
  rules?: PptxSmartArtNumericRule[];
3825
+ /** `dgm:shape`: this node's own preset geometry override, when present. */
3826
+ shape?: PptxSmartArtLayoutNodeShape;
3694
3827
  children?: PptxSmartArtLayoutNode[];
3695
3828
  }
3696
3829
  /** Metadata and root node from DiagramML CT_DiagramDefinition. */
@@ -3814,6 +3947,61 @@ interface PptxSmartArtNodeStyle {
3814
3947
  /** Italic emphasis override for the node's runs. */
3815
3948
  italic?: boolean;
3816
3949
  }
3950
+ /**
3951
+ * Manual layout override for a `type="pres"` presentation point, read from its
3952
+ * `dgm:prSet` attributes. PowerPoint writes these when the user drags, resizes,
3953
+ * rotates, or flips a SmartArt node by hand in its own diagram editor; without
3954
+ * them the node silently reverts to its algorithmic position whenever there is
3955
+ * no cached `dsp:` drawing part to fall back on.
3956
+ *
3957
+ * Every field is optional: only the attributes actually present on `prSet` are
3958
+ * populated. Angle and scale/factor units are already normalised to degrees and
3959
+ * plain ratios (a `custScaleX="150000"` becomes `scaleX: 1.5`), so a consumer
3960
+ * never has to know the raw `60000ths-of-a-degree` / `100000ths-of-a-percent`
3961
+ * XML encodings.
3962
+ *
3963
+ * @example
3964
+ * ```ts
3965
+ * const custom: SmartArtNodeCustomLayout = { angle: 15, scaleX: 1.2 };
3966
+ * // => a node manually rotated 15 degrees and widened 20% in PowerPoint
3967
+ * ```
3968
+ */
3969
+ interface SmartArtNodeCustomLayout {
3970
+ /** `custAng`: additional rotation in degrees. */
3971
+ angle?: number;
3972
+ /** `custScaleX`: horizontal scale ratio (1 = no change). */
3973
+ scaleX?: number;
3974
+ /** `custScaleY`: vertical scale ratio (1 = no change). */
3975
+ scaleY?: number;
3976
+ /** `custSzX`: horizontal size ratio, layered on top of {@link scaleX}. */
3977
+ sizeX?: number;
3978
+ /** `custSzY`: vertical size ratio, layered on top of {@link scaleY}. */
3979
+ sizeY?: number;
3980
+ /** `custFlipHor`: the node was manually mirrored horizontally. */
3981
+ flipHorizontal?: boolean;
3982
+ /** `custFlipVert`: the node was manually mirrored vertically. */
3983
+ flipVertical?: boolean;
3984
+ /** `custLinFactX`: manual position nudge along X, as a fraction of the container width. */
3985
+ linearFactorX?: number;
3986
+ /** `custLinFactY`: manual position nudge along Y, as a fraction of the container height. */
3987
+ linearFactorY?: number;
3988
+ /**
3989
+ * `custLinFactNeighborX`: spacing compensation applied to a NEIGHBOURING
3990
+ * node when this one is resized. Parsed for round-trip completeness; not
3991
+ * applied by the per-node final transform (it has no effect on this node's
3992
+ * own geometry; folding it into a neighbour's geometry would require
3993
+ * whole-layout awareness the final transform pass does not have).
3994
+ */
3995
+ linearFactorNeighborX?: number;
3996
+ /** `custLinFactNeighborY`: see {@link linearFactorNeighborX} (Y axis). */
3997
+ linearFactorNeighborY?: number;
3998
+ /** `custRadScaleRad`: manual radius scale ratio for a radial/cycle node. */
3999
+ radialScaleRadius?: number;
4000
+ /** `custRadScaleInc`: manual angular-position nudge for a radial/cycle node. */
4001
+ radialScaleIncrement?: number;
4002
+ /** `custT`: whether `prSet` declares a custom transform is present at all. */
4003
+ hasCustomTransform?: boolean;
4004
+ }
3817
4005
  /**
3818
4006
  * A single node in the SmartArt data model.
3819
4007
  *
@@ -3839,6 +4027,16 @@ interface PptxSmartArtNode {
3839
4027
  children?: PptxSmartArtNode[];
3840
4028
  /** Node type from `@_type` attribute (e.g. "doc", "node", "asst", "pres"). */
3841
4029
  nodeType?: string;
4030
+ /**
4031
+ * The node's own quick-style role (`dgm:prSet/@presStyleLbl` from its
4032
+ * paired `type="pres"` presentation point, resolved via a `presOf`
4033
+ * connection back to this content point). Structural names like `node1`,
4034
+ * `asst2`, `bgShp`, `revTx`; distinct from {@link nodeType}, which is the
4035
+ * data-model `@_type` ("node"/"asst"/...). Used to pick this node's own
4036
+ * colour list from a colour transform's per-role palettes instead of the
4037
+ * generic cycled palette (see `applySmartArtRoleColors`).
4038
+ */
4039
+ styleRole?: string;
3842
4040
  /**
3843
4041
  * Per-run text + run-properties for the node's first paragraph, captured at
3844
4042
  * parse time. When the joined run text still equals {@link text} (the node
@@ -3859,6 +4057,14 @@ interface PptxSmartArtNode {
3859
4057
  * it round-trips.
3860
4058
  */
3861
4059
  style?: PptxSmartArtNodeStyle;
4060
+ /**
4061
+ * Manual layout override read from the node's `dgm:prSet` `cust*`
4062
+ * attributes (drag/resize/rotate/flip performed in PowerPoint's own diagram
4063
+ * editor). Applied as a final transform after algorithmic layout by
4064
+ * {@link module:smartart-layout-interpreter-custom} so it survives even
4065
+ * when there is no cached `dsp:` drawing to fall back on.
4066
+ */
4067
+ customLayout?: SmartArtNodeCustomLayout;
3862
4068
  }
3863
4069
  //#endregion
3864
4070
  //#region src/core/types/smart-art-style-definition.d.ts
@@ -3921,6 +4127,18 @@ interface PptxSmartArtColorTransform extends PptxSmartArtDefinitionMetadata {
3921
4127
  lineInterpolation?: PptxSmartArtColorListMetadata;
3922
4128
  /** Ordered CT_CTStyleLabel metadata. */
3923
4129
  labels?: PptxSmartArtColorStyleLabel[];
4130
+ /**
4131
+ * Every `styleLbl`'s own resolved fill/line colour list, keyed by name
4132
+ * (e.g. `node1`, `asst0`, `bgShp`, `revTx`). Unlike {@link fillColors} /
4133
+ * {@link lineColors} (which collapse to ONE "primary" node-role list),
4134
+ * this keeps every role so a node can be coloured from its OWN role's
4135
+ * palette (see `PptxSmartArtNode.styleRole` and `applySmartArtRoleColors`)
4136
+ * instead of a generic cycled colour.
4137
+ */
4138
+ roleColors?: Record<string, {
4139
+ fill: string[];
4140
+ line: string[];
4141
+ }>;
3924
4142
  }
3925
4143
  /** Typed CT_StyleDefinition metadata and legacy rendering hint. */
3926
4144
  interface PptxSmartArtQuickStyle extends PptxSmartArtDefinitionMetadata {
@@ -4005,6 +4223,14 @@ interface PptxSmartArtConnection {
4005
4223
  siblingTransitionId?: string | null;
4006
4224
  /** Layout presentation identifier used by presentation connections. */
4007
4225
  presentationId?: string | null;
4226
+ /**
4227
+ * Connector text, read from the linked `parTrans`/`sibTrans` transition
4228
+ * point's `dgm:t` (via {@link parentTransitionId} / {@link siblingTransitionId}).
4229
+ * PowerPoint's own diagram editor lets a user type text directly onto an
4230
+ * org-chart relationship connector; `undefined` when the transition point
4231
+ * carries no text. Written back to that point on save.
4232
+ */
4233
+ label?: string;
4008
4234
  }
4009
4235
  /**
4010
4236
  * A pre-computed shape from `ppt/diagrams/drawing*.xml`.
@@ -4325,8 +4551,8 @@ interface PptxTableCellStyle {
4325
4551
  textGlowRadius?: number;
4326
4552
  /** Cell text glow opacity (0-1). */
4327
4553
  textGlowOpacity?: number;
4328
- /** Cell fill mode: solid, gradient, pattern, or none. */
4329
- fillMode?: 'solid' | 'gradient' | 'pattern' | 'none';
4554
+ /** Cell fill mode: solid, gradient, pattern, image, or none. */
4555
+ fillMode?: 'solid' | 'gradient' | 'pattern' | 'image' | 'none';
4330
4556
  /** Gradient fill stops (colours with positions). */
4331
4557
  gradientFillStops?: Array<{
4332
4558
  color: string;
@@ -4359,6 +4585,23 @@ interface PptxTableCellStyle {
4359
4585
  patternFillForeground?: string;
4360
4586
  /** Pattern fill background colour. */
4361
4587
  patternFillBackground?: string;
4588
+ /**
4589
+ * Image fill (`a:tcPr/a:blipFill`, CT_TableCellProperties). Resolved
4590
+ * archive-relative path (or external `http(s):`/`data:` URL) for the
4591
+ * cell's background image, from `a:blipFill/a:blip/@r:embed` (or
4592
+ * `@r:link`). Present when `fillMode` is `'image'`.
4593
+ *
4594
+ * The parser resolves this synchronously (path only, no binary read);
4595
+ * a viewer's load pipeline resolves it further to a displayable
4596
+ * `data:`/`blob:` URL, written back to {@link backgroundImageFillData}.
4597
+ */
4598
+ backgroundImageFillPath?: string;
4599
+ /**
4600
+ * Displayable image data (`data:` or `blob:` URL) for an image cell
4601
+ * fill, once resolved by the load pipeline. Renderers should prefer
4602
+ * this over {@link backgroundImageFillPath} when both are present.
4603
+ */
4604
+ backgroundImageFillData?: string;
4362
4605
  /**
4363
4606
  * Cell 3D bevel + lighting from `a:tcPr/a:cell3D` (CT_Cell3D,
4364
4607
  * ECMA-376 §21.1.3.1). Rendered as a CSS bevel treatment.
@@ -4584,6 +4827,24 @@ interface ParsedTableStyleFill {
4584
4827
  gradient?: ParsedTableStyleGradient;
4585
4828
  /** Preset pattern fill parsed from `a:pattFill`. */
4586
4829
  pattern?: ParsedTableStylePattern;
4830
+ /** Image texture fill parsed from `a:blipFill`. */
4831
+ image?: ParsedTableStyleImage;
4832
+ }
4833
+ /**
4834
+ * An image texture fill parsed from a table style section's `a:blipFill`.
4835
+ *
4836
+ * `ppt/tableStyles.xml` is a presentation-level part parsed once (not
4837
+ * per-slide), so this mirrors the per-CELL `a:tcPr/a:blipFill` two-field lazy
4838
+ * pattern (`PptxTableCellStyle.backgroundImageFillPath` /
4839
+ * `backgroundImageFillData`): `path` starts out as a raw archive-relative
4840
+ * path (or an already-external `http(s):`/`data:` URL), and a load pipeline
4841
+ * patches it to a displayable URL in `data` once resolved.
4842
+ */
4843
+ interface ParsedTableStyleImage {
4844
+ /** Archive-relative path, or an already-displayable external/data URL. */
4845
+ path?: string;
4846
+ /** Displayable URL once a load pipeline has resolved `path`. */
4847
+ data?: string;
4587
4848
  }
4588
4849
  /** A single colour stop within a {@link ParsedTableStyleGradient}. */
4589
4850
  interface ParsedTableStyleGradientStop {
@@ -5010,6 +5271,12 @@ interface OlePptxElement extends PptxElementBase {
5010
5271
  oleEmbeddedMimeType?: string;
5011
5272
  /** Size of the embedded payload in bytes. */
5012
5273
  oleEmbeddedByteSize?: number;
5274
+ /**
5275
+ * `p:link/@followColorScheme` (`ST_OleObjectFollowColorScheme`): whether a
5276
+ * LINKED OLE object's icon recolours to match the presentation theme.
5277
+ * Only meaningful when {@link isLinked} is `true`. ECMA-376 §19.3.1.28.
5278
+ */
5279
+ oleFollowColorScheme?: 'none' | 'full' | 'textAndBackground';
5013
5280
  /** Unrecognised graphicFrame extLst extensions, captured verbatim for round-trip. */
5014
5281
  extensionXml?: PptxGraphicFrameExtension[];
5015
5282
  }
@@ -5311,6 +5578,16 @@ interface PptxNotesMaster {
5311
5578
  headerFooter?: PptxHeaderFooterFlags;
5312
5579
  /** Colour map from `<p:clrMap>` (12 alias attributes). Applied at save time. */
5313
5580
  clrMap?: Record<string, string>;
5581
+ /**
5582
+ * Notes text defaults from `<p:notesStyle>` (`CT_TextListStyle`, ECMA-376
5583
+ * §19.3.1.34): the same `a:defPPr` + `a:lvl1pPr`..`a:lvl9pPr` shape as
5584
+ * {@link PptxMasterTextStyles}'s per-category styles, keyed 0-8 with the
5585
+ * default at `-1`. Governs the notes body placeholder's font size, indent
5586
+ * levels, and bullet style wherever a notes slide does not override them.
5587
+ * Parsed read-only for the render cascade; the save side preserves the
5588
+ * original `<p:notesStyle>` XML verbatim rather than re-serialising this.
5589
+ */
5590
+ notesStyle?: PptxTextStyleLevels;
5314
5591
  }
5315
5592
  /**
5316
5593
  * Parsed handout master from `ppt/handoutMasters/handoutMaster1.xml`.
@@ -5394,6 +5671,14 @@ interface PptxSlideMaster {
5394
5671
  * accent1-6, hlink, folHlink). Applied at save time when present.
5395
5672
  */
5396
5673
  clrMap?: Record<string, string>;
5674
+ /**
5675
+ * Whether the master is marked as preserved (prevent auto-deletion,
5676
+ * `@preserve`). Mirrors {@link PptxSlideLayout.preserve}: PowerPoint
5677
+ * silently drops an unused master unless this is set.
5678
+ *
5679
+ * ECMA-376 §19.3.1.38 (CT_SlideMaster).
5680
+ */
5681
+ preserve?: boolean;
5397
5682
  }
5398
5683
  /**
5399
5684
  * Per-level paragraph properties for a text style category.
@@ -5583,6 +5868,35 @@ type PptxGraphicBuild = {
5583
5868
  animateBackground: boolean;
5584
5869
  rawXml?: XmlObject;
5585
5870
  };
5871
+ /**
5872
+ * A single `p:tmpl` timing template parsed from a TEXT `p:bldP/p:tmplLst`
5873
+ * (CT_TLTemplate, ECMA-376 §19.5.85; the list itself is CT_TLTemplateList,
5874
+ * §19.5.84).
5875
+ *
5876
+ * PowerPoint writes these as the timing PowerPoint would apply to a build
5877
+ * level that does not yet have an instantiated effect, so that promoting or
5878
+ * demoting an outline paragraph, or adding a new bullet at a level with no
5879
+ * prior animation, has a default to clone. They are not consulted at
5880
+ * playback: the animation actually shown for every paragraph level already
5881
+ * visible on the slide is the real, instantiated `p:tnLst` under
5882
+ * `p:timing/p:tnLst`, which the rest of this parser already models in full.
5883
+ *
5884
+ * The nested time-node tree under each template's own `p:tnLst` is kept as
5885
+ * a preserved `XmlObject` rather than deep-parsed into
5886
+ * {@link PptxNativeAnimation} records: it is schema-identical to the
5887
+ * top-level timing tree but scoped to a template that is never itself
5888
+ * executed, so structurally modelling it would stand up a second, unused
5889
+ * parallel animation model. Parsing stops at typed round-trip; see
5890
+ * `docs/guide/limitations.md`.
5891
+ */
5892
+ interface PptxTimingTemplate {
5893
+ /** Build level this template targets, from `p:tmpl/@lvl` (ST_TLLevel, default 0). */
5894
+ level: number;
5895
+ /** Preserved `p:tnLst` (CT_TimeNodeList) subtree, verbatim. */
5896
+ timeNodeList: XmlObject;
5897
+ /** Preserved `p:tmpl` XML node (its attributes plus any unmodelled children). */
5898
+ rawXml?: XmlObject;
5899
+ }
5586
5900
  /**
5587
5901
  * Parsed native animation record from `p:timing / p:tnLst`.
5588
5902
  *
@@ -5693,6 +6007,58 @@ interface PptxNativeAnimation {
5693
6007
  soundPath?: string;
5694
6008
  /** Whether to stop any currently playing sound (`p:endSnd`). */
5695
6009
  stopSound?: boolean;
6010
+ /**
6011
+ * End-state behaviour from `p:cTn/@fill` (ST_TLTimeNodeFillType, ECMA-376
6012
+ * §19.5.27). `hold`/`freeze` mean the effect's final frame persists after
6013
+ * it finishes; `remove` (the default when absent) means the target reverts
6014
+ * to its pre-effect appearance. `transition` behaves like `hold` until the
6015
+ * next time node starts. Absent means the OOXML default (`remove`).
6016
+ */
6017
+ fill?: 'remove' | 'freeze' | 'hold' | 'transition';
6018
+ /**
6019
+ * Restart behaviour from `p:cTn/@restart` (ST_TLTimeNodeRestartType).
6020
+ * Absent means the OOXML default (`always`).
6021
+ */
6022
+ restart?: 'always' | 'whenNotActive' | 'never';
6023
+ /**
6024
+ * Repeat duration in milliseconds from `p:cTn/@repeatDur`. `Infinity`
6025
+ * represents the literal `"indefinite"` token.
6026
+ */
6027
+ repeatDurMs?: number;
6028
+ /**
6029
+ * Playback speed multiplier from `p:cTn/@spd` (ST_Percentage, normalized
6030
+ * from OOXML's 1000ths-of-a-percent storage to a plain percentage, e.g.
6031
+ * `150` for 150% / double speed). Absent means normal (100%) speed.
6032
+ */
6033
+ speedPct?: number;
6034
+ /**
6035
+ * Reverse the paragraph build order from `p:bldP/@rev` (TEXT build only).
6036
+ * Not to be confused with {@link PptxGraphicBuild}'s `reverse` field, which
6037
+ * carries the unrelated `p:bldDgm`/`@rev` DIAGRAM-build reverse flag.
6038
+ */
6039
+ buildReverse?: boolean;
6040
+ /**
6041
+ * Auto-advance time in milliseconds from `p:bldP/@advAuto`. `Infinity`
6042
+ * represents the literal `"indefinite"` token. Absent means the build
6043
+ * step waits for a click.
6044
+ */
6045
+ buildAdvAutoMs?: number;
6046
+ /**
6047
+ * Per-build-level timing templates from a TEXT `p:bldP/p:tmplLst`
6048
+ * (ECMA-376 §19.5.84 CT_TLTemplateList). Parsed for round-trip only; see
6049
+ * {@link PptxTimingTemplate} for why they are not consulted at playback.
6050
+ */
6051
+ buildTemplates?: PptxTimingTemplate[];
6052
+ /**
6053
+ * Whether the enclosing `p:seq` allows concurrent play with its siblings,
6054
+ * from `p:seq/@concurrent`. Parsed for round-trip; not yet honoured by
6055
+ * playback (see `docs/guide/limitations.md`).
6056
+ */
6057
+ seqConcurrent?: boolean;
6058
+ /** Next-action behaviour from `p:seq/@nextAc` (ST_TLNextActionType). */
6059
+ seqNextAction?: 'none' | 'seek';
6060
+ /** Previous-action behaviour from `p:seq/@prevAc` (ST_TLPreviousActionType). */
6061
+ seqPrevAction?: 'none' | 'skipTimeNode';
5696
6062
  /**
5697
6063
  * Whether the enclosing click-level group (a direct `p:par` child of the
5698
6064
  * `mainSeq`) begins automatically when the slide appears, rather than waiting
@@ -5783,6 +6149,55 @@ interface PptxNativeAnimation {
5783
6149
  * subsequent peer nodes are sequenced when serialised back to OOXML.
5784
6150
  */
5785
6151
  afterEffect?: boolean;
6152
+ /**
6153
+ * "After animation" end-state behaviour carried over from the matching
6154
+ * {@link PptxElementAnimation.afterAnimation} entry for this effect's
6155
+ * element. Not populated by the native-timing parser itself (there is no
6156
+ * single `p:cTn` attribute for it): `applyAfterAnimationFromEditorList` in
6157
+ * `pptx-viewer-shared` merges it in from the editor's per-element
6158
+ * animation list before playback, since that is the model the animation
6159
+ * panel writes `afterAnimation` into.
6160
+ */
6161
+ afterAnimationAction?: PptxAfterAnimationAction;
6162
+ /** Dim-to color hex, present when {@link afterAnimationAction} is `dimToColor`. */
6163
+ afterAnimationColor?: string;
6164
+ /**
6165
+ * Parsed `p:animEffect` filter descriptor. `presetId`/`presetClass` remain
6166
+ * the primary effect selector (see `resolveEffect` in `pptx-viewer-shared`);
6167
+ * this is the fallback used when a preset table lookup misses (unmapped or
6168
+ * absent `presetId`), which happens for decks authored by tools other than
6169
+ * PowerPoint that only emit the SMIL-style filter string.
6170
+ */
6171
+ effectFilter?: PptxAnimationEffectFilter;
6172
+ }
6173
+ /**
6174
+ * Parsed `p:animEffect/@filter` (+ `@transition`) descriptor. ECMA-376
6175
+ * describes `@filter` as a free-form string of the form `family(subtype)`,
6176
+ * optionally followed by `;`-separated fallback candidates (only the first
6177
+ * is honoured, per ECMA-376 S19.5.3's "first supported filter wins" rule).
6178
+ *
6179
+ * @example
6180
+ * ```ts
6181
+ * const f: PptxAnimationEffectFilter = { family: 'wipe', subtype: 'up', transition: 'in', raw: 'wipe(up)' };
6182
+ * ```
6183
+ */
6184
+ interface PptxAnimationEffectFilter {
6185
+ /** Filter family name (e.g. `"wipe"`, `"barn"`, `"checkerboard"`), lowercased. */
6186
+ family: string;
6187
+ /**
6188
+ * Parenthesised subtype/direction token verbatim (e.g. `"up"`,
6189
+ * `"inVertical"`, `"across"`, `"4"`). Absent when the filter has no
6190
+ * subtype (e.g. bare `"dissolve"`).
6191
+ */
6192
+ subtype?: string;
6193
+ /**
6194
+ * `p:animEffect/@transition`: `"in"` reveals the target (the OOXML
6195
+ * default when the attribute is omitted), `"out"` conceals it, `"none"`
6196
+ * applies the filter without a visibility change (a static filter pass).
6197
+ */
6198
+ transition?: 'in' | 'out' | 'none';
6199
+ /** Raw filter string exactly as authored, for round-trip/debugging. */
6200
+ raw: string;
5786
6201
  }
5787
6202
  /**
5788
6203
  * Single keyframe parsed from a `p:tav` element (CT_TLTimeAnimateValue).
@@ -6937,10 +7352,12 @@ interface PptxSlide {
6937
7352
  */
6938
7353
  backgroundPattern?: PptxSlideBackgroundPattern;
6939
7354
  /**
6940
- * `<p:bgPr/@shadeToTitle>` — boolean flag instructing the renderer to
7355
+ * `<p:bgPr/@shadeToTitle>`: boolean flag instructing the renderer to
6941
7356
  * shade the background toward the title placeholder colour. Captured
6942
- * for lossless round-trip; the React renderer currently treats it as
6943
- * a passthrough hint.
7357
+ * for lossless round-trip only; no renderer applies the visual effect.
7358
+ * Documented as a known no-op in `docs/guide/limitations.md` (legacy
7359
+ * PowerPoint 97-2003 hint, not observed in any real-world corpus file
7360
+ * and not settable from any modern PowerPoint UI).
6944
7361
  *
6945
7362
  * ECMA-376 §19.3.1.2 (CT_BackgroundProperties).
6946
7363
  */
@@ -6979,6 +7396,13 @@ interface PptxSlide {
6979
7396
  backgroundShowAnimation?: boolean;
6980
7397
  /** Whether master slide shapes should be shown on this slide (`p:sld/@showMasterSp`). */
6981
7398
  showMasterShapes?: boolean;
7399
+ /**
7400
+ * Whether inherited master placeholder animations should replay on this
7401
+ * slide (`p:sld/@showMasterPhAnim`). Distinct from {@link showMasterShapes}:
7402
+ * this governs animation timing, not shape visibility. Mirrors
7403
+ * `p:sldLayout/@showMasterPhAnim`, ECMA-376 §19.3.1.38.
7404
+ */
7405
+ showMasterPhAnim?: boolean;
6982
7406
  /** Drawing guides parsed from slide extension list. */
6983
7407
  guides?: PptxDrawingGuide[];
6984
7408
  /** When explicitly `false`, the slide is unmodified and save can skip re-serialization. */
@@ -7104,11 +7528,6 @@ interface PptxPresentationProperties {
7104
7528
  printProperties?: PptxPresentationPrintProperties | null;
7105
7529
  /** Most-recently-used colours from the presentation palette. */
7106
7530
  mruColors?: string[];
7107
- /** Grid spacing in EMUs (cx, cy). Default is 914400 / 8 = 114300. */
7108
- gridSpacing?: {
7109
- cx: number;
7110
- cy: number;
7111
- };
7112
7531
  /** Pen colour for presentation mode annotations (from `p:showPr/p:penClr`). */
7113
7532
  penColor?: string;
7114
7533
  /** Kiosk auto-restart interval in milliseconds (from `p:kiosk/@restart`). Only meaningful when showType is "kiosk". */
@@ -7316,6 +7735,29 @@ interface PptxData {
7316
7735
  embeddedFonts?: PptxEmbeddedFont[];
7317
7736
  /** Typed `p:embeddedFontLst` package metadata, including unresolved variants. */
7318
7737
  embeddedFontList?: PptxEmbeddedFontList;
7738
+ /**
7739
+ * `p:presentation/@embedTrueTypeFonts` (ECMA-376 §19.2.1.26): the author's
7740
+ * saved preference that TrueType fonts referenced by the deck be embedded.
7741
+ * `undefined` when the attribute is absent (spec default `false`).
7742
+ *
7743
+ * This is purely declarative in this library: fonts are only ever embedded
7744
+ * when the caller explicitly supplies `embeddedFontList`/`embeddedFonts`
7745
+ * (there is no automatic embed-on-save), so toggling this flag does not
7746
+ * gate any embedding behaviour of its own here - it only round-trips the
7747
+ * author's stated preference, the same way real PowerPoint reads it back
7748
+ * as a checkbox state rather than a trigger. See `@saveSubsetFonts`,
7749
+ * which is a separate, deliberately unimplemented flag (no glyph
7750
+ * subsetting) that does not interact with this one.
7751
+ */
7752
+ embedTrueTypeFonts?: boolean;
7753
+ /**
7754
+ * Presentation-level default text style (`p:defaultTextStyle`): the
7755
+ * last-resort paragraph/run-property fallback for every shape (placeholder
7756
+ * or not) whose local and inherited cascade leaves a field undefined.
7757
+ * Keyed the same way as {@link PptxMasterTextStyles} categories: `-1` is
7758
+ * `a:defPPr`, `0`-`8` are `a:lvl1pPr`-`a:lvl9pPr`.
7759
+ */
7760
+ defaultTextStyle?: PptxTextStyleLevels;
7319
7761
  /** Most-recently-used colour list from presentation properties. */
7320
7762
  mruColors?: string[];
7321
7763
  /** Parsed notes master data if present in the PPTX. */
@@ -7474,7 +7916,7 @@ interface PptxEmbeddedFont {
7474
7916
  originalPartBytes?: Uint8Array;
7475
7917
  }
7476
7918
  //#endregion
7477
- //#region ../core/dist/index-B7RwkUlH.d.ts
7919
+ //#region ../core/dist/index-DNZI4fvG.d.ts
7478
7920
  //#region src/core/types/theme-presets.d.ts
7479
7921
  /**
7480
7922
  * A complete theme preset that can be applied to a presentation.
@@ -8166,6 +8608,19 @@ interface PptxHandlerSaveOptions {
8166
8608
  kinsoku?: PptxKinsoku | null;
8167
8609
  /** Write-protection verifier. Set to `null` to remove, `undefined` to preserve existing. */
8168
8610
  modifyVerifier?: PptxModifyVerifier | null;
8611
+ /**
8612
+ * `p:presentation/@embedTrueTypeFonts` to write. `undefined` preserves
8613
+ * whatever was loaded (or omits the attribute for a brand-new deck);
8614
+ * purely declarative here, see {@link PptxData.embedTrueTypeFonts}.
8615
+ */
8616
+ embedTrueTypeFonts?: boolean;
8617
+ /**
8618
+ * Presentation-level default text style edits to save back to
8619
+ * `p:defaultTextStyle`. Only the levels present in the map are touched;
8620
+ * omitted levels and any unmodelled XML on an edited level survive
8621
+ * untouched. See {@link PptxData.defaultTextStyle}.
8622
+ */
8623
+ defaultTextStyle?: PptxTextStyleLevels;
8169
8624
  /** View properties to save back to ppt/viewProps.xml. */
8170
8625
  viewProperties?: PptxViewProperties;
8171
8626
  /**
@@ -9669,9 +10124,10 @@ interface GradientState {
9669
10124
  /**
9670
10125
  * Dropdown ids for the insert-chart menu. Distinct from `PptxChartType`
9671
10126
  * because PowerPoint offers Column (vertical) and Bar (horizontal) as two
9672
- * entries over the same underlying `'bar'` chart type.
10127
+ * entries over the same underlying `'bar'` chart type. The six ChartEx ids
10128
+ * (`histogram` through `regionMap`) map one-to-one onto their chart type.
9673
10129
  */
9674
- type InsertChartKind = 'column' | 'bar' | 'line' | 'pie' | 'doughnut' | 'area' | 'scatter';
10130
+ type InsertChartKind = 'column' | 'bar' | 'line' | 'pie' | 'doughnut' | 'area' | 'scatter' | 'histogram' | 'funnel' | 'treemap' | 'sunburst' | 'boxWhisker' | 'regionMap';
9675
10131
  /** In-memory clipboard payload stored when an element is copied or cut. */
9676
10132
  interface ElementClipboardPayload {
9677
10133
  element: PptxElement;
@@ -10041,6 +10497,13 @@ interface SlideStageOptions {
10041
10497
  t: Translator;
10042
10498
  /** Scale applied via CSS transform (default 1). */
10043
10499
  scale?: number;
10500
+ /**
10501
+ * Grid dot/line spacing in CSS px for the View > Grid overlay (`.pptxv-showGrid`),
10502
+ * derived by the caller from the deck's authored `viewProperties.gridSpacing`
10503
+ * via `computeGridSpacingPx`. Defaults to 10px (this binding's existing grid
10504
+ * step) when omitted.
10505
+ */
10506
+ gridSpacingPx?: number;
10044
10507
  /** Opt-in WebGL SmartArt renderer flag; see `PptxViewerOptions.smartArt3D`. */
10045
10508
  smartArt3D?: boolean;
10046
10509
  /**
@@ -10127,6 +10590,14 @@ interface ViewerState {
10127
10590
  /** Presentation sections used to group slides in the thumbnail rail. */
10128
10591
  sections: PptxSection[];
10129
10592
  presentationProperties: PptxPresentationProperties;
10593
+ /**
10594
+ * View properties (`ppt/viewProps.xml`, `p:viewPr`): grid spacing, snap /
10595
+ * guide toggles, last view, splitter state, etc. `gridSpacing` lives here,
10596
+ * NOT on `presentationProperties` -- `p:gridSpacing` is a child of
10597
+ * `p:viewPr`, and a real PowerPoint file never populates it under
10598
+ * `p:presentationPr`.
10599
+ */
10600
+ viewProperties: PptxViewProperties | undefined;
10130
10601
  headerFooter: PptxHeaderFooter;
10131
10602
  coreProperties?: PptxCoreProperties;
10132
10603
  appProperties?: PptxAppProperties;
@@ -11233,6 +11704,8 @@ interface MobileToolbar {
11233
11704
  interface NotesPanelUpdate {
11234
11705
  slide: PptxSlide | undefined;
11235
11706
  editable: boolean;
11707
+ /** Notes-master per-level text defaults (font size, indent, etc.) to fall back to when a segment omits them. */
11708
+ notesStyle?: PptxTextStyleLevels;
11236
11709
  }
11237
11710
  interface NotesPanel {
11238
11711
  el: HTMLElement;