@epam/ai-dial-chat-shared 1.2.0-dev.98 → 1.2.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.
- package/components/ConfirmationDialog/ConfirmationDialog.js +34 -0
- package/components/ConfirmationIdentityCard/ConfirmationIdentityCard.js +21 -0
- package/components/ConfirmationIdentityCard/ConfirmationIdentityCard.module.scss.js +6 -0
- package/components/ConfirmationIdentityRow/ConfirmationIdentityRow.js +24 -0
- package/components/ConfirmationIdentityRow/ConfirmationIdentityRow.module.scss.js +3 -0
- package/components/ConfirmationView/ConfirmationFooter.js +42 -0
- package/components/ConfirmationView/ConfirmationView.js +39 -0
- package/components/ConfirmationView/ConfirmationView.module.scss.js +7 -0
- package/components/CopyButton/CopyButton.js +5 -5
- package/components/EntityHeader/EntityHeader.js +14 -13
- package/components/EntityTypeLabel/EntityTypeLabel.js +2 -2
- package/components/FeaturedChip/FeaturedChip.js +9 -14
- package/components/InitialsAvatar/InitialsAvatar.js +10 -27
- package/components/MarkdownRenderer/CodeBlock/CodeBlock.js +65 -64
- package/components/MarkdownRenderer/MDMessageViewer.js +25 -17
- package/components/MarkdownRenderer/MarkdownRenderer.js +119 -118
- package/components/MarkdownRenderer/MarkdownRenderer.module.scss.js +7 -7
- package/components/MarkdownRenderer/Math/MarkdownMathBlock.module.scss.js +2 -2
- package/components/MarkdownRenderer/PlainTextRenderer.js +21 -0
- package/components/MarkdownRenderer/Table/MarkdownTable.js +62 -65
- package/components/MarkdownRenderer/Table/MarkdownTable.module.scss.js +11 -11
- package/components/MarkdownRenderer/Table/TableHeader.js +18 -21
- package/components/MarkdownRenderer/ThinkingShimmer.js +14 -0
- package/components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.js +3 -2
- package/components/PanelEmptyState/PanelEmptyState.js +2 -1
- package/components/TextRefinementField/TextRefinementField.js +86 -0
- package/constants/dial.js +2 -2
- package/constants/resizable-fields.js +2 -2
- package/file-manager/DialFileManagerShell/DialFileManagerShell.js +248 -236
- package/file-manager/FileManagerAttachModal/FileManagerAttachModal.js +17 -14
- package/file-manager/OperationLoaderModal/OperationLoaderModal.js +17 -20
- package/file-manager/upload-batch.js +2 -2
- package/file-manager/upload-queue.js +17 -0
- package/file-manager.d.ts +25 -14
- package/file-manager.js +4 -3
- package/hooks/useTextRefinement.js +66 -0
- package/hooks/useUnsavedChangesGuard.js +30 -0
- package/index.css +2 -2
- package/index.d.ts +510 -46
- package/index.js +73 -62
- package/markdown.d.ts +64 -8
- package/markdown.js +5 -4
- package/models/chat.js +4 -2
- package/package.json +5 -5
- package/utils/entity-field-limits.js +4 -0
- package/utils/entity-type.js +15 -0
- package/utils/format-price.js +13 -9
- package/utils/is-skill-selection-unsupported.js +4 -0
- package/utils/syntax-highlighting.js +13 -0
- package/components/InitialsAvatar/InitialsAvatar.module.scss.js +0 -6
- 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 "
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import b from "
|
|
16
|
-
import x
|
|
17
|
-
import C from "
|
|
18
|
-
import w from "remark-
|
|
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
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
[
|
|
24
|
-
],
|
|
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
|
-
},
|
|
54
|
-
...
|
|
54
|
+
}, k = [x], A = [S, {
|
|
55
|
+
...C,
|
|
55
56
|
tagNames: [
|
|
56
|
-
...
|
|
57
|
-
...
|
|
57
|
+
...C.tagNames ?? [],
|
|
58
|
+
...D,
|
|
58
59
|
"cit"
|
|
59
60
|
],
|
|
60
61
|
attributes: {
|
|
61
|
-
...
|
|
62
|
-
...
|
|
63
|
-
code: [...
|
|
62
|
+
...C.attributes,
|
|
63
|
+
...O,
|
|
64
|
+
code: [...C.attributes?.code ?? [], ["className"]],
|
|
64
65
|
cit: ["dataId"],
|
|
65
|
-
span: [...
|
|
66
|
+
span: [...C.attributes?.span ?? [], [
|
|
66
67
|
"className",
|
|
67
68
|
"katex",
|
|
68
69
|
"katex-error"
|
|
69
70
|
]]
|
|
70
71
|
}
|
|
71
|
-
}],
|
|
72
|
-
li: ({ children: e }) => /* @__PURE__ */
|
|
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__ */
|
|
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
|
-
},
|
|
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
|
-
},
|
|
85
|
+
}, R = {
|
|
85
86
|
left: "text-start",
|
|
86
87
|
center: "text-center",
|
|
87
88
|
right: "text-end"
|
|
88
|
-
},
|
|
89
|
+
}, z = (e) => {
|
|
89
90
|
let t = e?.properties?.align;
|
|
90
|
-
return typeof t == "string" ?
|
|
91
|
-
},
|
|
92
|
-
h1: ({ children: e }) => /* @__PURE__ */
|
|
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__ */
|
|
97
|
+
h2: ({ children: e }) => /* @__PURE__ */ _("h2", {
|
|
97
98
|
className: t.h2,
|
|
98
99
|
children: e
|
|
99
100
|
}),
|
|
100
|
-
h3: ({ children: e }) => /* @__PURE__ */
|
|
101
|
+
h3: ({ children: e }) => /* @__PURE__ */ _("h3", {
|
|
101
102
|
className: t.h3,
|
|
102
103
|
children: e
|
|
103
104
|
}),
|
|
104
|
-
h4: ({ children: e }) => /* @__PURE__ */
|
|
105
|
+
h4: ({ children: e }) => /* @__PURE__ */ _("h4", {
|
|
105
106
|
className: t.h4,
|
|
106
107
|
children: e
|
|
107
108
|
}),
|
|
108
|
-
h5: ({ children: e }) => /* @__PURE__ */
|
|
109
|
+
h5: ({ children: e }) => /* @__PURE__ */ _("h5", {
|
|
109
110
|
className: t.h5,
|
|
110
111
|
children: e
|
|
111
112
|
}),
|
|
112
|
-
h6: ({ children: n }) => /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
133
|
+
em: ({ children: e }) => /* @__PURE__ */ _("em", {
|
|
133
134
|
className: t.em ?? "italic",
|
|
134
135
|
children: e
|
|
135
136
|
}),
|
|
136
|
-
pre: ({ children: e }) => /* @__PURE__ */ g
|
|
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__ */
|
|
140
|
+
return c || l.includes("\n") ? /* @__PURE__ */ _(i, {
|
|
140
141
|
language: c,
|
|
141
142
|
value: l.replace(/\n$/, ""),
|
|
142
143
|
isStreaming: n,
|
|
143
|
-
theme:
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
166
|
-
del: ({ children: n }) => /* @__PURE__ */
|
|
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__ */
|
|
171
|
-
span: ({ children: e, node: n, ...r }) =>
|
|
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:
|
|
175
|
+
scrollRegionAriaLabel: y,
|
|
174
176
|
children: e
|
|
175
|
-
}) : /* @__PURE__ */
|
|
177
|
+
}) : /* @__PURE__ */ _("span", {
|
|
176
178
|
...r,
|
|
177
179
|
children: e
|
|
178
180
|
}),
|
|
179
|
-
table: ({ children: e }) => /* @__PURE__ */
|
|
181
|
+
table: ({ children: e }) => /* @__PURE__ */ _(c, {
|
|
180
182
|
classNames: t,
|
|
181
|
-
actionLabels:
|
|
182
|
-
downloadFilename:
|
|
183
|
-
onOpenInCanvas:
|
|
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) =>
|
|
190
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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",
|
|
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__ */
|
|
201
|
-
className: e("max-w-96 whitespace-normal px-3 py-[7px] align-top [overflow-wrap:anywhere]",
|
|
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
|
-
}),
|
|
205
|
-
let
|
|
206
|
-
|
|
207
|
-
if (!
|
|
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 ||
|
|
213
|
+
e || B([t.default, {
|
|
212
214
|
output: "mathml",
|
|
213
215
|
strict: !1
|
|
214
216
|
}]);
|
|
215
217
|
})(), () => {
|
|
216
218
|
e = !0;
|
|
217
219
|
};
|
|
218
|
-
}, [
|
|
219
|
-
let
|
|
220
|
-
...
|
|
221
|
-
...
|
|
222
|
-
|
|
220
|
+
}, [R, z]);
|
|
221
|
+
let H = m(() => [
|
|
222
|
+
...k,
|
|
223
|
+
...z ? [z] : [],
|
|
224
|
+
A,
|
|
223
225
|
...d
|
|
224
|
-
], [
|
|
225
|
-
"--cm-
|
|
226
|
-
"--cm-
|
|
227
|
-
"--cm-
|
|
228
|
-
"--cm-
|
|
229
|
-
"--cm-
|
|
230
|
-
"--cm-
|
|
231
|
-
"--cm-
|
|
232
|
-
"--cm-
|
|
233
|
-
"--cm-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
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
|
-
...
|
|
249
|
-
...
|
|
249
|
+
...I,
|
|
250
|
+
...c
|
|
250
251
|
}), [
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
252
|
+
s,
|
|
253
|
+
a,
|
|
254
|
+
g,
|
|
255
|
+
v,
|
|
255
256
|
b,
|
|
256
|
-
|
|
257
|
+
x,
|
|
257
258
|
C,
|
|
258
259
|
w,
|
|
259
|
-
|
|
260
|
+
T,
|
|
260
261
|
D,
|
|
261
|
-
|
|
262
|
+
O,
|
|
263
|
+
c
|
|
262
264
|
]);
|
|
263
|
-
return
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
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__ */
|
|
271
|
-
remarkPlugins:
|
|
272
|
-
rehypePlugins:
|
|
273
|
-
components:
|
|
274
|
-
urlTransform:
|
|
275
|
-
children:
|
|
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 {
|
|
281
|
+
export { H as MarkdownRenderer, I as defaultMarkdownComponents };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
thinking: "
|
|
3
|
-
"cm-shimmer": "_cm-
|
|
4
|
-
h6: "
|
|
5
|
-
codeInline: "
|
|
6
|
-
secondaryBorder: "
|
|
7
|
-
blockquote: "
|
|
8
|
-
link: "
|
|
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 };
|
|
@@ -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
|
|
11
|
-
import { memo as
|
|
12
|
-
import { jsx as
|
|
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
|
|
15
|
-
let [
|
|
16
|
-
"--cm-markdown-border":
|
|
17
|
-
"--cm-table-scrollbar":
|
|
18
|
-
"--cm-table-fade":
|
|
19
|
-
"--cm-table-row-divider":
|
|
20
|
-
"--cm-table-row-hover-bg":
|
|
21
|
-
}),
|
|
22
|
-
|
|
23
|
-
|
|
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
|
|
26
|
-
let e =
|
|
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 && (
|
|
29
|
-
|
|
30
|
-
},
|
|
28
|
+
e && (A.current != null && clearTimeout(A.current), k(!0), A.current = setTimeout(() => {
|
|
29
|
+
k(!1);
|
|
30
|
+
}, b));
|
|
31
31
|
});
|
|
32
|
-
}, [
|
|
33
|
-
let e =
|
|
34
|
-
e != null && r(`\uFEFF${l(Array.from(e.rows), c.Csv)}`,
|
|
35
|
-
}, [
|
|
36
|
-
let e =
|
|
37
|
-
e == null ||
|
|
38
|
-
}, [
|
|
39
|
-
actionLabels:
|
|
40
|
-
isCopied:
|
|
41
|
-
onCopy:
|
|
42
|
-
onDownloadCsv:
|
|
43
|
-
onOpenInCanvas:
|
|
44
|
-
}),
|
|
45
|
-
return /* @__PURE__ */
|
|
46
|
-
style:
|
|
47
|
-
className: e("group/table relative w-full min-w-0 max-w-full rounded-xl border [overflow:clip]", o.tableContainer,
|
|
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
|
-
|
|
49
|
+
H && /* @__PURE__ */ v("div", {
|
|
50
50
|
className: "sticky top-0 z-10 h-0",
|
|
51
|
-
children: /* @__PURE__ */
|
|
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:
|
|
54
|
-
tooltip: e.label,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"aria-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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__ */
|
|
69
|
-
ref:
|
|
70
|
-
className: e("w-full min-w-0 max-w-full overflow-x-auto", o.scrollContainer,
|
|
71
|
-
[o.tableScrollFadeBoth]:
|
|
72
|
-
[o.tableScrollFadeStart]:
|
|
73
|
-
[o.tableScrollFadeEnd]: !
|
|
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:
|
|
76
|
-
role:
|
|
77
|
-
"aria-label":
|
|
78
|
-
tabIndex:
|
|
79
|
-
children: /* @__PURE__ */
|
|
80
|
-
ref:
|
|
81
|
-
className: e("w-max min-w-full border-collapse",
|
|
82
|
-
children:
|
|
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
|
-
|
|
82
|
+
C?.copyLabel && /* @__PURE__ */ v("span", {
|
|
86
83
|
"aria-live": "polite",
|
|
87
84
|
className: "sr-only",
|
|
88
85
|
role: "status",
|
|
89
|
-
children:
|
|
86
|
+
children: O ? C.copiedLabel ?? "" : ""
|
|
90
87
|
})
|
|
91
88
|
]
|
|
92
89
|
});
|
|
93
90
|
});
|
|
94
91
|
//#endregion
|
|
95
|
-
export {
|
|
92
|
+
export { x as MarkdownTable };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
tableContainer: "
|
|
3
|
-
tableContainerLight: "
|
|
4
|
-
copiedIcon: "
|
|
5
|
-
scrollContainer: "
|
|
6
|
-
tableHeaderCell: "
|
|
7
|
-
sectionRow: "
|
|
8
|
-
rowDivider: "
|
|
9
|
-
row: "
|
|
10
|
-
tableScrollFadeEnd: "
|
|
11
|
-
tableScrollFadeStart: "
|
|
12
|
-
tableScrollFadeBoth: "
|
|
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 };
|