abstract-document 6.9.0 → 6.9.2

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 (396) hide show
  1. package/CHANGELOG.md +150 -127
  2. package/LICENSE +21 -21
  3. package/README.md +45 -45
  4. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/group.d.ts.map +1 -1
  5. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/group.js +229 -92
  6. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/group.js.map +1 -1
  7. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/header-and-footer.js +69 -69
  8. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/hello.js +51 -51
  9. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/letter-dimensions.js +51 -51
  10. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/mixed-hyperlink-and-textrun.js +115 -115
  11. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/mixed-textrun-and-images.js +169 -169
  12. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/multiple-images.js +141 -141
  13. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/multiple-tables.js +467 -467
  14. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/multiple-textrun-with-center-alignment.js +97 -97
  15. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/multiple-textrun-with-end-alignment.js +97 -97
  16. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/multiple-textrun-with-start-alignment-that-linebreaks.js +96 -96
  17. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/multiple-textrun-with-start-alignment.js +96 -96
  18. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/page-numbering.js +102 -102
  19. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/page-orientation-landscape.d.ts +3 -0
  20. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/page-orientation-landscape.d.ts.map +1 -0
  21. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/page-orientation-landscape.js +94 -0
  22. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/page-orientation-landscape.js.map +1 -0
  23. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/page-orientation-portrait.d.ts +3 -0
  24. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/page-orientation-portrait.d.ts.map +1 -0
  25. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/page-orientation-portrait.js +94 -0
  26. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/page-orientation-portrait.js.map +1 -0
  27. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/simple-table-colSpan-and-rowSpan.js +498 -498
  28. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/simple-table-without-rows.js +20 -20
  29. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/simple-table.js +167 -167
  30. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-hyperlink.js +70 -70
  31. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-image-png.d.ts +3 -0
  32. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-image-png.d.ts.map +1 -0
  33. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-image-png.js +149 -0
  34. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-image-png.js.map +1 -0
  35. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-image-svg.d.ts +3 -0
  36. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-image-svg.d.ts.map +1 -0
  37. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-image-svg.js +149 -0
  38. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-image-svg.js.map +1 -0
  39. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-image.js +97 -97
  40. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-center-alignment-that-linebreaks.js +68 -68
  41. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-center-alignment.js +68 -68
  42. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-end-alignment-that-linebreaks.js +68 -68
  43. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-end-alignment.js +68 -68
  44. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-start-alignment-that-linebreaks.js +68 -68
  45. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-start-alignment.js +68 -68
  46. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun.js +68 -68
  47. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/toc-separator.d.ts +3 -0
  48. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/toc-separator.d.ts.map +1 -0
  49. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/toc-separator.js +67 -0
  50. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/toc-separator.js.map +1 -0
  51. package/lib/abstract-document-exporters/__tests__/docx2/test-defs/world.js +51 -51
  52. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/group.d.ts +3 -0
  53. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/group.d.ts.map +1 -0
  54. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/group.js +83 -0
  55. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/group.js.map +1 -0
  56. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-auto-cell-widths.d.ts +3 -0
  57. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-auto-cell-widths.d.ts.map +1 -0
  58. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-auto-cell-widths.js +105 -0
  59. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-auto-cell-widths.js.map +1 -0
  60. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-fixed-cell-widths.d.ts +3 -0
  61. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-fixed-cell-widths.d.ts.map +1 -0
  62. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-fixed-cell-widths.js +104 -0
  63. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-fixed-cell-widths.js.map +1 -0
  64. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/simple-table.d.ts +3 -0
  65. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/simple-table.d.ts.map +1 -0
  66. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/simple-table.js +104 -0
  67. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/simple-table.js.map +1 -0
  68. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-image-url.d.ts +3 -0
  69. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-image-url.d.ts.map +1 -0
  70. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-image-url.js +86 -0
  71. package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-image-url.js.map +1 -0
  72. package/lib/abstract-document-exporters/docx2/render.js +29 -17
  73. package/lib/abstract-document-exporters/docx2/render.js.map +1 -1
  74. package/package.json +3 -3
  75. package/src/abstract-document/__tests__/hello-world-abstract-doc.ts +245 -245
  76. package/src/abstract-document/__tests__/markdown/export-test-def.ts +10 -10
  77. package/src/abstract-document/__tests__/markdown/export.test.tsx +15 -15
  78. package/src/abstract-document/__tests__/markdown/test-defs/markdown-bold-italic.tsx +31 -31
  79. package/src/abstract-document/__tests__/markdown/test-defs/markdown-bold.tsx +31 -31
  80. package/src/abstract-document/__tests__/markdown/test-defs/markdown-empty-keepTogether.tsx +54 -54
  81. package/src/abstract-document/__tests__/markdown/test-defs/markdown-header.tsx +38 -38
  82. package/src/abstract-document/__tests__/markdown/test-defs/markdown-italic.tsx +31 -31
  83. package/src/abstract-document/__tests__/markdown/test-defs/markdown-keepTogether.tsx +61 -61
  84. package/src/abstract-document/__tests__/markdown/test-defs/markdown-subscript.tsx +45 -45
  85. package/src/abstract-document/__tests__/markdown/test-defs/markdown-superscript.tsx +38 -38
  86. package/src/abstract-document/__tests__/model-builder._test.ts +48 -48
  87. package/src/abstract-document/abstract-doc.ts +19 -19
  88. package/src/abstract-document/atoms/atom.ts +14 -14
  89. package/src/abstract-document/atoms/hyper-link.ts +27 -27
  90. package/src/abstract-document/atoms/image.ts +21 -21
  91. package/src/abstract-document/atoms/link-target.ts +15 -15
  92. package/src/abstract-document/atoms/text-field.ts +36 -36
  93. package/src/abstract-document/atoms/text-run.ts +25 -25
  94. package/src/abstract-document/atoms/toc-separator.ts +18 -18
  95. package/src/abstract-document/default-styles.ts +145 -145
  96. package/src/abstract-document/index.ts +89 -89
  97. package/src/abstract-document/markdown/markdown.ts +142 -142
  98. package/src/abstract-document/markdown/types.ts +78 -78
  99. package/src/abstract-document/numberings/numbering-definition.ts +17 -17
  100. package/src/abstract-document/numberings/numbering-format.ts +7 -7
  101. package/src/abstract-document/numberings/numbering-level-definition.ts +42 -42
  102. package/src/abstract-document/numberings/numbering.ts +3 -3
  103. package/src/abstract-document/page/master-page.ts +23 -23
  104. package/src/abstract-document/page/section.ts +27 -27
  105. package/src/abstract-document/primitives/font.ts +37 -37
  106. package/src/abstract-document/primitives/image-resource.ts +27 -27
  107. package/src/abstract-document/primitives/layout-foundation-color.ts +37 -37
  108. package/src/abstract-document/primitives/layout-foundation.ts +37 -37
  109. package/src/abstract-document/primitives/length.ts +11 -11
  110. package/src/abstract-document/primitives/point.ts +11 -11
  111. package/src/abstract-document/primitives/rect.ts +15 -15
  112. package/src/abstract-document/primitives/size.ts +13 -13
  113. package/src/abstract-document/resources.ts +101 -101
  114. package/src/abstract-document/section-elements/group.ts +28 -28
  115. package/src/abstract-document/section-elements/page-break.ts +14 -14
  116. package/src/abstract-document/section-elements/paragraph-numbering.ts +6 -6
  117. package/src/abstract-document/section-elements/paragraph.ts +32 -32
  118. package/src/abstract-document/section-elements/section-element.ts +17 -17
  119. package/src/abstract-document/section-elements/table.ts +34 -34
  120. package/src/abstract-document/styles/group-style.ts +30 -30
  121. package/src/abstract-document/styles/page-style.ts +76 -76
  122. package/src/abstract-document/styles/paragraph-style.ts +49 -49
  123. package/src/abstract-document/styles/position.ts +8 -8
  124. package/src/abstract-document/styles/style-key.ts +5 -5
  125. package/src/abstract-document/styles/style.ts +44 -44
  126. package/src/abstract-document/styles/table-cell-style.ts +59 -59
  127. package/src/abstract-document/styles/table-style.ts +46 -46
  128. package/src/abstract-document/styles/text-style.ts +77 -77
  129. package/src/abstract-document/table/table-cell.ts +31 -31
  130. package/src/abstract-document/table/table-row.ts +14 -14
  131. package/src/abstract-document/types.ts +3 -3
  132. package/src/abstract-document-exporters/__tests__/docx2/export-test-def.ts +10 -10
  133. package/src/abstract-document-exporters/__tests__/docx2/export.test.tsx +67 -67
  134. package/src/abstract-document-exporters/__tests__/docx2/test-defs/group.tsx +267 -114
  135. package/src/abstract-document-exporters/__tests__/docx2/test-defs/header-and-footer.tsx +110 -110
  136. package/src/abstract-document-exporters/__tests__/docx2/test-defs/hello.tsx +70 -70
  137. package/src/abstract-document-exporters/__tests__/docx2/test-defs/letter-dimensions.tsx +74 -74
  138. package/src/abstract-document-exporters/__tests__/docx2/test-defs/mixed-hyperlink-and-textrun.tsx +137 -137
  139. package/src/abstract-document-exporters/__tests__/docx2/test-defs/mixed-textrun-and-images.tsx +217 -217
  140. package/src/abstract-document-exporters/__tests__/docx2/test-defs/multiple-images.tsx +187 -187
  141. package/src/abstract-document-exporters/__tests__/docx2/test-defs/multiple-tables.tsx +553 -553
  142. package/src/abstract-document-exporters/__tests__/docx2/test-defs/multiple-textrun-with-center-alignment.tsx +119 -119
  143. package/src/abstract-document-exporters/__tests__/docx2/test-defs/multiple-textrun-with-end-alignment.tsx +119 -119
  144. package/src/abstract-document-exporters/__tests__/docx2/test-defs/multiple-textrun-with-start-alignment-that-linebreaks.tsx +121 -121
  145. package/src/abstract-document-exporters/__tests__/docx2/test-defs/multiple-textrun-with-start-alignment.tsx +118 -118
  146. package/src/abstract-document-exporters/__tests__/docx2/test-defs/page-numbering.tsx +123 -123
  147. package/src/abstract-document-exporters/__tests__/docx2/test-defs/page-orientation-landscape.tsx +76 -0
  148. package/src/abstract-document-exporters/__tests__/docx2/test-defs/page-orientation-portrait.tsx +76 -0
  149. package/src/abstract-document-exporters/__tests__/docx2/test-defs/simple-table-colSpan-and-rowSpan.tsx +587 -587
  150. package/src/abstract-document-exporters/__tests__/docx2/test-defs/simple-table-without-rows.tsx +45 -45
  151. package/src/abstract-document-exporters/__tests__/docx2/test-defs/simple-table.tsx +210 -210
  152. package/src/abstract-document-exporters/__tests__/docx2/test-defs/single-hyperlink.tsx +89 -89
  153. package/src/abstract-document-exporters/__tests__/docx2/test-defs/single-image.tsx +142 -142
  154. package/src/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-center-alignment-that-linebreaks.tsx +88 -88
  155. package/src/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-center-alignment.tsx +88 -88
  156. package/src/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-end-alignment-that-linebreaks.tsx +88 -88
  157. package/src/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-end-alignment.tsx +88 -88
  158. package/src/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-start-alignment-that-linebreaks.tsx +88 -88
  159. package/src/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-start-alignment.tsx +88 -88
  160. package/src/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun.tsx +87 -87
  161. package/src/abstract-document-exporters/__tests__/docx2/test-defs/toc-separator.tsx +67 -0
  162. package/src/abstract-document-exporters/__tests__/docx2/test-defs/world.tsx +70 -70
  163. package/src/abstract-document-exporters/__tests__/docx2/tmp/Group.docx +0 -0
  164. 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
  165. 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
  166. 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
  167. package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple images.docx +0 -0
  168. package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple tables.docx +0 -0
  169. package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with Center alignment.docx +0 -0
  170. package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with End alignment.docx +0 -0
  171. package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with Start alignment that linebreaks.docx +0 -0
  172. package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with Start alignment.docx +0 -0
  173. package/src/abstract-document-exporters/__tests__/docx2/tmp/Page numbering.docx +0 -0
  174. 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
  175. package/src/abstract-document-exporters/__tests__/docx2/tmp/Simple table without rows.docx +0 -0
  176. package/src/abstract-document-exporters/__tests__/docx2/tmp/Simple table.docx +0 -0
  177. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single hyperlink.docx +0 -0
  178. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single image svg.docx +0 -0
  179. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single image.docx +0 -0
  180. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Center alignment that linebreaks.docx +0 -0
  181. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Center alignment.docx +0 -0
  182. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with End alignment that linebreaks.docx +0 -0
  183. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with End alignment.docx +0 -0
  184. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Start alignment that linebreaks.docx +0 -0
  185. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Start alignment.docx +0 -0
  186. package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun.docx +0 -0
  187. package/src/abstract-document-exporters/__tests__/docx2/tmp/hello.docx +0 -0
  188. package/src/abstract-document-exporters/__tests__/docx2/tmp/letter-dimensions.docx +0 -0
  189. package/src/abstract-document-exporters/__tests__/docx2/tmp/page-orientation-landscape.docx +0 -0
  190. package/src/abstract-document-exporters/__tests__/docx2/tmp/page-orientation-portrait.docx +0 -0
  191. package/src/abstract-document-exporters/__tests__/docx2/tmp/tocSeparator.docx +0 -0
  192. package/src/abstract-document-exporters/__tests__/docx2/tmp/world.docx +0 -0
  193. package/src/abstract-document-exporters/__tests__/pdf/export-test-def.ts +10 -10
  194. package/src/abstract-document-exporters/__tests__/pdf/export.test.tsx +46 -46
  195. package/src/abstract-document-exporters/__tests__/pdf/test-defs/absolute-position-group.tsx +77 -77
  196. package/src/abstract-document-exporters/__tests__/pdf/test-defs/absolute-position-header-and-footer.tsx +205 -205
  197. package/src/abstract-document-exporters/__tests__/pdf/test-defs/absolute-position-paragraph.tsx +51 -51
  198. package/src/abstract-document-exporters/__tests__/pdf/test-defs/absolute-position-section-in-group.tsx +96 -96
  199. package/src/abstract-document-exporters/__tests__/pdf/test-defs/absolute-position-section-in-table.tsx +145 -145
  200. package/src/abstract-document-exporters/__tests__/pdf/test-defs/absolute-position-table.tsx +117 -117
  201. package/src/abstract-document-exporters/__tests__/pdf/test-defs/date.tsx +66 -66
  202. package/src/abstract-document-exporters/__tests__/pdf/test-defs/group-no-keep-together.tsx +1287 -1287
  203. package/src/abstract-document-exporters/__tests__/pdf/test-defs/group-paragraphs.tsx +1291 -1291
  204. package/src/abstract-document-exporters/__tests__/pdf/test-defs/group-tables.tsx +1314 -1314
  205. package/src/abstract-document-exporters/__tests__/pdf/test-defs/group-too-big-for-one-page.tsx +272 -272
  206. package/src/abstract-document-exporters/__tests__/pdf/test-defs/header-and-footer.tsx +162 -162
  207. package/src/abstract-document-exporters/__tests__/pdf/test-defs/hello.tsx +45 -45
  208. package/src/abstract-document-exporters/__tests__/pdf/test-defs/hyperlink-intenal-link-target.tsx +831 -831
  209. package/src/abstract-document-exporters/__tests__/pdf/test-defs/hyperlink-internal.tsx +811 -811
  210. package/src/abstract-document-exporters/__tests__/pdf/test-defs/margins-header-body-footer.tsx +1008 -1008
  211. package/src/abstract-document-exporters/__tests__/pdf/test-defs/mixed-hyperlink-and-textrun-no-underline.tsx +114 -114
  212. package/src/abstract-document-exporters/__tests__/pdf/test-defs/mixed-hyperlink-and-textrun-with-underline.tsx +114 -114
  213. package/src/abstract-document-exporters/__tests__/pdf/test-defs/mixed-hyperlink-and-textrun.tsx +113 -113
  214. package/src/abstract-document-exporters/__tests__/pdf/test-defs/mixed-textrun-and-images.tsx +109 -109
  215. package/src/abstract-document-exporters/__tests__/pdf/test-defs/multiple-images-overflow.tsx +80 -80
  216. package/src/abstract-document-exporters/__tests__/pdf/test-defs/multiple-images.tsx +76 -76
  217. package/src/abstract-document-exporters/__tests__/pdf/test-defs/multiple-textrun-with-center-alignment.tsx +98 -98
  218. package/src/abstract-document-exporters/__tests__/pdf/test-defs/multiple-textrun-with-end-alignment.tsx +98 -98
  219. package/src/abstract-document-exporters/__tests__/pdf/test-defs/multiple-textrun-with-start-alignment-that-linebreaks.tsx +116 -116
  220. package/src/abstract-document-exporters/__tests__/pdf/test-defs/multiple-textrun-with-start-alignment.tsx +98 -98
  221. package/src/abstract-document-exporters/__tests__/pdf/test-defs/page-break-table-row-that-doesnt-fit-page.tsx +317 -317
  222. package/src/abstract-document-exporters/__tests__/pdf/test-defs/page-break-table-single-row.tsx +227 -227
  223. package/src/abstract-document-exporters/__tests__/pdf/test-defs/page-break-table-with-group.tsx +500 -500
  224. package/src/abstract-document-exporters/__tests__/pdf/test-defs/page-break-table-with-header.tsx +1555 -1555
  225. package/src/abstract-document-exporters/__tests__/pdf/test-defs/page-break-table-with-header2.tsx +824 -824
  226. package/src/abstract-document-exporters/__tests__/pdf/test-defs/page-break-table-with-margin-bottom.tsx +455 -455
  227. package/src/abstract-document-exporters/__tests__/pdf/test-defs/page-break-table-with-margin-top-single-table.tsx +354 -354
  228. package/src/abstract-document-exporters/__tests__/pdf/test-defs/page-break-table-with-margin-top.tsx +455 -455
  229. package/src/abstract-document-exporters/__tests__/pdf/test-defs/page-break-table-with-rowSpan-multipages.tsx +1567 -1567
  230. package/src/abstract-document-exporters/__tests__/pdf/test-defs/page-break-table-with-rowSpan.tsx +545 -545
  231. package/src/abstract-document-exporters/__tests__/pdf/test-defs/page-numbering.tsx +97 -97
  232. package/src/abstract-document-exporters/__tests__/pdf/test-defs/pagebreak.tsx +102 -102
  233. package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-all-auto-cell-widths.tsx +119 -119
  234. package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-all-fixed-cell-widths.tsx +119 -119
  235. package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-background.tsx +182 -182
  236. package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-cell-padding-image.tsx +205 -205
  237. package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-cell-padding-text.tsx +338 -338
  238. package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-center-alignment.tsx +114 -114
  239. package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-colSpan-and-rowSpan.tsx +425 -425
  240. package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-mix-auto-fix-cell-widths.tsx +119 -119
  241. package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-padding.tsx +115 -115
  242. package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-right-alignment.tsx +115 -115
  243. package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-row-alignment.tsx +297 -297
  244. package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-text-alignment-in-cell-wrapping.tsx +491 -491
  245. package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-text-alignment-in-cell.tsx +248 -248
  246. package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-with-default-colored-borders.tsx +223 -223
  247. package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-with-header.tsx +482 -482
  248. package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-with-multi-colored-borders.tsx +236 -236
  249. package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-with-single-colored-borders.tsx +236 -236
  250. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-figure.tsx +323 -323
  251. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-hyperlink-center.tsx +66 -66
  252. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-hyperlink-no-underline.tsx +70 -70
  253. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-hyperlink-right-aligned.tsx +66 -66
  254. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-hyperlink-with-underline.tsx +70 -70
  255. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-hyperlink.tsx +65 -65
  256. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-image-svg-color-hex.tsx +277 -277
  257. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-image-svg-color-name.tsx +277 -277
  258. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-image-svg-color-url.tsx +102 -102
  259. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-image-svg-dasharray.tsx +90 -90
  260. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-image-url.tsx +75 -0
  261. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-image.tsx +75 -75
  262. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-textrun-baseline-alphabetic.tsx +46 -46
  263. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-textrun-baseline-bottom.tsx +46 -46
  264. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-textrun-baseline-hanging.tsx +46 -46
  265. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-textrun-baseline-middle.tsx +46 -46
  266. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-textrun-baseline-top.tsx +46 -46
  267. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-textrun-super-subscript.tsx +98 -98
  268. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-textrun-with-center-alignment-that-linebreaks.tsx +81 -81
  269. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-textrun-with-center-alignment.tsx +66 -66
  270. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-textrun-with-end-alignment-that-linebreaks.tsx +81 -81
  271. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-textrun-with-end-alignment.tsx +66 -66
  272. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-textrun-with-justify-alignment.tsx +66 -66
  273. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-textrun-with-start-alignment-that-linebreaks.tsx +81 -81
  274. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-textrun-with-start-alignment.tsx +66 -66
  275. package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-textrun.tsx +45 -45
  276. package/src/abstract-document-exporters/__tests__/pdf/test-defs/table-of-content-separator.tsx +81 -81
  277. package/src/abstract-document-exporters/__tests__/pdf/test-defs/world.tsx +45 -45
  278. package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position group.pdf +2 -2
  279. package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position header and footer.pdf +2 -2
  280. package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position paragraph.pdf +2 -2
  281. package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position section in group.pdf +2 -2
  282. package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position section in table.pdf +2 -2
  283. package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position table.pdf +2 -2
  284. package/src/abstract-document-exporters/__tests__/pdf/tmp/Group Paragraphs.pdf +2 -2
  285. package/src/abstract-document-exporters/__tests__/pdf/tmp/Group Paratraphs.pdf +912 -0
  286. package/src/abstract-document-exporters/__tests__/pdf/tmp/Group Tables.pdf +2 -2
  287. package/src/abstract-document-exporters/__tests__/pdf/tmp/Group no keeptogether.pdf +2 -2
  288. package/src/abstract-document-exporters/__tests__/pdf/tmp/Group too big for one page.pdf +2 -2
  289. package/src/abstract-document-exporters/__tests__/pdf/tmp/Group.pdf +123 -0
  290. package/src/abstract-document-exporters/__tests__/pdf/tmp/Header and footer.pdf +2 -2
  291. package/src/abstract-document-exporters/__tests__/pdf/tmp/Hyperlink internal linktarget.pdf +2 -2
  292. package/src/abstract-document-exporters/__tests__/pdf/tmp/Hyperlink internal.pdf +2 -2
  293. package/src/abstract-document-exporters/__tests__/pdf/tmp/Margins header body footer.pdf +2 -2
  294. package/src/abstract-document-exporters/__tests__/pdf/tmp/Margins header body footer1.pdf +640 -0
  295. package/src/abstract-document-exporters/__tests__/pdf/tmp/Margins header body footer2.pdf +609 -0
  296. package/src/abstract-document-exporters/__tests__/pdf/tmp/Margins header body footer3.pdf +1188 -0
  297. package/src/abstract-document-exporters/__tests__/pdf/tmp/Margins header body footer4.pdf +1188 -0
  298. package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed hyperlink and textrun no underline.pdf +2 -2
  299. package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed hyperlink and textrun with underline.pdf +2 -2
  300. package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed hyperlink and textrun.pdf +2 -2
  301. 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
  302. package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple images overflow.pdf +0 -0
  303. package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple images.pdf +0 -0
  304. package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with Center alignment.pdf +2 -2
  305. package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with End alignment.pdf +2 -2
  306. package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with Start alignment that linebreaks.pdf +2 -2
  307. package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with Start alignment.pdf +2 -2
  308. package/src/abstract-document-exporters/__tests__/pdf/tmp/Page numbering.pdf +2 -2
  309. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table row that doesnt fit page.pdf +2 -2
  310. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table single row.pdf +2 -2
  311. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with group.pdf +2 -2
  312. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with header 2.pdf +2 -2
  313. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with header.pdf +2 -2
  314. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with margin bottom.pdf +2 -2
  315. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with margin top single table.pdf +2 -2
  316. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with margin top.pdf +2 -2
  317. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with rowSpan multipages.pdf +2 -2
  318. package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with rowSpan.pdf +2 -2
  319. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table all auto.pdf +2 -2
  320. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table all fix.pdf +2 -2
  321. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table auto.pdf +133 -0
  322. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table background.pdf +2 -2
  323. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table cell padding of image.pdf +0 -0
  324. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table cell padding of text.pdf +2 -2
  325. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table center alignment.pdf +2 -2
  326. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table colSpan and rowSpan.pdf +2 -2
  327. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table mix auto fix.pdf +2 -2
  328. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table one auto.pdf +133 -0
  329. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table padding.pdf +2 -2
  330. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table padding1.pdf +133 -0
  331. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table right alignment.pdf +2 -2
  332. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table row alignment.pdf +2 -2
  333. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table text alignment in cell with wrapping.pdf +2 -2
  334. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table text alignment in cell.pdf +2 -2
  335. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table with default colored borders.pdf +2 -2
  336. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table with header.pdf +2 -2
  337. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table with multi colored borders.pdf +2 -2
  338. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table with single colored borders.pdf +2 -2
  339. package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table.pdf +133 -0
  340. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single date.pdf +14 -14
  341. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single figure.pdf +2 -2
  342. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single hyperlink centered.pdf +2 -2
  343. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single hyperlink no underline.pdf +2 -2
  344. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single hyperlink right aligned.pdf +2 -2
  345. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single hyperlink.pdf +2 -2
  346. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image from URL.pdf +0 -0
  347. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg color hex.pdf +2 -2
  348. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg color name.pdf +2 -2
  349. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg color url.pdf +2 -2
  350. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg color.pdf +179 -0
  351. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg dasharray.pdf +2 -2
  352. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image.pdf +0 -0
  353. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline alphabetic.pdf +2 -2
  354. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline bottom.pdf +2 -2
  355. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline hanging.pdf +2 -2
  356. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline middle.pdf +2 -2
  357. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline top.pdf +2 -2
  358. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Center alignment that linebreaks.pdf +2 -2
  359. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Center alignment.pdf +2 -2
  360. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with End alignment that linebreaks.pdf +2 -2
  361. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with End alignment.pdf +2 -2
  362. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Justify alignment.pdf +2 -2
  363. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Start alignment that linebreaks.pdf +2 -2
  364. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Start alignment.pdf +2 -2
  365. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with super and subscripts.pdf +2 -2
  366. package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun.pdf +2 -2
  367. package/src/abstract-document-exporters/__tests__/pdf/tmp/Table of content separator.pdf +2 -2
  368. package/src/abstract-document-exporters/__tests__/pdf/tmp/hello.pdf +2 -2
  369. package/src/abstract-document-exporters/__tests__/pdf/tmp/world.pdf +2 -2
  370. package/src/abstract-document-exporters/docx/document-container.ts +18 -18
  371. package/src/abstract-document-exporters/docx/docx-constants.ts +46 -46
  372. package/src/abstract-document-exporters/docx/docx-document-renderer.ts +1084 -1084
  373. package/src/abstract-document-exporters/docx/ref-container.ts +53 -53
  374. package/src/abstract-document-exporters/docx/string-utils.ts +39 -39
  375. package/src/abstract-document-exporters/docx/xml-writer.ts +333 -333
  376. package/src/abstract-document-exporters/docx2/render-image.ts +159 -159
  377. package/src/abstract-document-exporters/docx2/render.ts +516 -496
  378. package/src/abstract-document-exporters/index.ts +5 -5
  379. package/src/abstract-document-exporters/pdf/font.ts +76 -76
  380. package/src/abstract-document-exporters/pdf/measure.ts +418 -418
  381. package/src/abstract-document-exporters/pdf/paginate.ts +434 -434
  382. package/src/abstract-document-exporters/pdf/pre-process.ts +389 -389
  383. package/src/abstract-document-exporters/pdf/render-image.ts +221 -221
  384. package/src/abstract-document-exporters/pdf/render.ts +847 -847
  385. package/src/abstract-document-exporters/pdf/update-refs.ts +163 -163
  386. package/src/abstract-document-exporters/shared/get_resources.ts +71 -71
  387. package/src/abstract-document-jsx/index.ts +86 -86
  388. package/src/custom_typings/@textlint/markdown-to-ast/index.d.ts +1 -1
  389. package/src/custom_typings/json-diff/index.d.ts +1 -1
  390. package/src/custom_typings/markdown-parser/index.d.ts +1 -1
  391. package/src/custom_typings/pdf2json/index.d.ts +1 -1
  392. package/src/custom_typings/remark-parse/index.d.ts +1 -1
  393. package/src/custom_typings/remark-sub-super/index.d.ts +1 -1
  394. package/src/custom_typings/svg-to-pdfkit/index.d.ts +1 -1
  395. package/src/custom_typings/unified/index.d.ts +1 -1
  396. package/src/index.ts +5 -5
@@ -1,19 +1,19 @@
1
- import { Section } from "./page/section";
2
- import { Resources } from "./resources";
3
-
4
- export type AbstractDoc = Resources & {
5
- readonly children: ReadonlyArray<Section>;
6
- };
7
-
8
- export type AbstractDocProps = Resources & {};
9
-
10
- export function create(
11
- props?: AbstractDocProps,
12
- children?: ReadonlyArray<Section>
13
- ): AbstractDoc {
14
- const { ...rest } = props || {};
15
- return {
16
- children: children || [],
17
- ...rest
18
- };
19
- }
1
+ import { Section } from "./page/section";
2
+ import { Resources } from "./resources";
3
+
4
+ export type AbstractDoc = Resources & {
5
+ readonly children: ReadonlyArray<Section>;
6
+ };
7
+
8
+ export type AbstractDocProps = Resources & {};
9
+
10
+ export function create(
11
+ props?: AbstractDocProps,
12
+ children?: ReadonlyArray<Section>
13
+ ): AbstractDoc {
14
+ const { ...rest } = props || {};
15
+ return {
16
+ children: children || [],
17
+ ...rest
18
+ };
19
+ }
@@ -1,14 +1,14 @@
1
- import { Image } from "./image";
2
- import { TextField } from "./text-field";
3
- import { TextRun } from "./text-run";
4
- import { HyperLink } from "./hyper-link";
5
- import { TocSeparator } from "./toc-separator";
6
- import { LinkTarget } from "./link-target";
7
-
8
- export type Atom =
9
- | Image
10
- | TextField
11
- | TextRun
12
- | HyperLink
13
- | TocSeparator
14
- | LinkTarget;
1
+ import { Image } from "./image";
2
+ import { TextField } from "./text-field";
3
+ import { TextRun } from "./text-run";
4
+ import { HyperLink } from "./hyper-link";
5
+ import { TocSeparator } from "./toc-separator";
6
+ import { LinkTarget } from "./link-target";
7
+
8
+ export type Atom =
9
+ | Image
10
+ | TextField
11
+ | TextRun
12
+ | HyperLink
13
+ | TocSeparator
14
+ | LinkTarget;
@@ -1,27 +1,27 @@
1
- import * as TextStyle from "../styles/text-style";
2
-
3
- export interface HyperLink {
4
- readonly type: "HyperLink";
5
- readonly styleName: string;
6
- readonly text: string;
7
- readonly target: string;
8
- readonly style: TextStyle.TextStyle;
9
- }
10
-
11
- export interface HyperLinkProps {
12
- readonly styleName?: string;
13
- readonly text: string;
14
- readonly target: string;
15
- readonly style?: TextStyle.TextStyle;
16
- }
17
-
18
- export function create(props: HyperLinkProps): HyperLink {
19
- const { styleName = "", text, target, style = TextStyle.create() } = props;
20
- return {
21
- type: "HyperLink",
22
- styleName,
23
- text,
24
- target,
25
- style
26
- };
27
- }
1
+ import * as TextStyle from "../styles/text-style";
2
+
3
+ export interface HyperLink {
4
+ readonly type: "HyperLink";
5
+ readonly styleName: string;
6
+ readonly text: string;
7
+ readonly target: string;
8
+ readonly style: TextStyle.TextStyle;
9
+ }
10
+
11
+ export interface HyperLinkProps {
12
+ readonly styleName?: string;
13
+ readonly text: string;
14
+ readonly target: string;
15
+ readonly style?: TextStyle.TextStyle;
16
+ }
17
+
18
+ export function create(props: HyperLinkProps): HyperLink {
19
+ const { styleName = "", text, target, style = TextStyle.create() } = props;
20
+ return {
21
+ type: "HyperLink",
22
+ styleName,
23
+ text,
24
+ target,
25
+ style
26
+ };
27
+ }
@@ -1,21 +1,21 @@
1
- import { ImageResource } from "../primitives/image-resource";
2
-
3
- export interface Image {
4
- readonly type: "Image";
5
- readonly imageResource: ImageResource;
6
- readonly width: number;
7
- readonly height: number;
8
- }
9
-
10
- export interface ImageProps {
11
- readonly imageResource: ImageResource;
12
- readonly width: number;
13
- readonly height: number;
14
- }
15
-
16
- export function create(props: ImageProps): Image {
17
- return {
18
- type: "Image",
19
- ...props
20
- };
21
- }
1
+ import { ImageResource } from "../primitives/image-resource";
2
+
3
+ export interface Image {
4
+ readonly type: "Image";
5
+ readonly imageResource: ImageResource;
6
+ readonly width: number;
7
+ readonly height: number;
8
+ }
9
+
10
+ export interface ImageProps {
11
+ readonly imageResource: ImageResource;
12
+ readonly width: number;
13
+ readonly height: number;
14
+ }
15
+
16
+ export function create(props: ImageProps): Image {
17
+ return {
18
+ type: "Image",
19
+ ...props
20
+ };
21
+ }
@@ -1,15 +1,15 @@
1
- export interface LinkTarget {
2
- readonly type: "LinkTarget";
3
- readonly name: string;
4
- }
5
-
6
- export interface LinkTargetProps {
7
- readonly name: string;
8
- }
9
-
10
- export function create(props: LinkTargetProps): LinkTarget {
11
- return {
12
- type: "LinkTarget",
13
- name: props.name
14
- };
15
- }
1
+ export interface LinkTarget {
2
+ readonly type: "LinkTarget";
3
+ readonly name: string;
4
+ }
5
+
6
+ export interface LinkTargetProps {
7
+ readonly name: string;
8
+ }
9
+
10
+ export function create(props: LinkTargetProps): LinkTarget {
11
+ return {
12
+ type: "LinkTarget",
13
+ name: props.name
14
+ };
15
+ }
@@ -1,36 +1,36 @@
1
- import * as TextStyle from "../styles/text-style";
2
-
3
- export type FieldType = "Date" | "PageNumber" | "TotalPages" | "PageNumberOf";
4
-
5
- export interface TextField {
6
- readonly type: "TextField";
7
- readonly styleName: string;
8
- readonly fieldType: FieldType;
9
- readonly style: TextStyle.TextStyle;
10
- readonly target: string;
11
- readonly text: string;
12
- }
13
-
14
- export interface TextFieldProps {
15
- readonly styleName?: string;
16
- readonly fieldType: FieldType;
17
- readonly style?: TextStyle.TextStyle;
18
- readonly target?: string;
19
- }
20
-
21
- export function create(props: TextFieldProps): TextField {
22
- const {
23
- styleName = "",
24
- fieldType,
25
- style = TextStyle.create(),
26
- target = ""
27
- } = props;
28
- return {
29
- type: "TextField",
30
- styleName,
31
- fieldType,
32
- style,
33
- target,
34
- text: ""
35
- };
36
- }
1
+ import * as TextStyle from "../styles/text-style";
2
+
3
+ export type FieldType = "Date" | "PageNumber" | "TotalPages" | "PageNumberOf";
4
+
5
+ export interface TextField {
6
+ readonly type: "TextField";
7
+ readonly styleName: string;
8
+ readonly fieldType: FieldType;
9
+ readonly style: TextStyle.TextStyle;
10
+ readonly target: string;
11
+ readonly text: string;
12
+ }
13
+
14
+ export interface TextFieldProps {
15
+ readonly styleName?: string;
16
+ readonly fieldType: FieldType;
17
+ readonly style?: TextStyle.TextStyle;
18
+ readonly target?: string;
19
+ }
20
+
21
+ export function create(props: TextFieldProps): TextField {
22
+ const {
23
+ styleName = "",
24
+ fieldType,
25
+ style = TextStyle.create(),
26
+ target = ""
27
+ } = props;
28
+ return {
29
+ type: "TextField",
30
+ styleName,
31
+ fieldType,
32
+ style,
33
+ target,
34
+ text: ""
35
+ };
36
+ }
@@ -1,25 +1,25 @@
1
- import * as TextStyle from "../styles/text-style";
2
-
3
- export interface TextRun {
4
- readonly type: "TextRun";
5
- readonly styleName: string;
6
- readonly nestedStyleNames?: ReadonlyArray<string>;
7
- readonly text: string;
8
- readonly style?: TextStyle.TextStyle;
9
- }
10
-
11
- export interface TextRunProps {
12
- readonly styleName?: string;
13
- readonly text: string;
14
- readonly style?: TextStyle.TextStyle;
15
- }
16
-
17
- export function create(props: TextRunProps): TextRun {
18
- const { styleName = "", text, style = TextStyle.create() } = props;
19
- return {
20
- type: "TextRun",
21
- styleName,
22
- text,
23
- style
24
- };
25
- }
1
+ import * as TextStyle from "../styles/text-style";
2
+
3
+ export interface TextRun {
4
+ readonly type: "TextRun";
5
+ readonly styleName: string;
6
+ readonly nestedStyleNames?: ReadonlyArray<string>;
7
+ readonly text: string;
8
+ readonly style?: TextStyle.TextStyle;
9
+ }
10
+
11
+ export interface TextRunProps {
12
+ readonly styleName?: string;
13
+ readonly text: string;
14
+ readonly style?: TextStyle.TextStyle;
15
+ }
16
+
17
+ export function create(props: TextRunProps): TextRun {
18
+ const { styleName = "", text, style = TextStyle.create() } = props;
19
+ return {
20
+ type: "TextRun",
21
+ styleName,
22
+ text,
23
+ style
24
+ };
25
+ }
@@ -1,18 +1,18 @@
1
- // TODO: This should be part of some kind of table of content API that better maps to Word file generation.
2
- // TocSeparator would correspond to docx <w:fldChar w:fldCharType="separate"/> element.
3
-
4
- export interface TocSeparator {
5
- readonly type: "TocSeparator";
6
- readonly width?: number;
7
- }
8
-
9
- export interface TocSeparatorProps {
10
- readonly width?: number;
11
- }
12
-
13
- export function create(_props: TocSeparatorProps): TocSeparator {
14
- return {
15
- type: "TocSeparator",
16
- width: _props.width,
17
- };
18
- }
1
+ // TODO: This should be part of some kind of table of content API that better maps to Word file generation.
2
+ // TocSeparator would correspond to docx <w:fldChar w:fldCharType="separate"/> element.
3
+
4
+ export interface TocSeparator {
5
+ readonly type: "TocSeparator";
6
+ readonly width?: number;
7
+ }
8
+
9
+ export interface TocSeparatorProps {
10
+ readonly width?: number;
11
+ }
12
+
13
+ export function create(_props: TocSeparatorProps): TocSeparator {
14
+ return {
15
+ type: "TocSeparator",
16
+ width: _props.width,
17
+ };
18
+ }
@@ -1,145 +1,145 @@
1
- import * as R from "ramda";
2
- // import {ParagraphStyle, StyleKey, TableStyle, TextStyle, TableCellStyle, LayoutFoundation, Style} from "./index";
3
- import * as LayoutFoundation from "./primitives/layout-foundation";
4
- import * as ParagraphStyle from "./styles/paragraph-style";
5
- import * as Style from "./styles/style";
6
- import * as StyleKey from "./styles/style-key";
7
- import * as TableCellStyle from "./styles/table-cell-style";
8
- import * as TableStyle from "./styles/table-style";
9
- import * as TextStyle from "./styles/text-style";
10
- import { Indexer } from "./types";
11
-
12
- export const defaultAndStandardStyles = createDefaultAndStandardStyles();
13
-
14
- export function createDefaultAndStandardStyles(): Indexer<Style.Style> {
15
- return { ...createDefaultStyles(), ...createStandardStyles() };
16
- }
17
-
18
- export function createStandardStyles(): Indexer<Style.Style> {
19
- return createStyles([
20
- // Markdown styles START --> //
21
- [
22
- "H1",
23
- ParagraphStyle.create({
24
- textStyle: TextStyle.create({ bold: true, fontSize: 32 }),
25
- margins: LayoutFoundation.create({ top: 32 / 4, bottom: 32 / 16 })
26
- })
27
- ],
28
- [
29
- "H2",
30
- ParagraphStyle.create({
31
- textStyle: TextStyle.create({ bold: true, fontSize: 24 }),
32
- margins: LayoutFoundation.create({ top: 24 / 4, bottom: 24 / 16 })
33
- })
34
- ],
35
- [
36
- "H3",
37
- ParagraphStyle.create({
38
- textStyle: TextStyle.create({ bold: true, fontSize: 18 }),
39
- margins: LayoutFoundation.create({ top: 18 / 4, bottom: 18 / 16 })
40
- })
41
- ],
42
- [
43
- "H4",
44
- ParagraphStyle.create({
45
- textStyle: TextStyle.create({ bold: true, fontSize: 15 }),
46
- margins: LayoutFoundation.create({ top: 15 / 4, bottom: 15 / 16 })
47
- })
48
- ],
49
- [
50
- "H5",
51
- ParagraphStyle.create({
52
- textStyle: TextStyle.create({ bold: true, fontSize: 13 }),
53
- margins: LayoutFoundation.create({ top: 13 / 4, bottom: 13 / 16 })
54
- })
55
- ],
56
- [
57
- "H6",
58
- ParagraphStyle.create({
59
- textStyle: TextStyle.create({ bold: true, fontSize: 10 }),
60
- margins: LayoutFoundation.create({ top: 10 / 4, bottom: 10 / 16 })
61
- })
62
- ],
63
- ["Emphasis", TextStyle.create({ italic: true })],
64
- ["Strong", TextStyle.create({ bold: true })],
65
- ["Subscript", TextStyle.create({ subScript: true, fontSize: 6 })],
66
- ["Superscript", TextStyle.create({ superScript: true, fontSize: 6 })]
67
- // <-- Markdown styles END //
68
- ]);
69
- }
70
-
71
- function createStyles(
72
- tuples: Array<[string, Style.Style]>
73
- ): Indexer<Style.Style> {
74
- return R.fromPairs(
75
- tuples.map(
76
- s =>
77
- [StyleKey.create(s[1].type, s[0]), s[1]] as R.KeyValuePair<
78
- StyleKey.StyleKey,
79
- Style.Style
80
- >
81
- )
82
- );
83
- }
84
-
85
- export function createDefaultStyles(): Indexer<Style.Style> {
86
- const paragraphStyle = defaultParagraphStyle();
87
- const textStyle = defaultTextStyle();
88
- const tableStyle = defaultTableStyle();
89
- const tableCellStyle = defaultTableCellStyle();
90
- return {
91
- [StyleKey.create(paragraphStyle.type, "Default")]: paragraphStyle,
92
- [StyleKey.create(textStyle.type, "Default")]: textStyle,
93
- [StyleKey.create(tableStyle.type, "Default")]: tableStyle,
94
- [StyleKey.create(tableCellStyle.type, "Default")]: tableCellStyle
95
- };
96
- }
97
-
98
- function defaultParagraphStyle(): ParagraphStyle.ParagraphStyle {
99
- return ParagraphStyle.create({
100
- alignment: "Start",
101
- margins: LayoutFoundation.create({
102
- top: 0,
103
- bottom: 0,
104
- left: 0,
105
- right: 0
106
- }),
107
- textStyle: defaultTextStyle()
108
- });
109
- }
110
-
111
- function defaultTextStyle(): TextStyle.TextStyle {
112
- return TextStyle.create({
113
- fontFamily: "Helvetica",
114
- fontSize: 10,
115
- underline: false,
116
- bold: false,
117
- italic: false,
118
- subScript: false,
119
- superScript: false
120
- });
121
- }
122
-
123
- function defaultTableStyle(): TableStyle.TableStyle {
124
- return TableStyle.create({
125
- alignment: "Left"
126
- });
127
- }
128
-
129
- function defaultTableCellStyle(): TableCellStyle.TableCellStyle {
130
- return TableCellStyle.create({
131
- borders: LayoutFoundation.create({
132
- top: 0,
133
- bottom: 0,
134
- left: 0,
135
- right: 0
136
- }),
137
- padding: LayoutFoundation.create({
138
- top: 0,
139
- bottom: 0,
140
- left: 0,
141
- right: 0
142
- }),
143
- verticalAlignment: "Middle"
144
- });
145
- }
1
+ import * as R from "ramda";
2
+ // import {ParagraphStyle, StyleKey, TableStyle, TextStyle, TableCellStyle, LayoutFoundation, Style} from "./index";
3
+ import * as LayoutFoundation from "./primitives/layout-foundation";
4
+ import * as ParagraphStyle from "./styles/paragraph-style";
5
+ import * as Style from "./styles/style";
6
+ import * as StyleKey from "./styles/style-key";
7
+ import * as TableCellStyle from "./styles/table-cell-style";
8
+ import * as TableStyle from "./styles/table-style";
9
+ import * as TextStyle from "./styles/text-style";
10
+ import { Indexer } from "./types";
11
+
12
+ export const defaultAndStandardStyles = createDefaultAndStandardStyles();
13
+
14
+ export function createDefaultAndStandardStyles(): Indexer<Style.Style> {
15
+ return { ...createDefaultStyles(), ...createStandardStyles() };
16
+ }
17
+
18
+ export function createStandardStyles(): Indexer<Style.Style> {
19
+ return createStyles([
20
+ // Markdown styles START --> //
21
+ [
22
+ "H1",
23
+ ParagraphStyle.create({
24
+ textStyle: TextStyle.create({ bold: true, fontSize: 32 }),
25
+ margins: LayoutFoundation.create({ top: 32 / 4, bottom: 32 / 16 })
26
+ })
27
+ ],
28
+ [
29
+ "H2",
30
+ ParagraphStyle.create({
31
+ textStyle: TextStyle.create({ bold: true, fontSize: 24 }),
32
+ margins: LayoutFoundation.create({ top: 24 / 4, bottom: 24 / 16 })
33
+ })
34
+ ],
35
+ [
36
+ "H3",
37
+ ParagraphStyle.create({
38
+ textStyle: TextStyle.create({ bold: true, fontSize: 18 }),
39
+ margins: LayoutFoundation.create({ top: 18 / 4, bottom: 18 / 16 })
40
+ })
41
+ ],
42
+ [
43
+ "H4",
44
+ ParagraphStyle.create({
45
+ textStyle: TextStyle.create({ bold: true, fontSize: 15 }),
46
+ margins: LayoutFoundation.create({ top: 15 / 4, bottom: 15 / 16 })
47
+ })
48
+ ],
49
+ [
50
+ "H5",
51
+ ParagraphStyle.create({
52
+ textStyle: TextStyle.create({ bold: true, fontSize: 13 }),
53
+ margins: LayoutFoundation.create({ top: 13 / 4, bottom: 13 / 16 })
54
+ })
55
+ ],
56
+ [
57
+ "H6",
58
+ ParagraphStyle.create({
59
+ textStyle: TextStyle.create({ bold: true, fontSize: 10 }),
60
+ margins: LayoutFoundation.create({ top: 10 / 4, bottom: 10 / 16 })
61
+ })
62
+ ],
63
+ ["Emphasis", TextStyle.create({ italic: true })],
64
+ ["Strong", TextStyle.create({ bold: true })],
65
+ ["Subscript", TextStyle.create({ subScript: true, fontSize: 6 })],
66
+ ["Superscript", TextStyle.create({ superScript: true, fontSize: 6 })]
67
+ // <-- Markdown styles END //
68
+ ]);
69
+ }
70
+
71
+ function createStyles(
72
+ tuples: Array<[string, Style.Style]>
73
+ ): Indexer<Style.Style> {
74
+ return R.fromPairs(
75
+ tuples.map(
76
+ s =>
77
+ [StyleKey.create(s[1].type, s[0]), s[1]] as R.KeyValuePair<
78
+ StyleKey.StyleKey,
79
+ Style.Style
80
+ >
81
+ )
82
+ );
83
+ }
84
+
85
+ export function createDefaultStyles(): Indexer<Style.Style> {
86
+ const paragraphStyle = defaultParagraphStyle();
87
+ const textStyle = defaultTextStyle();
88
+ const tableStyle = defaultTableStyle();
89
+ const tableCellStyle = defaultTableCellStyle();
90
+ return {
91
+ [StyleKey.create(paragraphStyle.type, "Default")]: paragraphStyle,
92
+ [StyleKey.create(textStyle.type, "Default")]: textStyle,
93
+ [StyleKey.create(tableStyle.type, "Default")]: tableStyle,
94
+ [StyleKey.create(tableCellStyle.type, "Default")]: tableCellStyle
95
+ };
96
+ }
97
+
98
+ function defaultParagraphStyle(): ParagraphStyle.ParagraphStyle {
99
+ return ParagraphStyle.create({
100
+ alignment: "Start",
101
+ margins: LayoutFoundation.create({
102
+ top: 0,
103
+ bottom: 0,
104
+ left: 0,
105
+ right: 0
106
+ }),
107
+ textStyle: defaultTextStyle()
108
+ });
109
+ }
110
+
111
+ function defaultTextStyle(): TextStyle.TextStyle {
112
+ return TextStyle.create({
113
+ fontFamily: "Helvetica",
114
+ fontSize: 10,
115
+ underline: false,
116
+ bold: false,
117
+ italic: false,
118
+ subScript: false,
119
+ superScript: false
120
+ });
121
+ }
122
+
123
+ function defaultTableStyle(): TableStyle.TableStyle {
124
+ return TableStyle.create({
125
+ alignment: "Left"
126
+ });
127
+ }
128
+
129
+ function defaultTableCellStyle(): TableCellStyle.TableCellStyle {
130
+ return TableCellStyle.create({
131
+ borders: LayoutFoundation.create({
132
+ top: 0,
133
+ bottom: 0,
134
+ left: 0,
135
+ right: 0
136
+ }),
137
+ padding: LayoutFoundation.create({
138
+ top: 0,
139
+ bottom: 0,
140
+ left: 0,
141
+ right: 0
142
+ }),
143
+ verticalAlignment: "Middle"
144
+ });
145
+ }