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