abstract-document 6.10.4 → 6.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/lib/abstract-document/atoms/atom.d.ts +2 -1
  3. package/lib/abstract-document/atoms/atom.d.ts.map +1 -1
  4. package/lib/abstract-document/atoms/line-break.d.ts +7 -0
  5. package/lib/abstract-document/atoms/line-break.d.ts.map +1 -0
  6. package/lib/abstract-document/atoms/line-break.js +10 -0
  7. package/lib/abstract-document/atoms/line-break.js.map +1 -0
  8. package/lib/abstract-document/index.d.ts +2 -1
  9. package/lib/abstract-document/index.d.ts.map +1 -1
  10. package/lib/abstract-document/index.js +3 -1
  11. package/lib/abstract-document/index.js.map +1 -1
  12. package/lib/abstract-document/markdown/markdown.d.ts.map +1 -1
  13. package/lib/abstract-document/markdown/markdown.js +5 -2
  14. package/lib/abstract-document/markdown/markdown.js.map +1 -1
  15. package/lib/abstract-document/markdown/types.d.ts +4 -1
  16. package/lib/abstract-document/markdown/types.d.ts.map +1 -1
  17. package/lib/abstract-document/styles/group-style.d.ts.map +1 -1
  18. package/lib/abstract-document/styles/group-style.js +1 -5
  19. package/lib/abstract-document/styles/group-style.js.map +1 -1
  20. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/manual-line-break-empty-lines.d.ts +3 -0
  21. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/manual-line-break-empty-lines.d.ts.map +1 -0
  22. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/manual-line-break-empty-lines.js +76 -0
  23. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/manual-line-break-empty-lines.js.map +1 -0
  24. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/manual-line-break.d.ts +3 -0
  25. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/manual-line-break.d.ts.map +1 -0
  26. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/manual-line-break.js +73 -0
  27. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/manual-line-break.js.map +1 -0
  28. package/lib/abstract-document-exporters/pdf/measure.d.ts.map +1 -1
  29. package/lib/abstract-document-exporters/pdf/measure.js +54 -30
  30. package/lib/abstract-document-exporters/pdf/measure.js.map +1 -1
  31. package/lib/abstract-document-exporters/pdf/render.js +10 -1
  32. package/lib/abstract-document-exporters/pdf/render.js.map +1 -1
  33. package/lib/abstract-document-jsx/index.d.ts +2 -1
  34. package/lib/abstract-document-jsx/index.d.ts.map +1 -1
  35. package/lib/abstract-document-jsx/index.js +3 -1
  36. package/lib/abstract-document-jsx/index.js.map +1 -1
  37. package/lib/abstract-document-xml/__tests__/layer/export-test-def.d.ts +13 -0
  38. package/lib/abstract-document-xml/__tests__/layer/export-test-def.d.ts.map +1 -0
  39. package/lib/abstract-document-xml/__tests__/layer/export-test-def.js +3 -0
  40. package/lib/abstract-document-xml/__tests__/layer/export-test-def.js.map +1 -0
  41. package/lib/abstract-document-xml/__tests__/layer/export.test.d.ts +3 -0
  42. package/lib/abstract-document-xml/__tests__/layer/export.test.d.ts.map +1 -0
  43. package/lib/abstract-document-xml/__tests__/layer/export.test.js +41 -0
  44. package/lib/abstract-document-xml/__tests__/layer/export.test.js.map +1 -0
  45. package/lib/abstract-document-xml/__tests__/layer/test-defs/simple-document.d.ts +3 -0
  46. package/lib/abstract-document-xml/__tests__/layer/test-defs/simple-document.d.ts.map +1 -0
  47. package/lib/abstract-document-xml/__tests__/layer/test-defs/simple-document.js +361 -0
  48. package/lib/abstract-document-xml/__tests__/layer/test-defs/simple-document.js.map +1 -0
  49. package/lib/abstract-document-xml/abstract-doc-of-xml/creator.d.ts.map +1 -1
  50. package/lib/abstract-document-xml/abstract-doc-of-xml/creator.js +2 -0
  51. package/lib/abstract-document-xml/abstract-doc-of-xml/creator.js.map +1 -1
  52. package/lib/abstract-document-xml/abstract-doc-of-xml/custom-elements.d.ts +17 -12
  53. package/lib/abstract-document-xml/abstract-doc-of-xml/custom-elements.d.ts.map +1 -1
  54. package/lib/abstract-document-xml/abstract-doc-of-xml/custom-elements.js +20 -15
  55. package/lib/abstract-document-xml/abstract-doc-of-xml/custom-elements.js.map +1 -1
  56. package/lib/abstract-document-xml/xsd-template/custom-elements.d.ts +10 -4
  57. package/lib/abstract-document-xml/xsd-template/custom-elements.d.ts.map +1 -1
  58. package/lib/abstract-document-xml/xsd-template/custom-elements.js +41 -9
  59. package/lib/abstract-document-xml/xsd-template/custom-elements.js.map +1 -1
  60. package/lib/abstract-document-xml/xsd-template/elements.d.ts.map +1 -1
  61. package/lib/abstract-document-xml/xsd-template/elements.js +34 -8
  62. package/lib/abstract-document-xml/xsd-template/elements.js.map +1 -1
  63. package/lib/abstract-document-xml/xsd-template/xsd-template.d.ts.map +1 -1
  64. package/lib/abstract-document-xml/xsd-template/xsd-template.js +5 -2
  65. package/lib/abstract-document-xml/xsd-template/xsd-template.js.map +1 -1
  66. package/package.json +2 -2
  67. package/src/abstract-document/atoms/atom.ts +2 -7
  68. package/src/abstract-document/atoms/line-break.ts +11 -0
  69. package/src/abstract-document/index.ts +2 -0
  70. package/src/abstract-document/markdown/markdown.ts +4 -2
  71. package/src/abstract-document/markdown/types.ts +6 -1
  72. package/src/abstract-document/styles/group-style.ts +1 -5
  73. package/src/abstract-document-exporters/__tests__/docx2/tmp/Group.docx +0 -0
  74. 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
  75. 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
  76. 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
  77. package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple images.docx +0 -0
  78. package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple tables.docx +0 -0
  79. package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with Center alignment.docx +0 -0
  80. package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with End alignment.docx +0 -0
  81. package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with Start alignment that linebreaks.docx +0 -0
  82. package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with Start alignment.docx +0 -0
  83. package/src/abstract-document-exporters/__tests__/docx2/tmp/Page numbering.docx +0 -0
  84. 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
  85. package/src/abstract-document-exporters/__tests__/docx2/tmp/Simple table without rows.docx +0 -0
  86. package/src/abstract-document-exporters/__tests__/docx2/tmp/Simple table.docx +0 -0
  87. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single hyperlink.docx +0 -0
  88. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single image.docx +0 -0
  89. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Center alignment that linebreaks.docx +0 -0
  90. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Center alignment.docx +0 -0
  91. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with End alignment that linebreaks.docx +0 -0
  92. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with End alignment.docx +0 -0
  93. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Start alignment that linebreaks.docx +0 -0
  94. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Start alignment.docx +0 -0
  95. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun.docx +0 -0
  96. package/src/abstract-document-exporters/__tests__/docx2/tmp/hello with Arial font.docx +0 -0
  97. package/src/abstract-document-exporters/__tests__/docx2/tmp/hello.docx +0 -0
  98. package/src/abstract-document-exporters/__tests__/docx2/tmp/letter-dimensions.docx +0 -0
  99. package/src/abstract-document-exporters/__tests__/docx2/tmp/page-orientation-landscape.docx +0 -0
  100. package/src/abstract-document-exporters/__tests__/docx2/tmp/page-orientation-portrait.docx +0 -0
  101. package/src/abstract-document-exporters/__tests__/docx2/tmp/tocSeparator.docx +0 -0
  102. package/src/abstract-document-exporters/__tests__/docx2/tmp/world.docx +0 -0
  103. package/src/abstract-document-exporters/__tests__/pdf/test-defs/manual-line-break-empty-lines.tsx +77 -0
  104. package/src/abstract-document-exporters/__tests__/pdf/test-defs/manual-line-break.tsx +73 -0
  105. package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position group.pdf +2 -2
  106. package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position header and footer.pdf +2 -2
  107. package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position paragraph.pdf +2 -2
  108. package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position section in group.pdf +2 -2
  109. package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position section in table.pdf +2 -2
  110. package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position table.pdf +2 -2
  111. package/src/abstract-document-exporters/__tests__/pdf/tmp/Group Paragraphs.pdf +2 -2
  112. package/src/abstract-document-exporters/__tests__/pdf/tmp/Group Tables.pdf +2 -2
  113. package/src/abstract-document-exporters/__tests__/pdf/tmp/Group no keeptogether.pdf +2 -2
  114. package/src/abstract-document-exporters/__tests__/pdf/tmp/Group too big for one page.pdf +2 -2
  115. package/src/abstract-document-exporters/__tests__/pdf/tmp/Header and footer.pdf +2 -2
  116. package/src/abstract-document-exporters/__tests__/pdf/tmp/Hyperlink internal linktarget.pdf +2 -2
  117. package/src/abstract-document-exporters/__tests__/pdf/tmp/Hyperlink internal.pdf +2 -2
  118. package/src/abstract-document-exporters/__tests__/pdf/tmp/Manual line break.pdf +123 -0
  119. package/src/abstract-document-exporters/__tests__/pdf/tmp/Manual line breaks empty lines.pdf +123 -0
  120. package/src/abstract-document-exporters/__tests__/pdf/tmp/Margins header body footer.pdf +2 -2
  121. package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed hyperlink and textrun no underline.pdf +2 -2
  122. package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed hyperlink and textrun with underline.pdf +2 -2
  123. package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed hyperlink and textrun.pdf +2 -2
  124. 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
  125. package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple images overflow.pdf +0 -0
  126. package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple images.pdf +0 -0
  127. package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with Center alignment.pdf +2 -2
  128. package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with End alignment.pdf +2 -2
  129. package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with Start alignment that linebreaks.pdf +2 -2
  130. package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with Start alignment.pdf +2 -2
  131. package/src/abstract-document-exporters/__tests__/pdf/tmp/Page numbering.pdf +2 -2
  132. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table row that doesnt fit page.pdf +2 -2
  133. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table single row.pdf +2 -2
  134. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with group.pdf +2 -2
  135. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with header 2.pdf +2 -2
  136. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with header.pdf +2 -2
  137. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with margin bottom.pdf +2 -2
  138. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with margin top single table.pdf +2 -2
  139. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with margin top.pdf +2 -2
  140. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with rowSpan multipages.pdf +2 -2
  141. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with rowSpan.pdf +2 -2
  142. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table all auto.pdf +2 -2
  143. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table all fix.pdf +2 -2
  144. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table background.pdf +2 -2
  145. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table cell padding of image.pdf +0 -0
  146. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table cell padding of text.pdf +2 -2
  147. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table center alignment.pdf +2 -2
  148. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table colSpan and rowSpan.pdf +2 -2
  149. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table minimal row height.pdf +2 -2
  150. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table mix auto fix.pdf +2 -2
  151. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table padding.pdf +2 -2
  152. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table right alignment.pdf +2 -2
  153. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table row alignment.pdf +2 -2
  154. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table text alignment in cell with wrapping.pdf +2 -2
  155. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table text alignment in cell.pdf +2 -2
  156. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table with default colored borders.pdf +2 -2
  157. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table with header.pdf +2 -2
  158. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table with multi colored borders.pdf +2 -2
  159. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table with single colored borders.pdf +2 -2
  160. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single date.pdf +14 -14
  161. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single figure.pdf +2 -2
  162. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single hyperlink centered.pdf +2 -2
  163. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single hyperlink no underline.pdf +2 -2
  164. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single hyperlink right aligned.pdf +2 -2
  165. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single hyperlink.pdf +2 -2
  166. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image from URL.pdf +0 -0
  167. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg color hex.pdf +2 -2
  168. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg color name.pdf +2 -2
  169. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg color url.pdf +2 -2
  170. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg dasharray.pdf +2 -2
  171. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image.pdf +0 -0
  172. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline alphabetic.pdf +2 -2
  173. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline bottom.pdf +2 -2
  174. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline hanging.pdf +2 -2
  175. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline middle.pdf +2 -2
  176. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline top.pdf +2 -2
  177. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Center alignment that linebreaks.pdf +2 -2
  178. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Center alignment.pdf +2 -2
  179. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with End alignment that linebreaks.pdf +2 -2
  180. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with End alignment.pdf +2 -2
  181. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Justify alignment.pdf +2 -2
  182. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Start alignment that linebreaks.pdf +2 -2
  183. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Start alignment.pdf +2 -2
  184. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with super and subscripts.pdf +2 -2
  185. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun.pdf +2 -2
  186. package/src/abstract-document-exporters/__tests__/pdf/tmp/Table of content separator.pdf +2 -2
  187. package/src/abstract-document-exporters/__tests__/pdf/tmp/hello with roman font.pdf +2 -2
  188. package/src/abstract-document-exporters/__tests__/pdf/tmp/hello.pdf +2 -2
  189. package/src/abstract-document-exporters/__tests__/pdf/tmp/pagebreak.pdf +2 -2
  190. package/src/abstract-document-exporters/__tests__/pdf/tmp/world.pdf +2 -2
  191. package/src/abstract-document-exporters/pdf/measure.ts +68 -37
  192. package/src/abstract-document-exporters/pdf/render.ts +10 -1
  193. package/src/abstract-document-jsx/index.ts +2 -0
  194. package/src/abstract-document-xml/abstract-doc-of-xml/creator.ts +6 -0
  195. package/src/abstract-document-xml/abstract-doc-of-xml/custom-elements.tsx +39 -25
  196. package/src/abstract-document-xml/xsd-template/custom-elements.ts +42 -8
  197. package/src/abstract-document-xml/xsd-template/elements.ts +15 -8
  198. package/src/abstract-document-xml/xsd-template/xsd-template.ts +5 -2
@@ -1,23 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.textRowElement = exports.textRow = exports.textCellElement = exports.textCell = exports.textParagraphElement = exports.textParagraph = void 0;
3
+ exports.imageParagraphElement = exports.imageParagraph = exports.imageCellElement = exports.imageCell = exports.imageRowElement = exports.imageRow = exports.textParagraphElement = exports.textParagraph = exports.textCellElement = exports.textCell = exports.textRowElement = exports.textRow = void 0;
4
4
  /* eslint-disable no-useless-escape */
5
- exports.textParagraph = `<xs:complexType name="TextParagraph">
5
+ exports.textRow = `<xs:complexType name="TextRow">
6
6
  <xs:annotation>
7
- <xs:documentation>Shortcut to create \\<Paragraph> \\<TextRun text="..." /> \\</Paragraph></xs:documentation>
7
+ <xs:documentation>Shortcut to create a \\<TableRow> \\<TableCell> \\<Paragraph> \\<TextRun text="..." /> \\</Paragraph> \\</TableCell> \\</TableRow></xs:documentation>
8
8
  </xs:annotation>
9
9
  <xs:choice minOccurs="0" maxOccurs="1">
10
10
  <xs:element name="style" type="TextStyle" />
11
11
  </xs:choice>
12
12
  <xs:attribute name="styleNames" type="xs:string" >
13
13
  <xs:annotation>
14
- <xs:documentation>Refrence to a TextStyle that is defined in \\<AbstractDoc> \\<StyleNames> \\<StyleName name="..." /> \\</StyleNames> \\</AbstractDoc></xs:documentation>
14
+ <xs:documentation>Refrence to a TextStyle that is defined in \\<AbstractDoc> \\<StyleNames> \\<StyleName name="..." /> \\</StyleNames> \\</AbstractDoc></xs:documentation>
15
15
  </xs:annotation>
16
16
  </xs:attribute>
17
17
  <xs:attribute name="target" type="xs:string" />
18
+ <xs:attribute name="columnSpan" type="xs:string" />
19
+ <xs:attribute name="rowSpan" type="xs:string" />
18
20
  <xs:attribute name="text" type="xs:string" use="required" />
19
21
  </xs:complexType>`;
20
- exports.textParagraphElement = `<xs:element name="TextParagraph" type="TextParagraph" maxOccurs="unbounded" />`;
22
+ exports.textRowElement = `<xs:element name="TextRow" type="TextRow" maxOccurs="unbounded" />`;
21
23
  exports.textCell = `<xs:complexType name="TextCell">
22
24
  <xs:annotation>
23
25
  <xs:documentation>Shortcut to create a \\<TableCell> \\<Paragraph> \\<TextRun text="..." /> \\</Paragraph> \\</TableCell></xs:documentation>
@@ -36,22 +38,52 @@ exports.textCell = `<xs:complexType name="TextCell">
36
38
  <xs:attribute name="text" type="xs:string" use="required" />
37
39
  </xs:complexType>`;
38
40
  exports.textCellElement = `<xs:element name="TextCell" type="TextCell" minOccurs="0" maxOccurs="unbounded" />`;
39
- exports.textRow = `<xs:complexType name="TextRow">
41
+ exports.textParagraph = `<xs:complexType name="TextParagraph">
40
42
  <xs:annotation>
41
- <xs:documentation>Shortcut to create a \\<TableRow> \\<TableCell> \\<Paragraph> \\<TextRun text="..." /> \\</Paragraph> \\</TableCell> \\</TableRow></xs:documentation>
43
+ <xs:documentation>Shortcut to create \\<Paragraph> \\<TextRun text="..." /> \\</Paragraph></xs:documentation>
42
44
  </xs:annotation>
43
45
  <xs:choice minOccurs="0" maxOccurs="1">
44
46
  <xs:element name="style" type="TextStyle" />
45
47
  </xs:choice>
46
48
  <xs:attribute name="styleNames" type="xs:string" >
47
49
  <xs:annotation>
48
- <xs:documentation>Refrence to a TextStyle that is defined in \\<AbstractDoc> \\<StyleNames> \\<StyleName name="..." /> \\</StyleNames> \\</AbstractDoc></xs:documentation>
50
+ <xs:documentation>Refrence to a TextStyle that is defined in \\<AbstractDoc> \\<StyleNames> \\<StyleName name="..." /> \\</StyleNames> \\</AbstractDoc></xs:documentation>
49
51
  </xs:annotation>
50
52
  </xs:attribute>
51
53
  <xs:attribute name="target" type="xs:string" />
54
+ <xs:attribute name="text" type="xs:string" use="required" />
55
+ </xs:complexType>`;
56
+ exports.textParagraphElement = `<xs:element name="TextParagraph" type="TextParagraph" maxOccurs="unbounded" />`;
57
+ exports.imageRow = `<xs:complexType name="ImageRow">
58
+ <xs:annotation>
59
+ <xs:documentation>Shortcut to create a \\<TableRow> \\<TableCell> \\<Paragraph> \\<Image src text="..." /> \\</Paragraph> \\</TableCell> \\</TableRow></xs:documentation>
60
+ </xs:annotation>
61
+ <xs:attribute name="styleNames" type="xs:string" />
62
+ <xs:attribute name="target" type="xs:string" />
52
63
  <xs:attribute name="columnSpan" type="xs:string" />
53
64
  <xs:attribute name="rowSpan" type="xs:string" />
54
65
  <xs:attribute name="text" type="xs:string" use="required" />
55
66
  </xs:complexType>`;
56
- exports.textRowElement = `<xs:element name="TextRow" type="TextRow" maxOccurs="unbounded" />`;
67
+ exports.imageRowElement = `<xs:element name="ImageRow" type="ImageRow" maxOccurs="unbounded" />`;
68
+ exports.imageCell = `<xs:complexType name="ImageCell">
69
+ <xs:annotation>
70
+ <xs:documentation>Shortcut to create a \\<ImageCell> \\<Paragraph> \\<Image src="..." /> \\</Paragraph> \\</TableCell></xs:documentation>
71
+ </xs:annotation>
72
+ <xs:attribute name="styleNames" type="xs:string" />
73
+ <xs:attribute name="target" type="xs:string" />
74
+ <xs:attribute name="columnSpan" type="xs:string" />
75
+ <xs:attribute name="rowSpan" type="xs:string" />
76
+ <xs:attribute name="text" type="xs:string" use="required" />
77
+ </xs:complexType>`;
78
+ exports.imageCellElement = `<xs:element name="ImageCell" type="ImageCell" minOccurs="0" maxOccurs="unbounded" />`;
79
+ exports.imageParagraph = `<xs:complexType name="ImageParagraph">
80
+ <xs:annotation>
81
+ <xs:documentation>Shortcut to create \\<Paragraph> \\<Image src="..." /> \\</Paragraph></xs:documentation>
82
+ </xs:annotation>
83
+ <xs:attribute name="styleNames" type="xs:string" />
84
+ <xs:attribute name="src" type="xs:string" use="required" />
85
+ <xs:attribute name="width" type="xs:decimal" use="required" />
86
+ <xs:attribute name="height" type="xs:decimal" use="required" />
87
+ </xs:complexType>`;
88
+ exports.imageParagraphElement = `<xs:element name="ImageParagraph" type="ImageParagraph" maxOccurs="unbounded" />`;
57
89
  //# sourceMappingURL=custom-elements.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"custom-elements.js","sourceRoot":"","sources":["../../../src/abstract-document-xml/xsd-template/custom-elements.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACzB,QAAA,aAAa,GAAG;;;;;;;;;;;;;;kBAcX,CAAC;AACN,QAAA,oBAAoB,GAAG,gFAAgF,CAAC;AAExG,QAAA,QAAQ,GAAG;;;;;;;;;;;;;;;;kBAgBN,CAAC;AACN,QAAA,eAAe,GAAG,oFAAoF,CAAC;AAEvG,QAAA,OAAO,GAAG;;;;;;;;;;;;;;;;kBAgBL,CAAC;AAEN,QAAA,cAAc,GAAG,oEAAoE,CAAC"}
1
+ {"version":3,"file":"custom-elements.js","sourceRoot":"","sources":["../../../src/abstract-document-xml/xsd-template/custom-elements.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACzB,QAAA,OAAO,GAAG;;;;;;;;;;;;;;;;kBAgBL,CAAC;AACN,QAAA,cAAc,GAAG,oEAAoE,CAAC;AAEtF,QAAA,QAAQ,GAAG;;;;;;;;;;;;;;;;kBAgBN,CAAC;AACN,QAAA,eAAe,GAAG,oFAAoF,CAAC;AAEvG,QAAA,aAAa,GAAG;;;;;;;;;;;;;;kBAcX,CAAC;AACN,QAAA,oBAAoB,GAAG,gFAAgF,CAAC;AAExG,QAAA,QAAQ,GAAG;;;;;;;;;kBASN,CAAC;AACN,QAAA,eAAe,GAAG,sEAAsE,CAAC;AAEzF,QAAA,SAAS,GAAG;;;;;;;;;kBASP,CAAC;AACN,QAAA,gBAAgB,GAAG,sFAAsF,CAAC;AAE1G,QAAA,cAAc,GAAG;;;;;;;;kBAQZ,CAAC;AACN,QAAA,qBAAqB,GAAG,kFAAkF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../src/abstract-document-xml/xsd-template/elements.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,uSAOV,CAAC;AAEf,eAAO,MAAM,OAAO,QAUF,CAAC;AAEnB,eAAO,MAAM,IAAI,6YASC,CAAC;AAEnB,eAAO,MAAM,cAAc,QAST,CAAC;AAEnB,eAAO,MAAM,KAAK,QAUA,CAAC;AAEnB,eAAO,MAAM,KAAK,QAqBA,CAAC;AAEnB,eAAO,MAAM,UAAU,QAOL,CAAC;AAEnB,eAAO,MAAM,QAAQ,QAKH,CAAC;AAEnB,eAAO,MAAM,SAAS,QAiBJ,CAAC;AAEnB,eAAO,MAAM,QAAQ,qLAGH,CAAC;AAEnB,eAAO,MAAM,SAAS,qpCAeJ,CAAC;AAEnB,eAAO,MAAM,SAAS,sjBAWJ,CAAC;AAEnB,eAAO,MAAM,YAAY,qHAEP,CAAC;AAEnB,eAAO,MAAM,UAAU,iHAEL,CAAC;AAEnB,eAAO,MAAM,OAAO,slBAWF,CAAC;AAEnB,eAAO,MAAM,SAAS,i5BAqBJ,CAAC;AAEnB,eAAO,MAAM,KAAK,+RAIA,CAAC;AAEnB,eAAO,MAAM,SAAS,0CAAwC,CAAC"}
1
+ {"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../src/abstract-document-xml/xsd-template/elements.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,uSAOV,CAAC;AAEf,eAAO,MAAM,OAAO,QAWF,CAAC;AAEnB,eAAO,MAAM,IAAI,6YASC,CAAC;AAEnB,eAAO,MAAM,cAAc,QAUT,CAAC;AAEnB,eAAO,MAAM,KAAK,QAWA,CAAC;AAEnB,eAAO,MAAM,KAAK,QAsBA,CAAC;AAEnB,eAAO,MAAM,UAAU,QAQL,CAAC;AAEnB,eAAO,MAAM,QAAQ,QAMH,CAAC;AAEnB,eAAO,MAAM,SAAS,QAkBJ,CAAC;AAEnB,eAAO,MAAM,QAAQ,qLAGH,CAAC;AAEnB,eAAO,MAAM,SAAS,qpCAeJ,CAAC;AAEnB,eAAO,MAAM,SAAS,sjBAWJ,CAAC;AAEnB,eAAO,MAAM,YAAY,qHAEP,CAAC;AAEnB,eAAO,MAAM,UAAU,iHAEL,CAAC;AAEnB,eAAO,MAAM,OAAO,slBAWF,CAAC;AAEnB,eAAO,MAAM,SAAS,i5BAqBJ,CAAC;AAEnB,eAAO,MAAM,KAAK,+RAIA,CAAC;AAEnB,eAAO,MAAM,SAAS,0CAAwC,CAAC"}
@@ -1,7 +1,26 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
2
21
  Object.defineProperty(exports, "__esModule", { value: true });
3
22
  exports.pageBreak = exports.image = exports.textField = exports.textRun = exports.linkTarget = exports.tocSeparator = exports.hyperLink = exports.paragraph = exports.markdown = exports.tableCell = exports.tableRow = exports.headerRows = exports.table = exports.group = exports.sectionElement = exports.page = exports.section = exports.abstractDoc = void 0;
4
- const custom_elements_1 = require("./custom-elements");
23
+ const Custom = __importStar(require("./custom-elements"));
5
24
  exports.abstractDoc = `<xs:element name="AbstractDoc">
6
25
  <xs:complexType>
7
26
  <xs:sequence>
@@ -16,7 +35,8 @@ exports.section = `<xs:complexType name="Section">
16
35
  <xs:element name="Group" type="Group" minOccurs="0" />
17
36
  <xs:element name="PageBreak" type="PageBreak" minOccurs="0" />
18
37
  <xs:element name="Paragraph" type="Paragraph" minOccurs="0" />
19
- ${custom_elements_1.textParagraphElement}
38
+ ${Custom.textParagraphElement}
39
+ ${Custom.imageParagraphElement}
20
40
  <xs:element name="Markdown" type="Markdown" minOccurs="0" />
21
41
  <xs:element name="page" type="page" minOccurs="0" maxOccurs="1"></xs:element>
22
42
  </xs:choice>
@@ -37,7 +57,8 @@ exports.sectionElement = `<xs:complexType name="SectionElement">
37
57
  <xs:element name="Group" type="Group" minOccurs="0" />
38
58
  <xs:element name="PageBreak" type="PageBreak" minOccurs="0" />
39
59
  <xs:element name="Paragraph" type="Paragraph" minOccurs="0" />
40
- ${custom_elements_1.textParagraphElement}
60
+ ${Custom.textParagraphElement}
61
+ ${Custom.imageParagraphElement}
41
62
  <xs:element name="Markdown" type="Markdown" minOccurs="0" />
42
63
  </xs:choice>
43
64
  </xs:complexType>`;
@@ -47,7 +68,8 @@ exports.group = `<xs:complexType name="Group">
47
68
  <xs:element name="Group" type="Group" minOccurs="0" />
48
69
  <xs:element name="PageBreak" type="PageBreak" minOccurs="0" />
49
70
  <xs:element name="Paragraph" type="Paragraph" minOccurs="0" />
50
- ${custom_elements_1.textParagraphElement}
71
+ ${Custom.textParagraphElement}
72
+ ${Custom.imageParagraphElement}
51
73
  <xs:element name="style" type="GroupStyle" minOccurs="0" />
52
74
  </xs:choice>
53
75
  <xs:attribute name="keepTogether" type="xs:boolean" />
@@ -59,7 +81,8 @@ exports.table = `<xs:complexType name="Table">
59
81
  <xs:sequence>
60
82
  <xs:choice minOccurs="1">
61
83
  <xs:element name="TableRow" type="TableRow" maxOccurs="unbounded" />
62
- ${custom_elements_1.textRowElement}
84
+ ${Custom.textRowElement}
85
+ ${Custom.imageRowElement}
63
86
  </xs:choice>
64
87
  </xs:sequence>
65
88
  </xs:choice>
@@ -78,14 +101,16 @@ exports.headerRows = `<xs:complexType name="headerRows">
78
101
  <xs:sequence>
79
102
  <xs:choice minOccurs="1" maxOccurs="unbounded">
80
103
  <xs:element name="TableRow" type="TableRow"/>
81
- ${custom_elements_1.textRowElement}
104
+ ${Custom.textRowElement}
105
+ ${Custom.imageRowElement}
82
106
  </xs:choice>
83
107
  </xs:sequence>
84
108
  </xs:complexType>`;
85
109
  exports.tableRow = `<xs:complexType name="TableRow">
86
110
  <xs:choice maxOccurs="unbounded">
87
111
  <xs:element name="TableCell" type="TableCell" minOccurs="0" maxOccurs="unbounded" />
88
- ${custom_elements_1.textCellElement}
112
+ ${Custom.textCellElement}
113
+ ${Custom.imageCellElement}
89
114
  </xs:choice>
90
115
  </xs:complexType>`;
91
116
  exports.tableCell = `<xs:complexType name="TableCell">
@@ -95,7 +120,8 @@ exports.tableCell = `<xs:complexType name="TableCell">
95
120
  <xs:element name="Group" type="Group" minOccurs="0" maxOccurs="unbounded" />
96
121
  <xs:element name="PageBreak" type="PageBreak" minOccurs="0" maxOccurs="unbounded" />
97
122
  <xs:element name="Paragraph" type="Paragraph" minOccurs="0" maxOccurs="unbounded" />
98
- ${custom_elements_1.textParagraphElement}
123
+ ${Custom.textParagraphElement}
124
+ ${Custom.imageParagraphElement}
99
125
  <xs:element name="Markdown" type="Markdown" minOccurs="0" maxOccurs="unbounded" />
100
126
  </xs:choice>
101
127
  <xs:attribute name="rowSpan" type="xs:integer" />
@@ -1 +1 @@
1
- {"version":3,"file":"elements.js","sourceRoot":"","sources":["../../../src/abstract-document-xml/xsd-template/elements.ts"],"names":[],"mappings":";;;AAAA,uDAA0F;AAE7E,QAAA,WAAW,GAAG;;;;;;;cAOb,CAAC;AAEF,QAAA,OAAO,GAAG;;;;;;IAMnB,sCAAoB;;;;kBAIN,CAAC;AAEN,QAAA,IAAI,GAAG;;;;;;;;;kBASF,CAAC;AAEN,QAAA,cAAc,GAAG;;;;;;IAM1B,sCAAoB;;;kBAGN,CAAC;AAEN,QAAA,KAAK,GAAG;;;;;;IAMjB,sCAAoB;;;;kBAIN,CAAC;AAEN,QAAA,KAAK,GAAG;;;;;;;MAOf,gCAAc;;;;;;;;;;;;;;kBAcF,CAAC;AAEN,QAAA,UAAU,GAAG;;;;KAIrB,gCAAc;;;kBAGD,CAAC;AAEN,QAAA,QAAQ,GAAG;;;IAGpB,iCAAe;;kBAED,CAAC;AAEN,QAAA,SAAS,GAAG;;;;;;;IAOrB,sCAAoB;;;;;;;;;;kBAUN,CAAC;AAEN,QAAA,QAAQ,GAAG;;;kBAGN,CAAC;AAEN,QAAA,SAAS,GAAG;;;;;;;;;;;;;;;kBAeP,CAAC;AAEN,QAAA,SAAS,GAAG;;;;;;;;;;;kBAWP,CAAC;AAEN,QAAA,YAAY,GAAG;;kBAEV,CAAC;AAEN,QAAA,UAAU,GAAG;;kBAER,CAAC;AAEN,QAAA,OAAO,GAAG;;;;;;;;;;;kBAWL,CAAC;AAEN,QAAA,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;kBAqBP,CAAC;AAEN,QAAA,KAAK,GAAG;;;;kBAIH,CAAC;AAEN,QAAA,SAAS,GAAG,qCAAqC,CAAC"}
1
+ {"version":3,"file":"elements.js","sourceRoot":"","sources":["../../../src/abstract-document-xml/xsd-template/elements.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4C;AAE/B,QAAA,WAAW,GAAG;;;;;;;cAOb,CAAC;AAEF,QAAA,OAAO,GAAG;;;;;;IAMnB,MAAM,CAAC,oBAAoB;IAC3B,MAAM,CAAC,qBAAqB;;;;kBAId,CAAC;AAEN,QAAA,IAAI,GAAG;;;;;;;;;kBASF,CAAC;AAEN,QAAA,cAAc,GAAG;;;;;;IAM1B,MAAM,CAAC,oBAAoB;IAC3B,MAAM,CAAC,qBAAqB;;;kBAGd,CAAC;AAEN,QAAA,KAAK,GAAG;;;;;;IAMjB,MAAM,CAAC,oBAAoB;IAC3B,MAAM,CAAC,qBAAqB;;;;kBAId,CAAC;AAEN,QAAA,KAAK,GAAG;;;;;;;MAOf,MAAM,CAAC,cAAc;MACrB,MAAM,CAAC,eAAe;;;;;;;;;;;;;;kBAcV,CAAC;AAEN,QAAA,UAAU,GAAG;;;;KAIrB,MAAM,CAAC,cAAc;KACrB,MAAM,CAAC,eAAe;;;kBAGT,CAAC;AAEN,QAAA,QAAQ,GAAG;;;IAGpB,MAAM,CAAC,eAAe;IACtB,MAAM,CAAC,gBAAgB;;kBAET,CAAC;AAEN,QAAA,SAAS,GAAG;;;;;;;IAOrB,MAAM,CAAC,oBAAoB;IAC3B,MAAM,CAAC,qBAAqB;;;;;;;;;;kBAUd,CAAC;AAEN,QAAA,QAAQ,GAAG;;;kBAGN,CAAC;AAEN,QAAA,SAAS,GAAG;;;;;;;;;;;;;;;kBAeP,CAAC;AAEN,QAAA,SAAS,GAAG;;;;;;;;;;;kBAWP,CAAC;AAEN,QAAA,YAAY,GAAG;;kBAEV,CAAC;AAEN,QAAA,UAAU,GAAG;;kBAER,CAAC;AAEN,QAAA,OAAO,GAAG;;;;;;;;;;;kBAWL,CAAC;AAEN,QAAA,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;kBAqBP,CAAC;AAEN,QAAA,KAAK,GAAG;;;;kBAIH,CAAC;AAEN,QAAA,SAAS,GAAG,qCAAqC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"xsd-template.d.ts","sourceRoot":"","sources":["../../../src/abstract-document-xml/xsd-template/xsd-template.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,GAAG,QAMH,CAAC;AAEd,eAAO,MAAM,UAAU,QASV,CAAC"}
1
+ {"version":3,"file":"xsd-template.d.ts","sourceRoot":"","sources":["../../../src/abstract-document-xml/xsd-template/xsd-template.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,GAAG,QAMH,CAAC;AAEd,eAAO,MAAM,UAAU,QASV,CAAC"}
@@ -48,9 +48,12 @@ ${Elements.tableRow}
48
48
  ${Elements.headerRows}
49
49
  ${Elements.table}
50
50
  ${Elements.tableCell}
51
- ${CustomElements.textParagraph}
51
+ ${CustomElements.textRow}
52
52
  ${CustomElements.textCell}
53
- ${CustomElements.textRow}`;
53
+ ${CustomElements.textParagraph}
54
+ ${CustomElements.imageRow}
55
+ ${CustomElements.imageCell}
56
+ ${CustomElements.imageParagraph}`;
54
57
  exports.xsd = `<?xml version="1.0" encoding="UTF-8"?>
55
58
  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
56
59
  ${commonParts}
@@ -1 +1 @@
1
- {"version":3,"file":"xsd-template.js","sourceRoot":"","sources":["../../../src/abstract-document-xml/xsd-template/xsd-template.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuC;AACvC,iDAAmC;AACnC,kEAAoD;AAEpD,MAAM,WAAW,GAAG,GAAG,MAAM,CAAC,gBAAgB;EAC5C,QAAQ,CAAC,OAAO;EAChB,QAAQ,CAAC,cAAc;EACvB,QAAQ,CAAC,IAAI;EACb,QAAQ,CAAC,SAAS;EAClB,QAAQ,CAAC,KAAK;EACd,QAAQ,CAAC,SAAS;EAClB,QAAQ,CAAC,OAAO;EAChB,QAAQ,CAAC,SAAS;EAClB,QAAQ,CAAC,YAAY;EACrB,QAAQ,CAAC,UAAU;EACnB,MAAM,CAAC,QAAQ;EACf,MAAM,CAAC,eAAe;EACtB,QAAQ,CAAC,KAAK;EACd,MAAM,CAAC,UAAU;EACjB,MAAM,CAAC,SAAS;EAChB,MAAM,CAAC,cAAc;EACrB,MAAM,CAAC,UAAU;EACjB,QAAQ,CAAC,SAAS;EAClB,QAAQ,CAAC,QAAQ;EACjB,MAAM,CAAC,cAAc;EACrB,QAAQ,CAAC,QAAQ;EACjB,QAAQ,CAAC,UAAU;EACnB,QAAQ,CAAC,KAAK;EACd,QAAQ,CAAC,SAAS;EAClB,cAAc,CAAC,aAAa;EAC5B,cAAc,CAAC,QAAQ;EACvB,cAAc,CAAC,OAAO,EAAE,CAAC;AAEd,QAAA,GAAG,GAAG;;MAEb,WAAW;MACX,MAAM,CAAC,UAAU;MACjB,MAAM,CAAC,SAAS;MAChB,QAAQ,CAAC,WAAW;aACb,CAAC;AAED,QAAA,UAAU,GAAG;;MAEpB,QAAQ,CAAC,OAAO;MAChB,WAAW;;;;;;aAMJ,CAAC"}
1
+ {"version":3,"file":"xsd-template.js","sourceRoot":"","sources":["../../../src/abstract-document-xml/xsd-template/xsd-template.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuC;AACvC,iDAAmC;AACnC,kEAAoD;AAEpD,MAAM,WAAW,GAAG,GAAG,MAAM,CAAC,gBAAgB;EAC5C,QAAQ,CAAC,OAAO;EAChB,QAAQ,CAAC,cAAc;EACvB,QAAQ,CAAC,IAAI;EACb,QAAQ,CAAC,SAAS;EAClB,QAAQ,CAAC,KAAK;EACd,QAAQ,CAAC,SAAS;EAClB,QAAQ,CAAC,OAAO;EAChB,QAAQ,CAAC,SAAS;EAClB,QAAQ,CAAC,YAAY;EACrB,QAAQ,CAAC,UAAU;EACnB,MAAM,CAAC,QAAQ;EACf,MAAM,CAAC,eAAe;EACtB,QAAQ,CAAC,KAAK;EACd,MAAM,CAAC,UAAU;EACjB,MAAM,CAAC,SAAS;EAChB,MAAM,CAAC,cAAc;EACrB,MAAM,CAAC,UAAU;EACjB,QAAQ,CAAC,SAAS;EAClB,QAAQ,CAAC,QAAQ;EACjB,MAAM,CAAC,cAAc;EACrB,QAAQ,CAAC,QAAQ;EACjB,QAAQ,CAAC,UAAU;EACnB,QAAQ,CAAC,KAAK;EACd,QAAQ,CAAC,SAAS;EAClB,cAAc,CAAC,OAAO;EACtB,cAAc,CAAC,QAAQ;EACvB,cAAc,CAAC,aAAa;EAC5B,cAAc,CAAC,QAAQ;EACvB,cAAc,CAAC,SAAS;EACxB,cAAc,CAAC,cAAc,EAAE,CAAC;AAErB,QAAA,GAAG,GAAG;;MAEb,WAAW;MACX,MAAM,CAAC,UAAU;MACjB,MAAM,CAAC,SAAS;MAChB,QAAQ,CAAC,WAAW;aACb,CAAC;AAED,QAAA,UAAU,GAAG;;MAEpB,QAAQ,CAAC,OAAO;MAChB,WAAW;;;;;;aAMJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abstract-document",
3
- "version": "6.10.4",
3
+ "version": "6.12.1",
4
4
  "description": "Dynamically create documents using code or JSX and render to any format",
5
5
  "repository": "https://github.com/dividab/abstract-visuals/tree/master/packages/abstract-document",
6
6
  "main": "lib/index.js",
@@ -40,5 +40,5 @@
40
40
  "jszip": "^3.10.1",
41
41
  "pdf2json": "2.0.1"
42
42
  },
43
- "gitHead": "e78e62680b8ae6ff53cd593c1e229c34573ec2e2"
43
+ "gitHead": "c65fd6dd950955ee50fecf1b067bf42808f8ccd8"
44
44
  }
@@ -4,11 +4,6 @@ import { TextRun } from "./text-run";
4
4
  import { HyperLink } from "./hyper-link";
5
5
  import { TocSeparator } from "./toc-separator";
6
6
  import { LinkTarget } from "./link-target";
7
+ import { LineBreak } from "./line-break";
7
8
 
8
- export type Atom =
9
- | Image
10
- | TextField
11
- | TextRun
12
- | HyperLink
13
- | TocSeparator
14
- | LinkTarget;
9
+ export type Atom = Image | TextField | TextRun | HyperLink | TocSeparator | LinkTarget | LineBreak;
@@ -0,0 +1,11 @@
1
+ export interface LineBreak {
2
+ readonly type: "LineBreak";
3
+ }
4
+
5
+ export interface LineBreakProps {}
6
+
7
+ export function create(props?: LineBreakProps): LineBreak {
8
+ return {
9
+ type: "LineBreak",
10
+ };
11
+ }
@@ -5,6 +5,7 @@ import * as TextField from "./atoms/text-field";
5
5
  import * as TextRun from "./atoms/text-run";
6
6
  import * as HyperLink from "./atoms/hyper-link";
7
7
  import * as LinkTarget from "./atoms/link-target";
8
+ import * as LineBreak from "./atoms/line-break";
8
9
  import * as TocSeparator from "./atoms/toc-separator";
9
10
  import * as Font from "./primitives/font";
10
11
  import * as Numbering from "./numberings/numbering";
@@ -50,6 +51,7 @@ export {
50
51
  TextRun,
51
52
  HyperLink,
52
53
  LinkTarget,
54
+ LineBreak,
53
55
  TocSeparator,
54
56
  Font,
55
57
  Numbering,
@@ -28,12 +28,12 @@ function preProcessMarkdownAst(
28
28
  d: number,
29
29
  listItemParams: ListItemParams | undefined = undefined
30
30
  ): MarkDownProcessData {
31
- if (ast.type === "text") {
31
+ if (ast.type === "text" || ast.type === "break") {
32
32
  return { atoms, paragraphs };
33
33
  } // Need to convice TS that we never go below this line with a Str element.
34
34
 
35
35
  if (ast.children) {
36
- ast.children.forEach((child) => {
36
+ ast.children.forEach((child, i) => {
37
37
  let style = styles.slice(); // create a new copy of styles
38
38
  switch (ast.type) {
39
39
  case "heading":
@@ -91,6 +91,8 @@ function preProcessMarkdownAst(
91
91
  )
92
92
  );
93
93
  atoms = []; // Flush the Atoms-array for the next paragraph.
94
+ } else if (child.type === "break") {
95
+ atoms.push({ type: "LineBreak" });
94
96
  } else if (child.type === "text") {
95
97
  atoms = atoms.concat(
96
98
  child.value.split("\n").map(
@@ -9,7 +9,8 @@ export type AstChildElements =
9
9
  | AstSubscript
10
10
  | AstSuperscript
11
11
  | AstList
12
- | AstListItem;
12
+ | AstListItem
13
+ | AstBreak;
13
14
  export type AstElements = AstRoot | AstChildElements;
14
15
 
15
16
  export interface AstMetaLoc {
@@ -72,6 +73,10 @@ export interface AstListItem {
72
73
  readonly children: Array<AstChildElements>;
73
74
  }
74
75
 
76
+ export interface AstBreak {
77
+ readonly type: "break";
78
+ }
79
+
75
80
  export interface MarkDownProcessData {
76
81
  readonly atoms: Array<AD.Atom.Atom>;
77
82
  readonly paragraphs: Array<AD.Paragraph.Paragraph>;
@@ -14,11 +14,7 @@ export interface GroupStyleProps {
14
14
 
15
15
  export function create(props?: GroupStyleProps): GroupStyle {
16
16
  const { margins = LayoutFoundation.create(), position = "relative" } = props || {};
17
- return {
18
- type: "GroupStyle",
19
- margins,
20
- position,
21
- };
17
+ return { type: "GroupStyle", margins, position };
22
18
  }
23
19
 
24
20
  export function overrideWith(overrider: GroupStyle | undefined, toOverride: GroupStyle | undefined): GroupStyle {
@@ -0,0 +1,77 @@
1
+ import React from "react";
2
+ import { ExportTestDef } from "../export-test-def";
3
+ import { Paragraph, AbstractDoc, Section, TextRun, LineBreak } from "../../../../abstract-document-jsx";
4
+
5
+ export const test: ExportTestDef = {
6
+ name: "Manual line breaks empty lines",
7
+ abstractDocJsx: (
8
+ <AbstractDoc>
9
+ <Section>
10
+ <Paragraph>
11
+ <LineBreak />
12
+ <TextRun text={"Hello"} />
13
+ <LineBreak />
14
+ <LineBreak />
15
+ </Paragraph>
16
+ <Paragraph>
17
+ <TextRun text={"World"} />
18
+ </Paragraph>
19
+ </Section>
20
+ </AbstractDoc>
21
+ ),
22
+ expectedPdfJson: {
23
+ Transcoder: "pdf2json@2.0.1 [https://github.com/modesty/pdf2json]",
24
+ Meta: {
25
+ PDFFormatVersion: "1.3",
26
+ IsAcroFormPresent: false,
27
+ IsXFAPresent: false,
28
+ Creator: "PDFKit",
29
+ Producer: "PDFKit",
30
+ CreationDate: "*",
31
+ Metadata: {},
32
+ },
33
+ Pages: [
34
+ {
35
+ Width: 37.188,
36
+ Height: 52.625,
37
+ HLines: [],
38
+ VLines: [],
39
+ Fills: [],
40
+ Texts: [
41
+ {
42
+ x: -0.25,
43
+ y: 0.42100000000000004,
44
+ w: 22.78,
45
+ oc: undefined,
46
+ sw: 0.32553125,
47
+ A: "left",
48
+ R: [
49
+ {
50
+ T: "Hello",
51
+ S: -1,
52
+ TS: [0, 13, 0, 0],
53
+ },
54
+ ],
55
+ },
56
+ {
57
+ x: -0.25,
58
+ y: 1.866,
59
+ w: 26.11,
60
+ oc: undefined,
61
+ sw: 0.32553125,
62
+ A: "left",
63
+ R: [
64
+ {
65
+ T: "World",
66
+ S: -1,
67
+ TS: [0, 13, 0, 0],
68
+ },
69
+ ],
70
+ },
71
+ ],
72
+ Fields: [],
73
+ Boxsets: [],
74
+ },
75
+ ],
76
+ },
77
+ };
@@ -0,0 +1,73 @@
1
+ import React from "react";
2
+ import { ExportTestDef } from "../export-test-def";
3
+ import { Paragraph, AbstractDoc, Section, TextRun, LineBreak } from "../../../../abstract-document-jsx";
4
+
5
+ export const test: ExportTestDef = {
6
+ name: "Manual line break",
7
+ abstractDocJsx: (
8
+ <AbstractDoc>
9
+ <Section>
10
+ <Paragraph>
11
+ <TextRun text={"Hello"} />
12
+ <LineBreak />
13
+ <TextRun text={"World"} />
14
+ </Paragraph>
15
+ </Section>
16
+ </AbstractDoc>
17
+ ),
18
+ expectedPdfJson: {
19
+ Transcoder: "pdf2json@2.0.1 [https://github.com/modesty/pdf2json]",
20
+ Meta: {
21
+ PDFFormatVersion: "1.3",
22
+ IsAcroFormPresent: false,
23
+ IsXFAPresent: false,
24
+ Creator: "PDFKit",
25
+ Producer: "PDFKit",
26
+ CreationDate: "*",
27
+ Metadata: {},
28
+ },
29
+ Pages: [
30
+ {
31
+ Width: 37.188,
32
+ Height: 52.625,
33
+ HLines: [],
34
+ VLines: [],
35
+ Fills: [],
36
+ Fields: [],
37
+ Boxsets: [],
38
+ Texts: [
39
+ {
40
+ x: -0.25,
41
+ y: -0.301,
42
+ w: 22.78,
43
+ oc: undefined,
44
+ sw: 0.32553125,
45
+ A: "left",
46
+ R: [
47
+ {
48
+ T: "Hello",
49
+ S: -1,
50
+ TS: [0, 13, 0, 0],
51
+ },
52
+ ],
53
+ },
54
+ {
55
+ x: -0.25,
56
+ y: 0.42100000000000004,
57
+ w: 26.11,
58
+ oc: undefined,
59
+ sw: 0.32553125,
60
+ A: "left",
61
+ R: [
62
+ {
63
+ T: "World",
64
+ S: -1,
65
+ TS: [0, 13, 0, 0],
66
+ },
67
+ ],
68
+ },
69
+ ],
70
+ },
71
+ ],
72
+ },
73
+ };
@@ -53,7 +53,7 @@ endobj
53
53
  (PDFKit)
54
54
  endobj
55
55
  12 0 obj
56
- (D:20230525131540Z)
56
+ (D:20231008070041Z)
57
57
  endobj
58
58
  9 0 obj
59
59
  <<
@@ -116,7 +116,7 @@ trailer
116
116
  /Size 13
117
117
  /Root 3 0 R
118
118
  /Info 9 0 R
119
- /ID [<d1e03430ceea42691e83a4859ed46338> <d1e03430ceea42691e83a4859ed46338>]
119
+ /ID [<541883f37d8e5d59fd1919683ce468ea> <541883f37d8e5d59fd1919683ce468ea>]
120
120
  >>
121
121
  startxref
122
122
  1104
@@ -103,7 +103,7 @@ endobj
103
103
  (PDFKit)
104
104
  endobj
105
105
  12 0 obj
106
- (D:20230525131540Z)
106
+ (D:20231008070041Z)
107
107
  endobj
108
108
  9 0 obj
109
109
  <<
@@ -166,7 +166,7 @@ trailer
166
166
  /Size 13
167
167
  /Root 3 0 R
168
168
  /Info 9 0 R
169
- /ID [<92f1348ebc31c3ceb17883aaabfdcce8> <92f1348ebc31c3ceb17883aaabfdcce8>]
169
+ /ID [<2028e1c01617b9e0c2e1b3782c838c65> <2028e1c01617b9e0c2e1b3782c838c65>]
170
170
  >>
171
171
  startxref
172
172
  1492