email-builder-utils 1.0.13 → 1.0.15
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 +4 -4
- 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"];
|
|
8
8
|
const addPxOrPerToAttributes = ["width", "height"];
|
|
9
9
|
const allPxAttributes = [...addPxToAttributes, ...addPxOrPerToAttributes];
|
|
10
10
|
exports.tableCommonStyle = "border-collapse:collapse; table-layout:fixed;";
|
|
@@ -112,7 +112,7 @@ async function appendOutlookForImage(content, outerContainerWidth, innerContaine
|
|
|
112
112
|
const scaledHeight = Math.round(originalHeight * widthScalingFactor); // Maintain aspect ratio
|
|
113
113
|
// VML for Outlook
|
|
114
114
|
const outlookImage = `<!--[if mso]>
|
|
115
|
-
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" style="width:${scaledWidth}px;height:${scaledHeight}px;">
|
|
115
|
+
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" style="width:${scaledWidth}px;height:${scaledHeight}px;" stroke="f" fillcolor="none">
|
|
116
116
|
<v:fill src="${imageUrl}" type="frame" />
|
|
117
117
|
</v:rect>
|
|
118
118
|
<![endif]-->`;
|
|
@@ -139,9 +139,9 @@ function appendOutlookForButton(content, buttonStyle, navigateToUrl, text) {
|
|
|
139
139
|
const { width, buttonColor, borderColor, borderRadius, borderWidth, height, buttonPadding, color, fontFamily, fontSize, fontWeight } = buttonStyle;
|
|
140
140
|
return `
|
|
141
141
|
<!--[if mso]>
|
|
142
|
-
<v:${borderRadius ? "roundrect" : "rect"} xmlns:v="urn:schemas-microsoft-com:vml" href="${navigateToUrl}" xmlns:w="urn:schemas-microsoft-com:office:word" style="height:${height || 44}px;width:${width || 200}px;v-text-anchor:middle;" arcsize="${borderRadius || 0}
|
|
142
|
+
<v:${borderRadius ? "roundrect" : "rect"} xmlns:v="urn:schemas-microsoft-com:vml" href="${navigateToUrl}" xmlns:w="urn:schemas-microsoft-com:office:word" style="height:${height || 44}px;width:${width || 200}px;v-text-anchor:middle;" arcsize="${borderRadius || 0}%" strokeweight="${borderWidth || 1}px" strokecolor="${borderColor || "none"}" fillcolor="${buttonColor || "none"}">
|
|
143
143
|
<w:anchorlock/>
|
|
144
|
-
<v:textbox inset="
|
|
144
|
+
<v:textbox inset="0px, 0px, 0px, 0px">
|
|
145
145
|
<center style="font-family:${fontFamily || ""};font-size:${fontSize}px;font-weight:${fontWeight};color:${color};">${text}</center>
|
|
146
146
|
</v:textbox>
|
|
147
147
|
</v:${borderRadius ? "roundrect" : "rect"}>
|