@comet/mail-react 9.3.0 → 9.3.1-canary-20260806072913
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/lib/blocks/pixelImage/HtmlPixelImageBlock.d.ts +1 -0
- package/lib/blocks/pixelImage/HtmlPixelImageBlock.js +1 -0
- package/lib/blocks/richText/createRichTextBlock.d.ts +4 -2
- package/lib/blocks/richText/createRichTextBlock.js +3 -1
- package/lib/components/button/HtmlButton.d.ts +2 -0
- package/lib/components/button/HtmlButton.js +2 -0
- package/lib/components/divider/HtmlDivider.d.ts +2 -0
- package/lib/components/divider/HtmlDivider.js +2 -0
- package/lib/components/image/HtmlImage.d.ts +1 -0
- package/lib/components/image/HtmlImage.js +1 -0
- package/lib/components/text/HtmlText.d.ts +2 -0
- package/package.json +3 -3
|
@@ -6,6 +6,7 @@ export type HtmlPixelImageBlockProps = Omit<ComponentProps<"img">, "src" | "widt
|
|
|
6
6
|
*
|
|
7
7
|
* Use within raw HTML context — HTML-only emails or
|
|
8
8
|
* [MJML ending tags](https://documentation.mjml.io/#ending-tags) like `MjmlRaw`.
|
|
9
|
+
* Inside `MjmlRaw` in an `MjmlColumn`, place `HtmlPixelImageBlock` in a `<tr>` and `<td>` of its own.
|
|
9
10
|
* For MJML context, use `MjmlPixelImageBlock`.
|
|
10
11
|
*/
|
|
11
12
|
export declare function HtmlPixelImageBlock({ data, width, largestPossibleRenderWidth, aspectRatio, className, ...imgProps }: HtmlPixelImageBlockProps): ReactNode;
|
|
@@ -7,6 +7,7 @@ import { usePixelImageBlockData } from "./usePixelImageBlockData.js";
|
|
|
7
7
|
*
|
|
8
8
|
* Use within raw HTML context — HTML-only emails or
|
|
9
9
|
* [MJML ending tags](https://documentation.mjml.io/#ending-tags) like `MjmlRaw`.
|
|
10
|
+
* Inside `MjmlRaw` in an `MjmlColumn`, place `HtmlPixelImageBlock` in a `<tr>` and `<td>` of its own.
|
|
10
11
|
* For MJML context, use `MjmlPixelImageBlock`.
|
|
11
12
|
*/
|
|
12
13
|
export function HtmlPixelImageBlock({ data, width, largestPossibleRenderWidth, aspectRatio, className, ...imgProps }) {
|
|
@@ -11,7 +11,9 @@ import type { CreateRichTextBlockOptions, RichTextBlockProps } from "./common.js
|
|
|
11
11
|
*
|
|
12
12
|
* `MjmlRichTextBlock` renders each draft block as `MjmlText` and must be
|
|
13
13
|
* placed within an `MjmlColumn`. `HtmlRichTextBlock` renders each draft block
|
|
14
|
-
* as `HtmlText` for raw-HTML contexts (e.g. inside `MjmlRaw`)
|
|
14
|
+
* as `HtmlText` for raw-HTML contexts (e.g. inside `MjmlRaw`); inside
|
|
15
|
+
* `MjmlRaw` in an `MjmlColumn`, place `HtmlRichTextBlock` in a `<tr>` and
|
|
16
|
+
* `<td>` of its own.
|
|
15
17
|
*
|
|
16
18
|
* ```ts
|
|
17
19
|
* export const { MjmlRichTextBlock, HtmlRichTextBlock } = createRichTextBlock({
|
|
@@ -25,6 +27,6 @@ import type { CreateRichTextBlockOptions, RichTextBlockProps } from "./common.js
|
|
|
25
27
|
export declare function createRichTextBlock<TLinkTypes extends Record<string, unknown> = Record<string, unknown>>(options?: CreateRichTextBlockOptions<TLinkTypes>): {
|
|
26
28
|
/** Renders CMS RichText block data (draft-js raw content) as one `MjmlText` per draft block. Must be placed within an `MjmlColumn`. */
|
|
27
29
|
MjmlRichTextBlock: (props: RichTextBlockProps) => ReactNode;
|
|
28
|
-
/** Renders CMS RichText block data (draft-js raw content) as one `HtmlText` div per draft block, for raw-HTML contexts such as `MjmlRaw`. */
|
|
30
|
+
/** Renders CMS RichText block data (draft-js raw content) as one `HtmlText` div per draft block, for raw-HTML contexts such as `MjmlRaw`. Inside `MjmlRaw` in an `MjmlColumn`, place `HtmlRichTextBlock` in a `<tr>` and `<td>` of its own. */
|
|
29
31
|
HtmlRichTextBlock: (props: RichTextBlockProps) => ReactNode;
|
|
30
32
|
};
|
|
@@ -50,7 +50,9 @@ function renderRichTextContent({ draftContent, blockTypes, linkTypes, inline, bl
|
|
|
50
50
|
*
|
|
51
51
|
* `MjmlRichTextBlock` renders each draft block as `MjmlText` and must be
|
|
52
52
|
* placed within an `MjmlColumn`. `HtmlRichTextBlock` renders each draft block
|
|
53
|
-
* as `HtmlText` for raw-HTML contexts (e.g. inside `MjmlRaw`)
|
|
53
|
+
* as `HtmlText` for raw-HTML contexts (e.g. inside `MjmlRaw`); inside
|
|
54
|
+
* `MjmlRaw` in an `MjmlColumn`, place `HtmlRichTextBlock` in a `<tr>` and
|
|
55
|
+
* `<td>` of its own.
|
|
54
56
|
*
|
|
55
57
|
* ```ts
|
|
56
58
|
* export const { MjmlRichTextBlock, HtmlRichTextBlock } = createRichTextBlock({
|
|
@@ -4,6 +4,8 @@ import type { ButtonProps } from "./buttonProps.js";
|
|
|
4
4
|
export type HtmlButtonProps = ButtonProps & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, keyof ButtonProps>;
|
|
5
5
|
/**
|
|
6
6
|
* Themed button for use inside MJML ending tags or outside of the MJML context.
|
|
7
|
+
* Inside `MjmlRaw` in an `MjmlColumn`, place `HtmlButton` in a `<tr>` and `<td>` of its own.
|
|
8
|
+
* For MJML context, use `MjmlButton`.
|
|
7
9
|
*/
|
|
8
10
|
export declare function HtmlButton({ variant: variantProp, fullWidth, target, href, className, style, children, ...restProps }: HtmlButtonProps): ReactNode;
|
|
9
11
|
export declare function generateHtmlButtonStyles(theme: Theme): string;
|
|
@@ -8,6 +8,8 @@ import { defaultButtonStyles } from "./defaultButtonStyles.js";
|
|
|
8
8
|
import { generateResponsiveButtonCss } from "./generateResponsiveButtonCss.js";
|
|
9
9
|
/**
|
|
10
10
|
* Themed button for use inside MJML ending tags or outside of the MJML context.
|
|
11
|
+
* Inside `MjmlRaw` in an `MjmlColumn`, place `HtmlButton` in a `<tr>` and `<td>` of its own.
|
|
12
|
+
* For MJML context, use `MjmlButton`.
|
|
11
13
|
*/
|
|
12
14
|
export function HtmlButton({ variant: variantProp, fullWidth, target = "_blank", href = "#", className, style, children, ...restProps }) {
|
|
13
15
|
const theme = useOptionalTheme();
|
|
@@ -4,6 +4,8 @@ import type { DividerProps } from "./dividerProps.js";
|
|
|
4
4
|
export type HtmlDividerProps = DividerProps;
|
|
5
5
|
/**
|
|
6
6
|
* Themed divider for use inside MJML ending tags or outside of the MJML context.
|
|
7
|
+
* Inside `MjmlRaw` in an `MjmlColumn`, place `HtmlDivider` in a `<tr>` and `<td>` of its own.
|
|
8
|
+
* For MJML context, use `MjmlDivider`.
|
|
7
9
|
*/
|
|
8
10
|
export declare function HtmlDivider({ variant: variantProp, height: heightProp, backgroundColor: backgroundColorProp, backgroundImage: backgroundImageProp, className, style, }: HtmlDividerProps): ReactNode;
|
|
9
11
|
export declare function generateHtmlDividerStyles(theme: Theme): string;
|
|
@@ -10,6 +10,8 @@ import { generateResponsiveDividerCss } from "./generateResponsiveDividerCss.js"
|
|
|
10
10
|
const zeroWidthSpace = String.fromCharCode(0x200b);
|
|
11
11
|
/**
|
|
12
12
|
* Themed divider for use inside MJML ending tags or outside of the MJML context.
|
|
13
|
+
* Inside `MjmlRaw` in an `MjmlColumn`, place `HtmlDivider` in a `<tr>` and `<td>` of its own.
|
|
14
|
+
* For MJML context, use `MjmlDivider`.
|
|
13
15
|
*/
|
|
14
16
|
export function HtmlDivider({ variant: variantProp, height: heightProp, backgroundColor: backgroundColorProp, backgroundImage: backgroundImageProp, className, style, }) {
|
|
15
17
|
const theme = useOptionalTheme();
|
|
@@ -6,6 +6,7 @@ export type HtmlImageProps = ComponentProps<"img">;
|
|
|
6
6
|
*
|
|
7
7
|
* Use within raw HTML context — HTML-only emails or
|
|
8
8
|
* [MJML ending tags](https://documentation.mjml.io/#ending-tags) like `MjmlRaw`.
|
|
9
|
+
* Inside `MjmlRaw` in an `MjmlColumn`, place `HtmlImage` in a `<tr>` and `<td>` of its own.
|
|
9
10
|
* For MJML context, use `MjmlImage`.
|
|
10
11
|
*/
|
|
11
12
|
export declare function HtmlImage({ className, ...restProps }: HtmlImageProps): ReactNode;
|
|
@@ -8,6 +8,7 @@ import { css } from "../../utils/css.js";
|
|
|
8
8
|
*
|
|
9
9
|
* Use within raw HTML context — HTML-only emails or
|
|
10
10
|
* [MJML ending tags](https://documentation.mjml.io/#ending-tags) like `MjmlRaw`.
|
|
11
|
+
* Inside `MjmlRaw` in an `MjmlColumn`, place `HtmlImage` in a `<tr>` and `<td>` of its own.
|
|
11
12
|
* For MJML context, use `MjmlImage`.
|
|
12
13
|
*/
|
|
13
14
|
export function HtmlImage({ className, ...restProps }) {
|
|
@@ -43,6 +43,8 @@ export type HtmlTextProps<E extends keyof JSX.IntrinsicElements = "td"> = HtmlTe
|
|
|
43
43
|
} & Omit<ComponentPropsWithoutRef<E>, keyof HtmlTextOwnProps | "element">;
|
|
44
44
|
/**
|
|
45
45
|
* Themed text component for use inside MJML ending tags or outside of the MJML context.
|
|
46
|
+
* Inside `MjmlRaw` in an `MjmlColumn`, place `HtmlText` in a `<tr>` of its own,
|
|
47
|
+
* and in a `<td>` too when `element` is not the default `td`.
|
|
46
48
|
*/
|
|
47
49
|
export declare function HtmlText<E extends keyof JSX.IntrinsicElements>(props: HtmlTextOwnProps & {
|
|
48
50
|
element: E;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comet/mail-react",
|
|
3
|
-
"version": "9.3.
|
|
3
|
+
"version": "9.3.1-canary-20260806072913",
|
|
4
4
|
"description": "Utilities for building HTML emails with React",
|
|
5
5
|
"license": "BSD-2-Clause",
|
|
6
6
|
"type": "module",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"typescript": "^5.9.3",
|
|
49
49
|
"vite": "^7.3.1",
|
|
50
50
|
"vitest": "^4.1.8",
|
|
51
|
-
"@comet/cli": "9.3.
|
|
52
|
-
"@comet/eslint-config": "9.3.
|
|
51
|
+
"@comet/cli": "9.3.1-canary-20260806072913",
|
|
52
|
+
"@comet/eslint-config": "9.3.1-canary-20260806072913"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|