email-builder-utils 1.1.3 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/utils/jsonToHTML.js +15 -2
- package/package.json +1 -1
package/dist/utils/jsonToHTML.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.tableCommonStyle = void 0;
|
|
|
4
4
|
exports.convertToHtml = convertToHtml;
|
|
5
5
|
const jimp_1 = require("jimp");
|
|
6
6
|
const types_1 = require("../types");
|
|
7
|
-
const addPxToAttributes = ["fontSize", "lineHeight"];
|
|
7
|
+
const addPxToAttributes = ["fontSize", "lineHeight", "borderRadius", "borderWidth"];
|
|
8
8
|
const addPxOrPerToAttributes = ["width", "height"];
|
|
9
9
|
const allPxAttributes = [...addPxToAttributes, ...addPxOrPerToAttributes];
|
|
10
10
|
exports.tableCommonStyle = "border-collapse:collapse; table-layout:fixed;";
|
|
@@ -75,11 +75,24 @@ function appendOutlookSupport(content, contentStyle) {
|
|
|
75
75
|
<table width="100%" style="${exports.tableCommonStyle}"><tr><td style="${contentStyle}">${content}</td></tr></table>
|
|
76
76
|
`;
|
|
77
77
|
}
|
|
78
|
+
// function convertDividerBlockToHtml(blockData: IBlockData) {
|
|
79
|
+
// const { style } = blockData.data;
|
|
80
|
+
// const { thickness, dividerColor, ...rest } = style;
|
|
81
|
+
// const convertedStyle = buildStyles(rest, {perChanges: [], pxChanges: allPxAttributes});
|
|
82
|
+
// return appendOutlookSupport(`<hr style="height:${thickness}px; background-color: ${dividerColor};" />`, convertedStyle);
|
|
83
|
+
// }
|
|
78
84
|
function convertDividerBlockToHtml(blockData) {
|
|
79
85
|
const { style } = blockData.data;
|
|
80
86
|
const { thickness, dividerColor, ...rest } = style;
|
|
81
87
|
const convertedStyle = buildStyles(rest, { perChanges: [], pxChanges: allPxAttributes });
|
|
82
|
-
|
|
88
|
+
const dividerContent = `
|
|
89
|
+
<table width="100%" cellpadding="0" cellspacing="0">
|
|
90
|
+
<tr>
|
|
91
|
+
<td height="${thickness}" style="font-size:1px; line-height:1px; background:${dividerColor};"> </td>
|
|
92
|
+
</tr>
|
|
93
|
+
</table>
|
|
94
|
+
`;
|
|
95
|
+
return appendOutlookSupport(dividerContent, convertedStyle);
|
|
83
96
|
}
|
|
84
97
|
function convertSpacerBlockToHtml(blockData) {
|
|
85
98
|
const { style } = blockData.data;
|