email-builder-utils 1.1.42 → 1.1.44

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":"AAGA,eAAO,MAAM,iBAAiB,GAAU,UAAU,GAAG,oBAiHpD,CAAC"}
1
+ {"version":3,"file":"convertJsonToHtml.d.ts","sourceRoot":"","sources":["../../src/utils/convertJsonToHtml.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB,GAAU,UAAU,GAAG,oBAwHpD,CAAC"}
@@ -13,89 +13,96 @@ const convertJsonToHtml = async (jsonData) => {
13
13
  }
14
14
  const { fontFamily, canvasColor, textColor, padding = {}, borderColor, borderRadius, borderWidth, borderStyle, } = rootData.style || {};
15
15
  const { top = 0, right = 0, bottom = 0, left = 0 } = padding;
16
- const rawHtml = `<!DOCTYPE html>
17
- <html lang="en">
18
- <head>
19
- <meta charset="UTF-8" />
20
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
21
- <meta name="x-apple-disable-message-reformatting" />
22
- <style>
23
- .responsive-table {
24
- width: 100%;
25
- max-width: 600px;
26
- }
27
- @media only screen and (max-width: 600px) {
28
- .responsive-table {
29
- width: 100% !important;
30
- }
31
- .stack-column,
32
- .stack-column td {
33
- display: block !important;
34
- width: 100% !important;
35
- max-width: 100% !important;
36
- }
37
- }
38
- .hide-mobile {
39
- display: block !important;
40
- }
41
-
42
- .hide-desktop {
43
- display: block !important;
44
- mso-hide: all !important; /* Hide in Outlook (treated as desktop) */
45
- }
46
-
47
- @media only screen and (max-width: 600px) {
48
- .hide-mobile {
49
- display: none !important;
50
- max-height: 0 !important;
51
- overflow: hidden !important;
52
- mso-hide: all !important;
53
- }
54
- }
55
-
56
- @media only screen and (min-width: 601px) {
57
- .hide-desktop {
58
- display: none !important;
59
- max-height: 0 !important;
60
- overflow: hidden !important;
61
- mso-hide: all !important;
62
- }
63
- }
64
-
65
- </style>
66
- </head>
67
- <body style="margin:0; padding:0; background-color:${canvasColor};">
68
- <center style="width:100%; background-color:${canvasColor};">
69
- <table
70
- class="responsive-table"
71
- role="presentation"
72
- bgcolor="${canvasColor}"
73
- cellpadding="0"
74
- cellspacing="0"
75
- border="0"
76
- width="600"
77
- align="center"
78
- style="
79
- font-family: ${(0, fontFallback_1.withFontFallback)(fontFamily)};
80
- margin: 0 auto;
81
- table-layout:fixed;
82
- width:600px;
83
- max-width:600px;
84
- background-color: ${canvasColor};
85
- color: ${textColor};
86
- border: ${borderWidth}px ${borderStyle} ${borderColor};
87
- border-radius: ${borderRadius}px; "
88
- >
89
- <tbody>
90
- <tr>
91
- <td style="padding: ${top}px ${right}px ${bottom}px ${left}px;">
92
- ${blocksHtml.join("")}
93
- </td>
94
- </tr>
95
- </tbody>
96
- </table>
97
- </center>
98
- </body>
16
+ const rawHtml = `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
17
+ <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
18
+ <head>
19
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
20
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
21
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
22
+ <meta name="x-apple-disable-message-reformatting" />
23
+ <!--[if gte mso 9]><xml>
24
+ <o:OfficeDocumentSettings>
25
+ <o:AllowPNG/>
26
+ <o:PixelsPerInch>96</o:PixelsPerInch>
27
+ </o:OfficeDocumentSettings>
28
+ </xml><![endif]-->
29
+ <style>
30
+ .responsive-table {
31
+ width: 100%;
32
+ max-width: 600px;
33
+ }
34
+ @media only screen and (max-width: 600px) {
35
+ .responsive-table {
36
+ width: 100% !important;
37
+ }
38
+ .stack-column,
39
+ .stack-column td {
40
+ display: block !important;
41
+ width: 100% !important;
42
+ max-width: 100% !important;
43
+ }
44
+ }
45
+ .hide-mobile {
46
+ display: block !important;
47
+ }
48
+
49
+ .hide-desktop {
50
+ display: block !important;
51
+ mso-hide: all !important; /* Hide in Outlook (treated as desktop) */
52
+ }
53
+
54
+ @media only screen and (max-width: 600px) {
55
+ .hide-mobile {
56
+ display: none !important;
57
+ max-height: 0 !important;
58
+ overflow: hidden !important;
59
+ mso-hide: all !important;
60
+ }
61
+ }
62
+
63
+ @media only screen and (min-width: 601px) {
64
+ .hide-desktop {
65
+ display: none !important;
66
+ max-height: 0 !important;
67
+ overflow: hidden !important;
68
+ mso-hide: all !important;
69
+ }
70
+ }
71
+
72
+ </style>
73
+ </head>
74
+ <body style="margin:0; padding:0; background-color:${canvasColor};">
75
+ <center style="width:100%; background-color:${canvasColor};">
76
+ <table
77
+ class="responsive-table"
78
+ role="presentation"
79
+ bgcolor="${canvasColor}"
80
+ cellpadding="0"
81
+ cellspacing="0"
82
+ border="0"
83
+ width="600"
84
+ align="center"
85
+ style="
86
+ font-family: ${(0, fontFallback_1.withFontFallback)(fontFamily)};
87
+ margin: 0 auto;
88
+ table-layout:fixed;
89
+ width:600px;
90
+ max-width:600px;
91
+ background-color: ${canvasColor};
92
+ ${textColor ? `color: ${textColor};` : ''}
93
+ ${borderWidth ? `border: ${borderWidth}px ${borderStyle || 'solid'} ${borderColor || 'transparent'};` : ''}
94
+ ${borderRadius ? `border-radius: ${borderRadius}px;` : ''}"
95
+ >
96
+ <tbody>
97
+ <tr>
98
+ <td style="padding: ${top}px ${right}px ${bottom}px ${left}px;">
99
+ ${blocksHtml.join("")}
100
+ </td>
101
+ </tr>
102
+ </tbody>
103
+ </table>
104
+ </center>
105
+ </body>
99
106
  </html>`;
100
107
  return rawHtml;
101
108
  };
@@ -1 +1 @@
1
- {"version":3,"file":"jsonToHTML.d.ts","sourceRoot":"","sources":["../../src/utils/jsonToHTML.ts"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