abstract-document 6.12.3 → 6.12.5
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/lib/abstract-document/atoms/image.d.ts.map +1 -1
- package/lib/abstract-document/atoms/image.js.map +1 -1
- package/lib/abstract-document/atoms/text-field.d.ts.map +1 -1
- package/lib/abstract-document/atoms/text-field.js +1 -8
- package/lib/abstract-document/atoms/text-field.js.map +1 -1
- package/lib/abstract-document/primitives/image-resource.d.ts.map +1 -1
- package/lib/abstract-document/primitives/image-resource.js +1 -5
- package/lib/abstract-document/primitives/image-resource.js.map +1 -1
- package/lib/abstract-document-xml/abstract-doc-of-xml/creator.d.ts.map +1 -1
- package/lib/abstract-document-xml/abstract-doc-of-xml/creator.js +36 -27
- package/lib/abstract-document-xml/abstract-doc-of-xml/creator.js.map +1 -1
- package/lib/abstract-document-xml/abstract-doc-of-xml/custom-elements.d.ts.map +1 -1
- package/lib/abstract-document-xml/abstract-doc-of-xml/custom-elements.js +10 -4
- package/lib/abstract-document-xml/abstract-doc-of-xml/custom-elements.js.map +1 -1
- package/lib/abstract-document-xml/xsd-template/custom-elements.d.ts +6 -6
- package/lib/abstract-document-xml/xsd-template/custom-elements.d.ts.map +1 -1
- package/lib/abstract-document-xml/xsd-template/custom-elements.js +36 -6
- package/lib/abstract-document-xml/xsd-template/custom-elements.js.map +1 -1
- package/lib/abstract-document-xml/xsd-template/elements.d.ts +1 -1
- package/lib/abstract-document-xml/xsd-template/elements.d.ts.map +1 -1
- package/lib/abstract-document-xml/xsd-template/elements.js +2 -2
- package/package.json +2 -2
- package/src/abstract-document/atoms/image.ts +1 -4
- package/src/abstract-document/atoms/text-field.ts +2 -14
- package/src/abstract-document/primitives/image-resource.ts +2 -10
- 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 +2 -2
- 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-xml/abstract-doc-of-xml/creator.ts +37 -25
- package/src/abstract-document-xml/abstract-doc-of-xml/custom-elements.tsx +11 -9
- package/src/abstract-document-xml/xsd-template/custom-elements.ts +36 -6
- package/src/abstract-document-xml/xsd-template/elements.ts +2 -2
package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Justify alignment.pdf
CHANGED
|
@@ -43,7 +43,7 @@ endobj
|
|
|
43
43
|
(PDFKit)
|
|
44
44
|
endobj
|
|
45
45
|
12 0 obj
|
|
46
|
-
(D:
|
|
46
|
+
(D:20231008111706Z)
|
|
47
47
|
endobj
|
|
48
48
|
9 0 obj
|
|
49
49
|
<<
|
|
@@ -106,7 +106,7 @@ trailer
|
|
|
106
106
|
/Size 13
|
|
107
107
|
/Root 3 0 R
|
|
108
108
|
/Info 9 0 R
|
|
109
|
-
/ID [<
|
|
109
|
+
/ID [<adddf49427462b9d78a91e7378446ddb> <adddf49427462b9d78a91e7378446ddb>]
|
|
110
110
|
>>
|
|
111
111
|
startxref
|
|
112
112
|
848
|
|
@@ -51,7 +51,7 @@ endobj
|
|
|
51
51
|
(PDFKit)
|
|
52
52
|
endobj
|
|
53
53
|
12 0 obj
|
|
54
|
-
(D:
|
|
54
|
+
(D:20231008111706Z)
|
|
55
55
|
endobj
|
|
56
56
|
9 0 obj
|
|
57
57
|
<<
|
|
@@ -114,7 +114,7 @@ trailer
|
|
|
114
114
|
/Size 13
|
|
115
115
|
/Root 3 0 R
|
|
116
116
|
/Info 9 0 R
|
|
117
|
-
/ID [<
|
|
117
|
+
/ID [<131cf0bfeb213acbc63312599fd144c4> <131cf0bfeb213acbc63312599fd144c4>]
|
|
118
118
|
>>
|
|
119
119
|
startxref
|
|
120
120
|
1418
|
package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Start alignment.pdf
CHANGED
|
@@ -43,7 +43,7 @@ endobj
|
|
|
43
43
|
(PDFKit)
|
|
44
44
|
endobj
|
|
45
45
|
12 0 obj
|
|
46
|
-
(D:
|
|
46
|
+
(D:20231008111706Z)
|
|
47
47
|
endobj
|
|
48
48
|
9 0 obj
|
|
49
49
|
<<
|
|
@@ -106,7 +106,7 @@ trailer
|
|
|
106
106
|
/Size 13
|
|
107
107
|
/Root 3 0 R
|
|
108
108
|
/Info 9 0 R
|
|
109
|
-
/ID [<
|
|
109
|
+
/ID [<74197d04c36e53e421b24d3bd0ae981a> <74197d04c36e53e421b24d3bd0ae981a>]
|
|
110
110
|
>>
|
|
111
111
|
startxref
|
|
112
112
|
848
|
|
@@ -63,7 +63,7 @@ endobj
|
|
|
63
63
|
(PDFKit)
|
|
64
64
|
endobj
|
|
65
65
|
12 0 obj
|
|
66
|
-
(D:
|
|
66
|
+
(D:20231008111706Z)
|
|
67
67
|
endobj
|
|
68
68
|
9 0 obj
|
|
69
69
|
<<
|
|
@@ -126,7 +126,7 @@ trailer
|
|
|
126
126
|
/Size 13
|
|
127
127
|
/Root 3 0 R
|
|
128
128
|
/Info 9 0 R
|
|
129
|
-
/ID [<
|
|
129
|
+
/ID [<d8ccc3ba679c369def5573e414b54495> <d8ccc3ba679c369def5573e414b54495>]
|
|
130
130
|
>>
|
|
131
131
|
startxref
|
|
132
132
|
1076
|
|
@@ -43,7 +43,7 @@ endobj
|
|
|
43
43
|
(PDFKit)
|
|
44
44
|
endobj
|
|
45
45
|
12 0 obj
|
|
46
|
-
(D:
|
|
46
|
+
(D:20231008111706Z)
|
|
47
47
|
endobj
|
|
48
48
|
9 0 obj
|
|
49
49
|
<<
|
|
@@ -106,7 +106,7 @@ trailer
|
|
|
106
106
|
/Size 13
|
|
107
107
|
/Root 3 0 R
|
|
108
108
|
/Info 9 0 R
|
|
109
|
-
/ID [<
|
|
109
|
+
/ID [<58fa9ef21fcc8ba1af9233db572ad5f7> <58fa9ef21fcc8ba1af9233db572ad5f7>]
|
|
110
110
|
>>
|
|
111
111
|
startxref
|
|
112
112
|
824
|
|
@@ -71,7 +71,7 @@ endobj
|
|
|
71
71
|
(PDFKit)
|
|
72
72
|
endobj
|
|
73
73
|
14 0 obj
|
|
74
|
-
(D:
|
|
74
|
+
(D:20231008111706Z)
|
|
75
75
|
endobj
|
|
76
76
|
11 0 obj
|
|
77
77
|
<<
|
|
@@ -136,7 +136,7 @@ trailer
|
|
|
136
136
|
/Size 15
|
|
137
137
|
/Root 3 0 R
|
|
138
138
|
/Info 11 0 R
|
|
139
|
-
/ID [<
|
|
139
|
+
/ID [<1f473306b4349e9e4ac3dd1096c474d8> <1f473306b4349e9e4ac3dd1096c474d8>]
|
|
140
140
|
>>
|
|
141
141
|
startxref
|
|
142
142
|
1232
|
|
@@ -43,7 +43,7 @@ endobj
|
|
|
43
43
|
(PDFKit)
|
|
44
44
|
endobj
|
|
45
45
|
12 0 obj
|
|
46
|
-
(D:
|
|
46
|
+
(D:20231008111705Z)
|
|
47
47
|
endobj
|
|
48
48
|
9 0 obj
|
|
49
49
|
<<
|
|
@@ -106,7 +106,7 @@ trailer
|
|
|
106
106
|
/Size 13
|
|
107
107
|
/Root 3 0 R
|
|
108
108
|
/Info 9 0 R
|
|
109
|
-
/ID [<
|
|
109
|
+
/ID [<ad91f4338aa0e39a884fd3ff2a74118a> <ad91f4338aa0e39a884fd3ff2a74118a>]
|
|
110
110
|
>>
|
|
111
111
|
startxref
|
|
112
112
|
894
|
|
@@ -79,7 +79,7 @@ endobj
|
|
|
79
79
|
(PDFKit)
|
|
80
80
|
endobj
|
|
81
81
|
15 0 obj
|
|
82
|
-
(D:
|
|
82
|
+
(D:20231008111706Z)
|
|
83
83
|
endobj
|
|
84
84
|
12 0 obj
|
|
85
85
|
<<
|
|
@@ -145,7 +145,7 @@ trailer
|
|
|
145
145
|
/Size 16
|
|
146
146
|
/Root 3 0 R
|
|
147
147
|
/Info 12 0 R
|
|
148
|
-
/ID [<
|
|
148
|
+
/ID [<f224cffd450c8b5d5c3aa242705d8418> <f224cffd450c8b5d5c3aa242705d8418>]
|
|
149
149
|
>>
|
|
150
150
|
startxref
|
|
151
151
|
1212
|
|
@@ -43,7 +43,7 @@ endobj
|
|
|
43
43
|
(PDFKit)
|
|
44
44
|
endobj
|
|
45
45
|
12 0 obj
|
|
46
|
-
(D:
|
|
46
|
+
(D:20231008111705Z)
|
|
47
47
|
endobj
|
|
48
48
|
9 0 obj
|
|
49
49
|
<<
|
|
@@ -106,7 +106,7 @@ trailer
|
|
|
106
106
|
/Size 13
|
|
107
107
|
/Root 3 0 R
|
|
108
108
|
/Info 9 0 R
|
|
109
|
-
/ID [<
|
|
109
|
+
/ID [<b1f8ca099b15875f513890f84f9b7bf2> <b1f8ca099b15875f513890f84f9b7bf2>]
|
|
110
110
|
>>
|
|
111
111
|
startxref
|
|
112
112
|
824
|
|
@@ -43,7 +43,7 @@ endobj
|
|
|
43
43
|
(PDFKit)
|
|
44
44
|
endobj
|
|
45
45
|
12 0 obj
|
|
46
|
-
(D:
|
|
46
|
+
(D:20231008111706Z)
|
|
47
47
|
endobj
|
|
48
48
|
9 0 obj
|
|
49
49
|
<<
|
|
@@ -106,7 +106,7 @@ trailer
|
|
|
106
106
|
/Size 13
|
|
107
107
|
/Root 3 0 R
|
|
108
108
|
/Info 9 0 R
|
|
109
|
-
/ID [<
|
|
109
|
+
/ID [<ea0823b6867fbb8321fa15201d2ec5e3> <ea0823b6867fbb8321fa15201d2ec5e3>]
|
|
110
110
|
>>
|
|
111
111
|
startxref
|
|
112
112
|
837
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { propIs } from "ramda";
|
|
2
|
+
import { ImageProps } from "../../abstract-document/atoms/image";
|
|
1
3
|
import {
|
|
2
4
|
AbstractDoc,
|
|
3
5
|
Atom,
|
|
@@ -57,40 +59,30 @@ export const creators: (
|
|
|
57
59
|
}
|
|
58
60
|
return AbstractDoc.create(props, children);
|
|
59
61
|
},
|
|
60
|
-
Paragraph: (props, children: ReadonlyArray<Atom.Atom>) => Paragraph.create(props, children),
|
|
61
62
|
Section: (props, children: ReadonlyArray<SectionElement.SectionElement>) => Section.create(props, children),
|
|
62
|
-
|
|
63
|
+
Paragraph: (props, children: ReadonlyArray<Atom.Atom>) => Paragraph.create(props, children),
|
|
63
64
|
TextRow: (props: TextRowProps) => TextRow(props, styleNames),
|
|
64
65
|
TextCell: (props: TextCellProps) => TextCell(props, styleNames),
|
|
65
66
|
TextParagraph: (props: TextParagraphProps) => TextParagraph(props, styleNames),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
TextRun: (props) => TextRun.create(props as unknown as TextRun.TextRunProps),
|
|
68
|
+
ImageRow: (props: ImageRowProps) => {
|
|
69
|
+
mutateImageProps(images, props);
|
|
70
|
+
return ImageRow(props, styleNames);
|
|
71
|
+
},
|
|
72
|
+
ImageCell: (props: ImageCellProps) => {
|
|
73
|
+
return ImageCell(props, styleNames);
|
|
74
|
+
},
|
|
75
|
+
ImageParagraph: (props: ImageParagraphProps) => {
|
|
76
|
+
return ImageParagraph(props, styleNames);
|
|
77
|
+
},
|
|
78
|
+
Image: (props: Record<string, unknown>) => {
|
|
79
|
+
return Image.create(props as unknown as Image.ImageProps);
|
|
80
|
+
},
|
|
69
81
|
Table: (props, children: ReadonlyArray<TableRow.TableRow>) =>
|
|
70
82
|
Table.create(props as unknown as Table.TableProps, children),
|
|
71
83
|
TableRow: (props, children: ReadonlyArray<TableCell.TableCell>) => TableRow.create(props, children),
|
|
72
84
|
TableCell: (props, children: ReadonlyArray<SectionElement.SectionElement>) => TableCell.create(props, children),
|
|
73
85
|
TextField: (props) => TextField.create(props as unknown as TextField.TextFieldProps),
|
|
74
|
-
Image: (props: Record<string, unknown>) => {
|
|
75
|
-
const image = images[(props.src as string) ?? ""];
|
|
76
|
-
if (image) {
|
|
77
|
-
if (image.width && image.height) {
|
|
78
|
-
props.width = image.width;
|
|
79
|
-
props.height = image.height;
|
|
80
|
-
} else {
|
|
81
|
-
const scaleX = (props.width as number) / image.abstractImage.size.width;
|
|
82
|
-
const scaleY = (props.height as number) / image.abstractImage.size.height;
|
|
83
|
-
if (scaleX < scaleY) {
|
|
84
|
-
props.height = (props.height as number) * (scaleX / scaleY);
|
|
85
|
-
} else {
|
|
86
|
-
props.width = (props.width as number) * (scaleY / scaleX);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
props.imageResource = images[props.src as string];
|
|
91
|
-
}
|
|
92
|
-
return Image.create(props as unknown as Image.ImageProps);
|
|
93
|
-
},
|
|
94
86
|
Group: (props, children) => Group.create(props, children as ReadonlyArray<Group.Group>),
|
|
95
87
|
PageBreak: () => PageBreak.create(),
|
|
96
88
|
Markdown: (props) => Markdown.create(props as unknown as Markdown.MarkdownProps),
|
|
@@ -271,3 +263,23 @@ export const propsCreators: Record<string, ADCreatorFn> = {
|
|
|
271
263
|
return borderColors;
|
|
272
264
|
},
|
|
273
265
|
};
|
|
266
|
+
|
|
267
|
+
function mutateImageProps(images: Record<string, ImageResource>, props: Record<string, unknown>): void {
|
|
268
|
+
const image = images[(props.src as string) ?? ""];
|
|
269
|
+
if (image) {
|
|
270
|
+
if (image.width && image.height) {
|
|
271
|
+
props.width = image.width;
|
|
272
|
+
props.height = image.height;
|
|
273
|
+
} else {
|
|
274
|
+
const scaleX = (props.width as number) / image.abstractImage.size.width;
|
|
275
|
+
const scaleY = (props.height as number) / image.abstractImage.size.height;
|
|
276
|
+
if (scaleX < scaleY) {
|
|
277
|
+
props.height = (props.height as number) * (scaleX / scaleY);
|
|
278
|
+
} else {
|
|
279
|
+
props.width = (props.width as number) * (scaleY / scaleX);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
props.imageResource = images[props.src as string];
|
|
284
|
+
}
|
|
285
|
+
}
|
|
@@ -95,12 +95,11 @@ export function ImageCell(props: ImageCellProps, styleNameTypes: Record<string,
|
|
|
95
95
|
const { image, width, height, paragraphStyle, cellStyle, columnSpan, rowSpan } = props;
|
|
96
96
|
const styleNames = extractStyleNames(props.styleNames, styleNameTypes);
|
|
97
97
|
const imageElement = image && Image.create({ imageResource: image, width, height });
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
);
|
|
98
|
+
const pararaphProps = { style: paragraphStyle, styleName: styleNames.ParagraphStyle };
|
|
99
|
+
const paragraph = imageElement
|
|
100
|
+
? Paragraph.create(pararaphProps, [imageElement])
|
|
101
|
+
: Paragraph.create(pararaphProps, [ImageMissing]);
|
|
102
|
+
return TableCell.create({ columnSpan, rowSpan, style: cellStyle, styleName: styleNames.TableCellStyle }, [paragraph]);
|
|
104
103
|
}
|
|
105
104
|
|
|
106
105
|
export type ImageParagraphProps = {
|
|
@@ -118,7 +117,10 @@ export function ImageParagraph(
|
|
|
118
117
|
const { image, width, height, paragraphStyle } = props;
|
|
119
118
|
const styleNames = extractStyleNames(props.styleNames, styleNameTypes);
|
|
120
119
|
const imageElement = image && Image.create({ imageResource: image, width, height });
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
const pararaphProps = { style: paragraphStyle, styleName: styleNames.ParagraphStyle };
|
|
121
|
+
return imageElement
|
|
122
|
+
? Paragraph.create(pararaphProps, [imageElement])
|
|
123
|
+
: Paragraph.create(pararaphProps, [ImageMissing]);
|
|
124
124
|
}
|
|
125
|
+
|
|
126
|
+
const ImageMissing = TextRun.create({ text: "Image missing" });
|
|
@@ -3,6 +3,12 @@ export const textRow = `<xs:complexType name="TextRow">
|
|
|
3
3
|
<xs:annotation>
|
|
4
4
|
<xs:documentation>Shortcut to create a \\<TableRow> \\<TableCell> \\<Paragraph> \\<TextRun text="..." /> \\</Paragraph> \\</TableCell> \\</TableRow></xs:documentation>
|
|
5
5
|
</xs:annotation>
|
|
6
|
+
<xs:choice minOccurs="0" maxOccurs="1">
|
|
7
|
+
<xs:element name="cellStyle" type="TableCellStyle" />
|
|
8
|
+
</xs:choice>
|
|
9
|
+
<xs:choice minOccurs="0" maxOccurs="1">
|
|
10
|
+
<xs:element name="paragraphStyle" type="ParagraphStyle" />
|
|
11
|
+
</xs:choice>
|
|
6
12
|
<xs:choice minOccurs="0" maxOccurs="1">
|
|
7
13
|
<xs:element name="style" type="TextStyle" />
|
|
8
14
|
</xs:choice>
|
|
@@ -22,6 +28,12 @@ export const textCell = `<xs:complexType name="TextCell">
|
|
|
22
28
|
<xs:annotation>
|
|
23
29
|
<xs:documentation>Shortcut to create a \\<TableCell> \\<Paragraph> \\<TextRun text="..." /> \\</Paragraph> \\</TableCell></xs:documentation>
|
|
24
30
|
</xs:annotation>
|
|
31
|
+
<xs:choice minOccurs="0" maxOccurs="1">
|
|
32
|
+
<xs:element name="cellStyle" type="TableCellStyle" />
|
|
33
|
+
</xs:choice>
|
|
34
|
+
<xs:choice minOccurs="0" maxOccurs="1">
|
|
35
|
+
<xs:element name="paragraphStyle" type="ParagraphStyle" />
|
|
36
|
+
</xs:choice>
|
|
25
37
|
<xs:choice minOccurs="0" maxOccurs="1">
|
|
26
38
|
<xs:element name="style" type="TextStyle" />
|
|
27
39
|
</xs:choice>
|
|
@@ -41,6 +53,9 @@ export const textParagraph = `<xs:complexType name="TextParagraph">
|
|
|
41
53
|
<xs:annotation>
|
|
42
54
|
<xs:documentation>Shortcut to create \\<Paragraph> \\<TextRun text="..." /> \\</Paragraph></xs:documentation>
|
|
43
55
|
</xs:annotation>
|
|
56
|
+
<xs:choice minOccurs="0" maxOccurs="1">
|
|
57
|
+
<xs:element name="paragraphStyle" type="ParagraphStyle" />
|
|
58
|
+
</xs:choice>
|
|
44
59
|
<xs:choice minOccurs="0" maxOccurs="1">
|
|
45
60
|
<xs:element name="style" type="TextStyle" />
|
|
46
61
|
</xs:choice>
|
|
@@ -62,8 +77,14 @@ export const imageRow = `<xs:complexType name="ImageRow">
|
|
|
62
77
|
<xs:attribute name="columnSpan" type="xs:string" />
|
|
63
78
|
<xs:attribute name="rowSpan" type="xs:string" />
|
|
64
79
|
<xs:attribute name="src" type="xs:string" use="required" />
|
|
65
|
-
<xs:attribute name="width" type="xs:decimal"
|
|
66
|
-
<xs:attribute name="height" type="xs:decimal"
|
|
80
|
+
<xs:attribute name="width" type="xs:decimal" />
|
|
81
|
+
<xs:attribute name="height" type="xs:decimal" />
|
|
82
|
+
<xs:choice minOccurs="0" maxOccurs="1">
|
|
83
|
+
<xs:element name="cellStyle" type="TableCellStyle" />
|
|
84
|
+
</xs:choice>
|
|
85
|
+
<xs:choice minOccurs="0" maxOccurs="1">
|
|
86
|
+
<xs:element name="paragraphStyle" type="ParagraphStyle" />
|
|
87
|
+
</xs:choice>
|
|
67
88
|
</xs:complexType>`;
|
|
68
89
|
export const imageRowElement = `<xs:element name="ImageRow" type="ImageRow" maxOccurs="unbounded" />`;
|
|
69
90
|
|
|
@@ -75,8 +96,14 @@ export const imageCell = `<xs:complexType name="ImageCell">
|
|
|
75
96
|
<xs:attribute name="columnSpan" type="xs:string" />
|
|
76
97
|
<xs:attribute name="rowSpan" type="xs:string" />
|
|
77
98
|
<xs:attribute name="src" type="xs:string" use="required" />
|
|
78
|
-
<xs:attribute name="width" type="xs:decimal"
|
|
79
|
-
<xs:attribute name="height" type="xs:decimal"
|
|
99
|
+
<xs:attribute name="width" type="xs:decimal" />
|
|
100
|
+
<xs:attribute name="height" type="xs:decimal" />
|
|
101
|
+
<xs:choice minOccurs="0" maxOccurs="1">
|
|
102
|
+
<xs:element name="cellStyle" type="TableCellStyle" />
|
|
103
|
+
</xs:choice>
|
|
104
|
+
<xs:choice minOccurs="0" maxOccurs="1">
|
|
105
|
+
<xs:element name="paragraphStyle" type="ParagraphStyle" />
|
|
106
|
+
</xs:choice>
|
|
80
107
|
</xs:complexType>`;
|
|
81
108
|
export const imageCellElement = `<xs:element name="ImageCell" type="ImageCell" minOccurs="0" maxOccurs="unbounded" />`;
|
|
82
109
|
|
|
@@ -86,7 +113,10 @@ export const imageParagraph = `<xs:complexType name="ImageParagraph">
|
|
|
86
113
|
</xs:annotation>
|
|
87
114
|
<xs:attribute name="styleNames" type="xs:string" />
|
|
88
115
|
<xs:attribute name="src" type="xs:string" use="required" />
|
|
89
|
-
<xs:attribute name="width" type="xs:decimal"
|
|
90
|
-
<xs:attribute name="height" type="xs:decimal"
|
|
116
|
+
<xs:attribute name="width" type="xs:decimal" />
|
|
117
|
+
<xs:attribute name="height" type="xs:decimal" />
|
|
118
|
+
<xs:choice minOccurs="0" maxOccurs="1">
|
|
119
|
+
<xs:element name="paragraphStyle" type="ParagraphStyle" />
|
|
120
|
+
</xs:choice>
|
|
91
121
|
</xs:complexType>`;
|
|
92
122
|
export const imageParagraphElement = `<xs:element name="ImageParagraph" type="ImageParagraph" maxOccurs="unbounded" />`;
|
|
@@ -201,8 +201,8 @@ export const textField = `<xs:complexType name="TextField">
|
|
|
201
201
|
|
|
202
202
|
export const image = `<xs:complexType name="Image">
|
|
203
203
|
<xs:attribute name="src" type="xs:string" use="required" />
|
|
204
|
-
<xs:attribute name="width" type="xs:decimal"
|
|
205
|
-
<xs:attribute name="height" type="xs:decimal"
|
|
204
|
+
<xs:attribute name="width" type="xs:decimal" />
|
|
205
|
+
<xs:attribute name="height" type="xs:decimal" />
|
|
206
206
|
</xs:complexType>`;
|
|
207
207
|
|
|
208
208
|
export const pageBreak = `<xs:complexType name="PageBreak" />`;
|