@react-email/render 1.0.5-canary.0 → 1.0.5-canary.1
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 +46 -6
- package/dist/browser/index.mjs +46 -6
- package/dist/node/index.js +46 -6
- package/dist/node/index.mjs +46 -6
- package/package.json +1 -1
package/dist/browser/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
8
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
9
|
var __getProtoOf = Object.getPrototypeOf;
|
|
@@ -19,6 +21,7 @@ var __spreadValues = (a, b) => {
|
|
|
19
21
|
}
|
|
20
22
|
return a;
|
|
21
23
|
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
25
|
var __export = (target, all) => {
|
|
23
26
|
for (var name in all)
|
|
24
27
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -87,18 +90,55 @@ var plainTextSelectors = [
|
|
|
87
90
|
// src/shared/utils/pretty.ts
|
|
88
91
|
var import_html = __toESM(require("prettier/plugins/html"));
|
|
89
92
|
var import_standalone = require("prettier/standalone");
|
|
93
|
+
function recursivelyMapDoc(doc, callback) {
|
|
94
|
+
if (Array.isArray(doc)) {
|
|
95
|
+
return doc.map((innerDoc) => recursivelyMapDoc(innerDoc, callback));
|
|
96
|
+
}
|
|
97
|
+
if (typeof doc === "object") {
|
|
98
|
+
if (doc.type === "group") {
|
|
99
|
+
return __spreadProps(__spreadValues({}, doc), {
|
|
100
|
+
contents: recursivelyMapDoc(doc.contents, callback),
|
|
101
|
+
expandedStates: recursivelyMapDoc(
|
|
102
|
+
doc.expandedStates,
|
|
103
|
+
callback
|
|
104
|
+
)
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
if ("contents" in doc) {
|
|
108
|
+
return __spreadProps(__spreadValues({}, doc), {
|
|
109
|
+
contents: recursivelyMapDoc(doc.contents, callback)
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
if ("parts" in doc) {
|
|
113
|
+
return __spreadProps(__spreadValues({}, doc), {
|
|
114
|
+
parts: recursivelyMapDoc(doc.parts, callback)
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
if (doc.type === "if-break") {
|
|
118
|
+
return __spreadProps(__spreadValues({}, doc), {
|
|
119
|
+
breakContents: recursivelyMapDoc(doc.breakContents, callback),
|
|
120
|
+
flatContents: recursivelyMapDoc(doc.flatContents, callback)
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return callback(doc);
|
|
125
|
+
}
|
|
90
126
|
var modifiedHtml = __spreadValues({}, import_html.default);
|
|
91
127
|
if (modifiedHtml.printers) {
|
|
92
128
|
const previousPrint = modifiedHtml.printers.html.print;
|
|
93
129
|
modifiedHtml.printers.html.print = (path, options, print, args) => {
|
|
94
130
|
const node = path.getNode();
|
|
131
|
+
const rawPrintingResult = previousPrint(path, options, print, args);
|
|
95
132
|
if (node.type === "ieConditionalComment") {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
133
|
+
const printingResult = recursivelyMapDoc(rawPrintingResult, (doc) => {
|
|
134
|
+
if (typeof doc === "object" && doc.type === "line") {
|
|
135
|
+
return doc.soft ? "" : " ";
|
|
136
|
+
}
|
|
137
|
+
return doc;
|
|
138
|
+
});
|
|
139
|
+
return printingResult;
|
|
100
140
|
}
|
|
101
|
-
return
|
|
141
|
+
return rawPrintingResult;
|
|
102
142
|
};
|
|
103
143
|
}
|
|
104
144
|
var defaults = {
|
|
@@ -109,7 +149,7 @@ var defaults = {
|
|
|
109
149
|
parser: "html"
|
|
110
150
|
};
|
|
111
151
|
var pretty = (str, options = {}) => {
|
|
112
|
-
return (0, import_standalone.format)(str, __spreadValues(__spreadValues({}, defaults), options));
|
|
152
|
+
return (0, import_standalone.format)(str.replaceAll("\0", ""), __spreadValues(__spreadValues({}, defaults), options));
|
|
113
153
|
};
|
|
114
154
|
|
|
115
155
|
// src/browser/render.tsx
|
package/dist/browser/index.mjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
2
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
6
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -14,6 +16,7 @@ var __spreadValues = (a, b) => {
|
|
|
14
16
|
}
|
|
15
17
|
return a;
|
|
16
18
|
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
17
20
|
var __async = (__this, __arguments, generator) => {
|
|
18
21
|
return new Promise((resolve, reject) => {
|
|
19
22
|
var fulfilled = (value) => {
|
|
@@ -52,18 +55,55 @@ var plainTextSelectors = [
|
|
|
52
55
|
// src/shared/utils/pretty.ts
|
|
53
56
|
import html from "prettier/plugins/html";
|
|
54
57
|
import { format } from "prettier/standalone";
|
|
58
|
+
function recursivelyMapDoc(doc, callback) {
|
|
59
|
+
if (Array.isArray(doc)) {
|
|
60
|
+
return doc.map((innerDoc) => recursivelyMapDoc(innerDoc, callback));
|
|
61
|
+
}
|
|
62
|
+
if (typeof doc === "object") {
|
|
63
|
+
if (doc.type === "group") {
|
|
64
|
+
return __spreadProps(__spreadValues({}, doc), {
|
|
65
|
+
contents: recursivelyMapDoc(doc.contents, callback),
|
|
66
|
+
expandedStates: recursivelyMapDoc(
|
|
67
|
+
doc.expandedStates,
|
|
68
|
+
callback
|
|
69
|
+
)
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
if ("contents" in doc) {
|
|
73
|
+
return __spreadProps(__spreadValues({}, doc), {
|
|
74
|
+
contents: recursivelyMapDoc(doc.contents, callback)
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if ("parts" in doc) {
|
|
78
|
+
return __spreadProps(__spreadValues({}, doc), {
|
|
79
|
+
parts: recursivelyMapDoc(doc.parts, callback)
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
if (doc.type === "if-break") {
|
|
83
|
+
return __spreadProps(__spreadValues({}, doc), {
|
|
84
|
+
breakContents: recursivelyMapDoc(doc.breakContents, callback),
|
|
85
|
+
flatContents: recursivelyMapDoc(doc.flatContents, callback)
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return callback(doc);
|
|
90
|
+
}
|
|
55
91
|
var modifiedHtml = __spreadValues({}, html);
|
|
56
92
|
if (modifiedHtml.printers) {
|
|
57
93
|
const previousPrint = modifiedHtml.printers.html.print;
|
|
58
94
|
modifiedHtml.printers.html.print = (path, options, print, args) => {
|
|
59
95
|
const node = path.getNode();
|
|
96
|
+
const rawPrintingResult = previousPrint(path, options, print, args);
|
|
60
97
|
if (node.type === "ieConditionalComment") {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
98
|
+
const printingResult = recursivelyMapDoc(rawPrintingResult, (doc) => {
|
|
99
|
+
if (typeof doc === "object" && doc.type === "line") {
|
|
100
|
+
return doc.soft ? "" : " ";
|
|
101
|
+
}
|
|
102
|
+
return doc;
|
|
103
|
+
});
|
|
104
|
+
return printingResult;
|
|
65
105
|
}
|
|
66
|
-
return
|
|
106
|
+
return rawPrintingResult;
|
|
67
107
|
};
|
|
68
108
|
}
|
|
69
109
|
var defaults = {
|
|
@@ -74,7 +114,7 @@ var defaults = {
|
|
|
74
114
|
parser: "html"
|
|
75
115
|
};
|
|
76
116
|
var pretty = (str, options = {}) => {
|
|
77
|
-
return format(str, __spreadValues(__spreadValues({}, defaults), options));
|
|
117
|
+
return format(str.replaceAll("\0", ""), __spreadValues(__spreadValues({}, defaults), options));
|
|
78
118
|
};
|
|
79
119
|
|
|
80
120
|
// src/browser/render.tsx
|
package/dist/node/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
8
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
9
|
var __getProtoOf = Object.getPrototypeOf;
|
|
@@ -19,6 +21,7 @@ var __spreadValues = (a, b) => {
|
|
|
19
21
|
}
|
|
20
22
|
return a;
|
|
21
23
|
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
25
|
var __export = (target, all) => {
|
|
23
26
|
for (var name in all)
|
|
24
27
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -87,18 +90,55 @@ var plainTextSelectors = [
|
|
|
87
90
|
// src/shared/utils/pretty.ts
|
|
88
91
|
var import_html = __toESM(require("prettier/plugins/html"));
|
|
89
92
|
var import_standalone = require("prettier/standalone");
|
|
93
|
+
function recursivelyMapDoc(doc, callback) {
|
|
94
|
+
if (Array.isArray(doc)) {
|
|
95
|
+
return doc.map((innerDoc) => recursivelyMapDoc(innerDoc, callback));
|
|
96
|
+
}
|
|
97
|
+
if (typeof doc === "object") {
|
|
98
|
+
if (doc.type === "group") {
|
|
99
|
+
return __spreadProps(__spreadValues({}, doc), {
|
|
100
|
+
contents: recursivelyMapDoc(doc.contents, callback),
|
|
101
|
+
expandedStates: recursivelyMapDoc(
|
|
102
|
+
doc.expandedStates,
|
|
103
|
+
callback
|
|
104
|
+
)
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
if ("contents" in doc) {
|
|
108
|
+
return __spreadProps(__spreadValues({}, doc), {
|
|
109
|
+
contents: recursivelyMapDoc(doc.contents, callback)
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
if ("parts" in doc) {
|
|
113
|
+
return __spreadProps(__spreadValues({}, doc), {
|
|
114
|
+
parts: recursivelyMapDoc(doc.parts, callback)
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
if (doc.type === "if-break") {
|
|
118
|
+
return __spreadProps(__spreadValues({}, doc), {
|
|
119
|
+
breakContents: recursivelyMapDoc(doc.breakContents, callback),
|
|
120
|
+
flatContents: recursivelyMapDoc(doc.flatContents, callback)
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return callback(doc);
|
|
125
|
+
}
|
|
90
126
|
var modifiedHtml = __spreadValues({}, import_html.default);
|
|
91
127
|
if (modifiedHtml.printers) {
|
|
92
128
|
const previousPrint = modifiedHtml.printers.html.print;
|
|
93
129
|
modifiedHtml.printers.html.print = (path, options, print, args) => {
|
|
94
130
|
const node = path.getNode();
|
|
131
|
+
const rawPrintingResult = previousPrint(path, options, print, args);
|
|
95
132
|
if (node.type === "ieConditionalComment") {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
133
|
+
const printingResult = recursivelyMapDoc(rawPrintingResult, (doc) => {
|
|
134
|
+
if (typeof doc === "object" && doc.type === "line") {
|
|
135
|
+
return doc.soft ? "" : " ";
|
|
136
|
+
}
|
|
137
|
+
return doc;
|
|
138
|
+
});
|
|
139
|
+
return printingResult;
|
|
100
140
|
}
|
|
101
|
-
return
|
|
141
|
+
return rawPrintingResult;
|
|
102
142
|
};
|
|
103
143
|
}
|
|
104
144
|
var defaults = {
|
|
@@ -109,7 +149,7 @@ var defaults = {
|
|
|
109
149
|
parser: "html"
|
|
110
150
|
};
|
|
111
151
|
var pretty = (str, options = {}) => {
|
|
112
|
-
return (0, import_standalone.format)(str, __spreadValues(__spreadValues({}, defaults), options));
|
|
152
|
+
return (0, import_standalone.format)(str.replaceAll("\0", ""), __spreadValues(__spreadValues({}, defaults), options));
|
|
113
153
|
};
|
|
114
154
|
|
|
115
155
|
// src/node/read-stream.ts
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
2
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
6
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -14,6 +16,7 @@ var __spreadValues = (a, b) => {
|
|
|
14
16
|
}
|
|
15
17
|
return a;
|
|
16
18
|
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
17
20
|
var __async = (__this, __arguments, generator) => {
|
|
18
21
|
return new Promise((resolve, reject) => {
|
|
19
22
|
var fulfilled = (value) => {
|
|
@@ -52,18 +55,55 @@ var plainTextSelectors = [
|
|
|
52
55
|
// src/shared/utils/pretty.ts
|
|
53
56
|
import html from "prettier/plugins/html";
|
|
54
57
|
import { format } from "prettier/standalone";
|
|
58
|
+
function recursivelyMapDoc(doc, callback) {
|
|
59
|
+
if (Array.isArray(doc)) {
|
|
60
|
+
return doc.map((innerDoc) => recursivelyMapDoc(innerDoc, callback));
|
|
61
|
+
}
|
|
62
|
+
if (typeof doc === "object") {
|
|
63
|
+
if (doc.type === "group") {
|
|
64
|
+
return __spreadProps(__spreadValues({}, doc), {
|
|
65
|
+
contents: recursivelyMapDoc(doc.contents, callback),
|
|
66
|
+
expandedStates: recursivelyMapDoc(
|
|
67
|
+
doc.expandedStates,
|
|
68
|
+
callback
|
|
69
|
+
)
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
if ("contents" in doc) {
|
|
73
|
+
return __spreadProps(__spreadValues({}, doc), {
|
|
74
|
+
contents: recursivelyMapDoc(doc.contents, callback)
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if ("parts" in doc) {
|
|
78
|
+
return __spreadProps(__spreadValues({}, doc), {
|
|
79
|
+
parts: recursivelyMapDoc(doc.parts, callback)
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
if (doc.type === "if-break") {
|
|
83
|
+
return __spreadProps(__spreadValues({}, doc), {
|
|
84
|
+
breakContents: recursivelyMapDoc(doc.breakContents, callback),
|
|
85
|
+
flatContents: recursivelyMapDoc(doc.flatContents, callback)
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return callback(doc);
|
|
90
|
+
}
|
|
55
91
|
var modifiedHtml = __spreadValues({}, html);
|
|
56
92
|
if (modifiedHtml.printers) {
|
|
57
93
|
const previousPrint = modifiedHtml.printers.html.print;
|
|
58
94
|
modifiedHtml.printers.html.print = (path, options, print, args) => {
|
|
59
95
|
const node = path.getNode();
|
|
96
|
+
const rawPrintingResult = previousPrint(path, options, print, args);
|
|
60
97
|
if (node.type === "ieConditionalComment") {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
98
|
+
const printingResult = recursivelyMapDoc(rawPrintingResult, (doc) => {
|
|
99
|
+
if (typeof doc === "object" && doc.type === "line") {
|
|
100
|
+
return doc.soft ? "" : " ";
|
|
101
|
+
}
|
|
102
|
+
return doc;
|
|
103
|
+
});
|
|
104
|
+
return printingResult;
|
|
65
105
|
}
|
|
66
|
-
return
|
|
106
|
+
return rawPrintingResult;
|
|
67
107
|
};
|
|
68
108
|
}
|
|
69
109
|
var defaults = {
|
|
@@ -74,7 +114,7 @@ var defaults = {
|
|
|
74
114
|
parser: "html"
|
|
75
115
|
};
|
|
76
116
|
var pretty = (str, options = {}) => {
|
|
77
|
-
return format(str, __spreadValues(__spreadValues({}, defaults), options));
|
|
117
|
+
return format(str.replaceAll("\0", ""), __spreadValues(__spreadValues({}, defaults), options));
|
|
78
118
|
};
|
|
79
119
|
|
|
80
120
|
// src/node/read-stream.ts
|