@pagenflow/email 1.1.5 → 1.1.7

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.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
- import React, { memo, createElement, Fragment, useEffect } from 'react';
2
+ import React, { memo, Fragment, useEffect } from 'react';
3
3
 
4
4
  function Body({ children, config = {} }) {
5
5
  var _a, _b, _c, _d;
@@ -17330,26 +17330,6 @@ 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
- color: color,
17336
- textDecoration: "none",
17337
- display: "block",
17338
- // Apply padding here for simplicity, though the TD is more reliable
17339
- padding: padding,
17340
- wordBreak: "break-word",
17341
- fontFamily: "Arial, sans-serif",
17342
- fontSize: "16px",
17343
- fontWeight: "bold",
17344
- lineHeight: "1.2",
17345
- };
17346
- // 2. Button Wrapper TD Style
17347
- const buttonTdStyle = {
17348
- backgroundColor: backgroundColor,
17349
- borderRadius: borderRadius,
17350
- padding: "0",
17351
- width: width || "auto",
17352
- };
17353
17333
  // --- VML Calculation and Code for Outlook Compatibility ---
17354
17334
  // VML needs fixed pixel height. We estimate it based on padding.
17355
17335
  const numericPadding = parseInt(padding.split(" ")[0] || "12", 10);
@@ -17384,16 +17364,24 @@ function Button({ config, devMode }) {
17384
17364
  border: "0 solid",
17385
17365
  margin: 0,
17386
17366
  padding: 0,
17387
- }, children: jsx("tbody", { children: jsx("tr", { children: jsxs("td", { children: [jsx("div", { dangerouslySetInnerHTML: { __html: vmlButton } }), jsx("table", { role: "presentation", cellPadding: 0, cellSpacing: 0, border: 0, style: {
17388
- borderCollapse: "collapse",
17389
- width: "100%",
17390
- }, children: jsx("tbody", { children: jsx("tr", { children: jsx("td", { style: buttonTdStyle, children: createElement(devMode ? "button" : "a", Object.assign(Object.assign({}, (devMode
17391
- ? {}
17392
- : {
17393
- href,
17394
- target: "_blank",
17395
- rel: "noopener noreferrer",
17396
- })), { style: linkStyle, draggable: false }), children) }) }) }) })] }) }) }) }));
17367
+ }, children: jsx("tbody", { children: jsx("tr", { children: jsx("td", { dangerouslySetInnerHTML: {
17368
+ __html: `
17369
+ ${vmlButton}
17370
+ <!--[if !mso]><!-->
17371
+ <table role="presentation" cellpadding="0" cellspacing="0" border="0" style="border-collapse: collapse; width: 100%;">
17372
+ <tbody>
17373
+ <tr>
17374
+ <td style="background-color: ${backgroundColor}; border-radius: ${borderRadius}; padding: 0; width: ${width || "auto"};">
17375
+ <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;">
17376
+ ${typeof children === "string" ? children : ""}
17377
+ </a>
17378
+ </td>
17379
+ </tr>
17380
+ </tbody>
17381
+ </table>
17382
+ <!--<![endif]-->
17383
+ `,
17384
+ } }) }) }) }));
17397
17385
  }
17398
17386
  var Button_default = memo(Button, arePropsEqual);
17399
17387