@epam/ai-dial-chat-shared 1.2.0-dev.99 → 1.3.0-dev.5

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 (51) hide show
  1. package/components/ConfirmationDialog/ConfirmationDialog.js +34 -0
  2. package/components/ConfirmationIdentityCard/ConfirmationIdentityCard.js +21 -0
  3. package/components/ConfirmationIdentityCard/ConfirmationIdentityCard.module.scss.js +6 -0
  4. package/components/ConfirmationIdentityRow/ConfirmationIdentityRow.js +24 -0
  5. package/components/ConfirmationIdentityRow/ConfirmationIdentityRow.module.scss.js +3 -0
  6. package/components/ConfirmationView/ConfirmationFooter.js +42 -0
  7. package/components/ConfirmationView/ConfirmationView.js +39 -0
  8. package/components/ConfirmationView/ConfirmationView.module.scss.js +7 -0
  9. package/components/CopyButton/CopyButton.js +5 -5
  10. package/components/EntityHeader/EntityHeader.js +14 -13
  11. package/components/EntityTypeLabel/EntityTypeLabel.js +2 -2
  12. package/components/FeaturedChip/FeaturedChip.js +9 -14
  13. package/components/InitialsAvatar/InitialsAvatar.js +10 -27
  14. package/components/MarkdownRenderer/CodeBlock/CodeBlock.js +65 -64
  15. package/components/MarkdownRenderer/MDMessageViewer.js +25 -17
  16. package/components/MarkdownRenderer/MarkdownRenderer.js +119 -118
  17. package/components/MarkdownRenderer/MarkdownRenderer.module.scss.js +7 -7
  18. package/components/MarkdownRenderer/Math/MarkdownMathBlock.module.scss.js +2 -2
  19. package/components/MarkdownRenderer/PlainTextRenderer.js +21 -0
  20. package/components/MarkdownRenderer/Table/MarkdownTable.js +62 -65
  21. package/components/MarkdownRenderer/Table/MarkdownTable.module.scss.js +11 -11
  22. package/components/MarkdownRenderer/Table/TableHeader.js +18 -21
  23. package/components/MarkdownRenderer/ThinkingShimmer.js +14 -0
  24. package/components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.js +3 -2
  25. package/components/PanelEmptyState/PanelEmptyState.js +2 -1
  26. package/components/TextRefinementField/TextRefinementField.js +86 -0
  27. package/constants/dial.js +2 -2
  28. package/constants/resizable-fields.js +2 -2
  29. package/file-manager/DialFileManagerShell/DialFileManagerShell.js +248 -236
  30. package/file-manager/FileManagerAttachModal/FileManagerAttachModal.js +17 -14
  31. package/file-manager/OperationLoaderModal/OperationLoaderModal.js +17 -20
  32. package/file-manager/upload-batch.js +2 -2
  33. package/file-manager/upload-queue.js +17 -0
  34. package/file-manager.d.ts +25 -14
  35. package/file-manager.js +4 -3
  36. package/hooks/useTextRefinement.js +66 -0
  37. package/hooks/useUnsavedChangesGuard.js +30 -0
  38. package/index.css +2 -2
  39. package/index.d.ts +510 -46
  40. package/index.js +73 -62
  41. package/markdown.d.ts +64 -8
  42. package/markdown.js +5 -4
  43. package/models/chat.js +4 -2
  44. package/package.json +5 -5
  45. package/utils/entity-field-limits.js +4 -0
  46. package/utils/entity-type.js +15 -0
  47. package/utils/format-price.js +13 -9
  48. package/utils/is-skill-selection-unsupported.js +4 -0
  49. package/utils/syntax-highlighting.js +13 -0
  50. package/components/InitialsAvatar/InitialsAvatar.module.scss.js +0 -6
  51. package/file-manager/UploadProgressModal/UploadProgressModal.js +0 -50
@@ -8,20 +8,21 @@ import { MarkdownMathBlock as o } from "./Math/MarkdownMathBlock.js";
8
8
  import s from "./Table/MarkdownTable.module.scss.js";
9
9
  import { MarkdownTable as c } from "./Table/MarkdownTable.js";
10
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";
11
+ import { ThinkingShimmer as u } from "./ThinkingShimmer.js";
12
+ import d from "remark-gfm";
13
+ import { memo as f, useEffect as p, useMemo as m, useState as h } from "react";
14
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
15
+ import y, { defaultUrlTransform as b } from "react-markdown";
16
+ import x from "rehype-raw";
17
+ import S, { defaultSchema as C } from "rehype-sanitize";
18
+ import w from "remark-breaks";
19
+ import T from "remark-math";
19
20
  //#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 = {
21
+ var E = [
22
+ d,
23
+ w,
24
+ [T, { singleDollarTextMath: !1 }]
25
+ ], D = /* @__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("."), O = {
25
26
  math: ["display", "xmlns"],
26
27
  annotation: ["encoding"],
27
28
  mfrac: ["linethickness"],
@@ -50,231 +51,231 @@ var T = [
50
51
  "width"
51
52
  ],
52
53
  mtd: ["width"]
53
- }, O = [b], k = [x, {
54
- ...S,
54
+ }, k = [x], A = [S, {
55
+ ...C,
55
56
  tagNames: [
56
- ...S.tagNames ?? [],
57
- ...E,
57
+ ...C.tagNames ?? [],
58
+ ...D,
58
59
  "cit"
59
60
  ],
60
61
  attributes: {
61
- ...S.attributes,
62
- ...D,
63
- code: [...S.attributes?.code ?? [], ["className"]],
62
+ ...C.attributes,
63
+ ...O,
64
+ code: [...C.attributes?.code ?? [], ["className"]],
64
65
  cit: ["dataId"],
65
- span: [...S.attributes?.span ?? [], [
66
+ span: [...C.attributes?.span ?? [], [
66
67
  "className",
67
68
  "katex",
68
69
  "katex-error"
69
70
  ]]
70
71
  }
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", {
72
+ }], j = [], M = /\$\$|\\\(|\\\[/, N = (e) => M.test(e), P = {}, F = (e) => e == null ? b : (t) => b(e(t)), I = {
73
+ li: ({ children: e }) => /* @__PURE__ */ _("li", {
73
74
  className: "mb-1.5 last:mb-0",
74
75
  children: e
75
76
  }),
76
- cit: ({ children: e, ...t }) => /* @__PURE__ */ _(h, { children: [
77
+ cit: ({ children: e, ...t }) => /* @__PURE__ */ v(g, { children: [
77
78
  t["data-id"] == null ? "<cit>" : `<cit data-id="${t["data-id"]}">`,
78
79
  e,
79
80
  "</cit>"
80
81
  ] })
81
- }, I = (e) => {
82
+ }, L = (e) => {
82
83
  let t = e?.properties?.className;
83
84
  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
+ }, R = {
85
86
  left: "text-start",
86
87
  center: "text-center",
87
88
  right: "text-end"
88
- }, R = (e) => {
89
+ }, z = (e) => {
89
90
  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", {
91
+ return typeof t == "string" ? R[t] : void 0;
92
+ }, B = (e) => e ? e.type === "text" ? e.value ?? "" : (e.children ?? []).map(B).join("") : "", V = (t, { isStreaming: n, codeBlockCopyLabel: r, codeBlockCopiedLabel: u, codeBlockDownloadLabel: d, codeBlockTheme: f, tableActionLabels: p, tableDownloadFilename: m, tableOnOpenInCanvas: h, tableScrollRegionAriaLabel: v, mathScrollRegionAriaLabel: y }) => ({
93
+ h1: ({ children: e }) => /* @__PURE__ */ _("h1", {
93
94
  className: t.h1,
94
95
  children: e
95
96
  }),
96
- h2: ({ children: e }) => /* @__PURE__ */ g("h2", {
97
+ h2: ({ children: e }) => /* @__PURE__ */ _("h2", {
97
98
  className: t.h2,
98
99
  children: e
99
100
  }),
100
- h3: ({ children: e }) => /* @__PURE__ */ g("h3", {
101
+ h3: ({ children: e }) => /* @__PURE__ */ _("h3", {
101
102
  className: t.h3,
102
103
  children: e
103
104
  }),
104
- h4: ({ children: e }) => /* @__PURE__ */ g("h4", {
105
+ h4: ({ children: e }) => /* @__PURE__ */ _("h4", {
105
106
  className: t.h4,
106
107
  children: e
107
108
  }),
108
- h5: ({ children: e }) => /* @__PURE__ */ g("h5", {
109
+ h5: ({ children: e }) => /* @__PURE__ */ _("h5", {
109
110
  className: t.h5,
110
111
  children: e
111
112
  }),
112
- h6: ({ children: n }) => /* @__PURE__ */ g("h6", {
113
+ h6: ({ children: n }) => /* @__PURE__ */ _("h6", {
113
114
  className: e(a.h6, t.h6),
114
115
  children: n
115
116
  }),
116
- p: ({ children: n }) => /* @__PURE__ */ g("p", {
117
+ p: ({ children: n }) => /* @__PURE__ */ _("p", {
117
118
  className: e("break-words", t.p),
118
119
  children: n
119
120
  }),
120
- ul: ({ children: n }) => /* @__PURE__ */ g("ul", {
121
+ ul: ({ children: n }) => /* @__PURE__ */ _("ul", {
121
122
  className: e("list-disc ps-[2em]", t.ul),
122
123
  children: n
123
124
  }),
124
- ol: ({ children: n }) => /* @__PURE__ */ g("ol", {
125
+ ol: ({ children: n }) => /* @__PURE__ */ _("ol", {
125
126
  className: e("list-decimal ps-[2em]", t.ol),
126
127
  children: n
127
128
  }),
128
- strong: ({ children: e }) => /* @__PURE__ */ g("strong", {
129
+ strong: ({ children: e }) => /* @__PURE__ */ _("strong", {
129
130
  className: t.strong ?? "dial-body-paragraph-semi-text",
130
131
  children: e
131
132
  }),
132
- em: ({ children: e }) => /* @__PURE__ */ g("em", {
133
+ em: ({ children: e }) => /* @__PURE__ */ _("em", {
133
134
  className: t.em ?? "italic",
134
135
  children: e
135
136
  }),
136
- pre: ({ children: e }) => /* @__PURE__ */ g(h, { children: e }),
137
+ pre: ({ children: e }) => /* @__PURE__ */ _(g, { children: e }),
137
138
  code: ({ children: o, className: s }) => {
138
139
  let c = /language-(\w+)/.exec(s ?? "")?.[1] ?? "", l = String(o);
139
- return c || l.includes("\n") ? /* @__PURE__ */ g(i, {
140
+ return c || l.includes("\n") ? /* @__PURE__ */ _(i, {
140
141
  language: c,
141
142
  value: l.replace(/\n$/, ""),
142
143
  isStreaming: n,
143
- theme: d,
144
+ theme: f,
144
145
  copyLabel: r,
145
146
  copiedLabel: u,
147
+ downloadLabel: d,
146
148
  containerClassName: t.codeBlockContainer,
147
149
  headerClassName: t.codeBlockHeader,
148
150
  codeClassName: t.codeFont
149
- }) : /* @__PURE__ */ g("code", {
151
+ }) : /* @__PURE__ */ _("code", {
150
152
  className: e("rounded px-1 py-0.5", a.codeInline, t.codeInlineFont ?? "dial-code-text", t.codeInline),
151
153
  children: o
152
154
  });
153
155
  },
154
- blockquote: ({ children: n }) => /* @__PURE__ */ g("blockquote", {
156
+ blockquote: ({ children: n }) => /* @__PURE__ */ _("blockquote", {
155
157
  className: e("border-s-2 py-1 ps-4", a.blockquote, t.blockquote),
156
158
  children: n
157
159
  }),
158
- a: ({ href: n, children: r }) => /* @__PURE__ */ g("a", {
160
+ a: ({ href: n, children: r }) => /* @__PURE__ */ _("a", {
159
161
  href: n,
160
162
  target: "_blank",
161
163
  rel: "noopener noreferrer",
162
164
  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
165
  children: r
164
166
  }),
165
- hr: () => /* @__PURE__ */ g("hr", { className: e("my-5 border-t", a.secondaryBorder, t.hr) }),
166
- del: ({ children: n }) => /* @__PURE__ */ g("del", {
167
+ hr: () => /* @__PURE__ */ _("hr", { className: e("my-5 border-t", a.secondaryBorder, t.hr) }),
168
+ del: ({ children: n }) => /* @__PURE__ */ _("del", {
167
169
  className: e("opacity-75", t.del),
168
170
  children: n
169
171
  }),
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
+ input: ({ type: e, checked: t }) => e === "checkbox" ? /* @__PURE__ */ _(l, { checked: t ?? !1 }) : null,
173
+ span: ({ children: e, node: n, ...r }) => L(n) ? /* @__PURE__ */ _(o, {
172
174
  className: t.mathBlock,
173
- scrollRegionAriaLabel: v,
175
+ scrollRegionAriaLabel: y,
174
176
  children: e
175
- }) : /* @__PURE__ */ g("span", {
177
+ }) : /* @__PURE__ */ _("span", {
176
178
  ...r,
177
179
  children: e
178
180
  }),
179
- table: ({ children: e }) => /* @__PURE__ */ g(c, {
181
+ table: ({ children: e }) => /* @__PURE__ */ _(c, {
180
182
  classNames: t,
181
- actionLabels: f,
182
- downloadFilename: p,
183
- onOpenInCanvas: m,
183
+ actionLabels: p,
184
+ downloadFilename: m,
185
+ onOpenInCanvas: h,
184
186
  isStreaming: n,
185
- scrollRegionAriaLabel: _,
187
+ scrollRegionAriaLabel: v,
186
188
  children: e
187
189
  }),
188
190
  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
+ let r = n?.children.filter((e) => e.type === "element") ?? [], i = r.some((e) => e.tagName === "th"), a = r.filter((e) => B(e).trim().length > 0).length, o = !i && r.length > 1 && a === 1;
192
+ return /* @__PURE__ */ _("tr", {
191
193
  className: e(s.row, o && s.sectionRow),
192
194
  children: t
193
195
  });
194
196
  },
195
- th: ({ children: n, node: r }) => /* @__PURE__ */ g("th", {
197
+ th: ({ children: n, node: r }) => /* @__PURE__ */ _("th", {
196
198
  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),
199
+ className: e("sticky top-0 z-[2] max-w-96 whitespace-normal break-words px-3 py-2.5 text-start", z(r), s.rowDivider, s.tableHeaderCell, t.tableHeaderFont ?? "dial-tiny-lead-semi-text", t.tableCell, t.tableHeader),
198
200
  children: n
199
201
  }),
200
- td: ({ children: n, node: r }) => /* @__PURE__ */ g("td", {
201
- className: e("max-w-96 whitespace-normal px-3 py-[7px] align-top [overflow-wrap:anywhere]", R(r), s.rowDivider, t.tableBodyCell, t.tableCell),
202
+ td: ({ children: n, node: r }) => /* @__PURE__ */ _("td", {
203
+ className: e("max-w-96 whitespace-normal px-3 py-[7px] align-top [overflow-wrap:anywhere]", z(r), s.rowDivider, t.tableBodyCell, t.tableCell),
202
204
  children: n
203
205
  })
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;
206
+ }), H = f(({ content: e, containerClassName: i, isStreaming: a, streamCharactersPerSecond: o, classNames: s = P, components: c, urlTransform: l, rehypePlugins: d = j, thinkingLabel: f = "Thinking", codeBlockCopyLabel: g, codeBlockCopiedLabel: v, codeBlockDownloadLabel: b, codeBlockTheme: x, colors: S, tableActionLabels: C, tableDownloadFilename: w, tableOnOpenInCanvas: T, tableScrollRegionAriaLabel: D, mathScrollRegionAriaLabel: O }) => {
207
+ let M = n(e, a, o), L = m(() => r(M), [M]), R = m(() => N(L), [L]), [z, B] = h(null);
208
+ p(() => {
209
+ if (!R || z) return;
208
210
  let e = !1;
209
211
  return (async () => {
210
212
  let [t] = await Promise.all([import("rehype-katex"), import("katex/dist/katex.min.css")]);
211
- e || z([t.default, {
213
+ e || B([t.default, {
212
214
  output: "mathml",
213
215
  strict: !1
214
216
  }]);
215
217
  })(), () => {
216
218
  e = !0;
217
219
  };
218
- }, [L, R]);
219
- let V = p(() => [
220
- ...O,
221
- ...R ? [R] : [],
222
- k,
220
+ }, [R, z]);
221
+ let H = m(() => [
222
+ ...k,
223
+ ...z ? [z] : [],
224
+ A,
223
225
  ...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
226
+ ], [z, d]), U = t({
227
+ "--cm-markdown-border": S?.border,
228
+ "--cm-blockquote-border": S?.blockquoteBorder,
229
+ "--cm-blockquote-text": S?.blockquoteText,
230
+ "--cm-link-text": S?.linkText,
231
+ "--cm-link-focus": S?.linkFocus,
232
+ "--cm-table-header-text": S?.tableHeaderText,
233
+ "--cm-h6-text": S?.headingSixText,
234
+ "--cm-code-inline-bg": S?.inlineCodeBackground,
235
+ "--cm-code-inline-text": S?.inlineCodeText
236
+ }), W = m(() => F(l), [l]), G = m(() => ({
237
+ ...V(s, {
238
+ isStreaming: a,
239
+ codeBlockCopyLabel: g,
240
+ codeBlockCopiedLabel: v,
241
+ codeBlockDownloadLabel: b,
242
+ codeBlockTheme: x,
243
+ tableActionLabels: C,
244
+ tableDownloadFilename: w,
245
+ tableOnOpenInCanvas: T,
246
+ tableScrollRegionAriaLabel: D,
247
+ mathScrollRegionAriaLabel: O
247
248
  }),
248
- ...F,
249
- ...l
249
+ ...I,
250
+ ...c
250
251
  }), [
251
- c,
252
- o,
253
- _,
254
- y,
252
+ s,
253
+ a,
254
+ g,
255
+ v,
255
256
  b,
256
- S,
257
+ x,
257
258
  C,
258
259
  w,
259
- E,
260
+ T,
260
261
  D,
261
- l
262
+ O,
263
+ c
262
264
  ]);
263
- return o && !j ? /* @__PURE__ */ g("span", {
264
- className: a.thinking,
265
- style: H,
266
- children: h
267
- }) : /* @__PURE__ */ g("div", {
268
- style: H,
265
+ return a && !M ? /* @__PURE__ */ _(u, {
266
+ label: f,
267
+ colors: S
268
+ }) : /* @__PURE__ */ _("div", {
269
+ style: U,
269
270
  className: i,
270
- children: /* @__PURE__ */ g(v, {
271
- remarkPlugins: T,
272
- rehypePlugins: V,
273
- components: W,
274
- urlTransform: U,
275
- children: I
271
+ children: /* @__PURE__ */ _(y, {
272
+ remarkPlugins: E,
273
+ rehypePlugins: H,
274
+ components: G,
275
+ urlTransform: W,
276
+ children: L
276
277
  })
277
278
  });
278
279
  });
279
280
  //#endregion
280
- export { V as MarkdownRenderer, F as defaultMarkdownComponents };
281
+ export { H as MarkdownRenderer, I as defaultMarkdownComponents };
@@ -1,11 +1,11 @@
1
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"
2
+ thinking: "_thinking_1ql91_9",
3
+ "cm-shimmer": "_cm-shimmer_1ql91_1",
4
+ h6: "_h6_1ql91_18",
5
+ codeInline: "_codeInline_1ql91_22",
6
+ secondaryBorder: "_secondaryBorder_1ql91_27",
7
+ blockquote: "_blockquote_1ql91_31",
8
+ link: "_link_1ql91_36"
9
9
  };
10
10
  //#endregion
11
11
  export { e as default };
@@ -1,6 +1,6 @@
1
1
  var e = {
2
- scrollContainer: "_scrollContainer_1f433_1",
3
- mathContent: "_mathContent_1f433_24"
2
+ scrollContainer: "_scrollContainer_n2oom_1",
3
+ mathContent: "_mathContent_n2oom_24"
4
4
  };
5
5
  //#endregion
6
6
  export { e as default };
@@ -0,0 +1,21 @@
1
+ import { mergeClasses as e } from "../../utils/merge-class.js";
2
+ import { useStreamedMarkdownContent as t } from "../../hooks/useStreamedMarkdownContent.js";
3
+ import { ThinkingShimmer as n } from "./ThinkingShimmer.js";
4
+ import { memo as r } from "react";
5
+ import { jsx as i } from "react/jsx-runtime";
6
+ //#region src/components/MarkdownRenderer/PlainTextRenderer.tsx
7
+ var a = {}, o = r(({ content: r, containerClassName: o, isStreaming: s, streamCharactersPerSecond: c, classNames: l = a, thinkingLabel: u = "Thinking", colors: d }) => {
8
+ let f = t(r, s, c);
9
+ return s && !f ? /* @__PURE__ */ i(n, {
10
+ label: u,
11
+ colors: d
12
+ }) : /* @__PURE__ */ i("div", {
13
+ className: o,
14
+ children: /* @__PURE__ */ i("p", {
15
+ className: e(l.p, "whitespace-pre-wrap break-words [overflow-wrap:anywhere]"),
16
+ children: f
17
+ })
18
+ });
19
+ });
20
+ //#endregion
21
+ export { o as PlainTextRenderer };
@@ -7,89 +7,86 @@ import { useHorizontalOverflow as a } from "../../../hooks/useHorizontalOverflow
7
7
  import o from "./MarkdownTable.module.scss.js";
8
8
  import { MARKDOWN_TABLE_CSV_MIME_TYPE as s, MarkdownTableCopyFormat as c, serializeMarkdownTableRows as l } from "./table-serialization.js";
9
9
  import { useMarkdownTableActions as u } from "./useMarkdownTableActions/useMarkdownTableActions.js";
10
- import { ElementSize as d, GhostIconButton as f, Tooltip as p } from "@epam/ai-dial-ui-kit";
11
- import { memo as m, useCallback as h, useEffect as g, useRef as _, useState as v } from "react";
12
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
10
+ import { ElementSize as d, GhostIconButton as f } from "@epam/ai-dial-ui-kit";
11
+ import { memo as p, useCallback as m, useEffect as h, useRef as g, useState as _ } from "react";
12
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
13
13
  //#region src/components/MarkdownRenderer/Table/MarkdownTable.tsx
14
- var x = 2e3, S = m(({ children: m, classNames: S, colors: C, actionLabels: w, downloadFilename: T, isStreaming: E, onOpenInCanvas: D, scrollRegionAriaLabel: O = "Scrollable table" }) => {
15
- let [k, A] = v(!1), j = _(null), { scrollContainerRef: M, contentRef: N, hasContentBeyondStart: P, hasContentBeyondEnd: F, handleScroll: I } = a(), L = t({
16
- "--cm-markdown-border": C?.border,
17
- "--cm-table-scrollbar": C?.scrollbar,
18
- "--cm-table-fade": C?.fade,
19
- "--cm-table-row-divider": C?.rowDivider,
20
- "--cm-table-row-hover-bg": C?.rowHoverBackground
21
- }), R = P || F;
22
- g(() => () => {
23
- j.current != null && clearTimeout(j.current);
14
+ var b = 2e3, x = p(({ children: p, classNames: x, colors: S, actionLabels: C, downloadFilename: w, isStreaming: T, onOpenInCanvas: E, scrollRegionAriaLabel: D = "Scrollable table" }) => {
15
+ let [O, k] = _(!1), A = g(null), { scrollContainerRef: j, contentRef: M, hasContentBeyondStart: N, hasContentBeyondEnd: P, handleScroll: F } = a(), I = t({
16
+ "--cm-markdown-border": S?.border,
17
+ "--cm-table-scrollbar": S?.scrollbar,
18
+ "--cm-table-fade": S?.fade,
19
+ "--cm-table-row-divider": S?.rowDivider,
20
+ "--cm-table-row-hover-bg": S?.rowHoverBackground
21
+ }), L = N || P;
22
+ h(() => () => {
23
+ A.current != null && clearTimeout(A.current);
24
24
  }, []);
25
- let z = h(() => {
26
- let e = N.current;
25
+ let R = m(() => {
26
+ let e = M.current;
27
27
  e != null && n(l(Array.from(e.rows), c.Markdown)).then((e) => {
28
- e && (j.current != null && clearTimeout(j.current), A(!0), j.current = setTimeout(() => {
29
- A(!1);
30
- }, x));
28
+ e && (A.current != null && clearTimeout(A.current), k(!0), A.current = setTimeout(() => {
29
+ k(!1);
30
+ }, b));
31
31
  });
32
- }, [N]), B = h(() => {
33
- let e = N.current;
34
- e != null && r(`\uFEFF${l(Array.from(e.rows), c.Csv)}`, T ?? "table.csv", s);
35
- }, [N, T]), V = h(() => {
36
- let e = N.current;
37
- e == null || D == null || D(l(Array.from(e.rows), c.Markdown));
38
- }, [N, D]), H = u({
39
- actionLabels: w,
40
- isCopied: k,
41
- onCopy: z,
42
- onDownloadCsv: B,
43
- onOpenInCanvas: D == null ? void 0 : V
44
- }), U = H.length > 0 && !E;
45
- return /* @__PURE__ */ b("div", {
46
- style: L,
47
- className: e("group/table relative w-full min-w-0 max-w-full rounded-xl border [overflow:clip]", o.tableContainer, S.tableWrapper, i.table),
32
+ }, [M]), z = m(() => {
33
+ let e = M.current;
34
+ e != null && r(`\uFEFF${l(Array.from(e.rows), c.Csv)}`, w ?? "table.csv", s);
35
+ }, [M, w]), B = m(() => {
36
+ let e = M.current;
37
+ e == null || E == null || E(l(Array.from(e.rows), c.Markdown));
38
+ }, [M, E]), V = u({
39
+ actionLabels: C,
40
+ isCopied: O,
41
+ onCopy: R,
42
+ onDownloadCsv: z,
43
+ onOpenInCanvas: E == null ? void 0 : B
44
+ }), H = V.length > 0 && !T;
45
+ return /* @__PURE__ */ y("div", {
46
+ style: I,
47
+ className: e("group/table relative w-full min-w-0 max-w-full rounded-xl border [overflow:clip]", o.tableContainer, x.tableWrapper, i.table),
48
48
  children: [
49
- U && /* @__PURE__ */ y("div", {
49
+ H && /* @__PURE__ */ v("div", {
50
50
  className: "sticky top-0 z-10 h-0",
51
- children: /* @__PURE__ */ y("div", {
51
+ children: /* @__PURE__ */ v("div", {
52
52
  className: "absolute end-2 top-2 flex items-center gap-1 rounded-lg border border-tertiary bg-layer-raised px-2 py-1 opacity-0 shadow-xs transition-opacity focus-within:opacity-100 group-hover/table:opacity-100",
53
- children: H.map((e) => /* @__PURE__ */ y(p, {
54
- tooltip: e.label,
55
- asChild: !0,
56
- children: /* @__PURE__ */ y(f, {
57
- "aria-label": e.label,
58
- icon: /* @__PURE__ */ y("span", {
59
- "aria-hidden": !0,
60
- children: e.icon
61
- }),
62
- size: d.Small,
63
- onClick: e.onClick
64
- })
53
+ children: V.map((e) => /* @__PURE__ */ v(f, {
54
+ tooltipProps: { tooltip: e.label },
55
+ "aria-label": e.label,
56
+ icon: /* @__PURE__ */ v("span", {
57
+ "aria-hidden": !0,
58
+ children: e.icon
59
+ }),
60
+ size: d.Small,
61
+ onClick: e.onClick
65
62
  }, e.label))
66
63
  })
67
64
  }),
68
- /* @__PURE__ */ y("div", {
69
- ref: M,
70
- className: e("w-full min-w-0 max-w-full overflow-x-auto", o.scrollContainer, S.tableScrollContainer, {
71
- [o.tableScrollFadeBoth]: P && F,
72
- [o.tableScrollFadeStart]: P && !F,
73
- [o.tableScrollFadeEnd]: !P && F
65
+ /* @__PURE__ */ v("div", {
66
+ ref: j,
67
+ className: e("w-full min-w-0 max-w-full overflow-x-auto", o.scrollContainer, x.tableScrollContainer, {
68
+ [o.tableScrollFadeBoth]: N && P,
69
+ [o.tableScrollFadeStart]: N && !P,
70
+ [o.tableScrollFadeEnd]: !N && P
74
71
  }, i.tableScroll),
75
- onScroll: I,
76
- role: R ? "region" : void 0,
77
- "aria-label": R ? O : void 0,
78
- tabIndex: R ? 0 : void 0,
79
- children: /* @__PURE__ */ y("table", {
80
- ref: N,
81
- className: e("w-max min-w-full border-collapse", S.tableFont ?? "dial-small-text"),
82
- children: m
72
+ onScroll: F,
73
+ role: L ? "region" : void 0,
74
+ "aria-label": L ? D : void 0,
75
+ tabIndex: L ? 0 : void 0,
76
+ children: /* @__PURE__ */ v("table", {
77
+ ref: M,
78
+ className: e("w-max min-w-full border-collapse", x.tableFont ?? "dial-small-text"),
79
+ children: p
83
80
  })
84
81
  }),
85
- w?.copyLabel && /* @__PURE__ */ y("span", {
82
+ C?.copyLabel && /* @__PURE__ */ v("span", {
86
83
  "aria-live": "polite",
87
84
  className: "sr-only",
88
85
  role: "status",
89
- children: k ? w.copiedLabel ?? "" : ""
86
+ children: O ? C.copiedLabel ?? "" : ""
90
87
  })
91
88
  ]
92
89
  });
93
90
  });
94
91
  //#endregion
95
- export { S as MarkdownTable };
92
+ export { x as MarkdownTable };
@@ -1,15 +1,15 @@
1
1
  var e = {
2
- tableContainer: "_tableContainer_1fwnj_1",
3
- tableContainerLight: "_tableContainerLight_1fwnj_6",
4
- copiedIcon: "_copiedIcon_1fwnj_10",
5
- scrollContainer: "_scrollContainer_1fwnj_14",
6
- tableHeaderCell: "_tableHeaderCell_1fwnj_30",
7
- sectionRow: "_sectionRow_1fwnj_37",
8
- rowDivider: "_rowDivider_1fwnj_41",
9
- row: "_row_1fwnj_41",
10
- tableScrollFadeEnd: "_tableScrollFadeEnd_1fwnj_51",
11
- tableScrollFadeStart: "_tableScrollFadeStart_1fwnj_59",
12
- tableScrollFadeBoth: "_tableScrollFadeBoth_1fwnj_67"
2
+ tableContainer: "_tableContainer_1qw2e_1",
3
+ tableContainerLight: "_tableContainerLight_1qw2e_6",
4
+ copiedIcon: "_copiedIcon_1qw2e_10",
5
+ scrollContainer: "_scrollContainer_1qw2e_14",
6
+ tableHeaderCell: "_tableHeaderCell_1qw2e_30",
7
+ sectionRow: "_sectionRow_1qw2e_37",
8
+ rowDivider: "_rowDivider_1qw2e_41",
9
+ row: "_row_1qw2e_41",
10
+ tableScrollFadeEnd: "_tableScrollFadeEnd_1qw2e_51",
11
+ tableScrollFadeStart: "_tableScrollFadeStart_1qw2e_59",
12
+ tableScrollFadeBoth: "_tableScrollFadeBoth_1qw2e_67"
13
13
  };
14
14
  //#endregion
15
15
  export { e as default };