@pagenflow/email 1.1.7 → 1.1.9

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>
@@ -17366,15 +17385,15 @@ function Button({ config, devMode }) {
17366
17385
  border: "0 solid",
17367
17386
  margin: 0,
17368
17387
  padding: 0,
17369
- }, children: jsxRuntime.jsx("tbody", { children: jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { dangerouslySetInnerHTML: {
17388
+ }, onClick: devMode ? (e) => e.preventDefault() : undefined, children: jsxRuntime.jsx("tbody", { children: jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { dangerouslySetInnerHTML: {
17370
17389
  __html: `
17371
17390
  ${vmlButton}
17372
17391
  <!--[if !mso]><!-->
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>
@@ -18020,7 +18039,7 @@ function Image({ config, devNode, devMode }) {
18020
18039
  // --- End dev
18021
18040
  width: width || "100%",
18022
18041
  borderCollapse: "collapse",
18023
- }, children: [jsxRuntime.jsx("tbody", { children: jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { style: tdStyle, align: "center", children: content }) }) }), devNode && (jsxRuntime.jsx("tfoot", { children: jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { children: devNode }) }) }))] }));
18042
+ }, onClick: devMode ? (e) => e.preventDefault() : undefined, children: [jsxRuntime.jsx("tbody", { children: jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { style: tdStyle, align: "center", children: content }) }) }), devMode && !!devNode && (jsxRuntime.jsx("tfoot", { children: jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { children: devNode }) }) }))] }));
18024
18043
  }
18025
18044
  var Image_default = React.memo(Image, arePropsEqual);
18026
18045
 
@@ -18219,7 +18238,7 @@ function Text({ config, devMode, children }) {
18219
18238
  jsxRuntime.jsx("table", { "aria-label": "Text Block Wrapper", role: "presentation", cellPadding: 0, cellSpacing: 0, border: 0, style: {
18220
18239
  width: "100%",
18221
18240
  borderCollapse: "collapse",
18222
- }, children: jsxRuntime.jsx("tbody", { children: jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { style: tdStyle, align: textAlign, children: jsxRuntime.jsx("div", { style: contentStyle, dangerouslySetInnerHTML: { __html: (_a = text !== null && text !== void 0 ? text : children) !== null && _a !== void 0 ? _a : "" } }) }) }) }) }));
18241
+ }, onClick: devMode ? (e) => e.preventDefault() : undefined, children: jsxRuntime.jsx("tbody", { children: jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { style: tdStyle, align: textAlign, children: jsxRuntime.jsx("div", { style: contentStyle, dangerouslySetInnerHTML: { __html: (_a = text !== null && text !== void 0 ? text : children) !== null && _a !== void 0 ? _a : "" } }) }) }) }) }));
18223
18242
  }
18224
18243
  var Text_default = React.memo(Text, arePropsEqual);
18225
18244