ooxml-core 1.9.0 → 1.11.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/PptxHandler-DNZHAHUY.cjs +12 -0
- package/dist/PptxHandler-E44KDHMQ.mjs +3 -0
- package/dist/{PptxHandler-EX4WBIQQ.mjs → PptxHandler-NROFYT2N.mjs} +2 -2
- package/dist/automation/index.cjs +3236 -2258
- package/dist/automation/index.mjs +3236 -2258
- package/dist/{chunk-SWF7KVL5.cjs → chunk-2UVH6RHI.cjs} +1608 -1163
- package/dist/{chunk-M76PHYRR.mjs → chunk-7DSZI7S6.mjs} +1 -1
- package/dist/{chunk-AT66SA5M.cjs → chunk-7QZGRB3T.cjs} +28 -10
- package/dist/chunk-ANZ4Q6I3.cjs +21 -0
- package/dist/{chunk-CPKNMQLX.cjs → chunk-AWIDASUW.cjs} +25 -2
- package/dist/{chunk-SVQZXP3F.mjs → chunk-CBNKBVX5.mjs} +25 -2
- package/dist/{chunk-FIELY5PI.mjs → chunk-EC2W2MDY.mjs} +30 -2
- package/dist/chunk-EGTRL3QJ.mjs +19 -0
- package/dist/chunk-GXHKNSZX.mjs +9 -0
- package/dist/{chunk-OXHMZS7B.mjs → chunk-HCXUI5UC.mjs} +943 -273
- package/dist/chunk-HDQXPSHY.cjs +17 -0
- package/dist/chunk-KTYBFGEY.mjs +14 -0
- package/dist/chunk-QOO36KG4.cjs +42 -0
- package/dist/chunk-R2KZXD6U.mjs +39 -0
- package/dist/{chunk-IGOA57LE.mjs → chunk-U2DF3EGK.mjs} +1 -1
- package/dist/{chunk-OB277ZGE.mjs → chunk-UAY26XOI.mjs} +27 -9
- package/dist/{chunk-WSO4T2LJ.mjs → chunk-W5ARCUJB.mjs} +26 -3
- package/dist/chunk-XZPZHXV4.cjs +12 -0
- package/dist/{chunk-LCS3J3QI.mjs → chunk-YB5SRNFS.mjs} +717 -272
- package/dist/docx/layout/adapt-table.d.ts +2 -2
- package/dist/docx/layout/adapt-table.d.ts.map +1 -1
- package/dist/docx/layout/flow-table.d.ts.map +1 -1
- package/dist/docx/layout/index.cjs +554 -83
- package/dist/docx/layout/index.mjs +554 -84
- package/dist/docx/layout/nested-fragment-edges.d.ts +9 -0
- package/dist/docx/layout/nested-fragment-edges.d.ts.map +1 -0
- package/dist/docx/layout/nested-frame-profile.d.ts +9 -0
- package/dist/docx/layout/nested-frame-profile.d.ts.map +1 -0
- package/dist/docx/layout/page-cursor.d.ts +2 -0
- package/dist/docx/layout/page-cursor.d.ts.map +1 -1
- package/dist/docx/layout/result.d.ts +20 -0
- package/dist/docx/layout/result.d.ts.map +1 -1
- package/dist/docx/layout/table-border-layout.d.ts +16 -0
- package/dist/docx/layout/table-border-layout.d.ts.map +1 -0
- package/dist/docx/layout/table-cell-layout.d.ts +3 -2
- package/dist/docx/layout/table-cell-layout.d.ts.map +1 -1
- package/dist/docx/layout/table-content.d.ts +4 -0
- package/dist/docx/layout/table-content.d.ts.map +1 -0
- package/dist/docx/layout/table-footnotes.d.ts +5 -0
- package/dist/docx/layout/table-footnotes.d.ts.map +1 -1
- package/dist/docx/layout/table-frames.d.ts +4 -0
- package/dist/docx/layout/table-frames.d.ts.map +1 -0
- package/dist/docx/layout/table-layout.d.ts +8 -3
- package/dist/docx/layout/table-layout.d.ts.map +1 -1
- package/dist/docx/layout/table-note-completion.d.ts +5 -0
- package/dist/docx/layout/table-note-completion.d.ts.map +1 -0
- package/dist/docx/layout/table-note-stories.d.ts +6 -0
- package/dist/docx/layout/table-note-stories.d.ts.map +1 -0
- package/dist/pptx/automation/index.cjs +801 -296
- package/dist/pptx/automation/index.d.ts +5 -4
- package/dist/pptx/automation/index.d.ts.map +1 -1
- package/dist/pptx/automation/index.mjs +5 -5
- package/dist/pptx/chunks/{text-operations-BLodkuXE.d.ts → elements-DD3UGOMd.d.ts} +27 -3248
- package/dist/pptx/chunks/elements-DD3UGOMd.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-B4cnSPNz.d.ts → index-BZrFyNtU.d.ts} +113 -5
- package/dist/pptx/chunks/index-BZrFyNtU.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-BZh-IMkN.d.ts → index-DdX02BSm.d.ts} +19 -3
- package/dist/pptx/chunks/index-DdX02BSm.d.ts.map +1 -0
- package/dist/pptx/chunks/smart-art-ENMMEbmW.d.ts +1512 -0
- package/dist/pptx/chunks/smart-art-ENMMEbmW.d.ts.map +1 -0
- package/dist/pptx/chunks/text-D49FKllA.d.ts +1473 -0
- package/dist/pptx/chunks/text-D49FKllA.d.ts.map +1 -0
- package/dist/pptx/chunks/text-operations-CyMTMfID.d.ts +3261 -0
- package/dist/pptx/chunks/text-operations-CyMTMfID.d.ts.map +1 -0
- package/dist/pptx/cli/index.cjs +801 -296
- package/dist/pptx/cli/index.d.ts +1 -1
- package/dist/pptx/cli/index.mjs +4 -4
- package/dist/pptx/converter/index.cjs +1 -0
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/converter/index.mjs +2 -2
- package/dist/pptx/editor/render/collaboration-live-patch-target.cjs +2 -2
- package/dist/pptx/editor/render/collaboration-live-patch-target.mjs +1 -1
- package/dist/pptx/editor/render/find-replace.cjs +19 -18
- package/dist/pptx/editor/render/find-replace.d.ts +2 -2
- package/dist/pptx/editor/render/find-replace.mjs +3 -2
- package/dist/pptx/editor/render/font-family-update.cjs +14 -0
- package/dist/pptx/editor/render/font-family-update.d.ts +17 -0
- package/dist/pptx/editor/render/font-family-update.d.ts.map +1 -0
- package/dist/pptx/editor/render/font-family-update.mjs +1 -0
- package/dist/pptx/editor/render/paragraph-geometry-overrides.cjs +14 -0
- package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts +17 -0
- package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts.map +1 -0
- package/dist/pptx/editor/render/paragraph-geometry-overrides.mjs +12 -0
- package/dist/pptx/editor/render/remap-text.cjs +2 -2
- package/dist/pptx/editor/render/remap-text.d.ts.map +1 -1
- package/dist/pptx/editor/render/remap-text.mjs +1 -1
- package/dist/pptx/editor/render/slide-operations.cjs +9 -8
- package/dist/pptx/editor/render/slide-operations.mjs +3 -2
- package/dist/pptx/editor/render/table-data-grid-ops.cjs +1 -1
- package/dist/pptx/editor/render/table-data-grid-ops.mjs +1 -1
- package/dist/pptx/editor/render/text-content-style.cjs +18 -0
- package/dist/pptx/editor/render/text-content-style.d.ts +9 -0
- package/dist/pptx/editor/render/text-content-style.d.ts.map +1 -0
- package/dist/pptx/editor/render/text-content-style.mjs +5 -0
- package/dist/pptx/editor/render/text-runs-style-patch.cjs +17 -0
- package/dist/pptx/editor/render/text-runs-style-patch.d.ts +7 -0
- package/dist/pptx/editor/render/text-runs-style-patch.d.ts.map +1 -0
- package/dist/pptx/editor/render/text-runs-style-patch.mjs +15 -0
- package/dist/pptx/editor/render/text-style-scope.cjs +173 -0
- package/dist/pptx/editor/render/text-style-scope.d.ts +76 -0
- package/dist/pptx/editor/render/text-style-scope.d.ts.map +1 -0
- package/dist/pptx/editor/render/text-style-scope.mjs +164 -0
- package/dist/pptx/editor/render/theme-editor-model.cjs +1 -1
- package/dist/pptx/editor/render/theme-editor-model.mjs +1 -1
- package/dist/pptx/editor/render/update-text-segment-style.cjs +11 -0
- package/dist/pptx/editor/render/update-text-segment-style.d.ts +14 -0
- package/dist/pptx/editor/render/update-text-segment-style.d.ts.map +1 -0
- package/dist/pptx/editor/render/update-text-segment-style.mjs +2 -0
- package/dist/pptx/index.cjs +1091 -296
- package/dist/pptx/index.d.ts +7 -5
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/smartart-layouts/index.d.ts +1 -1
- package/dist/teams/index.cjs +590 -122
- package/dist/teams/index.mjs +590 -122
- package/dist/visio/date-cache.d.ts +3 -0
- package/dist/visio/date-cache.d.ts.map +1 -0
- package/dist/visio/edit-commands.d.ts +3 -3
- package/dist/visio/edit-commands.d.ts.map +1 -1
- package/dist/visio/edit-formatting-scope.d.ts.map +1 -1
- package/dist/visio/edit-recalculate-index.d.ts.map +1 -1
- package/dist/visio/edit-text-field-commands.d.ts +15 -0
- package/dist/visio/edit-text-field-commands.d.ts.map +1 -1
- package/dist/visio/edit-text-field.d.ts +2 -2
- package/dist/visio/edit-text-field.d.ts.map +1 -1
- package/dist/visio/edit.d.ts +1 -1
- package/dist/visio/edit.d.ts.map +1 -1
- package/dist/visio/index.cjs +501 -220
- package/dist/visio/index.d.ts +1 -1
- package/dist/visio/index.d.ts.map +1 -1
- package/dist/visio/index.mjs +501 -220
- package/dist/visio/model.d.ts +6 -0
- package/dist/visio/model.d.ts.map +1 -1
- package/dist/visio/shape-metadata.d.ts.map +1 -1
- package/dist/visio/shapes.d.ts.map +1 -1
- package/dist/visio/style.d.ts +1 -1
- package/dist/visio/style.d.ts.map +1 -1
- package/dist/visio/text-field-display.d.ts +3 -0
- package/dist/visio/text-field-display.d.ts.map +1 -1
- package/dist/visio/text-field-editability.d.ts +6 -0
- package/dist/visio/text-field-editability.d.ts.map +1 -0
- package/dist/visio/text-field-fraction.d.ts +3 -0
- package/dist/visio/text-field-fraction.d.ts.map +1 -0
- package/dist/visio/text-field-independent.d.ts +4 -0
- package/dist/visio/text-field-independent.d.ts.map +1 -0
- package/dist/visio/text-field-numeric.d.ts +1 -1
- package/dist/visio/text-field-numeric.d.ts.map +1 -1
- package/dist/visio/text-field-source.d.ts +6 -0
- package/dist/visio/text-field-source.d.ts.map +1 -0
- package/dist/visio/text-field-system-date.d.ts +4 -0
- package/dist/visio/text-field-system-date.d.ts.map +1 -0
- package/dist/visio/text-fields.d.ts +1 -0
- package/dist/visio/text-fields.d.ts.map +1 -1
- package/dist/visio/ui/edit-commands.d.ts.map +1 -1
- package/dist/visio/ui/index.cjs +514 -221
- package/dist/visio/ui/index.mjs +514 -221
- package/dist/visio/ui/snapshot-scene.d.ts.map +1 -1
- package/dist/visio/ui/text-field-catalog.d.ts.map +1 -1
- package/dist/xlsx/edit/pivots.d.ts.map +1 -1
- package/dist/xlsx/index.cjs +1362 -659
- package/dist/xlsx/index.mjs +1361 -660
- package/dist/xlsx/load/index.cjs +1091 -430
- package/dist/xlsx/load/index.mjs +1091 -430
- package/dist/xlsx/model-pivots.d.ts +31 -2
- package/dist/xlsx/model-pivots.d.ts.map +1 -1
- package/dist/xlsx/pivot/admission.d.ts.map +1 -1
- package/dist/xlsx/pivot/aggregate.d.ts +3 -1
- package/dist/xlsx/pivot/aggregate.d.ts.map +1 -1
- package/dist/xlsx/pivot/data.d.ts +2 -2
- package/dist/xlsx/pivot/data.d.ts.map +1 -1
- package/dist/xlsx/pivot/hierarchy-first.d.ts +21 -0
- package/dist/xlsx/pivot/hierarchy-first.d.ts.map +1 -0
- package/dist/xlsx/pivot/hierarchy.d.ts +2 -4
- package/dist/xlsx/pivot/hierarchy.d.ts.map +1 -1
- package/dist/xlsx/pivot/index.d.ts +2 -0
- package/dist/xlsx/pivot/index.d.ts.map +1 -1
- package/dist/xlsx/pivot/measures.d.ts +13 -0
- package/dist/xlsx/pivot/measures.d.ts.map +1 -0
- package/dist/xlsx/pivot/page-filter-admission.d.ts +5 -0
- package/dist/xlsx/pivot/page-filter-admission.d.ts.map +1 -0
- package/dist/xlsx/pivot/page-filter.d.ts +11 -0
- package/dist/xlsx/pivot/page-filter.d.ts.map +1 -0
- package/dist/xlsx/pivot/read.d.ts.map +1 -1
- package/dist/xlsx/pivot/table-xml.d.ts.map +1 -1
- package/dist/xlsx/pivot/values-axis.d.ts +12 -0
- package/dist/xlsx/pivot/values-axis.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/navigation.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/i18n/pivots.d.ts.map +1 -1
- package/dist/xlsx/ui/index.cjs +640 -137
- package/dist/xlsx/ui/index.mjs +640 -137
- package/package.json +2 -2
- package/dist/PptxHandler-AT7FVG5Q.mjs +0 -2
- package/dist/PptxHandler-VFSCECPL.cjs +0 -11
- package/dist/pptx/chunks/index-B4cnSPNz.d.ts.map +0 -1
- package/dist/pptx/chunks/index-BZh-IMkN.d.ts.map +0 -1
- package/dist/pptx/chunks/smart-art-Q2kZQtHh.d.ts +0 -2970
- package/dist/pptx/chunks/smart-art-Q2kZQtHh.d.ts.map +0 -1
- package/dist/pptx/chunks/text-operations-BLodkuXE.d.ts.map +0 -1
|
@@ -0,0 +1,1512 @@
|
|
|
1
|
+
import { i as TextStyle, k as XmlObject, r as TextSegment, v as Pptx3DScene, x as Text3DStyle, y as Pptx3DShape } from "./text-D49FKllA.js";
|
|
2
|
+
//#region pptx/core/types/geometry.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Geometry types: adjustment handles, custom geometry points, segments,
|
|
5
|
+
* paths, and custom path properties.
|
|
6
|
+
*
|
|
7
|
+
* @module pptx-types/geometry
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Defines an adjustment handle position for a shape geometry.
|
|
11
|
+
*
|
|
12
|
+
* Adjustment handles allow users to interactively reshape preset shapes
|
|
13
|
+
* (e.g. rounding a rectangle corner or adjusting arrow head width).
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const handle: GeometryAdjustmentHandle = {
|
|
18
|
+
* guideName: "adj",
|
|
19
|
+
* xFraction: 0.25,
|
|
20
|
+
* minValue: 0,
|
|
21
|
+
* maxValue: 50000,
|
|
22
|
+
* };
|
|
23
|
+
* // => satisfies GeometryAdjustmentHandle
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
interface GeometryAdjustmentHandle {
|
|
27
|
+
/** Name of the adjustment guide this handle controls (e.g. "adj", "adj1"). */
|
|
28
|
+
guideName: string;
|
|
29
|
+
/** X position as a fraction of shape width (0..1), or undefined if the handle only moves vertically. */
|
|
30
|
+
xFraction?: number;
|
|
31
|
+
/** Y position as a fraction of shape height (0..1), or undefined if the handle only moves horizontally. */
|
|
32
|
+
yFraction?: number;
|
|
33
|
+
/** Minimum allowed value for the adjustment guide. */
|
|
34
|
+
minValue?: number;
|
|
35
|
+
/** Maximum allowed value for the adjustment guide. */
|
|
36
|
+
maxValue?: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A single point in a custom geometry path.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const pt: CustomGeometryPoint = { x: 100, y: 200 };
|
|
44
|
+
* // => satisfies CustomGeometryPoint
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
interface CustomGeometryPoint {
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* A segment within a custom geometry path.
|
|
53
|
+
*
|
|
54
|
+
* Discriminated union over `type` — can be a moveTo, lineTo,
|
|
55
|
+
* cubic Bézier, quadratic Bézier, or close command.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* const segments: CustomGeometrySegment[] = [
|
|
60
|
+
* { type: "moveTo", pt: { x: 0, y: 0 } },
|
|
61
|
+
* { type: "lineTo", pt: { x: 100, y: 0 } },
|
|
62
|
+
* { type: "lineTo", pt: { x: 100, y: 100 } },
|
|
63
|
+
* { type: "close" },
|
|
64
|
+
* ];
|
|
65
|
+
* // => satisfies CustomGeometrySegment[]
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
type CustomGeometrySegment = {
|
|
69
|
+
type: 'moveTo';
|
|
70
|
+
pt: CustomGeometryPoint;
|
|
71
|
+
} | {
|
|
72
|
+
type: 'lineTo';
|
|
73
|
+
pt: CustomGeometryPoint;
|
|
74
|
+
} | {
|
|
75
|
+
type: 'cubicBezTo';
|
|
76
|
+
pts: [CustomGeometryPoint, CustomGeometryPoint, CustomGeometryPoint];
|
|
77
|
+
} | {
|
|
78
|
+
type: 'quadBezTo';
|
|
79
|
+
pts: [CustomGeometryPoint, CustomGeometryPoint];
|
|
80
|
+
} | {
|
|
81
|
+
type: 'arcTo';
|
|
82
|
+
/** Horizontal radius of the ellipse. */
|
|
83
|
+
wR: number;
|
|
84
|
+
/** Vertical radius of the ellipse. */
|
|
85
|
+
hR: number;
|
|
86
|
+
/** Start angle in 60000ths of a degree. */
|
|
87
|
+
stAng: number;
|
|
88
|
+
/** Sweep angle in 60000ths of a degree. */
|
|
89
|
+
swAng: number;
|
|
90
|
+
} | {
|
|
91
|
+
type: 'close';
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* A single sub-path in a custom geometry definition (maps to one `a:path`).
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```ts
|
|
98
|
+
* const path: CustomGeometryPath = {
|
|
99
|
+
* width: 100,
|
|
100
|
+
* height: 100,
|
|
101
|
+
* segments: [
|
|
102
|
+
* { type: "moveTo", pt: { x: 0, y: 0 } },
|
|
103
|
+
* { type: "lineTo", pt: { x: 100, y: 100 } },
|
|
104
|
+
* ],
|
|
105
|
+
* };
|
|
106
|
+
* // => satisfies CustomGeometryPath
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
interface CustomGeometryPath {
|
|
110
|
+
/** Coordinate-space width for this sub-path. */
|
|
111
|
+
width: number;
|
|
112
|
+
/** Coordinate-space height for this sub-path. */
|
|
113
|
+
height: number;
|
|
114
|
+
/** Ordered list of drawing segments. */
|
|
115
|
+
segments: CustomGeometrySegment[];
|
|
116
|
+
/** Path fill mode (`a:path/@fill`): norm, lighten, lightenLess, darken, darkenLess, none. */
|
|
117
|
+
fillMode?: 'norm' | 'lighten' | 'lightenLess' | 'darken' | 'darkenLess' | 'none';
|
|
118
|
+
/** Whether the path is stroked (`a:path/@stroke`). */
|
|
119
|
+
stroke?: boolean;
|
|
120
|
+
/** 3D extrusion compatibility (`a:path/@extrusionOk`). */
|
|
121
|
+
extrusionOk?: boolean;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Auxiliary raw XML preserved from `a:custGeom` for round-trip serialization.
|
|
125
|
+
* These are stored opaquely so adjustment guides, handles, connection sites,
|
|
126
|
+
* and the text rectangle are not lost when a custGeom is edited and saved.
|
|
127
|
+
*/
|
|
128
|
+
interface CustomGeometryRawData {
|
|
129
|
+
/** Raw `a:avLst` XML content (adjustment value list). */
|
|
130
|
+
avLstXml?: unknown;
|
|
131
|
+
/** Raw `a:gdLst` XML content (guide list). */
|
|
132
|
+
gdLstXml?: unknown;
|
|
133
|
+
/** Raw `a:ahLst` XML content (adjustment handles). */
|
|
134
|
+
ahLstXml?: unknown;
|
|
135
|
+
/** Raw `a:cxnLst` XML content (connection sites). */
|
|
136
|
+
cxnLstXml?: unknown;
|
|
137
|
+
/** Raw `a:rect` XML content (text rectangle). */
|
|
138
|
+
rectXml?: unknown;
|
|
139
|
+
/**
|
|
140
|
+
* Raw `a:pathLst` XML content: every `a:path`'s formula-bearing `a:pt`
|
|
141
|
+
* x/y attributes, `a:arcTo` params, `a:close`, and per-path `@w`/`@h`/
|
|
142
|
+
* `@fill`/`@stroke`/`@extrusionOk`, preserved verbatim (not the
|
|
143
|
+
* parse-time-resolved numbers in `customGeometryPaths`). Lets a live
|
|
144
|
+
* `shapeAdjustments` drag re-evaluate the outline against the CURRENT
|
|
145
|
+
* guide values instead of the ones baked in at parse time; see
|
|
146
|
+
* `geometry/custom-geometry-live-eval.ts`.
|
|
147
|
+
*/
|
|
148
|
+
pathLstXml?: unknown;
|
|
149
|
+
/**
|
|
150
|
+
* Source command order of each `a:path` in {@link pathLstXml} (one list per
|
|
151
|
+
* path, in document order). The parsed tree groups a path's commands by
|
|
152
|
+
* type, and the order the parser attaches to it is keyed by object
|
|
153
|
+
* identity, so it does not survive a copy (undo snapshots, duplicate,
|
|
154
|
+
* paste, `structuredClone`, reactive proxies). Kept here as plain data so
|
|
155
|
+
* re-evaluating a copied `pathLstXml` still draws and saves the commands
|
|
156
|
+
* in their authored order; see `restorePathListCommandOrder`.
|
|
157
|
+
*/
|
|
158
|
+
pathCommandOrder?: string[][];
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* XY-style adjustment handle (`a:ahXY`) on a custom geometry.
|
|
162
|
+
*
|
|
163
|
+
* Allows interactive editing of one or two guide values constrained to a
|
|
164
|
+
* rectangular range. Coordinates are formula references (e.g. `"adj1"`,
|
|
165
|
+
* `"w/2"`, `"0"`) preserved verbatim so they can re-emit unchanged.
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```ts
|
|
169
|
+
* const handle: AdjustHandleXY = {
|
|
170
|
+
* gdRefX: "adj1",
|
|
171
|
+
* minX: "0",
|
|
172
|
+
* maxX: "w",
|
|
173
|
+
* posX: "adj1",
|
|
174
|
+
* posY: "h/2",
|
|
175
|
+
* };
|
|
176
|
+
* // => satisfies AdjustHandleXY
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
interface AdjustHandleXY {
|
|
180
|
+
/** Guide reference for the X axis (`@_gdRefX`). */
|
|
181
|
+
gdRefX?: string;
|
|
182
|
+
/** Guide reference for the Y axis (`@_gdRefY`). */
|
|
183
|
+
gdRefY?: string;
|
|
184
|
+
/** Minimum X value, as a formula reference (`@_minX`). */
|
|
185
|
+
minX?: string;
|
|
186
|
+
/** Maximum X value (`@_maxX`). */
|
|
187
|
+
maxX?: string;
|
|
188
|
+
/** Minimum Y value (`@_minY`). */
|
|
189
|
+
minY?: string;
|
|
190
|
+
/** Maximum Y value (`@_maxY`). */
|
|
191
|
+
maxY?: string;
|
|
192
|
+
/** Handle position X (formula or literal) from `a:pos/@_x`. */
|
|
193
|
+
posX?: string;
|
|
194
|
+
/** Handle position Y from `a:pos/@_y`. */
|
|
195
|
+
posY?: string;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Polar-style adjustment handle (`a:ahPolar`) on a custom geometry.
|
|
199
|
+
*
|
|
200
|
+
* Drives a guide via radial distance and angle rather than XY coordinates.
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* ```ts
|
|
204
|
+
* const handle: AdjustHandlePolar = {
|
|
205
|
+
* gdRefR: "adj1",
|
|
206
|
+
* gdRefAng: "adj2",
|
|
207
|
+
* posX: "wd2",
|
|
208
|
+
* posY: "hd2",
|
|
209
|
+
* };
|
|
210
|
+
* // => satisfies AdjustHandlePolar
|
|
211
|
+
* ```
|
|
212
|
+
*/
|
|
213
|
+
interface AdjustHandlePolar {
|
|
214
|
+
/** Guide reference for the radial distance (`@_gdRefR`). */
|
|
215
|
+
gdRefR?: string;
|
|
216
|
+
/** Guide reference for the angle (`@_gdRefAng`). */
|
|
217
|
+
gdRefAng?: string;
|
|
218
|
+
/** Minimum radial value (`@_minR`). */
|
|
219
|
+
minR?: string;
|
|
220
|
+
/** Maximum radial value (`@_maxR`). */
|
|
221
|
+
maxR?: string;
|
|
222
|
+
/** Minimum angle (`@_minAng`). */
|
|
223
|
+
minAng?: string;
|
|
224
|
+
/** Maximum angle (`@_maxAng`). */
|
|
225
|
+
maxAng?: string;
|
|
226
|
+
/** Handle position X from `a:pos/@_x`. */
|
|
227
|
+
posX?: string;
|
|
228
|
+
/** Handle position Y from `a:pos/@_y`. */
|
|
229
|
+
posY?: string;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Connection site (`a:cxn`) on a custom geometry.
|
|
233
|
+
*
|
|
234
|
+
* Defines a point on a custom shape that connectors may snap to.
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* ```ts
|
|
238
|
+
* const cxn: ConnectionSite = { ang: "0", posX: "0", posY: "hd2" };
|
|
239
|
+
* // => satisfies ConnectionSite
|
|
240
|
+
* ```
|
|
241
|
+
*/
|
|
242
|
+
interface ConnectionSite {
|
|
243
|
+
/** Approach angle (`@_ang`) — formula or literal degree-1/60000 value. */
|
|
244
|
+
ang?: string;
|
|
245
|
+
/** Site position X from `a:pos/@_x`. */
|
|
246
|
+
posX?: string;
|
|
247
|
+
/** Site position Y from `a:pos/@_y`. */
|
|
248
|
+
posY?: string;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Typed text rectangle (`a:rect`) on a custom geometry.
|
|
252
|
+
*
|
|
253
|
+
* Each edge is the formula or literal string preserved from the source XML
|
|
254
|
+
* (`"l"`, `"t"`, `"r"`, `"b"`, or any guide name / formula).
|
|
255
|
+
*/
|
|
256
|
+
interface CustomGeometryTextRect {
|
|
257
|
+
/** Left edge formula reference (`@_l`). */
|
|
258
|
+
l?: string;
|
|
259
|
+
/** Top edge (`@_t`). */
|
|
260
|
+
t?: string;
|
|
261
|
+
/** Right edge (`@_r`). */
|
|
262
|
+
r?: string;
|
|
263
|
+
/** Bottom edge (`@_b`). */
|
|
264
|
+
b?: string;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Custom (non-preset) geometry path — only on shapes and pictures.
|
|
268
|
+
*
|
|
269
|
+
* Contains SVG path data and/or structured custom geometry paths
|
|
270
|
+
* parsed from `a:custGeom/a:pathLst`.
|
|
271
|
+
*
|
|
272
|
+
* @example
|
|
273
|
+
* ```ts
|
|
274
|
+
* const custom: PptxCustomPathProperties = {
|
|
275
|
+
* pathData: "M 0 0 L 100 0 L 100 100 Z",
|
|
276
|
+
* pathWidth: 100,
|
|
277
|
+
* pathHeight: 100,
|
|
278
|
+
* };
|
|
279
|
+
* // => satisfies PptxCustomPathProperties
|
|
280
|
+
* ```
|
|
281
|
+
*/
|
|
282
|
+
interface PptxCustomPathProperties {
|
|
283
|
+
/** SVG path data for custom shapes. */
|
|
284
|
+
pathData?: string;
|
|
285
|
+
/** Coordinate-space width for the custom path. */
|
|
286
|
+
pathWidth?: number;
|
|
287
|
+
/** Coordinate-space height for the custom path. */
|
|
288
|
+
pathHeight?: number;
|
|
289
|
+
/** Structured custom geometry paths for editing (maps to a:custGeom/a:pathLst). */
|
|
290
|
+
customGeometryPaths?: CustomGeometryPath[];
|
|
291
|
+
/** Raw adjustment/guide/handle/connection/text-rectangle XML preserved for serialization. */
|
|
292
|
+
customGeometryRawData?: CustomGeometryRawData;
|
|
293
|
+
/**
|
|
294
|
+
* Typed XY adjustment handles parsed from `a:custGeom/a:ahLst/a:ahXY`.
|
|
295
|
+
* SDK-built shapes can populate this and the writer will emit `<a:ahXY>` entries
|
|
296
|
+
* even when no raw XML was preserved.
|
|
297
|
+
*/
|
|
298
|
+
customGeometryAdjustHandlesXY?: AdjustHandleXY[];
|
|
299
|
+
/**
|
|
300
|
+
* Typed polar adjustment handles parsed from `a:custGeom/a:ahLst/a:ahPolar`.
|
|
301
|
+
*/
|
|
302
|
+
customGeometryAdjustHandlesPolar?: AdjustHandlePolar[];
|
|
303
|
+
/**
|
|
304
|
+
* Typed connection sites parsed from `a:custGeom/a:cxnLst/a:cxn`.
|
|
305
|
+
*/
|
|
306
|
+
customGeometryConnectionSites?: ConnectionSite[];
|
|
307
|
+
/**
|
|
308
|
+
* Typed text rectangle parsed from `a:custGeom/a:rect`. When present this is
|
|
309
|
+
* preferred over {@link customGeometryRawData}'s `rectXml` on save.
|
|
310
|
+
*/
|
|
311
|
+
customGeometryTextRect?: CustomGeometryTextRect;
|
|
312
|
+
}
|
|
313
|
+
//#endregion
|
|
314
|
+
//#region diagram/types.d.ts
|
|
315
|
+
/** Resolved SmartArt layout family. */
|
|
316
|
+
type DiagramLayoutType = 'list' | 'process' | 'cycle' | 'hierarchy' | 'relationship' | 'matrix' | 'pyramid' | 'funnel' | 'gear' | 'target' | 'timeline' | 'venn' | 'chevron' | 'bending' | 'unknown';
|
|
317
|
+
/** SmartArt colour scheme presets. */
|
|
318
|
+
type DiagramColorScheme = 'colorful1' | 'colorful2' | 'colorful3' | 'monochromatic1' | 'monochromatic2';
|
|
319
|
+
/** SmartArt visual style intensity. */
|
|
320
|
+
type DiagramStyleIntensity = 'flat' | 'moderate' | 'intense';
|
|
321
|
+
/** A connection (`dgm:cxn`) between two data-model points. */
|
|
322
|
+
interface DiagramConnection {
|
|
323
|
+
/** Stable CT_Cxn model identifier. */
|
|
324
|
+
modelId?: string | null;
|
|
325
|
+
sourceId: string;
|
|
326
|
+
destId: string;
|
|
327
|
+
/** `parOf` (the schema default when omitted), `presOf`, `presParOf`, `unknownRelationship`. */
|
|
328
|
+
type?: string;
|
|
329
|
+
srcOrd?: number;
|
|
330
|
+
destOrd?: number;
|
|
331
|
+
/** Model ID of the parent transition point associated with this edge. */
|
|
332
|
+
parentTransitionId?: string | null;
|
|
333
|
+
/** Model ID of the sibling transition point associated with this edge. */
|
|
334
|
+
siblingTransitionId?: string | null;
|
|
335
|
+
/** Layout presentation identifier used by presentation connections. */
|
|
336
|
+
presentationId?: string | null;
|
|
337
|
+
/** Text typed onto the linked `parTrans`/`sibTrans` transition point, when it carries any. */
|
|
338
|
+
label?: string;
|
|
339
|
+
}
|
|
340
|
+
/** Manual layout overrides (`dgm:prSet/@cust*`) a user applied to a presentation point. */
|
|
341
|
+
interface DiagramNodeCustomLayout {
|
|
342
|
+
/** `custAng`: additional rotation in degrees. */
|
|
343
|
+
angle?: number;
|
|
344
|
+
scaleX?: number;
|
|
345
|
+
scaleY?: number;
|
|
346
|
+
sizeX?: number;
|
|
347
|
+
sizeY?: number;
|
|
348
|
+
flipHorizontal?: boolean;
|
|
349
|
+
flipVertical?: boolean;
|
|
350
|
+
linearFactorX?: number;
|
|
351
|
+
linearFactorY?: number;
|
|
352
|
+
linearFactorNeighborX?: number;
|
|
353
|
+
linearFactorNeighborY?: number;
|
|
354
|
+
radialScaleRadius?: number;
|
|
355
|
+
radialScaleIncrement?: number;
|
|
356
|
+
hasCustomTransform?: boolean;
|
|
357
|
+
}
|
|
358
|
+
//#endregion
|
|
359
|
+
//#region diagram/model/constraint-rules.d.ts
|
|
360
|
+
type DiagramConstraintRelationship = 'self' | 'ch' | 'des';
|
|
361
|
+
type DiagramConstraintOperator = 'none' | 'equ' | 'gte' | 'lte';
|
|
362
|
+
type DiagramConstraintPointType = 'all' | 'doc' | 'node' | 'norm' | 'nonNorm' | 'asst' | 'nonAsst' | 'parTrans' | 'pres' | 'sibTrans';
|
|
363
|
+
interface DiagramConstraintTarget {
|
|
364
|
+
for?: DiagramConstraintRelationship | undefined;
|
|
365
|
+
forName?: string | undefined;
|
|
366
|
+
pointType?: DiagramConstraintPointType | undefined;
|
|
367
|
+
}
|
|
368
|
+
/** Editable DiagramML CT_Constraint. */
|
|
369
|
+
interface DiagramConstraint<R = unknown> extends DiagramConstraintTarget {
|
|
370
|
+
type: string;
|
|
371
|
+
referenceType?: string | undefined;
|
|
372
|
+
referenceFor?: DiagramConstraintRelationship | undefined;
|
|
373
|
+
referenceForName?: string | undefined;
|
|
374
|
+
referencePointType?: DiagramConstraintPointType | undefined;
|
|
375
|
+
operator?: DiagramConstraintOperator | undefined;
|
|
376
|
+
value?: number | undefined;
|
|
377
|
+
factor?: number | undefined;
|
|
378
|
+
/** Original constraint retained for foreign attributes and extension content. */
|
|
379
|
+
rawXml?: R | undefined;
|
|
380
|
+
}
|
|
381
|
+
/** Editable DiagramML CT_NumericRule. */
|
|
382
|
+
interface DiagramNumericRule<R = unknown> extends DiagramConstraintTarget {
|
|
383
|
+
type: string;
|
|
384
|
+
value?: number | undefined;
|
|
385
|
+
factor?: number | undefined;
|
|
386
|
+
max?: number | undefined;
|
|
387
|
+
/** Original rule retained for foreign attributes and extension content. */
|
|
388
|
+
rawXml?: R | undefined;
|
|
389
|
+
}
|
|
390
|
+
//#endregion
|
|
391
|
+
//#region diagram/model/layout-primitives.d.ts
|
|
392
|
+
/**
|
|
393
|
+
* Leaf DiagramML layout-definition types (localized text, categories,
|
|
394
|
+
* algorithm parameters, iterator/`dgm:forEach`/`dgm:when`/`dgm:choose`
|
|
395
|
+
* attributes, and `dgm:shape` metadata). `R` is the raw XML node a reader
|
|
396
|
+
* keeps for round-trip (pptx: its `XmlObject` tree). Moved from
|
|
397
|
+
* `pptx/core/types/smart-art-layout-primitives.ts`.
|
|
398
|
+
*/
|
|
399
|
+
interface DiagramLocalizedText {
|
|
400
|
+
value: string;
|
|
401
|
+
language?: string;
|
|
402
|
+
}
|
|
403
|
+
interface DiagramLayoutCategory {
|
|
404
|
+
type: string;
|
|
405
|
+
priority: number;
|
|
406
|
+
}
|
|
407
|
+
interface DiagramAlgorithmParameter {
|
|
408
|
+
type: string;
|
|
409
|
+
value?: string | undefined;
|
|
410
|
+
}
|
|
411
|
+
/** Typed DiagramML CT_Algorithm data attached to a layout node. */
|
|
412
|
+
interface DiagramLayoutAlgorithm {
|
|
413
|
+
type: string;
|
|
414
|
+
revision?: number;
|
|
415
|
+
parameters?: DiagramAlgorithmParameter[];
|
|
416
|
+
}
|
|
417
|
+
interface DiagramIteratorAttributes {
|
|
418
|
+
name?: string | undefined;
|
|
419
|
+
reference?: string | undefined;
|
|
420
|
+
axis?: string[] | undefined;
|
|
421
|
+
pointTypes?: string[] | undefined;
|
|
422
|
+
hideLastTransition?: boolean[] | undefined;
|
|
423
|
+
start?: number[] | undefined;
|
|
424
|
+
count?: number[] | undefined;
|
|
425
|
+
step?: number[] | undefined;
|
|
426
|
+
}
|
|
427
|
+
interface DiagramForEach<R = unknown> extends DiagramIteratorAttributes {
|
|
428
|
+
rawXml?: R;
|
|
429
|
+
}
|
|
430
|
+
interface DiagramWhen<R = unknown> extends DiagramIteratorAttributes {
|
|
431
|
+
function: string;
|
|
432
|
+
argument?: string | undefined;
|
|
433
|
+
operator: string;
|
|
434
|
+
value: string;
|
|
435
|
+
rawXml?: R;
|
|
436
|
+
}
|
|
437
|
+
interface DiagramChoose<R = unknown> {
|
|
438
|
+
name?: string;
|
|
439
|
+
when: DiagramWhen<R>[];
|
|
440
|
+
otherwise?: {
|
|
441
|
+
name?: string;
|
|
442
|
+
rawXml?: R;
|
|
443
|
+
} | null;
|
|
444
|
+
rawXml?: R;
|
|
445
|
+
}
|
|
446
|
+
/** A single `dgm:adj/@val` adjustment, keyed by its `@idx` (1-based, like `a:gd`). */
|
|
447
|
+
interface DiagramShapeAdjustment {
|
|
448
|
+
index: number;
|
|
449
|
+
value: number;
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Typed DiagramML CT_Shape data (`dgm:shape`) attached to a layout node: the
|
|
453
|
+
* per-node preset geometry override real (and third-party/custom) layout
|
|
454
|
+
* definitions use so a layoutNode can be e.g. an ellipse or a chevron instead
|
|
455
|
+
* of the arranger family's hardcoded default shape.
|
|
456
|
+
*/
|
|
457
|
+
interface DiagramLayoutNodeShape {
|
|
458
|
+
/** `dgm:shape/@type`: a preset geometry name (`roundRect`, `ellipse`, `chevron`, `conn`, ...). */
|
|
459
|
+
presetGeometry?: string;
|
|
460
|
+
/** `dgm:adjLst/dgm:adj` entries (adjustment index -> value, as authored). */
|
|
461
|
+
adjustments?: DiagramShapeAdjustment[];
|
|
462
|
+
/** `dgm:shape/@hideGeom`: the shape is present only to size text, never painted. */
|
|
463
|
+
hideGeometry?: boolean;
|
|
464
|
+
/**
|
|
465
|
+
* `dgm:shape/@lkTxEntry` (CT_Shape, boolean, default false): this node is a
|
|
466
|
+
* decorative shape that should mirror its paired content node's text
|
|
467
|
+
* rather than always rendering blank. See `smartart-layout-interpreter-
|
|
468
|
+
* pyramid.ts`'s `arrangePyramid`, the interpreter's one existing
|
|
469
|
+
* synthesized-decorative-shape call site.
|
|
470
|
+
*/
|
|
471
|
+
lkTxEntry?: boolean;
|
|
472
|
+
}
|
|
473
|
+
//#endregion
|
|
474
|
+
//#region diagram/model/layout-definition.d.ts
|
|
475
|
+
/** Identity and ordering metadata from DiagramML CT_LayoutNode. */
|
|
476
|
+
interface DiagramLayoutNode<R = unknown> {
|
|
477
|
+
name?: string | undefined;
|
|
478
|
+
styleLabel?: string | undefined;
|
|
479
|
+
childOrder?: 'b' | 't' | undefined;
|
|
480
|
+
moveWith?: string | undefined;
|
|
481
|
+
algorithm?: DiagramLayoutAlgorithm | undefined;
|
|
482
|
+
forEach?: DiagramForEach<R>[] | undefined;
|
|
483
|
+
choose?: DiagramChoose<R>[] | undefined;
|
|
484
|
+
constraints?: DiagramConstraint<R>[] | undefined;
|
|
485
|
+
rules?: DiagramNumericRule<R>[] | undefined;
|
|
486
|
+
/** `dgm:shape`: this node's own preset geometry override, when present. */
|
|
487
|
+
shape?: DiagramLayoutNodeShape | undefined;
|
|
488
|
+
/**
|
|
489
|
+
* `dgm:presOf` (CT_PresentationOf, same iterator shape as `dgm:forEach`):
|
|
490
|
+
* which data-model point(s) this node's OWN text/geometry binds to -
|
|
491
|
+
* `axis: ['self']` the point currently being iterated, `['des']` all of
|
|
492
|
+
* its descendants, `['ch']` its direct children, and so on. Absent or
|
|
493
|
+
* empty `axis` (including a bare `<dgm:presOf/>`) means the node carries
|
|
494
|
+
* no text of its own (a pure positioning/decoration wrapper - `composite`,
|
|
495
|
+
* `sp` spacer, connector cap). See `smartart-layout-interpreter-item-
|
|
496
|
+
* roles.ts`, the one consumer: it is what lets the interpreter tell a
|
|
497
|
+
* text-bearing per-item role (a list layout's `childText`, a card
|
|
498
|
+
* layout's `roleText`/`bodyText`) apart from a same-generation sibling
|
|
499
|
+
* that positions or decorates instead.
|
|
500
|
+
*/
|
|
501
|
+
presentationOf?: DiagramIteratorAttributes | undefined;
|
|
502
|
+
/**
|
|
503
|
+
* EVERY `dgm:constr` reachable from this node, including ones declared
|
|
504
|
+
* inside a `dgm:choose`/`dgm:if`/`dgm:else` that wraps THIS layoutNode's
|
|
505
|
+
* `constrLst` (a genuinely conditional constraint set, e.g. one branch
|
|
506
|
+
* per data-point count - `gear`'s composite positions its `gear1`/
|
|
507
|
+
* `gear2`/`gear3` slots this way, so its plain, direct-child-only
|
|
508
|
+
* `constraints` above is empty for it). Stops at a nested `dgm:layoutNode`
|
|
509
|
+
* boundary: that child's own conditional constrLst becomes ITS
|
|
510
|
+
* `allConstraints`, not folded into the parent's. Read-only /
|
|
511
|
+
* interpretation-only - `constraints` above (this node's own DIRECT
|
|
512
|
+
* constrLst) remains the one `applySmartArtLayoutDefinition` round-trips,
|
|
513
|
+
* so editing an unrelated property can never collapse a genuinely
|
|
514
|
+
* conditional constrLst into a single branch. `undefined` when this node
|
|
515
|
+
* declares no constrLst at all, in or out of a choose (the common case);
|
|
516
|
+
* otherwise a superset of `constraints` (every branch, blindly unioned -
|
|
517
|
+
* this interpreter does not evaluate `dgm:choose` conditions when
|
|
518
|
+
* indexing constraints, matching the same "flatten both branches"
|
|
519
|
+
* convention `nestedLayoutNodes` already uses for `children`). See
|
|
520
|
+
* `smartart-constraint-solver.ts`'s `buildConstraintIndex`, the only
|
|
521
|
+
* consumer.
|
|
522
|
+
*/
|
|
523
|
+
allConstraints?: DiagramConstraint<R>[] | undefined;
|
|
524
|
+
children?: DiagramLayoutNode<R>[] | undefined;
|
|
525
|
+
/**
|
|
526
|
+
* The iterator attributes of the ENCLOSING `dgm:forEach` this node was
|
|
527
|
+
* found through, when `nestedLayoutNodes` (`smartart-layout-definition
|
|
528
|
+
* .ts`) reached it by walking one - as opposed to being a direct child of
|
|
529
|
+
* its parent layoutNode, or reached only through a `dgm:choose` wrapper
|
|
530
|
+
* (a condition, not an iteration, leaves this `undefined`).
|
|
531
|
+
*
|
|
532
|
+
* `forEach` above records a node's OWN direct `dgm:forEach` children
|
|
533
|
+
* (which wrap ITS descendants); this is the opposite direction - the
|
|
534
|
+
* forEach that wraps the node ITSELF, one level up. A layoutNode can sit
|
|
535
|
+
* inside more than one enclosing forEach only via nesting, so this is
|
|
536
|
+
* always the SINGLE nearest one, not a list.
|
|
537
|
+
*
|
|
538
|
+
* This is what tells a genuinely repeated per-child template
|
|
539
|
+
* (`axis="ch"`, `ptType` absent or `"node"`) apart from a once-only or
|
|
540
|
+
* transition-only sibling that merely happens to sit inside SOME
|
|
541
|
+
* `dgm:forEach` (a `ptType="parTrans"`/`"sibTrans"` connector, or
|
|
542
|
+
* `axis="followSib" cnt="1"`) - both can be direct siblings under the
|
|
543
|
+
* SAME parent layoutNode (`lProcess1`'s `vertFlow` has one forEach for
|
|
544
|
+
* its `parTrans` connector and a SEPARATE one, `axis="ch"`, for its
|
|
545
|
+
* repeated `child` items; `vertFlow.forEach` bundles both, but only
|
|
546
|
+
* `child.forEachOrigin` says which ONE produced it). See
|
|
547
|
+
* `smartart-layout-interpreter-item-roles-recursive.ts`, the one
|
|
548
|
+
* consumer. Read-only / interpretation-only, like `allConstraints`:
|
|
549
|
+
* never round-tripped by `applySmartArtLayoutDefinition`.
|
|
550
|
+
*/
|
|
551
|
+
forEachOrigin?: DiagramIteratorAttributes | undefined;
|
|
552
|
+
/**
|
|
553
|
+
* The conditions of EVERY enclosing `dgm:if` this node was found through,
|
|
554
|
+
* outermost first, when `nestedLayoutNodes` (`smartart-layout-
|
|
555
|
+
* definition.ts`) reached it via one or more `dgm:choose`'s `if` branches
|
|
556
|
+
* (as opposed to a direct child, a `dgm:else` branch contributing no
|
|
557
|
+
* condition of its own - see below - or a `dgm:forEach`, which sets
|
|
558
|
+
* {@link forEachOrigin} instead). ALL must hold (evaluate `!== false`,
|
|
559
|
+
* per {@link chooseGuard}'s own AND semantics - see `evaluateWhen`) for
|
|
560
|
+
* this node's branch to be genuinely live. A caller that already has the
|
|
561
|
+
* data-model node list can use this instead of treating every
|
|
562
|
+
* choose-flattened branch as unconditionally present
|
|
563
|
+
* (`nestedLayoutNodes`' pre-existing "flatten every branch" convention,
|
|
564
|
+
* still the default when this is absent or a caller does not evaluate
|
|
565
|
+
* it) - e.g. `cycle-matrix--fallback-n2.pptx`'s `child1group`..
|
|
566
|
+
* `child4group`, each gated on a DIFFERENT top-level point existing and
|
|
567
|
+
* having its own child (`axis="ch ch" st="N 1" cnt="1 0" func="cnt"
|
|
568
|
+
* op="gte" val="1"`).
|
|
569
|
+
*
|
|
570
|
+
* A CHAIN, not a single condition, because a node can sit inside NESTED
|
|
571
|
+
* `dgm:choose`s whose OWN conditions are each individually necessary -
|
|
572
|
+
* `sub-step-process--hier5.pptx`'s `chLin1`..`chLin7` each sit inside
|
|
573
|
+
* BOTH an outer `dgm:if func="pos" op="equ" val="N"` (which one of the
|
|
574
|
+
* 7 hand-duplicated per-position templates this is) AND an inner,
|
|
575
|
+
* nearly-vacuous `dgm:if func="cnt" op="gte" val="1"` (has >= 1 point at
|
|
576
|
+
* all) - keeping only the NEAREST (inner) one, as an earlier single-
|
|
577
|
+
* condition design did, loses the ONE piece of information (the outer
|
|
578
|
+
* `pos` guard) that actually discriminates `chLin1` from `chLin2`.
|
|
579
|
+
*
|
|
580
|
+
* A `dgm:else` branch contributes NO condition of its own (ECMA-376
|
|
581
|
+
* defines it as "none of the sibling ifs matched", which would need the
|
|
582
|
+
* FULL sibling list's conditions negated and ANDed together, not a
|
|
583
|
+
* single condition - no gallery fixture measured needs an else branch's
|
|
584
|
+
* own guard yet, so it is left unconditional, matching the pre-existing
|
|
585
|
+
* flatten-everything behaviour) but does NOT clear any OUTER ancestor
|
|
586
|
+
* guard already accumulated before it. Evaluate with `smartart-layout-
|
|
587
|
+
* interpreter-when.ts`'s `evaluateWhen`, once per entry, ANDed.
|
|
588
|
+
*/
|
|
589
|
+
chooseGuard?: DiagramWhen<R>[] | undefined;
|
|
590
|
+
/**
|
|
591
|
+
* ROUND 42: the forEach iterator active WHEN EACH ENTRY of {@link
|
|
592
|
+
* chooseGuard} was declared (index-parallel with it, `undefined` per
|
|
593
|
+
* entry when no forEach was active at that point) - NOT the same as
|
|
594
|
+
* {@link forEachOrigin}, which is always this NODE's own single nearest
|
|
595
|
+
* enclosing forEach, however deep. A `dgm:if` declared ABOVE a `dgm:forEach`
|
|
596
|
+
* that this node's own branch happens to descend through afterwards needs
|
|
597
|
+
* ITS OWN, SHALLOWER anchor for a `func="cnt"`/`"maxDepth"`-family
|
|
598
|
+
* `@axis` condition, not this node's deeper one - `funnel--flat3.pptx`'s
|
|
599
|
+
* `item1`/`item2`/`item3` (`chooseGuard: [Name5's axis="ch" func="cnt"
|
|
600
|
+
* op="gte" val="1"]`, declared directly under the composite root, BEFORE
|
|
601
|
+
* each item's own per-item `dgm:forEach axis="ch" st="2"/"3"/"4" cnt="1"`)
|
|
602
|
+
* is exactly this shape: evaluating Name5's condition anchored to item1's
|
|
603
|
+
* OWN forEach binding (one specific data point, with no children of its
|
|
604
|
+
* own in a flat dataset) wrongly resolves its `axis="ch"` child count to
|
|
605
|
+
* 0 instead of the diagram's real top-level count, dropping the item
|
|
606
|
+
* entirely - `chooseGuardOrigins[i]` for that entry is `undefined`
|
|
607
|
+
* (Name5 sits above ANY forEach), so the guard correctly stays
|
|
608
|
+
* root-relative. See `smartart-layout-interpreter-composite-
|
|
609
|
+
* candidates.ts`'s `guardAllows`, the one production consumer.
|
|
610
|
+
* `undefined` whenever {@link chooseGuard} itself is (no enclosing
|
|
611
|
+
* choose at all).
|
|
612
|
+
*/
|
|
613
|
+
chooseGuardOrigins?: (DiagramIteratorAttributes | undefined)[] | undefined;
|
|
614
|
+
/**
|
|
615
|
+
* The chain of every enclosing `dgm:choose`'s own GROUP identity + this
|
|
616
|
+
* node's ordinal position within it + THAT branch's own condition,
|
|
617
|
+
* outermost first - identifies WHICH `dgm:choose` instance and WHERE
|
|
618
|
+
* within its own `dgm:if`/`dgm:else` list this node's branch sits, unlike
|
|
619
|
+
* {@link chooseGuard} (a flat AND-chain of every condition with no group/
|
|
620
|
+
* position identity, and no entry at all for a `dgm:else` branch, which
|
|
621
|
+
* has no condition of its own - see that field's doc comment). `id` is a
|
|
622
|
+
* synthetic, process-unique identifier assigned per `dgm:choose` instance
|
|
623
|
+
* during flattening (`smartart-layout-definition-nesting.ts`'s
|
|
624
|
+
* `nestedLayoutNodes`, a monotonic counter - NOT round-tripped, NOT the
|
|
625
|
+
* choose's own `@_name`, which is not guaranteed unique across a whole
|
|
626
|
+
* layoutDef); `ordinal` is 0-based document order within that ONE choose
|
|
627
|
+
* (every `dgm:if` in order, then `dgm:else` last, if present); `guard` is
|
|
628
|
+
* that branch's OWN condition (`undefined` for a `dgm:else` entry, which
|
|
629
|
+
* has none - deliberately kept PER-ENTRY rather than cross-referenced by
|
|
630
|
+
* index against {@link chooseGuard}, whose own length can diverge from
|
|
631
|
+
* this chain's whenever an ancestor `dgm:else` contributed a group
|
|
632
|
+
* position but no guard).
|
|
633
|
+
*
|
|
634
|
+
* Lets a consumer recover ECMA-376's real `dgm:choose` semantics - "the
|
|
635
|
+
* FIRST branch whose condition holds wins, siblings never coexist" -
|
|
636
|
+
* from the flattened `.children` array, where that grouping would
|
|
637
|
+
* otherwise be lost: `balance--hier5.pptx`'s `balance_NN`/`left_NN_M`/
|
|
638
|
+
* `right_NN_M` family (127 members across ~30 NESTED `dgm:choose`
|
|
639
|
+
* instances, not one flat 127-branch choose) needs first-match-wins
|
|
640
|
+
* WITHIN each individual choose to resolve to the single genuinely-live
|
|
641
|
+
* arrangement, not the "every guard-true node is an independent
|
|
642
|
+
* candidate" reading `smartart-layout-interpreter-composite-choose.ts`'s
|
|
643
|
+
* `collectRawCandidates` used before this field existed - see that
|
|
644
|
+
* module's own consumer of this field for the actual selection rule.
|
|
645
|
+
* `undefined` (or an empty array) for a node reached without any
|
|
646
|
+
* enclosing choose (a direct child, or a `dgm:forEach`-only path) -
|
|
647
|
+
* every PRE-EXISTING caller that does not consult this field is
|
|
648
|
+
* unaffected by its mere presence.
|
|
649
|
+
*
|
|
650
|
+
* ROUND 42: `origin` is the forEach iterator active when THIS branch's
|
|
651
|
+
* own `dgm:if`/`dgm:else` was declared (the SAME "declaration time, not
|
|
652
|
+
* whatever descendant ends up carrying it" concept {@link
|
|
653
|
+
* chooseGuardOrigins} exists for) - the anchor a `func="cnt"`/`"maxDepth"`
|
|
654
|
+
* -family condition in `guard` needs, NOT a representative member's own
|
|
655
|
+
* (possibly deeper) `forEachOrigin`. See `smartart-layout-interpreter-
|
|
656
|
+
* composite-choose-groups.ts`'s `winningOrdinalFor`, the one consumer.
|
|
657
|
+
*/
|
|
658
|
+
chooseGroups?: {
|
|
659
|
+
id: string;
|
|
660
|
+
ordinal: number;
|
|
661
|
+
guard?: DiagramWhen<R> | undefined;
|
|
662
|
+
origin?: DiagramIteratorAttributes | undefined;
|
|
663
|
+
}[] | undefined;
|
|
664
|
+
/**
|
|
665
|
+
* Every `dgm:presOf` candidate reachable through a `dgm:choose`/`dgm:if`/
|
|
666
|
+
* `dgm:else` wrapping THIS node's OWN presOf (as opposed to
|
|
667
|
+
* {@link chooseGuard}, which gates the layoutNode's own EXISTENCE), each
|
|
668
|
+
* tagged with the FULL chain of enclosing `dgm:if` conditions that select
|
|
669
|
+
* it (`guard`, empty for an unconditional or `dgm:else`-reached
|
|
670
|
+
* candidate), in document order (every `dgm:if` then `dgm:else` last).
|
|
671
|
+
* `undefined` when this node's presOf is not choose-guarded at all (the
|
|
672
|
+
* overwhelmingly common case) - {@link presentationOf} already carries
|
|
673
|
+
* the one-and-only value then. Exists for a genuinely conditional presOf
|
|
674
|
+
* where TWO OR MORE branches each declare a real, DIFFERENT axis
|
|
675
|
+
* (`funnel--flat3.pptx`'s `item1`/`item2`/`item3`, one literal axis per
|
|
676
|
+
* data-point count): `smartart-layout-definition-constraints.ts`'s
|
|
677
|
+
* `choosePresentationOf` (feeding {@link presentationOf}) can only ever
|
|
678
|
+
* guess ONE branch statically, at parse time, with no diagram to
|
|
679
|
+
* evaluate against; this field lets an interpret-time caller with the
|
|
680
|
+
* actual diagram (`smartart-layout-interpreter-when.ts`'s
|
|
681
|
+
* `resolvePresentationOf`, the one consumer) pick the branch PowerPoint's
|
|
682
|
+
* own runtime would, first-match-wins.
|
|
683
|
+
*/
|
|
684
|
+
presentationOfCandidates?: {
|
|
685
|
+
guard: DiagramWhen<R>[];
|
|
686
|
+
presentationOf: DiagramIteratorAttributes;
|
|
687
|
+
}[] | undefined;
|
|
688
|
+
/**
|
|
689
|
+
* SESSION 17: every `dgm:rule` reachable through a `dgm:choose`/`dgm:if`/
|
|
690
|
+
* `dgm:else` wrapping THIS node's `ruleLst` (a genuinely count-gated rule
|
|
691
|
+
* set, e.g. `diverging-radial`'s own `w for="ch" forName="node"` ceiling:
|
|
692
|
+
* 6 `dgm:if cnt<=N` branches, each its own `fact`), tagged with its guard
|
|
693
|
+
* chain - the SAME shape {@link presentationOfCandidates} uses for
|
|
694
|
+
* choose-guarded `presOf`, applied to `dgm:rule`. `undefined` when not
|
|
695
|
+
* choose-guarded (`rules` above then carries the one set, the common
|
|
696
|
+
* case). See `smartart-layout-interpreter-cycle-hub-ratio.ts`'s
|
|
697
|
+
* `resolveHubToNodeRatio` (COM-verified live mechanism, not a guess) for
|
|
698
|
+
* how the guard is evaluated against the real satellite count.
|
|
699
|
+
*/
|
|
700
|
+
ruleCandidates?: {
|
|
701
|
+
guard: DiagramWhen<R>[];
|
|
702
|
+
rule: DiagramNumericRule<R>;
|
|
703
|
+
}[] | undefined;
|
|
704
|
+
/**
|
|
705
|
+
* ROUND 39: every `dgm:constr` reachable through a `dgm:choose`/`dgm:if`/
|
|
706
|
+
* `dgm:else` wrapping THIS node's `constrLst` (a genuinely count/position
|
|
707
|
+
* -branched constraint set, e.g. `basic-venn--flat3.pptx`'s composite
|
|
708
|
+
* `Name9` choose, one `ctrX`/`ctrY`/`w`/`h` per data-point-count branch
|
|
709
|
+
* for `circ1`/`circ1Tx`/...), each tagged with its guard chain - the SAME
|
|
710
|
+
* shape {@link presentationOfCandidates}/{@link ruleCandidates} use,
|
|
711
|
+
* applied to `dgm:constr`. `undefined` when not choose-guarded
|
|
712
|
+
* (`allConstraints`/`constraints` above then carry the one set, the
|
|
713
|
+
* common case). See `smartart-constraint-branch-index.ts`'s
|
|
714
|
+
* `selectConstraints` for how the guard is evaluated against the real
|
|
715
|
+
* diagram, and that module's own doc comment for why `allConstraints`'s
|
|
716
|
+
* pre-existing blind union of every branch is not enough on its own.
|
|
717
|
+
*/
|
|
718
|
+
constraintCandidates?: {
|
|
719
|
+
guard: DiagramWhen<R>[];
|
|
720
|
+
constraint: DiagramConstraint<R>;
|
|
721
|
+
}[] | undefined;
|
|
722
|
+
}
|
|
723
|
+
/** Metadata and root node from DiagramML CT_DiagramDefinition. */
|
|
724
|
+
interface DiagramLayoutDefinition<R = unknown> {
|
|
725
|
+
uniqueId?: string | undefined;
|
|
726
|
+
minimumVersion?: string | undefined;
|
|
727
|
+
defaultStyle?: string | undefined;
|
|
728
|
+
titles?: DiagramLocalizedText[] | undefined;
|
|
729
|
+
descriptions?: DiagramLocalizedText[] | undefined;
|
|
730
|
+
categories?: DiagramLayoutCategory[] | undefined;
|
|
731
|
+
rootNode: DiagramLayoutNode<R>;
|
|
732
|
+
/** Original definition retained for constraint evaluation and foreign rules. */
|
|
733
|
+
rawXml?: R | undefined;
|
|
734
|
+
/**
|
|
735
|
+
* The un-parsed layout-definition part text (starting at `<dgm:layoutDef>`,
|
|
736
|
+
* XML declaration included). `rawXml` above loses the document order of
|
|
737
|
+
* differently-named siblings (the package-wide `fast-xml-parser`
|
|
738
|
+
* configuration groups children into one array per tag), which the
|
|
739
|
+
* per-point DiagramML engine (`core/utils/smartart-engine/`) needs to
|
|
740
|
+
* execute a `layoutNode` body's `forEach`/`choose`/`constrLst` statements
|
|
741
|
+
* in their real declared sequence - see that package's `ordered-xml.ts`.
|
|
742
|
+
* `undefined` when the part could not be read (matches `rawXml`'s own
|
|
743
|
+
* optionality); the engine falls back to the legacy interpreter then.
|
|
744
|
+
*/
|
|
745
|
+
rawXmlText?: string | undefined;
|
|
746
|
+
}
|
|
747
|
+
//#endregion
|
|
748
|
+
//#region diagram/model/style-definition.d.ts
|
|
749
|
+
/** Editable metadata shared by DiagramML quick-style and color definitions. */
|
|
750
|
+
interface DiagramDefinitionText {
|
|
751
|
+
value: string;
|
|
752
|
+
language?: string;
|
|
753
|
+
}
|
|
754
|
+
interface DiagramDefinitionCategory {
|
|
755
|
+
type: string;
|
|
756
|
+
priority: number;
|
|
757
|
+
}
|
|
758
|
+
type DiagramColorApplicationMethod = 'span' | 'cycle' | 'repeat';
|
|
759
|
+
type DiagramHueDirection = 'cw' | 'ccw';
|
|
760
|
+
/** CT_Colors application metadata. Color-choice children remain preserved XML. */
|
|
761
|
+
interface DiagramColorListMetadata {
|
|
762
|
+
method?: DiagramColorApplicationMethod;
|
|
763
|
+
hueDirection?: DiagramHueDirection;
|
|
764
|
+
}
|
|
765
|
+
/**
|
|
766
|
+
* A quick-style label's `a:lnRef`/`a:fillRef`/`a:effectRef`/`a:fontRef`
|
|
767
|
+
* (`CT_ShapeStyle`, the same complex type an ordinary shape's `p:style`
|
|
768
|
+
* uses), resolved against the theme's `fmtScheme` at parse time instead of
|
|
769
|
+
* the coarse subtle/moderate/intense enum ({@link DiagramQuickStyle.effectIntensity}).
|
|
770
|
+
* Only populated when a theme format scheme was available when the quick
|
|
771
|
+
* style was parsed. See G13 in the 2026-09 diagram audit.
|
|
772
|
+
*/
|
|
773
|
+
interface DiagramResolvedStyleRef {
|
|
774
|
+
fillColor?: string;
|
|
775
|
+
fillMode?: 'solid' | 'gradient' | 'pattern' | 'none' | 'theme';
|
|
776
|
+
strokeColor?: string;
|
|
777
|
+
strokeWidth?: number;
|
|
778
|
+
/** `a:effectRef`'s theme-resolved outer shadow colour, when the style has one. */
|
|
779
|
+
shadowColor?: string;
|
|
780
|
+
/** `a:fontRef`'s theme-resolved typeface (`+mn-lt`/`+mj-lt` -> the theme's actual font). */
|
|
781
|
+
fontTypeface?: string;
|
|
782
|
+
}
|
|
783
|
+
/** CT_StyleLabel metadata from a quick-style definition. */
|
|
784
|
+
interface DiagramQuickStyleLabel<Scene = unknown, Shape = unknown, Text = unknown> {
|
|
785
|
+
name: string;
|
|
786
|
+
/** Theme-resolved `dgm:style` refs for this label's role, when available. */
|
|
787
|
+
resolvedStyle?: DiagramResolvedStyleRef;
|
|
788
|
+
/**
|
|
789
|
+
* The label's own `dgm:scene3d` (per-shape camera + light rig). PowerPoint
|
|
790
|
+
* copies it onto a shape's cached `a:scene3d` unless it is the default
|
|
791
|
+
* front camera with a `threePt` light (see `applySmartArtQuickStyle3d`).
|
|
792
|
+
*/
|
|
793
|
+
scene3d?: Scene;
|
|
794
|
+
/** The label's own `dgm:sp3d` (bevel / extrusion / contour / material); absent when empty. */
|
|
795
|
+
shape3d?: Shape;
|
|
796
|
+
/** The label's `dgm:txPr/a:sp3d` label-text extrusion (Bird's Eye Scene). */
|
|
797
|
+
text3d?: Text;
|
|
798
|
+
}
|
|
799
|
+
/** CT_CTStyleLabel metadata from a color-transform definition. */
|
|
800
|
+
interface DiagramColorTransformLabel {
|
|
801
|
+
name: string;
|
|
802
|
+
fill?: DiagramColorListMetadata;
|
|
803
|
+
line?: DiagramColorListMetadata;
|
|
804
|
+
effect?: DiagramColorListMetadata;
|
|
805
|
+
textLine?: DiagramColorListMetadata;
|
|
806
|
+
textFill?: DiagramColorListMetadata;
|
|
807
|
+
textEffect?: DiagramColorListMetadata;
|
|
808
|
+
}
|
|
809
|
+
interface DiagramDefinitionMetadata {
|
|
810
|
+
uniqueId?: string;
|
|
811
|
+
minimumVersion?: string;
|
|
812
|
+
titles?: DiagramDefinitionText[];
|
|
813
|
+
descriptions?: DiagramDefinitionText[];
|
|
814
|
+
categories?: DiagramDefinitionCategory[];
|
|
815
|
+
}
|
|
816
|
+
/** Typed CT_ColorTransform metadata and the resolved legacy color palette. */
|
|
817
|
+
interface DiagramColorTransform extends DiagramDefinitionMetadata {
|
|
818
|
+
/** Legacy resolved display name. */
|
|
819
|
+
name?: string;
|
|
820
|
+
/** Ordered resolved fill colors for rendering. */
|
|
821
|
+
fillColors: string[];
|
|
822
|
+
/** Ordered resolved line colors for rendering. */
|
|
823
|
+
lineColors: string[];
|
|
824
|
+
/** Ordered resolved text-fill colors (primary styleLbl `txFillClrLst`). */
|
|
825
|
+
textFillColors?: string[];
|
|
826
|
+
/** Ordered resolved text-line colors (primary styleLbl `txLinClrLst`). */
|
|
827
|
+
textLineColors?: string[];
|
|
828
|
+
/** Ordered resolved effect colors (primary styleLbl `effectClrLst`). */
|
|
829
|
+
effectColors?: string[];
|
|
830
|
+
/** Ordered resolved text-effect colors (primary styleLbl `txEffectClrLst`). */
|
|
831
|
+
textEffectColors?: string[];
|
|
832
|
+
/** Fill-list span/cycle + hue-direction interpolation of the primary styleLbl. */
|
|
833
|
+
fillInterpolation?: DiagramColorListMetadata;
|
|
834
|
+
/** Line-list span/cycle + hue-direction interpolation of the primary styleLbl. */
|
|
835
|
+
lineInterpolation?: DiagramColorListMetadata;
|
|
836
|
+
/** Ordered CT_CTStyleLabel metadata. */
|
|
837
|
+
labels?: DiagramColorTransformLabel[];
|
|
838
|
+
/**
|
|
839
|
+
* Every `styleLbl`'s own resolved fill/line colour list, keyed by name
|
|
840
|
+
* (e.g. `node1`, `asst0`, `bgShp`, `revTx`). Unlike {@link fillColors} /
|
|
841
|
+
* {@link lineColors} (which collapse to ONE "primary" node-role list),
|
|
842
|
+
* this keeps every role so a node can be coloured from its OWN role's
|
|
843
|
+
* palette (see `DiagramNode.styleRole` and `applySmartArtRoleColors`)
|
|
844
|
+
* instead of a generic cycled colour.
|
|
845
|
+
*/
|
|
846
|
+
roleColors?: Record<string, DiagramRoleColorList>;
|
|
847
|
+
}
|
|
848
|
+
/** One colour-transform `styleLbl`'s resolved colour lists. */
|
|
849
|
+
interface DiagramRoleColorList {
|
|
850
|
+
fill: string[];
|
|
851
|
+
line: string[];
|
|
852
|
+
/**
|
|
853
|
+
* `txFillClrLst`, when the label declares one (`revTx` -> `tx1`). A text
|
|
854
|
+
* node's colour comes from here; see `smartart-merged-text-label`.
|
|
855
|
+
*/
|
|
856
|
+
textFill?: string[];
|
|
857
|
+
}
|
|
858
|
+
/** Typed CT_StyleDefinition metadata and legacy rendering hint. */
|
|
859
|
+
interface DiagramQuickStyle<Scene = unknown, Shape = unknown, Text = unknown> extends DiagramDefinitionMetadata {
|
|
860
|
+
/** Legacy resolved display name. */
|
|
861
|
+
name?: string;
|
|
862
|
+
/** Legacy effect-intensity rendering hint. */
|
|
863
|
+
effectIntensity?: string;
|
|
864
|
+
/** Ordered CT_StyleLabel metadata. Complex style payload remains preserved XML. */
|
|
865
|
+
labels?: DiagramQuickStyleLabel<Scene, Shape, Text>[];
|
|
866
|
+
/**
|
|
867
|
+
* Whole-diagram 3D scene (camera preset/rotation/zoom/fov, light rig,
|
|
868
|
+
* backdrop) from the quick style's own `dgm:styleDef/dgm:scene3d`, present
|
|
869
|
+
* for the "Scene" quick styles (Brick, Flat, Metallic, Sunset, Bird's Eye
|
|
870
|
+
* Scene). One camera renders the whole diagram; per-shape `a:scene3d` is
|
|
871
|
+
* absent for those styles (see the cached drawing shape's own `scene3d`). Each
|
|
872
|
+
* `dgm:styleLbl` also carries its own per-label `dgm:scene3d`/`dgm:sp3d`
|
|
873
|
+
* ({@link DiagramQuickStyleLabel.scene3d} / `shape3d` / `text3d`),
|
|
874
|
+
* which PowerPoint bakes onto each cached shape; they are re-applied when a
|
|
875
|
+
* structural edit regenerates the shapes.
|
|
876
|
+
*/
|
|
877
|
+
scene3d?: Scene;
|
|
878
|
+
}
|
|
879
|
+
//#endregion
|
|
880
|
+
//#region diagram/model/node.d.ts
|
|
881
|
+
/**
|
|
882
|
+
* A single run of text inside a SmartArt node, capturing the run text and the
|
|
883
|
+
* raw `a:rPr` run-properties object verbatim so per-run formatting (bold,
|
|
884
|
+
* colour, size, etc.) survives a load -> edit -> save round-trip instead of
|
|
885
|
+
* collapsing to a single unstyled run.
|
|
886
|
+
*
|
|
887
|
+
* @example
|
|
888
|
+
* ```ts
|
|
889
|
+
* const run: DiagramNodeTextRun = {
|
|
890
|
+
* text: "Bold",
|
|
891
|
+
* rPr: { "@_b": "1", "@_lang": "en-US" },
|
|
892
|
+
* };
|
|
893
|
+
* // => satisfies DiagramNodeTextRun
|
|
894
|
+
* ```
|
|
895
|
+
*/
|
|
896
|
+
interface DiagramNodeTextRun<S = unknown> {
|
|
897
|
+
/** Run text content. */
|
|
898
|
+
text: string;
|
|
899
|
+
/**
|
|
900
|
+
* Raw parsed `a:rPr` run-properties object, preserved verbatim for
|
|
901
|
+
* round-trip. Untyped XML, hence the loose record shape.
|
|
902
|
+
*/
|
|
903
|
+
rPr?: Record<string, unknown>;
|
|
904
|
+
/** Resolved standard shape-text style derived from {@link rPr}. */
|
|
905
|
+
style?: S;
|
|
906
|
+
/** Raw run XML used to retain unmodelled extension children on save. */
|
|
907
|
+
rawXml?: Record<string, unknown>;
|
|
908
|
+
/** Original direct-child order, including unmodelled extension children. */
|
|
909
|
+
childOrder?: string[];
|
|
910
|
+
}
|
|
911
|
+
/** An ordered item within a SmartArt text paragraph. */
|
|
912
|
+
type DiagramNodeTextParagraphItem<S = unknown> = {
|
|
913
|
+
kind: 'run';
|
|
914
|
+
run: DiagramNodeTextRun<S>;
|
|
915
|
+
} | {
|
|
916
|
+
kind: 'break';
|
|
917
|
+
rPr?: Record<string, unknown>;
|
|
918
|
+
style?: S;
|
|
919
|
+
rawXml?: Record<string, unknown>;
|
|
920
|
+
childOrder?: string[];
|
|
921
|
+
} | {
|
|
922
|
+
kind: 'field';
|
|
923
|
+
id?: string;
|
|
924
|
+
fieldType?: string;
|
|
925
|
+
text: string;
|
|
926
|
+
rPr?: Record<string, unknown>;
|
|
927
|
+
style?: S;
|
|
928
|
+
pPr?: Record<string, unknown>;
|
|
929
|
+
rawXml?: Record<string, unknown>;
|
|
930
|
+
childOrder?: string[];
|
|
931
|
+
} | {
|
|
932
|
+
kind: 'tab';
|
|
933
|
+
rawXml?: Record<string, unknown>;
|
|
934
|
+
childOrder?: string[];
|
|
935
|
+
} | {
|
|
936
|
+
kind: 'raw';
|
|
937
|
+
name: string;
|
|
938
|
+
value: unknown;
|
|
939
|
+
};
|
|
940
|
+
/** A complete `a:p` paragraph in a SmartArt data-model text body. */
|
|
941
|
+
interface DiagramNodeTextParagraph<S = unknown> {
|
|
942
|
+
/** Paragraph properties (`a:pPr`) preserved verbatim. */
|
|
943
|
+
pPr?: Record<string, unknown>;
|
|
944
|
+
/** Text children in source order. */
|
|
945
|
+
items: DiagramNodeTextParagraphItem<S>[];
|
|
946
|
+
/** End-paragraph run properties (`a:endParaRPr`) preserved verbatim. */
|
|
947
|
+
endParaRPr?: Record<string, unknown>;
|
|
948
|
+
/** Resolved style for the paragraph terminator. */
|
|
949
|
+
endParaStyle?: S;
|
|
950
|
+
/** Raw paragraph XML used to retain unmodelled extension children on save. */
|
|
951
|
+
rawXml?: Record<string, unknown>;
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* Per-node visual override for a SmartArt node.
|
|
955
|
+
*
|
|
956
|
+
* Captures the individual fill / line / font colour and the bold / italic
|
|
957
|
+
* emphasis a user has set on one specific node, independent of the diagram's
|
|
958
|
+
* colour scheme and quick style. All colours are hex strings (e.g. "#FF0000").
|
|
959
|
+
* Every field is optional: only the overridden aspects are carried, so an
|
|
960
|
+
* empty object means "no per-node override".
|
|
961
|
+
*
|
|
962
|
+
* The parser reads these from the data point's `spPr` solid fill / line colour
|
|
963
|
+
* and the first run's `rPr` (b / i / solidFill) when present, and the save path
|
|
964
|
+
* writes them back so the override survives a load -> edit -> save round-trip.
|
|
965
|
+
*
|
|
966
|
+
* @example
|
|
967
|
+
* ```ts
|
|
968
|
+
* const style: DiagramNodeStyle = {
|
|
969
|
+
* fillColor: "#FF0000",
|
|
970
|
+
* fontColor: "#FFFFFF",
|
|
971
|
+
* bold: true,
|
|
972
|
+
* };
|
|
973
|
+
* // => satisfies DiagramNodeStyle
|
|
974
|
+
* ```
|
|
975
|
+
*/
|
|
976
|
+
interface DiagramNodeStyle {
|
|
977
|
+
/** Solid fill colour override (hex, e.g. "#4F81BD"). */
|
|
978
|
+
fillColor?: string;
|
|
979
|
+
/** Outline / line colour override (hex). */
|
|
980
|
+
lineColor?: string;
|
|
981
|
+
/** Text (font) colour override (hex). */
|
|
982
|
+
fontColor?: string;
|
|
983
|
+
/** Bold emphasis override for the node's runs. */
|
|
984
|
+
bold?: boolean;
|
|
985
|
+
/** Italic emphasis override for the node's runs. */
|
|
986
|
+
italic?: boolean;
|
|
987
|
+
}
|
|
988
|
+
/**
|
|
989
|
+
* A single node in the SmartArt data model.
|
|
990
|
+
*
|
|
991
|
+
* @example
|
|
992
|
+
* ```ts
|
|
993
|
+
* const node: DiagramNode = {
|
|
994
|
+
* id: "1",
|
|
995
|
+
* text: "CEO",
|
|
996
|
+
* children: [
|
|
997
|
+
* { id: "2", text: "VP Marketing", parentId: "1" },
|
|
998
|
+
* { id: "3", text: "VP Engineering", parentId: "1" },
|
|
999
|
+
* ],
|
|
1000
|
+
* };
|
|
1001
|
+
* // => satisfies DiagramNode
|
|
1002
|
+
* ```
|
|
1003
|
+
*/
|
|
1004
|
+
interface DiagramNode<S = unknown> {
|
|
1005
|
+
id: string;
|
|
1006
|
+
text: string;
|
|
1007
|
+
/** CT_Pt connection identifier, when the point references a connection. */
|
|
1008
|
+
connectionId?: string | null;
|
|
1009
|
+
parentId?: string | undefined;
|
|
1010
|
+
children?: DiagramNode<S>[];
|
|
1011
|
+
/** Node type from `@_type` attribute (e.g. "doc", "node", "asst", "pres"). */
|
|
1012
|
+
nodeType?: string;
|
|
1013
|
+
/**
|
|
1014
|
+
* The node's own quick-style role (`dgm:prSet/@presStyleLbl` from its
|
|
1015
|
+
* paired `type="pres"` presentation point, resolved via a `presOf`
|
|
1016
|
+
* connection back to this content point). Structural names like `node1`,
|
|
1017
|
+
* `asst2`, `bgShp`, `revTx`; distinct from {@link nodeType}, which is the
|
|
1018
|
+
* data-model `@_type` ("node"/"asst"/...). Used to pick this node's own
|
|
1019
|
+
* colour list from a colour transform's per-role palettes instead of the
|
|
1020
|
+
* generic cycled palette (see `applySmartArtRoleColors`).
|
|
1021
|
+
*/
|
|
1022
|
+
styleRole?: string;
|
|
1023
|
+
/**
|
|
1024
|
+
* `dgm:prSet/@coherent3DOff` (`CT_ElemPropSet`) resolved from the node's
|
|
1025
|
+
* paired presentation point: when true, this node opts out of the
|
|
1026
|
+
* diagram's overall coherent-3D scene rotation (a `dgm:scene3d`/`dgm:sp3d`
|
|
1027
|
+
* quick-style variation) applied to every other node.
|
|
1028
|
+
*/
|
|
1029
|
+
coherent3DOff?: boolean;
|
|
1030
|
+
/**
|
|
1031
|
+
* The layout variables PowerPoint recorded for each presentation node
|
|
1032
|
+
* this point drives (`dgm:prSet/@presName` -> `dgm:presLayoutVars`
|
|
1033
|
+
* variable -> `@val`), e.g. `{ hierRoot1: { hierBranch: 'l' } }` for an
|
|
1034
|
+
* org-chart manager set to "Left Hanging". Read-only: the presentation
|
|
1035
|
+
* points themselves round-trip verbatim.
|
|
1036
|
+
*/
|
|
1037
|
+
presLayoutVarsByName?: Record<string, Record<string, string>>;
|
|
1038
|
+
/**
|
|
1039
|
+
* Per-run text + run-properties for the node's first paragraph, captured at
|
|
1040
|
+
* parse time. When the joined run text still equals {@link text} (the node
|
|
1041
|
+
* was not edited, or was edited only in ways that preserve the run split),
|
|
1042
|
+
* the save path rebuilds the paragraph from these runs so per-run rich text
|
|
1043
|
+
* is not flattened. When {@link text} diverges, the runs are ignored.
|
|
1044
|
+
*/
|
|
1045
|
+
runs?: DiagramNodeTextRun<S>[];
|
|
1046
|
+
/**
|
|
1047
|
+
* Complete typed paragraph model. Unlike {@link runs}, this retains every
|
|
1048
|
+
* paragraph and the ordered run, field, break, and tab children within it.
|
|
1049
|
+
*/
|
|
1050
|
+
paragraphs?: DiagramNodeTextParagraph<S>[];
|
|
1051
|
+
/**
|
|
1052
|
+
* Optional per-node visual override (fill / line / font colour, bold /
|
|
1053
|
+
* italic). Read at parse time from the point's `spPr` / first-run `rPr`, set
|
|
1054
|
+
* by the editing op, honoured by the render path, and written back on save so
|
|
1055
|
+
* it round-trips.
|
|
1056
|
+
*/
|
|
1057
|
+
style?: DiagramNodeStyle;
|
|
1058
|
+
/**
|
|
1059
|
+
* Manual layout override read from the node's `dgm:prSet` `cust*`
|
|
1060
|
+
* attributes (drag/resize/rotate/flip performed in PowerPoint's own diagram
|
|
1061
|
+
* editor). Applied as a final transform after algorithmic layout by
|
|
1062
|
+
* {@link module:smartart-layout-interpreter-custom} so it survives even
|
|
1063
|
+
* when there is no cached `dsp:` drawing to fall back on.
|
|
1064
|
+
*/
|
|
1065
|
+
customLayout?: DiagramNodeCustomLayout;
|
|
1066
|
+
}
|
|
1067
|
+
//#endregion
|
|
1068
|
+
//#region diagram/model/data.d.ts
|
|
1069
|
+
/**
|
|
1070
|
+
* Named SmartArt layout presets for creation (subset of the built-in layouts).
|
|
1071
|
+
*
|
|
1072
|
+
* @example
|
|
1073
|
+
* ```ts
|
|
1074
|
+
* const layout: DiagramLayoutPreset = "hierarchy";
|
|
1075
|
+
* // => "hierarchy" - one of: "basicBlockList" | "alternatingHexagons" | "hierarchy" | ...
|
|
1076
|
+
* ```
|
|
1077
|
+
*/
|
|
1078
|
+
type DiagramLayoutPreset = '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';
|
|
1079
|
+
/**
|
|
1080
|
+
* Presentation layout variables from `dgm:prSet/dgm:presLayoutVars` (data model)
|
|
1081
|
+
* or `dgm:varLst` (layout definition defaults).
|
|
1082
|
+
*
|
|
1083
|
+
* These drive how the DiagramML layout interpreter arranges points: flow
|
|
1084
|
+
* direction, hierarchy branch style, org-chart mode, and child count limits.
|
|
1085
|
+
* The fallback layout engine can consult them for direction/org-chart hints.
|
|
1086
|
+
*
|
|
1087
|
+
* @example
|
|
1088
|
+
* ```ts
|
|
1089
|
+
* const vars: DiagramPresLayoutVars = { direction: "rev", orgChart: true };
|
|
1090
|
+
* // => satisfies DiagramPresLayoutVars
|
|
1091
|
+
* ```
|
|
1092
|
+
*/
|
|
1093
|
+
interface DiagramPresLayoutVars {
|
|
1094
|
+
/** Flow direction (`dgm:dir`): "norm" (default) or "rev" (reversed/RTL). */
|
|
1095
|
+
direction?: 'norm' | 'rev';
|
|
1096
|
+
/** Hierarchy branch style (`dgm:hierBranch`): std/init/l/r/hang. */
|
|
1097
|
+
hierarchyBranch?: 'std' | 'init' | 'l' | 'r' | 'hang';
|
|
1098
|
+
/** Org-chart mode enabled (`dgm:orgChart`). */
|
|
1099
|
+
orgChart?: boolean;
|
|
1100
|
+
/** Maximum children per node (`dgm:chMax`, -1 = unbounded). */
|
|
1101
|
+
childMax?: number;
|
|
1102
|
+
/** Preferred children per node (`dgm:chPref`, -1 = unbounded). */
|
|
1103
|
+
childPreferred?: number;
|
|
1104
|
+
/** Whether bullets are enabled (`dgm:bulletEnabled`). */
|
|
1105
|
+
bulletEnabled?: boolean;
|
|
1106
|
+
/** Animation-by-level setting (`dgm:animLvl`). */
|
|
1107
|
+
animationLevel?: string;
|
|
1108
|
+
/** Animate-one setting (`dgm:animOne`). */
|
|
1109
|
+
animateOne?: string;
|
|
1110
|
+
/** Allowed resize handles (`dgm:resizeHandles`). */
|
|
1111
|
+
resizeHandles?: string;
|
|
1112
|
+
}
|
|
1113
|
+
/**
|
|
1114
|
+
* The format-neutral part of a parsed SmartArt graphic: everything the layout
|
|
1115
|
+
* engine and interpreters read.
|
|
1116
|
+
*
|
|
1117
|
+
* @example
|
|
1118
|
+
* ```ts
|
|
1119
|
+
* const data: DiagramData = {
|
|
1120
|
+
* resolvedLayoutType: "hierarchy",
|
|
1121
|
+
* layout: "hierarchy",
|
|
1122
|
+
* colorScheme: "colorful1",
|
|
1123
|
+
* style: "moderate",
|
|
1124
|
+
* nodes: [
|
|
1125
|
+
* { id: "1", text: "CEO", children: [
|
|
1126
|
+
* { id: "2", text: "VP Marketing", parentId: "1" },
|
|
1127
|
+
* ]},
|
|
1128
|
+
* ],
|
|
1129
|
+
* };
|
|
1130
|
+
* // => satisfies DiagramData
|
|
1131
|
+
* ```
|
|
1132
|
+
*/
|
|
1133
|
+
interface DiagramData {
|
|
1134
|
+
layoutType?: string;
|
|
1135
|
+
resolvedLayoutType?: DiagramLayoutType;
|
|
1136
|
+
/** Named layout preset (used when creating new SmartArt). */
|
|
1137
|
+
layout?: DiagramLayoutPreset;
|
|
1138
|
+
/** Colour scheme for the SmartArt graphic. */
|
|
1139
|
+
colorScheme?: DiagramColorScheme;
|
|
1140
|
+
/** Visual style intensity. */
|
|
1141
|
+
style?: DiagramStyleIntensity;
|
|
1142
|
+
nodes: DiagramNode[];
|
|
1143
|
+
/** Connections between data-model nodes. */
|
|
1144
|
+
connections?: DiagramConnection[];
|
|
1145
|
+
/** Colour transform from the diagram colours part. */
|
|
1146
|
+
colorTransform?: DiagramColorTransform;
|
|
1147
|
+
/** Quick style from the diagram quick-style part. */
|
|
1148
|
+
quickStyle?: DiagramQuickStyle;
|
|
1149
|
+
/** Editable metadata from the related DiagramML layout definition. */
|
|
1150
|
+
layoutDefinition?: DiagramLayoutDefinition;
|
|
1151
|
+
/**
|
|
1152
|
+
* Presentation layout variables (direction, hierarchy branch, org-chart,
|
|
1153
|
+
* child limits, bullets) from `dgm:presLayoutVars` / layout `dgm:varLst`.
|
|
1154
|
+
* Consulted by the fallback layout engine for direction/org-chart hints.
|
|
1155
|
+
*/
|
|
1156
|
+
presLayoutVars?: DiagramPresLayoutVars;
|
|
1157
|
+
/**
|
|
1158
|
+
* The document theme's minor-Latin font (`a:fontScheme/a:minorFont/a:latin/
|
|
1159
|
+
* @typeface`): what SmartArt text actually renders in when no per-run
|
|
1160
|
+
* `a:latin` override is present (the common case; the font-fit is the one
|
|
1161
|
+
* consumer). Undefined when the theme carries no font scheme at all.
|
|
1162
|
+
*/
|
|
1163
|
+
themeMinorFont?: string;
|
|
1164
|
+
}
|
|
1165
|
+
//#endregion
|
|
1166
|
+
//#region pptx/core/types/smart-art-chrome.d.ts
|
|
1167
|
+
/**
|
|
1168
|
+
* Background / outline extracted from `dgm:bg` and `dgm:whole`.
|
|
1169
|
+
*
|
|
1170
|
+
* @example
|
|
1171
|
+
* ```ts
|
|
1172
|
+
* const chrome: PptxSmartArtChrome = {
|
|
1173
|
+
* backgroundColor: "#F0F0F0",
|
|
1174
|
+
* outlineColor: "#333333",
|
|
1175
|
+
* outlineWidth: 1,
|
|
1176
|
+
* };
|
|
1177
|
+
* // => satisfies PptxSmartArtChrome
|
|
1178
|
+
* ```
|
|
1179
|
+
*/
|
|
1180
|
+
interface PptxSmartArtChrome {
|
|
1181
|
+
/**
|
|
1182
|
+
* Background fill colour (hex). When the real `dgm:bg` fill is a gradient
|
|
1183
|
+
* or pattern (see {@link PptxSmartArtChrome.backgroundFillXml}), this is an
|
|
1184
|
+
* APPROXIMATION (the gradient's first stop, or the pattern's foreground
|
|
1185
|
+
* colour) for a consumer that only wants one display colour, not the full fill.
|
|
1186
|
+
*/
|
|
1187
|
+
backgroundColor?: string;
|
|
1188
|
+
/**
|
|
1189
|
+
* Raw `dgm:bg` fill XML, present only when the background is a gradient or
|
|
1190
|
+
* pattern fill (a solid fill is fully captured by {@link PptxSmartArtChrome.backgroundColor}
|
|
1191
|
+
* alone). Round-trip only: `smartart-save-chrome.ts` re-emits this verbatim
|
|
1192
|
+
* instead of flattening the fill to a solid colour on save.
|
|
1193
|
+
*/
|
|
1194
|
+
backgroundFillXml?: PptxSmartArtRawBackgroundFill;
|
|
1195
|
+
/** Outline stroke colour (hex). */
|
|
1196
|
+
outlineColor?: string;
|
|
1197
|
+
/** Outline stroke width in points. */
|
|
1198
|
+
outlineWidth?: number;
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* A `dgm:bg` fill this viewer doesn't fully model as first-class chrome
|
|
1202
|
+
* (gradient or pattern), preserved verbatim for round-trip. See
|
|
1203
|
+
* {@link PptxSmartArtChrome.backgroundFillXml}.
|
|
1204
|
+
*/
|
|
1205
|
+
interface PptxSmartArtRawBackgroundFill {
|
|
1206
|
+
/** Local element name of the fill under `dgm:bg` (`gradFill` or `pattFill`). */
|
|
1207
|
+
localName: 'gradFill' | 'pattFill';
|
|
1208
|
+
/** The fill element's own attributes/children, as parsed. */
|
|
1209
|
+
xml: XmlObject;
|
|
1210
|
+
}
|
|
1211
|
+
//#endregion
|
|
1212
|
+
//#region pptx/core/types/smart-art-model.d.ts
|
|
1213
|
+
type PptxSmartArtConstraintRelationship = DiagramConstraintRelationship;
|
|
1214
|
+
type PptxSmartArtConstraintOperator = DiagramConstraintOperator;
|
|
1215
|
+
type PptxSmartArtConstraintPointType = DiagramConstraintPointType;
|
|
1216
|
+
type PptxSmartArtConstraintTarget = DiagramConstraintTarget;
|
|
1217
|
+
type PptxSmartArtConstraint = DiagramConstraint<XmlObject>;
|
|
1218
|
+
type PptxSmartArtNumericRule = DiagramNumericRule<XmlObject>;
|
|
1219
|
+
type PptxSmartArtLocalizedText = DiagramLocalizedText;
|
|
1220
|
+
type PptxSmartArtLayoutCategory = DiagramLayoutCategory;
|
|
1221
|
+
type PptxSmartArtAlgorithmParameter = DiagramAlgorithmParameter;
|
|
1222
|
+
type PptxSmartArtLayoutAlgorithm = DiagramLayoutAlgorithm;
|
|
1223
|
+
type PptxSmartArtIteratorAttributes = DiagramIteratorAttributes;
|
|
1224
|
+
type PptxSmartArtForEach = DiagramForEach<XmlObject>;
|
|
1225
|
+
type PptxSmartArtWhen = DiagramWhen<XmlObject>;
|
|
1226
|
+
type PptxSmartArtChoose = DiagramChoose<XmlObject>;
|
|
1227
|
+
type PptxSmartArtShapeAdjustment = DiagramShapeAdjustment;
|
|
1228
|
+
type PptxSmartArtLayoutNodeShape = DiagramLayoutNodeShape;
|
|
1229
|
+
type PptxSmartArtLayoutNode = DiagramLayoutNode<XmlObject>;
|
|
1230
|
+
type PptxSmartArtLayoutDefinition = DiagramLayoutDefinition<XmlObject>;
|
|
1231
|
+
type PptxSmartArtDefinitionText = DiagramDefinitionText;
|
|
1232
|
+
type PptxSmartArtDefinitionCategory = DiagramDefinitionCategory;
|
|
1233
|
+
type PptxSmartArtColorApplicationMethod = DiagramColorApplicationMethod;
|
|
1234
|
+
type PptxSmartArtHueDirection = DiagramHueDirection;
|
|
1235
|
+
type PptxSmartArtColorListMetadata = DiagramColorListMetadata;
|
|
1236
|
+
type PptxSmartArtResolvedStyleRef = DiagramResolvedStyleRef;
|
|
1237
|
+
type PptxSmartArtQuickStyleLabel = DiagramQuickStyleLabel<Pptx3DScene, Pptx3DShape, Text3DStyle>;
|
|
1238
|
+
type PptxSmartArtColorStyleLabel = DiagramColorTransformLabel;
|
|
1239
|
+
type PptxSmartArtDefinitionMetadata = DiagramDefinitionMetadata;
|
|
1240
|
+
type PptxSmartArtColorTransform = DiagramColorTransform;
|
|
1241
|
+
type SmartArtRoleColorList = DiagramRoleColorList;
|
|
1242
|
+
type PptxSmartArtQuickStyle = DiagramQuickStyle<Pptx3DScene, Pptx3DShape, Text3DStyle>;
|
|
1243
|
+
type PptxSmartArtTextRun = DiagramNodeTextRun<TextStyle>;
|
|
1244
|
+
type PptxSmartArtTextParagraphItem = DiagramNodeTextParagraphItem<TextStyle>;
|
|
1245
|
+
type PptxSmartArtTextParagraph = DiagramNodeTextParagraph<TextStyle>;
|
|
1246
|
+
type PptxSmartArtNodeStyle = DiagramNodeStyle;
|
|
1247
|
+
type PptxSmartArtNode = DiagramNode<TextStyle>;
|
|
1248
|
+
/**
|
|
1249
|
+
* Manual layout override for a `type="pres"` presentation point, read from its
|
|
1250
|
+
* `dgm:prSet` `cust*` attributes (see `DiagramNodeCustomLayout`).
|
|
1251
|
+
*/
|
|
1252
|
+
type SmartArtNodeCustomLayout = DiagramNodeCustomLayout;
|
|
1253
|
+
type SmartArtLayout = DiagramLayoutPreset;
|
|
1254
|
+
type PptxSmartArtPresLayoutVars = DiagramPresLayoutVars;
|
|
1255
|
+
//#endregion
|
|
1256
|
+
//#region pptx/core/types/smart-art.d.ts
|
|
1257
|
+
/**
|
|
1258
|
+
* Resolved SmartArt layout category.
|
|
1259
|
+
*
|
|
1260
|
+
* @example
|
|
1261
|
+
* ```ts
|
|
1262
|
+
* const cat: SmartArtLayoutType = "hierarchy";
|
|
1263
|
+
* // => "hierarchy" — one of: "list" | "process" | "cycle" | "hierarchy" | "relationship" | …
|
|
1264
|
+
* ```
|
|
1265
|
+
*/
|
|
1266
|
+
type SmartArtLayoutType = DiagramLayoutType;
|
|
1267
|
+
/**
|
|
1268
|
+
* SmartArt colour scheme presets.
|
|
1269
|
+
*
|
|
1270
|
+
* @example
|
|
1271
|
+
* ```ts
|
|
1272
|
+
* const scheme: SmartArtColorScheme = "colorful1";
|
|
1273
|
+
* // => "colorful1" — one of: "colorful1" | "colorful2" | "colorful3" | "monochromatic1" | "monochromatic2"
|
|
1274
|
+
* ```
|
|
1275
|
+
*/
|
|
1276
|
+
type SmartArtColorScheme = DiagramColorScheme;
|
|
1277
|
+
/**
|
|
1278
|
+
* SmartArt visual style intensity.
|
|
1279
|
+
*
|
|
1280
|
+
* @example
|
|
1281
|
+
* ```ts
|
|
1282
|
+
* const style: SmartArtStyle = "moderate";
|
|
1283
|
+
* // => "moderate" — one of: "flat" | "moderate" | "intense"
|
|
1284
|
+
* ```
|
|
1285
|
+
*/
|
|
1286
|
+
type SmartArtStyle = DiagramStyleIntensity;
|
|
1287
|
+
/**
|
|
1288
|
+
* A connection between two SmartArt data-model nodes.
|
|
1289
|
+
*
|
|
1290
|
+
* @example
|
|
1291
|
+
* ```ts
|
|
1292
|
+
* const conn: PptxSmartArtConnection = {
|
|
1293
|
+
* sourceId: "1",
|
|
1294
|
+
* destId: "2",
|
|
1295
|
+
* type: "parOf",
|
|
1296
|
+
* };
|
|
1297
|
+
* // => satisfies PptxSmartArtConnection
|
|
1298
|
+
* ```
|
|
1299
|
+
*/
|
|
1300
|
+
type PptxSmartArtConnection = DiagramConnection;
|
|
1301
|
+
/**
|
|
1302
|
+
* A pre-computed shape from `ppt/diagrams/drawing*.xml`.
|
|
1303
|
+
*
|
|
1304
|
+
* @example
|
|
1305
|
+
* ```ts
|
|
1306
|
+
* const shape: PptxSmartArtDrawingShape = {
|
|
1307
|
+
* id: "s1",
|
|
1308
|
+
* shapeType: "roundRect",
|
|
1309
|
+
* x: 100, y: 50, width: 200, height: 80,
|
|
1310
|
+
* fillColor: "#4F81BD",
|
|
1311
|
+
* text: "CEO",
|
|
1312
|
+
* };
|
|
1313
|
+
* // => satisfies PptxSmartArtDrawingShape
|
|
1314
|
+
* ```
|
|
1315
|
+
*/
|
|
1316
|
+
interface PptxSmartArtDrawingShape extends PptxCustomPathProperties {
|
|
1317
|
+
/** Shape ID within the drawing. */
|
|
1318
|
+
id: string;
|
|
1319
|
+
/** Preset geometry type (e.g. "roundRect", "ellipse"). */
|
|
1320
|
+
shapeType?: string;
|
|
1321
|
+
/** Position and size in EMU-based pixels. */
|
|
1322
|
+
x: number;
|
|
1323
|
+
y: number;
|
|
1324
|
+
width: number;
|
|
1325
|
+
height: number;
|
|
1326
|
+
/** Rotation in degrees. */
|
|
1327
|
+
rotation?: number;
|
|
1328
|
+
/** Horizontal/vertical mirrors declared on the cached drawing transform. */
|
|
1329
|
+
flipHorizontal?: boolean;
|
|
1330
|
+
flipVertical?: boolean;
|
|
1331
|
+
/** Skew along the X axis in degrees. */
|
|
1332
|
+
skewX?: number;
|
|
1333
|
+
/** Skew along the Y axis in degrees. */
|
|
1334
|
+
skewY?: number;
|
|
1335
|
+
/** Preset-geometry adjustment values from `a:prstGeom/a:avLst`. */
|
|
1336
|
+
shapeAdjustments?: Record<string, number>;
|
|
1337
|
+
/**
|
|
1338
|
+
* The cached shape declares `a:noFill`. Renderers must leave it unpainted
|
|
1339
|
+
* rather than substituting a palette colour, because these shapes usually sit
|
|
1340
|
+
* on top of a painted shape whose fill has to stay visible.
|
|
1341
|
+
*/
|
|
1342
|
+
fillNone?: boolean;
|
|
1343
|
+
/** Solid fill colour (hex). */
|
|
1344
|
+
fillColor?: string;
|
|
1345
|
+
/**
|
|
1346
|
+
* Opacity (0..1) of the solid fill, from the colour's `a:alpha` (Basic Venn
|
|
1347
|
+
* paints its circles at 50% so overlaps blend). Absent when opaque.
|
|
1348
|
+
*/
|
|
1349
|
+
fillOpacity?: number;
|
|
1350
|
+
/**
|
|
1351
|
+
* Gradient fill stops when the cached shape uses `a:gradFill`. Positions are
|
|
1352
|
+
* 0..100 (percent). Renderers emit an SVG/CSS gradient instead of a flat box.
|
|
1353
|
+
*/
|
|
1354
|
+
fillGradientStops?: Array<{
|
|
1355
|
+
color: string;
|
|
1356
|
+
position: number;
|
|
1357
|
+
opacity?: number;
|
|
1358
|
+
}>;
|
|
1359
|
+
/** Gradient geometry type (`linear` for `a:lin`, `radial` for `a:path`). */
|
|
1360
|
+
fillGradientType?: 'linear' | 'radial';
|
|
1361
|
+
/** Linear gradient angle in degrees (0..360). */
|
|
1362
|
+
fillGradientAngle?: number;
|
|
1363
|
+
/** Pattern fill preset name from `a:pattFill/@prst` (e.g. "pct50", "cross"). */
|
|
1364
|
+
fillPatternPreset?: string;
|
|
1365
|
+
/** Pattern fill foreground colour (hex) from `a:pattFill/a:fgClr`. */
|
|
1366
|
+
fillPatternForegroundColor?: string;
|
|
1367
|
+
/** Pattern fill background colour (hex) from `a:pattFill/a:bgClr`. */
|
|
1368
|
+
fillPatternBackgroundColor?: string;
|
|
1369
|
+
/**
|
|
1370
|
+
* Relationship id of a picture (blip) fill's embedded image, from
|
|
1371
|
+
* `a:blipFill/a:blip/@r:embed`. The image bytes are resolved separately; see
|
|
1372
|
+
* {@link fillImageUrl}.
|
|
1373
|
+
*/
|
|
1374
|
+
fillBlipEmbedId?: string;
|
|
1375
|
+
/**
|
|
1376
|
+
* Resolved data-URI/URL for a picture (blip) fill, when the embedded image
|
|
1377
|
+
* part could be resolved. Absent when only {@link fillBlipEmbedId} is known.
|
|
1378
|
+
*/
|
|
1379
|
+
fillImageUrl?: string;
|
|
1380
|
+
/** Whether the cached shape carries an outer-shadow effect (`a:effectLst`). */
|
|
1381
|
+
hasShadow?: boolean;
|
|
1382
|
+
/** Resolved outer-shadow colour (hex), when present. */
|
|
1383
|
+
shadowColor?: string;
|
|
1384
|
+
/** Stroke colour (hex). */
|
|
1385
|
+
strokeColor?: string;
|
|
1386
|
+
/** Stroke width in points. */
|
|
1387
|
+
strokeWidth?: number;
|
|
1388
|
+
/** Text content of the shape. */
|
|
1389
|
+
text?: string;
|
|
1390
|
+
/** Standard rich-text segments projected from the associated SmartArt node. */
|
|
1391
|
+
textSegments?: TextSegment[];
|
|
1392
|
+
/** Font size in CSS pixels. */
|
|
1393
|
+
fontSize?: number;
|
|
1394
|
+
/** Font colour (hex). */
|
|
1395
|
+
fontColor?: string;
|
|
1396
|
+
/** Authored font family from the first styled run. */
|
|
1397
|
+
fontFamily?: string;
|
|
1398
|
+
/** Authored font weight (400 or 700). */
|
|
1399
|
+
fontWeight?: number;
|
|
1400
|
+
/** Authored font style. */
|
|
1401
|
+
fontStyle?: 'normal' | 'italic';
|
|
1402
|
+
/** Absolute line height in CSS pixels from `a:spcPts`. */
|
|
1403
|
+
lineHeight?: number;
|
|
1404
|
+
/** Relative line height from `a:spcPct`. */
|
|
1405
|
+
lineHeightRatio?: number;
|
|
1406
|
+
/** Absolute spacing after a paragraph in CSS pixels. */
|
|
1407
|
+
lineSpacingAfter?: number;
|
|
1408
|
+
/** Relative spacing after a paragraph. */
|
|
1409
|
+
lineSpacingAfterRatio?: number;
|
|
1410
|
+
/** Text-body insets in CSS pixels. */
|
|
1411
|
+
textInsetLeft?: number;
|
|
1412
|
+
textInsetTop?: number;
|
|
1413
|
+
textInsetRight?: number;
|
|
1414
|
+
textInsetBottom?: number;
|
|
1415
|
+
/** DiagramML text vertical anchor (`t`, `ctr`, or `b`). */
|
|
1416
|
+
textVerticalAnchor?: string;
|
|
1417
|
+
/** Independent DiagramML text-frame geometry from `dsp:txXfrm`. */
|
|
1418
|
+
textFrameX?: number;
|
|
1419
|
+
textFrameY?: number;
|
|
1420
|
+
textFrameWidth?: number;
|
|
1421
|
+
textFrameHeight?: number;
|
|
1422
|
+
/**
|
|
1423
|
+
* 3D scene (camera/light rig/backdrop) from `dsp:spPr/a:scene3d`, when this
|
|
1424
|
+
* cached shape carries its own per-shape camera. Bevel quick styles
|
|
1425
|
+
* (Polished, Inset, Cartoon, Powder) cache one per shape (always
|
|
1426
|
+
* `orthographicFront`, so the 2D layout stays undistorted). Scene quick
|
|
1427
|
+
* styles (Brick, Flat, Metallic, Sunset, Bird's Eye) instead put ONE camera
|
|
1428
|
+
* on the whole diagram (see `PptxSmartArtQuickStyle.scene3d`) and leave this
|
|
1429
|
+
* undefined on every shape.
|
|
1430
|
+
*/
|
|
1431
|
+
scene3d?: Pptx3DScene;
|
|
1432
|
+
/**
|
|
1433
|
+
* 3D extrusion/bevel/contour/material from `dsp:spPr/a:sp3d`. PowerPoint
|
|
1434
|
+
* caches this fully resolved (from the quick style's per-label `dgm:sp3d`)
|
|
1435
|
+
* on every shape for every non-flat quick style, bevel or scene alike.
|
|
1436
|
+
*/
|
|
1437
|
+
shape3d?: Pptx3DShape;
|
|
1438
|
+
/**
|
|
1439
|
+
* Text-body 3D extrusion/bevel from `dsp:txBody/a:bodyPr/a:sp3d`. Rare:
|
|
1440
|
+
* present when a quick style extrudes the label text itself off the shape
|
|
1441
|
+
* face (e.g. Bird's Eye Scene: `extrusionH="28000"`), rather than only the
|
|
1442
|
+
* shape body.
|
|
1443
|
+
*/
|
|
1444
|
+
text3d?: Text3DStyle;
|
|
1445
|
+
/**
|
|
1446
|
+
* The presentation style label (`presStyleLbl`: `node1`, `revTx`,
|
|
1447
|
+
* `sibTrans2D1`, ...) of the layout node a REGENERATED shape was laid out
|
|
1448
|
+
* from, when the layout engine reports it. Picks the quick-style label
|
|
1449
|
+
* whose 3D the shape takes; `undefined` on cached (parsed) shapes.
|
|
1450
|
+
*/
|
|
1451
|
+
styleLabel?: string;
|
|
1452
|
+
}
|
|
1453
|
+
/**
|
|
1454
|
+
* Complete parsed SmartArt data for a {@link SmartArtPptxElement}: the neutral
|
|
1455
|
+
* {@link DiagramData} (bound to the pptx node, quick-style and layout-definition
|
|
1456
|
+
* types) plus the package parts, cached drawing and save hints.
|
|
1457
|
+
*
|
|
1458
|
+
* @example
|
|
1459
|
+
* ```ts
|
|
1460
|
+
* const data: PptxSmartArtData = {
|
|
1461
|
+
* resolvedLayoutType: "hierarchy",
|
|
1462
|
+
* layout: "hierarchy",
|
|
1463
|
+
* colorScheme: "colorful1",
|
|
1464
|
+
* style: "moderate",
|
|
1465
|
+
* nodes: [
|
|
1466
|
+
* { id: "1", text: "CEO", children: [
|
|
1467
|
+
* { id: "2", text: "VP Marketing", parentId: "1" },
|
|
1468
|
+
* ]},
|
|
1469
|
+
* ],
|
|
1470
|
+
* };
|
|
1471
|
+
* // => satisfies PptxSmartArtData
|
|
1472
|
+
* ```
|
|
1473
|
+
*/
|
|
1474
|
+
interface PptxSmartArtData extends DiagramData {
|
|
1475
|
+
nodes: PptxSmartArtNode[];
|
|
1476
|
+
/** Pre-computed shapes from `ppt/diagrams/drawing*.xml`. */
|
|
1477
|
+
drawingShapes?: PptxSmartArtDrawingShape[];
|
|
1478
|
+
/** Background and outline chrome from `dgm:bg` / `dgm:whole`. */
|
|
1479
|
+
chrome?: PptxSmartArtChrome;
|
|
1480
|
+
/** Quick style from `ppt/diagrams/quickStyles*.xml`. */
|
|
1481
|
+
quickStyle?: PptxSmartArtQuickStyle;
|
|
1482
|
+
/** Editable metadata from the related DiagramML layout definition. */
|
|
1483
|
+
layoutDefinition?: PptxSmartArtLayoutDefinition;
|
|
1484
|
+
/** Relationship ID for the diagram data part (for round-trip save). */
|
|
1485
|
+
dataRelId?: string;
|
|
1486
|
+
/** Relationship ID for the diagram layout part. */
|
|
1487
|
+
layoutRelId?: string;
|
|
1488
|
+
/** Relationship ID for the drawing part. */
|
|
1489
|
+
drawingRelId?: string;
|
|
1490
|
+
/** Relationship ID for the colours part. */
|
|
1491
|
+
colorsRelId?: string;
|
|
1492
|
+
/** Relationship ID for the quick-styles part. */
|
|
1493
|
+
styleRelId?: string;
|
|
1494
|
+
/**
|
|
1495
|
+
* `uniqueId` of the built-in PowerPoint layout whose definition was applied by a layout swap
|
|
1496
|
+
* (`ooxml-core/pptx/smartart-layouts`). Save writes that definition as the layout part.
|
|
1497
|
+
*/
|
|
1498
|
+
builtinLayoutId?: string;
|
|
1499
|
+
/** Internal save hint: the layout definition changed in the editor. */
|
|
1500
|
+
layoutDirty?: boolean;
|
|
1501
|
+
/** Internal save hint: typed layout-definition metadata changed. */
|
|
1502
|
+
layoutDefinitionDirty?: boolean;
|
|
1503
|
+
/** Internal save hint: quick-style definition metadata changed. */
|
|
1504
|
+
quickStyleDirty?: boolean;
|
|
1505
|
+
/** Internal save hint: color-transform definition metadata changed. */
|
|
1506
|
+
colorTransformDirty?: boolean;
|
|
1507
|
+
/** Internal save hint: cached drawing geometry or text changed in the editor. */
|
|
1508
|
+
drawingDirty?: boolean;
|
|
1509
|
+
}
|
|
1510
|
+
//#endregion
|
|
1511
|
+
export { DiagramNodeTextParagraphItem as $, PptxSmartArtNode as A, DiagramNumericRule as At, PptxSmartArtTextRun as B, CustomGeometryPoint as Bt, PptxSmartArtIteratorAttributes as C, DiagramShapeAdjustment as Ct, PptxSmartArtLayoutNode as D, DiagramConstraintPointType as Dt, PptxSmartArtLayoutDefinition as E, DiagramConstraintOperator as Et, PptxSmartArtQuickStyleLabel as F, DiagramStyleIntensity as Ft, PptxSmartArtChrome as G, PptxCustomPathProperties as Gt, SmartArtLayout as H, CustomGeometrySegment as Ht, PptxSmartArtResolvedStyleRef as I, AdjustHandlePolar as It, DiagramLayoutPreset as J, PptxSmartArtRawBackgroundFill as K, PptxSmartArtShapeAdjustment as L, AdjustHandleXY as Lt, PptxSmartArtNumericRule as M, DiagramConnection as Mt, PptxSmartArtPresLayoutVars as N, DiagramLayoutType as Nt, PptxSmartArtLayoutNodeShape as O, DiagramConstraintRelationship as Ot, PptxSmartArtQuickStyle as P, DiagramNodeCustomLayout as Pt, DiagramNodeTextParagraph as Q, PptxSmartArtTextParagraph as R, ConnectionSite as Rt, PptxSmartArtHueDirection as S, DiagramLocalizedText as St, PptxSmartArtLayoutCategory as T, DiagramConstraint as Tt, SmartArtNodeCustomLayout as U, CustomGeometryTextRect as Ut, PptxSmartArtWhen as V, CustomGeometryRawData as Vt, SmartArtRoleColorList as W, GeometryAdjustmentHandle as Wt, DiagramNode as X, DiagramPresLayoutVars as Y, DiagramNodeStyle as Z, PptxSmartArtConstraintTarget as _, DiagramForEach as _t, SmartArtLayoutType as a, DiagramDefinitionCategory as at, PptxSmartArtDefinitionText as b, DiagramLayoutCategory as bt, PptxSmartArtChoose as c, DiagramHueDirection as ct, PptxSmartArtColorStyleLabel as d, DiagramResolvedStyleRef as dt, DiagramNodeTextRun as et, PptxSmartArtColorTransform as f, DiagramRoleColorList as ft, PptxSmartArtConstraintRelationship as g, DiagramChoose as gt, PptxSmartArtConstraintPointType as h, DiagramAlgorithmParameter as ht, SmartArtColorScheme as i, DiagramColorTransformLabel as it, PptxSmartArtNodeStyle as j, DiagramColorScheme as jt, PptxSmartArtLocalizedText as k, DiagramConstraintTarget as kt, PptxSmartArtColorApplicationMethod as l, DiagramQuickStyle as lt, PptxSmartArtConstraintOperator as m, DiagramLayoutNode as mt, PptxSmartArtData as n, DiagramColorListMetadata as nt, SmartArtStyle as o, DiagramDefinitionMetadata as ot, PptxSmartArtConstraint as p, DiagramLayoutDefinition as pt, DiagramData as q, PptxSmartArtDrawingShape as r, DiagramColorTransform as rt, PptxSmartArtAlgorithmParameter as s, DiagramDefinitionText as st, PptxSmartArtConnection as t, DiagramColorApplicationMethod as tt, PptxSmartArtColorListMetadata as u, DiagramQuickStyleLabel as ut, PptxSmartArtDefinitionCategory as v, DiagramIteratorAttributes as vt, PptxSmartArtLayoutAlgorithm as w, DiagramWhen as wt, PptxSmartArtForEach as x, DiagramLayoutNodeShape as xt, PptxSmartArtDefinitionMetadata as y, DiagramLayoutAlgorithm as yt, PptxSmartArtTextParagraphItem as z, CustomGeometryPath as zt };
|
|
1512
|
+
//# sourceMappingURL=smart-art-ENMMEbmW.d.ts.map
|