@epam/ai-dial-chat-shared 1.1.0-dev.44 → 1.1.0-dev.440

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 (175) hide show
  1. package/components/CopyButton/CopyButton.js +33 -0
  2. package/components/DeploymentIcon/DeploymentIcon.js +62 -0
  3. package/components/DeploymentIcon/DeploymentIcon.module.scss.js +3 -0
  4. package/components/EntityHeader/EntityHeader.js +47 -0
  5. package/components/EntityTypeLabel/EntityTypeLabel.js +10 -0
  6. package/components/FeaturedChip/FeaturedChip.js +17 -0
  7. package/components/InitialsAvatar/InitialsAvatar.js +29 -0
  8. package/components/InitialsAvatar/InitialsAvatar.module.scss.js +6 -0
  9. package/components/ItemHeader/ItemHeader.js +35 -0
  10. package/components/ItemHeader/ItemHeader.module.scss.js +6 -0
  11. package/components/MarkdownRenderer/CodeBlock/CodeBlock.js +104 -0
  12. package/components/MarkdownRenderer/CodeBlock/CodeBlock.module.scss.js +10 -0
  13. package/components/MarkdownRenderer/CodeBlock/syntax-theme.js +71 -0
  14. package/components/MarkdownRenderer/MDMessageViewer.js +22 -0
  15. package/components/MarkdownRenderer/MarkdownRenderer.js +280 -0
  16. package/components/MarkdownRenderer/MarkdownRenderer.module.scss.js +11 -0
  17. package/components/MarkdownRenderer/Math/MarkdownMathBlock.js +24 -0
  18. package/components/MarkdownRenderer/Math/MarkdownMathBlock.module.scss.js +6 -0
  19. package/components/MarkdownRenderer/Table/MarkdownTable.js +77 -0
  20. package/components/MarkdownRenderer/Table/MarkdownTable.module.scss.js +15 -0
  21. package/components/MarkdownRenderer/Table/TableHeader.js +30 -0
  22. package/components/MarkdownRenderer/Table/TableHeader.module.scss.js +3 -0
  23. package/components/MarkdownRenderer/Table/table-serialization.js +6 -0
  24. package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.js +66 -0
  25. package/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.js +12 -0
  26. package/components/MarkdownRenderer/markdown-class-names.js +23 -0
  27. package/components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.js +18 -0
  28. package/components/PanelEmptyState/PanelEmptyState.js +24 -0
  29. package/components/PanelEmptyState/PanelEmptyState.module.scss.js +6 -0
  30. package/components/ResourceSummary/ResourceSummary.js +34 -0
  31. package/components/ResourceSummary/ResourceSummary.module.scss.js +6 -0
  32. package/constants/dial.js +4 -0
  33. package/constants/entity-colors.js +17 -0
  34. package/constants/icon.js +13 -0
  35. package/constants/markdown-editor.js +4 -0
  36. package/constants/mime-types.js +99 -0
  37. package/constants/resizable-fields.js +4 -0
  38. package/constants/select-list.js +4 -0
  39. package/constants/tag-input.js +4 -0
  40. package/file-manager/DialFileManagerShell/DialFileManagerShell.js +299 -0
  41. package/file-manager/FileManagerAttachModal/FileManagerAttachModal.js +93 -0
  42. package/file-manager/OperationLoaderModal/OperationLoaderModal.js +36 -0
  43. package/file-manager/UploadProgressModal/UploadProgressModal.js +56 -0
  44. package/file-manager/file-manager-variant.js +8 -0
  45. package/file-manager/path.js +7 -0
  46. package/file-manager/upload-batch.js +6 -0
  47. package/file-manager/useGridEditingScroll/useGridEditingScroll.js +45 -0
  48. package/file-manager.d.ts +461 -0
  49. package/file-manager.js +3 -0
  50. package/hooks/useAvailableHeightCap.js +36 -0
  51. package/hooks/useCodeCopy.js +20 -0
  52. package/hooks/useCollapsedText.js +38 -0
  53. package/hooks/useHorizontalOverflow.js +25 -0
  54. package/hooks/useIsMobile.js +12 -0
  55. package/hooks/useStreamedMarkdownContent.js +32 -0
  56. package/index.css +1 -1
  57. package/index.d.ts +2509 -41
  58. package/index.js +64 -26490
  59. package/markdown.d.ts +401 -0
  60. package/markdown.js +11 -0
  61. package/models/chat.js +14 -0
  62. package/models/conversation-classification.js +6 -0
  63. package/models/conversation-transfer.js +14 -0
  64. package/models/deployment-features.js +6 -0
  65. package/package.json +73 -5
  66. package/types/attachment.js +8 -0
  67. package/types/code-editor.js +6 -0
  68. package/types/entity-type.js +6 -0
  69. package/types/mime-type.js +8 -0
  70. package/utils/avatar-color.js +37 -0
  71. package/utils/build-css-vars.js +8 -0
  72. package/utils/copy-to-clipboard.js +69 -0
  73. package/utils/file-download.js +79 -0
  74. package/utils/format-file-size.js +4 -0
  75. package/utils/format-last-used.js +20 -0
  76. package/utils/format-price.js +18 -0
  77. package/utils/generate-uuid.js +7 -0
  78. package/utils/initials.js +7 -0
  79. package/utils/is-audio-transcription-supported.js +5 -0
  80. package/utils/latex.js +34 -0
  81. package/utils/merge-class.js +8 -0
  82. package/utils/message-attachment-to-display.js +31 -0
  83. package/utils/message.js +5 -0
  84. package/utils/mime-type.js +73 -0
  85. package/utils/prompt-variables.js +42 -0
  86. package/utils/string-utils.js +14 -0
  87. package/components/DeploymentIcon/DeploymentIcon.d.ts +0 -45
  88. package/components/DeploymentIcon/DeploymentIcon.d.ts.map +0 -1
  89. package/components/Highlight/Highlight.d.ts +0 -26
  90. package/components/Highlight/Highlight.d.ts.map +0 -1
  91. package/components/InitialsAvatar/InitialsAvatar.d.ts +0 -16
  92. package/components/InitialsAvatar/InitialsAvatar.d.ts.map +0 -1
  93. package/components/MarkdownRenderer/CodeBlock/CodeBlock.d.ts +0 -50
  94. package/components/MarkdownRenderer/CodeBlock/CodeBlock.d.ts.map +0 -1
  95. package/components/MarkdownRenderer/CodeBlock/syntax-theme.d.ts +0 -7
  96. package/components/MarkdownRenderer/CodeBlock/syntax-theme.d.ts.map +0 -1
  97. package/components/MarkdownRenderer/MDMessageViewer.d.ts +0 -31
  98. package/components/MarkdownRenderer/MDMessageViewer.d.ts.map +0 -1
  99. package/components/MarkdownRenderer/MarkdownRenderer.d.ts +0 -112
  100. package/components/MarkdownRenderer/MarkdownRenderer.d.ts.map +0 -1
  101. package/components/MarkdownRenderer/Table/MarkdownTable.d.ts +0 -34
  102. package/components/MarkdownRenderer/Table/MarkdownTable.d.ts.map +0 -1
  103. package/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.d.ts +0 -13
  104. package/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.d.ts.map +0 -1
  105. package/components/MarkdownRenderer/markdown-class-names.d.ts +0 -4
  106. package/components/MarkdownRenderer/markdown-class-names.d.ts.map +0 -1
  107. package/components/PanelEmptyState/PanelEmptyState.d.ts +0 -20
  108. package/components/PanelEmptyState/PanelEmptyState.d.ts.map +0 -1
  109. package/constants/dial.d.ts +0 -3
  110. package/constants/dial.d.ts.map +0 -1
  111. package/constants/icon.d.ts +0 -12
  112. package/constants/icon.d.ts.map +0 -1
  113. package/constants/mime-types.d.ts +0 -10
  114. package/constants/mime-types.d.ts.map +0 -1
  115. package/hooks/useCodeCopy.d.ts +0 -14
  116. package/hooks/useCodeCopy.d.ts.map +0 -1
  117. package/hooks/useCollapsedText.d.ts +0 -31
  118. package/hooks/useCollapsedText.d.ts.map +0 -1
  119. package/hooks/useIsMobile.d.ts +0 -3
  120. package/hooks/useIsMobile.d.ts.map +0 -1
  121. package/hooks/useStreamedMarkdownContent.d.ts +0 -3
  122. package/hooks/useStreamedMarkdownContent.d.ts.map +0 -1
  123. package/hooks/useTableScroll.d.ts +0 -16
  124. package/hooks/useTableScroll.d.ts.map +0 -1
  125. package/index.d.ts.map +0 -1
  126. package/models/annotation.d.ts +0 -78
  127. package/models/annotation.d.ts.map +0 -1
  128. package/models/auth.d.ts +0 -26
  129. package/models/auth.d.ts.map +0 -1
  130. package/models/chat.d.ts +0 -304
  131. package/models/chat.d.ts.map +0 -1
  132. package/models/deployment-configuration.d.ts +0 -61
  133. package/models/deployment-configuration.d.ts.map +0 -1
  134. package/models/deployment-features.d.ts +0 -17
  135. package/models/deployment-features.d.ts.map +0 -1
  136. package/models/deployment.d.ts +0 -31
  137. package/models/deployment.d.ts.map +0 -1
  138. package/models/dial-model.d.ts +0 -19
  139. package/models/dial-model.d.ts.map +0 -1
  140. package/models/import-export.d.ts +0 -23
  141. package/models/import-export.d.ts.map +0 -1
  142. package/models/theme.d.ts +0 -36
  143. package/models/theme.d.ts.map +0 -1
  144. package/types/attachment.d.ts +0 -23
  145. package/types/attachment.d.ts.map +0 -1
  146. package/types/code-editor.d.ts +0 -8
  147. package/types/code-editor.d.ts.map +0 -1
  148. package/types/mime-type.d.ts +0 -59
  149. package/types/mime-type.d.ts.map +0 -1
  150. package/types/overlay/overlay-protocol.d.ts +0 -377
  151. package/types/overlay/overlay-protocol.d.ts.map +0 -1
  152. package/utils/avatar-color.d.ts +0 -13
  153. package/utils/avatar-color.d.ts.map +0 -1
  154. package/utils/build-css-vars.d.ts +0 -7
  155. package/utils/build-css-vars.d.ts.map +0 -1
  156. package/utils/copy-to-clipboard.d.ts +0 -15
  157. package/utils/copy-to-clipboard.d.ts.map +0 -1
  158. package/utils/file-download.d.ts +0 -9
  159. package/utils/file-download.d.ts.map +0 -1
  160. package/utils/format-file-size.d.ts +0 -3
  161. package/utils/format-file-size.d.ts.map +0 -1
  162. package/utils/format-last-used.d.ts +0 -8
  163. package/utils/format-last-used.d.ts.map +0 -1
  164. package/utils/initials.d.ts +0 -9
  165. package/utils/initials.d.ts.map +0 -1
  166. package/utils/is-audio-transcription-supported.d.ts +0 -3
  167. package/utils/is-audio-transcription-supported.d.ts.map +0 -1
  168. package/utils/merge-class.d.ts +0 -4
  169. package/utils/merge-class.d.ts.map +0 -1
  170. package/utils/message-attachment-to-display.d.ts +0 -22
  171. package/utils/message-attachment-to-display.d.ts.map +0 -1
  172. package/utils/message.d.ts +0 -10
  173. package/utils/message.d.ts.map +0 -1
  174. package/utils/string-utils.d.ts +0 -5
  175. package/utils/string-utils.d.ts.map +0 -1
@@ -0,0 +1,69 @@
1
+ import e from "dompurify";
2
+ import t from "rehype-stringify";
3
+ import n from "remark-gfm";
4
+ import r from "remark-parse";
5
+ import i from "remark-rehype";
6
+ import { unified as a } from "unified";
7
+ //#region src/utils/copy-to-clipboard.ts
8
+ var o = {
9
+ table: "border-collapse:collapse;width:100%;margin:0 0 12px;font-size:14px;line-height:20px;background:#ffffff;color:#161b2d;border:1px solid #d1dbea",
10
+ th: "background:#fcfcfc;color:#57647a;border-bottom:1px solid #e0e6f0;padding:8px 12px;text-align:start;font-weight:600",
11
+ td: "border-top:1px solid #e0e6f0;padding:8px 12px;text-align:start",
12
+ h1: "font-size:20px;line-height:28px;font-weight:600;margin:0 0 12px",
13
+ h2: "font-size:18px;line-height:26px;font-weight:600;margin:16px 0 8px",
14
+ h3: "font-size:16px;line-height:24px;font-weight:600;margin:16px 0 8px",
15
+ p: "font-size:14px;line-height:24px;margin:0 0 12px",
16
+ ul: "font-size:14px;line-height:24px;margin:0 0 12px;padding-inline-start:24px",
17
+ ol: "font-size:14px;line-height:24px;margin:0 0 12px;padding-inline-start:24px",
18
+ blockquote: "border-inline-start:3px solid #d1dbea;margin:0 0 12px;padding:4px 0 4px 12px",
19
+ pre: "background:#f8fafc;border:1px solid #d1dbea;border-radius:8px;padding:12px;overflow:auto;font-size:14px;line-height:20px;color:#161b2d;margin:0 0 12px",
20
+ code: "font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:14px;background:#f3f5f9;color:#161b2d;padding:1px 4px;border-radius:4px",
21
+ a: "text-decoration:underline",
22
+ hr: "border:0;border-top:1px solid #d1dbea;margin:16px 0"
23
+ }, s = "background:#f5f7fa", c = {
24
+ left: "text-align:start",
25
+ center: "text-align:center",
26
+ right: "text-align:end"
27
+ }, l = (e) => {
28
+ let t = e.properties?.align;
29
+ return typeof t == "string" ? c[t] : void 0;
30
+ }, u = "font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:14px", d = (e, t) => {
31
+ e.properties ||= {};
32
+ let n = typeof e.properties.style == "string" ? e.properties.style : "";
33
+ e.properties.style = n ? `${n};${t}` : t;
34
+ }, f = (e, t = !1) => {
35
+ if (e.tagName === "code" && t) d(e, u);
36
+ else if (e.tagName) {
37
+ let t = o[e.tagName];
38
+ if (t && d(e, t), e.tagName === "th" || e.tagName === "td") {
39
+ let t = l(e);
40
+ t && d(e, t);
41
+ }
42
+ }
43
+ let n = e.children ?? [];
44
+ e.tagName === "tbody" && n.filter((e) => e.tagName === "tr").forEach((e, t) => {
45
+ t % 2 == 1 && d(e, s);
46
+ }), n.forEach((n) => f(n, t || e.tagName === "pre"));
47
+ }, p = () => (e) => f(e), m = (o) => e.sanitize(a().use(r).use(n).use(i).use(p).use(t).processSync(o).toString()), h = (e) => {
48
+ if (typeof navigator > "u" || !navigator.clipboard?.write || typeof ClipboardItem > "u") return g(e);
49
+ let t;
50
+ try {
51
+ t = m(e);
52
+ } catch {
53
+ return g(e);
54
+ }
55
+ return navigator.clipboard.write([new ClipboardItem({
56
+ "text/html": new Blob([t], { type: "text/html" }),
57
+ "text/plain": new Blob([e], { type: "text/plain" })
58
+ })]).then(() => !0).catch(() => g(e));
59
+ }, g = (e) => typeof navigator < "u" && navigator.clipboard?.writeText ? navigator.clipboard.writeText(e).then(() => !0).catch(() => _(e)) : Promise.resolve(_(e)), _ = (e) => {
60
+ let t = document.createElement("textarea");
61
+ t.innerText = e, t.style.cssText = "position:fixed;top:0;left:0;width:1px;height:1px;padding:0;border:none;outline:none;box-shadow:none;background:transparent;opacity:0;", t.setAttribute("autocomplete", "off"), t.setAttribute("readonly", ""), document.body.appendChild(t);
62
+ try {
63
+ return t.focus({ preventScroll: !0 }), t.removeAttribute("readonly"), t.setSelectionRange(0, e.length), document.execCommand("copy");
64
+ } finally {
65
+ document.body.removeChild(t);
66
+ }
67
+ };
68
+ //#endregion
69
+ export { h as copyMarkdownAsRichText, g as copyToClipboard, m as markdownToRichTextHtml };
@@ -0,0 +1,79 @@
1
+ import { stripUrlQueryAndFragment as e } from "./mime-type.js";
2
+ import { MIME_TYPE_EXT_MAP as t } from "../constants/mime-types.js";
3
+ //#region src/utils/file-download.ts
4
+ var n = /^[a-zA-Z0-9]{1,10}$/, r = (e) => {
5
+ let t = e.lastIndexOf(".");
6
+ if (t <= 0 || t >= e.length - 1) return;
7
+ let r = e.slice(t + 1);
8
+ return n.test(r) ? r : void 0;
9
+ }, i = (n, i, a) => {
10
+ if (r(n) != null) return n;
11
+ if (a != null) {
12
+ let e = t[a];
13
+ if (e != null) return `${n}.${e}`;
14
+ }
15
+ if (i != null) {
16
+ let t = r(e(i).split("/").pop() ?? "");
17
+ if (t != null) return `${n}.${t}`;
18
+ }
19
+ return n;
20
+ }, a = {
21
+ typescript: "ts",
22
+ ts: "ts",
23
+ tsx: "tsx",
24
+ javascript: "js",
25
+ js: "js",
26
+ jsx: "jsx",
27
+ python: "py",
28
+ py: "py",
29
+ java: "java",
30
+ csharp: "cs",
31
+ cs: "cs",
32
+ cpp: "cpp",
33
+ c: "c",
34
+ go: "go",
35
+ rust: "rs",
36
+ rs: "rs",
37
+ ruby: "rb",
38
+ rb: "rb",
39
+ php: "php",
40
+ html: "html",
41
+ css: "css",
42
+ scss: "scss",
43
+ json: "json",
44
+ yaml: "yaml",
45
+ yml: "yml",
46
+ markdown: "md",
47
+ md: "md",
48
+ sql: "sql",
49
+ bash: "sh",
50
+ sh: "sh",
51
+ shell: "sh",
52
+ xml: "xml",
53
+ kotlin: "kt",
54
+ swift: "swift",
55
+ dart: "dart",
56
+ plaintext: "txt",
57
+ text: "txt"
58
+ }, o = (e) => a[e.toLowerCase()] ?? "txt", s = 1e3, c = (e, t) => {
59
+ let n = document.createElement("a");
60
+ n.href = e, n.download = t, n.rel = "noopener", n.style.display = "none", document.body.appendChild(n), n.click(), setTimeout(() => n.remove(), s);
61
+ }, l = (e, t) => {
62
+ let n = URL.createObjectURL(e);
63
+ c(n, t), setTimeout(() => URL.revokeObjectURL(n), s);
64
+ }, u = (e) => {
65
+ try {
66
+ let t = atob(e), n = new Uint8Array(t.length);
67
+ for (let e = 0; e < t.length; e++) n[e] = t.charCodeAt(e);
68
+ return n;
69
+ } catch {
70
+ return;
71
+ }
72
+ }, d = (e, t) => {
73
+ let n = u(e) ?? new TextEncoder().encode(e);
74
+ return new Blob([n.buffer], { type: t });
75
+ }, f = (e, t, n = "text/plain;charset=utf-8") => {
76
+ l(new Blob([e], { type: n }), t);
77
+ };
78
+ //#endregion
79
+ export { d as base64ToBlob, f as downloadTextFile, i as ensureDownloadFilename, o as getFileExtensionForLanguage, c as triggerAnchorDownload, l as triggerBlobDownload, u as tryBase64ToBytes };
@@ -0,0 +1,4 @@
1
+ //#region src/utils/format-file-size.ts
2
+ var e = 1024, t = e * 1024, n = t * 1024, r = (r) => r >= n ? `${(r / n).toFixed(r % n === 0 ? 0 : 1)} GB` : r >= t ? `${(r / t).toFixed(r % t === 0 ? 0 : 1)} MB` : r >= e ? `${(r / e).toFixed(r % e === 0 ? 0 : 1)} KB` : `${r} B`;
3
+ //#endregion
4
+ export { r as formatFileSize };
@@ -0,0 +1,20 @@
1
+ //#region src/utils/format-last-used.ts
2
+ var e = (e) => {
3
+ if (!e) return "";
4
+ let t = new Date(e);
5
+ if (isNaN(t.getTime())) return "";
6
+ let n = Date.now() - t.getTime(), r = Math.floor(n / 1e3);
7
+ if (r < 60) return "just now";
8
+ let i = Math.floor(r / 60);
9
+ if (i < 60) return `${i} min ago`;
10
+ let a = Math.floor(i / 60);
11
+ if (a < 24) return `${a} hour${a === 1 ? "" : "s"} ago`;
12
+ let o = Math.floor(a / 24);
13
+ if (o < 30) return `${o} day${o === 1 ? "" : "s"} ago`;
14
+ let s = Math.floor(o / 30);
15
+ if (s < 12) return `${s} month${s === 1 ? "" : "s"} ago`;
16
+ let c = Math.floor(s / 12);
17
+ return `${c} year${c === 1 ? "" : "s"} ago`;
18
+ };
19
+ //#endregion
20
+ export { e as formatLastUsed };
@@ -0,0 +1,18 @@
1
+ //#region src/utils/format-price.ts
2
+ var e = "token", t = 1e6, n = "en-US", r = new Intl.NumberFormat(n, {
3
+ style: "currency",
4
+ currency: "USD",
5
+ minimumFractionDigits: 0,
6
+ maximumFractionDigits: 2
7
+ }), i = new Intl.NumberFormat(n, {
8
+ style: "currency",
9
+ currency: "USD",
10
+ minimumFractionDigits: 0,
11
+ maximumFractionDigits: 6
12
+ }), a = (e) => r.format(e), o = (e) => e !== 0 && Math.abs(e) < 1 ? i.format(e) : a(e), s = (n, r) => {
13
+ if (n == null) return;
14
+ let i = Number(n);
15
+ return n.trim() === "" || !Number.isFinite(i) ? n : r == null || r.toLowerCase() === e ? `${o(i * t)}/M tokens` : `${o(i)}/${r.replace(/_/g, " ")}`;
16
+ };
17
+ //#endregion
18
+ export { a as formatCost, o as formatPrice, s as formatUnitPrice };
@@ -0,0 +1,7 @@
1
+ //#region src/utils/generate-uuid.ts
2
+ var e = () => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
3
+ let t = Math.random() * 16 | 0;
4
+ return (e === "x" ? t : t & 3 | 8).toString(16);
5
+ });
6
+ //#endregion
7
+ export { e as generateUUID };
@@ -0,0 +1,7 @@
1
+ //#region src/utils/initials.ts
2
+ var e = (e) => e.match(/\p{L}/u)?.[0] ?? "", t = (t) => {
3
+ let n = t.trim().split(/\s+/).filter(Boolean);
4
+ return n.length === 0 ? "?" : n.length >= 2 ? (e(n[0]) + e(n[1])).toUpperCase() || "?" : n[0].replace(/[^\p{L}]/gu, "").slice(0, 2).toUpperCase() || "?";
5
+ };
6
+ //#endregion
7
+ export { t as extractInitials };
@@ -0,0 +1,5 @@
1
+ import "../constants/mime-types.js";
2
+ //#region src/utils/is-audio-transcription-supported.ts
3
+ var e = (e) => e?.some((e) => e === "*/*" || e.startsWith("audio/")) ?? !1;
4
+ //#endregion
5
+ export { e as isAudioTranscriptionSupported };
package/utils/latex.js ADDED
@@ -0,0 +1,34 @@
1
+ //#region src/utils/latex.ts
2
+ var e = /\$\\ce\{/g, t = /\$\\pu\{/g, n = /\$\\\\ce\{[^}]*\}\$/g, r = /\$\\\\pu\{[^}]*\}\$/g, i = /(?<![\\$])\$(?!\$)(?=\d+(?:,\d{3})*(?:\.\d+)?(?:[KMBkmb])?(?:\s|$|[^a-zA-Z\d]))/g, a = /(?<!\\)\$(?!\$)((?:[^$\n]|\\[$])+?)(?<!\\)(?<!`)\$(?!\$)/g, o = (i) => {
3
+ let a = i.replace(e, "$\\\\ce{");
4
+ return a = a.replace(t, "$\\\\pu{"), a = a.replace(n, (e) => `$${e}$`), a = a.replace(r, (e) => `$${e}$`), a;
5
+ }, s = (e) => {
6
+ let t = [], n = -1, r = -1;
7
+ for (let i = 0; i < e.length; i++) {
8
+ let a = e[i];
9
+ a === "`" && i + 2 < e.length && e[i + 1] === "`" && e[i + 2] === "`" ? r === -1 ? (r = i, i += 2) : (t.push([r, i + 2]), r = -1, i += 2) : a === "`" && r === -1 && (n === -1 ? n = i : (t.push([n, i]), n = -1));
10
+ }
11
+ return t;
12
+ }, c = (e, t) => {
13
+ let n = 0, r = t.length - 1;
14
+ for (; n <= r;) {
15
+ let i = Math.floor((n + r) / 2), [a, o] = t[i];
16
+ if (e >= a && e <= o) return !0;
17
+ e < a ? r = i - 1 : n = i + 1;
18
+ }
19
+ return !1;
20
+ }, l = (e) => {
21
+ if (!e.includes("$")) return e;
22
+ let t = e;
23
+ (e.includes("\\ce{") || e.includes("\\pu{")) && (t = o(e));
24
+ let n = s(t), r = [], l = 0;
25
+ i.lastIndex = 0;
26
+ let u;
27
+ for (; (u = i.exec(t)) !== null;) c(u.index, n) || (r.push(t.substring(l, u.index)), r.push("\\$"), l = u.index + 1);
28
+ r.push(t.substring(l)), t = r.join("");
29
+ let d = [];
30
+ for (l = 0, a.lastIndex = 0; (u = a.exec(t)) !== null;) c(u.index, n) || (d.push(t.substring(l, u.index)), d.push(`$$${u[1]}$$`), l = u.index + u[0].length);
31
+ return d.push(t.substring(l)), d.join("");
32
+ };
33
+ //#endregion
34
+ export { l as preprocessLaTeX };
@@ -0,0 +1,8 @@
1
+ import e from "classnames";
2
+ import { twMerge as t } from "tailwind-merge";
3
+ //#region src/utils/merge-class.ts
4
+ function n(...n) {
5
+ return t(e(...n));
6
+ }
7
+ //#endregion
8
+ export { n as mergeClasses };
@@ -0,0 +1,31 @@
1
+ import { RequestStatus as e } from "../models/chat.js";
2
+ import { AttachmentType as t } from "../types/attachment.js";
3
+ import { getAttachmentTypeFromMime as n, inferMimeTypeFromPath as r } from "./mime-type.js";
4
+ //#region src/utils/message-attachment-to-display.ts
5
+ var i = (e, t, n) => {
6
+ if (!(!e?.startsWith(n) || !t)) return `data:${e};base64,${t}`;
7
+ }, a = (a, o = {}) => {
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
+ c && (a.url ? p = o.resolvePreviewUrl?.(a) ?? a.url : a.data && (p = i(a.type, a.data, "image/")));
10
+ let m;
11
+ return l && (a.url ? m = o.resolvePlayUrl?.(a) ?? a.url : a.data && (m = i(a.type, a.data, "audio/"))), {
12
+ id: d,
13
+ name: a.title,
14
+ contentType: f,
15
+ type: u ? t.Link : s,
16
+ status: e.Idle,
17
+ ...a.url ? { url: a.url } : {},
18
+ ...a.reference_url ? { referenceUrl: a.reference_url } : {},
19
+ ...c && p ? { previewUrl: p } : {},
20
+ ...l && m ? { playUrl: m } : {},
21
+ ...!c && !l && a.data ? { data: a.data } : {}
22
+ };
23
+ }, o = (e, t = {}) => {
24
+ let n = /* @__PURE__ */ new Set();
25
+ return e?.reduce((e, r) => {
26
+ let i = a(r, t);
27
+ return n.has(i.id) || (n.add(i.id), e.push(i)), e;
28
+ }, []) ?? [];
29
+ };
30
+ //#endregion
31
+ export { a as messageAttachmentToDisplayAttachment, o as messageAttachmentsToDisplayAttachments };
@@ -0,0 +1,5 @@
1
+ import { MessageRole as e } from "../models/chat.js";
2
+ //#region src/utils/message.ts
3
+ var t = (t) => t.role === e.Status;
4
+ //#endregion
5
+ export { t as isStatusMessage };
@@ -0,0 +1,73 @@
1
+ import { AttachmentType as e } from "../types/attachment.js";
2
+ import { MIMEType as t } from "../types/mime-type.js";
3
+ //#region src/utils/mime-type.ts
4
+ var n = {
5
+ md: t.Markdown,
6
+ markdown: t.Markdown,
7
+ txt: t.Plain,
8
+ html: t.HTML,
9
+ htm: t.HTML,
10
+ xhtml: t.XHTML,
11
+ css: t.CSS,
12
+ scss: t.Plain,
13
+ sass: t.Plain,
14
+ less: t.Plain,
15
+ js: t.JavaScript,
16
+ mjs: t.JavaScript,
17
+ cjs: t.JavaScript,
18
+ jsx: t.JavaScript,
19
+ ts: t.TypeScript,
20
+ mts: t.TypeScript,
21
+ cts: t.TypeScript,
22
+ tsx: t.TypeScript,
23
+ csv: t.CSV,
24
+ tsv: t.Plain,
25
+ json: t.JSON,
26
+ jsonl: t.JSON,
27
+ ndjson: t.JSON,
28
+ xml: t.XML,
29
+ pdf: t.PDF,
30
+ zip: t.ZIP,
31
+ gz: t.GZIP,
32
+ gzip: t.GZIP,
33
+ yaml: t.Plain,
34
+ yml: t.Plain,
35
+ toml: t.Plain,
36
+ ini: t.Plain,
37
+ conf: t.Plain,
38
+ cfg: t.Plain,
39
+ py: t.Plain,
40
+ rb: t.Plain,
41
+ go: t.Plain,
42
+ rs: t.Plain,
43
+ java: t.Plain,
44
+ kt: t.Plain,
45
+ swift: t.Plain,
46
+ c: t.Plain,
47
+ h: t.Plain,
48
+ cpp: t.Plain,
49
+ cs: t.Plain,
50
+ sh: t.Plain,
51
+ bash: t.Plain,
52
+ zsh: t.Plain,
53
+ fish: t.Plain,
54
+ ps1: t.Plain,
55
+ log: t.Plain,
56
+ env: t.Plain,
57
+ sql: t.Plain,
58
+ jpg: t.JPEG,
59
+ jpeg: t.JPEG,
60
+ png: t.PNG,
61
+ gif: t.GIF,
62
+ webp: t.WebP,
63
+ bmp: t.BMP,
64
+ svg: t.SVG,
65
+ mp3: t.MP3,
66
+ wav: t.WAV,
67
+ ogg: t.OGG
68
+ }, r = (e) => e.split(/[?#]/)[0], i = (e) => {
69
+ let t = r(e), i = t.lastIndexOf(".");
70
+ if (i !== -1) return n[t.slice(i + 1).toLowerCase()];
71
+ }, a = (t) => t?.startsWith("image/") ? e.Image : t?.startsWith("audio/") ? e.Audio : e.File;
72
+ //#endregion
73
+ export { a as getAttachmentTypeFromMime, i as inferMimeTypeFromPath, r as stripUrlQueryAndFragment };
@@ -0,0 +1,42 @@
1
+ //#region src/utils/prompt-variables.ts
2
+ var e = /\{\{([^{}]+)\}\}/g, t = "cat-prompt-variable", n = new Set(["code", "pre"]), r = (n) => {
3
+ e.lastIndex = 0;
4
+ let r = [], i = 0, a = e.exec(n);
5
+ for (; a != null;) a.index > i && r.push({
6
+ type: "text",
7
+ value: n.slice(i, a.index)
8
+ }), r.push({
9
+ type: "element",
10
+ tagName: "span",
11
+ properties: { className: [t] },
12
+ children: [{
13
+ type: "text",
14
+ value: a[0]
15
+ }]
16
+ }), i = a.index + a[0].length, a = e.exec(n);
17
+ return r.length === 0 ? null : (i < n.length && r.push({
18
+ type: "text",
19
+ value: n.slice(i)
20
+ }), r);
21
+ }, i = (e) => {
22
+ if (e.children == null || e.tagName != null && n.has(e.tagName)) return;
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
+ }
32
+ e.children = t;
33
+ }, a = () => (e) => {
34
+ i(e);
35
+ }, o = (t) => {
36
+ e.lastIndex = 0;
37
+ let n = /* @__PURE__ */ new Set(), r = e.exec(t);
38
+ for (; r != null;) n.add(r[1]), r = e.exec(t);
39
+ return Array.from(n);
40
+ }, s = (t, n) => t.replace(e, (e, t) => n[t] ?? e);
41
+ //#endregion
42
+ export { e as PROMPT_PARAM_PATTERN, t as PROMPT_VARIABLE_CLASS_NAME, o as extractPromptParams, a as rehypePromptVariables, s as resolvePromptParams };
@@ -0,0 +1,14 @@
1
+ //#region src/utils/string-utils.ts
2
+ var e = /[\t":;/\\,={}%&]/g, t = (t) => t.replace(e, ""), n = (e) => {
3
+ let t = e.length;
4
+ for (; t > 0 && e[t - 1] === ".";) --t;
5
+ return e.slice(0, t);
6
+ }, r = new TextEncoder(), i = new TextDecoder(), a = (e) => r.encode(e).length, o = (e, t) => {
7
+ let n = r.encode(e);
8
+ if (n.length <= t) return e;
9
+ let a = t;
10
+ for (; a > 0 && (n[a] & 192) == 128;) --a;
11
+ return i.decode(n.subarray(0, a));
12
+ };
13
+ //#endregion
14
+ export { e as PROHIBITED_CONVERSATION_NAME_CHARS_RE, a as getUtf8ByteLength, t as sanitizeConversationName, n as stripTrailingDots, o as truncateToUtf8Bytes };
@@ -1,45 +0,0 @@
1
- import { FC, ReactNode } from 'react';
2
- /** CSS custom-property overrides for the `DeploymentIcon` component. */
3
- export interface DeploymentIconColors {
4
- /** Badge background color. */
5
- background?: string;
6
- }
7
- /** User-visible strings for `DeploymentIcon`. */
8
- export interface DeploymentIconLabels {
9
- /** When provided, a tooltip with this text is shown on hover/focus. */
10
- tooltip?: string;
11
- }
12
- /** Style overrides for `DeploymentIcon`. */
13
- export interface DeploymentIconStyles {
14
- /** Color overrides applied as CSS custom properties. */
15
- colors?: DeploymentIconColors;
16
- /** Extra class applied to the outer badge wrapper, e.g. for a custom background variable. */
17
- badgeClassName?: string;
18
- }
19
- /** Props for `DeploymentIcon`. */
20
- export interface DeploymentIconProps {
21
- /** Image URL to display. When absent the fallback is shown directly. */
22
- src?: string;
23
- /** Outer badge dimension in pixels. */
24
- size: number;
25
- /** Display name used to generate initials when no image is available. */
26
- initialsName: string;
27
- /** Custom node rendered when `src` is absent or the image fails to load. Overrides `initialsName`. */
28
- fallback?: ReactNode;
29
- /** User-visible strings. */
30
- labels?: DeploymentIconLabels;
31
- /** Style overrides. */
32
- styles?: DeploymentIconStyles;
33
- }
34
- /**
35
- * Renders a deployment icon inside a rounded badge.
36
- * The `size` prop is the outer badge dimension in pixels.
37
- * The icon image is inset by ~11 % (matching Figma) to leave a visible backdrop.
38
- * On image load error, or when `src` is absent, renders `InitialsAvatar` derived from
39
- * `initialsName` (or the custom `fallback` node when provided).
40
- * When `src` changes, the previous image stays visible until the new one has
41
- * finished preloading, avoiding the blank frame a browser shows while an
42
- * `<img>`'s `src` attribute is swapped in place.
43
- */
44
- export declare const DeploymentIcon: FC<DeploymentIconProps>;
45
- //# sourceMappingURL=DeploymentIcon.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeploymentIcon.d.ts","sourceRoot":"","sources":["../../../src/components/DeploymentIcon/DeploymentIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,SAAS,EAA+B,MAAM,OAAO,CAAC;AAM7E,wEAAwE;AACxE,MAAM,WAAW,oBAAoB;IACnC,8BAA8B;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,iDAAiD;AACjD,MAAM,WAAW,oBAAoB;IACnC,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,4CAA4C;AAC5C,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,6FAA6F;IAC7F,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,kCAAkC;AAClC,MAAM,WAAW,mBAAmB;IAClC,wEAAwE;IACxE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,YAAY,EAAE,MAAM,CAAC;IACrB,sGAAsG;IACtG,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,uBAAuB;IACvB,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CA8FlD,CAAC"}
@@ -1,26 +0,0 @@
1
- import { FC } from 'react';
2
- /** CSS custom-property overrides for the `Highlight` component. */
3
- export interface HighlightColors {
4
- /** Highlighted match text color. */
5
- text?: string;
6
- /** Highlighted match background color. */
7
- background?: string;
8
- }
9
- /** Props for `Highlight`. */
10
- export interface HighlightProps {
11
- /** Full text to display. */
12
- text: string;
13
- /** Search query; the first case-insensitive match is highlighted. */
14
- query: string;
15
- /** Optional class name for the highlighted segment. */
16
- markClassName?: string;
17
- /** Optional class name forwarded to the `DialEllipsisTooltip` container. */
18
- className?: string;
19
- /** Maximum number of lines to display before truncating. Use `1` for single-line ellipsis truncation (e.g. list rows). Defaults to `2`. */
20
- maxLines?: number;
21
- /** Color overrides applied as CSS custom properties. */
22
- colors?: HighlightColors;
23
- }
24
- /** Renders text with the first occurrence of `query` wrapped in a highlight mark, with ellipsis truncation and a tooltip when overflowing. */
25
- export declare const Highlight: FC<HighlightProps>;
26
- //# sourceMappingURL=Highlight.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Highlight.d.ts","sourceRoot":"","sources":["../../../src/components/Highlight/Highlight.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAK3B,mEAAmE;AACnE,MAAM,WAAW,eAAe;IAC9B,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,6BAA6B;AAC7B,MAAM,WAAW,cAAc;IAC7B,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2IAA2I;IAC3I,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B;AAkBD,8IAA8I;AAC9I,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA8CxC,CAAC"}
@@ -1,16 +0,0 @@
1
- import { FC } from 'react';
2
- /** Props for `InitialsAvatar`. */
3
- export interface InitialsAvatarProps {
4
- /** Display name from which initials are derived. Empty string renders `"?"`. */
5
- name: string;
6
- /** Badge width and height in pixels. */
7
- size: number;
8
- /** Extra classes applied to the root element (e.g. `'shrink-0'`). */
9
- className?: string;
10
- }
11
- /**
12
- * A square badge showing 1–2 initials derived from `name` on a deterministic
13
- * colour background. Used as the fallback when a deployment has no icon image.
14
- */
15
- export declare const InitialsAvatar: FC<InitialsAvatarProps>;
16
- //# sourceMappingURL=InitialsAvatar.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InitialsAvatar.d.ts","sourceRoot":"","sources":["../../../src/components/InitialsAvatar/InitialsAvatar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAKhC,kCAAkC;AAClC,MAAM,WAAW,mBAAmB;IAClC,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CA0BlD,CAAC"}
@@ -1,50 +0,0 @@
1
- import { FC } from 'react';
2
- import { CodeBlockTheme } from '../../../types/code-editor';
3
- /** CSS custom-property overrides for the `MarkdownCodeBlock` component. */
4
- export interface MarkdownCodeBlockColors {
5
- /** Container background color. */
6
- background?: string;
7
- /** Container/header border color. */
8
- border?: string;
9
- /** Header background color. */
10
- headerBackground?: string;
11
- /** Language label text color. */
12
- language?: string;
13
- /** Copy button icon color once copied. */
14
- copied?: string;
15
- /** Scrollbar thumb/track color. */
16
- scrollbar?: string;
17
- }
18
- /** Props for {@link MarkdownCodeBlock}. */
19
- export interface MarkdownCodeBlockProps {
20
- /** Detected language from the fenced code block. Empty string for language-less blocks. */
21
- language: string;
22
- /** Raw code value with trailing newline stripped. */
23
- value: string;
24
- /** When true, the copy button is hidden (streaming in progress). */
25
- isStreaming?: boolean;
26
- /** Color theme for syntax highlighting. Defaults to `'dark'`. */
27
- theme?: CodeBlockTheme;
28
- /** Accessible label for the copy button. Defaults to `'Copy code'`. */
29
- copyLabel?: string;
30
- /** Accessible label for the copy button after copy completes. Defaults to `'Copied!'`. */
31
- copiedLabel?: string;
32
- /** Accessible label for the download button. Defaults to `'Download code'`. */
33
- downloadLabel?: string;
34
- /** Extra classes applied to the outer container element. */
35
- containerClassName?: string;
36
- /** Extra classes applied to the sticky header bar. */
37
- headerClassName?: string;
38
- /** Typography class for the `<code>` element (used when no language is detected). Defaults to `'dial-code-text'`. */
39
- codeClassName?: string;
40
- /** CSS class applied to the language label in the header. Defaults to `'dial-tiny-semi-text uppercase'` plus the module's `.languageLabel` class (`--text-secondary`). */
41
- languageLabelClassName?: string;
42
- /** Color overrides applied as CSS custom properties. */
43
- colors?: MarkdownCodeBlockColors;
44
- }
45
- /**
46
- * Renders a fenced or multiline code block with a sticky header (language label + copy button),
47
- * syntax highlighting via Prism, a height-constrained scrollable body, and always-LTR code direction.
48
- */
49
- export declare const MarkdownCodeBlock: FC<MarkdownCodeBlockProps>;
50
- //# sourceMappingURL=CodeBlock.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/MarkdownRenderer/CodeBlock/CodeBlock.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,EAAE,EAAQ,MAAM,OAAO,CAAC;AAGtC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAU5D,2EAA2E;AAC3E,MAAM,WAAW,uBAAuB;IACtC,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC,2FAA2F;IAC3F,QAAQ,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iEAAiE;IACjE,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0FAA0F;IAC1F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4DAA4D;IAC5D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sDAAsD;IACtD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qHAAqH;IACrH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0KAA0K;IAC1K,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,wDAAwD;IACxD,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAClC;AAOD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAmHxD,CAAC"}
@@ -1,7 +0,0 @@
1
- import { CSSProperties } from 'react';
2
- /** Style map consumed by `react-syntax-highlighter`'s `Prism` renderer. */
3
- type PrismStyleMap = Record<string, CSSProperties>;
4
- /** Prism syntax-highlighting style map used by {@link MarkdownCodeBlock}, restrained to design-system CSS variables. */
5
- export declare const restrainedSyntaxTheme: PrismStyleMap;
6
- export {};
7
- //# sourceMappingURL=syntax-theme.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"syntax-theme.d.ts","sourceRoot":"","sources":["../../../../src/components/MarkdownRenderer/CodeBlock/syntax-theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,2EAA2E;AAC3E,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AASnD,wHAAwH;AACxH,eAAO,MAAM,qBAAqB,EAAE,aA+DnC,CAAC"}
@@ -1,31 +0,0 @@
1
- import { FC } from 'react';
2
- import { Components } from 'react-markdown';
3
- import { CodeBlockTheme } from '../../types/code-editor';
4
- /** Props for the {@link MDMessageViewer} markdown renderer. */
5
- interface MDMessageViewerProps {
6
- /** Raw markdown string to render. */
7
- content: string;
8
- /** Enables gradual reveal for appended streaming content. */
9
- isStreaming?: boolean;
10
- /**
11
- * Label shown while `isStreaming` is true and no content has arrived yet.
12
- * Forwarded to {@link MarkdownRenderer}. Defaults to `'Thinking'`.
13
- */
14
- thinkingLabel?: string;
15
- /**
16
- * Additional react-markdown component overrides merged on top of the
17
- * built-in map. Use to inject custom React nodes (e.g. citation markers)
18
- * into specific markdown elements without modifying the viewer directly.
19
- */
20
- components?: Components;
21
- /** Accessible label for the copy button in code blocks. Forwarded to {@link MarkdownRenderer}. */
22
- codeBlockCopyLabel?: string;
23
- /** Accessible label for the copy button after copying. Forwarded to {@link MarkdownRenderer}. */
24
- codeBlockCopiedLabel?: string;
25
- /** Syntax highlight color theme for code blocks. Forwarded to {@link MarkdownRenderer}. */
26
- codeBlockTheme?: CodeBlockTheme;
27
- }
28
- /** Renders assistant message content as formatted markdown. */
29
- export declare const MDMessageViewer: FC<MDMessageViewerProps>;
30
- export {};
31
- //# sourceMappingURL=MDMessageViewer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MDMessageViewer.d.ts","sourceRoot":"","sources":["../../../src/components/MarkdownRenderer/MDMessageViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAQ,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAIzD,+DAA+D;AAC/D,UAAU,oBAAoB;IAC5B,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,kGAAkG;IAClG,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iGAAiG;IACjG,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,2FAA2F;IAC3F,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED,+DAA+D;AAC/D,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAqBpD,CAAC"}