pptx-svelte-viewer 2.18.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 (58) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/dist/{AiChatPanel-D6dfMwnT.js → AiChatPanel-DKeBilcx.js} +40 -40
  3. package/dist/{export-DbSAFc8m.js → export-CZzvhGTm.js} +28874 -26338
  4. package/dist/i18n.js +1 -1
  5. package/dist/index.d.ts +433 -13
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +34 -27
  8. package/dist/pptx-svelte-viewer.css +1 -1
  9. package/dist/{translator-CZ12ZvlE.js → translator-EP8BTIz6.js} +24 -4
  10. package/dist/viewer/components/chart-drag.svelte.d.ts +39 -0
  11. package/dist/viewer/components/chart-drag.svelte.d.ts.map +1 -0
  12. package/dist/viewer/components/props-editing.d.ts +2 -2
  13. package/dist/viewer/components/props-editing.d.ts.map +1 -1
  14. package/dist/viewer/components/props-elements.d.ts +8 -1
  15. package/dist/viewer/components/props-elements.d.ts.map +1 -1
  16. package/dist/viewer/components/props-stage.d.ts +5 -1
  17. package/dist/viewer/components/props-stage.d.ts.map +1 -1
  18. package/dist/viewer/components/viewer-body-commits.d.ts +6 -0
  19. package/dist/viewer/components/viewer-body-commits.d.ts.map +1 -1
  20. package/dist/viewer/editor/editing-api.d.ts.map +1 -1
  21. package/dist/viewer/editor/editor-adjust-gesture.d.ts.map +1 -1
  22. package/dist/viewer/editor/editor-controller-deps.d.ts +5 -0
  23. package/dist/viewer/editor/editor-controller-deps.d.ts.map +1 -1
  24. package/dist/viewer/editor/editor-controller-wiring.d.ts.map +1 -1
  25. package/dist/viewer/editor/editor-controller.svelte.d.ts +13 -2
  26. package/dist/viewer/editor/editor-controller.svelte.d.ts.map +1 -1
  27. package/dist/viewer/editor/editor-document-lifecycle.d.ts.map +1 -1
  28. package/dist/viewer/editor/editor-document-state.d.ts +6 -2
  29. package/dist/viewer/editor/editor-document-state.d.ts.map +1 -1
  30. package/dist/viewer/editor/editor-handle-handlers.d.ts +2 -2
  31. package/dist/viewer/editor/editor-handle-handlers.d.ts.map +1 -1
  32. package/dist/viewer/editor/editor-keyboard.d.ts +7 -0
  33. package/dist/viewer/editor/editor-keyboard.d.ts.map +1 -1
  34. package/dist/viewer/editor/editor-presentation-metadata.svelte.d.ts +11 -0
  35. package/dist/viewer/editor/editor-presentation-metadata.svelte.d.ts.map +1 -1
  36. package/dist/viewer/editor/editor-selection-interactivity.d.ts +7 -2
  37. package/dist/viewer/editor/editor-selection-interactivity.d.ts.map +1 -1
  38. package/dist/viewer/editor/editor-state.svelte.d.ts +15 -1
  39. package/dist/viewer/editor/editor-state.svelte.d.ts.map +1 -1
  40. package/dist/viewer/editor/table-cell-pointer.d.ts +5 -0
  41. package/dist/viewer/editor/table-cell-pointer.d.ts.map +1 -1
  42. package/dist/viewer/index.d.ts +481 -18
  43. package/dist/viewer/index.js +16 -16
  44. package/dist/viewer/render/contentpart-view.d.ts +8 -21
  45. package/dist/viewer/render/contentpart-view.d.ts.map +1 -1
  46. package/dist/viewer/render/table-view.d.ts.map +1 -1
  47. package/dist/viewer/state/create-viewer-state-editor-ui.svelte.d.ts.map +1 -1
  48. package/dist/viewer/state/create-viewer-state-presentation.svelte.d.ts.map +1 -1
  49. package/dist/viewer/state/create-viewer-state.svelte.d.ts.map +1 -1
  50. package/dist/viewer/state/inspector-deck.d.ts +10 -2
  51. package/dist/viewer/state/inspector-deck.d.ts.map +1 -1
  52. package/dist/viewer/state/presentation-loader.svelte.d.ts +12 -1
  53. package/dist/viewer/state/presentation-loader.svelte.d.ts.map +1 -1
  54. package/dist/viewer/state/viewer-effects.svelte.d.ts +2 -1
  55. package/dist/viewer/state/viewer-effects.svelte.d.ts.map +1 -1
  56. package/dist/viewer/state/viewport-handlers.d.ts +2 -0
  57. package/dist/viewer/state/viewport-handlers.d.ts.map +1 -1
  58. package/package.json +2 -2
@@ -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. */
@@ -1849,6 +1919,15 @@ interface PptxElementBase {
1849
1919
  shapeId?: string;
1850
1920
  /** Element name from `cNvPr/@name`. Used for morph transition matching via the `!!` naming convention. */
1851
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;
1852
1931
  x: number;
1853
1932
  y: number;
1854
1933
  width: number;
@@ -1909,6 +1988,19 @@ interface PptxTextProperties {
1909
1988
  }>;
1910
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. */
1911
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;
1912
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. */
1913
2005
  linkedTxbxId?: number;
1914
2006
  /** Sequence number within a linked text box chain (0-based). */
@@ -2319,6 +2411,12 @@ interface PptxChartLineStyle {
2319
2411
  }
2320
2412
  /** Marker symbol types for line/scatter chart data points. */
2321
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';
2322
2420
  /** Shape properties extracted from c:spPr for chart formatting. */
2323
2421
  interface PptxChartShapeProps {
2324
2422
  fillColor?: string;
@@ -2520,6 +2618,42 @@ interface PptxChartTreemapOptions {
2520
2618
  interface PptxChartSeries {
2521
2619
  name: string;
2522
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;
2523
2657
  /**
2524
2658
  * Blank-value mask aligned index-for-index with {@link values}: `true` marks
2525
2659
  * a category whose numeric cache point (`c:numCache/c:pt`) was absent or
@@ -2863,6 +2997,17 @@ interface PptxChartData {
2863
2997
  * default), so only horizontal bar charts need to carry the field.
2864
2998
  */
2865
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;
2866
3011
  /**
2867
3012
  * Bar/column gap between category clusters as a percentage of bar width
2868
3013
  * (`c:gapWidth/@val`, 0 through 500). Absent uses the renderer default.
@@ -3016,6 +3161,53 @@ interface PptxChartData {
3016
3161
  * // => { brightness: 20, contrast: -10, grayscale: true } satisfies PptxImageEffects
3017
3162
  * ```
3018
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
+ }
3019
3211
  interface PptxImageEffects {
3020
3212
  /** Brightness adjustment (-100 to 100). */
3021
3213
  brightness?: number;
@@ -3039,8 +3231,38 @@ interface PptxImageEffects {
3039
3231
  };
3040
3232
  /** Artistic effect name (blur, pencilGrayscale, paintStrokes, etc.). */
3041
3233
  artisticEffect?: string;
3042
- /** Artistic effect radius/amount. */
3234
+ /** Artistic effect radius/amount, normalised to 0..100. */
3043
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;
3044
3266
  /** Alpha modulation fixed: non-negative percentage (100 means unchanged opacity). */
3045
3267
  alphaModFix?: number;
3046
3268
  /** Original alpha modulation fixed node, including foreign attributes. */
@@ -4952,7 +5174,7 @@ interface UnknownPptxElement extends PptxElementBase {
4952
5174
  /**
4953
5175
  * A single element on a PPTX slide.
4954
5176
  *
4955
- * This is a **discriminated union** — narrow on `element.type` to access
5177
+ * This is a **discriminated union**: narrow on `element.type` to access
4956
5178
  * variant-specific properties like `imageData` (image/picture), `pathData`
4957
5179
  * (shape), or `textSegments` (text/shape).
4958
5180
  */
@@ -5695,6 +5917,54 @@ interface PptxEmbeddedFontList {
5695
5917
  rawXml?: XmlObject;
5696
5918
  }
5697
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
5698
5968
  //#region src/core/types/metadata.d.ts
5699
5969
  /**
5700
5970
  * A slide comment — may be a legacy positional comment or a modern
@@ -5741,6 +6011,8 @@ interface PptxComment {
5741
6011
  title?: string;
5742
6012
  /** Modern threaded comment support (p15:threadingInfo). */
5743
6013
  threadId?: string;
6014
+ /** `@`-mentions, indexed into `text` (see {@link PptxCommentMention}). */
6015
+ mentions?: PptxCommentMention[];
5744
6016
  /** Replies to this comment (for modern threaded comments). */
5745
6017
  replies?: PptxComment[];
5746
6018
  /** ID of the element this comment is associated with (if any). */
@@ -6260,7 +6532,7 @@ interface PptxTheme {
6260
6532
  * // => "morph" — one of 40+ transition effects
6261
6533
  * ```
6262
6534
  */
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';
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';
6264
6536
  /** Split orientation from OOXML `@_orient`. */
6265
6537
  type PptxSplitOrientation = 'horz' | 'vert';
6266
6538
  /** Schema-defined `ST_TransitionSpeed` values. */
@@ -6555,6 +6827,18 @@ interface PptxSlideBackgroundPattern {
6555
6827
  interface PptxSlide {
6556
6828
  id: string;
6557
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;
6558
6842
  sourceSlideId?: string;
6559
6843
  /** Optional author-supplied slide name (set via `SlideBuilder.setName`). */
6560
6844
  name?: string;
@@ -6757,6 +7041,26 @@ interface PptxPresentationProperties {
6757
7041
  /** Kiosk auto-restart interval in milliseconds (from `p:kiosk/@restart`). Only meaningful when showType is "kiosk". */
6758
7042
  kioskRestartTime?: number;
6759
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
+ }
6760
7064
  /**
6761
7065
  * A named custom slide show (`p:custShowLst / p:custShow`).
6762
7066
  *
@@ -7771,6 +8075,19 @@ interface PptxHandlerSaveOptions {
7771
8075
  customerData?: PptxCustomerData[];
7772
8076
  /** Photo album metadata to save back to `p:photoAlbum`. */
7773
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;
7774
8091
  /** East Asian line-break settings to save back to `p:kinsoku`. */
7775
8092
  kinsoku?: PptxKinsoku | null;
7776
8093
  /** Write-protection verifier. Set to `null` to remove, `undefined` to preserve existing. */
@@ -8362,24 +8679,38 @@ declare class PptxHandlerCore {
8362
8679
  name?: string;
8363
8680
  }>>;
8364
8681
  /**
8365
- * Export selected slides as individual PPTX files.
8682
+ * Export selected slides to a vector or raster format, keyed by slide index.
8366
8683
  *
8367
- * Each entry in the returned map is keyed by slide index and contains a
8368
- * 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.
8369
8696
  *
8370
8697
  * @param slides - Full slide array.
8371
- * @param options - Export options (slide indexes, format, etc.).
8372
- * @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`.
8373
8703
  *
8374
8704
  * @example
8375
8705
  * ```ts
8376
8706
  * const exports = await handler.exportSlides(data.slides, {
8377
- * slideIndexes: [0, 2],
8707
+ * format: 'svg',
8708
+ * slideIndices: [0, 2],
8378
8709
  * });
8379
8710
  * for (const [idx, bytes] of exports) {
8380
- * await fs.writeFile(`slide_${idx}.pptx`, Buffer.from(bytes));
8711
+ * await fs.writeFile(`slide_${idx}.svg`, Buffer.from(bytes));
8381
8712
  * }
8382
- * // => Map<number, Uint8Array> — one standalone .pptx per exported slide
8713
+ * // => Map<number, Uint8Array>: one SVG document per exported slide
8383
8714
  * ```
8384
8715
  */
8385
8716
  exportSlides(slides: PptxSlide[], options: PptxExportOptions): Promise<Map<number, Uint8Array>>;
@@ -8939,16 +9270,71 @@ interface FieldSubstitutionContext {
8939
9270
  /** Title text extracted from the first title placeholder on the slide. */
8940
9271
  slideTitle?: string;
8941
9272
  }
8942
- /** Descriptor for the draggable adjustment handle (the amber diamond). */
9273
+ //#endregion
9274
+ //#region src/render/connector-endpoints.d.ts
9275
+ /** Which end of a connector a gesture is moving. */
9276
+ type ConnectorEndpointKind = 'start' | 'end';
9277
+ //#endregion
9278
+ //#region src/render/shape-adjustment-model.d.ts
9279
+ /**
9280
+ * `shape-adjustment-model`: the vocabulary the adjust-handle modules share.
9281
+ *
9282
+ * The `a:ahLst` work is split three ways for the repo's file-size budget:
9283
+ * `shape-adjustment-probe` measures the geometry, `shape-adjustment-handles`
9284
+ * derives the handles from those measurements, and `shape-adjustment-solver`
9285
+ * turns a pointer position back into guide values. All three need these types
9286
+ * and the one rule that operates purely on them, so they live here and the
9287
+ * dependency graph stays a DAG rather than a cycle.
9288
+ *
9289
+ * @module render/shape-adjustment-model
9290
+ */
9291
+ /**
9292
+ * How a pointer position becomes a guide value, captured once when the gesture
9293
+ * starts so `pointermove` stays pure arithmetic.
9294
+ */
9295
+ interface ShapeAdjustmentSolver {
9296
+ /** `linear`: the handle slides. `angular`: it swings about {@link centerX}. */
9297
+ kind: 'linear' | 'angular';
9298
+ /** Handle position in element-local px at {@link startValue}. */
9299
+ anchorX: number;
9300
+ anchorY: number;
9301
+ /** Element-local px the handle travels per ONE unit of guide value. */
9302
+ dirX: number;
9303
+ dirY: number;
9304
+ /** Pivot for an angular handle (the shape centre). */
9305
+ centerX: number;
9306
+ centerY: number;
9307
+ /** The guide value the anchor was measured at. */
9308
+ startValue: number;
9309
+ /** Guide-space bounds, taken from the preset's own `pin` clamp. */
9310
+ min: number;
9311
+ max: number;
9312
+ }
9313
+ /** One guide a handle drives. */
9314
+ interface AdjustmentAxisSolver {
9315
+ key: string;
9316
+ solver: ShapeAdjustmentSolver;
9317
+ }
9318
+ /** Descriptor for one draggable adjustment handle (the amber diamond). */
8943
9319
  interface ShapeAdjustmentHandleDescriptor {
9320
+ /** The `a:avLst` guide name this handle writes (`adj`, `adj1`, ...). */
8944
9321
  key: string;
8945
9322
  /** Handle x offset in element-local px (origin = element top-left). */
8946
9323
  left: number;
8947
9324
  /** Handle y offset in element-local px. */
8948
9325
  top: number;
8949
- /** Current adjustment value (0–50000). */
9326
+ /**
9327
+ * Current adjustment value in GUIDE units, not a 0-1 fraction. Most presets
9328
+ * range 0..50000 or 0..100000 and the angular ones run to 21,600,000.
9329
+ */
8950
9330
  value: number;
8951
9331
  cursor: string;
9332
+ /**
9333
+ * How this handle's drag resolves, measured off the preset geometry: one
9334
+ * entry per `a:avLst` guide it drives (callouts drive two). Absent only for
9335
+ * a caller that built a descriptor by hand.
9336
+ */
9337
+ solvers?: AdjustmentAxisSolver[];
8952
9338
  }
8953
9339
  //#endregion
8954
9340
  //#region src/render/collaboration-presence.d.ts
@@ -9142,6 +9528,12 @@ interface ViewerFontSource {
9142
9528
  weight?: string | number;
9143
9529
  style?: 'normal' | 'italic';
9144
9530
  }
9531
+ interface SlideSizeEmu {
9532
+ widthEmu: number;
9533
+ heightEmu: number;
9534
+ /** ST_SlideSizeType token, or `''` for a size with no preset. */
9535
+ type: string;
9536
+ }
9145
9537
  /** The configuration emitted when a broadcast starts. */
9146
9538
  interface BroadcastConfig {
9147
9539
  roomId: string;
@@ -9425,13 +9817,25 @@ interface ViewerProofingOptions {
9425
9817
  checkSpellingAsYouType: boolean;
9426
9818
  hideSpellingErrors: boolean;
9427
9819
  }
9820
+ /**
9821
+ * File > Options > Save.
9822
+ *
9823
+ * Font embedding deliberately has NO entry here. It is owned by the File >
9824
+ * Fonts panel, whose toggle is the one the save path reads (see
9825
+ * `render/font-embedding`: `describeFontEmbedding` decides the toggle's start
9826
+ * position and whether it can do anything at all, `embeddedFontSaveOptions`
9827
+ * turns it into the `PptxHandler.save()` slice). This group used to carry a
9828
+ * second `embedFonts` boolean, plus an `embedAllFontCharacters` companion, and
9829
+ * neither was read by anything: the pane moved a switch that changed no saved
9830
+ * byte, while the panel next door moved the real one. Two switches for one
9831
+ * setting, one of them lying, is worse than one switch in a less
9832
+ * PowerPoint-shaped place.
9833
+ */
9428
9834
  interface ViewerSaveOptions {
9429
9835
  autoSave: boolean;
9430
9836
  autoRecoverIntervalMinutes: number;
9431
9837
  keepLastAutoRecoveredVersion: boolean;
9432
9838
  defaultExportFormat: DefaultExportFormat;
9433
- embedFonts: boolean;
9434
- embedAllFontCharacters: boolean;
9435
9839
  cacheRetentionDays: number;
9436
9840
  clearCacheOnClose: boolean;
9437
9841
  }
@@ -10310,6 +10714,8 @@ interface SlideCanvasProps {
10310
10714
  ontablecellcommit?: (elementId: string, rowIndex: number, cellIndex: number, text: string) => void;
10311
10715
  onsmartartnodecommit?: (elementId: string, nodeId: string, text: string) => void;
10312
10716
  onsmartartnodefill?: (elementId: string, nodeId: string, fill: string) => void;
10717
+ /** See `ElementRendererProps.onchartpointcommit`. */
10718
+ onchartpointcommit?: (elementId: string, chartData: PptxChartData) => void;
10313
10719
  /** Passed through to `SlideStage`; see {@link SlideStageProps.comments}. */
10314
10720
  comments?: readonly PptxComment[];
10315
10721
  /** Passed through to `SlideStage`; see {@link SlideStageProps.oncommentmarkerclick}. */
@@ -10870,6 +11276,17 @@ declare class EditorPresentationMetadata {
10870
11276
  presentationProperties: PptxPresentationProperties;
10871
11277
  customShows: PptxCustomShow[];
10872
11278
  constructor(host: PresentationMetadataHost);
11279
+ /**
11280
+ * Deep-copy a value that may be a rune PROXY.
11281
+ *
11282
+ * The dialogs build their edits in `$state`, so what reaches these setters is
11283
+ * a reactive proxy, and `structuredClone` throws `DataCloneError` on one. The
11284
+ * Header & Footer panel hit exactly that: "Apply to All" threw before it ever
11285
+ * assigned, so setting a footer silently did nothing and the canvas kept the
11286
+ * string the deck was loaded with. `$state.snapshot` is a pass-through for a
11287
+ * plain object, so this is safe for every caller.
11288
+ */
11289
+ private static clone;
10873
11290
  set(headerFooter?: PptxHeaderFooter, presentationProperties?: PptxPresentationProperties, customShows?: PptxCustomShow[]): void;
10874
11291
  updatePresentationProperties(next: PptxPresentationProperties): void;
10875
11292
  updateHeaderFooter(next: PptxHeaderFooter): void;
@@ -11058,6 +11475,13 @@ declare class TableCellSelection {
11058
11475
  interface EditorStateDeps {
11059
11476
  getCurrent(): number;
11060
11477
  getHandler(): PptxHandler | null;
11478
+ /**
11479
+ * The `p:sldSz` a save should write, resolved from the viewer's EMU slide
11480
+ * size and its pixel canvas by the shared `resolveSlideSizeSelection`.
11481
+ * Optional so out-of-tree mounts (and the unit tests) can omit it, in which
11482
+ * case core re-emits the load-time dimensions verbatim.
11483
+ */
11484
+ getSlideSize?: () => PptxSlideSize | undefined;
11061
11485
  onChange?: () => void;
11062
11486
  }
11063
11487
  declare class EditorState {
@@ -11155,6 +11579,13 @@ declare class EditorState {
11155
11579
  /** The loaded core handler, or null before a deck is open. Used by the
11156
11580
  * Slides group for layout switching (`applyLayoutToSlide`). */
11157
11581
  getHandler(): PptxHandler | null;
11582
+ /**
11583
+ * The `p:sldSz` the next save should write, or undefined to leave the
11584
+ * load-time dimensions alone. Slide size lives on the loader (it is not
11585
+ * content the undo stack owns), so it reaches the save through this dep the
11586
+ * same way the handler does.
11587
+ */
11588
+ getSlideSize(): PptxSlideSize | undefined;
11158
11589
  /** Adopt a freshly loaded deck as the working document (see `loadEditorDocument`). */
11159
11590
  setSlides(...args: LoadDocumentArgs): void;
11160
11591
  /** Adopt a remote (collaboration) snapshot; see `applyRemoteEditorSlides`. */
@@ -11310,6 +11741,11 @@ interface EditorControllerDeps {
11310
11741
  toggleShortcuts?(): void;
11311
11742
  /** Close the cheat sheet on Escape; true when it was open (Escape consumed). */
11312
11743
  closeShortcuts?(): boolean;
11744
+ /**
11745
+ * Open or close the find bar (Ctrl/Cmd+F). Like the cheat sheet, the panel is
11746
+ * shell-owned UI state, so the controller only signals the intent.
11747
+ */
11748
+ toggleFind?(): void;
11313
11749
  }
11314
11750
 
11315
11751
  interface EditorMarqueeRect extends MarqueeRect {
@@ -11336,8 +11772,13 @@ interface SelectionInteractivity {
11336
11772
  resizable: boolean;
11337
11773
  /** Draw (and honour) the rotate stem + knob. */
11338
11774
  rotatable: boolean;
11339
- /** The amber adjustment diamond, or null when there is none to draw. */
11340
- adjust: ShapeAdjustmentHandleDescriptor | null;
11775
+ /**
11776
+ * The amber adjustment diamonds, one per `a:avLst` guide. Empty when there
11777
+ * is none to draw; PowerPoint shows several on most presets (`quadArrow`
11778
+ * three, `callout3` four), and offering only the first left the rest
11779
+ * unreachable.
11780
+ */
11781
+ adjust: ShapeAdjustmentHandleDescriptor[];
11341
11782
  }
11342
11783
 
11343
11784
  declare class EditorController {
@@ -11346,6 +11787,8 @@ declare class EditorController {
11346
11787
  editingId: string | null;
11347
11788
  marquee: EditorMarqueeRect | null;
11348
11789
  constructor(editor: EditorState, deps: EditorControllerDeps);
11790
+ /** The elements the pointer acts on (slide, or master/layout), for overlays. */
11791
+ get activeElements(): PptxElement[];
11349
11792
  get overlayBox(): OverlayBox | null;
11350
11793
  /**
11351
11794
  * Which selection chrome the authored `a:spLocks` still permit, plus the
@@ -11365,7 +11808,16 @@ declare class EditorController {
11365
11808
  onStageContextMenu: (event: MouseEvent) => void;
11366
11809
  onHandlePointerDown: (handle: ResizeHandleId, event: PointerEvent) => void;
11367
11810
  onRotatePointerDown: (event: PointerEvent) => void;
11368
- onAdjustPointerDown: (event: PointerEvent) => void;
11811
+ onAdjustPointerDown: (event: PointerEvent, descriptor: ShapeAdjustmentHandleDescriptor) => void;
11812
+ /** Live connector-endpoint drag position in SLIDE px, or null when idle. */
11813
+ connectorEndpointDrag: {
11814
+ kind: ConnectorEndpointKind;
11815
+ x: number;
11816
+ y: number;
11817
+ } | null;
11818
+ /** The selected connector, when exactly one connector is selected. */
11819
+ get selectedConnector(): PptxElement | null;
11820
+ onConnectorEndpointPointerDown: (kind: ConnectorEndpointKind, event: PointerEvent) => void;
11369
11821
  onKeyDown: (event: KeyboardEvent) => void;
11370
11822
  /** Open the inline text editor over `id` when the element carries text. */
11371
11823
  enterInlineEdit(id: string): void;
@@ -11708,6 +12160,17 @@ declare class PresentationLoader {
11708
12160
  themeOptions: PptxThemeOption[];
11709
12161
  /** Slide canvas size in pixels. */
11710
12162
  canvasSize: CanvasSize;
12163
+ /**
12164
+ * The deck's `p:sldSz` in EMU, seeded from the parse and re-written by the
12165
+ * inspector's Slide Size preset / orientation controls.
12166
+ *
12167
+ * Held alongside {@link canvasSize} rather than derived from it because the
12168
+ * pixel size is lossy: Ledger is 12179300 EMU (1278.5px), so a round-trip
12169
+ * through an integer pixel would move it 6350 EMU and cost the deck its
12170
+ * `ppSlideSizeLedgerPaper` identity. `resolveSlideSizeSelection` decides
12171
+ * which of the two wins at save time.
12172
+ */
12173
+ slideSize: SlideSizeEmu | undefined;
11711
12174
  /** Archive-path -> displayable URL map for media + poster frames. */
11712
12175
  mediaDataUrls: Map<string, string>;
11713
12176
  /** Presentation theme colours used to resolve scheme-based table styles. */