pptx-svelte-viewer 0.6.0 → 0.8.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.
Files changed (39) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +1 -1
  3. package/dist/component-rAnX8oL7.js +79747 -0
  4. package/dist/i18n.js +1 -1
  5. package/dist/index.d.ts +4677 -135
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +17 -15
  8. package/dist/{translator-nTmCzaSH.js → translator-CbbaZk-L.js} +8 -1
  9. package/dist/viewer/collab/components/share-helpers.d.ts +3 -1
  10. package/dist/viewer/collab/components/share-helpers.d.ts.map +1 -1
  11. package/dist/viewer/components/ribbon/ribbon-tabs.d.ts +1 -1
  12. package/dist/viewer/components/ribbon/ribbon-tabs.d.ts.map +1 -1
  13. package/dist/viewer/components/ribbon/ribbon-types.d.ts +2 -0
  14. package/dist/viewer/components/ribbon/ribbon-types.d.ts.map +1 -1
  15. package/dist/viewer/editor/editor-document-state.d.ts +12 -0
  16. package/dist/viewer/editor/editor-document-state.d.ts.map +1 -0
  17. package/dist/viewer/editor/editor-master-controller.d.ts +7 -1
  18. package/dist/viewer/editor/editor-master-controller.d.ts.map +1 -1
  19. package/dist/viewer/editor/editor-state.svelte.d.ts +4 -2
  20. package/dist/viewer/editor/editor-state.svelte.d.ts.map +1 -1
  21. package/dist/viewer/index.d.ts +551 -118
  22. package/dist/viewer/index.js +1 -1
  23. package/dist/viewer/presentation/index.d.ts +1 -0
  24. package/dist/viewer/presentation/index.d.ts.map +1 -1
  25. package/dist/viewer/presentation/presenter-session.svelte.d.ts +27 -0
  26. package/dist/viewer/presentation/presenter-session.svelte.d.ts.map +1 -0
  27. package/dist/viewer/presentation-swipe.d.ts +11 -0
  28. package/dist/viewer/presentation-swipe.d.ts.map +1 -0
  29. package/dist/viewer/state/autosave.svelte.d.ts +3 -1
  30. package/dist/viewer/state/autosave.svelte.d.ts.map +1 -1
  31. package/dist/viewer/state/presentation-loader.svelte.d.ts +4 -1
  32. package/dist/viewer/state/presentation-loader.svelte.d.ts.map +1 -1
  33. package/dist/viewer/state/viewer-effects.svelte.d.ts.map +1 -1
  34. package/dist/viewer/state/zoom-navigation-context.d.ts +15 -0
  35. package/dist/viewer/state/zoom-navigation-context.d.ts.map +1 -0
  36. package/dist/viewer/types.d.ts +13 -2
  37. package/dist/viewer/types.d.ts.map +1 -1
  38. package/package.json +1 -1
  39. package/dist/component-NIMULjW3.js +0 -70065
@@ -676,6 +676,10 @@ interface Text3DStyle {
676
676
  interface Pptx3DScene {
677
677
  /** Camera preset type, e.g. "orthographicFront", "perspectiveFront". */
678
678
  cameraPreset?: string;
679
+ /** Camera field of view in 1/60000 degrees (`a:camera/@fov`). */
680
+ cameraFieldOfView?: number;
681
+ /** Camera zoom as an OOXML percentage fraction (`a:camera/@zoom`, 1 = 100%). */
682
+ cameraZoom?: number;
679
683
  /** Camera rotation around X axis in 1/60000 degrees. */
680
684
  cameraRotX?: number;
681
685
  /** Camera rotation around Y axis in 1/60000 degrees. */
@@ -686,6 +690,12 @@ interface Pptx3DScene {
686
690
  lightRigType?: string;
687
691
  /** Light rig direction, e.g. "t", "b", "l", "r", "tl". */
688
692
  lightRigDirection?: string;
693
+ /** Light-rig rotation latitude in 1/60000 degrees. */
694
+ lightRigRotX?: number;
695
+ /** Light-rig rotation longitude in 1/60000 degrees. */
696
+ lightRigRotY?: number;
697
+ /** Light-rig rotation revolution in 1/60000 degrees. */
698
+ lightRigRotZ?: number;
689
699
  /** Whether a 3D backdrop plane is present (`a:backdrop`). */
690
700
  hasBackdrop?: boolean;
691
701
  /** Backdrop plane anchor X in EMU. */
@@ -694,6 +704,18 @@ interface Pptx3DScene {
694
704
  backdropAnchorY?: number;
695
705
  /** Backdrop plane anchor Z in EMU. */
696
706
  backdropAnchorZ?: number;
707
+ /** Backdrop normal vector X component. */
708
+ backdropNormalX?: number;
709
+ /** Backdrop normal vector Y component. */
710
+ backdropNormalY?: number;
711
+ /** Backdrop normal vector Z component. */
712
+ backdropNormalZ?: number;
713
+ /** Backdrop up vector X component. */
714
+ backdropUpX?: number;
715
+ /** Backdrop up vector Y component. */
716
+ backdropUpY?: number;
717
+ /** Backdrop up vector Z component. */
718
+ backdropUpZ?: number;
697
719
  }
698
720
  /**
699
721
  * 3D shape extrusion/bevel from `a:sp3d`.
@@ -813,9 +835,13 @@ interface ShapeStyle {
813
835
  */
814
836
  fillColorXml?: XmlObject;
815
837
  fillGradient?: string;
838
+ /** Original `gradFill` XML retained for unknown-child and extension round-tripping. */
839
+ fillGradientXml?: XmlObject;
816
840
  fillMode?: 'solid' | 'gradient' | 'pattern' | 'none' | 'image' | 'theme' | 'group';
817
841
  fillPatternPreset?: string;
818
842
  fillPatternBackgroundColor?: string;
843
+ /** Original `pattFill` XML retained for unknown-child round-tripping. */
844
+ fillPatternXml?: XmlObject;
819
845
  /** Raw XML node for pattern fill foreground colour (preserves color transforms). */
820
846
  fillPatternFgClrXml?: XmlObject;
821
847
  /** Raw XML node for pattern fill background colour (preserves color transforms). */
@@ -881,6 +907,14 @@ interface ShapeStyle {
881
907
  /** Pen line alignment (`a:ln/@algn`): `ctr` (centre, default) or `in` (inside). */
882
908
  lineAlignment?: 'ctr' | 'in';
883
909
  shadowColor?: string;
910
+ /** Preserved source `a:effectLst`, including unknown effects and extensions. */
911
+ effectListXml?: XmlObject;
912
+ /** Original outer-shadow node used for lossless surgical updates. */
913
+ outerShadowXml?: XmlObject;
914
+ /** Resolved source shadow colour used to detect colour edits. */
915
+ outerShadowOriginalColor?: string;
916
+ /** Source shadow opacity used to detect alpha edits. */
917
+ outerShadowOriginalOpacity?: number;
884
918
  shadowBlur?: number;
885
919
  shadowOffsetX?: number;
886
920
  shadowOffsetY?: number;
@@ -924,11 +958,23 @@ interface ShapeStyle {
924
958
  /** Multiple shadow layers (for advanced effects). */
925
959
  shadows?: ShadowEffect[];
926
960
  glowColor?: string;
961
+ /** Original glow node used for lossless surgical updates. */
962
+ glowXml?: XmlObject;
963
+ /** Resolved source glow colour used to detect colour edits. */
964
+ glowOriginalColor?: string;
965
+ /** Source glow opacity used to detect alpha edits. */
966
+ glowOriginalOpacity?: number;
927
967
  glowRadius?: number;
928
968
  glowOpacity?: number;
929
969
  softEdgeRadius?: number;
930
970
  /** Inner shadow colour (`a:innerShdw`). */
931
971
  innerShadowColor?: string;
972
+ /** Original inner-shadow node used for lossless surgical updates. */
973
+ innerShadowXml?: XmlObject;
974
+ /** Resolved source inner-shadow colour used to detect colour edits. */
975
+ innerShadowOriginalColor?: string;
976
+ /** Source inner-shadow opacity used to detect alpha edits. */
977
+ innerShadowOriginalOpacity?: number;
932
978
  /** Inner shadow opacity (0-1). */
933
979
  innerShadowOpacity?: number;
934
980
  /** Inner shadow blur radius in px. */
@@ -937,8 +983,12 @@ interface ShapeStyle {
937
983
  innerShadowOffsetX?: number;
938
984
  /** Inner shadow vertical offset in px. */
939
985
  innerShadowOffsetY?: number;
986
+ /** Original soft-edge node, including vendor attributes and extensions. */
987
+ softEdgeXml?: XmlObject;
940
988
  /** Reflection effect — distance from shape bottom in px. */
941
989
  reflectionBlurRadius?: number;
990
+ /** Original reflection node, including vendor attributes and extensions. */
991
+ reflectionXml?: XmlObject;
942
992
  /** Reflection start opacity (0-1). */
943
993
  reflectionStartOpacity?: number;
944
994
  /** Reflection end opacity (0-1). */
@@ -1434,6 +1484,8 @@ interface TextStyle {
1434
1484
  text3d?: Text3DStyle;
1435
1485
  /** 3D scene (camera + light rig) settings on the text body (`a:bodyPr/a:scene3d`). */
1436
1486
  textBodyScene3d?: Pptx3DScene;
1487
+ /** Raw `a:scene3d` subtree used to preserve extensions and unmodelled children. */
1488
+ textBodyScene3dXml?: XmlObject;
1437
1489
  /**
1438
1490
  * Raw `<a:extLst>` subtree captured from `<a:bodyPr>`. Preserved verbatim so
1439
1491
  * authored extensions (e.g. content placeholders, custom application data)
@@ -1810,12 +1862,32 @@ interface PlaceholderTextLevelStyle {
1810
1862
  spaceAfter?: number;
1811
1863
  }
1812
1864
 
1865
+ /** Tick-mark placement from ChartML `ST_TickMark`. */
1866
+ type PptxChartTickMark = 'cross' | 'in' | 'none' | 'out';
1867
+ /** Typed axis tick and category/date label controls. */
1868
+ interface PptxChartAxisLabelFormatting {
1869
+ /** Primary and secondary tick-mark placement. */
1870
+ majorTickMark?: PptxChartTickMark;
1871
+ minorTickMark?: PptxChartTickMark;
1872
+ /** Tick-label position from ChartML `ST_TickLblPos`. */
1873
+ tickLblPos?: 'high' | 'low' | 'nextTo' | 'none';
1874
+ /** Automatic category/date axis behavior (`c:auto`). */
1875
+ auto?: boolean;
1876
+ /** Category-axis label alignment (`c:lblAlgn`). */
1877
+ labelAlignment?: 'ctr' | 'l' | 'r';
1878
+ /** Category/date label distance, from 0 through 1000 percent. */
1879
+ labelOffset?: number;
1880
+ /** Suppress multi-level category labels (`c:noMultiLvlLbl`). */
1881
+ noMultiLevelLabels?: boolean;
1882
+ }
1883
+
1813
1884
  /**
1814
1885
  * Chart types: chart categories, series data, style metadata, data tables,
1815
1886
  * trendlines, error bars, and the composite `PptxChartData`.
1816
1887
  *
1817
1888
  * @module pptx-types/chart
1818
1889
  */
1890
+
1819
1891
  /**
1820
1892
  * Supported chart type discriminators.
1821
1893
  *
@@ -1852,6 +1924,7 @@ type PptxChartTrendlineType = 'linear' | 'exponential' | 'logarithmic' | 'polyno
1852
1924
  */
1853
1925
  interface PptxChartTrendline {
1854
1926
  trendlineType: PptxChartTrendlineType;
1927
+ name?: string;
1855
1928
  order?: number;
1856
1929
  period?: number;
1857
1930
  forward?: number;
@@ -1860,6 +1933,13 @@ interface PptxChartTrendline {
1860
1933
  displayRSq?: boolean;
1861
1934
  displayEq?: boolean;
1862
1935
  color?: string;
1936
+ label?: PptxChartTrendlineLabel | null;
1937
+ }
1938
+ /** Typed, commonly edited properties of `c:trendlineLbl`. */
1939
+ interface PptxChartTrendlineLabel {
1940
+ layout?: PptxChartManualLayout;
1941
+ numberFormatCode?: string;
1942
+ sourceLinked?: boolean;
1863
1943
  }
1864
1944
  /** Error-bar direction axis. */
1865
1945
  type PptxChartErrBarDir = 'x' | 'y';
@@ -1896,6 +1976,8 @@ interface PptxChartErrBars {
1896
1976
  val?: number;
1897
1977
  customPlus?: number[];
1898
1978
  customMinus?: number[];
1979
+ noEndCap?: boolean;
1980
+ color?: string;
1899
1981
  }
1900
1982
  /**
1901
1983
  * Visibility flags for the chart data table (axes + legend keys).
@@ -1945,6 +2027,13 @@ interface PptxChartShapeProps {
1945
2027
  /** Line dash style (a:prstDash/@val), e.g. 'solid', 'dash', 'dot', 'lgDash'. */
1946
2028
  strokeDashStyle?: string;
1947
2029
  }
2030
+ /** Up/down bar formatting on line and stock charts (`c:upDownBars`). */
2031
+ interface PptxChartUpDownBars {
2032
+ /** Gap between bars as a percentage, constrained to 0 through 500. */
2033
+ gapWidth?: number;
2034
+ upBars?: PptxChartShapeProps;
2035
+ downBars?: PptxChartShapeProps;
2036
+ }
1948
2037
  /** Marker appearance on a chart series or data point. */
1949
2038
  interface PptxChartMarker {
1950
2039
  symbol: PptxChartMarkerSymbol;
@@ -1959,25 +2048,40 @@ interface PptxChartDataPoint {
1959
2048
  invertIfNegative?: boolean;
1960
2049
  marker?: PptxChartMarker;
1961
2050
  }
2051
+ /** Schema values accepted by `c:dLblPos`. */
2052
+ type PptxChartDataLabelPosition = 'bestFit' | 'b' | 'ctr' | 'inBase' | 'inEnd' | 'l' | 'outEnd' | 'r' | 't';
1962
2053
  /** Individual data label override (c:dLbl). */
1963
2054
  interface PptxChartDataLabel {
1964
2055
  idx: number;
2056
+ /** Suppress this data point's automatically generated label. */
2057
+ deleted?: boolean;
1965
2058
  showVal?: boolean;
1966
2059
  showCatName?: boolean;
1967
2060
  showSerName?: boolean;
1968
2061
  showPercent?: boolean;
1969
2062
  showLegendKey?: boolean;
1970
2063
  showBubbleSize?: boolean;
1971
- position?: string;
2064
+ position?: PptxChartDataLabelPosition;
1972
2065
  text?: string;
2066
+ separator?: string;
2067
+ showLeaderLines?: boolean;
1973
2068
  }
1974
2069
  /** Axis number format. */
1975
2070
  interface PptxChartAxisNumFmt {
1976
2071
  formatCode: string;
1977
2072
  sourceLinked?: boolean;
1978
2073
  }
2074
+ /** Typed contents of a value-axis display-unit label (`c:dispUnitsLbl`). */
2075
+ interface PptxChartDisplayUnitsLabel {
2076
+ /** Literal label text. Omit to preserve the source text subtree. */
2077
+ text?: string;
2078
+ /** Manual label placement. `null` removes only the manual layout. */
2079
+ layout?: PptxChartManualLayout | null;
2080
+ /** Label shape formatting. `null` removes `c:spPr`. */
2081
+ spPr?: PptxChartShapeProps | null;
2082
+ }
1979
2083
  /** Axis formatting for category, value, or date axes. */
1980
- interface PptxChartAxisFormatting {
2084
+ interface PptxChartAxisFormatting extends PptxChartAxisLabelFormatting {
1981
2085
  axisType: 'catAx' | 'valAx' | 'dateAx' | 'serAx';
1982
2086
  /** Axis position: "b" (bottom), "l" (left), "r" (right), "t" (top). */
1983
2087
  axPos?: 'b' | 'l' | 'r' | 't';
@@ -2011,8 +2115,12 @@ interface PptxChartAxisFormatting {
2011
2115
  displayUnits?: 'hundreds' | 'thousands' | 'tenThousands' | 'hundredThousands' | 'millions' | 'tenMillions' | 'hundredMillions' | 'billions' | 'trillions' | 'custom';
2012
2116
  /** Custom display unit divisor value (c:dispUnits/c:custUnit/@val). Only used when displayUnits is 'custom'. */
2013
2117
  displayUnitsValue?: number;
2014
- /** Display units label text (c:dispUnits/c:dispUnitsLbl). Overrides the built-in default label when present. */
2015
- displayUnitsLabel?: string;
2118
+ /**
2119
+ * Display-unit label contents (`c:dispUnits/c:dispUnitsLbl`). A string is
2120
+ * retained as a compatibility shorthand for `{ text: string }`; `null`
2121
+ * explicitly removes the label.
2122
+ */
2123
+ displayUnitsLabel?: string | PptxChartDisplayUnitsLabel | null;
2016
2124
  /** Whether logarithmic scaling is enabled (presence of c:scaling/c:logBase). */
2017
2125
  logScale?: boolean;
2018
2126
  /** Logarithmic base value (c:scaling/c:logBase/@val), typically 10 or e. */
@@ -2021,8 +2129,6 @@ interface PptxChartAxisFormatting {
2021
2129
  majorUnit?: number;
2022
2130
  /** Minor-unit interval between secondary tick marks (c:minorUnit/@val). */
2023
2131
  minorUnit?: number;
2024
- /** Tick-label position (c:tickLblPos/@val): 'high', 'low', 'nextTo', or 'none'. */
2025
- tickLblPos?: 'high' | 'low' | 'nextTo' | 'none';
2026
2132
  }
2027
2133
  /** 3D wall or floor element formatting. */
2028
2134
  interface PptxChart3DSurface {
@@ -2081,12 +2187,32 @@ interface PptxChartDataLabelOptions {
2081
2187
  showPercent?: boolean;
2082
2188
  /** Show the legend key swatch (`c:showLegendKey`). */
2083
2189
  showLegendKey?: boolean;
2190
+ /** Show bubble size (`c:showBubbleSize`). */
2191
+ showBubbleSize?: boolean;
2192
+ /** Text placed between combined label components (`c:separator`). */
2193
+ separator?: string;
2194
+ /** Show leader lines where supported (`c:showLeaderLines`). */
2195
+ showLeaderLines?: boolean;
2084
2196
  /**
2085
2197
  * Label position (`c:dLblPos`). Valid values depend on the chart type
2086
2198
  * (`ctr`, `inEnd`, `inBase`, `outEnd`, `bestFit`, `l`, `r`, `t`, `b`).
2087
2199
  * Omit to let PowerPoint use the type default.
2088
2200
  */
2089
- position?: 'ctr' | 'inEnd' | 'inBase' | 'outEnd' | 'bestFit' | 'l' | 'r' | 't' | 'b';
2201
+ position?: PptxChartDataLabelPosition;
2202
+ }
2203
+ /** Typed text defaults for a single chart legend entry. */
2204
+ interface PptxChartLegendTextStyle {
2205
+ fontFamily?: string;
2206
+ fontSize?: number;
2207
+ bold?: boolean;
2208
+ italic?: boolean;
2209
+ color?: string;
2210
+ }
2211
+ /** Per-series legend entry override (`c:legendEntry`). */
2212
+ interface PptxChartLegendEntry {
2213
+ index: number;
2214
+ deleted?: boolean;
2215
+ textStyle?: PptxChartLegendTextStyle;
2090
2216
  }
2091
2217
  /**
2092
2218
  * Style / formatting metadata for a chart.
@@ -2109,6 +2235,8 @@ interface PptxChartStyle {
2109
2235
  hasLegend?: boolean;
2110
2236
  /** Legend position (t, b, l, r, tr). */
2111
2237
  legendPosition?: string;
2238
+ /** Per-series visibility and text-style overrides. */
2239
+ legendEntries?: PptxChartLegendEntry[];
2112
2240
  /** Whether the chart has a title. */
2113
2241
  hasTitle?: boolean;
2114
2242
  /** Whether gridlines are visible. */
@@ -2169,6 +2297,14 @@ interface PptxChartOfPieOptions {
2169
2297
  serLines?: boolean;
2170
2298
  gapWidth?: number;
2171
2299
  }
2300
+ /** Classic `c:bubbleChart` options from CT_BubbleChart. */
2301
+ interface PptxBubbleChartOptions {
2302
+ bubble3D?: boolean;
2303
+ /** Bubble diameter scale in percent, constrained to 0 through 300. */
2304
+ bubbleScale?: number;
2305
+ showNegativeBubbles?: boolean;
2306
+ sizeRepresents?: 'area' | 'w';
2307
+ }
2172
2308
  /**
2173
2309
  * 3D viewing parameters for a chart (`c:view3D`, ECMA-376 §21.2.2.228 /
2174
2310
  * CT_View3D).
@@ -2209,6 +2345,27 @@ interface PptxChartChrome {
2209
2345
  dispBlanksAs?: 'gap' | 'zero' | 'span';
2210
2346
  showDLblsOverMax?: boolean;
2211
2347
  }
2348
+ /** Manual chart placement from `c:layout/c:manualLayout` (CT_ManualLayout). */
2349
+ interface PptxChartManualLayout {
2350
+ layoutTarget?: 'inner' | 'outer';
2351
+ xMode?: 'edge' | 'factor';
2352
+ yMode?: 'edge' | 'factor';
2353
+ widthMode?: 'edge' | 'factor';
2354
+ heightMode?: 'edge' | 'factor';
2355
+ x?: number;
2356
+ y?: number;
2357
+ width?: number;
2358
+ height?: number;
2359
+ }
2360
+ /**
2361
+ * Typed manual layouts for chart regions that accept `c:layout`.
2362
+ * A `null` region removes its manual layout without removing extensions.
2363
+ */
2364
+ interface PptxChartLayouts {
2365
+ title?: PptxChartManualLayout | null;
2366
+ plotArea?: PptxChartManualLayout | null;
2367
+ legend?: PptxChartManualLayout | null;
2368
+ }
2212
2369
  /** Parsed data extracted from an embedded xlsx workbook. */
2213
2370
  interface PptxEmbeddedWorkbookData {
2214
2371
  /** Category labels from the first column/row. */
@@ -2250,9 +2407,12 @@ interface PptxChartData {
2250
2407
  chartPartPath?: string;
2251
2408
  /** Internal: relationship ID linking the graphic frame to the chart part. */
2252
2409
  chartRelationshipId?: string;
2253
- dataTable?: PptxChartDataTable;
2410
+ /** `null` explicitly removes an existing ChartML data table. */
2411
+ dataTable?: PptxChartDataTable | null;
2254
2412
  dropLines?: PptxChartLineStyle;
2255
2413
  hiLowLines?: PptxChartLineStyle;
2414
+ /** `null` explicitly removes an existing up/down-bars container. */
2415
+ upDownBars?: PptxChartUpDownBars | null;
2256
2416
  axes?: PptxChartAxisFormatting[];
2257
2417
  floor?: PptxChart3DSurface;
2258
2418
  sideWall?: PptxChart3DSurface;
@@ -2310,6 +2470,8 @@ interface PptxChartData {
2310
2470
  * `ofPieChart` element can be re-emitted on save with full fidelity.
2311
2471
  */
2312
2472
  ofPieOptions?: PptxChartOfPieOptions;
2473
+ /** Classic bubble-chart display options (`c:bubbleChart`). */
2474
+ bubbleOptions?: PptxBubbleChartOptions;
2313
2475
  /**
2314
2476
  * 3D viewing parameters (`c:view3D`, CT_View3D).
2315
2477
  *
@@ -2325,6 +2487,8 @@ interface PptxChartData {
2325
2487
  * source data, so absence does not produce empty `<c:…/>` placeholders.
2326
2488
  */
2327
2489
  chartChrome?: PptxChartChrome;
2490
+ /** Editable manual placement for the title, plot area, and legend. */
2491
+ layouts?: PptxChartLayouts;
2328
2492
  /**
2329
2493
  * Raw `c:userShapes` XML subtree (a drawing tree) preserved verbatim.
2330
2494
  *
@@ -2350,107 +2514,55 @@ interface PptxChartData {
2350
2514
  clrMapOvr?: Record<string, string>;
2351
2515
  }
2352
2516
 
2353
- /**
2354
- * Image types: effects, crop shapes, and properties shared by image/picture
2355
- * elements.
2356
- *
2357
- * @module pptx-types/image
2358
- */
2359
- /**
2360
- * Blend mode for `a:blend` container nodes inside an `a:effectDag` (CT_BlendEffect).
2361
- *
2362
- * Per ECMA-376 §20.1.8.10, valid values are: `darken`, `lighten`, `mult`,
2363
- * `over`, `screen`.
2364
- */
2365
2517
  type EffectDagBlendMode = 'darken' | 'lighten' | 'mult' | 'over' | 'screen';
2366
- /**
2367
- * Container node kind inside an `a:effectDag` (CT_EffectContainer @type).
2368
- *
2369
- * Per ECMA-376 §20.1.8.20, `sib` (sibling) draws each child independently
2370
- * over the same source; `tree` (tree) chains effects so each sees the output
2371
- * of its siblings.
2372
- */
2373
2518
  type EffectDagContainerType = 'sib' | 'tree';
2374
- /**
2375
- * Typed model of the directed-acyclic effect graph stored in `a:effectDag`.
2376
- *
2377
- * The four "structural" container/transform nodes are typed; any other inner
2378
- * effect (e.g. `a:outerShdw`, `a:glow`, `a:alphaInv`) is preserved verbatim
2379
- * as a raw XML object via the {@link EffectDagRawLeaf} variant so we never
2380
- * have to recurse into the full effect taxonomy.
2381
- *
2382
- * @example
2383
- * ```ts
2384
- * // <a:effectDag>
2385
- * // <a:cont type="sib">
2386
- * // <a:blend blend="mult"><a:cont type="tree" /></a:blend>
2387
- * // </a:cont>
2388
- * // </a:effectDag>
2389
- * const dag: EffectDagContainer = {
2390
- * kind: "cont",
2391
- * type: "sib",
2392
- * children: [{
2393
- * kind: "blend",
2394
- * mode: "mult",
2395
- * container: { kind: "cont", type: "tree", children: [] },
2396
- * }],
2397
- * };
2398
- * ```
2399
- */
2400
- type EffectDagNode = EffectDagContainer | EffectDagBlend | EffectDagXfrm | EffectDagRelOff | EffectDagRawLeaf;
2401
- /** `a:cont` — CT_EffectContainer. Recursive; mirrors the top-level `effectDag`. */
2519
+ type EffectDagNode = EffectDagContainer | EffectDagBlend | EffectDagXfrm | EffectDagRelOff | EffectDagBlur | EffectDagPresetShadow | EffectDagRawLeaf;
2402
2520
  interface EffectDagContainer {
2403
2521
  kind: 'cont';
2404
- /** `@type` — `sib` or `tree`. */
2405
2522
  type: EffectDagContainerType;
2406
- /** Optional `@name` attribute. */
2407
2523
  name?: string;
2408
- /** Ordered children. */
2409
2524
  children: EffectDagNode[];
2410
2525
  }
2411
- /** `a:blend` — CT_BlendEffect. Always wraps a single `a:cont` child. */
2412
2526
  interface EffectDagBlend {
2413
2527
  kind: 'blend';
2414
- /** `@blend` attribute. */
2415
2528
  mode: EffectDagBlendMode;
2416
- /** Required child `a:cont` container. */
2417
2529
  container: EffectDagContainer;
2418
2530
  }
2419
- /** `a:xfrmEffect` — CT_TransformEffect. Affine transform with no children. */
2420
2531
  interface EffectDagXfrm {
2421
2532
  kind: 'xfrmEffect';
2422
- /** Horizontal scale, percentage * 1000 (e.g. 100000 = 100%). */
2423
2533
  sx?: number;
2424
- /** Vertical scale, percentage * 1000. */
2425
2534
  sy?: number;
2426
- /** Horizontal skew, degrees * 60000. */
2427
2535
  kx?: number;
2428
- /** Vertical skew, degrees * 60000. */
2429
2536
  ky?: number;
2430
- /** Horizontal translation in EMU. */
2431
2537
  tx?: number;
2432
- /** Vertical translation in EMU. */
2433
2538
  ty?: number;
2434
2539
  }
2435
- /** `a:relOff` — CT_RelativeOffsetEffect. Relative offset in 1000ths of a percent. */
2436
2540
  interface EffectDagRelOff {
2437
2541
  kind: 'relOff';
2438
- /** Horizontal offset, percentage * 1000. */
2439
2542
  tx?: number;
2440
- /** Vertical offset, percentage * 1000. */
2441
2543
  ty?: number;
2442
2544
  }
2443
- /**
2444
- * Catch-all leaf preserving any non-container effect (e.g. `a:outerShdw`,
2445
- * `a:glow`, `a:alphaInv`) as raw XML. Re-emitted verbatim on save.
2446
- */
2545
+ /** Typed CT_BlurEffect with its original payload retained for lossless edits. */
2546
+ interface EffectDagBlur {
2547
+ kind: 'blur';
2548
+ radiusEmu?: number;
2549
+ grow?: boolean;
2550
+ xml: XmlObject;
2551
+ }
2552
+ /** Typed CT_PresetShadowEffect with colour and extension XML retained verbatim. */
2553
+ interface EffectDagPresetShadow {
2554
+ kind: 'prstShdw';
2555
+ preset?: `shdw${number}`;
2556
+ distanceEmu?: number;
2557
+ direction?: number;
2558
+ xml: XmlObject;
2559
+ }
2447
2560
  interface EffectDagRawLeaf {
2448
2561
  kind: 'raw';
2449
- /** Local element name without the `a:` prefix (e.g. `outerShdw`, `glow`). */
2450
2562
  tag: string;
2451
- /** Raw XML object captured at load — preserved verbatim on save. */
2452
2563
  xml: Record<string, unknown>;
2453
2564
  }
2565
+
2454
2566
  /**
2455
2567
  * Image recolour/adjustment properties parsed from blip extensions.
2456
2568
  *
@@ -2677,6 +2789,11 @@ declare module "./index" {
2677
2789
  * ```
2678
2790
  */
2679
2791
  type PptxMediaType = 'video' | 'audio' | 'unknown';
2792
+ type PptxMediaReferenceKind = 'audioCd' | 'wavAudioFile' | 'audioFile' | 'videoFile' | 'quickTimeFile';
2793
+ interface PptxAudioCdPosition {
2794
+ track: number;
2795
+ time?: number;
2796
+ }
2680
2797
  /**
2681
2798
  * A named bookmark within a media clip timeline.
2682
2799
  *
@@ -2753,6 +2870,34 @@ interface MediaCaptionTrack {
2753
2870
  isDefault?: boolean;
2754
2871
  }
2755
2872
 
2873
+ /** Typed, editable metadata from a DiagramML layout-definition part. */
2874
+ interface PptxSmartArtLocalizedText {
2875
+ value: string;
2876
+ language?: string;
2877
+ }
2878
+ interface PptxSmartArtLayoutCategory {
2879
+ type: string;
2880
+ priority: number;
2881
+ }
2882
+ /** Identity and ordering metadata from DiagramML CT_LayoutNode. */
2883
+ interface PptxSmartArtLayoutNode {
2884
+ name?: string;
2885
+ styleLabel?: string;
2886
+ childOrder?: 'b' | 't';
2887
+ moveWith?: string;
2888
+ children?: PptxSmartArtLayoutNode[];
2889
+ }
2890
+ /** Metadata and root node from DiagramML CT_DiagramDefinition. */
2891
+ interface PptxSmartArtLayoutDefinition {
2892
+ uniqueId?: string;
2893
+ minimumVersion?: string;
2894
+ defaultStyle?: string;
2895
+ titles?: PptxSmartArtLocalizedText[];
2896
+ descriptions?: PptxSmartArtLocalizedText[];
2897
+ categories?: PptxSmartArtLayoutCategory[];
2898
+ rootNode: PptxSmartArtLayoutNode;
2899
+ }
2900
+
2756
2901
  /**
2757
2902
  * SmartArt node types: per-run text, per-node visual override, and the
2758
2903
  * data-model node itself. Split out of `smart-art.ts` to keep each type file
@@ -2840,6 +2985,8 @@ interface PptxSmartArtNodeStyle {
2840
2985
  interface PptxSmartArtNode {
2841
2986
  id: string;
2842
2987
  text: string;
2988
+ /** CT_Pt connection identifier, when the point references a connection. */
2989
+ connectionId?: string | null;
2843
2990
  parentId?: string;
2844
2991
  children?: PptxSmartArtNode[];
2845
2992
  /** Node type from `@_type` attribute (e.g. "doc", "node", "asst", "pres"). */
@@ -2861,6 +3008,64 @@ interface PptxSmartArtNode {
2861
3008
  style?: PptxSmartArtNodeStyle;
2862
3009
  }
2863
3010
 
3011
+ /** Editable metadata shared by DiagramML quick-style and color definitions. */
3012
+ interface PptxSmartArtDefinitionText {
3013
+ value: string;
3014
+ language?: string;
3015
+ }
3016
+ interface PptxSmartArtDefinitionCategory {
3017
+ type: string;
3018
+ priority: number;
3019
+ }
3020
+ type PptxSmartArtColorApplicationMethod = 'span' | 'cycle' | 'repeat';
3021
+ type PptxSmartArtHueDirection = 'cw' | 'ccw';
3022
+ /** CT_Colors application metadata. Color-choice children remain preserved XML. */
3023
+ interface PptxSmartArtColorListMetadata {
3024
+ method?: PptxSmartArtColorApplicationMethod;
3025
+ hueDirection?: PptxSmartArtHueDirection;
3026
+ }
3027
+ /** CT_StyleLabel metadata from a quick-style definition. */
3028
+ interface PptxSmartArtQuickStyleLabel {
3029
+ name: string;
3030
+ }
3031
+ /** CT_CTStyleLabel metadata from a color-transform definition. */
3032
+ interface PptxSmartArtColorStyleLabel {
3033
+ name: string;
3034
+ fill?: PptxSmartArtColorListMetadata;
3035
+ line?: PptxSmartArtColorListMetadata;
3036
+ effect?: PptxSmartArtColorListMetadata;
3037
+ textLine?: PptxSmartArtColorListMetadata;
3038
+ textFill?: PptxSmartArtColorListMetadata;
3039
+ textEffect?: PptxSmartArtColorListMetadata;
3040
+ }
3041
+ interface PptxSmartArtDefinitionMetadata {
3042
+ uniqueId?: string;
3043
+ minimumVersion?: string;
3044
+ titles?: PptxSmartArtDefinitionText[];
3045
+ descriptions?: PptxSmartArtDefinitionText[];
3046
+ categories?: PptxSmartArtDefinitionCategory[];
3047
+ }
3048
+ /** Typed CT_ColorTransform metadata and the resolved legacy color palette. */
3049
+ interface PptxSmartArtColorTransform extends PptxSmartArtDefinitionMetadata {
3050
+ /** Legacy resolved display name. */
3051
+ name?: string;
3052
+ /** Ordered resolved fill colors for rendering. */
3053
+ fillColors: string[];
3054
+ /** Ordered resolved line colors for rendering. */
3055
+ lineColors: string[];
3056
+ /** Ordered CT_CTStyleLabel metadata. */
3057
+ labels?: PptxSmartArtColorStyleLabel[];
3058
+ }
3059
+ /** Typed CT_StyleDefinition metadata and legacy rendering hint. */
3060
+ interface PptxSmartArtQuickStyle extends PptxSmartArtDefinitionMetadata {
3061
+ /** Legacy resolved display name. */
3062
+ name?: string;
3063
+ /** Legacy effect-intensity rendering hint. */
3064
+ effectIntensity?: string;
3065
+ /** Ordered CT_StyleLabel metadata. Complex style payload remains preserved XML. */
3066
+ labels?: PptxSmartArtQuickStyleLabel[];
3067
+ }
3068
+
2864
3069
  /**
2865
3070
  * SmartArt types: layout categories, layout presets, colour schemes,
2866
3071
  * data-model nodes/connections, drawing shapes, chrome, and the composite
@@ -2923,6 +3128,8 @@ type SmartArtStyle = 'flat' | 'moderate' | 'intense';
2923
3128
  * ```
2924
3129
  */
2925
3130
  interface PptxSmartArtConnection {
3131
+ /** Stable CT_Cxn model identifier. Required when serialized. */
3132
+ modelId?: string | null;
2926
3133
  /** Model ID of the source node. */
2927
3134
  sourceId: string;
2928
3135
  /** Model ID of the destination node. */
@@ -2933,6 +3140,12 @@ interface PptxSmartArtConnection {
2933
3140
  srcOrd?: number;
2934
3141
  /** Destination index for ordering. */
2935
3142
  destOrd?: number;
3143
+ /** Model ID of the parent transition point associated with this edge. */
3144
+ parentTransitionId?: string | null;
3145
+ /** Model ID of the sibling transition point associated with this edge. */
3146
+ siblingTransitionId?: string | null;
3147
+ /** Layout presentation identifier used by presentation connections. */
3148
+ presentationId?: string | null;
2936
3149
  }
2937
3150
  /**
2938
3151
  * A pre-computed shape from `ppt/diagrams/drawing*.xml`.
@@ -2999,45 +3212,6 @@ interface PptxSmartArtChrome {
2999
3212
  /** Outline stroke width in points. */
3000
3213
  outlineWidth?: number;
3001
3214
  }
3002
- /**
3003
- * Colour transform entry from `ppt/diagrams/colors*.xml`.
3004
- *
3005
- * @example
3006
- * ```ts
3007
- * const transform: PptxSmartArtColorTransform = {
3008
- * name: "Colorful - Accent Colors",
3009
- * fillColors: ["#4F81BD", "#C0504D", "#9BBB59"],
3010
- * lineColors: ["#385D8A", "#8C3836", "#71893F"],
3011
- * };
3012
- * // => satisfies PptxSmartArtColorTransform
3013
- * ```
3014
- */
3015
- interface PptxSmartArtColorTransform {
3016
- /** Colour scheme name / title. */
3017
- name?: string;
3018
- /** Ordered list of fill colours (hex) for each node. */
3019
- fillColors: string[];
3020
- /** Ordered list of line colours (hex). */
3021
- lineColors: string[];
3022
- }
3023
- /**
3024
- * Style entry from `ppt/diagrams/quickStyles*.xml`.
3025
- *
3026
- * @example
3027
- * ```ts
3028
- * const qs: PptxSmartArtQuickStyle = {
3029
- * name: "Moderate Effect",
3030
- * effectIntensity: "moderate",
3031
- * };
3032
- * // => satisfies PptxSmartArtQuickStyle
3033
- * ```
3034
- */
3035
- interface PptxSmartArtQuickStyle {
3036
- /** Style name / title. */
3037
- name?: string;
3038
- /** Effect intensity identifier (e.g. "subtle", "moderate", "intense"). */
3039
- effectIntensity?: string;
3040
- }
3041
3215
  /**
3042
3216
  * Complete parsed SmartArt data for a {@link SmartArtPptxElement}.
3043
3217
  *
@@ -3077,14 +3251,28 @@ interface PptxSmartArtData {
3077
3251
  colorTransform?: PptxSmartArtColorTransform;
3078
3252
  /** Quick style from `ppt/diagrams/quickStyles*.xml`. */
3079
3253
  quickStyle?: PptxSmartArtQuickStyle;
3254
+ /** Editable metadata from the related DiagramML layout definition. */
3255
+ layoutDefinition?: PptxSmartArtLayoutDefinition;
3080
3256
  /** Relationship ID for the diagram data part (for round-trip save). */
3081
3257
  dataRelId?: string;
3258
+ /** Relationship ID for the diagram layout part. */
3259
+ layoutRelId?: string;
3082
3260
  /** Relationship ID for the drawing part. */
3083
3261
  drawingRelId?: string;
3084
3262
  /** Relationship ID for the colours part. */
3085
3263
  colorsRelId?: string;
3086
3264
  /** Relationship ID for the quick-styles part. */
3087
3265
  styleRelId?: string;
3266
+ /** Internal save hint: the layout definition changed in the editor. */
3267
+ layoutDirty?: boolean;
3268
+ /** Internal save hint: typed layout-definition metadata changed. */
3269
+ layoutDefinitionDirty?: boolean;
3270
+ /** Internal save hint: quick-style definition metadata changed. */
3271
+ quickStyleDirty?: boolean;
3272
+ /** Internal save hint: color-transform definition metadata changed. */
3273
+ colorTransformDirty?: boolean;
3274
+ /** Internal save hint: cached drawing geometry or text changed in the editor. */
3275
+ drawingDirty?: boolean;
3088
3276
  }
3089
3277
 
3090
3278
  /**
@@ -3693,6 +3881,11 @@ interface MediaPptxElement extends PptxElementBase {
3693
3881
  mediaPath?: string;
3694
3882
  mediaData?: string;
3695
3883
  mediaMimeType?: string;
3884
+ mediaReferenceKind?: PptxMediaReferenceKind;
3885
+ mediaReferenceName?: string;
3886
+ audioCdStart?: PptxAudioCdPosition;
3887
+ audioCdEnd?: PptxAudioCdPosition;
3888
+ rawMediaReferenceXml?: XmlObject;
3696
3889
  /** Trim start in milliseconds (from p:cMediaNode p:cTn @st). */
3697
3890
  trimStartMs?: number;
3698
3891
  /** Trim end in milliseconds (from p:cMediaNode p:cTn @end). */
@@ -4117,6 +4310,44 @@ type PptxAnimationTrigger = 'onClick' | 'onShapeClick' | 'onHover' | 'afterPrevi
4117
4310
  * is preserved alongside other animations.
4118
4311
  */
4119
4312
  type PptxNativeAnimationKind = 'media';
4313
+ /** A target selected by `p:tgtEl` in the PresentationML timing model. */
4314
+ type PptxAnimationTarget = {
4315
+ type: 'shape';
4316
+ shapeId: string;
4317
+ rawXml?: XmlObject;
4318
+ } | {
4319
+ type: 'slide';
4320
+ rawXml?: XmlObject;
4321
+ } | {
4322
+ type: 'sound';
4323
+ relationshipId: string;
4324
+ name?: string;
4325
+ rawXml?: XmlObject;
4326
+ } | {
4327
+ type: 'ink';
4328
+ shapeId: string;
4329
+ rawXml?: XmlObject;
4330
+ } | {
4331
+ type: 'unknown';
4332
+ rawXml: XmlObject;
4333
+ };
4334
+ /** Nested build choice carried by `p:bldGraphic`. */
4335
+ type PptxGraphicBuild = {
4336
+ mode: 'asOne';
4337
+ rawXml?: XmlObject;
4338
+ } | {
4339
+ mode: 'sub';
4340
+ kind: 'diagram';
4341
+ build: string;
4342
+ reverse: boolean;
4343
+ rawXml?: XmlObject;
4344
+ } | {
4345
+ mode: 'sub';
4346
+ kind: 'chart';
4347
+ build: string;
4348
+ animateBackground: boolean;
4349
+ rawXml?: XmlObject;
4350
+ };
4120
4351
  /**
4121
4352
  * Parsed native animation record from `p:timing / p:tnLst`.
4122
4353
  *
@@ -4138,6 +4369,8 @@ type PptxNativeAnimationKind = 'media';
4138
4369
  interface PptxNativeAnimation {
4139
4370
  /** Target element/shape ID. */
4140
4371
  targetId?: string;
4372
+ /** Full timing target, including sound and ink target variants. */
4373
+ target?: PptxAnimationTarget;
4141
4374
  /** Trigger type. */
4142
4375
  trigger?: PptxAnimationTrigger;
4143
4376
  /** Shape ID that triggers this animation when clicked (interactive sequence). */
@@ -4242,6 +4475,8 @@ interface PptxNativeAnimation {
4242
4475
  * that aren't OLE charts).
4243
4476
  */
4244
4477
  graphicBuild?: string;
4478
+ /** Schema-accurate `p:bldGraphic/p:bldAsOne|p:bldSub` representation. */
4479
+ graphicBuildProperties?: PptxGraphicBuild;
4245
4480
  /**
4246
4481
  * Opaque map of `p:cTn` attributes that don't have a typed home on this
4247
4482
  * interface but must round-trip through parse → save. Keys are stored
@@ -4358,6 +4593,8 @@ interface AnimationCondition {
4358
4593
  targetShapeId?: string;
4359
4594
  /** Whether the condition targets a slide (from `p:tgtEl/p:sldTgt`). */
4360
4595
  targetSlide?: boolean;
4596
+ /** Full target choice, including `p:sndTgt` and `p:inkTgt`. */
4597
+ target?: PptxAnimationTarget;
4361
4598
  }
4362
4599
  /** Iteration configuration from `p:iterate`. */
4363
4600
  interface PptxAnimationIterate {
@@ -4442,6 +4679,7 @@ interface PptxElementAnimation {
4442
4679
  *
4443
4680
  * @module pptx-types/metadata
4444
4681
  */
4682
+
4445
4683
  /**
4446
4684
  * A slide comment — may be a legacy positional comment or a modern
4447
4685
  * threaded comment with replies.
@@ -4461,6 +4699,10 @@ interface PptxElementAnimation {
4461
4699
  interface PptxComment {
4462
4700
  id: string;
4463
4701
  text: string;
4702
+ /** Storage vocabulary used by this comment. Omitted means legacy PresentationML. */
4703
+ format?: 'legacy' | 'modern';
4704
+ /** Stable GUID author identifier used by Office 2021 modern comments. */
4705
+ authorId?: string;
4464
4706
  /** Optional parent comment id for reply threading metadata. */
4465
4707
  parentId?: string;
4466
4708
  author?: string;
@@ -4469,12 +4711,35 @@ interface PptxComment {
4469
4711
  y?: number;
4470
4712
  /** Whether this comment has been resolved/marked done. */
4471
4713
  resolved?: boolean;
4714
+ /** Native p188 status token. */
4715
+ status?: 'active' | 'resolved' | 'closed';
4716
+ /** Modern comment classification tags and author IDs that liked the comment. */
4717
+ tags?: string[];
4718
+ likes?: string[];
4719
+ startDate?: string;
4720
+ dueDate?: string;
4721
+ assignedTo?: string[];
4722
+ /** Task completion in thousandths of a percent, from 0 through 100000. */
4723
+ complete?: number;
4724
+ priority?: number;
4725
+ title?: string;
4472
4726
  /** Modern threaded comment support (p15:threadingInfo). */
4473
4727
  threadId?: string;
4474
4728
  /** Replies to this comment (for modern threaded comments). */
4475
4729
  replies?: PptxComment[];
4476
4730
  /** ID of the element this comment is associated with (if any). */
4477
4731
  elementId?: string;
4732
+ /** Original `p:cm` subtree, retained for unknown child and extension preservation. */
4733
+ rawXml?: XmlObject;
4734
+ }
4735
+ /** Office 2021 comment author from the p188 Author part. */
4736
+ interface PptxModernCommentAuthor {
4737
+ id: string;
4738
+ name: string;
4739
+ initials?: string;
4740
+ userId: string;
4741
+ providerId: string;
4742
+ rawXml?: XmlObject;
4478
4743
  }
4479
4744
  /**
4480
4745
  * A comment author from `ppt/commentAuthors.xml`.
@@ -4507,6 +4772,8 @@ interface PptxCommentAuthor {
4507
4772
  lastIdx: number;
4508
4773
  /** Colour index assigned to this author (`@_clrIdx`). */
4509
4774
  clrIdx: number;
4775
+ /** Original `p:cmAuthor` subtree, retained for unknown attribute preservation. */
4776
+ rawXml?: XmlObject;
4510
4777
  }
4511
4778
  /**
4512
4779
  * A compatibility warning generated during parse or save when the
@@ -4954,6 +5221,8 @@ interface PptxTheme {
4954
5221
  type PptxTransitionType = 'none' | 'cut' | 'fade' | 'push' | 'wipe' | 'split' | 'randomBar' | 'blinds' | 'checker' | 'circle' | 'comb' | 'cover' | 'diamond' | 'dissolve' | 'plus' | 'pull' | 'random' | 'strips' | 'uncover' | 'wedge' | 'wheel' | 'zoom' | 'newsflash' | 'morph' | 'conveyor' | 'doors' | 'ferris' | 'flash' | 'flythrough' | 'gallery' | 'glitter' | 'honeycomb' | 'pan' | 'prism' | 'reveal' | 'ripple' | 'shred' | 'switch' | 'vortex' | 'warp' | 'wheelReverse' | 'window' | 'cube' | 'flip' | 'rotate' | 'orbit';
4955
5222
  /** Split orientation from OOXML `@_orient`. */
4956
5223
  type PptxSplitOrientation = 'horz' | 'vert';
5224
+ /** Schema-defined `ST_TransitionSpeed` values. */
5225
+ type PptxTransitionSpeed = 'slow' | 'med' | 'fast';
4957
5226
  /**
4958
5227
  * Slide transition configuration.
4959
5228
  *
@@ -4970,6 +5239,8 @@ type PptxSplitOrientation = 'horz' | 'vert';
4970
5239
  */
4971
5240
  interface PptxSlideTransition {
4972
5241
  type: PptxTransitionType;
5242
+ /** Schema-defined transition speed. Defaults to `fast` when omitted. */
5243
+ speed?: PptxTransitionSpeed;
4973
5244
  durationMs?: number;
4974
5245
  direction?: string;
4975
5246
  advanceOnClick?: boolean;
@@ -4984,6 +5255,10 @@ interface PptxSlideTransition {
4984
5255
  orient?: PptxSplitOrientation;
4985
5256
  /** Relationship ID of transition sound from `p:sndAc/p:stSnd/@r:embed` when present. */
4986
5257
  soundRId?: string;
5258
+ /** Embedded WAV display name from `p:stSnd/p:snd/@name`. */
5259
+ soundName?: string;
5260
+ /** Whether the transition sound repeats until another sound starts. */
5261
+ soundLoop?: boolean;
4987
5262
  /** Resolved transition sound media path within the package. */
4988
5263
  soundPath?: string;
4989
5264
  /** Human-readable sound file name (extracted from soundPath). */
@@ -4997,6 +5272,8 @@ interface PptxSlideTransition {
4997
5272
  rawSoundAction?: XmlObject;
4998
5273
  /** Preserved extension-list XML node from `p:extLst` within the transition for lossless round-trip. */
4999
5274
  rawExtLst?: XmlObject;
5275
+ /** Original transition node, retained to preserve unknown attributes and children. */
5276
+ rawTransition?: XmlObject;
5000
5277
  }
5001
5278
 
5002
5279
  /**
@@ -5236,6 +5513,8 @@ interface PptxSlide {
5236
5513
  /** Optional `<p:cSld @name>` value of the notes slide, for round-trip. */
5237
5514
  notesCSldName?: string;
5238
5515
  comments?: PptxComment[];
5516
+ /** Source package metadata for an Office 2021 p188 comment part. */
5517
+ modernCommentPart?: PptxModernCommentPart;
5239
5518
  warnings?: PptxCompatibilityWarning[];
5240
5519
  rawXml?: XmlObject;
5241
5520
  /** Per-slide colour map override parsed from `p:clrMapOvr`. */
@@ -5254,6 +5533,24 @@ interface PptxSlide {
5254
5533
  activeXControls?: PptxActiveXControl[];
5255
5534
  /** Per-slide header/footer flags from `<p:hf>` (P-H3). */
5256
5535
  headerFooterFlags?: PptxHeaderFooterFlags;
5536
+ /** Server-backed slide synchronization metadata stored in a related OPC part. */
5537
+ slideSynchronization?: PptxSlideSyncProperties;
5538
+ }
5539
+ interface PptxModernCommentPart {
5540
+ path: string;
5541
+ relationshipId: string;
5542
+ /** Original p188:cmLst root, including unknown attributes and extensions. */
5543
+ rawXml?: XmlObject;
5544
+ }
5545
+ /** Metadata from a `p:sldSyncPr` slide synchronization data part. */
5546
+ interface PptxSlideSyncProperties {
5547
+ serverSlideId: string;
5548
+ serverSlideModifiedTime: string;
5549
+ clientInsertedTime: string;
5550
+ extensionList?: XmlObject;
5551
+ rawXml?: XmlObject;
5552
+ partPath?: string;
5553
+ relationshipId?: string;
5257
5554
  }
5258
5555
  /**
5259
5556
  * A slide layout available in the loaded presentation.
@@ -5381,6 +5678,8 @@ interface PptxCustomShow {
5381
5678
  id: string;
5382
5679
  /** Ordered list of slide relationship IDs included in this custom show. */
5383
5680
  slideRIds: string[];
5681
+ /** Original `p:custShow` subtree used to preserve unmodelled attributes and extensions. */
5682
+ rawXml?: XmlObject;
5384
5683
  }
5385
5684
  /**
5386
5685
  * An ordered section in the presentation (from `p:sectionLst` / `p14:sectionLst`).
@@ -5409,6 +5708,8 @@ interface PptxSection {
5409
5708
  collapsed?: boolean;
5410
5709
  /** Section highlight color hex (from p15:sectionPr/@clr). */
5411
5710
  color?: string;
5711
+ /** Original section subtree used to preserve unmodelled attributes and extensions. */
5712
+ rawXml?: XmlObject;
5412
5713
  }
5413
5714
  /**
5414
5715
  * Write-protection hash data parsed from `p:modifyVerifier` in `presentation.xml`.
@@ -5572,6 +5873,8 @@ interface PptxData {
5572
5873
  thumbnailData?: Uint8Array;
5573
5874
  /** Comment authors parsed from `ppt/commentAuthors.xml` for round-trip preservation. */
5574
5875
  commentAuthors?: PptxCommentAuthor[];
5876
+ /** Office 2021 p188 authors from the modern Author part. */
5877
+ modernCommentAuthors?: PptxModernCommentAuthor[];
5575
5878
  /**
5576
5879
  * OOXML conformance class of the loaded file.
5577
5880
  * - `'strict'` -- ISO/IEC 29500 Strict (uses `purl.oclc.org` namespace URIs)
@@ -7052,6 +7355,102 @@ interface CanvasSize {
7052
7355
  width: number;
7053
7356
  height: number;
7054
7357
  }
7358
+ /** Viewer interaction mode: read-only, edit, presentation, or master-view. */
7359
+ type ViewerMode = 'preview' | 'edit' | 'present' | 'master';
7360
+ /**
7361
+ * Framework-agnostic imperative API contract for the PowerPoint viewer.
7362
+ *
7363
+ * Each binding (React `forwardRef` handle, Vue `defineExpose`, Angular public
7364
+ * methods) implements this interface so consumers get a consistent progressive
7365
+ * API regardless of framework.
7366
+ */
7367
+ interface PowerPointViewerAPI {
7368
+ /** Serialise the current presentation to `.pptx` bytes. */
7369
+ getContent: () => Promise<Uint8Array>;
7370
+ /** Navigate to a specific slide by zero-based index. */
7371
+ goTo: (slideIndex: number) => void;
7372
+ /** Navigate to the previous slide. */
7373
+ goPrev: () => void;
7374
+ /** Navigate to the next slide. */
7375
+ goNext: () => void;
7376
+ /** Undo the last editing action. No-op when nothing to undo. */
7377
+ undo: () => void;
7378
+ /** Redo the last undone action. No-op when nothing to redo. */
7379
+ redo: () => void;
7380
+ /** Whether an undo action is available. */
7381
+ canUndo: () => boolean;
7382
+ /** Whether a redo action is available. */
7383
+ canRedo: () => boolean;
7384
+ /** Get the current zoom level (1 = 100%). */
7385
+ getZoom: () => number;
7386
+ /** Set the zoom level (clamped to min/max bounds). */
7387
+ setZoom: (level: number) => void;
7388
+ /** Zoom in by one step. */
7389
+ zoomIn: () => void;
7390
+ /** Zoom out by one step. */
7391
+ zoomOut: () => void;
7392
+ /** Reset zoom to 100%. */
7393
+ zoomReset: () => void;
7394
+ /** Get the current viewer mode. */
7395
+ getMode: () => ViewerMode;
7396
+ /** Switch the viewer mode (e.g. 'edit', 'preview', 'present'). */
7397
+ setMode: (mode: ViewerMode) => void;
7398
+ /** Get the zero-based active slide index. */
7399
+ getActiveSlideIndex: () => number;
7400
+ /** Set the active slide by zero-based index (alias of goTo). */
7401
+ setActiveSlideIndex: (index: number) => void;
7402
+ /** Get the total number of slides. */
7403
+ getSlideCount: () => number;
7404
+ /** Whether the document has unsaved changes. */
7405
+ isDirty: () => boolean;
7406
+ /**
7407
+ * Get the full slide array. Returns the actual `PptxSlide[]` from the
7408
+ * internal model with full type information (elements, notes, transitions,
7409
+ * animations, etc.). The returned reference is a snapshot; mutations are
7410
+ * not reflected back unless done via the manipulation methods.
7411
+ */
7412
+ getSlides: () => readonly PptxSlide[];
7413
+ /** Get a single slide by zero-based index, or undefined if out of range. */
7414
+ getSlide: (index: number) => PptxSlide | undefined;
7415
+ /** Get the currently active slide. */
7416
+ getActiveSlide: () => PptxSlide | undefined;
7417
+ /** Add a blank slide after the given index (or at end if omitted). */
7418
+ addSlide: (afterIndex?: number) => void;
7419
+ /** Delete slides at the given zero-based indexes. At least one slide is kept. */
7420
+ deleteSlides: (indexes: number[]) => void;
7421
+ /** Duplicate slides at the given zero-based indexes. */
7422
+ duplicateSlides: (indexes: number[]) => void;
7423
+ /** Move a slide from one position to another. */
7424
+ moveSlide: (fromIndex: number, toIndex: number) => void;
7425
+ /** Toggle the hidden flag on slides at the given indexes. */
7426
+ toggleHideSlides: (indexes: number[]) => void;
7427
+ /**
7428
+ * Get the elements on a slide. Defaults to the active slide when
7429
+ * `slideIndex` is omitted. Returns the full `PptxElement[]` with
7430
+ * all type-specific properties intact.
7431
+ */
7432
+ getElements: (slideIndex?: number) => readonly PptxElement[];
7433
+ /** Get a single element by ID from the active slide (or a specified slide). */
7434
+ getElementById: (elementId: string, slideIndex?: number) => PptxElement | undefined;
7435
+ /**
7436
+ * Update one or more properties of an element by ID on the active slide.
7437
+ * Accepts a `Partial<PptxElement>` patch (e.g. `{ x: 100, width: 300 }`).
7438
+ */
7439
+ updateElement: (elementId: string, updates: Partial<PptxElement>) => void;
7440
+ /** Delete elements by their IDs from the active slide. */
7441
+ deleteElements: (elementIds: string[]) => void;
7442
+ /**
7443
+ * Duplicate an element on the active slide.
7444
+ * Returns the new element's ID, or undefined if the source was not found.
7445
+ */
7446
+ duplicateElement: (elementId: string) => string | undefined;
7447
+ /** Get the IDs of currently selected elements. */
7448
+ getSelectedElementIds: () => string[];
7449
+ /** Programmatically select elements by their IDs. */
7450
+ selectElements: (ids: string[]) => void;
7451
+ /** Clear the current selection. */
7452
+ clearSelection: () => void;
7453
+ }
7055
7454
  /** Collaboration role within a session. */
7056
7455
  type CollaborationRole = 'owner' | 'collaborator' | 'viewer';
7057
7456
  /**
@@ -7064,10 +7463,12 @@ type CollaborationRole = 'owner' | 'collaborator' | 'viewer';
7064
7463
  * any signaling server, which makes this mode usable from static hosting.
7065
7464
  */
7066
7465
  type CollaborationTransport = 'websocket' | 'webrtc';
7466
+ /** How the local user entered a collaboration session. */
7467
+ type CollaborationSessionIntent = 'create' | 'join';
7067
7468
  /**
7068
7469
  * Real-time collaboration configuration.
7069
7470
  *
7070
- * The same shape is accepted by the React, Vue, and Angular bindings.
7471
+ * The same shape is accepted by every framework binding.
7071
7472
  */
7072
7473
  interface CollaborationConfig {
7073
7474
  /** Unique identifier for the collaboration room (alphanumeric, hyphens, underscores). */
@@ -7095,6 +7496,13 @@ interface CollaborationConfig {
7095
7496
  authToken?: string;
7096
7497
  /** Role in the session; defaults to `'collaborator'`. */
7097
7498
  role?: CollaborationRole;
7499
+ /**
7500
+ * Whether this client created the room or joined an existing room. Providers
7501
+ * do not use this value, but hosts can use it to avoid publishing local file
7502
+ * bytes when handling a join request. Omitted values retain the legacy
7503
+ * create-session behaviour.
7504
+ */
7505
+ sessionIntent?: CollaborationSessionIntent;
7098
7506
  /**
7099
7507
  * Elected-writer write-back callback (Area 3 of the C3 hardening plan).
7100
7508
  *
@@ -7112,6 +7520,17 @@ interface CollaborationConfig {
7112
7520
  */
7113
7521
  writeBackDebounceMs?: number;
7114
7522
  }
7523
+ /**
7524
+ * A font supplied by the host application. The package never ships fonts:
7525
+ * applications provide a licensed URL, data URL, or blob URL for their users.
7526
+ */
7527
+ interface ViewerFontSource {
7528
+ family: string;
7529
+ src: string;
7530
+ format?: 'truetype' | 'opentype' | 'woff' | 'woff2';
7531
+ weight?: string | number;
7532
+ style?: 'normal' | 'italic';
7533
+ }
7115
7534
 
7116
7535
  /**
7117
7536
  * Pure handout layout calculations, shared by every binding's print path.
@@ -7258,6 +7677,8 @@ interface ViewerLoadDetail {
7258
7677
  interface PowerPointViewerProps {
7259
7678
  /** PowerPoint content as `Uint8Array` (or `ArrayBuffer`). */
7260
7679
  source: Uint8Array | ArrayBuffer | null | undefined;
7680
+ /** Licensed font sources supplied by the host application. */
7681
+ fonts?: ViewerFontSource[];
7261
7682
  /**
7262
7683
  * Theme configuration for customising the viewer's appearance. Accepts
7263
7684
  * partial color overrides, a custom border-radius, and arbitrary CSS
@@ -7318,6 +7739,15 @@ interface PowerPointViewerProps {
7318
7739
  * to track the dirty state or mirror edits into host state.
7319
7740
  */
7320
7741
  onchange?: () => void;
7742
+ /** Canonical viewer contract callbacks. */
7743
+ ondirtychange?: (dirty: boolean) => void;
7744
+ oncontentchange?: (content: Uint8Array) => void;
7745
+ onmodechange?: (mode: string) => void;
7746
+ onzoomchange?: (zoom: number) => void;
7747
+ onselectionchange?: (elementIds: string[]) => void;
7748
+ onslidecountchange?: (count: number) => void;
7749
+ /** Host override for the File > Open action. */
7750
+ onopenfile?: () => void;
7321
7751
  /**
7322
7752
  * Enable debounced crash-recovery autosave. On each edit (when `editable`)
7323
7753
  * the current slides are serialized to `.pptx` bytes and written to the
@@ -7369,7 +7799,7 @@ interface PowerPointViewerProps {
7369
7799
  * instance (via `bind:this`). Mirrors the vanilla binding's `EditorController`
7370
7800
  * surface subset the host drives directly.
7371
7801
  */
7372
- interface PowerPointViewerApi {
7802
+ interface PowerPointViewerApi extends PowerPointViewerAPI {
7373
7803
  /** Undo the last committed edit. */
7374
7804
  undo(): void;
7375
7805
  /** Redo the last undone edit. */
@@ -7472,6 +7902,9 @@ declare class PresentationLoader {
7472
7902
  slides: PptxSlide[];
7473
7903
  /** Parsed slide-master hierarchy for the dedicated master workspace. */
7474
7904
  slideMasters: PptxSlideMaster[];
7905
+ notesMaster: PptxNotesMaster | undefined;
7906
+ handoutMaster: PptxHandoutMaster | undefined;
7907
+ notesCanvasSize: CanvasSize | undefined;
7475
7908
  /** Slide canvas size in pixels. */
7476
7909
  canvasSize: CanvasSize;
7477
7910
  /** Archive-path -> displayable URL map for media + poster frames. */