ooxml-core 0.22.1 → 0.23.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/dist/pptx/automation/index.cjs +8 -0
- package/dist/pptx/automation/index.d.ts +4 -3
- package/dist/pptx/automation/index.d.ts.map +1 -1
- package/dist/pptx/automation/index.mjs +8 -0
- package/dist/pptx/chunks/{index-ucqKcqvI.d.ts → index-CEyiW7oo.d.ts} +3 -2
- package/dist/pptx/chunks/index-CEyiW7oo.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-D2y7ehZ5.d.ts → index-CvtFF9SI.d.ts} +4 -3
- package/dist/pptx/chunks/index-CvtFF9SI.d.ts.map +1 -0
- package/dist/pptx/chunks/smart-art-CO2jmJFf.d.ts +2908 -0
- package/dist/pptx/chunks/smart-art-CO2jmJFf.d.ts.map +1 -0
- package/dist/pptx/chunks/{text-operations-CR3pUJi-.d.ts → text-operations-DM2_DC-I.d.ts} +263 -3162
- package/dist/pptx/chunks/text-operations-DM2_DC-I.d.ts.map +1 -0
- package/dist/pptx/cli/index.cjs +8 -0
- package/dist/pptx/cli/index.d.ts +1 -1
- package/dist/pptx/cli/index.mjs +8 -0
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/index.cjs +9 -0
- package/dist/pptx/index.d.ts +4 -3
- package/dist/pptx/index.mjs +9 -0
- package/dist/pptx/smartart-layouts/index.cjs +2120 -0
- package/dist/pptx/smartart-layouts/index.d.ts +35 -0
- package/dist/pptx/smartart-layouts/index.d.ts.map +1 -0
- package/dist/pptx/smartart-layouts/index.mjs +2113 -0
- package/package.json +7 -1
- package/dist/pptx/chunks/index-D2y7ehZ5.d.ts.map +0 -1
- package/dist/pptx/chunks/index-ucqKcqvI.d.ts.map +0 -1
- package/dist/pptx/chunks/text-operations-CR3pUJi-.d.ts.map +0 -1
|
@@ -0,0 +1,2908 @@
|
|
|
1
|
+
import { t as PptxThemeColorRef } from "./color-ref-DT599vEx.js";
|
|
2
|
+
//#region pptx/core/types/common.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Shared value types used across the entire PPTX editor type system.
|
|
5
|
+
*
|
|
6
|
+
* Contains primitive enums, small interfaces, and the XML object alias
|
|
7
|
+
* that almost every other type file imports.
|
|
8
|
+
*
|
|
9
|
+
* @module pptx-types/common
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Underline style tokens from OOXML `a:rPr/@u`.
|
|
13
|
+
*
|
|
14
|
+
* These map directly to the OpenXML `ST_TextUnderlineType` simple type.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const style: UnderlineStyle = "wavy";
|
|
19
|
+
* // => "wavy" — one of: sng | dbl | heavy | dotted | dash | wavy | none | ...
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
type UnderlineStyle = 'sng' | 'dbl' | 'heavy' | 'dotted' | 'dottedHeavy' | 'dash' | 'dashHeavy' | 'dashLong' | 'dashLongHeavy' | 'dotDash' | 'dotDashHeavy' | 'dotDotDash' | 'dotDotDashHeavy' | 'wavy' | 'wavyHeavy' | 'wavyDbl' | 'words' | 'none';
|
|
23
|
+
/**
|
|
24
|
+
* Connector connection point reference — links a connector endpoint to a
|
|
25
|
+
* specific shape on the slide.
|
|
26
|
+
*
|
|
27
|
+
* When both `shapeId` and `connectionSiteIndex` are set, the connector
|
|
28
|
+
* end snaps to that shapes’s connection site and “follows” the shape when
|
|
29
|
+
* it is moved.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const start: ConnectorConnectionPoint = {
|
|
34
|
+
* shapeId: "shape_1",
|
|
35
|
+
* connectionSiteIndex: 2,
|
|
36
|
+
* };
|
|
37
|
+
* // => { shapeId: "shape_1", connectionSiteIndex: 2 } satisfies ConnectorConnectionPoint
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
interface ConnectorConnectionPoint {
|
|
41
|
+
/** ID of the shape this connector endpoint is attached to. */
|
|
42
|
+
shapeId?: string;
|
|
43
|
+
/** Connection site index on the target shape (0-based). */
|
|
44
|
+
connectionSiteIndex?: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Arrow head types for connector start/end.
|
|
48
|
+
*
|
|
49
|
+
* Maps to `a:headEnd/@type` and `a:tailEnd/@type` in OOXML.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const arrow: ConnectorArrowType = "triangle";
|
|
54
|
+
* // => "triangle" — one of: none | triangle | stealth | diamond | oval | arrow
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
type ConnectorArrowType = 'none' | 'triangle' | 'stealth' | 'diamond' | 'oval' | 'arrow';
|
|
58
|
+
/**
|
|
59
|
+
* Stroke dash pattern types for lines and shape outlines.
|
|
60
|
+
*
|
|
61
|
+
* Maps to `a:ln/a:prstDash/@val` in OOXML. Use `"custom"` for
|
|
62
|
+
* user-defined dash/space arrays.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* const dash: StrokeDashType = "dashDot";
|
|
67
|
+
* // => "dashDot" — one of: solid | dot | dash | lgDash | dashDot | custom | ...
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
type StrokeDashType = 'solid' | 'dot' | 'dash' | 'lgDash' | 'dashDot' | 'lgDashDot' | 'lgDashDotDot' | 'sysDot' | 'sysDash' | 'sysDashDot' | 'sysDashDotDot' | 'custom';
|
|
71
|
+
/**
|
|
72
|
+
* Shadow effect properties for a single shadow layer.
|
|
73
|
+
*
|
|
74
|
+
* Represents parsed values from an `<a:outerShdw>` node. Multiple instances
|
|
75
|
+
* can be stored in {@link ShapeStyle.shadows} for compound shadow effects.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* const shadow: ShadowEffect = {
|
|
80
|
+
* color: "#000000",
|
|
81
|
+
* opacity: 0.4,
|
|
82
|
+
* blur: 6,
|
|
83
|
+
* angle: 315,
|
|
84
|
+
* distance: 4,
|
|
85
|
+
* };
|
|
86
|
+
* // => { color: "#000000", opacity: 0.4, blur: 6, angle: 315, distance: 4 } satisfies ShadowEffect
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
interface ShadowEffect {
|
|
90
|
+
/** Shadow color as hex string. */
|
|
91
|
+
color: string;
|
|
92
|
+
/** Shadow opacity (0-1). */
|
|
93
|
+
opacity: number;
|
|
94
|
+
/** Blur radius in pixels. */
|
|
95
|
+
blur: number;
|
|
96
|
+
/** Shadow angle in degrees (0-360). */
|
|
97
|
+
angle: number;
|
|
98
|
+
/** Shadow distance in pixels. */
|
|
99
|
+
distance: number;
|
|
100
|
+
/** Whether shadow rotates with shape. */
|
|
101
|
+
rotateWithShape?: boolean;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Strongly-typed parsed XML node from fast-xml-parser.
|
|
105
|
+
*
|
|
106
|
+
* The parser is configured with `attributeNamePrefix: '@_'`,
|
|
107
|
+
* `parseAttributeValue: false`, and `parseTagValue: false`, so attribute and
|
|
108
|
+
* text values are always strings at runtime. This type encodes that:
|
|
109
|
+
*
|
|
110
|
+
* - **Attributes** — keys matching `` `@_${string}` `` return
|
|
111
|
+
* `string | undefined` directly.
|
|
112
|
+
* - **Text content** — `#text` returns `string | undefined`.
|
|
113
|
+
* - **Child elements** — any other string key returns
|
|
114
|
+
* `XmlObject | XmlObject[] | string | undefined`. The union reflects that
|
|
115
|
+
* fast-xml-parser may emit an object (single child), an array (repeated
|
|
116
|
+
* children), or a bare string (text-only element collapsed by the parser).
|
|
117
|
+
*
|
|
118
|
+
* For traversal, prefer the helpers in {@link ./../utils/xml-access} —
|
|
119
|
+
* `xmlChild` / `xmlChildren` / `xmlAttr` / `xmlText` / `xmlPath` — which
|
|
120
|
+
* narrow the union and normalize the single-vs-array duality. Direct
|
|
121
|
+
* indexing works for attributes (typed as string) but chained child access
|
|
122
|
+
* (`obj['p:spPr']?.['a:xfrm']`) requires the helpers or a narrowing cast
|
|
123
|
+
* because TypeScript cannot index into the `XmlObject[] | string` part of
|
|
124
|
+
* the union.
|
|
125
|
+
*/
|
|
126
|
+
interface XmlObject {
|
|
127
|
+
/** Attributes (`@_`-prefixed keys) are always strings at runtime. */
|
|
128
|
+
[attr: `@_${string}`]: string | undefined;
|
|
129
|
+
/** Element text content surfaces under `#text` when present. */
|
|
130
|
+
'#text'?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Child elements keyed by their (namespaced) tag name. fast-xml-parser
|
|
133
|
+
* emits a single object for unique elements, an array for repeated ones,
|
|
134
|
+
* and a bare string for elements collapsed to their text content. Use
|
|
135
|
+
* the helpers in `utils/xml-access` to narrow this union.
|
|
136
|
+
*/
|
|
137
|
+
[child: string]: XmlObject | XmlObject[] | string | undefined;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Lock attributes from an element's non-visual properties node.
|
|
141
|
+
*
|
|
142
|
+
* When a flag is `true` the corresponding user interaction is disabled
|
|
143
|
+
* in the editor (e.g. `noRotation` prevents free rotation of the shape).
|
|
144
|
+
*
|
|
145
|
+
* One bag covers every family, but the families are NOT interchangeable in
|
|
146
|
+
* the file: `a:spLocks` (`CT_ShapeLocking`), `a:picLocks`, `a:cxnSpLocks`,
|
|
147
|
+
* `a:grpSpLocks` (`CT_GroupLocking`) and `a:graphicFrameLocks`
|
|
148
|
+
* (`CT_GraphicalObjectFrameLocking`) each declare their own attribute subset.
|
|
149
|
+
* `runtime/shape-lock-containers` holds that table and is what decides which
|
|
150
|
+
* of these fields may be written for a given element.
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* ```ts
|
|
154
|
+
* const locks: PptxShapeLocks = { noMove: true, noResize: true };
|
|
155
|
+
* // => { noMove: true, noResize: true } satisfies PptxShapeLocks
|
|
156
|
+
* ```
|
|
157
|
+
*/
|
|
158
|
+
interface PptxShapeLocks {
|
|
159
|
+
noGrouping?: boolean;
|
|
160
|
+
noRotation?: boolean;
|
|
161
|
+
noMove?: boolean;
|
|
162
|
+
noResize?: boolean;
|
|
163
|
+
noTextEdit?: boolean;
|
|
164
|
+
noSelect?: boolean;
|
|
165
|
+
noChangeAspect?: boolean;
|
|
166
|
+
noEditPoints?: boolean;
|
|
167
|
+
noAdjustHandles?: boolean;
|
|
168
|
+
noChangeArrowheads?: boolean;
|
|
169
|
+
noChangeShapeType?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* `a:graphicFrameLocks/@noDrilldown`: forbids selecting the individual
|
|
172
|
+
* parts inside a graphic frame (a chart series, a SmartArt node). Declared
|
|
173
|
+
* ONLY by `CT_GraphicalObjectFrameLocking`, so it is written for tables,
|
|
174
|
+
* charts, SmartArt, OLE objects and graphic-frame media, and never onto
|
|
175
|
+
* `a:spLocks` / `a:picLocks` / `a:cxnSpLocks` / `a:grpSpLocks`.
|
|
176
|
+
*/
|
|
177
|
+
noDrilldown?: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* `a:picLocks/@noCrop`: forbids cropping the picture. Declared ONLY by
|
|
180
|
+
* `CT_PictureLocking`, so it is written for pictures (and media authored as
|
|
181
|
+
* a `p:pic`) and never onto the other lock elements.
|
|
182
|
+
*/
|
|
183
|
+
noCrop?: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Text-box flag from `p:cNvSpPr/@txBox`. Not a lock in the strict sense,
|
|
186
|
+
* but it lives on the same non-visual-properties node as `a:spLocks`, so
|
|
187
|
+
* it is captured here to round-trip through the model. When `true` the
|
|
188
|
+
* shape is a plain text box (no fill/line by default).
|
|
189
|
+
*/
|
|
190
|
+
txBox?: boolean;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* A drawing guide parsed from OOXML extension lists.
|
|
194
|
+
*
|
|
195
|
+
* Slide-level and presentation-level guides are shown as thin coloured
|
|
196
|
+
* lines that help users align elements.
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* ```ts
|
|
200
|
+
* const guide: PptxDrawingGuide = {
|
|
201
|
+
* id: "g1",
|
|
202
|
+
* orientation: "horz",
|
|
203
|
+
* positionEmu: 457200,
|
|
204
|
+
* color: "#FF0000",
|
|
205
|
+
* };
|
|
206
|
+
* // => { id: "g1", orientation: "horz", positionEmu: 457200, color: "#FF0000" } satisfies PptxDrawingGuide
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
209
|
+
interface PptxDrawingGuide {
|
|
210
|
+
/** Unique identifier (from `@_id` attribute or generated). */
|
|
211
|
+
id: string;
|
|
212
|
+
/** Orientation: horizontal or vertical. */
|
|
213
|
+
orientation: 'horz' | 'vert';
|
|
214
|
+
/** Position in EMU (converted from pos attribute). */
|
|
215
|
+
positionEmu: number;
|
|
216
|
+
/** Optional guide colour as hex string (e.g. "#FF0000"). */
|
|
217
|
+
color?: string;
|
|
218
|
+
}
|
|
219
|
+
//#endregion
|
|
220
|
+
//#region pptx/core/types/three-d.d.ts
|
|
221
|
+
/**
|
|
222
|
+
* 3-D effect properties, text warp (WordArt) presets, and scene/shape bevel
|
|
223
|
+
* definitions parsed from OOXML `a:sp3d`, `a:scene3d`, and `a:bodyPr/a:prstTxWarp`.
|
|
224
|
+
*
|
|
225
|
+
* @module pptx-types/three-d
|
|
226
|
+
*/
|
|
227
|
+
/**
|
|
228
|
+
* Bevel preset type tokens from OOXML `a:bevelT/@prst` / `a:bevelB/@prst`.
|
|
229
|
+
*
|
|
230
|
+
* @example
|
|
231
|
+
* ```ts
|
|
232
|
+
* const bevel: BevelPresetType = "circle";
|
|
233
|
+
* // => "circle" — one of: "circle" | "relaxedInset" | "cross" | "coolSlant" | "angle" | …
|
|
234
|
+
* ```
|
|
235
|
+
*/
|
|
236
|
+
type BevelPresetType = 'circle' | 'relaxedInset' | 'cross' | 'coolSlant' | 'angle' | 'softRound' | 'convex' | 'slope' | 'divot' | 'riblet' | 'hardEdge' | 'artDeco' | 'none';
|
|
237
|
+
/**
|
|
238
|
+
* Material preset type tokens from OOXML `a:sp3d/@prstMaterial`.
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* ```ts
|
|
242
|
+
* const mat: MaterialPresetType = "plastic";
|
|
243
|
+
* // => "plastic" — one of: "matte" | "warmMatte" | "plastic" | "metal" | "dkEdge" | …
|
|
244
|
+
* ```
|
|
245
|
+
*/
|
|
246
|
+
type MaterialPresetType = 'matte' | 'warmMatte' | 'plastic' | 'metal' | 'dkEdge' | 'softEdge' | 'flat' | 'softmetal' | 'clear' | 'powder' | 'translucentPowder' | 'legacyMatte' | 'legacyPlastic' | 'legacyMetal' | 'legacyWireframe';
|
|
247
|
+
/**
|
|
248
|
+
* 3D text body extrusion/bevel from `a:bodyPr/a:sp3d`.
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* ```ts
|
|
252
|
+
* const text3d: Text3DStyle = {
|
|
253
|
+
* extrusionHeight: 57150,
|
|
254
|
+
* presetMaterial: "plastic",
|
|
255
|
+
* bevelTopType: "circle",
|
|
256
|
+
* bevelTopWidth: 25400,
|
|
257
|
+
* bevelTopHeight: 25400,
|
|
258
|
+
* };
|
|
259
|
+
* // => satisfies Text3DStyle
|
|
260
|
+
* ```
|
|
261
|
+
*/
|
|
262
|
+
interface Text3DStyle {
|
|
263
|
+
/** Extrusion height (depth) in EMU. */
|
|
264
|
+
extrusionHeight?: number;
|
|
265
|
+
/** Extrusion colour as hex string. */
|
|
266
|
+
extrusionColor?: string;
|
|
267
|
+
/** Preset material, e.g. "matte", "plastic", "metal". */
|
|
268
|
+
presetMaterial?: MaterialPresetType;
|
|
269
|
+
/** Top bevel preset type. */
|
|
270
|
+
bevelTopType?: BevelPresetType;
|
|
271
|
+
/** Top bevel width in EMU. */
|
|
272
|
+
bevelTopWidth?: number;
|
|
273
|
+
/** Top bevel height in EMU. */
|
|
274
|
+
bevelTopHeight?: number;
|
|
275
|
+
/** Bottom bevel preset type. */
|
|
276
|
+
bevelBottomType?: BevelPresetType;
|
|
277
|
+
/** Bottom bevel width in EMU. */
|
|
278
|
+
bevelBottomWidth?: number;
|
|
279
|
+
/** Bottom bevel height in EMU. */
|
|
280
|
+
bevelBottomHeight?: number;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* 3D scene/camera properties from `a:scene3d`.
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* ```ts
|
|
287
|
+
* const scene: Pptx3DScene = {
|
|
288
|
+
* cameraPreset: "perspectiveFront",
|
|
289
|
+
* lightRigType: "threePt",
|
|
290
|
+
* lightRigDirection: "t",
|
|
291
|
+
* };
|
|
292
|
+
* // => satisfies Pptx3DScene
|
|
293
|
+
* ```
|
|
294
|
+
*/
|
|
295
|
+
interface Pptx3DScene {
|
|
296
|
+
/** Camera preset type, e.g. "orthographicFront", "perspectiveFront". */
|
|
297
|
+
cameraPreset?: string;
|
|
298
|
+
/** Camera field of view in 1/60000 degrees (`a:camera/@fov`). */
|
|
299
|
+
cameraFieldOfView?: number;
|
|
300
|
+
/** Camera zoom as an OOXML percentage fraction (`a:camera/@zoom`, 1 = 100%). */
|
|
301
|
+
cameraZoom?: number;
|
|
302
|
+
/** Camera rotation around X axis in 1/60000 degrees. */
|
|
303
|
+
cameraRotX?: number;
|
|
304
|
+
/** Camera rotation around Y axis in 1/60000 degrees. */
|
|
305
|
+
cameraRotY?: number;
|
|
306
|
+
/** Camera rotation around Z axis in 1/60000 degrees. */
|
|
307
|
+
cameraRotZ?: number;
|
|
308
|
+
/** Light rig type, e.g. "threePt", "balanced", "harsh". */
|
|
309
|
+
lightRigType?: string;
|
|
310
|
+
/** Light rig direction, e.g. "t", "b", "l", "r", "tl". */
|
|
311
|
+
lightRigDirection?: string;
|
|
312
|
+
/** Light-rig rotation latitude in 1/60000 degrees. */
|
|
313
|
+
lightRigRotX?: number;
|
|
314
|
+
/** Light-rig rotation longitude in 1/60000 degrees. */
|
|
315
|
+
lightRigRotY?: number;
|
|
316
|
+
/** Light-rig rotation revolution in 1/60000 degrees. */
|
|
317
|
+
lightRigRotZ?: number;
|
|
318
|
+
/** Whether a 3D backdrop plane is present (`a:backdrop`). */
|
|
319
|
+
hasBackdrop?: boolean;
|
|
320
|
+
/** Backdrop plane anchor X in EMU. */
|
|
321
|
+
backdropAnchorX?: number;
|
|
322
|
+
/** Backdrop plane anchor Y in EMU. */
|
|
323
|
+
backdropAnchorY?: number;
|
|
324
|
+
/** Backdrop plane anchor Z in EMU. */
|
|
325
|
+
backdropAnchorZ?: number;
|
|
326
|
+
/** Backdrop normal vector X component. */
|
|
327
|
+
backdropNormalX?: number;
|
|
328
|
+
/** Backdrop normal vector Y component. */
|
|
329
|
+
backdropNormalY?: number;
|
|
330
|
+
/** Backdrop normal vector Z component. */
|
|
331
|
+
backdropNormalZ?: number;
|
|
332
|
+
/** Backdrop up vector X component. */
|
|
333
|
+
backdropUpX?: number;
|
|
334
|
+
/** Backdrop up vector Y component. */
|
|
335
|
+
backdropUpY?: number;
|
|
336
|
+
/** Backdrop up vector Z component. */
|
|
337
|
+
backdropUpZ?: number;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* 3D shape extrusion/bevel from `a:sp3d`.
|
|
341
|
+
*
|
|
342
|
+
* @example
|
|
343
|
+
* ```ts
|
|
344
|
+
* const shape3d: Pptx3DShape = {
|
|
345
|
+
* extrusionHeight: 76200,
|
|
346
|
+
* extrusionColor: "#4F81BD",
|
|
347
|
+
* presetMaterial: "metal",
|
|
348
|
+
* bevelTopType: "circle",
|
|
349
|
+
* bevelTopWidth: 12700,
|
|
350
|
+
* bevelTopHeight: 12700,
|
|
351
|
+
* };
|
|
352
|
+
* // => satisfies Pptx3DShape
|
|
353
|
+
* ```
|
|
354
|
+
*/
|
|
355
|
+
interface Pptx3DShape {
|
|
356
|
+
/**
|
|
357
|
+
* Position of the shape along the Z axis, in EMU (`a:sp3d/@z`, default 0).
|
|
358
|
+
* Independent of {@link extrusionHeight}: it moves the whole shape forward
|
|
359
|
+
* or back in 3D space rather than adding depth to it, most commonly used to
|
|
360
|
+
* stack several shapes at different depths under one `a:scene3d` camera.
|
|
361
|
+
*/
|
|
362
|
+
positionZ?: number;
|
|
363
|
+
/** Extrusion height in EMU. */
|
|
364
|
+
extrusionHeight?: number;
|
|
365
|
+
/** Extrusion colour. */
|
|
366
|
+
extrusionColor?: string;
|
|
367
|
+
/** Contour width in EMU. */
|
|
368
|
+
contourWidth?: number;
|
|
369
|
+
/** Contour colour. */
|
|
370
|
+
contourColor?: string;
|
|
371
|
+
/** Preset material, e.g. "matte", "warmMatte", "metal". */
|
|
372
|
+
presetMaterial?: string;
|
|
373
|
+
/** Top bevel type, e.g. "circle", "relaxedInset". */
|
|
374
|
+
bevelTopType?: string;
|
|
375
|
+
/** Top bevel width in EMU. */
|
|
376
|
+
bevelTopWidth?: number;
|
|
377
|
+
/** Top bevel height in EMU. */
|
|
378
|
+
bevelTopHeight?: number;
|
|
379
|
+
/** Bottom bevel type, e.g. "circle", "relaxedInset". */
|
|
380
|
+
bevelBottomType?: string;
|
|
381
|
+
/** Bottom bevel width in EMU. */
|
|
382
|
+
bevelBottomWidth?: number;
|
|
383
|
+
/** Bottom bevel height in EMU. */
|
|
384
|
+
bevelBottomHeight?: number;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Known OOXML preset text warp types (WordArt transforms).
|
|
388
|
+
*
|
|
389
|
+
* Falls back to `string` for unknown presets not yet catalogued.
|
|
390
|
+
*
|
|
391
|
+
* @example
|
|
392
|
+
* ```ts
|
|
393
|
+
* const warp: PptxTextWarpPreset = "textArchUp";
|
|
394
|
+
* // => "textArchUp" — one of: "textNoShape" | "textPlain" | "textStop" | "textArchUp" | …
|
|
395
|
+
* ```
|
|
396
|
+
*/
|
|
397
|
+
type PptxTextWarpPreset = 'textNoShape' | 'textPlain' | 'textStop' | 'textTriangle' | 'textTriangleInverted' | 'textChevron' | 'textChevronInverted' | 'textRingInside' | 'textRingOutside' | 'textArchUp' | 'textArchDown' | 'textCircle' | 'textButton' | 'textArchUpPour' | 'textArchDownPour' | 'textCirclePour' | 'textButtonPour' | 'textCurveUp' | 'textCurveDown' | 'textCanUp' | 'textCanDown' | 'textWave1' | 'textWave2' | 'textWave4' | 'textDoubleWave1' | 'textInflate' | 'textDeflate' | 'textInflateBottom' | 'textDeflateBottom' | 'textInflateTop' | 'textDeflateTop' | 'textFadeRight' | 'textFadeLeft' | 'textFadeUp' | 'textFadeDown' | 'textSlantUp' | 'textSlantDown' | 'textCascadeUp' | 'textCascadeDown' | 'textDeflateInflate' | 'textDeflateInflateDeflate' | string;
|
|
398
|
+
//#endregion
|
|
399
|
+
//#region pptx/core/types/effect-dag.d.ts
|
|
400
|
+
type EffectDagBlendMode = 'darken' | 'lighten' | 'mult' | 'over' | 'screen';
|
|
401
|
+
type EffectDagContainerType = 'sib' | 'tree';
|
|
402
|
+
type EffectDagNode = EffectDagContainer | EffectDagBlend | EffectDagXfrm | EffectDagRelOff | EffectDagBlur | EffectDagAlphaOutset | EffectDagPresetShadow | EffectDagRawLeaf;
|
|
403
|
+
interface EffectDagContainer {
|
|
404
|
+
kind: 'cont';
|
|
405
|
+
type: EffectDagContainerType;
|
|
406
|
+
name?: string;
|
|
407
|
+
children: EffectDagNode[];
|
|
408
|
+
}
|
|
409
|
+
interface EffectDagBlend {
|
|
410
|
+
kind: 'blend';
|
|
411
|
+
mode: EffectDagBlendMode;
|
|
412
|
+
container: EffectDagContainer;
|
|
413
|
+
}
|
|
414
|
+
interface EffectDagXfrm {
|
|
415
|
+
kind: 'xfrmEffect';
|
|
416
|
+
sx?: number;
|
|
417
|
+
sy?: number;
|
|
418
|
+
kx?: number;
|
|
419
|
+
ky?: number;
|
|
420
|
+
tx?: number;
|
|
421
|
+
ty?: number;
|
|
422
|
+
}
|
|
423
|
+
interface EffectDagRelOff {
|
|
424
|
+
kind: 'relOff';
|
|
425
|
+
tx?: number;
|
|
426
|
+
ty?: number;
|
|
427
|
+
}
|
|
428
|
+
/** Typed CT_BlurEffect with its original payload retained for lossless edits. */
|
|
429
|
+
interface EffectDagBlur {
|
|
430
|
+
kind: 'blur';
|
|
431
|
+
radiusEmu?: number;
|
|
432
|
+
grow?: boolean;
|
|
433
|
+
xml: XmlObject;
|
|
434
|
+
}
|
|
435
|
+
/** Typed CT_AlphaOutsetEffect with original XML retained for lossless edits. */
|
|
436
|
+
interface EffectDagAlphaOutset {
|
|
437
|
+
kind: 'alphaOutset';
|
|
438
|
+
radiusEmu?: number;
|
|
439
|
+
xml: XmlObject;
|
|
440
|
+
}
|
|
441
|
+
/** Typed CT_PresetShadowEffect with colour and extension XML retained verbatim. */
|
|
442
|
+
interface EffectDagPresetShadow {
|
|
443
|
+
kind: 'prstShdw';
|
|
444
|
+
preset?: `shdw${number}`;
|
|
445
|
+
distanceEmu?: number;
|
|
446
|
+
direction?: number;
|
|
447
|
+
xml: XmlObject;
|
|
448
|
+
}
|
|
449
|
+
interface EffectDagRawLeaf {
|
|
450
|
+
kind: 'raw';
|
|
451
|
+
tag: string;
|
|
452
|
+
xml: Record<string, unknown>;
|
|
453
|
+
}
|
|
454
|
+
//#endregion
|
|
455
|
+
//#region pptx/core/types/text.d.ts
|
|
456
|
+
/**
|
|
457
|
+
* Rich text style properties for a text run or paragraph.
|
|
458
|
+
*
|
|
459
|
+
* Combines character-level formatting (font, bold, colour …),
|
|
460
|
+
* paragraph-level controls (alignment, spacing, indentation), and
|
|
461
|
+
* body-level properties (autofit, insets, text direction). All
|
|
462
|
+
* fields are optional — unset properties inherit from layout/master
|
|
463
|
+
* placeholders or theme defaults.
|
|
464
|
+
*
|
|
465
|
+
* @remarks
|
|
466
|
+
* Font sizes are stored in **points**. Spatial measurements (insets,
|
|
467
|
+
* margins) are in **pixels** (pre-converted from EMU during parsing).
|
|
468
|
+
*
|
|
469
|
+
* @example
|
|
470
|
+
* ```ts
|
|
471
|
+
* const heading: TextStyle = {
|
|
472
|
+
* fontFamily: "Montserrat",
|
|
473
|
+
* fontSize: 36,
|
|
474
|
+
* bold: true,
|
|
475
|
+
* color: "#1A1A2E",
|
|
476
|
+
* align: "center",
|
|
477
|
+
* lineSpacing: 1.15,
|
|
478
|
+
* };
|
|
479
|
+
*
|
|
480
|
+
* const body: TextStyle = {
|
|
481
|
+
* fontFamily: "Open Sans",
|
|
482
|
+
* fontSize: 14,
|
|
483
|
+
* color: "#444444",
|
|
484
|
+
* align: "left",
|
|
485
|
+
* paragraphSpacingAfter: 8,
|
|
486
|
+
* };
|
|
487
|
+
* // => both satisfy the TextStyle interface
|
|
488
|
+
* ```
|
|
489
|
+
*/
|
|
490
|
+
/** 2D linear transform matrix `[a, b, c, d]` for inherited group orientation. */
|
|
491
|
+
type TextOrientationMatrix = [number, number, number, number];
|
|
492
|
+
interface TextStyle {
|
|
493
|
+
/**
|
|
494
|
+
* Combined rotation/flip matrix inherited from ancestor groups.
|
|
495
|
+
* Used only to keep descendant text readable after nested group mirrors.
|
|
496
|
+
*/
|
|
497
|
+
ancestorGroupTransform?: TextOrientationMatrix;
|
|
498
|
+
/** Original `a:rPr` XML retained by projections that share the shape-text model. */
|
|
499
|
+
runPropertiesXml?: XmlObject;
|
|
500
|
+
/**
|
|
501
|
+
* The properties this run's OWN `a:rPr` authored, and nothing else.
|
|
502
|
+
*
|
|
503
|
+
* A run style is assembled as
|
|
504
|
+
* `{...inheritedRunStyle, ...authoredRunStyle}`, so the flat style is a
|
|
505
|
+
* fully RESOLVED view: it cannot say whether `fontSize: 60` came from the
|
|
506
|
+
* run, from the shape's `a:lstStyle`, from the layout placeholder, from the
|
|
507
|
+
* master `p:txStyles` or from the theme. Omission is meaningful in OOXML
|
|
508
|
+
* (§21.1.2.3), so a writer that re-emits the resolved view converts every
|
|
509
|
+
* inherited value into an authored one and the deck stops being
|
|
510
|
+
* theme-driven after one save.
|
|
511
|
+
*
|
|
512
|
+
* This is the run-scope twin of {@link TextSegment.paragraphProperties},
|
|
513
|
+
* which is parsed strictly from the paragraph's own `a:pPr` for the same
|
|
514
|
+
* reason. Present only for runs that came from a parsed deck; absent for
|
|
515
|
+
* SDK-built text, where the flat style IS the only description and must be
|
|
516
|
+
* written out in full.
|
|
517
|
+
*/
|
|
518
|
+
authoredRunStyle?: TextStyle;
|
|
519
|
+
/**
|
|
520
|
+
* The resolved inheritance baseline {@link authoredRunStyle} was layered
|
|
521
|
+
* on top of (shape `a:lstStyle` -> placeholder -> layout -> master
|
|
522
|
+
* `p:txStyles` -> theme -> `p:defaultTextStyle`).
|
|
523
|
+
*
|
|
524
|
+
* Kept alongside the authored half because the two answer different
|
|
525
|
+
* questions. The authored half says "the source pinned this"; the baseline
|
|
526
|
+
* says "this value is what inheritance already produces", which is how an
|
|
527
|
+
* EDIT is told apart from an inherited value: an editor mutates the flat
|
|
528
|
+
* style without knowing about either field, so a property that now differs
|
|
529
|
+
* from the baseline was either authored or edited and must be written,
|
|
530
|
+
* while one that still matches can be left to inherit.
|
|
531
|
+
*
|
|
532
|
+
* Holds a reference to the per-paragraph baseline object rather than a
|
|
533
|
+
* copy, so carrying it costs one pointer per run.
|
|
534
|
+
*/
|
|
535
|
+
inheritedRunStyle?: TextStyle;
|
|
536
|
+
/**
|
|
537
|
+
* Snapshot of the ELEMENT-scope paragraph geometry (alignment, margins,
|
|
538
|
+
* indent, line and paragraph spacing, tab stops, rtl, line-break flags) as
|
|
539
|
+
* the load pipeline resolved it.
|
|
540
|
+
*
|
|
541
|
+
* Present only on an `element.textStyle` that came from a parsed deck, and
|
|
542
|
+
* populated only with the geometry keys. It exists so the save path can
|
|
543
|
+
* answer one question it otherwise cannot: has the user CHANGED the body's
|
|
544
|
+
* alignment or indent, or is the value simply what the shape's
|
|
545
|
+
* `a:lstStyle`, its layout placeholder and the master already produce?
|
|
546
|
+
* Element-level text panels (`textAdvancedPatch`, `alignPatch` and friends
|
|
547
|
+
* in `pptx-viewer-shared`) write `element.textStyle` and never touch
|
|
548
|
+
* `segment.paragraphProperties`, so a diff against this snapshot is the
|
|
549
|
+
* only way to tell an edit from an inheritance artefact.
|
|
550
|
+
*
|
|
551
|
+
* @see element-paragraph-geometry.ts
|
|
552
|
+
*/
|
|
553
|
+
resolvedParagraphGeometry?: TextStyle;
|
|
554
|
+
/**
|
|
555
|
+
* Snapshot of the ELEMENT-scope `a:bodyPr` properties (vertical anchor,
|
|
556
|
+
* text direction, columns, overflow, autofit, body insets, text wrap, and
|
|
557
|
+
* the boolean/rotation attributes) as the load pipeline resolved them.
|
|
558
|
+
*
|
|
559
|
+
* A shape's own `a:bodyPr` is parsed first, then whatever it left
|
|
560
|
+
* `undefined` is back-filled from the placeholder / layout / master
|
|
561
|
+
* defaults (`applyPlaceholderBodyDefaults`), and a placeholder shape with
|
|
562
|
+
* no `a:bodyPr` of its own has the INHERITED one parsed as if it were its
|
|
563
|
+
* own. None of those three sources is distinguishable at
|
|
564
|
+
* `element.textStyle` once the cascade finishes, so a writer that
|
|
565
|
+
* re-emits every defined field turns an inherited anchor, inset, autofit
|
|
566
|
+
* mode or `rtlCol` into a value pinned on the slide forever (and an
|
|
567
|
+
* inherited `a:normAutofit` with no scale gets written back as
|
|
568
|
+
* `a:spAutoFit`, flipping AutoSize from "shrink text" to "resize shape").
|
|
569
|
+
*
|
|
570
|
+
* Present only on an `element.textStyle` that came from a parsed deck.
|
|
571
|
+
* The save path diffs the live style against this snapshot: a field that
|
|
572
|
+
* still matches is an inheritance artefact and the writer leaves the
|
|
573
|
+
* underlying `a:bodyPr` attribute untouched (whatever it already is,
|
|
574
|
+
* present or absent); a field that differs was authored or has since
|
|
575
|
+
* been edited and is written out.
|
|
576
|
+
*
|
|
577
|
+
* @see element-body-properties.ts
|
|
578
|
+
*/
|
|
579
|
+
resolvedBodyProperties?: TextStyle;
|
|
580
|
+
fontFamily?: string;
|
|
581
|
+
fontSize?: number;
|
|
582
|
+
/** When true, some form of autofit is in effect; see {@link autoFitMode} for which. */
|
|
583
|
+
autoFit?: boolean;
|
|
584
|
+
/** Explicit autofit mode from OOXML body properties.
|
|
585
|
+
* - 'shrink': `a:spAutoFit` - resize the SHAPE to fit the text (never the font)
|
|
586
|
+
* - 'normal': `a:normAutofit` - shrink the TEXT to fit the shape (via `fontScale`/`lnSpcReduction`)
|
|
587
|
+
* - 'none': `a:noAutofit` - explicitly no auto-fit (text overflows)
|
|
588
|
+
* - undefined: no autofit element present (inherit from layout/master)
|
|
589
|
+
*/
|
|
590
|
+
autoFitMode?: 'shrink' | 'normal' | 'none';
|
|
591
|
+
/** Font scale percentage for normAutofit (e.g. 0.9 = 90%). Only meaningful when autoFit is true. */
|
|
592
|
+
autoFitFontScale?: number;
|
|
593
|
+
/** Line spacing reduction for normAutofit (e.g. 0.2 = reduce by 20%). Only meaningful when autoFit is true. */
|
|
594
|
+
autoFitLineSpacingReduction?: number;
|
|
595
|
+
bold?: boolean;
|
|
596
|
+
italic?: boolean;
|
|
597
|
+
underline?: boolean;
|
|
598
|
+
/** Specific underline style (e.g. "sng", "dbl", "wavy"). Falls back to "sng" when `underline` is true. */
|
|
599
|
+
underlineStyle?: UnderlineStyle;
|
|
600
|
+
/** Underline colour as hex string (`a:uFill` / `a:uLn`). When absent, inherits text colour. */
|
|
601
|
+
underlineColor?: string;
|
|
602
|
+
/**
|
|
603
|
+
* When true, the source authored `<a:u val="none"/>` to explicitly suppress
|
|
604
|
+
* underline (rather than omitting the attribute entirely). Preserved so the
|
|
605
|
+
* writer can re-emit the explicit `none` token instead of dropping it.
|
|
606
|
+
*/
|
|
607
|
+
underlineExplicitNone?: boolean;
|
|
608
|
+
/**
|
|
609
|
+
* Underline line properties parsed from `<a:rPr><a:uLn>` — width, dash
|
|
610
|
+
* preset, and end caps. Captured as a typed object so the writer can
|
|
611
|
+
* round-trip the line styling that previously was dropped (only the
|
|
612
|
+
* solidFill colour was carried before).
|
|
613
|
+
*/
|
|
614
|
+
underlineLine?: {
|
|
615
|
+
/** Line width in EMU (raw OOXML) for `a:uLn/@w`. */
|
|
616
|
+
widthEmu?: number;
|
|
617
|
+
/** Compound line type (`a:uLn/@cmpd`). */
|
|
618
|
+
compound?: string;
|
|
619
|
+
/** Cap style (`a:uLn/@cap`). */
|
|
620
|
+
cap?: string;
|
|
621
|
+
/** Pen alignment (`a:uLn/@algn`). */
|
|
622
|
+
algn?: string;
|
|
623
|
+
/** Preset dash value (`a:uLn/a:prstDash/@val`). */
|
|
624
|
+
prstDash?: string;
|
|
625
|
+
/** Raw `a:uLn/a:headEnd` XML preserved verbatim. */
|
|
626
|
+
headEndXml?: XmlObject;
|
|
627
|
+
/** Raw `a:uLn/a:tailEnd` XML preserved verbatim. */
|
|
628
|
+
tailEndXml?: XmlObject;
|
|
629
|
+
};
|
|
630
|
+
/** When `<a:uLnTx/>` is present — underline line follows the text run line. */
|
|
631
|
+
underlineLineFollowsText?: boolean;
|
|
632
|
+
/** When `<a:uFillTx/>` is present — underline fill follows the text run fill. */
|
|
633
|
+
underlineFillFollowsText?: boolean;
|
|
634
|
+
strikethrough?: boolean;
|
|
635
|
+
/** Specific strike type: single or double from `a:rPr/@strike`. */
|
|
636
|
+
strikeType?: 'sngStrike' | 'dblStrike';
|
|
637
|
+
/** Text outline width in px (`a:rPr > a:ln/@w` in EMU). */
|
|
638
|
+
textOutlineWidth?: number;
|
|
639
|
+
/** Text outline colour as hex string (`a:rPr > a:ln > a:solidFill`). */
|
|
640
|
+
textOutlineColor?: string;
|
|
641
|
+
/** Text outline dash preset (`a:rPr > a:ln > a:prstDash/@val`), e.g. `dash`; absent for solid. */
|
|
642
|
+
textOutlineDash?: string;
|
|
643
|
+
/** When true, the text body has no fill (`a:rPr > a:noFill`), producing hollow/outline-only text. */
|
|
644
|
+
textFillNone?: boolean;
|
|
645
|
+
/**
|
|
646
|
+
* When true, the run authored an EMPTY `<a:effectLst/>`: an explicit "no
|
|
647
|
+
* effects" override that blocks an inherited shadow or glow. Kept so a
|
|
648
|
+
* rewrite re-emits it instead of letting the inherited effect return.
|
|
649
|
+
*/
|
|
650
|
+
textEffectsExplicitNone?: boolean;
|
|
651
|
+
/** Superscript/subscript baseline shift as percentage (`a:rPr/@baseline`). Positive = super, negative = sub. */
|
|
652
|
+
baseline?: number;
|
|
653
|
+
/** Character spacing in hundredths of a point (`a:rPr/@spc`). */
|
|
654
|
+
characterSpacing?: number;
|
|
655
|
+
/** Kerning threshold in hundredths of a point (`a:rPr/@kern`). 0 = none. */
|
|
656
|
+
kerning?: number;
|
|
657
|
+
/** Text highlight colour as hex string (`a:highlight`). */
|
|
658
|
+
highlightColor?: string;
|
|
659
|
+
/**
|
|
660
|
+
* Raw colour-choice XML preserved from `a:highlight` so a themed highlight
|
|
661
|
+
* (`a:schemeClr` / `a:sysClr` / `a:prstClr`) re-emits with its original
|
|
662
|
+
* identity rather than being flattened to `<a:srgbClr/>` on save. On save we
|
|
663
|
+
* re-emit verbatim when the resolved {@link highlightColor} still matches.
|
|
664
|
+
*/
|
|
665
|
+
highlightColorXml?: XmlObject;
|
|
666
|
+
/** Text-level gradient fill CSS string (from `a:rPr > a:gradFill`). */
|
|
667
|
+
textFillGradient?: string;
|
|
668
|
+
/** Structured gradient stops for text fill round-trip serialization. */
|
|
669
|
+
textFillGradientStops?: Array<{
|
|
670
|
+
color: string;
|
|
671
|
+
position: number;
|
|
672
|
+
opacity?: number;
|
|
673
|
+
}>;
|
|
674
|
+
/** Gradient angle in degrees for text fill round-trip. */
|
|
675
|
+
textFillGradientAngle?: number;
|
|
676
|
+
/** Gradient type for text fill round-trip ('linear' | 'radial'). */
|
|
677
|
+
textFillGradientType?: 'linear' | 'radial';
|
|
678
|
+
/** Text-level pattern fill preset (from `a:rPr > a:pattFill`). */
|
|
679
|
+
textFillPattern?: string;
|
|
680
|
+
/** Text-level pattern foreground colour. */
|
|
681
|
+
textFillPatternForeground?: string;
|
|
682
|
+
/** Text-level pattern background colour. */
|
|
683
|
+
textFillPatternBackground?: string;
|
|
684
|
+
/**
|
|
685
|
+
* Raw `a:rPr > a:blipFill` XML, preserved verbatim for round-trip
|
|
686
|
+
* serialization AND as the input to the image resolution pass that fills
|
|
687
|
+
* in {@link textFillBlipUrl} (parsing a run's fill happens synchronously,
|
|
688
|
+
* with no zip/relationship access at that point; resolving the blip to a
|
|
689
|
+
* displayable URL needs both, so it happens in a later async pass over
|
|
690
|
+
* the slide's parsed elements, mirroring how a shape's OWN image fill is
|
|
691
|
+
* resolved). A picture-filled text run (`a:rPr > a:blipFill`) was
|
|
692
|
+
* documented as handled ("Handles gradient fills, pattern fills, and
|
|
693
|
+
* image fills on text runs") but never actually parsed, so it silently
|
|
694
|
+
* fell through to the run's plain `color` and rendered solid black
|
|
695
|
+
* (COM-verified: `audit-text` slide 13's "PICTURE FILL" run shows the
|
|
696
|
+
* fill image through the glyphs in PowerPoint).
|
|
697
|
+
*/
|
|
698
|
+
textFillBlipXml?: XmlObject;
|
|
699
|
+
/** Resolved displayable URL for {@link textFillBlipXml}, or the archive-relative path when unresolved (lazy decode). */
|
|
700
|
+
textFillBlipUrl?: string;
|
|
701
|
+
/** Tiling mode for {@link textFillBlipUrl} (`a:blipFill/a:tile` present -> 'tile', else 'stretch'). */
|
|
702
|
+
textFillBlipMode?: 'stretch' | 'tile';
|
|
703
|
+
hyperlink?: string;
|
|
704
|
+
/** Relationship ID for the hyperlink (`a:hlinkClick/@r:id`) — preserved for round-trip serialization. */
|
|
705
|
+
hyperlinkRId?: string;
|
|
706
|
+
/** Hyperlink tooltip text (`a:hlinkClick/@tooltip`). */
|
|
707
|
+
hyperlinkTooltip?: string;
|
|
708
|
+
/** Hyperlink action type (`a:hlinkClick/@action`). */
|
|
709
|
+
hyperlinkAction?: string;
|
|
710
|
+
/** Whether the hyperlink target is an internal slide jump (targetSlideIndex style). */
|
|
711
|
+
hyperlinkTargetSlideIndex?: number;
|
|
712
|
+
color?: string;
|
|
713
|
+
/**
|
|
714
|
+
* Raw XML colour-choice node preserved from `a:rPr/a:solidFill` for
|
|
715
|
+
* round-trip serialisation. Captures `a:schemeClr` / `a:sysClr` /
|
|
716
|
+
* `a:prstClr` / `a:srgbClr` plus colour transforms. On save we re-emit
|
|
717
|
+
* verbatim when the resolved {@link color} still matches this node.
|
|
718
|
+
*/
|
|
719
|
+
colorXml?: XmlObject;
|
|
720
|
+
/**
|
|
721
|
+
* Typed theme colour reference for the run's text colour, set when
|
|
722
|
+
* {@link colorXml} is a plain `a:schemeClr` (see
|
|
723
|
+
* `themeColorRefFromColorChoice`). When present it WINS on save: the
|
|
724
|
+
* writer emits `<a:schemeClr>` from this ref instead of the resolved
|
|
725
|
+
* {@link color}, so the text keeps following the theme palette after a
|
|
726
|
+
* later theme change.
|
|
727
|
+
*/
|
|
728
|
+
colorRef?: PptxThemeColorRef;
|
|
729
|
+
align?: 'left' | 'center' | 'right' | 'justify' | 'justLow' | 'dist' | 'thaiDist';
|
|
730
|
+
/**
|
|
731
|
+
* Vertical text-box anchor (`a:bodyPr/@anchor`, `ST_TextAnchoringType`).
|
|
732
|
+
* `distributed`/`justified` (`dist`/`just`) stretch line spacing so the
|
|
733
|
+
* paragraph block fills the box's full vertical extent, distinct from true
|
|
734
|
+
* centering (`middle`/`ctr`); both approximate to a middle-anchored render
|
|
735
|
+
* (see `text-body-layout.ts`) since CSS has no native vertical-justify
|
|
736
|
+
* primitive, but round-trip losslessly through parse/save.
|
|
737
|
+
*/
|
|
738
|
+
vAlign?: 'top' | 'middle' | 'bottom' | 'distributed' | 'justified';
|
|
739
|
+
/** Right-to-left paragraph/run direction (`a:pPr/@rtl`, `a:rPr/@rtl`). */
|
|
740
|
+
rtl?: boolean;
|
|
741
|
+
/** Body text direction (`a:bodyPr/@vert`).
|
|
742
|
+
*
|
|
743
|
+
* Values map to OOXML `a:bodyPr/@vert` attribute values:
|
|
744
|
+
* - `"horizontal"` — default horizontal text (`horz`)
|
|
745
|
+
* - `"vertical"` — standard vertical text, right-to-left columns (`vert`)
|
|
746
|
+
* - `"vertical270"` — text rotated 270 degrees (`vert270`)
|
|
747
|
+
* - `"eaVert"` — East Asian vertical text with CJK glyphs upright (`eaVert`)
|
|
748
|
+
* - `"wordArtVert"` — WordArt vertical, each character upright stacked (`wordArtVert`)
|
|
749
|
+
* - `"wordArtVertRtl"` — WordArt vertical, right-to-left direction (`wordArtVertRtl`)
|
|
750
|
+
* - `"mongolianVert"` — Mongolian vertical text, left-to-right columns (`mongolianVert`)
|
|
751
|
+
*/
|
|
752
|
+
textDirection?: 'horizontal' | 'vertical' | 'vertical270' | 'eaVert' | 'wordArtVert' | 'wordArtVertRtl' | 'mongolianVert';
|
|
753
|
+
/** Body column count (`a:bodyPr/@numCol`). */
|
|
754
|
+
columnCount?: number;
|
|
755
|
+
/** Column spacing in px (`a:bodyPr/@spcCol` in EMU). */
|
|
756
|
+
columnSpacing?: number;
|
|
757
|
+
/** Horizontal overflow mode from `a:bodyPr/@hOverflow`. */
|
|
758
|
+
hOverflow?: 'overflow' | 'clip';
|
|
759
|
+
/** Vertical overflow mode from `a:bodyPr/@vertOverflow`. */
|
|
760
|
+
vertOverflow?: 'overflow' | 'clip' | 'ellipsis';
|
|
761
|
+
/** Body text left inset in px (`a:bodyPr/@lIns` in EMU). */
|
|
762
|
+
bodyInsetLeft?: number;
|
|
763
|
+
/** Body text top inset in px (`a:bodyPr/@tIns` in EMU). */
|
|
764
|
+
bodyInsetTop?: number;
|
|
765
|
+
/** Body text right inset in px (`a:bodyPr/@rIns` in EMU). */
|
|
766
|
+
bodyInsetRight?: number;
|
|
767
|
+
/** Body text bottom inset in px (`a:bodyPr/@bIns` in EMU). */
|
|
768
|
+
bodyInsetBottom?: number;
|
|
769
|
+
/** Paragraph spacing before in px. */
|
|
770
|
+
paragraphSpacingBefore?: number;
|
|
771
|
+
/** Paragraph spacing after in px. */
|
|
772
|
+
paragraphSpacingAfter?: number;
|
|
773
|
+
/** Line spacing multiplier (e.g. 1.2 = 120%). Used when mode is proportional (spcPct). */
|
|
774
|
+
lineSpacing?: number;
|
|
775
|
+
/** Exact line spacing in points (from `a:lnSpc > a:spcPts`). Takes priority over `lineSpacing` when set. */
|
|
776
|
+
lineSpacingExactPt?: number;
|
|
777
|
+
/** Paragraph left margin in px (`a:pPr/@marL` in EMU). */
|
|
778
|
+
paragraphMarginLeft?: number;
|
|
779
|
+
/** Paragraph right margin in px (`a:pPr/@marR` in EMU). */
|
|
780
|
+
paragraphMarginRight?: number;
|
|
781
|
+
/** Paragraph first-line indent in px (`a:pPr/@indent` in EMU). */
|
|
782
|
+
paragraphIndent?: number;
|
|
783
|
+
/** Tab stop positions and alignments (`a:pPr/a:tabLst/a:tab`). */
|
|
784
|
+
tabStops?: Array<{
|
|
785
|
+
position: number;
|
|
786
|
+
align: 'l' | 'ctr' | 'r' | 'dec';
|
|
787
|
+
leader?: 'none' | 'dot' | 'hyphen' | 'underscore';
|
|
788
|
+
/**
|
|
789
|
+
* True when the source spelled out the schema-default `@algn="l"`, so the
|
|
790
|
+
* writer re-emits it instead of treating it as an omitted default.
|
|
791
|
+
*/
|
|
792
|
+
alignAuthored?: boolean;
|
|
793
|
+
/** True when the source spelled out the schema-default `@leader="none"`. */
|
|
794
|
+
leaderAuthored?: boolean;
|
|
795
|
+
}>;
|
|
796
|
+
/**
|
|
797
|
+
* True when the paragraph's own `a:pPr` authored an EMPTY `<a:tabLst/>`
|
|
798
|
+
* (explicitly "no tab stops", overriding whatever the cascade would
|
|
799
|
+
* otherwise supply) rather than omitting the element entirely (inherit).
|
|
800
|
+
* fast-xml-parser gives a childless element as the empty string, so
|
|
801
|
+
* `tabLst` and no-`tabLst` are otherwise indistinguishable once `tabStops`
|
|
802
|
+
* comes back empty either way. Paragraph-scope only; not part of the
|
|
803
|
+
* element-level geometry cascade.
|
|
804
|
+
*/
|
|
805
|
+
tabStopsExplicitEmpty?: boolean;
|
|
806
|
+
/** Body text wrapping mode from `a:bodyPr/@wrap`. */
|
|
807
|
+
textWrap?: 'square' | 'none';
|
|
808
|
+
/** Preset text warp type from `a:bodyPr/a:prstTxWarp`. */
|
|
809
|
+
textWarpPreset?: PptxTextWarpPreset;
|
|
810
|
+
/** Primary adjustment value for text warp (from `a:prstTxWarp/a:avLst/a:gd` with name "adj").
|
|
811
|
+
* Stored as raw OOXML 1/60000th units (e.g. 50000 = default for many presets). */
|
|
812
|
+
textWarpAdj?: number;
|
|
813
|
+
/** Secondary adjustment value for text warp (from `a:prstTxWarp/a:avLst/a:gd` with name "adj2").
|
|
814
|
+
* Stored as raw OOXML 1/60000th units. */
|
|
815
|
+
textWarpAdj2?: number;
|
|
816
|
+
/** Text capitalization style from `a:rPr/@cap`. */
|
|
817
|
+
textCaps?: 'all' | 'small' | 'none';
|
|
818
|
+
/**
|
|
819
|
+
* When true, the source authored `<a:rPr cap="none"/>` explicitly. This
|
|
820
|
+
* differs from {@link textCaps} = `"none"` only because the writer must
|
|
821
|
+
* preserve the explicit token rather than collapse it to omission.
|
|
822
|
+
*/
|
|
823
|
+
textCapsExplicitNone?: boolean;
|
|
824
|
+
/** Symbol font family from `a:sym`. */
|
|
825
|
+
symbolFont?: string;
|
|
826
|
+
/** East Asian font family from `a:ea`. */
|
|
827
|
+
eastAsiaFont?: string;
|
|
828
|
+
/** Complex Script font family from `a:cs`. */
|
|
829
|
+
complexScriptFont?: string;
|
|
830
|
+
/**
|
|
831
|
+
* Theme-font token (`+mj-lt` / `+mn-lt` / ...) authored on `a:latin`, when
|
|
832
|
+
* present. {@link fontFamily} holds the resolved concrete face for
|
|
833
|
+
* rendering; this preserves the token linkage so the writer re-emits the
|
|
834
|
+
* token rather than the flattened face (see #84).
|
|
835
|
+
*/
|
|
836
|
+
latinFontThemeToken?: string;
|
|
837
|
+
/** Theme-font token authored on `a:ea` (e.g. `+mn-ea`), when present. */
|
|
838
|
+
eastAsiaFontThemeToken?: string;
|
|
839
|
+
/** Theme-font token authored on `a:cs` (e.g. `+mn-cs`), when present. */
|
|
840
|
+
complexScriptFontThemeToken?: string;
|
|
841
|
+
/**
|
|
842
|
+
* Automatic per-script fallback face resolved from the theme's
|
|
843
|
+
* `<a:font script="...">` overrides for a run whose text is dominantly
|
|
844
|
+
* CJK / Arabic / Hebrew / Thai (see #83). A rendering hint only: it is not
|
|
845
|
+
* serialised back on save, so it never disturbs the round-trip typefaces.
|
|
846
|
+
*/
|
|
847
|
+
scriptFallbackFont?: string;
|
|
848
|
+
/**
|
|
849
|
+
* Set alongside {@link scriptFallbackFont} when the resolved {@link fontFamily}
|
|
850
|
+
* came only from the paragraph/list-style/theme CASCADE (the run's own
|
|
851
|
+
* `a:rPr` authored no `a:latin`/`a:ea`/`a:cs` of its own). A run always
|
|
852
|
+
* inherits SOME font this way (typically the theme's `+mn-lt`), so without
|
|
853
|
+
* this flag `fontFamily` was indistinguishable from a run that genuinely
|
|
854
|
+
* chose that font itself, and the renderer never applied the theme's
|
|
855
|
+
* per-script override (see #83): `+mn-lt` names only the LATIN member of
|
|
856
|
+
* the font scheme and was never meant to cover text in a different
|
|
857
|
+
* dominant script. An explicit `a:latin`/`a:ea`/`a:cs` authored on the run
|
|
858
|
+
* itself still always wins; only the cascade default yields to the
|
|
859
|
+
* script-specific override.
|
|
860
|
+
*/
|
|
861
|
+
fontFamilyIsCascadeDefault?: boolean;
|
|
862
|
+
/** Text language from `a:rPr/@lang`. */
|
|
863
|
+
language?: string;
|
|
864
|
+
/** Hyperlink mouse-over target from `a:hlinkMouseOver`. */
|
|
865
|
+
hyperlinkMouseOver?: string;
|
|
866
|
+
/**
|
|
867
|
+
* Raw `a:snd` (embedded WAV audio) child of `a:hlinkClick`, preserved
|
|
868
|
+
* verbatim (carries `@r:embed` + `@name`). Round-tripped on save so the
|
|
869
|
+
* click sound survives instead of being dropped.
|
|
870
|
+
*/
|
|
871
|
+
hyperlinkSoundXml?: XmlObject;
|
|
872
|
+
/** Raw `a:snd` child of `a:hlinkMouseOver`, preserved verbatim for round-trip. */
|
|
873
|
+
hyperlinkMouseOverSoundXml?: XmlObject;
|
|
874
|
+
/** Hyperlink invalidUrl attribute (`a:hlinkClick/@invalidUrl`). */
|
|
875
|
+
hyperlinkInvalidUrl?: string;
|
|
876
|
+
/** Hyperlink target frame (`a:hlinkClick/@tgtFrame`). */
|
|
877
|
+
hyperlinkTargetFrame?: string;
|
|
878
|
+
/** Whether hyperlink history is tracked (`a:hlinkClick/@history`). */
|
|
879
|
+
hyperlinkHistory?: boolean;
|
|
880
|
+
/** Whether hyperlink uses highlight-click effect (`a:hlinkClick/@highlightClick`). */
|
|
881
|
+
hyperlinkHighlightClick?: boolean;
|
|
882
|
+
/** Whether hyperlink ends a sound (`a:hlinkClick/@endSnd`). */
|
|
883
|
+
hyperlinkEndSound?: boolean;
|
|
884
|
+
/**
|
|
885
|
+
* Raw `a:hlinkClick/a:extLst` child, preserved verbatim for round-trip.
|
|
886
|
+
* Carries vendor extensions this engine does not interpret, most commonly
|
|
887
|
+
* `ahyp:hlinkClr` (Microsoft's "hyperlink color" extension,
|
|
888
|
+
* `{A12FA001-AC4F-418D-AE19-62706E023703}`), which records whether a
|
|
889
|
+
* hyperlink run should paint with the theme's text colour instead of the
|
|
890
|
+
* hyperlink colour. Dropping the whole `a:extLst` silently reverted such a
|
|
891
|
+
* run to the default (themed) hyperlink colour on save.
|
|
892
|
+
*/
|
|
893
|
+
hyperlinkExtensionXml?: XmlObject;
|
|
894
|
+
/** Kumimoji (ideographic text combining) flag for vertical CJK text (`a:rPr/@kumimoji`). */
|
|
895
|
+
kumimoji?: boolean;
|
|
896
|
+
/** Normalize height flag (`a:rPr/@normalizeH`). */
|
|
897
|
+
normalizeHeight?: boolean;
|
|
898
|
+
/** No proofing flag (`a:rPr/@noProof`). */
|
|
899
|
+
noProof?: boolean;
|
|
900
|
+
/** Dirty flag indicating run has been edited (`a:rPr/@dirty`). */
|
|
901
|
+
dirty?: boolean;
|
|
902
|
+
/** Error flag indicating spelling error (`a:rPr/@err`). */
|
|
903
|
+
spellingError?: boolean;
|
|
904
|
+
/** Smart tag clean flag (`a:rPr/@smtClean`). */
|
|
905
|
+
smartTagClean?: boolean;
|
|
906
|
+
/** Bookmark link target (`a:rPr/@bmk`). */
|
|
907
|
+
bookmark?: string;
|
|
908
|
+
/** Alternative language for the run (`a:rPr/@altLang`). Populated for runs
|
|
909
|
+
* authored in mixed-script documents (e.g. Asian/Latin combined). */
|
|
910
|
+
altLanguage?: string;
|
|
911
|
+
/** SmartTag (Office grammar tag) GUID id (`a:rPr/@smtId`). Round-tripped
|
|
912
|
+
* verbatim — the engine doesn't interpret it. */
|
|
913
|
+
smartTagId?: number;
|
|
914
|
+
/** Latin font PANOSE classification string from `a:rPr > a:latin/@panose`. */
|
|
915
|
+
latinFontPanose?: string;
|
|
916
|
+
/** Latin font pitch + family flag from `a:rPr > a:latin/@pitchFamily`. */
|
|
917
|
+
latinFontPitchFamily?: number;
|
|
918
|
+
/** Latin font character set id from `a:rPr > a:latin/@charset`. */
|
|
919
|
+
latinFontCharset?: number;
|
|
920
|
+
/** East-Asian font PANOSE from `a:rPr > a:ea/@panose`. */
|
|
921
|
+
eastAsiaFontPanose?: string;
|
|
922
|
+
/** East-Asian font pitch + family flag from `a:rPr > a:ea/@pitchFamily`. */
|
|
923
|
+
eastAsiaFontPitchFamily?: number;
|
|
924
|
+
/** East-Asian font character set id from `a:rPr > a:ea/@charset`. */
|
|
925
|
+
eastAsiaFontCharset?: number;
|
|
926
|
+
/** Complex-script font PANOSE from `a:rPr > a:cs/@panose`. */
|
|
927
|
+
complexScriptFontPanose?: string;
|
|
928
|
+
/** Complex-script font pitch + family flag from `a:rPr > a:cs/@pitchFamily`. */
|
|
929
|
+
complexScriptFontPitchFamily?: number;
|
|
930
|
+
/** Complex-script font character set id from `a:rPr > a:cs/@charset`. */
|
|
931
|
+
complexScriptFontCharset?: number;
|
|
932
|
+
/** Symbol-font PANOSE from `a:rPr > a:sym/@panose`. */
|
|
933
|
+
symbolFontPanose?: string;
|
|
934
|
+
/** Symbol-font pitch + family flag from `a:rPr > a:sym/@pitchFamily`. */
|
|
935
|
+
symbolFontPitchFamily?: number;
|
|
936
|
+
/** Symbol-font character set id from `a:rPr > a:sym/@charset`. */
|
|
937
|
+
symbolFontCharset?: number;
|
|
938
|
+
/** Paragraph list type for toggling bullet / numbered lists via the toolbar.
|
|
939
|
+
* - `'bullet'` — character bullet (default "•")
|
|
940
|
+
* - `'numbered'` — auto-numbered list (arabicPeriod)
|
|
941
|
+
* - `'none'` — explicitly no list
|
|
942
|
+
*/
|
|
943
|
+
listType?: 'bullet' | 'numbered' | 'none';
|
|
944
|
+
/** Default tab size in px (`a:pPr/@defTabSz` in EMU). */
|
|
945
|
+
defaultTabSize?: number;
|
|
946
|
+
/** East Asian line break flag (`a:pPr/@eaLnBrk`). */
|
|
947
|
+
eaLineBreak?: boolean;
|
|
948
|
+
/** Latin line break flag (`a:pPr/@latinLnBrk`). */
|
|
949
|
+
latinLineBreak?: boolean;
|
|
950
|
+
/** Font alignment (`a:pPr/@fontAlgn`): 'auto' | 'base' | 'ctr' | 't' | 'b'. */
|
|
951
|
+
fontAlignment?: string;
|
|
952
|
+
/** Hanging punctuation flag (`a:pPr/@hangingPunct`). */
|
|
953
|
+
hangingPunctuation?: boolean;
|
|
954
|
+
/** Whether to space first and last paragraph from body edges (`a:bodyPr/@spcFirstLastPara`). */
|
|
955
|
+
spaceFirstLastParagraph?: boolean;
|
|
956
|
+
/** Right-to-left column flow (`a:bodyPr/@rtlCol`). */
|
|
957
|
+
rtlColumns?: boolean;
|
|
958
|
+
/** Whether text originates from WordArt (`a:bodyPr/@fromWordArt`). */
|
|
959
|
+
fromWordArt?: boolean;
|
|
960
|
+
/** Whether text anchoring is centered (`a:bodyPr/@anchorCtr`). */
|
|
961
|
+
anchorCenter?: boolean;
|
|
962
|
+
/** Force anti-aliasing (`a:bodyPr/@forceAA`). */
|
|
963
|
+
forceAntiAlias?: boolean;
|
|
964
|
+
/** Upright text in 3D views (`a:bodyPr/@upright`). */
|
|
965
|
+
upright?: boolean;
|
|
966
|
+
/** Compatible line spacing flag (`a:bodyPr/@compatLnSpc`). */
|
|
967
|
+
compatibleLineSpacing?: boolean;
|
|
968
|
+
/**
|
|
969
|
+
* Text body rotation in **degrees** (`a:bodyPr/@rot`).
|
|
970
|
+
*
|
|
971
|
+
* OOXML stores the value as 60000ths of a degree. Positive values rotate
|
|
972
|
+
* the body clockwise. When undefined, the attribute is omitted on save
|
|
973
|
+
* (PowerPoint treats absent `rot` as inherit/none).
|
|
974
|
+
*/
|
|
975
|
+
textBodyRotation?: number;
|
|
976
|
+
/** Text shadow colour as hex string (`a:outerShdw`). */
|
|
977
|
+
textShadowColor?: string;
|
|
978
|
+
/** Text shadow blur radius in px. */
|
|
979
|
+
textShadowBlur?: number;
|
|
980
|
+
/** Text shadow horizontal offset in px. */
|
|
981
|
+
textShadowOffsetX?: number;
|
|
982
|
+
/** Text shadow vertical offset in px. */
|
|
983
|
+
textShadowOffsetY?: number;
|
|
984
|
+
/** Text shadow opacity (0-1). */
|
|
985
|
+
textShadowOpacity?: number;
|
|
986
|
+
/** Text inner shadow colour (`a:innerShdw`). */
|
|
987
|
+
textInnerShadowColor?: string;
|
|
988
|
+
/** Text inner shadow opacity (0-1). */
|
|
989
|
+
textInnerShadowOpacity?: number;
|
|
990
|
+
/** Text inner shadow blur radius in px. */
|
|
991
|
+
textInnerShadowBlur?: number;
|
|
992
|
+
/** Text inner shadow horizontal offset in px. */
|
|
993
|
+
textInnerShadowOffsetX?: number;
|
|
994
|
+
/** Text inner shadow vertical offset in px. */
|
|
995
|
+
textInnerShadowOffsetY?: number;
|
|
996
|
+
/**
|
|
997
|
+
* Original inner-shadow colour-choice XML (`a:innerShdw`'s
|
|
998
|
+
* `a:prstClr`/`a:schemeClr`/`a:srgbClr`/… child), preserved verbatim so an
|
|
999
|
+
* authored preset or theme colour round-trips instead of always being
|
|
1000
|
+
* re-serialized as a resolved `a:srgbClr`. Mirrors {@link textGlowColorXml}.
|
|
1001
|
+
*/
|
|
1002
|
+
textInnerShadowColorXml?: XmlObject;
|
|
1003
|
+
/** Theme colour slot the inner shadow colour resolved from, when it is `a:schemeClr`. */
|
|
1004
|
+
textInnerShadowColorRef?: PptxThemeColorRef;
|
|
1005
|
+
/** Preset shadow type from `a:prstShdw/@prst` (e.g. "shdw1"..."shdw20"). */
|
|
1006
|
+
textPresetShadowName?: string;
|
|
1007
|
+
/** Preset shadow colour as hex string. */
|
|
1008
|
+
textPresetShadowColor?: string;
|
|
1009
|
+
/** Preset shadow opacity (0-1). */
|
|
1010
|
+
textPresetShadowOpacity?: number;
|
|
1011
|
+
/** Preset shadow distance in px. */
|
|
1012
|
+
textPresetShadowDistance?: number;
|
|
1013
|
+
/** Preset shadow direction in degrees. */
|
|
1014
|
+
textPresetShadowDirection?: number;
|
|
1015
|
+
/** Text blur effect radius in px (`a:blur`). */
|
|
1016
|
+
textBlurRadius?: number;
|
|
1017
|
+
/**
|
|
1018
|
+
* Text soft-edge radius in px (`a:softEdge/@rad`).
|
|
1019
|
+
*
|
|
1020
|
+
* Feathers the glyph's own edges (a uniform blur of the alpha silhouette,
|
|
1021
|
+
* the same effect a shape's `a:softEdge` gives its fill), unrelated to
|
|
1022
|
+
* `a:blur` (which blurs the whole run, colour included) or a shadow. Never
|
|
1023
|
+
* parsed before this field existed, so `a:softEdge` on a run was silently
|
|
1024
|
+
* dropped: PowerPoint fades the glyphs to near-transparent at their
|
|
1025
|
+
* outline (COM-verified, `audit-text` slide 14's "SOFTEDGE" run), while
|
|
1026
|
+
* the viewer painted them fully crisp.
|
|
1027
|
+
*/
|
|
1028
|
+
textSoftEdgeRadius?: number;
|
|
1029
|
+
/**
|
|
1030
|
+
* Raw `a:effectDag` XML node from `a:rPr`, preserved verbatim for
|
|
1031
|
+
* round-trip serialisation. Mirrors the shape-level
|
|
1032
|
+
* {@link import('./shape-style').ShapeStyle.effectDagXml} field.
|
|
1033
|
+
*/
|
|
1034
|
+
textEffectDagXml?: XmlObject;
|
|
1035
|
+
/**
|
|
1036
|
+
* Typed effect graph parsed from `textEffectDagXml`. The four structural
|
|
1037
|
+
* container nodes (`a:cont`, `a:blend`, `a:xfrmEffect`, `a:relOff`) are
|
|
1038
|
+
* fully typed; any other leaf effect is captured as
|
|
1039
|
+
* {@link import('./effect-dag').EffectDagRawLeaf} so we never have to
|
|
1040
|
+
* recurse into the full effect taxonomy.
|
|
1041
|
+
*/
|
|
1042
|
+
textEffectDagTree?: EffectDagContainer;
|
|
1043
|
+
/** Text alpha modulation fixed (0-100) from `a:alphaModFix`. */
|
|
1044
|
+
textAlphaModFix?: number;
|
|
1045
|
+
/** Text alpha modulation from `a:alphaMod` (0-100 percentage). */
|
|
1046
|
+
textAlphaMod?: number;
|
|
1047
|
+
/** Text hue shift in degrees from `a:hsl/@hue`. */
|
|
1048
|
+
textHslHue?: number;
|
|
1049
|
+
/** Text saturation adjustment from `a:hsl/@sat`. */
|
|
1050
|
+
textHslSaturation?: number;
|
|
1051
|
+
/** Text luminance adjustment from `a:hsl/@lum`. */
|
|
1052
|
+
textHslLuminance?: number;
|
|
1053
|
+
/** Text colour change from colour as hex string (`a:clrChange`). */
|
|
1054
|
+
textClrChangeFrom?: string;
|
|
1055
|
+
/** Text colour change to colour as hex string. */
|
|
1056
|
+
textClrChangeTo?: string;
|
|
1057
|
+
/** Text duotone colour pair (`a:duotone`). */
|
|
1058
|
+
textDuotone?: {
|
|
1059
|
+
color1: string;
|
|
1060
|
+
color2: string;
|
|
1061
|
+
};
|
|
1062
|
+
/** Text glow colour as hex string (`a:glow`). */
|
|
1063
|
+
textGlowColor?: string;
|
|
1064
|
+
/** Text glow radius in px. */
|
|
1065
|
+
textGlowRadius?: number;
|
|
1066
|
+
/** Text glow opacity (0-1). */
|
|
1067
|
+
textGlowOpacity?: number;
|
|
1068
|
+
/**
|
|
1069
|
+
* Original glow colour-choice XML (`a:glow`'s `a:schemeClr`/`a:srgbClr`/…
|
|
1070
|
+
* child), preserved verbatim so a theme colour reference round-trips
|
|
1071
|
+
* instead of always being re-serialized as a resolved `a:srgbClr` (which
|
|
1072
|
+
* cuts the glow off from theme/Recolor changes).
|
|
1073
|
+
*/
|
|
1074
|
+
textGlowColorXml?: XmlObject;
|
|
1075
|
+
/** Theme colour slot the glow colour resolved from, when it is `a:schemeClr`. */
|
|
1076
|
+
textGlowColorRef?: PptxThemeColorRef;
|
|
1077
|
+
/** Text reflection enabled flag. */
|
|
1078
|
+
textReflection?: boolean;
|
|
1079
|
+
/** Text reflection blur radius in px. */
|
|
1080
|
+
textReflectionBlur?: number;
|
|
1081
|
+
/** Text reflection start opacity (0-1). */
|
|
1082
|
+
textReflectionStartOpacity?: number;
|
|
1083
|
+
/** Text reflection end opacity (0-1). */
|
|
1084
|
+
textReflectionEndOpacity?: number;
|
|
1085
|
+
/** Text reflection offset distance in px. */
|
|
1086
|
+
textReflectionOffset?: number;
|
|
1087
|
+
/**
|
|
1088
|
+
* Text reflection end position (`@endPos`) as a 0-1 fraction of the text
|
|
1089
|
+
* height the fade reaches. Mirrors `ShapeStyle.reflectionEndPosition`.
|
|
1090
|
+
*/
|
|
1091
|
+
textReflectionEndPosition?: number;
|
|
1092
|
+
/**
|
|
1093
|
+
* Text reflection offset direction (`@dir`) in degrees. Mirrors
|
|
1094
|
+
* `ShapeStyle.reflectionDirection`.
|
|
1095
|
+
*/
|
|
1096
|
+
textReflectionDirection?: number;
|
|
1097
|
+
/**
|
|
1098
|
+
* Text reflection fade direction (`a:rPr/a:effectLst/a:reflection/@fadeDir`)
|
|
1099
|
+
* in degrees. Mirrors `ShapeStyle.reflectionFadeDirection`.
|
|
1100
|
+
*/
|
|
1101
|
+
textReflectionFadeDirection?: number;
|
|
1102
|
+
/**
|
|
1103
|
+
* Text reflection horizontal scaling (`@sx`), same units as
|
|
1104
|
+
* `ShapeStyle.reflectionScaleX` (1000ths of a percent, e.g. 100000 = 100%).
|
|
1105
|
+
*/
|
|
1106
|
+
textReflectionScaleX?: number;
|
|
1107
|
+
/** Text reflection vertical scaling (`@sy`). See `ShapeStyle.reflectionScaleY`. */
|
|
1108
|
+
textReflectionScaleY?: number;
|
|
1109
|
+
/**
|
|
1110
|
+
* Text reflection horizontal skew (`@kx`) in 60000ths of a degree. See
|
|
1111
|
+
* `ShapeStyle.reflectionSkewX`.
|
|
1112
|
+
*/
|
|
1113
|
+
textReflectionSkewX?: number;
|
|
1114
|
+
/** Text reflection vertical skew (`@ky`). See `ShapeStyle.reflectionSkewY`. */
|
|
1115
|
+
textReflectionSkewY?: number;
|
|
1116
|
+
/**
|
|
1117
|
+
* Text reflection independent rotation (`@rot`) in degrees. See
|
|
1118
|
+
* `ShapeStyle.reflectionRotation`.
|
|
1119
|
+
*/
|
|
1120
|
+
textReflectionRotation?: number;
|
|
1121
|
+
/** Text reflection anchor (`@algn`). See `ShapeStyle.reflectionAlignment`. */
|
|
1122
|
+
textReflectionAlignment?: 'tl' | 't' | 'tr' | 'l' | 'ctr' | 'r' | 'bl' | 'b' | 'br';
|
|
1123
|
+
/** 3D extrusion/bevel settings on the text body. */
|
|
1124
|
+
text3d?: Text3DStyle;
|
|
1125
|
+
/** 3D scene (camera + light rig) settings on the text body (`a:bodyPr/a:scene3d`). */
|
|
1126
|
+
textBodyScene3d?: Pptx3DScene;
|
|
1127
|
+
/** Raw `a:scene3d` subtree used to preserve extensions and unmodelled children. */
|
|
1128
|
+
textBodyScene3dXml?: XmlObject;
|
|
1129
|
+
/**
|
|
1130
|
+
* `a:bodyPr/a:flatTx` - an explicit "render this text flat" marker. `sp3d`
|
|
1131
|
+
* and `flatTx` are a mutually exclusive OOXML choice (`EG_Text3D`), so a
|
|
1132
|
+
* shape/run that overrides an inherited 3D text body with `<a:flatTx/>`
|
|
1133
|
+
* carries no `text3d` of its own; without this explicit flag a later
|
|
1134
|
+
* inheritance merge has no signal to stop `text3d`/`textBodyScene3d` from
|
|
1135
|
+
* an ancestor (layout/master) leaking back in, the way `noFill` stops an
|
|
1136
|
+
* inherited fill. A renderer must short-circuit 3D-text application
|
|
1137
|
+
* whenever this is `true`, regardless of what `text3d`/`textBodyScene3d`
|
|
1138
|
+
* otherwise hold.
|
|
1139
|
+
*/
|
|
1140
|
+
flatText?: boolean;
|
|
1141
|
+
/**
|
|
1142
|
+
* Raw `<a:extLst>` subtree captured from `<a:bodyPr>`. Preserved verbatim so
|
|
1143
|
+
* authored extensions (e.g. content placeholders, custom application data)
|
|
1144
|
+
* survive a round-trip even though the engine doesn't interpret them.
|
|
1145
|
+
*/
|
|
1146
|
+
bodyPropertiesExtLstXml?: XmlObject;
|
|
1147
|
+
/**
|
|
1148
|
+
* Raw `<a:extLst>` subtree captured from `<a:pPr>`. Only meaningful on the
|
|
1149
|
+
* paragraph-level style (paragraphs propagate this via the first segment).
|
|
1150
|
+
*/
|
|
1151
|
+
paragraphPropertiesExtLstXml?: XmlObject;
|
|
1152
|
+
/**
|
|
1153
|
+
* Raw `<a:extLst>` subtree captured from `<a:rPr>`. Persisted verbatim on
|
|
1154
|
+
* save when present — covers run-level extensions the typed model doesn't
|
|
1155
|
+
* model (e.g. `a14:hiddenFill` and similar).
|
|
1156
|
+
*/
|
|
1157
|
+
runPropertiesExtLstXml?: XmlObject;
|
|
1158
|
+
/**
|
|
1159
|
+
* Raw `<a:defRPr>` XML node captured from `<a:pPr>`. The schema permits
|
|
1160
|
+
* `defRPr` directly inside `pPr` so that paragraph defaults can specify the
|
|
1161
|
+
* end-paragraph run formatting; previously this was dropped on save. We
|
|
1162
|
+
* persist the parsed XML object so it round-trips verbatim.
|
|
1163
|
+
*
|
|
1164
|
+
* Only meaningful on the *first* segment of each paragraph (matches the
|
|
1165
|
+
* convention used for {@link bulletInfo} / {@link endParaRunProperties}).
|
|
1166
|
+
*/
|
|
1167
|
+
paragraphDefaultRunPropertiesXml?: XmlObject;
|
|
1168
|
+
/**
|
|
1169
|
+
* The bullet colour / size / typeface children (`a:buClrTx`, `a:buClr`,
|
|
1170
|
+
* `a:buSzTx`, `a:buSzPct`, `a:buSzPts`, `a:buFontTx`, `a:buFont`) a
|
|
1171
|
+
* paragraph authored in its own `<a:pPr>` WITHOUT a bullet type
|
|
1172
|
+
* (`a:buNone` / `a:buChar` / `a:buAutoNum` / `a:buBlip`), captured
|
|
1173
|
+
* verbatim in source order. Such a paragraph restyles an inherited bullet
|
|
1174
|
+
* rather than declaring one, so its {@link BulletInfo} resolves from the
|
|
1175
|
+
* cascade and is (correctly) not written back; without this capture the
|
|
1176
|
+
* paragraph's own override vanished on every rewrite.
|
|
1177
|
+
*
|
|
1178
|
+
* Only meaningful on a paragraph's own authored properties.
|
|
1179
|
+
*/
|
|
1180
|
+
paragraphBulletPropertiesXml?: XmlObject;
|
|
1181
|
+
}
|
|
1182
|
+
/**
|
|
1183
|
+
* Structured bullet metadata attached to the first {@link TextSegment}
|
|
1184
|
+
* of each paragraph.
|
|
1185
|
+
*
|
|
1186
|
+
* Describes how the paragraph bullet should render: character bullets
|
|
1187
|
+
* (`char`), auto-numbered lists (`autoNumType`), or picture bullets
|
|
1188
|
+
* (`imageRelId` / `imageDataUrl`). Set `none: true` when `a:buNone`
|
|
1189
|
+
* explicitly suppresses the bullet.
|
|
1190
|
+
*
|
|
1191
|
+
* @example
|
|
1192
|
+
* ```ts
|
|
1193
|
+
* // Simple character bullet:
|
|
1194
|
+
* const bullet: BulletInfo = { char: "•", color: "#333333" };
|
|
1195
|
+
*
|
|
1196
|
+
* // Auto-numbered list starting at 1:
|
|
1197
|
+
* const numbered: BulletInfo = {
|
|
1198
|
+
* autoNumType: "arabicPeriod",
|
|
1199
|
+
* autoNumStartAt: 1,
|
|
1200
|
+
* };
|
|
1201
|
+
* // => { char: "•", color: "#333333" } and { autoNumType: "arabicPeriod", autoNumStartAt: 1 }
|
|
1202
|
+
* ```
|
|
1203
|
+
*/
|
|
1204
|
+
interface BulletInfo {
|
|
1205
|
+
/** Bullet character (e.g. "•", "-", "»") from `a:buChar`. */
|
|
1206
|
+
char?: string;
|
|
1207
|
+
/** Auto-numbering type (e.g. "arabicPeriod", "romanUcPeriod") from `a:buAutoNum`. */
|
|
1208
|
+
autoNumType?: string;
|
|
1209
|
+
/** Auto-numbering start value. */
|
|
1210
|
+
autoNumStartAt?: number;
|
|
1211
|
+
/**
|
|
1212
|
+
* Auto-numbering ORDINAL OFFSET: the zero-based distance of this paragraph
|
|
1213
|
+
* within its own numbered list, such that
|
|
1214
|
+
* `autoNumStartAt + paragraphIndex` is the ordinal to render. Despite the
|
|
1215
|
+
* name it is NOT the paragraph's position in the text body; the two agree
|
|
1216
|
+
* only for a list that starts at the first paragraph and is never
|
|
1217
|
+
* interrupted.
|
|
1218
|
+
*
|
|
1219
|
+
* It has to be the offset rather than the raw position because every
|
|
1220
|
+
* consumer that re-derives a marker from `BulletInfo` alone (the renderer's
|
|
1221
|
+
* `resolveParagraphBullet`, the Markdown converter's `resolveListMarker`)
|
|
1222
|
+
* computes `autoNumStartAt + paragraphIndex`. The load path resolves the
|
|
1223
|
+
* real sequence itself, restarting the count after any paragraph that
|
|
1224
|
+
* interrupts the list, and publishes the offset here so those consumers
|
|
1225
|
+
* land on the same number. With the raw position they did not, and BOTH
|
|
1226
|
+
* markers were painted ("3.1. Item"), because the paragraph builder drops
|
|
1227
|
+
* the parsed marker segment only when the two strings agree.
|
|
1228
|
+
*
|
|
1229
|
+
* Runtime-only: derived at parse time and never serialized. OOXML has no
|
|
1230
|
+
* counterpart (`a:buAutoNum` carries only `@type` and `@startAt`), so the
|
|
1231
|
+
* writer neither reads nor emits it.
|
|
1232
|
+
*/
|
|
1233
|
+
paragraphIndex?: number;
|
|
1234
|
+
/** Bullet font family from `a:buFont`. */
|
|
1235
|
+
fontFamily?: string;
|
|
1236
|
+
/**
|
|
1237
|
+
* PANOSE font-matching hint from `a:buFont/@panose`. `a:buFont` is a
|
|
1238
|
+
* CT_TextFont, the same complex type as `a:latin`/`a:ea`/`a:cs`/`a:sym`
|
|
1239
|
+
* (which carry the equivalent `TextStyle.latinFontPanose` etc.), so a
|
|
1240
|
+
* bullet's own PANOSE/pitch-family/charset decide the fallback glyph
|
|
1241
|
+
* PowerPoint substitutes when the named typeface is missing.
|
|
1242
|
+
*/
|
|
1243
|
+
fontPanose?: string;
|
|
1244
|
+
/** Font pitch-and-family byte from `a:buFont/@pitchFamily`. */
|
|
1245
|
+
fontPitchFamily?: number;
|
|
1246
|
+
/** Font character-set byte from `a:buFont/@charset`. */
|
|
1247
|
+
fontCharset?: number;
|
|
1248
|
+
/** Bullet size as percentage of text font size from `a:buSzPct`. */
|
|
1249
|
+
sizePercent?: number;
|
|
1250
|
+
/** Bullet size in points from `a:buSzPts`. */
|
|
1251
|
+
sizePts?: number;
|
|
1252
|
+
/** Bullet color as hex string from `a:buClr`. */
|
|
1253
|
+
color?: string;
|
|
1254
|
+
/**
|
|
1255
|
+
* Raw colour-choice XML captured from `<a:buClr>` so that themed bullets
|
|
1256
|
+
* (`a:schemeClr`, `a:sysClr`, `a:prstClr`) round-trip with their original
|
|
1257
|
+
* identity rather than being flattened to `<a:srgbClr/>` on save.
|
|
1258
|
+
*/
|
|
1259
|
+
colorXml?: XmlObject;
|
|
1260
|
+
/**
|
|
1261
|
+
* Typed theme colour reference for the bullet colour, set when
|
|
1262
|
+
* {@link colorXml} is a plain `a:schemeClr`. Wins on save, same as
|
|
1263
|
+
* {@link TextStyle.colorRef}.
|
|
1264
|
+
*/
|
|
1265
|
+
colorRef?: PptxThemeColorRef;
|
|
1266
|
+
/** True when `a:buNone` explicitly suppresses bullets. */
|
|
1267
|
+
none?: boolean;
|
|
1268
|
+
/** Picture bullet: relationship ID from `a:buBlip` → `a:blip[@r:embed]`. */
|
|
1269
|
+
imageRelId?: string;
|
|
1270
|
+
/** Picture bullet: data URL of the embedded image. */
|
|
1271
|
+
imageDataUrl?: string;
|
|
1272
|
+
/**
|
|
1273
|
+
* Raw `<a:buBlip>` XML captured at parse time. Carries the full blipFill
|
|
1274
|
+
* subtree (`a:tile`, `a:stretch`, `a:srcRect`, `a:blip > a:extLst`) so the
|
|
1275
|
+
* writer can emit the complete original definition rather than the bare
|
|
1276
|
+
* `a:blip[@r:embed]` mapping. When set, the writer prefers it over
|
|
1277
|
+
* {@link imageRelId} for emission.
|
|
1278
|
+
*/
|
|
1279
|
+
imageBlipFillXml?: XmlObject;
|
|
1280
|
+
/** When true, `<a:buFontTx/>` was specified — inherit the bullet font from
|
|
1281
|
+
* the run text, not from a buFont declaration. */
|
|
1282
|
+
fontInherit?: boolean;
|
|
1283
|
+
/** When true, `<a:buClrTx/>` was specified — inherit the bullet colour from
|
|
1284
|
+
* the run text. */
|
|
1285
|
+
colorInherit?: boolean;
|
|
1286
|
+
/** When true, `<a:buSzTx/>` was specified — inherit the bullet size from
|
|
1287
|
+
* the run text font size. */
|
|
1288
|
+
sizeInherit?: boolean;
|
|
1289
|
+
/**
|
|
1290
|
+
* True when this bullet resolution came from the paragraph's OWN `a:pPr`
|
|
1291
|
+
* rather than the shape's `a:lstStyle`, an inherited placeholder, or the
|
|
1292
|
+
* master's `a:defPPr` / `p:txStyles`. `resolveParagraphBulletInfo` walks
|
|
1293
|
+
* that cascade and returns the first match, so without this flag a
|
|
1294
|
+
* writer that re-emits every resolved `BulletInfo` in full pins an
|
|
1295
|
+
* inherited bullet (e.g. a master `buFont="Arial"` / `buChar="•"`) onto
|
|
1296
|
+
* every paragraph's own `a:pPr` the moment the slide is rewritten. The
|
|
1297
|
+
* save path only writes the bullet group when this is `true`, mirroring
|
|
1298
|
+
* how `paragraphProperties` gates every other per-paragraph field.
|
|
1299
|
+
*/
|
|
1300
|
+
ownedByParagraph?: boolean;
|
|
1301
|
+
}
|
|
1302
|
+
/**
|
|
1303
|
+
* A single text run within a paragraph.
|
|
1304
|
+
*
|
|
1305
|
+
* A text body is decomposed into an array of `TextSegment` objects,
|
|
1306
|
+
* each with its own style. Paragraph breaks are represented as
|
|
1307
|
+
* segments with `isParagraphBreak: true`.
|
|
1308
|
+
*
|
|
1309
|
+
* @example
|
|
1310
|
+
* ```ts
|
|
1311
|
+
* const segments: TextSegment[] = [
|
|
1312
|
+
* { text: "Bold intro ", style: { bold: true, fontSize: 16 } },
|
|
1313
|
+
* { text: "and normal text.", style: { fontSize: 16 } },
|
|
1314
|
+
* { text: "", style: {}, isParagraphBreak: true },
|
|
1315
|
+
* { text: "Second paragraph.", style: { fontSize: 14 } },
|
|
1316
|
+
* ];
|
|
1317
|
+
* // => 4 segments: 2 styled runs, 1 paragraph break, 1 normal run
|
|
1318
|
+
* ```
|
|
1319
|
+
*/
|
|
1320
|
+
interface TextSegment {
|
|
1321
|
+
text: string;
|
|
1322
|
+
style: TextStyle;
|
|
1323
|
+
/** When this segment originated from an `a:fld` element, stores the field type (e.g. "slidenum", "datetime"). */
|
|
1324
|
+
fieldType?: string;
|
|
1325
|
+
/** When this segment originated from an `a:fld` element, stores the field GUID. */
|
|
1326
|
+
fieldGuid?: string;
|
|
1327
|
+
/**
|
|
1328
|
+
* Original attribute name used to author the field GUID — `'uuid'` for the
|
|
1329
|
+
* `a:fld/@uuid` form authored by some legacy producers, `'id'` for the
|
|
1330
|
+
* canonical `a:fld/@id` form. Preserved so the writer round-trips whichever
|
|
1331
|
+
* spelling the source used (PowerPoint accepts both). Defaults to `'id'`
|
|
1332
|
+
* on save when undefined.
|
|
1333
|
+
*/
|
|
1334
|
+
fieldGuidAttr?: 'uuid' | 'id';
|
|
1335
|
+
/**
|
|
1336
|
+
* Raw per-field paragraph properties (`a:fld > a:pPr`). The schema permits
|
|
1337
|
+
* `pPr` inside an `a:fld` so the field can carry its own paragraph-level
|
|
1338
|
+
* formatting; preserved verbatim on save when present.
|
|
1339
|
+
*/
|
|
1340
|
+
fieldParagraphPropertiesXml?: XmlObject;
|
|
1341
|
+
/** Raw OMML XML node for equation segments (from `a14:m` / `m:oMathPara`). */
|
|
1342
|
+
equationXml?: Record<string, unknown>;
|
|
1343
|
+
/**
|
|
1344
|
+
* The ORIGINAL top-level paragraph child that carried this equation,
|
|
1345
|
+
* captured verbatim at parse time and keyed by its own tag: `{ 'a14:m':
|
|
1346
|
+
* ... }`, `{ 'm:oMathPara': ... }`, `{ 'm:oMath': ... }`, or `{
|
|
1347
|
+
* 'mc:AlternateContent': ... }` for an equation authored behind a
|
|
1348
|
+
* Choice/Fallback switch. `equationXml` above is the resolved math content
|
|
1349
|
+
* used for rendering (unwrapped one level for `a14:m`/`mc:AlternateContent`
|
|
1350
|
+
* sources); this field exists solely so the writer can re-emit an UNTOUCHED
|
|
1351
|
+
* equation byte-for-byte, Choice and Fallback both, instead of collapsing
|
|
1352
|
+
* it to a bare math element PowerPoint's own writer never produces.
|
|
1353
|
+
* `undefined` for a freshly inserted or edited equation, which the writer
|
|
1354
|
+
* instead reconstructs from `equationXml` (always `{ 'm:oMathPara': ... }`
|
|
1355
|
+
* or `{ 'm:oMath': ... }` for those cases). Any code that replaces
|
|
1356
|
+
* `equationXml` on an existing segment must drop this field, or the writer
|
|
1357
|
+
* would keep re-emitting the equation's OLD XML instead of the edit.
|
|
1358
|
+
*/
|
|
1359
|
+
equationSourceXml?: Record<string, unknown>;
|
|
1360
|
+
/**
|
|
1361
|
+
* Optional equation number for numbered equations (e.g. "(1)", "(2.3)").
|
|
1362
|
+
* When present, the equation is rendered centered with the number right-aligned.
|
|
1363
|
+
*/
|
|
1364
|
+
equationNumber?: string;
|
|
1365
|
+
/** Whether this segment represents a paragraph break rather than renderable text. */
|
|
1366
|
+
isParagraphBreak?: boolean;
|
|
1367
|
+
/**
|
|
1368
|
+
* Whether this segment represents a soft line break (`a:br`) rather than
|
|
1369
|
+
* a paragraph terminator. Soft line breaks remain inside the same paragraph
|
|
1370
|
+
* but force a line wrap and may carry their own run properties.
|
|
1371
|
+
*
|
|
1372
|
+
* The renderer should treat the segment text as `"\n"` when present.
|
|
1373
|
+
*/
|
|
1374
|
+
isLineBreak?: true;
|
|
1375
|
+
/**
|
|
1376
|
+
* Raw `a:rPr` XML for an `a:br` (soft line break) segment, captured verbatim
|
|
1377
|
+
* during parse so the writer can re-emit attributes/colours/fonts that the
|
|
1378
|
+
* typed model doesn't represent. Only meaningful when {@link isLineBreak}
|
|
1379
|
+
* is `true`.
|
|
1380
|
+
*/
|
|
1381
|
+
breakRunProperties?: Record<string, unknown>;
|
|
1382
|
+
/** Structured bullet info for the first segment of a paragraph. */
|
|
1383
|
+
bulletInfo?: BulletInfo;
|
|
1384
|
+
/**
|
|
1385
|
+
* Outline level for the paragraph this segment starts (`a:p/@lvl`).
|
|
1386
|
+
*
|
|
1387
|
+
* Only meaningful on the first segment of a paragraph (matching the
|
|
1388
|
+
* convention used for {@link bulletInfo}). Stored as the raw OOXML
|
|
1389
|
+
* value (0 = top level, 1-8 = nested) and serialised back when non-zero.
|
|
1390
|
+
*/
|
|
1391
|
+
paragraphLevel?: number;
|
|
1392
|
+
/**
|
|
1393
|
+
* Raw `a:endParaRPr` XML node for the paragraph this segment starts.
|
|
1394
|
+
*
|
|
1395
|
+
* Captured verbatim on parse so attributes and child colours/fonts that
|
|
1396
|
+
* the typed model doesn't represent survive a round-trip. Only meaningful
|
|
1397
|
+
* on the first segment of a paragraph.
|
|
1398
|
+
*/
|
|
1399
|
+
endParaRunProperties?: Record<string, unknown>;
|
|
1400
|
+
/**
|
|
1401
|
+
* Resolved body defaults and optional `a:endParaRPr` of a runless paragraph.
|
|
1402
|
+
* Carried on its first segment (or terminator), separately from marker
|
|
1403
|
+
* styling. Absent when the source contains an authored run or field.
|
|
1404
|
+
*/
|
|
1405
|
+
paragraphInsertionStyle?: TextStyle;
|
|
1406
|
+
/**
|
|
1407
|
+
* Per-paragraph properties (alignment, spacing, margins, indent, tab stops,
|
|
1408
|
+
* rtl) authored on this paragraph's own `a:pPr` (#69). Only meaningful on
|
|
1409
|
+
* the first segment of a paragraph. When present, the writer emits these
|
|
1410
|
+
* per paragraph instead of collapsing one shape-level pPr onto every
|
|
1411
|
+
* paragraph. Only the paragraph-geometry keys of {@link TextStyle} are
|
|
1412
|
+
* populated; unrelated fields fall back to the shape-level style.
|
|
1413
|
+
*/
|
|
1414
|
+
paragraphProperties?: TextStyle;
|
|
1415
|
+
/**
|
|
1416
|
+
* The paragraph this segment starts authored an EMPTY `<a:pPr/>`. Only
|
|
1417
|
+
* meaningful on the first segment of a paragraph. The writer re-emits the
|
|
1418
|
+
* empty element when it has no paragraph property of its own to write, so
|
|
1419
|
+
* a rewritten slide keeps the markup PowerPoint wrote.
|
|
1420
|
+
*/
|
|
1421
|
+
emptyParagraphPropertiesAuthored?: boolean;
|
|
1422
|
+
/**
|
|
1423
|
+
* The paragraph this segment starts has no run content and authored no
|
|
1424
|
+
* `a:endParaRPr` (a bare `<a:p/>`, possibly with an `a:pPr`). Only
|
|
1425
|
+
* meaningful on the first segment of a paragraph. It stops the writer
|
|
1426
|
+
* inventing an empty run or an `<a:endParaRPr lang="en-US"/>` stub for a
|
|
1427
|
+
* paragraph that still has no content when saved.
|
|
1428
|
+
*/
|
|
1429
|
+
bareParagraph?: boolean;
|
|
1430
|
+
/**
|
|
1431
|
+
* Phonetic annotation text from `a:ruby > a:rt` (e.g. furigana, pinyin).
|
|
1432
|
+
* When present, the renderer should wrap the base text with an HTML `<ruby>` tag.
|
|
1433
|
+
*/
|
|
1434
|
+
rubyText?: string;
|
|
1435
|
+
/**
|
|
1436
|
+
* Ruby text alignment from `a:rubyPr > @val` attribute.
|
|
1437
|
+
* Values: "ctr" (center), "l" (left), "r" (right), "dist" (distribute), "distCat", "distLetter".
|
|
1438
|
+
* @default "ctr"
|
|
1439
|
+
*/
|
|
1440
|
+
rubyAlignment?: string;
|
|
1441
|
+
/**
|
|
1442
|
+
* Ruby text font size as a percentage of the base text font size
|
|
1443
|
+
* from `a:rubyPr/@hps` (half-point size) or inferred from rt run font size.
|
|
1444
|
+
* Stored in **points** for consistency with `TextStyle.fontSize`.
|
|
1445
|
+
*/
|
|
1446
|
+
rubyFontSize?: number;
|
|
1447
|
+
/**
|
|
1448
|
+
* Style for the ruby (phonetic) text run, parsed from `a:rt > a:r > a:rPr`.
|
|
1449
|
+
* Used by the renderer to apply font family, colour, etc. to the `<rt>` element.
|
|
1450
|
+
*/
|
|
1451
|
+
rubyStyle?: TextStyle;
|
|
1452
|
+
/**
|
|
1453
|
+
* The parsed `a:rubyPr` node, kept verbatim so its attributes (`hps`,
|
|
1454
|
+
* `hpsRaise`, `hpsBaseText`, `lid`, ...) round-trip exactly; only an
|
|
1455
|
+
* edited {@link rubyAlignment} is written over it on save.
|
|
1456
|
+
*/
|
|
1457
|
+
rubyPropertiesXml?: XmlObject;
|
|
1458
|
+
/**
|
|
1459
|
+
* What each of a ruby run's two base-side `a:rPr`s authored on its own:
|
|
1460
|
+
* `outer` is the containing `a:r`'s, `base` the `a:rubyBase` run's. The
|
|
1461
|
+
* flat {@link style} merges both for rendering; these let the writer give
|
|
1462
|
+
* each `a:rPr` back only its own properties (plus any later edit).
|
|
1463
|
+
*/
|
|
1464
|
+
rubyRunAuthoredStyles?: {
|
|
1465
|
+
outer?: TextStyle;
|
|
1466
|
+
base?: TextStyle;
|
|
1467
|
+
};
|
|
1468
|
+
}
|
|
1469
|
+
//#endregion
|
|
1470
|
+
//#region pptx/core/types/geometry.d.ts
|
|
1471
|
+
/**
|
|
1472
|
+
* Geometry types: adjustment handles, custom geometry points, segments,
|
|
1473
|
+
* paths, and custom path properties.
|
|
1474
|
+
*
|
|
1475
|
+
* @module pptx-types/geometry
|
|
1476
|
+
*/
|
|
1477
|
+
/**
|
|
1478
|
+
* Defines an adjustment handle position for a shape geometry.
|
|
1479
|
+
*
|
|
1480
|
+
* Adjustment handles allow users to interactively reshape preset shapes
|
|
1481
|
+
* (e.g. rounding a rectangle corner or adjusting arrow head width).
|
|
1482
|
+
*
|
|
1483
|
+
* @example
|
|
1484
|
+
* ```ts
|
|
1485
|
+
* const handle: GeometryAdjustmentHandle = {
|
|
1486
|
+
* guideName: "adj",
|
|
1487
|
+
* xFraction: 0.25,
|
|
1488
|
+
* minValue: 0,
|
|
1489
|
+
* maxValue: 50000,
|
|
1490
|
+
* };
|
|
1491
|
+
* // => satisfies GeometryAdjustmentHandle
|
|
1492
|
+
* ```
|
|
1493
|
+
*/
|
|
1494
|
+
interface GeometryAdjustmentHandle {
|
|
1495
|
+
/** Name of the adjustment guide this handle controls (e.g. "adj", "adj1"). */
|
|
1496
|
+
guideName: string;
|
|
1497
|
+
/** X position as a fraction of shape width (0..1), or undefined if the handle only moves vertically. */
|
|
1498
|
+
xFraction?: number;
|
|
1499
|
+
/** Y position as a fraction of shape height (0..1), or undefined if the handle only moves horizontally. */
|
|
1500
|
+
yFraction?: number;
|
|
1501
|
+
/** Minimum allowed value for the adjustment guide. */
|
|
1502
|
+
minValue?: number;
|
|
1503
|
+
/** Maximum allowed value for the adjustment guide. */
|
|
1504
|
+
maxValue?: number;
|
|
1505
|
+
}
|
|
1506
|
+
/**
|
|
1507
|
+
* A single point in a custom geometry path.
|
|
1508
|
+
*
|
|
1509
|
+
* @example
|
|
1510
|
+
* ```ts
|
|
1511
|
+
* const pt: CustomGeometryPoint = { x: 100, y: 200 };
|
|
1512
|
+
* // => satisfies CustomGeometryPoint
|
|
1513
|
+
* ```
|
|
1514
|
+
*/
|
|
1515
|
+
interface CustomGeometryPoint {
|
|
1516
|
+
x: number;
|
|
1517
|
+
y: number;
|
|
1518
|
+
}
|
|
1519
|
+
/**
|
|
1520
|
+
* A segment within a custom geometry path.
|
|
1521
|
+
*
|
|
1522
|
+
* Discriminated union over `type` — can be a moveTo, lineTo,
|
|
1523
|
+
* cubic Bézier, quadratic Bézier, or close command.
|
|
1524
|
+
*
|
|
1525
|
+
* @example
|
|
1526
|
+
* ```ts
|
|
1527
|
+
* const segments: CustomGeometrySegment[] = [
|
|
1528
|
+
* { type: "moveTo", pt: { x: 0, y: 0 } },
|
|
1529
|
+
* { type: "lineTo", pt: { x: 100, y: 0 } },
|
|
1530
|
+
* { type: "lineTo", pt: { x: 100, y: 100 } },
|
|
1531
|
+
* { type: "close" },
|
|
1532
|
+
* ];
|
|
1533
|
+
* // => satisfies CustomGeometrySegment[]
|
|
1534
|
+
* ```
|
|
1535
|
+
*/
|
|
1536
|
+
type CustomGeometrySegment = {
|
|
1537
|
+
type: 'moveTo';
|
|
1538
|
+
pt: CustomGeometryPoint;
|
|
1539
|
+
} | {
|
|
1540
|
+
type: 'lineTo';
|
|
1541
|
+
pt: CustomGeometryPoint;
|
|
1542
|
+
} | {
|
|
1543
|
+
type: 'cubicBezTo';
|
|
1544
|
+
pts: [CustomGeometryPoint, CustomGeometryPoint, CustomGeometryPoint];
|
|
1545
|
+
} | {
|
|
1546
|
+
type: 'quadBezTo';
|
|
1547
|
+
pts: [CustomGeometryPoint, CustomGeometryPoint];
|
|
1548
|
+
} | {
|
|
1549
|
+
type: 'arcTo';
|
|
1550
|
+
/** Horizontal radius of the ellipse. */
|
|
1551
|
+
wR: number;
|
|
1552
|
+
/** Vertical radius of the ellipse. */
|
|
1553
|
+
hR: number;
|
|
1554
|
+
/** Start angle in 60000ths of a degree. */
|
|
1555
|
+
stAng: number;
|
|
1556
|
+
/** Sweep angle in 60000ths of a degree. */
|
|
1557
|
+
swAng: number;
|
|
1558
|
+
} | {
|
|
1559
|
+
type: 'close';
|
|
1560
|
+
};
|
|
1561
|
+
/**
|
|
1562
|
+
* A single sub-path in a custom geometry definition (maps to one `a:path`).
|
|
1563
|
+
*
|
|
1564
|
+
* @example
|
|
1565
|
+
* ```ts
|
|
1566
|
+
* const path: CustomGeometryPath = {
|
|
1567
|
+
* width: 100,
|
|
1568
|
+
* height: 100,
|
|
1569
|
+
* segments: [
|
|
1570
|
+
* { type: "moveTo", pt: { x: 0, y: 0 } },
|
|
1571
|
+
* { type: "lineTo", pt: { x: 100, y: 100 } },
|
|
1572
|
+
* ],
|
|
1573
|
+
* };
|
|
1574
|
+
* // => satisfies CustomGeometryPath
|
|
1575
|
+
* ```
|
|
1576
|
+
*/
|
|
1577
|
+
interface CustomGeometryPath {
|
|
1578
|
+
/** Coordinate-space width for this sub-path. */
|
|
1579
|
+
width: number;
|
|
1580
|
+
/** Coordinate-space height for this sub-path. */
|
|
1581
|
+
height: number;
|
|
1582
|
+
/** Ordered list of drawing segments. */
|
|
1583
|
+
segments: CustomGeometrySegment[];
|
|
1584
|
+
/** Path fill mode (`a:path/@fill`): norm, lighten, lightenLess, darken, darkenLess, none. */
|
|
1585
|
+
fillMode?: 'norm' | 'lighten' | 'lightenLess' | 'darken' | 'darkenLess' | 'none';
|
|
1586
|
+
/** Whether the path is stroked (`a:path/@stroke`). */
|
|
1587
|
+
stroke?: boolean;
|
|
1588
|
+
/** 3D extrusion compatibility (`a:path/@extrusionOk`). */
|
|
1589
|
+
extrusionOk?: boolean;
|
|
1590
|
+
}
|
|
1591
|
+
/**
|
|
1592
|
+
* Auxiliary raw XML preserved from `a:custGeom` for round-trip serialization.
|
|
1593
|
+
* These are stored opaquely so adjustment guides, handles, connection sites,
|
|
1594
|
+
* and the text rectangle are not lost when a custGeom is edited and saved.
|
|
1595
|
+
*/
|
|
1596
|
+
interface CustomGeometryRawData {
|
|
1597
|
+
/** Raw `a:avLst` XML content (adjustment value list). */
|
|
1598
|
+
avLstXml?: unknown;
|
|
1599
|
+
/** Raw `a:gdLst` XML content (guide list). */
|
|
1600
|
+
gdLstXml?: unknown;
|
|
1601
|
+
/** Raw `a:ahLst` XML content (adjustment handles). */
|
|
1602
|
+
ahLstXml?: unknown;
|
|
1603
|
+
/** Raw `a:cxnLst` XML content (connection sites). */
|
|
1604
|
+
cxnLstXml?: unknown;
|
|
1605
|
+
/** Raw `a:rect` XML content (text rectangle). */
|
|
1606
|
+
rectXml?: unknown;
|
|
1607
|
+
/**
|
|
1608
|
+
* Raw `a:pathLst` XML content: every `a:path`'s formula-bearing `a:pt`
|
|
1609
|
+
* x/y attributes, `a:arcTo` params, `a:close`, and per-path `@w`/`@h`/
|
|
1610
|
+
* `@fill`/`@stroke`/`@extrusionOk`, preserved verbatim (not the
|
|
1611
|
+
* parse-time-resolved numbers in `customGeometryPaths`). Lets a live
|
|
1612
|
+
* `shapeAdjustments` drag re-evaluate the outline against the CURRENT
|
|
1613
|
+
* guide values instead of the ones baked in at parse time; see
|
|
1614
|
+
* `geometry/custom-geometry-live-eval.ts`.
|
|
1615
|
+
*/
|
|
1616
|
+
pathLstXml?: unknown;
|
|
1617
|
+
}
|
|
1618
|
+
/**
|
|
1619
|
+
* XY-style adjustment handle (`a:ahXY`) on a custom geometry.
|
|
1620
|
+
*
|
|
1621
|
+
* Allows interactive editing of one or two guide values constrained to a
|
|
1622
|
+
* rectangular range. Coordinates are formula references (e.g. `"adj1"`,
|
|
1623
|
+
* `"w/2"`, `"0"`) preserved verbatim so they can re-emit unchanged.
|
|
1624
|
+
*
|
|
1625
|
+
* @example
|
|
1626
|
+
* ```ts
|
|
1627
|
+
* const handle: AdjustHandleXY = {
|
|
1628
|
+
* gdRefX: "adj1",
|
|
1629
|
+
* minX: "0",
|
|
1630
|
+
* maxX: "w",
|
|
1631
|
+
* posX: "adj1",
|
|
1632
|
+
* posY: "h/2",
|
|
1633
|
+
* };
|
|
1634
|
+
* // => satisfies AdjustHandleXY
|
|
1635
|
+
* ```
|
|
1636
|
+
*/
|
|
1637
|
+
interface AdjustHandleXY {
|
|
1638
|
+
/** Guide reference for the X axis (`@_gdRefX`). */
|
|
1639
|
+
gdRefX?: string;
|
|
1640
|
+
/** Guide reference for the Y axis (`@_gdRefY`). */
|
|
1641
|
+
gdRefY?: string;
|
|
1642
|
+
/** Minimum X value, as a formula reference (`@_minX`). */
|
|
1643
|
+
minX?: string;
|
|
1644
|
+
/** Maximum X value (`@_maxX`). */
|
|
1645
|
+
maxX?: string;
|
|
1646
|
+
/** Minimum Y value (`@_minY`). */
|
|
1647
|
+
minY?: string;
|
|
1648
|
+
/** Maximum Y value (`@_maxY`). */
|
|
1649
|
+
maxY?: string;
|
|
1650
|
+
/** Handle position X (formula or literal) from `a:pos/@_x`. */
|
|
1651
|
+
posX?: string;
|
|
1652
|
+
/** Handle position Y from `a:pos/@_y`. */
|
|
1653
|
+
posY?: string;
|
|
1654
|
+
}
|
|
1655
|
+
/**
|
|
1656
|
+
* Polar-style adjustment handle (`a:ahPolar`) on a custom geometry.
|
|
1657
|
+
*
|
|
1658
|
+
* Drives a guide via radial distance and angle rather than XY coordinates.
|
|
1659
|
+
*
|
|
1660
|
+
* @example
|
|
1661
|
+
* ```ts
|
|
1662
|
+
* const handle: AdjustHandlePolar = {
|
|
1663
|
+
* gdRefR: "adj1",
|
|
1664
|
+
* gdRefAng: "adj2",
|
|
1665
|
+
* posX: "wd2",
|
|
1666
|
+
* posY: "hd2",
|
|
1667
|
+
* };
|
|
1668
|
+
* // => satisfies AdjustHandlePolar
|
|
1669
|
+
* ```
|
|
1670
|
+
*/
|
|
1671
|
+
interface AdjustHandlePolar {
|
|
1672
|
+
/** Guide reference for the radial distance (`@_gdRefR`). */
|
|
1673
|
+
gdRefR?: string;
|
|
1674
|
+
/** Guide reference for the angle (`@_gdRefAng`). */
|
|
1675
|
+
gdRefAng?: string;
|
|
1676
|
+
/** Minimum radial value (`@_minR`). */
|
|
1677
|
+
minR?: string;
|
|
1678
|
+
/** Maximum radial value (`@_maxR`). */
|
|
1679
|
+
maxR?: string;
|
|
1680
|
+
/** Minimum angle (`@_minAng`). */
|
|
1681
|
+
minAng?: string;
|
|
1682
|
+
/** Maximum angle (`@_maxAng`). */
|
|
1683
|
+
maxAng?: string;
|
|
1684
|
+
/** Handle position X from `a:pos/@_x`. */
|
|
1685
|
+
posX?: string;
|
|
1686
|
+
/** Handle position Y from `a:pos/@_y`. */
|
|
1687
|
+
posY?: string;
|
|
1688
|
+
}
|
|
1689
|
+
/**
|
|
1690
|
+
* Connection site (`a:cxn`) on a custom geometry.
|
|
1691
|
+
*
|
|
1692
|
+
* Defines a point on a custom shape that connectors may snap to.
|
|
1693
|
+
*
|
|
1694
|
+
* @example
|
|
1695
|
+
* ```ts
|
|
1696
|
+
* const cxn: ConnectionSite = { ang: "0", posX: "0", posY: "hd2" };
|
|
1697
|
+
* // => satisfies ConnectionSite
|
|
1698
|
+
* ```
|
|
1699
|
+
*/
|
|
1700
|
+
interface ConnectionSite {
|
|
1701
|
+
/** Approach angle (`@_ang`) — formula or literal degree-1/60000 value. */
|
|
1702
|
+
ang?: string;
|
|
1703
|
+
/** Site position X from `a:pos/@_x`. */
|
|
1704
|
+
posX?: string;
|
|
1705
|
+
/** Site position Y from `a:pos/@_y`. */
|
|
1706
|
+
posY?: string;
|
|
1707
|
+
}
|
|
1708
|
+
/**
|
|
1709
|
+
* Typed text rectangle (`a:rect`) on a custom geometry.
|
|
1710
|
+
*
|
|
1711
|
+
* Each edge is the formula or literal string preserved from the source XML
|
|
1712
|
+
* (`"l"`, `"t"`, `"r"`, `"b"`, or any guide name / formula).
|
|
1713
|
+
*/
|
|
1714
|
+
interface CustomGeometryTextRect {
|
|
1715
|
+
/** Left edge formula reference (`@_l`). */
|
|
1716
|
+
l?: string;
|
|
1717
|
+
/** Top edge (`@_t`). */
|
|
1718
|
+
t?: string;
|
|
1719
|
+
/** Right edge (`@_r`). */
|
|
1720
|
+
r?: string;
|
|
1721
|
+
/** Bottom edge (`@_b`). */
|
|
1722
|
+
b?: string;
|
|
1723
|
+
}
|
|
1724
|
+
/**
|
|
1725
|
+
* Custom (non-preset) geometry path — only on shapes and pictures.
|
|
1726
|
+
*
|
|
1727
|
+
* Contains SVG path data and/or structured custom geometry paths
|
|
1728
|
+
* parsed from `a:custGeom/a:pathLst`.
|
|
1729
|
+
*
|
|
1730
|
+
* @example
|
|
1731
|
+
* ```ts
|
|
1732
|
+
* const custom: PptxCustomPathProperties = {
|
|
1733
|
+
* pathData: "M 0 0 L 100 0 L 100 100 Z",
|
|
1734
|
+
* pathWidth: 100,
|
|
1735
|
+
* pathHeight: 100,
|
|
1736
|
+
* };
|
|
1737
|
+
* // => satisfies PptxCustomPathProperties
|
|
1738
|
+
* ```
|
|
1739
|
+
*/
|
|
1740
|
+
interface PptxCustomPathProperties {
|
|
1741
|
+
/** SVG path data for custom shapes. */
|
|
1742
|
+
pathData?: string;
|
|
1743
|
+
/** Coordinate-space width for the custom path. */
|
|
1744
|
+
pathWidth?: number;
|
|
1745
|
+
/** Coordinate-space height for the custom path. */
|
|
1746
|
+
pathHeight?: number;
|
|
1747
|
+
/** Structured custom geometry paths for editing (maps to a:custGeom/a:pathLst). */
|
|
1748
|
+
customGeometryPaths?: CustomGeometryPath[];
|
|
1749
|
+
/** Raw adjustment/guide/handle/connection/text-rectangle XML preserved for serialization. */
|
|
1750
|
+
customGeometryRawData?: CustomGeometryRawData;
|
|
1751
|
+
/**
|
|
1752
|
+
* Typed XY adjustment handles parsed from `a:custGeom/a:ahLst/a:ahXY`.
|
|
1753
|
+
* SDK-built shapes can populate this and the writer will emit `<a:ahXY>` entries
|
|
1754
|
+
* even when no raw XML was preserved.
|
|
1755
|
+
*/
|
|
1756
|
+
customGeometryAdjustHandlesXY?: AdjustHandleXY[];
|
|
1757
|
+
/**
|
|
1758
|
+
* Typed polar adjustment handles parsed from `a:custGeom/a:ahLst/a:ahPolar`.
|
|
1759
|
+
*/
|
|
1760
|
+
customGeometryAdjustHandlesPolar?: AdjustHandlePolar[];
|
|
1761
|
+
/**
|
|
1762
|
+
* Typed connection sites parsed from `a:custGeom/a:cxnLst/a:cxn`.
|
|
1763
|
+
*/
|
|
1764
|
+
customGeometryConnectionSites?: ConnectionSite[];
|
|
1765
|
+
/**
|
|
1766
|
+
* Typed text rectangle parsed from `a:custGeom/a:rect`. When present this is
|
|
1767
|
+
* preferred over {@link customGeometryRawData}'s `rectXml` on save.
|
|
1768
|
+
*/
|
|
1769
|
+
customGeometryTextRect?: CustomGeometryTextRect;
|
|
1770
|
+
}
|
|
1771
|
+
//#endregion
|
|
1772
|
+
//#region diagram/types.d.ts
|
|
1773
|
+
/** Resolved SmartArt layout family. */
|
|
1774
|
+
type DiagramLayoutType = 'list' | 'process' | 'cycle' | 'hierarchy' | 'relationship' | 'matrix' | 'pyramid' | 'funnel' | 'gear' | 'target' | 'timeline' | 'venn' | 'chevron' | 'bending' | 'unknown';
|
|
1775
|
+
/** SmartArt colour scheme presets. */
|
|
1776
|
+
type DiagramColorScheme = 'colorful1' | 'colorful2' | 'colorful3' | 'monochromatic1' | 'monochromatic2';
|
|
1777
|
+
/** SmartArt visual style intensity. */
|
|
1778
|
+
type DiagramStyleIntensity = 'flat' | 'moderate' | 'intense';
|
|
1779
|
+
/** A connection (`dgm:cxn`) between two data-model points. */
|
|
1780
|
+
interface DiagramConnection {
|
|
1781
|
+
/** Stable CT_Cxn model identifier. */
|
|
1782
|
+
modelId?: string | null;
|
|
1783
|
+
sourceId: string;
|
|
1784
|
+
destId: string;
|
|
1785
|
+
/** `parOf` (the schema default when omitted), `presOf`, `presParOf`, `unknownRelationship`. */
|
|
1786
|
+
type?: string;
|
|
1787
|
+
srcOrd?: number;
|
|
1788
|
+
destOrd?: number;
|
|
1789
|
+
/** Model ID of the parent transition point associated with this edge. */
|
|
1790
|
+
parentTransitionId?: string | null;
|
|
1791
|
+
/** Model ID of the sibling transition point associated with this edge. */
|
|
1792
|
+
siblingTransitionId?: string | null;
|
|
1793
|
+
/** Layout presentation identifier used by presentation connections. */
|
|
1794
|
+
presentationId?: string | null;
|
|
1795
|
+
/** Text typed onto the linked `parTrans`/`sibTrans` transition point, when it carries any. */
|
|
1796
|
+
label?: string;
|
|
1797
|
+
}
|
|
1798
|
+
/** Manual layout overrides (`dgm:prSet/@cust*`) a user applied to a presentation point. */
|
|
1799
|
+
interface DiagramNodeCustomLayout {
|
|
1800
|
+
/** `custAng`: additional rotation in degrees. */
|
|
1801
|
+
angle?: number;
|
|
1802
|
+
scaleX?: number;
|
|
1803
|
+
scaleY?: number;
|
|
1804
|
+
sizeX?: number;
|
|
1805
|
+
sizeY?: number;
|
|
1806
|
+
flipHorizontal?: boolean;
|
|
1807
|
+
flipVertical?: boolean;
|
|
1808
|
+
linearFactorX?: number;
|
|
1809
|
+
linearFactorY?: number;
|
|
1810
|
+
linearFactorNeighborX?: number;
|
|
1811
|
+
linearFactorNeighborY?: number;
|
|
1812
|
+
radialScaleRadius?: number;
|
|
1813
|
+
radialScaleIncrement?: number;
|
|
1814
|
+
hasCustomTransform?: boolean;
|
|
1815
|
+
}
|
|
1816
|
+
//#endregion
|
|
1817
|
+
//#region pptx/core/types/smart-art-chrome.d.ts
|
|
1818
|
+
/**
|
|
1819
|
+
* Background / outline extracted from `dgm:bg` and `dgm:whole`.
|
|
1820
|
+
*
|
|
1821
|
+
* @example
|
|
1822
|
+
* ```ts
|
|
1823
|
+
* const chrome: PptxSmartArtChrome = {
|
|
1824
|
+
* backgroundColor: "#F0F0F0",
|
|
1825
|
+
* outlineColor: "#333333",
|
|
1826
|
+
* outlineWidth: 1,
|
|
1827
|
+
* };
|
|
1828
|
+
* // => satisfies PptxSmartArtChrome
|
|
1829
|
+
* ```
|
|
1830
|
+
*/
|
|
1831
|
+
interface PptxSmartArtChrome {
|
|
1832
|
+
/**
|
|
1833
|
+
* Background fill colour (hex). When the real `dgm:bg` fill is a gradient
|
|
1834
|
+
* or pattern (see {@link PptxSmartArtChrome.backgroundFillXml}), this is an
|
|
1835
|
+
* APPROXIMATION (the gradient's first stop, or the pattern's foreground
|
|
1836
|
+
* colour) for a consumer that only wants one display colour, not the full fill.
|
|
1837
|
+
*/
|
|
1838
|
+
backgroundColor?: string;
|
|
1839
|
+
/**
|
|
1840
|
+
* Raw `dgm:bg` fill XML, present only when the background is a gradient or
|
|
1841
|
+
* pattern fill (a solid fill is fully captured by {@link PptxSmartArtChrome.backgroundColor}
|
|
1842
|
+
* alone). Round-trip only: `smartart-save-chrome.ts` re-emits this verbatim
|
|
1843
|
+
* instead of flattening the fill to a solid colour on save.
|
|
1844
|
+
*/
|
|
1845
|
+
backgroundFillXml?: PptxSmartArtRawBackgroundFill;
|
|
1846
|
+
/** Outline stroke colour (hex). */
|
|
1847
|
+
outlineColor?: string;
|
|
1848
|
+
/** Outline stroke width in points. */
|
|
1849
|
+
outlineWidth?: number;
|
|
1850
|
+
}
|
|
1851
|
+
/**
|
|
1852
|
+
* A `dgm:bg` fill this viewer doesn't fully model as first-class chrome
|
|
1853
|
+
* (gradient or pattern), preserved verbatim for round-trip. See
|
|
1854
|
+
* {@link PptxSmartArtChrome.backgroundFillXml}.
|
|
1855
|
+
*/
|
|
1856
|
+
interface PptxSmartArtRawBackgroundFill {
|
|
1857
|
+
/** Local element name of the fill under `dgm:bg` (`gradFill` or `pattFill`). */
|
|
1858
|
+
localName: 'gradFill' | 'pattFill';
|
|
1859
|
+
/** The fill element's own attributes/children, as parsed. */
|
|
1860
|
+
xml: XmlObject;
|
|
1861
|
+
}
|
|
1862
|
+
//#endregion
|
|
1863
|
+
//#region pptx/core/types/smart-art-constraint-rules.d.ts
|
|
1864
|
+
type PptxSmartArtConstraintRelationship = 'self' | 'ch' | 'des';
|
|
1865
|
+
type PptxSmartArtConstraintOperator = 'none' | 'equ' | 'gte' | 'lte';
|
|
1866
|
+
type PptxSmartArtConstraintPointType = 'all' | 'doc' | 'node' | 'norm' | 'nonNorm' | 'asst' | 'nonAsst' | 'parTrans' | 'pres' | 'sibTrans';
|
|
1867
|
+
interface PptxSmartArtConstraintTarget {
|
|
1868
|
+
for?: PptxSmartArtConstraintRelationship;
|
|
1869
|
+
forName?: string;
|
|
1870
|
+
pointType?: PptxSmartArtConstraintPointType;
|
|
1871
|
+
}
|
|
1872
|
+
/** Editable DiagramML CT_Constraint. */
|
|
1873
|
+
interface PptxSmartArtConstraint extends PptxSmartArtConstraintTarget {
|
|
1874
|
+
type: string;
|
|
1875
|
+
referenceType?: string;
|
|
1876
|
+
referenceFor?: PptxSmartArtConstraintRelationship;
|
|
1877
|
+
referenceForName?: string;
|
|
1878
|
+
referencePointType?: PptxSmartArtConstraintPointType;
|
|
1879
|
+
operator?: PptxSmartArtConstraintOperator;
|
|
1880
|
+
value?: number;
|
|
1881
|
+
factor?: number;
|
|
1882
|
+
/** Original constraint retained for foreign attributes and extension content. */
|
|
1883
|
+
rawXml?: XmlObject;
|
|
1884
|
+
}
|
|
1885
|
+
/** Editable DiagramML CT_NumericRule. */
|
|
1886
|
+
interface PptxSmartArtNumericRule extends PptxSmartArtConstraintTarget {
|
|
1887
|
+
type: string;
|
|
1888
|
+
value?: number;
|
|
1889
|
+
factor?: number;
|
|
1890
|
+
max?: number;
|
|
1891
|
+
/** Original rule retained for foreign attributes and extension content. */
|
|
1892
|
+
rawXml?: XmlObject;
|
|
1893
|
+
}
|
|
1894
|
+
//#endregion
|
|
1895
|
+
//#region pptx/core/types/smart-art-layout-primitives.d.ts
|
|
1896
|
+
interface PptxSmartArtLocalizedText {
|
|
1897
|
+
value: string;
|
|
1898
|
+
language?: string;
|
|
1899
|
+
}
|
|
1900
|
+
interface PptxSmartArtLayoutCategory {
|
|
1901
|
+
type: string;
|
|
1902
|
+
priority: number;
|
|
1903
|
+
}
|
|
1904
|
+
interface PptxSmartArtAlgorithmParameter {
|
|
1905
|
+
type: string;
|
|
1906
|
+
value?: string;
|
|
1907
|
+
}
|
|
1908
|
+
/** Typed DiagramML CT_Algorithm data attached to a layout node. */
|
|
1909
|
+
interface PptxSmartArtLayoutAlgorithm {
|
|
1910
|
+
type: string;
|
|
1911
|
+
revision?: number;
|
|
1912
|
+
parameters?: PptxSmartArtAlgorithmParameter[];
|
|
1913
|
+
}
|
|
1914
|
+
interface PptxSmartArtIteratorAttributes {
|
|
1915
|
+
name?: string;
|
|
1916
|
+
reference?: string;
|
|
1917
|
+
axis?: string[];
|
|
1918
|
+
pointTypes?: string[];
|
|
1919
|
+
hideLastTransition?: boolean[];
|
|
1920
|
+
start?: number[];
|
|
1921
|
+
count?: number[];
|
|
1922
|
+
step?: number[];
|
|
1923
|
+
}
|
|
1924
|
+
interface PptxSmartArtForEach extends PptxSmartArtIteratorAttributes {
|
|
1925
|
+
rawXml?: XmlObject;
|
|
1926
|
+
}
|
|
1927
|
+
interface PptxSmartArtWhen extends PptxSmartArtIteratorAttributes {
|
|
1928
|
+
function: string;
|
|
1929
|
+
argument?: string;
|
|
1930
|
+
operator: string;
|
|
1931
|
+
value: string;
|
|
1932
|
+
rawXml?: XmlObject;
|
|
1933
|
+
}
|
|
1934
|
+
interface PptxSmartArtChoose {
|
|
1935
|
+
name?: string;
|
|
1936
|
+
when: PptxSmartArtWhen[];
|
|
1937
|
+
otherwise?: {
|
|
1938
|
+
name?: string;
|
|
1939
|
+
rawXml?: XmlObject;
|
|
1940
|
+
} | null;
|
|
1941
|
+
rawXml?: XmlObject;
|
|
1942
|
+
}
|
|
1943
|
+
/** A single `dgm:adj/@val` adjustment, keyed by its `@idx` (1-based, like `a:gd`). */
|
|
1944
|
+
interface PptxSmartArtShapeAdjustment {
|
|
1945
|
+
index: number;
|
|
1946
|
+
value: number;
|
|
1947
|
+
}
|
|
1948
|
+
/**
|
|
1949
|
+
* Typed DiagramML CT_Shape data (`dgm:shape`) attached to a layout node: the
|
|
1950
|
+
* per-node preset geometry override real (and third-party/custom) layout
|
|
1951
|
+
* definitions use so a layoutNode can be e.g. an ellipse or a chevron instead
|
|
1952
|
+
* of the arranger family's hardcoded default shape.
|
|
1953
|
+
*/
|
|
1954
|
+
interface PptxSmartArtLayoutNodeShape {
|
|
1955
|
+
/** `dgm:shape/@type`: a preset geometry name (`roundRect`, `ellipse`, `chevron`, `conn`, ...). */
|
|
1956
|
+
presetGeometry?: string;
|
|
1957
|
+
/** `dgm:adjLst/dgm:adj` entries (adjustment index -> value, as authored). */
|
|
1958
|
+
adjustments?: PptxSmartArtShapeAdjustment[];
|
|
1959
|
+
/** `dgm:shape/@hideGeom`: the shape is present only to size text, never painted. */
|
|
1960
|
+
hideGeometry?: boolean;
|
|
1961
|
+
/**
|
|
1962
|
+
* `dgm:shape/@lkTxEntry` (CT_Shape, boolean, default false): this node is a
|
|
1963
|
+
* decorative shape that should mirror its paired content node's text
|
|
1964
|
+
* rather than always rendering blank. See `smartart-layout-interpreter-
|
|
1965
|
+
* pyramid.ts`'s `arrangePyramid`, the interpreter's one existing
|
|
1966
|
+
* synthesized-decorative-shape call site.
|
|
1967
|
+
*/
|
|
1968
|
+
lkTxEntry?: boolean;
|
|
1969
|
+
}
|
|
1970
|
+
//#endregion
|
|
1971
|
+
//#region pptx/core/types/smart-art-layout-definition.d.ts
|
|
1972
|
+
/** Identity and ordering metadata from DiagramML CT_LayoutNode. */
|
|
1973
|
+
interface PptxSmartArtLayoutNode {
|
|
1974
|
+
name?: string;
|
|
1975
|
+
styleLabel?: string;
|
|
1976
|
+
childOrder?: 'b' | 't';
|
|
1977
|
+
moveWith?: string;
|
|
1978
|
+
algorithm?: PptxSmartArtLayoutAlgorithm;
|
|
1979
|
+
forEach?: PptxSmartArtForEach[];
|
|
1980
|
+
choose?: PptxSmartArtChoose[];
|
|
1981
|
+
constraints?: PptxSmartArtConstraint[];
|
|
1982
|
+
rules?: PptxSmartArtNumericRule[];
|
|
1983
|
+
/** `dgm:shape`: this node's own preset geometry override, when present. */
|
|
1984
|
+
shape?: PptxSmartArtLayoutNodeShape;
|
|
1985
|
+
/**
|
|
1986
|
+
* `dgm:presOf` (CT_PresentationOf, same iterator shape as `dgm:forEach`):
|
|
1987
|
+
* which data-model point(s) this node's OWN text/geometry binds to -
|
|
1988
|
+
* `axis: ['self']` the point currently being iterated, `['des']` all of
|
|
1989
|
+
* its descendants, `['ch']` its direct children, and so on. Absent or
|
|
1990
|
+
* empty `axis` (including a bare `<dgm:presOf/>`) means the node carries
|
|
1991
|
+
* no text of its own (a pure positioning/decoration wrapper - `composite`,
|
|
1992
|
+
* `sp` spacer, connector cap). See `smartart-layout-interpreter-item-
|
|
1993
|
+
* roles.ts`, the one consumer: it is what lets the interpreter tell a
|
|
1994
|
+
* text-bearing per-item role (a list layout's `childText`, a card
|
|
1995
|
+
* layout's `roleText`/`bodyText`) apart from a same-generation sibling
|
|
1996
|
+
* that positions or decorates instead.
|
|
1997
|
+
*/
|
|
1998
|
+
presentationOf?: PptxSmartArtIteratorAttributes;
|
|
1999
|
+
/**
|
|
2000
|
+
* EVERY `dgm:constr` reachable from this node, including ones declared
|
|
2001
|
+
* inside a `dgm:choose`/`dgm:if`/`dgm:else` that wraps THIS layoutNode's
|
|
2002
|
+
* `constrLst` (a genuinely conditional constraint set, e.g. one branch
|
|
2003
|
+
* per data-point count - `gear`'s composite positions its `gear1`/
|
|
2004
|
+
* `gear2`/`gear3` slots this way, so its plain, direct-child-only
|
|
2005
|
+
* `constraints` above is empty for it). Stops at a nested `dgm:layoutNode`
|
|
2006
|
+
* boundary: that child's own conditional constrLst becomes ITS
|
|
2007
|
+
* `allConstraints`, not folded into the parent's. Read-only /
|
|
2008
|
+
* interpretation-only - `constraints` above (this node's own DIRECT
|
|
2009
|
+
* constrLst) remains the one `applySmartArtLayoutDefinition` round-trips,
|
|
2010
|
+
* so editing an unrelated property can never collapse a genuinely
|
|
2011
|
+
* conditional constrLst into a single branch. `undefined` when this node
|
|
2012
|
+
* declares no constrLst at all, in or out of a choose (the common case);
|
|
2013
|
+
* otherwise a superset of `constraints` (every branch, blindly unioned -
|
|
2014
|
+
* this interpreter does not evaluate `dgm:choose` conditions when
|
|
2015
|
+
* indexing constraints, matching the same "flatten both branches"
|
|
2016
|
+
* convention `nestedLayoutNodes` already uses for `children`). See
|
|
2017
|
+
* `smartart-constraint-solver.ts`'s `buildConstraintIndex`, the only
|
|
2018
|
+
* consumer.
|
|
2019
|
+
*/
|
|
2020
|
+
allConstraints?: PptxSmartArtConstraint[];
|
|
2021
|
+
children?: PptxSmartArtLayoutNode[];
|
|
2022
|
+
/**
|
|
2023
|
+
* The iterator attributes of the ENCLOSING `dgm:forEach` this node was
|
|
2024
|
+
* found through, when `nestedLayoutNodes` (`smartart-layout-definition
|
|
2025
|
+
* .ts`) reached it by walking one - as opposed to being a direct child of
|
|
2026
|
+
* its parent layoutNode, or reached only through a `dgm:choose` wrapper
|
|
2027
|
+
* (a condition, not an iteration, leaves this `undefined`).
|
|
2028
|
+
*
|
|
2029
|
+
* `forEach` above records a node's OWN direct `dgm:forEach` children
|
|
2030
|
+
* (which wrap ITS descendants); this is the opposite direction - the
|
|
2031
|
+
* forEach that wraps the node ITSELF, one level up. A layoutNode can sit
|
|
2032
|
+
* inside more than one enclosing forEach only via nesting, so this is
|
|
2033
|
+
* always the SINGLE nearest one, not a list.
|
|
2034
|
+
*
|
|
2035
|
+
* This is what tells a genuinely repeated per-child template
|
|
2036
|
+
* (`axis="ch"`, `ptType` absent or `"node"`) apart from a once-only or
|
|
2037
|
+
* transition-only sibling that merely happens to sit inside SOME
|
|
2038
|
+
* `dgm:forEach` (a `ptType="parTrans"`/`"sibTrans"` connector, or
|
|
2039
|
+
* `axis="followSib" cnt="1"`) - both can be direct siblings under the
|
|
2040
|
+
* SAME parent layoutNode (`lProcess1`'s `vertFlow` has one forEach for
|
|
2041
|
+
* its `parTrans` connector and a SEPARATE one, `axis="ch"`, for its
|
|
2042
|
+
* repeated `child` items; `vertFlow.forEach` bundles both, but only
|
|
2043
|
+
* `child.forEachOrigin` says which ONE produced it). See
|
|
2044
|
+
* `smartart-layout-interpreter-item-roles-recursive.ts`, the one
|
|
2045
|
+
* consumer. Read-only / interpretation-only, like `allConstraints`:
|
|
2046
|
+
* never round-tripped by `applySmartArtLayoutDefinition`.
|
|
2047
|
+
*/
|
|
2048
|
+
forEachOrigin?: PptxSmartArtIteratorAttributes;
|
|
2049
|
+
/**
|
|
2050
|
+
* The conditions of EVERY enclosing `dgm:if` this node was found through,
|
|
2051
|
+
* outermost first, when `nestedLayoutNodes` (`smartart-layout-
|
|
2052
|
+
* definition.ts`) reached it via one or more `dgm:choose`'s `if` branches
|
|
2053
|
+
* (as opposed to a direct child, a `dgm:else` branch contributing no
|
|
2054
|
+
* condition of its own - see below - or a `dgm:forEach`, which sets
|
|
2055
|
+
* {@link forEachOrigin} instead). ALL must hold (evaluate `!== false`,
|
|
2056
|
+
* per {@link chooseGuard}'s own AND semantics - see `evaluateWhen`) for
|
|
2057
|
+
* this node's branch to be genuinely live. A caller that already has the
|
|
2058
|
+
* data-model node list can use this instead of treating every
|
|
2059
|
+
* choose-flattened branch as unconditionally present
|
|
2060
|
+
* (`nestedLayoutNodes`' pre-existing "flatten every branch" convention,
|
|
2061
|
+
* still the default when this is absent or a caller does not evaluate
|
|
2062
|
+
* it) - e.g. `cycle-matrix--fallback-n2.pptx`'s `child1group`..
|
|
2063
|
+
* `child4group`, each gated on a DIFFERENT top-level point existing and
|
|
2064
|
+
* having its own child (`axis="ch ch" st="N 1" cnt="1 0" func="cnt"
|
|
2065
|
+
* op="gte" val="1"`).
|
|
2066
|
+
*
|
|
2067
|
+
* A CHAIN, not a single condition, because a node can sit inside NESTED
|
|
2068
|
+
* `dgm:choose`s whose OWN conditions are each individually necessary -
|
|
2069
|
+
* `sub-step-process--hier5.pptx`'s `chLin1`..`chLin7` each sit inside
|
|
2070
|
+
* BOTH an outer `dgm:if func="pos" op="equ" val="N"` (which one of the
|
|
2071
|
+
* 7 hand-duplicated per-position templates this is) AND an inner,
|
|
2072
|
+
* nearly-vacuous `dgm:if func="cnt" op="gte" val="1"` (has >= 1 point at
|
|
2073
|
+
* all) - keeping only the NEAREST (inner) one, as an earlier single-
|
|
2074
|
+
* condition design did, loses the ONE piece of information (the outer
|
|
2075
|
+
* `pos` guard) that actually discriminates `chLin1` from `chLin2`.
|
|
2076
|
+
*
|
|
2077
|
+
* A `dgm:else` branch contributes NO condition of its own (ECMA-376
|
|
2078
|
+
* defines it as "none of the sibling ifs matched", which would need the
|
|
2079
|
+
* FULL sibling list's conditions negated and ANDed together, not a
|
|
2080
|
+
* single condition - no gallery fixture measured needs an else branch's
|
|
2081
|
+
* own guard yet, so it is left unconditional, matching the pre-existing
|
|
2082
|
+
* flatten-everything behaviour) but does NOT clear any OUTER ancestor
|
|
2083
|
+
* guard already accumulated before it. Evaluate with `smartart-layout-
|
|
2084
|
+
* interpreter-when.ts`'s `evaluateWhen`, once per entry, ANDed.
|
|
2085
|
+
*/
|
|
2086
|
+
chooseGuard?: PptxSmartArtWhen[];
|
|
2087
|
+
/**
|
|
2088
|
+
* ROUND 42: the forEach iterator active WHEN EACH ENTRY of {@link
|
|
2089
|
+
* chooseGuard} was declared (index-parallel with it, `undefined` per
|
|
2090
|
+
* entry when no forEach was active at that point) - NOT the same as
|
|
2091
|
+
* {@link forEachOrigin}, which is always this NODE's own single nearest
|
|
2092
|
+
* enclosing forEach, however deep. A `dgm:if` declared ABOVE a `dgm:forEach`
|
|
2093
|
+
* that this node's own branch happens to descend through afterwards needs
|
|
2094
|
+
* ITS OWN, SHALLOWER anchor for a `func="cnt"`/`"maxDepth"`-family
|
|
2095
|
+
* `@axis` condition, not this node's deeper one - `funnel--flat3.pptx`'s
|
|
2096
|
+
* `item1`/`item2`/`item3` (`chooseGuard: [Name5's axis="ch" func="cnt"
|
|
2097
|
+
* op="gte" val="1"]`, declared directly under the composite root, BEFORE
|
|
2098
|
+
* each item's own per-item `dgm:forEach axis="ch" st="2"/"3"/"4" cnt="1"`)
|
|
2099
|
+
* is exactly this shape: evaluating Name5's condition anchored to item1's
|
|
2100
|
+
* OWN forEach binding (one specific data point, with no children of its
|
|
2101
|
+
* own in a flat dataset) wrongly resolves its `axis="ch"` child count to
|
|
2102
|
+
* 0 instead of the diagram's real top-level count, dropping the item
|
|
2103
|
+
* entirely - `chooseGuardOrigins[i]` for that entry is `undefined`
|
|
2104
|
+
* (Name5 sits above ANY forEach), so the guard correctly stays
|
|
2105
|
+
* root-relative. See `smartart-layout-interpreter-composite-
|
|
2106
|
+
* candidates.ts`'s `guardAllows`, the one production consumer.
|
|
2107
|
+
* `undefined` whenever {@link chooseGuard} itself is (no enclosing
|
|
2108
|
+
* choose at all).
|
|
2109
|
+
*/
|
|
2110
|
+
chooseGuardOrigins?: (PptxSmartArtIteratorAttributes | undefined)[];
|
|
2111
|
+
/**
|
|
2112
|
+
* The chain of every enclosing `dgm:choose`'s own GROUP identity + this
|
|
2113
|
+
* node's ordinal position within it + THAT branch's own condition,
|
|
2114
|
+
* outermost first - identifies WHICH `dgm:choose` instance and WHERE
|
|
2115
|
+
* within its own `dgm:if`/`dgm:else` list this node's branch sits, unlike
|
|
2116
|
+
* {@link chooseGuard} (a flat AND-chain of every condition with no group/
|
|
2117
|
+
* position identity, and no entry at all for a `dgm:else` branch, which
|
|
2118
|
+
* has no condition of its own - see that field's doc comment). `id` is a
|
|
2119
|
+
* synthetic, process-unique identifier assigned per `dgm:choose` instance
|
|
2120
|
+
* during flattening (`smartart-layout-definition-nesting.ts`'s
|
|
2121
|
+
* `nestedLayoutNodes`, a monotonic counter - NOT round-tripped, NOT the
|
|
2122
|
+
* choose's own `@_name`, which is not guaranteed unique across a whole
|
|
2123
|
+
* layoutDef); `ordinal` is 0-based document order within that ONE choose
|
|
2124
|
+
* (every `dgm:if` in order, then `dgm:else` last, if present); `guard` is
|
|
2125
|
+
* that branch's OWN condition (`undefined` for a `dgm:else` entry, which
|
|
2126
|
+
* has none - deliberately kept PER-ENTRY rather than cross-referenced by
|
|
2127
|
+
* index against {@link chooseGuard}, whose own length can diverge from
|
|
2128
|
+
* this chain's whenever an ancestor `dgm:else` contributed a group
|
|
2129
|
+
* position but no guard).
|
|
2130
|
+
*
|
|
2131
|
+
* Lets a consumer recover ECMA-376's real `dgm:choose` semantics - "the
|
|
2132
|
+
* FIRST branch whose condition holds wins, siblings never coexist" -
|
|
2133
|
+
* from the flattened `.children` array, where that grouping would
|
|
2134
|
+
* otherwise be lost: `balance--hier5.pptx`'s `balance_NN`/`left_NN_M`/
|
|
2135
|
+
* `right_NN_M` family (127 members across ~30 NESTED `dgm:choose`
|
|
2136
|
+
* instances, not one flat 127-branch choose) needs first-match-wins
|
|
2137
|
+
* WITHIN each individual choose to resolve to the single genuinely-live
|
|
2138
|
+
* arrangement, not the "every guard-true node is an independent
|
|
2139
|
+
* candidate" reading `smartart-layout-interpreter-composite-choose.ts`'s
|
|
2140
|
+
* `collectRawCandidates` used before this field existed - see that
|
|
2141
|
+
* module's own consumer of this field for the actual selection rule.
|
|
2142
|
+
* `undefined` (or an empty array) for a node reached without any
|
|
2143
|
+
* enclosing choose (a direct child, or a `dgm:forEach`-only path) -
|
|
2144
|
+
* every PRE-EXISTING caller that does not consult this field is
|
|
2145
|
+
* unaffected by its mere presence.
|
|
2146
|
+
*
|
|
2147
|
+
* ROUND 42: `origin` is the forEach iterator active when THIS branch's
|
|
2148
|
+
* own `dgm:if`/`dgm:else` was declared (the SAME "declaration time, not
|
|
2149
|
+
* whatever descendant ends up carrying it" concept {@link
|
|
2150
|
+
* chooseGuardOrigins} exists for) - the anchor a `func="cnt"`/`"maxDepth"`
|
|
2151
|
+
* -family condition in `guard` needs, NOT a representative member's own
|
|
2152
|
+
* (possibly deeper) `forEachOrigin`. See `smartart-layout-interpreter-
|
|
2153
|
+
* composite-choose-groups.ts`'s `winningOrdinalFor`, the one consumer.
|
|
2154
|
+
*/
|
|
2155
|
+
chooseGroups?: {
|
|
2156
|
+
id: string;
|
|
2157
|
+
ordinal: number;
|
|
2158
|
+
guard?: PptxSmartArtWhen;
|
|
2159
|
+
origin?: PptxSmartArtIteratorAttributes;
|
|
2160
|
+
}[];
|
|
2161
|
+
/**
|
|
2162
|
+
* Every `dgm:presOf` candidate reachable through a `dgm:choose`/`dgm:if`/
|
|
2163
|
+
* `dgm:else` wrapping THIS node's OWN presOf (as opposed to
|
|
2164
|
+
* {@link chooseGuard}, which gates the layoutNode's own EXISTENCE), each
|
|
2165
|
+
* tagged with the FULL chain of enclosing `dgm:if` conditions that select
|
|
2166
|
+
* it (`guard`, empty for an unconditional or `dgm:else`-reached
|
|
2167
|
+
* candidate), in document order (every `dgm:if` then `dgm:else` last).
|
|
2168
|
+
* `undefined` when this node's presOf is not choose-guarded at all (the
|
|
2169
|
+
* overwhelmingly common case) - {@link presentationOf} already carries
|
|
2170
|
+
* the one-and-only value then. Exists for a genuinely conditional presOf
|
|
2171
|
+
* where TWO OR MORE branches each declare a real, DIFFERENT axis
|
|
2172
|
+
* (`funnel--flat3.pptx`'s `item1`/`item2`/`item3`, one literal axis per
|
|
2173
|
+
* data-point count): `smartart-layout-definition-constraints.ts`'s
|
|
2174
|
+
* `choosePresentationOf` (feeding {@link presentationOf}) can only ever
|
|
2175
|
+
* guess ONE branch statically, at parse time, with no diagram to
|
|
2176
|
+
* evaluate against; this field lets an interpret-time caller with the
|
|
2177
|
+
* actual diagram (`smartart-layout-interpreter-when.ts`'s
|
|
2178
|
+
* `resolvePresentationOf`, the one consumer) pick the branch PowerPoint's
|
|
2179
|
+
* own runtime would, first-match-wins.
|
|
2180
|
+
*/
|
|
2181
|
+
presentationOfCandidates?: {
|
|
2182
|
+
guard: PptxSmartArtWhen[];
|
|
2183
|
+
presentationOf: PptxSmartArtIteratorAttributes;
|
|
2184
|
+
}[];
|
|
2185
|
+
/**
|
|
2186
|
+
* SESSION 17: every `dgm:rule` reachable through a `dgm:choose`/`dgm:if`/
|
|
2187
|
+
* `dgm:else` wrapping THIS node's `ruleLst` (a genuinely count-gated rule
|
|
2188
|
+
* set, e.g. `diverging-radial`'s own `w for="ch" forName="node"` ceiling:
|
|
2189
|
+
* 6 `dgm:if cnt<=N` branches, each its own `fact`), tagged with its guard
|
|
2190
|
+
* chain - the SAME shape {@link presentationOfCandidates} uses for
|
|
2191
|
+
* choose-guarded `presOf`, applied to `dgm:rule`. `undefined` when not
|
|
2192
|
+
* choose-guarded (`rules` above then carries the one set, the common
|
|
2193
|
+
* case). See `smartart-layout-interpreter-cycle-hub-ratio.ts`'s
|
|
2194
|
+
* `resolveHubToNodeRatio` (COM-verified live mechanism, not a guess) for
|
|
2195
|
+
* how the guard is evaluated against the real satellite count.
|
|
2196
|
+
*/
|
|
2197
|
+
ruleCandidates?: {
|
|
2198
|
+
guard: PptxSmartArtWhen[];
|
|
2199
|
+
rule: PptxSmartArtNumericRule;
|
|
2200
|
+
}[];
|
|
2201
|
+
/**
|
|
2202
|
+
* ROUND 39: every `dgm:constr` reachable through a `dgm:choose`/`dgm:if`/
|
|
2203
|
+
* `dgm:else` wrapping THIS node's `constrLst` (a genuinely count/position
|
|
2204
|
+
* -branched constraint set, e.g. `basic-venn--flat3.pptx`'s composite
|
|
2205
|
+
* `Name9` choose, one `ctrX`/`ctrY`/`w`/`h` per data-point-count branch
|
|
2206
|
+
* for `circ1`/`circ1Tx`/...), each tagged with its guard chain - the SAME
|
|
2207
|
+
* shape {@link presentationOfCandidates}/{@link ruleCandidates} use,
|
|
2208
|
+
* applied to `dgm:constr`. `undefined` when not choose-guarded
|
|
2209
|
+
* (`allConstraints`/`constraints` above then carry the one set, the
|
|
2210
|
+
* common case). See `smartart-constraint-branch-index.ts`'s
|
|
2211
|
+
* `selectConstraints` for how the guard is evaluated against the real
|
|
2212
|
+
* diagram, and that module's own doc comment for why `allConstraints`'s
|
|
2213
|
+
* pre-existing blind union of every branch is not enough on its own.
|
|
2214
|
+
*/
|
|
2215
|
+
constraintCandidates?: {
|
|
2216
|
+
guard: PptxSmartArtWhen[];
|
|
2217
|
+
constraint: PptxSmartArtConstraint;
|
|
2218
|
+
}[];
|
|
2219
|
+
}
|
|
2220
|
+
/** Metadata and root node from DiagramML CT_DiagramDefinition. */
|
|
2221
|
+
interface PptxSmartArtLayoutDefinition {
|
|
2222
|
+
uniqueId?: string;
|
|
2223
|
+
minimumVersion?: string;
|
|
2224
|
+
defaultStyle?: string;
|
|
2225
|
+
titles?: PptxSmartArtLocalizedText[];
|
|
2226
|
+
descriptions?: PptxSmartArtLocalizedText[];
|
|
2227
|
+
categories?: PptxSmartArtLayoutCategory[];
|
|
2228
|
+
rootNode: PptxSmartArtLayoutNode;
|
|
2229
|
+
/** Original definition retained for constraint evaluation and foreign rules. */
|
|
2230
|
+
rawXml?: XmlObject;
|
|
2231
|
+
/**
|
|
2232
|
+
* The un-parsed layout-definition part text (starting at `<dgm:layoutDef>`,
|
|
2233
|
+
* XML declaration included). `rawXml` above loses the document order of
|
|
2234
|
+
* differently-named siblings (the package-wide `fast-xml-parser`
|
|
2235
|
+
* configuration groups children into one array per tag), which the
|
|
2236
|
+
* per-point DiagramML engine (`core/utils/smartart-engine/`) needs to
|
|
2237
|
+
* execute a `layoutNode` body's `forEach`/`choose`/`constrLst` statements
|
|
2238
|
+
* in their real declared sequence - see that package's `ordered-xml.ts`.
|
|
2239
|
+
* `undefined` when the part could not be read (matches `rawXml`'s own
|
|
2240
|
+
* optionality); the engine falls back to the legacy interpreter then.
|
|
2241
|
+
*/
|
|
2242
|
+
rawXmlText?: string;
|
|
2243
|
+
}
|
|
2244
|
+
//#endregion
|
|
2245
|
+
//#region pptx/core/types/smart-art-node.d.ts
|
|
2246
|
+
/**
|
|
2247
|
+
* A single run of text inside a SmartArt node, capturing the run text and the
|
|
2248
|
+
* raw `a:rPr` run-properties object verbatim so per-run formatting (bold,
|
|
2249
|
+
* colour, size, etc.) survives a load -> edit -> save round-trip instead of
|
|
2250
|
+
* collapsing to a single unstyled run.
|
|
2251
|
+
*
|
|
2252
|
+
* @example
|
|
2253
|
+
* ```ts
|
|
2254
|
+
* const run: PptxSmartArtTextRun = {
|
|
2255
|
+
* text: "Bold",
|
|
2256
|
+
* rPr: { "@_b": "1", "@_lang": "en-US" },
|
|
2257
|
+
* };
|
|
2258
|
+
* // => satisfies PptxSmartArtTextRun
|
|
2259
|
+
* ```
|
|
2260
|
+
*/
|
|
2261
|
+
interface PptxSmartArtTextRun {
|
|
2262
|
+
/** Run text content. */
|
|
2263
|
+
text: string;
|
|
2264
|
+
/**
|
|
2265
|
+
* Raw parsed `a:rPr` run-properties object, preserved verbatim for
|
|
2266
|
+
* round-trip. Untyped XML, hence the loose record shape.
|
|
2267
|
+
*/
|
|
2268
|
+
rPr?: Record<string, unknown>;
|
|
2269
|
+
/** Resolved standard shape-text style derived from {@link rPr}. */
|
|
2270
|
+
style?: TextStyle;
|
|
2271
|
+
/** Raw run XML used to retain unmodelled extension children on save. */
|
|
2272
|
+
rawXml?: Record<string, unknown>;
|
|
2273
|
+
/** Original direct-child order, including unmodelled extension children. */
|
|
2274
|
+
childOrder?: string[];
|
|
2275
|
+
}
|
|
2276
|
+
/** An ordered item within a SmartArt text paragraph. */
|
|
2277
|
+
type PptxSmartArtTextParagraphItem = {
|
|
2278
|
+
kind: 'run';
|
|
2279
|
+
run: PptxSmartArtTextRun;
|
|
2280
|
+
} | {
|
|
2281
|
+
kind: 'break';
|
|
2282
|
+
rPr?: Record<string, unknown>;
|
|
2283
|
+
style?: TextStyle;
|
|
2284
|
+
rawXml?: Record<string, unknown>;
|
|
2285
|
+
childOrder?: string[];
|
|
2286
|
+
} | {
|
|
2287
|
+
kind: 'field';
|
|
2288
|
+
id?: string;
|
|
2289
|
+
fieldType?: string;
|
|
2290
|
+
text: string;
|
|
2291
|
+
rPr?: Record<string, unknown>;
|
|
2292
|
+
style?: TextStyle;
|
|
2293
|
+
pPr?: Record<string, unknown>;
|
|
2294
|
+
rawXml?: Record<string, unknown>;
|
|
2295
|
+
childOrder?: string[];
|
|
2296
|
+
} | {
|
|
2297
|
+
kind: 'tab';
|
|
2298
|
+
rawXml?: Record<string, unknown>;
|
|
2299
|
+
childOrder?: string[];
|
|
2300
|
+
} | {
|
|
2301
|
+
kind: 'raw';
|
|
2302
|
+
name: string;
|
|
2303
|
+
value: unknown;
|
|
2304
|
+
};
|
|
2305
|
+
/** A complete `a:p` paragraph in a SmartArt data-model text body. */
|
|
2306
|
+
interface PptxSmartArtTextParagraph {
|
|
2307
|
+
/** Paragraph properties (`a:pPr`) preserved verbatim. */
|
|
2308
|
+
pPr?: Record<string, unknown>;
|
|
2309
|
+
/** Text children in source order. */
|
|
2310
|
+
items: PptxSmartArtTextParagraphItem[];
|
|
2311
|
+
/** End-paragraph run properties (`a:endParaRPr`) preserved verbatim. */
|
|
2312
|
+
endParaRPr?: Record<string, unknown>;
|
|
2313
|
+
/** Resolved style for the paragraph terminator. */
|
|
2314
|
+
endParaStyle?: TextStyle;
|
|
2315
|
+
/** Raw paragraph XML used to retain unmodelled extension children on save. */
|
|
2316
|
+
rawXml?: Record<string, unknown>;
|
|
2317
|
+
}
|
|
2318
|
+
/**
|
|
2319
|
+
* Per-node visual override for a SmartArt node.
|
|
2320
|
+
*
|
|
2321
|
+
* Captures the individual fill / line / font colour and the bold / italic
|
|
2322
|
+
* emphasis a user has set on one specific node, independent of the diagram's
|
|
2323
|
+
* colour scheme and quick style. All colours are hex strings (e.g. "#FF0000").
|
|
2324
|
+
* Every field is optional: only the overridden aspects are carried, so an
|
|
2325
|
+
* empty object means "no per-node override".
|
|
2326
|
+
*
|
|
2327
|
+
* The parser reads these from the data point's `spPr` solid fill / line colour
|
|
2328
|
+
* and the first run's `rPr` (b / i / solidFill) when present, and the save path
|
|
2329
|
+
* writes them back so the override survives a load -> edit -> save round-trip.
|
|
2330
|
+
*
|
|
2331
|
+
* @example
|
|
2332
|
+
* ```ts
|
|
2333
|
+
* const style: PptxSmartArtNodeStyle = {
|
|
2334
|
+
* fillColor: "#FF0000",
|
|
2335
|
+
* fontColor: "#FFFFFF",
|
|
2336
|
+
* bold: true,
|
|
2337
|
+
* };
|
|
2338
|
+
* // => satisfies PptxSmartArtNodeStyle
|
|
2339
|
+
* ```
|
|
2340
|
+
*/
|
|
2341
|
+
interface PptxSmartArtNodeStyle {
|
|
2342
|
+
/** Solid fill colour override (hex, e.g. "#4F81BD"). */
|
|
2343
|
+
fillColor?: string;
|
|
2344
|
+
/** Outline / line colour override (hex). */
|
|
2345
|
+
lineColor?: string;
|
|
2346
|
+
/** Text (font) colour override (hex). */
|
|
2347
|
+
fontColor?: string;
|
|
2348
|
+
/** Bold emphasis override for the node's runs. */
|
|
2349
|
+
bold?: boolean;
|
|
2350
|
+
/** Italic emphasis override for the node's runs. */
|
|
2351
|
+
italic?: boolean;
|
|
2352
|
+
}
|
|
2353
|
+
/**
|
|
2354
|
+
* Manual layout override for a `type="pres"` presentation point, read from its
|
|
2355
|
+
* `dgm:prSet` attributes. PowerPoint writes these when the user drags, resizes,
|
|
2356
|
+
* rotates, or flips a SmartArt node by hand in its own diagram editor; without
|
|
2357
|
+
* them the node silently reverts to its algorithmic position whenever there is
|
|
2358
|
+
* no cached `dsp:` drawing part to fall back on.
|
|
2359
|
+
*
|
|
2360
|
+
* Every field is optional: only the attributes actually present on `prSet` are
|
|
2361
|
+
* populated. Angle and scale/factor units are already normalised to degrees and
|
|
2362
|
+
* plain ratios (a `custScaleX="150000"` becomes `scaleX: 1.5`), so a consumer
|
|
2363
|
+
* never has to know the raw `60000ths-of-a-degree` / `100000ths-of-a-percent`
|
|
2364
|
+
* XML encodings.
|
|
2365
|
+
*
|
|
2366
|
+
* @example
|
|
2367
|
+
* ```ts
|
|
2368
|
+
* const custom: SmartArtNodeCustomLayout = { angle: 15, scaleX: 1.2 };
|
|
2369
|
+
* // => a node manually rotated 15 degrees and widened 20% in PowerPoint
|
|
2370
|
+
* ```
|
|
2371
|
+
*/
|
|
2372
|
+
type SmartArtNodeCustomLayout = DiagramNodeCustomLayout;
|
|
2373
|
+
/**
|
|
2374
|
+
* A single node in the SmartArt data model.
|
|
2375
|
+
*
|
|
2376
|
+
* @example
|
|
2377
|
+
* ```ts
|
|
2378
|
+
* const node: PptxSmartArtNode = {
|
|
2379
|
+
* id: "1",
|
|
2380
|
+
* text: "CEO",
|
|
2381
|
+
* children: [
|
|
2382
|
+
* { id: "2", text: "VP Marketing", parentId: "1" },
|
|
2383
|
+
* { id: "3", text: "VP Engineering", parentId: "1" },
|
|
2384
|
+
* ],
|
|
2385
|
+
* };
|
|
2386
|
+
* // => satisfies PptxSmartArtNode
|
|
2387
|
+
* ```
|
|
2388
|
+
*/
|
|
2389
|
+
interface PptxSmartArtNode {
|
|
2390
|
+
id: string;
|
|
2391
|
+
text: string;
|
|
2392
|
+
/** CT_Pt connection identifier, when the point references a connection. */
|
|
2393
|
+
connectionId?: string | null;
|
|
2394
|
+
parentId?: string;
|
|
2395
|
+
children?: PptxSmartArtNode[];
|
|
2396
|
+
/** Node type from `@_type` attribute (e.g. "doc", "node", "asst", "pres"). */
|
|
2397
|
+
nodeType?: string;
|
|
2398
|
+
/**
|
|
2399
|
+
* The node's own quick-style role (`dgm:prSet/@presStyleLbl` from its
|
|
2400
|
+
* paired `type="pres"` presentation point, resolved via a `presOf`
|
|
2401
|
+
* connection back to this content point). Structural names like `node1`,
|
|
2402
|
+
* `asst2`, `bgShp`, `revTx`; distinct from {@link nodeType}, which is the
|
|
2403
|
+
* data-model `@_type` ("node"/"asst"/...). Used to pick this node's own
|
|
2404
|
+
* colour list from a colour transform's per-role palettes instead of the
|
|
2405
|
+
* generic cycled palette (see `applySmartArtRoleColors`).
|
|
2406
|
+
*/
|
|
2407
|
+
styleRole?: string;
|
|
2408
|
+
/**
|
|
2409
|
+
* `dgm:prSet/@coherent3DOff` (`CT_ElemPropSet`) resolved from the node's
|
|
2410
|
+
* paired presentation point: when true, this node opts out of the
|
|
2411
|
+
* diagram's overall coherent-3D scene rotation (a `dgm:scene3d`/`dgm:sp3d`
|
|
2412
|
+
* quick-style variation) applied to every other node.
|
|
2413
|
+
*/
|
|
2414
|
+
coherent3DOff?: boolean;
|
|
2415
|
+
/**
|
|
2416
|
+
* The layout variables PowerPoint recorded for each presentation node
|
|
2417
|
+
* this point drives (`dgm:prSet/@presName` -> `dgm:presLayoutVars`
|
|
2418
|
+
* variable -> `@val`), e.g. `{ hierRoot1: { hierBranch: 'l' } }` for an
|
|
2419
|
+
* org-chart manager set to "Left Hanging". Read-only: the presentation
|
|
2420
|
+
* points themselves round-trip verbatim.
|
|
2421
|
+
*/
|
|
2422
|
+
presLayoutVarsByName?: Record<string, Record<string, string>>;
|
|
2423
|
+
/**
|
|
2424
|
+
* Per-run text + run-properties for the node's first paragraph, captured at
|
|
2425
|
+
* parse time. When the joined run text still equals {@link text} (the node
|
|
2426
|
+
* was not edited, or was edited only in ways that preserve the run split),
|
|
2427
|
+
* the save path rebuilds the paragraph from these runs so per-run rich text
|
|
2428
|
+
* is not flattened. When {@link text} diverges, the runs are ignored.
|
|
2429
|
+
*/
|
|
2430
|
+
runs?: PptxSmartArtTextRun[];
|
|
2431
|
+
/**
|
|
2432
|
+
* Complete typed paragraph model. Unlike {@link runs}, this retains every
|
|
2433
|
+
* paragraph and the ordered run, field, break, and tab children within it.
|
|
2434
|
+
*/
|
|
2435
|
+
paragraphs?: PptxSmartArtTextParagraph[];
|
|
2436
|
+
/**
|
|
2437
|
+
* Optional per-node visual override (fill / line / font colour, bold /
|
|
2438
|
+
* italic). Read at parse time from the point's `spPr` / first-run `rPr`, set
|
|
2439
|
+
* by the editing op, honoured by the render path, and written back on save so
|
|
2440
|
+
* it round-trips.
|
|
2441
|
+
*/
|
|
2442
|
+
style?: PptxSmartArtNodeStyle;
|
|
2443
|
+
/**
|
|
2444
|
+
* Manual layout override read from the node's `dgm:prSet` `cust*`
|
|
2445
|
+
* attributes (drag/resize/rotate/flip performed in PowerPoint's own diagram
|
|
2446
|
+
* editor). Applied as a final transform after algorithmic layout by
|
|
2447
|
+
* {@link module:smartart-layout-interpreter-custom} so it survives even
|
|
2448
|
+
* when there is no cached `dsp:` drawing to fall back on.
|
|
2449
|
+
*/
|
|
2450
|
+
customLayout?: SmartArtNodeCustomLayout;
|
|
2451
|
+
}
|
|
2452
|
+
//#endregion
|
|
2453
|
+
//#region pptx/core/types/smart-art-style-definition.d.ts
|
|
2454
|
+
interface PptxSmartArtDefinitionText {
|
|
2455
|
+
value: string;
|
|
2456
|
+
language?: string;
|
|
2457
|
+
}
|
|
2458
|
+
interface PptxSmartArtDefinitionCategory {
|
|
2459
|
+
type: string;
|
|
2460
|
+
priority: number;
|
|
2461
|
+
}
|
|
2462
|
+
type PptxSmartArtColorApplicationMethod = 'span' | 'cycle' | 'repeat';
|
|
2463
|
+
type PptxSmartArtHueDirection = 'cw' | 'ccw';
|
|
2464
|
+
/** CT_Colors application metadata. Color-choice children remain preserved XML. */
|
|
2465
|
+
interface PptxSmartArtColorListMetadata {
|
|
2466
|
+
method?: PptxSmartArtColorApplicationMethod;
|
|
2467
|
+
hueDirection?: PptxSmartArtHueDirection;
|
|
2468
|
+
}
|
|
2469
|
+
/**
|
|
2470
|
+
* A quick-style label's `a:lnRef`/`a:fillRef`/`a:effectRef`/`a:fontRef`
|
|
2471
|
+
* (`CT_ShapeStyle`, the same complex type an ordinary shape's `p:style`
|
|
2472
|
+
* uses), resolved against the theme's `fmtScheme` at parse time instead of
|
|
2473
|
+
* the coarse subtle/moderate/intense enum ({@link PptxSmartArtQuickStyle.effectIntensity}).
|
|
2474
|
+
* Only populated when a theme format scheme was available when the quick
|
|
2475
|
+
* style was parsed. See G13 in the 2026-09 diagram audit.
|
|
2476
|
+
*/
|
|
2477
|
+
interface PptxSmartArtResolvedStyleRef {
|
|
2478
|
+
fillColor?: string;
|
|
2479
|
+
fillMode?: 'solid' | 'gradient' | 'pattern' | 'none' | 'theme';
|
|
2480
|
+
strokeColor?: string;
|
|
2481
|
+
strokeWidth?: number;
|
|
2482
|
+
/** `a:effectRef`'s theme-resolved outer shadow colour, when the style has one. */
|
|
2483
|
+
shadowColor?: string;
|
|
2484
|
+
/** `a:fontRef`'s theme-resolved typeface (`+mn-lt`/`+mj-lt` -> the theme's actual font). */
|
|
2485
|
+
fontTypeface?: string;
|
|
2486
|
+
}
|
|
2487
|
+
/** CT_StyleLabel metadata from a quick-style definition. */
|
|
2488
|
+
interface PptxSmartArtQuickStyleLabel {
|
|
2489
|
+
name: string;
|
|
2490
|
+
/** Theme-resolved `dgm:style` refs for this label's role, when available. */
|
|
2491
|
+
resolvedStyle?: PptxSmartArtResolvedStyleRef;
|
|
2492
|
+
/**
|
|
2493
|
+
* The label's own `dgm:scene3d` (per-shape camera + light rig). PowerPoint
|
|
2494
|
+
* copies it onto a shape's cached `a:scene3d` unless it is the default
|
|
2495
|
+
* front camera with a `threePt` light (see `applySmartArtQuickStyle3d`).
|
|
2496
|
+
*/
|
|
2497
|
+
scene3d?: Pptx3DScene;
|
|
2498
|
+
/** The label's own `dgm:sp3d` (bevel / extrusion / contour / material); absent when empty. */
|
|
2499
|
+
shape3d?: Pptx3DShape;
|
|
2500
|
+
/** The label's `dgm:txPr/a:sp3d` label-text extrusion (Bird's Eye Scene). */
|
|
2501
|
+
text3d?: Text3DStyle;
|
|
2502
|
+
}
|
|
2503
|
+
/** CT_CTStyleLabel metadata from a color-transform definition. */
|
|
2504
|
+
interface PptxSmartArtColorStyleLabel {
|
|
2505
|
+
name: string;
|
|
2506
|
+
fill?: PptxSmartArtColorListMetadata;
|
|
2507
|
+
line?: PptxSmartArtColorListMetadata;
|
|
2508
|
+
effect?: PptxSmartArtColorListMetadata;
|
|
2509
|
+
textLine?: PptxSmartArtColorListMetadata;
|
|
2510
|
+
textFill?: PptxSmartArtColorListMetadata;
|
|
2511
|
+
textEffect?: PptxSmartArtColorListMetadata;
|
|
2512
|
+
}
|
|
2513
|
+
interface PptxSmartArtDefinitionMetadata {
|
|
2514
|
+
uniqueId?: string;
|
|
2515
|
+
minimumVersion?: string;
|
|
2516
|
+
titles?: PptxSmartArtDefinitionText[];
|
|
2517
|
+
descriptions?: PptxSmartArtDefinitionText[];
|
|
2518
|
+
categories?: PptxSmartArtDefinitionCategory[];
|
|
2519
|
+
}
|
|
2520
|
+
/** Typed CT_ColorTransform metadata and the resolved legacy color palette. */
|
|
2521
|
+
interface PptxSmartArtColorTransform extends PptxSmartArtDefinitionMetadata {
|
|
2522
|
+
/** Legacy resolved display name. */
|
|
2523
|
+
name?: string;
|
|
2524
|
+
/** Ordered resolved fill colors for rendering. */
|
|
2525
|
+
fillColors: string[];
|
|
2526
|
+
/** Ordered resolved line colors for rendering. */
|
|
2527
|
+
lineColors: string[];
|
|
2528
|
+
/** Ordered resolved text-fill colors (primary styleLbl `txFillClrLst`). */
|
|
2529
|
+
textFillColors?: string[];
|
|
2530
|
+
/** Ordered resolved text-line colors (primary styleLbl `txLinClrLst`). */
|
|
2531
|
+
textLineColors?: string[];
|
|
2532
|
+
/** Ordered resolved effect colors (primary styleLbl `effectClrLst`). */
|
|
2533
|
+
effectColors?: string[];
|
|
2534
|
+
/** Ordered resolved text-effect colors (primary styleLbl `txEffectClrLst`). */
|
|
2535
|
+
textEffectColors?: string[];
|
|
2536
|
+
/** Fill-list span/cycle + hue-direction interpolation of the primary styleLbl. */
|
|
2537
|
+
fillInterpolation?: PptxSmartArtColorListMetadata;
|
|
2538
|
+
/** Line-list span/cycle + hue-direction interpolation of the primary styleLbl. */
|
|
2539
|
+
lineInterpolation?: PptxSmartArtColorListMetadata;
|
|
2540
|
+
/** Ordered CT_CTStyleLabel metadata. */
|
|
2541
|
+
labels?: PptxSmartArtColorStyleLabel[];
|
|
2542
|
+
/**
|
|
2543
|
+
* Every `styleLbl`'s own resolved fill/line colour list, keyed by name
|
|
2544
|
+
* (e.g. `node1`, `asst0`, `bgShp`, `revTx`). Unlike {@link fillColors} /
|
|
2545
|
+
* {@link lineColors} (which collapse to ONE "primary" node-role list),
|
|
2546
|
+
* this keeps every role so a node can be coloured from its OWN role's
|
|
2547
|
+
* palette (see `PptxSmartArtNode.styleRole` and `applySmartArtRoleColors`)
|
|
2548
|
+
* instead of a generic cycled colour.
|
|
2549
|
+
*/
|
|
2550
|
+
roleColors?: Record<string, SmartArtRoleColorList>;
|
|
2551
|
+
}
|
|
2552
|
+
/** One colour-transform `styleLbl`'s resolved colour lists. */
|
|
2553
|
+
interface SmartArtRoleColorList {
|
|
2554
|
+
fill: string[];
|
|
2555
|
+
line: string[];
|
|
2556
|
+
/**
|
|
2557
|
+
* `txFillClrLst`, when the label declares one (`revTx` -> `tx1`). A text
|
|
2558
|
+
* node's colour comes from here; see `smartart-merged-text-label`.
|
|
2559
|
+
*/
|
|
2560
|
+
textFill?: string[];
|
|
2561
|
+
}
|
|
2562
|
+
/** Typed CT_StyleDefinition metadata and legacy rendering hint. */
|
|
2563
|
+
interface PptxSmartArtQuickStyle extends PptxSmartArtDefinitionMetadata {
|
|
2564
|
+
/** Legacy resolved display name. */
|
|
2565
|
+
name?: string;
|
|
2566
|
+
/** Legacy effect-intensity rendering hint. */
|
|
2567
|
+
effectIntensity?: string;
|
|
2568
|
+
/** Ordered CT_StyleLabel metadata. Complex style payload remains preserved XML. */
|
|
2569
|
+
labels?: PptxSmartArtQuickStyleLabel[];
|
|
2570
|
+
/**
|
|
2571
|
+
* Whole-diagram 3D scene (camera preset/rotation/zoom/fov, light rig,
|
|
2572
|
+
* backdrop) from the quick style's own `dgm:styleDef/dgm:scene3d`, present
|
|
2573
|
+
* for the "Scene" quick styles (Brick, Flat, Metallic, Sunset, Bird's Eye
|
|
2574
|
+
* Scene). One camera renders the whole diagram; per-shape `a:scene3d` is
|
|
2575
|
+
* absent for those styles (see `PptxSmartArtDrawingShape.scene3d`). Each
|
|
2576
|
+
* `dgm:styleLbl` also carries its own per-label `dgm:scene3d`/`dgm:sp3d`
|
|
2577
|
+
* ({@link PptxSmartArtQuickStyleLabel.scene3d} / `shape3d` / `text3d`),
|
|
2578
|
+
* which PowerPoint bakes onto each cached shape; they are re-applied when a
|
|
2579
|
+
* structural edit regenerates the shapes.
|
|
2580
|
+
*/
|
|
2581
|
+
scene3d?: Pptx3DScene;
|
|
2582
|
+
}
|
|
2583
|
+
//#endregion
|
|
2584
|
+
//#region pptx/core/types/smart-art.d.ts
|
|
2585
|
+
/**
|
|
2586
|
+
* Resolved SmartArt layout category.
|
|
2587
|
+
*
|
|
2588
|
+
* @example
|
|
2589
|
+
* ```ts
|
|
2590
|
+
* const cat: SmartArtLayoutType = "hierarchy";
|
|
2591
|
+
* // => "hierarchy" — one of: "list" | "process" | "cycle" | "hierarchy" | "relationship" | …
|
|
2592
|
+
* ```
|
|
2593
|
+
*/
|
|
2594
|
+
type SmartArtLayoutType = DiagramLayoutType;
|
|
2595
|
+
/**
|
|
2596
|
+
* Named SmartArt layout presets for creation (subset of PowerPoint layouts).
|
|
2597
|
+
*
|
|
2598
|
+
* @example
|
|
2599
|
+
* ```ts
|
|
2600
|
+
* const layout: SmartArtLayout = "hierarchy";
|
|
2601
|
+
* // => "hierarchy" — one of: "basicBlockList" | "alternatingHexagons" | "hierarchy" | …
|
|
2602
|
+
* ```
|
|
2603
|
+
*/
|
|
2604
|
+
type SmartArtLayout = 'basicBlockList' | 'alternatingHexagons' | 'basicChevronProcess' | 'basicCycle' | 'basicPie' | 'basicRadial' | 'basicVenn' | 'continuousBlockProcess' | 'convergingRadial' | 'hierarchy' | 'horizontalBulletList' | 'linearVenn' | 'segmentedProcess' | 'stackedList' | 'tableList' | 'trapezoidList' | 'upwardArrow' | 'basicFunnel' | 'basicTarget' | 'interlockingGears' | 'basicTimeline' | 'basicMatrix' | 'basicPyramid' | 'invertedPyramid' | 'bendingProcess' | 'stepDownProcess' | 'alternatingFlow' | 'descendingProcess' | 'pictureAccentList' | 'verticalBlockList' | 'groupedList' | 'pyramidList' | 'horizontalPictureList' | 'accentProcess' | 'verticalChevronList';
|
|
2605
|
+
/**
|
|
2606
|
+
* SmartArt colour scheme presets.
|
|
2607
|
+
*
|
|
2608
|
+
* @example
|
|
2609
|
+
* ```ts
|
|
2610
|
+
* const scheme: SmartArtColorScheme = "colorful1";
|
|
2611
|
+
* // => "colorful1" — one of: "colorful1" | "colorful2" | "colorful3" | "monochromatic1" | "monochromatic2"
|
|
2612
|
+
* ```
|
|
2613
|
+
*/
|
|
2614
|
+
type SmartArtColorScheme = DiagramColorScheme;
|
|
2615
|
+
/**
|
|
2616
|
+
* SmartArt visual style intensity.
|
|
2617
|
+
*
|
|
2618
|
+
* @example
|
|
2619
|
+
* ```ts
|
|
2620
|
+
* const style: SmartArtStyle = "moderate";
|
|
2621
|
+
* // => "moderate" — one of: "flat" | "moderate" | "intense"
|
|
2622
|
+
* ```
|
|
2623
|
+
*/
|
|
2624
|
+
type SmartArtStyle = DiagramStyleIntensity;
|
|
2625
|
+
/**
|
|
2626
|
+
* A connection between two SmartArt data-model nodes.
|
|
2627
|
+
*
|
|
2628
|
+
* @example
|
|
2629
|
+
* ```ts
|
|
2630
|
+
* const conn: PptxSmartArtConnection = {
|
|
2631
|
+
* sourceId: "1",
|
|
2632
|
+
* destId: "2",
|
|
2633
|
+
* type: "parOf",
|
|
2634
|
+
* };
|
|
2635
|
+
* // => satisfies PptxSmartArtConnection
|
|
2636
|
+
* ```
|
|
2637
|
+
*/
|
|
2638
|
+
type PptxSmartArtConnection = DiagramConnection;
|
|
2639
|
+
/**
|
|
2640
|
+
* A pre-computed shape from `ppt/diagrams/drawing*.xml`.
|
|
2641
|
+
*
|
|
2642
|
+
* @example
|
|
2643
|
+
* ```ts
|
|
2644
|
+
* const shape: PptxSmartArtDrawingShape = {
|
|
2645
|
+
* id: "s1",
|
|
2646
|
+
* shapeType: "roundRect",
|
|
2647
|
+
* x: 100, y: 50, width: 200, height: 80,
|
|
2648
|
+
* fillColor: "#4F81BD",
|
|
2649
|
+
* text: "CEO",
|
|
2650
|
+
* };
|
|
2651
|
+
* // => satisfies PptxSmartArtDrawingShape
|
|
2652
|
+
* ```
|
|
2653
|
+
*/
|
|
2654
|
+
interface PptxSmartArtDrawingShape extends PptxCustomPathProperties {
|
|
2655
|
+
/** Shape ID within the drawing. */
|
|
2656
|
+
id: string;
|
|
2657
|
+
/** Preset geometry type (e.g. "roundRect", "ellipse"). */
|
|
2658
|
+
shapeType?: string;
|
|
2659
|
+
/** Position and size in EMU-based pixels. */
|
|
2660
|
+
x: number;
|
|
2661
|
+
y: number;
|
|
2662
|
+
width: number;
|
|
2663
|
+
height: number;
|
|
2664
|
+
/** Rotation in degrees. */
|
|
2665
|
+
rotation?: number;
|
|
2666
|
+
/** Horizontal/vertical mirrors declared on the cached drawing transform. */
|
|
2667
|
+
flipHorizontal?: boolean;
|
|
2668
|
+
flipVertical?: boolean;
|
|
2669
|
+
/** Skew along the X axis in degrees. */
|
|
2670
|
+
skewX?: number;
|
|
2671
|
+
/** Skew along the Y axis in degrees. */
|
|
2672
|
+
skewY?: number;
|
|
2673
|
+
/** Preset-geometry adjustment values from `a:prstGeom/a:avLst`. */
|
|
2674
|
+
shapeAdjustments?: Record<string, number>;
|
|
2675
|
+
/**
|
|
2676
|
+
* The cached shape declares `a:noFill`. Renderers must leave it unpainted
|
|
2677
|
+
* rather than substituting a palette colour, because these shapes usually sit
|
|
2678
|
+
* on top of a painted shape whose fill has to stay visible.
|
|
2679
|
+
*/
|
|
2680
|
+
fillNone?: boolean;
|
|
2681
|
+
/** Solid fill colour (hex). */
|
|
2682
|
+
fillColor?: string;
|
|
2683
|
+
/**
|
|
2684
|
+
* Opacity (0..1) of the solid fill, from the colour's `a:alpha` (Basic Venn
|
|
2685
|
+
* paints its circles at 50% so overlaps blend). Absent when opaque.
|
|
2686
|
+
*/
|
|
2687
|
+
fillOpacity?: number;
|
|
2688
|
+
/**
|
|
2689
|
+
* Gradient fill stops when the cached shape uses `a:gradFill`. Positions are
|
|
2690
|
+
* 0..100 (percent). Renderers emit an SVG/CSS gradient instead of a flat box.
|
|
2691
|
+
*/
|
|
2692
|
+
fillGradientStops?: Array<{
|
|
2693
|
+
color: string;
|
|
2694
|
+
position: number;
|
|
2695
|
+
opacity?: number;
|
|
2696
|
+
}>;
|
|
2697
|
+
/** Gradient geometry type (`linear` for `a:lin`, `radial` for `a:path`). */
|
|
2698
|
+
fillGradientType?: 'linear' | 'radial';
|
|
2699
|
+
/** Linear gradient angle in degrees (0..360). */
|
|
2700
|
+
fillGradientAngle?: number;
|
|
2701
|
+
/** Pattern fill preset name from `a:pattFill/@prst` (e.g. "pct50", "cross"). */
|
|
2702
|
+
fillPatternPreset?: string;
|
|
2703
|
+
/** Pattern fill foreground colour (hex) from `a:pattFill/a:fgClr`. */
|
|
2704
|
+
fillPatternForegroundColor?: string;
|
|
2705
|
+
/** Pattern fill background colour (hex) from `a:pattFill/a:bgClr`. */
|
|
2706
|
+
fillPatternBackgroundColor?: string;
|
|
2707
|
+
/**
|
|
2708
|
+
* Relationship id of a picture (blip) fill's embedded image, from
|
|
2709
|
+
* `a:blipFill/a:blip/@r:embed`. The image bytes are resolved separately; see
|
|
2710
|
+
* {@link fillImageUrl}.
|
|
2711
|
+
*/
|
|
2712
|
+
fillBlipEmbedId?: string;
|
|
2713
|
+
/**
|
|
2714
|
+
* Resolved data-URI/URL for a picture (blip) fill, when the embedded image
|
|
2715
|
+
* part could be resolved. Absent when only {@link fillBlipEmbedId} is known.
|
|
2716
|
+
*/
|
|
2717
|
+
fillImageUrl?: string;
|
|
2718
|
+
/** Whether the cached shape carries an outer-shadow effect (`a:effectLst`). */
|
|
2719
|
+
hasShadow?: boolean;
|
|
2720
|
+
/** Resolved outer-shadow colour (hex), when present. */
|
|
2721
|
+
shadowColor?: string;
|
|
2722
|
+
/** Stroke colour (hex). */
|
|
2723
|
+
strokeColor?: string;
|
|
2724
|
+
/** Stroke width in points. */
|
|
2725
|
+
strokeWidth?: number;
|
|
2726
|
+
/** Text content of the shape. */
|
|
2727
|
+
text?: string;
|
|
2728
|
+
/** Standard rich-text segments projected from the associated SmartArt node. */
|
|
2729
|
+
textSegments?: TextSegment[];
|
|
2730
|
+
/** Font size in CSS pixels. */
|
|
2731
|
+
fontSize?: number;
|
|
2732
|
+
/** Font colour (hex). */
|
|
2733
|
+
fontColor?: string;
|
|
2734
|
+
/** Authored font family from the first styled run. */
|
|
2735
|
+
fontFamily?: string;
|
|
2736
|
+
/** Authored font weight (400 or 700). */
|
|
2737
|
+
fontWeight?: number;
|
|
2738
|
+
/** Authored font style. */
|
|
2739
|
+
fontStyle?: 'normal' | 'italic';
|
|
2740
|
+
/** Absolute line height in CSS pixels from `a:spcPts`. */
|
|
2741
|
+
lineHeight?: number;
|
|
2742
|
+
/** Relative line height from `a:spcPct`. */
|
|
2743
|
+
lineHeightRatio?: number;
|
|
2744
|
+
/** Absolute spacing after a paragraph in CSS pixels. */
|
|
2745
|
+
lineSpacingAfter?: number;
|
|
2746
|
+
/** Relative spacing after a paragraph. */
|
|
2747
|
+
lineSpacingAfterRatio?: number;
|
|
2748
|
+
/** Text-body insets in CSS pixels. */
|
|
2749
|
+
textInsetLeft?: number;
|
|
2750
|
+
textInsetTop?: number;
|
|
2751
|
+
textInsetRight?: number;
|
|
2752
|
+
textInsetBottom?: number;
|
|
2753
|
+
/** DiagramML text vertical anchor (`t`, `ctr`, or `b`). */
|
|
2754
|
+
textVerticalAnchor?: string;
|
|
2755
|
+
/** Independent DiagramML text-frame geometry from `dsp:txXfrm`. */
|
|
2756
|
+
textFrameX?: number;
|
|
2757
|
+
textFrameY?: number;
|
|
2758
|
+
textFrameWidth?: number;
|
|
2759
|
+
textFrameHeight?: number;
|
|
2760
|
+
/**
|
|
2761
|
+
* 3D scene (camera/light rig/backdrop) from `dsp:spPr/a:scene3d`, when this
|
|
2762
|
+
* cached shape carries its own per-shape camera. Bevel quick styles
|
|
2763
|
+
* (Polished, Inset, Cartoon, Powder) cache one per shape (always
|
|
2764
|
+
* `orthographicFront`, so the 2D layout stays undistorted). Scene quick
|
|
2765
|
+
* styles (Brick, Flat, Metallic, Sunset, Bird's Eye) instead put ONE camera
|
|
2766
|
+
* on the whole diagram (see `PptxSmartArtQuickStyle.scene3d`) and leave this
|
|
2767
|
+
* undefined on every shape.
|
|
2768
|
+
*/
|
|
2769
|
+
scene3d?: Pptx3DScene;
|
|
2770
|
+
/**
|
|
2771
|
+
* 3D extrusion/bevel/contour/material from `dsp:spPr/a:sp3d`. PowerPoint
|
|
2772
|
+
* caches this fully resolved (from the quick style's per-label `dgm:sp3d`)
|
|
2773
|
+
* on every shape for every non-flat quick style, bevel or scene alike.
|
|
2774
|
+
*/
|
|
2775
|
+
shape3d?: Pptx3DShape;
|
|
2776
|
+
/**
|
|
2777
|
+
* Text-body 3D extrusion/bevel from `dsp:txBody/a:bodyPr/a:sp3d`. Rare:
|
|
2778
|
+
* present when a quick style extrudes the label text itself off the shape
|
|
2779
|
+
* face (e.g. Bird's Eye Scene: `extrusionH="28000"`), rather than only the
|
|
2780
|
+
* shape body.
|
|
2781
|
+
*/
|
|
2782
|
+
text3d?: Text3DStyle;
|
|
2783
|
+
/**
|
|
2784
|
+
* The presentation style label (`presStyleLbl`: `node1`, `revTx`,
|
|
2785
|
+
* `sibTrans2D1`, ...) of the layout node a REGENERATED shape was laid out
|
|
2786
|
+
* from, when the layout engine reports it. Picks the quick-style label
|
|
2787
|
+
* whose 3D the shape takes; `undefined` on cached (parsed) shapes.
|
|
2788
|
+
*/
|
|
2789
|
+
styleLabel?: string;
|
|
2790
|
+
}
|
|
2791
|
+
/**
|
|
2792
|
+
* Presentation layout variables from `dgm:prSet/dgm:presLayoutVars` (data model)
|
|
2793
|
+
* or `dgm:varLst` (layout definition defaults).
|
|
2794
|
+
*
|
|
2795
|
+
* These drive how the DiagramML layout interpreter arranges points: flow
|
|
2796
|
+
* direction, hierarchy branch style, org-chart mode, and child count limits.
|
|
2797
|
+
* The fallback layout engine can consult them for direction/org-chart hints.
|
|
2798
|
+
*
|
|
2799
|
+
* @example
|
|
2800
|
+
* ```ts
|
|
2801
|
+
* const vars: PptxSmartArtPresLayoutVars = { direction: "rev", orgChart: true };
|
|
2802
|
+
* // => satisfies PptxSmartArtPresLayoutVars
|
|
2803
|
+
* ```
|
|
2804
|
+
*/
|
|
2805
|
+
interface PptxSmartArtPresLayoutVars {
|
|
2806
|
+
/** Flow direction (`dgm:dir`): "norm" (default) or "rev" (reversed/RTL). */
|
|
2807
|
+
direction?: 'norm' | 'rev';
|
|
2808
|
+
/** Hierarchy branch style (`dgm:hierBranch`): std/init/l/r/hang. */
|
|
2809
|
+
hierarchyBranch?: 'std' | 'init' | 'l' | 'r' | 'hang';
|
|
2810
|
+
/** Org-chart mode enabled (`dgm:orgChart`). */
|
|
2811
|
+
orgChart?: boolean;
|
|
2812
|
+
/** Maximum children per node (`dgm:chMax`, -1 = unbounded). */
|
|
2813
|
+
childMax?: number;
|
|
2814
|
+
/** Preferred children per node (`dgm:chPref`, -1 = unbounded). */
|
|
2815
|
+
childPreferred?: number;
|
|
2816
|
+
/** Whether bullets are enabled (`dgm:bulletEnabled`). */
|
|
2817
|
+
bulletEnabled?: boolean;
|
|
2818
|
+
/** Animation-by-level setting (`dgm:animLvl`). */
|
|
2819
|
+
animationLevel?: string;
|
|
2820
|
+
/** Animate-one setting (`dgm:animOne`). */
|
|
2821
|
+
animateOne?: string;
|
|
2822
|
+
/** Allowed resize handles (`dgm:resizeHandles`). */
|
|
2823
|
+
resizeHandles?: string;
|
|
2824
|
+
}
|
|
2825
|
+
/**
|
|
2826
|
+
* Complete parsed SmartArt data for a {@link SmartArtPptxElement}.
|
|
2827
|
+
*
|
|
2828
|
+
* @example
|
|
2829
|
+
* ```ts
|
|
2830
|
+
* const data: PptxSmartArtData = {
|
|
2831
|
+
* resolvedLayoutType: "hierarchy",
|
|
2832
|
+
* layout: "hierarchy",
|
|
2833
|
+
* colorScheme: "colorful1",
|
|
2834
|
+
* style: "moderate",
|
|
2835
|
+
* nodes: [
|
|
2836
|
+
* { id: "1", text: "CEO", children: [
|
|
2837
|
+
* { id: "2", text: "VP Marketing", parentId: "1" },
|
|
2838
|
+
* ]},
|
|
2839
|
+
* ],
|
|
2840
|
+
* };
|
|
2841
|
+
* // => satisfies PptxSmartArtData
|
|
2842
|
+
* ```
|
|
2843
|
+
*/
|
|
2844
|
+
interface PptxSmartArtData {
|
|
2845
|
+
layoutType?: string;
|
|
2846
|
+
resolvedLayoutType?: SmartArtLayoutType;
|
|
2847
|
+
/** Named layout preset (used when creating new SmartArt). */
|
|
2848
|
+
layout?: SmartArtLayout;
|
|
2849
|
+
/** Colour scheme for the SmartArt graphic. */
|
|
2850
|
+
colorScheme?: SmartArtColorScheme;
|
|
2851
|
+
/** Visual style intensity. */
|
|
2852
|
+
style?: SmartArtStyle;
|
|
2853
|
+
nodes: PptxSmartArtNode[];
|
|
2854
|
+
/** Connections between data-model nodes. */
|
|
2855
|
+
connections?: PptxSmartArtConnection[];
|
|
2856
|
+
/** Pre-computed shapes from `ppt/diagrams/drawing*.xml`. */
|
|
2857
|
+
drawingShapes?: PptxSmartArtDrawingShape[];
|
|
2858
|
+
/** Background and outline chrome from `dgm:bg` / `dgm:whole`. */
|
|
2859
|
+
chrome?: PptxSmartArtChrome;
|
|
2860
|
+
/** Colour transform from `ppt/diagrams/colors*.xml`. */
|
|
2861
|
+
colorTransform?: PptxSmartArtColorTransform;
|
|
2862
|
+
/** Quick style from `ppt/diagrams/quickStyles*.xml`. */
|
|
2863
|
+
quickStyle?: PptxSmartArtQuickStyle;
|
|
2864
|
+
/** Editable metadata from the related DiagramML layout definition. */
|
|
2865
|
+
layoutDefinition?: PptxSmartArtLayoutDefinition;
|
|
2866
|
+
/**
|
|
2867
|
+
* Presentation layout variables (direction, hierarchy branch, org-chart,
|
|
2868
|
+
* child limits, bullets) from `dgm:presLayoutVars` / layout `dgm:varLst`.
|
|
2869
|
+
* Consulted by the fallback layout engine for direction/org-chart hints.
|
|
2870
|
+
*/
|
|
2871
|
+
presLayoutVars?: PptxSmartArtPresLayoutVars;
|
|
2872
|
+
/**
|
|
2873
|
+
* The deck's own theme minor-Latin font (`a:fontScheme/a:minorFont/a:latin/
|
|
2874
|
+
* @typeface`): what SmartArt text actually renders in when no per-run
|
|
2875
|
+
* `a:latin` override is present (the common case - see
|
|
2876
|
+
* `smartart-layout-item-font-size.ts`'s font-fit, the one consumer).
|
|
2877
|
+
* Undefined when the theme carries no font scheme at all.
|
|
2878
|
+
*/
|
|
2879
|
+
themeMinorFont?: string;
|
|
2880
|
+
/** Relationship ID for the diagram data part (for round-trip save). */
|
|
2881
|
+
dataRelId?: string;
|
|
2882
|
+
/** Relationship ID for the diagram layout part. */
|
|
2883
|
+
layoutRelId?: string;
|
|
2884
|
+
/** Relationship ID for the drawing part. */
|
|
2885
|
+
drawingRelId?: string;
|
|
2886
|
+
/** Relationship ID for the colours part. */
|
|
2887
|
+
colorsRelId?: string;
|
|
2888
|
+
/** Relationship ID for the quick-styles part. */
|
|
2889
|
+
styleRelId?: string;
|
|
2890
|
+
/**
|
|
2891
|
+
* `uniqueId` of the built-in PowerPoint layout whose definition was applied by a layout swap
|
|
2892
|
+
* (`ooxml-core/pptx/smartart-layouts`). Save writes that definition as the layout part.
|
|
2893
|
+
*/
|
|
2894
|
+
builtinLayoutId?: string;
|
|
2895
|
+
/** Internal save hint: the layout definition changed in the editor. */
|
|
2896
|
+
layoutDirty?: boolean;
|
|
2897
|
+
/** Internal save hint: typed layout-definition metadata changed. */
|
|
2898
|
+
layoutDefinitionDirty?: boolean;
|
|
2899
|
+
/** Internal save hint: quick-style definition metadata changed. */
|
|
2900
|
+
quickStyleDirty?: boolean;
|
|
2901
|
+
/** Internal save hint: color-transform definition metadata changed. */
|
|
2902
|
+
colorTransformDirty?: boolean;
|
|
2903
|
+
/** Internal save hint: cached drawing geometry or text changed in the editor. */
|
|
2904
|
+
drawingDirty?: boolean;
|
|
2905
|
+
}
|
|
2906
|
+
//#endregion
|
|
2907
|
+
export { CustomGeometrySegment as $, PptxSmartArtChoose as A, UnderlineStyle as At, PptxSmartArtConstraintOperator as B, PptxSmartArtTextParagraph as C, Text3DStyle as Ct, PptxSmartArtLayoutDefinition as D, PptxShapeLocks as Dt, SmartArtNodeCustomLayout as E, PptxDrawingGuide as Et, PptxSmartArtLayoutNodeShape as F, PptxSmartArtChrome as G, PptxSmartArtConstraintRelationship as H, PptxSmartArtLocalizedText as I, AdjustHandleXY as J, PptxSmartArtRawBackgroundFill as K, PptxSmartArtShapeAdjustment as L, PptxSmartArtIteratorAttributes as M, PptxSmartArtLayoutAlgorithm as N, PptxSmartArtLayoutNode as O, ShadowEffect as Ot, PptxSmartArtLayoutCategory as P, CustomGeometryRawData as Q, PptxSmartArtWhen as R, PptxSmartArtNodeStyle as S, PptxTextWarpPreset as St, PptxSmartArtTextRun as T, ConnectorConnectionPoint as Tt, PptxSmartArtConstraintTarget as U, PptxSmartArtConstraintPointType as V, PptxSmartArtNumericRule as W, CustomGeometryPath as X, ConnectionSite as Y, CustomGeometryPoint as Z, PptxSmartArtQuickStyle as _, EffectDagXfrm as _t, SmartArtColorScheme as a, TextSegment as at, SmartArtRoleColorList as b, Pptx3DScene as bt, SmartArtStyle as c, EffectDagBlend as ct, PptxSmartArtColorStyleLabel as d, EffectDagContainer as dt, CustomGeometryTextRect as et, PptxSmartArtColorTransform as f, EffectDagContainerType as ft, PptxSmartArtHueDirection as g, EffectDagRelOff as gt, PptxSmartArtDefinitionText as h, EffectDagRawLeaf as ht, PptxSmartArtPresLayoutVars as i, TextOrientationMatrix as it, PptxSmartArtForEach as j, XmlObject as jt, PptxSmartArtAlgorithmParameter as k, StrokeDashType as kt, PptxSmartArtColorApplicationMethod as l, EffectDagBlendMode as lt, PptxSmartArtDefinitionMetadata as m, EffectDagPresetShadow as mt, PptxSmartArtData as n, PptxCustomPathProperties as nt, SmartArtLayout as o, TextStyle as ot, PptxSmartArtDefinitionCategory as p, EffectDagNode as pt, AdjustHandlePolar as q, PptxSmartArtDrawingShape as r, BulletInfo as rt, SmartArtLayoutType as s, EffectDagAlphaOutset as st, PptxSmartArtConnection as t, GeometryAdjustmentHandle as tt, PptxSmartArtColorListMetadata as u, EffectDagBlur as ut, PptxSmartArtQuickStyleLabel as v, BevelPresetType as vt, PptxSmartArtTextParagraphItem as w, ConnectorArrowType as wt, PptxSmartArtNode as x, Pptx3DShape as xt, PptxSmartArtResolvedStyleRef as y, MaterialPresetType as yt, PptxSmartArtConstraint as z };
|
|
2908
|
+
//# sourceMappingURL=smart-art-CO2jmJFf.d.ts.map
|