@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 +25 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +25 -6
- 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>
|
|
@@ -17364,15 +17383,15 @@ function Button({ config, devMode }) {
|
|
|
17364
17383
|
border: "0 solid",
|
|
17365
17384
|
margin: 0,
|
|
17366
17385
|
padding: 0,
|
|
17367
|
-
}, children: jsx("tbody", { children: jsx("tr", { children: jsx("td", { dangerouslySetInnerHTML: {
|
|
17386
|
+
}, onClick: devMode ? (e) => e.preventDefault() : undefined, children: jsx("tbody", { children: jsx("tr", { children: jsx("td", { dangerouslySetInnerHTML: {
|
|
17368
17387
|
__html: `
|
|
17369
17388
|
${vmlButton}
|
|
17370
17389
|
<!--[if !mso]><!-->
|
|
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>
|
|
@@ -18018,7 +18037,7 @@ function Image({ config, devNode, devMode }) {
|
|
|
18018
18037
|
// --- End dev
|
|
18019
18038
|
width: width || "100%",
|
|
18020
18039
|
borderCollapse: "collapse",
|
|
18021
|
-
}, children: [jsx("tbody", { children: jsx("tr", { children: jsx("td", { style: tdStyle, align: "center", children: content }) }) }), devNode && (jsx("tfoot", { children: jsx("tr", { children: jsx("td", { children: devNode }) }) }))] }));
|
|
18040
|
+
}, onClick: devMode ? (e) => e.preventDefault() : undefined, children: [jsx("tbody", { children: jsx("tr", { children: jsx("td", { style: tdStyle, align: "center", children: content }) }) }), devMode && !!devNode && (jsx("tfoot", { children: jsx("tr", { children: jsx("td", { children: devNode }) }) }))] }));
|
|
18022
18041
|
}
|
|
18023
18042
|
var Image_default = memo(Image, arePropsEqual);
|
|
18024
18043
|
|
|
@@ -18217,7 +18236,7 @@ function Text({ config, devMode, children }) {
|
|
|
18217
18236
|
jsx("table", { "aria-label": "Text Block Wrapper", role: "presentation", cellPadding: 0, cellSpacing: 0, border: 0, style: {
|
|
18218
18237
|
width: "100%",
|
|
18219
18238
|
borderCollapse: "collapse",
|
|
18220
|
-
}, children: jsx("tbody", { children: jsx("tr", { children: jsx("td", { style: tdStyle, align: textAlign, children: jsx("div", { style: contentStyle, dangerouslySetInnerHTML: { __html: (_a = text !== null && text !== void 0 ? text : children) !== null && _a !== void 0 ? _a : "" } }) }) }) }) }));
|
|
18239
|
+
}, onClick: devMode ? (e) => e.preventDefault() : undefined, children: jsx("tbody", { children: jsx("tr", { children: jsx("td", { style: tdStyle, align: textAlign, children: jsx("div", { style: contentStyle, dangerouslySetInnerHTML: { __html: (_a = text !== null && text !== void 0 ? text : children) !== null && _a !== void 0 ? _a : "" } }) }) }) }) }));
|
|
18221
18240
|
}
|
|
18222
18241
|
var Text_default = memo(Text, arePropsEqual);
|
|
18223
18242
|
|