qt-ui-kit 1.0.85 → 1.0.87

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.js CHANGED
@@ -16291,7 +16291,11 @@ function EmailBody({
16291
16291
  attachments,
16292
16292
  body
16293
16293
  }) {
16294
- const safeText = import_dompurify.default.sanitize(body ? body.replace(/\n/g, "<br>") : "");
16294
+ function isHtml(content) {
16295
+ return /<\/?[a-z][\s\S]*>/i.test(content);
16296
+ }
16297
+ const isHtmlContent = body && isHtml(body);
16298
+ const safeText = isHtmlContent ? import_dompurify.default.sanitize(body) : import_dompurify.default.sanitize(body?.replace(/\n/g, "<br>") || "");
16295
16299
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-col gap-4 bg-white p-4 rounded-b-2xl overflow-auto", children: [
16296
16300
  /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-col gap-0.5", children: [
16297
16301
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(MetadataRow, { metadata: [`Subject: ${subjectLine}`] }),
@@ -16303,12 +16307,12 @@ function EmailBody({
16303
16307
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(MetadataRow, { metadata: [`Attachments: ${attachments}`] })
16304
16308
  ] }),
16305
16309
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("hr", { className: "text-qtneutral-500" }),
16306
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "body-medium prose break-all whitespace-pre-line", children: body && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
16310
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "body-small break-all whitespace-pre-line flex", children: body && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
16307
16311
  "iframe",
16308
16312
  {
16309
- srcDoc: `<div style="font-family: sans-serif;">${safeText}</div>`,
16313
+ srcDoc: `<div style="font-family: sans-serif; padding: 0px; margin: 0px;">${safeText}</div>`,
16310
16314
  sandbox: "allow-popups",
16311
- style: { border: 0, width: "100%" },
16315
+ style: { border: 0, width: "100%", height: "500px" },
16312
16316
  title: "Plain Text Email"
16313
16317
  }
16314
16318
  ) })