pptx-templates 0.0.0-stage → 0.1.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 (323) hide show
  1. package/AI-INSTRUCTOR.md +2253 -0
  2. package/CHANGELOG.md +56 -0
  3. package/LICENSE +23 -0
  4. package/README.md +84 -2
  5. package/dist/automizer.d.ts +224 -0
  6. package/dist/automizer.js +704 -0
  7. package/dist/automizer.js.map +1 -0
  8. package/dist/classes/content-type-registry.d.ts +46 -0
  9. package/dist/classes/content-type-registry.js +170 -0
  10. package/dist/classes/content-type-registry.js.map +1 -0
  11. package/dist/classes/element-importer.d.ts +49 -0
  12. package/dist/classes/element-importer.js +254 -0
  13. package/dist/classes/element-importer.js.map +1 -0
  14. package/dist/classes/has-shapes.d.ts +286 -0
  15. package/dist/classes/has-shapes.js +385 -0
  16. package/dist/classes/has-shapes.js.map +1 -0
  17. package/dist/classes/layout.d.ts +42 -0
  18. package/dist/classes/layout.js +113 -0
  19. package/dist/classes/layout.js.map +1 -0
  20. package/dist/classes/master.d.ts +45 -0
  21. package/dist/classes/master.js +146 -0
  22. package/dist/classes/master.js.map +1 -0
  23. package/dist/classes/placeholder-normalizer.d.ts +42 -0
  24. package/dist/classes/placeholder-normalizer.js +136 -0
  25. package/dist/classes/placeholder-normalizer.js.map +1 -0
  26. package/dist/classes/related-content-copier.d.ts +18 -0
  27. package/dist/classes/related-content-copier.js +114 -0
  28. package/dist/classes/related-content-copier.js.map +1 -0
  29. package/dist/classes/shape.d.ts +62 -0
  30. package/dist/classes/shape.js +194 -0
  31. package/dist/classes/shape.js.map +1 -0
  32. package/dist/classes/slide-master-remover.d.ts +44 -0
  33. package/dist/classes/slide-master-remover.js +201 -0
  34. package/dist/classes/slide-master-remover.js.map +1 -0
  35. package/dist/classes/slide-notes-copier.d.ts +26 -0
  36. package/dist/classes/slide-notes-copier.js +76 -0
  37. package/dist/classes/slide-notes-copier.js.map +1 -0
  38. package/dist/classes/slide.d.ts +91 -0
  39. package/dist/classes/slide.js +286 -0
  40. package/dist/classes/slide.js.map +1 -0
  41. package/dist/classes/template.d.ts +137 -0
  42. package/dist/classes/template.js +311 -0
  43. package/dist/classes/template.js.map +1 -0
  44. package/dist/constants/constants.d.ts +11 -0
  45. package/dist/constants/constants.js +182 -0
  46. package/dist/constants/constants.js.map +1 -0
  47. package/dist/enums/chart-type.d.ts +11 -0
  48. package/dist/enums/chart-type.js +16 -0
  49. package/dist/enums/chart-type.js.map +1 -0
  50. package/dist/enums/content-type-map.d.ts +16 -0
  51. package/dist/enums/content-type-map.js +23 -0
  52. package/dist/enums/content-type-map.js.map +1 -0
  53. package/dist/enums/element-type.d.ts +14 -0
  54. package/dist/enums/element-type.js +20 -0
  55. package/dist/enums/element-type.js.map +1 -0
  56. package/dist/errors.d.ts +81 -0
  57. package/dist/errors.js +100 -0
  58. package/dist/errors.js.map +1 -0
  59. package/dist/extensions/index.d.ts +5 -0
  60. package/dist/extensions/index.js +31 -0
  61. package/dist/extensions/index.js.map +1 -0
  62. package/dist/extensions/pptxgenjs-compat/img-broken-png.d.ts +5 -0
  63. package/dist/extensions/pptxgenjs-compat/img-broken-png.js +9 -0
  64. package/dist/extensions/pptxgenjs-compat/img-broken-png.js.map +1 -0
  65. package/dist/extensions/pptxgenjs-compat/index.d.ts +5 -0
  66. package/dist/extensions/pptxgenjs-compat/index.js +10 -0
  67. package/dist/extensions/pptxgenjs-compat/index.js.map +1 -0
  68. package/dist/extensions/pptxgenjs-compat/svg-fallback.d.ts +14 -0
  69. package/dist/extensions/pptxgenjs-compat/svg-fallback.js +139 -0
  70. package/dist/extensions/pptxgenjs-compat/svg-fallback.js.map +1 -0
  71. package/dist/extensions/run-merge/index.d.ts +13 -0
  72. package/dist/extensions/run-merge/index.js +89 -0
  73. package/dist/extensions/run-merge/index.js.map +1 -0
  74. package/dist/extensions/template-logic/commands.d.ts +22 -0
  75. package/dist/extensions/template-logic/commands.js +83 -0
  76. package/dist/extensions/template-logic/commands.js.map +1 -0
  77. package/dist/extensions/template-logic/expression.d.ts +61 -0
  78. package/dist/extensions/template-logic/expression.js +499 -0
  79. package/dist/extensions/template-logic/expression.js.map +1 -0
  80. package/dist/extensions/template-logic/images.d.ts +26 -0
  81. package/dist/extensions/template-logic/images.js +183 -0
  82. package/dist/extensions/template-logic/images.js.map +1 -0
  83. package/dist/extensions/template-logic/index.d.ts +14 -0
  84. package/dist/extensions/template-logic/index.js +64 -0
  85. package/dist/extensions/template-logic/index.js.map +1 -0
  86. package/dist/extensions/template-logic/list-commands.d.ts +9 -0
  87. package/dist/extensions/template-logic/list-commands.js +72 -0
  88. package/dist/extensions/template-logic/list-commands.js.map +1 -0
  89. package/dist/extensions/template-logic/renderer.d.ts +85 -0
  90. package/dist/extensions/template-logic/renderer.js +867 -0
  91. package/dist/extensions/template-logic/renderer.js.map +1 -0
  92. package/dist/extensions/template-logic/types.d.ts +62 -0
  93. package/dist/extensions/template-logic/types.js +3 -0
  94. package/dist/extensions/template-logic/types.js.map +1 -0
  95. package/dist/helper/archive/archive-fs.d.ts +45 -0
  96. package/dist/helper/archive/archive-fs.js +206 -0
  97. package/dist/helper/archive/archive-fs.js.map +1 -0
  98. package/dist/helper/archive/archive-jszip.d.ts +31 -0
  99. package/dist/helper/archive/archive-jszip.js +173 -0
  100. package/dist/helper/archive/archive-jszip.js.map +1 -0
  101. package/dist/helper/archive/archive.d.ts +27 -0
  102. package/dist/helper/archive/archive.js +78 -0
  103. package/dist/helper/archive/archive.js.map +1 -0
  104. package/dist/helper/cell-id-helper.d.ts +25 -0
  105. package/dist/helper/cell-id-helper.js +95 -0
  106. package/dist/helper/cell-id-helper.js.map +1 -0
  107. package/dist/helper/compute-src-rect.d.ts +9 -0
  108. package/dist/helper/compute-src-rect.js +52 -0
  109. package/dist/helper/compute-src-rect.js.map +1 -0
  110. package/dist/helper/content-tracker.d.ts +31 -0
  111. package/dist/helper/content-tracker.js +227 -0
  112. package/dist/helper/content-tracker.js.map +1 -0
  113. package/dist/helper/count-helper.d.ts +33 -0
  114. package/dist/helper/count-helper.js +140 -0
  115. package/dist/helper/count-helper.js.map +1 -0
  116. package/dist/helper/css-style-parser.d.ts +52 -0
  117. package/dist/helper/css-style-parser.js +246 -0
  118. package/dist/helper/css-style-parser.js.map +1 -0
  119. package/dist/helper/file-helper.d.ts +36 -0
  120. package/dist/helper/file-helper.js +150 -0
  121. package/dist/helper/file-helper.js.map +1 -0
  122. package/dist/helper/general-helper.d.ts +6 -0
  123. package/dist/helper/general-helper.js +34 -0
  124. package/dist/helper/general-helper.js.map +1 -0
  125. package/dist/helper/generate/generate-pptxgenjs.d.ts +37 -0
  126. package/dist/helper/generate/generate-pptxgenjs.js +134 -0
  127. package/dist/helper/generate/generate-pptxgenjs.js.map +1 -0
  128. package/dist/helper/html-to-multitext-helper.d.ts +84 -0
  129. package/dist/helper/html-to-multitext-helper.js +490 -0
  130. package/dist/helper/html-to-multitext-helper.js.map +1 -0
  131. package/dist/helper/hyperlink-processor.d.ts +54 -0
  132. package/dist/helper/hyperlink-processor.js +289 -0
  133. package/dist/helper/hyperlink-processor.js.map +1 -0
  134. package/dist/helper/image-dimensions.d.ts +21 -0
  135. package/dist/helper/image-dimensions.js +202 -0
  136. package/dist/helper/image-dimensions.js.map +1 -0
  137. package/dist/helper/jszip-helper.d.ts +21 -0
  138. package/dist/helper/jszip-helper.js +162 -0
  139. package/dist/helper/jszip-helper.js.map +1 -0
  140. package/dist/helper/layout-index.d.ts +55 -0
  141. package/dist/helper/layout-index.js +155 -0
  142. package/dist/helper/layout-index.js.map +1 -0
  143. package/dist/helper/logger.d.ts +53 -0
  144. package/dist/helper/logger.js +73 -0
  145. package/dist/helper/logger.js.map +1 -0
  146. package/dist/helper/media-deduplicator.d.ts +42 -0
  147. package/dist/helper/media-deduplicator.js +88 -0
  148. package/dist/helper/media-deduplicator.js.map +1 -0
  149. package/dist/helper/modify-background-helper.d.ts +19 -0
  150. package/dist/helper/modify-background-helper.js +59 -0
  151. package/dist/helper/modify-background-helper.js.map +1 -0
  152. package/dist/helper/modify-chart-helper.d.ts +159 -0
  153. package/dist/helper/modify-chart-helper.js +642 -0
  154. package/dist/helper/modify-chart-helper.js.map +1 -0
  155. package/dist/helper/modify-cleanup-helper.d.ts +69 -0
  156. package/dist/helper/modify-cleanup-helper.js +343 -0
  157. package/dist/helper/modify-cleanup-helper.js.map +1 -0
  158. package/dist/helper/modify-color-helper.d.ts +35 -0
  159. package/dist/helper/modify-color-helper.js +211 -0
  160. package/dist/helper/modify-color-helper.js.map +1 -0
  161. package/dist/helper/modify-helper.d.ts +23 -0
  162. package/dist/helper/modify-helper.js +61 -0
  163. package/dist/helper/modify-helper.js.map +1 -0
  164. package/dist/helper/modify-hyperlink-element.d.ts +9 -0
  165. package/dist/helper/modify-hyperlink-element.js +34 -0
  166. package/dist/helper/modify-hyperlink-element.js.map +1 -0
  167. package/dist/helper/modify-hyperlink-helper.d.ts +42 -0
  168. package/dist/helper/modify-hyperlink-helper.js +258 -0
  169. package/dist/helper/modify-hyperlink-helper.js.map +1 -0
  170. package/dist/helper/modify-image-helper.d.ts +23 -0
  171. package/dist/helper/modify-image-helper.js +157 -0
  172. package/dist/helper/modify-image-helper.js.map +1 -0
  173. package/dist/helper/modify-presentation-helper.d.ts +55 -0
  174. package/dist/helper/modify-presentation-helper.js +177 -0
  175. package/dist/helper/modify-presentation-helper.js.map +1 -0
  176. package/dist/helper/modify-shape-helper.d.ts +111 -0
  177. package/dist/helper/modify-shape-helper.js +340 -0
  178. package/dist/helper/modify-shape-helper.js.map +1 -0
  179. package/dist/helper/modify-table-helper.d.ts +11 -0
  180. package/dist/helper/modify-table-helper.js +100 -0
  181. package/dist/helper/modify-table-helper.js.map +1 -0
  182. package/dist/helper/modify-text-helper.d.ts +62 -0
  183. package/dist/helper/modify-text-helper.js +244 -0
  184. package/dist/helper/modify-text-helper.js.map +1 -0
  185. package/dist/helper/modify-xml-helper.d.ts +52 -0
  186. package/dist/helper/modify-xml-helper.js +305 -0
  187. package/dist/helper/modify-xml-helper.js.map +1 -0
  188. package/dist/helper/multitext-helper.d.ts +116 -0
  189. package/dist/helper/multitext-helper.js +462 -0
  190. package/dist/helper/multitext-helper.js.map +1 -0
  191. package/dist/helper/ppt-paths.d.ts +76 -0
  192. package/dist/helper/ppt-paths.js +116 -0
  193. package/dist/helper/ppt-paths.js.map +1 -0
  194. package/dist/helper/shape-type-detector.d.ts +34 -0
  195. package/dist/helper/shape-type-detector.js +99 -0
  196. package/dist/helper/shape-type-detector.js.map +1 -0
  197. package/dist/helper/text-replace-helper.d.ts +30 -0
  198. package/dist/helper/text-replace-helper.js +149 -0
  199. package/dist/helper/text-replace-helper.js.map +1 -0
  200. package/dist/helper/xml/lnLRTB.d.ts +1 -0
  201. package/dist/helper/xml/lnLRTB.js +62 -0
  202. package/dist/helper/xml/lnLRTB.js.map +1 -0
  203. package/dist/helper/xml/prstGeom.d.ts +1 -0
  204. package/dist/helper/xml/prstGeom.js +11 -0
  205. package/dist/helper/xml/prstGeom.js.map +1 -0
  206. package/dist/helper/xml-elements.d.ts +134 -0
  207. package/dist/helper/xml-elements.js +538 -0
  208. package/dist/helper/xml-elements.js.map +1 -0
  209. package/dist/helper/xml-helper.d.ts +120 -0
  210. package/dist/helper/xml-helper.js +495 -0
  211. package/dist/helper/xml-helper.js.map +1 -0
  212. package/dist/helper/xml-placeholder-helper.d.ts +92 -0
  213. package/dist/helper/xml-placeholder-helper.js +454 -0
  214. package/dist/helper/xml-placeholder-helper.js.map +1 -0
  215. package/dist/helper/xml-pretty-print.d.ts +17 -0
  216. package/dist/helper/xml-pretty-print.js +88 -0
  217. package/dist/helper/xml-pretty-print.js.map +1 -0
  218. package/dist/helper/xml-relationship-helper.d.ts +103 -0
  219. package/dist/helper/xml-relationship-helper.js +397 -0
  220. package/dist/helper/xml-relationship-helper.js.map +1 -0
  221. package/dist/helper/xml-slide-helper.d.ts +107 -0
  222. package/dist/helper/xml-slide-helper.js +676 -0
  223. package/dist/helper/xml-slide-helper.js.map +1 -0
  224. package/dist/helper/xml-template-helper.d.ts +42 -0
  225. package/dist/helper/xml-template-helper.js +252 -0
  226. package/dist/helper/xml-template-helper.js.map +1 -0
  227. package/dist/helper/xmldom-sax-patch.d.ts +18 -0
  228. package/dist/helper/xmldom-sax-patch.js +58 -0
  229. package/dist/helper/xmldom-sax-patch.js.map +1 -0
  230. package/dist/index.d.ts +81 -0
  231. package/dist/index.js +177 -0
  232. package/dist/index.js.map +1 -0
  233. package/dist/interfaces/iarchive.d.ts +43 -0
  234. package/dist/interfaces/iarchive.js +3 -0
  235. package/dist/interfaces/iarchive.js.map +1 -0
  236. package/dist/interfaces/ichart.d.ts +7 -0
  237. package/dist/interfaces/ichart.js +3 -0
  238. package/dist/interfaces/ichart.js.map +1 -0
  239. package/dist/interfaces/icounter.d.ts +7 -0
  240. package/dist/interfaces/icounter.js +3 -0
  241. package/dist/interfaces/icounter.js.map +1 -0
  242. package/dist/interfaces/igenerator.d.ts +4 -0
  243. package/dist/interfaces/igenerator.js +3 -0
  244. package/dist/interfaces/igenerator.js.map +1 -0
  245. package/dist/interfaces/iimage.d.ts +7 -0
  246. package/dist/interfaces/iimage.js +3 -0
  247. package/dist/interfaces/iimage.js.map +1 -0
  248. package/dist/interfaces/ilayout.d.ts +14 -0
  249. package/dist/interfaces/ilayout.js +3 -0
  250. package/dist/interfaces/ilayout.js.map +1 -0
  251. package/dist/interfaces/imaster.d.ts +15 -0
  252. package/dist/interfaces/imaster.js +3 -0
  253. package/dist/interfaces/imaster.js.map +1 -0
  254. package/dist/interfaces/imulti-text.d.ts +50 -0
  255. package/dist/interfaces/imulti-text.js +3 -0
  256. package/dist/interfaces/imulti-text.js.map +1 -0
  257. package/dist/interfaces/ipptxgenjs-slide.d.ts +40 -0
  258. package/dist/interfaces/ipptxgenjs-slide.js +3 -0
  259. package/dist/interfaces/ipptxgenjs-slide.js.map +1 -0
  260. package/dist/interfaces/ipresentation-props.d.ts +16 -0
  261. package/dist/interfaces/ipresentation-props.js +3 -0
  262. package/dist/interfaces/ipresentation-props.js.map +1 -0
  263. package/dist/interfaces/ishape-action.d.ts +18 -0
  264. package/dist/interfaces/ishape-action.js +3 -0
  265. package/dist/interfaces/ishape-action.js.map +1 -0
  266. package/dist/interfaces/ishape.d.ts +5 -0
  267. package/dist/interfaces/ishape.js +3 -0
  268. package/dist/interfaces/ishape.js.map +1 -0
  269. package/dist/interfaces/islide.d.ts +71 -0
  270. package/dist/interfaces/islide.js +3 -0
  271. package/dist/interfaces/islide.js.map +1 -0
  272. package/dist/interfaces/itemplate.d.ts +9 -0
  273. package/dist/interfaces/itemplate.js +3 -0
  274. package/dist/interfaces/itemplate.js.map +1 -0
  275. package/dist/interfaces/pres-template.d.ts +9 -0
  276. package/dist/interfaces/pres-template.js +3 -0
  277. package/dist/interfaces/pres-template.js.map +1 -0
  278. package/dist/interfaces/root-pres-template.d.ts +38 -0
  279. package/dist/interfaces/root-pres-template.js +3 -0
  280. package/dist/interfaces/root-pres-template.js.map +1 -0
  281. package/dist/modify/modify-chart.d.ts +74 -0
  282. package/dist/modify/modify-chart.js +753 -0
  283. package/dist/modify/modify-chart.js.map +1 -0
  284. package/dist/modify/modify-table.d.ts +64 -0
  285. package/dist/modify/modify-table.js +435 -0
  286. package/dist/modify/modify-table.js.map +1 -0
  287. package/dist/shapes/chart.d.ts +91 -0
  288. package/dist/shapes/chart.js +437 -0
  289. package/dist/shapes/chart.js.map +1 -0
  290. package/dist/shapes/diagram.d.ts +33 -0
  291. package/dist/shapes/diagram.js +167 -0
  292. package/dist/shapes/diagram.js.map +1 -0
  293. package/dist/shapes/generic.d.ts +27 -0
  294. package/dist/shapes/generic.js +118 -0
  295. package/dist/shapes/generic.js.map +1 -0
  296. package/dist/shapes/hyperlink.d.ts +27 -0
  297. package/dist/shapes/hyperlink.js +193 -0
  298. package/dist/shapes/hyperlink.js.map +1 -0
  299. package/dist/shapes/image.d.ts +47 -0
  300. package/dist/shapes/image.js +244 -0
  301. package/dist/shapes/image.js.map +1 -0
  302. package/dist/shapes/ole.d.ts +30 -0
  303. package/dist/shapes/ole.js +237 -0
  304. package/dist/shapes/ole.js.map +1 -0
  305. package/dist/types/chart-types.d.ts +115 -0
  306. package/dist/types/chart-types.js +3 -0
  307. package/dist/types/chart-types.js.map +1 -0
  308. package/dist/types/modify-types.d.ts +128 -0
  309. package/dist/types/modify-types.js +3 -0
  310. package/dist/types/modify-types.js.map +1 -0
  311. package/dist/types/shape-types.d.ts +40 -0
  312. package/dist/types/shape-types.js +3 -0
  313. package/dist/types/shape-types.js.map +1 -0
  314. package/dist/types/table-types.d.ts +38 -0
  315. package/dist/types/table-types.js +3 -0
  316. package/dist/types/table-types.js.map +1 -0
  317. package/dist/types/types.d.ts +317 -0
  318. package/dist/types/types.js +16 -0
  319. package/dist/types/types.js.map +1 -0
  320. package/dist/types/xml-types.d.ts +168 -0
  321. package/dist/types/xml-types.js +3 -0
  322. package/dist/types/xml-types.js.map +1 -0
  323. package/package.json +92 -4
@@ -0,0 +1,42 @@
1
+ import { ShapeTargetType, SourceIdentifier } from '../types/types';
2
+ import { IPresentationProps } from '../interfaces/ipresentation-props';
3
+ import { PresTemplate } from '../interfaces/pres-template';
4
+ import { RootPresTemplate } from '../interfaces/root-pres-template';
5
+ import HasShapes from './has-shapes';
6
+ import { ILayout } from '../interfaces/ilayout';
7
+ export declare class Layout extends HasShapes implements ILayout {
8
+ targetType: ShapeTargetType;
9
+ targetMaster: number;
10
+ /**
11
+ * `true` for a layout of the root template that is modified in place
12
+ * (`Automizer.modifyLayout`); see `Master.inPlace`.
13
+ */
14
+ inPlace: boolean;
15
+ constructor(params: {
16
+ presentation: IPresentationProps;
17
+ template: PresTemplate;
18
+ sourceIdentifier: SourceIdentifier;
19
+ targetMaster?: number;
20
+ inPlace?: boolean;
21
+ });
22
+ /**
23
+ * Appends slideLayout
24
+ * @internal
25
+ * @param targetTemplate
26
+ * @returns append
27
+ */
28
+ append(targetTemplate: RootPresTemplate): Promise<void>;
29
+ /**
30
+ * Applies the queued element actions and modifications to a layout that
31
+ * is already part of the root template; see `Master.applyInPlace`.
32
+ * @internal
33
+ */
34
+ applyInPlace(targetTemplate: RootPresTemplate): Promise<void>;
35
+ /**
36
+ * Copys slide layout files
37
+ * @internal
38
+ */
39
+ copySlideLayoutFiles(): Promise<void>;
40
+ updateRelation(): Promise<void>;
41
+ getName(): Promise<string>;
42
+ }
@@ -0,0 +1,113 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.Layout = void 0;
16
+ const file_helper_1 = require("../helper/file-helper");
17
+ const ppt_paths_1 = require("../helper/ppt-paths");
18
+ const xml_helper_1 = require("../helper/xml-helper");
19
+ const xml_relationship_helper_1 = require("../helper/xml-relationship-helper");
20
+ const has_shapes_1 = __importDefault(require("./has-shapes"));
21
+ const logger_1 = require("../helper/logger");
22
+ const has_shapes_2 = require("./has-shapes");
23
+ class Layout extends has_shapes_1.default {
24
+ constructor(params) {
25
+ super(params);
26
+ this.targetType = 'slideLayout';
27
+ this.sourceNumber = Number(params.sourceIdentifier);
28
+ this.targetMaster = params.targetMaster;
29
+ this.inPlace = params.inPlace === true;
30
+ this.sourcePath = ppt_paths_1.PptPaths.slideLayout(this.sourceNumber);
31
+ this.relsPath = ppt_paths_1.PptPaths.slideLayoutRels(this.sourceNumber);
32
+ }
33
+ /**
34
+ * Appends slideLayout
35
+ * @internal
36
+ * @param targetTemplate
37
+ * @returns append
38
+ */
39
+ append(targetTemplate) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ if (this.inPlace) {
42
+ return this.applyInPlace(targetTemplate);
43
+ }
44
+ this.targetTemplate = targetTemplate;
45
+ this.targetArchive = targetTemplate.archive;
46
+ this.targetNumber = targetTemplate.incrementCounter('layouts');
47
+ this.targetPath = ppt_paths_1.PptPaths.slideLayout(this.targetNumber);
48
+ this.targetRelsPath = ppt_paths_1.PptPaths.slideLayoutRels(this.targetNumber);
49
+ this.sourceArchive = this.sourceTemplate.archive;
50
+ logger_1.log.info('Importing slideLayout ' + this.targetNumber);
51
+ yield this.copySlideLayoutFiles();
52
+ yield this.copyRelatedContent();
53
+ yield this.addToPresentation();
54
+ yield this.updateRelation();
55
+ yield this.cleanSlide(this.targetPath);
56
+ yield this.cleanRelations(this.targetRelsPath);
57
+ yield this.checkIntegrity(true, true);
58
+ yield this.flushTargetXml();
59
+ });
60
+ }
61
+ /**
62
+ * Applies the queued element actions and modifications to a layout that
63
+ * is already part of the root template; see `Master.applyInPlace`.
64
+ * @internal
65
+ */
66
+ applyInPlace(targetTemplate) {
67
+ return __awaiter(this, void 0, void 0, function* () {
68
+ this.targetTemplate = targetTemplate;
69
+ this.targetArchive = targetTemplate.archive;
70
+ this.sourceArchive = targetTemplate.archive;
71
+ this.targetNumber = this.sourceNumber;
72
+ this.targetPath = this.sourcePath;
73
+ this.targetRelsPath = this.relsPath;
74
+ yield (0, has_shapes_2.assertPartExists)(this.targetArchive, this.targetPath, 'slide layout');
75
+ logger_1.log.info('Modifying slideLayout ' + this.targetNumber + ' in place');
76
+ if (this.importElements.length) {
77
+ yield this.importedSelectedElements();
78
+ }
79
+ yield this.applyModifications();
80
+ yield this.applyRelModifications();
81
+ yield this.flushTargetXml();
82
+ });
83
+ }
84
+ /**
85
+ * Copys slide layout files
86
+ * @internal
87
+ */
88
+ copySlideLayoutFiles() {
89
+ return __awaiter(this, void 0, void 0, function* () {
90
+ yield file_helper_1.FileHelper.zipCopy(this.sourceArchive, ppt_paths_1.PptPaths.slideLayout(this.sourceNumber), this.targetArchive, ppt_paths_1.PptPaths.slideLayout(this.targetNumber));
91
+ yield file_helper_1.FileHelper.zipCopy(this.sourceArchive, ppt_paths_1.PptPaths.slideLayoutRels(this.sourceNumber), this.targetArchive, ppt_paths_1.PptPaths.slideLayoutRels(this.targetNumber));
92
+ });
93
+ }
94
+ updateRelation() {
95
+ return __awaiter(this, void 0, void 0, function* () {
96
+ const layoutToMaster = (yield new xml_relationship_helper_1.XmlRelationshipHelper().initialize(this.targetArchive, `slideLayout${this.targetNumber}.xml.rels`, `ppt/slideLayouts/_rels`, '../slideMasters/slideMaster'));
97
+ layoutToMaster[0].updateTargetIndex(this.targetMaster);
98
+ });
99
+ }
100
+ getName() {
101
+ return __awaiter(this, void 0, void 0, function* () {
102
+ var _a;
103
+ const slideLayoutXml = yield xml_helper_1.XmlHelper.getXmlFromArchive(this.sourceArchive, ppt_paths_1.PptPaths.slideLayout(this.sourceNumber));
104
+ const layout = (_a = slideLayoutXml.getElementsByTagName('p:cSld')) === null || _a === void 0 ? void 0 : _a.item(0);
105
+ if (layout) {
106
+ const name = layout.getAttribute('name');
107
+ return name;
108
+ }
109
+ });
110
+ }
111
+ }
112
+ exports.Layout = Layout;
113
+ //# sourceMappingURL=layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/classes/layout.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uDAAmD;AACnD,mDAA+C;AAC/C,qDAAiD;AAKjD,+EAA0E;AAC1E,8DAAqC;AAErC,6CAAuC;AACvC,6CAAgD;AAEhD,MAAa,MAAO,SAAQ,oBAAS;IASnC,YAAY,MAMX;QACC,KAAK,CAAC,MAAM,CAAC,CAAC;QAfhB,eAAU,GAAoB,aA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,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CACxC,CAAC;YAEF,MAAM,wBAAU,CAAC,OAAO,CACtB,IAAI,CAAC,aAAa,EAClB,oBAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,EAC3C,IAAI,CAAC,aAAa,EAClB,oBAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CAC5C,CAAC;QACJ,CAAC;KAAA;IAEK,cAAc;;YAClB,MAAM,cAAc,GAAG,CAAC,MAAM,IAAI,+CAAqB,EAAE,CAAC,UAAU,CAClE,IAAI,CAAC,aAAa,EAClB,cAAc,IAAI,CAAC,YAAY,WAAW,EAC1C,wBAAwB,EACxB,6BAA6B,CAC9B,CAAa,CAAC;YAEf,cAAc,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACzD,CAAC;KAAA;IAEK,OAAO;;;YACX,MAAM,cAAc,GAAG,MAAM,sBAAS,CAAC,iBAAiB,CACtD,IAAI,CAAC,aAAa,EAClB,oBAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CACxC,CAAC;YAEF,MAAM,MAAM,GAAG,MAAA,cAAc,CAAC,oBAAoB,CAAC,QAAQ,CAAC,0CAAE,IAAI,CAAC,CAAC,CAAC,CAAC;YACtE,IAAI,MAAM,EAAE,CAAC;gBACX,MAAM,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;gBACzC,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;KAAA;CACF;AAjID,wBAiIC"}
@@ -0,0 +1,45 @@
1
+ import { ShapeTargetType, SourceIdentifier, Target } from '../types/types';
2
+ import { IPresentationProps } from '../interfaces/ipresentation-props';
3
+ import { PresTemplate } from '../interfaces/pres-template';
4
+ import { RootPresTemplate } from '../interfaces/root-pres-template';
5
+ import { IMaster } from '../interfaces/imaster';
6
+ import HasShapes from './has-shapes';
7
+ export declare class Master extends HasShapes implements IMaster {
8
+ targetType: ShapeTargetType;
9
+ key: string;
10
+ /**
11
+ * `true` for a master of the root template that is modified in place
12
+ * (`Automizer.modifyMaster`): nothing is copied, the queued element
13
+ * actions and modifications are applied to the root's own part.
14
+ */
15
+ inPlace: boolean;
16
+ constructor(params: {
17
+ presentation: IPresentationProps;
18
+ template: PresTemplate;
19
+ sourceIdentifier: SourceIdentifier;
20
+ inPlace?: boolean;
21
+ });
22
+ static getKey(slideLayoutNumber: number, templateName: string): string;
23
+ /**
24
+ * Appends slide
25
+ * @internal
26
+ * @param targetTemplate
27
+ * @returns append
28
+ */
29
+ append(targetTemplate: RootPresTemplate): Promise<void>;
30
+ /**
31
+ * Applies the queued element actions and modifications to a master that
32
+ * is already part of the root template. Source and target are the same
33
+ * part of the output archive; no files are copied, no relationships or
34
+ * content types are registered and the master keeps its number.
35
+ * @internal
36
+ */
37
+ applyInPlace(targetTemplate: RootPresTemplate): Promise<void>;
38
+ copyRelatedLayouts(): Promise<Target[]>;
39
+ copyThemeFiles(): Promise<void>;
40
+ /**
41
+ * Copy slide master files
42
+ * @internal
43
+ */
44
+ copySlideMasterFiles(): Promise<void>;
45
+ }
@@ -0,0 +1,146 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.Master = void 0;
16
+ const file_helper_1 = require("../helper/file-helper");
17
+ const ppt_paths_1 = require("../helper/ppt-paths");
18
+ const xml_helper_1 = require("../helper/xml-helper");
19
+ const xml_relationship_helper_1 = require("../helper/xml-relationship-helper");
20
+ const has_shapes_1 = __importDefault(require("./has-shapes"));
21
+ const layout_1 = require("./layout");
22
+ const logger_1 = require("../helper/logger");
23
+ const has_shapes_2 = require("./has-shapes");
24
+ class Master extends has_shapes_1.default {
25
+ constructor(params) {
26
+ super(params);
27
+ this.targetType = 'slideMaster';
28
+ this.inPlace = params.inPlace === true;
29
+ // ToDo analogue for slideMasters
30
+ // this.sourceNumber = this.getSlideNumber(
31
+ // params.template,
32
+ // params.sourceIdentifier,
33
+ // );
34
+ this.sourceNumber = Number(params.sourceIdentifier);
35
+ this.key = Master.getKey(this.sourceNumber, params.template.name);
36
+ this.sourcePath = ppt_paths_1.PptPaths.slideMaster(this.sourceNumber);
37
+ this.relsPath = ppt_paths_1.PptPaths.slideMasterRels(this.sourceNumber);
38
+ }
39
+ static getKey(slideLayoutNumber, templateName) {
40
+ return slideLayoutNumber + '@' + templateName;
41
+ }
42
+ /**
43
+ * Appends slide
44
+ * @internal
45
+ * @param targetTemplate
46
+ * @returns append
47
+ */
48
+ append(targetTemplate) {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ if (this.inPlace) {
51
+ return this.applyInPlace(targetTemplate);
52
+ }
53
+ this.targetTemplate = targetTemplate;
54
+ this.targetArchive = targetTemplate.archive;
55
+ this.targetNumber = targetTemplate.incrementCounter('masters');
56
+ this.targetPath = ppt_paths_1.PptPaths.slideMaster(this.targetNumber);
57
+ this.targetRelsPath = ppt_paths_1.PptPaths.slideMasterRels(this.targetNumber);
58
+ this.sourceArchive = this.sourceTemplate.archive;
59
+ logger_1.log.info('Importing slideMaster ' + this.targetNumber);
60
+ yield this.copySlideMasterFiles();
61
+ yield this.copyRelatedLayouts();
62
+ yield this.copyRelatedContent();
63
+ yield this.addToPresentation();
64
+ yield this.copyThemeFiles();
65
+ if (this.importElements.length) {
66
+ yield this.importedSelectedElements();
67
+ }
68
+ yield this.applyModifications();
69
+ yield this.applyRelModifications();
70
+ const info = this.targetTemplate.automizer.params.showIntegrityInfo;
71
+ const assert = this.targetTemplate.automizer.params.showIntegrityInfo;
72
+ yield this.checkIntegrity(info, assert);
73
+ yield this.cleanSlide(this.targetPath);
74
+ yield this.flushTargetXml();
75
+ });
76
+ }
77
+ /**
78
+ * Applies the queued element actions and modifications to a master that
79
+ * is already part of the root template. Source and target are the same
80
+ * part of the output archive; no files are copied, no relationships or
81
+ * content types are registered and the master keeps its number.
82
+ * @internal
83
+ */
84
+ applyInPlace(targetTemplate) {
85
+ return __awaiter(this, void 0, void 0, function* () {
86
+ this.targetTemplate = targetTemplate;
87
+ this.targetArchive = targetTemplate.archive;
88
+ this.sourceArchive = targetTemplate.archive;
89
+ this.targetNumber = this.sourceNumber;
90
+ this.targetPath = this.sourcePath;
91
+ this.targetRelsPath = this.relsPath;
92
+ yield (0, has_shapes_2.assertPartExists)(this.targetArchive, this.targetPath, 'slide master');
93
+ logger_1.log.info('Modifying slideMaster ' + this.targetNumber + ' in place');
94
+ if (this.importElements.length) {
95
+ yield this.importedSelectedElements();
96
+ }
97
+ yield this.applyModifications();
98
+ yield this.applyRelModifications();
99
+ yield this.flushTargetXml();
100
+ });
101
+ }
102
+ copyRelatedLayouts() {
103
+ return __awaiter(this, void 0, void 0, function* () {
104
+ const targets = (yield new xml_relationship_helper_1.XmlRelationshipHelper().initialize(this.targetArchive, `slideMaster${this.targetNumber}.xml.rels`, `ppt/slideMasters/_rels`, '../slideLayouts/slideLayout'));
105
+ for (const target of targets) {
106
+ const layout = new layout_1.Layout({
107
+ presentation: this.targetTemplate.automizer,
108
+ template: this.sourceTemplate,
109
+ sourceIdentifier: target.number,
110
+ targetMaster: this.targetNumber,
111
+ });
112
+ yield this.targetTemplate.appendLayout(layout);
113
+ const layoutName = yield layout.getName();
114
+ this.targetTemplate.mapContents('slideLayout', this.sourceTemplate.name, target.number, layout.targetNumber, layoutName);
115
+ target.updateTargetIndex(layout.targetNumber);
116
+ }
117
+ return targets;
118
+ });
119
+ }
120
+ copyThemeFiles() {
121
+ return __awaiter(this, void 0, void 0, function* () {
122
+ const targets = yield xml_relationship_helper_1.XmlRelationshipHelper.getRelationshipTargetsByPrefix(this.targetArchive, ppt_paths_1.PptPaths.slideMasterRels(this.targetNumber), '../theme/theme');
123
+ if (!targets.length) {
124
+ return;
125
+ }
126
+ const themeTarget = targets[0];
127
+ const themeSourceId = themeTarget.number;
128
+ const themeTargetId = this.targetTemplate.incrementCounter('themes');
129
+ yield file_helper_1.FileHelper.zipCopy(this.sourceArchive, ppt_paths_1.PptPaths.theme(themeSourceId), this.targetArchive, ppt_paths_1.PptPaths.theme(themeTargetId));
130
+ yield this.contentTypes.appendThemeToContentType(themeTargetId);
131
+ yield xml_helper_1.XmlHelper.replaceAttribute(this.targetArchive, ppt_paths_1.PptPaths.slideMasterRels(this.targetNumber), 'Relationship', 'Id', themeTarget.rId, ppt_paths_1.PptPaths.relative.theme(themeTargetId), 'Target');
132
+ });
133
+ }
134
+ /**
135
+ * Copy slide master files
136
+ * @internal
137
+ */
138
+ copySlideMasterFiles() {
139
+ return __awaiter(this, void 0, void 0, function* () {
140
+ yield file_helper_1.FileHelper.zipCopy(this.sourceArchive, ppt_paths_1.PptPaths.slideMaster(this.sourceNumber), this.targetArchive, ppt_paths_1.PptPaths.slideMaster(this.targetNumber));
141
+ yield file_helper_1.FileHelper.zipCopy(this.sourceArchive, ppt_paths_1.PptPaths.slideMasterRels(this.sourceNumber), this.targetArchive, ppt_paths_1.PptPaths.slideMasterRels(this.targetNumber));
142
+ });
143
+ }
144
+ }
145
+ exports.Master = Master;
146
+ //# sourceMappingURL=master.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"master.js","sourceRoot":"","sources":["../../src/classes/master.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uDAAmD;AACn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AAA;IAED;;;OAGG;IACG,oBAAoB;;YACxB,MAAM,wBAAU,CAAC,OAAO,CACtB,IAAI,CAAC,aAAa,EAClB,oBAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,EACvC,IAAI,CAAC,aAAa,EAClB,oBAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CACxC,CAAC;YAEF,MAAM,wBAAU,CAAC,OAAO,CACtB,IAAI,CAAC,aAAa,EAClB,oBAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,EAC3C,IAAI,CAAC,aAAa,EAClB,oBAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CAC5C,CAAC;QACJ,CAAC;KAAA;CACF;AAvMD,wBAuMC"}
@@ -0,0 +1,42 @@
1
+ import { SlidePlaceholder } from '../types/types';
2
+ import { XmlDocument } from '../types/xml-types';
3
+ import type HasShapes from './has-shapes';
4
+ /**
5
+ * Placeholder cleanup on written slides: removes duplicate placeholders,
6
+ * strips placeholder tags without a counterpart on the target layout and
7
+ * drops tags pptx-templates cannot process.
8
+ *
9
+ * Extracted from HasShapes (ROADMAP Phase 2).
10
+ */
11
+ export declare class PlaceholderNormalizer {
12
+ private host;
13
+ constructor(host: HasShapes);
14
+ /**
15
+ * Removes all unsupported tags from slide xml and (with
16
+ * `params.cleanupPlaceholders`) normalizes placeholder shapes.
17
+ * E.g. added relations & tags by Thinkcell cannot be processed
18
+ * by pptx-templates at the moment.
19
+ */
20
+ cleanSlide(targetPath: string, sourcePlaceholderTypes?: SlidePlaceholder[]): Promise<void>;
21
+ /**
22
+ * Collects the placeholders present on the target slide.
23
+ */
24
+ parsePlaceholders(): Promise<SlidePlaceholder[]>;
25
+ /**
26
+ * If you insert a placeholder shape on a target slide with an empty
27
+ * placeholder of the same type, we need to remove the existing
28
+ * placeholder.
29
+ */
30
+ removeDuplicatePlaceholders(xml: XmlDocument, sourcePlaceholderTypes: SlidePlaceholder[]): void;
31
+ /**
32
+ * If a placeholder shape was inserted on a slide without a corresponding
33
+ * placeholder, powerPoint will usually smash the shape's formatting.
34
+ * This function removes the placeholder tag.
35
+ */
36
+ normalizePlaceholderShapes(xml: XmlDocument, sourcePlaceholderTypes: SlidePlaceholder[]): void;
37
+ /**
38
+ * Removes unsupported tags and (optionally) their now-empty parents.
39
+ * Parents will be removed only if they become empty AND are NOT `p:nvPr`.
40
+ */
41
+ private removeUnsupportedTags;
42
+ }
@@ -0,0 +1,136 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PlaceholderNormalizer = void 0;
13
+ const logger_1 = require("../helper/logger");
14
+ const xml_helper_1 = require("../helper/xml-helper");
15
+ /**
16
+ * Placeholder cleanup on written slides: removes duplicate placeholders,
17
+ * strips placeholder tags without a counterpart on the target layout and
18
+ * drops tags pptx-templates cannot process.
19
+ *
20
+ * Extracted from HasShapes (ROADMAP Phase 2).
21
+ */
22
+ class PlaceholderNormalizer {
23
+ constructor(host) {
24
+ this.host = host;
25
+ }
26
+ /**
27
+ * Removes all unsupported tags from slide xml and (with
28
+ * `params.cleanupPlaceholders`) normalizes placeholder shapes.
29
+ * E.g. added relations & tags by Thinkcell cannot be processed
30
+ * by pptx-templates at the moment.
31
+ */
32
+ cleanSlide(targetPath, sourcePlaceholderTypes) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ const xml = yield xml_helper_1.XmlHelper.getXmlFromArchive(this.host.targetArchive, targetPath);
35
+ if (this.host.cleanupPlaceholders && sourcePlaceholderTypes) {
36
+ this.removeDuplicatePlaceholders(xml, sourcePlaceholderTypes);
37
+ this.normalizePlaceholderShapes(xml, sourcePlaceholderTypes);
38
+ }
39
+ this.removeUnsupportedTags(xml);
40
+ xml_helper_1.XmlHelper.writeXmlToArchive(this.host.targetArchive, targetPath, xml);
41
+ });
42
+ }
43
+ /**
44
+ * Collects the placeholders present on the target slide.
45
+ */
46
+ parsePlaceholders() {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ const xml = yield xml_helper_1.XmlHelper.getXmlFromArchive(this.host.targetArchive, this.host.targetPath);
49
+ const placeholderTypes = [];
50
+ const placeholders = xml.getElementsByTagName('p:ph');
51
+ xml_helper_1.XmlHelper.modifyCollection(placeholders, (placeholder) => {
52
+ placeholderTypes.push({
53
+ type: placeholder.getAttribute('type'),
54
+ id: placeholder.getAttribute('id'),
55
+ xml: placeholder,
56
+ });
57
+ });
58
+ return placeholderTypes;
59
+ });
60
+ }
61
+ /**
62
+ * If you insert a placeholder shape on a target slide with an empty
63
+ * placeholder of the same type, we need to remove the existing
64
+ * placeholder.
65
+ */
66
+ removeDuplicatePlaceholders(xml, sourcePlaceholderTypes) {
67
+ const placeholders = xml.getElementsByTagName('p:ph');
68
+ const usedTypes = {};
69
+ xml_helper_1.XmlHelper.modifyCollection(placeholders, (placeholder) => {
70
+ const type = placeholder.getAttribute('type');
71
+ usedTypes[type] = usedTypes[type] || 0;
72
+ usedTypes[type]++;
73
+ });
74
+ for (const usedType in usedTypes) {
75
+ const count = usedTypes[usedType];
76
+ if (count > 1) {
77
+ // TODO: in case more than two placeholders are of a kind,
78
+ // this will likely remove more than intended. Should also match by id.
79
+ const removePlaceholders = sourcePlaceholderTypes.filter((sourcePlaceholder) => sourcePlaceholder.type === usedType);
80
+ removePlaceholders.forEach((removePlaceholder) => {
81
+ const parentShapeTag = 'p:sp';
82
+ const parentShape = xml_helper_1.XmlHelper.getClosestParent(parentShapeTag, removePlaceholder.xml);
83
+ if (parentShape) {
84
+ xml_helper_1.XmlHelper.remove(parentShape);
85
+ }
86
+ });
87
+ }
88
+ }
89
+ }
90
+ /**
91
+ * If a placeholder shape was inserted on a slide without a corresponding
92
+ * placeholder, powerPoint will usually smash the shape's formatting.
93
+ * This function removes the placeholder tag.
94
+ */
95
+ normalizePlaceholderShapes(xml, sourcePlaceholderTypes) {
96
+ const placeholders = xml.getElementsByTagName('p:ph');
97
+ xml_helper_1.XmlHelper.modifyCollection(placeholders, (placeholder) => {
98
+ const usedType = placeholder.getAttribute('type');
99
+ const existingPlaceholder = sourcePlaceholderTypes.find((sourcePlaceholder) => sourcePlaceholder.type === usedType);
100
+ if (!existingPlaceholder) {
101
+ xml_helper_1.XmlHelper.remove(placeholder);
102
+ }
103
+ });
104
+ }
105
+ /**
106
+ * Removes unsupported tags and (optionally) their now-empty parents.
107
+ * Parents will be removed only if they become empty AND are NOT `p:nvPr`.
108
+ */
109
+ removeUnsupportedTags(xml) {
110
+ this.host.unsupportedTags.forEach((tag) => {
111
+ const drop = xml_helper_1.XmlHelper.collectionToArray(xml.getElementsByTagName(tag));
112
+ if (drop.length > 0) {
113
+ logger_1.log.debug('Cleaning unsupported tag ' + tag);
114
+ // First get parent elements before removing
115
+ const parents = new Set();
116
+ for (const item of drop) {
117
+ const parent = item.parentNode;
118
+ if (parent) {
119
+ parents.add(parent);
120
+ }
121
+ }
122
+ // Remove the unsupported tags
123
+ drop.forEach((item) => xml_helper_1.XmlHelper.remove(item));
124
+ // Check each parent and remove it if it has no children left
125
+ // but never remove <p:nvPr/>
126
+ parents.forEach((parent) => {
127
+ if (parent.childNodes.length === 0 && parent.nodeName !== 'p:nvPr') {
128
+ xml_helper_1.XmlHelper.remove(parent);
129
+ }
130
+ });
131
+ }
132
+ });
133
+ }
134
+ }
135
+ exports.PlaceholderNormalizer = PlaceholderNormalizer;
136
+ //# sourceMappingURL=placeholder-normalizer.js.map
@@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AAI,EAAE,EAAE,CAAC,sBAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;gBAE/C,6DAA6D;gBAC7D,6BAA6B;gBAC7B,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;oBACzB,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;wBACnE,sBAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;oBAC3B,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA5ID,sDA4IC"}
@@ -0,0 +1,18 @@
1
+ import type HasShapes from './has-shapes';
2
+ /**
3
+ * Copies all content related to a slide/master/layout — charts, images,
4
+ * diagrams, OLE objects and hyperlinks — from the source archive into the
5
+ * target archive when the slide is appended.
6
+ *
7
+ * Extracted from HasShapes (ROADMAP Phase 2).
8
+ */
9
+ export declare class RelatedContentCopier {
10
+ private host;
11
+ constructor(host: HasShapes);
12
+ copy(): Promise<void>;
13
+ private copyCharts;
14
+ private copyImages;
15
+ private copyDiagrams;
16
+ private copyOleObjects;
17
+ private copyHyperlinks;
18
+ }