email-builder-utils 1.1.34 → 1.1.40
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertJsonToHtml.d.ts","sourceRoot":"","sources":["../../src/utils/convertJsonToHtml.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,GAAU,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"convertJsonToHtml.d.ts","sourceRoot":"","sources":["../../src/utils/convertJsonToHtml.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,GAAU,UAAU,GAAG,oBA8GpD,CAAC"}
|
|
@@ -73,6 +73,8 @@ const convertJsonToHtml = async (jsonData) => {
|
|
|
73
73
|
font-family: ${fontFamily};
|
|
74
74
|
margin: 0 auto;
|
|
75
75
|
table-layout:fixed;
|
|
76
|
+
width:600px;
|
|
77
|
+
max-width:600px;
|
|
76
78
|
background-color: ${canvasColor};
|
|
77
79
|
color: ${textColor};
|
|
78
80
|
padding: ${top}px ${right}px ${bottom}px ${left}px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonToHTML.d.ts","sourceRoot":"","sources":["../../src/utils/jsonToHTML.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"jsonToHTML.d.ts","sourceRoot":"","sources":["../../src/utils/jsonToHTML.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC,UAAU,cAAc;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,UAAU,UAAU;IAClB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE;QACJ,KAAK,EAAE,cAAc,CAAC;QACtB,KAAK,EAAE,GAAG,CAAC;QACX,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;KAC7B,CAAC;CACH;AAYD,eAAO,MAAM,gBAAgB,kDAAkD,CAAC;AAwFhF,wBAAsB,aAAa,CACjC,SAAS,EAAE,UAAU,EACrB,QAAQ,EAAE,GAAG,EACb,aAAa,EAAE,MAAM,mBAwBtB;AA4qBD,wBAAsB,iBAAiB,CAAC,SAAS,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,mBAyL5E"}
|
package/dist/utils/jsonToHTML.js
CHANGED
|
@@ -133,8 +133,11 @@ function appendOutlookSupport(content, contentStyle, className) {
|
|
|
133
133
|
<!--<![endif]-->
|
|
134
134
|
`;
|
|
135
135
|
}
|
|
136
|
+
// Use a single table that works for both MSO and non-MSO
|
|
137
|
+
// The content inside already has its own MSO conditional comments
|
|
138
|
+
// width="100%" works for modern clients, Outlook will use the td width from nested tables
|
|
136
139
|
return `
|
|
137
|
-
<table width="100%" style="${exports.tableCommonStyle}" class="${visibilityClass}"><tr><td style="${contentStyle}">${content}</td></tr></table>
|
|
140
|
+
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="${exports.tableCommonStyle}; max-width:600px;" class="${visibilityClass}"><tr><td width="100%" style="${contentStyle}">${content}</td></tr></table>
|
|
138
141
|
`;
|
|
139
142
|
}
|
|
140
143
|
function convertDividerBlockToHtml(blockData) {
|
|
@@ -231,33 +234,74 @@ function convertTextBlock(blockData) {
|
|
|
231
234
|
? `<a href="${navigateToUrl}" rel="noreferrer noopener" style="color:inherit;text-decoration:none;cursor:pointer;">${textContent}</a>`
|
|
232
235
|
: textContent;
|
|
233
236
|
}
|
|
234
|
-
async function appendOutlookForImage(content, outerContainerWidth, innerContainerWidth, imageUrl, style = {}) {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
237
|
+
async function appendOutlookForImage(content, outerContainerWidth, innerContainerWidth, imageUrl, style = {}, finalWidth, finalHeight) {
|
|
238
|
+
// OUTLOOK FIX: Use provided dimensions or calculate from image
|
|
239
|
+
let vmlWidth;
|
|
240
|
+
let vmlHeight;
|
|
241
|
+
if (finalWidth && finalHeight) {
|
|
242
|
+
// Use pre-calculated dimensions (preferred for accuracy)
|
|
243
|
+
vmlWidth = finalWidth;
|
|
244
|
+
vmlHeight = finalHeight;
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
// Fallback: calculate from image
|
|
248
|
+
const image = await jimp_1.Jimp.read(imageUrl);
|
|
249
|
+
const originalWidth = image.bitmap.width;
|
|
250
|
+
const originalHeight = image.bitmap.height;
|
|
251
|
+
const widthScalingFactor = Math.min(outerContainerWidth / originalWidth, innerContainerWidth / originalWidth, 1 // Never scale up
|
|
252
|
+
);
|
|
253
|
+
vmlWidth = Math.round(originalWidth * widthScalingFactor);
|
|
254
|
+
vmlHeight = Math.round(originalHeight * widthScalingFactor);
|
|
255
|
+
}
|
|
241
256
|
const borderWidth = parseInt(style?.borderWidth) || 0;
|
|
242
257
|
const borderColor = style?.borderColor || "transparent";
|
|
243
258
|
const borderRadius = parseInt(style?.borderRadius) || 0;
|
|
244
259
|
const useRoundRect = borderRadius > 0;
|
|
245
260
|
const arcsize = useRoundRect
|
|
246
|
-
? Math.min(borderRadius /
|
|
261
|
+
? Math.min(borderRadius / vmlHeight, 1).toFixed(2)
|
|
247
262
|
: "";
|
|
248
263
|
const borderAttributes = borderWidth > 0
|
|
249
264
|
? `strokeweight="${borderWidth}px" strokecolor="${borderColor}"`
|
|
250
265
|
: `stroked="false"`;
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
266
|
+
// OUTLOOK FIX: For Outlook 2019+ (version 2512), VML type="frame" causes stretching
|
|
267
|
+
// Solution: Use simple IMG tag with fixed dimensions for Outlook, only use VML for border radius
|
|
268
|
+
let outlookImage;
|
|
269
|
+
if (useRoundRect && borderRadius > 0) {
|
|
270
|
+
// Use VML for border radius - wrap in table to constrain width for Old Outlook (Word engine)
|
|
271
|
+
// Use aspect="atmost" to prevent image from stretching beyond its bounds
|
|
272
|
+
outlookImage = `<!--[if mso]>
|
|
273
|
+
<table border="0" cellpadding="0" cellspacing="0" width="${vmlWidth}" style="width:${vmlWidth}px;">
|
|
274
|
+
<tr>
|
|
275
|
+
<td align="center" valign="top" width="${vmlWidth}" style="width:${vmlWidth}px;">
|
|
276
|
+
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml"
|
|
277
|
+
style="width:${vmlWidth}px;height:${vmlHeight}px;"
|
|
278
|
+
${borderAttributes}
|
|
279
|
+
arcsize="${arcsize}"
|
|
280
|
+
fill="true" fillcolor="none">
|
|
281
|
+
<v:fill src="${imageUrl}" type="tile" aspect="atmost" />
|
|
282
|
+
<v:textbox inset="0,0,0,0"><div style="display:none;">.</div></v:textbox>
|
|
283
|
+
</v:roundrect>
|
|
284
|
+
</td>
|
|
285
|
+
</tr>
|
|
286
|
+
</table>
|
|
260
287
|
<![endif]-->`;
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
// For images without border radius, wrap in a table with explicit width for Old Outlook (Word engine)
|
|
291
|
+
// This prevents stretching/overflow in Outlook 2007-2019 and Outlook Classic
|
|
292
|
+
const borderStyleAttr = borderWidth > 0
|
|
293
|
+
? `border: ${borderWidth}px solid ${borderColor};`
|
|
294
|
+
: '';
|
|
295
|
+
outlookImage = `<!--[if mso]>
|
|
296
|
+
<table border="0" cellpadding="0" cellspacing="0" width="${vmlWidth}" style="width:${vmlWidth}px;">
|
|
297
|
+
<tr>
|
|
298
|
+
<td align="center" valign="top" width="${vmlWidth}" style="width:${vmlWidth}px;">
|
|
299
|
+
<img src="${imageUrl}" alt="Image" border="0" width="${vmlWidth}" height="${vmlHeight}" style="display:block; width:${vmlWidth}px; height:${vmlHeight}px; max-width:${vmlWidth}px; ${borderStyleAttr}" />
|
|
300
|
+
</td>
|
|
301
|
+
</tr>
|
|
302
|
+
</table>
|
|
303
|
+
<![endif]-->`;
|
|
304
|
+
}
|
|
261
305
|
return `
|
|
262
306
|
${outlookImage}
|
|
263
307
|
<!--[if !mso]><!-->
|
|
@@ -279,42 +323,52 @@ async function convertImageBlock(blockData, cellWidthInPx) {
|
|
|
279
323
|
const { altText, imageUrl, navigateToUrl } = props;
|
|
280
324
|
const visibilityClass = (0, common_1.getVisibilityClass)(props);
|
|
281
325
|
const { width, height, objectFit, borderRadius, borderWidth, borderColor, borderStyle, ...containerStyle } = style;
|
|
282
|
-
// Ensure border styles are applied only to the container, not the image
|
|
283
|
-
const imageStyle = {
|
|
284
|
-
width,
|
|
285
|
-
height,
|
|
286
|
-
objectFit,
|
|
287
|
-
borderStyle,
|
|
288
|
-
borderRadius: borderRadius,
|
|
289
|
-
borderColor,
|
|
290
|
-
};
|
|
291
326
|
// Add border styles to container for fallback clients
|
|
292
327
|
const containerStyles = buildStyles({
|
|
293
328
|
...containerStyle,
|
|
294
329
|
}, { perChanges: [], pxChanges: addPxToAttributes });
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
330
|
+
// OUTLOOK FIX: Ensure cellWidthInPx never exceeds 600px
|
|
331
|
+
const safeCellWidth = Math.min(cellWidthInPx, 600);
|
|
332
|
+
// Parse width percentage (default 100%)
|
|
333
|
+
const widthPercent = typeof width === "string" && width.includes("%")
|
|
334
|
+
? parseInt(width.replace("%", ""))
|
|
335
|
+
: typeof width === "number"
|
|
336
|
+
? width
|
|
337
|
+
: 100;
|
|
338
|
+
// OUTLOOK FIX: Calculate inner container width based on safe cell width
|
|
339
|
+
const paddingLeft = style?.padding?.left || 0;
|
|
340
|
+
const paddingRight = style?.padding?.right || 0;
|
|
341
|
+
const availableWidth = safeCellWidth - paddingLeft - paddingRight;
|
|
342
|
+
const innerContainerWidth = Math.round((widthPercent / 100) * availableWidth);
|
|
343
|
+
// Get image dimensions and calculate scaled sizes
|
|
301
344
|
const { originalWidth, originalHeight, scaledWidth, scaledHeight } = await computeScaledDimensions(imageUrl, innerContainerWidth);
|
|
345
|
+
// OUTLOOK FIX: For Outlook, we need exact pixel dimensions
|
|
346
|
+
// Calculate final dimensions that respect both original size and container
|
|
347
|
+
const finalWidth = Math.min(scaledWidth, innerContainerWidth, originalWidth);
|
|
348
|
+
const finalHeight = Math.round((finalWidth / originalWidth) * originalHeight);
|
|
349
|
+
// Build image styles for modern email clients (non-Outlook)
|
|
302
350
|
const imageTagStyles = buildStyles({
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
351
|
+
borderStyle,
|
|
352
|
+
borderRadius: borderRadius,
|
|
353
|
+
borderColor,
|
|
354
|
+
borderWidth,
|
|
306
355
|
}, {
|
|
307
|
-
perChanges:
|
|
356
|
+
perChanges: [],
|
|
308
357
|
pxChanges: addPxToAttributes,
|
|
309
358
|
});
|
|
310
|
-
|
|
359
|
+
// OUTLOOK FIX: Image element with explicit dimensions
|
|
360
|
+
// Outlook will use width/height attributes, modern clients use CSS
|
|
361
|
+
// Use max-width instead of width:100% to prevent stretching
|
|
362
|
+
const imageElement = `<img src="${imageUrl}" alt="${altText || "Image"}" border="0" width="${finalWidth}" height="${finalHeight}" style="${imageTagStyles}; display:block; max-width:100%; height:auto;" />`;
|
|
311
363
|
const percentWidth = typeof width === "string" && width.endsWith("%")
|
|
312
364
|
? width
|
|
313
365
|
: typeof width === "number"
|
|
314
366
|
? `${width}%`
|
|
315
367
|
: "100%";
|
|
368
|
+
// Non-MSO wrapper for responsive behavior
|
|
316
369
|
const nonMsoWrapper = `<div style="display:inline-block; width:${percentWidth}; max-width:${originalWidth}px;">${imageElement}</div>`;
|
|
317
|
-
|
|
370
|
+
// OUTLOOK FIX: Generate VML with corrected dimensions
|
|
371
|
+
const outlookImage = await appendOutlookForImage(nonMsoWrapper, safeCellWidth, innerContainerWidth, imageUrl, style, finalWidth, finalHeight);
|
|
318
372
|
const imageContent = appendOutlookSupport(outlookImage, containerStyles, visibilityClass);
|
|
319
373
|
return navigateToUrl
|
|
320
374
|
? `<a href="${navigateToUrl}" target="_blank" rel="noreferrer noopener" style="display:block;">${imageContent}</a>`
|
|
@@ -387,16 +441,20 @@ async function convertGridBlock(blockData, rootData, cellWidthInPx) {
|
|
|
387
441
|
});
|
|
388
442
|
const total = childrenIds.length;
|
|
389
443
|
const visualRows = Math.ceil(total / columns);
|
|
444
|
+
// OUTLOOK FIX: Use explicit pixel width for Old Outlook (Word engine)
|
|
445
|
+
const msoTableWidth = Math.min(cellWidthInPx, 600);
|
|
390
446
|
let html = `
|
|
391
447
|
<!--[if mso]>
|
|
392
|
-
<table border="0" cellpadding="0" cellspacing="${columnGap}" width="
|
|
393
|
-
style="border-collapse:separate;border-spacing:${columnGap}px;"
|
|
448
|
+
<table border="0" cellpadding="0" cellspacing="${columnGap}" width="${msoTableWidth}"
|
|
449
|
+
style="border-collapse:separate;border-spacing:${columnGap}px;width:${msoTableWidth}px;"
|
|
394
450
|
class="${gridVisibilityClass}">
|
|
395
451
|
<![endif]-->
|
|
396
|
-
|
|
452
|
+
<!--[if !mso]><!-->
|
|
453
|
+
<table border="0" cellpadding="0" cellspacing="${columnGap}" width="100%"
|
|
397
454
|
role="presentation"
|
|
398
|
-
style="border-collapse:separate;border-spacing:${columnGap}px; ${tableStyles}"
|
|
455
|
+
style="border-collapse:separate;border-spacing:${columnGap}px; ${tableStyles}; max-width:600px;"
|
|
399
456
|
class="${gridVisibilityClass}">
|
|
457
|
+
<!--<![endif]-->
|
|
400
458
|
`;
|
|
401
459
|
for (let r = 0; r < visualRows; r++) {
|
|
402
460
|
html += "<tr>";
|
|
@@ -414,16 +472,38 @@ async function convertGridBlock(blockData, rootData, cellWidthInPx) {
|
|
|
414
472
|
visibleCells++;
|
|
415
473
|
}
|
|
416
474
|
}
|
|
417
|
-
// FIX:
|
|
475
|
+
// OUTLOOK FIX: Calculate safe width based on visible cells
|
|
476
|
+
// If we have visible cells, distribute 100% width evenly
|
|
418
477
|
const safeWidth = visibleCells > 0 ? 100 / visibleCells : 100 / columns;
|
|
478
|
+
// OUTLOOK FIX: Calculate total width used by all cells
|
|
479
|
+
let totalWidth = 0;
|
|
480
|
+
const cellWidthPercents = [];
|
|
419
481
|
for (let c = 0; c < columns; c++) {
|
|
420
|
-
const idx = r * columns + c;
|
|
421
482
|
const id = rowIds[c];
|
|
422
483
|
let widthPercent = cellWidths[c] ?? safeWidth;
|
|
423
|
-
//
|
|
484
|
+
// Validate width
|
|
424
485
|
if (widthPercent <= 0 || widthPercent > 100) {
|
|
425
486
|
widthPercent = safeWidth;
|
|
426
487
|
}
|
|
488
|
+
cellWidthPercents.push(widthPercent);
|
|
489
|
+
if (id) {
|
|
490
|
+
const child = rootData[id];
|
|
491
|
+
const isHidden = child?.data?.props?.hideOnDesktop;
|
|
492
|
+
if (!isHidden) {
|
|
493
|
+
totalWidth += widthPercent;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
// OUTLOOK FIX: If total width < 100%, scale up to fill container
|
|
498
|
+
// This prevents orphaned space that Outlook handles poorly
|
|
499
|
+
const scaleFactor = totalWidth > 0 && totalWidth < 100 ? 100 / totalWidth : 1;
|
|
500
|
+
for (let c = 0; c < columns; c++) {
|
|
501
|
+
const idx = r * columns + c;
|
|
502
|
+
const id = rowIds[c];
|
|
503
|
+
// OUTLOOK FIX: Scale width to ensure cells fill 100% of container
|
|
504
|
+
let widthPercent = cellWidthPercents[c] * scaleFactor;
|
|
505
|
+
// OUTLOOK FIX: Ensure width doesn't exceed 100% after scaling
|
|
506
|
+
widthPercent = Math.min(widthPercent, 100);
|
|
427
507
|
if (id) {
|
|
428
508
|
const child = rootData[id];
|
|
429
509
|
const { style: cellStyle = {}, props: childProps = {} } = child.data;
|
|
@@ -433,6 +513,8 @@ async function convertGridBlock(blockData, rootData, cellWidthInPx) {
|
|
|
433
513
|
// Only render if visible
|
|
434
514
|
if (childVisible) {
|
|
435
515
|
const { html: childHtml, styles } = await convertGridCellBlock(child, rootData, widthPercent, cellWidthInPx);
|
|
516
|
+
// OUTLOOK FIX: Calculate pixel width for Outlook
|
|
517
|
+
const cellWidthPx = Math.round((widthPercent / 100) * cellWidthInPx);
|
|
436
518
|
html += `
|
|
437
519
|
<td
|
|
438
520
|
width="${Math.round(widthPercent)}%"
|
|
@@ -440,7 +522,7 @@ async function convertGridBlock(blockData, rootData, cellWidthInPx) {
|
|
|
440
522
|
responsive ? "stack-column" : "",
|
|
441
523
|
visibilityClass,
|
|
442
524
|
].filter(Boolean).join(" ")}"
|
|
443
|
-
style="vertical-align:${verticalAlign};word-break:break-word;${styles}"
|
|
525
|
+
style="width:${cellWidthPx}px;vertical-align:${verticalAlign};word-break:break-word;${styles}"
|
|
444
526
|
>
|
|
445
527
|
${childHtml}
|
|
446
528
|
</td>`;
|
|
@@ -448,16 +530,26 @@ async function convertGridBlock(blockData, rootData, cellWidthInPx) {
|
|
|
448
530
|
}
|
|
449
531
|
else {
|
|
450
532
|
// SAFE empty cell (keeps layout stable)
|
|
533
|
+
// OUTLOOK FIX: Calculate pixel width for Outlook
|
|
534
|
+
const cellWidthPx = Math.round((widthPercent / 100) * cellWidthInPx);
|
|
451
535
|
html += `
|
|
452
|
-
<td width="${Math.round(widthPercent)}%"
|
|
536
|
+
<td width="${Math.round(widthPercent)}%"
|
|
453
537
|
${responsive ? 'class="stack-column"' : ""}
|
|
454
|
-
style="vertical-align:top;">
|
|
538
|
+
style="width:${cellWidthPx}px;vertical-align:top;">
|
|
455
539
|
</td>`;
|
|
456
540
|
}
|
|
457
541
|
}
|
|
458
542
|
html += "</tr>";
|
|
459
543
|
}
|
|
460
|
-
|
|
544
|
+
// Close both MSO and non-MSO tables
|
|
545
|
+
html += `
|
|
546
|
+
<!--[if mso]>
|
|
547
|
+
</table>
|
|
548
|
+
<![endif]-->
|
|
549
|
+
<!--[if !mso]><!-->
|
|
550
|
+
</table>
|
|
551
|
+
<!--<![endif]-->
|
|
552
|
+
`;
|
|
461
553
|
return html;
|
|
462
554
|
}
|
|
463
555
|
async function convertGridCellBlock(blockData, rootData, cellWidthPercent, parentCellWidthPx) {
|
|
@@ -468,8 +560,11 @@ async function convertGridCellBlock(blockData, rootData, cellWidthPercent, paren
|
|
|
468
560
|
pxChanges: allPxAttributes,
|
|
469
561
|
});
|
|
470
562
|
const parts = [];
|
|
471
|
-
// FIX:
|
|
472
|
-
|
|
563
|
+
// OUTLOOK FIX: Calculate the actual cell width in pixels based on percentage
|
|
564
|
+
// If parent is 600px and cell is 50%, cell width should be 300px, not 600px
|
|
565
|
+
const cellWidthPx = Math.round((cellWidthPercent / 100) * parentCellWidthPx);
|
|
566
|
+
// OUTLOOK FIX: Ensure cell width is reasonable and capped at 600px
|
|
567
|
+
const safeCellWidthPx = Math.min(Math.max(cellWidthPx, 20), 600);
|
|
473
568
|
for (const childId of childrenIds) {
|
|
474
569
|
const child = rootData[childId];
|
|
475
570
|
if (child) {
|
|
@@ -604,7 +699,7 @@ async function convertVideoBlock(blockData, cellWidthInPx) {
|
|
|
604
699
|
height: ${calculatedHeight}px;
|
|
605
700
|
background-color: ${style?.backgroundColor || "#FFFFFF"};
|
|
606
701
|
background-image: url('${resolvedThumbnail}');
|
|
607
|
-
background-size:
|
|
702
|
+
background-size: contain;
|
|
608
703
|
background-position: center;
|
|
609
704
|
background-repeat: no-repeat;
|
|
610
705
|
box-sizing: border-box;
|
|
@@ -632,7 +727,7 @@ async function convertVideoBlock(blockData, cellWidthInPx) {
|
|
|
632
727
|
<!--<![endif]-->`;
|
|
633
728
|
const videoContent = `${outlookVideoContent}${nonOutlookVideoContent}`;
|
|
634
729
|
const wrapperHtml = `
|
|
635
|
-
<table width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation" style="margin:0; padding:0; border-collapse: collapse;" class="${visibilityClass}">
|
|
730
|
+
<table width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation" style="margin:0; padding:0; border-collapse: collapse; max-width:600px;" class="${visibilityClass}">
|
|
636
731
|
<tr>
|
|
637
732
|
<td align="${style?.textAlign || "left"}" style="padding:0; ${outerContainerStyles}">
|
|
638
733
|
<table border="0" cellpadding="0" cellspacing="0" role="presentation"
|
|
@@ -794,7 +889,7 @@ async function convertShapeBlock(blockData) {
|
|
|
794
889
|
}, visibilityClass);
|
|
795
890
|
// Combine into table wrapper
|
|
796
891
|
return `
|
|
797
|
-
<table width="100%" style="border-collapse:collapse;table-layout:fixed;" class="${visibilityClass}">
|
|
892
|
+
<table width="100%" style="border-collapse:collapse;table-layout:fixed;max-width:600px;" class="${visibilityClass}">
|
|
798
893
|
<tr>
|
|
799
894
|
<td style="padding:${padding.top || 0}px ${padding.right || 0}px ${padding.bottom || 0}px ${padding.left || 0}px;text-align:${alignment};">
|
|
800
895
|
${outlookContent}
|