pptx-templates 0.3.9 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/AI-INSTRUCTOR.md +46 -3
  2. package/CHANGELOG.md +236 -1
  3. package/README.md +61 -168
  4. package/dist/automizer.d.ts +7 -0
  5. package/dist/automizer.js +168 -176
  6. package/dist/automizer.js.map +1 -1
  7. package/dist/classes/content-type-registry.js +23 -36
  8. package/dist/classes/content-type-registry.js.map +1 -1
  9. package/dist/classes/element-importer.js +130 -148
  10. package/dist/classes/element-importer.js.map +1 -1
  11. package/dist/classes/has-shapes.js +81 -126
  12. package/dist/classes/has-shapes.js.map +1 -1
  13. package/dist/classes/layout.js +47 -67
  14. package/dist/classes/layout.js.map +1 -1
  15. package/dist/classes/master.js +70 -89
  16. package/dist/classes/master.js.map +1 -1
  17. package/dist/classes/placeholder-normalizer.js +48 -37
  18. package/dist/classes/placeholder-normalizer.js.map +1 -1
  19. package/dist/classes/related-content-copier.js +65 -86
  20. package/dist/classes/related-content-copier.js.map +1 -1
  21. package/dist/classes/shape.js +79 -110
  22. package/dist/classes/shape.js.map +1 -1
  23. package/dist/classes/slide-master-remover.js +108 -130
  24. package/dist/classes/slide-master-remover.js.map +1 -1
  25. package/dist/classes/slide-notes-copier.js +24 -41
  26. package/dist/classes/slide-notes-copier.js.map +1 -1
  27. package/dist/classes/slide.js +112 -141
  28. package/dist/classes/slide.js.map +1 -1
  29. package/dist/classes/template.js +82 -117
  30. package/dist/classes/template.js.map +1 -1
  31. package/dist/constants/constants.js.map +1 -1
  32. package/dist/enums/chart-type.js.map +1 -1
  33. package/dist/enums/content-type-map.js.map +1 -1
  34. package/dist/enums/element-type.js.map +1 -1
  35. package/dist/errors.js +5 -5
  36. package/dist/errors.js.map +1 -1
  37. package/dist/extensions/cli/index.js +3 -13
  38. package/dist/extensions/cli/index.js.map +1 -1
  39. package/dist/extensions/hide-slide/index.js +48 -46
  40. package/dist/extensions/hide-slide/index.js.map +1 -1
  41. package/dist/extensions/index.d.ts +13 -3
  42. package/dist/extensions/index.js +3 -1
  43. package/dist/extensions/index.js.map +1 -1
  44. package/dist/extensions/link-scheme/index.d.ts +12 -0
  45. package/dist/extensions/link-scheme/index.js +40 -0
  46. package/dist/extensions/link-scheme/index.js.map +1 -0
  47. package/dist/extensions/master-parts/index.js +36 -49
  48. package/dist/extensions/master-parts/index.js.map +1 -1
  49. package/dist/extensions/pptxgenjs-compat/img-broken-png.js.map +1 -1
  50. package/dist/extensions/pptxgenjs-compat/index.js.map +1 -1
  51. package/dist/extensions/pptxgenjs-compat/svg-fallback.js +56 -70
  52. package/dist/extensions/pptxgenjs-compat/svg-fallback.js.map +1 -1
  53. package/dist/extensions/regexp-escape/index.d.ts +10 -0
  54. package/dist/extensions/regexp-escape/index.js +15 -0
  55. package/dist/extensions/regexp-escape/index.js.map +1 -0
  56. package/dist/extensions/run-merge/index.js +4 -5
  57. package/dist/extensions/run-merge/index.js.map +1 -1
  58. package/dist/extensions/shape-geometry/index.js +33 -11
  59. package/dist/extensions/shape-geometry/index.js.map +1 -1
  60. package/dist/extensions/shape-geometry/presets.d.ts +1 -1
  61. package/dist/extensions/shape-geometry/presets.js.map +1 -1
  62. package/dist/extensions/shape-geometry/types.js.map +1 -1
  63. package/dist/extensions/template-lint/cli.js +71 -49
  64. package/dist/extensions/template-lint/cli.js.map +1 -1
  65. package/dist/extensions/template-lint/config.js +29 -13
  66. package/dist/extensions/template-lint/config.js.map +1 -1
  67. package/dist/extensions/template-lint/data-model.js +17 -20
  68. package/dist/extensions/template-lint/data-model.js.map +1 -1
  69. package/dist/extensions/template-lint/hints.js.map +1 -1
  70. package/dist/extensions/template-lint/index.js.map +1 -1
  71. package/dist/extensions/template-lint/init-cli.d.ts +2 -0
  72. package/dist/extensions/template-lint/init-cli.js +33 -23
  73. package/dist/extensions/template-lint/init-cli.js.map +1 -1
  74. package/dist/extensions/template-lint/lint.d.ts +1 -1
  75. package/dist/extensions/template-lint/lint.js +83 -64
  76. package/dist/extensions/template-lint/lint.js.map +1 -1
  77. package/dist/extensions/template-lint/skeleton.js +5 -6
  78. package/dist/extensions/template-lint/skeleton.js.map +1 -1
  79. package/dist/extensions/template-lint/types.js.map +1 -1
  80. package/dist/extensions/template-lint/usage-cli.js +17 -18
  81. package/dist/extensions/template-lint/usage-cli.js.map +1 -1
  82. package/dist/extensions/template-lint/usage.js +8 -9
  83. package/dist/extensions/template-lint/usage.js.map +1 -1
  84. package/dist/extensions/template-lint/watch.d.ts +2 -0
  85. package/dist/extensions/template-lint/watch.js +52 -7
  86. package/dist/extensions/template-lint/watch.js.map +1 -1
  87. package/dist/extensions/template-logic/clone.d.ts +2 -16
  88. package/dist/extensions/template-logic/clone.js +15 -90
  89. package/dist/extensions/template-logic/clone.js.map +1 -1
  90. package/dist/extensions/template-logic/commands.d.ts +1 -1
  91. package/dist/extensions/template-logic/commands.js +12 -11
  92. package/dist/extensions/template-logic/commands.js.map +1 -1
  93. package/dist/extensions/template-logic/expression.d.ts +15 -2
  94. package/dist/extensions/template-logic/expression.js +143 -63
  95. package/dist/extensions/template-logic/expression.js.map +1 -1
  96. package/dist/extensions/template-logic/images.js +58 -55
  97. package/dist/extensions/template-logic/images.js.map +1 -1
  98. package/dist/extensions/template-logic/index.js +16 -24
  99. package/dist/extensions/template-logic/index.js.map +1 -1
  100. package/dist/extensions/template-logic/list-commands.js +8 -19
  101. package/dist/extensions/template-logic/list-commands.js.map +1 -1
  102. package/dist/extensions/template-logic/renderer.d.ts +9 -0
  103. package/dist/extensions/template-logic/renderer.js +480 -477
  104. package/dist/extensions/template-logic/renderer.js.map +1 -1
  105. package/dist/extensions/template-logic/types.d.ts +8 -1
  106. package/dist/extensions/template-logic/types.js.map +1 -1
  107. package/dist/extensions/template-render/cli.js +34 -22
  108. package/dist/extensions/template-render/cli.js.map +1 -1
  109. package/dist/extensions/template-render/index.js +152 -107
  110. package/dist/extensions/template-render/index.js.map +1 -1
  111. package/dist/extensions/template-render/prune.d.ts +14 -0
  112. package/dist/extensions/template-render/prune.js +131 -0
  113. package/dist/extensions/template-render/prune.js.map +1 -0
  114. package/dist/extensions/template-render/zip-text.d.ts +9 -0
  115. package/dist/extensions/template-render/zip-text.js +27 -0
  116. package/dist/extensions/template-render/zip-text.js.map +1 -0
  117. package/dist/extensions/template-render/zip-writer.d.ts +16 -0
  118. package/dist/extensions/template-render/zip-writer.js +151 -0
  119. package/dist/extensions/template-render/zip-writer.js.map +1 -0
  120. package/dist/extensions/text-flow/flow.js +183 -207
  121. package/dist/extensions/text-flow/flow.js.map +1 -1
  122. package/dist/extensions/text-flow/font-file.d.ts +9 -0
  123. package/dist/extensions/text-flow/font-file.js +40 -22
  124. package/dist/extensions/text-flow/font-file.js.map +1 -1
  125. package/dist/extensions/text-flow/fonts.d.ts +4 -0
  126. package/dist/extensions/text-flow/fonts.js +67 -23
  127. package/dist/extensions/text-flow/fonts.js.map +1 -1
  128. package/dist/extensions/text-flow/index.js.map +1 -1
  129. package/dist/extensions/text-flow/layout.js +8 -9
  130. package/dist/extensions/text-flow/layout.js.map +1 -1
  131. package/dist/extensions/text-flow/slide-styles.js +18 -22
  132. package/dist/extensions/text-flow/slide-styles.js.map +1 -1
  133. package/dist/extensions/text-flow/styles.d.ts +7 -1
  134. package/dist/extensions/text-flow/styles.js +108 -64
  135. package/dist/extensions/text-flow/styles.js.map +1 -1
  136. package/dist/helper/archive/archive-fs.d.ts +11 -0
  137. package/dist/helper/archive/archive-fs.js +195 -142
  138. package/dist/helper/archive/archive-fs.js.map +1 -1
  139. package/dist/helper/archive/archive-jszip.js +101 -125
  140. package/dist/helper/archive/archive-jszip.js.map +1 -1
  141. package/dist/helper/archive/archive.d.ts +6 -0
  142. package/dist/helper/archive/archive.js +21 -30
  143. package/dist/helper/archive/archive.js.map +1 -1
  144. package/dist/helper/archive/jszip-fast-read.d.ts +26 -0
  145. package/dist/helper/archive/jszip-fast-read.js +166 -0
  146. package/dist/helper/archive/jszip-fast-read.js.map +1 -0
  147. package/dist/helper/cell-id-helper.d.ts +1 -0
  148. package/dist/helper/cell-id-helper.js +6 -2
  149. package/dist/helper/cell-id-helper.js.map +1 -1
  150. package/dist/helper/compute-src-rect.js +4 -5
  151. package/dist/helper/compute-src-rect.js.map +1 -1
  152. package/dist/helper/content-tracker.js +86 -114
  153. package/dist/helper/content-tracker.js.map +1 -1
  154. package/dist/helper/count-helper.js +48 -78
  155. package/dist/helper/count-helper.js.map +1 -1
  156. package/dist/helper/css-style-parser.d.ts +1 -1
  157. package/dist/helper/css-style-parser.js +1 -2
  158. package/dist/helper/css-style-parser.js.map +1 -1
  159. package/dist/helper/file-helper.js +30 -48
  160. package/dist/helper/file-helper.js.map +1 -1
  161. package/dist/helper/general-helper.js.map +1 -1
  162. package/dist/helper/generate/generate-pptxgenjs.js +36 -48
  163. package/dist/helper/generate/generate-pptxgenjs.js.map +1 -1
  164. package/dist/helper/html-to-multitext-helper.d.ts +4 -4
  165. package/dist/helper/html-to-multitext-helper.js +46 -23
  166. package/dist/helper/html-to-multitext-helper.js.map +1 -1
  167. package/dist/helper/hyperlink-processor.js +125 -139
  168. package/dist/helper/hyperlink-processor.js.map +1 -1
  169. package/dist/helper/image-dimensions.js.map +1 -1
  170. package/dist/helper/jszip-helper.d.ts +1 -1
  171. package/dist/helper/jszip-helper.js +40 -33
  172. package/dist/helper/jszip-helper.js.map +1 -1
  173. package/dist/helper/layout-index.js +51 -71
  174. package/dist/helper/layout-index.js.map +1 -1
  175. package/dist/helper/logger.js +4 -4
  176. package/dist/helper/logger.js.map +1 -1
  177. package/dist/helper/media-deduplicator.d.ts +24 -0
  178. package/dist/helper/media-deduplicator.js +81 -34
  179. package/dist/helper/media-deduplicator.js.map +1 -1
  180. package/dist/helper/modify-background-helper.js +46 -46
  181. package/dist/helper/modify-background-helper.js.map +1 -1
  182. package/dist/helper/modify-chart-helper.d.ts +1 -1
  183. package/dist/helper/modify-chart-helper.js +597 -591
  184. package/dist/helper/modify-chart-helper.js.map +1 -1
  185. package/dist/helper/modify-cleanup-helper.js +112 -112
  186. package/dist/helper/modify-cleanup-helper.js.map +1 -1
  187. package/dist/helper/modify-color-helper.d.ts +1 -1
  188. package/dist/helper/modify-color-helper.js +53 -53
  189. package/dist/helper/modify-color-helper.js.map +1 -1
  190. package/dist/helper/modify-helper.js +25 -25
  191. package/dist/helper/modify-helper.js.map +1 -1
  192. package/dist/helper/modify-hyperlink-element.js.map +1 -1
  193. package/dist/helper/modify-hyperlink-helper.js +152 -158
  194. package/dist/helper/modify-hyperlink-helper.js.map +1 -1
  195. package/dist/helper/modify-image-helper.d.ts +1 -1
  196. package/dist/helper/modify-image-helper.js +121 -132
  197. package/dist/helper/modify-image-helper.js.map +1 -1
  198. package/dist/helper/modify-presentation-helper.js +137 -154
  199. package/dist/helper/modify-presentation-helper.js.map +1 -1
  200. package/dist/helper/modify-shape-helper.js +262 -262
  201. package/dist/helper/modify-shape-helper.js.map +1 -1
  202. package/dist/helper/modify-table-helper.js +95 -84
  203. package/dist/helper/modify-table-helper.js.map +1 -1
  204. package/dist/helper/modify-text-helper.d.ts +8 -0
  205. package/dist/helper/modify-text-helper.js +202 -190
  206. package/dist/helper/modify-text-helper.js.map +1 -1
  207. package/dist/helper/modify-xml-helper.js +36 -36
  208. package/dist/helper/modify-xml-helper.js.map +1 -1
  209. package/dist/helper/multitext-helper.js +13 -9
  210. package/dist/helper/multitext-helper.js.map +1 -1
  211. package/dist/helper/ppt-paths.js +17 -17
  212. package/dist/helper/ppt-paths.js.map +1 -1
  213. package/dist/helper/shape-type-detector.js +18 -29
  214. package/dist/helper/shape-type-detector.js.map +1 -1
  215. package/dist/helper/text-replace-helper.js +8 -8
  216. package/dist/helper/text-replace-helper.js.map +1 -1
  217. package/dist/helper/xml/lnLRTB.js.map +1 -1
  218. package/dist/helper/xml/prstGeom.js.map +1 -1
  219. package/dist/helper/xml-clone.d.ts +24 -0
  220. package/dist/helper/xml-clone.js +269 -0
  221. package/dist/helper/xml-clone.js.map +1 -0
  222. package/dist/helper/xml-elements.js +17 -20
  223. package/dist/helper/xml-elements.js.map +1 -1
  224. package/dist/helper/xml-find.d.ts +4 -0
  225. package/dist/helper/xml-find.js +48 -0
  226. package/dist/helper/xml-find.js.map +1 -0
  227. package/dist/helper/xml-helper.js +102 -135
  228. package/dist/helper/xml-helper.js.map +1 -1
  229. package/dist/helper/xml-parse-cache.d.ts +31 -0
  230. package/dist/helper/xml-parse-cache.js +71 -0
  231. package/dist/helper/xml-parse-cache.js.map +1 -0
  232. package/dist/helper/xml-placeholder-helper.js +10 -10
  233. package/dist/helper/xml-placeholder-helper.js.map +1 -1
  234. package/dist/helper/xml-pretty-print.js.map +1 -1
  235. package/dist/helper/xml-relationship-helper.js +132 -147
  236. package/dist/helper/xml-relationship-helper.js.map +1 -1
  237. package/dist/helper/xml-serializer.d.ts +2 -0
  238. package/dist/helper/xml-serializer.js +192 -0
  239. package/dist/helper/xml-serializer.js.map +1 -0
  240. package/dist/helper/xml-slide-helper.js +109 -129
  241. package/dist/helper/xml-slide-helper.js.map +1 -1
  242. package/dist/helper/xml-template-helper.js +120 -144
  243. package/dist/helper/xml-template-helper.js.map +1 -1
  244. package/dist/helper/xmldom-sax-patch.js +52 -2
  245. package/dist/helper/xmldom-sax-patch.js.map +1 -1
  246. package/dist/index.d.ts +4 -4
  247. package/dist/index.js +4 -2
  248. package/dist/index.js.map +1 -1
  249. package/dist/interfaces/iarchive.js.map +1 -1
  250. package/dist/interfaces/ichart.js.map +1 -1
  251. package/dist/interfaces/icounter.js.map +1 -1
  252. package/dist/interfaces/igenerator.js.map +1 -1
  253. package/dist/interfaces/iimage.js.map +1 -1
  254. package/dist/interfaces/ilayout.js.map +1 -1
  255. package/dist/interfaces/imaster.js.map +1 -1
  256. package/dist/interfaces/imulti-text.js.map +1 -1
  257. package/dist/interfaces/ipptxgenjs-slide.js.map +1 -1
  258. package/dist/interfaces/ipresentation-props.js.map +1 -1
  259. package/dist/interfaces/ishape-action.js.map +1 -1
  260. package/dist/interfaces/ishape.js.map +1 -1
  261. package/dist/interfaces/islide.js.map +1 -1
  262. package/dist/interfaces/itemplate.js.map +1 -1
  263. package/dist/interfaces/pres-template.js.map +1 -1
  264. package/dist/interfaces/root-pres-template.js.map +1 -1
  265. package/dist/modify/modify-chart.d.ts +4 -4
  266. package/dist/modify/modify-chart.js +35 -23
  267. package/dist/modify/modify-chart.js.map +1 -1
  268. package/dist/modify/modify-table.d.ts +0 -1
  269. package/dist/modify/modify-table.js +19 -27
  270. package/dist/modify/modify-table.js.map +1 -1
  271. package/dist/shapes/chart.js +238 -287
  272. package/dist/shapes/chart.js.map +1 -1
  273. package/dist/shapes/diagram.d.ts +14 -0
  274. package/dist/shapes/diagram.js +167 -103
  275. package/dist/shapes/diagram.js.map +1 -1
  276. package/dist/shapes/generic.js +62 -83
  277. package/dist/shapes/generic.js.map +1 -1
  278. package/dist/shapes/hyperlink.d.ts +0 -1
  279. package/dist/shapes/hyperlink.js +84 -124
  280. package/dist/shapes/hyperlink.js.map +1 -1
  281. package/dist/shapes/image.js +118 -149
  282. package/dist/shapes/image.js.map +1 -1
  283. package/dist/shapes/ole.js +148 -188
  284. package/dist/shapes/ole.js.map +1 -1
  285. package/dist/types/chart-types.js.map +1 -1
  286. package/dist/types/modify-types.js.map +1 -1
  287. package/dist/types/shape-types.js.map +1 -1
  288. package/dist/types/table-types.js.map +1 -1
  289. package/dist/types/types.d.ts +7 -0
  290. package/dist/types/types.js.map +1 -1
  291. package/dist/types/xml-types.js.map +1 -1
  292. package/dist/vendor/pptxgenjs/README.md +8 -3
  293. package/dist/vendor/pptxgenjs/index.js +19 -2
  294. package/package.json +13 -16
@@ -49,6 +49,268 @@ const SPPR_AFTER_LINE_TAGS = [
49
49
  * Provides various methods for manipulating shape appearance, position, and content
50
50
  */
51
51
  class ModifyShapeHelper {
52
+ /**
53
+ * Set solid fill of modified shape to accent6 color
54
+ *
55
+ * @param element - XML element representing the shape
56
+ */
57
+ static { this.setSolidFill = (element) => {
58
+ element
59
+ .getElementsByTagName('a:solidFill')[0]
60
+ .getElementsByTagName('a:schemeClr')[0]
61
+ .setAttribute('val', 'accent6');
62
+ }; }
63
+ /**
64
+ * Set outline (line) properties of an existing shape, picture or
65
+ * placeholder: width, dash style and color.
66
+ *
67
+ * Creates an <a:ln> element if the shape has none, which is the case
68
+ * whenever the outline was never overridden in PowerPoint and is
69
+ * inherited from the theme or the shape style.
70
+ *
71
+ * Note: if the shape's outline was explicitly switched off in PowerPoint
72
+ * (<a:ln><a:noFill/></a:ln>), a weight alone stays invisible - pass a
73
+ * color as well. Use ModifyCleanupHelper.removeBorder to drop an outline.
74
+ *
75
+ * @param outline - Width (EMU, 1pt = 12700), dash type and/or color
76
+ * @returns Function that accepts an XML element to modify
77
+ */
78
+ static { this.setOutline = (outline) => (element) => {
79
+ // For grouped shapes, this targets the first child shape;
80
+ // modify the members of a group individually instead.
81
+ const spPr = element.getElementsByTagName('p:spPr')[0] ||
82
+ element.getElementsByTagName('a:spPr')[0];
83
+ if (!spPr) {
84
+ return; // e.g. a graphicFrame (table/chart) has no shape properties
85
+ }
86
+ // Direct child only: <a:ln> also occurs in text run properties.
87
+ const existingLine = xml_helper_1.XmlHelper.getFirstDirectChild(spPr, ['a:ln']);
88
+ if (existingLine) {
89
+ new xml_elements_1.default(spPr, { outline }).applyOutline(existingLine);
90
+ return;
91
+ }
92
+ const line = new xml_elements_1.default(spPr, { outline }).outline();
93
+ const anchor = xml_helper_1.XmlHelper.getFirstDirectChild(spPr, SPPR_AFTER_LINE_TAGS);
94
+ if (anchor) {
95
+ spPr.insertBefore(line, anchor);
96
+ }
97
+ else {
98
+ spPr.appendChild(line);
99
+ }
100
+ }; }
101
+ /**
102
+ * Set text content of a shape
103
+ *
104
+ * @param text - Text string to set as shape content
105
+ * @returns Function that accepts an XML element to modify
106
+ */
107
+ static { this.setText = (text) => (element) => {
108
+ modify_text_helper_1.default.setText(text)(element);
109
+ }; }
110
+ /**
111
+ * Set content to bulleted list within a shape
112
+ *
113
+ * @param list - Array or string content for the bullet list
114
+ * @returns Function that accepts an XML element to modify
115
+ */
116
+ static { this.setBulletList = (list) => (element) => {
117
+ modify_text_helper_1.default.setBulletList(list)(element);
118
+ }; }
119
+ /**
120
+ * Replace tagged text content within modified shape
121
+ *
122
+ * @param replaceText - Single replacement or array of replacements
123
+ * @param options - Optional configuration for text replacement
124
+ * @returns Function that accepts an XML element to modify
125
+ */
126
+ static { this.replaceText = (replaceText, options) => (element) => {
127
+ const replaceTexts = general_helper_1.GeneralHelper.arrayify(replaceText);
128
+ new text_replace_helper_1.default(options, element)
129
+ .isolateTaggedNodes()
130
+ .applyReplacements(replaceTexts);
131
+ }; }
132
+ /**
133
+ * Creates missing transformation elements (a:off and a:ext) with default values
134
+ * Ensures that a shape has the required XML structure for positioning and sizing
135
+ *
136
+ * @param element - The XML element to check and modify
137
+ * @returns The xfrm element that contains or will contain the transformation data
138
+ */
139
+ static { this.ensureTransformElements = (element) => {
140
+ // First find the xfrm element (could be a:xfrm or p:xfrm)
141
+ let xfrm = element.getElementsByTagName('a:xfrm')[0];
142
+ if (!xfrm) {
143
+ xfrm = element.getElementsByTagName('p:xfrm')[0];
144
+ }
145
+ // If no xfrm element exists, try to find the appropriate parent to create it
146
+ if (!xfrm) {
147
+ const spPr = element.getElementsByTagName('p:spPr')[0] ||
148
+ element.getElementsByTagName('a:spPr')[0];
149
+ if (!spPr) {
150
+ return null; // Cannot create xfrm without a proper parent
151
+ }
152
+ // Create the xfrm element
153
+ xfrm = element.ownerDocument.createElement('a:xfrm');
154
+ spPr.appendChild(xfrm);
155
+ }
156
+ // Create a:off element if it doesn't exist
157
+ if (!xfrm.getElementsByTagName('a:off')[0]) {
158
+ const newAOff = element.ownerDocument.createElement('a:off');
159
+ // Set default coordinates (0,0)
160
+ newAOff.setAttribute('x', '0');
161
+ newAOff.setAttribute('y', '0');
162
+ // Insert a:off as the first child of xfrm
163
+ if (xfrm.hasChildNodes()) {
164
+ xfrm.insertBefore(newAOff, xfrm.firstChild);
165
+ }
166
+ else {
167
+ xfrm.appendChild(newAOff);
168
+ }
169
+ }
170
+ // Create a:ext element if it doesn't exist
171
+ if (!xfrm.getElementsByTagName('a:ext')[0]) {
172
+ const newAExt = element.ownerDocument.createElement('a:ext');
173
+ // Set default dimensions - using 1000000 which is about 2.78cm
174
+ newAExt.setAttribute('cx', '1000000');
175
+ newAExt.setAttribute('cy', '1000000');
176
+ // Add the a:ext element after a:off
177
+ xfrm.appendChild(newAExt);
178
+ }
179
+ return xfrm;
180
+ }; }
181
+ /**
182
+ * Set absolute position and size of a shape
183
+ *
184
+ * @param pos - Object containing position and size coordinates
185
+ * @returns Function that accepts an XML element to modify
186
+ */
187
+ static { this.setPosition = (pos) => (element) => {
188
+ // Ensure the transform elements exist
189
+ const xfrm = ModifyShapeHelper.ensureTransformElements(element);
190
+ if (!xfrm) {
191
+ return; // Cannot set position without proper structure
192
+ }
193
+ // Apply each provided coordinate
194
+ Object.keys(pos).forEach((key) => {
195
+ const mapped = map[key];
196
+ let value = Math.round(pos[key]);
197
+ // Skip invalid values or unsupported properties
198
+ if (typeof value !== 'number' || !mapped)
199
+ return;
200
+ // Ensure value is not negative
201
+ value = value < 0 ? 0 : value;
202
+ // Set the value in the appropriate XML tag and attribute
203
+ xfrm
204
+ .getElementsByTagName(mapped.tag)[0]
205
+ .setAttribute(mapped.attribute, String(value));
206
+ });
207
+ }; }
208
+ /**
209
+ * Incrementally update position and size of a shape by adding delta values
210
+ *
211
+ * @param pos - Object containing delta values for position and size
212
+ * @returns Function that accepts an XML element to modify
213
+ */
214
+ static { this.updatePosition = (pos) => (element) => {
215
+ // Ensure the transform elements exist
216
+ const xfrm = ModifyShapeHelper.ensureTransformElements(element);
217
+ if (!xfrm) {
218
+ return; // Cannot update position without proper structure
219
+ }
220
+ // Apply each provided delta coordinate
221
+ Object.keys(pos).forEach((key) => {
222
+ const mapped = map[key];
223
+ let value = Math.round(pos[key]);
224
+ // Skip invalid values or unsupported properties
225
+ if (typeof value !== 'number' || !mapped)
226
+ return;
227
+ // Get current value and add the delta
228
+ const currentValue = xfrm
229
+ .getElementsByTagName(mapped.tag)[0]
230
+ .getAttribute(mapped.attribute);
231
+ value += Number(currentValue);
232
+ // Update the value in the appropriate XML tag and attribute
233
+ xfrm
234
+ .getElementsByTagName(mapped.tag)[0]
235
+ .setAttribute(mapped.attribute, String(value));
236
+ });
237
+ }; }
238
+ /**
239
+ * Rotate a shape by a given angle in degrees
240
+ *
241
+ * @param degrees - Rotation angle in degrees (positive = clockwise, negative = counterclockwise)
242
+ * @returns Function that accepts an XML element to modify
243
+ */
244
+ static { this.rotate = (degrees) => (element) => {
245
+ const spPr = element.getElementsByTagName('p:spPr');
246
+ if (spPr) {
247
+ const xfrm = spPr.item(0).getElementsByTagName('a:xfrm').item(0);
248
+ // Convert negative degrees to equivalent positive value (0-359)
249
+ degrees = degrees < 0 ? 360 + degrees : degrees;
250
+ // PowerPoint uses 60000 units per degree for rotation
251
+ xfrm.setAttribute('rot', String(Math.round(degrees * 60000)));
252
+ }
253
+ }; }
254
+ /**
255
+ * Apply rounded corners to a shape with a specified corner radius
256
+ *
257
+ * @param degree - Corner radius in EMU units (1 cm = 360000 EMU)
258
+ * @returns Function that accepts an XML element to modify
259
+ */
260
+ static { this.roundedCorners = (degree) => (element) => {
261
+ // Find the spPr element where we need to add or modify the a:prstGeom element
262
+ const spPr = element.getElementsByTagName('p:spPr')[0] ||
263
+ element.getElementsByTagName('a:spPr')[0];
264
+ if (!spPr) {
265
+ return; // Cannot find spPr element
266
+ }
267
+ // Get the shape dimensions to calculate the appropriate adjustment value
268
+ const xfrm = ModifyShapeHelper.ensureTransformElements(element);
269
+ if (!xfrm) {
270
+ return; // Cannot proceed without proper transformation data
271
+ }
272
+ // Get current width and height
273
+ const width = Number(xfrm.getElementsByTagName('a:ext')[0].getAttribute('cx'));
274
+ const height = Number(xfrm.getElementsByTagName('a:ext')[0].getAttribute('cy'));
275
+ // Calculate the adjustment value based on the smaller dimension
276
+ const minDimension = Math.min(width, height);
277
+ // Ensure degree is within reasonable bounds (PowerPoint uses 0-50% for rounded rect)
278
+ const clampedDegree = Math.max(0, Math.min(degree, minDimension / 2));
279
+ // Calculate the adjustment value (0-100000 where 100000 is 100%)
280
+ // PowerPoint uses the percentage of the shorter dimension for corners
281
+ const adjValue = Math.round((clampedDegree / minDimension) * 100000);
282
+ // Remove any existing prstGeom element
283
+ const existingPrstGeom = spPr.getElementsByTagName('a:prstGeom')[0];
284
+ if (existingPrstGeom) {
285
+ xml_helper_1.XmlHelper.remove(existingPrstGeom);
286
+ }
287
+ // Create the new prstGeom element with the roundRect preset
288
+ const prstGeom = element.ownerDocument.createElement('a:prstGeom');
289
+ prstGeom.setAttribute('prst', 'roundRect');
290
+ // Create the avLst element and the adjustment value
291
+ const avLst = element.ownerDocument.createElement('a:avLst');
292
+ const gd = element.ownerDocument.createElement('a:gd');
293
+ gd.setAttribute('name', 'adj');
294
+ gd.setAttribute('fmla', `val ${adjValue}`);
295
+ // Build the element hierarchy
296
+ avLst.appendChild(gd);
297
+ prstGeom.appendChild(avLst);
298
+ // Add the new prstGeom element to spPr at the appropriate position
299
+ // It should be added after xfrm but before other elements
300
+ const xfrmElement = spPr.getElementsByTagName('a:xfrm')[0];
301
+ if (xfrmElement && xfrmElement.nextSibling) {
302
+ spPr.insertBefore(prstGeom, xfrmElement.nextSibling);
303
+ }
304
+ else {
305
+ spPr.appendChild(prstGeom);
306
+ }
307
+ // Check for noFill element - for picture elements, we need to remove noFill
308
+ // otherwise the picture will be invisible when we apply rounded corners
309
+ const noFillElement = spPr.getElementsByTagName('a:noFill')[0];
310
+ if (noFillElement) {
311
+ xml_helper_1.XmlHelper.remove(noFillElement);
312
+ }
313
+ }; }
52
314
  /**
53
315
  * Determines the type of visual element in PowerPoint
54
316
  * @param element The XML element to check
@@ -74,267 +336,5 @@ class ModifyShapeHelper {
74
336
  return index_1.ModifyColorHelper.elementHasBackground(element);
75
337
  }
76
338
  }
77
- /**
78
- * Set solid fill of modified shape to accent6 color
79
- *
80
- * @param element - XML element representing the shape
81
- */
82
- ModifyShapeHelper.setSolidFill = (element) => {
83
- element
84
- .getElementsByTagName('a:solidFill')[0]
85
- .getElementsByTagName('a:schemeClr')[0]
86
- .setAttribute('val', 'accent6');
87
- };
88
- /**
89
- * Set outline (line) properties of an existing shape, picture or
90
- * placeholder: width, dash style and color.
91
- *
92
- * Creates an <a:ln> element if the shape has none, which is the case
93
- * whenever the outline was never overridden in PowerPoint and is
94
- * inherited from the theme or the shape style.
95
- *
96
- * Note: if the shape's outline was explicitly switched off in PowerPoint
97
- * (<a:ln><a:noFill/></a:ln>), a weight alone stays invisible - pass a
98
- * color as well. Use ModifyCleanupHelper.removeBorder to drop an outline.
99
- *
100
- * @param outline - Width (EMU, 1pt = 12700), dash type and/or color
101
- * @returns Function that accepts an XML element to modify
102
- */
103
- ModifyShapeHelper.setOutline = (outline) => (element) => {
104
- // For grouped shapes, this targets the first child shape;
105
- // modify the members of a group individually instead.
106
- const spPr = element.getElementsByTagName('p:spPr')[0] ||
107
- element.getElementsByTagName('a:spPr')[0];
108
- if (!spPr) {
109
- return; // e.g. a graphicFrame (table/chart) has no shape properties
110
- }
111
- // Direct child only: <a:ln> also occurs in text run properties.
112
- const existingLine = xml_helper_1.XmlHelper.getFirstDirectChild(spPr, ['a:ln']);
113
- if (existingLine) {
114
- new xml_elements_1.default(spPr, { outline }).applyOutline(existingLine);
115
- return;
116
- }
117
- const line = new xml_elements_1.default(spPr, { outline }).outline();
118
- const anchor = xml_helper_1.XmlHelper.getFirstDirectChild(spPr, SPPR_AFTER_LINE_TAGS);
119
- if (anchor) {
120
- spPr.insertBefore(line, anchor);
121
- }
122
- else {
123
- spPr.appendChild(line);
124
- }
125
- };
126
- /**
127
- * Set text content of a shape
128
- *
129
- * @param text - Text string to set as shape content
130
- * @returns Function that accepts an XML element to modify
131
- */
132
- ModifyShapeHelper.setText = (text) => (element) => {
133
- modify_text_helper_1.default.setText(text)(element);
134
- };
135
- /**
136
- * Set content to bulleted list within a shape
137
- *
138
- * @param list - Array or string content for the bullet list
139
- * @returns Function that accepts an XML element to modify
140
- */
141
- ModifyShapeHelper.setBulletList = (list) => (element) => {
142
- modify_text_helper_1.default.setBulletList(list)(element);
143
- };
144
- /**
145
- * Replace tagged text content within modified shape
146
- *
147
- * @param replaceText - Single replacement or array of replacements
148
- * @param options - Optional configuration for text replacement
149
- * @returns Function that accepts an XML element to modify
150
- */
151
- ModifyShapeHelper.replaceText = (replaceText, options) => (element) => {
152
- const replaceTexts = general_helper_1.GeneralHelper.arrayify(replaceText);
153
- new text_replace_helper_1.default(options, element)
154
- .isolateTaggedNodes()
155
- .applyReplacements(replaceTexts);
156
- };
157
- /**
158
- * Creates missing transformation elements (a:off and a:ext) with default values
159
- * Ensures that a shape has the required XML structure for positioning and sizing
160
- *
161
- * @param element - The XML element to check and modify
162
- * @returns The xfrm element that contains or will contain the transformation data
163
- */
164
- ModifyShapeHelper.ensureTransformElements = (element) => {
165
- // First find the xfrm element (could be a:xfrm or p:xfrm)
166
- let xfrm = element.getElementsByTagName('a:xfrm')[0];
167
- if (!xfrm) {
168
- xfrm = element.getElementsByTagName('p:xfrm')[0];
169
- }
170
- // If no xfrm element exists, try to find the appropriate parent to create it
171
- if (!xfrm) {
172
- const spPr = element.getElementsByTagName('p:spPr')[0] ||
173
- element.getElementsByTagName('a:spPr')[0];
174
- if (!spPr) {
175
- return null; // Cannot create xfrm without a proper parent
176
- }
177
- // Create the xfrm element
178
- xfrm = element.ownerDocument.createElement('a:xfrm');
179
- spPr.appendChild(xfrm);
180
- }
181
- // Create a:off element if it doesn't exist
182
- if (!xfrm.getElementsByTagName('a:off')[0]) {
183
- const newAOff = element.ownerDocument.createElement('a:off');
184
- // Set default coordinates (0,0)
185
- newAOff.setAttribute('x', '0');
186
- newAOff.setAttribute('y', '0');
187
- // Insert a:off as the first child of xfrm
188
- if (xfrm.hasChildNodes()) {
189
- xfrm.insertBefore(newAOff, xfrm.firstChild);
190
- }
191
- else {
192
- xfrm.appendChild(newAOff);
193
- }
194
- }
195
- // Create a:ext element if it doesn't exist
196
- if (!xfrm.getElementsByTagName('a:ext')[0]) {
197
- const newAExt = element.ownerDocument.createElement('a:ext');
198
- // Set default dimensions - using 1000000 which is about 2.78cm
199
- newAExt.setAttribute('cx', '1000000');
200
- newAExt.setAttribute('cy', '1000000');
201
- // Add the a:ext element after a:off
202
- xfrm.appendChild(newAExt);
203
- }
204
- return xfrm;
205
- };
206
- /**
207
- * Set absolute position and size of a shape
208
- *
209
- * @param pos - Object containing position and size coordinates
210
- * @returns Function that accepts an XML element to modify
211
- */
212
- ModifyShapeHelper.setPosition = (pos) => (element) => {
213
- // Ensure the transform elements exist
214
- const xfrm = ModifyShapeHelper.ensureTransformElements(element);
215
- if (!xfrm) {
216
- return; // Cannot set position without proper structure
217
- }
218
- // Apply each provided coordinate
219
- Object.keys(pos).forEach((key) => {
220
- const mapped = map[key];
221
- let value = Math.round(pos[key]);
222
- // Skip invalid values or unsupported properties
223
- if (typeof value !== 'number' || !mapped)
224
- return;
225
- // Ensure value is not negative
226
- value = value < 0 ? 0 : value;
227
- // Set the value in the appropriate XML tag and attribute
228
- xfrm
229
- .getElementsByTagName(mapped.tag)[0]
230
- .setAttribute(mapped.attribute, String(value));
231
- });
232
- };
233
- /**
234
- * Incrementally update position and size of a shape by adding delta values
235
- *
236
- * @param pos - Object containing delta values for position and size
237
- * @returns Function that accepts an XML element to modify
238
- */
239
- ModifyShapeHelper.updatePosition = (pos) => (element) => {
240
- // Ensure the transform elements exist
241
- const xfrm = ModifyShapeHelper.ensureTransformElements(element);
242
- if (!xfrm) {
243
- return; // Cannot update position without proper structure
244
- }
245
- // Apply each provided delta coordinate
246
- Object.keys(pos).forEach((key) => {
247
- const mapped = map[key];
248
- let value = Math.round(pos[key]);
249
- // Skip invalid values or unsupported properties
250
- if (typeof value !== 'number' || !mapped)
251
- return;
252
- // Get current value and add the delta
253
- const currentValue = xfrm
254
- .getElementsByTagName(mapped.tag)[0]
255
- .getAttribute(mapped.attribute);
256
- value += Number(currentValue);
257
- // Update the value in the appropriate XML tag and attribute
258
- xfrm
259
- .getElementsByTagName(mapped.tag)[0]
260
- .setAttribute(mapped.attribute, String(value));
261
- });
262
- };
263
- /**
264
- * Rotate a shape by a given angle in degrees
265
- *
266
- * @param degrees - Rotation angle in degrees (positive = clockwise, negative = counterclockwise)
267
- * @returns Function that accepts an XML element to modify
268
- */
269
- ModifyShapeHelper.rotate = (degrees) => (element) => {
270
- const spPr = element.getElementsByTagName('p:spPr');
271
- if (spPr) {
272
- const xfrm = spPr.item(0).getElementsByTagName('a:xfrm').item(0);
273
- // Convert negative degrees to equivalent positive value (0-359)
274
- degrees = degrees < 0 ? 360 + degrees : degrees;
275
- // PowerPoint uses 60000 units per degree for rotation
276
- xfrm.setAttribute('rot', String(Math.round(degrees * 60000)));
277
- }
278
- };
279
- /**
280
- * Apply rounded corners to a shape with a specified corner radius
281
- *
282
- * @param degree - Corner radius in EMU units (1 cm = 360000 EMU)
283
- * @returns Function that accepts an XML element to modify
284
- */
285
- ModifyShapeHelper.roundedCorners = (degree) => (element) => {
286
- // Find the spPr element where we need to add or modify the a:prstGeom element
287
- const spPr = element.getElementsByTagName('p:spPr')[0] ||
288
- element.getElementsByTagName('a:spPr')[0];
289
- if (!spPr) {
290
- return; // Cannot find spPr element
291
- }
292
- // Get the shape dimensions to calculate the appropriate adjustment value
293
- const xfrm = ModifyShapeHelper.ensureTransformElements(element);
294
- if (!xfrm) {
295
- return; // Cannot proceed without proper transformation data
296
- }
297
- // Get current width and height
298
- const width = Number(xfrm.getElementsByTagName('a:ext')[0].getAttribute('cx'));
299
- const height = Number(xfrm.getElementsByTagName('a:ext')[0].getAttribute('cy'));
300
- // Calculate the adjustment value based on the smaller dimension
301
- const minDimension = Math.min(width, height);
302
- // Ensure degree is within reasonable bounds (PowerPoint uses 0-50% for rounded rect)
303
- const clampedDegree = Math.max(0, Math.min(degree, minDimension / 2));
304
- // Calculate the adjustment value (0-100000 where 100000 is 100%)
305
- // PowerPoint uses the percentage of the shorter dimension for corners
306
- const adjValue = Math.round((clampedDegree / minDimension) * 100000);
307
- // Remove any existing prstGeom element
308
- const existingPrstGeom = spPr.getElementsByTagName('a:prstGeom')[0];
309
- if (existingPrstGeom) {
310
- xml_helper_1.XmlHelper.remove(existingPrstGeom);
311
- }
312
- // Create the new prstGeom element with the roundRect preset
313
- const prstGeom = element.ownerDocument.createElement('a:prstGeom');
314
- prstGeom.setAttribute('prst', 'roundRect');
315
- // Create the avLst element and the adjustment value
316
- const avLst = element.ownerDocument.createElement('a:avLst');
317
- const gd = element.ownerDocument.createElement('a:gd');
318
- gd.setAttribute('name', 'adj');
319
- gd.setAttribute('fmla', `val ${adjValue}`);
320
- // Build the element hierarchy
321
- avLst.appendChild(gd);
322
- prstGeom.appendChild(avLst);
323
- // Add the new prstGeom element to spPr at the appropriate position
324
- // It should be added after xfrm but before other elements
325
- const xfrmElement = spPr.getElementsByTagName('a:xfrm')[0];
326
- if (xfrmElement && xfrmElement.nextSibling) {
327
- spPr.insertBefore(prstGeom, xfrmElement.nextSibling);
328
- }
329
- else {
330
- spPr.appendChild(prstGeom);
331
- }
332
- // Check for noFill element - for picture elements, we need to remove noFill
333
- // otherwise the picture will be invisible when we apply rounded corners
334
- const noFillElement = spPr.getElementsByTagName('a:noFill')[0];
335
- if (noFillElement) {
336
- xml_helper_1.XmlHelper.remove(noFillElement);
337
- }
338
- };
339
339
  exports.default = ModifyShapeHelper;
340
340
  //# sourceMappingURL=modify-shape-helper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"modify-shape-helper.js","sourceRoot":"","sources":["../../src/helper/modify-shape-helper.ts"],"names":[],"mappings":";;;;;AAUA,kEAAyC;AAEzC,qDAAiD;AACjD,gFAAsD;AACtD,8EAAoD;AAOpD,6CAAyC;AACzC,yDAAoD;AACpD,sFAA4D;AAC5D,oCAA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,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;QACvD,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC7B,CAAC;QAED,4EAA4E;QAC5E,wEAAwE;QACxE,MAAM,aAAa,GAAG,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/D,IAAI,aAAa,EAAE,CAAC;YAClB,sBAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAClC,CAAC;IACH,CAAC,CAAC;IAEJ;;;;OAIG;IACH,MAAM,CAAC,oBAAoB,CAAC,OAAmB;QAC7C,OAAO,iCAAc,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,yBAAyB,CAAC,OAAmB;QAClD,OAAO,gCAAoB,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,oBAAoB,CAAC,OAAmB;QAC7C,OAAO,yBAAiB,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAA;IACxD,CAAC;CACF","sourcesContent":["/**\n * @file ModifyShapeHelper provides utility functions for manipulating PowerPoint shapes\n * through XML modifications.\n */\nimport {\n BulletListContent,\n ReplaceText,\n ReplaceTextOptions,\n ShapeOutline,\n} from '../types/modify-types';\nimport XmlElements from './xml-elements';\nimport { ShapeCoordinates } from '../types/shape-types';\nimport { GeneralHelper } from './general-helper';\nimport TextReplaceHelper from './text-replace-helper';\nimport ModifyTextHelper from './modify-text-helper';\nimport {\n ElementVisualType,\n PlaceholderInfo,\n ShapeBackgroundInfo,\n XmlElement,\n} from '../types/xml-types';\nimport { XmlHelper } from './xml-helper';\nimport { XmlSlideHelper } from './xml-slide-helper';\nimport XmlPlaceholderHelper from './xml-placeholder-helper';\nimport { ModifyColorHelper } from '../index';\n\n/**\n * Mapping between user-friendly property names and their corresponding XML structure\n * This allows using multiple alias names for the same shape properties\n */\nconst map = {\n // X position mappings (left)\n x: { tag: 'a:off', attribute: 'x' },\n l: { tag: 'a:off', attribute: 'x' },\n left: { tag: 'a:off', attribute: 'x' },\n\n // Y position mappings (top)\n y: { tag: 'a:off', attribute: 'y' },\n t: { tag: 'a:off', attribute: 'y' },\n top: { tag: 'a:off', attribute: 'y' },\n\n // Width mappings\n cx: { tag: 'a:ext', attribute: 'cx' },\n w: { tag: 'a:ext', attribute: 'cx' },\n width: { tag: 'a:ext', attribute: 'cx' },\n\n // Height mappings\n cy: { tag: 'a:ext', attribute: 'cy' },\n h: { tag: 'a:ext', attribute: 'cy' },\n height: { tag: 'a:ext', attribute: 'cy' },\n};\n\n/**\n * Children of <p:spPr> that must stay behind <a:ln>, in OOXML schema order.\n * Used to insert a new outline at a schema-valid position.\n */\nconst SPPR_AFTER_LINE_TAGS = [\n 'a:effectLst',\n 'a:effectDag',\n 'a:scene3d',\n 'a:sp3d',\n 'a:extLst',\n];\n\n/**\n * Helper class for modifying PowerPoint shapes in XML structure\n * Provides various methods for manipulating shape appearance, position, and content\n */\nexport default class ModifyShapeHelper {\n /**\n * Set solid fill of modified shape to accent6 color\n *\n * @param element - XML element representing the shape\n */\n static setSolidFill = (element: XmlElement): void => {\n element\n .getElementsByTagName('a:solidFill')[0]\n .getElementsByTagName('a:schemeClr')[0]\n .setAttribute('val', 'accent6');\n };\n\n /**\n * Set outline (line) properties of an existing shape, picture or\n * placeholder: width, dash style and color.\n *\n * Creates an <a:ln> element if the shape has none, which is the case\n * whenever the outline was never overridden in PowerPoint and is\n * inherited from the theme or the shape style.\n *\n * Note: if the shape's outline was explicitly switched off in PowerPoint\n * (<a:ln><a:noFill/></a:ln>), a weight alone stays invisible - pass a\n * color as well. Use ModifyCleanupHelper.removeBorder to drop an outline.\n *\n * @param outline - Width (EMU, 1pt = 12700), dash type and/or color\n * @returns Function that accepts an XML element to modify\n */\n static setOutline =\n (outline: ShapeOutline) =>\n (element: XmlElement): void => {\n // For grouped shapes, this targets the first child shape;\n // modify the members of a group individually instead.\n const spPr =\n element.getElementsByTagName('p:spPr')[0] ||\n element.getElementsByTagName('a:spPr')[0];\n\n if (!spPr) {\n return; // e.g. a graphicFrame (table/chart) has no shape properties\n }\n\n // Direct child only: <a:ln> also occurs in text run properties.\n const existingLine = XmlHelper.getFirstDirectChild(spPr, ['a:ln']);\n\n if (existingLine) {\n new XmlElements(spPr, { outline }).applyOutline(existingLine);\n return;\n }\n\n const line = new XmlElements(spPr, { outline }).outline();\n const anchor = XmlHelper.getFirstDirectChild(spPr, SPPR_AFTER_LINE_TAGS);\n if (anchor) {\n spPr.insertBefore(line, anchor);\n } else {\n spPr.appendChild(line);\n }\n };\n\n /**\n * Set text content of a shape\n *\n * @param text - Text string to set as shape content\n * @returns Function that accepts an XML element to modify\n */\n static setText =\n (text: string) =>\n (element: XmlElement): void => {\n ModifyTextHelper.setText(text)(element as XmlElement);\n };\n\n /**\n * Set content to bulleted list within a shape\n *\n * @param list - Array or string content for the bullet list\n * @returns Function that accepts an XML element to modify\n */\n static setBulletList =\n (list: BulletListContent) =>\n (element: XmlElement): void => {\n ModifyTextHelper.setBulletList(list)(element as XmlElement);\n };\n\n /**\n * Replace tagged text content within modified shape\n *\n * @param replaceText - Single replacement or array of replacements\n * @param options - Optional configuration for text replacement\n * @returns Function that accepts an XML element to modify\n */\n static replaceText =\n (replaceText: ReplaceText | ReplaceText[], options?: ReplaceTextOptions) =>\n (element: XmlElement): void => {\n const replaceTexts = GeneralHelper.arrayify(replaceText);\n\n new TextReplaceHelper(options, element as XmlElement)\n .isolateTaggedNodes()\n .applyReplacements(replaceTexts);\n };\n\n /**\n * Creates missing transformation elements (a:off and a:ext) with default values\n * Ensures that a shape has the required XML structure for positioning and sizing\n *\n * @param element - The XML element to check and modify\n * @returns The xfrm element that contains or will contain the transformation data\n */\n static ensureTransformElements = (element: XmlElement): XmlElement | null => {\n // First find the xfrm element (could be a:xfrm or p:xfrm)\n let xfrm = element.getElementsByTagName('a:xfrm')[0] as XmlElement;\n if (!xfrm) {\n xfrm = element.getElementsByTagName('p:xfrm')[0] as XmlElement;\n }\n\n // If no xfrm element exists, try to find the appropriate parent to create it\n if (!xfrm) {\n const spPr =\n element.getElementsByTagName('p:spPr')[0] ||\n element.getElementsByTagName('a:spPr')[0];\n\n if (!spPr) {\n return null; // Cannot create xfrm without a proper parent\n }\n\n // Create the xfrm element\n xfrm = element.ownerDocument.createElement('a:xfrm');\n spPr.appendChild(xfrm);\n }\n\n // Create a:off element if it doesn't exist\n if (!xfrm.getElementsByTagName('a:off')[0]) {\n const newAOff = element.ownerDocument.createElement('a:off');\n // Set default coordinates (0,0)\n newAOff.setAttribute('x', '0');\n newAOff.setAttribute('y', '0');\n\n // Insert a:off as the first child of xfrm\n if (xfrm.hasChildNodes()) {\n xfrm.insertBefore(newAOff, xfrm.firstChild);\n } else {\n xfrm.appendChild(newAOff);\n }\n }\n\n // Create a:ext element if it doesn't exist\n if (!xfrm.getElementsByTagName('a:ext')[0]) {\n const newAExt = element.ownerDocument.createElement('a:ext');\n // Set default dimensions - using 1000000 which is about 2.78cm\n newAExt.setAttribute('cx', '1000000');\n newAExt.setAttribute('cy', '1000000');\n\n // Add the a:ext element after a:off\n xfrm.appendChild(newAExt);\n }\n\n return xfrm;\n };\n\n /**\n * Set absolute position and size of a shape\n *\n * @param pos - Object containing position and size coordinates\n * @returns Function that accepts an XML element to modify\n */\n static setPosition =\n (pos: ShapeCoordinates) =>\n (element: XmlElement): void => {\n // Ensure the transform elements exist\n const xfrm = ModifyShapeHelper.ensureTransformElements(element);\n if (!xfrm) {\n return; // Cannot set position without proper structure\n }\n\n // Apply each provided coordinate\n Object.keys(pos).forEach((key) => {\n const mapped = map[key as keyof typeof map];\n let value = Math.round(pos[key as keyof ShapeCoordinates]);\n // Skip invalid values or unsupported properties\n if (typeof value !== 'number' || !mapped) return;\n // Ensure value is not negative\n value = value < 0 ? 0 : value;\n\n // Set the value in the appropriate XML tag and attribute\n xfrm\n .getElementsByTagName(mapped.tag)[0]\n .setAttribute(mapped.attribute, String(value));\n });\n };\n\n /**\n * Incrementally update position and size of a shape by adding delta values\n *\n * @param pos - Object containing delta values for position and size\n * @returns Function that accepts an XML element to modify\n */\n static updatePosition =\n (pos: ShapeCoordinates) =>\n (element: XmlElement): void => {\n // Ensure the transform elements exist\n const xfrm = ModifyShapeHelper.ensureTransformElements(element);\n if (!xfrm) {\n return; // Cannot update position without proper structure\n }\n\n // Apply each provided delta coordinate\n Object.keys(pos).forEach((key) => {\n const mapped = map[key as keyof typeof map];\n let value = Math.round(pos[key as keyof ShapeCoordinates]);\n // Skip invalid values or unsupported properties\n if (typeof value !== 'number' || !mapped) return;\n\n // Get current value and add the delta\n const currentValue = xfrm\n .getElementsByTagName(mapped.tag)[0]\n .getAttribute(mapped.attribute);\n\n value += Number(currentValue);\n\n // Update the value in the appropriate XML tag and attribute\n xfrm\n .getElementsByTagName(mapped.tag)[0]\n .setAttribute(mapped.attribute, String(value));\n });\n };\n\n /**\n * Rotate a shape by a given angle in degrees\n *\n * @param degrees - Rotation angle in degrees (positive = clockwise, negative = counterclockwise)\n * @returns Function that accepts an XML element to modify\n */\n static rotate =\n (degrees: number) =>\n (element: XmlElement): void => {\n const spPr = element.getElementsByTagName('p:spPr');\n\n if (spPr) {\n const xfrm = spPr.item(0).getElementsByTagName('a:xfrm').item(0);\n // Convert negative degrees to equivalent positive value (0-359)\n degrees = degrees < 0 ? 360 + degrees : degrees;\n // PowerPoint uses 60000 units per degree for rotation\n xfrm.setAttribute('rot', String(Math.round(degrees * 60000)));\n }\n };\n\n /**\n * Apply rounded corners to a shape with a specified corner radius\n *\n * @param degree - Corner radius in EMU units (1 cm = 360000 EMU)\n * @returns Function that accepts an XML element to modify\n */\n static roundedCorners =\n (degree: number) =>\n (element: XmlElement): void => {\n // Find the spPr element where we need to add or modify the a:prstGeom element\n const spPr =\n element.getElementsByTagName('p:spPr')[0] ||\n element.getElementsByTagName('a:spPr')[0];\n\n if (!spPr) {\n return; // Cannot find spPr element\n }\n\n // Get the shape dimensions to calculate the appropriate adjustment value\n const xfrm = ModifyShapeHelper.ensureTransformElements(element);\n if (!xfrm) {\n return; // Cannot proceed without proper transformation data\n }\n\n // Get current width and height\n const width = Number(\n xfrm.getElementsByTagName('a:ext')[0].getAttribute('cx'),\n );\n const height = Number(\n xfrm.getElementsByTagName('a:ext')[0].getAttribute('cy'),\n );\n\n // Calculate the adjustment value based on the smaller dimension\n const minDimension = Math.min(width, height);\n\n // Ensure degree is within reasonable bounds (PowerPoint uses 0-50% for rounded rect)\n const clampedDegree = Math.max(0, Math.min(degree, minDimension / 2));\n\n // Calculate the adjustment value (0-100000 where 100000 is 100%)\n // PowerPoint uses the percentage of the shorter dimension for corners\n const adjValue = Math.round((clampedDegree / minDimension) * 100000);\n\n // Remove any existing prstGeom element\n const existingPrstGeom = spPr.getElementsByTagName('a:prstGeom')[0];\n if (existingPrstGeom) {\n XmlHelper.remove(existingPrstGeom);\n }\n\n // Create the new prstGeom element with the roundRect preset\n const prstGeom = element.ownerDocument.createElement('a:prstGeom');\n prstGeom.setAttribute('prst', 'roundRect');\n\n // Create the avLst element and the adjustment value\n const avLst = element.ownerDocument.createElement('a:avLst');\n const gd = element.ownerDocument.createElement('a:gd');\n gd.setAttribute('name', 'adj');\n gd.setAttribute('fmla', `val ${adjValue}`);\n\n // Build the element hierarchy\n avLst.appendChild(gd);\n prstGeom.appendChild(avLst);\n\n // Add the new prstGeom element to spPr at the appropriate position\n // It should be added after xfrm but before other elements\n const xfrmElement = spPr.getElementsByTagName('a:xfrm')[0];\n\n if (xfrmElement && xfrmElement.nextSibling) {\n spPr.insertBefore(prstGeom, xfrmElement.nextSibling);\n } else {\n spPr.appendChild(prstGeom);\n }\n\n // Check for noFill element - for picture elements, we need to remove noFill\n // otherwise the picture will be invisible when we apply rounded corners\n const noFillElement = spPr.getElementsByTagName('a:noFill')[0];\n if (noFillElement) {\n XmlHelper.remove(noFillElement);\n }\n };\n\n /**\n * Determines the type of visual element in PowerPoint\n * @param element The XML element to check\n * @returns A string identifying the element type\n */\n static getElementVisualType(element: XmlElement): ElementVisualType {\n return XmlSlideHelper.getElementVisualType(element);\n }\n\n /**\n * Forward placeholder info function\n * @param element The XML element to check\n * @returns The PlaceholderInfo object\n */\n static getElementPlaceholderInfo(element: XmlElement): PlaceholderInfo {\n return XmlPlaceholderHelper.getPlaceholderInfo(element);\n }\n\n /**\n * Check if the given element has a background which is non-transparent\n * @param element The XML element to check\n * @returns ShapeBackgroundInfo\n */\n static elementHasBackground(element: XmlElement): ShapeBackgroundInfo {\n return ModifyColorHelper.elementHasBackground(element)\n }\n}\n"]}