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
@@ -183,11 +183,18 @@ interface XmlObject {
183
183
  [child: string]: XmlObject | XmlObject[] | string | undefined;
184
184
  }
185
185
  /**
186
- * Shape lock attributes from `p:cNvSpPr / a:spLocks`.
186
+ * Lock attributes from an element's non-visual properties node.
187
187
  *
188
188
  * When a flag is `true` the corresponding user interaction is disabled
189
189
  * in the editor (e.g. `noRotation` prevents free rotation of the shape).
190
190
  *
191
+ * One bag covers every family, but the families are NOT interchangeable in
192
+ * the file: `a:spLocks` (`CT_ShapeLocking`), `a:picLocks`, `a:cxnSpLocks`,
193
+ * `a:grpSpLocks` (`CT_GroupLocking`) and `a:graphicFrameLocks`
194
+ * (`CT_GraphicalObjectFrameLocking`) each declare their own attribute subset.
195
+ * `runtime/shape-lock-containers` holds that table and is what decides which
196
+ * of these fields may be written for a given element.
197
+ *
191
198
  * @example
192
199
  * ```ts
193
200
  * const locks: PptxShapeLocks = { noMove: true, noResize: true };
@@ -206,6 +213,14 @@ interface PptxShapeLocks {
206
213
  noAdjustHandles?: boolean;
207
214
  noChangeArrowheads?: boolean;
208
215
  noChangeShapeType?: boolean;
216
+ /**
217
+ * `a:graphicFrameLocks/@noDrilldown`: forbids selecting the individual
218
+ * parts inside a graphic frame (a chart series, a SmartArt node). Declared
219
+ * ONLY by `CT_GraphicalObjectFrameLocking`, so it is written for tables,
220
+ * charts, SmartArt, OLE objects and graphic-frame media, and never onto
221
+ * `a:spLocks` / `a:picLocks` / `a:cxnSpLocks` / `a:grpSpLocks`.
222
+ */
223
+ noDrilldown?: boolean;
209
224
  /**
210
225
  * Text-box flag from `p:cNvSpPr/@txBox`. Not a lock in the strict sense,
211
226
  * but it lives on the same non-visual-properties node as `a:spLocks`, so
@@ -1145,6 +1160,22 @@ interface ShapeStyle {
1145
1160
  fontRefIdx?: string;
1146
1161
  /** Raw XML colour child of `<a:fontRef>`. */
1147
1162
  fontRefColorXml?: XmlObject;
1163
+ /**
1164
+ * The fill `<a:fillRef>` resolved to, recorded ONLY when the shape's own
1165
+ * `spPr` authored no fill at all, so the reference is what paints it.
1166
+ *
1167
+ * Its absence therefore means "the fill is the shape's own", and its
1168
+ * presence plus an unchanged flat fill means "still purely inherited": see
1169
+ * `authored-shape-style.ts`, the shape-scope twin of `TextStyle`'s
1170
+ * `inheritedRunStyle`.
1171
+ */
1172
+ inheritedFillStyle?: ShapeStyle;
1173
+ /**
1174
+ * The outline `<a:lnRef>` resolved to, recorded before `spPr/a:ln` was
1175
+ * layered on top. A property that still equals this baseline was never
1176
+ * authored on the shape and must not be written back as if it were.
1177
+ */
1178
+ inheritedLineStyle?: ShapeStyle;
1148
1179
  }
1149
1180
  //#endregion
1150
1181
  //#region src/core/types/text.d.ts
@@ -1185,6 +1216,60 @@ interface ShapeStyle {
1185
1216
  interface TextStyle {
1186
1217
  /** Original `a:rPr` XML retained by projections that share the shape-text model. */
1187
1218
  runPropertiesXml?: XmlObject;
1219
+ /**
1220
+ * The properties this run's OWN `a:rPr` authored, and nothing else.
1221
+ *
1222
+ * A run style is assembled as
1223
+ * `{...inheritedRunStyle, ...authoredRunStyle}`, so the flat style is a
1224
+ * fully RESOLVED view: it cannot say whether `fontSize: 60` came from the
1225
+ * run, from the shape's `a:lstStyle`, from the layout placeholder, from the
1226
+ * master `p:txStyles` or from the theme. Omission is meaningful in OOXML
1227
+ * (§21.1.2.3), so a writer that re-emits the resolved view converts every
1228
+ * inherited value into an authored one and the deck stops being
1229
+ * theme-driven after one save.
1230
+ *
1231
+ * This is the run-scope twin of {@link TextSegment.paragraphProperties},
1232
+ * which is parsed strictly from the paragraph's own `a:pPr` for the same
1233
+ * reason. Present only for runs that came from a parsed deck; absent for
1234
+ * SDK-built text, where the flat style IS the only description and must be
1235
+ * written out in full.
1236
+ */
1237
+ authoredRunStyle?: TextStyle;
1238
+ /**
1239
+ * The resolved inheritance baseline {@link authoredRunStyle} was layered
1240
+ * on top of (shape `a:lstStyle` -> placeholder -> layout -> master
1241
+ * `p:txStyles` -> theme -> `p:defaultTextStyle`).
1242
+ *
1243
+ * Kept alongside the authored half because the two answer different
1244
+ * questions. The authored half says "the source pinned this"; the baseline
1245
+ * says "this value is what inheritance already produces", which is how an
1246
+ * EDIT is told apart from an inherited value: an editor mutates the flat
1247
+ * style without knowing about either field, so a property that now differs
1248
+ * from the baseline was either authored or edited and must be written,
1249
+ * while one that still matches can be left to inherit.
1250
+ *
1251
+ * Holds a reference to the per-paragraph baseline object rather than a
1252
+ * copy, so carrying it costs one pointer per run.
1253
+ */
1254
+ inheritedRunStyle?: TextStyle;
1255
+ /**
1256
+ * Snapshot of the ELEMENT-scope paragraph geometry (alignment, margins,
1257
+ * indent, line and paragraph spacing, tab stops, rtl, line-break flags) as
1258
+ * the load pipeline resolved it.
1259
+ *
1260
+ * Present only on an `element.textStyle` that came from a parsed deck, and
1261
+ * populated only with the geometry keys. It exists so the save path can
1262
+ * answer one question it otherwise cannot: has the user CHANGED the body's
1263
+ * alignment or indent, or is the value simply what the shape's
1264
+ * `a:lstStyle`, its layout placeholder and the master already produce?
1265
+ * Element-level text panels (`textAdvancedPatch`, `alignPatch` and friends
1266
+ * in `pptx-viewer-shared`) write `element.textStyle` and never touch
1267
+ * `segment.paragraphProperties`, so a diff against this snapshot is the
1268
+ * only way to tell an edit from an inheritance artefact.
1269
+ *
1270
+ * @see element-paragraph-geometry.ts
1271
+ */
1272
+ resolvedParagraphGeometry?: TextStyle;
1188
1273
  fontFamily?: string;
1189
1274
  fontSize?: number;
1190
1275
  /** When true, renderer should shrink text to fit the shape bounds. */
@@ -1849,6 +1934,15 @@ interface PptxElementBase {
1849
1934
  shapeId?: string;
1850
1935
  /** Element name from `cNvPr/@name`. Used for morph transition matching via the `!!` naming convention. */
1851
1936
  name?: string;
1937
+ /**
1938
+ * `p:nvSpPr/p:nvPr/p:ph/@type` (lower-cased) when the shape is a placeholder:
1939
+ * `title`, `ctrtitle`, `body`, `subtitle`, `ftr`, `dt`, `sldnum`, ...
1940
+ *
1941
+ * Captured on load so consumers can tell a footer placeholder from a text box
1942
+ * without re-walking `rawXml`. Absent on non-placeholder shapes and on
1943
+ * SDK-created elements.
1944
+ */
1945
+ placeholderType?: string;
1852
1946
  x: number;
1853
1947
  y: number;
1854
1948
  width: number;
@@ -1909,6 +2003,19 @@ interface PptxTextProperties {
1909
2003
  }>;
1910
2004
  /** 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. */
1911
2005
  promptText?: string;
2006
+ /**
2007
+ * The string {@link text} was INHERITED from, when this is a header / footer /
2008
+ * date / slide-number placeholder whose own body the file leaves empty.
2009
+ *
2010
+ * PowerPoint keeps the footer string on the slide master and writes each
2011
+ * slide's copy of the `ftr` placeholder empty, so the empty body means
2012
+ * "render the master's footer here". Rendering needs the resolved string, but
2013
+ * SAVING it into the slide would pin that slide to today's master text and
2014
+ * silently detach it from the Header & Footer dialog. The save writer
2015
+ * therefore leaves the authored empty body alone while `text` still equals
2016
+ * this value, and writes a genuine per-slide override once it does not.
2017
+ */
2018
+ inheritedPlaceholderText?: string;
1912
2019
  /** 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. */
1913
2020
  linkedTxbxId?: number;
1914
2021
  /** Sequence number within a linked text box chain (0-based). */
@@ -2319,6 +2426,12 @@ interface PptxChartLineStyle {
2319
2426
  }
2320
2427
  /** Marker symbol types for line/scatter chart data points. */
2321
2428
  type PptxChartMarkerSymbol = 'circle' | 'dash' | 'diamond' | 'dot' | 'none' | 'picture' | 'plus' | 'square' | 'star' | 'triangle' | 'x' | 'auto';
2429
+ /**
2430
+ * `ST_ScatterStyle` (ECMA-376 §21.2.3.40): how a scatter chart joins its points.
2431
+ * `line`/`lineMarker` connect them with straight segments, `smooth`/
2432
+ * `smoothMarker` with a bezier, `marker`/`none` not at all.
2433
+ */
2434
+ type PptxChartScatterStyle = 'none' | 'line' | 'lineMarker' | 'marker' | 'smooth' | 'smoothMarker';
2322
2435
  /** Shape properties extracted from c:spPr for chart formatting. */
2323
2436
  interface PptxChartShapeProps {
2324
2437
  fillColor?: string;
@@ -2520,6 +2633,42 @@ interface PptxChartTreemapOptions {
2520
2633
  interface PptxChartSeries {
2521
2634
  name: string;
2522
2635
  values: number[];
2636
+ /**
2637
+ * Per-series x values from `c:ser/c:xVal` (scatter and bubble series only).
2638
+ *
2639
+ * Every `CT_ScatterSer` / `CT_BubbleSer` carries its OWN `c:xVal`, so two
2640
+ * series in one scatter chart routinely plot against different x ranges (the
2641
+ * normal case for measurement data). Reading the x values off the first
2642
+ * series and reusing them everywhere plotted every series against series 1's
2643
+ * x axis. Absent for category-axis chart kinds, where
2644
+ * {@link PptxChartData.categories} is the x axis.
2645
+ */
2646
+ xValues?: number[];
2647
+ /**
2648
+ * Per-series bubble sizes from `c:ser/c:bubbleSize` (bubble series only),
2649
+ * aligned index-for-index with {@link values}.
2650
+ *
2651
+ * `CT_BubbleSer` carries x, y AND size, so a one-series bubble chart is fully
2652
+ * specified. Absent when the source omits `c:bubbleSize`.
2653
+ */
2654
+ bubbleSizes?: number[];
2655
+ /**
2656
+ * Series-level data-label content flags from `c:ser/c:dLbls`.
2657
+ *
2658
+ * PowerPoint writes the flags a user picks in "Format Data Labels" onto the
2659
+ * SERIES, and leaves the chart-type-level `c:dLbls` all-zero, so reading only
2660
+ * the chart-level group reports "show nothing" for a chart that visibly shows
2661
+ * percentages. These override {@link PptxChartStyle.dataLabels}.
2662
+ */
2663
+ dataLabelOptions?: PptxChartDataLabelOptions;
2664
+ /**
2665
+ * Whether the series line is explicitly suppressed
2666
+ * (`c:ser/c:spPr/a:ln/a:noFill`). Line-drawn kinds (line, scatter, radar)
2667
+ * use this to decide whether to draw a connecting line at all; a marker-only
2668
+ * scatter is authored as `scatterStyle="lineMarker"` PLUS this flag, never by
2669
+ * changing the scatter style.
2670
+ */
2671
+ lineNoFill?: boolean;
2523
2672
  /**
2524
2673
  * Blank-value mask aligned index-for-index with {@link values}: `true` marks
2525
2674
  * a category whose numeric cache point (`c:numCache/c:pt`) was absent or
@@ -2863,6 +3012,17 @@ interface PptxChartData {
2863
3012
  * default), so only horizontal bar charts need to carry the field.
2864
3013
  */
2865
3014
  barDirection?: PptxChartBarDirection;
3015
+ /**
3016
+ * Scatter presentation mode (`c:scatterChart/c:scatterStyle/@val`).
3017
+ *
3018
+ * `lineMarker` (PowerPoint's own default for every scatter it writes) and
3019
+ * `smoothMarker` draw a connecting line; `marker` and `none` do not. Whether
3020
+ * the MARKERS appear is decided separately by `c:marker/c:symbol`, and
3021
+ * whether the LINE appears is further gated by
3022
+ * {@link PptxChartSeries.lineNoFill} - PowerPoint expresses "markers only" as
3023
+ * `lineMarker` plus an `a:ln/a:noFill`, not as `marker`.
3024
+ */
3025
+ scatterStyle?: PptxChartScatterStyle;
2866
3026
  /**
2867
3027
  * Bar/column gap between category clusters as a percentage of bar width
2868
3028
  * (`c:gapWidth/@val`, 0 through 500). Absent uses the renderer default.
@@ -3016,6 +3176,53 @@ interface PptxChartData {
3016
3176
  * // => { brightness: 20, contrast: -10, grayscale: true } satisfies PptxImageEffects
3017
3177
  * ```
3018
3178
  */
3179
+ /**
3180
+ * One `a14:foregroundMark` / `a14:backgroundMark` polyline hint recorded while
3181
+ * the user painted over the picture in PowerPoint's "Remove Background" mode.
3182
+ * Coordinates are 0..1 fractions of the image.
3183
+ */
3184
+ interface PptxBackgroundRemovalMark {
3185
+ x1: number;
3186
+ y1: number;
3187
+ x2: number;
3188
+ y2: number;
3189
+ }
3190
+ /**
3191
+ * PowerPoint "Remove Background" state (`a14:backgroundRemoval`).
3192
+ *
3193
+ * The four edges are the RETAINED rectangle as 0..1 fractions of the image
3194
+ * (OOXML stores them as per-100000 relative units), and the mark lists are the
3195
+ * segmentation hints the user painted.
3196
+ *
3197
+ * **This is edit-time metadata, not a render instruction.** PowerPoint bakes the
3198
+ * removal into the bitmap referenced by the main `a:blip/@r:embed` and keeps the
3199
+ * pristine original in `a14:imgLayer/@r:embed`. Verified against PowerPoint COM:
3200
+ * a slide exported with and without this element is byte-identical. A renderer
3201
+ * that clips to the retained rectangle would clip an image whose background has
3202
+ * already been removed.
3203
+ *
3204
+ * @example
3205
+ * ```ts
3206
+ * const removal: PptxBackgroundRemoval = { top: 0.12, bottom: 0.88, left: 0.07, right: 0.93 };
3207
+ * // => retains the middle of the image; the marks list stays empty
3208
+ * ```
3209
+ */
3210
+ interface PptxBackgroundRemoval {
3211
+ /** Top edge of the retained rectangle (0..1 fraction of the image height). */
3212
+ top: number;
3213
+ /** Bottom edge of the retained rectangle (0..1 fraction of the image height). */
3214
+ bottom: number;
3215
+ /** Left edge of the retained rectangle (0..1 fraction of the image width). */
3216
+ left: number;
3217
+ /** Right edge of the retained rectangle (0..1 fraction of the image width). */
3218
+ right: number;
3219
+ /** Strokes marking regions the user forced to be foreground. */
3220
+ foregroundMarks?: PptxBackgroundRemovalMark[];
3221
+ /** Strokes marking regions the user forced to be background. */
3222
+ backgroundMarks?: PptxBackgroundRemovalMark[];
3223
+ /** Original effect XML, retained for lossless re-emission. */
3224
+ rawXml?: XmlObject;
3225
+ }
3019
3226
  interface PptxImageEffects {
3020
3227
  /** Brightness adjustment (-100 to 100). */
3021
3228
  brightness?: number;
@@ -3039,8 +3246,38 @@ interface PptxImageEffects {
3039
3246
  };
3040
3247
  /** Artistic effect name (blur, pencilGrayscale, paintStrokes, etc.). */
3041
3248
  artisticEffect?: string;
3042
- /** Artistic effect radius/amount. */
3249
+ /** Artistic effect radius/amount, normalised to 0..100. */
3043
3250
  artisticRadius?: number;
3251
+ /**
3252
+ * Every numeric attribute of the source `a14:artistic*` element, raw and
3253
+ * un-normalised (`trans`, `pencilSize`, `crackSpacing`, …). The attribute set
3254
+ * differs per effect, so this is the lossless companion to the single
3255
+ * {@link PptxImageEffects.artisticRadius} number.
3256
+ */
3257
+ artisticParams?: Record<string, number>;
3258
+ /**
3259
+ * Name of the artistic effect ALREADY baked into the image data, which a
3260
+ * renderer must not apply a second time. Set from the `a14` blip extension,
3261
+ * which PowerPoint writes alongside a pre-rendered bitmap (see
3262
+ * {@link PptxBackgroundRemoval}), and normally equal to
3263
+ * {@link PptxImageEffects.artisticEffect}.
3264
+ *
3265
+ * It records the NAME rather than a boolean so that picking a different
3266
+ * effect in this library's inspector (which patches `artisticEffect` alone)
3267
+ * still renders: the two names then differ.
3268
+ */
3269
+ artisticPrerenderedEffect?: string;
3270
+ /**
3271
+ * PowerPoint "Remove Background" state (`a14:backgroundRemoval`). Edit-time
3272
+ * metadata: the removal is already baked into the image data.
3273
+ */
3274
+ backgroundRemoval?: PptxBackgroundRemoval;
3275
+ /**
3276
+ * `a14:imgLayer/@r:embed` — relationship id of the PRISTINE original image
3277
+ * the baked effects were derived from (PowerPoint stores it as an HD Photo
3278
+ * `.wdp` part, which browsers cannot decode).
3279
+ */
3280
+ originalImageRelId?: string;
3044
3281
  /** Alpha modulation fixed: non-negative percentage (100 means unchanged opacity). */
3045
3282
  alphaModFix?: number;
3046
3283
  /** Original alpha modulation fixed node, including foreign attributes. */
@@ -4952,7 +5189,7 @@ interface UnknownPptxElement extends PptxElementBase {
4952
5189
  /**
4953
5190
  * A single element on a PPTX slide.
4954
5191
  *
4955
- * This is a **discriminated union** narrow on `element.type` to access
5192
+ * This is a **discriminated union**: narrow on `element.type` to access
4956
5193
  * variant-specific properties like `imageData` (image/picture), `pathData`
4957
5194
  * (shape), or `textSegments` (text/shape).
4958
5195
  */
@@ -5695,6 +5932,54 @@ interface PptxEmbeddedFontList {
5695
5932
  rawXml?: XmlObject;
5696
5933
  }
5697
5934
  //#endregion
5935
+ //#region src/core/types/comment-mentions.d.ts
5936
+ /**
5937
+ * A single `@`-mention inside a modern comment body.
5938
+ *
5939
+ * Offsets index into the comment's FLATTENED plain text: every `a:t` value
5940
+ * below `p188:txBody` concatenated, with paragraphs joined by `\n`. That is the
5941
+ * same string `PptxComment.text` carries, so an edit to `text` invalidates
5942
+ * every offset after the edit point and the serializer re-bases them.
5943
+ *
5944
+ * The markup Office uses for a mention is `CT_Mention` (documented for the
5945
+ * SpreadsheetML `2018/threadedcomments` part): `mentionpersonId`, `mentionId`,
5946
+ * `startIndex` and `length`. The PowerPoint `2018/8/main` schema does not
5947
+ * publish a mention element at all, so `rawXml` is retained and re-emitted
5948
+ * attribute-for-attribute: a producer that spells the attributes differently
5949
+ * still round-trips.
5950
+ *
5951
+ * @example
5952
+ * ```ts
5953
+ * const mention: PptxCommentMention = {
5954
+ * personId: "{2CB2E9D0-D392-EB21-5D46-FBA34C1295E6}",
5955
+ * authorName: "Bob Example",
5956
+ * startIndex: 3,
5957
+ * length: 11,
5958
+ * };
5959
+ * // => "Hi Bob Example can you check this".slice(3, 14) === "Bob Example"
5960
+ * ```
5961
+ */
5962
+ interface PptxCommentMention {
5963
+ /** `mentionId`: GUID identifying this mention instance. */
5964
+ id?: string;
5965
+ /** `mentionpersonId`: the `p188:author` id of the mentioned person. */
5966
+ personId: string;
5967
+ /** Display name resolved from the author list at parse time, when known. */
5968
+ authorName?: string;
5969
+ /** Character offset of the mentioned span in the flattened plain text. */
5970
+ startIndex: number;
5971
+ /** Character length of the mentioned span. */
5972
+ length: number;
5973
+ /**
5974
+ * `uri` of the `p188:ext` this mention list was read from. Undefined means
5975
+ * the list is a direct child of `p188:cm`, which is where it is written for
5976
+ * newly authored mentions.
5977
+ */
5978
+ containerUri?: string;
5979
+ /** Original `p188:mention` node, retained for unknown-attribute preservation. */
5980
+ rawXml?: XmlObject;
5981
+ }
5982
+ //#endregion
5698
5983
  //#region src/core/types/metadata.d.ts
5699
5984
  /**
5700
5985
  * A slide comment — may be a legacy positional comment or a modern
@@ -5741,6 +6026,8 @@ interface PptxComment {
5741
6026
  title?: string;
5742
6027
  /** Modern threaded comment support (p15:threadingInfo). */
5743
6028
  threadId?: string;
6029
+ /** `@`-mentions, indexed into `text` (see {@link PptxCommentMention}). */
6030
+ mentions?: PptxCommentMention[];
5744
6031
  /** Replies to this comment (for modern threaded comments). */
5745
6032
  replies?: PptxComment[];
5746
6033
  /** ID of the element this comment is associated with (if any). */
@@ -6260,7 +6547,7 @@ interface PptxTheme {
6260
6547
  * // => "morph" — one of 40+ transition effects
6261
6548
  * ```
6262
6549
  */
6263
- 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';
6550
+ 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';
6264
6551
  /** Split orientation from OOXML `@_orient`. */
6265
6552
  type PptxSplitOrientation = 'horz' | 'vert';
6266
6553
  /** Schema-defined `ST_TransitionSpeed` values. */
@@ -6555,6 +6842,18 @@ interface PptxSlideBackgroundPattern {
6555
6842
  interface PptxSlide {
6556
6843
  id: string;
6557
6844
  rId: string;
6845
+ /**
6846
+ * `p:sldIdLst/p:sldId/@id` (ST_SlideId, 256..2147483647): the numeric key
6847
+ * that sections (`p14:sldIdLst/p14:sldId/@id`) and section/summary zooms
6848
+ * name slides by.
6849
+ *
6850
+ * It lives in `presentation.xml`, NOT in the slide part, so it cannot be
6851
+ * recovered from `rawXml`. Without it on the model, code that writes a
6852
+ * section's membership has nothing correct to write and falls back to the
6853
+ * slide NUMBER, which is 1-based and therefore never matches a real deck's
6854
+ * ids: the section reloads with no slides in it.
6855
+ */
6856
+ slideId?: string;
6558
6857
  sourceSlideId?: string;
6559
6858
  /** Optional author-supplied slide name (set via `SlideBuilder.setName`). */
6560
6859
  name?: string;
@@ -6757,6 +7056,26 @@ interface PptxPresentationProperties {
6757
7056
  /** Kiosk auto-restart interval in milliseconds (from `p:kiosk/@restart`). Only meaningful when showType is "kiosk". */
6758
7057
  kioskRestartTime?: number;
6759
7058
  }
7059
+ /**
7060
+ * Slide dimensions from `p:sldSz` (CT_SlideSize, ECMA-376 §19.2.1.39).
7061
+ *
7062
+ * @example
7063
+ * ```ts
7064
+ * const size: PptxSlideSize = { widthEmu: 9144000, heightEmu: 6858000, type: 'screen4x3' };
7065
+ * // => satisfies PptxSlideSize
7066
+ * ```
7067
+ */
7068
+ interface PptxSlideSize {
7069
+ /** `@cx` in EMU. Omitted or non-positive values leave the loaded width alone. */
7070
+ widthEmu?: number;
7071
+ /** `@cy` in EMU. Omitted or non-positive values leave the loaded height alone. */
7072
+ heightEmu?: number;
7073
+ /**
7074
+ * `@type` (ST_SlideSizeType). The schema default is `custom`, which is
7075
+ * why PowerPoint omits the attribute for a non-preset size.
7076
+ */
7077
+ type?: string;
7078
+ }
6760
7079
  /**
6761
7080
  * A named custom slide show (`p:custShowLst / p:custShow`).
6762
7081
  *
@@ -7771,6 +8090,19 @@ interface PptxHandlerSaveOptions {
7771
8090
  customerData?: PptxCustomerData[];
7772
8091
  /** Photo album metadata to save back to `p:photoAlbum`. */
7773
8092
  photoAlbum?: PptxPhotoAlbum;
8093
+ /**
8094
+ * Slide dimensions to write back to `p:sldSz`.
8095
+ *
8096
+ * Omitting the option preserves the load-time dimensions verbatim, which
8097
+ * is why an edit made through a viewer's Slide Size control has to reach
8098
+ * the save call: nothing else in the pipeline can observe it.
8099
+ *
8100
+ * PowerPoint derives `Presentation.PageSetup.SlideSize` from `@cx`/`@cy`
8101
+ * alone (verified by COM: an A4-typed `p:sldSz` carrying 4:3 dimensions
8102
+ * still reports `ppSlideSizeCustom`), so `type` is written for fidelity
8103
+ * but the dimensions are what actually decide the reported preset.
8104
+ */
8105
+ slideSize?: PptxSlideSize;
7774
8106
  /** East Asian line-break settings to save back to `p:kinsoku`. */
7775
8107
  kinsoku?: PptxKinsoku | null;
7776
8108
  /** Write-protection verifier. Set to `null` to remove, `undefined` to preserve existing. */
@@ -8362,24 +8694,38 @@ declare class PptxHandlerCore {
8362
8694
  name?: string;
8363
8695
  }>>;
8364
8696
  /**
8365
- * Export selected slides as individual PPTX files.
8697
+ * Export selected slides to a vector or raster format, keyed by slide index.
8366
8698
  *
8367
- * Each entry in the returned map is keyed by slide index and contains a
8368
- * standalone `Uint8Array` PPTX with only that slide.
8699
+ * **This does not produce PPTX files.** The previous version of this comment
8700
+ * said each entry was "a standalone PPTX with only that slide", named the
8701
+ * option `slideIndexes` (the real field is `slideIndices`), and wrote the
8702
+ * bytes to `slide_N.pptx`. None of that was ever true: the runtime has
8703
+ * always taken a `format` of `svg` / `png` / `pdf`. Per-slide PPTX
8704
+ * extraction is a different operation and is not implemented here.
8705
+ *
8706
+ * Only `svg` works without a host-supplied backend, and it works fully:
8707
+ * the headless {@link SvgExporter} renders it with no DOM. `png` and `pdf`
8708
+ * THROW, because this package carries no rasteriser; use a viewer binding's
8709
+ * browser export pipeline, or override `exportSlides` on the runtime with
8710
+ * your own backend.
8369
8711
  *
8370
8712
  * @param slides - Full slide array.
8371
- * @param options - Export options (slide indexes, format, etc.).
8372
- * @returns A `Map<slideIndex, Uint8Array>` of exported files.
8713
+ * @param options - Export options (`format`, `slideIndices`, `width`, ...).
8714
+ * @returns A `Map<slideIndex, Uint8Array>` of exported files. Hidden slides
8715
+ * are omitted unless `options.includeHidden` is set, so the map can be
8716
+ * smaller than `options.slideIndices`.
8717
+ * @throws {Error} when `options.format` is `png` or `pdf`.
8373
8718
  *
8374
8719
  * @example
8375
8720
  * ```ts
8376
8721
  * const exports = await handler.exportSlides(data.slides, {
8377
- * slideIndexes: [0, 2],
8722
+ * format: 'svg',
8723
+ * slideIndices: [0, 2],
8378
8724
  * });
8379
8725
  * for (const [idx, bytes] of exports) {
8380
- * await fs.writeFile(`slide_${idx}.pptx`, Buffer.from(bytes));
8726
+ * await fs.writeFile(`slide_${idx}.svg`, Buffer.from(bytes));
8381
8727
  * }
8382
- * // => Map<number, Uint8Array> one standalone .pptx per exported slide
8728
+ * // => Map<number, Uint8Array>: one SVG document per exported slide
8383
8729
  * ```
8384
8730
  */
8385
8731
  exportSlides(slides: PptxSlide[], options: PptxExportOptions): Promise<Map<number, Uint8Array>>;
@@ -8829,6 +9175,91 @@ interface MorphTransitionPlan {
8829
9175
  //#region src/render/text-case-transform.d.ts
8830
9176
  type ChangeCaseMode = 'sentence' | 'lower' | 'upper' | 'capitalize' | 'toggle';
8831
9177
  //#endregion
9178
+ //#region src/render/shape-adjustment-model.d.ts
9179
+ /**
9180
+ * `shape-adjustment-model`: the vocabulary the adjust-handle modules share.
9181
+ *
9182
+ * The `a:ahLst` work is split three ways for the repo's file-size budget:
9183
+ * `shape-adjustment-probe` measures the geometry, `shape-adjustment-handles`
9184
+ * derives the handles from those measurements, and `shape-adjustment-solver`
9185
+ * turns a pointer position back into guide values. All three need these types
9186
+ * and the one rule that operates purely on them, so they live here and the
9187
+ * dependency graph stays a DAG rather than a cycle.
9188
+ *
9189
+ * @module render/shape-adjustment-model
9190
+ */
9191
+ /**
9192
+ * How a pointer position becomes a guide value, captured once when the gesture
9193
+ * starts so `pointermove` stays pure arithmetic.
9194
+ */
9195
+ interface ShapeAdjustmentSolver {
9196
+ /** `linear`: the handle slides. `angular`: it swings about {@link centerX}. */
9197
+ kind: 'linear' | 'angular';
9198
+ /** Handle position in element-local px at {@link startValue}. */
9199
+ anchorX: number;
9200
+ anchorY: number;
9201
+ /** Element-local px the handle travels per ONE unit of guide value. */
9202
+ dirX: number;
9203
+ dirY: number;
9204
+ /** Pivot for an angular handle (the shape centre). */
9205
+ centerX: number;
9206
+ centerY: number;
9207
+ /** The guide value the anchor was measured at. */
9208
+ startValue: number;
9209
+ /** Guide-space bounds, taken from the preset's own `pin` clamp. */
9210
+ min: number;
9211
+ max: number;
9212
+ }
9213
+ /** One guide a handle drives. */
9214
+ interface AdjustmentAxisSolver {
9215
+ key: string;
9216
+ solver: ShapeAdjustmentSolver;
9217
+ }
9218
+ /** Descriptor for one draggable adjustment handle (the amber diamond). */
9219
+ interface ShapeAdjustmentHandleDescriptor {
9220
+ /** The `a:avLst` guide name this handle writes (`adj`, `adj1`, ...). */
9221
+ key: string;
9222
+ /** Handle x offset in element-local px (origin = element top-left). */
9223
+ left: number;
9224
+ /** Handle y offset in element-local px. */
9225
+ top: number;
9226
+ /**
9227
+ * Current adjustment value in GUIDE units, not a 0-1 fraction. Most presets
9228
+ * range 0..50000 or 0..100000 and the angular ones run to 21,600,000.
9229
+ */
9230
+ value: number;
9231
+ cursor: string;
9232
+ /**
9233
+ * How this handle's drag resolves, measured off the preset geometry: one
9234
+ * entry per `a:avLst` guide it drives (callouts drive two). Absent only for
9235
+ * a caller that built a descriptor by hand.
9236
+ */
9237
+ solvers?: AdjustmentAxisSolver[];
9238
+ }
9239
+ /** Live drag state captured when an adjustment gesture starts. */
9240
+ interface ShapeAdjustmentDragState {
9241
+ elementId: string;
9242
+ key: string;
9243
+ shapeType: string;
9244
+ startClientX: number;
9245
+ startClientY: number;
9246
+ startAdjustment: number;
9247
+ startWidth: number;
9248
+ startHeight: number;
9249
+ moved: boolean;
9250
+ /** Copied from the descriptor the gesture started on. */
9251
+ solvers?: AdjustmentAxisSolver[];
9252
+ /**
9253
+ * The element's whole `a:avLst` map at gesture start.
9254
+ *
9255
+ * A binding writes `shapeAdjustments` as one object, so a drag that sent
9256
+ * only the guide it changed would DELETE every other authored adjustment on
9257
+ * a multi-adjust preset (a `quadArrow` would lose two of its three the first
9258
+ * time one was touched).
9259
+ */
9260
+ startAdjustments?: Record<string, number>;
9261
+ }
9262
+ //#endregion
8832
9263
  //#region src/render/collaboration-text-codec.d.ts
8833
9264
  /**
8834
9265
  * collaboration-text-codec.ts: TextSegment[] <-> Y.Text delta codec used by the
@@ -8947,6 +9378,12 @@ interface CompareResult {
8947
9378
  changedCount: number;
8948
9379
  unchangedCount: number;
8949
9380
  }
9381
+ interface SlideSizeEmu {
9382
+ widthEmu: number;
9383
+ heightEmu: number;
9384
+ /** ST_SlideSizeType token, or `''` for a size with no preset. */
9385
+ type: string;
9386
+ }
8950
9387
  //#endregion
8951
9388
  //#region src/render/mobile-viewport.d.ts
8952
9389
  /**
@@ -9068,6 +9505,31 @@ interface FontEmbeddingDescriptor {
9068
9505
  /** Present only when `interactive` is false. */
9069
9506
  disabledReasonKey?: string;
9070
9507
  }
9508
+ /** Everything a binding needs to render the recovery dialog, and nothing else. */
9509
+ interface AutosaveRecoveryPrompt {
9510
+ /** IndexedDB key the snapshot is stored under (the deck's file path/name). */
9511
+ readonly filePath: string;
9512
+ /** When the snapshot was written (epoch ms). */
9513
+ readonly timestamp: number;
9514
+ /** Snapshot size in bytes. */
9515
+ readonly size: number;
9516
+ /** Whole minutes since it was written, floored at 0. */
9517
+ readonly ageMinutes: number;
9518
+ readonly titleKey: string;
9519
+ readonly messageKey: string;
9520
+ /** `size` is pre-formatted here because byte units are not translated. */
9521
+ readonly messageParams: {
9522
+ readonly file: string;
9523
+ readonly size: string;
9524
+ };
9525
+ /** Relative age, reusing the existing autosave age keys. */
9526
+ readonly ageKey: string;
9527
+ readonly ageParams: {
9528
+ readonly count: number;
9529
+ };
9530
+ readonly restoreKey: string;
9531
+ readonly discardKey: string;
9532
+ }
9071
9533
  //#endregion
9072
9534
  //#region src/render/master-view.d.ts
9073
9535
  /** Which part the master view is currently pointed at. */
@@ -9217,13 +9679,25 @@ interface ViewerProofingOptions {
9217
9679
  checkSpellingAsYouType: boolean;
9218
9680
  hideSpellingErrors: boolean;
9219
9681
  }
9682
+ /**
9683
+ * File > Options > Save.
9684
+ *
9685
+ * Font embedding deliberately has NO entry here. It is owned by the File >
9686
+ * Fonts panel, whose toggle is the one the save path reads (see
9687
+ * `render/font-embedding`: `describeFontEmbedding` decides the toggle's start
9688
+ * position and whether it can do anything at all, `embeddedFontSaveOptions`
9689
+ * turns it into the `PptxHandler.save()` slice). This group used to carry a
9690
+ * second `embedFonts` boolean, plus an `embedAllFontCharacters` companion, and
9691
+ * neither was read by anything: the pane moved a switch that changed no saved
9692
+ * byte, while the panel next door moved the real one. Two switches for one
9693
+ * setting, one of them lying, is worse than one switch in a less
9694
+ * PowerPoint-shaped place.
9695
+ */
9220
9696
  interface ViewerSaveOptions {
9221
9697
  autoSave: boolean;
9222
9698
  autoRecoverIntervalMinutes: number;
9223
9699
  keepLastAutoRecoveredVersion: boolean;
9224
9700
  defaultExportFormat: DefaultExportFormat;
9225
- embedFonts: boolean;
9226
- embedAllFontCharacters: boolean;
9227
9701
  cacheRetentionDays: number;
9228
9702
  clearCacheOnClose: boolean;
9229
9703
  }
@@ -9442,22 +9916,6 @@ interface ResizeState {
9442
9916
  lastWidth: number;
9443
9917
  lastHeight: number;
9444
9918
  }
9445
- /**
9446
- * Tracks the state of an ongoing shape adjustment handle drag.
9447
- * Used when the user drags the yellow diamond handle to alter
9448
- * shape-specific parameters (e.g. corner radius on a rounded rectangle).
9449
- */
9450
- interface ShapeAdjustmentDragState {
9451
- elementId: string;
9452
- key: string;
9453
- shapeType: string;
9454
- startClientX: number;
9455
- startClientY: number;
9456
- startAdjustment: number;
9457
- startWidth: number;
9458
- startHeight: number;
9459
- moved: boolean;
9460
- }
9461
9919
  /**
9462
9920
  * A snapshot of editor state captured for undo/redo history.
9463
9921
  * Contains the full slide deck state at a point in time so that
@@ -9760,6 +10218,8 @@ interface ToolbarProps {
9760
10218
  onToggleVersionHistory?: () => void;
9761
10219
  onOpenPasswordProtection?: () => void;
9762
10220
  onOpenDocumentProperties?: () => void;
10221
+ /** Design > Slide Size: reveal the inspector card that owns the slide size. */
10222
+ onOpenSlideSize?: () => void;
9763
10223
  onOpenFontEmbedding?: () => void;
9764
10224
  onOpenDigitalSignatures?: () => void;
9765
10225
  onEnterMasterView: () => void;
@@ -9885,7 +10345,7 @@ interface SlideCanvasProps {
9885
10345
  /** Called when the user presses mouse down on empty canvas space. */
9886
10346
  onCanvasMouseDown?: (e: React$1.MouseEvent) => void;
9887
10347
  onResizePointerDown: (elementId: string, e: React$1.MouseEvent, handle: string) => void;
9888
- onAdjustmentPointerDown: (elementId: string, e: React$1.MouseEvent) => void;
10348
+ onAdjustmentPointerDown: (elementId: string, e: React$1.MouseEvent, descriptor: ShapeAdjustmentHandleDescriptor) => void;
9889
10349
  /** Commit a new rotation (degrees) when the on-canvas rotate handle is dragged. */
9890
10350
  onRotate?: (elementId: string, rotationDeg: number) => void;
9891
10351
  onInlineEditChange: (text: string) => void;
@@ -10000,10 +10460,37 @@ interface UseAutosaveInput {
10000
10460
  filePath: string | undefined;
10001
10461
  /** Serialise current editor state to a Uint8Array. */
10002
10462
  serializeSlides: () => Promise<Uint8Array | null>;
10003
- /** Autosave interval in seconds (default 120). */
10463
+ /**
10464
+ * Autosave interval in seconds.
10465
+ *
10466
+ * @deprecated Pass {@link intervalMs} instead. Seconds cannot express the
10467
+ * short cadence a host may legitimately ask for, and the shared clamp it went
10468
+ * through raised anything under 10s back to 10s, so an explicit host policy
10469
+ * was silently overruled. Ignored when `intervalMs` is given.
10470
+ */
10004
10471
  intervalSeconds?: number;
10005
- /** Whether autosave is enabled. */
10472
+ /**
10473
+ * Autosave interval in milliseconds, already resolved by the shared
10474
+ * `resolveAutosaveIntervalMs` (host prop > File > Options > Save AutoRecover
10475
+ * cadence > 120s default). Wins over {@link intervalSeconds}.
10476
+ */
10477
+ intervalMs?: number;
10478
+ /**
10479
+ * Whether autosave is enabled: the resolved `active` from the shared
10480
+ * `resolveAutosaveActivation`, NOT the raw title-bar toggle.
10481
+ */
10006
10482
  enabled?: boolean;
10483
+ /**
10484
+ * The values a snapshot is built from, read fresh on each tick.
10485
+ *
10486
+ * `isDirty` stays true from the first edit until the user performs a real
10487
+ * save, so on its own it makes the timer re-serialize and rewrite an
10488
+ * identical deck every N seconds forever. Vue, Svelte and Vanilla never had
10489
+ * that problem because they debounce on the slides array being reassigned;
10490
+ * this is the same trigger, and `shouldWriteAutosaveSnapshot` writes
10491
+ * whenever it is unsure. Omit it and every tick writes, as before.
10492
+ */
10493
+ getChangeSources?: () => readonly unknown[];
10007
10494
  }
10008
10495
  interface UseAutosaveResult {
10009
10496
  /** Current autosave status for display in the StatusBar. */
@@ -10575,6 +11062,8 @@ interface UsePresentationModeInput {
10575
11062
  onToggleToolbar?: () => void;
10576
11063
  /** Open the All Slides navigator (Ctrl+S). */
10577
11064
  onShowAllSlides?: () => void;
11065
+ /** Show or hide live captions (PowerPoint's bare J). */
11066
+ onToggleSubtitles?: () => void;
10578
11067
  /** Called to persist rehearsal timings into slide transitions. */
10579
11068
  onSaveRehearsalTimings?: (timings: Record<number, number>) => void;
10580
11069
  /** Whether to loop continuously (kiosk or explicit loop setting). */
@@ -10951,6 +11440,15 @@ interface ViewerCoreState {
10951
11440
  /** Width and height of the slide canvas in CSS pixels. */
10952
11441
  canvasSize: CanvasSize;
10953
11442
  setCanvasSize: React$1.Dispatch<React$1.SetStateAction<CanvasSize>>;
11443
+ /**
11444
+ * `p:sldSz` in EMU, seeded from the loaded deck and updated by Design >
11445
+ * Slide Size. It is what a save persists: the pixel `canvasSize` above
11446
+ * cannot round-trip a preset (Ledger's 12179300 EMU is 1278.5px, and the
11447
+ * integer pixel it rounds to costs the deck its `ppSlideSizeLedgerPaper`
11448
+ * identity). `undefined` until a deck loads or the user picks a preset.
11449
+ */
11450
+ slideSizeEmu: SlideSizeEmu | undefined;
11451
+ setSlideSizeEmu: React$1.Dispatch<React$1.SetStateAction<SlideSizeEmu | undefined>>;
10954
11452
  /** Zero-based index of the currently active (visible) slide. */
10955
11453
  activeSlideIndex: number;
10956
11454
  setActiveSlideIndex: React$1.Dispatch<React$1.SetStateAction<number>>;
@@ -11230,6 +11728,8 @@ interface UseLoadContentInput {
11230
11728
  setTemplateElementsBySlideId: React.Dispatch<React.SetStateAction<Record<string, PptxElement[]>>>;
11231
11729
  mediaDataUrls: Map<string, string>;
11232
11730
  setCanvasSize: React.Dispatch<React.SetStateAction<CanvasSize>>;
11731
+ /** Seeds the EMU `p:sldSz` that a save persists (see `ViewerCoreState.slideSizeEmu`). */
11732
+ setSlideSizeEmu: React.Dispatch<React.SetStateAction<SlideSizeEmu | undefined>>;
11233
11733
  setHeaderFooter: React.Dispatch<React.SetStateAction<PptxHeaderFooter>>;
11234
11734
  setLayoutOptions: React.Dispatch<React.SetStateAction<Array<{
11235
11735
  path: string;
@@ -11240,6 +11740,12 @@ interface UseLoadContentInput {
11240
11740
  setTableStyleMap: React.Dispatch<React.SetStateAction<ParsedTableStyleMap | undefined>>;
11241
11741
  setThemeOptions: React.Dispatch<React.SetStateAction<PptxThemeOption[]>>;
11242
11742
  setCustomShows: React.Dispatch<React.SetStateAction<PptxCustomShow[]>>;
11743
+ /**
11744
+ * Seeds the running show from `p:showPr/p:custShow/@id`, so a deck authored
11745
+ * to open into a custom show plays that subset instead of the whole deck.
11746
+ * A later manual pick still wins: this only fires on load.
11747
+ */
11748
+ setActiveCustomShowId: React.Dispatch<React.SetStateAction<string | null>>;
11243
11749
  setSections: React.Dispatch<React.SetStateAction<PptxSection[]>>;
11244
11750
  setPresentationProperties: React.Dispatch<React.SetStateAction<PptxPresentationProperties>>;
11245
11751
  setNotesMaster: React.Dispatch<React.SetStateAction<PptxNotesMaster | undefined>>;
@@ -11273,7 +11779,7 @@ interface UseLoadContentInput {
11273
11779
  interface UseLoadContentResult {
11274
11780
  handlerRef: React.MutableRefObject<PptxHandler | null>;
11275
11781
  }
11276
- declare function useLoadContent({ content, clearSelection, history, setSlides, setTemplateElementsBySlideId, mediaDataUrls, setCanvasSize, setHeaderFooter, setLayoutOptions, setSlideMasters, setTheme, setTableStyleMap, setThemeOptions, setCustomShows, setSections, setPresentationProperties, setNotesMaster, setHandoutMaster, setNotesCanvasSize, setCustomProperties, setTagCollections, setCoreProperties, setAppProperties, setEmbeddedFonts, setActiveSlideIndex, setHasMacros, setHasDigitalSignatures, setDigitalSignatureCount, setGuides, setLoading, setError, setIsDirty, setIsEncrypted, onContentApplied }: UseLoadContentInput): UseLoadContentResult;
11782
+ declare function useLoadContent({ content, clearSelection, history, setSlides, setTemplateElementsBySlideId, mediaDataUrls, setCanvasSize, setSlideSizeEmu, setHeaderFooter, setLayoutOptions, setSlideMasters, setTheme, setTableStyleMap, setThemeOptions, setCustomShows, setActiveCustomShowId, setSections, setPresentationProperties, setNotesMaster, setHandoutMaster, setNotesCanvasSize, setCustomProperties, setTagCollections, setCoreProperties, setAppProperties, setEmbeddedFonts, setActiveSlideIndex, setHasMacros, setHasDigitalSignatures, setDigitalSignatureCount, setGuides, setLoading, setError, setIsDirty, setIsEncrypted, onContentApplied }: UseLoadContentInput): UseLoadContentResult;
11277
11783
  //#endregion
11278
11784
  //#region src/viewer/hooks/useElementOperations.d.ts
11279
11785
  /**
@@ -11354,6 +11860,12 @@ interface SectionOperations {
11354
11860
  moveSectionUp: (sectionId: string) => void;
11355
11861
  moveSectionDown: (sectionId: string) => void;
11356
11862
  moveSlidesToSection: (slideIndexes: number[], targetSectionId: string) => void;
11863
+ /**
11864
+ * Flip `section.collapsed`, the `p14:section/@collapsed` flag core already
11865
+ * round-trips. React alone kept collapse in component-local state, so the
11866
+ * one binding that could not persist a collapsed section was this one.
11867
+ */
11868
+ toggleSectionCollapse: (sectionId: string) => void;
11357
11869
  }
11358
11870
  declare function useSectionOperations(input: UseSectionOperationsInput): SectionOperations;
11359
11871
  //#endregion
@@ -11424,7 +11936,7 @@ interface CanvasInteractionHandlers {
11424
11936
  handleElementContextMenu: (elementId: string, e: React.MouseEvent) => void;
11425
11937
  handleCanvasMouseDown: (e: React.MouseEvent) => void;
11426
11938
  handleResizePointerDown: (elementId: string, e: React.MouseEvent, handle: string) => void;
11427
- handleAdjustmentPointerDown: (elementId: string, e: React.MouseEvent) => void;
11939
+ handleAdjustmentPointerDown: (elementId: string, e: React.MouseEvent, descriptor: ShapeAdjustmentHandleDescriptor) => void;
11428
11940
  /** Commit a new rotation (degrees) for an element from the on-canvas rotate handle. */
11429
11941
  handleRotate: (elementId: string, rotationDeg: number) => void;
11430
11942
  /** Commit an inline (on-canvas) SmartArt node edit through the element-update path. */
@@ -11688,6 +12200,8 @@ interface UseExportHandlersInput {
11688
12200
  appProperties: Record<string, unknown> | null;
11689
12201
  customProperties: Array<Record<string, unknown>>;
11690
12202
  tagCollections: Array<Record<string, unknown>>;
12203
+ /** The slide masters and their layouts; see `UseExportSaveAsInput`. */
12204
+ slideMasters: PptxSlideMaster[];
11691
12205
  notesMaster: Record<string, unknown> | undefined;
11692
12206
  handoutMaster: Record<string, unknown> | undefined;
11693
12207
  guides: Array<{
@@ -11700,6 +12214,12 @@ interface UseExportHandlersInput {
11700
12214
  theme: PptxTheme | undefined;
11701
12215
  /** Slide canvas size in CSS pixels, carried into the deck-JSON export. */
11702
12216
  canvasSize: CanvasSize;
12217
+ /**
12218
+ * The EMU `p:sldSz` the viewer holds. Save-As builds its own save options
12219
+ * rather than reusing `useSerialize`, so without this a Slide Size edit
12220
+ * reached Save and not Save As (or the backstage Save, which routes here).
12221
+ */
12222
+ slideSizeEmu?: SlideSizeEmu | undefined;
11703
12223
  password?: string;
11704
12224
  }
11705
12225
  interface ExportHandlersResult {
@@ -12075,6 +12595,16 @@ interface UseSerializeInput {
12075
12595
  /** Separated master/layout (template) elements, merged back at save time. */
12076
12596
  templateElementsBySlideId: Record<string, PptxElement[]>;
12077
12597
  activeSlideIndex: number;
12598
+ /** The pixel canvas the raw Slide Size W/H inputs edit. */
12599
+ canvasSize: CanvasSize;
12600
+ /**
12601
+ * The EMU `p:sldSz` the viewer is holding (seeded on load, replaced by a
12602
+ * preset/orientation pick). Passed with `canvasSize` to
12603
+ * `resolveSlideSizeSelection`, which keeps the EMU whenever the two still
12604
+ * agree so a preset survives the save, and takes the pixels when the user
12605
+ * has typed into the raw inputs.
12606
+ */
12607
+ slideSizeEmu?: SlideSizeEmu | undefined;
12078
12608
  guides: Array<{
12079
12609
  id: string;
12080
12610
  axis: 'h' | 'v';
@@ -12092,6 +12622,19 @@ interface UseSerializeInput {
12092
12622
  appProperties: PptxAppProperties | undefined;
12093
12623
  customProperties: PptxCustomProperty[];
12094
12624
  tagCollections: PptxTagCollection[];
12625
+ /**
12626
+ * The slide masters and their layouts, as View > Slide Master left them.
12627
+ *
12628
+ * Required, not optional: this was the one save option React never passed,
12629
+ * and core rewrites a master or layout part only for the ones the caller
12630
+ * hands back. Every master-view edit therefore showed on screen and was
12631
+ * dropped by the save - a deleted master shape came back on reload, and a
12632
+ * master background reverted to white. The other four bindings pass it.
12633
+ * Core compares each part against the element list parsed at load and
12634
+ * rewrites only what actually changed, so passing the whole array on every
12635
+ * save costs an untouched deck nothing.
12636
+ */
12637
+ slideMasters: PptxSlideMaster[];
12095
12638
  notesMaster: PptxNotesMaster | undefined;
12096
12639
  handoutMaster: PptxHandoutMaster | undefined;
12097
12640
  handlerRef: React$1.RefObject<PptxHandler | null>;
@@ -12125,9 +12668,26 @@ interface UseRecoveryDetectionInput {
12125
12668
  loading: boolean;
12126
12669
  error: string | null;
12127
12670
  slideCount: number;
12128
- openVersionHistory: () => void;
12671
+ /**
12672
+ * Whether the host permits autosave (the shared `resolveAutosaveActivation`
12673
+ * ceiling). A host that passed `autosave={false}` is never offered snapshots
12674
+ * an earlier configuration left behind. Defaults to true.
12675
+ */
12676
+ autosaveAllowed?: boolean;
12677
+ /** Load the recovered bytes into the viewer. */
12678
+ onRestore?: (bytes: Uint8Array) => void;
12679
+ /** Legacy behaviour: also open the Version History panel when one is found. */
12680
+ openVersionHistory?: () => void;
12681
+ }
12682
+ interface UseRecoveryDetectionResult {
12683
+ /** What the dialog should say, or null when there is nothing to offer. */
12684
+ prompt: AutosaveRecoveryPrompt | null;
12685
+ /** Accept: load the snapshot and close. */
12686
+ restore: () => void;
12687
+ /** Decline: drop the snapshot and close. */
12688
+ discard: () => void;
12129
12689
  }
12130
- declare function useRecoveryDetection(input: UseRecoveryDetectionInput): void;
12690
+ declare function useRecoveryDetection(input: UseRecoveryDetectionInput): UseRecoveryDetectionResult;
12131
12691
  //#endregion
12132
12692
  //#region src/viewer/hooks/usePresentationSetup.d.ts
12133
12693
  interface UsePresentationSetupInput {
@@ -12158,6 +12718,12 @@ interface UsePresentationSetupInput {
12158
12718
  promptKeepInkAnnotations?: boolean;
12159
12719
  /** Options > Advanced > "Show popup toolbar" (default true). */
12160
12720
  popupToolbarEnabled?: boolean;
12721
+ /**
12722
+ * Show or hide live captions. PowerPoint toggles them on a bare `J` during a
12723
+ * show, and the shared slide-show keymap resolves that key for every binding;
12724
+ * without this callback the key is mapped and then lands nowhere.
12725
+ */
12726
+ onToggleSubtitles?: () => void;
12161
12727
  }
12162
12728
  interface PresentationSetupResult {
12163
12729
  presentation: UsePresentationModeResult;
@@ -12241,15 +12807,18 @@ declare function useIOHandlers(input: UseIOHandlersInput): IOHandlersResult;
12241
12807
  interface UseContentLifecycleInput {
12242
12808
  content: ArrayBuffer | Uint8Array | null;
12243
12809
  filePath: string | undefined;
12244
- /** AutoSave toggle state; when false the recovery autosave timer is off. */
12810
+ /**
12811
+ * Whether autosave actually runs: the resolved `active` from the shared
12812
+ * `resolveAutosaveActivation` (host `autosave` prop as a ceiling, title-bar
12813
+ * toggle as the preference inside it), not the raw toggle.
12814
+ */
12245
12815
  autosaveEnabled?: boolean;
12246
12816
  /**
12247
- * AutoRecover cadence in seconds, from
12248
- * `resolveAutosaveIntervalSeconds(File > Options > Save)`. React was the only
12249
- * binding that never passed one (vanilla, svelte and angular all resolve it),
12250
- * so the option's number field moved and the timer kept its 120s default.
12817
+ * The resolved cadence in milliseconds, from the shared
12818
+ * `resolveAutosaveIntervalMs` (host `autosaveIntervalMs` prop > File >
12819
+ * Options > Save AutoRecover cadence > 120s default).
12251
12820
  */
12252
- autosaveIntervalSeconds?: number;
12821
+ autosaveIntervalMs?: number;
12253
12822
  /**
12254
12823
  * File > Fonts > "Embed fonts in the file". Forwarded to `useSerialize`, so
12255
12824
  * turning it off actually strips the embedded font data on the next save.
@@ -12305,13 +12874,22 @@ interface UseViewerIntegrationInput {
12305
12874
  gridSpacingPx: number;
12306
12875
  content: ArrayBuffer | Uint8Array | null;
12307
12876
  filePath: string | undefined;
12308
- /** AutoSave toggle state from the title bar. */
12877
+ /**
12878
+ * Whether autosave actually runs: the shared `resolveAutosaveActivation`
12879
+ * verdict (host `autosave` prop as a ceiling, title-bar toggle inside it).
12880
+ */
12309
12881
  autosaveEnabled: boolean;
12310
12882
  /**
12311
- * AutoRecover cadence in seconds, resolved from File > Options > Save.
12312
- * Optional: omitting it keeps `useAutosave`'s 120s default.
12883
+ * Whether the host permits autosave at all. Only the recovery prompt needs
12884
+ * this separately from `autosaveEnabled`: a user who merely switched the
12885
+ * toggle off should still be offered a snapshot from before the crash.
12313
12886
  */
12314
- autosaveIntervalSeconds?: number;
12887
+ autosaveAllowed?: boolean;
12888
+ /**
12889
+ * The resolved cadence in milliseconds (shared `resolveAutosaveIntervalMs`).
12890
+ * Optional: omitting it keeps the shared 120s AutoRecover default.
12891
+ */
12892
+ autosaveIntervalMs?: number;
12315
12893
  canEdit: boolean;
12316
12894
  mode: ViewerState['mode'];
12317
12895
  slides: PptxSlide[];
@@ -12342,6 +12920,8 @@ interface ViewerIntegrationResult {
12342
12920
  handleEnterPresenterView: AnnotationHandlersResult['handleEnterPresenterView'];
12343
12921
  handleEnterRehearsalMode: AnnotationHandlersResult['handleEnterRehearsalMode'];
12344
12922
  autosaveStatus: AutosaveStatus;
12923
+ /** The crash-recovery prompt (shared descriptor) plus its accept/decline actions. */
12924
+ recovery: UseRecoveryDetectionResult;
12345
12925
  isEncryptedDialogOpen: boolean;
12346
12926
  setIsEncryptedDialogOpen: Dispatch<SetStateAction<boolean>>;
12347
12927
  /** The loaded core handler, exposed for the AI bridge (`getHandler`). */
@@ -12643,6 +13223,13 @@ interface UseExportSaveAsInput {
12643
13223
  appProperties: Record<string, unknown> | null;
12644
13224
  customProperties: Array<Record<string, unknown>>;
12645
13225
  tagCollections: Array<Record<string, unknown>>;
13226
+ /**
13227
+ * The slide masters and their layouts, as View > Slide Master left them.
13228
+ * Save As builds its own options rather than reusing `useSerialize`, so it
13229
+ * needs the same array: without it a master-view edit reached Save and not
13230
+ * Save As. (For a long while it reached neither.)
13231
+ */
13232
+ slideMasters: PptxSlideMaster[];
12646
13233
  notesMaster: Record<string, unknown> | undefined;
12647
13234
  handoutMaster: Record<string, unknown> | undefined;
12648
13235
  guides: Array<{
@@ -12655,6 +13242,8 @@ interface UseExportSaveAsInput {
12655
13242
  theme: PptxTheme | undefined;
12656
13243
  /** Slide canvas size in CSS pixels, carried into the deck-JSON export. */
12657
13244
  canvasSize: CanvasSize;
13245
+ /** The EMU `p:sldSz` the viewer holds; see `UseExportHandlersInput`. */
13246
+ slideSizeEmu?: SlideSizeEmu | undefined;
12658
13247
  modalControls: ExportModalControls;
12659
13248
  password?: string;
12660
13249
  }
@@ -12722,6 +13311,13 @@ interface UseKeyboardShortcutsInput {
12722
13311
  onUngroup?: () => void;
12723
13312
  /** Show or hide the keyboard-shortcut reference ("?"). */
12724
13313
  onToggleShortcuts?: () => void;
13314
+ /**
13315
+ * Open or close the find bar (Ctrl/Cmd+F). Left unwired by the default
13316
+ * shell, where `useFindReplace` owns the find state and resolves the same
13317
+ * chord against the same shared keymap; the case exists so the switch stays
13318
+ * exhaustive and so a host driving this hook directly can handle it.
13319
+ */
13320
+ onFind?: () => void;
12725
13321
  /** Navigate to previous visible slide (edit mode, no selection). */
12726
13322
  onPrevSlide?: () => void;
12727
13323
  /** Navigate to next visible slide (edit mode, no selection). */
@@ -12880,6 +13476,8 @@ interface UsePresentationKeyboardInput {
12880
13476
  onToggleToolbar?: () => void;
12881
13477
  /** Open the All Slides navigator (Ctrl+S). */
12882
13478
  onShowAllSlides?: () => void;
13479
+ /** Show or hide live captions (J). */
13480
+ onToggleSubtitles?: () => void;
12883
13481
  onToggleBlackScreen?: () => void;
12884
13482
  onToggleWhiteScreen?: () => void;
12885
13483
  rehearsing: boolean;