@react-email/render 1.2.2 → 1.3.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.
@@ -1,209 +1,148 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __async = (__this, __arguments, generator) => {
21
- return new Promise((resolve, reject) => {
22
- var fulfilled = (value) => {
23
- try {
24
- step(generator.next(value));
25
- } catch (e) {
26
- reject(e);
27
- }
28
- };
29
- var rejected = (value) => {
30
- try {
31
- step(generator.throw(value));
32
- } catch (e) {
33
- reject(e);
34
- }
35
- };
36
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
37
- step((generator = generator.apply(__this, __arguments)).next());
38
- });
39
- };
40
-
41
- // src/node/render.tsx
42
1
  import { Suspense } from "react";
43
-
44
- // src/shared/utils/pretty.ts
45
2
  import * as html from "prettier/plugins/html";
46
3
  import { format } from "prettier/standalone";
4
+ import { convert } from "html-to-text";
5
+ import { Writable } from "node:stream";
6
+ import { jsx } from "react/jsx-runtime";
7
+
8
+ //#region src/shared/utils/pretty.ts
47
9
  function recursivelyMapDoc(doc, callback) {
48
- if (Array.isArray(doc)) {
49
- return doc.map((innerDoc) => recursivelyMapDoc(innerDoc, callback));
50
- }
51
- if (typeof doc === "object") {
52
- if (doc.type === "group") {
53
- return __spreadProps(__spreadValues({}, doc), {
54
- contents: recursivelyMapDoc(doc.contents, callback),
55
- expandedStates: recursivelyMapDoc(
56
- doc.expandedStates,
57
- callback
58
- )
59
- });
60
- }
61
- if ("contents" in doc) {
62
- return __spreadProps(__spreadValues({}, doc), {
63
- contents: recursivelyMapDoc(doc.contents, callback)
64
- });
65
- }
66
- if ("parts" in doc) {
67
- return __spreadProps(__spreadValues({}, doc), {
68
- parts: recursivelyMapDoc(doc.parts, callback)
69
- });
70
- }
71
- if (doc.type === "if-break") {
72
- return __spreadProps(__spreadValues({}, doc), {
73
- breakContents: recursivelyMapDoc(doc.breakContents, callback),
74
- flatContents: recursivelyMapDoc(doc.flatContents, callback)
75
- });
76
- }
77
- }
78
- return callback(doc);
10
+ if (Array.isArray(doc)) return doc.map((innerDoc) => recursivelyMapDoc(innerDoc, callback));
11
+ if (typeof doc === "object") {
12
+ if (doc.type === "group") return {
13
+ ...doc,
14
+ contents: recursivelyMapDoc(doc.contents, callback),
15
+ expandedStates: recursivelyMapDoc(doc.expandedStates, callback)
16
+ };
17
+ if ("contents" in doc) return {
18
+ ...doc,
19
+ contents: recursivelyMapDoc(doc.contents, callback)
20
+ };
21
+ if ("parts" in doc) return {
22
+ ...doc,
23
+ parts: recursivelyMapDoc(doc.parts, callback)
24
+ };
25
+ if (doc.type === "if-break") return {
26
+ ...doc,
27
+ breakContents: recursivelyMapDoc(doc.breakContents, callback),
28
+ flatContents: recursivelyMapDoc(doc.flatContents, callback)
29
+ };
30
+ }
31
+ return callback(doc);
79
32
  }
80
- var modifiedHtml = __spreadValues({}, html);
33
+ const modifiedHtml = { ...html };
81
34
  if (modifiedHtml.printers) {
82
- const previousPrint = modifiedHtml.printers.html.print;
83
- modifiedHtml.printers.html.print = (path, options, print, args) => {
84
- const node = path.getNode();
85
- const rawPrintingResult = previousPrint(path, options, print, args);
86
- if (node.type === "ieConditionalComment") {
87
- const printingResult = recursivelyMapDoc(rawPrintingResult, (doc) => {
88
- if (typeof doc === "object" && doc.type === "line") {
89
- return doc.soft ? "" : " ";
90
- }
91
- return doc;
92
- });
93
- return printingResult;
94
- }
95
- return rawPrintingResult;
96
- };
35
+ const previousPrint = modifiedHtml.printers.html.print;
36
+ modifiedHtml.printers.html.print = (path, options, print, args) => {
37
+ const node = path.getNode();
38
+ const rawPrintingResult = previousPrint(path, options, print, args);
39
+ if (node.type === "ieConditionalComment") return recursivelyMapDoc(rawPrintingResult, (doc) => {
40
+ if (typeof doc === "object" && doc.type === "line") return doc.soft ? "" : " ";
41
+ return doc;
42
+ });
43
+ return rawPrintingResult;
44
+ };
97
45
  }
98
- var defaults = {
99
- endOfLine: "lf",
100
- tabWidth: 2,
101
- plugins: [modifiedHtml],
102
- bracketSameLine: true,
103
- parser: "html"
46
+ const defaults = {
47
+ endOfLine: "lf",
48
+ tabWidth: 2,
49
+ plugins: [modifiedHtml],
50
+ bracketSameLine: true,
51
+ parser: "html"
104
52
  };
105
- var pretty = (str, options = {}) => {
106
- return format(str.replaceAll("\0", ""), __spreadValues(__spreadValues({}, defaults), options));
53
+ const pretty = (str, options = {}) => {
54
+ return format(str.replaceAll("\0", ""), {
55
+ ...defaults,
56
+ ...options
57
+ });
107
58
  };
108
59
 
109
- // src/shared/utils/to-plain-text.ts
110
- import {
111
- convert
112
- } from "html-to-text";
113
- var plainTextSelectors = [
114
- { selector: "img", format: "skip" },
115
- { selector: "[data-skip-in-text=true]", format: "skip" },
116
- {
117
- selector: "a",
118
- options: { linkBrackets: false }
119
- }
60
+ //#endregion
61
+ //#region src/shared/utils/to-plain-text.ts
62
+ const plainTextSelectors = [
63
+ {
64
+ selector: "img",
65
+ format: "skip"
66
+ },
67
+ {
68
+ selector: "[data-skip-in-text=true]",
69
+ format: "skip"
70
+ },
71
+ {
72
+ selector: "a",
73
+ options: {
74
+ linkBrackets: false,
75
+ hideLinkHrefIfSameAsText: true
76
+ }
77
+ }
120
78
  ];
121
- function toPlainText(html2, options) {
122
- return convert(html2, __spreadValues({
123
- selectors: plainTextSelectors
124
- }, options));
79
+ function toPlainText(html$1, options) {
80
+ return convert(html$1, {
81
+ selectors: plainTextSelectors,
82
+ ...options
83
+ });
125
84
  }
126
85
 
127
- // src/node/read-stream.ts
128
- import { Writable } from "node:stream";
129
- var decoder = new TextDecoder("utf-8");
130
- var readStream = (stream) => __async(void 0, null, function* () {
131
- let result = "";
132
- if ("pipeTo" in stream) {
133
- const writableStream = new WritableStream({
134
- write(chunk) {
135
- result += decoder.decode(chunk);
136
- }
137
- });
138
- yield stream.pipeTo(writableStream);
139
- } else {
140
- const writable = new Writable({
141
- write(chunk, _encoding, callback) {
142
- result += decoder.decode(chunk);
143
- callback();
144
- }
145
- });
146
- stream.pipe(writable);
147
- yield new Promise((resolve, reject) => {
148
- writable.on("error", reject);
149
- writable.on("close", () => {
150
- resolve();
151
- });
152
- });
153
- }
154
- return result;
155
- });
156
-
157
- // src/node/render.tsx
158
- import { jsx } from "react/jsx-runtime";
159
- var render = (node, options) => __async(void 0, null, function* () {
160
- const suspendedElement = /* @__PURE__ */ jsx(Suspense, { children: node });
161
- const reactDOMServer = yield import("react-dom/server").then(
162
- // This is beacuse react-dom/server is CJS
163
- (m) => m.default
164
- );
165
- let html2;
166
- if (Object.hasOwn(reactDOMServer, "renderToReadableStream")) {
167
- html2 = yield readStream(
168
- yield reactDOMServer.renderToReadableStream(suspendedElement, {
169
- progressiveChunkSize: Number.POSITIVE_INFINITY
170
- })
171
- );
172
- } else {
173
- yield new Promise((resolve, reject) => {
174
- const stream = reactDOMServer.renderToPipeableStream(suspendedElement, {
175
- onAllReady() {
176
- return __async(this, null, function* () {
177
- html2 = yield readStream(stream);
178
- resolve();
179
- });
180
- },
181
- onError(error) {
182
- reject(error);
183
- },
184
- progressiveChunkSize: Number.POSITIVE_INFINITY
185
- });
186
- });
187
- }
188
- if (options == null ? void 0 : options.plainText) {
189
- return toPlainText(html2, options.htmlToTextOptions);
190
- }
191
- const doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
192
- const document = `${doctype}${html2.replace(/<!DOCTYPE.*?>/, "")}`;
193
- if (options == null ? void 0 : options.pretty) {
194
- return pretty(document);
195
- }
196
- return document;
197
- });
86
+ //#endregion
87
+ //#region src/node/read-stream.ts
88
+ const decoder = new TextDecoder("utf-8");
89
+ const readStream = async (stream) => {
90
+ let result = "";
91
+ if ("pipeTo" in stream) {
92
+ const writableStream = new WritableStream({ write(chunk) {
93
+ result += decoder.decode(chunk);
94
+ } });
95
+ await stream.pipeTo(writableStream);
96
+ } else {
97
+ const writable = new Writable({ write(chunk, _encoding, callback) {
98
+ result += decoder.decode(chunk);
99
+ callback();
100
+ } });
101
+ stream.pipe(writable);
102
+ await new Promise((resolve, reject) => {
103
+ writable.on("error", reject);
104
+ writable.on("close", () => {
105
+ resolve();
106
+ });
107
+ });
108
+ }
109
+ return result;
110
+ };
198
111
 
199
- // src/node/index.ts
200
- var renderAsync = (element, options) => {
201
- return render(element, options);
112
+ //#endregion
113
+ //#region src/node/render.tsx
114
+ const render = async (node, options) => {
115
+ const suspendedElement = /* @__PURE__ */ jsx(Suspense, { children: node });
116
+ const reactDOMServer = await import("react-dom/server").then((m) => m.default);
117
+ let html$1;
118
+ if (Object.hasOwn(reactDOMServer, "renderToReadableStream")) html$1 = await readStream(await reactDOMServer.renderToReadableStream(suspendedElement, { progressiveChunkSize: Number.POSITIVE_INFINITY }));
119
+ else await new Promise((resolve, reject) => {
120
+ const stream = reactDOMServer.renderToPipeableStream(suspendedElement, {
121
+ async onAllReady() {
122
+ html$1 = await readStream(stream);
123
+ resolve();
124
+ },
125
+ onError(error) {
126
+ reject(error);
127
+ },
128
+ progressiveChunkSize: Number.POSITIVE_INFINITY
129
+ });
130
+ });
131
+ if (options?.plainText) return toPlainText(html$1, options.htmlToTextOptions);
132
+ const document = `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">${html$1.replace(/<!DOCTYPE.*?>/, "")}`;
133
+ if (options?.pretty) return pretty(document);
134
+ return document;
202
135
  };
203
- export {
204
- plainTextSelectors,
205
- pretty,
206
- render,
207
- renderAsync,
208
- toPlainText
136
+
137
+ //#endregion
138
+ //#region src/node/index.ts
139
+ /**
140
+ * @deprecated use {@link render}
141
+ */
142
+ const renderAsync = (element, options) => {
143
+ return render(element, options);
209
144
  };
145
+
146
+ //#endregion
147
+ export { plainTextSelectors, pretty, render, renderAsync, toPlainText };
148
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["defaults: Options","plainTextSelectors: SelectorDefinition[]","html","html!: string","html"],"sources":["../../src/shared/utils/pretty.ts","../../src/shared/utils/to-plain-text.ts","../../src/node/read-stream.ts","../../src/node/render.tsx","../../src/node/index.ts"],"sourcesContent":["import type { Options, Plugin } from 'prettier';\nimport type { builders } from 'prettier/doc';\nimport * as html from 'prettier/plugins/html';\nimport { format } from 'prettier/standalone';\n\ninterface HtmlNode {\n type: 'element' | 'text' | 'ieConditionalComment';\n name?: string;\n sourceSpan: {\n start: { file: unknown[]; offset: number; line: number; col: number };\n end: { file: unknown[]; offset: number; line: number; col: number };\n details: null;\n };\n parent?: HtmlNode;\n}\n\nfunction recursivelyMapDoc(\n doc: builders.Doc,\n callback: (innerDoc: string | builders.DocCommand) => builders.Doc,\n): builders.Doc {\n if (Array.isArray(doc)) {\n return doc.map((innerDoc) => recursivelyMapDoc(innerDoc, callback));\n }\n\n if (typeof doc === 'object') {\n if (doc.type === 'group') {\n return {\n ...doc,\n contents: recursivelyMapDoc(doc.contents, callback),\n expandedStates: recursivelyMapDoc(\n doc.expandedStates,\n callback,\n ) as builders.Doc[],\n };\n }\n\n if ('contents' in doc) {\n return {\n ...doc,\n contents: recursivelyMapDoc(doc.contents, callback),\n };\n }\n\n if ('parts' in doc) {\n return {\n ...doc,\n parts: recursivelyMapDoc(doc.parts, callback) as builders.Doc[],\n };\n }\n\n if (doc.type === 'if-break') {\n return {\n ...doc,\n breakContents: recursivelyMapDoc(doc.breakContents, callback),\n flatContents: recursivelyMapDoc(doc.flatContents, callback),\n };\n }\n }\n\n return callback(doc);\n}\n\nconst modifiedHtml = { ...html } as Plugin;\nif (modifiedHtml.printers) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const previousPrint = modifiedHtml.printers.html.print;\n modifiedHtml.printers.html.print = (path, options, print, args) => {\n const node = path.getNode() as HtmlNode;\n\n const rawPrintingResult = previousPrint(path, options, print, args);\n\n if (node.type === 'ieConditionalComment') {\n const printingResult = recursivelyMapDoc(rawPrintingResult, (doc) => {\n if (typeof doc === 'object' && doc.type === 'line') {\n return doc.soft ? '' : ' ';\n }\n\n return doc;\n });\n\n return printingResult;\n }\n\n return rawPrintingResult;\n };\n}\n\nconst defaults: Options = {\n endOfLine: 'lf',\n tabWidth: 2,\n plugins: [modifiedHtml],\n bracketSameLine: true,\n parser: 'html',\n};\n\nexport const pretty = (str: string, options: Options = {}) => {\n return format(str.replaceAll('\\0', ''), {\n ...defaults,\n ...options,\n });\n};\n","import {\n convert,\n type HtmlToTextOptions,\n type SelectorDefinition,\n} from 'html-to-text';\n\nexport const plainTextSelectors: SelectorDefinition[] = [\n { selector: 'img', format: 'skip' },\n { selector: '[data-skip-in-text=true]', format: 'skip' },\n {\n selector: 'a',\n options: { linkBrackets: false, hideLinkHrefIfSameAsText: true },\n },\n];\n\nexport function toPlainText(html: string, options?: HtmlToTextOptions) {\n return convert(html, {\n selectors: plainTextSelectors,\n ...options,\n });\n}\n","import { Writable } from 'node:stream';\nimport type {\n PipeableStream,\n ReactDOMServerReadableStream,\n} from 'react-dom/server.browser';\n\nconst decoder = new TextDecoder('utf-8');\n\nexport const readStream = async (\n stream: PipeableStream | ReactDOMServerReadableStream,\n) => {\n let result = '';\n\n if ('pipeTo' in stream) {\n // means it's a readable stream\n const writableStream = new WritableStream({\n write(chunk: BufferSource) {\n result += decoder.decode(chunk);\n },\n });\n await stream.pipeTo(writableStream);\n } else {\n const writable = new Writable({\n write(chunk: BufferSource, _encoding, callback) {\n result += decoder.decode(chunk);\n\n callback();\n },\n });\n stream.pipe(writable);\n\n await new Promise<void>((resolve, reject) => {\n writable.on('error', reject);\n writable.on('close', () => {\n resolve();\n });\n });\n }\n\n return result;\n};\n","import { Suspense } from 'react';\nimport type { Options } from '../shared/options';\nimport { pretty } from '../shared/utils/pretty';\nimport { toPlainText } from '../shared/utils/to-plain-text';\nimport { readStream } from './read-stream';\n\nexport const render = async (node: React.ReactNode, options?: Options) => {\n const suspendedElement = <Suspense>{node}</Suspense>;\n const reactDOMServer = await import('react-dom/server').then(\n // This is beacuse react-dom/server is CJS\n (m) => m.default,\n );\n\n let html!: string;\n if (Object.hasOwn(reactDOMServer, 'renderToReadableStream')) {\n html = await readStream(\n await reactDOMServer.renderToReadableStream(suspendedElement, {\n progressiveChunkSize: Number.POSITIVE_INFINITY,\n }),\n );\n } else {\n await new Promise<void>((resolve, reject) => {\n const stream = reactDOMServer.renderToPipeableStream(suspendedElement, {\n async onAllReady() {\n html = await readStream(stream);\n resolve();\n },\n onError(error) {\n reject(error as Error);\n },\n progressiveChunkSize: Number.POSITIVE_INFINITY,\n });\n });\n }\n\n if (options?.plainText) {\n return toPlainText(html, options.htmlToTextOptions);\n }\n\n const doctype =\n '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">';\n\n const document = `${doctype}${html.replace(/<!DOCTYPE.*?>/, '')}`;\n\n if (options?.pretty) {\n return pretty(document);\n }\n\n return document;\n};\n","import type { Options } from '../shared/options';\nimport { render } from './render';\n\n/**\n * @deprecated use {@link render}\n */\nexport const renderAsync = (element: React.ReactElement, options?: Options) => {\n return render(element, options);\n};\n\nexport * from '../shared/options';\nexport * from '../shared/utils/pretty';\nexport * from '../shared/utils/to-plain-text';\nexport * from './render';\n"],"mappings":"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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-email/render",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "description": "Transform React components into HTML email templates",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/browser/index.js",
@@ -51,6 +51,16 @@
51
51
  "default": "./dist/edge/index.js"
52
52
  }
53
53
  },
54
+ "convex": {
55
+ "import": {
56
+ "types": "./dist/edge/index.d.mts",
57
+ "default": "./dist/edge/index.mjs"
58
+ },
59
+ "require": {
60
+ "types": "./dist/edge/index.d.ts",
61
+ "default": "./dist/edge/index.js"
62
+ }
63
+ },
54
64
  "node": {
55
65
  "import": {
56
66
  "types": "./dist/node/index.d.mts",
@@ -112,7 +122,6 @@
112
122
  "@types/react": "npm:types-react@19.0.0-rc.1",
113
123
  "@types/react-dom": "npm:types-react-dom@19.0.0",
114
124
  "jsdom": "26.1.0",
115
- "tsup": "8.4.0",
116
125
  "typescript": "5.8.3",
117
126
  "tsconfig": "0.0.0"
118
127
  },
@@ -120,8 +129,8 @@
120
129
  "access": "public"
121
130
  },
122
131
  "scripts": {
123
- "build": "tsup-node",
124
- "build:watch": "tsup-node --watch",
132
+ "build": "tsdown",
133
+ "build:watch": "tsdown --watch",
125
134
  "clean": "rm -rf dist",
126
135
  "test": "vitest run",
127
136
  "test:watch": "vitest"
package/readme.md CHANGED
@@ -4,11 +4,10 @@
4
4
  <div align="center">Transform React components into HTML email templates.</div>
5
5
  <br />
6
6
  <div align="center">
7
- <a href="https://react.email">Website</a>
7
+ <a href="https://react.email">Website</a>
8
8
  <span> · </span>
9
- <a href="https://github.com/resend/react-email">GitHub</a>
10
- <span> · </span>
11
- <a href="https://react.email/discord">Discord</a>
9
+ <a href="https://github.com/resend/react-email">GitHub</a>
10
+
12
11
  </div>
13
12
 
14
13
  ## Install