react-email 6.5.0 → 6.6.0
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/CHANGELOG.md +6 -0
- package/dist/cli/index.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +8 -0
- package/dist/index.d.mts +8 -0
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/src/components/preview/preview.tsx +6 -2
package/CHANGELOG.md
CHANGED
package/dist/cli/index.mjs
CHANGED
|
@@ -6523,7 +6523,7 @@ const getEmailsDirectoryMetadata = async (absolutePathToEmailsDirectory, keepFil
|
|
|
6523
6523
|
//#region package.json
|
|
6524
6524
|
var package_default = {
|
|
6525
6525
|
name: "react-email",
|
|
6526
|
-
version: "6.
|
|
6526
|
+
version: "6.6.0",
|
|
6527
6527
|
description: "A live preview of your emails right in your browser.",
|
|
6528
6528
|
bin: { "email": "./dist/cli/index.mjs" },
|
|
6529
6529
|
type: "module",
|
package/dist/index.cjs
CHANGED
|
@@ -17879,9 +17879,9 @@ Markdown.displayName = "Markdown";
|
|
|
17879
17879
|
//#endregion
|
|
17880
17880
|
//#region src/components/preview/preview.tsx
|
|
17881
17881
|
const PREVIEW_MAX_LENGTH = 200;
|
|
17882
|
-
const Preview = react.forwardRef(({ children = "", ...props }, ref) => {
|
|
17882
|
+
const Preview = react.forwardRef(({ children = "", useTitleTag = true, ...props }, ref) => {
|
|
17883
17883
|
const text = (Array.isArray(children) ? children.join("") : children).substring(0, PREVIEW_MAX_LENGTH);
|
|
17884
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("title", { children: text }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
17884
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [useTitleTag ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("title", { children: text }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
17885
17885
|
style: {
|
|
17886
17886
|
display: "none",
|
|
17887
17887
|
overflow: "hidden",
|
package/dist/index.d.cts
CHANGED
|
@@ -5058,9 +5058,17 @@ declare const Markdown: React$2.ForwardRefExoticComponent<Readonly<{
|
|
|
5058
5058
|
//#endregion
|
|
5059
5059
|
//#region src/components/preview/preview.d.ts
|
|
5060
5060
|
type PreviewProps = Readonly<React$2.ComponentPropsWithoutRef<'div'> & {
|
|
5061
|
+
/**
|
|
5062
|
+
* @default true
|
|
5063
|
+
*/
|
|
5064
|
+
useTitleTag?: boolean;
|
|
5061
5065
|
children: string | string[];
|
|
5062
5066
|
}>;
|
|
5063
5067
|
declare const Preview: React$2.ForwardRefExoticComponent<Readonly<Omit<React$2.DetailedHTMLProps<React$2.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
5068
|
+
/**
|
|
5069
|
+
* @default true
|
|
5070
|
+
*/
|
|
5071
|
+
useTitleTag?: boolean;
|
|
5064
5072
|
children: string | string[];
|
|
5065
5073
|
}> & React$2.RefAttributes<HTMLDivElement>>;
|
|
5066
5074
|
declare const renderWhiteSpace: (text: string) => _$react_jsx_runtime0.JSX.Element | null;
|
package/dist/index.d.mts
CHANGED
|
@@ -5058,9 +5058,17 @@ declare const Markdown: React$2.ForwardRefExoticComponent<Readonly<{
|
|
|
5058
5058
|
//#endregion
|
|
5059
5059
|
//#region src/components/preview/preview.d.ts
|
|
5060
5060
|
type PreviewProps = Readonly<React$2.ComponentPropsWithoutRef<'div'> & {
|
|
5061
|
+
/**
|
|
5062
|
+
* @default true
|
|
5063
|
+
*/
|
|
5064
|
+
useTitleTag?: boolean;
|
|
5061
5065
|
children: string | string[];
|
|
5062
5066
|
}>;
|
|
5063
5067
|
declare const Preview: React$2.ForwardRefExoticComponent<Readonly<Omit<React$2.DetailedHTMLProps<React$2.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
5068
|
+
/**
|
|
5069
|
+
* @default true
|
|
5070
|
+
*/
|
|
5071
|
+
useTitleTag?: boolean;
|
|
5064
5072
|
children: string | string[];
|
|
5065
5073
|
}> & React$2.RefAttributes<HTMLDivElement>>;
|
|
5066
5074
|
declare const renderWhiteSpace: (text: string) => _$react_jsx_runtime0.JSX.Element | null;
|
package/dist/index.mjs
CHANGED
|
@@ -17858,9 +17858,9 @@ Markdown.displayName = "Markdown";
|
|
|
17858
17858
|
//#endregion
|
|
17859
17859
|
//#region src/components/preview/preview.tsx
|
|
17860
17860
|
const PREVIEW_MAX_LENGTH = 200;
|
|
17861
|
-
const Preview = React$1.forwardRef(({ children = "", ...props }, ref) => {
|
|
17861
|
+
const Preview = React$1.forwardRef(({ children = "", useTitleTag = true, ...props }, ref) => {
|
|
17862
17862
|
const text = (Array.isArray(children) ? children.join("") : children).substring(0, PREVIEW_MAX_LENGTH);
|
|
17863
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("title", { children: text }), /* @__PURE__ */ jsxs("div", {
|
|
17863
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [useTitleTag ? /* @__PURE__ */ jsx("title", { children: text }) : null, /* @__PURE__ */ jsxs("div", {
|
|
17864
17864
|
style: {
|
|
17865
17865
|
display: "none",
|
|
17866
17866
|
overflow: "hidden",
|
package/package.json
CHANGED
|
@@ -2,6 +2,10 @@ import * as React from 'react';
|
|
|
2
2
|
|
|
3
3
|
export type PreviewProps = Readonly<
|
|
4
4
|
React.ComponentPropsWithoutRef<'div'> & {
|
|
5
|
+
/**
|
|
6
|
+
* @default true
|
|
7
|
+
*/
|
|
8
|
+
useTitleTag?: boolean;
|
|
5
9
|
children: string | string[];
|
|
6
10
|
}
|
|
7
11
|
>;
|
|
@@ -9,14 +13,14 @@ export type PreviewProps = Readonly<
|
|
|
9
13
|
const PREVIEW_MAX_LENGTH = 200;
|
|
10
14
|
|
|
11
15
|
export const Preview = React.forwardRef<HTMLDivElement, PreviewProps>(
|
|
12
|
-
({ children = '', ...props }, ref) => {
|
|
16
|
+
({ children = '', useTitleTag = true, ...props }, ref) => {
|
|
13
17
|
const text = (
|
|
14
18
|
Array.isArray(children) ? children.join('') : children
|
|
15
19
|
).substring(0, PREVIEW_MAX_LENGTH);
|
|
16
20
|
|
|
17
21
|
return (
|
|
18
22
|
<>
|
|
19
|
-
<title>{text}</title>
|
|
23
|
+
{useTitleTag ? <title>{text}</title> : null}
|
|
20
24
|
<div
|
|
21
25
|
style={{
|
|
22
26
|
display: 'none',
|