@epam/ai-dial-chat-shared 1.2.0-dev.11 → 1.2.0-dev.111

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 (30) hide show
  1. package/components/MarkdownRenderer/CodeBlock/CodeBlock.js +64 -63
  2. package/components/MarkdownRenderer/CodeBlock/CodeBlock.module.scss.js +6 -6
  3. package/components/MarkdownRenderer/MDMessageViewer.js +23 -17
  4. package/components/MarkdownRenderer/MarkdownRenderer.js +88 -90
  5. package/components/MarkdownRenderer/Math/MarkdownMathBlock.js +19 -18
  6. package/components/MarkdownRenderer/PlainTextRenderer.js +21 -0
  7. package/components/MarkdownRenderer/Table/MarkdownTable.js +74 -56
  8. package/components/MarkdownRenderer/Table/MarkdownTable.module.scss.js +11 -11
  9. package/components/MarkdownRenderer/Table/table-serialization.js +23 -3
  10. package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.js +48 -62
  11. package/components/MarkdownRenderer/ThinkingShimmer.js +14 -0
  12. package/constants/mime-types.js +49 -2
  13. package/constants/public-class-names.js +10 -0
  14. package/constants/resizable-fields.js +1 -1
  15. package/file-manager/DialFileManagerShell/DialFileManagerShell.js +160 -159
  16. package/file-manager/FileManagerAttachModal/FileManagerAttachModal.js +23 -22
  17. package/file-manager/UploadProgressModal/UploadProgressModal.js +26 -32
  18. package/file-manager.d.ts +10 -6
  19. package/index.css +2 -2
  20. package/index.d.ts +161 -10
  21. package/index.js +58 -56
  22. package/markdown.d.ts +61 -8
  23. package/markdown.js +13 -11
  24. package/package.json +3 -3
  25. package/types/attachment.js +1 -1
  26. package/utils/file-download.js +6 -6
  27. package/utils/is-skill-selection-unsupported.js +4 -0
  28. package/utils/latex.js +5 -3
  29. package/utils/merge-class.js +5 -4
  30. package/utils/mime-type.js +10 -6
@@ -2,81 +2,82 @@ import { CodeBlockTheme as e } from "../../../types/code-editor.js";
2
2
  import { mergeClasses as t } from "../../../utils/merge-class.js";
3
3
  import { buildCssVars as n } from "../../../utils/build-css-vars.js";
4
4
  import { downloadTextFile as r, getFileExtensionForLanguage as i } from "../../../utils/file-download.js";
5
- import { useCodeCopy as a } from "../../../hooks/useCodeCopy.js";
6
- import o from "./CodeBlock.module.scss.js";
7
- import { restrainedSyntaxTheme as s } from "./syntax-theme.js";
8
- import { DIAL_ICON_SIZE as c, DIAL_KIT_ICON_STROKE as l, ElementSize as u, GhostIconButton as d } from "@epam/ai-dial-ui-kit";
9
- import { Suspense as f, lazy as p, memo as m } from "react";
10
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
11
- import { IconCheck as _, IconCopy as v, IconDownload as y } from "@tabler/icons-react";
5
+ import { CHAT_SHARED_CLASS as a } from "../../../constants/public-class-names.js";
6
+ import { useCodeCopy as o } from "../../../hooks/useCodeCopy.js";
7
+ import s from "./CodeBlock.module.scss.js";
8
+ import { restrainedSyntaxTheme as c } from "./syntax-theme.js";
9
+ import { DIAL_ICON_SIZE as l, DIAL_KIT_ICON_STROKE as u, ElementSize as d, GhostIconButton as f } from "@epam/ai-dial-ui-kit";
10
+ import { Suspense as p, lazy as m, memo as h } from "react";
11
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
12
+ import { IconCheck as v, IconCopy as y, IconDownload as b } from "@tabler/icons-react";
12
13
  //#region src/components/MarkdownRenderer/CodeBlock/CodeBlock.tsx
13
- var b = {
14
- dark: s,
15
- light: s
16
- }, x = p(async () => {
14
+ var x = {
15
+ dark: c,
16
+ light: c
17
+ }, S = m(async () => {
17
18
  let { Prism: e } = await import("react-syntax-highlighter");
18
19
  return { default: e };
19
- }), S = m(({ language: p, value: m, isStreaming: S, theme: C = e.Dark, copyLabel: w = "Copy code", copiedLabel: T = "Copied!", downloadLabel: E = "Download code", hideDownload: D = !1, containerClassName: O, headerClassName: k, codeClassName: A = "dial-code-text", languageLabelClassName: j = "dial-tiny-lead-semi-text", title: M, titleSlot: N, colors: P }) => {
20
- let { isCopied: F, copy: I } = a(m), L = C === e.Light, R = () => {
21
- r(m, `code.${i(p)}`);
22
- }, z = /* @__PURE__ */ h("pre", {
20
+ }), C = h(({ language: m, value: h, isStreaming: C, theme: w = e.Dark, copyLabel: T = "Copy code", copiedLabel: E = "Copied!", downloadLabel: D = "Download code", hideDownload: O = !1, containerClassName: k, headerClassName: A, codeClassName: j = "dial-code-text", languageLabelClassName: M = "dial-tiny-lead-semi-text", title: N, titleSlot: P, colors: F }) => {
21
+ let { isCopied: I, copy: L } = o(h), R = w === e.Light, z = () => {
22
+ r(h, `code.${i(m)}`);
23
+ }, B = /* @__PURE__ */ g("pre", {
23
24
  className: "p-4",
24
- children: /* @__PURE__ */ h("code", {
25
- className: t("whitespace-pre", A),
26
- children: m
25
+ children: /* @__PURE__ */ g("code", {
26
+ className: t("whitespace-pre", j),
27
+ children: h
27
28
  })
28
29
  });
29
- return /* @__PURE__ */ g("div", {
30
+ return /* @__PURE__ */ _("div", {
30
31
  style: n({
31
- "--cm-code-block-bg": P?.background,
32
- "--cm-code-block-border": P?.border,
33
- "--cm-code-block-header-bg": P?.headerBackground,
34
- "--cm-code-block-language": P?.language,
35
- "--cm-code-block-copied": P?.copied,
36
- "--cm-code-block-scrollbar": P?.scrollbar
32
+ "--cm-code-block-bg": F?.background,
33
+ "--cm-code-block-border": F?.border,
34
+ "--cm-code-block-header-bg": F?.headerBackground,
35
+ "--cm-code-block-language": F?.language,
36
+ "--cm-code-block-copied": F?.copied,
37
+ "--cm-code-block-scrollbar": F?.scrollbar
37
38
  }),
38
- className: t("my-4 max-w-full overflow-hidden rounded-xl border", o.container, L && o.containerLight, O),
39
+ className: t("my-4 max-w-full rounded-xl border [overflow:clip]", s.container, R && s.containerLight, k, a.codeBlock),
39
40
  children: [
40
- /* @__PURE__ */ g("div", {
41
- className: t("flex min-h-10 items-center justify-between border-b px-4", N == null ? "py-2" : "py-0", o.header, k),
42
- children: [N ?? /* @__PURE__ */ h("span", {
43
- className: t(o.languageLabel, j),
44
- children: M ?? p
45
- }), !S && /* @__PURE__ */ g("div", {
41
+ /* @__PURE__ */ _("div", {
42
+ className: t("sticky top-0 z-10 flex min-h-10 items-center justify-between px-4", P == null ? "py-2" : "py-0", s.header, A, a.codeBlockHeader),
43
+ children: [P ?? /* @__PURE__ */ g("span", {
44
+ className: t(s.languageLabel, M),
45
+ children: N ?? m
46
+ }), !C && /* @__PURE__ */ _("div", {
46
47
  className: "flex items-center gap-1",
47
- children: [!D && /* @__PURE__ */ h(d, {
48
- icon: /* @__PURE__ */ h(y, {
49
- size: c.SM,
50
- stroke: l
48
+ children: [!O && /* @__PURE__ */ g(f, {
49
+ icon: /* @__PURE__ */ g(b, {
50
+ size: l.SM,
51
+ stroke: u
51
52
  }),
52
- "aria-label": E,
53
- size: u.Small,
54
- onClick: R
55
- }), /* @__PURE__ */ h(d, {
56
- icon: F ? /* @__PURE__ */ h(_, {
57
- size: c.SM,
58
- className: o.copiedIcon,
53
+ "aria-label": D,
54
+ size: d.Small,
55
+ onClick: z
56
+ }), /* @__PURE__ */ g(f, {
57
+ icon: I ? /* @__PURE__ */ g(v, {
58
+ size: l.SM,
59
+ className: s.copiedIcon,
59
60
  "aria-hidden": !0,
60
- stroke: l
61
- }) : /* @__PURE__ */ h(v, {
62
- size: c.SM,
61
+ stroke: u
62
+ }) : /* @__PURE__ */ g(y, {
63
+ size: l.SM,
63
64
  "aria-hidden": !0,
64
- stroke: l
65
+ stroke: u
65
66
  }),
66
- "aria-label": w,
67
- size: u.Small,
68
- onClick: I
67
+ "aria-label": T,
68
+ size: d.Small,
69
+ onClick: L
69
70
  })]
70
71
  })]
71
72
  }),
72
- /* @__PURE__ */ h("div", {
73
- className: t(o.scrollContainer, "max-h-[60vh] overflow-auto"),
73
+ /* @__PURE__ */ g("div", {
74
+ className: t(s.scrollContainer, "max-h-[60vh] overflow-auto"),
74
75
  dir: "ltr",
75
- children: p ? /* @__PURE__ */ h(f, {
76
- fallback: z,
77
- children: /* @__PURE__ */ h(x, {
78
- language: p,
79
- style: b[C] ?? s,
76
+ children: m ? /* @__PURE__ */ g(p, {
77
+ fallback: B,
78
+ children: /* @__PURE__ */ g(S, {
79
+ language: m,
80
+ style: x[w] ?? c,
80
81
  customStyle: {
81
82
  margin: 0,
82
83
  borderRadius: 0,
@@ -86,19 +87,19 @@ var b = {
86
87
  padding: "14px 16px",
87
88
  letterSpacing: 0
88
89
  },
89
- codeTagProps: { className: A },
90
- children: m
90
+ codeTagProps: { className: j },
91
+ children: h
91
92
  })
92
- }) : z
93
+ }) : B
93
94
  }),
94
- /* @__PURE__ */ h("span", {
95
+ /* @__PURE__ */ g("span", {
95
96
  role: "status",
96
97
  "aria-live": "polite",
97
98
  className: "sr-only",
98
- children: F ? T : ""
99
+ children: I ? E : ""
99
100
  })
100
101
  ]
101
102
  });
102
103
  });
103
104
  //#endregion
104
- export { S as MarkdownCodeBlock };
105
+ export { C as MarkdownCodeBlock };
@@ -1,10 +1,10 @@
1
1
  var e = {
2
- container: "_container_spugt_1",
3
- containerLight: "_containerLight_spugt_6",
4
- header: "_header_spugt_10",
5
- languageLabel: "_languageLabel_spugt_15",
6
- copiedIcon: "_copiedIcon_spugt_19",
7
- scrollContainer: "_scrollContainer_spugt_23"
2
+ container: "_container_sqe5k_1",
3
+ containerLight: "_containerLight_sqe5k_6",
4
+ header: "_header_sqe5k_10",
5
+ languageLabel: "_languageLabel_sqe5k_15",
6
+ copiedIcon: "_copiedIcon_sqe5k_19",
7
+ scrollContainer: "_scrollContainer_sqe5k_23"
8
8
  };
9
9
  //#endregion
10
10
  export { e as default };
@@ -1,22 +1,28 @@
1
1
  import { MarkdownRenderer as e } from "./MarkdownRenderer.js";
2
2
  import { DEFAULT_MARKDOWN_CLASS_NAMES as t } from "./markdown-class-names.js";
3
- import { memo as n } from "react";
4
- import { jsx as r } from "react/jsx-runtime";
3
+ import { PlainTextRenderer as n } from "./PlainTextRenderer.js";
4
+ import { memo as r } from "react";
5
+ import { jsx as i } from "react/jsx-runtime";
5
6
  //#region src/components/MarkdownRenderer/MDMessageViewer.tsx
6
- var i = n(({ content: n, isStreaming: i, thinkingLabel: a, components: o, urlTransform: s, codeBlockCopyLabel: c, codeBlockCopiedLabel: l, codeBlockTheme: u, tableActionLabels: d, tableDownloadFilename: f, tableOnOpenInCanvas: p, tableScrollRegionAriaLabel: m, classNames: h = t }) => /* @__PURE__ */ r(e, {
7
- content: n,
8
- isStreaming: i,
9
- thinkingLabel: a,
10
- components: o,
11
- urlTransform: s,
12
- codeBlockCopyLabel: c,
13
- codeBlockCopiedLabel: l,
14
- codeBlockTheme: u,
15
- tableActionLabels: d,
16
- tableDownloadFilename: f,
17
- tableOnOpenInCanvas: p,
18
- tableScrollRegionAriaLabel: m,
19
- classNames: h
7
+ var a = r(({ content: r, isPlainText: a, isStreaming: o, thinkingLabel: s, components: c, urlTransform: l, codeBlockCopyLabel: u, codeBlockCopiedLabel: d, codeBlockTheme: f, tableActionLabels: p, tableDownloadFilename: m, tableOnOpenInCanvas: h, tableScrollRegionAriaLabel: g, classNames: _ = t }) => a ? /* @__PURE__ */ i(n, {
8
+ content: r,
9
+ isStreaming: o,
10
+ thinkingLabel: s,
11
+ classNames: _
12
+ }) : /* @__PURE__ */ i(e, {
13
+ content: r,
14
+ isStreaming: o,
15
+ thinkingLabel: s,
16
+ components: c,
17
+ urlTransform: l,
18
+ codeBlockCopyLabel: u,
19
+ codeBlockCopiedLabel: d,
20
+ codeBlockTheme: f,
21
+ tableActionLabels: p,
22
+ tableDownloadFilename: m,
23
+ tableOnOpenInCanvas: h,
24
+ tableScrollRegionAriaLabel: g,
25
+ classNames: _
20
26
  }));
21
27
  //#endregion
22
- export { i as MDMessageViewer };
28
+ export { a as MDMessageViewer };
@@ -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,93 +51,93 @@ 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, codeBlockTheme: d, tableActionLabels: f, tableDownloadFilename: p, tableOnOpenInCanvas: m, tableScrollRegionAriaLabel: h, mathScrollRegionAriaLabel: v }) => ({
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,
@@ -146,64 +147,64 @@ var T = [
146
147
  containerClassName: t.codeBlockContainer,
147
148
  headerClassName: t.codeBlockHeader,
148
149
  codeClassName: t.codeFont
149
- }) : /* @__PURE__ */ g("code", {
150
+ }) : /* @__PURE__ */ _("code", {
150
151
  className: e("rounded px-1 py-0.5", a.codeInline, t.codeInlineFont ?? "dial-code-text", t.codeInline),
151
152
  children: o
152
153
  });
153
154
  },
154
- blockquote: ({ children: n }) => /* @__PURE__ */ g("blockquote", {
155
+ blockquote: ({ children: n }) => /* @__PURE__ */ _("blockquote", {
155
156
  className: e("border-s-2 py-1 ps-4", a.blockquote, t.blockquote),
156
157
  children: n
157
158
  }),
158
- a: ({ href: n, children: r }) => /* @__PURE__ */ g("a", {
159
+ a: ({ href: n, children: r }) => /* @__PURE__ */ _("a", {
159
160
  href: n,
160
161
  target: "_blank",
161
162
  rel: "noopener noreferrer",
162
163
  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
164
  children: r
164
165
  }),
165
- hr: () => /* @__PURE__ */ g("hr", { className: e("my-5 border-t", a.secondaryBorder, t.hr) }),
166
- del: ({ children: n }) => /* @__PURE__ */ g("del", {
166
+ hr: () => /* @__PURE__ */ _("hr", { className: e("my-5 border-t", a.secondaryBorder, t.hr) }),
167
+ del: ({ children: n }) => /* @__PURE__ */ _("del", {
167
168
  className: e("opacity-75", t.del),
168
169
  children: n
169
170
  }),
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, {
171
+ input: ({ type: e, checked: t }) => e === "checkbox" ? /* @__PURE__ */ _(l, { checked: t ?? !1 }) : null,
172
+ span: ({ children: e, node: n, ...r }) => L(n) ? /* @__PURE__ */ _(o, {
172
173
  className: t.mathBlock,
173
174
  scrollRegionAriaLabel: v,
174
175
  children: e
175
- }) : /* @__PURE__ */ g("span", {
176
+ }) : /* @__PURE__ */ _("span", {
176
177
  ...r,
177
178
  children: e
178
179
  }),
179
- table: ({ children: e }) => /* @__PURE__ */ g(c, {
180
+ table: ({ children: e }) => /* @__PURE__ */ _(c, {
180
181
  classNames: t,
181
182
  actionLabels: f,
182
183
  downloadFilename: p,
183
184
  onOpenInCanvas: m,
184
185
  isStreaming: n,
185
- scrollRegionAriaLabel: _,
186
+ scrollRegionAriaLabel: h,
186
187
  children: e
187
188
  }),
188
189
  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", {
190
+ 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;
191
+ return /* @__PURE__ */ _("tr", {
191
192
  className: e(s.row, o && s.sectionRow),
192
193
  children: t
193
194
  });
194
195
  },
195
- th: ({ children: n, node: r }) => /* @__PURE__ */ g("th", {
196
+ th: ({ children: n, node: r }) => /* @__PURE__ */ _("th", {
196
197
  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
+ 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
199
  children: n
199
200
  }),
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),
201
+ td: ({ children: n, node: r }) => /* @__PURE__ */ _("td", {
202
+ 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
203
  children: n
203
204
  })
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(() => {
205
+ }), 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, codeBlockTheme: b, colors: x, tableActionLabels: S, tableDownloadFilename: C, tableOnOpenInCanvas: w, tableScrollRegionAriaLabel: T, mathScrollRegionAriaLabel: D }) => {
206
+ let O = n(e, a, o), M = m(() => r(O), [O]), L = m(() => N(M), [M]), [R, z] = h(null);
207
+ p(() => {
207
208
  if (!L || R) return;
208
209
  let e = !1;
209
210
  return (async () => {
@@ -216,14 +217,12 @@ var T = [
216
217
  e = !0;
217
218
  };
218
219
  }, [L, R]);
219
- let V = p(() => [
220
- ...O,
220
+ let B = m(() => [
221
+ ...k,
221
222
  ...R ? [R] : [],
222
- k,
223
+ A,
223
224
  ...d
224
225
  ], [R, d]), H = t({
225
- "--cm-thinking-inverted": x?.thinkingPrimary,
226
- "--cm-thinking-secondary": x?.thinkingSecondary,
227
226
  "--cm-markdown-border": x?.border,
228
227
  "--cm-blockquote-border": x?.blockquoteBorder,
229
228
  "--cm-blockquote-text": x?.blockquoteText,
@@ -233,48 +232,47 @@ var T = [
233
232
  "--cm-h6-text": x?.headingSixText,
234
233
  "--cm-code-inline-bg": x?.inlineCodeBackground,
235
234
  "--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,
235
+ }), U = m(() => F(l), [l]), W = m(() => ({
236
+ ...V(s, {
237
+ isStreaming: a,
238
+ codeBlockCopyLabel: g,
239
+ codeBlockCopiedLabel: v,
241
240
  codeBlockTheme: b,
242
241
  tableActionLabels: S,
243
242
  tableDownloadFilename: C,
244
243
  tableOnOpenInCanvas: w,
245
- tableScrollRegionAriaLabel: E,
244
+ tableScrollRegionAriaLabel: T,
246
245
  mathScrollRegionAriaLabel: D
247
246
  }),
248
- ...F,
249
- ...l
247
+ ...I,
248
+ ...c
250
249
  }), [
251
- c,
252
- o,
253
- _,
254
- y,
250
+ s,
251
+ a,
252
+ g,
253
+ v,
255
254
  b,
256
255
  S,
257
256
  C,
258
257
  w,
259
- E,
258
+ T,
260
259
  D,
261
- l
260
+ c
262
261
  ]);
263
- return o && !j ? /* @__PURE__ */ g("span", {
264
- className: a.thinking,
265
- style: H,
266
- children: h
267
- }) : /* @__PURE__ */ g("div", {
262
+ return a && !O ? /* @__PURE__ */ _(u, {
263
+ label: f,
264
+ colors: x
265
+ }) : /* @__PURE__ */ _("div", {
268
266
  style: H,
269
267
  className: i,
270
- children: /* @__PURE__ */ g(v, {
271
- remarkPlugins: T,
272
- rehypePlugins: V,
268
+ children: /* @__PURE__ */ _(y, {
269
+ remarkPlugins: E,
270
+ rehypePlugins: B,
273
271
  components: W,
274
272
  urlTransform: U,
275
- children: I
273
+ children: M
276
274
  })
277
275
  });
278
276
  });
279
277
  //#endregion
280
- export { V as MarkdownRenderer, F as defaultMarkdownComponents };
278
+ export { H as MarkdownRenderer, I as defaultMarkdownComponents };
@@ -1,24 +1,25 @@
1
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";
2
+ import { CHAT_SHARED_CLASS as t } from "../../../constants/public-class-names.js";
3
+ import { useHorizontalOverflow as n } from "../../../hooks/useHorizontalOverflow.js";
4
+ import r from "./MarkdownMathBlock.module.scss.js";
5
+ import { memo as i } from "react";
6
+ import { jsx as a } from "react/jsx-runtime";
6
7
  //#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
8
+ var o = i(({ children: i, className: o, scrollRegionAriaLabel: s = "Scrollable formula" }) => {
9
+ let { scrollContainerRef: c, contentRef: l, hasContentBeyondStart: u, hasContentBeyondEnd: d, handleScroll: f } = n(), p = u || d;
10
+ return /* @__PURE__ */ a("div", {
11
+ ref: c,
12
+ className: e("w-full min-w-0 max-w-full overflow-x-auto overflow-y-hidden", r.scrollContainer, o, t.mathBlock),
13
+ onScroll: f,
14
+ role: p ? "region" : void 0,
15
+ "aria-label": p ? s : void 0,
16
+ tabIndex: p ? 0 : void 0,
17
+ children: /* @__PURE__ */ a("span", {
18
+ ref: l,
19
+ className: e("katex", r.mathContent),
20
+ children: i
20
21
  })
21
22
  });
22
23
  });
23
24
  //#endregion
24
- export { a as MarkdownMathBlock };
25
+ export { o as MarkdownMathBlock };
@@ -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 };