@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.
- package/components/MarkdownRenderer/CodeBlock/CodeBlock.js +64 -63
- package/components/MarkdownRenderer/CodeBlock/CodeBlock.module.scss.js +6 -6
- package/components/MarkdownRenderer/MarkdownRenderer.js +1 -1
- package/components/MarkdownRenderer/Math/MarkdownMathBlock.js +19 -18
- package/components/MarkdownRenderer/Table/MarkdownTable.js +74 -56
- package/components/MarkdownRenderer/Table/MarkdownTable.module.scss.js +11 -11
- package/components/MarkdownRenderer/Table/table-serialization.js +3 -3
- package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.js +48 -62
- package/constants/public-class-names.js +10 -0
- package/constants/resizable-fields.js +1 -1
- package/file-manager/DialFileManagerShell/DialFileManagerShell.js +161 -159
- package/file-manager/FileManagerAttachModal/FileManagerAttachModal.js +22 -21
- package/file-manager/UploadProgressModal/UploadProgressModal.js +26 -32
- package/file-manager.d.ts +5 -1
- package/index.css +2 -2
- package/index.d.ts +86 -9
- package/index.js +20 -20
- package/markdown.d.ts +15 -7
- package/markdown.js +12 -11
- package/package.json +3 -3
- package/types/attachment.js +1 -1
|
@@ -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 {
|
|
6
|
-
import o from "
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
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
|
|
14
|
-
dark:
|
|
15
|
-
light:
|
|
16
|
-
},
|
|
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
|
-
}),
|
|
20
|
-
let { isCopied:
|
|
21
|
-
r(
|
|
22
|
-
},
|
|
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__ */
|
|
25
|
-
className: t("whitespace-pre",
|
|
26
|
-
children:
|
|
25
|
+
children: /* @__PURE__ */ g("code", {
|
|
26
|
+
className: t("whitespace-pre", j),
|
|
27
|
+
children: h
|
|
27
28
|
})
|
|
28
29
|
});
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ _("div", {
|
|
30
31
|
style: n({
|
|
31
|
-
"--cm-code-block-bg":
|
|
32
|
-
"--cm-code-block-border":
|
|
33
|
-
"--cm-code-block-header-bg":
|
|
34
|
-
"--cm-code-block-language":
|
|
35
|
-
"--cm-code-block-copied":
|
|
36
|
-
"--cm-code-block-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
|
|
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__ */
|
|
41
|
-
className: t("flex min-h-10 items-center justify-between
|
|
42
|
-
children: [
|
|
43
|
-
className: t(
|
|
44
|
-
children:
|
|
45
|
-
}), !
|
|
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: [!
|
|
48
|
-
icon: /* @__PURE__ */
|
|
49
|
-
size:
|
|
50
|
-
stroke:
|
|
48
|
+
children: [!O && /* @__PURE__ */ g(f, {
|
|
49
|
+
icon: /* @__PURE__ */ g(b, {
|
|
50
|
+
size: l.SM,
|
|
51
|
+
stroke: u
|
|
51
52
|
}),
|
|
52
|
-
"aria-label":
|
|
53
|
-
size:
|
|
54
|
-
onClick:
|
|
55
|
-
}), /* @__PURE__ */
|
|
56
|
-
icon:
|
|
57
|
-
size:
|
|
58
|
-
className:
|
|
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:
|
|
61
|
-
}) : /* @__PURE__ */
|
|
62
|
-
size:
|
|
61
|
+
stroke: u
|
|
62
|
+
}) : /* @__PURE__ */ g(y, {
|
|
63
|
+
size: l.SM,
|
|
63
64
|
"aria-hidden": !0,
|
|
64
|
-
stroke:
|
|
65
|
+
stroke: u
|
|
65
66
|
}),
|
|
66
|
-
"aria-label":
|
|
67
|
-
size:
|
|
68
|
-
onClick:
|
|
67
|
+
"aria-label": T,
|
|
68
|
+
size: d.Small,
|
|
69
|
+
onClick: L
|
|
69
70
|
})]
|
|
70
71
|
})]
|
|
71
72
|
}),
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
className: t(
|
|
73
|
+
/* @__PURE__ */ g("div", {
|
|
74
|
+
className: t(s.scrollContainer, "max-h-[60vh] overflow-auto"),
|
|
74
75
|
dir: "ltr",
|
|
75
|
-
children:
|
|
76
|
-
fallback:
|
|
77
|
-
children: /* @__PURE__ */
|
|
78
|
-
language:
|
|
79
|
-
style:
|
|
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:
|
|
90
|
-
children:
|
|
90
|
+
codeTagProps: { className: j },
|
|
91
|
+
children: h
|
|
91
92
|
})
|
|
92
|
-
}) :
|
|
93
|
+
}) : B
|
|
93
94
|
}),
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ g("span", {
|
|
95
96
|
role: "status",
|
|
96
97
|
"aria-live": "polite",
|
|
97
98
|
className: "sr-only",
|
|
98
|
-
children:
|
|
99
|
+
children: I ? E : ""
|
|
99
100
|
})
|
|
100
101
|
]
|
|
101
102
|
});
|
|
102
103
|
});
|
|
103
104
|
//#endregion
|
|
104
|
-
export {
|
|
105
|
+
export { C as MarkdownCodeBlock };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
container: "
|
|
3
|
-
containerLight: "
|
|
4
|
-
header: "
|
|
5
|
-
languageLabel: "
|
|
6
|
-
copiedIcon: "
|
|
7
|
-
scrollContainer: "
|
|
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-
|
|
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 {
|
|
3
|
-
import n from "
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
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
|
|
8
|
-
let { scrollContainerRef:
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
-
ref:
|
|
11
|
-
className: e("w-full min-w-0 max-w-full overflow-x-auto overflow-y-hidden",
|
|
12
|
-
onScroll:
|
|
13
|
-
role:
|
|
14
|
-
"aria-label":
|
|
15
|
-
tabIndex:
|
|
16
|
-
children: /* @__PURE__ */
|
|
17
|
-
ref:
|
|
18
|
-
className: e("katex",
|
|
19
|
-
children:
|
|
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 {
|
|
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 {
|
|
3
|
+
import { copyMarkdownAsRichText as n } from "../../../utils/copy-to-clipboard.js";
|
|
4
4
|
import { downloadTextFile as r } from "../../../utils/file-download.js";
|
|
5
|
-
import {
|
|
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 {
|
|
11
|
-
import {
|
|
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
|
|
14
|
-
let [
|
|
15
|
-
"--cm-markdown-border":
|
|
16
|
-
"--cm-table-scrollbar":
|
|
17
|
-
"--cm-table-fade":
|
|
18
|
-
"--cm-table-row-divider":
|
|
19
|
-
"--cm-table-row-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
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
|
-
}, [
|
|
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
|
-
|
|
41
|
-
onCopy:
|
|
42
|
-
onDownloadCsv:
|
|
43
|
-
onOpenInCanvas:
|
|
44
|
-
}),
|
|
45
|
-
return /* @__PURE__ */
|
|
46
|
-
style:
|
|
47
|
-
className: e("relative w-full min-w-0 max-w-full
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
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:
|
|
89
|
+
children: k ? w.copiedLabel ?? "" : ""
|
|
72
90
|
})
|
|
73
91
|
]
|
|
74
92
|
});
|
|
75
93
|
});
|
|
76
94
|
//#endregion
|
|
77
|
-
export {
|
|
95
|
+
export { S as MarkdownTable };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
tableContainer: "
|
|
3
|
-
tableContainerLight: "
|
|
4
|
-
copiedIcon: "
|
|
5
|
-
scrollContainer: "
|
|
6
|
-
tableHeaderCell: "
|
|
7
|
-
sectionRow: "
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
tableScrollFadeEnd: "
|
|
11
|
-
tableScrollFadeStart: "
|
|
12
|
-
tableScrollFadeBoth: "
|
|
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.
|
|
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) =>
|
|
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,
|
|
6
|
+
export { t as DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME, n as MARKDOWN_TABLE_CSV_MIME_TYPE, e as MarkdownTableCopyFormat, o as serializeMarkdownTableRows };
|
package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.js
CHANGED
|
@@ -1,66 +1,52 @@
|
|
|
1
1
|
import e from "../MarkdownTable.module.scss.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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 {
|
|
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 };
|