@epam/ai-dial-chat-shared 1.1.0-dev.94 → 1.1.0-rc.0

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 (179) 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 +48 -0
  5. package/components/EntityTypeLabel/EntityTypeLabel.js +10 -0
  6. package/components/FeaturedChip/FeaturedChip.js +18 -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 +69 -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 +17 -0
  29. package/components/PanelEmptyState/PanelEmptyState.module.scss.js +3 -0
  30. package/components/ResourceSummary/ResourceSummary.js +34 -0
  31. package/components/ResourceSummary/ResourceSummary.module.scss.js +6 -0
  32. package/constants/breakpoint.js +4 -0
  33. package/constants/dial.js +4 -0
  34. package/constants/entity-colors.js +17 -0
  35. package/constants/icon.js +13 -0
  36. package/constants/markdown-editor.js +4 -0
  37. package/constants/mime-types.js +99 -0
  38. package/constants/resizable-fields.js +4 -0
  39. package/constants/select-list.js +4 -0
  40. package/constants/tag-input.js +4 -0
  41. package/file-manager/DialFileManagerShell/DialFileManagerShell.js +299 -0
  42. package/file-manager/FileManagerAttachModal/FileManagerAttachModal.js +108 -0
  43. package/file-manager/OperationLoaderModal/OperationLoaderModal.js +36 -0
  44. package/file-manager/UploadProgressModal/UploadProgressModal.js +56 -0
  45. package/file-manager/file-manager-variant.js +8 -0
  46. package/file-manager/path.js +7 -0
  47. package/file-manager/upload-batch.js +6 -0
  48. package/file-manager/useGridEditingScroll/useGridEditingScroll.js +45 -0
  49. package/file-manager.d.ts +491 -0
  50. package/file-manager.js +3 -0
  51. package/hooks/useAvailableHeightCap.js +36 -0
  52. package/hooks/useCodeCopy.js +20 -0
  53. package/hooks/useCollapsedText.js +38 -0
  54. package/hooks/useHorizontalOverflow.js +25 -0
  55. package/hooks/useIsMobile.js +13 -0
  56. package/hooks/useStreamedMarkdownContent.js +32 -0
  57. package/index.css +1 -1
  58. package/index.d.ts +2505 -41
  59. package/index.js +64 -49132
  60. package/markdown.d.ts +401 -0
  61. package/markdown.js +11 -0
  62. package/models/chat.js +14 -0
  63. package/models/conversation-classification.js +6 -0
  64. package/models/conversation-transfer.js +14 -0
  65. package/models/deployment-features.js +6 -0
  66. package/package.json +43 -12
  67. package/types/attachment.js +8 -0
  68. package/types/code-editor.js +6 -0
  69. package/types/entity-type.js +6 -0
  70. package/types/mime-type.js +8 -0
  71. package/utils/annotation.js +120 -0
  72. package/utils/avatar-color.js +37 -0
  73. package/utils/build-css-vars.js +8 -0
  74. package/utils/copy-to-clipboard.js +69 -0
  75. package/utils/file-download.js +79 -0
  76. package/utils/format-file-size.js +4 -0
  77. package/utils/format-last-used.js +20 -0
  78. package/utils/format-price.js +18 -0
  79. package/utils/generate-uuid.js +7 -0
  80. package/utils/initials.js +7 -0
  81. package/utils/is-audio-transcription-supported.js +5 -0
  82. package/utils/latex.js +79 -0
  83. package/utils/merge-class.js +8 -0
  84. package/utils/message-attachment-to-display.js +31 -0
  85. package/utils/message.js +5 -0
  86. package/utils/mime-type.js +73 -0
  87. package/utils/prompt-variables.js +58 -0
  88. package/utils/string-utils.js +14 -0
  89. package/components/DeploymentIcon/DeploymentIcon.d.ts +0 -36
  90. package/components/DeploymentIcon/DeploymentIcon.d.ts.map +0 -1
  91. package/components/InitialsAvatar/InitialsAvatar.d.ts +0 -13
  92. package/components/InitialsAvatar/InitialsAvatar.d.ts.map +0 -1
  93. package/components/MarkdownRenderer/CodeBlock/CodeBlock.d.ts +0 -47
  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 -105
  100. package/components/MarkdownRenderer/MarkdownRenderer.d.ts.map +0 -1
  101. package/components/MarkdownRenderer/Table/MarkdownTable.d.ts +0 -31
  102. package/components/MarkdownRenderer/Table/MarkdownTable.d.ts.map +0 -1
  103. package/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.d.ts +0 -9
  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 -14
  112. package/constants/icon.d.ts.map +0 -1
  113. package/constants/mime-types.d.ts +0 -7
  114. package/constants/mime-types.d.ts.map +0 -1
  115. package/hooks/useCodeCopy.d.ts +0 -6
  116. package/hooks/useCodeCopy.d.ts.map +0 -1
  117. package/hooks/useCollapsedText.d.ts +0 -27
  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 -17
  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 -276
  131. package/models/chat.d.ts.map +0 -1
  132. package/models/custom-visualizer.d.ts +0 -61
  133. package/models/custom-visualizer.d.ts.map +0 -1
  134. package/models/deployment-configuration.d.ts +0 -55
  135. package/models/deployment-configuration.d.ts.map +0 -1
  136. package/models/deployment-features.d.ts +0 -17
  137. package/models/deployment-features.d.ts.map +0 -1
  138. package/models/deployment.d.ts +0 -31
  139. package/models/deployment.d.ts.map +0 -1
  140. package/models/dial-model.d.ts +0 -19
  141. package/models/dial-model.d.ts.map +0 -1
  142. package/models/import-export.d.ts +0 -23
  143. package/models/import-export.d.ts.map +0 -1
  144. package/models/theme.d.ts +0 -36
  145. package/models/theme.d.ts.map +0 -1
  146. package/models/tool-menu-item.d.ts +0 -13
  147. package/models/tool-menu-item.d.ts.map +0 -1
  148. package/types/attachment.d.ts +0 -23
  149. package/types/attachment.d.ts.map +0 -1
  150. package/types/code-editor.d.ts +0 -8
  151. package/types/code-editor.d.ts.map +0 -1
  152. package/types/mime-type.d.ts +0 -53
  153. package/types/mime-type.d.ts.map +0 -1
  154. package/utils/avatar-color.d.ts +0 -10
  155. package/utils/avatar-color.d.ts.map +0 -1
  156. package/utils/build-css-vars.d.ts +0 -4
  157. package/utils/build-css-vars.d.ts.map +0 -1
  158. package/utils/copy-to-clipboard.d.ts +0 -3
  159. package/utils/copy-to-clipboard.d.ts.map +0 -1
  160. package/utils/file-download.d.ts +0 -9
  161. package/utils/file-download.d.ts.map +0 -1
  162. package/utils/format-file-size.d.ts +0 -3
  163. package/utils/format-file-size.d.ts.map +0 -1
  164. package/utils/format-last-used.d.ts +0 -3
  165. package/utils/format-last-used.d.ts.map +0 -1
  166. package/utils/initials.d.ts +0 -3
  167. package/utils/initials.d.ts.map +0 -1
  168. package/utils/is-audio-transcription-supported.d.ts +0 -3
  169. package/utils/is-audio-transcription-supported.d.ts.map +0 -1
  170. package/utils/latex.d.ts +0 -11
  171. package/utils/latex.d.ts.map +0 -1
  172. package/utils/merge-class.d.ts +0 -4
  173. package/utils/merge-class.d.ts.map +0 -1
  174. package/utils/message-attachment-to-display.d.ts +0 -22
  175. package/utils/message-attachment-to-display.d.ts.map +0 -1
  176. package/utils/message.d.ts +0 -4
  177. package/utils/message.d.ts.map +0 -1
  178. package/utils/string-utils.d.ts +0 -5
  179. package/utils/string-utils.d.ts.map +0 -1
@@ -0,0 +1,280 @@
1
+ import { mergeClasses as e } from "../../utils/merge-class.js";
2
+ import { buildCssVars as t } from "../../utils/build-css-vars.js";
3
+ import { useStreamedMarkdownContent as n } from "../../hooks/useStreamedMarkdownContent.js";
4
+ import { preprocessLaTeX as r } from "../../utils/latex.js";
5
+ import { MarkdownCodeBlock as i } from "./CodeBlock/CodeBlock.js";
6
+ import a from "./MarkdownRenderer.module.scss.js";
7
+ import { MarkdownMathBlock as o } from "./Math/MarkdownMathBlock.js";
8
+ import s from "./Table/MarkdownTable.module.scss.js";
9
+ import { MarkdownTable as c } from "./Table/MarkdownTable.js";
10
+ import { MarkdownTaskCheckbox as l } from "./TaskCheckbox/MarkdownTaskCheckbox.js";
11
+ import u from "remark-gfm";
12
+ import { memo as d, useEffect as f, useMemo as p, useState as m } from "react";
13
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
14
+ import v, { defaultUrlTransform as y } from "react-markdown";
15
+ import b from "rehype-raw";
16
+ import x, { defaultSchema as S } from "rehype-sanitize";
17
+ import C from "remark-breaks";
18
+ import w from "remark-math";
19
+ //#region src/components/MarkdownRenderer/MarkdownRenderer.tsx
20
+ var T = [
21
+ u,
22
+ C,
23
+ [w, { singleDollarTextMath: !1 }]
24
+ ], E = /* @__PURE__ */ "math.maction.annotation.annotation-xml.menclose.merror.mfenced.mfrac.mi.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.semantics.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover".split("."), D = {
25
+ math: ["display", "xmlns"],
26
+ annotation: ["encoding"],
27
+ mfrac: ["linethickness"],
28
+ mi: ["mathvariant"],
29
+ mo: [
30
+ "fence",
31
+ "minsize",
32
+ "stretchy"
33
+ ],
34
+ mover: ["accent"],
35
+ mpadded: [
36
+ "height",
37
+ "lspace",
38
+ "width"
39
+ ],
40
+ mspace: ["width"],
41
+ mstyle: [
42
+ "displaystyle",
43
+ "mathcolor",
44
+ "scriptlevel"
45
+ ],
46
+ mtable: [
47
+ "columnalign",
48
+ "columnspacing",
49
+ "rowspacing",
50
+ "width"
51
+ ],
52
+ mtd: ["width"]
53
+ }, O = [b], k = [x, {
54
+ ...S,
55
+ tagNames: [
56
+ ...S.tagNames ?? [],
57
+ ...E,
58
+ "cit"
59
+ ],
60
+ attributes: {
61
+ ...S.attributes,
62
+ ...D,
63
+ code: [...S.attributes?.code ?? [], ["className"]],
64
+ cit: ["dataId"],
65
+ span: [...S.attributes?.span ?? [], [
66
+ "className",
67
+ "katex",
68
+ "katex-error"
69
+ ]]
70
+ }
71
+ }], A = [], j = /\$\$|\\\(|\\\[/, M = (e) => j.test(e), N = {}, P = (e) => e == null ? y : (t) => y(e(t)), F = {
72
+ li: ({ children: e }) => /* @__PURE__ */ g("li", {
73
+ className: "mb-1.5 last:mb-0",
74
+ children: e
75
+ }),
76
+ cit: ({ children: e, ...t }) => /* @__PURE__ */ _(h, { children: [
77
+ t["data-id"] == null ? "<cit>" : `<cit data-id="${t["data-id"]}">`,
78
+ e,
79
+ "</cit>"
80
+ ] })
81
+ }, I = (e) => {
82
+ let t = e?.properties?.className;
83
+ return !Array.isArray(t) || !t.includes("katex") ? !1 : (e?.children ?? []).some((e) => e.type === "element" && e.tagName === "math" && e.properties?.display === "block");
84
+ }, L = {
85
+ left: "text-start",
86
+ center: "text-center",
87
+ right: "text-end"
88
+ }, R = (e) => {
89
+ let t = e?.properties?.align;
90
+ return typeof t == "string" ? L[t] : void 0;
91
+ }, z = (e) => e ? e.type === "text" ? e.value ?? "" : (e.children ?? []).map(z).join("") : "", B = (t, { isStreaming: n, codeBlockCopyLabel: r, codeBlockCopiedLabel: u, codeBlockTheme: d, tableActionLabels: f, tableDownloadFilename: p, tableOnOpenInCanvas: m, tableScrollRegionAriaLabel: _, mathScrollRegionAriaLabel: v }) => ({
92
+ h1: ({ children: e }) => /* @__PURE__ */ g("h1", {
93
+ className: t.h1,
94
+ children: e
95
+ }),
96
+ h2: ({ children: e }) => /* @__PURE__ */ g("h2", {
97
+ className: t.h2,
98
+ children: e
99
+ }),
100
+ h3: ({ children: e }) => /* @__PURE__ */ g("h3", {
101
+ className: t.h3,
102
+ children: e
103
+ }),
104
+ h4: ({ children: e }) => /* @__PURE__ */ g("h4", {
105
+ className: t.h4,
106
+ children: e
107
+ }),
108
+ h5: ({ children: e }) => /* @__PURE__ */ g("h5", {
109
+ className: t.h5,
110
+ children: e
111
+ }),
112
+ h6: ({ children: n }) => /* @__PURE__ */ g("h6", {
113
+ className: e(a.h6, t.h6),
114
+ children: n
115
+ }),
116
+ p: ({ children: n }) => /* @__PURE__ */ g("p", {
117
+ className: e("break-words", t.p),
118
+ children: n
119
+ }),
120
+ ul: ({ children: n }) => /* @__PURE__ */ g("ul", {
121
+ className: e("list-disc ps-[2em]", t.ul),
122
+ children: n
123
+ }),
124
+ ol: ({ children: n }) => /* @__PURE__ */ g("ol", {
125
+ className: e("list-decimal ps-[2em]", t.ol),
126
+ children: n
127
+ }),
128
+ strong: ({ children: e }) => /* @__PURE__ */ g("strong", {
129
+ className: t.strong ?? "dial-body-paragraph-semi-text",
130
+ children: e
131
+ }),
132
+ em: ({ children: e }) => /* @__PURE__ */ g("em", {
133
+ className: t.em ?? "italic",
134
+ children: e
135
+ }),
136
+ pre: ({ children: e }) => /* @__PURE__ */ g(h, { children: e }),
137
+ code: ({ children: o, className: s }) => {
138
+ let c = /language-(\w+)/.exec(s ?? "")?.[1] ?? "", l = String(o);
139
+ return c || l.includes("\n") ? /* @__PURE__ */ g(i, {
140
+ language: c,
141
+ value: l.replace(/\n$/, ""),
142
+ isStreaming: n,
143
+ theme: d,
144
+ copyLabel: r,
145
+ copiedLabel: u,
146
+ containerClassName: t.codeBlockContainer,
147
+ headerClassName: t.codeBlockHeader,
148
+ codeClassName: t.codeFont
149
+ }) : /* @__PURE__ */ g("code", {
150
+ className: e("rounded px-1 py-0.5", a.codeInline, t.codeInlineFont ?? "dial-code-text", t.codeInline),
151
+ children: o
152
+ });
153
+ },
154
+ blockquote: ({ children: n }) => /* @__PURE__ */ g("blockquote", {
155
+ className: e("border-s-2 py-1 ps-4", a.blockquote, t.blockquote),
156
+ children: n
157
+ }),
158
+ a: ({ href: n, children: r }) => /* @__PURE__ */ g("a", {
159
+ href: n,
160
+ target: "_blank",
161
+ rel: "noopener noreferrer",
162
+ className: e("decoration-current/60 break-words underline underline-offset-2 hover:decoration-current focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2", a.link, t.link),
163
+ children: r
164
+ }),
165
+ hr: () => /* @__PURE__ */ g("hr", { className: e("my-5 border-t", a.secondaryBorder, t.hr) }),
166
+ del: ({ children: n }) => /* @__PURE__ */ g("del", {
167
+ className: e("opacity-75", t.del),
168
+ children: n
169
+ }),
170
+ input: ({ type: e, checked: t }) => e === "checkbox" ? /* @__PURE__ */ g(l, { checked: t ?? !1 }) : null,
171
+ span: ({ children: e, node: n, ...r }) => I(n) ? /* @__PURE__ */ g(o, {
172
+ className: t.mathBlock,
173
+ scrollRegionAriaLabel: v,
174
+ children: e
175
+ }) : /* @__PURE__ */ g("span", {
176
+ ...r,
177
+ children: e
178
+ }),
179
+ table: ({ children: e }) => /* @__PURE__ */ g(c, {
180
+ classNames: t,
181
+ actionLabels: f,
182
+ downloadFilename: p,
183
+ onOpenInCanvas: m,
184
+ isStreaming: n,
185
+ scrollRegionAriaLabel: _,
186
+ children: e
187
+ }),
188
+ tr: ({ children: t, node: n }) => {
189
+ let r = n?.children.filter((e) => e.type === "element") ?? [], i = r.some((e) => e.tagName === "th"), a = r.filter((e) => z(e).trim().length > 0).length, o = !i && r.length > 1 && a === 1;
190
+ return /* @__PURE__ */ g("tr", {
191
+ className: e(s.row, o && s.sectionRow),
192
+ children: t
193
+ });
194
+ },
195
+ th: ({ children: n, node: r }) => /* @__PURE__ */ g("th", {
196
+ scope: "col",
197
+ className: e("sticky top-0 z-[2] max-w-96 whitespace-normal break-words px-3 py-2.5 text-start", R(r), s.rowDivider, s.tableHeaderCell, t.tableHeaderFont ?? "dial-tiny-lead-semi-text", t.tableCell, t.tableHeader),
198
+ children: n
199
+ }),
200
+ td: ({ children: n, node: r }) => /* @__PURE__ */ g("td", {
201
+ className: e("max-w-96 whitespace-normal px-3 py-2.5 align-top [overflow-wrap:anywhere]", R(r), s.rowDivider, t.tableBodyCell, t.tableCell),
202
+ children: n
203
+ })
204
+ }), V = d(({ content: e, containerClassName: i, isStreaming: o, streamCharactersPerSecond: s, classNames: c = N, components: l, urlTransform: u, rehypePlugins: d = A, thinkingLabel: h = "Thinking", codeBlockCopyLabel: _, codeBlockCopiedLabel: y, codeBlockTheme: b, colors: x, tableActionLabels: S, tableDownloadFilename: C, tableOnOpenInCanvas: w, tableScrollRegionAriaLabel: E, mathScrollRegionAriaLabel: D }) => {
205
+ let j = n(e, o, s), I = p(() => r(j), [j]), L = p(() => M(I), [I]), [R, z] = m(null);
206
+ f(() => {
207
+ if (!L || R) return;
208
+ let e = !1;
209
+ return (async () => {
210
+ let [t] = await Promise.all([import("rehype-katex"), import("katex/dist/katex.min.css")]);
211
+ e || z([t.default, {
212
+ output: "mathml",
213
+ strict: !1
214
+ }]);
215
+ })(), () => {
216
+ e = !0;
217
+ };
218
+ }, [L, R]);
219
+ let V = p(() => [
220
+ ...O,
221
+ ...R ? [R] : [],
222
+ k,
223
+ ...d
224
+ ], [R, d]), H = t({
225
+ "--cm-thinking-inverted": x?.thinkingPrimary,
226
+ "--cm-thinking-secondary": x?.thinkingSecondary,
227
+ "--cm-markdown-border": x?.border,
228
+ "--cm-blockquote-border": x?.blockquoteBorder,
229
+ "--cm-blockquote-text": x?.blockquoteText,
230
+ "--cm-link-text": x?.linkText,
231
+ "--cm-link-focus": x?.linkFocus,
232
+ "--cm-table-header-text": x?.tableHeaderText,
233
+ "--cm-h6-text": x?.headingSixText,
234
+ "--cm-code-inline-bg": x?.inlineCodeBackground,
235
+ "--cm-code-inline-text": x?.inlineCodeText
236
+ }), U = p(() => P(u), [u]), W = p(() => ({
237
+ ...B(c, {
238
+ isStreaming: o,
239
+ codeBlockCopyLabel: _,
240
+ codeBlockCopiedLabel: y,
241
+ codeBlockTheme: b,
242
+ tableActionLabels: S,
243
+ tableDownloadFilename: C,
244
+ tableOnOpenInCanvas: w,
245
+ tableScrollRegionAriaLabel: E,
246
+ mathScrollRegionAriaLabel: D
247
+ }),
248
+ ...F,
249
+ ...l
250
+ }), [
251
+ c,
252
+ o,
253
+ _,
254
+ y,
255
+ b,
256
+ S,
257
+ C,
258
+ w,
259
+ E,
260
+ D,
261
+ l
262
+ ]);
263
+ return o && !j ? /* @__PURE__ */ g("span", {
264
+ className: a.thinking,
265
+ style: H,
266
+ children: h
267
+ }) : /* @__PURE__ */ g("div", {
268
+ style: H,
269
+ className: i,
270
+ children: /* @__PURE__ */ g(v, {
271
+ remarkPlugins: T,
272
+ rehypePlugins: V,
273
+ components: W,
274
+ urlTransform: U,
275
+ children: I
276
+ })
277
+ });
278
+ });
279
+ //#endregion
280
+ export { V as MarkdownRenderer, F as defaultMarkdownComponents };
@@ -0,0 +1,11 @@
1
+ var e = {
2
+ thinking: "_thinking_1g29w_9",
3
+ "cm-shimmer": "_cm-shimmer_1g29w_1",
4
+ h6: "_h6_1g29w_18",
5
+ codeInline: "_codeInline_1g29w_22",
6
+ secondaryBorder: "_secondaryBorder_1g29w_27",
7
+ blockquote: "_blockquote_1g29w_31",
8
+ link: "_link_1g29w_36"
9
+ };
10
+ //#endregion
11
+ export { e as default };
@@ -0,0 +1,24 @@
1
+ import { mergeClasses as e } from "../../../utils/merge-class.js";
2
+ import { useHorizontalOverflow as t } from "../../../hooks/useHorizontalOverflow.js";
3
+ import n from "./MarkdownMathBlock.module.scss.js";
4
+ import { memo as r } from "react";
5
+ import { jsx as i } from "react/jsx-runtime";
6
+ //#region src/components/MarkdownRenderer/Math/MarkdownMathBlock.tsx
7
+ var a = r(({ children: r, className: a, scrollRegionAriaLabel: o = "Scrollable formula" }) => {
8
+ let { scrollContainerRef: s, contentRef: c, hasContentBeyondStart: l, hasContentBeyondEnd: u, handleScroll: d } = t(), f = l || u;
9
+ return /* @__PURE__ */ i("div", {
10
+ ref: s,
11
+ className: e("w-full min-w-0 max-w-full overflow-x-auto overflow-y-hidden", n.scrollContainer, a),
12
+ onScroll: d,
13
+ role: f ? "region" : void 0,
14
+ "aria-label": f ? o : void 0,
15
+ tabIndex: f ? 0 : void 0,
16
+ children: /* @__PURE__ */ i("span", {
17
+ ref: c,
18
+ className: e("katex", n.mathContent),
19
+ children: r
20
+ })
21
+ });
22
+ });
23
+ //#endregion
24
+ export { a as MarkdownMathBlock };
@@ -0,0 +1,6 @@
1
+ var e = {
2
+ scrollContainer: "_scrollContainer_1f433_1",
3
+ mathContent: "_mathContent_1f433_24"
4
+ };
5
+ //#endregion
6
+ export { e as default };
@@ -0,0 +1,77 @@
1
+ import { mergeClasses as e } from "../../../utils/merge-class.js";
2
+ import { buildCssVars as t } from "../../../utils/build-css-vars.js";
3
+ import { copyToClipboard as n } from "../../../utils/copy-to-clipboard.js";
4
+ import { downloadTextFile as r } from "../../../utils/file-download.js";
5
+ import { TableHeader as i } from "./TableHeader.js";
6
+ import { useHorizontalOverflow as a } from "../../../hooks/useHorizontalOverflow.js";
7
+ import o from "./MarkdownTable.module.scss.js";
8
+ import { MARKDOWN_TABLE_CSV_MIME_TYPE as s, MarkdownTableCopyFormat as c, serializeMarkdownTableRows as l } from "./table-serialization.js";
9
+ import { useMarkdownTableActions as u } from "./useMarkdownTableActions/useMarkdownTableActions.js";
10
+ import { memo as d, useCallback as f, useEffect as p, useRef as m, useState as h } from "react";
11
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
12
+ //#region src/components/MarkdownRenderer/Table/MarkdownTable.tsx
13
+ var v = 2e3, y = d(({ children: d, classNames: y, colors: b, actionLabels: x, downloadFilename: S, isStreaming: C, onOpenInCanvas: w, scrollRegionAriaLabel: T = "Scrollable table" }) => {
14
+ let [E, D] = h(void 0), O = m(null), { scrollContainerRef: k, contentRef: A, hasContentBeyondStart: j, hasContentBeyondEnd: M, handleScroll: N } = a(), P = t({
15
+ "--cm-markdown-border": b?.border,
16
+ "--cm-table-scrollbar": b?.scrollbar,
17
+ "--cm-table-fade": b?.fade,
18
+ "--cm-table-row-divider": b?.rowDivider,
19
+ "--cm-table-row-zebra-bg": b?.rowZebraBackground,
20
+ "--cm-table-row-hover-bg": b?.rowHoverBackground
21
+ }), F = j || M;
22
+ p(() => () => {
23
+ O.current != null && clearTimeout(O.current);
24
+ }, []);
25
+ let I = f((e) => {
26
+ let t = A.current;
27
+ t != null && n(l(Array.from(t.rows), e)).then((t) => {
28
+ t && (O.current != null && clearTimeout(O.current), D(e), O.current = setTimeout(() => {
29
+ D(void 0);
30
+ }, v));
31
+ });
32
+ }, [A]), L = f(() => {
33
+ let e = A.current;
34
+ e != null && r(`\uFEFF${l(Array.from(e.rows), c.Csv)}`, S ?? "table.csv", s);
35
+ }, [A, S]), R = f(() => {
36
+ let e = A.current;
37
+ e == null || w == null || w(l(Array.from(e.rows), c.Markdown));
38
+ }, [A, w]), z = u({
39
+ actionLabels: x,
40
+ copiedFormat: E,
41
+ onCopy: I,
42
+ onDownloadCsv: L,
43
+ onOpenInCanvas: w == null ? void 0 : R
44
+ }), B = z.length > 0 && !C;
45
+ return /* @__PURE__ */ _("div", {
46
+ style: P,
47
+ className: e("relative w-full min-w-0 max-w-full overflow-hidden rounded-xl border", o.tableContainer, o.tableContainerLight, y.tableWrapper),
48
+ children: [
49
+ B && /* @__PURE__ */ g(i, { actions: z }),
50
+ /* @__PURE__ */ g("div", {
51
+ ref: k,
52
+ className: e("w-full min-w-0 max-w-full overflow-x-auto", o.scrollContainer, y.tableScrollContainer, {
53
+ [o.tableScrollFadeBoth]: j && M,
54
+ [o.tableScrollFadeStart]: j && !M,
55
+ [o.tableScrollFadeEnd]: !j && M
56
+ }),
57
+ onScroll: N,
58
+ role: F ? "region" : void 0,
59
+ "aria-label": F ? T : void 0,
60
+ tabIndex: F ? 0 : void 0,
61
+ children: /* @__PURE__ */ g("table", {
62
+ ref: A,
63
+ className: e("w-max min-w-full border-collapse", y.tableFont ?? "dial-small-text"),
64
+ children: d
65
+ })
66
+ }),
67
+ x?.copiedLabel && /* @__PURE__ */ g("span", {
68
+ "aria-live": "polite",
69
+ className: "sr-only",
70
+ role: "status",
71
+ children: E ? x.copiedLabel : ""
72
+ })
73
+ ]
74
+ });
75
+ });
76
+ //#endregion
77
+ export { y as MarkdownTable };
@@ -0,0 +1,15 @@
1
+ var e = {
2
+ tableContainer: "_tableContainer_187t3_1",
3
+ tableContainerLight: "_tableContainerLight_187t3_6",
4
+ copiedIcon: "_copiedIcon_187t3_10",
5
+ scrollContainer: "_scrollContainer_187t3_14",
6
+ tableHeaderCell: "_tableHeaderCell_187t3_30",
7
+ sectionRow: "_sectionRow_187t3_35",
8
+ row: "_row_187t3_39",
9
+ rowDivider: "_rowDivider_187t3_43",
10
+ tableScrollFadeEnd: "_tableScrollFadeEnd_187t3_53",
11
+ tableScrollFadeStart: "_tableScrollFadeStart_187t3_61",
12
+ tableScrollFadeBoth: "_tableScrollFadeBoth_187t3_69"
13
+ };
14
+ //#endregion
15
+ export { e as default };
@@ -0,0 +1,30 @@
1
+ import { mergeClasses as e } from "../../../utils/merge-class.js";
2
+ import t from "./TableHeader.module.scss.js";
3
+ import { ElementSize as n, GhostIconButton as r, Tooltip as i } from "@epam/ai-dial-ui-kit";
4
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
+ //#region src/components/MarkdownRenderer/Table/TableHeader.tsx
6
+ var s = ({ children: s, actions: c, className: l }) => /* @__PURE__ */ o("div", {
7
+ className: e("flex min-h-10 items-center gap-2 border-b px-2 py-2", t.tableHeader, l),
8
+ children: [s != null && /* @__PURE__ */ a("div", {
9
+ className: "min-w-0 flex-1",
10
+ children: s
11
+ }), c != null && /* @__PURE__ */ a("div", {
12
+ className: "ms-auto flex items-center gap-1",
13
+ children: c.map((e) => /* @__PURE__ */ a(i, {
14
+ tooltip: e.label,
15
+ asChild: !0,
16
+ children: /* @__PURE__ */ a(r, {
17
+ "aria-label": e.label,
18
+ icon: /* @__PURE__ */ a("span", {
19
+ "aria-hidden": !0,
20
+ className: "flex items-center",
21
+ children: e.icon
22
+ }),
23
+ size: n.Small,
24
+ onClick: e.onClick
25
+ })
26
+ }, e.label))
27
+ })]
28
+ });
29
+ //#endregion
30
+ export { s as TableHeader };
@@ -0,0 +1,3 @@
1
+ var e = { tableHeader: "_tableHeader_1qvg8_1" };
2
+ //#endregion
3
+ export { e as default };
@@ -0,0 +1,6 @@
1
+ //#region src/components/MarkdownRenderer/Table/table-serialization.ts
2
+ var e = /* @__PURE__ */ function(e) {
3
+ return e.Csv = "csv", e.Txt = "txt", e.Markdown = "markdown", e;
4
+ }({}), t = "table.csv", n = "text/csv;charset=utf-8", r = (e) => Array.from(e.cells).map((e) => e.textContent?.trim() ?? ""), i = (e) => r(e).map((e) => e ? `"${e.replace(/"/g, "\"\"")}"` : "").join(","), a = (e) => r(e).join(" "), o = (e) => `| ${r(e).join(" | ")} |`, s = (e, t) => t === "csv" ? e.map(i).join("\n") : t === "txt" ? e.map(a).join("\n") : e.map((e, t) => t === 0 ? [o(e), `| ${r(e).map(() => ":--").join(" | ")} |`].join("\n") : o(e)).join("\n");
5
+ //#endregion
6
+ export { t as DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME, n as MARKDOWN_TABLE_CSV_MIME_TYPE, e as MarkdownTableCopyFormat, s as serializeMarkdownTableRows };
@@ -0,0 +1,66 @@
1
+ import e from "../MarkdownTable.module.scss.js";
2
+ import { MarkdownTableCopyFormat as t } from "../table-serialization.js";
3
+ import { DIAL_ICON_SIZE as n, DIAL_KIT_ICON_STROKE as r } from "@epam/ai-dial-ui-kit";
4
+ import { useMemo as i } from "react";
5
+ import { jsx as a } from "react/jsx-runtime";
6
+ import { IconCheck as o, IconCsv as s, IconDownload as c, IconMarkdown as l, IconMaximize as u, IconTxt as d } from "@tabler/icons-react";
7
+ //#region src/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.tsx
8
+ var f = ({ actionLabels: f, copiedFormat: p, onCopy: m, onDownloadCsv: h, onOpenInCanvas: g }) => i(() => {
9
+ if (f == null) return [];
10
+ let i = [], _ = [
11
+ {
12
+ label: f.copyCsvLabel,
13
+ format: t.Csv,
14
+ Icon: s
15
+ },
16
+ {
17
+ label: f.copyTxtLabel,
18
+ format: t.Txt,
19
+ Icon: d
20
+ },
21
+ {
22
+ label: f.copyMarkdownLabel,
23
+ format: t.Markdown,
24
+ Icon: l
25
+ }
26
+ ];
27
+ for (let { label: t, format: s, Icon: c } of _) {
28
+ if (t == null) continue;
29
+ let l = p === s ? /* @__PURE__ */ a(o, {
30
+ className: e.copiedIcon,
31
+ size: n.SM,
32
+ stroke: r
33
+ }) : /* @__PURE__ */ a(c, {
34
+ size: n.SM,
35
+ stroke: r
36
+ });
37
+ i.push({
38
+ label: t,
39
+ icon: l,
40
+ onClick: () => m(s)
41
+ });
42
+ }
43
+ return f.downloadCsvLabel != null && i.push({
44
+ label: f.downloadCsvLabel,
45
+ icon: /* @__PURE__ */ a(c, {
46
+ size: n.SM,
47
+ stroke: r
48
+ }),
49
+ onClick: h
50
+ }), f.openInCanvasLabel != null && g != null && i.push({
51
+ label: f.openInCanvasLabel,
52
+ icon: /* @__PURE__ */ a(u, {
53
+ size: n.SM,
54
+ stroke: r
55
+ }),
56
+ onClick: g
57
+ }), i;
58
+ }, [
59
+ f,
60
+ p,
61
+ m,
62
+ h,
63
+ g
64
+ ]);
65
+ //#endregion
66
+ export { f as useMarkdownTableActions };
@@ -0,0 +1,12 @@
1
+ import { Checkbox as e } from "@epam/ai-dial-ui-kit";
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ //#region src/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.tsx
4
+ var n = ({ checked: n = !1 }) => /* @__PURE__ */ t("span", {
5
+ className: "me-1.5 inline-flex align-middle",
6
+ children: /* @__PURE__ */ t(e, {
7
+ isSelected: n,
8
+ disabled: !0
9
+ })
10
+ });
11
+ //#endregion
12
+ export { n as MarkdownTaskCheckbox };
@@ -0,0 +1,23 @@
1
+ //#region src/components/MarkdownRenderer/markdown-class-names.ts
2
+ var e = {
3
+ h1: "dial-h1-text mb-3 mt-6 first:mt-0 [text-wrap:balance]",
4
+ h2: "dial-h2-text mb-2 mt-5 first:mt-0 [text-wrap:balance]",
5
+ h3: "dial-h3-text mb-2 mt-4 first:mt-0 [text-wrap:balance]",
6
+ h4: "mb-2 mt-4 dial-body-semi-text first:mt-0 [text-wrap:balance]",
7
+ h5: "mb-2 mt-4 dial-small-semi-text first:mt-0 [text-wrap:balance]",
8
+ h6: "mb-2 mt-4 dial-tiny-text first:mt-0 [text-wrap:balance]",
9
+ p: "dial-body-paragraph-text mb-3 break-words [overflow-wrap:anywhere] [text-wrap:pretty] last:mb-0",
10
+ ul: "mb-3 space-y-1",
11
+ ol: "mb-3 space-y-1",
12
+ codeInline: "mx-0.5 px-1.5 break-words [overflow-wrap:anywhere]",
13
+ blockquote: "my-4",
14
+ link: "break-words [overflow-wrap:anywhere]",
15
+ tableWrapper: "my-4",
16
+ mathBlock: "my-4"
17
+ }, t = {
18
+ ...e,
19
+ p: "dial-small-paragraph-text mb-3 break-words [overflow-wrap:anywhere] [text-wrap:pretty] last:mb-0",
20
+ strong: "dial-small-paragraph-semi-text"
21
+ };
22
+ //#endregion
23
+ export { t as COMPACT_MARKDOWN_CLASS_NAMES, e as DEFAULT_MARKDOWN_CLASS_NAMES };
@@ -0,0 +1,18 @@
1
+ import { rehypePromptVariables as e } from "../../utils/prompt-variables.js";
2
+ import { MarkdownRenderer as t } from "../MarkdownRenderer/MarkdownRenderer.js";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ //#region src/components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.tsx
5
+ var r = [e], i = ({ content: e, headingClassName: i }) => /* @__PURE__ */ n(t, {
6
+ content: e,
7
+ rehypePlugins: r,
8
+ classNames: {
9
+ h1: i,
10
+ h2: i,
11
+ h3: i,
12
+ h4: i,
13
+ h5: i,
14
+ h6: i
15
+ }
16
+ });
17
+ //#endregion
18
+ export { i as MarkdownWithPlaceholders };
@@ -0,0 +1,17 @@
1
+ import { mergeClasses as e } from "../../utils/merge-class.js";
2
+ import { buildCssVars as t } from "../../utils/build-css-vars.js";
3
+ import n from "./PanelEmptyState.module.scss.js";
4
+ import { NoDataContent as r } from "@epam/ai-dial-ui-kit";
5
+ import { memo as i } from "react";
6
+ import { jsx as a } from "react/jsx-runtime";
7
+ //#region src/components/PanelEmptyState/PanelEmptyState.tsx
8
+ var o = i(({ label: i, colors: o, labelClassName: s = "dial-tiny-text", containerClassName: c }) => /* @__PURE__ */ a("div", {
9
+ style: t({ "--pes-label-color": o?.label }),
10
+ children: /* @__PURE__ */ a(r, {
11
+ title: i,
12
+ titleClassName: e(n.label, s),
13
+ className: c
14
+ })
15
+ }));
16
+ //#endregion
17
+ export { o as PanelEmptyState };
@@ -0,0 +1,3 @@
1
+ var e = { label: "_label_12p89_1" };
2
+ //#endregion
3
+ export { e as default };
@@ -0,0 +1,34 @@
1
+ import { mergeClasses as e } from "../../utils/merge-class.js";
2
+ import { buildCssVars as t } from "../../utils/build-css-vars.js";
3
+ import { EntityHeader as n } from "../EntityHeader/EntityHeader.js";
4
+ import r from "./ResourceSummary.module.scss.js";
5
+ import { EllipsisTooltip as i } from "@epam/ai-dial-ui-kit";
6
+ import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
7
+ //#region src/components/ResourceSummary/ResourceSummary.tsx
8
+ var c = ({ item: c, children: l, versionLabel: u = "Version {version} · current", hasVersionTag: d = !0, iconSize: f = 40, className: p, styles: m, colors: h }) => {
9
+ let g = m?.colors ?? h, { versionTagClassName: _ = "dial-tiny-text" } = m?.typography ?? {}, v = t({
10
+ "--rs-border": g?.border,
11
+ "--rs-bg": g?.background,
12
+ "--rs-version-tag-border": g?.versionTagBorder,
13
+ "--rs-version-tag-bg": g?.versionTagBackground,
14
+ "--rs-version-tag-text": g?.versionTagText
15
+ }), y = c && /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("div", {
16
+ className: "min-w-0 flex-1",
17
+ children: /* @__PURE__ */ o(n, {
18
+ item: c,
19
+ iconSize: f,
20
+ hasFeaturedTag: !1,
21
+ showVersion: !d
22
+ })
23
+ }), d && c.version && /* @__PURE__ */ o("span", {
24
+ className: e("inline-flex h-[24px] max-w-[45%] shrink-0 items-center gap-1 rounded-lg border px-2", _, r.versionTag),
25
+ children: /* @__PURE__ */ o(i, { text: u.replace("{version}", c.version) })
26
+ })] });
27
+ return /* @__PURE__ */ o("div", {
28
+ style: v,
29
+ className: e("flex items-center justify-between gap-3 rounded-xl border p-3", r.row, p),
30
+ children: l ?? y
31
+ });
32
+ };
33
+ //#endregion
34
+ export { c as ResourceSummary };
@@ -0,0 +1,6 @@
1
+ var e = {
2
+ row: "_row_1csuq_1",
3
+ versionTag: "_versionTag_1csuq_7"
4
+ };
5
+ //#endregion
6
+ export { e as default };
@@ -0,0 +1,4 @@
1
+ //#region src/constants/breakpoint.ts
2
+ var e = 1280, t = e - 1, n = `(min-width: ${e}px)`, r = `(max-width: ${t}px)`;
3
+ //#endregion
4
+ export { e as DESKTOP_BREAKPOINT_PX, n as DESKTOP_MEDIA_QUERY, t as MOBILE_MAX_WIDTH_PX, r as MOBILE_MEDIA_QUERY };
@@ -0,0 +1,4 @@
1
+ //#region src/constants/dial.ts
2
+ var e = ".dial_folder";
3
+ //#endregion
4
+ export { e as HIDDEN_FILE };