@epam/ai-dial-chat-shared 1.1.2 → 1.2.0-dev.101
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/components/MarkdownRenderer/CodeBlock/CodeBlock.js +64 -63
- package/components/MarkdownRenderer/CodeBlock/CodeBlock.module.scss.js +6 -6
- package/components/MarkdownRenderer/MarkdownRenderer.js +1 -1
- package/components/MarkdownRenderer/Math/MarkdownMathBlock.js +19 -18
- package/components/MarkdownRenderer/Table/MarkdownTable.js +74 -56
- package/components/MarkdownRenderer/Table/MarkdownTable.module.scss.js +11 -11
- package/components/MarkdownRenderer/Table/table-serialization.js +23 -3
- package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.js +48 -62
- package/constants/mime-types.js +49 -2
- package/constants/public-class-names.js +10 -0
- package/file-manager/DialFileManagerShell/DialFileManagerShell.js +160 -159
- package/file-manager/FileManagerAttachModal/FileManagerAttachModal.js +23 -22
- package/file-manager/UploadProgressModal/UploadProgressModal.js +26 -32
- package/file-manager.d.ts +10 -6
- package/index.css +2 -2
- package/index.d.ts +46 -8
- package/index.js +56 -55
- package/markdown.d.ts +15 -7
- package/markdown.js +12 -11
- package/package.json +3 -3
- package/types/attachment.js +1 -1
- package/utils/file-download.js +6 -6
- package/utils/latex.js +5 -3
- package/utils/merge-class.js +5 -4
- package/utils/mime-type.js +10 -6
package/utils/latex.js
CHANGED
|
@@ -26,11 +26,13 @@ var e = /\$\\ce\{/g, t = /\$\\pu\{/g, n = /\$\\\\ce\{[^}]*\}\$/g, r = /\$\\\\pu\
|
|
|
26
26
|
let t = p(e), n = [], r = 0, s;
|
|
27
27
|
for (i.lastIndex = 0; (s = i.exec(e)) !== null;) {
|
|
28
28
|
let i = s.index, c = i + s[0].length, l = s[1];
|
|
29
|
-
if (
|
|
29
|
+
if (m(i, t)) continue;
|
|
30
30
|
let u = e.lastIndexOf("\n", i - 1) + 1;
|
|
31
31
|
if (e.slice(u, i).trim() !== "") continue;
|
|
32
|
-
let d =
|
|
33
|
-
|
|
32
|
+
let d = e.indexOf("\n", c), f = e.slice(c, d === -1 ? e.length : d);
|
|
33
|
+
if (!l.includes("\n") && (f.trim() !== "" || l.trim() === "")) continue;
|
|
34
|
+
let p = l.replace(a, "").replace(o, "");
|
|
35
|
+
n.push(e.slice(r, i)), n.push(`$$\n${p}\n$$${f.trim() === "" ? "" : "\n"}`), r = c;
|
|
34
36
|
}
|
|
35
37
|
return n.push(e.substring(r)), n.join("");
|
|
36
38
|
}, y = (e, t) => {
|
package/utils/merge-class.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import e from "classnames";
|
|
2
|
-
import {
|
|
2
|
+
import { extendTailwindMerge as t } from "tailwind-merge";
|
|
3
3
|
//#region src/utils/merge-class.ts
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
var n = t({ extend: { classGroups: { shadow: [{ shadow: ["chat-button"] }] } } });
|
|
5
|
+
function r(...t) {
|
|
6
|
+
return n(e(...t));
|
|
6
7
|
}
|
|
7
8
|
//#endregion
|
|
8
|
-
export {
|
|
9
|
+
export { r as mergeClasses };
|
package/utils/mime-type.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AttachmentType as e } from "../types/attachment.js";
|
|
2
2
|
import { MIMEType as t } from "../types/mime-type.js";
|
|
3
|
+
import { MIME_TYPE_ALIASES as n } from "../constants/mime-types.js";
|
|
3
4
|
//#region src/utils/mime-type.ts
|
|
4
|
-
var
|
|
5
|
+
var r = {
|
|
5
6
|
md: t.Markdown,
|
|
6
7
|
markdown: t.Markdown,
|
|
7
8
|
txt: t.Plain,
|
|
@@ -65,9 +66,12 @@ var n = {
|
|
|
65
66
|
mp3: t.MP3,
|
|
66
67
|
wav: t.WAV,
|
|
67
68
|
ogg: t.OGG
|
|
68
|
-
},
|
|
69
|
-
let t =
|
|
70
|
-
|
|
71
|
-
},
|
|
69
|
+
}, i = (e) => e.toLowerCase().split(";")[0].trim(), a = (e) => {
|
|
70
|
+
let t = i(e);
|
|
71
|
+
return n[t] ?? t;
|
|
72
|
+
}, o = (e) => e.split(/[?#]/)[0], s = (e) => {
|
|
73
|
+
let t = o(e), n = t.lastIndexOf(".");
|
|
74
|
+
if (n !== -1) return r[t.slice(n + 1).toLowerCase()];
|
|
75
|
+
}, c = (t) => t?.startsWith("image/") ? e.Image : t?.startsWith("audio/") ? e.Audio : e.File;
|
|
72
76
|
//#endregion
|
|
73
|
-
export {
|
|
77
|
+
export { c as getAttachmentTypeFromMime, i as getBaseMimeType, s as inferMimeTypeFromPath, a as normalizeMimeType, o as stripUrlQueryAndFragment };
|