pptx-templates 0.0.0-stage → 0.1.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.
- package/AI-INSTRUCTOR.md +2253 -0
- package/CHANGELOG.md +49 -0
- package/LICENSE +23 -0
- package/README.md +86 -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/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 +147 -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,490 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HtmlToMultiTextHelper = void 0;
|
|
4
|
+
const xmldom_1 = require("@xmldom/xmldom");
|
|
5
|
+
const logger_1 = require("./logger");
|
|
6
|
+
const css_style_parser_1 = require("./css-style-parser");
|
|
7
|
+
/**
|
|
8
|
+
* Tags whose empty form is a deliberate blank line rather than a wrapper:
|
|
9
|
+
* `<p></p>` and `<p> </p>` are how editors express "empty line", while an
|
|
10
|
+
* empty `<div>` is just structure.
|
|
11
|
+
*/
|
|
12
|
+
const PRESERVE_EMPTY_TAGS = ['p', 'li', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
13
|
+
/** Inline tags that only ever contribute character properties. */
|
|
14
|
+
const INLINE_TAGS = [
|
|
15
|
+
'a',
|
|
16
|
+
'abbr',
|
|
17
|
+
'b',
|
|
18
|
+
'big',
|
|
19
|
+
'cite',
|
|
20
|
+
'code',
|
|
21
|
+
'del',
|
|
22
|
+
'em',
|
|
23
|
+
'font',
|
|
24
|
+
'i',
|
|
25
|
+
'ins',
|
|
26
|
+
'kbd',
|
|
27
|
+
'mark',
|
|
28
|
+
'q',
|
|
29
|
+
's',
|
|
30
|
+
'samp',
|
|
31
|
+
'small',
|
|
32
|
+
'span',
|
|
33
|
+
'strike',
|
|
34
|
+
'strong',
|
|
35
|
+
'sub',
|
|
36
|
+
'sup',
|
|
37
|
+
'tt',
|
|
38
|
+
'u',
|
|
39
|
+
'var',
|
|
40
|
+
];
|
|
41
|
+
/** Block tags that open a paragraph of their own. */
|
|
42
|
+
const BLOCK_TAGS = [
|
|
43
|
+
'address',
|
|
44
|
+
'article',
|
|
45
|
+
'aside',
|
|
46
|
+
'blockquote',
|
|
47
|
+
'div',
|
|
48
|
+
'dd',
|
|
49
|
+
'dt',
|
|
50
|
+
'figcaption',
|
|
51
|
+
'h1',
|
|
52
|
+
'h2',
|
|
53
|
+
'h3',
|
|
54
|
+
'h4',
|
|
55
|
+
'h5',
|
|
56
|
+
'h6',
|
|
57
|
+
'header',
|
|
58
|
+
'footer',
|
|
59
|
+
'main',
|
|
60
|
+
'p',
|
|
61
|
+
'pre',
|
|
62
|
+
'section',
|
|
63
|
+
];
|
|
64
|
+
/** Headings: paragraph level styling, relative to a 12pt body default. */
|
|
65
|
+
const HEADING_SIZES = {
|
|
66
|
+
h1: 2400,
|
|
67
|
+
h2: 2000,
|
|
68
|
+
h3: 1800,
|
|
69
|
+
h4: 1600,
|
|
70
|
+
h5: 1400,
|
|
71
|
+
h6: 1200,
|
|
72
|
+
};
|
|
73
|
+
const MONOSPACE_FONT = 'Consolas';
|
|
74
|
+
/**
|
|
75
|
+
* Blocks that carry a vertical margin in the browser's default stylesheet
|
|
76
|
+
* (`margin: 1em 0`); `<ul>`/`<ol>` carry one too, handled as list edges.
|
|
77
|
+
*/
|
|
78
|
+
const MARGIN_TAGS = [
|
|
79
|
+
'p',
|
|
80
|
+
'h1',
|
|
81
|
+
'h2',
|
|
82
|
+
'h3',
|
|
83
|
+
'h4',
|
|
84
|
+
'h5',
|
|
85
|
+
'h6',
|
|
86
|
+
'blockquote',
|
|
87
|
+
'pre',
|
|
88
|
+
];
|
|
89
|
+
/**
|
|
90
|
+
* Gap between block paragraphs as a percentage of the line height - the PPTX
|
|
91
|
+
* projection of the browser's `margin: 1em 0`, with adjacent margins already
|
|
92
|
+
* collapsed into one gap.
|
|
93
|
+
*/
|
|
94
|
+
const BLOCK_MARGIN_PERCENT = 100;
|
|
95
|
+
/**
|
|
96
|
+
* PowerPoint varies the numbering scheme per outline level; mirror the
|
|
97
|
+
* familiar 1. / a. / i. cascade and cycle beyond level 3.
|
|
98
|
+
*/
|
|
99
|
+
const AUTO_NUMBER_TYPES = [
|
|
100
|
+
'arabicPeriod',
|
|
101
|
+
'alphaLcPeriod',
|
|
102
|
+
'romanLcPeriod',
|
|
103
|
+
];
|
|
104
|
+
class HtmlToMultiTextHelper {
|
|
105
|
+
constructor() {
|
|
106
|
+
this.paragraphs = [];
|
|
107
|
+
/** Parallel to `paragraphs`: margin/list identity of the emitting block. */
|
|
108
|
+
this.blockMeta = [];
|
|
109
|
+
this.listCounter = 0;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Converts an HTML string to a MultiTextParagraph array.
|
|
113
|
+
*
|
|
114
|
+
* The input contract is XHTML-ish markup as produced by WYSIWYG editors
|
|
115
|
+
* (CKEditor/TinyMCE): tags closed, attributes quoted. `@xmldom/xmldom` is an
|
|
116
|
+
* XML parser - real-world tag soup (unclosed `<br>`, bare ` `) does not
|
|
117
|
+
* parse. Common editor quirks that *are* handled: sibling-nested lists
|
|
118
|
+
* (`<ul><li/><ul>…</ul></ul>`), block-inside-block, and inline styles on any
|
|
119
|
+
* element.
|
|
120
|
+
*
|
|
121
|
+
* @param html HTML string to convert
|
|
122
|
+
* @returns Array of MultiTextParagraph objects
|
|
123
|
+
*/
|
|
124
|
+
run(html) {
|
|
125
|
+
this.paragraphs = [];
|
|
126
|
+
this.blockMeta = [];
|
|
127
|
+
this.listCounter = 0;
|
|
128
|
+
this.open = undefined;
|
|
129
|
+
const doc = new xmldom_1.DOMParser().parseFromString(html, 'text/html');
|
|
130
|
+
const body = doc.getElementsByTagName('body')[0];
|
|
131
|
+
if (!body) {
|
|
132
|
+
logger_1.log.error('You need to provide a <body> tag for HtmlToMultiText');
|
|
133
|
+
return this.paragraphs;
|
|
134
|
+
}
|
|
135
|
+
const rootBlock = { listTypes: [], blockStyle: {} };
|
|
136
|
+
this.walkChildren(body, rootBlock, {});
|
|
137
|
+
this.flush();
|
|
138
|
+
this.applyBlockMargins();
|
|
139
|
+
return this.paragraphs;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Single traversal pass. Two accumulators travel down the tree:
|
|
143
|
+
* `block` (list depth, alignment, block styling) and `inline` (character
|
|
144
|
+
* properties). Neither is ever mutated in place - each level gets its own
|
|
145
|
+
* copy, which is what makes both list-nesting shapes converge.
|
|
146
|
+
*/
|
|
147
|
+
walk(node, block, inline) {
|
|
148
|
+
if (node.nodeType === xmldom_1.Node.TEXT_NODE) {
|
|
149
|
+
this.appendText(node.textContent || '', block, inline);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
if (node.nodeType !== xmldom_1.Node.ELEMENT_NODE) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
const element = node;
|
|
156
|
+
const tagName = element.tagName.toLowerCase();
|
|
157
|
+
switch (true) {
|
|
158
|
+
case tagName === 'br':
|
|
159
|
+
this.appendBreak(block, inline);
|
|
160
|
+
return;
|
|
161
|
+
case tagName === 'ul' || tagName === 'ol':
|
|
162
|
+
// A list interrupts its parent paragraph: <li>text<ul>… must not merge
|
|
163
|
+
this.flush();
|
|
164
|
+
this.walkChildren(element, this.pushList(element, block, tagName), inline);
|
|
165
|
+
return;
|
|
166
|
+
case tagName === 'li':
|
|
167
|
+
case BLOCK_TAGS.includes(tagName):
|
|
168
|
+
this.walkBlock(element, tagName, block, inline);
|
|
169
|
+
return;
|
|
170
|
+
case INLINE_TAGS.includes(tagName):
|
|
171
|
+
this.walkChildren(element, block, this.inlineStyleFor(element, tagName, inline));
|
|
172
|
+
return;
|
|
173
|
+
default:
|
|
174
|
+
// Unknown/structural elements (table, span-like customs, …): keep their
|
|
175
|
+
// text instead of dropping it
|
|
176
|
+
this.walkChildren(element, block, inline);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* A block element (incl. `<li>`) opens exactly one paragraph. If its children
|
|
181
|
+
* turn out to be blocks themselves, *they* become the paragraphs and this one
|
|
182
|
+
* stays empty - the innermost block wins, ancestors only contribute
|
|
183
|
+
* properties. Only a block that emitted nothing at all may end up as a
|
|
184
|
+
* deliberate blank line.
|
|
185
|
+
*/
|
|
186
|
+
walkBlock(element, tagName, block, inline) {
|
|
187
|
+
// A block starts a paragraph of its own - whatever text was collected
|
|
188
|
+
// before it (loose text, a preceding inline run) ends here
|
|
189
|
+
this.flush();
|
|
190
|
+
const blockContext = this.blockContextFor(element, tagName, block);
|
|
191
|
+
const paragraphsBefore = this.paragraphs.length;
|
|
192
|
+
this.openParagraph(blockContext);
|
|
193
|
+
this.walkChildren(element, blockContext, inline);
|
|
194
|
+
const emittedNothing = this.paragraphs.length === paragraphsBefore;
|
|
195
|
+
this.flush(PRESERVE_EMPTY_TAGS.includes(tagName) && emittedNothing);
|
|
196
|
+
}
|
|
197
|
+
walkChildren(element, block, inline) {
|
|
198
|
+
Array.from(element.childNodes).forEach((child) => this.walk(child, block, inline));
|
|
199
|
+
}
|
|
200
|
+
/** Push one list level, taking the list type from the tag. */
|
|
201
|
+
pushList(element, block, tagName) {
|
|
202
|
+
const withCss = this.applyElementCss(element, block);
|
|
203
|
+
return Object.assign(Object.assign({}, withCss), { listTypes: [...withCss.listTypes, tagName],
|
|
204
|
+
// A new top-level list gets its own identity; nested lists inherit it
|
|
205
|
+
listRoot: withCss.listTypes.length === 0 ? ++this.listCounter : withCss.listRoot });
|
|
206
|
+
}
|
|
207
|
+
/** Block context of a non-list block element, incl. heading/pre styling. */
|
|
208
|
+
blockContextFor(element, tagName, block) {
|
|
209
|
+
const context = this.applyElementCss(element, block);
|
|
210
|
+
const blockStyle = Object.assign({}, context.blockStyle);
|
|
211
|
+
if (HEADING_SIZES[tagName]) {
|
|
212
|
+
blockStyle.size = HEADING_SIZES[tagName];
|
|
213
|
+
blockStyle.isBold = true;
|
|
214
|
+
}
|
|
215
|
+
if (tagName === 'pre') {
|
|
216
|
+
blockStyle.fontFamily = MONOSPACE_FONT;
|
|
217
|
+
}
|
|
218
|
+
return Object.assign(Object.assign({}, context), { blockStyle, margin: context.margin || MARGIN_TAGS.includes(tagName) });
|
|
219
|
+
}
|
|
220
|
+
/** Merge an element's inline CSS into the block context (alignment, style). */
|
|
221
|
+
applyElementCss(element, block) {
|
|
222
|
+
const css = (0, css_style_parser_1.parseInlineCss)(element.getAttribute('style') || '');
|
|
223
|
+
if (Object.keys(css).length === 0) {
|
|
224
|
+
return block;
|
|
225
|
+
}
|
|
226
|
+
const alignment = css['text-align']
|
|
227
|
+
? (0, css_style_parser_1.parseCssTextAlign)(css['text-align'])
|
|
228
|
+
: undefined;
|
|
229
|
+
return Object.assign(Object.assign({}, block), { alignment: alignment !== null && alignment !== void 0 ? alignment : block.alignment, blockStyle: this.cssToTextStyle(css, block.blockStyle) });
|
|
230
|
+
}
|
|
231
|
+
/** Character properties contributed by one inline element. */
|
|
232
|
+
inlineStyleFor(element, tagName, inline) {
|
|
233
|
+
const style = Object.assign({}, inline);
|
|
234
|
+
switch (tagName) {
|
|
235
|
+
case 'strong':
|
|
236
|
+
case 'b':
|
|
237
|
+
style.isBold = true;
|
|
238
|
+
break;
|
|
239
|
+
case 'em':
|
|
240
|
+
case 'i':
|
|
241
|
+
case 'cite':
|
|
242
|
+
case 'var':
|
|
243
|
+
style.isItalics = true;
|
|
244
|
+
break;
|
|
245
|
+
case 'u':
|
|
246
|
+
case 'ins':
|
|
247
|
+
style.isUnderlined = true;
|
|
248
|
+
break;
|
|
249
|
+
case 's':
|
|
250
|
+
case 'strike':
|
|
251
|
+
case 'del':
|
|
252
|
+
style.isStrike = true;
|
|
253
|
+
break;
|
|
254
|
+
case 'sub':
|
|
255
|
+
style.isSubscript = true;
|
|
256
|
+
break;
|
|
257
|
+
case 'sup':
|
|
258
|
+
style.isSuperscript = true;
|
|
259
|
+
break;
|
|
260
|
+
case 'code':
|
|
261
|
+
case 'kbd':
|
|
262
|
+
case 'samp':
|
|
263
|
+
case 'tt':
|
|
264
|
+
style.fontFamily = MONOSPACE_FONT;
|
|
265
|
+
break;
|
|
266
|
+
case 'mark':
|
|
267
|
+
style.highlight = { type: 'srgbClr', value: 'FFFF00' };
|
|
268
|
+
break;
|
|
269
|
+
case 'a':
|
|
270
|
+
this.applyHyperlink(element, style);
|
|
271
|
+
break;
|
|
272
|
+
case 'font':
|
|
273
|
+
this.applyFontAttributes(element, style);
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
return this.cssToTextStyle((0, css_style_parser_1.parseInlineCss)(element.getAttribute('style') || ''), style);
|
|
277
|
+
}
|
|
278
|
+
/** Map the supported CSS subset onto TextStyle. */
|
|
279
|
+
cssToTextStyle(css, base) {
|
|
280
|
+
var _a, _b;
|
|
281
|
+
if (Object.keys(css).length === 0) {
|
|
282
|
+
return base;
|
|
283
|
+
}
|
|
284
|
+
const style = Object.assign({}, base);
|
|
285
|
+
const size = css['font-size']
|
|
286
|
+
? (0, css_style_parser_1.parseCssFontSize)(css['font-size'])
|
|
287
|
+
: undefined;
|
|
288
|
+
if (size !== undefined) {
|
|
289
|
+
style.size = size;
|
|
290
|
+
}
|
|
291
|
+
const color = css['color'] ? (0, css_style_parser_1.normalizeCssColor)(css['color']) : undefined;
|
|
292
|
+
if (color) {
|
|
293
|
+
style.color = { type: 'srgbClr', value: color };
|
|
294
|
+
}
|
|
295
|
+
const highlight = css['background-color']
|
|
296
|
+
? (0, css_style_parser_1.normalizeCssColor)(css['background-color'])
|
|
297
|
+
: undefined;
|
|
298
|
+
if (highlight) {
|
|
299
|
+
style.highlight = { type: 'srgbClr', value: highlight };
|
|
300
|
+
}
|
|
301
|
+
const isBold = css['font-weight']
|
|
302
|
+
? (0, css_style_parser_1.parseCssFontWeight)(css['font-weight'])
|
|
303
|
+
: undefined;
|
|
304
|
+
if (isBold !== undefined) {
|
|
305
|
+
style.isBold = isBold;
|
|
306
|
+
}
|
|
307
|
+
const isItalics = css['font-style']
|
|
308
|
+
? (0, css_style_parser_1.parseCssFontStyle)(css['font-style'])
|
|
309
|
+
: undefined;
|
|
310
|
+
if (isItalics !== undefined) {
|
|
311
|
+
style.isItalics = isItalics;
|
|
312
|
+
}
|
|
313
|
+
const decoration = (_b = (_a = css['text-decoration']) !== null && _a !== void 0 ? _a : css['text-decoration-line']) !== null && _b !== void 0 ? _b : undefined;
|
|
314
|
+
if (decoration !== undefined) {
|
|
315
|
+
const { isUnderlined, isStrike } = (0, css_style_parser_1.parseCssTextDecoration)(decoration);
|
|
316
|
+
if (isUnderlined !== undefined) {
|
|
317
|
+
style.isUnderlined = isUnderlined;
|
|
318
|
+
}
|
|
319
|
+
if (isStrike !== undefined) {
|
|
320
|
+
style.isStrike = isStrike;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
const fontFamily = css['font-family']
|
|
324
|
+
? (0, css_style_parser_1.parseCssFontFamily)(css['font-family'])
|
|
325
|
+
: undefined;
|
|
326
|
+
if (fontFamily) {
|
|
327
|
+
style.fontFamily = fontFamily;
|
|
328
|
+
}
|
|
329
|
+
return style;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* `<a href>`: a purely numeric href is treated as an internal slide number,
|
|
333
|
+
* anything else as an external target.
|
|
334
|
+
*/
|
|
335
|
+
applyHyperlink(element, style) {
|
|
336
|
+
const href = element.getAttribute('href');
|
|
337
|
+
if (!href)
|
|
338
|
+
return;
|
|
339
|
+
if (/^\d+$/.test(href.trim())) {
|
|
340
|
+
style.hyperlink = {
|
|
341
|
+
target: parseInt(href, 10),
|
|
342
|
+
isInternal: true,
|
|
343
|
+
};
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
style.hyperlink = {
|
|
347
|
+
target: href,
|
|
348
|
+
isInternal: false,
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
/** Legacy `<font color size face>` - still emitted by some editors. */
|
|
352
|
+
applyFontAttributes(element, style) {
|
|
353
|
+
const color = element.getAttribute('color');
|
|
354
|
+
if (color) {
|
|
355
|
+
const normalized = (0, css_style_parser_1.normalizeCssColor)(color);
|
|
356
|
+
if (normalized) {
|
|
357
|
+
style.color = { type: 'srgbClr', value: normalized };
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
const face = element.getAttribute('face');
|
|
361
|
+
if (face) {
|
|
362
|
+
const fontFamily = (0, css_style_parser_1.parseCssFontFamily)(face);
|
|
363
|
+
if (fontFamily) {
|
|
364
|
+
style.fontFamily = fontFamily;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Append text to the open paragraph, applying CSS whitespace collapsing:
|
|
370
|
+
* runs of whitespace become a single space, and a space is dropped at the
|
|
371
|
+
* start of a paragraph. ` ` (U+00A0) is not whitespace and survives.
|
|
372
|
+
*/
|
|
373
|
+
appendText(text, block, inline) {
|
|
374
|
+
const collapsed = text.replace(/[ \t\r\n\f]+/g, ' ');
|
|
375
|
+
if (collapsed === '') {
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
// Whitespace between block elements is layout, not content
|
|
379
|
+
if (collapsed === ' ' && !this.open) {
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
this.openParagraph(block);
|
|
383
|
+
const isParagraphStart = this.open.runs.length === 0;
|
|
384
|
+
const text_ = isParagraphStart ? collapsed.replace(/^ /, '') : collapsed;
|
|
385
|
+
if (text_ === '') {
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
this.open.runs.push({ text: text_, style: this.runStyle(block, inline) });
|
|
389
|
+
}
|
|
390
|
+
appendBreak(block, inline) {
|
|
391
|
+
this.openParagraph(block);
|
|
392
|
+
this.open.runs.push({ break: true, style: this.runStyle(block, inline) });
|
|
393
|
+
}
|
|
394
|
+
/** Block styling is the base, inline styling wins. */
|
|
395
|
+
runStyle(block, inline) {
|
|
396
|
+
return Object.assign(Object.assign({}, block.blockStyle), inline);
|
|
397
|
+
}
|
|
398
|
+
openParagraph(block) {
|
|
399
|
+
if (this.open) {
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
this.open = { block, runs: [] };
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Close the open paragraph and project its block context onto the flat PPTX
|
|
406
|
+
* paragraph properties.
|
|
407
|
+
*
|
|
408
|
+
* @param allowEmpty - Emit the paragraph even without runs (blank line)
|
|
409
|
+
*/
|
|
410
|
+
flush(allowEmpty = false) {
|
|
411
|
+
var _a;
|
|
412
|
+
if (!this.open) {
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
const { block, runs } = this.open;
|
|
416
|
+
this.open = undefined;
|
|
417
|
+
this.trimTrailingWhitespace(runs);
|
|
418
|
+
// A <br> right before the block's end has no visible effect in HTML (the
|
|
419
|
+
// empty last line gets no line box) - drop exactly one, so a deliberate
|
|
420
|
+
// <br><br> still keeps its one empty line
|
|
421
|
+
if ((_a = runs[runs.length - 1]) === null || _a === void 0 ? void 0 : _a.break) {
|
|
422
|
+
runs.pop();
|
|
423
|
+
this.trimTrailingWhitespace(runs);
|
|
424
|
+
}
|
|
425
|
+
if (runs.length === 0) {
|
|
426
|
+
if (!allowEmpty) {
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
runs.push({ text: '' });
|
|
430
|
+
}
|
|
431
|
+
const listDepth = block.listTypes.length;
|
|
432
|
+
const listType = block.listTypes[listDepth - 1];
|
|
433
|
+
// PPTX `lvl` is 0-based: the outermost list level is 0, like a plain
|
|
434
|
+
// paragraph - the bullet, not the level, is what sets a list item apart
|
|
435
|
+
const level = listDepth > 0 ? Math.min(listDepth - 1, 8) : 0;
|
|
436
|
+
this.paragraphs.push({
|
|
437
|
+
paragraph: Object.assign(Object.assign({ level, bullet: listDepth > 0 }, (listType === 'ol'
|
|
438
|
+
? {
|
|
439
|
+
bulletType: 'number',
|
|
440
|
+
autoNumberType: AUTO_NUMBER_TYPES[level % AUTO_NUMBER_TYPES.length],
|
|
441
|
+
}
|
|
442
|
+
: {})), (block.alignment ? { alignment: block.alignment } : {})),
|
|
443
|
+
textRuns: runs,
|
|
444
|
+
});
|
|
445
|
+
this.blockMeta.push({ margin: !!block.margin, listRoot: block.listRoot });
|
|
446
|
+
}
|
|
447
|
+
/** Trailing collapsed whitespace is layout, not content. */
|
|
448
|
+
trimTrailingWhitespace(runs) {
|
|
449
|
+
for (let i = runs.length - 1; i >= 0; i--) {
|
|
450
|
+
const run = runs[i];
|
|
451
|
+
if (run.text === undefined) {
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
run.text = run.text.replace(/ +$/, '');
|
|
455
|
+
if (run.text !== '') {
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
runs.pop();
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Project the browser's default vertical margins onto `spaceBefore`.
|
|
463
|
+
*
|
|
464
|
+
* Items of the same list sit tight (nested lists carry no margin in the
|
|
465
|
+
* default stylesheet); every other boundary touching a margin-bearing block
|
|
466
|
+
* or a list edge - including the edge between two adjacent lists - gets one
|
|
467
|
+
* collapsed gap, carried by the later paragraph. The first paragraph gets
|
|
468
|
+
* none: there is no margin against the text frame.
|
|
469
|
+
*/
|
|
470
|
+
applyBlockMargins() {
|
|
471
|
+
this.paragraphs.forEach((paragraph, index) => {
|
|
472
|
+
if (index === 0) {
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
const previous = this.blockMeta[index - 1];
|
|
476
|
+
const current = this.blockMeta[index];
|
|
477
|
+
const sameList = current.listRoot !== undefined &&
|
|
478
|
+
current.listRoot === previous.listRoot;
|
|
479
|
+
const touchesMargin = previous.margin ||
|
|
480
|
+
current.margin ||
|
|
481
|
+
previous.listRoot !== undefined ||
|
|
482
|
+
current.listRoot !== undefined;
|
|
483
|
+
if (!sameList && touchesMargin) {
|
|
484
|
+
paragraph.paragraph.spaceBefore = { percent: BLOCK_MARGIN_PERCENT };
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
exports.HtmlToMultiTextHelper = HtmlToMultiTextHelper;
|
|
490
|
+
//# sourceMappingURL=html-to-multitext-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-to-multitext-helper.js","sourceRoot":"","sources":["../../src/helper/html-to-multitext-helper.ts"],"names":[],"mappings":";;;AAMA,2CAAiD;AAEjD,qCAA+B;AAC/B,yDAS4B;AA+B5B;;;;GAIG;AACH,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAE5E,kEAAkE;AAClE,MAAM,WAAW,GAAG;IAClB,G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C,CAAC;IACL,CAAC;CACF;AA3fD,sDA2fC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { XmlElement } from '../types/xml-types';
|
|
2
|
+
import IArchive from '../interfaces/iarchive';
|
|
3
|
+
import { Target } from '../types/types';
|
|
4
|
+
/**
|
|
5
|
+
* Hyperlink processing utilities
|
|
6
|
+
*/
|
|
7
|
+
export declare class HyperlinkProcessor {
|
|
8
|
+
private static readonly HYPERLINK_TAG;
|
|
9
|
+
private static readonly RELATIONSHIP_ATTRIBUTE;
|
|
10
|
+
private static readonly HYPERLINK_REL_TYPES;
|
|
11
|
+
static isHyperlinkRelType(relType: string): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Finds all hyperlink elements within a given element
|
|
14
|
+
*/
|
|
15
|
+
static findHyperlinks(element: XmlElement): XmlElement[];
|
|
16
|
+
/**
|
|
17
|
+
* Checks if an element contains hyperlinks
|
|
18
|
+
*/
|
|
19
|
+
static hasHyperlinks(element: XmlElement): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Checks if an element contains multiple hyperlinks
|
|
22
|
+
*/
|
|
23
|
+
static hasMultipleHyperlinks(element: XmlElement): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Determines if an element should be processed as a hyperlink element
|
|
26
|
+
* @param element - Element to analyze
|
|
27
|
+
* @returns True if element should be processed as hyperlink
|
|
28
|
+
*/
|
|
29
|
+
static shouldProcessAsHyperlink(element: XmlElement): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Gets the primary hyperlink target from an element
|
|
32
|
+
* @param element - Element to analyze
|
|
33
|
+
* @returns Target information or null if no hyperlink found
|
|
34
|
+
*/
|
|
35
|
+
static getPrimaryHyperlinkTarget(element: XmlElement): Target | null;
|
|
36
|
+
/**
|
|
37
|
+
* Extracts hyperlink relationship IDs from an element
|
|
38
|
+
* @param element - The XML element to extract from
|
|
39
|
+
* @returns Array of relationship IDs
|
|
40
|
+
*/
|
|
41
|
+
static extractHyperlinkRelationshipIds(element: XmlElement): string[];
|
|
42
|
+
/**
|
|
43
|
+
* Updates hyperlink relationship IDs in an element
|
|
44
|
+
*/
|
|
45
|
+
static updateHyperlinkRelationshipIds(element: XmlElement, relationshipMap: Map<string, string>): void;
|
|
46
|
+
/**
|
|
47
|
+
* Processes hyperlinks for single-hyperlink elements
|
|
48
|
+
*/
|
|
49
|
+
static processSingleHyperlink(element: XmlElement, newRid: string): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Copies multiple hyperlinks from source to target slide
|
|
52
|
+
*/
|
|
53
|
+
static copyMultipleHyperlinks(element: XmlElement, sourceArchive: IArchive, sourceSlideNumber: number, targetArchive: IArchive, targetSlideRelFile: string, sourceElement?: XmlElement): Promise<void>;
|
|
54
|
+
}
|