abstract-document 6.0.2 → 6.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +58 -58
- package/LICENSE +21 -0
- package/README.md +45 -45
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/group.js +90 -90
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/header-and-footer.js +69 -69
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/hello.js +51 -51
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/mixed-hyperlink-and-textrun.js +115 -115
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/mixed-textrun-and-images.js +169 -169
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/multiple-images.js +141 -141
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/multiple-tables.js +467 -467
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/multiple-textrun-with-center-alignment.js +97 -97
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/multiple-textrun-with-end-alignment.js +97 -97
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/multiple-textrun-with-start-alignment-that-linebreaks.js +96 -96
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/multiple-textrun-with-start-alignment.js +96 -96
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/page-numbering.js +102 -102
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/simple-table.js +167 -167
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-hyperlink.js +70 -70
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-image.js +97 -97
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-center-alignment-that-linebreaks.js +68 -68
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-center-alignment.js +68 -68
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-end-alignment-that-linebreaks.js +68 -68
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-end-alignment.js +68 -68
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-start-alignment-that-linebreaks.js +68 -68
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-start-alignment.js +68 -68
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun.js +68 -68
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/world.js +51 -51
- package/lib/{abstract-document/__tests__/markdown/test-defs/markdown.d.ts → abstract-document-exporters/__tests__/pdf/test-defs/simple-table-auto-cell-widths.d.ts} +1 -1
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-auto-cell-widths.d.ts.map +1 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-auto-cell-widths.js +105 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-auto-cell-widths.js.map +1 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-fixed-cell-widths.d.ts +3 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-fixed-cell-widths.d.ts.map +1 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-fixed-cell-widths.js +104 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-fixed-cell-widths.js.map +1 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-image-svg-color-hex.d.ts.map +1 -1
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-image-svg-color-hex.js +0 -1
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-image-svg-color-hex.js.map +1 -1
- package/lib/abstract-document-exporters/__tests__/{docx2/test-defs/table-of-content-separator.d.ts → pdf/test-defs/single-image-svg-color-url.d.ts} +1 -1
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-image-svg-color-url.d.ts.map +1 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-image-svg-color-url.js +108 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-image-svg-color-url.js.map +1 -0
- package/lib/abstract-document-exporters/pdf/render-image.js +2 -2
- package/lib/abstract-document-exporters/pdf/render-image.js.map +1 -1
- package/package.json +4 -3
- package/src/abstract-document/__tests__/hello-world-abstract-doc.ts +245 -245
- package/src/abstract-document/__tests__/markdown/export-test-def.ts +10 -10
- package/src/abstract-document/__tests__/markdown/export.test.tsx +15 -15
- package/src/abstract-document/__tests__/markdown/test-defs/markdown-bold-italic.tsx +30 -30
- package/src/abstract-document/__tests__/markdown/test-defs/markdown-bold.tsx +30 -30
- package/src/abstract-document/__tests__/markdown/test-defs/markdown-empty-keepTogether.tsx +43 -43
- package/src/abstract-document/__tests__/markdown/test-defs/markdown-header.tsx +37 -37
- package/src/abstract-document/__tests__/markdown/test-defs/markdown-italic.tsx +30 -30
- package/src/abstract-document/__tests__/markdown/test-defs/markdown-keepTogether.tsx +50 -50
- package/src/abstract-document/__tests__/markdown/test-defs/markdown-subscript.tsx +44 -44
- package/src/abstract-document/__tests__/markdown/test-defs/markdown-superscript.tsx +37 -37
- package/src/abstract-document/__tests__/model-builder._test.ts +48 -48
- package/src/abstract-document/abstract-doc.ts +19 -19
- package/src/abstract-document/atoms/atom.ts +14 -14
- package/src/abstract-document/atoms/hyper-link.ts +27 -27
- package/src/abstract-document/atoms/image.ts +21 -21
- package/src/abstract-document/atoms/link-target.ts +15 -15
- package/src/abstract-document/atoms/text-field.ts +36 -36
- package/src/abstract-document/atoms/text-run.ts +25 -25
- package/src/abstract-document/atoms/toc-separator.ts +14 -14
- package/src/abstract-document/default-styles.ts +145 -145
- package/src/abstract-document/index.ts +83 -83
- package/src/abstract-document/markdown/markdown.ts +142 -142
- package/src/abstract-document/markdown/types.ts +78 -78
- package/src/abstract-document/numberings/numbering-definition.ts +17 -17
- package/src/abstract-document/numberings/numbering-format.ts +7 -7
- package/src/abstract-document/numberings/numbering-level-definition.ts +42 -42
- package/src/abstract-document/numberings/numbering.ts +3 -3
- package/src/abstract-document/page/master-page.ts +23 -23
- package/src/abstract-document/page/section.ts +27 -27
- package/src/abstract-document/primitives/font.ts +37 -37
- package/src/abstract-document/primitives/image-resource.ts +27 -27
- package/src/abstract-document/primitives/layout-foundation.ts +37 -37
- package/src/abstract-document/primitives/length.ts +11 -11
- package/src/abstract-document/primitives/point.ts +11 -11
- package/src/abstract-document/primitives/rect.ts +15 -15
- package/src/abstract-document/primitives/size.ts +13 -13
- package/src/abstract-document/resources.ts +101 -101
- package/src/abstract-document/section-elements/group.ts +25 -25
- package/src/abstract-document/section-elements/page-break.ts +14 -14
- package/src/abstract-document/section-elements/paragraph-numbering.ts +6 -6
- package/src/abstract-document/section-elements/paragraph.ts +30 -30
- package/src/abstract-document/section-elements/section-element.ts +6 -6
- package/src/abstract-document/section-elements/table.ts +37 -37
- package/src/abstract-document/styles/page-style.ts +76 -76
- package/src/abstract-document/styles/paragraph-style.ts +45 -45
- package/src/abstract-document/styles/style-key.ts +5 -5
- package/src/abstract-document/styles/style.ts +44 -44
- package/src/abstract-document/styles/table-cell-style.ts +54 -54
- package/src/abstract-document/styles/table-style.ts +45 -45
- package/src/abstract-document/styles/text-style.ts +73 -73
- package/src/abstract-document/table/table-cell.ts +29 -29
- package/src/abstract-document/table/table-row.ts +17 -17
- package/src/abstract-document/types.ts +3 -3
- package/src/abstract-document-exporters/__tests__/docx2/export-test-def.ts +10 -10
- package/src/abstract-document-exporters/__tests__/docx2/export.test.tsx +67 -67
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/group.tsx +114 -114
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/header-and-footer.tsx +110 -110
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/hello.tsx +70 -70
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/mixed-hyperlink-and-textrun.tsx +137 -137
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/mixed-textrun-and-images.tsx +212 -212
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/multiple-images.tsx +182 -182
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/multiple-tables.tsx +553 -553
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/multiple-textrun-with-center-alignment.tsx +119 -119
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/multiple-textrun-with-end-alignment.tsx +119 -119
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/multiple-textrun-with-start-alignment-that-linebreaks.tsx +121 -121
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/multiple-textrun-with-start-alignment.tsx +118 -118
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/page-numbering.tsx +123 -123
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/simple-table.tsx +210 -210
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/single-hyperlink.tsx +89 -89
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/single-image.tsx +137 -137
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-center-alignment-that-linebreaks.tsx +88 -88
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-center-alignment.tsx +88 -88
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-end-alignment-that-linebreaks.tsx +88 -88
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-end-alignment.tsx +88 -88
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-start-alignment-that-linebreaks.tsx +88 -88
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun-with-start-alignment.tsx +88 -88
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/single-textrun.tsx +87 -87
- package/src/abstract-document-exporters/__tests__/docx2/test-defs/world.tsx +70 -70
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Group.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Header and footer.docx and b/package/src/abstract-document-exporters/__tests__/docx2/tmp/Header → footer.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Mixed hyperlink and textrun.docx and b/package/src/abstract-document-exporters/__tests__/docx2/tmp/Mixed hyperlink → textrun.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Mixed textrun and images.docx and b/package/src/abstract-document-exporters/__tests__/docx2/tmp/Mixed textrun → images.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple images.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple tables.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with Center alignment.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with End alignment.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with Start alignment that linebreaks.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with Start alignment.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Page numbering.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Simple table.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single hyperlink.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single image.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Center alignment that linebreaks.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Center alignment.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with End alignment that linebreaks.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with End alignment.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Start alignment that linebreaks.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Start alignment.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/hello.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/world.docx +0 -0
- package/src/abstract-document-exporters/__tests__/pdf/export-test-def.ts +10 -10
- package/src/abstract-document-exporters/__tests__/pdf/export.test.tsx +46 -46
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/date.tsx +66 -66
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/group-paragraphs.tsx +1291 -1291
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/group-tables.tsx +1314 -1314
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/header-and-footer.tsx +162 -162
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/hello.tsx +45 -45
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/margins-header-body-footer.tsx +1008 -1008
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/mixed-hyperlink-and-textrun.tsx +113 -113
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/mixed-textrun-and-images.tsx +104 -104
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/multiple-images.tsx +71 -71
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/multiple-textrun-with-center-alignment.tsx +98 -98
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/multiple-textrun-with-end-alignment.tsx +98 -98
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/multiple-textrun-with-start-alignment-that-linebreaks.tsx +116 -116
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/multiple-textrun-with-start-alignment.tsx +98 -98
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/page-numbering.tsx +97 -97
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/pagebreak.tsx +102 -102
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-all-auto-cell-widths.tsx +119 -119
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-all-fixed-cell-widths.tsx +119 -119
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-cell-padding-image.tsx +200 -200
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-cell-padding-text.tsx +338 -338
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-center-alignment.tsx +114 -114
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-mix-auto-fix-cell-widths.tsx +119 -119
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-padding.tsx +115 -115
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-right-alignment.tsx +115 -115
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-row-alignment.tsx +297 -297
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-text-alignment-in-cell-wrapping.tsx +491 -491
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/simple-table-text-alignment-in-cell.tsx +248 -248
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-hyperlink.tsx +65 -65
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-image-svg-color-hex.tsx +272 -273
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-image-svg-color-name.tsx +272 -272
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-image-svg-color-url.tsx +97 -0
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-image.tsx +70 -70
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-textrun-with-center-alignment-that-linebreaks.tsx +81 -81
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-textrun-with-center-alignment.tsx +66 -66
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-textrun-with-end-alignment-that-linebreaks.tsx +81 -81
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-textrun-with-end-alignment.tsx +66 -66
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-textrun-with-start-alignment-that-linebreaks.tsx +81 -81
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-textrun-with-start-alignment.tsx +66 -66
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-textrun.tsx +45 -45
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/table-of-content-separator.tsx +81 -81
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/world.tsx +45 -45
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Group Paragraphs.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Group Paratraphs.pdf +912 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Group Tables.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Group.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Header and footer.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Margins header body footer.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Margins header body footer1.pdf +640 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Margins header body footer2.pdf +609 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Margins header body footer3.pdf +1188 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Margins header body footer4.pdf +1188 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed hyperlink and textrun.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed textrun and images.pdf and b/package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed textrun → images.pdf +0 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple images.pdf +0 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with Center alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with End alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with Start alignment that linebreaks.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with Start alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Page numbering.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table all auto.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table all fix.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table auto.pdf +133 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table cell padding of image.pdf +0 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table cell padding of text.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table center alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table mix auto fix.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table one auto.pdf +133 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table padding.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table padding1.pdf +133 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table right alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table row alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table text alignment in cell with wrapping.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table text alignment in cell.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single date.pdf +14 -14
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single hyperlink.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg color hex.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg color name.pdf +179 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg color url.pdf +222 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg color.pdf +179 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image.pdf +0 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Center alignment that linebreaks.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Center alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with End alignment that linebreaks.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with End alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Start alignment that linebreaks.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Start alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Table of content separator.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/hello.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/world.pdf +2 -2
- package/src/abstract-document-exporters/docx/document-container.ts +18 -18
- package/src/abstract-document-exporters/docx/docx-constants.ts +46 -46
- package/src/abstract-document-exporters/docx/docx-document-renderer.ts +1084 -1084
- package/src/abstract-document-exporters/docx/ref-container.ts +53 -53
- package/src/abstract-document-exporters/docx/string-utils.ts +39 -39
- package/src/abstract-document-exporters/docx/xml-writer.ts +333 -333
- package/src/abstract-document-exporters/docx2/render-image.ts +159 -159
- package/src/abstract-document-exporters/docx2/render.ts +476 -476
- package/src/abstract-document-exporters/index.ts +5 -5
- package/src/abstract-document-exporters/pdf/font.ts +67 -67
- package/src/abstract-document-exporters/pdf/measure.ts +410 -410
- package/src/abstract-document-exporters/pdf/paginate.ts +337 -337
- package/src/abstract-document-exporters/pdf/pre-process.ts +363 -363
- package/src/abstract-document-exporters/pdf/render-image.ts +189 -189
- package/src/abstract-document-exporters/pdf/render.ts +752 -752
- package/src/abstract-document-exporters/pdf/update-refs.ts +163 -163
- package/src/abstract-document-exporters/shared/get_resources.ts +71 -71
- package/src/abstract-document-jsx/index.ts +86 -86
- package/src/index.ts +5 -5
- package/lib/abstract-document/__tests__/markdown/test-defs/markdown.d.ts.map +0 -1
- package/lib/abstract-document/__tests__/markdown/test-defs/markdown.js +0 -14
- package/lib/abstract-document/__tests__/markdown/test-defs/markdown.js.map +0 -1
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/table-of-content-separator.d.ts.map +0 -1
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/table-of-content-separator.js +0 -18
- package/lib/abstract-document-exporters/__tests__/docx2/test-defs/table-of-content-separator.js.map +0 -1
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-date.d.ts +0 -1
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-date.d.ts.map +0 -1
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-date.js +0 -70
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-date.js.map +0 -1
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple tables.zip +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Table of content separator.docx +0 -0
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import * as TextStyle from "./text-style";
|
|
2
|
-
import * as LayoutFoundation from "../primitives/layout-foundation";
|
|
3
|
-
|
|
4
|
-
export type TextAlignment = "Start" | "Center" | "End" | "Justify";
|
|
5
|
-
|
|
6
|
-
export interface ParagraphStyle {
|
|
7
|
-
readonly type: "ParagraphStyle";
|
|
8
|
-
readonly alignment?: TextAlignment;
|
|
9
|
-
readonly margins: LayoutFoundation.LayoutFoundation;
|
|
10
|
-
readonly textStyle: TextStyle.TextStyle;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface ParagraphStyleProps {
|
|
14
|
-
readonly alignment?: TextAlignment;
|
|
15
|
-
readonly margins?: LayoutFoundation.LayoutFoundation;
|
|
16
|
-
readonly textStyle?: TextStyle.TextStyle;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function create(props?: ParagraphStyleProps): ParagraphStyle {
|
|
20
|
-
const {
|
|
21
|
-
alignment = undefined,
|
|
22
|
-
margins = LayoutFoundation.create(),
|
|
23
|
-
textStyle = TextStyle.create()
|
|
24
|
-
} =
|
|
25
|
-
props || {};
|
|
26
|
-
return {
|
|
27
|
-
type: "ParagraphStyle",
|
|
28
|
-
alignment,
|
|
29
|
-
margins,
|
|
30
|
-
textStyle
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function overrideWith(
|
|
35
|
-
overrider: ParagraphStyle | undefined,
|
|
36
|
-
toOverride: ParagraphStyle | undefined
|
|
37
|
-
): ParagraphStyle {
|
|
38
|
-
const a: ParagraphStyleProps = overrider || {};
|
|
39
|
-
const b: ParagraphStyleProps = toOverride || {};
|
|
40
|
-
return create({
|
|
41
|
-
alignment: a.alignment || b.alignment,
|
|
42
|
-
margins: LayoutFoundation.overrideWith(a.margins, b.margins),
|
|
43
|
-
textStyle: TextStyle.overrideWith(a.textStyle, b.textStyle)
|
|
44
|
-
});
|
|
45
|
-
}
|
|
1
|
+
import * as TextStyle from "./text-style";
|
|
2
|
+
import * as LayoutFoundation from "../primitives/layout-foundation";
|
|
3
|
+
|
|
4
|
+
export type TextAlignment = "Start" | "Center" | "End" | "Justify";
|
|
5
|
+
|
|
6
|
+
export interface ParagraphStyle {
|
|
7
|
+
readonly type: "ParagraphStyle";
|
|
8
|
+
readonly alignment?: TextAlignment;
|
|
9
|
+
readonly margins: LayoutFoundation.LayoutFoundation;
|
|
10
|
+
readonly textStyle: TextStyle.TextStyle;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ParagraphStyleProps {
|
|
14
|
+
readonly alignment?: TextAlignment;
|
|
15
|
+
readonly margins?: LayoutFoundation.LayoutFoundation;
|
|
16
|
+
readonly textStyle?: TextStyle.TextStyle;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function create(props?: ParagraphStyleProps): ParagraphStyle {
|
|
20
|
+
const {
|
|
21
|
+
alignment = undefined,
|
|
22
|
+
margins = LayoutFoundation.create(),
|
|
23
|
+
textStyle = TextStyle.create()
|
|
24
|
+
} =
|
|
25
|
+
props || {};
|
|
26
|
+
return {
|
|
27
|
+
type: "ParagraphStyle",
|
|
28
|
+
alignment,
|
|
29
|
+
margins,
|
|
30
|
+
textStyle
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function overrideWith(
|
|
35
|
+
overrider: ParagraphStyle | undefined,
|
|
36
|
+
toOverride: ParagraphStyle | undefined
|
|
37
|
+
): ParagraphStyle {
|
|
38
|
+
const a: ParagraphStyleProps = overrider || {};
|
|
39
|
+
const b: ParagraphStyleProps = toOverride || {};
|
|
40
|
+
return create({
|
|
41
|
+
alignment: a.alignment || b.alignment,
|
|
42
|
+
margins: LayoutFoundation.overrideWith(a.margins, b.margins),
|
|
43
|
+
textStyle: TextStyle.overrideWith(a.textStyle, b.textStyle)
|
|
44
|
+
});
|
|
45
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type StyleKey = string;
|
|
2
|
-
|
|
3
|
-
export function create(type: string, name: string): StyleKey {
|
|
4
|
-
return `${type}_${name}`;
|
|
5
|
-
}
|
|
1
|
+
export type StyleKey = string;
|
|
2
|
+
|
|
3
|
+
export function create(type: string, name: string): StyleKey {
|
|
4
|
+
return `${type}_${name}`;
|
|
5
|
+
}
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import * as ParagraphStyle from "./paragraph-style";
|
|
2
|
-
import * as TableCellStyle from "./table-cell-style";
|
|
3
|
-
import * as TableStyle from "./table-style";
|
|
4
|
-
import * as TextStyle from "./text-style";
|
|
5
|
-
|
|
6
|
-
export type Style =
|
|
7
|
-
| ParagraphStyle.ParagraphStyle
|
|
8
|
-
| TableCellStyle.TableCellStyle
|
|
9
|
-
| TableStyle.TableStyle
|
|
10
|
-
| TextStyle.TextStyle;
|
|
11
|
-
|
|
12
|
-
export function overrideWith(
|
|
13
|
-
overrider: Style | undefined,
|
|
14
|
-
toOverride: Style | undefined
|
|
15
|
-
): Style | undefined {
|
|
16
|
-
if (!overrider) {
|
|
17
|
-
return toOverride;
|
|
18
|
-
}
|
|
19
|
-
if (!toOverride) {
|
|
20
|
-
return overrider;
|
|
21
|
-
}
|
|
22
|
-
if (
|
|
23
|
-
overrider.type === "ParagraphStyle" &&
|
|
24
|
-
toOverride.type === "ParagraphStyle"
|
|
25
|
-
) {
|
|
26
|
-
return ParagraphStyle.overrideWith(overrider, toOverride);
|
|
27
|
-
} else if (
|
|
28
|
-
overrider.type === "TableCellStyle" &&
|
|
29
|
-
toOverride.type === "TableCellStyle"
|
|
30
|
-
) {
|
|
31
|
-
return TableCellStyle.overrideWith(overrider, toOverride);
|
|
32
|
-
} else if (
|
|
33
|
-
overrider.type === "TableStyle" &&
|
|
34
|
-
toOverride.type === "TableStyle"
|
|
35
|
-
) {
|
|
36
|
-
return TableStyle.overrideWith(overrider, toOverride);
|
|
37
|
-
} else if (
|
|
38
|
-
overrider.type === "TextStyle" &&
|
|
39
|
-
toOverride.type === "TextStyle"
|
|
40
|
-
) {
|
|
41
|
-
return TextStyle.overrideWith(overrider, toOverride);
|
|
42
|
-
}
|
|
43
|
-
return toOverride;
|
|
44
|
-
}
|
|
1
|
+
import * as ParagraphStyle from "./paragraph-style";
|
|
2
|
+
import * as TableCellStyle from "./table-cell-style";
|
|
3
|
+
import * as TableStyle from "./table-style";
|
|
4
|
+
import * as TextStyle from "./text-style";
|
|
5
|
+
|
|
6
|
+
export type Style =
|
|
7
|
+
| ParagraphStyle.ParagraphStyle
|
|
8
|
+
| TableCellStyle.TableCellStyle
|
|
9
|
+
| TableStyle.TableStyle
|
|
10
|
+
| TextStyle.TextStyle;
|
|
11
|
+
|
|
12
|
+
export function overrideWith(
|
|
13
|
+
overrider: Style | undefined,
|
|
14
|
+
toOverride: Style | undefined
|
|
15
|
+
): Style | undefined {
|
|
16
|
+
if (!overrider) {
|
|
17
|
+
return toOverride;
|
|
18
|
+
}
|
|
19
|
+
if (!toOverride) {
|
|
20
|
+
return overrider;
|
|
21
|
+
}
|
|
22
|
+
if (
|
|
23
|
+
overrider.type === "ParagraphStyle" &&
|
|
24
|
+
toOverride.type === "ParagraphStyle"
|
|
25
|
+
) {
|
|
26
|
+
return ParagraphStyle.overrideWith(overrider, toOverride);
|
|
27
|
+
} else if (
|
|
28
|
+
overrider.type === "TableCellStyle" &&
|
|
29
|
+
toOverride.type === "TableCellStyle"
|
|
30
|
+
) {
|
|
31
|
+
return TableCellStyle.overrideWith(overrider, toOverride);
|
|
32
|
+
} else if (
|
|
33
|
+
overrider.type === "TableStyle" &&
|
|
34
|
+
toOverride.type === "TableStyle"
|
|
35
|
+
) {
|
|
36
|
+
return TableStyle.overrideWith(overrider, toOverride);
|
|
37
|
+
} else if (
|
|
38
|
+
overrider.type === "TextStyle" &&
|
|
39
|
+
toOverride.type === "TextStyle"
|
|
40
|
+
) {
|
|
41
|
+
return TextStyle.overrideWith(overrider, toOverride);
|
|
42
|
+
}
|
|
43
|
+
return toOverride;
|
|
44
|
+
}
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import * as LayoutFoundation from "../primitives/layout-foundation";
|
|
2
|
-
|
|
3
|
-
export type RowAlignment = "Top" | "Middle" | "Bottom";
|
|
4
|
-
|
|
5
|
-
export interface TableCellStyle {
|
|
6
|
-
readonly type: "TableCellStyle";
|
|
7
|
-
readonly background?: string;
|
|
8
|
-
readonly borders: LayoutFoundation.LayoutFoundation;
|
|
9
|
-
readonly borderColor?: string;
|
|
10
|
-
readonly padding: LayoutFoundation.LayoutFoundation;
|
|
11
|
-
readonly verticalAlignment?: RowAlignment;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface TableCellStyleProps {
|
|
15
|
-
readonly background?: string;
|
|
16
|
-
readonly borders?: LayoutFoundation.LayoutFoundation;
|
|
17
|
-
readonly borderColor?: string;
|
|
18
|
-
readonly padding?: LayoutFoundation.LayoutFoundation;
|
|
19
|
-
readonly verticalAlignment?: RowAlignment;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function create(props?: TableCellStyleProps): TableCellStyle {
|
|
23
|
-
const {
|
|
24
|
-
background = undefined,
|
|
25
|
-
borders = LayoutFoundation.create(),
|
|
26
|
-
borderColor = undefined,
|
|
27
|
-
padding = LayoutFoundation.create(),
|
|
28
|
-
verticalAlignment = undefined
|
|
29
|
-
} =
|
|
30
|
-
props || {};
|
|
31
|
-
return {
|
|
32
|
-
type: "TableCellStyle",
|
|
33
|
-
background,
|
|
34
|
-
borders,
|
|
35
|
-
borderColor,
|
|
36
|
-
padding,
|
|
37
|
-
verticalAlignment
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function overrideWith(
|
|
42
|
-
overrider: TableCellStyle | undefined,
|
|
43
|
-
toOverride: TableCellStyle | undefined
|
|
44
|
-
): TableCellStyle {
|
|
45
|
-
const a: TableCellStyleProps = overrider || {};
|
|
46
|
-
const b: TableCellStyleProps = toOverride || {};
|
|
47
|
-
return create({
|
|
48
|
-
background: a.background || b.background,
|
|
49
|
-
borders: LayoutFoundation.overrideWith(a.borders, b.borders),
|
|
50
|
-
borderColor: a.borderColor || b.borderColor,
|
|
51
|
-
padding: LayoutFoundation.overrideWith(a.padding, b.padding),
|
|
52
|
-
verticalAlignment: a.verticalAlignment || b.verticalAlignment
|
|
53
|
-
});
|
|
54
|
-
}
|
|
1
|
+
import * as LayoutFoundation from "../primitives/layout-foundation";
|
|
2
|
+
|
|
3
|
+
export type RowAlignment = "Top" | "Middle" | "Bottom";
|
|
4
|
+
|
|
5
|
+
export interface TableCellStyle {
|
|
6
|
+
readonly type: "TableCellStyle";
|
|
7
|
+
readonly background?: string;
|
|
8
|
+
readonly borders: LayoutFoundation.LayoutFoundation;
|
|
9
|
+
readonly borderColor?: string;
|
|
10
|
+
readonly padding: LayoutFoundation.LayoutFoundation;
|
|
11
|
+
readonly verticalAlignment?: RowAlignment;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface TableCellStyleProps {
|
|
15
|
+
readonly background?: string;
|
|
16
|
+
readonly borders?: LayoutFoundation.LayoutFoundation;
|
|
17
|
+
readonly borderColor?: string;
|
|
18
|
+
readonly padding?: LayoutFoundation.LayoutFoundation;
|
|
19
|
+
readonly verticalAlignment?: RowAlignment;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function create(props?: TableCellStyleProps): TableCellStyle {
|
|
23
|
+
const {
|
|
24
|
+
background = undefined,
|
|
25
|
+
borders = LayoutFoundation.create(),
|
|
26
|
+
borderColor = undefined,
|
|
27
|
+
padding = LayoutFoundation.create(),
|
|
28
|
+
verticalAlignment = undefined
|
|
29
|
+
} =
|
|
30
|
+
props || {};
|
|
31
|
+
return {
|
|
32
|
+
type: "TableCellStyle",
|
|
33
|
+
background,
|
|
34
|
+
borders,
|
|
35
|
+
borderColor,
|
|
36
|
+
padding,
|
|
37
|
+
verticalAlignment
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function overrideWith(
|
|
42
|
+
overrider: TableCellStyle | undefined,
|
|
43
|
+
toOverride: TableCellStyle | undefined
|
|
44
|
+
): TableCellStyle {
|
|
45
|
+
const a: TableCellStyleProps = overrider || {};
|
|
46
|
+
const b: TableCellStyleProps = toOverride || {};
|
|
47
|
+
return create({
|
|
48
|
+
background: a.background || b.background,
|
|
49
|
+
borders: LayoutFoundation.overrideWith(a.borders, b.borders),
|
|
50
|
+
borderColor: a.borderColor || b.borderColor,
|
|
51
|
+
padding: LayoutFoundation.overrideWith(a.padding, b.padding),
|
|
52
|
+
verticalAlignment: a.verticalAlignment || b.verticalAlignment
|
|
53
|
+
});
|
|
54
|
+
}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import * as LayoutFoundation from "../primitives/layout-foundation";
|
|
2
|
-
import * as TableCellStyle from "./table-cell-style";
|
|
3
|
-
|
|
4
|
-
export type TableAlignment = "Left" | "Center" | "Right";
|
|
5
|
-
|
|
6
|
-
export interface TableStyle {
|
|
7
|
-
readonly type: "TableStyle";
|
|
8
|
-
readonly margins: LayoutFoundation.LayoutFoundation;
|
|
9
|
-
readonly alignment?: TableAlignment;
|
|
10
|
-
readonly cellStyle: TableCellStyle.TableCellStyle;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface TableStyleProps {
|
|
14
|
-
readonly margins?: LayoutFoundation.LayoutFoundation;
|
|
15
|
-
readonly alignment?: TableAlignment;
|
|
16
|
-
readonly cellStyle?: TableCellStyle.TableCellStyle;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function create(props?: TableStyleProps): TableStyle {
|
|
20
|
-
const {
|
|
21
|
-
margins = LayoutFoundation.create(),
|
|
22
|
-
alignment = undefined,
|
|
23
|
-
cellStyle = TableCellStyle.create()
|
|
24
|
-
} =
|
|
25
|
-
props || {};
|
|
26
|
-
return {
|
|
27
|
-
type: "TableStyle",
|
|
28
|
-
margins,
|
|
29
|
-
alignment,
|
|
30
|
-
cellStyle
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function overrideWith(
|
|
35
|
-
overrider: TableStyle,
|
|
36
|
-
toOverride: TableStyle
|
|
37
|
-
): TableStyle {
|
|
38
|
-
const a: TableStyleProps = overrider || {};
|
|
39
|
-
const b: TableStyleProps = toOverride || {};
|
|
40
|
-
return create({
|
|
41
|
-
margins: LayoutFoundation.overrideWith(a.margins, b.margins),
|
|
42
|
-
alignment: a.alignment || b.alignment,
|
|
43
|
-
cellStyle: TableCellStyle.overrideWith(a.cellStyle, b.cellStyle)
|
|
44
|
-
});
|
|
45
|
-
}
|
|
1
|
+
import * as LayoutFoundation from "../primitives/layout-foundation";
|
|
2
|
+
import * as TableCellStyle from "./table-cell-style";
|
|
3
|
+
|
|
4
|
+
export type TableAlignment = "Left" | "Center" | "Right";
|
|
5
|
+
|
|
6
|
+
export interface TableStyle {
|
|
7
|
+
readonly type: "TableStyle";
|
|
8
|
+
readonly margins: LayoutFoundation.LayoutFoundation;
|
|
9
|
+
readonly alignment?: TableAlignment;
|
|
10
|
+
readonly cellStyle: TableCellStyle.TableCellStyle;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface TableStyleProps {
|
|
14
|
+
readonly margins?: LayoutFoundation.LayoutFoundation;
|
|
15
|
+
readonly alignment?: TableAlignment;
|
|
16
|
+
readonly cellStyle?: TableCellStyle.TableCellStyle;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function create(props?: TableStyleProps): TableStyle {
|
|
20
|
+
const {
|
|
21
|
+
margins = LayoutFoundation.create(),
|
|
22
|
+
alignment = undefined,
|
|
23
|
+
cellStyle = TableCellStyle.create()
|
|
24
|
+
} =
|
|
25
|
+
props || {};
|
|
26
|
+
return {
|
|
27
|
+
type: "TableStyle",
|
|
28
|
+
margins,
|
|
29
|
+
alignment,
|
|
30
|
+
cellStyle
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function overrideWith(
|
|
35
|
+
overrider: TableStyle,
|
|
36
|
+
toOverride: TableStyle
|
|
37
|
+
): TableStyle {
|
|
38
|
+
const a: TableStyleProps = overrider || {};
|
|
39
|
+
const b: TableStyleProps = toOverride || {};
|
|
40
|
+
return create({
|
|
41
|
+
margins: LayoutFoundation.overrideWith(a.margins, b.margins),
|
|
42
|
+
alignment: a.alignment || b.alignment,
|
|
43
|
+
cellStyle: TableCellStyle.overrideWith(a.cellStyle, b.cellStyle)
|
|
44
|
+
});
|
|
45
|
+
}
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
export type TextAlignment = "left" | "center" | "right" | "justify";
|
|
2
|
-
|
|
3
|
-
export interface TextStyle {
|
|
4
|
-
readonly type: "TextStyle";
|
|
5
|
-
readonly fontFamily?: string;
|
|
6
|
-
readonly bold?: boolean;
|
|
7
|
-
readonly mediumBold?: boolean;
|
|
8
|
-
readonly color?: string;
|
|
9
|
-
readonly fontSize?: number;
|
|
10
|
-
readonly fontScale?: number;
|
|
11
|
-
readonly italic?: boolean;
|
|
12
|
-
readonly subScript?: boolean;
|
|
13
|
-
readonly superScript?: boolean;
|
|
14
|
-
readonly underline?: boolean;
|
|
15
|
-
readonly verticalPosition?: number;
|
|
16
|
-
readonly indent?: number;
|
|
17
|
-
readonly lineGap?: number;
|
|
18
|
-
readonly lineBreak?: boolean;
|
|
19
|
-
readonly alignment?: TextAlignment;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface TextStyleProps {
|
|
23
|
-
readonly fontFamily?: string;
|
|
24
|
-
readonly bold?: boolean;
|
|
25
|
-
readonly mediumBold?: boolean;
|
|
26
|
-
readonly color?: string;
|
|
27
|
-
readonly fontSize?: number;
|
|
28
|
-
readonly fontScale?: number;
|
|
29
|
-
readonly italic?: boolean;
|
|
30
|
-
readonly subScript?: boolean;
|
|
31
|
-
readonly superScript?: boolean;
|
|
32
|
-
readonly underline?: boolean;
|
|
33
|
-
readonly verticalPosition?: number;
|
|
34
|
-
readonly indent?: number;
|
|
35
|
-
readonly lineGap?: number;
|
|
36
|
-
readonly lineBreak?: boolean;
|
|
37
|
-
readonly alignment?: TextAlignment;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function create(props?: TextStyleProps): TextStyle {
|
|
41
|
-
return {
|
|
42
|
-
type: "TextStyle",
|
|
43
|
-
...(props || {}),
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function overrideWith(overrider: TextStyle | undefined, toOverride: TextStyle | undefined): TextStyle {
|
|
48
|
-
const a: TextStyleProps = overrider || {};
|
|
49
|
-
const b: TextStyleProps = toOverride || {};
|
|
50
|
-
return create({
|
|
51
|
-
fontFamily: a.fontFamily || b.fontFamily,
|
|
52
|
-
bold: a.bold || b.bold,
|
|
53
|
-
mediumBold: a.mediumBold || b.mediumBold,
|
|
54
|
-
color: a.color || b.color,
|
|
55
|
-
fontSize: a.fontSize || b.fontSize,
|
|
56
|
-
fontScale: a.fontScale || b.fontScale,
|
|
57
|
-
italic: a.italic || b.italic,
|
|
58
|
-
subScript: a.subScript || b.subScript,
|
|
59
|
-
superScript: a.superScript || b.superScript,
|
|
60
|
-
underline: a.underline || b.underline,
|
|
61
|
-
verticalPosition: a.verticalPosition || b.verticalPosition,
|
|
62
|
-
indent: a.indent || b.indent,
|
|
63
|
-
lineGap: a.lineGap || b.lineGap,
|
|
64
|
-
lineBreak: a.lineBreak ?? b.lineBreak,
|
|
65
|
-
alignment: a.alignment ?? b.alignment,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export function calculateFontSize(textStyle: TextStyle | undefined, defaultFontSize: number): number {
|
|
70
|
-
const fontSize = textStyle && textStyle.fontSize ? textStyle.fontSize : defaultFontSize;
|
|
71
|
-
const fontScale = textStyle && textStyle.fontScale ? textStyle.fontScale : 1.0;
|
|
72
|
-
return fontSize * fontScale;
|
|
73
|
-
}
|
|
1
|
+
export type TextAlignment = "left" | "center" | "right" | "justify";
|
|
2
|
+
|
|
3
|
+
export interface TextStyle {
|
|
4
|
+
readonly type: "TextStyle";
|
|
5
|
+
readonly fontFamily?: string;
|
|
6
|
+
readonly bold?: boolean;
|
|
7
|
+
readonly mediumBold?: boolean;
|
|
8
|
+
readonly color?: string;
|
|
9
|
+
readonly fontSize?: number;
|
|
10
|
+
readonly fontScale?: number;
|
|
11
|
+
readonly italic?: boolean;
|
|
12
|
+
readonly subScript?: boolean;
|
|
13
|
+
readonly superScript?: boolean;
|
|
14
|
+
readonly underline?: boolean;
|
|
15
|
+
readonly verticalPosition?: number;
|
|
16
|
+
readonly indent?: number;
|
|
17
|
+
readonly lineGap?: number;
|
|
18
|
+
readonly lineBreak?: boolean;
|
|
19
|
+
readonly alignment?: TextAlignment;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface TextStyleProps {
|
|
23
|
+
readonly fontFamily?: string;
|
|
24
|
+
readonly bold?: boolean;
|
|
25
|
+
readonly mediumBold?: boolean;
|
|
26
|
+
readonly color?: string;
|
|
27
|
+
readonly fontSize?: number;
|
|
28
|
+
readonly fontScale?: number;
|
|
29
|
+
readonly italic?: boolean;
|
|
30
|
+
readonly subScript?: boolean;
|
|
31
|
+
readonly superScript?: boolean;
|
|
32
|
+
readonly underline?: boolean;
|
|
33
|
+
readonly verticalPosition?: number;
|
|
34
|
+
readonly indent?: number;
|
|
35
|
+
readonly lineGap?: number;
|
|
36
|
+
readonly lineBreak?: boolean;
|
|
37
|
+
readonly alignment?: TextAlignment;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function create(props?: TextStyleProps): TextStyle {
|
|
41
|
+
return {
|
|
42
|
+
type: "TextStyle",
|
|
43
|
+
...(props || {}),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function overrideWith(overrider: TextStyle | undefined, toOverride: TextStyle | undefined): TextStyle {
|
|
48
|
+
const a: TextStyleProps = overrider || {};
|
|
49
|
+
const b: TextStyleProps = toOverride || {};
|
|
50
|
+
return create({
|
|
51
|
+
fontFamily: a.fontFamily || b.fontFamily,
|
|
52
|
+
bold: a.bold || b.bold,
|
|
53
|
+
mediumBold: a.mediumBold || b.mediumBold,
|
|
54
|
+
color: a.color || b.color,
|
|
55
|
+
fontSize: a.fontSize || b.fontSize,
|
|
56
|
+
fontScale: a.fontScale || b.fontScale,
|
|
57
|
+
italic: a.italic || b.italic,
|
|
58
|
+
subScript: a.subScript || b.subScript,
|
|
59
|
+
superScript: a.superScript || b.superScript,
|
|
60
|
+
underline: a.underline || b.underline,
|
|
61
|
+
verticalPosition: a.verticalPosition || b.verticalPosition,
|
|
62
|
+
indent: a.indent || b.indent,
|
|
63
|
+
lineGap: a.lineGap || b.lineGap,
|
|
64
|
+
lineBreak: a.lineBreak ?? b.lineBreak,
|
|
65
|
+
alignment: a.alignment ?? b.alignment,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function calculateFontSize(textStyle: TextStyle | undefined, defaultFontSize: number): number {
|
|
70
|
+
const fontSize = textStyle && textStyle.fontSize ? textStyle.fontSize : defaultFontSize;
|
|
71
|
+
const fontScale = textStyle && textStyle.fontScale ? textStyle.fontScale : 1.0;
|
|
72
|
+
return fontSize * fontScale;
|
|
73
|
+
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import * as SectionElement from "../section-elements/section-element";
|
|
2
|
-
import * as TableCellStyle from "../styles/table-cell-style";
|
|
3
|
-
|
|
4
|
-
export interface TableCell {
|
|
5
|
-
readonly styleName: string;
|
|
6
|
-
readonly columnSpan: number;
|
|
7
|
-
readonly style?: TableCellStyle.TableCellStyle;
|
|
8
|
-
readonly children: ReadonlyArray<SectionElement.SectionElement>;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface TableCellProps {
|
|
12
|
-
readonly styleName?: string;
|
|
13
|
-
readonly columnSpan?: number;
|
|
14
|
-
readonly style?: TableCellStyle.TableCellStyle;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function create(
|
|
18
|
-
props?: TableCellProps,
|
|
19
|
-
children?: ReadonlyArray<SectionElement.SectionElement>
|
|
20
|
-
): TableCell {
|
|
21
|
-
const { styleName = "", columnSpan = 1, style = TableCellStyle.create() } =
|
|
22
|
-
props || {};
|
|
23
|
-
return {
|
|
24
|
-
styleName,
|
|
25
|
-
columnSpan,
|
|
26
|
-
style,
|
|
27
|
-
children: children || []
|
|
28
|
-
};
|
|
29
|
-
}
|
|
1
|
+
import * as SectionElement from "../section-elements/section-element";
|
|
2
|
+
import * as TableCellStyle from "../styles/table-cell-style";
|
|
3
|
+
|
|
4
|
+
export interface TableCell {
|
|
5
|
+
readonly styleName: string;
|
|
6
|
+
readonly columnSpan: number;
|
|
7
|
+
readonly style?: TableCellStyle.TableCellStyle;
|
|
8
|
+
readonly children: ReadonlyArray<SectionElement.SectionElement>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface TableCellProps {
|
|
12
|
+
readonly styleName?: string;
|
|
13
|
+
readonly columnSpan?: number;
|
|
14
|
+
readonly style?: TableCellStyle.TableCellStyle;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function create(
|
|
18
|
+
props?: TableCellProps,
|
|
19
|
+
children?: ReadonlyArray<SectionElement.SectionElement>
|
|
20
|
+
): TableCell {
|
|
21
|
+
const { styleName = "", columnSpan = 1, style = TableCellStyle.create() } =
|
|
22
|
+
props || {};
|
|
23
|
+
return {
|
|
24
|
+
styleName,
|
|
25
|
+
columnSpan,
|
|
26
|
+
style,
|
|
27
|
+
children: children || []
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { TableCell } from "./table-cell";
|
|
2
|
-
|
|
3
|
-
export interface TableRow {
|
|
4
|
-
readonly children: ReadonlyArray<TableCell>;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface TableRowProps {}
|
|
8
|
-
|
|
9
|
-
export function create(
|
|
10
|
-
props?: TableRowProps,
|
|
11
|
-
children?: ReadonlyArray<TableCell>
|
|
12
|
-
): TableRow {
|
|
13
|
-
const {} = props || {};
|
|
14
|
-
return {
|
|
15
|
-
children: children || []
|
|
16
|
-
};
|
|
17
|
-
}
|
|
1
|
+
import { TableCell } from "./table-cell";
|
|
2
|
+
|
|
3
|
+
export interface TableRow {
|
|
4
|
+
readonly children: ReadonlyArray<TableCell>;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface TableRowProps {}
|
|
8
|
+
|
|
9
|
+
export function create(
|
|
10
|
+
props?: TableRowProps,
|
|
11
|
+
children?: ReadonlyArray<TableCell>
|
|
12
|
+
): TableRow {
|
|
13
|
+
const {} = props || {};
|
|
14
|
+
return {
|
|
15
|
+
children: children || []
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
// tslint:disable-next-line:readonly-keyword
|
|
2
|
-
export type Indexer<T> = { [key: string]: T };
|
|
3
|
-
export type Guid = string;
|
|
1
|
+
// tslint:disable-next-line:readonly-keyword
|
|
2
|
+
export type Indexer<T> = { [key: string]: T };
|
|
3
|
+
export type Guid = string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Defines a data-type that represents a single test for the Docx render function
|
|
3
|
-
*/
|
|
4
|
-
export type ExportTestDef = {
|
|
5
|
-
readonly name: string;
|
|
6
|
-
readonly only?: boolean;
|
|
7
|
-
readonly skip?: boolean;
|
|
8
|
-
readonly abstractDocJsx: JSX.Element;
|
|
9
|
-
readonly expectedDocxZipContexts: { readonly [filename: string]: string };
|
|
10
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Defines a data-type that represents a single test for the Docx render function
|
|
3
|
+
*/
|
|
4
|
+
export type ExportTestDef = {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly only?: boolean;
|
|
7
|
+
readonly skip?: boolean;
|
|
8
|
+
readonly abstractDocJsx: JSX.Element;
|
|
9
|
+
readonly expectedDocxZipContexts: { readonly [filename: string]: string };
|
|
10
|
+
};
|