abstract-document 20.1.6 → 20.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/lib/abstract-document/atoms/text-run.d.ts.map +1 -1
- package/lib/abstract-document/atoms/text-run.js +1 -7
- package/lib/abstract-document/atoms/text-run.js.map +1 -1
- package/lib/abstract-document/markdown/markdown.d.ts.map +1 -1
- package/lib/abstract-document/markdown/markdown.js +58 -60
- package/lib/abstract-document/markdown/markdown.js.map +1 -1
- package/lib/abstract-document/resources.d.ts.map +1 -1
- package/lib/abstract-document/resources.js +1 -3
- package/lib/abstract-document/resources.js.map +1 -1
- package/lib/abstract-document/styles/table-style.js +2 -2
- package/lib/abstract-document/styles/table-style.js.map +1 -1
- package/lib/abstract-document/styles/text-style.js +6 -6
- package/lib/abstract-document/styles/text-style.js.map +1 -1
- package/lib/abstract-document-exporters/docx/xml-writer.d.ts.map +1 -1
- package/lib/abstract-document-exporters/docx/xml-writer.js +14 -17
- package/lib/abstract-document-exporters/docx/xml-writer.js.map +1 -1
- package/lib/abstract-document-exporters/docx2/render-image.js +9 -11
- package/lib/abstract-document-exporters/docx2/render-image.js.map +1 -1
- package/lib/abstract-document-exporters/docx2/render.js +2 -6
- package/lib/abstract-document-exporters/docx2/render.js.map +1 -1
- package/lib/abstract-document-exporters/pdf/font.d.ts.map +1 -1
- package/lib/abstract-document-exporters/pdf/font.js +1 -2
- package/lib/abstract-document-exporters/pdf/font.js.map +1 -1
- package/lib/abstract-document-exporters/pdf/measure.js +3 -3
- package/lib/abstract-document-exporters/pdf/measure.js.map +1 -1
- package/lib/abstract-document-exporters/pdf/paginate.js +1 -0
- package/lib/abstract-document-exporters/pdf/paginate.js.map +1 -1
- package/lib/abstract-document-exporters/pdf/pre-process.js +4 -6
- package/lib/abstract-document-exporters/pdf/pre-process.js.map +1 -1
- package/lib/abstract-document-exporters/pdf/render-image.js +2 -2
- package/lib/abstract-document-exporters/pdf/render-image.js.map +1 -1
- package/lib/abstract-document-exporters/pdf/render.js +23 -26
- package/lib/abstract-document-exporters/pdf/render.js.map +1 -1
- package/lib/abstract-document-exporters/pdf/textRunRow.d.ts.map +1 -1
- package/lib/abstract-document-exporters/pdf/textRunRow.js +21 -23
- package/lib/abstract-document-exporters/pdf/textRunRow.js.map +1 -1
- package/lib/abstract-document-jsx/index.d.ts.map +1 -1
- package/lib/abstract-document-jsx/index.js +5 -5
- package/lib/abstract-document-jsx/index.js.map +1 -1
- package/lib/abstract-document-xml/abstract-doc-of-xml/abstract-doc-of-xml.d.ts.map +1 -1
- package/lib/abstract-document-xml/abstract-doc-of-xml/abstract-doc-of-xml.js +32 -29
- package/lib/abstract-document-xml/abstract-doc-of-xml/abstract-doc-of-xml.js.map +1 -1
- package/lib/abstract-document-xml/abstract-doc-of-xml/creator.d.ts.map +1 -1
- package/lib/abstract-document-xml/abstract-doc-of-xml/creator.js +10 -39
- package/lib/abstract-document-xml/abstract-doc-of-xml/creator.js.map +1 -1
- package/lib/abstract-document-xml/abstract-doc-of-xml/custom-elements.d.ts.map +1 -1
- package/lib/abstract-document-xml/abstract-doc-of-xml/custom-elements.js +16 -5
- package/lib/abstract-document-xml/abstract-doc-of-xml/custom-elements.js.map +1 -1
- package/package.json +4 -4
- package/src/abstract-document/atoms/text-run.ts +1 -7
- package/src/abstract-document/markdown/markdown.ts +74 -76
- package/src/abstract-document/resources.ts +1 -3
- package/src/abstract-document/styles/table-style.ts +2 -2
- package/src/abstract-document/styles/text-style.ts +6 -6
- package/src/abstract-document-exporters/docx/xml-writer.ts +16 -19
- package/src/abstract-document-exporters/docx2/render-image.ts +11 -13
- package/src/abstract-document-exporters/docx2/render.ts +3 -7
- package/src/abstract-document-exporters/pdf/font.ts +1 -2
- package/src/abstract-document-exporters/pdf/measure.ts +9 -9
- package/src/abstract-document-exporters/pdf/paginate.ts +3 -2
- package/src/abstract-document-exporters/pdf/pre-process.ts +5 -7
- package/src/abstract-document-exporters/pdf/render-image.ts +9 -9
- package/src/abstract-document-exporters/pdf/render.ts +25 -28
- package/src/abstract-document-exporters/pdf/textRunRow.ts +32 -35
- package/src/abstract-document-jsx/index.ts +5 -5
- package/src/abstract-document-xml/abstract-doc-of-xml/abstract-doc-of-xml.ts +30 -27
- package/src/abstract-document-xml/abstract-doc-of-xml/creator.ts +13 -42
- package/src/abstract-document-xml/abstract-doc-of-xml/custom-elements.tsx +22 -8
|
@@ -35,7 +35,9 @@ export function extractStyleNames(styleNames: string | undefined, styleNameTypes
|
|
|
35
35
|
return styleNameProps;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
export type TextRowProps = Omit<TextCellProps, "style"> & {
|
|
38
|
+
export type TextRowProps = Omit<TextCellProps, "style"> & {
|
|
39
|
+
readonly cellStyle?: TableCellStyle.TableCellStyle;
|
|
40
|
+
};
|
|
39
41
|
|
|
40
42
|
export function TextRow(props: TextRowProps, styleNameTypes: Record<string, string>): TableRow.TableRow {
|
|
41
43
|
return TableRow.create({}, [TextCell({ ...props, style: props.cellStyle }, styleNameTypes)]);
|
|
@@ -85,7 +87,9 @@ export function TextParagraph(props: TextParagraphProps, styleNameTypes: Record<
|
|
|
85
87
|
return Paragraph.create({ style, styleName: styleNames.ParagraphStyle }, [textRun]);
|
|
86
88
|
}
|
|
87
89
|
|
|
88
|
-
export type ImageRowProps = Omit<ImageCellProps, "style"> & {
|
|
90
|
+
export type ImageRowProps = Omit<ImageCellProps, "style"> & {
|
|
91
|
+
readonly cellStyle?: TableCellStyle.TableCellStyle;
|
|
92
|
+
};
|
|
89
93
|
|
|
90
94
|
export function ImageRow(props: ImageRowProps, styleNameTypes: Record<string, string>): TableRow.TableRow {
|
|
91
95
|
return TableRow.create({}, [ImageCell({ ...props, style: props.cellStyle }, styleNameTypes)]);
|
|
@@ -101,12 +105,18 @@ export type ImageCellProps = Omit<ImageParagraphProps, "style"> & {
|
|
|
101
105
|
export function ImageCell(props: ImageCellProps, styleNameTypes: Record<string, string>): TableCell.TableCell {
|
|
102
106
|
const { imageResource, width, height, horizontalAlignment, verticalAlignment, paragraphStyle, style, columnSpan, rowSpan } = props;
|
|
103
107
|
const styleNames = extractStyleNames(props.styleNames, styleNameTypes);
|
|
104
|
-
const imageElement =
|
|
108
|
+
const imageElement = Image.create({
|
|
109
|
+
imageResource,
|
|
110
|
+
width,
|
|
111
|
+
height,
|
|
112
|
+
horizontalAlignment,
|
|
113
|
+
verticalAlignment,
|
|
114
|
+
});
|
|
105
115
|
const pararaphProps = {
|
|
106
116
|
style: paragraphStyle ? { ...paragraphStyle, type: "ParagraphStyle" } : undefined,
|
|
107
117
|
styleName: styleNames.ParagraphStyle,
|
|
108
118
|
} as ParagraphProps;
|
|
109
|
-
const paragraph =
|
|
119
|
+
const paragraph = Paragraph.create(pararaphProps, [imageElement]);
|
|
110
120
|
return TableCell.create({ columnSpan, rowSpan, style, styleName: styleNames.TableCellStyle }, [paragraph]);
|
|
111
121
|
}
|
|
112
122
|
|
|
@@ -118,9 +128,13 @@ export type ImageParagraphProps = ImageProps & {
|
|
|
118
128
|
export function ImageParagraph(props: ImageParagraphProps, styleNameTypes: Record<string, string>): Paragraph.Paragraph | undefined {
|
|
119
129
|
const { imageResource, width, height, style, horizontalAlignment, verticalAlignment } = props;
|
|
120
130
|
const styleNames = extractStyleNames(props.styleNames, styleNameTypes);
|
|
121
|
-
const imageElement =
|
|
131
|
+
const imageElement = Image.create({
|
|
132
|
+
imageResource,
|
|
133
|
+
width,
|
|
134
|
+
height,
|
|
135
|
+
horizontalAlignment,
|
|
136
|
+
verticalAlignment,
|
|
137
|
+
});
|
|
122
138
|
const pararaphProps = { style, styleName: styleNames.ParagraphStyle };
|
|
123
|
-
return
|
|
139
|
+
return Paragraph.create(pararaphProps, [imageElement]);
|
|
124
140
|
}
|
|
125
|
-
|
|
126
|
-
const ImageMissing = TextRun.create({ text: "Image missing" });
|