@pagenflow/email 1.1.7 → 1.1.8
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/index.cjs.js +22 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +22 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -17330,6 +17330,25 @@ const justifyMap$2 = {
|
|
|
17330
17330
|
function Button({ config, devMode }) {
|
|
17331
17331
|
const { href, children, backgroundColor = "#007bff", // Default blue
|
|
17332
17332
|
color = "#ffffff", padding = "12px 24px", borderRadius = "3px", width, justifyContent = "center", } = config;
|
|
17333
|
+
// 1. Link (A) Tag Styles (Fallback for Webmail/Mobile)
|
|
17334
|
+
const linkStyle = {
|
|
17335
|
+
textDecoration: "none",
|
|
17336
|
+
display: "block",
|
|
17337
|
+
// Apply padding here for simplicity, though the TD is more reliable
|
|
17338
|
+
padding: padding,
|
|
17339
|
+
wordBreak: "break-word",
|
|
17340
|
+
fontFamily: "Arial, sans-serif",
|
|
17341
|
+
fontSize: "16px",
|
|
17342
|
+
fontWeight: "bold",
|
|
17343
|
+
lineHeight: "1.2",
|
|
17344
|
+
};
|
|
17345
|
+
// 2. Button Wrapper TD Style
|
|
17346
|
+
const buttonTdStyle = {
|
|
17347
|
+
backgroundColor: backgroundColor,
|
|
17348
|
+
borderRadius: borderRadius,
|
|
17349
|
+
padding: "0",
|
|
17350
|
+
width: width || "auto",
|
|
17351
|
+
};
|
|
17333
17352
|
// --- VML Calculation and Code for Outlook Compatibility ---
|
|
17334
17353
|
// VML needs fixed pixel height. We estimate it based on padding.
|
|
17335
17354
|
const numericPadding = parseInt(padding.split(" ")[0] || "12", 10);
|
|
@@ -17345,7 +17364,7 @@ function Button({ config, devMode }) {
|
|
|
17345
17364
|
<!--[if mso]>
|
|
17346
17365
|
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="${href}" style="height:${vmlHeight}px;v-text-anchor:middle;width:${vmlWidth}px;" arcsize="${(parseInt(borderRadius) / vmlHeight) * 100}%" strokecolor="${vmlFillColor}" fillcolor="${vmlFillColor}">
|
|
17347
17366
|
<w:anchorlock/>
|
|
17348
|
-
<center style="color:${color};font-family
|
|
17367
|
+
<center style="color:${color};font-family:${linkStyle.fontFamily};font-size:${linkStyle.fontSize};font-weight:${linkStyle.fontWeight};">
|
|
17349
17368
|
${typeof children === "string" ? children : ""}
|
|
17350
17369
|
</center>
|
|
17351
17370
|
</v:roundrect>
|
|
@@ -17371,8 +17390,8 @@ function Button({ config, devMode }) {
|
|
|
17371
17390
|
<table role="presentation" cellpadding="0" cellspacing="0" border="0" style="border-collapse: collapse; width: 100%;">
|
|
17372
17391
|
<tbody>
|
|
17373
17392
|
<tr>
|
|
17374
|
-
<td style="background-color: ${backgroundColor}; border-radius: ${borderRadius}; padding:
|
|
17375
|
-
<a href="${href}" target="_blank" rel="noopener noreferrer" style="color: ${color}; text-decoration:
|
|
17393
|
+
<td style="background-color: ${buttonTdStyle.backgroundColor}; border-radius: ${buttonTdStyle.borderRadius}; padding: ${buttonTdStyle.padding}; width: ${buttonTdStyle.width};">
|
|
17394
|
+
<a href="${href}" target="_blank" rel="noopener noreferrer" style="color: ${color}; text-decoration: ${linkStyle.textDecoration}; display: ${linkStyle.display}; padding: ${linkStyle.padding}; word-break: ${linkStyle.wordBreak}; font-family: ${linkStyle.fontFamily}; font-size: ${linkStyle.fontSize}; font-weight: ${linkStyle.fontWeight}; line-height: ${linkStyle.lineHeight};">
|
|
17376
17395
|
${typeof children === "string" ? children : ""}
|
|
17377
17396
|
</a>
|
|
17378
17397
|
</td>
|