@epam/ai-dial-chat-shared 1.2.0-dev.6 → 1.2.0-dev.69

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.
@@ -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 };
@@ -198,7 +198,7 @@ var T = [
198
198
  children: n
199
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
+ 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
202
  children: n
203
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 }) => {
@@ -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 };
@@ -1,77 +1,95 @@
1
1
  import { mergeClasses as e } from "../../../utils/merge-class.js";
2
2
  import { buildCssVars as t } from "../../../utils/build-css-vars.js";
3
- import { copyToClipboard as n } from "../../../utils/copy-to-clipboard.js";
3
+ import { copyMarkdownAsRichText as n } from "../../../utils/copy-to-clipboard.js";
4
4
  import { downloadTextFile as r } from "../../../utils/file-download.js";
5
- import { TableHeader as i } from "./TableHeader.js";
5
+ import { CHAT_SHARED_CLASS as i } from "../../../constants/public-class-names.js";
6
6
  import { useHorizontalOverflow as a } from "../../../hooks/useHorizontalOverflow.js";
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 { 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";
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";
12
13
  //#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);
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);
24
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));
25
+ let z = h(() => {
26
+ let e = N.current;
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));
31
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),
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),
48
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
49
+ U && /* @__PURE__ */ y("div", {
50
+ className: "sticky top-0 z-10 h-0",
51
+ children: /* @__PURE__ */ y("div", {
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
+ })
65
+ }, e.label))
65
66
  })
66
67
  }),
67
- x?.copiedLabel && /* @__PURE__ */ g("span", {
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
74
+ }, 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
83
+ })
84
+ }),
85
+ w?.copyLabel && /* @__PURE__ */ y("span", {
68
86
  "aria-live": "polite",
69
87
  className: "sr-only",
70
88
  role: "status",
71
- children: E ? x.copiedLabel : ""
89
+ children: k ? w.copiedLabel ?? "" : ""
72
90
  })
73
91
  ]
74
92
  });
75
93
  });
76
94
  //#endregion
77
- export { y as MarkdownTable };
95
+ export { S as MarkdownTable };
@@ -1,15 +1,15 @@
1
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"
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"
13
13
  };
14
14
  //#endregion
15
15
  export { e as default };
@@ -1,6 +1,6 @@
1
1
  //#region src/components/MarkdownRenderer/Table/table-serialization.ts
2
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");
3
+ return e.Csv = "csv", 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, t) => t === "csv" ? e.map(i).join("\n") : e.map((e, t) => t === 0 ? [a(e), `| ${r(e).map(() => ":--").join(" | ")} |`].join("\n") : a(e)).join("\n");
5
5
  //#endregion
6
- export { t as DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME, n as MARKDOWN_TABLE_CSV_MIME_TYPE, e as MarkdownTableCopyFormat, s as serializeMarkdownTableRows };
6
+ export { t as DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME, n as MARKDOWN_TABLE_CSV_MIME_TYPE, e as MarkdownTableCopyFormat, o as serializeMarkdownTableRows };
@@ -1,66 +1,52 @@
1
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";
2
+ import { DIAL_ICON_SIZE as t, DIAL_KIT_ICON_STROKE as n } from "@epam/ai-dial-ui-kit";
3
+ import { useMemo as r } from "react";
4
+ import { jsx as i } from "react/jsx-runtime";
5
+ import { IconCheck as a, IconCopy as o, IconDownload as s, IconLayoutSidebarRight as c } from "@tabler/icons-react";
7
6
  //#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
7
+ var l = ({ actionLabels: l, isCopied: u, onCopy: d, onDownloadCsv: f, onOpenInCanvas: p }) => {
8
+ let m = l?.copyLabel, h = l?.downloadCsvLabel, g = l?.openInCanvasLabel;
9
+ return r(() => {
10
+ let r = [];
11
+ if (m != null) {
12
+ let s = u ? /* @__PURE__ */ i(a, {
13
+ className: e.copiedIcon,
14
+ size: t.SM,
15
+ stroke: n
16
+ }) : /* @__PURE__ */ i(o, {
17
+ size: t.SM,
18
+ stroke: n
19
+ });
20
+ r.push({
21
+ label: m,
22
+ icon: s,
23
+ onClick: d
24
+ });
25
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
- ]);
26
+ return h != null && r.push({
27
+ label: h,
28
+ icon: /* @__PURE__ */ i(s, {
29
+ size: t.SM,
30
+ stroke: n
31
+ }),
32
+ onClick: f
33
+ }), g != null && p != null && r.push({
34
+ label: g,
35
+ icon: /* @__PURE__ */ i(c, {
36
+ size: t.SM,
37
+ stroke: n
38
+ }),
39
+ onClick: p
40
+ }), r;
41
+ }, [
42
+ m,
43
+ h,
44
+ g,
45
+ u,
46
+ d,
47
+ f,
48
+ p
49
+ ]);
50
+ };
65
51
  //#endregion
66
- export { f as useMarkdownTableActions };
52
+ export { l as useMarkdownTableActions };
@@ -0,0 +1,10 @@
1
+ //#region src/constants/public-class-names.ts
2
+ var e = {
3
+ codeBlock: "dial-chat-shared-code-block",
4
+ codeBlockHeader: "dial-chat-shared-code-block-header",
5
+ table: "dial-chat-shared-table",
6
+ tableScroll: "dial-chat-shared-table-scroll",
7
+ mathBlock: "dial-chat-shared-math-block"
8
+ };
9
+ //#endregion
10
+ export { e as CHAT_SHARED_CLASS };
@@ -1,4 +1,4 @@
1
1
  //#region src/constants/resizable-fields.ts
2
- var e = "max-h-[50vh]", t = "--resizable-field-max-height", n = "[&_.w-md-editor]:max-h-[var(--resizable-field-max-height,70vh)]";
2
+ var e = "max-h-[50vh]", t = "--resizable-field-max-height", n = "[&_.w-md-editor:not(.w-md-editor-fullscreen)]:max-h-[var(--resizable-field-max-height,70vh)]";
3
3
  //#endregion
4
4
  export { n as MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME, t as RESIZABLE_FIELD_MAX_HEIGHT_CSS_VARIABLE, e as RESIZABLE_TEXTAREA_CLASS_NAME };