abstract-document 6.16.1 → 6.17.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/CHANGELOG.md +5 -0
- package/lib/abstract-document/primitives/font.d.ts +9 -1
- package/lib/abstract-document/primitives/font.d.ts.map +1 -1
- package/lib/abstract-document/primitives/font.js +6 -2
- package/lib/abstract-document/primitives/font.js.map +1 -1
- package/lib/abstract-document/styles/text-style.d.ts +9 -0
- package/lib/abstract-document/styles/text-style.d.ts.map +1 -1
- package/lib/abstract-document/styles/text-style.js +23 -18
- package/lib/abstract-document/styles/text-style.js.map +1 -1
- package/lib/abstract-document-exporters/docx2/render.js +4 -4
- package/lib/abstract-document-exporters/docx2/render.js.map +1 -1
- package/lib/abstract-document-exporters/pdf/font.d.ts +2 -1
- package/lib/abstract-document-exporters/pdf/font.d.ts.map +1 -1
- package/lib/abstract-document-exporters/pdf/font.js +49 -6
- package/lib/abstract-document-exporters/pdf/font.js.map +1 -1
- package/lib/abstract-document-exporters/pdf/render-image.js +1 -1
- package/lib/abstract-document-exporters/pdf/render-image.js.map +1 -1
- package/lib/abstract-document-exporters/pdf/render.d.ts +0 -1
- package/lib/abstract-document-exporters/pdf/render.d.ts.map +1 -1
- package/lib/abstract-document-exporters/pdf/render.js +2 -20
- package/lib/abstract-document-exporters/pdf/render.js.map +1 -1
- package/package.json +3 -4
- package/src/abstract-document/primitives/font.ts +18 -2
- package/src/abstract-document/styles/text-style.ts +33 -2
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Group.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Header and footer.docx and b/package/src/abstract-document-exporters/__tests__/docx2/tmp/Header → footer.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Mixed hyperlink and textrun.docx and b/package/src/abstract-document-exporters/__tests__/docx2/tmp/Mixed hyperlink → textrun.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Mixed textrun and images.docx and b/package/src/abstract-document-exporters/__tests__/docx2/tmp/Mixed textrun → images.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple images.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple tables.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with Center alignment.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with End alignment.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with Start alignment that linebreaks.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with Start alignment.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Page numbering.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Simple table colSpan and rowSpan.docx and b/package/src/abstract-document-exporters/__tests__/docx2/tmp/Simple table colSpan → rowSpan.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Simple table without rows.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Simple table.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single hyperlink.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single image.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Center alignment that linebreaks.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Center alignment.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with End alignment that linebreaks.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with End alignment.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Start alignment that linebreaks.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Start alignment.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/hello with Arial font.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/hello.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/letter-dimensions.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/page-orientation-landscape.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/page-orientation-portrait.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/tocSeparator.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/world.docx +0 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position group.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position header and footer.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position paragraph.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position section in group.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position section in table.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position table.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Group Paragraphs.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Group Tables.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Group no keeptogether.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Group too big for one page.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Header and footer.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Hyperlink internal linktarget.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Hyperlink internal.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Manual line break.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Manual line breaks empty lines.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Margins header body footer.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed hyperlink and textrun no underline.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed hyperlink and textrun with underline.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed hyperlink and textrun.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed textrun and images.pdf and b/package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed textrun → images.pdf +0 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple images overflow.pdf +0 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple images.pdf +0 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with Center alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with End alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with Start alignment that linebreaks.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with Start alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Page numbering.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table row that doesnt fit page.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table single row.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with group.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with header 2.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with header.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with margin bottom.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with margin top single table.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with margin top.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with rowSpan multipages.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with rowSpan.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table all auto.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table all fix.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table background.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table cell padding of image.pdf +0 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table cell padding of text.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table center alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table colSpan and rowSpan.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table minimal row height.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table mix auto fix.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table padding.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table right alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table row alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table text alignment in cell with wrapping.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table text alignment in cell.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table with default colored borders.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table with header.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table with multi colored borders.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table with single colored borders.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single date.pdf +14 -14
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single figure.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single hyperlink centered.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single hyperlink no underline.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single hyperlink right aligned.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single hyperlink.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image from URL.pdf +0 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg color hex.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg color name.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg color url.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg dasharray.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image.pdf +0 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline alphabetic.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline bottom.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline hanging.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline middle.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline top.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Center alignment that linebreaks.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Center alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with End alignment that linebreaks.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with End alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Justify alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Start alignment that linebreaks.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Start alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with super and subscripts.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Table of content separator.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/hello with roman font.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/hello.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/pagebreak.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/world.pdf +2 -2
- package/src/abstract-document-exporters/docx2/render.ts +4 -4
- package/src/abstract-document-exporters/pdf/font.ts +47 -8
- package/src/abstract-document-exporters/pdf/render-image.ts +1 -6
- package/src/abstract-document-exporters/pdf/render.ts +0 -18
- package/lib/abstract-document-xml/__tests__/layer/export-test-def.d.ts +0 -13
- package/lib/abstract-document-xml/__tests__/layer/export-test-def.d.ts.map +0 -1
- package/lib/abstract-document-xml/__tests__/layer/export-test-def.js +0 -3
- package/lib/abstract-document-xml/__tests__/layer/export-test-def.js.map +0 -1
- package/lib/abstract-document-xml/__tests__/layer/export.test.d.ts +0 -3
- package/lib/abstract-document-xml/__tests__/layer/export.test.d.ts.map +0 -1
- package/lib/abstract-document-xml/__tests__/layer/export.test.js +0 -41
- package/lib/abstract-document-xml/__tests__/layer/export.test.js.map +0 -1
- package/lib/abstract-document-xml/__tests__/layer/test-defs/simple-document.d.ts +0 -3
- package/lib/abstract-document-xml/__tests__/layer/test-defs/simple-document.d.ts.map +0 -1
- package/lib/abstract-document-xml/__tests__/layer/test-defs/simple-document.js +0 -361
- package/lib/abstract-document-xml/__tests__/layer/test-defs/simple-document.js.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as AD from "../../abstract-document/index";
|
|
2
|
+
import { TextFontWeight } from "../../abstract-document/styles/text-style";
|
|
2
3
|
import { getResources } from "../shared/get_resources";
|
|
3
4
|
|
|
4
5
|
export function registerFonts(
|
|
@@ -9,38 +10,64 @@ export function registerFonts(
|
|
|
9
10
|
if (resources.fonts) {
|
|
10
11
|
for (const fontName of Object.keys(resources.fonts)) {
|
|
11
12
|
const font = resources.fonts[fontName];
|
|
13
|
+
registerFont(fontName + "-Light", font.light || font.normal);
|
|
12
14
|
registerFont(fontName, font.normal);
|
|
13
15
|
registerFont(fontName + "-Medium", font.medium || font.normal);
|
|
14
16
|
registerFont(fontName + "-Bold", font.bold);
|
|
17
|
+
registerFont(fontName + "-ExtraBold", font.extraBold || font.bold);
|
|
18
|
+
registerFont(fontName + "-LightOblique", font.lightItalic || font.normal);
|
|
19
|
+
registerFont(fontName + "-LightItalic", font.lightItalic || font.normal);
|
|
15
20
|
registerFont(fontName + "-Oblique", font.italic);
|
|
16
21
|
registerFont(fontName + "-Italic", font.italic);
|
|
17
22
|
registerFont(fontName + "-BoldOblique", font.boldItalic);
|
|
18
23
|
registerFont(fontName + "-BoldItalic", font.boldItalic);
|
|
19
24
|
registerFont(fontName + "-MediumOblique", font.mediumItalic || font.italic);
|
|
20
25
|
registerFont(fontName + "-MediumItalic", font.mediumItalic || font.italic);
|
|
26
|
+
registerFont(fontName + "-ExtraBoldItalic", font.extraBoldItalic || font.boldItalic);
|
|
27
|
+
registerFont(fontName + "-ExtraBoldOblique", font.extraBoldItalic || font.boldItalic);
|
|
21
28
|
}
|
|
22
29
|
}
|
|
23
30
|
}
|
|
24
31
|
|
|
25
32
|
export function getFontNameStyle(textStyle: AD.TextStyle.TextStyle): string {
|
|
26
|
-
|
|
33
|
+
const fontWeight = textStyle.fontWeight
|
|
34
|
+
? textStyle.fontWeight
|
|
35
|
+
: textStyle.light
|
|
36
|
+
? "light"
|
|
37
|
+
: textStyle.normal
|
|
38
|
+
? "normal"
|
|
39
|
+
: textStyle.bold
|
|
40
|
+
? "bold"
|
|
41
|
+
: textStyle.mediumBold
|
|
42
|
+
? "mediumBold"
|
|
43
|
+
: textStyle.extraBold
|
|
44
|
+
? "extraBold"
|
|
45
|
+
: "normal";
|
|
46
|
+
return getFontName(textStyle.fontFamily, fontWeight, textStyle.italic);
|
|
27
47
|
}
|
|
28
48
|
|
|
29
49
|
export function getFontName(
|
|
30
50
|
fontFamily: string | undefined,
|
|
31
|
-
|
|
32
|
-
italic: boolean | undefined
|
|
33
|
-
mediumBold: boolean | undefined
|
|
51
|
+
fontWeight: TextFontWeight,
|
|
52
|
+
italic: boolean | undefined
|
|
34
53
|
): string {
|
|
35
54
|
const name = fontFamily || "Helvetica";
|
|
36
|
-
if (
|
|
55
|
+
if (fontWeight === "light" && italic) {
|
|
56
|
+
return name + "-LightOblique";
|
|
57
|
+
} else if (fontWeight === "bold" && italic) {
|
|
37
58
|
return name + "-BoldOblique";
|
|
38
|
-
} else if (mediumBold && italic) {
|
|
59
|
+
} else if (fontWeight === "mediumBold" && italic) {
|
|
39
60
|
return name + "-MediumOblique";
|
|
40
|
-
} else if (
|
|
61
|
+
} else if (fontWeight === "extraBold" && italic) {
|
|
62
|
+
return name + "-ExtraBoldOblique";
|
|
63
|
+
} else if (fontWeight === "light") {
|
|
64
|
+
return name + "-Light";
|
|
65
|
+
} else if (fontWeight === "bold") {
|
|
41
66
|
return name + "-Bold";
|
|
42
|
-
} else if (mediumBold) {
|
|
67
|
+
} else if (fontWeight === "mediumBold") {
|
|
43
68
|
return name + "-Medium";
|
|
69
|
+
} else if (fontWeight === "extraBold") {
|
|
70
|
+
return name + "-ExtraBold";
|
|
44
71
|
} else if (italic) {
|
|
45
72
|
return name + "-Oblique";
|
|
46
73
|
} else {
|
|
@@ -52,6 +79,9 @@ export function isFontAvailable(fontName: string, resources: AD.Resources.Resour
|
|
|
52
79
|
if (resources.fonts) {
|
|
53
80
|
for (const name of Object.keys(resources.fonts)) {
|
|
54
81
|
const font = resources.fonts[name];
|
|
82
|
+
if (font.light && fontName === `${name}-Light`) {
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
55
85
|
if (font.normal && fontName === name) {
|
|
56
86
|
return true;
|
|
57
87
|
}
|
|
@@ -61,6 +91,12 @@ export function isFontAvailable(fontName: string, resources: AD.Resources.Resour
|
|
|
61
91
|
if (font.bold && fontName === `${name}-Bold`) {
|
|
62
92
|
return true;
|
|
63
93
|
}
|
|
94
|
+
if (font.extraBold && fontName === `${name}-ExtraBold`) {
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
if (font.lightItalic && (fontName === `${name}-LightOblique` || fontName === `${name}-LightItalic`)) {
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
64
100
|
if (font.italic && (fontName === `${name}-Oblique` || fontName === `${name}-Italic`)) {
|
|
65
101
|
return true;
|
|
66
102
|
}
|
|
@@ -70,6 +106,9 @@ export function isFontAvailable(fontName: string, resources: AD.Resources.Resour
|
|
|
70
106
|
if (font.mediumItalic && (fontName === `${name}-MediumOblique` || fontName === `${name}-MediumItalic`)) {
|
|
71
107
|
return true;
|
|
72
108
|
}
|
|
109
|
+
if (font.extraBoldItalic && (fontName === `${name}-ExtraBoldOblique` || fontName === `${name}-ExtraBoldItalic`)) {
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
73
112
|
}
|
|
74
113
|
}
|
|
75
114
|
return false;
|
|
@@ -141,12 +141,7 @@ function abstractComponentToPdf(
|
|
|
141
141
|
.stroke(colorToRgb(component.strokeColor));
|
|
142
142
|
break;
|
|
143
143
|
case "text":
|
|
144
|
-
const font = getFontName(
|
|
145
|
-
component.fontFamily,
|
|
146
|
-
component.fontWeight === "bold",
|
|
147
|
-
component.italic,
|
|
148
|
-
component.fontWeight === "mediumBold"
|
|
149
|
-
);
|
|
144
|
+
const font = getFontName(component.fontFamily, component.fontWeight, component.italic);
|
|
150
145
|
if (component.clockwiseRotationDegrees !== 0) {
|
|
151
146
|
pdf.save();
|
|
152
147
|
pdf.rotate(component.clockwiseRotationDegrees, {
|
|
@@ -3,7 +3,6 @@ import { preProcess } from "./pre-process";
|
|
|
3
3
|
import { measure, measurePages } from "./measure";
|
|
4
4
|
import { paginate, Page } from "./paginate";
|
|
5
5
|
import { updatePageRefs } from "./update-refs";
|
|
6
|
-
import BlobStream from "blob-stream";
|
|
7
6
|
import { renderImage } from "./render-image";
|
|
8
7
|
import { registerFonts, getFontNameStyle } from "./font";
|
|
9
8
|
|
|
@@ -11,28 +10,11 @@ export type PdfExportOptions = {
|
|
|
11
10
|
compress: boolean;
|
|
12
11
|
};
|
|
13
12
|
|
|
14
|
-
// Remove??
|
|
15
13
|
export function exportToHTML5Blob(
|
|
16
14
|
// tslint:disable-next-line:no-any
|
|
17
15
|
pdfKit: any,
|
|
18
16
|
doc: AD.AbstractDoc.AbstractDoc,
|
|
19
17
|
options: PdfExportOptions = { compress: false }
|
|
20
|
-
): Promise<Blob> {
|
|
21
|
-
return new Promise((resolve) => {
|
|
22
|
-
const stream = BlobStream();
|
|
23
|
-
exportToStream(pdfKit, stream, doc, options);
|
|
24
|
-
stream.on("finish", () => {
|
|
25
|
-
const blob = stream.toBlob("application/pdf");
|
|
26
|
-
resolve(blob);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function exportToHTML5BlobWithoutStream(
|
|
32
|
-
// tslint:disable-next-line:no-any
|
|
33
|
-
pdfKit: any,
|
|
34
|
-
doc: AD.AbstractDoc.AbstractDoc,
|
|
35
|
-
options: PdfExportOptions = { compress: false }
|
|
36
18
|
): Promise<Blob> {
|
|
37
19
|
return new Promise((resolve) => {
|
|
38
20
|
let pdf = createDocument(pdfKit, options, doc);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Defines a data-type that represents a single test.
|
|
3
|
-
*/
|
|
4
|
-
export declare type ExportTestDef = {
|
|
5
|
-
readonly name: string;
|
|
6
|
-
readonly only?: boolean;
|
|
7
|
-
readonly skip?: boolean;
|
|
8
|
-
readonly abstractDocXML: string;
|
|
9
|
-
readonly images: {};
|
|
10
|
-
readonly fonts: {};
|
|
11
|
-
readonly expectedPdfJson: {};
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=export-test-def.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"export-test-def.d.ts","sourceRoot":"","sources":["../../../../src/abstract-document-xml/__tests__/layer/export-test-def.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,aAAa,GAAG;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;IACnB,QAAQ,CAAC,eAAe,EAAE,EAAE,CAAC;CAC9B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"export-test-def.js","sourceRoot":"","sources":["../../../../src/abstract-document-xml/__tests__/layer/export-test-def.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"export.test.d.ts","sourceRoot":"","sources":["../../../../src/abstract-document-xml/__tests__/layer/export.test.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAMlD,eAAO,MAAM,KAAK,0BAA+D,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.tests = void 0;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const test_utils_1 = require("@abstract-visuals/test-utils");
|
|
9
|
-
const parse_xml_1 = require("../../parse-xml");
|
|
10
|
-
const abstract_doc_of_xml_1 = require("../../abstract-doc-of-xml/abstract-doc-of-xml");
|
|
11
|
-
const creator_1 = require("../../abstract-doc-of-xml/creator");
|
|
12
|
-
exports.tests = (0, test_utils_1.loadTests)(path_1.default.join(__dirname, "test-defs/"));
|
|
13
|
-
describe("abstract-doc-xml", () => {
|
|
14
|
-
(0, test_utils_1.onlySkip)(exports.tests).forEach((item) => {
|
|
15
|
-
test(item.name, async () => {
|
|
16
|
-
const xml = (0, parse_xml_1.parseXml)(item.abstractDocXML, {
|
|
17
|
-
preserveOrder: true,
|
|
18
|
-
ignoreAttributes: false,
|
|
19
|
-
attributeNamePrefix: "",
|
|
20
|
-
allowBooleanAttributes: true,
|
|
21
|
-
trimValues: false,
|
|
22
|
-
ignoreDeclaration: true,
|
|
23
|
-
processEntities: true,
|
|
24
|
-
htmlEntities: true,
|
|
25
|
-
attributeValueProcessor: (_name, value) => {
|
|
26
|
-
if (!(value === null || value === void 0 ? void 0 : value.trim())) {
|
|
27
|
-
return value;
|
|
28
|
-
}
|
|
29
|
-
const nValue = Number(value);
|
|
30
|
-
if (!Number.isNaN(nValue)) {
|
|
31
|
-
return nValue;
|
|
32
|
-
}
|
|
33
|
-
return value;
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
const doc = (0, abstract_doc_of_xml_1.abstractDocOfXml)((0, creator_1.creators)(item.images, item.fonts, (0, abstract_doc_of_xml_1.extractImageFontsStyleNames)(xml)[2]), xml[0]);
|
|
37
|
-
expect(JSON.stringify(doc, undefined, 2)).toEqual(item.expectedPdfJson);
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
//# sourceMappingURL=export.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"export.test.js","sourceRoot":"","sources":["../../../../src/abstract-document-xml/__tests__/layer/export.test.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,6DAAmE;AAEnE,+CAA2C;AAC3C,uF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AG,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC1E,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simple-document.d.ts","sourceRoot":"","sources":["../../../../../src/abstract-document-xml/__tests__/layer/test-defs/simple-document.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,eAAO,MAAM,IAAI,EAAE,aAoWlB,CAAC"}
|
|
@@ -1,361 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.test = void 0;
|
|
4
|
-
exports.test = {
|
|
5
|
-
name: "Simple document",
|
|
6
|
-
images: {},
|
|
7
|
-
fonts: {},
|
|
8
|
-
abstractDocXML: `<AbstractDoc>
|
|
9
|
-
<StyleNames>
|
|
10
|
-
<StyleName name="footerResultText" type="TextStyle" fontSize="8" color="#353535" bold="true"/>
|
|
11
|
-
<StyleName name="footerResultCell" type="TableCellStyle" padding="4 4 3 0" borders="1 0 0 0" borderColor="#123151" verticalAlignment="Bottom"/>
|
|
12
|
-
</StyleNames>
|
|
13
|
-
<Section>
|
|
14
|
-
<Table columnWidths="375,70,60">
|
|
15
|
-
<style margins="150 0 0 0"/>
|
|
16
|
-
<TableRow>
|
|
17
|
-
<TableCell styleName="footerResultCell"/>
|
|
18
|
-
<TextCell text="Cost €" styleNames="footerResultText, footerResultCell"/>
|
|
19
|
-
<TextCell text="Price €" styleNames="footerResultText, footerResultCell"/>
|
|
20
|
-
</TableRow>
|
|
21
|
-
</Table>
|
|
22
|
-
</Section>
|
|
23
|
-
</AbstractDoc>`,
|
|
24
|
-
expectedPdfJson: {
|
|
25
|
-
children: [
|
|
26
|
-
{
|
|
27
|
-
page: {
|
|
28
|
-
style: {
|
|
29
|
-
headerMargins: {
|
|
30
|
-
top: 0,
|
|
31
|
-
bottom: 0,
|
|
32
|
-
left: 0,
|
|
33
|
-
right: 0,
|
|
34
|
-
},
|
|
35
|
-
footerMargins: {
|
|
36
|
-
top: 0,
|
|
37
|
-
bottom: 0,
|
|
38
|
-
left: 0,
|
|
39
|
-
right: 0,
|
|
40
|
-
},
|
|
41
|
-
contentMargins: {
|
|
42
|
-
top: 0,
|
|
43
|
-
bottom: 0,
|
|
44
|
-
left: 0,
|
|
45
|
-
right: 0,
|
|
46
|
-
},
|
|
47
|
-
orientation: "Portrait",
|
|
48
|
-
paperSize: "A4",
|
|
49
|
-
noTopBottomMargin: false,
|
|
50
|
-
},
|
|
51
|
-
header: [],
|
|
52
|
-
footer: [],
|
|
53
|
-
},
|
|
54
|
-
id: "",
|
|
55
|
-
children: [
|
|
56
|
-
{
|
|
57
|
-
type: "Table",
|
|
58
|
-
columnWidths: [375, 70, 60],
|
|
59
|
-
styleName: "",
|
|
60
|
-
style: {
|
|
61
|
-
margins: {
|
|
62
|
-
top: 150,
|
|
63
|
-
right: 0,
|
|
64
|
-
bottom: 0,
|
|
65
|
-
left: 0,
|
|
66
|
-
},
|
|
67
|
-
type: "TableStyle",
|
|
68
|
-
},
|
|
69
|
-
headerRows: [],
|
|
70
|
-
children: [
|
|
71
|
-
{
|
|
72
|
-
children: [
|
|
73
|
-
{
|
|
74
|
-
styleName: "footerResultCell",
|
|
75
|
-
columnSpan: 1,
|
|
76
|
-
rowSpan: 1,
|
|
77
|
-
style: {
|
|
78
|
-
type: "TableCellStyle",
|
|
79
|
-
borders: {
|
|
80
|
-
top: 0,
|
|
81
|
-
bottom: 0,
|
|
82
|
-
left: 0,
|
|
83
|
-
right: 0,
|
|
84
|
-
},
|
|
85
|
-
borderColors: {
|
|
86
|
-
top: "",
|
|
87
|
-
bottom: "",
|
|
88
|
-
left: "",
|
|
89
|
-
right: "",
|
|
90
|
-
},
|
|
91
|
-
padding: {
|
|
92
|
-
top: 0,
|
|
93
|
-
bottom: 0,
|
|
94
|
-
left: 0,
|
|
95
|
-
right: 0,
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
dummy: false,
|
|
99
|
-
children: [],
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
styleName: "footerResultCell",
|
|
103
|
-
columnSpan: 1,
|
|
104
|
-
rowSpan: 1,
|
|
105
|
-
style: {
|
|
106
|
-
type: "TableCellStyle",
|
|
107
|
-
borders: {
|
|
108
|
-
top: 0,
|
|
109
|
-
bottom: 0,
|
|
110
|
-
left: 0,
|
|
111
|
-
right: 0,
|
|
112
|
-
},
|
|
113
|
-
borderColors: {
|
|
114
|
-
top: "",
|
|
115
|
-
bottom: "",
|
|
116
|
-
left: "",
|
|
117
|
-
right: "",
|
|
118
|
-
},
|
|
119
|
-
padding: {
|
|
120
|
-
top: 0,
|
|
121
|
-
bottom: 0,
|
|
122
|
-
left: 0,
|
|
123
|
-
right: 0,
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
dummy: false,
|
|
127
|
-
children: [
|
|
128
|
-
{
|
|
129
|
-
type: "Paragraph",
|
|
130
|
-
styleName: "",
|
|
131
|
-
style: {
|
|
132
|
-
type: "ParagraphStyle",
|
|
133
|
-
margins: {
|
|
134
|
-
top: 0,
|
|
135
|
-
bottom: 0,
|
|
136
|
-
left: 0,
|
|
137
|
-
right: 0,
|
|
138
|
-
},
|
|
139
|
-
position: "relative",
|
|
140
|
-
textStyle: {
|
|
141
|
-
type: "TextStyle",
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
children: [
|
|
145
|
-
{
|
|
146
|
-
type: "TextRun",
|
|
147
|
-
styleName: "footerResultText",
|
|
148
|
-
text: "Cost €",
|
|
149
|
-
style: {
|
|
150
|
-
type: "TextStyle",
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
],
|
|
154
|
-
},
|
|
155
|
-
],
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
styleName: "footerResultCell",
|
|
159
|
-
columnSpan: 1,
|
|
160
|
-
rowSpan: 1,
|
|
161
|
-
style: {
|
|
162
|
-
type: "TableCellStyle",
|
|
163
|
-
borders: {
|
|
164
|
-
top: 0,
|
|
165
|
-
bottom: 0,
|
|
166
|
-
left: 0,
|
|
167
|
-
right: 0,
|
|
168
|
-
},
|
|
169
|
-
borderColors: {
|
|
170
|
-
top: "",
|
|
171
|
-
bottom: "",
|
|
172
|
-
left: "",
|
|
173
|
-
right: "",
|
|
174
|
-
},
|
|
175
|
-
padding: {
|
|
176
|
-
top: 0,
|
|
177
|
-
bottom: 0,
|
|
178
|
-
left: 0,
|
|
179
|
-
right: 0,
|
|
180
|
-
},
|
|
181
|
-
},
|
|
182
|
-
dummy: false,
|
|
183
|
-
children: [
|
|
184
|
-
{
|
|
185
|
-
type: "Paragraph",
|
|
186
|
-
styleName: "",
|
|
187
|
-
style: {
|
|
188
|
-
type: "ParagraphStyle",
|
|
189
|
-
margins: {
|
|
190
|
-
top: 0,
|
|
191
|
-
bottom: 0,
|
|
192
|
-
left: 0,
|
|
193
|
-
right: 0,
|
|
194
|
-
},
|
|
195
|
-
position: "relative",
|
|
196
|
-
textStyle: {
|
|
197
|
-
type: "TextStyle",
|
|
198
|
-
},
|
|
199
|
-
},
|
|
200
|
-
children: [
|
|
201
|
-
{
|
|
202
|
-
type: "TextRun",
|
|
203
|
-
styleName: "footerResultText",
|
|
204
|
-
text: "Price €",
|
|
205
|
-
style: {
|
|
206
|
-
type: "TextStyle",
|
|
207
|
-
},
|
|
208
|
-
},
|
|
209
|
-
],
|
|
210
|
-
},
|
|
211
|
-
],
|
|
212
|
-
},
|
|
213
|
-
],
|
|
214
|
-
},
|
|
215
|
-
],
|
|
216
|
-
},
|
|
217
|
-
],
|
|
218
|
-
},
|
|
219
|
-
],
|
|
220
|
-
styles: {
|
|
221
|
-
TextStyle_footerResultText: {
|
|
222
|
-
name: "footerResultText",
|
|
223
|
-
type: "TextStyle",
|
|
224
|
-
fontSize: 8,
|
|
225
|
-
color: "#353535",
|
|
226
|
-
bold: "true",
|
|
227
|
-
style: {
|
|
228
|
-
type: "TextStyle",
|
|
229
|
-
},
|
|
230
|
-
},
|
|
231
|
-
TableCellStyle_footerResultCell: {
|
|
232
|
-
name: "footerResultCell",
|
|
233
|
-
type: "TableCellStyle",
|
|
234
|
-
padding: {
|
|
235
|
-
top: 4,
|
|
236
|
-
right: 4,
|
|
237
|
-
bottom: 3,
|
|
238
|
-
left: 0,
|
|
239
|
-
},
|
|
240
|
-
borders: {
|
|
241
|
-
top: 1,
|
|
242
|
-
right: 0,
|
|
243
|
-
bottom: 0,
|
|
244
|
-
left: 0,
|
|
245
|
-
},
|
|
246
|
-
borderColor: "#123151",
|
|
247
|
-
verticalAlignment: "Bottom",
|
|
248
|
-
},
|
|
249
|
-
ParagraphStyle_H1: {
|
|
250
|
-
type: "ParagraphStyle",
|
|
251
|
-
margins: {
|
|
252
|
-
top: 8,
|
|
253
|
-
bottom: 2,
|
|
254
|
-
left: 0,
|
|
255
|
-
right: 0,
|
|
256
|
-
},
|
|
257
|
-
position: "relative",
|
|
258
|
-
textStyle: {
|
|
259
|
-
type: "TextStyle",
|
|
260
|
-
bold: true,
|
|
261
|
-
fontSize: 32,
|
|
262
|
-
},
|
|
263
|
-
},
|
|
264
|
-
ParagraphStyle_H2: {
|
|
265
|
-
type: "ParagraphStyle",
|
|
266
|
-
margins: {
|
|
267
|
-
top: 6,
|
|
268
|
-
bottom: 1.5,
|
|
269
|
-
left: 0,
|
|
270
|
-
right: 0,
|
|
271
|
-
},
|
|
272
|
-
position: "relative",
|
|
273
|
-
textStyle: {
|
|
274
|
-
type: "TextStyle",
|
|
275
|
-
bold: true,
|
|
276
|
-
fontSize: 24,
|
|
277
|
-
},
|
|
278
|
-
},
|
|
279
|
-
ParagraphStyle_H3: {
|
|
280
|
-
type: "ParagraphStyle",
|
|
281
|
-
margins: {
|
|
282
|
-
top: 4.5,
|
|
283
|
-
bottom: 1.125,
|
|
284
|
-
left: 0,
|
|
285
|
-
right: 0,
|
|
286
|
-
},
|
|
287
|
-
position: "relative",
|
|
288
|
-
textStyle: {
|
|
289
|
-
type: "TextStyle",
|
|
290
|
-
bold: true,
|
|
291
|
-
fontSize: 18,
|
|
292
|
-
},
|
|
293
|
-
},
|
|
294
|
-
ParagraphStyle_H4: {
|
|
295
|
-
type: "ParagraphStyle",
|
|
296
|
-
margins: {
|
|
297
|
-
top: 3.75,
|
|
298
|
-
bottom: 0.9375,
|
|
299
|
-
left: 0,
|
|
300
|
-
right: 0,
|
|
301
|
-
},
|
|
302
|
-
position: "relative",
|
|
303
|
-
textStyle: {
|
|
304
|
-
type: "TextStyle",
|
|
305
|
-
bold: true,
|
|
306
|
-
fontSize: 15,
|
|
307
|
-
},
|
|
308
|
-
},
|
|
309
|
-
ParagraphStyle_H5: {
|
|
310
|
-
type: "ParagraphStyle",
|
|
311
|
-
margins: {
|
|
312
|
-
top: 3.25,
|
|
313
|
-
bottom: 0.8125,
|
|
314
|
-
left: 0,
|
|
315
|
-
right: 0,
|
|
316
|
-
},
|
|
317
|
-
position: "relative",
|
|
318
|
-
textStyle: {
|
|
319
|
-
type: "TextStyle",
|
|
320
|
-
bold: true,
|
|
321
|
-
fontSize: 13,
|
|
322
|
-
},
|
|
323
|
-
},
|
|
324
|
-
ParagraphStyle_H6: {
|
|
325
|
-
type: "ParagraphStyle",
|
|
326
|
-
margins: {
|
|
327
|
-
top: 2.5,
|
|
328
|
-
bottom: 0.625,
|
|
329
|
-
left: 0,
|
|
330
|
-
right: 0,
|
|
331
|
-
},
|
|
332
|
-
position: "relative",
|
|
333
|
-
textStyle: {
|
|
334
|
-
type: "TextStyle",
|
|
335
|
-
bold: true,
|
|
336
|
-
fontSize: 10,
|
|
337
|
-
},
|
|
338
|
-
},
|
|
339
|
-
TextStyle_Emphasis: {
|
|
340
|
-
type: "TextStyle",
|
|
341
|
-
italic: true,
|
|
342
|
-
},
|
|
343
|
-
TextStyle_Strong: {
|
|
344
|
-
type: "TextStyle",
|
|
345
|
-
bold: true,
|
|
346
|
-
},
|
|
347
|
-
TextStyle_Subscript: {
|
|
348
|
-
type: "TextStyle",
|
|
349
|
-
subScript: true,
|
|
350
|
-
fontSize: 6,
|
|
351
|
-
},
|
|
352
|
-
TextStyle_Superscript: {
|
|
353
|
-
type: "TextStyle",
|
|
354
|
-
superScript: true,
|
|
355
|
-
fontSize: 6,
|
|
356
|
-
},
|
|
357
|
-
},
|
|
358
|
-
fonts: {},
|
|
359
|
-
},
|
|
360
|
-
};
|
|
361
|
-
//# sourceMappingURL=simple-document.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simple-document.js","sourceRoot":"","sources":["../../../../../src/abstract-document-xml/__tests__/layer/test-defs/simple-document.tsx"],"names":[],"mappings":";;;AAEa,QAAA,IAAI,GAAkB;IACjC,IAAI,EAAE,iBAAiB;IACvB,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;IACT,cAAc,EAAE;;;;;;;;;;;;;;;eAeH;IACb,eAAe,EAAE;QACf,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE;oBACJ,KAAK,EAAE;wBACL,aAAa,EAAE;4BACb,GAAG,EAAE,CAAC;4BACN,MAAM,EAAE,CAAC;4BACT,IAAI,EAAE,CAAC;4BACP,KAAK,EAAE,CAAC;yBACT;wBACD,aAAa,EAAE;4BACb,GAAG,EAAE,CAAC;4BACN,MAAM,EAAE,CAAC;4BACT,IAAI,EAAE,CAAC;4BACP,KAAK,EAAE,CAAC;yBACT;wBACD,cAAc,EAAE;4BACd,GAAG,EAAE,CAAC;4BACN,MAAM,EAAE,CAAC;4BACT,IAAI,EAAE,CAAC;4BACP,KAAK,EAAE,CAAC;yBACT;wBACD,WAAW,EAAE,UAAU;wBACvB,SAAS,EAAE,IAAI;wBACf,iBAAiB,EAAE,KAAK;qBACzB;oBACD,MAAM,EAAE,EAAE;oBACV,MAAM,EAAE,EA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