email-builder-utils 1.0.10 → 1.0.11
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.
|
@@ -6,7 +6,7 @@ const convertJsonToHtml = async (jsonData) => {
|
|
|
6
6
|
const rootData = jsonData?.root?.data;
|
|
7
7
|
const blocksHtml = [];
|
|
8
8
|
for (const childId of rootData?.childrenIds) {
|
|
9
|
-
blocksHtml.push(await (0, jsonToHTML_1.convertToHtml)(jsonData[childId], jsonData, 600));
|
|
9
|
+
blocksHtml.push(await (0, jsonToHTML_1.convertToHtml)(jsonData[childId], jsonData, 600 - (rootData.style?.padding?.left || 0) - (rootData.style?.padding?.right || 0)));
|
|
10
10
|
}
|
|
11
11
|
const rawHtml = `
|
|
12
12
|
<!DOCTYPE html>
|
package/dist/utils/jsonToHTML.js
CHANGED
|
@@ -125,7 +125,7 @@ async function convertImageBlock(blockData, cellWidthInPx) {
|
|
|
125
125
|
const containerStyles = buildStyles(containerStyle, { perChanges: [], pxChanges: addPxToAttributes });
|
|
126
126
|
const imageTagStyles = buildStyles(imageStyle, { perChanges: addPxOrPerToAttributes, pxChanges: addPxToAttributes });
|
|
127
127
|
const imageElement = `<img src="${imageUrl}" alt="${altText}" style="${imageTagStyles}" />`;
|
|
128
|
-
const outlookImage = await appendOutlookForImage(imageElement, cellWidthInPx, ((typeof width === "string" ? parseInt(width.replace("%", "")) : width) / 100) * cellWidthInPx, imageUrl);
|
|
128
|
+
const outlookImage = await appendOutlookForImage(imageElement, cellWidthInPx, ((typeof width === "string" ? parseInt(width.replace("%", "")) : width) / 100) * (cellWidthInPx - style?.padding?.left - style?.padding?.right), imageUrl);
|
|
129
129
|
const imageContent = appendOutlookSupport(outlookImage, containerStyles);
|
|
130
130
|
return navigateToUrl ? `<a href="${navigateToUrl}" target="_blank" style="display:block; text-decoration:none; cursor:pointer;">${imageContent}</a>` : imageContent;
|
|
131
131
|
}
|