react-email-studio 3.8.0 → 3.8.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/index.cjs +9 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -869,7 +869,7 @@ function videoUrlToEmbedSrc(url) {
|
|
|
869
869
|
if (vi) return `https://player.vimeo.com/video/${vi[1]}`;
|
|
870
870
|
return url;
|
|
871
871
|
}
|
|
872
|
-
var EMPTY_RICH_HTML = "
|
|
872
|
+
var EMPTY_RICH_HTML = "";
|
|
873
873
|
function unwrapAllDivElements(container) {
|
|
874
874
|
let el;
|
|
875
875
|
while (el = container.querySelector("div")) {
|
|
@@ -1175,13 +1175,15 @@ function blockToHtml(cb) {
|
|
|
1175
1175
|
case "text": {
|
|
1176
1176
|
const shell = emailSurfaceBgCss(p);
|
|
1177
1177
|
const inner = `font-size:${lenPx(p.fontSize)};color:${p.color};text-align:${p.align};font-weight:${p.fontWeight || 400};font-style:${p.italic ? "italic" : "normal"};text-decoration:${p.underline ? "underline" : "none"};line-height:${lh(p.lineHeight)};letter-spacing:${lenPx(p.letterSpacing)};font-family:${p.fontFamily || "Georgia,serif"}`;
|
|
1178
|
-
|
|
1178
|
+
const content = typeof p.content === "string" ? p.content : "";
|
|
1179
|
+
const body = /^\s*<[^>]+>/.test(content) ? content : escHtml(content).replace(/\r?\n/g, "<br/>");
|
|
1180
|
+
return `<div style="${pd(p.padding)};${marginCss()}${shell}"><div style="${inner}">${body}</div></div>`;
|
|
1179
1181
|
}
|
|
1180
1182
|
case "html": {
|
|
1181
1183
|
const shell = emailSurfaceBgCss(p);
|
|
1182
1184
|
const inner = `font-size:${lenPx(p.fontSize)};color:${p.color};text-align:${p.align};line-height:${lh(p.lineHeight)};letter-spacing:${lenPx(p.letterSpacing)};font-family:${p.fontFamily || "Georgia,serif"}`;
|
|
1183
1185
|
const bodyRaw = typeof cb.content === "string" ? cb.content : typeof p.content === "string" ? p.content : "";
|
|
1184
|
-
const body = enhanceRichHtmlForEmail(bodyRaw || "
|
|
1186
|
+
const body = enhanceRichHtmlForEmail(bodyRaw || "");
|
|
1185
1187
|
return `<div style="${pd(p.padding)};${marginCss()}${shell}"><div class="email-rich-html-inner" style="${inner}">${body}</div></div>`;
|
|
1186
1188
|
}
|
|
1187
1189
|
case "image": {
|
|
@@ -3043,7 +3045,7 @@ function ContentBlock({ block, selected, onClick, preview, C }) {
|
|
|
3043
3045
|
wordBreak: "break-word",
|
|
3044
3046
|
minHeight: emptyRich && !preview ? "2.75em" : void 0
|
|
3045
3047
|
},
|
|
3046
|
-
dangerouslySetInnerHTML: { __html: richHtml || "
|
|
3048
|
+
dangerouslySetInnerHTML: { __html: richHtml || "" }
|
|
3047
3049
|
}
|
|
3048
3050
|
),
|
|
3049
3051
|
emptyRich && !preview ? /* @__PURE__ */ jsx3(
|
|
@@ -5948,10 +5950,10 @@ function ContentBlockEditor({ block, onChange, onClose, onUpload, C }) {
|
|
|
5948
5950
|
"textarea",
|
|
5949
5951
|
{
|
|
5950
5952
|
style: { ...IS, minHeight: 200, resize: "vertical", fontFamily: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace", fontSize: 12, lineHeight: 1.45 },
|
|
5951
|
-
value:
|
|
5952
|
-
onChange: (e) => set("content",
|
|
5953
|
+
value: String(p.content ?? ""),
|
|
5954
|
+
onChange: (e) => set("content", e.target.value),
|
|
5953
5955
|
spellCheck: false,
|
|
5954
|
-
placeholder: "
|
|
5956
|
+
placeholder: "Write your text\u2026"
|
|
5955
5957
|
},
|
|
5956
5958
|
block.id
|
|
5957
5959
|
) }),
|