email-builder-utils 1.1.7 → 1.1.9

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.
@@ -172,20 +172,28 @@ async function convertImageBlock(blockData, cellWidthInPx) {
172
172
  : imageContent;
173
173
  }
174
174
  function appendOutlookForButton(content, buttonStyle, navigateToUrl, text) {
175
- const { width, buttonColor, borderColor, borderRadius, borderWidth, height, buttonPadding, color, fontFamily, fontSize, fontWeight } = buttonStyle;
175
+ const { width = 200, height = 44, borderRadius = 0, borderColor = "transparent", borderWidth = 0, buttonColor = "none", buttonPadding = { top: 0, bottom: 0, left: 0, right: 0 }, color = "#000000", fontFamily = "Arial, sans-serif", fontSize = 16, fontWeight = 400, } = buttonStyle;
176
+ const borderAttributes = borderWidth > 0
177
+ ? `strokeweight="${borderWidth}px" strokecolor="${borderColor}"`
178
+ : `stroked="false"`;
176
179
  return `
177
- <!--[if mso]>
178
- <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}px" strokeweight="${borderWidth || 0}px" strokecolor="${borderColor || "transparent"}" fillcolor="${buttonColor || "none"}">
179
- <w:anchorlock/>
180
- <v:textbox inset="${buttonPadding?.top || 0}px, ${buttonPadding?.left || 0}px, ${buttonPadding?.bottom || 0}px, ${buttonPadding?.right || 0}px">
181
- <center style="font-family:${fontFamily || ""};font-size:${fontSize}px;font-weight:${fontWeight};color:${color};">${text}</center>
182
- </v:textbox>
183
- </v:${borderRadius ? "roundrect" : "rect"}>
184
- <![endif]-->
185
- <!--[if !mso]><!-->
186
- ${content}
187
- <!--<![endif]-->
188
- `;
180
+ <!--[if mso]>
181
+ <v:${borderRadius ? "roundrect" : "rect"} xmlns:v="urn:schemas-microsoft-com:vml" href="${navigateToUrl}"
182
+ style="height:${height}px;v-text-anchor:middle;width:${width}px;"
183
+ arcsize="${borderRadius / height}" ${borderAttributes}
184
+ fillcolor="${buttonColor}">
185
+ <w:anchorlock/>
186
+ <v:textbox inset="${buttonPadding.top}px,${buttonPadding.left}px,${buttonPadding.bottom}px,${buttonPadding.right}px">
187
+ <center style="font-family:${fontFamily};font-size:${fontSize}px;font-weight:${fontWeight};color:${color};">
188
+ ${text}
189
+ </center>
190
+ </v:textbox>
191
+ </v:${borderRadius ? "roundrect" : "rect"}>
192
+ <![endif]-->
193
+ <!--[if !mso]><!-->
194
+ ${content}
195
+ <!--<![endif]-->
196
+ `;
189
197
  }
190
198
  function convertButtonBlock(blockData) {
191
199
  const { style, props } = blockData.data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "email-builder-utils",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [