@pagenflow/email 1.3.4 → 1.3.6

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.
@@ -15,15 +15,22 @@ export interface HeadingConfig {
15
15
  fontSize?: string;
16
16
  /** Font weight (e.g., 'normal', 'bold', or '700'). */
17
17
  fontWeight?: string;
18
- /** Font style (e.g., 'italic'). */ fontStyle?: string;
18
+ /** Font style (e.g., 'italic'). */
19
+ fontStyle?: string;
19
20
  /** Line height (e.g., '1.3' or '30px'). */
20
21
  lineHeight?: string;
21
- /** Letter spacing (e.g., '0.5px', '1px'). */ letterSpacing?: string;
22
- /** Text transform (e.g., 'uppercase', 'lowercase', 'capitalize'). */ textTransform?: string;
23
- /** Text decoration (e.g., 'underline', 'line-through'). */ textDecoration?: string;
24
- /** Text direction (e.g., 'ltr', 'rtl'). */ direction?: string;
25
- /** Vertical alignment (e.g., 'sub', 'super'). Applied to content wrapper in Text, applied to TD here for alignment. */ verticalAlign?: string;
26
- /** Background color of the heading block. */ backgroundColor?: string;
22
+ /** Letter spacing (e.g., '0.5px', '1px'). */
23
+ letterSpacing?: string;
24
+ /** Text transform (e.g., 'uppercase', 'lowercase', 'capitalize'). */
25
+ textTransform?: string;
26
+ /** Text decoration (e.g., 'underline', 'line-through'). */
27
+ textDecoration?: string;
28
+ /** Text direction (e.g., 'ltr', 'rtl'). */
29
+ direction?: string;
30
+ /** Vertical alignment (e.g., 'sub', 'super'). Applied to content wrapper in Text, applied to TD here for alignment. */
31
+ verticalAlign?: string;
32
+ /** Background color of the heading block. */
33
+ backgroundColor?: string;
27
34
  }
28
35
  export type HeadingProps = {
29
36
  config: HeadingConfig;
package/dist/index.cjs.js CHANGED
@@ -2022,53 +2022,55 @@ function Head({ children, backgroundColor = "#ffffff", title = "Email Preview",
2022
2022
  }
2023
2023
 
2024
2024
  /* 3. Handling Mobile Wrap - Pure CSS Solution */
2025
+ /* Target only the direct row-content-table, not nested ones */
2026
+
2025
2027
  /* Force table to act like block container */
2026
- .responsive-row[data-mobile-wrap="true"] .content-table {
2028
+ .responsive-row[data-mobile-wrap="true"] > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > td > .row-content-table {
2027
2029
  width: 100% !important;
2028
2030
  max-width: 100% !important;
2029
2031
  }
2030
2032
 
2031
2033
  /* Force table row to stack cells */
2032
- .responsive-row[data-mobile-wrap="true"] .content-tr {
2034
+ .responsive-row[data-mobile-wrap="true"] > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > td > .row-content-table > tbody > .content-tr {
2033
2035
  display: block !important;
2034
2036
  }
2035
2037
 
2036
2038
  /* Force each child cell to be full width block */
2037
- .responsive-row[data-mobile-wrap="true"] .child-cell {
2039
+ .responsive-row[data-mobile-wrap="true"] > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > td > .row-content-table > tbody > .content-tr > .child-cell {
2038
2040
  display: block !important;
2039
2041
  width: 100% !important;
2040
2042
  box-sizing: border-box !important;
2041
2043
  }
2042
2044
 
2043
2045
  /* Hide horizontal gap cells and create vertical spacing with padding */
2044
- .responsive-row[data-mobile-wrap="true"] .row-gap-td {
2046
+ .responsive-row[data-mobile-wrap="true"] > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > td > .row-content-table > tbody > .content-tr > .row-gap-td {
2045
2047
  display: none !important;
2046
2048
  width: 0 !important;
2047
2049
  height: 0 !important;
2048
2050
  }
2049
2051
 
2050
2052
  /* Add vertical spacing between stacked cells using margin */
2051
- .responsive-row[data-mobile-wrap="true"] .child-cell:not(:last-child) {
2053
+ .responsive-row[data-mobile-wrap="true"] > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > td > .row-content-table > tbody > .content-tr > .child-cell:not(:last-child) {
2052
2054
  margin-bottom: 20px !important;
2053
2055
  }
2054
2056
 
2055
2057
  /* Dynamic gap support - common values */
2056
- .responsive-row[data-mobile-wrap="true"][data-gap="10px"] .child-cell:not(:last-child) {
2058
+ .responsive-row[data-mobile-wrap="true"][data-gap="10px"] > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > td > .row-content-table > tbody > .content-tr > .child-cell:not(:last-child) {
2057
2059
  margin-bottom: 10px !important;
2058
2060
  }
2059
- .responsive-row[data-mobile-wrap="true"][data-gap="15px"] .child-cell:not(:last-child) {
2061
+ .responsive-row[data-mobile-wrap="true"][data-gap="15px"] > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > td > .row-content-table > tbody > .content-tr > .child-cell:not(:last-child) {
2060
2062
  margin-bottom: 15px !important;
2061
2063
  }
2062
- .responsive-row[data-mobile-wrap="true"][data-gap="20px"] .child-cell:not(:last-child) {
2064
+ .responsive-row[data-mobile-wrap="true"][data-gap="20px"] > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > td > .row-content-table > tbody > .content-tr > .child-cell:not(:last-child) {
2063
2065
  margin-bottom: 20px !important;
2064
2066
  }
2065
- .responsive-row[data-mobile-wrap="true"][data-gap="24px"] .child-cell:not(:last-child) {
2067
+ .responsive-row[data-mobile-wrap="true"][data-gap="24px"] > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > td > .row-content-table > tbody > .content-tr > .child-cell:not(:last-child) {
2066
2068
  margin-bottom: 24px !important;
2067
2069
  }
2068
- .responsive-row[data-mobile-wrap="true"][data-gap="30px"] .child-cell:not(:last-child) {
2070
+ .responsive-row[data-mobile-wrap="true"][data-gap="30px"] > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > td > .row-content-table > tbody > .content-tr > .child-cell:not(:last-child) {
2069
2071
  margin-bottom: 30px !important;
2070
2072
  }
2071
- .responsive-row[data-mobile-wrap="true"][data-gap="40px"] .child-cell:not(:last-child) {
2073
+ .responsive-row[data-mobile-wrap="true"][data-gap="40px"] > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > td > .row-content-table > tbody > .content-tr > .child-cell:not(:last-child) {
2072
2074
  margin-bottom: 40px !important;
2073
2075
  }
2074
2076
  }
@@ -2150,8 +2152,10 @@ function Head({ children, backgroundColor = "#ffffff", title = "Email Preview",
2150
2152
  }
2151
2153
 
2152
2154
  function Heading({ config, devMode, children }) {
2153
- var _a;
2154
2155
  const { text, level = "h1", padding, color, textAlign, fontSize, fontWeight, fontStyle, lineHeight, letterSpacing, textTransform, textDecoration, direction, verticalAlign, backgroundColor, } = config;
2156
+ // Determine the content to render
2157
+ const content = text !== null && text !== void 0 ? text : children;
2158
+ const isString = typeof content === "string";
2155
2159
  // 1. TD Style: Where padding, background, width, and verticalAlign are applied.
2156
2160
  const tdStyle = {
2157
2161
  padding: padding,
@@ -2178,7 +2182,6 @@ function Heading({ config, devMode, children }) {
2178
2182
  fontFamily: "Arial, Helvetica, sans-serif",
2179
2183
  // Outlook specific fixes (using string indexing)
2180
2184
  ["msoLineHeightRule"]: "exactly",
2181
- // ["mso-line-height-rule" as string]: "exactly",
2182
2185
  };
2183
2186
  // Dynamically create the Heading element
2184
2187
  const HeadingTag = level;
@@ -2187,7 +2190,7 @@ function Heading({ config, devMode, children }) {
2187
2190
  jsxRuntime.jsx("table", { "aria-label": "Heading Block Wrapper", role: "presentation", cellPadding: 0, cellSpacing: 0, border: 0, style: {
2188
2191
  width: "100%",
2189
2192
  borderCollapse: "collapse",
2190
- }, children: jsxRuntime.jsx("tbody", { children: jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { style: tdStyle, align: textAlign, children: jsxRuntime.jsx(HeadingTag, { style: headingStyle, dangerouslySetInnerHTML: { __html: (_a = text !== null && text !== void 0 ? text : children) !== null && _a !== void 0 ? _a : "" } }) }) }) }) }));
2193
+ }, children: jsxRuntime.jsx("tbody", { children: jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { style: tdStyle, align: textAlign, children: isString ? (jsxRuntime.jsx(HeadingTag, { style: headingStyle, dangerouslySetInnerHTML: { __html: content } })) : (jsxRuntime.jsx(HeadingTag, { style: headingStyle, children: content })) }) }) }) }));
2191
2194
  }
2192
2195
  var Heading_default = React.memo(Heading, arePropsEqual);
2193
2196
 
@@ -2345,7 +2348,7 @@ function Row({ children, config, devNode }) {
2345
2348
  width: "100%",
2346
2349
  height: "100%",
2347
2350
  borderCollapse: "collapse",
2348
- }, children: jsxRuntime.jsx("tbody", { children: jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { align: tdAlign, children: jsxRuntime.jsx("table", Object.assign({ "aria-label": "Row Content", role: "presentation", cellPadding: 0, cellSpacing: 0, border: 0, style: contentTableStyle }, (config.height && { height: config.height }), { className: "content-table", children: jsxRuntime.jsx("tbody", { children: jsxRuntime.jsx("tr", { className: "content-tr", children: childrenArray.map((child, index) => (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx("td", { valign: tdValign, style: {
2351
+ }, children: jsxRuntime.jsx("tbody", { children: jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { align: tdAlign, children: jsxRuntime.jsx("table", Object.assign({ "aria-label": "Row Content", role: "presentation", cellPadding: 0, cellSpacing: 0, border: 0, style: contentTableStyle }, (config.height && { height: config.height }), { className: "content-table row-content-table", children: jsxRuntime.jsx("tbody", { children: jsxRuntime.jsx("tr", { className: "content-tr", children: childrenArray.map((child, index) => (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx("td", { valign: tdValign, style: {
2349
2352
  verticalAlign: tdValign,
2350
2353
  textAlign: "left",
2351
2354
  padding: "0",