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.
- package/AI-INSTRUCTOR.md +2253 -0
- package/CHANGELOG.md +56 -0
- package/LICENSE +23 -0
- package/README.md +84 -2
- package/dist/automizer.d.ts +224 -0
- package/dist/automizer.js +704 -0
- package/dist/automizer.js.map +1 -0
- package/dist/classes/content-type-registry.d.ts +46 -0
- package/dist/classes/content-type-registry.js +170 -0
- package/dist/classes/content-type-registry.js.map +1 -0
- package/dist/classes/element-importer.d.ts +49 -0
- package/dist/classes/element-importer.js +254 -0
- package/dist/classes/element-importer.js.map +1 -0
- package/dist/classes/has-shapes.d.ts +286 -0
- package/dist/classes/has-shapes.js +385 -0
- package/dist/classes/has-shapes.js.map +1 -0
- package/dist/classes/layout.d.ts +42 -0
- package/dist/classes/layout.js +113 -0
- package/dist/classes/layout.js.map +1 -0
- package/dist/classes/master.d.ts +45 -0
- package/dist/classes/master.js +146 -0
- package/dist/classes/master.js.map +1 -0
- package/dist/classes/placeholder-normalizer.d.ts +42 -0
- package/dist/classes/placeholder-normalizer.js +136 -0
- package/dist/classes/placeholder-normalizer.js.map +1 -0
- package/dist/classes/related-content-copier.d.ts +18 -0
- package/dist/classes/related-content-copier.js +114 -0
- package/dist/classes/related-content-copier.js.map +1 -0
- package/dist/classes/shape.d.ts +62 -0
- package/dist/classes/shape.js +194 -0
- package/dist/classes/shape.js.map +1 -0
- package/dist/classes/slide-master-remover.d.ts +44 -0
- package/dist/classes/slide-master-remover.js +201 -0
- package/dist/classes/slide-master-remover.js.map +1 -0
- package/dist/classes/slide-notes-copier.d.ts +26 -0
- package/dist/classes/slide-notes-copier.js +76 -0
- package/dist/classes/slide-notes-copier.js.map +1 -0
- package/dist/classes/slide.d.ts +91 -0
- package/dist/classes/slide.js +286 -0
- package/dist/classes/slide.js.map +1 -0
- package/dist/classes/template.d.ts +137 -0
- package/dist/classes/template.js +311 -0
- package/dist/classes/template.js.map +1 -0
- package/dist/constants/constants.d.ts +11 -0
- package/dist/constants/constants.js +182 -0
- package/dist/constants/constants.js.map +1 -0
- package/dist/enums/chart-type.d.ts +11 -0
- package/dist/enums/chart-type.js +16 -0
- package/dist/enums/chart-type.js.map +1 -0
- package/dist/enums/content-type-map.d.ts +16 -0
- package/dist/enums/content-type-map.js +23 -0
- package/dist/enums/content-type-map.js.map +1 -0
- package/dist/enums/element-type.d.ts +14 -0
- package/dist/enums/element-type.js +20 -0
- package/dist/enums/element-type.js.map +1 -0
- package/dist/errors.d.ts +81 -0
- package/dist/errors.js +100 -0
- package/dist/errors.js.map +1 -0
- package/dist/extensions/index.d.ts +5 -0
- package/dist/extensions/index.js +31 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/extensions/pptxgenjs-compat/img-broken-png.d.ts +5 -0
- package/dist/extensions/pptxgenjs-compat/img-broken-png.js +9 -0
- package/dist/extensions/pptxgenjs-compat/img-broken-png.js.map +1 -0
- package/dist/extensions/pptxgenjs-compat/index.d.ts +5 -0
- package/dist/extensions/pptxgenjs-compat/index.js +10 -0
- package/dist/extensions/pptxgenjs-compat/index.js.map +1 -0
- package/dist/extensions/pptxgenjs-compat/svg-fallback.d.ts +14 -0
- package/dist/extensions/pptxgenjs-compat/svg-fallback.js +139 -0
- package/dist/extensions/pptxgenjs-compat/svg-fallback.js.map +1 -0
- package/dist/extensions/run-merge/index.d.ts +13 -0
- package/dist/extensions/run-merge/index.js +89 -0
- package/dist/extensions/run-merge/index.js.map +1 -0
- package/dist/extensions/template-logic/commands.d.ts +22 -0
- package/dist/extensions/template-logic/commands.js +83 -0
- package/dist/extensions/template-logic/commands.js.map +1 -0
- package/dist/extensions/template-logic/expression.d.ts +61 -0
- package/dist/extensions/template-logic/expression.js +499 -0
- package/dist/extensions/template-logic/expression.js.map +1 -0
- package/dist/extensions/template-logic/images.d.ts +26 -0
- package/dist/extensions/template-logic/images.js +183 -0
- package/dist/extensions/template-logic/images.js.map +1 -0
- package/dist/extensions/template-logic/index.d.ts +14 -0
- package/dist/extensions/template-logic/index.js +64 -0
- package/dist/extensions/template-logic/index.js.map +1 -0
- package/dist/extensions/template-logic/list-commands.d.ts +9 -0
- package/dist/extensions/template-logic/list-commands.js +72 -0
- package/dist/extensions/template-logic/list-commands.js.map +1 -0
- package/dist/extensions/template-logic/renderer.d.ts +85 -0
- package/dist/extensions/template-logic/renderer.js +867 -0
- package/dist/extensions/template-logic/renderer.js.map +1 -0
- package/dist/extensions/template-logic/types.d.ts +62 -0
- package/dist/extensions/template-logic/types.js +3 -0
- package/dist/extensions/template-logic/types.js.map +1 -0
- package/dist/helper/archive/archive-fs.d.ts +45 -0
- package/dist/helper/archive/archive-fs.js +206 -0
- package/dist/helper/archive/archive-fs.js.map +1 -0
- package/dist/helper/archive/archive-jszip.d.ts +31 -0
- package/dist/helper/archive/archive-jszip.js +173 -0
- package/dist/helper/archive/archive-jszip.js.map +1 -0
- package/dist/helper/archive/archive.d.ts +27 -0
- package/dist/helper/archive/archive.js +78 -0
- package/dist/helper/archive/archive.js.map +1 -0
- package/dist/helper/cell-id-helper.d.ts +25 -0
- package/dist/helper/cell-id-helper.js +95 -0
- package/dist/helper/cell-id-helper.js.map +1 -0
- package/dist/helper/compute-src-rect.d.ts +9 -0
- package/dist/helper/compute-src-rect.js +52 -0
- package/dist/helper/compute-src-rect.js.map +1 -0
- package/dist/helper/content-tracker.d.ts +31 -0
- package/dist/helper/content-tracker.js +227 -0
- package/dist/helper/content-tracker.js.map +1 -0
- package/dist/helper/count-helper.d.ts +33 -0
- package/dist/helper/count-helper.js +140 -0
- package/dist/helper/count-helper.js.map +1 -0
- package/dist/helper/css-style-parser.d.ts +52 -0
- package/dist/helper/css-style-parser.js +246 -0
- package/dist/helper/css-style-parser.js.map +1 -0
- package/dist/helper/file-helper.d.ts +36 -0
- package/dist/helper/file-helper.js +150 -0
- package/dist/helper/file-helper.js.map +1 -0
- package/dist/helper/general-helper.d.ts +6 -0
- package/dist/helper/general-helper.js +34 -0
- package/dist/helper/general-helper.js.map +1 -0
- package/dist/helper/generate/generate-pptxgenjs.d.ts +37 -0
- package/dist/helper/generate/generate-pptxgenjs.js +134 -0
- package/dist/helper/generate/generate-pptxgenjs.js.map +1 -0
- package/dist/helper/html-to-multitext-helper.d.ts +84 -0
- package/dist/helper/html-to-multitext-helper.js +490 -0
- package/dist/helper/html-to-multitext-helper.js.map +1 -0
- package/dist/helper/hyperlink-processor.d.ts +54 -0
- package/dist/helper/hyperlink-processor.js +289 -0
- package/dist/helper/hyperlink-processor.js.map +1 -0
- package/dist/helper/image-dimensions.d.ts +21 -0
- package/dist/helper/image-dimensions.js +202 -0
- package/dist/helper/image-dimensions.js.map +1 -0
- package/dist/helper/jszip-helper.d.ts +21 -0
- package/dist/helper/jszip-helper.js +162 -0
- package/dist/helper/jszip-helper.js.map +1 -0
- package/dist/helper/layout-index.d.ts +55 -0
- package/dist/helper/layout-index.js +155 -0
- package/dist/helper/layout-index.js.map +1 -0
- package/dist/helper/logger.d.ts +53 -0
- package/dist/helper/logger.js +73 -0
- package/dist/helper/logger.js.map +1 -0
- package/dist/helper/media-deduplicator.d.ts +42 -0
- package/dist/helper/media-deduplicator.js +88 -0
- package/dist/helper/media-deduplicator.js.map +1 -0
- package/dist/helper/modify-background-helper.d.ts +19 -0
- package/dist/helper/modify-background-helper.js +59 -0
- package/dist/helper/modify-background-helper.js.map +1 -0
- package/dist/helper/modify-chart-helper.d.ts +159 -0
- package/dist/helper/modify-chart-helper.js +642 -0
- package/dist/helper/modify-chart-helper.js.map +1 -0
- package/dist/helper/modify-cleanup-helper.d.ts +69 -0
- package/dist/helper/modify-cleanup-helper.js +343 -0
- package/dist/helper/modify-cleanup-helper.js.map +1 -0
- package/dist/helper/modify-color-helper.d.ts +35 -0
- package/dist/helper/modify-color-helper.js +211 -0
- package/dist/helper/modify-color-helper.js.map +1 -0
- package/dist/helper/modify-helper.d.ts +23 -0
- package/dist/helper/modify-helper.js +61 -0
- package/dist/helper/modify-helper.js.map +1 -0
- package/dist/helper/modify-hyperlink-element.d.ts +9 -0
- package/dist/helper/modify-hyperlink-element.js +34 -0
- package/dist/helper/modify-hyperlink-element.js.map +1 -0
- package/dist/helper/modify-hyperlink-helper.d.ts +42 -0
- package/dist/helper/modify-hyperlink-helper.js +258 -0
- package/dist/helper/modify-hyperlink-helper.js.map +1 -0
- package/dist/helper/modify-image-helper.d.ts +23 -0
- package/dist/helper/modify-image-helper.js +157 -0
- package/dist/helper/modify-image-helper.js.map +1 -0
- package/dist/helper/modify-presentation-helper.d.ts +55 -0
- package/dist/helper/modify-presentation-helper.js +177 -0
- package/dist/helper/modify-presentation-helper.js.map +1 -0
- package/dist/helper/modify-shape-helper.d.ts +111 -0
- package/dist/helper/modify-shape-helper.js +340 -0
- package/dist/helper/modify-shape-helper.js.map +1 -0
- package/dist/helper/modify-table-helper.d.ts +11 -0
- package/dist/helper/modify-table-helper.js +100 -0
- package/dist/helper/modify-table-helper.js.map +1 -0
- package/dist/helper/modify-text-helper.d.ts +62 -0
- package/dist/helper/modify-text-helper.js +244 -0
- package/dist/helper/modify-text-helper.js.map +1 -0
- package/dist/helper/modify-xml-helper.d.ts +52 -0
- package/dist/helper/modify-xml-helper.js +305 -0
- package/dist/helper/modify-xml-helper.js.map +1 -0
- package/dist/helper/multitext-helper.d.ts +116 -0
- package/dist/helper/multitext-helper.js +462 -0
- package/dist/helper/multitext-helper.js.map +1 -0
- package/dist/helper/ppt-paths.d.ts +76 -0
- package/dist/helper/ppt-paths.js +116 -0
- package/dist/helper/ppt-paths.js.map +1 -0
- package/dist/helper/shape-type-detector.d.ts +34 -0
- package/dist/helper/shape-type-detector.js +99 -0
- package/dist/helper/shape-type-detector.js.map +1 -0
- package/dist/helper/text-replace-helper.d.ts +30 -0
- package/dist/helper/text-replace-helper.js +149 -0
- package/dist/helper/text-replace-helper.js.map +1 -0
- package/dist/helper/xml/lnLRTB.d.ts +1 -0
- package/dist/helper/xml/lnLRTB.js +62 -0
- package/dist/helper/xml/lnLRTB.js.map +1 -0
- package/dist/helper/xml/prstGeom.d.ts +1 -0
- package/dist/helper/xml/prstGeom.js +11 -0
- package/dist/helper/xml/prstGeom.js.map +1 -0
- package/dist/helper/xml-elements.d.ts +134 -0
- package/dist/helper/xml-elements.js +538 -0
- package/dist/helper/xml-elements.js.map +1 -0
- package/dist/helper/xml-helper.d.ts +120 -0
- package/dist/helper/xml-helper.js +495 -0
- package/dist/helper/xml-helper.js.map +1 -0
- package/dist/helper/xml-placeholder-helper.d.ts +92 -0
- package/dist/helper/xml-placeholder-helper.js +454 -0
- package/dist/helper/xml-placeholder-helper.js.map +1 -0
- package/dist/helper/xml-pretty-print.d.ts +17 -0
- package/dist/helper/xml-pretty-print.js +88 -0
- package/dist/helper/xml-pretty-print.js.map +1 -0
- package/dist/helper/xml-relationship-helper.d.ts +103 -0
- package/dist/helper/xml-relationship-helper.js +397 -0
- package/dist/helper/xml-relationship-helper.js.map +1 -0
- package/dist/helper/xml-slide-helper.d.ts +107 -0
- package/dist/helper/xml-slide-helper.js +676 -0
- package/dist/helper/xml-slide-helper.js.map +1 -0
- package/dist/helper/xml-template-helper.d.ts +42 -0
- package/dist/helper/xml-template-helper.js +252 -0
- package/dist/helper/xml-template-helper.js.map +1 -0
- package/dist/helper/xmldom-sax-patch.d.ts +18 -0
- package/dist/helper/xmldom-sax-patch.js +58 -0
- package/dist/helper/xmldom-sax-patch.js.map +1 -0
- package/dist/index.d.ts +81 -0
- package/dist/index.js +177 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/iarchive.d.ts +43 -0
- package/dist/interfaces/iarchive.js +3 -0
- package/dist/interfaces/iarchive.js.map +1 -0
- package/dist/interfaces/ichart.d.ts +7 -0
- package/dist/interfaces/ichart.js +3 -0
- package/dist/interfaces/ichart.js.map +1 -0
- package/dist/interfaces/icounter.d.ts +7 -0
- package/dist/interfaces/icounter.js +3 -0
- package/dist/interfaces/icounter.js.map +1 -0
- package/dist/interfaces/igenerator.d.ts +4 -0
- package/dist/interfaces/igenerator.js +3 -0
- package/dist/interfaces/igenerator.js.map +1 -0
- package/dist/interfaces/iimage.d.ts +7 -0
- package/dist/interfaces/iimage.js +3 -0
- package/dist/interfaces/iimage.js.map +1 -0
- package/dist/interfaces/ilayout.d.ts +14 -0
- package/dist/interfaces/ilayout.js +3 -0
- package/dist/interfaces/ilayout.js.map +1 -0
- package/dist/interfaces/imaster.d.ts +15 -0
- package/dist/interfaces/imaster.js +3 -0
- package/dist/interfaces/imaster.js.map +1 -0
- package/dist/interfaces/imulti-text.d.ts +50 -0
- package/dist/interfaces/imulti-text.js +3 -0
- package/dist/interfaces/imulti-text.js.map +1 -0
- package/dist/interfaces/ipptxgenjs-slide.d.ts +40 -0
- package/dist/interfaces/ipptxgenjs-slide.js +3 -0
- package/dist/interfaces/ipptxgenjs-slide.js.map +1 -0
- package/dist/interfaces/ipresentation-props.d.ts +16 -0
- package/dist/interfaces/ipresentation-props.js +3 -0
- package/dist/interfaces/ipresentation-props.js.map +1 -0
- package/dist/interfaces/ishape-action.d.ts +18 -0
- package/dist/interfaces/ishape-action.js +3 -0
- package/dist/interfaces/ishape-action.js.map +1 -0
- package/dist/interfaces/ishape.d.ts +5 -0
- package/dist/interfaces/ishape.js +3 -0
- package/dist/interfaces/ishape.js.map +1 -0
- package/dist/interfaces/islide.d.ts +71 -0
- package/dist/interfaces/islide.js +3 -0
- package/dist/interfaces/islide.js.map +1 -0
- package/dist/interfaces/itemplate.d.ts +9 -0
- package/dist/interfaces/itemplate.js +3 -0
- package/dist/interfaces/itemplate.js.map +1 -0
- package/dist/interfaces/pres-template.d.ts +9 -0
- package/dist/interfaces/pres-template.js +3 -0
- package/dist/interfaces/pres-template.js.map +1 -0
- package/dist/interfaces/root-pres-template.d.ts +38 -0
- package/dist/interfaces/root-pres-template.js +3 -0
- package/dist/interfaces/root-pres-template.js.map +1 -0
- package/dist/modify/modify-chart.d.ts +74 -0
- package/dist/modify/modify-chart.js +753 -0
- package/dist/modify/modify-chart.js.map +1 -0
- package/dist/modify/modify-table.d.ts +64 -0
- package/dist/modify/modify-table.js +435 -0
- package/dist/modify/modify-table.js.map +1 -0
- package/dist/shapes/chart.d.ts +91 -0
- package/dist/shapes/chart.js +437 -0
- package/dist/shapes/chart.js.map +1 -0
- package/dist/shapes/diagram.d.ts +33 -0
- package/dist/shapes/diagram.js +167 -0
- package/dist/shapes/diagram.js.map +1 -0
- package/dist/shapes/generic.d.ts +27 -0
- package/dist/shapes/generic.js +118 -0
- package/dist/shapes/generic.js.map +1 -0
- package/dist/shapes/hyperlink.d.ts +27 -0
- package/dist/shapes/hyperlink.js +193 -0
- package/dist/shapes/hyperlink.js.map +1 -0
- package/dist/shapes/image.d.ts +47 -0
- package/dist/shapes/image.js +244 -0
- package/dist/shapes/image.js.map +1 -0
- package/dist/shapes/ole.d.ts +30 -0
- package/dist/shapes/ole.js +237 -0
- package/dist/shapes/ole.js.map +1 -0
- package/dist/types/chart-types.d.ts +115 -0
- package/dist/types/chart-types.js +3 -0
- package/dist/types/chart-types.js.map +1 -0
- package/dist/types/modify-types.d.ts +128 -0
- package/dist/types/modify-types.js +3 -0
- package/dist/types/modify-types.js.map +1 -0
- package/dist/types/shape-types.d.ts +40 -0
- package/dist/types/shape-types.js +3 -0
- package/dist/types/shape-types.js.map +1 -0
- package/dist/types/table-types.d.ts +38 -0
- package/dist/types/table-types.js +3 -0
- package/dist/types/table-types.js.map +1 -0
- package/dist/types/types.d.ts +317 -0
- package/dist/types/types.js +16 -0
- package/dist/types/types.js.map +1 -0
- package/dist/types/xml-types.d.ts +168 -0
- package/dist/types/xml-types.js +3 -0
- package/dist/types/xml-types.js.map +1 -0
- 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;
|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X,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;AACnD,mDAA+C;AAC/C,qDAAiD;AAMjD,+EAA0E;AAC1E,8DAAqC;AACrC,qCAAkC;AAClC,6CAAuC;AACvC,6CAAgD;AAEhD,MAAa,MAAO,SAAQ,oBAAS;IAUnC,YAAY,MAKX;QACC,KAAK,CAAC,MAAM,CAAC,CAAC;QAfhB,eAAU,GAAoB,aAAa,CAAC;QAiB1C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,KAAK,IAAI,CAAC;QAEvC,iCAAiC;QACjC,2CAA2C;QAC3C,qBAAqB;QACrB,6BAA6B;QAC7B,KAAK;QAEL,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;QAEpD,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAElE,IAAI,CAAC,UAAU,GAAG,oBAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC1D,IAAI,CAAC,QAAQ,GAAG,oBAA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AC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;YAErE,MAAM,wBAAU,CAAC,OAAO,CACtB,IAAI,CAAC,aAAa,EAClB,oBAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,EAC7B,IAAI,CAAC,aAAa,EAClB,oBAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,CAC9B,CAAC;YAEF,MAAM,IAAI,CAAC,YAAY,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC;YAEhE,MAAM,sBAAS,CAAC,gBAAgB,CAC9B,IAAI,CAAC,aAAa,EAClB,oBAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,EAC3C,cAAc,EACd,IAAI,EACJ,WAAW,CAAC,GAAG,EACf,oBAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,EACtC,QAAQ,CACT,CAAC;QACJ,CAAC;KAAA;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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholder-normalizer.js","sourceRoot":"","sources":["../../src/classes/placeholder-normalizer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAuC;AACvC,qDAAiD;AAKjD;;;;;;GAMG;AACH,MAAa,qBAAqB;IAChC,YAAoB,IAAe;QAAf,SAAI,GAAJ,IAAI,CAAW;IAAG,CAAC;IAEvC;;;;;OAKG;IACG,UAAU,CACd,UAAkB,EAClB,sBAA2C;;YAE3C,MAAM,GAAG,GAAG,MAAM,sBAAS,CAAC,iBAAiB,CAC3C,IAAI,CAAC,IAAI,CAAC,aAAa,EACvB,UAAU,CACX,CAAC;YAEF,IAAI,IAAI,CAAC,IAAI,CAAC,mBAAmB,IAAI,sBAAsB,EAAE,CAAC;gBAC5D,IAAI,CAAC,2BAA2B,CAAC,GAAG,EAAE,sBAAsB,CAAC,CAAC;gBAC9D,IAAI,CAAC,0BAA0B,CAAC,GAA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AqB,CAAC,GAAgB;QAC5C,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACxC,MAAM,IAAI,GAAG,sBAAS,CAAC,iBAAiB,CAAC,GAAG,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC;YACxE,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACpB,YAAG,CAAC,KAAK,CAAC,2BAA2B,GAAG,GAAG,CAAC,CAAC;gBAE7C,4CAA4C;gBAC5C,MAAM,OAAO,GAAG,IAAI,GAAG,EAAc,CAAC;gBACtC,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;oBACxB,MAAM,MAAM,GAAG,IAAI,CAAC,UAA+B,CAAC;oBACpD,IAAI,MAAM,EAAE,CAAC;wBACX,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;oBACtB,CAAC;gBACH,CAAC;gBAED,8BAA8B;gBAC9B,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,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
|
+
}
|