qt-ui-kit 1.0.84 → 1.0.86
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 +15 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -15
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +4 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16280,8 +16280,6 @@ function MetadataRow({ metadata }) {
|
|
|
16280
16280
|
|
|
16281
16281
|
// src/components/organisms/message_body/email_body.tsx
|
|
16282
16282
|
var import_dompurify = __toESM(require("dompurify"));
|
|
16283
|
-
var import_react_markdown = __toESM(require("react-markdown"));
|
|
16284
|
-
var import_rehype_raw = __toESM(require("rehype-raw"));
|
|
16285
16283
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
16286
16284
|
function EmailBody({
|
|
16287
16285
|
subjectLine,
|
|
@@ -16293,7 +16291,11 @@ function EmailBody({
|
|
|
16293
16291
|
attachments,
|
|
16294
16292
|
body
|
|
16295
16293
|
}) {
|
|
16296
|
-
|
|
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>") || "");
|
|
16297
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: [
|
|
16298
16300
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-col gap-0.5", children: [
|
|
16299
16301
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(MetadataRow, { metadata: [`Subject: ${subjectLine}`] }),
|
|
@@ -16305,15 +16307,13 @@ function EmailBody({
|
|
|
16305
16307
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(MetadataRow, { metadata: [`Attachments: ${attachments}`] })
|
|
16306
16308
|
] }),
|
|
16307
16309
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("hr", { className: "text-qtneutral-500" }),
|
|
16308
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "body-
|
|
16309
|
-
|
|
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)(
|
|
16311
|
+
"iframe",
|
|
16310
16312
|
{
|
|
16311
|
-
|
|
16312
|
-
|
|
16313
|
-
|
|
16314
|
-
|
|
16315
|
-
// Apply custom components/styling
|
|
16316
|
-
}
|
|
16313
|
+
srcDoc: `<div style="font-family: sans-serif; padding: 0px; margin: 0px;">${safeText}</div>`,
|
|
16314
|
+
sandbox: "allow-popups",
|
|
16315
|
+
style: { border: 0, width: "100%", height: "600px" },
|
|
16316
|
+
title: "Plain Text Email"
|
|
16317
16317
|
}
|
|
16318
16318
|
) })
|
|
16319
16319
|
] });
|
|
@@ -16335,7 +16335,7 @@ function EmojiPill({ emoji, count }) {
|
|
|
16335
16335
|
|
|
16336
16336
|
// src/util/utilcomponents.tsx
|
|
16337
16337
|
var import_clsx9 = __toESM(require("clsx"));
|
|
16338
|
-
var
|
|
16338
|
+
var import_react_markdown = __toESM(require("react-markdown"));
|
|
16339
16339
|
var import_remark_gfm = __toESM(require("remark-gfm"));
|
|
16340
16340
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
16341
16341
|
function MarkdownRenderer({ content, truncated }) {
|
|
@@ -16346,7 +16346,7 @@ function MarkdownRenderer({ content, truncated }) {
|
|
|
16346
16346
|
"flex flex-col markdown break-all",
|
|
16347
16347
|
truncated && "line-clamp-3"
|
|
16348
16348
|
),
|
|
16349
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
16349
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_markdown.default, { remarkPlugins: [import_remark_gfm.default], children: content })
|
|
16350
16350
|
}
|
|
16351
16351
|
);
|
|
16352
16352
|
}
|
|
@@ -16443,7 +16443,7 @@ function ChatBubble({
|
|
|
16443
16443
|
children: name ? name[0].toUpperCase() : ""
|
|
16444
16444
|
}
|
|
16445
16445
|
),
|
|
16446
|
-
uniqueEmojis.entries().map(([e, c]) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(EmojiPill, { emoji: e, count: c }))
|
|
16446
|
+
Array.from(uniqueEmojis.entries()).map(([e, c]) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(EmojiPill, { emoji: e, count: c }, e))
|
|
16447
16447
|
] })
|
|
16448
16448
|
]
|
|
16449
16449
|
}
|
|
@@ -16519,7 +16519,7 @@ function TicketBody({
|
|
|
16519
16519
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { children: related || "None" }),
|
|
16520
16520
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { children: description || "None" })
|
|
16521
16521
|
] }),
|
|
16522
|
-
comments && comments.map((c, i) => {
|
|
16522
|
+
comments && Array.from(comments).map((c, i) => {
|
|
16523
16523
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex col-span-2 flex-col gap-2 w-full", children: [
|
|
16524
16524
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("hr", { className: "text-qtneutral-500" }),
|
|
16525
16525
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: `${i == 0 ? "body-bold" : "body "}`, children: `${i == 0 ? "New" : ""} Comment` }),
|