@epam/ai-dial-chat-shared 1.2.0-dev.48 → 1.2.0-dev.50
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/Math/MarkdownMathBlock.js +19 -18
- package/components/MarkdownRenderer/Table/MarkdownTable.js +64 -63
- package/constants/public-class-names.js +10 -0
- package/index.d.ts +15 -0
- package/index.js +20 -19
- package/markdown.d.ts +13 -0
- package/markdown.js +12 -11
- package/package.json +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 rounded-xl border [overflow:clip]",
|
|
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("sticky top-0 z-10 flex min-h-10 items-center justify-between px-4",
|
|
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,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 };
|
|
@@ -2,93 +2,94 @@ import { mergeClasses as e } from "../../../utils/merge-class.js";
|
|
|
2
2
|
import { buildCssVars as t } from "../../../utils/build-css-vars.js";
|
|
3
3
|
import { copyMarkdownAsRichText as n } from "../../../utils/copy-to-clipboard.js";
|
|
4
4
|
import { downloadTextFile as r } from "../../../utils/file-download.js";
|
|
5
|
-
import {
|
|
6
|
-
import a from "
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
5
|
+
import { CHAT_SHARED_CLASS as i } from "../../../constants/public-class-names.js";
|
|
6
|
+
import { useHorizontalOverflow as a } from "../../../hooks/useHorizontalOverflow.js";
|
|
7
|
+
import o from "./MarkdownTable.module.scss.js";
|
|
8
|
+
import { MARKDOWN_TABLE_CSV_MIME_TYPE as s, MarkdownTableCopyFormat as c, serializeMarkdownTableRows as l } from "./table-serialization.js";
|
|
9
|
+
import { useMarkdownTableActions as u } from "./useMarkdownTableActions/useMarkdownTableActions.js";
|
|
10
|
+
import { ElementSize as d, GhostIconButton as f, Tooltip as p } from "@epam/ai-dial-ui-kit";
|
|
11
|
+
import { memo as m, useCallback as h, useEffect as g, useRef as _, useState as v } from "react";
|
|
12
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
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-hover-bg":
|
|
20
|
-
}),
|
|
21
|
-
|
|
22
|
-
|
|
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);
|
|
23
24
|
}, []);
|
|
24
|
-
let
|
|
25
|
-
let e =
|
|
26
|
-
e != null && n(
|
|
27
|
-
e && (
|
|
28
|
-
|
|
29
|
-
},
|
|
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));
|
|
30
31
|
});
|
|
31
|
-
}, [
|
|
32
|
-
let e =
|
|
33
|
-
e != null && r(`\uFEFF${
|
|
34
|
-
}, [
|
|
35
|
-
let e =
|
|
36
|
-
e == null ||
|
|
37
|
-
}, [
|
|
38
|
-
actionLabels:
|
|
39
|
-
isCopied:
|
|
40
|
-
onCopy:
|
|
41
|
-
onDownloadCsv:
|
|
42
|
-
onOpenInCanvas:
|
|
43
|
-
}),
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
style:
|
|
46
|
-
className: e("group/table relative w-full min-w-0 max-w-full rounded-xl border [overflow:clip]",
|
|
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),
|
|
47
48
|
children: [
|
|
48
|
-
|
|
49
|
+
U && /* @__PURE__ */ y("div", {
|
|
49
50
|
className: "sticky top-0 z-10 h-0",
|
|
50
|
-
children: /* @__PURE__ */
|
|
51
|
+
children: /* @__PURE__ */ y("div", {
|
|
51
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",
|
|
52
|
-
children:
|
|
53
|
+
children: H.map((e) => /* @__PURE__ */ y(p, {
|
|
53
54
|
tooltip: e.label,
|
|
54
55
|
asChild: !0,
|
|
55
|
-
children: /* @__PURE__ */
|
|
56
|
+
children: /* @__PURE__ */ y(f, {
|
|
56
57
|
"aria-label": e.label,
|
|
57
|
-
icon: /* @__PURE__ */
|
|
58
|
+
icon: /* @__PURE__ */ y("span", {
|
|
58
59
|
"aria-hidden": !0,
|
|
59
60
|
children: e.icon
|
|
60
61
|
}),
|
|
61
|
-
size:
|
|
62
|
+
size: d.Small,
|
|
62
63
|
onClick: e.onClick
|
|
63
64
|
})
|
|
64
65
|
}, e.label))
|
|
65
66
|
})
|
|
66
67
|
}),
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
ref:
|
|
69
|
-
className: e("w-full min-w-0 max-w-full overflow-x-auto",
|
|
70
|
-
[
|
|
71
|
-
[
|
|
72
|
-
[
|
|
73
|
-
}),
|
|
74
|
-
onScroll:
|
|
75
|
-
role:
|
|
76
|
-
"aria-label":
|
|
77
|
-
tabIndex:
|
|
78
|
-
children: /* @__PURE__ */
|
|
79
|
-
ref:
|
|
80
|
-
className: e("w-max min-w-full border-collapse",
|
|
81
|
-
children:
|
|
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
|
|
82
83
|
})
|
|
83
84
|
}),
|
|
84
|
-
|
|
85
|
+
w?.copyLabel && /* @__PURE__ */ y("span", {
|
|
85
86
|
"aria-live": "polite",
|
|
86
87
|
className: "sr-only",
|
|
87
88
|
role: "status",
|
|
88
|
-
children:
|
|
89
|
+
children: k ? w.copiedLabel ?? "" : ""
|
|
89
90
|
})
|
|
90
91
|
]
|
|
91
92
|
});
|
|
92
93
|
});
|
|
93
94
|
//#endregion
|
|
94
|
-
export {
|
|
95
|
+
export { S as MarkdownTable };
|
|
@@ -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 };
|
package/index.d.ts
CHANGED
|
@@ -221,6 +221,19 @@ export declare enum CatalogEntityType {
|
|
|
221
221
|
Prompt = "PROMPT"
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
+
export declare const CHAT_SHARED_CLASS: {
|
|
225
|
+
/** The bordered container of a fenced code block. */
|
|
226
|
+
readonly codeBlock: "dial-chat-shared-code-block";
|
|
227
|
+
/** The code block's sticky header, holding the language label and actions. */
|
|
228
|
+
readonly codeBlockHeader: "dial-chat-shared-code-block-header";
|
|
229
|
+
/** The bordered container of a Markdown table. */
|
|
230
|
+
readonly table: "dial-chat-shared-table";
|
|
231
|
+
/** The scrolling box around a Markdown table, which owns its overflow. */
|
|
232
|
+
readonly tableScroll: "dial-chat-shared-table-scroll";
|
|
233
|
+
/** The scrolling box around a display-math block. */
|
|
234
|
+
readonly mathBlock: "dial-chat-shared-math-block";
|
|
235
|
+
};
|
|
236
|
+
|
|
224
237
|
/** Color theme for syntax highlighting. */
|
|
225
238
|
export declare enum CodeBlockTheme {
|
|
226
239
|
/** Dark syntax-highlighting theme. */
|
|
@@ -323,6 +336,8 @@ export declare interface ConversationTransferJob {
|
|
|
323
336
|
* {@link ConversationTransferJobStatus.Warning}.
|
|
324
337
|
*/
|
|
325
338
|
warningCode?: ConversationTransferWarningCode;
|
|
339
|
+
/** Untranslated names of skipped attachments, when available for this warning. */
|
|
340
|
+
warningNames?: string[];
|
|
326
341
|
}
|
|
327
342
|
|
|
328
343
|
/** Lifecycle status of a queued export/import job. */
|
package/index.js
CHANGED
|
@@ -42,22 +42,23 @@ import { FeaturedChip as Me } from "./components/FeaturedChip/FeaturedChip.js";
|
|
|
42
42
|
import { EntityHeader as Ne } from "./components/EntityHeader/EntityHeader.js";
|
|
43
43
|
import { ResourceSummary as Pe } from "./components/ResourceSummary/ResourceSummary.js";
|
|
44
44
|
import { TableHeader as Fe } from "./components/MarkdownRenderer/Table/TableHeader.js";
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
|
|
45
|
+
import { CHAT_SHARED_CLASS as Ie } from "./constants/public-class-names.js";
|
|
46
|
+
import { useCodeCopy as Le } from "./hooks/useCodeCopy.js";
|
|
47
|
+
import { restrainedSyntaxTheme as Re } from "./components/MarkdownRenderer/CodeBlock/syntax-theme.js";
|
|
48
|
+
import { MarkdownCodeBlock as ze } from "./components/MarkdownRenderer/CodeBlock/CodeBlock.js";
|
|
49
|
+
import { DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME as Be, MARKDOWN_TABLE_CSV_MIME_TYPE as Ve, MarkdownTableCopyFormat as He, serializeMarkdownTableRows as Ue } from "./components/MarkdownRenderer/Table/table-serialization.js";
|
|
50
|
+
import { MarkdownTable as We } from "./components/MarkdownRenderer/Table/MarkdownTable.js";
|
|
51
|
+
import { MarkdownRenderer as Ge, defaultMarkdownComponents as Ke } from "./components/MarkdownRenderer/MarkdownRenderer.js";
|
|
52
|
+
import { COMPACT_MARKDOWN_CLASS_NAMES as qe, DEFAULT_MARKDOWN_CLASS_NAMES as Je } from "./components/MarkdownRenderer/markdown-class-names.js";
|
|
53
|
+
import { MDMessageViewer as Ye } from "./components/MarkdownRenderer/MDMessageViewer.js";
|
|
54
|
+
import { MarkdownWithPlaceholders as Xe } from "./components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.js";
|
|
55
|
+
import { useCollapsedText as Ze } from "./hooks/useCollapsedText.js";
|
|
56
|
+
import { useAvailableHeightCap as Qe } from "./hooks/useAvailableHeightCap.js";
|
|
57
|
+
import { useIsMobile as $e } from "./hooks/useIsMobile.js";
|
|
58
|
+
import { DialFileManagerActionProfile as et, DialFileManagerVariant as tt } from "./file-manager/file-manager-variant.js";
|
|
59
|
+
import { getParentFolderPath as nt, isHiddenPath as rt } from "./file-manager/path.js";
|
|
60
|
+
import { FileUploadStatus as it } from "./file-manager/upload-batch.js";
|
|
61
|
+
import { useGridEditingScroll as at } from "./file-manager/useGridEditingScroll/useGridEditingScroll.js";
|
|
62
|
+
import { OperationLoaderModal as ot } from "./file-manager/OperationLoaderModal/OperationLoaderModal.js";
|
|
63
|
+
import { UploadProgressModal as st } from "./file-manager/UploadProgressModal/UploadProgressModal.js";
|
|
64
|
+
export { f as AttachmentErrorReason, p as AttachmentType, le as BASE_LG_ICON_PROPS, ue as BASE_MD_ICON_PROPS, Ie as CHAT_SHARED_CLASS, qe as COMPACT_MARKDOWN_CLASS_NAMES, m as CatalogEntityType, _ as CodeBlockTheme, e as ConversationTransferErrorCode, t as ConversationTransferJobStatus, n as ConversationTransferSubjectKind, r as ConversationTransferUnitKind, i as ConversationTransferWarningCode, De as CopyButton, Oe as CopyIconButton, Je as DEFAULT_MARKDOWN_CLASS_NAMES, Be as DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME, ye as DESKTOP_BREAKPOINT_PX, be as DESKTOP_MEDIA_QUERY, Ee as DeploymentIcon, et as DialFileManagerActionProfile, tt as DialFileManagerVariant, $ as ENTITY_TYPE_BG_COLOR, ee as ENTITY_TYPE_COLOR, Ne as EntityHeader, je as EntityTypeLabel, Me as FeaturedChip, h as FileExtension, it as FileUploadStatus, a as FilterTab, de as HIDDEN_FILE, Te as InitialsAvatar, Ae as ItemHeader, pe as MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME, ge as MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME, Ve as MARKDOWN_TABLE_CSV_MIME_TYPE, Ye as MDMessageViewer, g as MIMEType, P as MIME_TYPE_AUDIO_PREFIX, F as MIME_TYPE_EXT_MAP, I as MIME_TYPE_WILDCARD, xe as MOBILE_MAX_WIDTH_PX, Se as MOBILE_MEDIA_QUERY, ze as MarkdownCodeBlock, Ge as MarkdownRenderer, We as MarkdownTable, He as MarkdownTableCopyFormat, Xe as MarkdownWithPlaceholders, o as MessageRating, s as MessageRole, ot as OperationLoaderModal, w as PROHIBITED_CONVERSATION_NAME_CHARS_RE, te as PROMPT_PARAM_DEFAULT_SEPARATOR, ne as PROMPT_PARAM_PATTERN, re as PROMPT_VARIABLE_CLASS_NAME, ke as PanelEmptyState, me as RESIZABLE_FIELD_MAX_HEIGHT_CSS_VARIABLE, he as RESIZABLE_TEXTAREA_CLASS_NAME, c as RequestStatus, Pe as ResourceSummary, d as ResponseFormat, _e as SELECT_LIST_MAX_HEIGHT_CLASS_NAME, ve as SELECT_LIST_MAX_HEIGHT_PX, l as StageStatus, u as StatusEvent, fe as TAG_INPUT_TAG_CLASS_NAME, Fe as TableHeader, st as UploadProgressModal, K as base64ToBlob, A as buildCssVars, ie as buildPromptParamDefaults, R as copyMarkdownAsRichText, z as copyToClipboard, Ke as defaultMarkdownComponents, q as downloadTextFile, J as ensureDownloadFilename, we as extractInitials, ae as extractPromptParams, U as formatCost, H as formatFileSize, V as formatLastUsed, W as formatPrice, G as formatUnitPrice, ce as generateUUID, v as getAttachmentTypeFromMime, Y as getFileExtensionForLanguage, nt as getParentFolderPath, T as getUtf8ByteLength, y as inferMimeTypeFromPath, x as isAnnotationSelector, L as isAudioTranscriptionSupported, rt as isHiddenPath, j as isStatusMessage, B as markdownToRichTextHtml, k as mergeClasses, M as messageAttachmentToDisplayAttachment, N as messageAttachmentsToDisplayAttachments, S as normalizePersistedHtmlTagAttachmentType, C as normalizeRawAnnotations, Ce as pickAvatarColor, oe as rehypePromptVariables, se as resolvePromptParams, Re as restrainedSyntaxTheme, E as sanitizeConversationName, Ue as serializeMarkdownTableRows, D as stripTrailingDots, b as stripUrlQueryAndFragment, X as triggerAnchorDownload, Z as triggerBlobDownload, O as truncateToUtf8Bytes, Q as tryBase64ToBytes, Qe as useAvailableHeightCap, Le as useCodeCopy, Ze as useCollapsedText, at as useGridEditingScroll, $e as useIsMobile };
|
package/markdown.d.ts
CHANGED
|
@@ -4,6 +4,19 @@ import { FC } from 'react';
|
|
|
4
4
|
import { Options } from 'react-markdown';
|
|
5
5
|
import { ReactNode } from 'react';
|
|
6
6
|
|
|
7
|
+
export declare const CHAT_SHARED_CLASS: {
|
|
8
|
+
/** The bordered container of a fenced code block. */
|
|
9
|
+
readonly codeBlock: "dial-chat-shared-code-block";
|
|
10
|
+
/** The code block's sticky header, holding the language label and actions. */
|
|
11
|
+
readonly codeBlockHeader: "dial-chat-shared-code-block-header";
|
|
12
|
+
/** The bordered container of a Markdown table. */
|
|
13
|
+
readonly table: "dial-chat-shared-table";
|
|
14
|
+
/** The scrolling box around a Markdown table, which owns its overflow. */
|
|
15
|
+
readonly tableScroll: "dial-chat-shared-table-scroll";
|
|
16
|
+
/** The scrolling box around a display-math block. */
|
|
17
|
+
readonly mathBlock: "dial-chat-shared-math-block";
|
|
18
|
+
};
|
|
19
|
+
|
|
7
20
|
/** Color theme for syntax highlighting. */
|
|
8
21
|
declare enum CodeBlockTheme {
|
|
9
22
|
/** Dark syntax-highlighting theme. */
|
package/markdown.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
1
|
+
import { CHAT_SHARED_CLASS as e } from "./constants/public-class-names.js";
|
|
2
|
+
import { useCodeCopy as t } from "./hooks/useCodeCopy.js";
|
|
3
|
+
import { restrainedSyntaxTheme as n } from "./components/MarkdownRenderer/CodeBlock/syntax-theme.js";
|
|
4
|
+
import { MarkdownCodeBlock as r } from "./components/MarkdownRenderer/CodeBlock/CodeBlock.js";
|
|
5
|
+
import { DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME as i, MARKDOWN_TABLE_CSV_MIME_TYPE as a, MarkdownTableCopyFormat as o, serializeMarkdownTableRows as s } from "./components/MarkdownRenderer/Table/table-serialization.js";
|
|
6
|
+
import { MarkdownTable as c } from "./components/MarkdownRenderer/Table/MarkdownTable.js";
|
|
7
|
+
import { MarkdownRenderer as l, defaultMarkdownComponents as u } from "./components/MarkdownRenderer/MarkdownRenderer.js";
|
|
8
|
+
import { COMPACT_MARKDOWN_CLASS_NAMES as d, DEFAULT_MARKDOWN_CLASS_NAMES as f } from "./components/MarkdownRenderer/markdown-class-names.js";
|
|
9
|
+
import { MDMessageViewer as p } from "./components/MarkdownRenderer/MDMessageViewer.js";
|
|
10
|
+
import { MarkdownWithPlaceholders as m } from "./components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.js";
|
|
11
|
+
import { useCollapsedText as h } from "./hooks/useCollapsedText.js";
|
|
12
|
+
export { e as CHAT_SHARED_CLASS, d as COMPACT_MARKDOWN_CLASS_NAMES, f as DEFAULT_MARKDOWN_CLASS_NAMES, i as DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME, a as MARKDOWN_TABLE_CSV_MIME_TYPE, p as MDMessageViewer, r as MarkdownCodeBlock, l as MarkdownRenderer, c as MarkdownTable, o as MarkdownTableCopyFormat, m as MarkdownWithPlaceholders, u as defaultMarkdownComponents, n as restrainedSyntaxTheme, s as serializeMarkdownTableRows, t as useCodeCopy, h as useCollapsedText };
|
package/package.json
CHANGED