@react-email/render 1.0.4 → 1.0.5-canary.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/dist/browser/index.js +27 -12
- package/dist/browser/index.mjs +27 -12
- package/dist/edge-light/index.d.mts +27 -0
- package/dist/edge-light/index.d.ts +27 -0
- package/dist/edge-light/index.js +216 -0
- package/dist/edge-light/index.mjs +180 -0
- package/dist/index.d.mts +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.js +44 -668
- package/dist/index.mjs +41 -666
- package/dist/node/index.js +27 -12
- package/dist/node/index.mjs +27 -12
- package/package.json +1 -3
package/dist/node/index.js
CHANGED
|
@@ -74,29 +74,44 @@ module.exports = __toCommonJS(node_exports);
|
|
|
74
74
|
var import_html_to_text = require("html-to-text");
|
|
75
75
|
var import_react = require("react");
|
|
76
76
|
|
|
77
|
+
// src/shared/plain-text-selectors.ts
|
|
78
|
+
var plainTextSelectors = [
|
|
79
|
+
{ selector: "img", format: "skip" },
|
|
80
|
+
{ selector: "#__react-email-preview", format: "skip" },
|
|
81
|
+
{
|
|
82
|
+
selector: "a",
|
|
83
|
+
options: { linkBrackets: false }
|
|
84
|
+
}
|
|
85
|
+
];
|
|
86
|
+
|
|
77
87
|
// src/shared/utils/pretty.ts
|
|
78
|
-
var import_standalone = require("prettier/standalone");
|
|
79
88
|
var import_html = __toESM(require("prettier/plugins/html"));
|
|
89
|
+
var import_standalone = require("prettier/standalone");
|
|
90
|
+
var modifiedHtml = __spreadValues({}, import_html.default);
|
|
91
|
+
if (modifiedHtml.printers) {
|
|
92
|
+
const previousPrint = modifiedHtml.printers.html.print;
|
|
93
|
+
modifiedHtml.printers.html.print = (path, options, print, args) => {
|
|
94
|
+
const node = path.getNode();
|
|
95
|
+
if (node.type === "ieConditionalComment") {
|
|
96
|
+
return options.originalText.slice(
|
|
97
|
+
node.sourceSpan.start.offset,
|
|
98
|
+
node.sourceSpan.end.offset
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
return previousPrint(path, options, print, args);
|
|
102
|
+
};
|
|
103
|
+
}
|
|
80
104
|
var defaults = {
|
|
81
105
|
endOfLine: "lf",
|
|
82
106
|
tabWidth: 2,
|
|
83
|
-
plugins: [
|
|
107
|
+
plugins: [modifiedHtml],
|
|
108
|
+
bracketSameLine: true,
|
|
84
109
|
parser: "html"
|
|
85
110
|
};
|
|
86
111
|
var pretty = (str, options = {}) => {
|
|
87
112
|
return (0, import_standalone.format)(str, __spreadValues(__spreadValues({}, defaults), options));
|
|
88
113
|
};
|
|
89
114
|
|
|
90
|
-
// src/shared/plain-text-selectors.ts
|
|
91
|
-
var plainTextSelectors = [
|
|
92
|
-
{ selector: "img", format: "skip" },
|
|
93
|
-
{ selector: "#__react-email-preview", format: "skip" },
|
|
94
|
-
{
|
|
95
|
-
selector: "a",
|
|
96
|
-
options: { linkBrackets: false }
|
|
97
|
-
}
|
|
98
|
-
];
|
|
99
|
-
|
|
100
115
|
// src/node/read-stream.ts
|
|
101
116
|
var import_node_stream = require("stream");
|
|
102
117
|
var decoder = new TextDecoder("utf-8");
|
package/dist/node/index.mjs
CHANGED
|
@@ -39,29 +39,44 @@ var __async = (__this, __arguments, generator) => {
|
|
|
39
39
|
import { convert } from "html-to-text";
|
|
40
40
|
import { Suspense } from "react";
|
|
41
41
|
|
|
42
|
+
// src/shared/plain-text-selectors.ts
|
|
43
|
+
var plainTextSelectors = [
|
|
44
|
+
{ selector: "img", format: "skip" },
|
|
45
|
+
{ selector: "#__react-email-preview", format: "skip" },
|
|
46
|
+
{
|
|
47
|
+
selector: "a",
|
|
48
|
+
options: { linkBrackets: false }
|
|
49
|
+
}
|
|
50
|
+
];
|
|
51
|
+
|
|
42
52
|
// src/shared/utils/pretty.ts
|
|
43
|
-
import { format } from "prettier/standalone";
|
|
44
53
|
import html from "prettier/plugins/html";
|
|
54
|
+
import { format } from "prettier/standalone";
|
|
55
|
+
var modifiedHtml = __spreadValues({}, html);
|
|
56
|
+
if (modifiedHtml.printers) {
|
|
57
|
+
const previousPrint = modifiedHtml.printers.html.print;
|
|
58
|
+
modifiedHtml.printers.html.print = (path, options, print, args) => {
|
|
59
|
+
const node = path.getNode();
|
|
60
|
+
if (node.type === "ieConditionalComment") {
|
|
61
|
+
return options.originalText.slice(
|
|
62
|
+
node.sourceSpan.start.offset,
|
|
63
|
+
node.sourceSpan.end.offset
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
return previousPrint(path, options, print, args);
|
|
67
|
+
};
|
|
68
|
+
}
|
|
45
69
|
var defaults = {
|
|
46
70
|
endOfLine: "lf",
|
|
47
71
|
tabWidth: 2,
|
|
48
|
-
plugins: [
|
|
72
|
+
plugins: [modifiedHtml],
|
|
73
|
+
bracketSameLine: true,
|
|
49
74
|
parser: "html"
|
|
50
75
|
};
|
|
51
76
|
var pretty = (str, options = {}) => {
|
|
52
77
|
return format(str, __spreadValues(__spreadValues({}, defaults), options));
|
|
53
78
|
};
|
|
54
79
|
|
|
55
|
-
// src/shared/plain-text-selectors.ts
|
|
56
|
-
var plainTextSelectors = [
|
|
57
|
-
{ selector: "img", format: "skip" },
|
|
58
|
-
{ selector: "#__react-email-preview", format: "skip" },
|
|
59
|
-
{
|
|
60
|
-
selector: "a",
|
|
61
|
-
options: { linkBrackets: false }
|
|
62
|
-
}
|
|
63
|
-
];
|
|
64
|
-
|
|
65
80
|
// src/node/read-stream.ts
|
|
66
81
|
import { Writable } from "node:stream";
|
|
67
82
|
var decoder = new TextDecoder("utf-8");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-email/render",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5-canary.0",
|
|
4
4
|
"description": "Transform React components into HTML email templates",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/browser/index.js",
|
|
@@ -95,7 +95,6 @@
|
|
|
95
95
|
"tsup": "7.2.0",
|
|
96
96
|
"typescript": "5.1.6",
|
|
97
97
|
"vitest": "1.1.2",
|
|
98
|
-
"eslint-config-custom": "0.0.0",
|
|
99
98
|
"tsconfig": "0.0.0"
|
|
100
99
|
},
|
|
101
100
|
"publishConfig": {
|
|
@@ -105,7 +104,6 @@
|
|
|
105
104
|
"build": "tsup-node",
|
|
106
105
|
"clean": "rm -rf dist",
|
|
107
106
|
"dev": "tsup-node --watch",
|
|
108
|
-
"lint": "eslint .",
|
|
109
107
|
"test": "vitest run",
|
|
110
108
|
"test:watch": "vitest"
|
|
111
109
|
}
|