@pagenflow/email 1.3.4 → 1.3.5

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
@@ -2150,8 +2150,10 @@ function Head({ children, backgroundColor = "#ffffff", title = "Email Preview",
2150
2150
  }
2151
2151
 
2152
2152
  function Heading({ config, devMode, children }) {
2153
- var _a;
2154
2153
  const { text, level = "h1", padding, color, textAlign, fontSize, fontWeight, fontStyle, lineHeight, letterSpacing, textTransform, textDecoration, direction, verticalAlign, backgroundColor, } = config;
2154
+ // Determine the content to render
2155
+ const content = text !== null && text !== void 0 ? text : children;
2156
+ const isString = typeof content === "string";
2155
2157
  // 1. TD Style: Where padding, background, width, and verticalAlign are applied.
2156
2158
  const tdStyle = {
2157
2159
  padding: padding,
@@ -2178,7 +2180,6 @@ function Heading({ config, devMode, children }) {
2178
2180
  fontFamily: "Arial, Helvetica, sans-serif",
2179
2181
  // Outlook specific fixes (using string indexing)
2180
2182
  ["msoLineHeightRule"]: "exactly",
2181
- // ["mso-line-height-rule" as string]: "exactly",
2182
2183
  };
2183
2184
  // Dynamically create the Heading element
2184
2185
  const HeadingTag = level;
@@ -2187,7 +2188,7 @@ function Heading({ config, devMode, children }) {
2187
2188
  jsxRuntime.jsx("table", { "aria-label": "Heading Block Wrapper", role: "presentation", cellPadding: 0, cellSpacing: 0, border: 0, style: {
2188
2189
  width: "100%",
2189
2190
  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 : "" } }) }) }) }) }));
2191
+ }, 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
2192
  }
2192
2193
  var Heading_default = React.memo(Heading, arePropsEqual);
2193
2194