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.mjs
CHANGED
|
@@ -16253,8 +16253,6 @@ function MetadataRow({ metadata }) {
|
|
|
16253
16253
|
|
|
16254
16254
|
// src/components/organisms/message_body/email_body.tsx
|
|
16255
16255
|
import DOMPurify from "dompurify";
|
|
16256
|
-
import ReactMarkdown from "react-markdown";
|
|
16257
|
-
import rehypeRaw from "rehype-raw";
|
|
16258
16256
|
import { jsx as jsx31, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
16259
16257
|
function EmailBody({
|
|
16260
16258
|
subjectLine,
|
|
@@ -16266,7 +16264,11 @@ function EmailBody({
|
|
|
16266
16264
|
attachments,
|
|
16267
16265
|
body
|
|
16268
16266
|
}) {
|
|
16269
|
-
|
|
16267
|
+
function isHtml(content) {
|
|
16268
|
+
return /<\/?[a-z][\s\S]*>/i.test(content);
|
|
16269
|
+
}
|
|
16270
|
+
const isHtmlContent = body && isHtml(body);
|
|
16271
|
+
const safeText = isHtmlContent ? DOMPurify.sanitize(body) : DOMPurify.sanitize(body?.replace(/\n/g, "<br>") || "");
|
|
16270
16272
|
return /* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-4 bg-white p-4 rounded-b-2xl overflow-auto", children: [
|
|
16271
16273
|
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-0.5", children: [
|
|
16272
16274
|
/* @__PURE__ */ jsx31(MetadataRow, { metadata: [`Subject: ${subjectLine}`] }),
|
|
@@ -16278,15 +16280,13 @@ function EmailBody({
|
|
|
16278
16280
|
/* @__PURE__ */ jsx31(MetadataRow, { metadata: [`Attachments: ${attachments}`] })
|
|
16279
16281
|
] }),
|
|
16280
16282
|
/* @__PURE__ */ jsx31("hr", { className: "text-qtneutral-500" }),
|
|
16281
|
-
/* @__PURE__ */ jsx31("div", { className: "body-
|
|
16282
|
-
|
|
16283
|
+
/* @__PURE__ */ jsx31("div", { className: "body-small break-all whitespace-pre-line flex", children: body && /* @__PURE__ */ jsx31(
|
|
16284
|
+
"iframe",
|
|
16283
16285
|
{
|
|
16284
|
-
|
|
16285
|
-
|
|
16286
|
-
|
|
16287
|
-
|
|
16288
|
-
// Apply custom components/styling
|
|
16289
|
-
}
|
|
16286
|
+
srcDoc: `<div style="font-family: sans-serif; padding: 0px; margin: 0px;">${safeText}</div>`,
|
|
16287
|
+
sandbox: "allow-popups",
|
|
16288
|
+
style: { border: 0, width: "100%", height: "600px" },
|
|
16289
|
+
title: "Plain Text Email"
|
|
16290
16290
|
}
|
|
16291
16291
|
) })
|
|
16292
16292
|
] });
|
|
@@ -16308,7 +16308,7 @@ function EmojiPill({ emoji, count }) {
|
|
|
16308
16308
|
|
|
16309
16309
|
// src/util/utilcomponents.tsx
|
|
16310
16310
|
import clsx9 from "clsx";
|
|
16311
|
-
import
|
|
16311
|
+
import ReactMarkdown from "react-markdown";
|
|
16312
16312
|
import remarkGfm from "remark-gfm";
|
|
16313
16313
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
16314
16314
|
function MarkdownRenderer({ content, truncated }) {
|
|
@@ -16319,7 +16319,7 @@ function MarkdownRenderer({ content, truncated }) {
|
|
|
16319
16319
|
"flex flex-col markdown break-all",
|
|
16320
16320
|
truncated && "line-clamp-3"
|
|
16321
16321
|
),
|
|
16322
|
-
children: /* @__PURE__ */ jsx33(
|
|
16322
|
+
children: /* @__PURE__ */ jsx33(ReactMarkdown, { remarkPlugins: [remarkGfm], children: content })
|
|
16323
16323
|
}
|
|
16324
16324
|
);
|
|
16325
16325
|
}
|
|
@@ -16416,7 +16416,7 @@ function ChatBubble({
|
|
|
16416
16416
|
children: name ? name[0].toUpperCase() : ""
|
|
16417
16417
|
}
|
|
16418
16418
|
),
|
|
16419
|
-
uniqueEmojis.entries().map(([e, c]) => /* @__PURE__ */ jsx34(EmojiPill, { emoji: e, count: c }))
|
|
16419
|
+
Array.from(uniqueEmojis.entries()).map(([e, c]) => /* @__PURE__ */ jsx34(EmojiPill, { emoji: e, count: c }, e))
|
|
16420
16420
|
] })
|
|
16421
16421
|
]
|
|
16422
16422
|
}
|
|
@@ -16492,7 +16492,7 @@ function TicketBody({
|
|
|
16492
16492
|
/* @__PURE__ */ jsx36("div", { children: related || "None" }),
|
|
16493
16493
|
/* @__PURE__ */ jsx36("div", { children: description || "None" })
|
|
16494
16494
|
] }),
|
|
16495
|
-
comments && comments.map((c, i) => {
|
|
16495
|
+
comments && Array.from(comments).map((c, i) => {
|
|
16496
16496
|
return /* @__PURE__ */ jsxs26("div", { className: "flex col-span-2 flex-col gap-2 w-full", children: [
|
|
16497
16497
|
/* @__PURE__ */ jsx36("hr", { className: "text-qtneutral-500" }),
|
|
16498
16498
|
/* @__PURE__ */ jsx36("div", { className: `${i == 0 ? "body-bold" : "body "}`, children: `${i == 0 ? "New" : ""} Comment` }),
|