pptx-react-viewer 2.16.10 → 2.18.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 (136) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +14 -14
  3. package/dist/{AiChatPanel-XHKYPYPH.mjs → AiChatPanel-SSSBERWJ.mjs} +4 -4
  4. package/dist/AiChatPanel-SSSBERWJ.mjs.br +0 -0
  5. package/dist/AiChatPanel-SSSBERWJ.mjs.gz +0 -0
  6. package/dist/{AiChatPanel-EPMBL6EA.js → AiChatPanel-UN5DHPZY.js} +24 -24
  7. package/dist/AiChatPanel-UN5DHPZY.js.br +0 -0
  8. package/dist/AiChatPanel-UN5DHPZY.js.gz +0 -0
  9. package/dist/{Model3DScene-DUJOZA2B.js → Model3DScene-4RPYKC2I.js} +2 -2
  10. package/dist/Model3DScene-4RPYKC2I.js.br +0 -0
  11. package/dist/Model3DScene-4RPYKC2I.js.gz +0 -0
  12. package/dist/{Model3DScene-YMIAGRPG.mjs → Model3DScene-LYEESYAI.mjs} +1 -1
  13. package/dist/Model3DScene-LYEESYAI.mjs.br +0 -0
  14. package/dist/Model3DScene-LYEESYAI.mjs.gz +0 -0
  15. package/dist/{PowerPointViewer-Du7u4INi.d.ts → PowerPointViewer-Cf4YHjdF.d.ts} +2 -2
  16. package/dist/PowerPointViewer-Cf4YHjdF.d.ts.map +1 -0
  17. package/dist/{SurfaceChart3DScene-TNCHWQAK.js → SurfaceChart3DScene-ACPKCWLJ.js} +2 -2
  18. package/dist/SurfaceChart3DScene-ACPKCWLJ.js.br +0 -0
  19. package/dist/SurfaceChart3DScene-ACPKCWLJ.js.gz +0 -0
  20. package/dist/{SurfaceChart3DScene-Q47OEJXS.mjs → SurfaceChart3DScene-JR62SOYO.mjs} +1 -1
  21. package/dist/SurfaceChart3DScene-JR62SOYO.mjs.br +0 -0
  22. package/dist/SurfaceChart3DScene-JR62SOYO.mjs.gz +0 -0
  23. package/dist/{audience-content-store-BvqKy7Hf.d.ts → audience-content-store-CyS0oP6t.d.ts} +2 -2
  24. package/dist/{audience-content-store-BvqKy7Hf.d.ts.map → audience-content-store-CyS0oP6t.d.ts.map} +1 -1
  25. package/dist/{chunk-WK22Z7PK.js → chunk-4LWGAVAP.js} +526 -928
  26. package/dist/chunk-4LWGAVAP.js.br +0 -0
  27. package/dist/chunk-4LWGAVAP.js.gz +0 -0
  28. package/dist/{chunk-EL2YF26P.mjs → chunk-7XF6S4AM.mjs} +1 -1
  29. package/dist/chunk-7XF6S4AM.mjs.br +0 -0
  30. package/dist/chunk-7XF6S4AM.mjs.gz +0 -0
  31. package/dist/{chunk-FSVE6WUY.js → chunk-ASKYZ5ZY.js} +728 -523
  32. package/dist/chunk-ASKYZ5ZY.js.br +0 -0
  33. package/dist/chunk-ASKYZ5ZY.js.gz +0 -0
  34. package/dist/{chunk-VHME5BE6.mjs → chunk-BZOL6FXF.mjs} +326 -728
  35. package/dist/chunk-BZOL6FXF.mjs.br +0 -0
  36. package/dist/chunk-BZOL6FXF.mjs.gz +0 -0
  37. package/dist/{chunk-YWKUIUQX.mjs → chunk-GODW6RNR.mjs} +87648 -78804
  38. package/dist/chunk-GODW6RNR.mjs.br +0 -0
  39. package/dist/chunk-GODW6RNR.mjs.gz +0 -0
  40. package/dist/{chunk-ESC6IB2F.js → chunk-ICZDMFF2.js} +2147 -3399
  41. package/dist/chunk-ICZDMFF2.js.br +0 -0
  42. package/dist/chunk-ICZDMFF2.js.gz +0 -0
  43. package/dist/{chunk-PI5SFTDC.js → chunk-MAVLV56S.js} +3 -3
  44. package/dist/chunk-MAVLV56S.js.br +0 -0
  45. package/dist/chunk-MAVLV56S.js.gz +0 -0
  46. package/dist/{chunk-G3VAE7ZF.mjs → chunk-O7FTUUXP.mjs} +1212 -2464
  47. package/dist/chunk-O7FTUUXP.mjs.br +0 -0
  48. package/dist/chunk-O7FTUUXP.mjs.gz +0 -0
  49. package/dist/{chunk-J7EFC3GS.mjs → chunk-QUB5OSKY.mjs} +394 -189
  50. package/dist/chunk-QUB5OSKY.mjs.br +0 -0
  51. package/dist/chunk-QUB5OSKY.mjs.gz +0 -0
  52. package/dist/{chunk-DVZF4ARG.js → chunk-RTUGI4HQ.js} +49 -4
  53. package/dist/chunk-RTUGI4HQ.js.br +0 -0
  54. package/dist/chunk-RTUGI4HQ.js.gz +0 -0
  55. package/dist/{chunk-5IUEPQTK.mjs → chunk-SNL6LBRX.mjs} +49 -4
  56. package/dist/chunk-SNL6LBRX.mjs.br +0 -0
  57. package/dist/chunk-SNL6LBRX.mjs.gz +0 -0
  58. package/dist/{chunk-Y2KIB3QH.js → chunk-WVDM36ZM.js} +87730 -78843
  59. package/dist/chunk-WVDM36ZM.js.br +0 -0
  60. package/dist/chunk-WVDM36ZM.js.gz +0 -0
  61. package/dist/i18n.js +4 -4
  62. package/dist/i18n.js.br +0 -0
  63. package/dist/i18n.js.gz +0 -0
  64. package/dist/i18n.mjs +1 -1
  65. package/dist/i18n.mjs.br +0 -0
  66. package/dist/i18n.mjs.gz +0 -0
  67. package/dist/index.d.ts +702 -37
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js +65 -41
  70. package/dist/index.js.br +0 -0
  71. package/dist/index.js.gz +0 -0
  72. package/dist/index.mjs +6 -6
  73. package/dist/index.mjs.br +0 -0
  74. package/dist/index.mjs.gz +0 -0
  75. package/dist/internals.d.ts +923 -54
  76. package/dist/internals.d.ts.map +1 -1
  77. package/dist/internals.js +79 -79
  78. package/dist/internals.js.br +0 -0
  79. package/dist/internals.js.gz +0 -0
  80. package/dist/internals.mjs +4 -4
  81. package/dist/internals.mjs.br +0 -0
  82. package/dist/internals.mjs.gz +0 -0
  83. package/dist/pptx-viewer.css +1 -1
  84. package/dist/pptx-viewer.css.br +0 -0
  85. package/dist/pptx-viewer.css.gz +0 -0
  86. package/dist/{types-DU35aAJK.d.ts → types-C_CTI-QE.d.ts} +3 -31
  87. package/dist/types-C_CTI-QE.d.ts.map +1 -0
  88. package/dist/{useViewerBuildingBlocks-Xddn6SFj.d.ts → useViewerBuildingBlocks-DItilDbP.d.ts} +47 -8
  89. package/dist/useViewerBuildingBlocks-DItilDbP.d.ts.map +1 -0
  90. package/dist/viewer/index.d.ts +593 -56
  91. package/dist/viewer/index.js +27 -27
  92. package/dist/viewer/index.js.br +0 -0
  93. package/dist/viewer/index.js.gz +0 -0
  94. package/dist/viewer/index.mjs +6 -6
  95. package/dist/viewer/index.mjs.br +0 -0
  96. package/dist/viewer/index.mjs.gz +0 -0
  97. package/package.json +2 -2
  98. package/dist/AiChatPanel-EPMBL6EA.js.br +0 -0
  99. package/dist/AiChatPanel-EPMBL6EA.js.gz +0 -0
  100. package/dist/AiChatPanel-XHKYPYPH.mjs.br +0 -0
  101. package/dist/AiChatPanel-XHKYPYPH.mjs.gz +0 -0
  102. package/dist/Model3DScene-DUJOZA2B.js.br +0 -0
  103. package/dist/Model3DScene-DUJOZA2B.js.gz +0 -0
  104. package/dist/Model3DScene-YMIAGRPG.mjs.br +0 -0
  105. package/dist/Model3DScene-YMIAGRPG.mjs.gz +0 -0
  106. package/dist/PowerPointViewer-Du7u4INi.d.ts.map +0 -1
  107. package/dist/SurfaceChart3DScene-Q47OEJXS.mjs.br +0 -0
  108. package/dist/SurfaceChart3DScene-Q47OEJXS.mjs.gz +0 -0
  109. package/dist/SurfaceChart3DScene-TNCHWQAK.js.br +0 -0
  110. package/dist/SurfaceChart3DScene-TNCHWQAK.js.gz +0 -0
  111. package/dist/chunk-5IUEPQTK.mjs.br +0 -0
  112. package/dist/chunk-5IUEPQTK.mjs.gz +0 -0
  113. package/dist/chunk-DVZF4ARG.js.br +0 -0
  114. package/dist/chunk-DVZF4ARG.js.gz +0 -0
  115. package/dist/chunk-EL2YF26P.mjs.br +0 -0
  116. package/dist/chunk-EL2YF26P.mjs.gz +0 -0
  117. package/dist/chunk-ESC6IB2F.js.br +0 -0
  118. package/dist/chunk-ESC6IB2F.js.gz +0 -0
  119. package/dist/chunk-FSVE6WUY.js.br +0 -0
  120. package/dist/chunk-FSVE6WUY.js.gz +0 -0
  121. package/dist/chunk-G3VAE7ZF.mjs.br +0 -0
  122. package/dist/chunk-G3VAE7ZF.mjs.gz +0 -0
  123. package/dist/chunk-J7EFC3GS.mjs.br +0 -0
  124. package/dist/chunk-J7EFC3GS.mjs.gz +0 -0
  125. package/dist/chunk-PI5SFTDC.js.br +0 -0
  126. package/dist/chunk-PI5SFTDC.js.gz +0 -0
  127. package/dist/chunk-VHME5BE6.mjs.br +0 -0
  128. package/dist/chunk-VHME5BE6.mjs.gz +0 -0
  129. package/dist/chunk-WK22Z7PK.js.br +0 -0
  130. package/dist/chunk-WK22Z7PK.js.gz +0 -0
  131. package/dist/chunk-Y2KIB3QH.js.br +0 -0
  132. package/dist/chunk-Y2KIB3QH.js.gz +0 -0
  133. package/dist/chunk-YWKUIUQX.mjs.br +0 -0
  134. package/dist/chunk-YWKUIUQX.mjs.gz +0 -0
  135. package/dist/types-DU35aAJK.d.ts.map +0 -1
  136. package/dist/useViewerBuildingBlocks-Xddn6SFj.d.ts.map +0 -1
@@ -1145,6 +1145,22 @@ interface ShapeStyle {
1145
1145
  fontRefIdx?: string;
1146
1146
  /** Raw XML colour child of `<a:fontRef>`. */
1147
1147
  fontRefColorXml?: XmlObject;
1148
+ /**
1149
+ * The fill `<a:fillRef>` resolved to, recorded ONLY when the shape's own
1150
+ * `spPr` authored no fill at all, so the reference is what paints it.
1151
+ *
1152
+ * Its absence therefore means "the fill is the shape's own", and its
1153
+ * presence plus an unchanged flat fill means "still purely inherited": see
1154
+ * `authored-shape-style.ts`, the shape-scope twin of `TextStyle`'s
1155
+ * `inheritedRunStyle`.
1156
+ */
1157
+ inheritedFillStyle?: ShapeStyle;
1158
+ /**
1159
+ * The outline `<a:lnRef>` resolved to, recorded before `spPr/a:ln` was
1160
+ * layered on top. A property that still equals this baseline was never
1161
+ * authored on the shape and must not be written back as if it were.
1162
+ */
1163
+ inheritedLineStyle?: ShapeStyle;
1148
1164
  }
1149
1165
  //#endregion
1150
1166
  //#region src/core/types/text.d.ts
@@ -1185,6 +1201,60 @@ interface ShapeStyle {
1185
1201
  interface TextStyle {
1186
1202
  /** Original `a:rPr` XML retained by projections that share the shape-text model. */
1187
1203
  runPropertiesXml?: XmlObject;
1204
+ /**
1205
+ * The properties this run's OWN `a:rPr` authored, and nothing else.
1206
+ *
1207
+ * A run style is assembled as
1208
+ * `{...inheritedRunStyle, ...authoredRunStyle}`, so the flat style is a
1209
+ * fully RESOLVED view: it cannot say whether `fontSize: 60` came from the
1210
+ * run, from the shape's `a:lstStyle`, from the layout placeholder, from the
1211
+ * master `p:txStyles` or from the theme. Omission is meaningful in OOXML
1212
+ * (§21.1.2.3), so a writer that re-emits the resolved view converts every
1213
+ * inherited value into an authored one and the deck stops being
1214
+ * theme-driven after one save.
1215
+ *
1216
+ * This is the run-scope twin of {@link TextSegment.paragraphProperties},
1217
+ * which is parsed strictly from the paragraph's own `a:pPr` for the same
1218
+ * reason. Present only for runs that came from a parsed deck; absent for
1219
+ * SDK-built text, where the flat style IS the only description and must be
1220
+ * written out in full.
1221
+ */
1222
+ authoredRunStyle?: TextStyle;
1223
+ /**
1224
+ * The resolved inheritance baseline {@link authoredRunStyle} was layered
1225
+ * on top of (shape `a:lstStyle` -> placeholder -> layout -> master
1226
+ * `p:txStyles` -> theme -> `p:defaultTextStyle`).
1227
+ *
1228
+ * Kept alongside the authored half because the two answer different
1229
+ * questions. The authored half says "the source pinned this"; the baseline
1230
+ * says "this value is what inheritance already produces", which is how an
1231
+ * EDIT is told apart from an inherited value: an editor mutates the flat
1232
+ * style without knowing about either field, so a property that now differs
1233
+ * from the baseline was either authored or edited and must be written,
1234
+ * while one that still matches can be left to inherit.
1235
+ *
1236
+ * Holds a reference to the per-paragraph baseline object rather than a
1237
+ * copy, so carrying it costs one pointer per run.
1238
+ */
1239
+ inheritedRunStyle?: TextStyle;
1240
+ /**
1241
+ * Snapshot of the ELEMENT-scope paragraph geometry (alignment, margins,
1242
+ * indent, line and paragraph spacing, tab stops, rtl, line-break flags) as
1243
+ * the load pipeline resolved it.
1244
+ *
1245
+ * Present only on an `element.textStyle` that came from a parsed deck, and
1246
+ * populated only with the geometry keys. It exists so the save path can
1247
+ * answer one question it otherwise cannot: has the user CHANGED the body's
1248
+ * alignment or indent, or is the value simply what the shape's
1249
+ * `a:lstStyle`, its layout placeholder and the master already produce?
1250
+ * Element-level text panels (`textAdvancedPatch`, `alignPatch` and friends
1251
+ * in `pptx-viewer-shared`) write `element.textStyle` and never touch
1252
+ * `segment.paragraphProperties`, so a diff against this snapshot is the
1253
+ * only way to tell an edit from an inheritance artefact.
1254
+ *
1255
+ * @see element-paragraph-geometry.ts
1256
+ */
1257
+ resolvedParagraphGeometry?: TextStyle;
1188
1258
  fontFamily?: string;
1189
1259
  fontSize?: number;
1190
1260
  /** When true, renderer should shrink text to fit the shape bounds. */
@@ -1640,7 +1710,28 @@ interface BulletInfo {
1640
1710
  autoNumType?: string;
1641
1711
  /** Auto-numbering start value. */
1642
1712
  autoNumStartAt?: number;
1643
- /** Zero-based paragraph index within the text body (for auto-numbering). */
1713
+ /**
1714
+ * Auto-numbering ORDINAL OFFSET: the zero-based distance of this paragraph
1715
+ * within its own numbered list, such that
1716
+ * `autoNumStartAt + paragraphIndex` is the ordinal to render. Despite the
1717
+ * name it is NOT the paragraph's position in the text body; the two agree
1718
+ * only for a list that starts at the first paragraph and is never
1719
+ * interrupted.
1720
+ *
1721
+ * It has to be the offset rather than the raw position because every
1722
+ * consumer that re-derives a marker from `BulletInfo` alone (the renderer's
1723
+ * `resolveParagraphBullet`, the Markdown converter's `resolveListMarker`)
1724
+ * computes `autoNumStartAt + paragraphIndex`. The load path resolves the
1725
+ * real sequence itself, restarting the count after any paragraph that
1726
+ * interrupts the list, and publishes the offset here so those consumers
1727
+ * land on the same number. With the raw position they did not, and BOTH
1728
+ * markers were painted ("3.1. Item"), because the paragraph builder drops
1729
+ * the parsed marker segment only when the two strings agree.
1730
+ *
1731
+ * Runtime-only: derived at parse time and never serialized. OOXML has no
1732
+ * counterpart (`a:buAutoNum` carries only `@type` and `@startAt`), so the
1733
+ * writer neither reads nor emits it.
1734
+ */
1644
1735
  paragraphIndex?: number;
1645
1736
  /** Bullet font family from `a:buFont`. */
1646
1737
  fontFamily?: string;
@@ -1828,6 +1919,15 @@ interface PptxElementBase {
1828
1919
  shapeId?: string;
1829
1920
  /** Element name from `cNvPr/@name`. Used for morph transition matching via the `!!` naming convention. */
1830
1921
  name?: string;
1922
+ /**
1923
+ * `p:nvSpPr/p:nvPr/p:ph/@type` (lower-cased) when the shape is a placeholder:
1924
+ * `title`, `ctrtitle`, `body`, `subtitle`, `ftr`, `dt`, `sldnum`, ...
1925
+ *
1926
+ * Captured on load so consumers can tell a footer placeholder from a text box
1927
+ * without re-walking `rawXml`. Absent on non-placeholder shapes and on
1928
+ * SDK-created elements.
1929
+ */
1930
+ placeholderType?: string;
1831
1931
  x: number;
1832
1932
  y: number;
1833
1933
  width: number;
@@ -1888,6 +1988,19 @@ interface PptxTextProperties {
1888
1988
  }>;
1889
1989
  /** 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. */
1890
1990
  promptText?: string;
1991
+ /**
1992
+ * The string {@link text} was INHERITED from, when this is a header / footer /
1993
+ * date / slide-number placeholder whose own body the file leaves empty.
1994
+ *
1995
+ * PowerPoint keeps the footer string on the slide master and writes each
1996
+ * slide's copy of the `ftr` placeholder empty, so the empty body means
1997
+ * "render the master's footer here". Rendering needs the resolved string, but
1998
+ * SAVING it into the slide would pin that slide to today's master text and
1999
+ * silently detach it from the Header & Footer dialog. The save writer
2000
+ * therefore leaves the authored empty body alone while `text` still equals
2001
+ * this value, and writes a genuine per-slide override once it does not.
2002
+ */
2003
+ inheritedPlaceholderText?: string;
1891
2004
  /** 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. */
1892
2005
  linkedTxbxId?: number;
1893
2006
  /** Sequence number within a linked text box chain (0-based). */
@@ -2298,6 +2411,12 @@ interface PptxChartLineStyle {
2298
2411
  }
2299
2412
  /** Marker symbol types for line/scatter chart data points. */
2300
2413
  type PptxChartMarkerSymbol = 'circle' | 'dash' | 'diamond' | 'dot' | 'none' | 'picture' | 'plus' | 'square' | 'star' | 'triangle' | 'x' | 'auto';
2414
+ /**
2415
+ * `ST_ScatterStyle` (ECMA-376 §21.2.3.40): how a scatter chart joins its points.
2416
+ * `line`/`lineMarker` connect them with straight segments, `smooth`/
2417
+ * `smoothMarker` with a bezier, `marker`/`none` not at all.
2418
+ */
2419
+ type PptxChartScatterStyle = 'none' | 'line' | 'lineMarker' | 'marker' | 'smooth' | 'smoothMarker';
2301
2420
  /** Shape properties extracted from c:spPr for chart formatting. */
2302
2421
  interface PptxChartShapeProps {
2303
2422
  fillColor?: string;
@@ -2499,6 +2618,42 @@ interface PptxChartTreemapOptions {
2499
2618
  interface PptxChartSeries {
2500
2619
  name: string;
2501
2620
  values: number[];
2621
+ /**
2622
+ * Per-series x values from `c:ser/c:xVal` (scatter and bubble series only).
2623
+ *
2624
+ * Every `CT_ScatterSer` / `CT_BubbleSer` carries its OWN `c:xVal`, so two
2625
+ * series in one scatter chart routinely plot against different x ranges (the
2626
+ * normal case for measurement data). Reading the x values off the first
2627
+ * series and reusing them everywhere plotted every series against series 1's
2628
+ * x axis. Absent for category-axis chart kinds, where
2629
+ * {@link PptxChartData.categories} is the x axis.
2630
+ */
2631
+ xValues?: number[];
2632
+ /**
2633
+ * Per-series bubble sizes from `c:ser/c:bubbleSize` (bubble series only),
2634
+ * aligned index-for-index with {@link values}.
2635
+ *
2636
+ * `CT_BubbleSer` carries x, y AND size, so a one-series bubble chart is fully
2637
+ * specified. Absent when the source omits `c:bubbleSize`.
2638
+ */
2639
+ bubbleSizes?: number[];
2640
+ /**
2641
+ * Series-level data-label content flags from `c:ser/c:dLbls`.
2642
+ *
2643
+ * PowerPoint writes the flags a user picks in "Format Data Labels" onto the
2644
+ * SERIES, and leaves the chart-type-level `c:dLbls` all-zero, so reading only
2645
+ * the chart-level group reports "show nothing" for a chart that visibly shows
2646
+ * percentages. These override {@link PptxChartStyle.dataLabels}.
2647
+ */
2648
+ dataLabelOptions?: PptxChartDataLabelOptions;
2649
+ /**
2650
+ * Whether the series line is explicitly suppressed
2651
+ * (`c:ser/c:spPr/a:ln/a:noFill`). Line-drawn kinds (line, scatter, radar)
2652
+ * use this to decide whether to draw a connecting line at all; a marker-only
2653
+ * scatter is authored as `scatterStyle="lineMarker"` PLUS this flag, never by
2654
+ * changing the scatter style.
2655
+ */
2656
+ lineNoFill?: boolean;
2502
2657
  /**
2503
2658
  * Blank-value mask aligned index-for-index with {@link values}: `true` marks
2504
2659
  * a category whose numeric cache point (`c:numCache/c:pt`) was absent or
@@ -2842,6 +2997,17 @@ interface PptxChartData {
2842
2997
  * default), so only horizontal bar charts need to carry the field.
2843
2998
  */
2844
2999
  barDirection?: PptxChartBarDirection;
3000
+ /**
3001
+ * Scatter presentation mode (`c:scatterChart/c:scatterStyle/@val`).
3002
+ *
3003
+ * `lineMarker` (PowerPoint's own default for every scatter it writes) and
3004
+ * `smoothMarker` draw a connecting line; `marker` and `none` do not. Whether
3005
+ * the MARKERS appear is decided separately by `c:marker/c:symbol`, and
3006
+ * whether the LINE appears is further gated by
3007
+ * {@link PptxChartSeries.lineNoFill} - PowerPoint expresses "markers only" as
3008
+ * `lineMarker` plus an `a:ln/a:noFill`, not as `marker`.
3009
+ */
3010
+ scatterStyle?: PptxChartScatterStyle;
2845
3011
  /**
2846
3012
  * Bar/column gap between category clusters as a percentage of bar width
2847
3013
  * (`c:gapWidth/@val`, 0 through 500). Absent uses the renderer default.
@@ -2995,6 +3161,53 @@ interface PptxChartData {
2995
3161
  * // => { brightness: 20, contrast: -10, grayscale: true } satisfies PptxImageEffects
2996
3162
  * ```
2997
3163
  */
3164
+ /**
3165
+ * One `a14:foregroundMark` / `a14:backgroundMark` polyline hint recorded while
3166
+ * the user painted over the picture in PowerPoint's "Remove Background" mode.
3167
+ * Coordinates are 0..1 fractions of the image.
3168
+ */
3169
+ interface PptxBackgroundRemovalMark {
3170
+ x1: number;
3171
+ y1: number;
3172
+ x2: number;
3173
+ y2: number;
3174
+ }
3175
+ /**
3176
+ * PowerPoint "Remove Background" state (`a14:backgroundRemoval`).
3177
+ *
3178
+ * The four edges are the RETAINED rectangle as 0..1 fractions of the image
3179
+ * (OOXML stores them as per-100000 relative units), and the mark lists are the
3180
+ * segmentation hints the user painted.
3181
+ *
3182
+ * **This is edit-time metadata, not a render instruction.** PowerPoint bakes the
3183
+ * removal into the bitmap referenced by the main `a:blip/@r:embed` and keeps the
3184
+ * pristine original in `a14:imgLayer/@r:embed`. Verified against PowerPoint COM:
3185
+ * a slide exported with and without this element is byte-identical. A renderer
3186
+ * that clips to the retained rectangle would clip an image whose background has
3187
+ * already been removed.
3188
+ *
3189
+ * @example
3190
+ * ```ts
3191
+ * const removal: PptxBackgroundRemoval = { top: 0.12, bottom: 0.88, left: 0.07, right: 0.93 };
3192
+ * // => retains the middle of the image; the marks list stays empty
3193
+ * ```
3194
+ */
3195
+ interface PptxBackgroundRemoval {
3196
+ /** Top edge of the retained rectangle (0..1 fraction of the image height). */
3197
+ top: number;
3198
+ /** Bottom edge of the retained rectangle (0..1 fraction of the image height). */
3199
+ bottom: number;
3200
+ /** Left edge of the retained rectangle (0..1 fraction of the image width). */
3201
+ left: number;
3202
+ /** Right edge of the retained rectangle (0..1 fraction of the image width). */
3203
+ right: number;
3204
+ /** Strokes marking regions the user forced to be foreground. */
3205
+ foregroundMarks?: PptxBackgroundRemovalMark[];
3206
+ /** Strokes marking regions the user forced to be background. */
3207
+ backgroundMarks?: PptxBackgroundRemovalMark[];
3208
+ /** Original effect XML, retained for lossless re-emission. */
3209
+ rawXml?: XmlObject;
3210
+ }
2998
3211
  interface PptxImageEffects {
2999
3212
  /** Brightness adjustment (-100 to 100). */
3000
3213
  brightness?: number;
@@ -3018,8 +3231,38 @@ interface PptxImageEffects {
3018
3231
  };
3019
3232
  /** Artistic effect name (blur, pencilGrayscale, paintStrokes, etc.). */
3020
3233
  artisticEffect?: string;
3021
- /** Artistic effect radius/amount. */
3234
+ /** Artistic effect radius/amount, normalised to 0..100. */
3022
3235
  artisticRadius?: number;
3236
+ /**
3237
+ * Every numeric attribute of the source `a14:artistic*` element, raw and
3238
+ * un-normalised (`trans`, `pencilSize`, `crackSpacing`, …). The attribute set
3239
+ * differs per effect, so this is the lossless companion to the single
3240
+ * {@link PptxImageEffects.artisticRadius} number.
3241
+ */
3242
+ artisticParams?: Record<string, number>;
3243
+ /**
3244
+ * Name of the artistic effect ALREADY baked into the image data, which a
3245
+ * renderer must not apply a second time. Set from the `a14` blip extension,
3246
+ * which PowerPoint writes alongside a pre-rendered bitmap (see
3247
+ * {@link PptxBackgroundRemoval}), and normally equal to
3248
+ * {@link PptxImageEffects.artisticEffect}.
3249
+ *
3250
+ * It records the NAME rather than a boolean so that picking a different
3251
+ * effect in this library's inspector (which patches `artisticEffect` alone)
3252
+ * still renders: the two names then differ.
3253
+ */
3254
+ artisticPrerenderedEffect?: string;
3255
+ /**
3256
+ * PowerPoint "Remove Background" state (`a14:backgroundRemoval`). Edit-time
3257
+ * metadata: the removal is already baked into the image data.
3258
+ */
3259
+ backgroundRemoval?: PptxBackgroundRemoval;
3260
+ /**
3261
+ * `a14:imgLayer/@r:embed` — relationship id of the PRISTINE original image
3262
+ * the baked effects were derived from (PowerPoint stores it as an HD Photo
3263
+ * `.wdp` part, which browsers cannot decode).
3264
+ */
3265
+ originalImageRelId?: string;
3023
3266
  /** Alpha modulation fixed: non-negative percentage (100 means unchanged opacity). */
3024
3267
  alphaModFix?: number;
3025
3268
  /** Original alpha modulation fixed node, including foreign attributes. */
@@ -3935,6 +4178,11 @@ interface PptxTableCellStyle {
3935
4178
  italic?: boolean;
3936
4179
  underline?: boolean;
3937
4180
  color?: string;
4181
+ /**
4182
+ * Font family from the first run's `a:rPr/a:latin@typeface` (falling back to
4183
+ * `a:ea` / `a:cs`). Per-run families live on {@link PptxTableCellTextRun}.
4184
+ */
4185
+ fontFamily?: string;
3938
4186
  /**
3939
4187
  * Raw XML colour-choice node preserved from `a:tc/a:txBody/.../a:rPr/a:solidFill`
3940
4188
  * for round-trip serialisation. Currently unused by the cell-level writer
@@ -4090,6 +4338,45 @@ interface PptxTableCell3D {
4090
4338
  /** Light rig direction (`a:lightRig@dir`, e.g. `tl`, `t`, `tr`). */
4091
4339
  lightRigDirection?: string;
4092
4340
  }
4341
+ /**
4342
+ * One styled text run inside a table cell's `a:txBody`.
4343
+ *
4344
+ * `PptxTableCell.text` is a flat string and `PptxTableCell.style` describes
4345
+ * only the FIRST run, so a cell mixing formats ("Revenue **grew 42%** last
4346
+ * year") cannot be represented by those two alone. {@link PptxTableCell.runs}
4347
+ * carries the full sequence, with paragraph and line breaks as marker entries
4348
+ * so a renderer can walk it linearly.
4349
+ *
4350
+ * Structurally identical to `pptx-viewer-shared`'s `CellTextRun`, which every
4351
+ * binding's table renderer already consumes.
4352
+ *
4353
+ * @example
4354
+ * ```ts
4355
+ * const runs: PptxTableCellTextRun[] = [
4356
+ * { text: "Revenue " },
4357
+ * { text: "grew 42%", bold: true, color: "#C00000" },
4358
+ * ];
4359
+ * // => satisfies PptxTableCellTextRun[]
4360
+ * ```
4361
+ */
4362
+ interface PptxTableCellTextRun {
4363
+ /** Run text. Empty for the break markers below. */
4364
+ text: string;
4365
+ /** This entry starts a new paragraph (`a:p` boundary) rather than carrying text. */
4366
+ isParagraphBreak?: boolean;
4367
+ /** This entry is a soft line break (`a:br`) rather than carrying text. */
4368
+ isLineBreak?: boolean;
4369
+ bold?: boolean;
4370
+ italic?: boolean;
4371
+ underline?: boolean;
4372
+ strikethrough?: boolean;
4373
+ /** Resolved run colour as a CSS colour string. */
4374
+ color?: string;
4375
+ /** Run font size in points (`a:rPr@sz` / 100). */
4376
+ fontSize?: number;
4377
+ /** Run font family from `a:rPr/a:latin@typeface` (or `a:ea` / `a:cs`). */
4378
+ fontFamily?: string;
4379
+ }
4093
4380
  /**
4094
4381
  * A single table cell with text content, optional style, and merge info.
4095
4382
  *
@@ -4106,6 +4393,15 @@ interface PptxTableCell3D {
4106
4393
  interface PptxTableCell {
4107
4394
  text: string;
4108
4395
  style?: PptxTableCellStyle;
4396
+ /**
4397
+ * Per-run formatting for the cell's text, when it has any beyond what
4398
+ * {@link style} can express. Present only for cells whose `a:txBody`
4399
+ * actually carries runs; renderers fall back to {@link text} when absent.
4400
+ *
4401
+ * Editing a cell's text invalidates these (the editor produces a plain
4402
+ * string), so an edit path must clear them alongside setting `text`.
4403
+ */
4404
+ textRuns?: PptxTableCellTextRun[];
4109
4405
  /** Column span (defaults to 1). */
4110
4406
  gridSpan?: number;
4111
4407
  /** Row span (defaults to 1). */
@@ -4878,13 +5174,42 @@ interface UnknownPptxElement extends PptxElementBase {
4878
5174
  /**
4879
5175
  * A single element on a PPTX slide.
4880
5176
  *
4881
- * This is a **discriminated union** narrow on `element.type` to access
5177
+ * This is a **discriminated union**: narrow on `element.type` to access
4882
5178
  * variant-specific properties like `imageData` (image/picture), `pathData`
4883
5179
  * (shape), or `textSegments` (text/shape).
4884
5180
  */
4885
5181
  type PptxElement = TextPptxElement | ShapePptxElement | ConnectorPptxElement | ImagePptxElement | PicturePptxElement | TablePptxElement | ChartPptxElement | SmartArtPptxElement | OlePptxElement | MediaPptxElement | GroupPptxElement | InkPptxElement | ContentPartPptxElement | ZoomPptxElement | Model3DPptxElement | UnknownPptxElement;
4886
5182
  //#endregion
4887
5183
  //#region src/core/types/masters.d.ts
5184
+ /**
5185
+ * A placeholder slot declared on a master or layout.
5186
+ *
5187
+ * The geometry fields are in CSS pixels (EMU / {@link EMU_PER_PX}) and are only
5188
+ * present when the shape carried an explicit `a:xfrm`. Placeholders that
5189
+ * inherit their frame from the master leave them undefined, so consumers that
5190
+ * draw placeholder outlines (the layout gallery) must skip those entries
5191
+ * rather than assume a zero-sized box at the origin.
5192
+ *
5193
+ * @example
5194
+ * ```ts
5195
+ * const frame: PptxPlaceholderFrame = { type: "body", idx: "1", x: 63, y: 130 };
5196
+ * // => satisfies PptxPlaceholderFrame
5197
+ * ```
5198
+ */
5199
+ interface PptxPlaceholderFrame {
5200
+ /** `p:ph/@type`, lower-cased by the parser; defaults to `body` when omitted. */
5201
+ type: string;
5202
+ /** `p:ph/@idx`, when present. */
5203
+ idx?: string;
5204
+ /** Left offset in CSS pixels, when the shape declares `a:off`. */
5205
+ x?: number;
5206
+ /** Top offset in CSS pixels, when the shape declares `a:off`. */
5207
+ y?: number;
5208
+ /** Width in CSS pixels, when the shape declares `a:ext`. */
5209
+ width?: number;
5210
+ /** Height in CSS pixels, when the shape declares `a:ext`. */
5211
+ height?: number;
5212
+ }
4888
5213
  /**
4889
5214
  * Parsed notes master from `ppt/notesMasters/notesMaster1.xml`.
4890
5215
  *
@@ -4906,10 +5231,7 @@ interface PptxNotesMaster {
4906
5231
  /** Background image data URL. */
4907
5232
  backgroundImage?: string;
4908
5233
  /** Placeholder shapes found on the notes master. */
4909
- placeholders?: Array<{
4910
- type: string;
4911
- idx?: string;
4912
- }>;
5234
+ placeholders?: PptxPlaceholderFrame[];
4913
5235
  /** Editable elements on the notes master (header, footer, date, page number, slide image, notes body). */
4914
5236
  elements?: PptxElement[];
4915
5237
  /** Header/footer flags from `<p:hf>` on the notes master (P-H3). */
@@ -4937,10 +5259,7 @@ interface PptxHandoutMaster {
4937
5259
  /** Background image data URL. */
4938
5260
  backgroundImage?: string;
4939
5261
  /** Placeholder shapes found on the handout master. */
4940
- placeholders?: Array<{
4941
- type: string;
4942
- idx?: string;
4943
- }>;
5262
+ placeholders?: PptxPlaceholderFrame[];
4944
5263
  /** Editable elements on the handout master (header, footer, date, page number, slide placeholders). */
4945
5264
  elements?: PptxElement[];
4946
5265
  /** Number of slides per page for handout print layout (1, 2, 3, 4, 6, or 9). */
@@ -4988,10 +5307,7 @@ interface PptxSlideMaster {
4988
5307
  /** Layout paths associated with this master. */
4989
5308
  layoutPaths?: string[];
4990
5309
  /** Placeholder shapes on the master. */
4991
- placeholders?: Array<{
4992
- type: string;
4993
- idx?: string;
4994
- }>;
5310
+ placeholders?: PptxPlaceholderFrame[];
4995
5311
  /** Parsed element shapes on the master slide (for master view rendering). */
4996
5312
  elements?: PptxElement[];
4997
5313
  /** Parsed slide layout objects associated with this master. */
@@ -5063,10 +5379,7 @@ interface PptxSlideLayout {
5063
5379
  /** Parsed element shapes on the layout. */
5064
5380
  elements?: PptxElement[];
5065
5381
  /** Placeholder shapes on the layout. */
5066
- placeholders?: Array<{
5067
- type: string;
5068
- idx?: string;
5069
- }>;
5382
+ placeholders?: PptxPlaceholderFrame[];
5070
5383
  /** Matching name attribute for layout identification (`@matchingName`). */
5071
5384
  matchingName?: string;
5072
5385
  /** Whether the layout is marked as preserved (prevent deletion, `@preserve`). */
@@ -5080,6 +5393,42 @@ interface PptxSlideLayout {
5080
5393
  /** Header/footer flags from `<p:hf>` on this layout (P-H3). */
5081
5394
  headerFooter?: PptxHeaderFooterFlags;
5082
5395
  }
5396
+ /**
5397
+ * Rendered content of a single layout, used to draw gallery thumbnails.
5398
+ *
5399
+ * Produced on demand rather than during load: materialising every layout's
5400
+ * artwork (and decoding its images) up front costs a noticeable amount of time
5401
+ * on decks with many masters, and most sessions never open the layout gallery
5402
+ * at all.
5403
+ *
5404
+ * @example
5405
+ * ```ts
5406
+ * const preview: PptxLayoutPreview = {
5407
+ * path: "ppt/slideLayouts/slideLayout2.xml",
5408
+ * width: 960,
5409
+ * height: 540,
5410
+ * elements: [],
5411
+ * placeholders: [{ type: "title" }],
5412
+ * };
5413
+ * // => satisfies PptxLayoutPreview
5414
+ * ```
5415
+ */
5416
+ interface PptxLayoutPreview {
5417
+ /** ZIP path of the layout this preview belongs to. */
5418
+ path: string;
5419
+ /** Slide width in CSS pixels, so a thumbnail can compute its own scale. */
5420
+ width: number;
5421
+ /** Slide height in CSS pixels. */
5422
+ height: number;
5423
+ /** Background resolved from the layout, falling back to its master's. */
5424
+ backgroundColor?: string;
5425
+ /** Background image data URL, when the layout or master declares one. */
5426
+ backgroundImage?: string;
5427
+ /** The layout's own artwork (pictures, shapes and static text). */
5428
+ elements: PptxElement[];
5429
+ /** Placeholder slots, drawn as outlined frames in the gallery. */
5430
+ placeholders: PptxPlaceholderFrame[];
5431
+ }
5083
5432
  /**
5084
5433
  * A theme part available in the presentation package.
5085
5434
  *
@@ -5568,6 +5917,54 @@ interface PptxEmbeddedFontList {
5568
5917
  rawXml?: XmlObject;
5569
5918
  }
5570
5919
  //#endregion
5920
+ //#region src/core/types/comment-mentions.d.ts
5921
+ /**
5922
+ * A single `@`-mention inside a modern comment body.
5923
+ *
5924
+ * Offsets index into the comment's FLATTENED plain text: every `a:t` value
5925
+ * below `p188:txBody` concatenated, with paragraphs joined by `\n`. That is the
5926
+ * same string `PptxComment.text` carries, so an edit to `text` invalidates
5927
+ * every offset after the edit point and the serializer re-bases them.
5928
+ *
5929
+ * The markup Office uses for a mention is `CT_Mention` (documented for the
5930
+ * SpreadsheetML `2018/threadedcomments` part): `mentionpersonId`, `mentionId`,
5931
+ * `startIndex` and `length`. The PowerPoint `2018/8/main` schema does not
5932
+ * publish a mention element at all, so `rawXml` is retained and re-emitted
5933
+ * attribute-for-attribute: a producer that spells the attributes differently
5934
+ * still round-trips.
5935
+ *
5936
+ * @example
5937
+ * ```ts
5938
+ * const mention: PptxCommentMention = {
5939
+ * personId: "{2CB2E9D0-D392-EB21-5D46-FBA34C1295E6}",
5940
+ * authorName: "Bob Example",
5941
+ * startIndex: 3,
5942
+ * length: 11,
5943
+ * };
5944
+ * // => "Hi Bob Example can you check this".slice(3, 14) === "Bob Example"
5945
+ * ```
5946
+ */
5947
+ interface PptxCommentMention {
5948
+ /** `mentionId`: GUID identifying this mention instance. */
5949
+ id?: string;
5950
+ /** `mentionpersonId`: the `p188:author` id of the mentioned person. */
5951
+ personId: string;
5952
+ /** Display name resolved from the author list at parse time, when known. */
5953
+ authorName?: string;
5954
+ /** Character offset of the mentioned span in the flattened plain text. */
5955
+ startIndex: number;
5956
+ /** Character length of the mentioned span. */
5957
+ length: number;
5958
+ /**
5959
+ * `uri` of the `p188:ext` this mention list was read from. Undefined means
5960
+ * the list is a direct child of `p188:cm`, which is where it is written for
5961
+ * newly authored mentions.
5962
+ */
5963
+ containerUri?: string;
5964
+ /** Original `p188:mention` node, retained for unknown-attribute preservation. */
5965
+ rawXml?: XmlObject;
5966
+ }
5967
+ //#endregion
5571
5968
  //#region src/core/types/metadata.d.ts
5572
5969
  /**
5573
5970
  * A slide comment — may be a legacy positional comment or a modern
@@ -5614,6 +6011,8 @@ interface PptxComment {
5614
6011
  title?: string;
5615
6012
  /** Modern threaded comment support (p15:threadingInfo). */
5616
6013
  threadId?: string;
6014
+ /** `@`-mentions, indexed into `text` (see {@link PptxCommentMention}). */
6015
+ mentions?: PptxCommentMention[];
5617
6016
  /** Replies to this comment (for modern threaded comments). */
5618
6017
  replies?: PptxComment[];
5619
6018
  /** ID of the element this comment is associated with (if any). */
@@ -6133,7 +6532,7 @@ interface PptxTheme {
6133
6532
  * // => "morph" — one of 40+ transition effects
6134
6533
  * ```
6135
6534
  */
6136
- 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';
6535
+ 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';
6137
6536
  /** Split orientation from OOXML `@_orient`. */
6138
6537
  type PptxSplitOrientation = 'horz' | 'vert';
6139
6538
  /** Schema-defined `ST_TransitionSpeed` values. */
@@ -6428,6 +6827,18 @@ interface PptxSlideBackgroundPattern {
6428
6827
  interface PptxSlide {
6429
6828
  id: string;
6430
6829
  rId: string;
6830
+ /**
6831
+ * `p:sldIdLst/p:sldId/@id` (ST_SlideId, 256..2147483647): the numeric key
6832
+ * that sections (`p14:sldIdLst/p14:sldId/@id`) and section/summary zooms
6833
+ * name slides by.
6834
+ *
6835
+ * It lives in `presentation.xml`, NOT in the slide part, so it cannot be
6836
+ * recovered from `rawXml`. Without it on the model, code that writes a
6837
+ * section's membership has nothing correct to write and falls back to the
6838
+ * slide NUMBER, which is 1-based and therefore never matches a real deck's
6839
+ * ids: the section reloads with no slides in it.
6840
+ */
6841
+ slideId?: string;
6431
6842
  sourceSlideId?: string;
6432
6843
  /** Optional author-supplied slide name (set via `SlideBuilder.setName`). */
6433
6844
  name?: string;
@@ -6630,6 +7041,26 @@ interface PptxPresentationProperties {
6630
7041
  /** Kiosk auto-restart interval in milliseconds (from `p:kiosk/@restart`). Only meaningful when showType is "kiosk". */
6631
7042
  kioskRestartTime?: number;
6632
7043
  }
7044
+ /**
7045
+ * Slide dimensions from `p:sldSz` (CT_SlideSize, ECMA-376 §19.2.1.39).
7046
+ *
7047
+ * @example
7048
+ * ```ts
7049
+ * const size: PptxSlideSize = { widthEmu: 9144000, heightEmu: 6858000, type: 'screen4x3' };
7050
+ * // => satisfies PptxSlideSize
7051
+ * ```
7052
+ */
7053
+ interface PptxSlideSize {
7054
+ /** `@cx` in EMU. Omitted or non-positive values leave the loaded width alone. */
7055
+ widthEmu?: number;
7056
+ /** `@cy` in EMU. Omitted or non-positive values leave the loaded height alone. */
7057
+ heightEmu?: number;
7058
+ /**
7059
+ * `@type` (ST_SlideSizeType). The schema default is `custom`, which is
7060
+ * why PowerPoint omits the attribute for a non-preset size.
7061
+ */
7062
+ type?: string;
7063
+ }
6633
7064
  /**
6634
7065
  * A named custom slide show (`p:custShowLst / p:custShow`).
6635
7066
  *
@@ -7644,6 +8075,19 @@ interface PptxHandlerSaveOptions {
7644
8075
  customerData?: PptxCustomerData[];
7645
8076
  /** Photo album metadata to save back to `p:photoAlbum`. */
7646
8077
  photoAlbum?: PptxPhotoAlbum;
8078
+ /**
8079
+ * Slide dimensions to write back to `p:sldSz`.
8080
+ *
8081
+ * Omitting the option preserves the load-time dimensions verbatim, which
8082
+ * is why an edit made through a viewer's Slide Size control has to reach
8083
+ * the save call: nothing else in the pipeline can observe it.
8084
+ *
8085
+ * PowerPoint derives `Presentation.PageSetup.SlideSize` from `@cx`/`@cy`
8086
+ * alone (verified by COM: an A4-typed `p:sldSz` carrying 4:3 dimensions
8087
+ * still reports `ppSlideSizeCustom`), so `type` is written for fidelity
8088
+ * but the dimensions are what actually decide the reported preset.
8089
+ */
8090
+ slideSize?: PptxSlideSize;
7647
8091
  /** East Asian line-break settings to save back to `p:kinsoku`. */
7648
8092
  kinsoku?: PptxKinsoku | null;
7649
8093
  /** Write-protection verifier. Set to `null` to remove, `undefined` to preserve existing. */
@@ -7699,6 +8143,8 @@ interface IPptxHandlerRuntime {
7699
8143
  revokeBlobUrls(): void;
7700
8144
  getCompatibilityWarnings(): PptxCompatibilityWarning[];
7701
8145
  getLayoutOptions(): PptxLayoutOption[];
8146
+ getLayoutPreview(layoutPath: string): Promise<PptxLayoutPreview | null>;
8147
+ getLayoutPreviews(layoutPaths?: readonly string[]): Promise<PptxLayoutPreview[]>;
7702
8148
  createXmlBuilder(data: PptxData): PptxXmlBuilder;
7703
8149
  Builder(data: PptxData): PptxXmlBuilder;
7704
8150
  setTemplateBackground(path: string, backgroundColor: string | undefined): void;
@@ -7887,6 +8333,26 @@ declare class PptxHandlerCore {
7887
8333
  * @returns Array of {@link PptxLayoutOption} entries.
7888
8334
  */
7889
8335
  getLayoutOptions(): PptxLayoutOption[];
8336
+ /**
8337
+ * Build the artwork thumbnails backing the New Slide / Layout galleries.
8338
+ *
8339
+ * Parsing happens on first request and is memoised afterwards, so opening
8340
+ * the gallery costs one pass over the layout parts and reopening it costs
8341
+ * nothing. Callers that only need one entry should prefer
8342
+ * {@link getLayoutPreview}.
8343
+ *
8344
+ * @param layoutPaths - Restrict the result to these layouts; defaults to
8345
+ * every layout in the presentation.
8346
+ * @returns One {@link PptxLayoutPreview} per resolvable layout.
8347
+ */
8348
+ getLayoutPreviews(layoutPaths?: readonly string[]): Promise<PptxLayoutPreview[]>;
8349
+ /**
8350
+ * Build the artwork thumbnail for a single layout.
8351
+ *
8352
+ * @param layoutPath - Archive path of the `p:sldLayout` part.
8353
+ * @returns The preview, or `null` when the presentation has no such layout.
8354
+ */
8355
+ getLayoutPreview(layoutPath: string): Promise<PptxLayoutPreview | null>;
7890
8356
  /**
7891
8357
  * Create a fluent XML builder scoped to the given presentation data.
7892
8358
  *
@@ -8213,24 +8679,38 @@ declare class PptxHandlerCore {
8213
8679
  name?: string;
8214
8680
  }>>;
8215
8681
  /**
8216
- * Export selected slides as individual PPTX files.
8682
+ * Export selected slides to a vector or raster format, keyed by slide index.
8217
8683
  *
8218
- * Each entry in the returned map is keyed by slide index and contains a
8219
- * standalone `Uint8Array` PPTX with only that slide.
8684
+ * **This does not produce PPTX files.** The previous version of this comment
8685
+ * said each entry was "a standalone PPTX with only that slide", named the
8686
+ * option `slideIndexes` (the real field is `slideIndices`), and wrote the
8687
+ * bytes to `slide_N.pptx`. None of that was ever true: the runtime has
8688
+ * always taken a `format` of `svg` / `png` / `pdf`. Per-slide PPTX
8689
+ * extraction is a different operation and is not implemented here.
8690
+ *
8691
+ * Only `svg` works without a host-supplied backend, and it works fully:
8692
+ * the headless {@link SvgExporter} renders it with no DOM. `png` and `pdf`
8693
+ * THROW, because this package carries no rasteriser; use a viewer binding's
8694
+ * browser export pipeline, or override `exportSlides` on the runtime with
8695
+ * your own backend.
8220
8696
  *
8221
8697
  * @param slides - Full slide array.
8222
- * @param options - Export options (slide indexes, format, etc.).
8223
- * @returns A `Map<slideIndex, Uint8Array>` of exported files.
8698
+ * @param options - Export options (`format`, `slideIndices`, `width`, ...).
8699
+ * @returns A `Map<slideIndex, Uint8Array>` of exported files. Hidden slides
8700
+ * are omitted unless `options.includeHidden` is set, so the map can be
8701
+ * smaller than `options.slideIndices`.
8702
+ * @throws {Error} when `options.format` is `png` or `pdf`.
8224
8703
  *
8225
8704
  * @example
8226
8705
  * ```ts
8227
8706
  * const exports = await handler.exportSlides(data.slides, {
8228
- * slideIndexes: [0, 2],
8707
+ * format: 'svg',
8708
+ * slideIndices: [0, 2],
8229
8709
  * });
8230
8710
  * for (const [idx, bytes] of exports) {
8231
- * await fs.writeFile(`slide_${idx}.pptx`, Buffer.from(bytes));
8711
+ * await fs.writeFile(`slide_${idx}.svg`, Buffer.from(bytes));
8232
8712
  * }
8233
- * // => Map<number, Uint8Array> one standalone .pptx per exported slide
8713
+ * // => Map<number, Uint8Array>: one SVG document per exported slide
8234
8714
  * ```
8235
8715
  */
8236
8716
  exportSlides(slides: PptxSlide[], options: PptxExportOptions): Promise<Map<number, Uint8Array>>;
@@ -8680,6 +9160,91 @@ interface MorphTransitionPlan {
8680
9160
  //#region src/render/text-case-transform.d.ts
8681
9161
  type ChangeCaseMode = 'sentence' | 'lower' | 'upper' | 'capitalize' | 'toggle';
8682
9162
  //#endregion
9163
+ //#region src/render/shape-adjustment-model.d.ts
9164
+ /**
9165
+ * `shape-adjustment-model`: the vocabulary the adjust-handle modules share.
9166
+ *
9167
+ * The `a:ahLst` work is split three ways for the repo's file-size budget:
9168
+ * `shape-adjustment-probe` measures the geometry, `shape-adjustment-handles`
9169
+ * derives the handles from those measurements, and `shape-adjustment-solver`
9170
+ * turns a pointer position back into guide values. All three need these types
9171
+ * and the one rule that operates purely on them, so they live here and the
9172
+ * dependency graph stays a DAG rather than a cycle.
9173
+ *
9174
+ * @module render/shape-adjustment-model
9175
+ */
9176
+ /**
9177
+ * How a pointer position becomes a guide value, captured once when the gesture
9178
+ * starts so `pointermove` stays pure arithmetic.
9179
+ */
9180
+ interface ShapeAdjustmentSolver {
9181
+ /** `linear`: the handle slides. `angular`: it swings about {@link centerX}. */
9182
+ kind: 'linear' | 'angular';
9183
+ /** Handle position in element-local px at {@link startValue}. */
9184
+ anchorX: number;
9185
+ anchorY: number;
9186
+ /** Element-local px the handle travels per ONE unit of guide value. */
9187
+ dirX: number;
9188
+ dirY: number;
9189
+ /** Pivot for an angular handle (the shape centre). */
9190
+ centerX: number;
9191
+ centerY: number;
9192
+ /** The guide value the anchor was measured at. */
9193
+ startValue: number;
9194
+ /** Guide-space bounds, taken from the preset's own `pin` clamp. */
9195
+ min: number;
9196
+ max: number;
9197
+ }
9198
+ /** One guide a handle drives. */
9199
+ interface AdjustmentAxisSolver {
9200
+ key: string;
9201
+ solver: ShapeAdjustmentSolver;
9202
+ }
9203
+ /** Descriptor for one draggable adjustment handle (the amber diamond). */
9204
+ interface ShapeAdjustmentHandleDescriptor {
9205
+ /** The `a:avLst` guide name this handle writes (`adj`, `adj1`, ...). */
9206
+ key: string;
9207
+ /** Handle x offset in element-local px (origin = element top-left). */
9208
+ left: number;
9209
+ /** Handle y offset in element-local px. */
9210
+ top: number;
9211
+ /**
9212
+ * Current adjustment value in GUIDE units, not a 0-1 fraction. Most presets
9213
+ * range 0..50000 or 0..100000 and the angular ones run to 21,600,000.
9214
+ */
9215
+ value: number;
9216
+ cursor: string;
9217
+ /**
9218
+ * How this handle's drag resolves, measured off the preset geometry: one
9219
+ * entry per `a:avLst` guide it drives (callouts drive two). Absent only for
9220
+ * a caller that built a descriptor by hand.
9221
+ */
9222
+ solvers?: AdjustmentAxisSolver[];
9223
+ }
9224
+ /** Live drag state captured when an adjustment gesture starts. */
9225
+ interface ShapeAdjustmentDragState {
9226
+ elementId: string;
9227
+ key: string;
9228
+ shapeType: string;
9229
+ startClientX: number;
9230
+ startClientY: number;
9231
+ startAdjustment: number;
9232
+ startWidth: number;
9233
+ startHeight: number;
9234
+ moved: boolean;
9235
+ /** Copied from the descriptor the gesture started on. */
9236
+ solvers?: AdjustmentAxisSolver[];
9237
+ /**
9238
+ * The element's whole `a:avLst` map at gesture start.
9239
+ *
9240
+ * A binding writes `shapeAdjustments` as one object, so a drag that sent
9241
+ * only the guide it changed would DELETE every other authored adjustment on
9242
+ * a multi-adjust preset (a `quadArrow` would lose two of its three the first
9243
+ * time one was touched).
9244
+ */
9245
+ startAdjustments?: Record<string, number>;
9246
+ }
9247
+ //#endregion
8683
9248
  //#region src/render/collaboration-text-codec.d.ts
8684
9249
  /**
8685
9250
  * collaboration-text-codec.ts: TextSegment[] <-> Y.Text delta codec used by the
@@ -8798,6 +9363,12 @@ interface CompareResult {
8798
9363
  changedCount: number;
8799
9364
  unchangedCount: number;
8800
9365
  }
9366
+ interface SlideSizeEmu {
9367
+ widthEmu: number;
9368
+ heightEmu: number;
9369
+ /** ST_SlideSizeType token, or `''` for a size with no preset. */
9370
+ type: string;
9371
+ }
8801
9372
  //#endregion
8802
9373
  //#region src/render/mobile-viewport.d.ts
8803
9374
  /**
@@ -8900,6 +9471,34 @@ interface ElementClipboardPayload {
8900
9471
  element: PptxElement;
8901
9472
  isTemplate: boolean;
8902
9473
  }
9474
+ /** What the "Embed fonts in the file" toggle should look like and do. */
9475
+ interface FontEmbeddingDescriptor {
9476
+ /** Distinct typeface names the loaded deck currently embeds. */
9477
+ embeddedFamilies: string[];
9478
+ /**
9479
+ * Whether the toggle accepts input. False when the deck embeds nothing,
9480
+ * because turning it on could not produce an embedded font.
9481
+ */
9482
+ interactive: boolean;
9483
+ /**
9484
+ * The position the toggle must START in so that it describes the file that
9485
+ * would be written right now. A deck that arrived with embedded fonts keeps
9486
+ * them on save, so the switch has to read "on" from the outset; the previous
9487
+ * hardcoded `false` said the opposite of what save actually did.
9488
+ */
9489
+ initialEnabled: boolean;
9490
+ /** Present only when `interactive` is false. */
9491
+ disabledReasonKey?: string;
9492
+ }
9493
+ //#endregion
9494
+ //#region src/render/master-view.d.ts
9495
+ /** Which part the master view is currently pointed at. */
9496
+ interface MasterViewTarget {
9497
+ tab: MasterViewTab;
9498
+ masterIndex: number;
9499
+ /** `null` selects the master itself rather than one of its layouts. */
9500
+ layoutIndex: number | null;
9501
+ }
8903
9502
  //#endregion
8904
9503
  //#region src/render/virtualized-list.d.ts
8905
9504
  /** Framework-neutral virtual-list range used by every thumbnail sidebar. */
@@ -8915,6 +9514,51 @@ interface VirtualizedRange {
8915
9514
  }
8916
9515
  /** Compute the rendered item window for fixed-height virtual lists. */
8917
9516
  declare function computeVirtualRange(totalItems: number, itemHeight: number, scrollTop: number, viewportHeight: number, overscan?: number): VirtualizedRange;
9517
+ /**
9518
+ * Why the deck is being serialised, which is a separate question from whether
9519
+ * the user protected it.
9520
+ *
9521
+ * - `user-file` (the default): the bytes leave the viewer as a file. Save,
9522
+ * Save As, Export, the host-facing `getContent()`. Protection applies.
9523
+ * - `recovery-snapshot`: the bytes exist only so the viewer can read them back.
9524
+ * The autosave crash-recovery snapshot in IndexedDB, and the internal
9525
+ * re-serialise-then-reload cycle behind "apply theme". Protection does NOT
9526
+ * apply: these are always written in the clear.
9527
+ *
9528
+ * ## Why a recovery snapshot must stay plaintext
9529
+ *
9530
+ * Nothing that reads a snapshot back has a password to give it.
9531
+ * `readBackstageRecentFile`, `restoreSessionDeck` and the Version History
9532
+ * panel's Restore all hand `record.data` straight to `PptxHandler.load()` with
9533
+ * no `password` option, and an encrypted package refuses to open without one
9534
+ * (`EncryptedFileError`). So an encrypted snapshot is not an inconvenience, it
9535
+ * is unreadable: the moment the user turns on protection their crash-recovery
9536
+ * data is silently destroyed, which is the exact opposite of what autosave is
9537
+ * for.
9538
+ *
9539
+ * Encrypting it "properly" is not available either. Decrypting on recovery
9540
+ * means the key has to outlive the crash the snapshot exists for, so it would
9541
+ * have to sit in the same IndexedDB / localStorage as the snapshot itself,
9542
+ * next to the ciphertext it unlocks. That is not a security boundary, it is
9543
+ * theatre. Prompting the user instead only works if they remember the password
9544
+ * of a deck they lost, which is precisely the moment they will not.
9545
+ *
9546
+ * ## The tradeoff this accepts (deliberately, not by omission)
9547
+ *
9548
+ * A password-protected deck DOES leave its content in cleartext at rest in the
9549
+ * origin's IndexedDB. Anyone with the browser profile, or any script running on
9550
+ * the origin, can read it. What limits the exposure: snapshots are scoped to
9551
+ * the origin and profile, aged out by the store, and clearable from
9552
+ * File > Account > Storage & Privacy (`clearLocalStorageData`). A user who
9553
+ * cannot accept plaintext at rest should switch AutoSave off, which stops the
9554
+ * snapshot being written at all.
9555
+ *
9556
+ * The rejected alternative was "skip autosave entirely while a password is
9557
+ * set". It removes the plaintext, but it also removes crash recovery without
9558
+ * telling anyone, so a crash loses the whole editing session. Losing data
9559
+ * quietly is the failure mode we are fixing, not a fix for it.
9560
+ */
9561
+ type DeckSavePurpose = 'user-file' | 'recovery-snapshot';
8918
9562
  //#endregion
8919
9563
  //#region src/render/toolbar-actions.d.ts
8920
9564
  /**
@@ -8970,6 +9614,15 @@ interface ViewerGeneralOptions {
8970
9614
  userName: string;
8971
9615
  userInitials: string;
8972
9616
  showStartScreen: boolean;
9617
+ /**
9618
+ * Lets the user hand a local font file to the viewer so decks authored
9619
+ * with a font the browser lacks render with the real face.
9620
+ *
9621
+ * Off by default. The registration reads a file the user picks and adds it
9622
+ * to the page's font set for the session, which is a capability a host
9623
+ * embedding the viewer should opt into rather than inherit.
9624
+ */
9625
+ enableCustomFontUpload: boolean;
8973
9626
  }
8974
9627
  interface ViewerProofingOptions {
8975
9628
  autoCorrectTwoInitialCapitals: boolean;
@@ -8986,13 +9639,25 @@ interface ViewerProofingOptions {
8986
9639
  checkSpellingAsYouType: boolean;
8987
9640
  hideSpellingErrors: boolean;
8988
9641
  }
9642
+ /**
9643
+ * File > Options > Save.
9644
+ *
9645
+ * Font embedding deliberately has NO entry here. It is owned by the File >
9646
+ * Fonts panel, whose toggle is the one the save path reads (see
9647
+ * `render/font-embedding`: `describeFontEmbedding` decides the toggle's start
9648
+ * position and whether it can do anything at all, `embeddedFontSaveOptions`
9649
+ * turns it into the `PptxHandler.save()` slice). This group used to carry a
9650
+ * second `embedFonts` boolean, plus an `embedAllFontCharacters` companion, and
9651
+ * neither was read by anything: the pane moved a switch that changed no saved
9652
+ * byte, while the panel next door moved the real one. Two switches for one
9653
+ * setting, one of them lying, is worse than one switch in a less
9654
+ * PowerPoint-shaped place.
9655
+ */
8989
9656
  interface ViewerSaveOptions {
8990
9657
  autoSave: boolean;
8991
9658
  autoRecoverIntervalMinutes: number;
8992
9659
  keepLastAutoRecoveredVersion: boolean;
8993
9660
  defaultExportFormat: DefaultExportFormat;
8994
- embedFonts: boolean;
8995
- embedAllFontCharacters: boolean;
8996
9661
  cacheRetentionDays: number;
8997
9662
  clearCacheOnClose: boolean;
8998
9663
  }
@@ -9211,22 +9876,6 @@ interface ResizeState {
9211
9876
  lastWidth: number;
9212
9877
  lastHeight: number;
9213
9878
  }
9214
- /**
9215
- * Tracks the state of an ongoing shape adjustment handle drag.
9216
- * Used when the user drags the yellow diamond handle to alter
9217
- * shape-specific parameters (e.g. corner radius on a rounded rectangle).
9218
- */
9219
- interface ShapeAdjustmentDragState {
9220
- elementId: string;
9221
- key: string;
9222
- shapeType: string;
9223
- startClientX: number;
9224
- startClientY: number;
9225
- startAdjustment: number;
9226
- startWidth: number;
9227
- startHeight: number;
9228
- moved: boolean;
9229
- }
9230
9879
  /**
9231
9880
  * A snapshot of editor state captured for undo/redo history.
9232
9881
  * Contains the full slide deck state at a point in time so that
@@ -9497,10 +10146,20 @@ interface ToolbarProps {
9497
10146
  onTransformTextCase: (mode: ChangeCaseMode) => void;
9498
10147
  isOverflowMenuOpen: boolean;
9499
10148
  onSetOverflowMenuOpen: (open: boolean) => void;
9500
- layoutOptions: Array<{
9501
- path: string;
9502
- name: string;
9503
- }>;
10149
+ layoutOptions: PptxLayoutOption[];
10150
+ /** `layoutPath` of the active slide, marking the current gallery tile. */
10151
+ currentLayoutPath?: string;
10152
+ /** Supplies gallery artwork; without it the menus stay name-only. */
10153
+ loadLayoutPreviews?: () => Promise<PptxLayoutPreview[]>;
10154
+ /** Theme major/minor latin faces, leading the font dropdown. */
10155
+ themeFonts?: {
10156
+ heading?: string;
10157
+ body?: string;
10158
+ };
10159
+ /** Families the deck embeds, offered as their own dropdown group. */
10160
+ embeddedFontFamilies?: readonly string[];
10161
+ /** Families registered this session via File > Options > Fonts. */
10162
+ customFontFamilies?: readonly string[];
9504
10163
  onInsertSlideFromLayout: (path: string, name?: string) => void;
9505
10164
  /** Re-map the active slide onto another of its master's layouts. */
9506
10165
  onApplyLayout?: (path: string) => void;
@@ -9519,6 +10178,8 @@ interface ToolbarProps {
9519
10178
  onToggleVersionHistory?: () => void;
9520
10179
  onOpenPasswordProtection?: () => void;
9521
10180
  onOpenDocumentProperties?: () => void;
10181
+ /** Design > Slide Size: reveal the inspector card that owns the slide size. */
10182
+ onOpenSlideSize?: () => void;
9522
10183
  onOpenFontEmbedding?: () => void;
9523
10184
  onOpenDigitalSignatures?: () => void;
9524
10185
  onEnterMasterView: () => void;
@@ -9552,6 +10213,22 @@ interface ToolbarProps {
9552
10213
  activeSlide?: PptxSlide;
9553
10214
  onTransitionChange: (updates: Partial<PptxSlideTransition>) => void;
9554
10215
  onApplyTransitionToAll: () => void;
10216
+ /**
10217
+ * Home > Slides > Reset: re-apply the active slide's own layout, restoring
10218
+ * inherited placeholder geometry. Undeclared until now, which is why
10219
+ * `SlidesGroup` bound `undefined` and the button did nothing.
10220
+ */
10221
+ onResetSlide?: () => void;
10222
+ /** Home > Slides > Section: start a new section at the active slide. */
10223
+ onAddSection?: () => void;
10224
+ /** Home > Editing > Select > Select All (every element on the active slide). */
10225
+ onSelectAll?: () => void;
10226
+ /**
10227
+ * Slide Show > Options: what the four checkboxes read, and how a tick is
10228
+ * committed. See shared `ribbon-slide-show-options`.
10229
+ */
10230
+ presentationProperties?: PptxPresentationProperties;
10231
+ onPresentationPropertiesChange?: (updates: Partial<PptxPresentationProperties>) => void;
9555
10232
  /** Host-supplied list of toolbar buttons/ribbon tabs to hide. See `PowerPointViewerProps.hiddenActions`. */
9556
10233
  hiddenActions?: readonly ToolbarActionId[];
9557
10234
  /** Whether the AI assistant is available (the host passed the `ai` prop). */
@@ -9628,7 +10305,7 @@ interface SlideCanvasProps {
9628
10305
  /** Called when the user presses mouse down on empty canvas space. */
9629
10306
  onCanvasMouseDown?: (e: React$1.MouseEvent) => void;
9630
10307
  onResizePointerDown: (elementId: string, e: React$1.MouseEvent, handle: string) => void;
9631
- onAdjustmentPointerDown: (elementId: string, e: React$1.MouseEvent) => void;
10308
+ onAdjustmentPointerDown: (elementId: string, e: React$1.MouseEvent, descriptor: ShapeAdjustmentHandleDescriptor) => void;
9632
10309
  /** Commit a new rotation (degrees) when the on-canvas rotate handle is dragged. */
9633
10310
  onRotate?: (elementId: string, rotationDeg: number) => void;
9634
10311
  onInlineEditChange: (text: string) => void;
@@ -9747,6 +10424,17 @@ interface UseAutosaveInput {
9747
10424
  intervalSeconds?: number;
9748
10425
  /** Whether autosave is enabled. */
9749
10426
  enabled?: boolean;
10427
+ /**
10428
+ * The values a snapshot is built from, read fresh on each tick.
10429
+ *
10430
+ * `isDirty` stays true from the first edit until the user performs a real
10431
+ * save, so on its own it makes the timer re-serialize and rewrite an
10432
+ * identical deck every N seconds forever. Vue, Svelte and Vanilla never had
10433
+ * that problem because they debounce on the slides array being reassigned;
10434
+ * this is the same trigger, and `shouldWriteAutosaveSnapshot` writes
10435
+ * whenever it is unsure. Omit it and every tick writes, as before.
10436
+ */
10437
+ getChangeSources?: () => readonly unknown[];
9750
10438
  }
9751
10439
  interface UseAutosaveResult {
9752
10440
  /** Current autosave status for display in the StatusBar. */
@@ -10192,6 +10880,18 @@ interface EditorHistoryInput {
10192
10880
  maxHistoryEntries?: number;
10193
10881
  hasActivePointerInteraction: () => boolean;
10194
10882
  pointerCommitNonce: number;
10883
+ /**
10884
+ * Raised whenever a local edit is committed, i.e. exactly when this hook
10885
+ * learns the deck has diverged from what was last loaded or saved.
10886
+ *
10887
+ * This is what drives `state.isDirty`, and through it the status bar, the
10888
+ * host's `onDirtyChange` (the demos hang their "* filename" title marker off
10889
+ * it) and - critically - `useAutosave`, which short-circuits on a clean
10890
+ * document. Before this existed, `isDirty` was raised only by a few
10891
+ * master-view and document-property paths, so an element nudge, Home > New
10892
+ * Slide or a notes edit left the flag false and crash recovery never ran.
10893
+ */
10894
+ onDirty?: () => void;
10195
10895
  setSlides: (slides: PptxSlide[]) => void;
10196
10896
  setCanvasSize: (size: CanvasSize) => void;
10197
10897
  setActiveSlideIndex: (index: number) => void;
@@ -10306,6 +11006,8 @@ interface UsePresentationModeInput {
10306
11006
  onToggleToolbar?: () => void;
10307
11007
  /** Open the All Slides navigator (Ctrl+S). */
10308
11008
  onShowAllSlides?: () => void;
11009
+ /** Show or hide live captions (PowerPoint's bare J). */
11010
+ onToggleSubtitles?: () => void;
10309
11011
  /** Called to persist rehearsal timings into slide transitions. */
10310
11012
  onSaveRehearsalTimings?: (timings: Record<number, number>) => void;
10311
11013
  /** Whether to loop continuously (kiosk or explicit loop setting). */
@@ -10682,6 +11384,15 @@ interface ViewerCoreState {
10682
11384
  /** Width and height of the slide canvas in CSS pixels. */
10683
11385
  canvasSize: CanvasSize;
10684
11386
  setCanvasSize: React$1.Dispatch<React$1.SetStateAction<CanvasSize>>;
11387
+ /**
11388
+ * `p:sldSz` in EMU, seeded from the loaded deck and updated by Design >
11389
+ * Slide Size. It is what a save persists: the pixel `canvasSize` above
11390
+ * cannot round-trip a preset (Ledger's 12179300 EMU is 1278.5px, and the
11391
+ * integer pixel it rounds to costs the deck its `ppSlideSizeLedgerPaper`
11392
+ * identity). `undefined` until a deck loads or the user picks a preset.
11393
+ */
11394
+ slideSizeEmu: SlideSizeEmu | undefined;
11395
+ setSlideSizeEmu: React$1.Dispatch<React$1.SetStateAction<SlideSizeEmu | undefined>>;
10685
11396
  /** Zero-based index of the currently active (visible) slide. */
10686
11397
  activeSlideIndex: number;
10687
11398
  setActiveSlideIndex: React$1.Dispatch<React$1.SetStateAction<number>>;
@@ -10961,6 +11672,8 @@ interface UseLoadContentInput {
10961
11672
  setTemplateElementsBySlideId: React.Dispatch<React.SetStateAction<Record<string, PptxElement[]>>>;
10962
11673
  mediaDataUrls: Map<string, string>;
10963
11674
  setCanvasSize: React.Dispatch<React.SetStateAction<CanvasSize>>;
11675
+ /** Seeds the EMU `p:sldSz` that a save persists (see `ViewerCoreState.slideSizeEmu`). */
11676
+ setSlideSizeEmu: React.Dispatch<React.SetStateAction<SlideSizeEmu | undefined>>;
10964
11677
  setHeaderFooter: React.Dispatch<React.SetStateAction<PptxHeaderFooter>>;
10965
11678
  setLayoutOptions: React.Dispatch<React.SetStateAction<Array<{
10966
11679
  path: string;
@@ -10971,6 +11684,12 @@ interface UseLoadContentInput {
10971
11684
  setTableStyleMap: React.Dispatch<React.SetStateAction<ParsedTableStyleMap | undefined>>;
10972
11685
  setThemeOptions: React.Dispatch<React.SetStateAction<PptxThemeOption[]>>;
10973
11686
  setCustomShows: React.Dispatch<React.SetStateAction<PptxCustomShow[]>>;
11687
+ /**
11688
+ * Seeds the running show from `p:showPr/p:custShow/@id`, so a deck authored
11689
+ * to open into a custom show plays that subset instead of the whole deck.
11690
+ * A later manual pick still wins: this only fires on load.
11691
+ */
11692
+ setActiveCustomShowId: React.Dispatch<React.SetStateAction<string | null>>;
10974
11693
  setSections: React.Dispatch<React.SetStateAction<PptxSection[]>>;
10975
11694
  setPresentationProperties: React.Dispatch<React.SetStateAction<PptxPresentationProperties>>;
10976
11695
  setNotesMaster: React.Dispatch<React.SetStateAction<PptxNotesMaster | undefined>>;
@@ -11004,9 +11723,28 @@ interface UseLoadContentInput {
11004
11723
  interface UseLoadContentResult {
11005
11724
  handlerRef: React.MutableRefObject<PptxHandler | null>;
11006
11725
  }
11007
- 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;
11726
+ 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;
11008
11727
  //#endregion
11009
11728
  //#region src/viewer/hooks/useElementOperations.d.ts
11729
+ /**
11730
+ * View > Slide Master routing.
11731
+ *
11732
+ * The master view paints a part that is not in `slides`, so an edit made
11733
+ * there has to be written back into the master / layout / notes / handout
11734
+ * model instead. React previously keyed a pseudo-slide on the master's
11735
+ * archive path and pushed edits into `templateElementsBySlideId`, where
11736
+ * `buildSaveSlides` looks parts up by real slide id and so never found them:
11737
+ * the change showed on screen and vanished on save.
11738
+ */
11739
+ interface MasterViewRouting {
11740
+ target: MasterViewTarget | null;
11741
+ slideMasters: PptxSlideMaster[];
11742
+ notesMaster: PptxNotesMaster | undefined;
11743
+ handoutMaster: PptxHandoutMaster | undefined;
11744
+ setSlideMasters: React.Dispatch<React.SetStateAction<PptxSlideMaster[]>>;
11745
+ setNotesMaster: React.Dispatch<React.SetStateAction<PptxNotesMaster | undefined>>;
11746
+ setHandoutMaster: React.Dispatch<React.SetStateAction<PptxHandoutMaster | undefined>>;
11747
+ }
11010
11748
  interface UseElementOperationsInput {
11011
11749
  slides: PptxSlide[];
11012
11750
  activeSlide: PptxSlide | undefined;
@@ -11017,6 +11755,8 @@ interface UseElementOperationsInput {
11017
11755
  editTemplateMode: boolean;
11018
11756
  /** Template (master/layout) elements for the active slide. */
11019
11757
  templateElements: PptxElement[];
11758
+ /** Set while View > Slide Master is open; routes writes to the master part. */
11759
+ masterView?: MasterViewRouting | undefined;
11020
11760
  history: EditorHistoryResult;
11021
11761
  setSlides: React.Dispatch<React.SetStateAction<PptxSlide[]>>;
11022
11762
  setTemplateElementsBySlideId: React.Dispatch<React.SetStateAction<Record<string, PptxElement[]>>>;
@@ -11064,6 +11804,12 @@ interface SectionOperations {
11064
11804
  moveSectionUp: (sectionId: string) => void;
11065
11805
  moveSectionDown: (sectionId: string) => void;
11066
11806
  moveSlidesToSection: (slideIndexes: number[], targetSectionId: string) => void;
11807
+ /**
11808
+ * Flip `section.collapsed`, the `p14:section/@collapsed` flag core already
11809
+ * round-trips. React alone kept collapse in component-local state, so the
11810
+ * one binding that could not persist a collapsed section was this one.
11811
+ */
11812
+ toggleSectionCollapse: (sectionId: string) => void;
11067
11813
  }
11068
11814
  declare function useSectionOperations(input: UseSectionOperationsInput): SectionOperations;
11069
11815
  //#endregion
@@ -11134,7 +11880,7 @@ interface CanvasInteractionHandlers {
11134
11880
  handleElementContextMenu: (elementId: string, e: React.MouseEvent) => void;
11135
11881
  handleCanvasMouseDown: (e: React.MouseEvent) => void;
11136
11882
  handleResizePointerDown: (elementId: string, e: React.MouseEvent, handle: string) => void;
11137
- handleAdjustmentPointerDown: (elementId: string, e: React.MouseEvent) => void;
11883
+ handleAdjustmentPointerDown: (elementId: string, e: React.MouseEvent, descriptor: ShapeAdjustmentHandleDescriptor) => void;
11138
11884
  /** Commit a new rotation (degrees) for an element from the on-canvas rotate handle. */
11139
11885
  handleRotate: (elementId: string, rotationDeg: number) => void;
11140
11886
  /** Commit an inline (on-canvas) SmartArt node edit through the element-update path. */
@@ -11398,6 +12144,8 @@ interface UseExportHandlersInput {
11398
12144
  appProperties: Record<string, unknown> | null;
11399
12145
  customProperties: Array<Record<string, unknown>>;
11400
12146
  tagCollections: Array<Record<string, unknown>>;
12147
+ /** The slide masters and their layouts; see `UseExportSaveAsInput`. */
12148
+ slideMasters: PptxSlideMaster[];
11401
12149
  notesMaster: Record<string, unknown> | undefined;
11402
12150
  handoutMaster: Record<string, unknown> | undefined;
11403
12151
  guides: Array<{
@@ -11410,6 +12158,12 @@ interface UseExportHandlersInput {
11410
12158
  theme: PptxTheme | undefined;
11411
12159
  /** Slide canvas size in CSS pixels, carried into the deck-JSON export. */
11412
12160
  canvasSize: CanvasSize;
12161
+ /**
12162
+ * The EMU `p:sldSz` the viewer holds. Save-As builds its own save options
12163
+ * rather than reusing `useSerialize`, so without this a Slide Size edit
12164
+ * reached Save and not Save As (or the backstage Save, which routes here).
12165
+ */
12166
+ slideSizeEmu?: SlideSizeEmu | undefined;
11413
12167
  password?: string;
11414
12168
  }
11415
12169
  interface ExportHandlersResult {
@@ -11610,6 +12364,12 @@ interface UseViewerDialogsInput {
11610
12364
  isDirty: boolean;
11611
12365
  /** Editor history instance (used for markDirty on settings changes). */
11612
12366
  history: EditorHistoryResult;
12367
+ /**
12368
+ * Typeface names the loaded deck embeds (`p:embeddedFontLst`). Decides
12369
+ * whether the "Embed fonts" toggle can do anything, and which position it
12370
+ * starts in.
12371
+ */
12372
+ embeddedFontFamilies?: readonly string[];
11613
12373
  }
11614
12374
  /**
11615
12375
  * Output shape of the {@link useViewerDialogs} hook.
@@ -11656,9 +12416,15 @@ interface ViewerDialogsResult {
11656
12416
  /** OMML data for the equation currently being edited, or null. */
11657
12417
  editingEquationOmml: Record<string, unknown> | null;
11658
12418
  setEditingEquationOmml: React.Dispatch<React.SetStateAction<Record<string, unknown> | null>>;
11659
- /** Whether font embedding is enabled for save. */
12419
+ /**
12420
+ * Whether the saved file will carry the deck's embedded fonts. Read by
12421
+ * `useSerialize` via `embeddedFontSaveOptions`; false strips
12422
+ * `p:embeddedFontLst` and the `.fntdata` parts.
12423
+ */
11660
12424
  embedFontsEnabled: boolean;
11661
12425
  setEmbedFontsEnabled: React.Dispatch<React.SetStateAction<boolean>>;
12426
+ /** Whether the toggle can do anything on this deck, and why not when it cannot. */
12427
+ fontEmbedding: FontEmbeddingDescriptor;
11662
12428
  /** True when the container is narrower than 768px (triggers compact layout). */
11663
12429
  isNarrowViewport: boolean;
11664
12430
  /** Switches the viewer to master view mode, preserving the previous mode for restoration. */
@@ -11773,6 +12539,16 @@ interface UseSerializeInput {
11773
12539
  /** Separated master/layout (template) elements, merged back at save time. */
11774
12540
  templateElementsBySlideId: Record<string, PptxElement[]>;
11775
12541
  activeSlideIndex: number;
12542
+ /** The pixel canvas the raw Slide Size W/H inputs edit. */
12543
+ canvasSize: CanvasSize;
12544
+ /**
12545
+ * The EMU `p:sldSz` the viewer is holding (seeded on load, replaced by a
12546
+ * preset/orientation pick). Passed with `canvasSize` to
12547
+ * `resolveSlideSizeSelection`, which keeps the EMU whenever the two still
12548
+ * agree so a preset survives the save, and takes the pixels when the user
12549
+ * has typed into the raw inputs.
12550
+ */
12551
+ slideSizeEmu?: SlideSizeEmu | undefined;
11776
12552
  guides: Array<{
11777
12553
  id: string;
11778
12554
  axis: 'h' | 'v';
@@ -11790,12 +12566,43 @@ interface UseSerializeInput {
11790
12566
  appProperties: PptxAppProperties | undefined;
11791
12567
  customProperties: PptxCustomProperty[];
11792
12568
  tagCollections: PptxTagCollection[];
12569
+ /**
12570
+ * The slide masters and their layouts, as View > Slide Master left them.
12571
+ *
12572
+ * Required, not optional: this was the one save option React never passed,
12573
+ * and core rewrites a master or layout part only for the ones the caller
12574
+ * hands back. Every master-view edit therefore showed on screen and was
12575
+ * dropped by the save - a deleted master shape came back on reload, and a
12576
+ * master background reverted to white. The other four bindings pass it.
12577
+ * Core compares each part against the element list parsed at load and
12578
+ * rewrites only what actually changed, so passing the whole array on every
12579
+ * save costs an untouched deck nothing.
12580
+ */
12581
+ slideMasters: PptxSlideMaster[];
11793
12582
  notesMaster: PptxNotesMaster | undefined;
11794
12583
  handoutMaster: PptxHandoutMaster | undefined;
11795
12584
  handlerRef: React$1.RefObject<PptxHandler | null>;
11796
12585
  inlineEditingElementIdRef: React$1.MutableRefObject<string | null>;
11797
12586
  inlineEditingTextRef: React$1.MutableRefObject<string>;
11798
12587
  password?: string;
12588
+ /**
12589
+ * File > Fonts > "Embed fonts in the file". `false` passes
12590
+ * `embeddedFontList: null`, which strips `p:embeddedFontLst`, the `/font`
12591
+ * relationships and the `.fntdata` parts; `true` (the default) leaves core to
12592
+ * re-embed whatever the deck arrived with. Before this the toggle reached no
12593
+ * save call at all and the saved bytes were identical either way.
12594
+ */
12595
+ embedFonts?: boolean;
12596
+ /**
12597
+ * Why these bytes are being produced. Defaults to `'user-file'` (Save, Save
12598
+ * As, Export, the imperative `getContent()`), which honours `password`.
12599
+ * `'recovery-snapshot'` is for bytes the viewer reads back itself - the
12600
+ * autosave snapshot and the re-serialise-then-reload cycle - and is always
12601
+ * plaintext, because nothing on the way back in can supply the password.
12602
+ * See `deck-save-encryption` in `pptx-viewer-shared` for the full rationale
12603
+ * and the privacy tradeoff it accepts.
12604
+ */
12605
+ purpose?: DeckSavePurpose;
11799
12606
  }
11800
12607
  declare function useSerialize(input: UseSerializeInput): () => Promise<Uint8Array | null>;
11801
12608
  //#endregion
@@ -11838,6 +12645,12 @@ interface UsePresentationSetupInput {
11838
12645
  promptKeepInkAnnotations?: boolean;
11839
12646
  /** Options > Advanced > "Show popup toolbar" (default true). */
11840
12647
  popupToolbarEnabled?: boolean;
12648
+ /**
12649
+ * Show or hide live captions. PowerPoint toggles them on a bare `J` during a
12650
+ * show, and the shared slide-show keymap resolves that key for every binding;
12651
+ * without this callback the key is mapped and then lands nowhere.
12652
+ */
12653
+ onToggleSubtitles?: () => void;
11841
12654
  }
11842
12655
  interface PresentationSetupResult {
11843
12656
  presentation: UsePresentationModeResult;
@@ -11899,6 +12712,12 @@ interface UseIOHandlersInput {
11899
12712
  };
11900
12713
  handlerRef: React$1.RefObject<PptxHandler | null>;
11901
12714
  serializeSlides: () => Promise<Uint8Array | null>;
12715
+ /**
12716
+ * Plaintext serialisation for bytes the viewer feeds straight back into its
12717
+ * own loader. "Apply theme" does exactly that, and the loader has no password
12718
+ * to offer, so it must never receive an encrypted package.
12719
+ */
12720
+ serializeForRecovery: () => Promise<Uint8Array | null>;
11902
12721
  setContent: React$1.Dispatch<React$1.SetStateAction<ArrayBuffer | Uint8Array | null>>;
11903
12722
  onContentChange: ((content: Uint8Array) => void) | undefined;
11904
12723
  password?: string;
@@ -11917,6 +12736,18 @@ interface UseContentLifecycleInput {
11917
12736
  filePath: string | undefined;
11918
12737
  /** AutoSave toggle state; when false the recovery autosave timer is off. */
11919
12738
  autosaveEnabled?: boolean;
12739
+ /**
12740
+ * AutoRecover cadence in seconds, from
12741
+ * `resolveAutosaveIntervalSeconds(File > Options > Save)`. React was the only
12742
+ * binding that never passed one (vanilla, svelte and angular all resolve it),
12743
+ * so the option's number field moved and the timer kept its 120s default.
12744
+ */
12745
+ autosaveIntervalSeconds?: number;
12746
+ /**
12747
+ * File > Fonts > "Embed fonts in the file". Forwarded to `useSerialize`, so
12748
+ * turning it off actually strips the embedded font data on the next save.
12749
+ */
12750
+ embedFonts?: boolean;
11920
12751
  slides: PptxSlide[];
11921
12752
  state: ViewerState;
11922
12753
  history: EditorHistoryResult;
@@ -11929,7 +12760,14 @@ interface UseContentLifecycleInput {
11929
12760
  }
11930
12761
  interface ContentLifecycleResult {
11931
12762
  handlerRef: React$1.RefObject<PptxHandler | null>;
12763
+ /** Serialise for the user: honours "Encrypt with Password". */
11932
12764
  serializeSlides: () => Promise<Uint8Array | null>;
12765
+ /**
12766
+ * Serialise for bytes the viewer reads back itself (autosave snapshot,
12767
+ * re-serialise-then-reload). Always plaintext, so recovery - which has no
12768
+ * password to offer - can actually open them.
12769
+ */
12770
+ serializeForRecovery: () => Promise<Uint8Array | null>;
11933
12771
  autosaveStatus: AutosaveStatus;
11934
12772
  }
11935
12773
  declare function useContentLifecycle(input: UseContentLifecycleInput): ContentLifecycleResult;
@@ -11962,6 +12800,11 @@ interface UseViewerIntegrationInput {
11962
12800
  filePath: string | undefined;
11963
12801
  /** AutoSave toggle state from the title bar. */
11964
12802
  autosaveEnabled: boolean;
12803
+ /**
12804
+ * AutoRecover cadence in seconds, resolved from File > Options > Save.
12805
+ * Optional: omitting it keeps `useAutosave`'s 120s default.
12806
+ */
12807
+ autosaveIntervalSeconds?: number;
11965
12808
  canEdit: boolean;
11966
12809
  mode: ViewerState['mode'];
11967
12810
  slides: PptxSlide[];
@@ -12101,6 +12944,14 @@ interface LayoutSwitchingResult {
12101
12944
  loadAvailableLayouts: () => Promise<void>;
12102
12945
  /** Apply a layout to the active slide by its archive path. */
12103
12946
  applyLayout: (layoutPath: string) => Promise<void>;
12947
+ /**
12948
+ * Build the artwork thumbnails the New Slide / Layout galleries draw.
12949
+ *
12950
+ * Deliberately a callback rather than state: parsing every layout is only
12951
+ * worth doing once the user opens one of those menus, and core memoises the
12952
+ * result so reopening costs nothing.
12953
+ */
12954
+ loadLayoutPreviews: () => Promise<PptxLayoutPreview[]>;
12104
12955
  /** The current slide's layout path (if known). */
12105
12956
  currentLayoutPath: string | undefined;
12106
12957
  }
@@ -12285,6 +13136,13 @@ interface UseExportSaveAsInput {
12285
13136
  appProperties: Record<string, unknown> | null;
12286
13137
  customProperties: Array<Record<string, unknown>>;
12287
13138
  tagCollections: Array<Record<string, unknown>>;
13139
+ /**
13140
+ * The slide masters and their layouts, as View > Slide Master left them.
13141
+ * Save As builds its own options rather than reusing `useSerialize`, so it
13142
+ * needs the same array: without it a master-view edit reached Save and not
13143
+ * Save As. (For a long while it reached neither.)
13144
+ */
13145
+ slideMasters: PptxSlideMaster[];
12288
13146
  notesMaster: Record<string, unknown> | undefined;
12289
13147
  handoutMaster: Record<string, unknown> | undefined;
12290
13148
  guides: Array<{
@@ -12297,6 +13155,8 @@ interface UseExportSaveAsInput {
12297
13155
  theme: PptxTheme | undefined;
12298
13156
  /** Slide canvas size in CSS pixels, carried into the deck-JSON export. */
12299
13157
  canvasSize: CanvasSize;
13158
+ /** The EMU `p:sldSz` the viewer holds; see `UseExportHandlersInput`. */
13159
+ slideSizeEmu?: SlideSizeEmu | undefined;
12300
13160
  modalControls: ExportModalControls;
12301
13161
  password?: string;
12302
13162
  }
@@ -12364,6 +13224,13 @@ interface UseKeyboardShortcutsInput {
12364
13224
  onUngroup?: () => void;
12365
13225
  /** Show or hide the keyboard-shortcut reference ("?"). */
12366
13226
  onToggleShortcuts?: () => void;
13227
+ /**
13228
+ * Open or close the find bar (Ctrl/Cmd+F). Left unwired by the default
13229
+ * shell, where `useFindReplace` owns the find state and resolves the same
13230
+ * chord against the same shared keymap; the case exists so the switch stays
13231
+ * exhaustive and so a host driving this hook directly can handle it.
13232
+ */
13233
+ onFind?: () => void;
12367
13234
  /** Navigate to previous visible slide (edit mode, no selection). */
12368
13235
  onPrevSlide?: () => void;
12369
13236
  /** Navigate to next visible slide (edit mode, no selection). */
@@ -12522,6 +13389,8 @@ interface UsePresentationKeyboardInput {
12522
13389
  onToggleToolbar?: () => void;
12523
13390
  /** Open the All Slides navigator (Ctrl+S). */
12524
13391
  onShowAllSlides?: () => void;
13392
+ /** Show or hide live captions (J). */
13393
+ onToggleSubtitles?: () => void;
12525
13394
  onToggleBlackScreen?: () => void;
12526
13395
  onToggleWhiteScreen?: () => void;
12527
13396
  rehearsing: boolean;