@epam/ai-dial-chat-shared 1.3.0-dev.5 → 1.3.0-dev.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ConfirmationDialog/ConfirmationDialog.d.ts +41 -0
- package/components/ConfirmationDialog/ConfirmationDialog.d.ts.map +1 -0
- package/components/ConfirmationIdentityCard/ConfirmationIdentityCard.d.ts +33 -0
- package/components/ConfirmationIdentityCard/ConfirmationIdentityCard.d.ts.map +1 -0
- package/components/ConfirmationIdentityRow/ConfirmationIdentityRow.d.ts +33 -0
- package/components/ConfirmationIdentityRow/ConfirmationIdentityRow.d.ts.map +1 -0
- package/components/ConfirmationView/ConfirmationFooter.d.ts +41 -0
- package/components/ConfirmationView/ConfirmationFooter.d.ts.map +1 -0
- package/components/ConfirmationView/ConfirmationFooter.js +3 -1
- package/components/ConfirmationView/ConfirmationView.d.ts +57 -0
- package/components/ConfirmationView/ConfirmationView.d.ts.map +1 -0
- package/components/ConfirmationView/ConfirmationView.js +15 -14
- package/components/CopyButton/CopyButton.d.ts +19 -0
- package/components/CopyButton/CopyButton.d.ts.map +1 -0
- package/components/DeleteConfirmationDialog/DeleteConfirmationDialog.d.ts +41 -0
- package/components/DeleteConfirmationDialog/DeleteConfirmationDialog.d.ts.map +1 -0
- package/components/DeleteConfirmationDialog/DeleteConfirmationDialog.js +34 -0
- package/components/DeleteConfirmationView/DeleteConfirmationView.d.ts +49 -0
- package/components/DeleteConfirmationView/DeleteConfirmationView.d.ts.map +1 -0
- package/components/DeleteConfirmationView/DeleteConfirmationView.js +37 -0
- package/components/DeleteConfirmationView/DeleteConfirmationView.module.scss.js +6 -0
- package/components/DeploymentIcon/DeploymentIcon.d.ts +36 -0
- package/components/DeploymentIcon/DeploymentIcon.d.ts.map +1 -0
- package/components/EntityHeader/EntityHeader.d.ts +38 -0
- package/components/EntityHeader/EntityHeader.d.ts.map +1 -0
- package/components/EntityTypeLabel/EntityTypeLabel.d.ts +18 -0
- package/components/EntityTypeLabel/EntityTypeLabel.d.ts.map +1 -0
- package/components/FeaturedChip/FeaturedChip.d.ts +16 -0
- package/components/FeaturedChip/FeaturedChip.d.ts.map +1 -0
- package/components/InitialsAvatar/InitialsAvatar.d.ts +15 -0
- package/components/InitialsAvatar/InitialsAvatar.d.ts.map +1 -0
- package/components/ItemHeader/ItemHeader.d.ts +36 -0
- package/components/ItemHeader/ItemHeader.d.ts.map +1 -0
- package/components/MarkdownRenderer/CodeBlock/CodeBlock.d.ts +53 -0
- package/components/MarkdownRenderer/CodeBlock/CodeBlock.d.ts.map +1 -0
- package/components/MarkdownRenderer/CodeBlock/syntax-theme.d.ts +7 -0
- package/components/MarkdownRenderer/CodeBlock/syntax-theme.d.ts.map +1 -0
- package/components/MarkdownRenderer/MDMessageViewer.d.ts +66 -0
- package/components/MarkdownRenderer/MDMessageViewer.d.ts.map +1 -0
- package/components/MarkdownRenderer/MDMessageViewer.js +14 -12
- package/components/MarkdownRenderer/MarkdownRenderer.d.ts +139 -0
- package/components/MarkdownRenderer/MarkdownRenderer.d.ts.map +1 -0
- package/components/MarkdownRenderer/MarkdownRenderer.js +136 -129
- package/components/MarkdownRenderer/Math/MarkdownMathBlock.d.ts +18 -0
- package/components/MarkdownRenderer/Math/MarkdownMathBlock.d.ts.map +1 -0
- package/components/MarkdownRenderer/PlainTextRenderer.d.ts +39 -0
- package/components/MarkdownRenderer/PlainTextRenderer.d.ts.map +1 -0
- package/components/MarkdownRenderer/Table/MarkdownTable.d.ts +47 -0
- package/components/MarkdownRenderer/Table/MarkdownTable.d.ts.map +1 -0
- package/components/MarkdownRenderer/Table/TableHeader.d.ts +22 -0
- package/components/MarkdownRenderer/Table/TableHeader.d.ts.map +1 -0
- package/components/MarkdownRenderer/Table/table-serialization.d.ts +16 -0
- package/components/MarkdownRenderer/Table/table-serialization.d.ts.map +1 -0
- package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.d.ts +27 -0
- package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.d.ts.map +1 -0
- package/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.d.ts +9 -0
- package/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.d.ts.map +1 -0
- package/components/MarkdownRenderer/ThinkingShimmer.d.ts +17 -0
- package/components/MarkdownRenderer/ThinkingShimmer.d.ts.map +1 -0
- package/components/MarkdownRenderer/markdown-class-names.d.ts +10 -0
- package/components/MarkdownRenderer/markdown-class-names.d.ts.map +1 -0
- package/components/MarkdownRenderer/markdown-whitespace.d.ts +15 -0
- package/components/MarkdownRenderer/markdown-whitespace.d.ts.map +1 -0
- package/components/MarkdownRenderer/markdown-whitespace.js +18 -0
- package/components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.d.ts +25 -0
- package/components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.d.ts.map +1 -0
- package/components/PanelEmptyState/PanelEmptyState.d.ts +22 -0
- package/components/PanelEmptyState/PanelEmptyState.d.ts.map +1 -0
- package/components/ResourceSummary/ResourceSummary.d.ts +49 -0
- package/components/ResourceSummary/ResourceSummary.d.ts.map +1 -0
- package/components/TextRefinementField/TextRefinementField.d.ts +31 -0
- package/components/TextRefinementField/TextRefinementField.d.ts.map +1 -0
- package/constants/breakpoint.d.ts +9 -0
- package/constants/breakpoint.d.ts.map +1 -0
- package/constants/dial.d.ts +5 -0
- package/constants/dial.d.ts.map +1 -0
- package/constants/entity-colors.d.ts +6 -0
- package/constants/entity-colors.d.ts.map +1 -0
- package/constants/icon.d.ts +14 -0
- package/constants/icon.d.ts.map +1 -0
- package/constants/markdown-editor.d.ts +2 -0
- package/constants/markdown-editor.d.ts.map +1 -0
- package/constants/mime-types.d.ts +27 -0
- package/constants/mime-types.d.ts.map +1 -0
- package/constants/public-class-names.d.ts +13 -0
- package/constants/public-class-names.d.ts.map +1 -0
- package/constants/resizable-fields.d.ts +5 -0
- package/constants/resizable-fields.d.ts.map +1 -0
- package/constants/select-list.d.ts +4 -0
- package/constants/select-list.d.ts.map +1 -0
- package/constants/tag-input.d.ts +2 -0
- package/constants/tag-input.d.ts.map +1 -0
- package/entry-points/file-manager.d.ts +5 -0
- package/entry-points/file-manager.d.ts.map +1 -0
- package/entry-points/markdown.d.ts +19 -0
- package/entry-points/markdown.d.ts.map +1 -0
- package/file-manager/DialFileManagerShell/DialFileManagerShell.d.ts +52 -0
- package/file-manager/DialFileManagerShell/DialFileManagerShell.d.ts.map +1 -0
- package/file-manager/DialFileManagerShell/DialFileManagerShell.js +128 -120
- package/file-manager/FileManagerAttachModal/FileManagerAttachModal.d.ts +89 -0
- package/file-manager/FileManagerAttachModal/FileManagerAttachModal.d.ts.map +1 -0
- package/file-manager/FileManagerAttachModal/FileManagerAttachModal.js +2 -1
- package/file-manager/OperationLoaderModal/OperationLoaderModal.d.ts +17 -0
- package/file-manager/OperationLoaderModal/OperationLoaderModal.d.ts.map +1 -0
- package/file-manager/attach-result.d.ts +9 -0
- package/file-manager/attach-result.d.ts.map +1 -0
- package/file-manager/file-manager-controller.d.ts +121 -0
- package/file-manager/file-manager-controller.d.ts.map +1 -0
- package/file-manager/file-manager-variant.d.ts +21 -0
- package/file-manager/file-manager-variant.d.ts.map +1 -0
- package/file-manager/file-upload-validation.d.ts +8 -0
- package/file-manager/file-upload-validation.d.ts.map +1 -0
- package/file-manager/index.d.ts +10 -0
- package/file-manager/index.d.ts.map +1 -0
- package/file-manager/labels.d.ts +156 -0
- package/file-manager/labels.d.ts.map +1 -0
- package/file-manager/path.d.ts +12 -0
- package/file-manager/path.d.ts.map +1 -0
- package/file-manager/upload-batch.d.ts +29 -0
- package/file-manager/upload-batch.d.ts.map +1 -0
- package/file-manager/upload-queue.d.ts +5 -0
- package/file-manager/upload-queue.d.ts.map +1 -0
- package/file-manager/useGridEditingScroll/useGridEditingScroll.d.ts +27 -0
- package/file-manager/useGridEditingScroll/useGridEditingScroll.d.ts.map +1 -0
- package/file-manager.d.ts +2 -506
- package/hooks/useAvailableHeightCap.d.ts +30 -0
- package/hooks/useAvailableHeightCap.d.ts.map +1 -0
- package/hooks/useCodeCopy.d.ts +6 -0
- package/hooks/useCodeCopy.d.ts.map +1 -0
- package/hooks/useCollapsedText.d.ts +27 -0
- package/hooks/useCollapsedText.d.ts.map +1 -0
- package/hooks/useHorizontalOverflow.d.ts +21 -0
- package/hooks/useHorizontalOverflow.d.ts.map +1 -0
- package/hooks/useIsMobile.d.ts +3 -0
- package/hooks/useIsMobile.d.ts.map +1 -0
- package/hooks/useStreamedMarkdownContent.d.ts +3 -0
- package/hooks/useStreamedMarkdownContent.d.ts.map +1 -0
- package/hooks/useTextRefinement.d.ts +44 -0
- package/hooks/useTextRefinement.d.ts.map +1 -0
- package/hooks/useUnsavedChangesGuard.d.ts +14 -0
- package/hooks/useUnsavedChangesGuard.d.ts.map +1 -0
- package/index.css +2 -2
- package/index.d.ts +78 -3072
- package/index.d.ts.map +1 -0
- package/index.js +28 -25
- package/markdown.d.ts +2 -465
- package/markdown.js +3 -2
- package/models/annotation.d.ts +143 -0
- package/models/annotation.d.ts.map +1 -0
- package/models/application-visualizer.d.ts +67 -0
- package/models/application-visualizer.d.ts.map +1 -0
- package/models/auth.d.ts +26 -0
- package/models/auth.d.ts.map +1 -0
- package/models/chat.d.ts +407 -0
- package/models/chat.d.ts.map +1 -0
- package/models/conversation-classification.d.ts +9 -0
- package/models/conversation-classification.d.ts.map +1 -0
- package/models/conversation-transfer.d.ts +96 -0
- package/models/conversation-transfer.d.ts.map +1 -0
- package/models/custom-visualizer.d.ts +61 -0
- package/models/custom-visualizer.d.ts.map +1 -0
- package/models/deployment-configuration.d.ts +55 -0
- package/models/deployment-configuration.d.ts.map +1 -0
- package/models/deployment-features.d.ts +17 -0
- package/models/deployment-features.d.ts.map +1 -0
- package/models/deployment.d.ts +31 -0
- package/models/deployment.d.ts.map +1 -0
- package/models/dial-model.d.ts +19 -0
- package/models/dial-model.d.ts.map +1 -0
- package/models/entity.d.ts +15 -0
- package/models/entity.d.ts.map +1 -0
- package/models/import-export.d.ts +23 -0
- package/models/import-export.d.ts.map +1 -0
- package/models/inline-segment.d.ts +11 -0
- package/models/inline-segment.d.ts.map +1 -0
- package/models/locale.d.ts +19 -0
- package/models/locale.d.ts.map +1 -0
- package/models/text-refinement.d.ts +18 -0
- package/models/text-refinement.d.ts.map +1 -0
- package/models/theme.d.ts +36 -0
- package/models/theme.d.ts.map +1 -0
- package/models/tool-menu-item.d.ts +13 -0
- package/models/tool-menu-item.d.ts.map +1 -0
- package/package.json +3 -3
- package/types/attachment.d.ts +25 -0
- package/types/attachment.d.ts.map +1 -0
- package/types/code-editor.d.ts +8 -0
- package/types/code-editor.d.ts.map +1 -0
- package/types/entity-type.d.ts +10 -0
- package/types/entity-type.d.ts.map +1 -0
- package/types/file-manager-node.d.ts +17 -0
- package/types/file-manager-node.d.ts.map +1 -0
- package/types/mime-type.d.ts +59 -0
- package/types/mime-type.d.ts.map +1 -0
- package/utils/annotation.d.ts +29 -0
- package/utils/annotation.d.ts.map +1 -0
- package/utils/avatar-color.d.ts +10 -0
- package/utils/avatar-color.d.ts.map +1 -0
- package/utils/build-css-vars.d.ts +4 -0
- package/utils/build-css-vars.d.ts.map +1 -0
- package/utils/copy-to-clipboard.d.ts +18 -0
- package/utils/copy-to-clipboard.d.ts.map +1 -0
- package/utils/entity-field-limits.d.ts +11 -0
- package/utils/entity-field-limits.d.ts.map +1 -0
- package/utils/entity-type.d.ts +5 -0
- package/utils/entity-type.d.ts.map +1 -0
- package/utils/file-download.d.ts +21 -0
- package/utils/file-download.d.ts.map +1 -0
- package/utils/format-file-size.d.ts +3 -0
- package/utils/format-file-size.d.ts.map +1 -0
- package/utils/format-last-used.d.ts +3 -0
- package/utils/format-last-used.d.ts.map +1 -0
- package/utils/format-price.d.ts +7 -0
- package/utils/format-price.d.ts.map +1 -0
- package/utils/generate-uuid.d.ts +3 -0
- package/utils/generate-uuid.d.ts.map +1 -0
- package/utils/initials.d.ts +3 -0
- package/utils/initials.d.ts.map +1 -0
- package/utils/inline-segments.d.ts +38 -0
- package/utils/inline-segments.d.ts.map +1 -0
- package/utils/inline-segments.js +53 -0
- package/utils/is-audio-transcription-supported.d.ts +3 -0
- package/utils/is-audio-transcription-supported.d.ts.map +1 -0
- package/utils/is-skill-selection-unsupported.d.ts +3 -0
- package/utils/is-skill-selection-unsupported.d.ts.map +1 -0
- package/utils/latex.d.ts +21 -0
- package/utils/latex.d.ts.map +1 -0
- package/utils/markdown-html.d.ts +14 -0
- package/utils/markdown-html.d.ts.map +1 -0
- package/utils/markdown-html.js +11 -0
- package/utils/merge-class.d.ts +4 -0
- package/utils/merge-class.d.ts.map +1 -0
- package/utils/message-attachment-to-display.d.ts +22 -0
- package/utils/message-attachment-to-display.d.ts.map +1 -0
- package/utils/message.d.ts +4 -0
- package/utils/message.d.ts.map +1 -0
- package/utils/mime-type.d.ts +22 -0
- package/utils/mime-type.d.ts.map +1 -0
- package/utils/prompt-variables.d.ts +62 -0
- package/utils/prompt-variables.d.ts.map +1 -0
- package/utils/string-utils.d.ts +11 -0
- package/utils/string-utils.d.ts.map +1 -0
- package/utils/syntax-highlighting.d.ts +8 -0
- package/utils/syntax-highlighting.d.ts.map +1 -0
|
@@ -2,27 +2,29 @@ import { mergeClasses as e } from "../../utils/merge-class.js";
|
|
|
2
2
|
import { buildCssVars as t } from "../../utils/build-css-vars.js";
|
|
3
3
|
import { useStreamedMarkdownContent as n } from "../../hooks/useStreamedMarkdownContent.js";
|
|
4
4
|
import { preprocessLaTeX as r } from "../../utils/latex.js";
|
|
5
|
-
import {
|
|
6
|
-
import a from "./
|
|
7
|
-
import {
|
|
8
|
-
import s from "./
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import d from "
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import T from "
|
|
5
|
+
import { rehypeRawAsText as i } from "../../utils/markdown-html.js";
|
|
6
|
+
import { MarkdownCodeBlock as a } from "./CodeBlock/CodeBlock.js";
|
|
7
|
+
import { rehypePreserveSpaces as o } from "./markdown-whitespace.js";
|
|
8
|
+
import s from "./MarkdownRenderer.module.scss.js";
|
|
9
|
+
import { MarkdownMathBlock as c } from "./Math/MarkdownMathBlock.js";
|
|
10
|
+
import l from "./Table/MarkdownTable.module.scss.js";
|
|
11
|
+
import { MarkdownTable as u } from "./Table/MarkdownTable.js";
|
|
12
|
+
import { MarkdownTaskCheckbox as d } from "./TaskCheckbox/MarkdownTaskCheckbox.js";
|
|
13
|
+
import { ThinkingShimmer as f } from "./ThinkingShimmer.js";
|
|
14
|
+
import p from "remark-gfm";
|
|
15
|
+
import { memo as m, useEffect as h, useMemo as g, useState as _ } from "react";
|
|
16
|
+
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
17
|
+
import x, { defaultUrlTransform as S } from "react-markdown";
|
|
18
|
+
import C from "rehype-raw";
|
|
19
|
+
import w, { defaultSchema as T } from "rehype-sanitize";
|
|
20
|
+
import E from "remark-breaks";
|
|
21
|
+
import D from "remark-math";
|
|
20
22
|
//#region src/components/MarkdownRenderer/MarkdownRenderer.tsx
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
[
|
|
25
|
-
],
|
|
23
|
+
var O = [
|
|
24
|
+
p,
|
|
25
|
+
E,
|
|
26
|
+
[D, { singleDollarTextMath: !1 }]
|
|
27
|
+
], k = /* @__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("."), A = {
|
|
26
28
|
math: ["display", "xmlns"],
|
|
27
29
|
annotation: ["encoding"],
|
|
28
30
|
mfrac: ["linethickness"],
|
|
@@ -51,231 +53,236 @@ var E = [
|
|
|
51
53
|
"width"
|
|
52
54
|
],
|
|
53
55
|
mtd: ["width"]
|
|
54
|
-
},
|
|
55
|
-
...
|
|
56
|
+
}, j = [C], M = [i], N = [w, {
|
|
57
|
+
...T,
|
|
56
58
|
tagNames: [
|
|
57
|
-
...
|
|
58
|
-
...
|
|
59
|
+
...T.tagNames ?? [],
|
|
60
|
+
...k,
|
|
59
61
|
"cit"
|
|
60
62
|
],
|
|
61
63
|
attributes: {
|
|
62
|
-
...
|
|
63
|
-
...
|
|
64
|
-
code: [...
|
|
64
|
+
...T.attributes,
|
|
65
|
+
...A,
|
|
66
|
+
code: [...T.attributes?.code ?? [], ["className"]],
|
|
65
67
|
cit: ["dataId"],
|
|
66
|
-
span: [...
|
|
68
|
+
span: [...T.attributes?.span ?? [], [
|
|
67
69
|
"className",
|
|
68
70
|
"katex",
|
|
69
71
|
"katex-error"
|
|
70
72
|
]]
|
|
71
73
|
}
|
|
72
|
-
}],
|
|
73
|
-
li: ({ children: e }) => /* @__PURE__ */
|
|
74
|
+
}], P = [], F = /\$\$|\\\(|\\\[/, I = (e) => F.test(e), L = {}, R = (e) => e == null ? S : (t) => S(e(t)), z = {
|
|
75
|
+
li: ({ children: e }) => /* @__PURE__ */ y("li", {
|
|
74
76
|
className: "mb-1.5 last:mb-0",
|
|
75
77
|
children: e
|
|
76
78
|
}),
|
|
77
|
-
cit: ({ children: e, ...t }) => /* @__PURE__ */ v
|
|
79
|
+
cit: ({ children: e, ...t }) => /* @__PURE__ */ b(v, { children: [
|
|
78
80
|
t["data-id"] == null ? "<cit>" : `<cit data-id="${t["data-id"]}">`,
|
|
79
81
|
e,
|
|
80
82
|
"</cit>"
|
|
81
83
|
] })
|
|
82
|
-
},
|
|
84
|
+
}, B = (e) => {
|
|
83
85
|
let t = e?.properties?.className;
|
|
84
86
|
return !Array.isArray(t) || !t.includes("katex") ? !1 : (e?.children ?? []).some((e) => e.type === "element" && e.tagName === "math" && e.properties?.display === "block");
|
|
85
|
-
},
|
|
87
|
+
}, V = {
|
|
86
88
|
left: "text-start",
|
|
87
89
|
center: "text-center",
|
|
88
90
|
right: "text-end"
|
|
89
|
-
},
|
|
91
|
+
}, H = (e) => {
|
|
90
92
|
let t = e?.properties?.align;
|
|
91
|
-
return typeof t == "string" ?
|
|
92
|
-
},
|
|
93
|
-
h1: ({ children: e }) => /* @__PURE__ */
|
|
93
|
+
return typeof t == "string" ? V[t] : void 0;
|
|
94
|
+
}, U = (e) => e ? e.type === "text" ? e.value ?? "" : (e.children ?? []).map(U).join("") : "", W = (t, { isStreaming: n, codeBlockCopyLabel: r, codeBlockCopiedLabel: i, codeBlockDownloadLabel: o, codeBlockTheme: f, tableActionLabels: p, tableDownloadFilename: m, tableOnOpenInCanvas: h, tableScrollRegionAriaLabel: g, mathScrollRegionAriaLabel: _ }) => ({
|
|
95
|
+
h1: ({ children: e }) => /* @__PURE__ */ y("h1", {
|
|
94
96
|
className: t.h1,
|
|
95
97
|
children: e
|
|
96
98
|
}),
|
|
97
|
-
h2: ({ children: e }) => /* @__PURE__ */
|
|
99
|
+
h2: ({ children: e }) => /* @__PURE__ */ y("h2", {
|
|
98
100
|
className: t.h2,
|
|
99
101
|
children: e
|
|
100
102
|
}),
|
|
101
|
-
h3: ({ children: e }) => /* @__PURE__ */
|
|
103
|
+
h3: ({ children: e }) => /* @__PURE__ */ y("h3", {
|
|
102
104
|
className: t.h3,
|
|
103
105
|
children: e
|
|
104
106
|
}),
|
|
105
|
-
h4: ({ children: e }) => /* @__PURE__ */
|
|
107
|
+
h4: ({ children: e }) => /* @__PURE__ */ y("h4", {
|
|
106
108
|
className: t.h4,
|
|
107
109
|
children: e
|
|
108
110
|
}),
|
|
109
|
-
h5: ({ children: e }) => /* @__PURE__ */
|
|
111
|
+
h5: ({ children: e }) => /* @__PURE__ */ y("h5", {
|
|
110
112
|
className: t.h5,
|
|
111
113
|
children: e
|
|
112
114
|
}),
|
|
113
|
-
h6: ({ children: n }) => /* @__PURE__ */
|
|
114
|
-
className: e(
|
|
115
|
+
h6: ({ children: n }) => /* @__PURE__ */ y("h6", {
|
|
116
|
+
className: e(s.h6, t.h6),
|
|
115
117
|
children: n
|
|
116
118
|
}),
|
|
117
|
-
p: ({ children: n }) => /* @__PURE__ */
|
|
119
|
+
p: ({ children: n }) => /* @__PURE__ */ y("p", {
|
|
118
120
|
className: e("break-words", t.p),
|
|
119
121
|
children: n
|
|
120
122
|
}),
|
|
121
|
-
ul: ({ children: n }) => /* @__PURE__ */
|
|
123
|
+
ul: ({ children: n }) => /* @__PURE__ */ y("ul", {
|
|
122
124
|
className: e("list-disc ps-[2em]", t.ul),
|
|
123
125
|
children: n
|
|
124
126
|
}),
|
|
125
|
-
ol: ({ children: n }) => /* @__PURE__ */
|
|
127
|
+
ol: ({ children: n }) => /* @__PURE__ */ y("ol", {
|
|
126
128
|
className: e("list-decimal ps-[2em]", t.ol),
|
|
127
129
|
children: n
|
|
128
130
|
}),
|
|
129
|
-
strong: ({ children: e }) => /* @__PURE__ */
|
|
131
|
+
strong: ({ children: e }) => /* @__PURE__ */ y("strong", {
|
|
130
132
|
className: t.strong ?? "dial-body-paragraph-semi-text",
|
|
131
133
|
children: e
|
|
132
134
|
}),
|
|
133
|
-
em: ({ children: e }) => /* @__PURE__ */
|
|
135
|
+
em: ({ children: e }) => /* @__PURE__ */ y("em", {
|
|
134
136
|
className: t.em ?? "italic",
|
|
135
137
|
children: e
|
|
136
138
|
}),
|
|
137
|
-
pre: ({ children: e }) => /* @__PURE__ */
|
|
138
|
-
code: ({ children:
|
|
139
|
-
let
|
|
140
|
-
return
|
|
141
|
-
language:
|
|
142
|
-
value:
|
|
139
|
+
pre: ({ children: e }) => /* @__PURE__ */ y(v, { children: e }),
|
|
140
|
+
code: ({ children: c, className: l }) => {
|
|
141
|
+
let u = /language-(\w+)/.exec(l ?? "")?.[1] ?? "", d = String(c);
|
|
142
|
+
return u || d.includes("\n") ? /* @__PURE__ */ y(a, {
|
|
143
|
+
language: u,
|
|
144
|
+
value: d.replace(/\n$/, ""),
|
|
143
145
|
isStreaming: n,
|
|
144
146
|
theme: f,
|
|
145
147
|
copyLabel: r,
|
|
146
|
-
copiedLabel:
|
|
147
|
-
downloadLabel:
|
|
148
|
+
copiedLabel: i,
|
|
149
|
+
downloadLabel: o,
|
|
148
150
|
containerClassName: t.codeBlockContainer,
|
|
149
151
|
headerClassName: t.codeBlockHeader,
|
|
150
152
|
codeClassName: t.codeFont
|
|
151
|
-
}) : /* @__PURE__ */
|
|
152
|
-
className: e("rounded px-1 py-0.5",
|
|
153
|
-
children:
|
|
153
|
+
}) : /* @__PURE__ */ y("code", {
|
|
154
|
+
className: e("rounded px-1 py-0.5", s.codeInline, t.codeInlineFont ?? "dial-code-text", t.codeInline),
|
|
155
|
+
children: c
|
|
154
156
|
});
|
|
155
157
|
},
|
|
156
|
-
blockquote: ({ children: n }) => /* @__PURE__ */
|
|
157
|
-
className: e("border-s-2 py-1 ps-4",
|
|
158
|
+
blockquote: ({ children: n }) => /* @__PURE__ */ y("blockquote", {
|
|
159
|
+
className: e("border-s-2 py-1 ps-4", s.blockquote, t.blockquote),
|
|
158
160
|
children: n
|
|
159
161
|
}),
|
|
160
|
-
a: ({ href: n, children: r }) => /* @__PURE__ */
|
|
162
|
+
a: ({ href: n, children: r }) => /* @__PURE__ */ y("a", {
|
|
161
163
|
href: n,
|
|
162
164
|
target: "_blank",
|
|
163
165
|
rel: "noopener noreferrer",
|
|
164
|
-
className: e("decoration-current/60 break-words underline underline-offset-2 hover:decoration-current focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2",
|
|
166
|
+
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", s.link, t.link),
|
|
165
167
|
children: r
|
|
166
168
|
}),
|
|
167
|
-
hr: () => /* @__PURE__ */
|
|
168
|
-
del: ({ children: n }) => /* @__PURE__ */
|
|
169
|
+
hr: () => /* @__PURE__ */ y("hr", { className: e("my-5 border-t", s.secondaryBorder, t.hr) }),
|
|
170
|
+
del: ({ children: n }) => /* @__PURE__ */ y("del", {
|
|
169
171
|
className: e("opacity-75", t.del),
|
|
170
172
|
children: n
|
|
171
173
|
}),
|
|
172
|
-
input: ({ type: e, checked: t }) => e === "checkbox" ? /* @__PURE__ */
|
|
173
|
-
span: ({ children: e, node: n, ...r }) =>
|
|
174
|
+
input: ({ type: e, checked: t }) => e === "checkbox" ? /* @__PURE__ */ y(d, { checked: t ?? !1 }) : null,
|
|
175
|
+
span: ({ children: e, node: n, ...r }) => B(n) ? /* @__PURE__ */ y(c, {
|
|
174
176
|
className: t.mathBlock,
|
|
175
|
-
scrollRegionAriaLabel:
|
|
177
|
+
scrollRegionAriaLabel: _,
|
|
176
178
|
children: e
|
|
177
|
-
}) : /* @__PURE__ */
|
|
179
|
+
}) : /* @__PURE__ */ y("span", {
|
|
178
180
|
...r,
|
|
179
181
|
children: e
|
|
180
182
|
}),
|
|
181
|
-
table: ({ children: e }) => /* @__PURE__ */
|
|
183
|
+
table: ({ children: e }) => /* @__PURE__ */ y(u, {
|
|
182
184
|
classNames: t,
|
|
183
185
|
actionLabels: p,
|
|
184
186
|
downloadFilename: m,
|
|
185
187
|
onOpenInCanvas: h,
|
|
186
188
|
isStreaming: n,
|
|
187
|
-
scrollRegionAriaLabel:
|
|
189
|
+
scrollRegionAriaLabel: g,
|
|
188
190
|
children: e
|
|
189
191
|
}),
|
|
190
192
|
tr: ({ children: t, node: n }) => {
|
|
191
|
-
let r = n?.children.filter((e) => e.type === "element") ?? [], i = r.some((e) => e.tagName === "th"), a = r.filter((e) =>
|
|
192
|
-
return /* @__PURE__ */
|
|
193
|
-
className: e(
|
|
193
|
+
let r = n?.children.filter((e) => e.type === "element") ?? [], i = r.some((e) => e.tagName === "th"), a = r.filter((e) => U(e).trim().length > 0).length, o = !i && r.length > 1 && a === 1;
|
|
194
|
+
return /* @__PURE__ */ y("tr", {
|
|
195
|
+
className: e(l.row, o && l.sectionRow),
|
|
194
196
|
children: t
|
|
195
197
|
});
|
|
196
198
|
},
|
|
197
|
-
th: ({ children: n, node: r }) => /* @__PURE__ */
|
|
199
|
+
th: ({ children: n, node: r }) => /* @__PURE__ */ y("th", {
|
|
198
200
|
scope: "col",
|
|
199
|
-
className: e("sticky top-0 z-[2] max-w-96 whitespace-normal break-words px-3 py-2.5 text-start",
|
|
201
|
+
className: e("sticky top-0 z-[2] max-w-96 whitespace-normal break-words px-3 py-2.5 text-start", H(r), l.rowDivider, l.tableHeaderCell, t.tableHeaderFont ?? "dial-tiny-lead-semi-text", t.tableCell, t.tableHeader),
|
|
200
202
|
children: n
|
|
201
203
|
}),
|
|
202
|
-
td: ({ children: n, node: r }) => /* @__PURE__ */
|
|
203
|
-
className: e("max-w-96 whitespace-normal px-3 py-[7px] align-top [overflow-wrap:anywhere]",
|
|
204
|
+
td: ({ children: n, node: r }) => /* @__PURE__ */ y("td", {
|
|
205
|
+
className: e("max-w-96 whitespace-normal px-3 py-[7px] align-top [overflow-wrap:anywhere]", H(r), l.rowDivider, t.tableBodyCell, t.tableCell),
|
|
204
206
|
children: n
|
|
205
207
|
})
|
|
206
|
-
}),
|
|
207
|
-
let
|
|
208
|
-
|
|
209
|
-
if (!
|
|
208
|
+
}), G = m(({ content: e, containerClassName: i, isStreaming: a, streamCharactersPerSecond: s, classNames: c = L, components: l, urlTransform: u, rehypePlugins: d = P, isRawHtmlEnabled: p = !0, thinkingLabel: m = "Thinking", codeBlockCopyLabel: v, codeBlockCopiedLabel: b, codeBlockDownloadLabel: S, codeBlockTheme: C, colors: w, tableActionLabels: T, tableDownloadFilename: E, tableOnOpenInCanvas: D, tableScrollRegionAriaLabel: k, mathScrollRegionAriaLabel: A }) => {
|
|
209
|
+
let F = n(e, a, s), B = g(() => r(F), [F]), V = g(() => I(B), [B]), [H, U] = _(null);
|
|
210
|
+
h(() => {
|
|
211
|
+
if (!V || H) return;
|
|
210
212
|
let e = !1;
|
|
211
213
|
return (async () => {
|
|
212
214
|
let [t] = await Promise.all([import("rehype-katex"), import("katex/dist/katex.min.css")]);
|
|
213
|
-
e ||
|
|
215
|
+
e || U([t.default, {
|
|
214
216
|
output: "mathml",
|
|
215
217
|
strict: !1
|
|
216
218
|
}]);
|
|
217
219
|
})(), () => {
|
|
218
220
|
e = !0;
|
|
219
221
|
};
|
|
220
|
-
}, [
|
|
221
|
-
let
|
|
222
|
-
...
|
|
223
|
-
...
|
|
224
|
-
|
|
222
|
+
}, [V, H]);
|
|
223
|
+
let G = g(() => [
|
|
224
|
+
...p ? j : M,
|
|
225
|
+
...H ? [H] : [],
|
|
226
|
+
N,
|
|
227
|
+
o,
|
|
225
228
|
...d
|
|
226
|
-
], [
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
"--cm-
|
|
232
|
-
"--cm-
|
|
233
|
-
"--cm-
|
|
234
|
-
"--cm-
|
|
235
|
-
"--cm-
|
|
236
|
-
|
|
237
|
-
|
|
229
|
+
], [
|
|
230
|
+
p,
|
|
231
|
+
H,
|
|
232
|
+
d
|
|
233
|
+
]), K = t({
|
|
234
|
+
"--cm-markdown-border": w?.border,
|
|
235
|
+
"--cm-blockquote-border": w?.blockquoteBorder,
|
|
236
|
+
"--cm-blockquote-text": w?.blockquoteText,
|
|
237
|
+
"--cm-link-text": w?.linkText,
|
|
238
|
+
"--cm-link-focus": w?.linkFocus,
|
|
239
|
+
"--cm-table-header-text": w?.tableHeaderText,
|
|
240
|
+
"--cm-h6-text": w?.headingSixText,
|
|
241
|
+
"--cm-code-inline-bg": w?.inlineCodeBackground,
|
|
242
|
+
"--cm-code-inline-text": w?.inlineCodeText
|
|
243
|
+
}), q = g(() => R(u), [u]), J = g(() => ({
|
|
244
|
+
...W(c, {
|
|
238
245
|
isStreaming: a,
|
|
239
|
-
codeBlockCopyLabel:
|
|
240
|
-
codeBlockCopiedLabel:
|
|
241
|
-
codeBlockDownloadLabel:
|
|
242
|
-
codeBlockTheme:
|
|
243
|
-
tableActionLabels:
|
|
244
|
-
tableDownloadFilename:
|
|
245
|
-
tableOnOpenInCanvas:
|
|
246
|
-
tableScrollRegionAriaLabel:
|
|
247
|
-
mathScrollRegionAriaLabel:
|
|
246
|
+
codeBlockCopyLabel: v,
|
|
247
|
+
codeBlockCopiedLabel: b,
|
|
248
|
+
codeBlockDownloadLabel: S,
|
|
249
|
+
codeBlockTheme: C,
|
|
250
|
+
tableActionLabels: T,
|
|
251
|
+
tableDownloadFilename: E,
|
|
252
|
+
tableOnOpenInCanvas: D,
|
|
253
|
+
tableScrollRegionAriaLabel: k,
|
|
254
|
+
mathScrollRegionAriaLabel: A
|
|
248
255
|
}),
|
|
249
|
-
...
|
|
250
|
-
...
|
|
256
|
+
...z,
|
|
257
|
+
...l
|
|
251
258
|
}), [
|
|
252
|
-
|
|
259
|
+
c,
|
|
253
260
|
a,
|
|
254
|
-
g,
|
|
255
261
|
v,
|
|
256
262
|
b,
|
|
257
|
-
|
|
263
|
+
S,
|
|
258
264
|
C,
|
|
259
|
-
w,
|
|
260
265
|
T,
|
|
266
|
+
E,
|
|
261
267
|
D,
|
|
262
|
-
|
|
263
|
-
|
|
268
|
+
k,
|
|
269
|
+
A,
|
|
270
|
+
l
|
|
264
271
|
]);
|
|
265
|
-
return a && !
|
|
266
|
-
label:
|
|
267
|
-
colors:
|
|
268
|
-
}) : /* @__PURE__ */
|
|
269
|
-
style:
|
|
272
|
+
return a && !F ? /* @__PURE__ */ y(f, {
|
|
273
|
+
label: m,
|
|
274
|
+
colors: w
|
|
275
|
+
}) : /* @__PURE__ */ y("div", {
|
|
276
|
+
style: K,
|
|
270
277
|
className: i,
|
|
271
|
-
children: /* @__PURE__ */
|
|
272
|
-
remarkPlugins:
|
|
273
|
-
rehypePlugins:
|
|
274
|
-
components:
|
|
275
|
-
urlTransform:
|
|
276
|
-
children:
|
|
278
|
+
children: /* @__PURE__ */ y(x, {
|
|
279
|
+
remarkPlugins: O,
|
|
280
|
+
rehypePlugins: G,
|
|
281
|
+
components: J,
|
|
282
|
+
urlTransform: q,
|
|
283
|
+
children: B
|
|
277
284
|
})
|
|
278
285
|
});
|
|
279
286
|
});
|
|
280
287
|
//#endregion
|
|
281
|
-
export {
|
|
288
|
+
export { G as MarkdownRenderer, z as defaultMarkdownComponents };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
/** Props for {@link MarkdownMathBlock}. */
|
|
3
|
+
export interface MarkdownMathBlockProps {
|
|
4
|
+
/** Rendered KaTeX output — the `<math display="block">` element and its subtree. */
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/** Extra classes on the scroll container. */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Accessible label for the horizontally scrollable region. Defaults to `'Scrollable formula'`. */
|
|
9
|
+
scrollRegionAriaLabel?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Wraps KaTeX display math in a horizontally scrollable region so a formula
|
|
13
|
+
* wider than the message column stays reachable instead of being clipped.
|
|
14
|
+
* The region only becomes a labelled, keyboard-focusable landmark while it
|
|
15
|
+
* actually overflows, so ordinary formulas add no tab stop or noise.
|
|
16
|
+
*/
|
|
17
|
+
export declare const MarkdownMathBlock: FC<MarkdownMathBlockProps>;
|
|
18
|
+
//# sourceMappingURL=MarkdownMathBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownMathBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/MarkdownRenderer/Math/MarkdownMathBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,SAAS,EAAQ,MAAM,OAAO,CAAC;AAMtD,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC,oFAAoF;IACpF,QAAQ,EAAE,SAAS,CAAC;IACpB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mGAAmG;IACnG,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAqCxD,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { MarkdownRendererClassNames, MarkdownRendererColors } from './MarkdownRenderer';
|
|
3
|
+
/** Props for {@link PlainTextRenderer}. */
|
|
4
|
+
export interface PlainTextRendererProps {
|
|
5
|
+
/** Message text. Rendered verbatim — never parsed as Markdown or HTML. */
|
|
6
|
+
content: string;
|
|
7
|
+
/** Classes applied to the renderer root. */
|
|
8
|
+
containerClassName?: string;
|
|
9
|
+
/** When true, appended content is revealed gradually for smoother streaming updates. */
|
|
10
|
+
isStreaming?: boolean;
|
|
11
|
+
/** Reveal speed used while `isStreaming` is true. Defaults to 120 characters per second. */
|
|
12
|
+
streamCharactersPerSecond?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Typography classes. Only `p` is read — the single paragraph the renderer
|
|
15
|
+
* emits — so the same object a Markdown message is styled with keeps both
|
|
16
|
+
* formats on one type scale.
|
|
17
|
+
*/
|
|
18
|
+
classNames?: Pick<MarkdownRendererClassNames, 'p'>;
|
|
19
|
+
/**
|
|
20
|
+
* Label shown with a shimmer animation while `isStreaming` is true and no
|
|
21
|
+
* content has arrived yet. Defaults to `'Thinking'`.
|
|
22
|
+
*/
|
|
23
|
+
thinkingLabel?: string;
|
|
24
|
+
/** Color overrides applied as CSS custom properties. */
|
|
25
|
+
colors?: Pick<MarkdownRendererColors, 'thinkingPrimary' | 'thinkingSecondary'>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Renders message text as plain text: no Markdown pipeline, no raw HTML, no
|
|
29
|
+
* syntax highlighting. The text is a React text child, so it is escaped by
|
|
30
|
+
* construction — a table, a heading, or `**bold**` reaches the reader exactly
|
|
31
|
+
* as the model emitted it, which is what a conversation's `plain_text`
|
|
32
|
+
* response format promises.
|
|
33
|
+
*
|
|
34
|
+
* Lives beside {@link MarkdownRenderer} because it is the other half of the
|
|
35
|
+
* same choice: both render an assistant message body, and both are selected
|
|
36
|
+
* by `MDMessageViewer` from the conversation's response format.
|
|
37
|
+
*/
|
|
38
|
+
export declare const PlainTextRenderer: FC<PlainTextRendererProps>;
|
|
39
|
+
//# sourceMappingURL=PlainTextRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlainTextRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/MarkdownRenderer/PlainTextRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,KAAK,EACV,0BAA0B,EAC1B,sBAAsB,EACvB,MAAM,oBAAoB,CAAC;AAG5B,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,wFAAwF;IACxF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4FAA4F;IAC5F,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC;;;;OAIG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC,0BAA0B,EAAE,GAAG,CAAC,CAAC;IACnD;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wDAAwD;IACxD,MAAM,CAAC,EAAE,IAAI,CACX,sBAAsB,EACtB,iBAAiB,GAAG,mBAAmB,CACxC,CAAC;CACH;AAKD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAuCxD,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { MarkdownTableActionLabels } from './table-serialization';
|
|
3
|
+
export { DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME, MARKDOWN_TABLE_CSV_MIME_TYPE, MarkdownTableCopyFormat, serializeMarkdownTableRows, type MarkdownTableActionLabels, } from './table-serialization';
|
|
4
|
+
export type { MarkdownTableHeaderAction } from './useMarkdownTableActions/useMarkdownTableActions';
|
|
5
|
+
/** Per-element className overrides for {@link MarkdownTable}. */
|
|
6
|
+
export interface MarkdownTableClassNames {
|
|
7
|
+
/** Extra classes on the outer table wrapper. */
|
|
8
|
+
tableWrapper?: string;
|
|
9
|
+
/** Typography class for the table. Defaults to `'dial-small-text'`. */
|
|
10
|
+
tableFont?: string;
|
|
11
|
+
/** Extra classes on the scrollable table region. */
|
|
12
|
+
tableScrollContainer?: string;
|
|
13
|
+
}
|
|
14
|
+
/** CSS custom-property overrides for the `MarkdownTable` component. */
|
|
15
|
+
export interface MarkdownTableColors {
|
|
16
|
+
/** Scroll container border color. */
|
|
17
|
+
border?: string;
|
|
18
|
+
/** Scrollbar thumb/track color. */
|
|
19
|
+
scrollbar?: string;
|
|
20
|
+
/** Edge-fade mask color; only its alpha is used. Defaults to `--stroke-focus-black`. */
|
|
21
|
+
fade?: string;
|
|
22
|
+
/** Divider color between rows. Defaults to `--stroke-tertiary`. */
|
|
23
|
+
rowDivider?: string;
|
|
24
|
+
/** Background of a body row on hover. Defaults to `--bg-control-accent-alpha-hover`. */
|
|
25
|
+
rowHoverBackground?: string;
|
|
26
|
+
}
|
|
27
|
+
/** Props for {@link MarkdownTable}. */
|
|
28
|
+
export interface MarkdownTableProps {
|
|
29
|
+
/** Table body/children rendered inside the scrollable wrapper (typically `<thead>`/`<tbody>` from react-markdown). */
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
/** Per-element className overrides. */
|
|
32
|
+
classNames: MarkdownTableClassNames;
|
|
33
|
+
/** Color overrides applied as CSS custom properties. */
|
|
34
|
+
colors?: MarkdownTableColors;
|
|
35
|
+
/** Localized labels for table actions. Supplying them enables the action bar. */
|
|
36
|
+
actionLabels?: MarkdownTableActionLabels;
|
|
37
|
+
/** Filename used when downloading the table as CSV. Defaults to `'table.csv'`. */
|
|
38
|
+
downloadFilename?: string;
|
|
39
|
+
/** When true, table actions are hidden while content is still arriving. */
|
|
40
|
+
isStreaming?: boolean;
|
|
41
|
+
onOpenInCanvas?: (markdown: string) => void;
|
|
42
|
+
/** Accessible label for the horizontally scrollable region. Defaults to `'Scrollable table'`. */
|
|
43
|
+
scrollRegionAriaLabel?: string;
|
|
44
|
+
}
|
|
45
|
+
/** Renders a responsive Markdown table with an end fade while more columns are available. */
|
|
46
|
+
export declare const MarkdownTable: FC<MarkdownTableProps>;
|
|
47
|
+
//# sourceMappingURL=MarkdownTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownTable.d.ts","sourceRoot":"","sources":["../../../../src/components/MarkdownRenderer/Table/MarkdownTable.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EAAE,EACP,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAQf,OAAO,EAKL,KAAK,yBAAyB,EAC/B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,wCAAwC,EACxC,4BAA4B,EAC5B,uBAAuB,EACvB,0BAA0B,EAC1B,KAAK,yBAAyB,GAC/B,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,yBAAyB,EAAE,MAAM,mDAAmD,CAAC;AAEnG,iEAAiE;AACjE,MAAM,WAAW,uBAAuB;IACtC,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,uEAAuE;AACvE,MAAM,WAAW,mBAAmB;IAClC,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wFAAwF;IACxF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wFAAwF;IACxF,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,uCAAuC;AACvC,MAAM,WAAW,kBAAkB;IACjC,sHAAsH;IACtH,QAAQ,EAAE,SAAS,CAAC;IACpB,uCAAuC;IACvC,UAAU,EAAE,uBAAuB,CAAC;IACpC,wDAAwD;IACxD,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,iFAAiF;IACjF,YAAY,CAAC,EAAE,yBAAyB,CAAC;IACzC,kFAAkF;IAClF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,2EAA2E;IAC3E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,iGAAiG;IACjG,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAID,6FAA6F;AAC7F,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CA6JhD,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
/** A single action rendered by {@link TableHeader}. */
|
|
3
|
+
export interface TableHeaderAction {
|
|
4
|
+
/** Stable accessible name and tooltip text. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Decorative icon content rendered inside the action button. */
|
|
7
|
+
icon: ReactNode;
|
|
8
|
+
/** Called when the action button is activated. */
|
|
9
|
+
onClick: () => void;
|
|
10
|
+
}
|
|
11
|
+
/** Props for {@link TableHeader}. */
|
|
12
|
+
export interface TableHeaderProps {
|
|
13
|
+
/** Content rendered at the inline start of the header. */
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
/** Action descriptors rendered as icon buttons at the inline end. */
|
|
16
|
+
actions?: TableHeaderAction[];
|
|
17
|
+
/** Extra classes merged onto the header. */
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
/** Reusable table header with caller-supplied leading content and actions. */
|
|
21
|
+
export declare const TableHeader: FC<TableHeaderProps>;
|
|
22
|
+
//# sourceMappingURL=TableHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/MarkdownRenderer/Table/TableHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI3C,uDAAuD;AACvD,MAAM,WAAW,iBAAiB;IAChC,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,IAAI,EAAE,SAAS,CAAC;IAChB,kDAAkD;IAClD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC/B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,qEAAqE;IACrE,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC9B,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,8EAA8E;AAC9E,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAgC5C,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare enum MarkdownTableCopyFormat {
|
|
2
|
+
Csv = "csv",
|
|
3
|
+
Markdown = "markdown"
|
|
4
|
+
}
|
|
5
|
+
/** Default filename used when downloading a Markdown table as CSV. */
|
|
6
|
+
export declare const DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME = "table.csv";
|
|
7
|
+
/** MIME type used when downloading a Markdown table as CSV. */
|
|
8
|
+
export declare const MARKDOWN_TABLE_CSV_MIME_TYPE = "text/csv;charset=utf-8";
|
|
9
|
+
export interface MarkdownTableActionLabels {
|
|
10
|
+
copyLabel?: string;
|
|
11
|
+
copiedLabel?: string;
|
|
12
|
+
downloadCsvLabel?: string;
|
|
13
|
+
openInCanvasLabel?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const serializeMarkdownTableRows: (rows: readonly HTMLTableRowElement[], format: MarkdownTableCopyFormat) => string;
|
|
16
|
+
//# sourceMappingURL=table-serialization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-serialization.d.ts","sourceRoot":"","sources":["../../../../src/components/MarkdownRenderer/Table/table-serialization.ts"],"names":[],"mappings":"AAAA,oBAAY,uBAAuB;IACjC,GAAG,QAAQ;IACX,QAAQ,aAAa;CACtB;AAED,sEAAsE;AACtE,eAAO,MAAM,wCAAwC,cAAc,CAAC;AACpE,+DAA+D;AAC/D,eAAO,MAAM,4BAA4B,2BAA2B,CAAC;AAErE,MAAM,WAAW,yBAAyB;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAsID,eAAO,MAAM,0BAA0B,GACrC,MAAM,SAAS,mBAAmB,EAAE,EACpC,QAAQ,uBAAuB,KAC9B,MAiBF,CAAC"}
|
package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { MarkdownTableActionLabels } from '../table-serialization';
|
|
3
|
+
/** A table action rendered as an icon button. */
|
|
4
|
+
export interface MarkdownTableHeaderAction {
|
|
5
|
+
/** Stable accessible name and tooltip text. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Decorative icon content. */
|
|
8
|
+
icon: ReactNode;
|
|
9
|
+
/** Called when the action is activated. */
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
}
|
|
12
|
+
/** Params for {@link useMarkdownTableActions}. */
|
|
13
|
+
export interface UseMarkdownTableActionsParams {
|
|
14
|
+
/** Localized labels for table actions. `undefined` yields no actions. */
|
|
15
|
+
actionLabels: MarkdownTableActionLabels | undefined;
|
|
16
|
+
/** Whether the table has just been copied (shows a checkmark on the copy button). */
|
|
17
|
+
isCopied: boolean;
|
|
18
|
+
/** Called when the copy action is activated. */
|
|
19
|
+
onCopy: () => void;
|
|
20
|
+
/** Called when the download-as-CSV action is activated. */
|
|
21
|
+
onDownloadCsv: () => void;
|
|
22
|
+
/** Called when the open-in-canvas action is activated. Omit to hide that action. */
|
|
23
|
+
onOpenInCanvas?: () => void;
|
|
24
|
+
}
|
|
25
|
+
/** Builds the {@link MarkdownTableHeaderAction} list for a table's action bar from its localized labels. */
|
|
26
|
+
export declare const useMarkdownTableActions: ({ actionLabels, isCopied, onCopy, onDownloadCsv, onOpenInCanvas, }: UseMarkdownTableActionsParams) => MarkdownTableHeaderAction[];
|
|
27
|
+
//# sourceMappingURL=useMarkdownTableActions.d.ts.map
|
package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMarkdownTableActions.d.ts","sourceRoot":"","sources":["../../../../../src/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAExE,iDAAiD;AACjD,MAAM,WAAW,yBAAyB;IACxC,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,IAAI,EAAE,SAAS,CAAC;IAChB,2CAA2C;IAC3C,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,kDAAkD;AAClD,MAAM,WAAW,6BAA6B;IAC5C,yEAAyE;IACzE,YAAY,EAAE,yBAAyB,GAAG,SAAS,CAAC;IACpD,qFAAqF;IACrF,QAAQ,EAAE,OAAO,CAAC;IAClB,gDAAgD;IAChD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,2DAA2D;IAC3D,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,oFAAoF;IACpF,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED,4GAA4G;AAC5G,eAAO,MAAM,uBAAuB,GAAI,oEAMrC,6BAA6B,KAAG,yBAAyB,EAyD3D,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
/** Props for {@link MarkdownTaskCheckbox}. */
|
|
3
|
+
export interface MarkdownTaskCheckboxProps {
|
|
4
|
+
/** Whether the GFM task-list item is checked. Defaults to `false`. */
|
|
5
|
+
checked?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** Read-only checkbox for GFM task-list items (`- [ ]` / `- [x]`). */
|
|
8
|
+
export declare const MarkdownTaskCheckbox: FC<MarkdownTaskCheckboxProps>;
|
|
9
|
+
//# sourceMappingURL=MarkdownTaskCheckbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownTaskCheckbox.d.ts","sourceRoot":"","sources":["../../../../src/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,8CAA8C;AAC9C,MAAM,WAAW,yBAAyB;IACxC,sEAAsE;IACtE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,sEAAsE;AACtE,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CAM9D,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { MarkdownRendererColors } from './MarkdownRenderer';
|
|
3
|
+
/** Props for {@link ThinkingShimmer}. */
|
|
4
|
+
export interface ThinkingShimmerProps {
|
|
5
|
+
/** Text rendered with the shimmer animation. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Gradient color overrides applied as CSS custom properties. */
|
|
8
|
+
colors?: Pick<MarkdownRendererColors, 'thinkingPrimary' | 'thinkingSecondary'>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The "thinking" placeholder both message renderers show while a stream has
|
|
12
|
+
* started but no content has arrived yet. Owns the mapping from the public
|
|
13
|
+
* color props to the gradient's CSS variables — `thinkingPrimary` drives
|
|
14
|
+
* `--cm-thinking-inverted` — so that mapping exists in one place.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ThinkingShimmer: FC<ThinkingShimmerProps>;
|
|
17
|
+
//# sourceMappingURL=ThinkingShimmer.d.ts.map
|