@epam/ai-dial-chat-shared 1.1.15 → 1.1.17
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/CopyButton/CopyButton.js +1 -2
- package/components/DeploymentIcon/DeploymentIcon.js +1 -2
- package/components/DeploymentIcon/DeploymentIcon.module.scss.js +3 -3
- package/components/EntityHeader/EntityHeader.js +1 -2
- package/components/EntityTypeLabel/EntityTypeLabel.js +1 -2
- package/components/FeaturedChip/FeaturedChip.js +1 -2
- package/components/InitialsAvatar/InitialsAvatar.js +1 -2
- package/components/InitialsAvatar/InitialsAvatar.module.scss.js +5 -5
- package/components/ItemHeader/ItemHeader.js +1 -2
- package/components/ItemHeader/ItemHeader.module.scss.js +5 -5
- package/components/MarkdownRenderer/CodeBlock/CodeBlock.js +9 -10
- package/components/MarkdownRenderer/CodeBlock/CodeBlock.module.scss.js +9 -9
- package/components/MarkdownRenderer/CodeBlock/syntax-theme.js +1 -2
- package/components/MarkdownRenderer/MDMessageViewer.js +1 -2
- package/components/MarkdownRenderer/MarkdownRenderer.js +1 -2
- package/components/MarkdownRenderer/MarkdownRenderer.module.scss.js +9 -9
- package/components/MarkdownRenderer/Math/MarkdownMathBlock.js +1 -2
- package/components/MarkdownRenderer/Math/MarkdownMathBlock.module.scss.js +5 -5
- package/components/MarkdownRenderer/Table/MarkdownTable.js +30 -27
- package/components/MarkdownRenderer/Table/MarkdownTable.module.scss.js +14 -14
- package/components/MarkdownRenderer/Table/TableHeader.js +1 -2
- package/components/MarkdownRenderer/Table/TableHeader.module.scss.js +3 -3
- package/components/MarkdownRenderer/Table/table-serialization.js +1 -2
- package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.js +1 -2
- package/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.js +1 -2
- package/components/MarkdownRenderer/markdown-class-names.js +1 -2
- package/components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.js +1 -2
- package/components/PanelEmptyState/PanelEmptyState.js +12 -10
- package/components/PanelEmptyState/PanelEmptyState.module.scss.js +3 -3
- package/components/ResourceSummary/ResourceSummary.js +1 -2
- package/components/ResourceSummary/ResourceSummary.module.scss.js +5 -5
- package/constants/breakpoint.js +2 -3
- package/constants/dial.js +1 -2
- package/constants/entity-colors.js +1 -2
- package/constants/icon.js +1 -2
- package/constants/markdown-editor.js +1 -2
- package/constants/mime-types.js +1 -2
- package/constants/resizable-fields.js +1 -2
- package/constants/select-list.js +1 -2
- package/constants/tag-input.js +1 -2
- package/file-manager/DialFileManagerShell/DialFileManagerShell.js +1 -2
- package/file-manager/FileManagerAttachModal/FileManagerAttachModal.js +2 -7
- package/file-manager/OperationLoaderModal/OperationLoaderModal.js +1 -2
- package/file-manager/UploadProgressModal/UploadProgressModal.js +1 -2
- package/file-manager/file-manager-variant.js +1 -2
- package/file-manager/path.js +1 -2
- package/file-manager/upload-batch.js +1 -2
- package/file-manager/useGridEditingScroll/useGridEditingScroll.js +1 -2
- package/hooks/useAvailableHeightCap.js +2 -3
- package/hooks/useCodeCopy.js +1 -2
- package/hooks/useCollapsedText.js +1 -2
- package/hooks/useHorizontalOverflow.js +1 -2
- package/hooks/useIsMobile.js +2 -3
- package/hooks/useStreamedMarkdownContent.js +1 -2
- package/index.css +1 -1
- package/models/chat.js +1 -2
- package/models/conversation-classification.js +1 -2
- package/models/conversation-transfer.js +1 -2
- package/models/deployment-features.js +1 -2
- package/package.json +2 -2
- package/types/attachment.js +1 -2
- package/types/code-editor.js +1 -2
- package/types/entity-type.js +1 -2
- package/types/mime-type.js +1 -2
- package/utils/annotation.js +1 -2
- package/utils/avatar-color.js +1 -2
- package/utils/build-css-vars.js +1 -2
- package/utils/copy-to-clipboard.js +1 -2
- package/utils/file-download.js +1 -2
- package/utils/format-file-size.js +1 -2
- package/utils/format-last-used.js +1 -2
- package/utils/format-price.js +8 -9
- package/utils/generate-uuid.js +1 -2
- package/utils/initials.js +1 -2
- package/utils/is-audio-transcription-supported.js +1 -2
- package/utils/latex.js +4 -17
- package/utils/merge-class.js +1 -2
- package/utils/message-attachment-to-display.js +2 -3
- package/utils/message.js +1 -2
- package/utils/mime-type.js +2 -3
- package/utils/prompt-variables.js +6 -11
- package/utils/string-utils.js +1 -2
package/utils/latex.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/latex.ts
|
|
2
2
|
var e = /\$\\ce\{/g, t = /\$\\pu\{/g, n = /\$\\\\ce\{[^}]*\}\$/g, r = /\$\\\\pu\{[^}]*\}\$/g, i = /\$\$([\s\S]*?)\$\$/g, a = /^[ \t]*\r?\n/, o = /\r?\n[ \t]*$/, s = /\d+(?:,\d{3})*(?:\.\d+)?(?:[KMBkmb])?/y, c = /\s|[^a-zA-Z\d]/y, l = /[\^_\\]/y, u = /(?:[<>]|\\(?:le|leq|ll|ge|geq|gg|ne|neq|approx|equiv|sim|simeq|cong|in|notin|subset|subseteq|supset|supseteq|to|rightarrow|leftarrow|mapsto|implies|iff)\b)/y, d = /\\[a-zA-Z]|[\^_]/, f = (i) => {
|
|
3
3
|
let a = i.replace(e, "$\\\\ce{");
|
|
4
4
|
return a = a.replace(t, "$\\\\pu{"), a = a.replace(n, (e) => `$${e}$`), a = a.replace(r, (e) => `$${e}$`), a;
|
|
@@ -36,17 +36,13 @@ var e = /\$\\ce\{/g, t = /\$\\pu\{/g, n = /\$\\\\ce\{[^}]*\}\$/g, r = /\$\\\\pu\
|
|
|
36
36
|
}, y = (e, t) => {
|
|
37
37
|
let n = h(s, e, t + 1);
|
|
38
38
|
return n ? t + 1 + n[0].length : -1;
|
|
39
|
-
}, b = (e, t) => t >= e.length
|
|
39
|
+
}, b = (e, t) => t >= e.length || !(!h(c, e, t) || h(l, e, t) || h(u, e, _(e, t))), x = (e, t) => {
|
|
40
40
|
let n = [];
|
|
41
41
|
for (let r = 0; r < e.length; r++) {
|
|
42
42
|
if (e[r] !== "$") continue;
|
|
43
43
|
let i = r;
|
|
44
44
|
for (; i + 1 < e.length && e[i + 1] === "$";) i++;
|
|
45
|
-
|
|
46
|
-
r = i;
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
r > 0 && e[r - 1] === "\\" || m(r, t) || n.push(r);
|
|
45
|
+
i > r ? r = i : r > 0 && e[r - 1] === "\\" || m(r, t) || n.push(r);
|
|
50
46
|
}
|
|
51
47
|
return n;
|
|
52
48
|
}, S = (e, t, n, r) => {
|
|
@@ -60,20 +56,11 @@ var e = /\$\\ce\{/g, t = /\$\\pu\{/g, n = /\$\\\\ce\{[^}]*\}\$/g, r = /\$\\\\pu\
|
|
|
60
56
|
let n = p(t), r = x(t, n), i = /* @__PURE__ */ new Map(), a = -1;
|
|
61
57
|
for (let e = 0; e < r.length; e++) {
|
|
62
58
|
let n = r[e], o = y(t, n);
|
|
63
|
-
|
|
64
|
-
i.set(n, "\\$"), a === -1 && r[e + 1] === o && (i.set(o, "\\$"), e++);
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
67
|
-
if (a === -1) {
|
|
68
|
-
a = n;
|
|
69
|
-
continue;
|
|
70
|
-
}
|
|
71
|
-
S(t, a, n, i) ? (i.set(a, "$$"), i.set(n, "$$"), a = -1) : a = n;
|
|
59
|
+
o !== -1 && b(t, o) && (a !== -1 || !C(t, n, r[e + 1], i)) ? (i.set(n, "\\$"), a === -1 && r[e + 1] === o && (i.set(o, "\\$"), e++)) : a === -1 ? a = n : S(t, a, n, i) ? (i.set(a, "$$"), i.set(n, "$$"), a = -1) : a = n;
|
|
72
60
|
}
|
|
73
61
|
if (i.size === 0) return t;
|
|
74
62
|
let o = [], s = 0;
|
|
75
63
|
for (let e of [...i.keys()].sort((e, t) => e - t)) o.push(t.slice(s, e)), o.push(i.get(e)), s = e + 1;
|
|
76
64
|
return o.push(t.substring(s)), o.join("");
|
|
77
65
|
};
|
|
78
|
-
//#endregion
|
|
79
66
|
export { w as preprocessLaTeX };
|
package/utils/merge-class.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { RequestStatus as e } from "../models/chat.js";
|
|
2
2
|
import { AttachmentType as t } from "../types/attachment.js";
|
|
3
3
|
import { getAttachmentTypeFromMime as n, inferMimeTypeFromPath as r } from "./mime-type.js";
|
|
4
|
-
|
|
4
|
+
// src/utils/message-attachment-to-display.ts
|
|
5
5
|
var i = (e, t, n) => {
|
|
6
|
-
if (
|
|
6
|
+
if (e?.startsWith(n) && t) return `data:${e};base64,${t}`;
|
|
7
7
|
}, a = (a, o = {}) => {
|
|
8
8
|
let s = n(a.type), c = s === t.Image, l = s === t.Audio, u = a.url && a.reference_url && !a.reference_type, d = a.url ?? a.data ?? a.title, f = (a.url == null && a.reference_url != null ? a.reference_type ?? r(a.reference_url) : void 0) ?? a.type ?? "", p;
|
|
9
9
|
c && (a.url ? p = o.resolvePreviewUrl?.(a) ?? a.url : a.data && (p = i(a.type, a.data, "image/")));
|
|
@@ -27,5 +27,4 @@ var i = (e, t, n) => {
|
|
|
27
27
|
return n.has(i.id) || (n.add(i.id), e.push(i)), e;
|
|
28
28
|
}, []) ?? [];
|
|
29
29
|
};
|
|
30
|
-
//#endregion
|
|
31
30
|
export { a as messageAttachmentToDisplayAttachment, o as messageAttachmentsToDisplayAttachments };
|
package/utils/message.js
CHANGED
package/utils/mime-type.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AttachmentType as e } from "../types/attachment.js";
|
|
2
2
|
import { MIMEType as t } from "../types/mime-type.js";
|
|
3
|
-
|
|
3
|
+
// src/utils/mime-type.ts
|
|
4
4
|
var n = {
|
|
5
5
|
md: t.Markdown,
|
|
6
6
|
markdown: t.Markdown,
|
|
@@ -67,7 +67,6 @@ var n = {
|
|
|
67
67
|
ogg: t.OGG
|
|
68
68
|
}, r = (e) => e.split(/[?#]/)[0], i = (e) => {
|
|
69
69
|
let t = r(e), i = t.lastIndexOf(".");
|
|
70
|
-
|
|
70
|
+
return i === -1 ? void 0 : n[t.slice(i + 1).toLowerCase()];
|
|
71
71
|
}, a = (t) => t?.startsWith("image/") ? e.Image : t?.startsWith("audio/") ? e.Audio : e.File;
|
|
72
|
-
//#endregion
|
|
73
72
|
export { a as getAttachmentTypeFromMime, i as inferMimeTypeFromPath, r as stripUrlQueryAndFragment };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
var e = /\{\{([^{}]+)\}\}/g, t = "cat-prompt-variable", n = new Set(["code", "pre"]), r = (n) => {
|
|
1
|
+
// src/utils/prompt-variables.ts
|
|
2
|
+
var e = /\{\{([^{}]+)\}\}/g, t = "cat-prompt-variable", n = /* @__PURE__ */ new Set(["code", "pre"]), r = (n) => {
|
|
3
3
|
e.lastIndex = 0;
|
|
4
4
|
let r = [], i = 0, a = e.exec(n);
|
|
5
5
|
for (; a != null;) a.index > i && r.push({
|
|
@@ -21,14 +21,10 @@ var e = /\{\{([^{}]+)\}\}/g, t = "cat-prompt-variable", n = new Set(["code", "pr
|
|
|
21
21
|
}, i = (e) => {
|
|
22
22
|
if (e.children == null || e.tagName != null && n.has(e.tagName)) return;
|
|
23
23
|
let t = [];
|
|
24
|
-
for (let n of e.children) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
i(n), t.push(n);
|
|
31
|
-
}
|
|
24
|
+
for (let n of e.children) if (n.type === "text" && n.value != null) {
|
|
25
|
+
let e = r(n.value);
|
|
26
|
+
t.push(...e ?? [n]);
|
|
27
|
+
} else i(n), t.push(n);
|
|
32
28
|
e.children = t;
|
|
33
29
|
}, a = () => (e) => {
|
|
34
30
|
i(e);
|
|
@@ -54,5 +50,4 @@ var e = /\{\{([^{}]+)\}\}/g, t = "cat-prompt-variable", n = new Set(["code", "pr
|
|
|
54
50
|
for (let { name: n, defaultValue: r } of e) r != null && (t[n] = r);
|
|
55
51
|
return t;
|
|
56
52
|
};
|
|
57
|
-
//#endregion
|
|
58
53
|
export { o as PROMPT_PARAM_DEFAULT_SEPARATOR, e as PROMPT_PARAM_PATTERN, t as PROMPT_VARIABLE_CLASS_NAME, u as buildPromptParamDefaults, c as extractPromptParams, a as rehypePromptVariables, l as resolvePromptParams };
|
package/utils/string-utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/string-utils.ts
|
|
2
2
|
var e = /[\t":;/\\,={}%&]/g, t = (t) => t.replace(e, ""), n = (e) => {
|
|
3
3
|
let t = e.length;
|
|
4
4
|
for (; t > 0 && e[t - 1] === ".";) --t;
|
|
@@ -10,5 +10,4 @@ var e = /[\t":;/\\,={}%&]/g, t = (t) => t.replace(e, ""), n = (e) => {
|
|
|
10
10
|
for (; a > 0 && (n[a] & 192) == 128;) --a;
|
|
11
11
|
return i.decode(n.subarray(0, a));
|
|
12
12
|
};
|
|
13
|
-
//#endregion
|
|
14
13
|
export { e as PROHIBITED_CONVERSATION_NAME_CHARS_RE, a as getUtf8ByteLength, t as sanitizeConversationName, n as stripTrailingDots, o as truncateToUtf8Bytes };
|