pptx-react-viewer 2.17.0 → 2.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +703 -0
- package/README.md +14 -14
- package/dist/{AiChatPanel-HCHCVQN2.js → AiChatPanel-2GBJETOY.js} +24 -24
- package/dist/AiChatPanel-2GBJETOY.js.br +0 -0
- package/dist/AiChatPanel-2GBJETOY.js.gz +0 -0
- package/dist/{AiChatPanel-RZ4A7P4H.mjs → AiChatPanel-FZUKTQPQ.mjs} +4 -4
- package/dist/AiChatPanel-FZUKTQPQ.mjs.br +0 -0
- package/dist/AiChatPanel-FZUKTQPQ.mjs.gz +0 -0
- package/dist/{Model3DScene-LK7LSQNH.js → Model3DScene-JHTI2AQ6.js} +2 -2
- package/dist/Model3DScene-JHTI2AQ6.js.br +0 -0
- package/dist/Model3DScene-JHTI2AQ6.js.gz +0 -0
- package/dist/{Model3DScene-I7FR74AD.mjs → Model3DScene-WRRQSYAZ.mjs} +1 -1
- package/dist/Model3DScene-WRRQSYAZ.mjs.br +0 -0
- package/dist/Model3DScene-WRRQSYAZ.mjs.gz +0 -0
- package/dist/{PowerPointViewer-Du7u4INi.d.ts → PowerPointViewer-DVFkeluD.d.ts} +2 -2
- package/dist/PowerPointViewer-DVFkeluD.d.ts.map +1 -0
- package/dist/{audience-content-store-BvqKy7Hf.d.ts → audience-content-store-ChVOSdBh.d.ts} +2 -2
- package/dist/{audience-content-store-BvqKy7Hf.d.ts.map → audience-content-store-ChVOSdBh.d.ts.map} +1 -1
- package/dist/{chunk-7JPLVECA.js → chunk-7ARD2J6Y.js} +10502 -7059
- package/dist/chunk-7ARD2J6Y.js.br +0 -0
- package/dist/chunk-7ARD2J6Y.js.gz +0 -0
- package/dist/{chunk-ZA5JONCW.mjs → chunk-BO373PYH.mjs} +257 -184
- package/dist/chunk-BO373PYH.mjs.br +0 -0
- package/dist/chunk-BO373PYH.mjs.gz +0 -0
- package/dist/{chunk-TCGXGD6E.js → chunk-IRLOXBO7.js} +608 -535
- package/dist/chunk-IRLOXBO7.js.br +0 -0
- package/dist/chunk-IRLOXBO7.js.gz +0 -0
- package/dist/{chunk-AONFHTTJ.js → chunk-MVKRI3CZ.js} +36 -4
- package/dist/chunk-MVKRI3CZ.js.br +0 -0
- package/dist/chunk-MVKRI3CZ.js.gz +0 -0
- package/dist/{chunk-MQHC5TXI.mjs → chunk-MWEBCWVD.mjs} +38 -2347
- package/dist/chunk-MWEBCWVD.mjs.br +0 -0
- package/dist/chunk-MWEBCWVD.mjs.gz +0 -0
- package/dist/{chunk-NQJPPIVH.js → chunk-NFFV3RDS.js} +1632 -1201
- package/dist/chunk-NFFV3RDS.js.br +0 -0
- package/dist/chunk-NFFV3RDS.js.gz +0 -0
- package/dist/{chunk-5BXATG54.js → chunk-OVPJT4EQ.js} +182 -2490
- package/dist/chunk-OVPJT4EQ.js.br +0 -0
- package/dist/chunk-OVPJT4EQ.js.gz +0 -0
- package/dist/{chunk-ATOUVRRQ.js → chunk-RPJ2BIQ7.js} +3 -3
- package/dist/chunk-RPJ2BIQ7.js.br +0 -0
- package/dist/chunk-RPJ2BIQ7.js.gz +0 -0
- package/dist/{chunk-S64T7C4V.mjs → chunk-SQJBFMEX.mjs} +36 -4
- package/dist/chunk-SQJBFMEX.mjs.br +0 -0
- package/dist/chunk-SQJBFMEX.mjs.gz +0 -0
- package/dist/{chunk-K2QU73KB.mjs → chunk-XF3EOHY2.mjs} +10455 -7039
- package/dist/chunk-XF3EOHY2.mjs.br +0 -0
- package/dist/chunk-XF3EOHY2.mjs.gz +0 -0
- package/dist/{chunk-422DF424.mjs → chunk-YWJBD7KV.mjs} +654 -223
- package/dist/chunk-YWJBD7KV.mjs.br +0 -0
- package/dist/chunk-YWJBD7KV.mjs.gz +0 -0
- package/dist/{chunk-FXJOTEPO.mjs → chunk-ZMEYXAC6.mjs} +1 -1
- package/dist/chunk-ZMEYXAC6.mjs.br +0 -0
- package/dist/chunk-ZMEYXAC6.mjs.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +535 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +65 -41
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +645 -47
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +79 -79
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/{types-DU35aAJK.d.ts → types-TCH6icpi.d.ts} +25 -31
- package/dist/types-TCH6icpi.d.ts.map +1 -0
- package/dist/{useViewerBuildingBlocks-C9-prKYB.d.ts → useViewerBuildingBlocks-BKb0qs1j.d.ts} +34 -5
- package/dist/useViewerBuildingBlocks-BKb0qs1j.d.ts.map +1 -0
- package/dist/viewer/index.d.ts +465 -40
- package/dist/viewer/index.js +27 -27
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +2 -2
- package/dist/AiChatPanel-HCHCVQN2.js.br +0 -0
- package/dist/AiChatPanel-HCHCVQN2.js.gz +0 -0
- package/dist/AiChatPanel-RZ4A7P4H.mjs.br +0 -0
- package/dist/AiChatPanel-RZ4A7P4H.mjs.gz +0 -0
- package/dist/Model3DScene-I7FR74AD.mjs.br +0 -0
- package/dist/Model3DScene-I7FR74AD.mjs.gz +0 -0
- package/dist/Model3DScene-LK7LSQNH.js.br +0 -0
- package/dist/Model3DScene-LK7LSQNH.js.gz +0 -0
- package/dist/PowerPointViewer-Du7u4INi.d.ts.map +0 -1
- package/dist/SurfaceChart3DScene-DEQP5O3U.mjs +0 -76
- package/dist/SurfaceChart3DScene-DEQP5O3U.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-DEQP5O3U.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-ODQY77SZ.js +0 -78
- package/dist/SurfaceChart3DScene-ODQY77SZ.js.br +0 -0
- package/dist/SurfaceChart3DScene-ODQY77SZ.js.gz +0 -0
- package/dist/chunk-422DF424.mjs.br +0 -0
- package/dist/chunk-422DF424.mjs.gz +0 -0
- package/dist/chunk-5BXATG54.js.br +0 -0
- package/dist/chunk-5BXATG54.js.gz +0 -0
- package/dist/chunk-7JPLVECA.js.br +0 -0
- package/dist/chunk-7JPLVECA.js.gz +0 -0
- package/dist/chunk-AONFHTTJ.js.br +0 -0
- package/dist/chunk-AONFHTTJ.js.gz +0 -0
- package/dist/chunk-ATOUVRRQ.js.br +0 -0
- package/dist/chunk-ATOUVRRQ.js.gz +0 -0
- package/dist/chunk-FXJOTEPO.mjs.br +0 -0
- package/dist/chunk-FXJOTEPO.mjs.gz +0 -0
- package/dist/chunk-K2QU73KB.mjs.br +0 -0
- package/dist/chunk-K2QU73KB.mjs.gz +0 -0
- package/dist/chunk-MQHC5TXI.mjs.br +0 -0
- package/dist/chunk-MQHC5TXI.mjs.gz +0 -0
- package/dist/chunk-NQJPPIVH.js.br +0 -0
- package/dist/chunk-NQJPPIVH.js.gz +0 -0
- package/dist/chunk-S64T7C4V.mjs.br +0 -0
- package/dist/chunk-S64T7C4V.mjs.gz +0 -0
- package/dist/chunk-TCGXGD6E.js.br +0 -0
- package/dist/chunk-TCGXGD6E.js.gz +0 -0
- package/dist/chunk-ZA5JONCW.mjs.br +0 -0
- package/dist/chunk-ZA5JONCW.mjs.gz +0 -0
- package/dist/types-DU35aAJK.d.ts.map +0 -1
- package/dist/useViewerBuildingBlocks-C9-prKYB.d.ts.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -203,11 +203,18 @@ interface XmlObject {
|
|
|
203
203
|
[child: string]: XmlObject | XmlObject[] | string | undefined;
|
|
204
204
|
}
|
|
205
205
|
/**
|
|
206
|
-
*
|
|
206
|
+
* Lock attributes from an element's non-visual properties node.
|
|
207
207
|
*
|
|
208
208
|
* When a flag is `true` the corresponding user interaction is disabled
|
|
209
209
|
* in the editor (e.g. `noRotation` prevents free rotation of the shape).
|
|
210
210
|
*
|
|
211
|
+
* One bag covers every family, but the families are NOT interchangeable in
|
|
212
|
+
* the file: `a:spLocks` (`CT_ShapeLocking`), `a:picLocks`, `a:cxnSpLocks`,
|
|
213
|
+
* `a:grpSpLocks` (`CT_GroupLocking`) and `a:graphicFrameLocks`
|
|
214
|
+
* (`CT_GraphicalObjectFrameLocking`) each declare their own attribute subset.
|
|
215
|
+
* `runtime/shape-lock-containers` holds that table and is what decides which
|
|
216
|
+
* of these fields may be written for a given element.
|
|
217
|
+
*
|
|
211
218
|
* @example
|
|
212
219
|
* ```ts
|
|
213
220
|
* const locks: PptxShapeLocks = { noMove: true, noResize: true };
|
|
@@ -226,6 +233,14 @@ interface PptxShapeLocks {
|
|
|
226
233
|
noAdjustHandles?: boolean;
|
|
227
234
|
noChangeArrowheads?: boolean;
|
|
228
235
|
noChangeShapeType?: boolean;
|
|
236
|
+
/**
|
|
237
|
+
* `a:graphicFrameLocks/@noDrilldown`: forbids selecting the individual
|
|
238
|
+
* parts inside a graphic frame (a chart series, a SmartArt node). Declared
|
|
239
|
+
* ONLY by `CT_GraphicalObjectFrameLocking`, so it is written for tables,
|
|
240
|
+
* charts, SmartArt, OLE objects and graphic-frame media, and never onto
|
|
241
|
+
* `a:spLocks` / `a:picLocks` / `a:cxnSpLocks` / `a:grpSpLocks`.
|
|
242
|
+
*/
|
|
243
|
+
noDrilldown?: boolean;
|
|
229
244
|
/**
|
|
230
245
|
* Text-box flag from `p:cNvSpPr/@txBox`. Not a lock in the strict sense,
|
|
231
246
|
* but it lives on the same non-visual-properties node as `a:spLocks`, so
|
|
@@ -1165,6 +1180,22 @@ interface ShapeStyle {
|
|
|
1165
1180
|
fontRefIdx?: string;
|
|
1166
1181
|
/** Raw XML colour child of `<a:fontRef>`. */
|
|
1167
1182
|
fontRefColorXml?: XmlObject;
|
|
1183
|
+
/**
|
|
1184
|
+
* The fill `<a:fillRef>` resolved to, recorded ONLY when the shape's own
|
|
1185
|
+
* `spPr` authored no fill at all, so the reference is what paints it.
|
|
1186
|
+
*
|
|
1187
|
+
* Its absence therefore means "the fill is the shape's own", and its
|
|
1188
|
+
* presence plus an unchanged flat fill means "still purely inherited": see
|
|
1189
|
+
* `authored-shape-style.ts`, the shape-scope twin of `TextStyle`'s
|
|
1190
|
+
* `inheritedRunStyle`.
|
|
1191
|
+
*/
|
|
1192
|
+
inheritedFillStyle?: ShapeStyle;
|
|
1193
|
+
/**
|
|
1194
|
+
* The outline `<a:lnRef>` resolved to, recorded before `spPr/a:ln` was
|
|
1195
|
+
* layered on top. A property that still equals this baseline was never
|
|
1196
|
+
* authored on the shape and must not be written back as if it were.
|
|
1197
|
+
*/
|
|
1198
|
+
inheritedLineStyle?: ShapeStyle;
|
|
1168
1199
|
}
|
|
1169
1200
|
//#endregion
|
|
1170
1201
|
//#region src/core/types/text.d.ts
|
|
@@ -1205,6 +1236,60 @@ interface ShapeStyle {
|
|
|
1205
1236
|
interface TextStyle {
|
|
1206
1237
|
/** Original `a:rPr` XML retained by projections that share the shape-text model. */
|
|
1207
1238
|
runPropertiesXml?: XmlObject;
|
|
1239
|
+
/**
|
|
1240
|
+
* The properties this run's OWN `a:rPr` authored, and nothing else.
|
|
1241
|
+
*
|
|
1242
|
+
* A run style is assembled as
|
|
1243
|
+
* `{...inheritedRunStyle, ...authoredRunStyle}`, so the flat style is a
|
|
1244
|
+
* fully RESOLVED view: it cannot say whether `fontSize: 60` came from the
|
|
1245
|
+
* run, from the shape's `a:lstStyle`, from the layout placeholder, from the
|
|
1246
|
+
* master `p:txStyles` or from the theme. Omission is meaningful in OOXML
|
|
1247
|
+
* (§21.1.2.3), so a writer that re-emits the resolved view converts every
|
|
1248
|
+
* inherited value into an authored one and the deck stops being
|
|
1249
|
+
* theme-driven after one save.
|
|
1250
|
+
*
|
|
1251
|
+
* This is the run-scope twin of {@link TextSegment.paragraphProperties},
|
|
1252
|
+
* which is parsed strictly from the paragraph's own `a:pPr` for the same
|
|
1253
|
+
* reason. Present only for runs that came from a parsed deck; absent for
|
|
1254
|
+
* SDK-built text, where the flat style IS the only description and must be
|
|
1255
|
+
* written out in full.
|
|
1256
|
+
*/
|
|
1257
|
+
authoredRunStyle?: TextStyle;
|
|
1258
|
+
/**
|
|
1259
|
+
* The resolved inheritance baseline {@link authoredRunStyle} was layered
|
|
1260
|
+
* on top of (shape `a:lstStyle` -> placeholder -> layout -> master
|
|
1261
|
+
* `p:txStyles` -> theme -> `p:defaultTextStyle`).
|
|
1262
|
+
*
|
|
1263
|
+
* Kept alongside the authored half because the two answer different
|
|
1264
|
+
* questions. The authored half says "the source pinned this"; the baseline
|
|
1265
|
+
* says "this value is what inheritance already produces", which is how an
|
|
1266
|
+
* EDIT is told apart from an inherited value: an editor mutates the flat
|
|
1267
|
+
* style without knowing about either field, so a property that now differs
|
|
1268
|
+
* from the baseline was either authored or edited and must be written,
|
|
1269
|
+
* while one that still matches can be left to inherit.
|
|
1270
|
+
*
|
|
1271
|
+
* Holds a reference to the per-paragraph baseline object rather than a
|
|
1272
|
+
* copy, so carrying it costs one pointer per run.
|
|
1273
|
+
*/
|
|
1274
|
+
inheritedRunStyle?: TextStyle;
|
|
1275
|
+
/**
|
|
1276
|
+
* Snapshot of the ELEMENT-scope paragraph geometry (alignment, margins,
|
|
1277
|
+
* indent, line and paragraph spacing, tab stops, rtl, line-break flags) as
|
|
1278
|
+
* the load pipeline resolved it.
|
|
1279
|
+
*
|
|
1280
|
+
* Present only on an `element.textStyle` that came from a parsed deck, and
|
|
1281
|
+
* populated only with the geometry keys. It exists so the save path can
|
|
1282
|
+
* answer one question it otherwise cannot: has the user CHANGED the body's
|
|
1283
|
+
* alignment or indent, or is the value simply what the shape's
|
|
1284
|
+
* `a:lstStyle`, its layout placeholder and the master already produce?
|
|
1285
|
+
* Element-level text panels (`textAdvancedPatch`, `alignPatch` and friends
|
|
1286
|
+
* in `pptx-viewer-shared`) write `element.textStyle` and never touch
|
|
1287
|
+
* `segment.paragraphProperties`, so a diff against this snapshot is the
|
|
1288
|
+
* only way to tell an edit from an inheritance artefact.
|
|
1289
|
+
*
|
|
1290
|
+
* @see element-paragraph-geometry.ts
|
|
1291
|
+
*/
|
|
1292
|
+
resolvedParagraphGeometry?: TextStyle;
|
|
1208
1293
|
fontFamily?: string;
|
|
1209
1294
|
fontSize?: number;
|
|
1210
1295
|
/** When true, renderer should shrink text to fit the shape bounds. */
|
|
@@ -1869,6 +1954,15 @@ interface PptxElementBase {
|
|
|
1869
1954
|
shapeId?: string;
|
|
1870
1955
|
/** Element name from `cNvPr/@name`. Used for morph transition matching via the `!!` naming convention. */
|
|
1871
1956
|
name?: string;
|
|
1957
|
+
/**
|
|
1958
|
+
* `p:nvSpPr/p:nvPr/p:ph/@type` (lower-cased) when the shape is a placeholder:
|
|
1959
|
+
* `title`, `ctrtitle`, `body`, `subtitle`, `ftr`, `dt`, `sldnum`, ...
|
|
1960
|
+
*
|
|
1961
|
+
* Captured on load so consumers can tell a footer placeholder from a text box
|
|
1962
|
+
* without re-walking `rawXml`. Absent on non-placeholder shapes and on
|
|
1963
|
+
* SDK-created elements.
|
|
1964
|
+
*/
|
|
1965
|
+
placeholderType?: string;
|
|
1872
1966
|
x: number;
|
|
1873
1967
|
y: number;
|
|
1874
1968
|
width: number;
|
|
@@ -1929,6 +2023,19 @@ interface PptxTextProperties {
|
|
|
1929
2023
|
}>;
|
|
1930
2024
|
/** 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. */
|
|
1931
2025
|
promptText?: string;
|
|
2026
|
+
/**
|
|
2027
|
+
* The string {@link text} was INHERITED from, when this is a header / footer /
|
|
2028
|
+
* date / slide-number placeholder whose own body the file leaves empty.
|
|
2029
|
+
*
|
|
2030
|
+
* PowerPoint keeps the footer string on the slide master and writes each
|
|
2031
|
+
* slide's copy of the `ftr` placeholder empty, so the empty body means
|
|
2032
|
+
* "render the master's footer here". Rendering needs the resolved string, but
|
|
2033
|
+
* SAVING it into the slide would pin that slide to today's master text and
|
|
2034
|
+
* silently detach it from the Header & Footer dialog. The save writer
|
|
2035
|
+
* therefore leaves the authored empty body alone while `text` still equals
|
|
2036
|
+
* this value, and writes a genuine per-slide override once it does not.
|
|
2037
|
+
*/
|
|
2038
|
+
inheritedPlaceholderText?: string;
|
|
1932
2039
|
/** 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. */
|
|
1933
2040
|
linkedTxbxId?: number;
|
|
1934
2041
|
/** Sequence number within a linked text box chain (0-based). */
|
|
@@ -2339,6 +2446,12 @@ interface PptxChartLineStyle {
|
|
|
2339
2446
|
}
|
|
2340
2447
|
/** Marker symbol types for line/scatter chart data points. */
|
|
2341
2448
|
type PptxChartMarkerSymbol = 'circle' | 'dash' | 'diamond' | 'dot' | 'none' | 'picture' | 'plus' | 'square' | 'star' | 'triangle' | 'x' | 'auto';
|
|
2449
|
+
/**
|
|
2450
|
+
* `ST_ScatterStyle` (ECMA-376 §21.2.3.40): how a scatter chart joins its points.
|
|
2451
|
+
* `line`/`lineMarker` connect them with straight segments, `smooth`/
|
|
2452
|
+
* `smoothMarker` with a bezier, `marker`/`none` not at all.
|
|
2453
|
+
*/
|
|
2454
|
+
type PptxChartScatterStyle = 'none' | 'line' | 'lineMarker' | 'marker' | 'smooth' | 'smoothMarker';
|
|
2342
2455
|
/** Shape properties extracted from c:spPr for chart formatting. */
|
|
2343
2456
|
interface PptxChartShapeProps {
|
|
2344
2457
|
fillColor?: string;
|
|
@@ -2540,6 +2653,42 @@ interface PptxChartTreemapOptions {
|
|
|
2540
2653
|
interface PptxChartSeries {
|
|
2541
2654
|
name: string;
|
|
2542
2655
|
values: number[];
|
|
2656
|
+
/**
|
|
2657
|
+
* Per-series x values from `c:ser/c:xVal` (scatter and bubble series only).
|
|
2658
|
+
*
|
|
2659
|
+
* Every `CT_ScatterSer` / `CT_BubbleSer` carries its OWN `c:xVal`, so two
|
|
2660
|
+
* series in one scatter chart routinely plot against different x ranges (the
|
|
2661
|
+
* normal case for measurement data). Reading the x values off the first
|
|
2662
|
+
* series and reusing them everywhere plotted every series against series 1's
|
|
2663
|
+
* x axis. Absent for category-axis chart kinds, where
|
|
2664
|
+
* {@link PptxChartData.categories} is the x axis.
|
|
2665
|
+
*/
|
|
2666
|
+
xValues?: number[];
|
|
2667
|
+
/**
|
|
2668
|
+
* Per-series bubble sizes from `c:ser/c:bubbleSize` (bubble series only),
|
|
2669
|
+
* aligned index-for-index with {@link values}.
|
|
2670
|
+
*
|
|
2671
|
+
* `CT_BubbleSer` carries x, y AND size, so a one-series bubble chart is fully
|
|
2672
|
+
* specified. Absent when the source omits `c:bubbleSize`.
|
|
2673
|
+
*/
|
|
2674
|
+
bubbleSizes?: number[];
|
|
2675
|
+
/**
|
|
2676
|
+
* Series-level data-label content flags from `c:ser/c:dLbls`.
|
|
2677
|
+
*
|
|
2678
|
+
* PowerPoint writes the flags a user picks in "Format Data Labels" onto the
|
|
2679
|
+
* SERIES, and leaves the chart-type-level `c:dLbls` all-zero, so reading only
|
|
2680
|
+
* the chart-level group reports "show nothing" for a chart that visibly shows
|
|
2681
|
+
* percentages. These override {@link PptxChartStyle.dataLabels}.
|
|
2682
|
+
*/
|
|
2683
|
+
dataLabelOptions?: PptxChartDataLabelOptions;
|
|
2684
|
+
/**
|
|
2685
|
+
* Whether the series line is explicitly suppressed
|
|
2686
|
+
* (`c:ser/c:spPr/a:ln/a:noFill`). Line-drawn kinds (line, scatter, radar)
|
|
2687
|
+
* use this to decide whether to draw a connecting line at all; a marker-only
|
|
2688
|
+
* scatter is authored as `scatterStyle="lineMarker"` PLUS this flag, never by
|
|
2689
|
+
* changing the scatter style.
|
|
2690
|
+
*/
|
|
2691
|
+
lineNoFill?: boolean;
|
|
2543
2692
|
/**
|
|
2544
2693
|
* Blank-value mask aligned index-for-index with {@link values}: `true` marks
|
|
2545
2694
|
* a category whose numeric cache point (`c:numCache/c:pt`) was absent or
|
|
@@ -2883,6 +3032,17 @@ interface PptxChartData {
|
|
|
2883
3032
|
* default), so only horizontal bar charts need to carry the field.
|
|
2884
3033
|
*/
|
|
2885
3034
|
barDirection?: PptxChartBarDirection;
|
|
3035
|
+
/**
|
|
3036
|
+
* Scatter presentation mode (`c:scatterChart/c:scatterStyle/@val`).
|
|
3037
|
+
*
|
|
3038
|
+
* `lineMarker` (PowerPoint's own default for every scatter it writes) and
|
|
3039
|
+
* `smoothMarker` draw a connecting line; `marker` and `none` do not. Whether
|
|
3040
|
+
* the MARKERS appear is decided separately by `c:marker/c:symbol`, and
|
|
3041
|
+
* whether the LINE appears is further gated by
|
|
3042
|
+
* {@link PptxChartSeries.lineNoFill} - PowerPoint expresses "markers only" as
|
|
3043
|
+
* `lineMarker` plus an `a:ln/a:noFill`, not as `marker`.
|
|
3044
|
+
*/
|
|
3045
|
+
scatterStyle?: PptxChartScatterStyle;
|
|
2886
3046
|
/**
|
|
2887
3047
|
* Bar/column gap between category clusters as a percentage of bar width
|
|
2888
3048
|
* (`c:gapWidth/@val`, 0 through 500). Absent uses the renderer default.
|
|
@@ -3036,6 +3196,53 @@ interface PptxChartData {
|
|
|
3036
3196
|
* // => { brightness: 20, contrast: -10, grayscale: true } satisfies PptxImageEffects
|
|
3037
3197
|
* ```
|
|
3038
3198
|
*/
|
|
3199
|
+
/**
|
|
3200
|
+
* One `a14:foregroundMark` / `a14:backgroundMark` polyline hint recorded while
|
|
3201
|
+
* the user painted over the picture in PowerPoint's "Remove Background" mode.
|
|
3202
|
+
* Coordinates are 0..1 fractions of the image.
|
|
3203
|
+
*/
|
|
3204
|
+
interface PptxBackgroundRemovalMark {
|
|
3205
|
+
x1: number;
|
|
3206
|
+
y1: number;
|
|
3207
|
+
x2: number;
|
|
3208
|
+
y2: number;
|
|
3209
|
+
}
|
|
3210
|
+
/**
|
|
3211
|
+
* PowerPoint "Remove Background" state (`a14:backgroundRemoval`).
|
|
3212
|
+
*
|
|
3213
|
+
* The four edges are the RETAINED rectangle as 0..1 fractions of the image
|
|
3214
|
+
* (OOXML stores them as per-100000 relative units), and the mark lists are the
|
|
3215
|
+
* segmentation hints the user painted.
|
|
3216
|
+
*
|
|
3217
|
+
* **This is edit-time metadata, not a render instruction.** PowerPoint bakes the
|
|
3218
|
+
* removal into the bitmap referenced by the main `a:blip/@r:embed` and keeps the
|
|
3219
|
+
* pristine original in `a14:imgLayer/@r:embed`. Verified against PowerPoint COM:
|
|
3220
|
+
* a slide exported with and without this element is byte-identical. A renderer
|
|
3221
|
+
* that clips to the retained rectangle would clip an image whose background has
|
|
3222
|
+
* already been removed.
|
|
3223
|
+
*
|
|
3224
|
+
* @example
|
|
3225
|
+
* ```ts
|
|
3226
|
+
* const removal: PptxBackgroundRemoval = { top: 0.12, bottom: 0.88, left: 0.07, right: 0.93 };
|
|
3227
|
+
* // => retains the middle of the image; the marks list stays empty
|
|
3228
|
+
* ```
|
|
3229
|
+
*/
|
|
3230
|
+
interface PptxBackgroundRemoval {
|
|
3231
|
+
/** Top edge of the retained rectangle (0..1 fraction of the image height). */
|
|
3232
|
+
top: number;
|
|
3233
|
+
/** Bottom edge of the retained rectangle (0..1 fraction of the image height). */
|
|
3234
|
+
bottom: number;
|
|
3235
|
+
/** Left edge of the retained rectangle (0..1 fraction of the image width). */
|
|
3236
|
+
left: number;
|
|
3237
|
+
/** Right edge of the retained rectangle (0..1 fraction of the image width). */
|
|
3238
|
+
right: number;
|
|
3239
|
+
/** Strokes marking regions the user forced to be foreground. */
|
|
3240
|
+
foregroundMarks?: PptxBackgroundRemovalMark[];
|
|
3241
|
+
/** Strokes marking regions the user forced to be background. */
|
|
3242
|
+
backgroundMarks?: PptxBackgroundRemovalMark[];
|
|
3243
|
+
/** Original effect XML, retained for lossless re-emission. */
|
|
3244
|
+
rawXml?: XmlObject;
|
|
3245
|
+
}
|
|
3039
3246
|
interface PptxImageEffects {
|
|
3040
3247
|
/** Brightness adjustment (-100 to 100). */
|
|
3041
3248
|
brightness?: number;
|
|
@@ -3059,8 +3266,38 @@ interface PptxImageEffects {
|
|
|
3059
3266
|
};
|
|
3060
3267
|
/** Artistic effect name (blur, pencilGrayscale, paintStrokes, etc.). */
|
|
3061
3268
|
artisticEffect?: string;
|
|
3062
|
-
/** Artistic effect radius/amount. */
|
|
3269
|
+
/** Artistic effect radius/amount, normalised to 0..100. */
|
|
3063
3270
|
artisticRadius?: number;
|
|
3271
|
+
/**
|
|
3272
|
+
* Every numeric attribute of the source `a14:artistic*` element, raw and
|
|
3273
|
+
* un-normalised (`trans`, `pencilSize`, `crackSpacing`, …). The attribute set
|
|
3274
|
+
* differs per effect, so this is the lossless companion to the single
|
|
3275
|
+
* {@link PptxImageEffects.artisticRadius} number.
|
|
3276
|
+
*/
|
|
3277
|
+
artisticParams?: Record<string, number>;
|
|
3278
|
+
/**
|
|
3279
|
+
* Name of the artistic effect ALREADY baked into the image data, which a
|
|
3280
|
+
* renderer must not apply a second time. Set from the `a14` blip extension,
|
|
3281
|
+
* which PowerPoint writes alongside a pre-rendered bitmap (see
|
|
3282
|
+
* {@link PptxBackgroundRemoval}), and normally equal to
|
|
3283
|
+
* {@link PptxImageEffects.artisticEffect}.
|
|
3284
|
+
*
|
|
3285
|
+
* It records the NAME rather than a boolean so that picking a different
|
|
3286
|
+
* effect in this library's inspector (which patches `artisticEffect` alone)
|
|
3287
|
+
* still renders: the two names then differ.
|
|
3288
|
+
*/
|
|
3289
|
+
artisticPrerenderedEffect?: string;
|
|
3290
|
+
/**
|
|
3291
|
+
* PowerPoint "Remove Background" state (`a14:backgroundRemoval`). Edit-time
|
|
3292
|
+
* metadata: the removal is already baked into the image data.
|
|
3293
|
+
*/
|
|
3294
|
+
backgroundRemoval?: PptxBackgroundRemoval;
|
|
3295
|
+
/**
|
|
3296
|
+
* `a14:imgLayer/@r:embed` — relationship id of the PRISTINE original image
|
|
3297
|
+
* the baked effects were derived from (PowerPoint stores it as an HD Photo
|
|
3298
|
+
* `.wdp` part, which browsers cannot decode).
|
|
3299
|
+
*/
|
|
3300
|
+
originalImageRelId?: string;
|
|
3064
3301
|
/** Alpha modulation fixed: non-negative percentage (100 means unchanged opacity). */
|
|
3065
3302
|
alphaModFix?: number;
|
|
3066
3303
|
/** Original alpha modulation fixed node, including foreign attributes. */
|
|
@@ -4972,7 +5209,7 @@ interface UnknownPptxElement extends PptxElementBase {
|
|
|
4972
5209
|
/**
|
|
4973
5210
|
* A single element on a PPTX slide.
|
|
4974
5211
|
*
|
|
4975
|
-
* This is a **discriminated union
|
|
5212
|
+
* This is a **discriminated union**: narrow on `element.type` to access
|
|
4976
5213
|
* variant-specific properties like `imageData` (image/picture), `pathData`
|
|
4977
5214
|
* (shape), or `textSegments` (text/shape).
|
|
4978
5215
|
*/
|
|
@@ -5705,6 +5942,54 @@ interface PptxEmbeddedFontList {
|
|
|
5705
5942
|
rawXml?: XmlObject;
|
|
5706
5943
|
}
|
|
5707
5944
|
//#endregion
|
|
5945
|
+
//#region src/core/types/comment-mentions.d.ts
|
|
5946
|
+
/**
|
|
5947
|
+
* A single `@`-mention inside a modern comment body.
|
|
5948
|
+
*
|
|
5949
|
+
* Offsets index into the comment's FLATTENED plain text: every `a:t` value
|
|
5950
|
+
* below `p188:txBody` concatenated, with paragraphs joined by `\n`. That is the
|
|
5951
|
+
* same string `PptxComment.text` carries, so an edit to `text` invalidates
|
|
5952
|
+
* every offset after the edit point and the serializer re-bases them.
|
|
5953
|
+
*
|
|
5954
|
+
* The markup Office uses for a mention is `CT_Mention` (documented for the
|
|
5955
|
+
* SpreadsheetML `2018/threadedcomments` part): `mentionpersonId`, `mentionId`,
|
|
5956
|
+
* `startIndex` and `length`. The PowerPoint `2018/8/main` schema does not
|
|
5957
|
+
* publish a mention element at all, so `rawXml` is retained and re-emitted
|
|
5958
|
+
* attribute-for-attribute: a producer that spells the attributes differently
|
|
5959
|
+
* still round-trips.
|
|
5960
|
+
*
|
|
5961
|
+
* @example
|
|
5962
|
+
* ```ts
|
|
5963
|
+
* const mention: PptxCommentMention = {
|
|
5964
|
+
* personId: "{2CB2E9D0-D392-EB21-5D46-FBA34C1295E6}",
|
|
5965
|
+
* authorName: "Bob Example",
|
|
5966
|
+
* startIndex: 3,
|
|
5967
|
+
* length: 11,
|
|
5968
|
+
* };
|
|
5969
|
+
* // => "Hi Bob Example can you check this".slice(3, 14) === "Bob Example"
|
|
5970
|
+
* ```
|
|
5971
|
+
*/
|
|
5972
|
+
interface PptxCommentMention {
|
|
5973
|
+
/** `mentionId`: GUID identifying this mention instance. */
|
|
5974
|
+
id?: string;
|
|
5975
|
+
/** `mentionpersonId`: the `p188:author` id of the mentioned person. */
|
|
5976
|
+
personId: string;
|
|
5977
|
+
/** Display name resolved from the author list at parse time, when known. */
|
|
5978
|
+
authorName?: string;
|
|
5979
|
+
/** Character offset of the mentioned span in the flattened plain text. */
|
|
5980
|
+
startIndex: number;
|
|
5981
|
+
/** Character length of the mentioned span. */
|
|
5982
|
+
length: number;
|
|
5983
|
+
/**
|
|
5984
|
+
* `uri` of the `p188:ext` this mention list was read from. Undefined means
|
|
5985
|
+
* the list is a direct child of `p188:cm`, which is where it is written for
|
|
5986
|
+
* newly authored mentions.
|
|
5987
|
+
*/
|
|
5988
|
+
containerUri?: string;
|
|
5989
|
+
/** Original `p188:mention` node, retained for unknown-attribute preservation. */
|
|
5990
|
+
rawXml?: XmlObject;
|
|
5991
|
+
}
|
|
5992
|
+
//#endregion
|
|
5708
5993
|
//#region src/core/types/metadata.d.ts
|
|
5709
5994
|
/**
|
|
5710
5995
|
* A slide comment — may be a legacy positional comment or a modern
|
|
@@ -5751,6 +6036,8 @@ interface PptxComment {
|
|
|
5751
6036
|
title?: string;
|
|
5752
6037
|
/** Modern threaded comment support (p15:threadingInfo). */
|
|
5753
6038
|
threadId?: string;
|
|
6039
|
+
/** `@`-mentions, indexed into `text` (see {@link PptxCommentMention}). */
|
|
6040
|
+
mentions?: PptxCommentMention[];
|
|
5754
6041
|
/** Replies to this comment (for modern threaded comments). */
|
|
5755
6042
|
replies?: PptxComment[];
|
|
5756
6043
|
/** ID of the element this comment is associated with (if any). */
|
|
@@ -6270,7 +6557,7 @@ interface PptxTheme {
|
|
|
6270
6557
|
* // => "morph" — one of 40+ transition effects
|
|
6271
6558
|
* ```
|
|
6272
6559
|
*/
|
|
6273
|
-
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';
|
|
6560
|
+
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';
|
|
6274
6561
|
/** Split orientation from OOXML `@_orient`. */
|
|
6275
6562
|
type PptxSplitOrientation = 'horz' | 'vert';
|
|
6276
6563
|
/** Schema-defined `ST_TransitionSpeed` values. */
|
|
@@ -6565,6 +6852,18 @@ interface PptxSlideBackgroundPattern {
|
|
|
6565
6852
|
interface PptxSlide {
|
|
6566
6853
|
id: string;
|
|
6567
6854
|
rId: string;
|
|
6855
|
+
/**
|
|
6856
|
+
* `p:sldIdLst/p:sldId/@id` (ST_SlideId, 256..2147483647): the numeric key
|
|
6857
|
+
* that sections (`p14:sldIdLst/p14:sldId/@id`) and section/summary zooms
|
|
6858
|
+
* name slides by.
|
|
6859
|
+
*
|
|
6860
|
+
* It lives in `presentation.xml`, NOT in the slide part, so it cannot be
|
|
6861
|
+
* recovered from `rawXml`. Without it on the model, code that writes a
|
|
6862
|
+
* section's membership has nothing correct to write and falls back to the
|
|
6863
|
+
* slide NUMBER, which is 1-based and therefore never matches a real deck's
|
|
6864
|
+
* ids: the section reloads with no slides in it.
|
|
6865
|
+
*/
|
|
6866
|
+
slideId?: string;
|
|
6568
6867
|
sourceSlideId?: string;
|
|
6569
6868
|
/** Optional author-supplied slide name (set via `SlideBuilder.setName`). */
|
|
6570
6869
|
name?: string;
|
|
@@ -6767,6 +7066,26 @@ interface PptxPresentationProperties {
|
|
|
6767
7066
|
/** Kiosk auto-restart interval in milliseconds (from `p:kiosk/@restart`). Only meaningful when showType is "kiosk". */
|
|
6768
7067
|
kioskRestartTime?: number;
|
|
6769
7068
|
}
|
|
7069
|
+
/**
|
|
7070
|
+
* Slide dimensions from `p:sldSz` (CT_SlideSize, ECMA-376 §19.2.1.39).
|
|
7071
|
+
*
|
|
7072
|
+
* @example
|
|
7073
|
+
* ```ts
|
|
7074
|
+
* const size: PptxSlideSize = { widthEmu: 9144000, heightEmu: 6858000, type: 'screen4x3' };
|
|
7075
|
+
* // => satisfies PptxSlideSize
|
|
7076
|
+
* ```
|
|
7077
|
+
*/
|
|
7078
|
+
interface PptxSlideSize {
|
|
7079
|
+
/** `@cx` in EMU. Omitted or non-positive values leave the loaded width alone. */
|
|
7080
|
+
widthEmu?: number;
|
|
7081
|
+
/** `@cy` in EMU. Omitted or non-positive values leave the loaded height alone. */
|
|
7082
|
+
heightEmu?: number;
|
|
7083
|
+
/**
|
|
7084
|
+
* `@type` (ST_SlideSizeType). The schema default is `custom`, which is
|
|
7085
|
+
* why PowerPoint omits the attribute for a non-preset size.
|
|
7086
|
+
*/
|
|
7087
|
+
type?: string;
|
|
7088
|
+
}
|
|
6770
7089
|
/**
|
|
6771
7090
|
* A named custom slide show (`p:custShowLst / p:custShow`).
|
|
6772
7091
|
*
|
|
@@ -7781,6 +8100,19 @@ interface PptxHandlerSaveOptions {
|
|
|
7781
8100
|
customerData?: PptxCustomerData[];
|
|
7782
8101
|
/** Photo album metadata to save back to `p:photoAlbum`. */
|
|
7783
8102
|
photoAlbum?: PptxPhotoAlbum;
|
|
8103
|
+
/**
|
|
8104
|
+
* Slide dimensions to write back to `p:sldSz`.
|
|
8105
|
+
*
|
|
8106
|
+
* Omitting the option preserves the load-time dimensions verbatim, which
|
|
8107
|
+
* is why an edit made through a viewer's Slide Size control has to reach
|
|
8108
|
+
* the save call: nothing else in the pipeline can observe it.
|
|
8109
|
+
*
|
|
8110
|
+
* PowerPoint derives `Presentation.PageSetup.SlideSize` from `@cx`/`@cy`
|
|
8111
|
+
* alone (verified by COM: an A4-typed `p:sldSz` carrying 4:3 dimensions
|
|
8112
|
+
* still reports `ppSlideSizeCustom`), so `type` is written for fidelity
|
|
8113
|
+
* but the dimensions are what actually decide the reported preset.
|
|
8114
|
+
*/
|
|
8115
|
+
slideSize?: PptxSlideSize;
|
|
7784
8116
|
/** East Asian line-break settings to save back to `p:kinsoku`. */
|
|
7785
8117
|
kinsoku?: PptxKinsoku | null;
|
|
7786
8118
|
/** Write-protection verifier. Set to `null` to remove, `undefined` to preserve existing. */
|
|
@@ -8372,24 +8704,38 @@ declare class PptxHandlerCore {
|
|
|
8372
8704
|
name?: string;
|
|
8373
8705
|
}>>;
|
|
8374
8706
|
/**
|
|
8375
|
-
* Export selected slides
|
|
8707
|
+
* Export selected slides to a vector or raster format, keyed by slide index.
|
|
8376
8708
|
*
|
|
8377
|
-
*
|
|
8378
|
-
* standalone
|
|
8709
|
+
* **This does not produce PPTX files.** The previous version of this comment
|
|
8710
|
+
* said each entry was "a standalone PPTX with only that slide", named the
|
|
8711
|
+
* option `slideIndexes` (the real field is `slideIndices`), and wrote the
|
|
8712
|
+
* bytes to `slide_N.pptx`. None of that was ever true: the runtime has
|
|
8713
|
+
* always taken a `format` of `svg` / `png` / `pdf`. Per-slide PPTX
|
|
8714
|
+
* extraction is a different operation and is not implemented here.
|
|
8715
|
+
*
|
|
8716
|
+
* Only `svg` works without a host-supplied backend, and it works fully:
|
|
8717
|
+
* the headless {@link SvgExporter} renders it with no DOM. `png` and `pdf`
|
|
8718
|
+
* THROW, because this package carries no rasteriser; use a viewer binding's
|
|
8719
|
+
* browser export pipeline, or override `exportSlides` on the runtime with
|
|
8720
|
+
* your own backend.
|
|
8379
8721
|
*
|
|
8380
8722
|
* @param slides - Full slide array.
|
|
8381
|
-
* @param options - Export options (
|
|
8382
|
-
* @returns A `Map<slideIndex, Uint8Array>` of exported files.
|
|
8723
|
+
* @param options - Export options (`format`, `slideIndices`, `width`, ...).
|
|
8724
|
+
* @returns A `Map<slideIndex, Uint8Array>` of exported files. Hidden slides
|
|
8725
|
+
* are omitted unless `options.includeHidden` is set, so the map can be
|
|
8726
|
+
* smaller than `options.slideIndices`.
|
|
8727
|
+
* @throws {Error} when `options.format` is `png` or `pdf`.
|
|
8383
8728
|
*
|
|
8384
8729
|
* @example
|
|
8385
8730
|
* ```ts
|
|
8386
8731
|
* const exports = await handler.exportSlides(data.slides, {
|
|
8387
|
-
*
|
|
8732
|
+
* format: 'svg',
|
|
8733
|
+
* slideIndices: [0, 2],
|
|
8388
8734
|
* });
|
|
8389
8735
|
* for (const [idx, bytes] of exports) {
|
|
8390
|
-
* await fs.writeFile(`slide_${idx}.
|
|
8736
|
+
* await fs.writeFile(`slide_${idx}.svg`, Buffer.from(bytes));
|
|
8391
8737
|
* }
|
|
8392
|
-
* // => Map<number, Uint8Array
|
|
8738
|
+
* // => Map<number, Uint8Array>: one SVG document per exported slide
|
|
8393
8739
|
* ```
|
|
8394
8740
|
*/
|
|
8395
8741
|
exportSlides(slides: PptxSlide[], options: PptxExportOptions): Promise<Map<number, Uint8Array>>;
|
|
@@ -8967,6 +9313,68 @@ interface FieldSubstitutionContext {
|
|
|
8967
9313
|
//#endregion
|
|
8968
9314
|
//#region src/render/text-case-transform.d.ts
|
|
8969
9315
|
type ChangeCaseMode = 'sentence' | 'lower' | 'upper' | 'capitalize' | 'toggle';
|
|
9316
|
+
//#endregion
|
|
9317
|
+
//#region src/render/shape-adjustment-model.d.ts
|
|
9318
|
+
/**
|
|
9319
|
+
* `shape-adjustment-model`: the vocabulary the adjust-handle modules share.
|
|
9320
|
+
*
|
|
9321
|
+
* The `a:ahLst` work is split three ways for the repo's file-size budget:
|
|
9322
|
+
* `shape-adjustment-probe` measures the geometry, `shape-adjustment-handles`
|
|
9323
|
+
* derives the handles from those measurements, and `shape-adjustment-solver`
|
|
9324
|
+
* turns a pointer position back into guide values. All three need these types
|
|
9325
|
+
* and the one rule that operates purely on them, so they live here and the
|
|
9326
|
+
* dependency graph stays a DAG rather than a cycle.
|
|
9327
|
+
*
|
|
9328
|
+
* @module render/shape-adjustment-model
|
|
9329
|
+
*/
|
|
9330
|
+
/**
|
|
9331
|
+
* How a pointer position becomes a guide value, captured once when the gesture
|
|
9332
|
+
* starts so `pointermove` stays pure arithmetic.
|
|
9333
|
+
*/
|
|
9334
|
+
interface ShapeAdjustmentSolver {
|
|
9335
|
+
/** `linear`: the handle slides. `angular`: it swings about {@link centerX}. */
|
|
9336
|
+
kind: 'linear' | 'angular';
|
|
9337
|
+
/** Handle position in element-local px at {@link startValue}. */
|
|
9338
|
+
anchorX: number;
|
|
9339
|
+
anchorY: number;
|
|
9340
|
+
/** Element-local px the handle travels per ONE unit of guide value. */
|
|
9341
|
+
dirX: number;
|
|
9342
|
+
dirY: number;
|
|
9343
|
+
/** Pivot for an angular handle (the shape centre). */
|
|
9344
|
+
centerX: number;
|
|
9345
|
+
centerY: number;
|
|
9346
|
+
/** The guide value the anchor was measured at. */
|
|
9347
|
+
startValue: number;
|
|
9348
|
+
/** Guide-space bounds, taken from the preset's own `pin` clamp. */
|
|
9349
|
+
min: number;
|
|
9350
|
+
max: number;
|
|
9351
|
+
}
|
|
9352
|
+
/** One guide a handle drives. */
|
|
9353
|
+
interface AdjustmentAxisSolver {
|
|
9354
|
+
key: string;
|
|
9355
|
+
solver: ShapeAdjustmentSolver;
|
|
9356
|
+
}
|
|
9357
|
+
/** Descriptor for one draggable adjustment handle (the amber diamond). */
|
|
9358
|
+
interface ShapeAdjustmentHandleDescriptor {
|
|
9359
|
+
/** The `a:avLst` guide name this handle writes (`adj`, `adj1`, ...). */
|
|
9360
|
+
key: string;
|
|
9361
|
+
/** Handle x offset in element-local px (origin = element top-left). */
|
|
9362
|
+
left: number;
|
|
9363
|
+
/** Handle y offset in element-local px. */
|
|
9364
|
+
top: number;
|
|
9365
|
+
/**
|
|
9366
|
+
* Current adjustment value in GUIDE units, not a 0-1 fraction. Most presets
|
|
9367
|
+
* range 0..50000 or 0..100000 and the angular ones run to 21,600,000.
|
|
9368
|
+
*/
|
|
9369
|
+
value: number;
|
|
9370
|
+
cursor: string;
|
|
9371
|
+
/**
|
|
9372
|
+
* How this handle's drag resolves, measured off the preset geometry: one
|
|
9373
|
+
* entry per `a:avLst` guide it drives (callouts drive two). Absent only for
|
|
9374
|
+
* a caller that built a descriptor by hand.
|
|
9375
|
+
*/
|
|
9376
|
+
solvers?: AdjustmentAxisSolver[];
|
|
9377
|
+
}
|
|
8970
9378
|
/**
|
|
8971
9379
|
* A font supplied by the host application. The package never ships fonts:
|
|
8972
9380
|
* applications provide a licensed URL, data URL, or blob URL for their users.
|
|
@@ -8979,6 +9387,80 @@ interface ViewerFontSource {
|
|
|
8979
9387
|
style?: 'normal' | 'italic';
|
|
8980
9388
|
}
|
|
8981
9389
|
//#endregion
|
|
9390
|
+
//#region src/render/presentation-file-kinds.d.ts
|
|
9391
|
+
/**
|
|
9392
|
+
* presentation-file-kinds: the one place that answers "can the viewer open
|
|
9393
|
+
* this file?" and "what should the saved copy be called?".
|
|
9394
|
+
*
|
|
9395
|
+
* ## Why this is a shared decision and not five allow-lists
|
|
9396
|
+
*
|
|
9397
|
+
* The loader reads more formats than any single UI advertises. Legacy binary
|
|
9398
|
+
* `.ppt` (PowerPoint 97-2003) is the sharp example: `PptxHandler.load()` has
|
|
9399
|
+
* detected the OLE compound-file container and converted the binary deck
|
|
9400
|
+
* through the regular pptx pipeline for some time, but the product kept saying
|
|
9401
|
+
* it was unsupported, and a picker that filters the extension out makes a
|
|
9402
|
+
* working loader unreachable in practice. Whenever the loader learns a format,
|
|
9403
|
+
* exactly one list has to change.
|
|
9404
|
+
*
|
|
9405
|
+
* ## Read many, write one
|
|
9406
|
+
*
|
|
9407
|
+
* Input is a superset of output. We READ `.pptx`, `.ppsx`, `.pptm`, `.potx`,
|
|
9408
|
+
* legacy binary `.ppt` and portable `pptx-viewer-json`; we WRITE only the
|
|
9409
|
+
* OpenXML family. That asymmetry is deliberate (PowerPoint itself does the
|
|
9410
|
+
* same: open a 97-2003 deck and Save As offers `.pptx`), and it is why
|
|
9411
|
+
* {@link savedPresentationFileName} always REPLACES the source extension
|
|
9412
|
+
* rather than keeping it. A deck opened as `report.ppt` and saved as
|
|
9413
|
+
* `report.ppt` would be a file whose bytes and whose name disagree, which is
|
|
9414
|
+
* the kind of thing PowerPoint refuses to open.
|
|
9415
|
+
*
|
|
9416
|
+
* This module deliberately imports nothing, so any layer (render, export, a
|
|
9417
|
+
* binding, a host app) can depend on it without risking an import cycle.
|
|
9418
|
+
*
|
|
9419
|
+
* @module render/presentation-file-kinds
|
|
9420
|
+
*/
|
|
9421
|
+
/**
|
|
9422
|
+
* Extensions the built-in file picker offers, in the order it offers them.
|
|
9423
|
+
*
|
|
9424
|
+
* `.ppt` is in the list because the loader genuinely handles it, not as a
|
|
9425
|
+
* courtesy: see `packages/core/src/core/ppt/` and the `ppt-import` integration
|
|
9426
|
+
* suite, which asserts a `.ppt` loads to the same model as the `.pptx` it was
|
|
9427
|
+
* exported from.
|
|
9428
|
+
*/
|
|
9429
|
+
declare const PRESENTATION_OPEN_EXTENSIONS: readonly ['.pptx', '.ppsx', '.pptm', '.potx', '.ppt', '.json'];
|
|
9430
|
+
/** Comma-separated `accept` attribute for a presentation file input. */
|
|
9431
|
+
declare const PPTX_OPEN_ACCEPT: string;
|
|
9432
|
+
/**
|
|
9433
|
+
* True when a picked / dropped file's name looks like something the loader can
|
|
9434
|
+
* open. Use this instead of a hand-rolled `endsWith` chain: a drop handler that
|
|
9435
|
+
* disagrees with the picker's `accept` list is a format that is supported by
|
|
9436
|
+
* mouse but not by drag, which is how `.ppt` stayed invisible.
|
|
9437
|
+
*
|
|
9438
|
+
* Extension-only, by design. The real answer comes from the container sniff in
|
|
9439
|
+
* `PptxHandler.load()`; this is only the cheap pre-filter a drop target needs
|
|
9440
|
+
* before it hands bytes to the loader.
|
|
9441
|
+
*/
|
|
9442
|
+
declare function isSupportedPresentationFile(name: string | null | undefined): boolean;
|
|
9443
|
+
/** True for the binary PowerPoint 97-2003 family, which we read but never write. */
|
|
9444
|
+
declare function isLegacyBinaryPresentation(name: string | null | undefined): boolean;
|
|
9445
|
+
/** The formats the save path can produce. Binary `.ppt` is deliberately absent. */
|
|
9446
|
+
type SavedPresentationFormat = 'pptx' | 'ppsx' | 'pptm';
|
|
9447
|
+
/**
|
|
9448
|
+
* The stem of a presentation file name: directories and any loadable extension
|
|
9449
|
+
* removed. `C:\decks\report.ppt` becomes `report`; a name with no recognised
|
|
9450
|
+
* extension is kept whole, so `Untitled Presentation` survives intact rather
|
|
9451
|
+
* than losing everything after its last dot.
|
|
9452
|
+
*/
|
|
9453
|
+
declare function presentationBaseName(sourceName: string | null | undefined, fallback?: string): string;
|
|
9454
|
+
/**
|
|
9455
|
+
* The name a saved copy should be offered under: the source stem plus the
|
|
9456
|
+
* extension of the format actually being written.
|
|
9457
|
+
*
|
|
9458
|
+
* This is what turns `report.ppt` into `report.pptx` on Save As. Output is
|
|
9459
|
+
* always an OpenXML package, so keeping the source extension would mislabel
|
|
9460
|
+
* the bytes.
|
|
9461
|
+
*/
|
|
9462
|
+
declare function savedPresentationFileName(sourceName: string | null | undefined, format?: SavedPresentationFormat): string;
|
|
9463
|
+
//#endregion
|
|
8982
9464
|
//#region src/render/insert-chart.d.ts
|
|
8983
9465
|
/**
|
|
8984
9466
|
* Dropdown ids for the insert-chart menu. Distinct from `PptxChartType`
|
|
@@ -9117,13 +9599,25 @@ interface ViewerProofingOptions {
|
|
|
9117
9599
|
checkSpellingAsYouType: boolean;
|
|
9118
9600
|
hideSpellingErrors: boolean;
|
|
9119
9601
|
}
|
|
9602
|
+
/**
|
|
9603
|
+
* File > Options > Save.
|
|
9604
|
+
*
|
|
9605
|
+
* Font embedding deliberately has NO entry here. It is owned by the File >
|
|
9606
|
+
* Fonts panel, whose toggle is the one the save path reads (see
|
|
9607
|
+
* `render/font-embedding`: `describeFontEmbedding` decides the toggle's start
|
|
9608
|
+
* position and whether it can do anything at all, `embeddedFontSaveOptions`
|
|
9609
|
+
* turns it into the `PptxHandler.save()` slice). This group used to carry a
|
|
9610
|
+
* second `embedFonts` boolean, plus an `embedAllFontCharacters` companion, and
|
|
9611
|
+
* neither was read by anything: the pane moved a switch that changed no saved
|
|
9612
|
+
* byte, while the panel next door moved the real one. Two switches for one
|
|
9613
|
+
* setting, one of them lying, is worse than one switch in a less
|
|
9614
|
+
* PowerPoint-shaped place.
|
|
9615
|
+
*/
|
|
9120
9616
|
interface ViewerSaveOptions {
|
|
9121
9617
|
autoSave: boolean;
|
|
9122
9618
|
autoRecoverIntervalMinutes: number;
|
|
9123
9619
|
keepLastAutoRecoveredVersion: boolean;
|
|
9124
9620
|
defaultExportFormat: DefaultExportFormat;
|
|
9125
|
-
embedFonts: boolean;
|
|
9126
|
-
embedAllFontCharacters: boolean;
|
|
9127
9621
|
cacheRetentionDays: number;
|
|
9128
9622
|
clearCacheOnClose: boolean;
|
|
9129
9623
|
}
|
|
@@ -9551,6 +10045,28 @@ interface PowerPointViewerProps {
|
|
|
9551
10045
|
onOpenFile?: () => void;
|
|
9552
10046
|
/** Whether editing actions are enabled */
|
|
9553
10047
|
canEdit?: boolean;
|
|
10048
|
+
/**
|
|
10049
|
+
* Recovery autosave: after an edit the deck is re-serialised (always as a
|
|
10050
|
+
* plain, unencrypted package, because recovery has no password) and stashed
|
|
10051
|
+
* in the shared IndexedDB store keyed by {@link filePath}. It is a crash-
|
|
10052
|
+
* safety net and never replaces the user's real Save: the document stays
|
|
10053
|
+
* dirty. On load, a newer snapshot is offered back through a recovery prompt.
|
|
10054
|
+
*
|
|
10055
|
+
* **The prop is a policy ceiling; the title-bar AutoSave toggle is the user's
|
|
10056
|
+
* preference inside it.** `false` turns autosave off and makes the toggle
|
|
10057
|
+
* inert (a user cannot switch on what the application forbade). `true` or
|
|
10058
|
+
* omitted permits it, and the toggle decides, defaulting to on. Identical in
|
|
10059
|
+
* all five bindings; see `resolveAutosaveActivation` in `pptx-viewer-shared`.
|
|
10060
|
+
*
|
|
10061
|
+
* @default true
|
|
10062
|
+
*/
|
|
10063
|
+
autosave?: boolean;
|
|
10064
|
+
/**
|
|
10065
|
+
* Recovery cadence in milliseconds. An explicit value is a host policy and is
|
|
10066
|
+
* honoured as given; omit it to follow the user's File > Options > Save >
|
|
10067
|
+
* "Save AutoRecover information every N minutes" (two minutes by default).
|
|
10068
|
+
*/
|
|
10069
|
+
autosaveIntervalMs?: number;
|
|
9554
10070
|
/** Optional class name */
|
|
9555
10071
|
className?: string;
|
|
9556
10072
|
/**
|
|
@@ -9898,6 +10414,8 @@ interface ToolbarProps {
|
|
|
9898
10414
|
onToggleVersionHistory?: () => void;
|
|
9899
10415
|
onOpenPasswordProtection?: () => void;
|
|
9900
10416
|
onOpenDocumentProperties?: () => void;
|
|
10417
|
+
/** Design > Slide Size: reveal the inspector card that owns the slide size. */
|
|
10418
|
+
onOpenSlideSize?: () => void;
|
|
9901
10419
|
onOpenFontEmbedding?: () => void;
|
|
9902
10420
|
onOpenDigitalSignatures?: () => void;
|
|
9903
10421
|
onEnterMasterView: () => void;
|
|
@@ -10023,7 +10541,7 @@ interface SlideCanvasProps {
|
|
|
10023
10541
|
/** Called when the user presses mouse down on empty canvas space. */
|
|
10024
10542
|
onCanvasMouseDown?: (e: React$1__default.MouseEvent) => void;
|
|
10025
10543
|
onResizePointerDown: (elementId: string, e: React$1__default.MouseEvent, handle: string) => void;
|
|
10026
|
-
onAdjustmentPointerDown: (elementId: string, e: React$1__default.MouseEvent) => void;
|
|
10544
|
+
onAdjustmentPointerDown: (elementId: string, e: React$1__default.MouseEvent, descriptor: ShapeAdjustmentHandleDescriptor) => void;
|
|
10027
10545
|
/** Commit a new rotation (degrees) when the on-canvas rotate handle is dragged. */
|
|
10028
10546
|
onRotate?: (elementId: string, rotationDeg: number) => void;
|
|
10029
10547
|
onInlineEditChange: (text: string) => void;
|
|
@@ -10223,5 +10741,5 @@ declare function SlideTemplatePreview({ templateId, scheme }: SlideTemplatePrevi
|
|
|
10223
10741
|
*/
|
|
10224
10742
|
declare function renderToCanvas(element: HTMLElement, options?: Partial<Options>): Promise<HTMLCanvasElement>;
|
|
10225
10743
|
|
|
10226
|
-
export { AVATAR_COLOR_SWATCHES, DEFAULT_VIEWER_PROFILE, LOCALE_CATALOG, PowerPointViewer, SLIDE_TEMPLATES, SlideCanvas, SlideTemplateGalleryDialog, SlideTemplatePreview, THEME_CATALOG, Toolbar, VIEWER_PREFS_STORAGE_KEY, ViewerThemeProvider, buildSlideTemplateContent, buildSlideTemplateSlide, clearAllLocalViewerData, clearStoredViewerPrefs, defaultCssVars, defaultRadius, defaultThemeColors, getAnimationInitialStyle, getLocalStorageUsageSummary, readStoredViewerPrefs, renderToCanvas, resolveProfileInitial, resolveThemeCatalogEntry, saveViewerProfile, themeToCssVars, useViewerBuildingBlocks, useViewerTheme, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius, writeStoredViewerPrefs };
|
|
10227
|
-
export type { AccountAuthConfig, LocalStorageUsageSummary, LocaleCatalogEntry, PowerPointViewerAPI, PowerPointViewerHandle, PowerPointViewerProps, PptxAiBridge, PptxAiConfig, PptxAiConnection, PptxAiContextStrategy, PptxAiToolName, PptxAiWritePolicy, SlideCanvasProps, SlideTemplateGalleryDialogProps, SlideTemplateId, SlideTemplatePreviewProps, SlideTemplateSpec, StoredViewerPrefs, ThemeCatalogEntry, ToolbarActionId, ToolbarButtonId, ToolbarProps, ToolbarTabId, UseViewerBuildingBlocksInput, ViewerBuildingBlocksResult, ViewerMode, ViewerProfile, ViewerTheme, ViewerThemeColors };
|
|
10744
|
+
export { AVATAR_COLOR_SWATCHES, DEFAULT_VIEWER_PROFILE, LOCALE_CATALOG, PPTX_OPEN_ACCEPT, PRESENTATION_OPEN_EXTENSIONS, PowerPointViewer, SLIDE_TEMPLATES, SlideCanvas, SlideTemplateGalleryDialog, SlideTemplatePreview, THEME_CATALOG, Toolbar, VIEWER_PREFS_STORAGE_KEY, ViewerThemeProvider, buildSlideTemplateContent, buildSlideTemplateSlide, clearAllLocalViewerData, clearStoredViewerPrefs, defaultCssVars, defaultRadius, defaultThemeColors, getAnimationInitialStyle, getLocalStorageUsageSummary, isLegacyBinaryPresentation, isSupportedPresentationFile, presentationBaseName, readStoredViewerPrefs, renderToCanvas, resolveProfileInitial, resolveThemeCatalogEntry, saveViewerProfile, savedPresentationFileName, themeToCssVars, useViewerBuildingBlocks, useViewerTheme, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius, writeStoredViewerPrefs };
|
|
10745
|
+
export type { AccountAuthConfig, LocalStorageUsageSummary, LocaleCatalogEntry, PowerPointViewerAPI, PowerPointViewerHandle, PowerPointViewerProps, PptxAiBridge, PptxAiConfig, PptxAiConnection, PptxAiContextStrategy, PptxAiToolName, PptxAiWritePolicy, SavedPresentationFormat, SlideCanvasProps, SlideTemplateGalleryDialogProps, SlideTemplateId, SlideTemplatePreviewProps, SlideTemplateSpec, StoredViewerPrefs, ThemeCatalogEntry, ToolbarActionId, ToolbarButtonId, ToolbarProps, ToolbarTabId, UseViewerBuildingBlocksInput, ViewerBuildingBlocksResult, ViewerMode, ViewerProfile, ViewerTheme, ViewerThemeColors };
|