@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.
Files changed (82) hide show
  1. package/components/CopyButton/CopyButton.js +1 -2
  2. package/components/DeploymentIcon/DeploymentIcon.js +1 -2
  3. package/components/DeploymentIcon/DeploymentIcon.module.scss.js +3 -3
  4. package/components/EntityHeader/EntityHeader.js +1 -2
  5. package/components/EntityTypeLabel/EntityTypeLabel.js +1 -2
  6. package/components/FeaturedChip/FeaturedChip.js +1 -2
  7. package/components/InitialsAvatar/InitialsAvatar.js +1 -2
  8. package/components/InitialsAvatar/InitialsAvatar.module.scss.js +5 -5
  9. package/components/ItemHeader/ItemHeader.js +1 -2
  10. package/components/ItemHeader/ItemHeader.module.scss.js +5 -5
  11. package/components/MarkdownRenderer/CodeBlock/CodeBlock.js +9 -10
  12. package/components/MarkdownRenderer/CodeBlock/CodeBlock.module.scss.js +9 -9
  13. package/components/MarkdownRenderer/CodeBlock/syntax-theme.js +1 -2
  14. package/components/MarkdownRenderer/MDMessageViewer.js +1 -2
  15. package/components/MarkdownRenderer/MarkdownRenderer.js +1 -2
  16. package/components/MarkdownRenderer/MarkdownRenderer.module.scss.js +9 -9
  17. package/components/MarkdownRenderer/Math/MarkdownMathBlock.js +1 -2
  18. package/components/MarkdownRenderer/Math/MarkdownMathBlock.module.scss.js +5 -5
  19. package/components/MarkdownRenderer/Table/MarkdownTable.js +30 -27
  20. package/components/MarkdownRenderer/Table/MarkdownTable.module.scss.js +14 -14
  21. package/components/MarkdownRenderer/Table/TableHeader.js +1 -2
  22. package/components/MarkdownRenderer/Table/TableHeader.module.scss.js +3 -3
  23. package/components/MarkdownRenderer/Table/table-serialization.js +1 -2
  24. package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.js +1 -2
  25. package/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.js +1 -2
  26. package/components/MarkdownRenderer/markdown-class-names.js +1 -2
  27. package/components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.js +1 -2
  28. package/components/PanelEmptyState/PanelEmptyState.js +12 -10
  29. package/components/PanelEmptyState/PanelEmptyState.module.scss.js +3 -3
  30. package/components/ResourceSummary/ResourceSummary.js +1 -2
  31. package/components/ResourceSummary/ResourceSummary.module.scss.js +5 -5
  32. package/constants/breakpoint.js +2 -3
  33. package/constants/dial.js +1 -2
  34. package/constants/entity-colors.js +1 -2
  35. package/constants/icon.js +1 -2
  36. package/constants/markdown-editor.js +1 -2
  37. package/constants/mime-types.js +1 -2
  38. package/constants/resizable-fields.js +1 -2
  39. package/constants/select-list.js +1 -2
  40. package/constants/tag-input.js +1 -2
  41. package/file-manager/DialFileManagerShell/DialFileManagerShell.js +1 -2
  42. package/file-manager/FileManagerAttachModal/FileManagerAttachModal.js +2 -7
  43. package/file-manager/OperationLoaderModal/OperationLoaderModal.js +1 -2
  44. package/file-manager/UploadProgressModal/UploadProgressModal.js +1 -2
  45. package/file-manager/file-manager-variant.js +1 -2
  46. package/file-manager/path.js +1 -2
  47. package/file-manager/upload-batch.js +1 -2
  48. package/file-manager/useGridEditingScroll/useGridEditingScroll.js +1 -2
  49. package/hooks/useAvailableHeightCap.js +2 -3
  50. package/hooks/useCodeCopy.js +1 -2
  51. package/hooks/useCollapsedText.js +1 -2
  52. package/hooks/useHorizontalOverflow.js +1 -2
  53. package/hooks/useIsMobile.js +2 -3
  54. package/hooks/useStreamedMarkdownContent.js +1 -2
  55. package/index.css +1 -1
  56. package/models/chat.js +1 -2
  57. package/models/conversation-classification.js +1 -2
  58. package/models/conversation-transfer.js +1 -2
  59. package/models/deployment-features.js +1 -2
  60. package/package.json +2 -2
  61. package/types/attachment.js +1 -2
  62. package/types/code-editor.js +1 -2
  63. package/types/entity-type.js +1 -2
  64. package/types/mime-type.js +1 -2
  65. package/utils/annotation.js +1 -2
  66. package/utils/avatar-color.js +1 -2
  67. package/utils/build-css-vars.js +1 -2
  68. package/utils/copy-to-clipboard.js +1 -2
  69. package/utils/file-download.js +1 -2
  70. package/utils/format-file-size.js +1 -2
  71. package/utils/format-last-used.js +1 -2
  72. package/utils/format-price.js +8 -9
  73. package/utils/generate-uuid.js +1 -2
  74. package/utils/initials.js +1 -2
  75. package/utils/is-audio-transcription-supported.js +1 -2
  76. package/utils/latex.js +4 -17
  77. package/utils/merge-class.js +1 -2
  78. package/utils/message-attachment-to-display.js +2 -3
  79. package/utils/message.js +1 -2
  80. package/utils/mime-type.js +2 -3
  81. package/utils/prompt-variables.js +6 -11
  82. package/utils/string-utils.js +1 -2
package/utils/latex.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/utils/latex.ts
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 ? !0 : !(!h(c, e, t) || h(l, e, t) || h(u, e, _(e, t))), x = (e, t) => {
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
- if (i > r) {
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
- if (o !== -1 && b(t, o) && (a !== -1 || !C(t, n, r[e + 1], i))) {
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 };
@@ -1,8 +1,7 @@
1
1
  import e from "classnames";
2
2
  import { twMerge as t } from "tailwind-merge";
3
- //#region src/utils/merge-class.ts
3
+ // src/utils/merge-class.ts
4
4
  function n(...n) {
5
5
  return t(e(...n));
6
6
  }
7
- //#endregion
8
7
  export { n as mergeClasses };
@@ -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
- //#region src/utils/message-attachment-to-display.ts
4
+ // src/utils/message-attachment-to-display.ts
5
5
  var i = (e, t, n) => {
6
- if (!(!e?.startsWith(n) || !t)) return `data:${e};base64,${t}`;
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
@@ -1,5 +1,4 @@
1
1
  import { MessageRole as e } from "../models/chat.js";
2
- //#region src/utils/message.ts
2
+ // src/utils/message.ts
3
3
  var t = (t) => t.role === e.Status;
4
- //#endregion
5
4
  export { t as isStatusMessage };
@@ -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
- //#region src/utils/mime-type.ts
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
- if (i !== -1) return n[t.slice(i + 1).toLowerCase()];
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
- //#region src/utils/prompt-variables.ts
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
- if (n.type === "text" && n.value != null) {
26
- let e = r(n.value);
27
- t.push(...e ?? [n]);
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 };
@@ -1,4 +1,4 @@
1
- //#region src/utils/string-utils.ts
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 };