ooxml-core 1.47.0 → 1.48.1

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