pptx-templates 0.3.9 → 0.4.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 (216) hide show
  1. package/AI-INSTRUCTOR.md +4 -1
  2. package/CHANGELOG.md +104 -1
  3. package/dist/automizer.js +143 -176
  4. package/dist/automizer.js.map +1 -1
  5. package/dist/classes/content-type-registry.js +23 -36
  6. package/dist/classes/content-type-registry.js.map +1 -1
  7. package/dist/classes/element-importer.js +129 -148
  8. package/dist/classes/element-importer.js.map +1 -1
  9. package/dist/classes/has-shapes.js +81 -126
  10. package/dist/classes/has-shapes.js.map +1 -1
  11. package/dist/classes/layout.js +47 -67
  12. package/dist/classes/layout.js.map +1 -1
  13. package/dist/classes/master.js +70 -89
  14. package/dist/classes/master.js.map +1 -1
  15. package/dist/classes/placeholder-normalizer.js +48 -37
  16. package/dist/classes/placeholder-normalizer.js.map +1 -1
  17. package/dist/classes/related-content-copier.js +65 -86
  18. package/dist/classes/related-content-copier.js.map +1 -1
  19. package/dist/classes/shape.js +79 -110
  20. package/dist/classes/shape.js.map +1 -1
  21. package/dist/classes/slide-master-remover.js +108 -130
  22. package/dist/classes/slide-master-remover.js.map +1 -1
  23. package/dist/classes/slide-notes-copier.js +24 -41
  24. package/dist/classes/slide-notes-copier.js.map +1 -1
  25. package/dist/classes/slide.js +112 -141
  26. package/dist/classes/slide.js.map +1 -1
  27. package/dist/classes/template.js +82 -117
  28. package/dist/classes/template.js.map +1 -1
  29. package/dist/errors.js +5 -5
  30. package/dist/errors.js.map +1 -1
  31. package/dist/extensions/cli/index.js +3 -13
  32. package/dist/extensions/cli/index.js.map +1 -1
  33. package/dist/extensions/hide-slide/index.js +48 -46
  34. package/dist/extensions/hide-slide/index.js.map +1 -1
  35. package/dist/extensions/master-parts/index.js +36 -49
  36. package/dist/extensions/master-parts/index.js.map +1 -1
  37. package/dist/extensions/pptxgenjs-compat/svg-fallback.js +56 -70
  38. package/dist/extensions/pptxgenjs-compat/svg-fallback.js.map +1 -1
  39. package/dist/extensions/regexp-escape/index.d.ts +10 -0
  40. package/dist/extensions/regexp-escape/index.js +15 -0
  41. package/dist/extensions/regexp-escape/index.js.map +1 -0
  42. package/dist/extensions/run-merge/index.js +4 -5
  43. package/dist/extensions/run-merge/index.js.map +1 -1
  44. package/dist/extensions/shape-geometry/index.js +10 -10
  45. package/dist/extensions/shape-geometry/index.js.map +1 -1
  46. package/dist/extensions/template-lint/cli.js +49 -41
  47. package/dist/extensions/template-lint/cli.js.map +1 -1
  48. package/dist/extensions/template-lint/config.js +18 -10
  49. package/dist/extensions/template-lint/config.js.map +1 -1
  50. package/dist/extensions/template-lint/data-model.js +17 -20
  51. package/dist/extensions/template-lint/data-model.js.map +1 -1
  52. package/dist/extensions/template-lint/init-cli.js +12 -17
  53. package/dist/extensions/template-lint/init-cli.js.map +1 -1
  54. package/dist/extensions/template-lint/lint.js +83 -64
  55. package/dist/extensions/template-lint/lint.js.map +1 -1
  56. package/dist/extensions/template-lint/skeleton.js +5 -6
  57. package/dist/extensions/template-lint/skeleton.js.map +1 -1
  58. package/dist/extensions/template-lint/usage-cli.js +10 -14
  59. package/dist/extensions/template-lint/usage-cli.js.map +1 -1
  60. package/dist/extensions/template-lint/usage.js +8 -9
  61. package/dist/extensions/template-lint/usage.js.map +1 -1
  62. package/dist/extensions/template-logic/clone.d.ts +2 -16
  63. package/dist/extensions/template-logic/clone.js +15 -90
  64. package/dist/extensions/template-logic/clone.js.map +1 -1
  65. package/dist/extensions/template-logic/commands.js +6 -11
  66. package/dist/extensions/template-logic/commands.js.map +1 -1
  67. package/dist/extensions/template-logic/expression.js +29 -54
  68. package/dist/extensions/template-logic/expression.js.map +1 -1
  69. package/dist/extensions/template-logic/images.js +44 -51
  70. package/dist/extensions/template-logic/images.js.map +1 -1
  71. package/dist/extensions/template-logic/index.js +16 -24
  72. package/dist/extensions/template-logic/index.js.map +1 -1
  73. package/dist/extensions/template-logic/list-commands.js +8 -19
  74. package/dist/extensions/template-logic/list-commands.js.map +1 -1
  75. package/dist/extensions/template-logic/renderer.d.ts +8 -0
  76. package/dist/extensions/template-logic/renderer.js +466 -475
  77. package/dist/extensions/template-logic/renderer.js.map +1 -1
  78. package/dist/extensions/template-render/cli.js +7 -18
  79. package/dist/extensions/template-render/cli.js.map +1 -1
  80. package/dist/extensions/template-render/index.js +152 -107
  81. package/dist/extensions/template-render/index.js.map +1 -1
  82. package/dist/extensions/template-render/prune.d.ts +14 -0
  83. package/dist/extensions/template-render/prune.js +131 -0
  84. package/dist/extensions/template-render/prune.js.map +1 -0
  85. package/dist/extensions/template-render/zip-text.d.ts +9 -0
  86. package/dist/extensions/template-render/zip-text.js +27 -0
  87. package/dist/extensions/template-render/zip-text.js.map +1 -0
  88. package/dist/extensions/template-render/zip-writer.d.ts +16 -0
  89. package/dist/extensions/template-render/zip-writer.js +151 -0
  90. package/dist/extensions/template-render/zip-writer.js.map +1 -0
  91. package/dist/extensions/text-flow/flow.js +183 -207
  92. package/dist/extensions/text-flow/flow.js.map +1 -1
  93. package/dist/extensions/text-flow/font-file.js +9 -7
  94. package/dist/extensions/text-flow/font-file.js.map +1 -1
  95. package/dist/extensions/text-flow/fonts.d.ts +4 -0
  96. package/dist/extensions/text-flow/fonts.js +45 -22
  97. package/dist/extensions/text-flow/fonts.js.map +1 -1
  98. package/dist/extensions/text-flow/layout.js +5 -6
  99. package/dist/extensions/text-flow/layout.js.map +1 -1
  100. package/dist/extensions/text-flow/slide-styles.js +18 -22
  101. package/dist/extensions/text-flow/slide-styles.js.map +1 -1
  102. package/dist/extensions/text-flow/styles.d.ts +6 -0
  103. package/dist/extensions/text-flow/styles.js +108 -64
  104. package/dist/extensions/text-flow/styles.js.map +1 -1
  105. package/dist/helper/archive/archive-fs.js +102 -138
  106. package/dist/helper/archive/archive-fs.js.map +1 -1
  107. package/dist/helper/archive/archive-jszip.js +101 -125
  108. package/dist/helper/archive/archive-jszip.js.map +1 -1
  109. package/dist/helper/archive/archive.d.ts +6 -0
  110. package/dist/helper/archive/archive.js +21 -30
  111. package/dist/helper/archive/archive.js.map +1 -1
  112. package/dist/helper/archive/jszip-fast-read.d.ts +19 -0
  113. package/dist/helper/archive/jszip-fast-read.js +153 -0
  114. package/dist/helper/archive/jszip-fast-read.js.map +1 -0
  115. package/dist/helper/compute-src-rect.js +4 -5
  116. package/dist/helper/compute-src-rect.js.map +1 -1
  117. package/dist/helper/content-tracker.js +86 -114
  118. package/dist/helper/content-tracker.js.map +1 -1
  119. package/dist/helper/count-helper.js +48 -78
  120. package/dist/helper/count-helper.js.map +1 -1
  121. package/dist/helper/css-style-parser.js +1 -2
  122. package/dist/helper/css-style-parser.js.map +1 -1
  123. package/dist/helper/file-helper.js +30 -48
  124. package/dist/helper/file-helper.js.map +1 -1
  125. package/dist/helper/generate/generate-pptxgenjs.js +36 -48
  126. package/dist/helper/generate/generate-pptxgenjs.js.map +1 -1
  127. package/dist/helper/html-to-multitext-helper.js +34 -18
  128. package/dist/helper/html-to-multitext-helper.js.map +1 -1
  129. package/dist/helper/hyperlink-processor.js +125 -139
  130. package/dist/helper/hyperlink-processor.js.map +1 -1
  131. package/dist/helper/jszip-helper.js +23 -32
  132. package/dist/helper/jszip-helper.js.map +1 -1
  133. package/dist/helper/layout-index.js +51 -71
  134. package/dist/helper/layout-index.js.map +1 -1
  135. package/dist/helper/logger.js +4 -4
  136. package/dist/helper/logger.js.map +1 -1
  137. package/dist/helper/media-deduplicator.d.ts +24 -0
  138. package/dist/helper/media-deduplicator.js +81 -34
  139. package/dist/helper/media-deduplicator.js.map +1 -1
  140. package/dist/helper/modify-background-helper.js +46 -46
  141. package/dist/helper/modify-background-helper.js.map +1 -1
  142. package/dist/helper/modify-chart-helper.js +597 -591
  143. package/dist/helper/modify-chart-helper.js.map +1 -1
  144. package/dist/helper/modify-cleanup-helper.js +112 -112
  145. package/dist/helper/modify-cleanup-helper.js.map +1 -1
  146. package/dist/helper/modify-color-helper.js +53 -53
  147. package/dist/helper/modify-color-helper.js.map +1 -1
  148. package/dist/helper/modify-helper.js +25 -25
  149. package/dist/helper/modify-helper.js.map +1 -1
  150. package/dist/helper/modify-hyperlink-helper.js +143 -154
  151. package/dist/helper/modify-hyperlink-helper.js.map +1 -1
  152. package/dist/helper/modify-image-helper.js +121 -132
  153. package/dist/helper/modify-image-helper.js.map +1 -1
  154. package/dist/helper/modify-presentation-helper.js +137 -154
  155. package/dist/helper/modify-presentation-helper.js.map +1 -1
  156. package/dist/helper/modify-shape-helper.js +262 -262
  157. package/dist/helper/modify-shape-helper.js.map +1 -1
  158. package/dist/helper/modify-table-helper.js +84 -84
  159. package/dist/helper/modify-table-helper.js.map +1 -1
  160. package/dist/helper/modify-text-helper.js +187 -189
  161. package/dist/helper/modify-text-helper.js.map +1 -1
  162. package/dist/helper/modify-xml-helper.js +36 -36
  163. package/dist/helper/modify-xml-helper.js.map +1 -1
  164. package/dist/helper/multitext-helper.js +9 -7
  165. package/dist/helper/multitext-helper.js.map +1 -1
  166. package/dist/helper/ppt-paths.js +17 -17
  167. package/dist/helper/ppt-paths.js.map +1 -1
  168. package/dist/helper/shape-type-detector.js +18 -29
  169. package/dist/helper/shape-type-detector.js.map +1 -1
  170. package/dist/helper/text-replace-helper.js +6 -7
  171. package/dist/helper/text-replace-helper.js.map +1 -1
  172. package/dist/helper/xml-clone.d.ts +24 -0
  173. package/dist/helper/xml-clone.js +269 -0
  174. package/dist/helper/xml-clone.js.map +1 -0
  175. package/dist/helper/xml-elements.js +17 -20
  176. package/dist/helper/xml-elements.js.map +1 -1
  177. package/dist/helper/xml-find.d.ts +4 -0
  178. package/dist/helper/xml-find.js +48 -0
  179. package/dist/helper/xml-find.js.map +1 -0
  180. package/dist/helper/xml-helper.js +99 -134
  181. package/dist/helper/xml-helper.js.map +1 -1
  182. package/dist/helper/xml-parse-cache.d.ts +31 -0
  183. package/dist/helper/xml-parse-cache.js +71 -0
  184. package/dist/helper/xml-parse-cache.js.map +1 -0
  185. package/dist/helper/xml-placeholder-helper.js +10 -10
  186. package/dist/helper/xml-placeholder-helper.js.map +1 -1
  187. package/dist/helper/xml-relationship-helper.js +120 -144
  188. package/dist/helper/xml-relationship-helper.js.map +1 -1
  189. package/dist/helper/xml-serializer.d.ts +2 -0
  190. package/dist/helper/xml-serializer.js +192 -0
  191. package/dist/helper/xml-serializer.js.map +1 -0
  192. package/dist/helper/xml-slide-helper.js +109 -129
  193. package/dist/helper/xml-slide-helper.js.map +1 -1
  194. package/dist/helper/xml-template-helper.js +120 -144
  195. package/dist/helper/xml-template-helper.js.map +1 -1
  196. package/dist/helper/xmldom-sax-patch.js +52 -2
  197. package/dist/helper/xmldom-sax-patch.js.map +1 -1
  198. package/dist/index.js +4 -2
  199. package/dist/index.js.map +1 -1
  200. package/dist/modify/modify-chart.js +35 -23
  201. package/dist/modify/modify-chart.js.map +1 -1
  202. package/dist/modify/modify-table.js +11 -14
  203. package/dist/modify/modify-table.js.map +1 -1
  204. package/dist/shapes/chart.js +238 -287
  205. package/dist/shapes/chart.js.map +1 -1
  206. package/dist/shapes/diagram.js +73 -104
  207. package/dist/shapes/diagram.js.map +1 -1
  208. package/dist/shapes/generic.js +62 -83
  209. package/dist/shapes/generic.js.map +1 -1
  210. package/dist/shapes/hyperlink.js +98 -124
  211. package/dist/shapes/hyperlink.js.map +1 -1
  212. package/dist/shapes/image.js +112 -151
  213. package/dist/shapes/image.js.map +1 -1
  214. package/dist/shapes/ole.js +148 -188
  215. package/dist/shapes/ole.js.map +1 -1
  216. package/package.json +3 -4
@@ -1,17 +1,7 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
4
  };
14
- var _a;
15
5
  Object.defineProperty(exports, "__esModule", { value: true });
16
6
  const logger_1 = require("./logger");
17
7
  const types_1 = require("../types/types");
@@ -21,137 +11,136 @@ const fs_1 = __importDefault(require("fs"));
21
11
  const xml_helper_1 = require("./xml-helper");
22
12
  const compute_src_rect_1 = require("./compute-src-rect");
23
13
  class ModifyImageHelper {
24
- }
25
- _a = ModifyImageHelper;
26
- /**
27
- * Update the "Target" attribute of a created image relation.
28
- * This will change the image itself. Load images with Automizer.loadMedia
29
- * @param filename name of target image in root template media folder.
30
- */
31
- ModifyImageHelper.setRelationTarget = (filename) => {
32
- return (element, arg1) => {
33
- arg1.setAttribute('Target', xml_helper_1.XmlHelper.sanitizeAttr('../media/' + (0, slugify_1.default)(filename)));
34
- };
35
- };
36
- /**
37
- * Update the "Target" attribute of a created image relation.
38
- * This will change the image itself. Load images with Automizer.loadMedia
39
- * This will also auto-crop the image to the new width and height,
40
- * based on the container aspect ratio, derived from the original image
41
- * and using the new image width and height based on the files loaded into
42
- * the presentation media folder using .loadMedia()
43
- * @param filename name of target image in root template media folder.
44
- * @param pres presentation properties (to access the root template archive)
45
- */
46
- ModifyImageHelper.setRelationTargetCover = (filename, pres) => {
47
- return (element, arg1) => __awaiter(void 0, void 0, void 0, function* () {
48
- const newTarget = '../media/' + (0, slugify_1.default)(filename);
49
- const originalTarget = arg1.getAttribute('Target');
50
- const originalTargetPath = originalTarget.replace(/^\.\.\//, 'ppt/');
51
- const originalImageDimensions = { width: 100, height: 100 };
52
- const newImageDimensions = { width: 100, height: 100 };
53
- // Get the new image dimensions, using the rootTemplate mediafiles array,
54
- // since we have it loaded into the presentation media folder using .loadMedia()
55
- // If we don't find the media file, we warn, but continue
56
- try {
57
- const mediaFile = pres.rootTemplate.mediaFiles.find((file) => file.file === filename);
58
- if (!mediaFile) {
59
- throw new Error('Media file not found in template archive in path: ' + filename);
14
+ /**
15
+ * Update the "Target" attribute of a created image relation.
16
+ * This will change the image itself. Load images with Automizer.loadMedia
17
+ * @param filename name of target image in root template media folder.
18
+ */
19
+ static { this.setRelationTarget = (filename) => {
20
+ return (element, arg1) => {
21
+ arg1.setAttribute('Target', xml_helper_1.XmlHelper.sanitizeAttr('../media/' + (0, slugify_1.default)(filename)));
22
+ };
23
+ }; }
24
+ /**
25
+ * Update the "Target" attribute of a created image relation.
26
+ * This will change the image itself. Load images with Automizer.loadMedia
27
+ * This will also auto-crop the image to the new width and height,
28
+ * based on the container aspect ratio, derived from the original image
29
+ * and using the new image width and height based on the files loaded into
30
+ * the presentation media folder using .loadMedia()
31
+ * @param filename name of target image in root template media folder.
32
+ * @param pres presentation properties (to access the root template archive)
33
+ */
34
+ static { this.setRelationTargetCover = (filename, pres) => {
35
+ return async (element, arg1) => {
36
+ const newTarget = '../media/' + (0, slugify_1.default)(filename);
37
+ const originalTarget = arg1.getAttribute('Target');
38
+ const originalTargetPath = originalTarget.replace(/^\.\.\//, 'ppt/');
39
+ const originalImageDimensions = { width: 100, height: 100 };
40
+ const newImageDimensions = { width: 100, height: 100 };
41
+ // Get the new image dimensions, using the rootTemplate mediafiles array,
42
+ // since we have it loaded into the presentation media folder using .loadMedia()
43
+ // If we don't find the media file, we warn, but continue
44
+ try {
45
+ const mediaFile = pres.rootTemplate.mediaFiles.find((file) => file.file === filename);
46
+ if (!mediaFile) {
47
+ throw new Error('Media file not found in template archive in path: ' + filename);
48
+ }
49
+ const buffer = (0, types_1.getMediaBuffer)(mediaFile, fs_1.default.readFileSync);
50
+ const _dimensions = (0, image_dimensions_1.imageDimensions)(buffer);
51
+ newImageDimensions.width = _dimensions.width;
52
+ newImageDimensions.height = _dimensions.height;
60
53
  }
61
- const buffer = (0, types_1.getMediaBuffer)(mediaFile, fs_1.default.readFileSync);
62
- const _dimensions = (0, image_dimensions_1.imageDimensions)(buffer);
63
- newImageDimensions.width = _dimensions.width;
64
- newImageDimensions.height = _dimensions.height;
65
- }
66
- catch (error) {
67
- const errorMessage = error instanceof Error ? error.message : String(error);
68
- logger_1.log.warn('Could not read new image dimensions, using defaults: ' +
69
- errorMessage);
70
- }
71
- // Find the original image dimensions using the original target path from the original slide
72
- // using the rootTemplate archive file system and get the image dimensions.
73
- // If we don't find the original image, we warn, but continue
74
- // If we find the original image, we get the image dimensions and use this to reverse calculate
75
- // the aspect ratio and then use the new image dimensions to calculate and set the new crop on srcRect.
76
- // This results in the image being cropped in the image container to match the aspect ratio of the new image.
77
- try {
78
- if (pres.rootTemplate.archive.fileExists(originalTargetPath)) {
79
- // read(..., 'nodebuffer') always yields a Buffer despite the wider return type
80
- const originalImage = (yield pres.rootTemplate.archive.read(originalTargetPath, 'nodebuffer'));
81
- const _dimensions = (0, image_dimensions_1.imageDimensions)(originalImage);
82
- originalImageDimensions.width = _dimensions.width;
83
- originalImageDimensions.height = _dimensions.height;
54
+ catch (error) {
55
+ const errorMessage = error instanceof Error ? error.message : String(error);
56
+ logger_1.log.warn('Could not read new image dimensions, using defaults: ' +
57
+ errorMessage);
58
+ }
59
+ // Find the original image dimensions using the original target path from the original slide
60
+ // using the rootTemplate archive file system and get the image dimensions.
61
+ // If we don't find the original image, we warn, but continue
62
+ // If we find the original image, we get the image dimensions and use this to reverse calculate
63
+ // the aspect ratio and then use the new image dimensions to calculate and set the new crop on srcRect.
64
+ // This results in the image being cropped in the image container to match the aspect ratio of the new image.
65
+ try {
66
+ if (pres.rootTemplate.archive.fileExists(originalTargetPath)) {
67
+ // read(..., 'nodebuffer') always yields a Buffer despite the wider return type
68
+ const originalImage = (await pres.rootTemplate.archive.read(originalTargetPath, 'nodebuffer'));
69
+ const _dimensions = (0, image_dimensions_1.imageDimensions)(originalImage);
70
+ originalImageDimensions.width = _dimensions.width;
71
+ originalImageDimensions.height = _dimensions.height;
72
+ }
73
+ else {
74
+ throw new Error('Original image not found from template archive in path: ' +
75
+ originalTargetPath);
76
+ }
77
+ const srcRect = element.getElementsByTagName('a:srcRect')[0];
78
+ const srcRectLeft = srcRect.getAttribute('l');
79
+ const srcRectTop = srcRect.getAttribute('t');
80
+ const srcRectRight = srcRect.getAttribute('r');
81
+ const srcRectBottom = srcRect.getAttribute('b');
82
+ const currentSrcRect = {
83
+ l: srcRectLeft ? Number(srcRectLeft) : 0,
84
+ t: srcRectTop ? Number(srcRectTop) : 0,
85
+ r: srcRectRight ? Number(srcRectRight) : 0,
86
+ b: srcRectBottom ? Number(srcRectBottom) : 0,
87
+ };
88
+ const containerAr = (0, compute_src_rect_1.inferContainerAr)(originalImageDimensions.width, originalImageDimensions.height, currentSrcRect);
89
+ const newSrcRect = (0, compute_src_rect_1.computeSrcRectForNewImage)(containerAr, newImageDimensions.width, newImageDimensions.height);
90
+ srcRect.setAttribute('l', String(newSrcRect.l));
91
+ srcRect.setAttribute('t', String(newSrcRect.t));
92
+ srcRect.setAttribute('r', String(newSrcRect.r));
93
+ srcRect.setAttribute('b', String(newSrcRect.b));
84
94
  }
85
- else {
86
- throw new Error('Original image not found from template archive in path: ' +
87
- originalTargetPath);
95
+ catch (error) {
96
+ const errorMessage = error instanceof Error ? error.message : String(error);
97
+ logger_1.log.warn('Skipped setting relation target cropped due to an error: ' +
98
+ errorMessage);
88
99
  }
89
- const srcRect = element.getElementsByTagName('a:srcRect')[0];
90
- const srcRectLeft = srcRect.getAttribute('l');
91
- const srcRectTop = srcRect.getAttribute('t');
92
- const srcRectRight = srcRect.getAttribute('r');
93
- const srcRectBottom = srcRect.getAttribute('b');
94
- const currentSrcRect = {
95
- l: srcRectLeft ? Number(srcRectLeft) : 0,
96
- t: srcRectTop ? Number(srcRectTop) : 0,
97
- r: srcRectRight ? Number(srcRectRight) : 0,
98
- b: srcRectBottom ? Number(srcRectBottom) : 0,
99
- };
100
- const containerAr = (0, compute_src_rect_1.inferContainerAr)(originalImageDimensions.width, originalImageDimensions.height, currentSrcRect);
101
- const newSrcRect = (0, compute_src_rect_1.computeSrcRectForNewImage)(containerAr, newImageDimensions.width, newImageDimensions.height);
102
- srcRect.setAttribute('l', String(newSrcRect.l));
103
- srcRect.setAttribute('t', String(newSrcRect.t));
104
- srcRect.setAttribute('r', String(newSrcRect.r));
105
- srcRect.setAttribute('b', String(newSrcRect.b));
106
- }
107
- catch (error) {
108
- const errorMessage = error instanceof Error ? error.message : String(error);
109
- logger_1.log.warn('Skipped setting relation target cropped due to an error: ' +
110
- errorMessage);
100
+ arg1.setAttribute('Target', xml_helper_1.XmlHelper.sanitizeAttr(newTarget));
101
+ };
102
+ }; }
103
+ /*
104
+ Update an existing duotone image overlay element (WIP)
105
+ Apply a duotone color to an image p:blipFill -> a:blip fill element.
106
+ Works best on white icons, see __tests__/media/feather.png
107
+ */
108
+ static { this.setDuotoneFill = (duotoneParams) => (element) => {
109
+ const blipFill = element.getElementsByTagName('p:blipFill');
110
+ if (!blipFill) {
111
+ return;
111
112
  }
112
- arg1.setAttribute('Target', xml_helper_1.XmlHelper.sanitizeAttr(newTarget));
113
- });
114
- };
115
- /*
116
- Update an existing duotone image overlay element (WIP)
117
- Apply a duotone color to an image p:blipFill -> a:blip fill element.
118
- Works best on white icons, see __tests__/media/feather.png
119
- */
120
- ModifyImageHelper.setDuotoneFill = (duotoneParams) => (element) => {
121
- const blipFill = element.getElementsByTagName('p:blipFill');
122
- if (!blipFill) {
123
- return;
124
- }
125
- const duotone = blipFill.item(0).getElementsByTagName('a:duotone')[0];
126
- if (duotone) {
127
- if (duotoneParams === null || duotoneParams === void 0 ? void 0 : duotoneParams.color) {
128
- const srgbClr = duotone.getElementsByTagName('a:srgbClr')[0];
129
- if (srgbClr) {
130
- // Only sRgb supported
131
- srgbClr.setAttribute('val', String(duotoneParams.color.value));
132
- if ((duotoneParams === null || duotoneParams === void 0 ? void 0 : duotoneParams.tint) !== undefined) {
133
- // tint needs to be 0 - 100000
134
- const tint = srgbClr.getElementsByTagName('a:tint')[0];
135
- if (tint) {
136
- tint.setAttribute('val', String(duotoneParams.tint));
113
+ const duotone = blipFill.item(0).getElementsByTagName('a:duotone')[0];
114
+ if (duotone) {
115
+ if (duotoneParams?.color) {
116
+ const srgbClr = duotone.getElementsByTagName('a:srgbClr')[0];
117
+ if (srgbClr) {
118
+ // Only sRgb supported
119
+ srgbClr.setAttribute('val', String(duotoneParams.color.value));
120
+ if (duotoneParams?.tint !== undefined) {
121
+ // tint needs to be 0 - 100000
122
+ const tint = srgbClr.getElementsByTagName('a:tint')[0];
123
+ if (tint) {
124
+ tint.setAttribute('val', String(duotoneParams.tint));
125
+ }
137
126
  }
138
- }
139
- if ((duotoneParams === null || duotoneParams === void 0 ? void 0 : duotoneParams.satMod) !== undefined) {
140
- const satMod = srgbClr.getElementsByTagName('a:satMod')[0];
141
- if (satMod) {
142
- satMod.setAttribute('val', String(duotoneParams.satMod));
127
+ if (duotoneParams?.satMod !== undefined) {
128
+ const satMod = srgbClr.getElementsByTagName('a:satMod')[0];
129
+ if (satMod) {
130
+ satMod.setAttribute('val', String(duotoneParams.satMod));
131
+ }
143
132
  }
144
133
  }
145
134
  }
146
- }
147
- if (duotoneParams === null || duotoneParams === void 0 ? void 0 : duotoneParams.prstClr) {
148
- const prstClr = duotone.getElementsByTagName('a:prstClr')[0];
149
- if (prstClr) {
150
- // Only tested with "black" and "white"
151
- prstClr.setAttribute('val', String(duotoneParams.prstClr));
135
+ if (duotoneParams?.prstClr) {
136
+ const prstClr = duotone.getElementsByTagName('a:prstClr')[0];
137
+ if (prstClr) {
138
+ // Only tested with "black" and "white"
139
+ prstClr.setAttribute('val', String(duotoneParams.prstClr));
140
+ }
152
141
  }
153
142
  }
154
- }
155
- };
143
+ }; }
144
+ }
156
145
  exports.default = ModifyImageHelper;
157
146
  //# sourceMappingURL=modify-image-helper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"modify-image-helper.js","sourceRoot":"","sources":["../../src/helper/modify-image-helper.ts"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