pptx-react-viewer 2.17.0 → 2.19.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 (132) hide show
  1. package/CHANGELOG.md +703 -0
  2. package/README.md +14 -14
  3. package/dist/{AiChatPanel-HCHCVQN2.js → AiChatPanel-2GBJETOY.js} +24 -24
  4. package/dist/AiChatPanel-2GBJETOY.js.br +0 -0
  5. package/dist/AiChatPanel-2GBJETOY.js.gz +0 -0
  6. package/dist/{AiChatPanel-RZ4A7P4H.mjs → AiChatPanel-FZUKTQPQ.mjs} +4 -4
  7. package/dist/AiChatPanel-FZUKTQPQ.mjs.br +0 -0
  8. package/dist/AiChatPanel-FZUKTQPQ.mjs.gz +0 -0
  9. package/dist/{Model3DScene-LK7LSQNH.js → Model3DScene-JHTI2AQ6.js} +2 -2
  10. package/dist/Model3DScene-JHTI2AQ6.js.br +0 -0
  11. package/dist/Model3DScene-JHTI2AQ6.js.gz +0 -0
  12. package/dist/{Model3DScene-I7FR74AD.mjs → Model3DScene-WRRQSYAZ.mjs} +1 -1
  13. package/dist/Model3DScene-WRRQSYAZ.mjs.br +0 -0
  14. package/dist/Model3DScene-WRRQSYAZ.mjs.gz +0 -0
  15. package/dist/{PowerPointViewer-Du7u4INi.d.ts → PowerPointViewer-DVFkeluD.d.ts} +2 -2
  16. package/dist/PowerPointViewer-DVFkeluD.d.ts.map +1 -0
  17. package/dist/{audience-content-store-BvqKy7Hf.d.ts → audience-content-store-ChVOSdBh.d.ts} +2 -2
  18. package/dist/{audience-content-store-BvqKy7Hf.d.ts.map → audience-content-store-ChVOSdBh.d.ts.map} +1 -1
  19. package/dist/{chunk-7JPLVECA.js → chunk-7ARD2J6Y.js} +10502 -7059
  20. package/dist/chunk-7ARD2J6Y.js.br +0 -0
  21. package/dist/chunk-7ARD2J6Y.js.gz +0 -0
  22. package/dist/{chunk-ZA5JONCW.mjs → chunk-BO373PYH.mjs} +257 -184
  23. package/dist/chunk-BO373PYH.mjs.br +0 -0
  24. package/dist/chunk-BO373PYH.mjs.gz +0 -0
  25. package/dist/{chunk-TCGXGD6E.js → chunk-IRLOXBO7.js} +608 -535
  26. package/dist/chunk-IRLOXBO7.js.br +0 -0
  27. package/dist/chunk-IRLOXBO7.js.gz +0 -0
  28. package/dist/{chunk-AONFHTTJ.js → chunk-MVKRI3CZ.js} +36 -4
  29. package/dist/chunk-MVKRI3CZ.js.br +0 -0
  30. package/dist/chunk-MVKRI3CZ.js.gz +0 -0
  31. package/dist/{chunk-MQHC5TXI.mjs → chunk-MWEBCWVD.mjs} +38 -2347
  32. package/dist/chunk-MWEBCWVD.mjs.br +0 -0
  33. package/dist/chunk-MWEBCWVD.mjs.gz +0 -0
  34. package/dist/{chunk-NQJPPIVH.js → chunk-NFFV3RDS.js} +1632 -1201
  35. package/dist/chunk-NFFV3RDS.js.br +0 -0
  36. package/dist/chunk-NFFV3RDS.js.gz +0 -0
  37. package/dist/{chunk-5BXATG54.js → chunk-OVPJT4EQ.js} +182 -2490
  38. package/dist/chunk-OVPJT4EQ.js.br +0 -0
  39. package/dist/chunk-OVPJT4EQ.js.gz +0 -0
  40. package/dist/{chunk-ATOUVRRQ.js → chunk-RPJ2BIQ7.js} +3 -3
  41. package/dist/chunk-RPJ2BIQ7.js.br +0 -0
  42. package/dist/chunk-RPJ2BIQ7.js.gz +0 -0
  43. package/dist/{chunk-S64T7C4V.mjs → chunk-SQJBFMEX.mjs} +36 -4
  44. package/dist/chunk-SQJBFMEX.mjs.br +0 -0
  45. package/dist/chunk-SQJBFMEX.mjs.gz +0 -0
  46. package/dist/{chunk-K2QU73KB.mjs → chunk-XF3EOHY2.mjs} +10455 -7039
  47. package/dist/chunk-XF3EOHY2.mjs.br +0 -0
  48. package/dist/chunk-XF3EOHY2.mjs.gz +0 -0
  49. package/dist/{chunk-422DF424.mjs → chunk-YWJBD7KV.mjs} +654 -223
  50. package/dist/chunk-YWJBD7KV.mjs.br +0 -0
  51. package/dist/chunk-YWJBD7KV.mjs.gz +0 -0
  52. package/dist/{chunk-FXJOTEPO.mjs → chunk-ZMEYXAC6.mjs} +1 -1
  53. package/dist/chunk-ZMEYXAC6.mjs.br +0 -0
  54. package/dist/chunk-ZMEYXAC6.mjs.gz +0 -0
  55. package/dist/i18n.js +4 -4
  56. package/dist/i18n.js.br +0 -0
  57. package/dist/i18n.js.gz +0 -0
  58. package/dist/i18n.mjs +1 -1
  59. package/dist/i18n.mjs.br +0 -0
  60. package/dist/i18n.mjs.gz +0 -0
  61. package/dist/index.d.ts +535 -17
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +65 -41
  64. package/dist/index.js.br +0 -0
  65. package/dist/index.js.gz +0 -0
  66. package/dist/index.mjs +6 -6
  67. package/dist/index.mjs.br +0 -0
  68. package/dist/index.mjs.gz +0 -0
  69. package/dist/internals.d.ts +645 -47
  70. package/dist/internals.d.ts.map +1 -1
  71. package/dist/internals.js +79 -79
  72. package/dist/internals.js.br +0 -0
  73. package/dist/internals.js.gz +0 -0
  74. package/dist/internals.mjs +4 -4
  75. package/dist/internals.mjs.br +0 -0
  76. package/dist/internals.mjs.gz +0 -0
  77. package/dist/pptx-viewer.css +1 -1
  78. package/dist/pptx-viewer.css.br +0 -0
  79. package/dist/pptx-viewer.css.gz +0 -0
  80. package/dist/{types-DU35aAJK.d.ts → types-TCH6icpi.d.ts} +25 -31
  81. package/dist/types-TCH6icpi.d.ts.map +1 -0
  82. package/dist/{useViewerBuildingBlocks-C9-prKYB.d.ts → useViewerBuildingBlocks-BKb0qs1j.d.ts} +34 -5
  83. package/dist/useViewerBuildingBlocks-BKb0qs1j.d.ts.map +1 -0
  84. package/dist/viewer/index.d.ts +465 -40
  85. package/dist/viewer/index.js +27 -27
  86. package/dist/viewer/index.js.br +0 -0
  87. package/dist/viewer/index.js.gz +0 -0
  88. package/dist/viewer/index.mjs +6 -6
  89. package/dist/viewer/index.mjs.br +0 -0
  90. package/dist/viewer/index.mjs.gz +0 -0
  91. package/package.json +2 -2
  92. package/dist/AiChatPanel-HCHCVQN2.js.br +0 -0
  93. package/dist/AiChatPanel-HCHCVQN2.js.gz +0 -0
  94. package/dist/AiChatPanel-RZ4A7P4H.mjs.br +0 -0
  95. package/dist/AiChatPanel-RZ4A7P4H.mjs.gz +0 -0
  96. package/dist/Model3DScene-I7FR74AD.mjs.br +0 -0
  97. package/dist/Model3DScene-I7FR74AD.mjs.gz +0 -0
  98. package/dist/Model3DScene-LK7LSQNH.js.br +0 -0
  99. package/dist/Model3DScene-LK7LSQNH.js.gz +0 -0
  100. package/dist/PowerPointViewer-Du7u4INi.d.ts.map +0 -1
  101. package/dist/SurfaceChart3DScene-DEQP5O3U.mjs +0 -76
  102. package/dist/SurfaceChart3DScene-DEQP5O3U.mjs.br +0 -0
  103. package/dist/SurfaceChart3DScene-DEQP5O3U.mjs.gz +0 -0
  104. package/dist/SurfaceChart3DScene-ODQY77SZ.js +0 -78
  105. package/dist/SurfaceChart3DScene-ODQY77SZ.js.br +0 -0
  106. package/dist/SurfaceChart3DScene-ODQY77SZ.js.gz +0 -0
  107. package/dist/chunk-422DF424.mjs.br +0 -0
  108. package/dist/chunk-422DF424.mjs.gz +0 -0
  109. package/dist/chunk-5BXATG54.js.br +0 -0
  110. package/dist/chunk-5BXATG54.js.gz +0 -0
  111. package/dist/chunk-7JPLVECA.js.br +0 -0
  112. package/dist/chunk-7JPLVECA.js.gz +0 -0
  113. package/dist/chunk-AONFHTTJ.js.br +0 -0
  114. package/dist/chunk-AONFHTTJ.js.gz +0 -0
  115. package/dist/chunk-ATOUVRRQ.js.br +0 -0
  116. package/dist/chunk-ATOUVRRQ.js.gz +0 -0
  117. package/dist/chunk-FXJOTEPO.mjs.br +0 -0
  118. package/dist/chunk-FXJOTEPO.mjs.gz +0 -0
  119. package/dist/chunk-K2QU73KB.mjs.br +0 -0
  120. package/dist/chunk-K2QU73KB.mjs.gz +0 -0
  121. package/dist/chunk-MQHC5TXI.mjs.br +0 -0
  122. package/dist/chunk-MQHC5TXI.mjs.gz +0 -0
  123. package/dist/chunk-NQJPPIVH.js.br +0 -0
  124. package/dist/chunk-NQJPPIVH.js.gz +0 -0
  125. package/dist/chunk-S64T7C4V.mjs.br +0 -0
  126. package/dist/chunk-S64T7C4V.mjs.gz +0 -0
  127. package/dist/chunk-TCGXGD6E.js.br +0 -0
  128. package/dist/chunk-TCGXGD6E.js.gz +0 -0
  129. package/dist/chunk-ZA5JONCW.mjs.br +0 -0
  130. package/dist/chunk-ZA5JONCW.mjs.gz +0 -0
  131. package/dist/types-DU35aAJK.d.ts.map +0 -1
  132. package/dist/useViewerBuildingBlocks-C9-prKYB.d.ts.map +0 -1
@@ -185,11 +185,18 @@ interface XmlObject {
185
185
  [child: string]: XmlObject | XmlObject[] | string | undefined;
186
186
  }
187
187
  /**
188
- * Shape lock attributes from `p:cNvSpPr / a:spLocks`.
188
+ * Lock attributes from an element's non-visual properties node.
189
189
  *
190
190
  * When a flag is `true` the corresponding user interaction is disabled
191
191
  * in the editor (e.g. `noRotation` prevents free rotation of the shape).
192
192
  *
193
+ * One bag covers every family, but the families are NOT interchangeable in
194
+ * the file: `a:spLocks` (`CT_ShapeLocking`), `a:picLocks`, `a:cxnSpLocks`,
195
+ * `a:grpSpLocks` (`CT_GroupLocking`) and `a:graphicFrameLocks`
196
+ * (`CT_GraphicalObjectFrameLocking`) each declare their own attribute subset.
197
+ * `runtime/shape-lock-containers` holds that table and is what decides which
198
+ * of these fields may be written for a given element.
199
+ *
193
200
  * @example
194
201
  * ```ts
195
202
  * const locks: PptxShapeLocks = { noMove: true, noResize: true };
@@ -208,6 +215,14 @@ interface PptxShapeLocks {
208
215
  noAdjustHandles?: boolean;
209
216
  noChangeArrowheads?: boolean;
210
217
  noChangeShapeType?: boolean;
218
+ /**
219
+ * `a:graphicFrameLocks/@noDrilldown`: forbids selecting the individual
220
+ * parts inside a graphic frame (a chart series, a SmartArt node). Declared
221
+ * ONLY by `CT_GraphicalObjectFrameLocking`, so it is written for tables,
222
+ * charts, SmartArt, OLE objects and graphic-frame media, and never onto
223
+ * `a:spLocks` / `a:picLocks` / `a:cxnSpLocks` / `a:grpSpLocks`.
224
+ */
225
+ noDrilldown?: boolean;
211
226
  /**
212
227
  * Text-box flag from `p:cNvSpPr/@txBox`. Not a lock in the strict sense,
213
228
  * but it lives on the same non-visual-properties node as `a:spLocks`, so
@@ -1147,6 +1162,22 @@ interface ShapeStyle {
1147
1162
  fontRefIdx?: string;
1148
1163
  /** Raw XML colour child of `<a:fontRef>`. */
1149
1164
  fontRefColorXml?: XmlObject;
1165
+ /**
1166
+ * The fill `<a:fillRef>` resolved to, recorded ONLY when the shape's own
1167
+ * `spPr` authored no fill at all, so the reference is what paints it.
1168
+ *
1169
+ * Its absence therefore means "the fill is the shape's own", and its
1170
+ * presence plus an unchanged flat fill means "still purely inherited": see
1171
+ * `authored-shape-style.ts`, the shape-scope twin of `TextStyle`'s
1172
+ * `inheritedRunStyle`.
1173
+ */
1174
+ inheritedFillStyle?: ShapeStyle;
1175
+ /**
1176
+ * The outline `<a:lnRef>` resolved to, recorded before `spPr/a:ln` was
1177
+ * layered on top. A property that still equals this baseline was never
1178
+ * authored on the shape and must not be written back as if it were.
1179
+ */
1180
+ inheritedLineStyle?: ShapeStyle;
1150
1181
  }
1151
1182
  //#endregion
1152
1183
  //#region src/core/types/text.d.ts
@@ -1187,6 +1218,60 @@ interface ShapeStyle {
1187
1218
  interface TextStyle {
1188
1219
  /** Original `a:rPr` XML retained by projections that share the shape-text model. */
1189
1220
  runPropertiesXml?: XmlObject;
1221
+ /**
1222
+ * The properties this run's OWN `a:rPr` authored, and nothing else.
1223
+ *
1224
+ * A run style is assembled as
1225
+ * `{...inheritedRunStyle, ...authoredRunStyle}`, so the flat style is a
1226
+ * fully RESOLVED view: it cannot say whether `fontSize: 60` came from the
1227
+ * run, from the shape's `a:lstStyle`, from the layout placeholder, from the
1228
+ * master `p:txStyles` or from the theme. Omission is meaningful in OOXML
1229
+ * (§21.1.2.3), so a writer that re-emits the resolved view converts every
1230
+ * inherited value into an authored one and the deck stops being
1231
+ * theme-driven after one save.
1232
+ *
1233
+ * This is the run-scope twin of {@link TextSegment.paragraphProperties},
1234
+ * which is parsed strictly from the paragraph's own `a:pPr` for the same
1235
+ * reason. Present only for runs that came from a parsed deck; absent for
1236
+ * SDK-built text, where the flat style IS the only description and must be
1237
+ * written out in full.
1238
+ */
1239
+ authoredRunStyle?: TextStyle;
1240
+ /**
1241
+ * The resolved inheritance baseline {@link authoredRunStyle} was layered
1242
+ * on top of (shape `a:lstStyle` -> placeholder -> layout -> master
1243
+ * `p:txStyles` -> theme -> `p:defaultTextStyle`).
1244
+ *
1245
+ * Kept alongside the authored half because the two answer different
1246
+ * questions. The authored half says "the source pinned this"; the baseline
1247
+ * says "this value is what inheritance already produces", which is how an
1248
+ * EDIT is told apart from an inherited value: an editor mutates the flat
1249
+ * style without knowing about either field, so a property that now differs
1250
+ * from the baseline was either authored or edited and must be written,
1251
+ * while one that still matches can be left to inherit.
1252
+ *
1253
+ * Holds a reference to the per-paragraph baseline object rather than a
1254
+ * copy, so carrying it costs one pointer per run.
1255
+ */
1256
+ inheritedRunStyle?: TextStyle;
1257
+ /**
1258
+ * Snapshot of the ELEMENT-scope paragraph geometry (alignment, margins,
1259
+ * indent, line and paragraph spacing, tab stops, rtl, line-break flags) as
1260
+ * the load pipeline resolved it.
1261
+ *
1262
+ * Present only on an `element.textStyle` that came from a parsed deck, and
1263
+ * populated only with the geometry keys. It exists so the save path can
1264
+ * answer one question it otherwise cannot: has the user CHANGED the body's
1265
+ * alignment or indent, or is the value simply what the shape's
1266
+ * `a:lstStyle`, its layout placeholder and the master already produce?
1267
+ * Element-level text panels (`textAdvancedPatch`, `alignPatch` and friends
1268
+ * in `pptx-viewer-shared`) write `element.textStyle` and never touch
1269
+ * `segment.paragraphProperties`, so a diff against this snapshot is the
1270
+ * only way to tell an edit from an inheritance artefact.
1271
+ *
1272
+ * @see element-paragraph-geometry.ts
1273
+ */
1274
+ resolvedParagraphGeometry?: TextStyle;
1190
1275
  fontFamily?: string;
1191
1276
  fontSize?: number;
1192
1277
  /** When true, renderer should shrink text to fit the shape bounds. */
@@ -1851,6 +1936,15 @@ interface PptxElementBase {
1851
1936
  shapeId?: string;
1852
1937
  /** Element name from `cNvPr/@name`. Used for morph transition matching via the `!!` naming convention. */
1853
1938
  name?: string;
1939
+ /**
1940
+ * `p:nvSpPr/p:nvPr/p:ph/@type` (lower-cased) when the shape is a placeholder:
1941
+ * `title`, `ctrtitle`, `body`, `subtitle`, `ftr`, `dt`, `sldnum`, ...
1942
+ *
1943
+ * Captured on load so consumers can tell a footer placeholder from a text box
1944
+ * without re-walking `rawXml`. Absent on non-placeholder shapes and on
1945
+ * SDK-created elements.
1946
+ */
1947
+ placeholderType?: string;
1854
1948
  x: number;
1855
1949
  y: number;
1856
1950
  width: number;
@@ -1911,6 +2005,19 @@ interface PptxTextProperties {
1911
2005
  }>;
1912
2006
  /** Placeholder prompt text inherited from layout/master (e.g. "Click to add title"). Shown as a greyed-out hint when the shape has no user-entered text. */
1913
2007
  promptText?: string;
2008
+ /**
2009
+ * The string {@link text} was INHERITED from, when this is a header / footer /
2010
+ * date / slide-number placeholder whose own body the file leaves empty.
2011
+ *
2012
+ * PowerPoint keeps the footer string on the slide master and writes each
2013
+ * slide's copy of the `ftr` placeholder empty, so the empty body means
2014
+ * "render the master's footer here". Rendering needs the resolved string, but
2015
+ * SAVING it into the slide would pin that slide to today's master text and
2016
+ * silently detach it from the Header & Footer dialog. The save writer
2017
+ * therefore leaves the authored empty body alone while `text` still equals
2018
+ * this value, and writes a genuine per-slide override once it does not.
2019
+ */
2020
+ inheritedPlaceholderText?: string;
1914
2021
  /** Linked text box chain ID from `a:bodyPr > a:linkedTxbx/@id` or `a:txbx > a:linkedTxbx/@id`. Text overflows from one linked frame to the next. */
1915
2022
  linkedTxbxId?: number;
1916
2023
  /** Sequence number within a linked text box chain (0-based). */
@@ -2321,6 +2428,12 @@ interface PptxChartLineStyle {
2321
2428
  }
2322
2429
  /** Marker symbol types for line/scatter chart data points. */
2323
2430
  type PptxChartMarkerSymbol = 'circle' | 'dash' | 'diamond' | 'dot' | 'none' | 'picture' | 'plus' | 'square' | 'star' | 'triangle' | 'x' | 'auto';
2431
+ /**
2432
+ * `ST_ScatterStyle` (ECMA-376 §21.2.3.40): how a scatter chart joins its points.
2433
+ * `line`/`lineMarker` connect them with straight segments, `smooth`/
2434
+ * `smoothMarker` with a bezier, `marker`/`none` not at all.
2435
+ */
2436
+ type PptxChartScatterStyle = 'none' | 'line' | 'lineMarker' | 'marker' | 'smooth' | 'smoothMarker';
2324
2437
  /** Shape properties extracted from c:spPr for chart formatting. */
2325
2438
  interface PptxChartShapeProps {
2326
2439
  fillColor?: string;
@@ -2522,6 +2635,42 @@ interface PptxChartTreemapOptions {
2522
2635
  interface PptxChartSeries {
2523
2636
  name: string;
2524
2637
  values: number[];
2638
+ /**
2639
+ * Per-series x values from `c:ser/c:xVal` (scatter and bubble series only).
2640
+ *
2641
+ * Every `CT_ScatterSer` / `CT_BubbleSer` carries its OWN `c:xVal`, so two
2642
+ * series in one scatter chart routinely plot against different x ranges (the
2643
+ * normal case for measurement data). Reading the x values off the first
2644
+ * series and reusing them everywhere plotted every series against series 1's
2645
+ * x axis. Absent for category-axis chart kinds, where
2646
+ * {@link PptxChartData.categories} is the x axis.
2647
+ */
2648
+ xValues?: number[];
2649
+ /**
2650
+ * Per-series bubble sizes from `c:ser/c:bubbleSize` (bubble series only),
2651
+ * aligned index-for-index with {@link values}.
2652
+ *
2653
+ * `CT_BubbleSer` carries x, y AND size, so a one-series bubble chart is fully
2654
+ * specified. Absent when the source omits `c:bubbleSize`.
2655
+ */
2656
+ bubbleSizes?: number[];
2657
+ /**
2658
+ * Series-level data-label content flags from `c:ser/c:dLbls`.
2659
+ *
2660
+ * PowerPoint writes the flags a user picks in "Format Data Labels" onto the
2661
+ * SERIES, and leaves the chart-type-level `c:dLbls` all-zero, so reading only
2662
+ * the chart-level group reports "show nothing" for a chart that visibly shows
2663
+ * percentages. These override {@link PptxChartStyle.dataLabels}.
2664
+ */
2665
+ dataLabelOptions?: PptxChartDataLabelOptions;
2666
+ /**
2667
+ * Whether the series line is explicitly suppressed
2668
+ * (`c:ser/c:spPr/a:ln/a:noFill`). Line-drawn kinds (line, scatter, radar)
2669
+ * use this to decide whether to draw a connecting line at all; a marker-only
2670
+ * scatter is authored as `scatterStyle="lineMarker"` PLUS this flag, never by
2671
+ * changing the scatter style.
2672
+ */
2673
+ lineNoFill?: boolean;
2525
2674
  /**
2526
2675
  * Blank-value mask aligned index-for-index with {@link values}: `true` marks
2527
2676
  * a category whose numeric cache point (`c:numCache/c:pt`) was absent or
@@ -2865,6 +3014,17 @@ interface PptxChartData {
2865
3014
  * default), so only horizontal bar charts need to carry the field.
2866
3015
  */
2867
3016
  barDirection?: PptxChartBarDirection;
3017
+ /**
3018
+ * Scatter presentation mode (`c:scatterChart/c:scatterStyle/@val`).
3019
+ *
3020
+ * `lineMarker` (PowerPoint's own default for every scatter it writes) and
3021
+ * `smoothMarker` draw a connecting line; `marker` and `none` do not. Whether
3022
+ * the MARKERS appear is decided separately by `c:marker/c:symbol`, and
3023
+ * whether the LINE appears is further gated by
3024
+ * {@link PptxChartSeries.lineNoFill} - PowerPoint expresses "markers only" as
3025
+ * `lineMarker` plus an `a:ln/a:noFill`, not as `marker`.
3026
+ */
3027
+ scatterStyle?: PptxChartScatterStyle;
2868
3028
  /**
2869
3029
  * Bar/column gap between category clusters as a percentage of bar width
2870
3030
  * (`c:gapWidth/@val`, 0 through 500). Absent uses the renderer default.
@@ -3018,6 +3178,53 @@ interface PptxChartData {
3018
3178
  * // => { brightness: 20, contrast: -10, grayscale: true } satisfies PptxImageEffects
3019
3179
  * ```
3020
3180
  */
3181
+ /**
3182
+ * One `a14:foregroundMark` / `a14:backgroundMark` polyline hint recorded while
3183
+ * the user painted over the picture in PowerPoint's "Remove Background" mode.
3184
+ * Coordinates are 0..1 fractions of the image.
3185
+ */
3186
+ interface PptxBackgroundRemovalMark {
3187
+ x1: number;
3188
+ y1: number;
3189
+ x2: number;
3190
+ y2: number;
3191
+ }
3192
+ /**
3193
+ * PowerPoint "Remove Background" state (`a14:backgroundRemoval`).
3194
+ *
3195
+ * The four edges are the RETAINED rectangle as 0..1 fractions of the image
3196
+ * (OOXML stores them as per-100000 relative units), and the mark lists are the
3197
+ * segmentation hints the user painted.
3198
+ *
3199
+ * **This is edit-time metadata, not a render instruction.** PowerPoint bakes the
3200
+ * removal into the bitmap referenced by the main `a:blip/@r:embed` and keeps the
3201
+ * pristine original in `a14:imgLayer/@r:embed`. Verified against PowerPoint COM:
3202
+ * a slide exported with and without this element is byte-identical. A renderer
3203
+ * that clips to the retained rectangle would clip an image whose background has
3204
+ * already been removed.
3205
+ *
3206
+ * @example
3207
+ * ```ts
3208
+ * const removal: PptxBackgroundRemoval = { top: 0.12, bottom: 0.88, left: 0.07, right: 0.93 };
3209
+ * // => retains the middle of the image; the marks list stays empty
3210
+ * ```
3211
+ */
3212
+ interface PptxBackgroundRemoval {
3213
+ /** Top edge of the retained rectangle (0..1 fraction of the image height). */
3214
+ top: number;
3215
+ /** Bottom edge of the retained rectangle (0..1 fraction of the image height). */
3216
+ bottom: number;
3217
+ /** Left edge of the retained rectangle (0..1 fraction of the image width). */
3218
+ left: number;
3219
+ /** Right edge of the retained rectangle (0..1 fraction of the image width). */
3220
+ right: number;
3221
+ /** Strokes marking regions the user forced to be foreground. */
3222
+ foregroundMarks?: PptxBackgroundRemovalMark[];
3223
+ /** Strokes marking regions the user forced to be background. */
3224
+ backgroundMarks?: PptxBackgroundRemovalMark[];
3225
+ /** Original effect XML, retained for lossless re-emission. */
3226
+ rawXml?: XmlObject;
3227
+ }
3021
3228
  interface PptxImageEffects {
3022
3229
  /** Brightness adjustment (-100 to 100). */
3023
3230
  brightness?: number;
@@ -3041,8 +3248,38 @@ interface PptxImageEffects {
3041
3248
  };
3042
3249
  /** Artistic effect name (blur, pencilGrayscale, paintStrokes, etc.). */
3043
3250
  artisticEffect?: string;
3044
- /** Artistic effect radius/amount. */
3251
+ /** Artistic effect radius/amount, normalised to 0..100. */
3045
3252
  artisticRadius?: number;
3253
+ /**
3254
+ * Every numeric attribute of the source `a14:artistic*` element, raw and
3255
+ * un-normalised (`trans`, `pencilSize`, `crackSpacing`, …). The attribute set
3256
+ * differs per effect, so this is the lossless companion to the single
3257
+ * {@link PptxImageEffects.artisticRadius} number.
3258
+ */
3259
+ artisticParams?: Record<string, number>;
3260
+ /**
3261
+ * Name of the artistic effect ALREADY baked into the image data, which a
3262
+ * renderer must not apply a second time. Set from the `a14` blip extension,
3263
+ * which PowerPoint writes alongside a pre-rendered bitmap (see
3264
+ * {@link PptxBackgroundRemoval}), and normally equal to
3265
+ * {@link PptxImageEffects.artisticEffect}.
3266
+ *
3267
+ * It records the NAME rather than a boolean so that picking a different
3268
+ * effect in this library's inspector (which patches `artisticEffect` alone)
3269
+ * still renders: the two names then differ.
3270
+ */
3271
+ artisticPrerenderedEffect?: string;
3272
+ /**
3273
+ * PowerPoint "Remove Background" state (`a14:backgroundRemoval`). Edit-time
3274
+ * metadata: the removal is already baked into the image data.
3275
+ */
3276
+ backgroundRemoval?: PptxBackgroundRemoval;
3277
+ /**
3278
+ * `a14:imgLayer/@r:embed` — relationship id of the PRISTINE original image
3279
+ * the baked effects were derived from (PowerPoint stores it as an HD Photo
3280
+ * `.wdp` part, which browsers cannot decode).
3281
+ */
3282
+ originalImageRelId?: string;
3046
3283
  /** Alpha modulation fixed: non-negative percentage (100 means unchanged opacity). */
3047
3284
  alphaModFix?: number;
3048
3285
  /** Original alpha modulation fixed node, including foreign attributes. */
@@ -4954,7 +5191,7 @@ interface UnknownPptxElement extends PptxElementBase {
4954
5191
  /**
4955
5192
  * A single element on a PPTX slide.
4956
5193
  *
4957
- * This is a **discriminated union** narrow on `element.type` to access
5194
+ * This is a **discriminated union**: narrow on `element.type` to access
4958
5195
  * variant-specific properties like `imageData` (image/picture), `pathData`
4959
5196
  * (shape), or `textSegments` (text/shape).
4960
5197
  */
@@ -5687,6 +5924,54 @@ interface PptxEmbeddedFontList {
5687
5924
  rawXml?: XmlObject;
5688
5925
  }
5689
5926
  //#endregion
5927
+ //#region src/core/types/comment-mentions.d.ts
5928
+ /**
5929
+ * A single `@`-mention inside a modern comment body.
5930
+ *
5931
+ * Offsets index into the comment's FLATTENED plain text: every `a:t` value
5932
+ * below `p188:txBody` concatenated, with paragraphs joined by `\n`. That is the
5933
+ * same string `PptxComment.text` carries, so an edit to `text` invalidates
5934
+ * every offset after the edit point and the serializer re-bases them.
5935
+ *
5936
+ * The markup Office uses for a mention is `CT_Mention` (documented for the
5937
+ * SpreadsheetML `2018/threadedcomments` part): `mentionpersonId`, `mentionId`,
5938
+ * `startIndex` and `length`. The PowerPoint `2018/8/main` schema does not
5939
+ * publish a mention element at all, so `rawXml` is retained and re-emitted
5940
+ * attribute-for-attribute: a producer that spells the attributes differently
5941
+ * still round-trips.
5942
+ *
5943
+ * @example
5944
+ * ```ts
5945
+ * const mention: PptxCommentMention = {
5946
+ * personId: "{2CB2E9D0-D392-EB21-5D46-FBA34C1295E6}",
5947
+ * authorName: "Bob Example",
5948
+ * startIndex: 3,
5949
+ * length: 11,
5950
+ * };
5951
+ * // => "Hi Bob Example can you check this".slice(3, 14) === "Bob Example"
5952
+ * ```
5953
+ */
5954
+ interface PptxCommentMention {
5955
+ /** `mentionId`: GUID identifying this mention instance. */
5956
+ id?: string;
5957
+ /** `mentionpersonId`: the `p188:author` id of the mentioned person. */
5958
+ personId: string;
5959
+ /** Display name resolved from the author list at parse time, when known. */
5960
+ authorName?: string;
5961
+ /** Character offset of the mentioned span in the flattened plain text. */
5962
+ startIndex: number;
5963
+ /** Character length of the mentioned span. */
5964
+ length: number;
5965
+ /**
5966
+ * `uri` of the `p188:ext` this mention list was read from. Undefined means
5967
+ * the list is a direct child of `p188:cm`, which is where it is written for
5968
+ * newly authored mentions.
5969
+ */
5970
+ containerUri?: string;
5971
+ /** Original `p188:mention` node, retained for unknown-attribute preservation. */
5972
+ rawXml?: XmlObject;
5973
+ }
5974
+ //#endregion
5690
5975
  //#region src/core/types/metadata.d.ts
5691
5976
  /**
5692
5977
  * A slide comment — may be a legacy positional comment or a modern
@@ -5733,6 +6018,8 @@ interface PptxComment {
5733
6018
  title?: string;
5734
6019
  /** Modern threaded comment support (p15:threadingInfo). */
5735
6020
  threadId?: string;
6021
+ /** `@`-mentions, indexed into `text` (see {@link PptxCommentMention}). */
6022
+ mentions?: PptxCommentMention[];
5736
6023
  /** Replies to this comment (for modern threaded comments). */
5737
6024
  replies?: PptxComment[];
5738
6025
  /** ID of the element this comment is associated with (if any). */
@@ -6252,7 +6539,7 @@ interface PptxTheme {
6252
6539
  * // => "morph" — one of 40+ transition effects
6253
6540
  * ```
6254
6541
  */
6255
- 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' | 'fallOver' | 'drape' | 'curtains' | 'wind' | 'prestige' | 'fracture' | 'crush' | 'peelOff' | 'pageCurlDouble' | 'pageCurlSingle' | 'airplane' | 'origami';
6542
+ 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' | 'box' | 'orbit' | 'fallOver' | 'drape' | 'curtains' | 'wind' | 'prestige' | 'fracture' | 'crush' | 'peelOff' | 'pageCurlDouble' | 'pageCurlSingle' | 'airplane' | 'origami';
6256
6543
  /** Split orientation from OOXML `@_orient`. */
6257
6544
  type PptxSplitOrientation = 'horz' | 'vert';
6258
6545
  /** Schema-defined `ST_TransitionSpeed` values. */
@@ -6547,6 +6834,18 @@ interface PptxSlideBackgroundPattern {
6547
6834
  interface PptxSlide {
6548
6835
  id: string;
6549
6836
  rId: string;
6837
+ /**
6838
+ * `p:sldIdLst/p:sldId/@id` (ST_SlideId, 256..2147483647): the numeric key
6839
+ * that sections (`p14:sldIdLst/p14:sldId/@id`) and section/summary zooms
6840
+ * name slides by.
6841
+ *
6842
+ * It lives in `presentation.xml`, NOT in the slide part, so it cannot be
6843
+ * recovered from `rawXml`. Without it on the model, code that writes a
6844
+ * section's membership has nothing correct to write and falls back to the
6845
+ * slide NUMBER, which is 1-based and therefore never matches a real deck's
6846
+ * ids: the section reloads with no slides in it.
6847
+ */
6848
+ slideId?: string;
6550
6849
  sourceSlideId?: string;
6551
6850
  /** Optional author-supplied slide name (set via `SlideBuilder.setName`). */
6552
6851
  name?: string;
@@ -6749,6 +7048,26 @@ interface PptxPresentationProperties {
6749
7048
  /** Kiosk auto-restart interval in milliseconds (from `p:kiosk/@restart`). Only meaningful when showType is "kiosk". */
6750
7049
  kioskRestartTime?: number;
6751
7050
  }
7051
+ /**
7052
+ * Slide dimensions from `p:sldSz` (CT_SlideSize, ECMA-376 §19.2.1.39).
7053
+ *
7054
+ * @example
7055
+ * ```ts
7056
+ * const size: PptxSlideSize = { widthEmu: 9144000, heightEmu: 6858000, type: 'screen4x3' };
7057
+ * // => satisfies PptxSlideSize
7058
+ * ```
7059
+ */
7060
+ interface PptxSlideSize {
7061
+ /** `@cx` in EMU. Omitted or non-positive values leave the loaded width alone. */
7062
+ widthEmu?: number;
7063
+ /** `@cy` in EMU. Omitted or non-positive values leave the loaded height alone. */
7064
+ heightEmu?: number;
7065
+ /**
7066
+ * `@type` (ST_SlideSizeType). The schema default is `custom`, which is
7067
+ * why PowerPoint omits the attribute for a non-preset size.
7068
+ */
7069
+ type?: string;
7070
+ }
6752
7071
  /**
6753
7072
  * A named custom slide show (`p:custShowLst / p:custShow`).
6754
7073
  *
@@ -7763,6 +8082,19 @@ interface PptxHandlerSaveOptions {
7763
8082
  customerData?: PptxCustomerData[];
7764
8083
  /** Photo album metadata to save back to `p:photoAlbum`. */
7765
8084
  photoAlbum?: PptxPhotoAlbum;
8085
+ /**
8086
+ * Slide dimensions to write back to `p:sldSz`.
8087
+ *
8088
+ * Omitting the option preserves the load-time dimensions verbatim, which
8089
+ * is why an edit made through a viewer's Slide Size control has to reach
8090
+ * the save call: nothing else in the pipeline can observe it.
8091
+ *
8092
+ * PowerPoint derives `Presentation.PageSetup.SlideSize` from `@cx`/`@cy`
8093
+ * alone (verified by COM: an A4-typed `p:sldSz` carrying 4:3 dimensions
8094
+ * still reports `ppSlideSizeCustom`), so `type` is written for fidelity
8095
+ * but the dimensions are what actually decide the reported preset.
8096
+ */
8097
+ slideSize?: PptxSlideSize;
7766
8098
  /** East Asian line-break settings to save back to `p:kinsoku`. */
7767
8099
  kinsoku?: PptxKinsoku | null;
7768
8100
  /** Write-protection verifier. Set to `null` to remove, `undefined` to preserve existing. */
@@ -8354,24 +8686,38 @@ declare class PptxHandlerCore {
8354
8686
  name?: string;
8355
8687
  }>>;
8356
8688
  /**
8357
- * Export selected slides as individual PPTX files.
8689
+ * Export selected slides to a vector or raster format, keyed by slide index.
8690
+ *
8691
+ * **This does not produce PPTX files.** The previous version of this comment
8692
+ * said each entry was "a standalone PPTX with only that slide", named the
8693
+ * option `slideIndexes` (the real field is `slideIndices`), and wrote the
8694
+ * bytes to `slide_N.pptx`. None of that was ever true: the runtime has
8695
+ * always taken a `format` of `svg` / `png` / `pdf`. Per-slide PPTX
8696
+ * extraction is a different operation and is not implemented here.
8358
8697
  *
8359
- * Each entry in the returned map is keyed by slide index and contains a
8360
- * standalone `Uint8Array` PPTX with only that slide.
8698
+ * Only `svg` works without a host-supplied backend, and it works fully:
8699
+ * the headless {@link SvgExporter} renders it with no DOM. `png` and `pdf`
8700
+ * THROW, because this package carries no rasteriser; use a viewer binding's
8701
+ * browser export pipeline, or override `exportSlides` on the runtime with
8702
+ * your own backend.
8361
8703
  *
8362
8704
  * @param slides - Full slide array.
8363
- * @param options - Export options (slide indexes, format, etc.).
8364
- * @returns A `Map<slideIndex, Uint8Array>` of exported files.
8705
+ * @param options - Export options (`format`, `slideIndices`, `width`, ...).
8706
+ * @returns A `Map<slideIndex, Uint8Array>` of exported files. Hidden slides
8707
+ * are omitted unless `options.includeHidden` is set, so the map can be
8708
+ * smaller than `options.slideIndices`.
8709
+ * @throws {Error} when `options.format` is `png` or `pdf`.
8365
8710
  *
8366
8711
  * @example
8367
8712
  * ```ts
8368
8713
  * const exports = await handler.exportSlides(data.slides, {
8369
- * slideIndexes: [0, 2],
8714
+ * format: 'svg',
8715
+ * slideIndices: [0, 2],
8370
8716
  * });
8371
8717
  * for (const [idx, bytes] of exports) {
8372
- * await fs.writeFile(`slide_${idx}.pptx`, Buffer.from(bytes));
8718
+ * await fs.writeFile(`slide_${idx}.svg`, Buffer.from(bytes));
8373
8719
  * }
8374
- * // => Map<number, Uint8Array> one standalone .pptx per exported slide
8720
+ * // => Map<number, Uint8Array>: one SVG document per exported slide
8375
8721
  * ```
8376
8722
  */
8377
8723
  exportSlides(slides: PptxSlide[], options: PptxExportOptions): Promise<Map<number, Uint8Array>>;
@@ -8721,6 +9067,91 @@ interface CollaborationConfig {
8721
9067
  */
8722
9068
  writeBackDebounceMs?: number;
8723
9069
  }
9070
+ //#endregion
9071
+ //#region src/render/shape-adjustment-model.d.ts
9072
+ /**
9073
+ * `shape-adjustment-model`: the vocabulary the adjust-handle modules share.
9074
+ *
9075
+ * The `a:ahLst` work is split three ways for the repo's file-size budget:
9076
+ * `shape-adjustment-probe` measures the geometry, `shape-adjustment-handles`
9077
+ * derives the handles from those measurements, and `shape-adjustment-solver`
9078
+ * turns a pointer position back into guide values. All three need these types
9079
+ * and the one rule that operates purely on them, so they live here and the
9080
+ * dependency graph stays a DAG rather than a cycle.
9081
+ *
9082
+ * @module render/shape-adjustment-model
9083
+ */
9084
+ /**
9085
+ * How a pointer position becomes a guide value, captured once when the gesture
9086
+ * starts so `pointermove` stays pure arithmetic.
9087
+ */
9088
+ interface ShapeAdjustmentSolver {
9089
+ /** `linear`: the handle slides. `angular`: it swings about {@link centerX}. */
9090
+ kind: 'linear' | 'angular';
9091
+ /** Handle position in element-local px at {@link startValue}. */
9092
+ anchorX: number;
9093
+ anchorY: number;
9094
+ /** Element-local px the handle travels per ONE unit of guide value. */
9095
+ dirX: number;
9096
+ dirY: number;
9097
+ /** Pivot for an angular handle (the shape centre). */
9098
+ centerX: number;
9099
+ centerY: number;
9100
+ /** The guide value the anchor was measured at. */
9101
+ startValue: number;
9102
+ /** Guide-space bounds, taken from the preset's own `pin` clamp. */
9103
+ min: number;
9104
+ max: number;
9105
+ }
9106
+ /** One guide a handle drives. */
9107
+ interface AdjustmentAxisSolver {
9108
+ key: string;
9109
+ solver: ShapeAdjustmentSolver;
9110
+ }
9111
+ /** Descriptor for one draggable adjustment handle (the amber diamond). */
9112
+ interface ShapeAdjustmentHandleDescriptor {
9113
+ /** The `a:avLst` guide name this handle writes (`adj`, `adj1`, ...). */
9114
+ key: string;
9115
+ /** Handle x offset in element-local px (origin = element top-left). */
9116
+ left: number;
9117
+ /** Handle y offset in element-local px. */
9118
+ top: number;
9119
+ /**
9120
+ * Current adjustment value in GUIDE units, not a 0-1 fraction. Most presets
9121
+ * range 0..50000 or 0..100000 and the angular ones run to 21,600,000.
9122
+ */
9123
+ value: number;
9124
+ cursor: string;
9125
+ /**
9126
+ * How this handle's drag resolves, measured off the preset geometry: one
9127
+ * entry per `a:avLst` guide it drives (callouts drive two). Absent only for
9128
+ * a caller that built a descriptor by hand.
9129
+ */
9130
+ solvers?: AdjustmentAxisSolver[];
9131
+ }
9132
+ /** Live drag state captured when an adjustment gesture starts. */
9133
+ interface ShapeAdjustmentDragState {
9134
+ elementId: string;
9135
+ key: string;
9136
+ shapeType: string;
9137
+ startClientX: number;
9138
+ startClientY: number;
9139
+ startAdjustment: number;
9140
+ startWidth: number;
9141
+ startHeight: number;
9142
+ moved: boolean;
9143
+ /** Copied from the descriptor the gesture started on. */
9144
+ solvers?: AdjustmentAxisSolver[];
9145
+ /**
9146
+ * The element's whole `a:avLst` map at gesture start.
9147
+ *
9148
+ * A binding writes `shapeAdjustments` as one object, so a drag that sent
9149
+ * only the guide it changed would DELETE every other authored adjustment on
9150
+ * a multi-adjust preset (a `quadArrow` would lose two of its three the first
9151
+ * time one was touched).
9152
+ */
9153
+ startAdjustments?: Record<string, number>;
9154
+ }
8724
9155
  /**
8725
9156
  * A font supplied by the host application. The package never ships fonts:
8726
9157
  * applications provide a licensed URL, data URL, or blob URL for their users.
@@ -8942,34 +9373,6 @@ interface ResizeState {
8942
9373
  lastWidth: number;
8943
9374
  lastHeight: number;
8944
9375
  }
8945
- /**
8946
- * Describes the position and value of a shape adjustment handle (yellow diamond).
8947
- * Adjustment handles allow users to modify shape parameters like corner radius,
8948
- * arrow width, etc. without a full resize.
8949
- */
8950
- interface ShapeAdjustmentHandleDescriptor {
8951
- key: string;
8952
- left: number;
8953
- top: number;
8954
- value: number;
8955
- cursor: string;
8956
- }
8957
- /**
8958
- * Tracks the state of an ongoing shape adjustment handle drag.
8959
- * Used when the user drags the yellow diamond handle to alter
8960
- * shape-specific parameters (e.g. corner radius on a rounded rectangle).
8961
- */
8962
- interface ShapeAdjustmentDragState {
8963
- elementId: string;
8964
- key: string;
8965
- shapeType: string;
8966
- startClientX: number;
8967
- startClientY: number;
8968
- startAdjustment: number;
8969
- startWidth: number;
8970
- startHeight: number;
8971
- moved: boolean;
8972
- }
8973
9376
  /**
8974
9377
  * A snapshot of editor state captured for undo/redo history.
8975
9378
  * Contains the full slide deck state at a point in time so that
@@ -9448,6 +9851,28 @@ interface PowerPointViewerProps {
9448
9851
  onOpenFile?: () => void;
9449
9852
  /** Whether editing actions are enabled */
9450
9853
  canEdit?: boolean;
9854
+ /**
9855
+ * Recovery autosave: after an edit the deck is re-serialised (always as a
9856
+ * plain, unencrypted package, because recovery has no password) and stashed
9857
+ * in the shared IndexedDB store keyed by {@link filePath}. It is a crash-
9858
+ * safety net and never replaces the user's real Save: the document stays
9859
+ * dirty. On load, a newer snapshot is offered back through a recovery prompt.
9860
+ *
9861
+ * **The prop is a policy ceiling; the title-bar AutoSave toggle is the user's
9862
+ * preference inside it.** `false` turns autosave off and makes the toggle
9863
+ * inert (a user cannot switch on what the application forbade). `true` or
9864
+ * omitted permits it, and the toggle decides, defaulting to on. Identical in
9865
+ * all five bindings; see `resolveAutosaveActivation` in `pptx-viewer-shared`.
9866
+ *
9867
+ * @default true
9868
+ */
9869
+ autosave?: boolean;
9870
+ /**
9871
+ * Recovery cadence in milliseconds. An explicit value is a host policy and is
9872
+ * honoured as given; omit it to follow the user's File > Options > Save >
9873
+ * "Save AutoRecover information every N minutes" (two minutes by default).
9874
+ */
9875
+ autosaveIntervalMs?: number;
9451
9876
  /** Optional class name */
9452
9877
  className?: string;
9453
9878
  /**