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 CHANGED
@@ -906,7 +906,7 @@ function videoUrlToEmbedSrc(url) {
906
906
  if (vi) return `https://player.vimeo.com/video/${vi[1]}`;
907
907
  return url;
908
908
  }
909
- var EMPTY_RICH_HTML = "<p></p>";
909
+ var EMPTY_RICH_HTML = "";
910
910
  function unwrapAllDivElements(container) {
911
911
  let el;
912
912
  while (el = container.querySelector("div")) {
@@ -1212,13 +1212,15 @@ function blockToHtml(cb) {
1212
1212
  case "text": {
1213
1213
  const shell = emailSurfaceBgCss(p);
1214
1214
  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"}`;
1215
- return `<div style="${pd(p.padding)};${marginCss()}${shell}"><div style="${inner}">${p.content}</div></div>`;
1215
+ const content = typeof p.content === "string" ? p.content : "";
1216
+ const body = /^\s*<[^>]+>/.test(content) ? content : escHtml(content).replace(/\r?\n/g, "<br/>");
1217
+ return `<div style="${pd(p.padding)};${marginCss()}${shell}"><div style="${inner}">${body}</div></div>`;
1216
1218
  }
1217
1219
  case "html": {
1218
1220
  const shell = emailSurfaceBgCss(p);
1219
1221
  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"}`;
1220
1222
  const bodyRaw = typeof cb.content === "string" ? cb.content : typeof p.content === "string" ? p.content : "";
1221
- const body = enhanceRichHtmlForEmail(bodyRaw || "<p></p>");
1223
+ const body = enhanceRichHtmlForEmail(bodyRaw || "");
1222
1224
  return `<div style="${pd(p.padding)};${marginCss()}${shell}"><div class="email-rich-html-inner" style="${inner}">${body}</div></div>`;
1223
1225
  }
1224
1226
  case "image": {
@@ -3074,7 +3076,7 @@ function ContentBlock({ block, selected, onClick, preview, C }) {
3074
3076
  wordBreak: "break-word",
3075
3077
  minHeight: emptyRich && !preview ? "2.75em" : void 0
3076
3078
  },
3077
- dangerouslySetInnerHTML: { __html: richHtml || "<p></p>" }
3079
+ dangerouslySetInnerHTML: { __html: richHtml || "" }
3078
3080
  }
3079
3081
  ),
3080
3082
  emptyRich && !preview ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
@@ -5938,10 +5940,10 @@ function ContentBlockEditor({ block, onChange, onClose, onUpload, C }) {
5938
5940
  "textarea",
5939
5941
  {
5940
5942
  style: { ...IS, minHeight: 200, resize: "vertical", fontFamily: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace", fontSize: 12, lineHeight: 1.45 },
5941
- value: normalizeRichHtmlForStorage(p.content),
5942
- onChange: (e) => set("content", normalizeRichHtmlForStorage(e.target.value)),
5943
+ value: String(p.content ?? ""),
5944
+ onChange: (e) => set("content", e.target.value),
5943
5945
  spellCheck: false,
5944
- placeholder: "e.g. <p>Your message</p>"
5946
+ placeholder: "Write your text\u2026"
5945
5947
  },
5946
5948
  block.id
5947
5949
  ) }),