@epam/ai-dial-chat-shared 1.3.0-dev.96 → 1.3.0-rc.0
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/ActionMenu/ActionMenu.d.ts +26 -0
- package/components/ActionMenu/ActionMenu.d.ts.map +1 -0
- package/components/ActionMenu/ActionMenu.js +50 -0
- package/components/ConfirmationDialog/ConfirmationDialog.d.ts +6 -1
- package/components/ConfirmationDialog/ConfirmationDialog.d.ts.map +1 -1
- package/components/ConfirmationDialog/ConfirmationDialog.js +11 -9
- package/components/ConfirmationIdentityCard/ConfirmationIdentityCard.module.scss.js +5 -4
- package/components/ConfirmationIdentityRow/ConfirmationIdentityRow.js +2 -2
- package/components/ConfirmationIdentityRow/ConfirmationIdentityRow.module.scss.js +3 -2
- package/components/ConfirmationView/ConfirmationFooter.d.ts.map +1 -1
- package/components/ConfirmationView/ConfirmationFooter.js +24 -25
- package/components/ConfirmationView/ConfirmationView.d.ts +2 -0
- package/components/ConfirmationView/ConfirmationView.d.ts.map +1 -1
- package/components/ConfirmationView/ConfirmationView.js +12 -12
- package/components/ConfirmationView/ConfirmationView.module.scss.js +6 -5
- package/components/DeleteConfirmationDrawer/DeleteConfirmationDrawer.d.ts +31 -0
- package/components/DeleteConfirmationDrawer/DeleteConfirmationDrawer.d.ts.map +1 -0
- package/components/DeleteConfirmationDrawer/DeleteConfirmationDrawer.js +36 -0
- package/components/DeleteConfirmationView/DeleteConfirmationView.d.ts +3 -0
- package/components/DeleteConfirmationView/DeleteConfirmationView.d.ts.map +1 -1
- package/components/DeleteConfirmationView/DeleteConfirmationView.js +36 -27
- package/components/DeleteConfirmationView/DeleteConfirmationView.module.scss.js +5 -4
- package/components/DeploymentIcon/DeploymentIcon.module.scss.js +3 -2
- package/components/EntityHeader/EntityHeader.js +1 -1
- package/components/InitialsAvatar/InitialsAvatar.d.ts +3 -0
- package/components/InitialsAvatar/InitialsAvatar.d.ts.map +1 -1
- package/components/InitialsAvatar/InitialsAvatar.js +4 -3
- package/components/ItemHeader/ItemHeader.module.scss.js +5 -4
- package/components/MarkdownRenderer/CodeBlock/CodeBlock.d.ts +6 -2
- package/components/MarkdownRenderer/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/components/MarkdownRenderer/CodeBlock/CodeBlock.js +58 -58
- package/components/MarkdownRenderer/CodeBlock/CodeBlock.module.scss.js +9 -8
- package/components/MarkdownRenderer/CodeBlock/syntax-theme.d.ts.map +1 -1
- package/components/MarkdownRenderer/MarkdownRenderer.d.ts +6 -0
- package/components/MarkdownRenderer/MarkdownRenderer.d.ts.map +1 -1
- package/components/MarkdownRenderer/MarkdownRenderer.js +29 -24
- package/components/MarkdownRenderer/MarkdownRenderer.module.scss.js +9 -8
- package/components/MarkdownRenderer/Math/MarkdownMathBlock.module.scss.js +5 -4
- package/components/MarkdownRenderer/PlainTextRenderer.js +1 -1
- package/components/MarkdownRenderer/Table/MarkdownTable.d.ts +4 -0
- package/components/MarkdownRenderer/Table/MarkdownTable.d.ts.map +1 -1
- package/components/MarkdownRenderer/Table/MarkdownTable.js +68 -63
- package/components/MarkdownRenderer/Table/MarkdownTable.module.scss.js +15 -13
- package/components/MarkdownRenderer/Table/TableHeader.module.scss.js +3 -2
- package/components/MarkdownRenderer/markdown-whitespace.js +2 -6
- package/components/NewVersionAlert/NewVersionAlert.d.ts +27 -0
- package/components/NewVersionAlert/NewVersionAlert.d.ts.map +1 -0
- package/components/NewVersionAlert/NewVersionAlert.js +28 -0
- package/components/NewVersionAlert/NewVersionAlert.module.scss.js +4 -0
- package/components/NotificationStack/NotificationStack.d.ts +48 -0
- package/components/NotificationStack/NotificationStack.d.ts.map +1 -0
- package/components/NotificationStack/NotificationStack.js +111 -0
- package/components/PanelEmptyState/PanelEmptyState.d.ts +12 -2
- package/components/PanelEmptyState/PanelEmptyState.d.ts.map +1 -1
- package/components/PanelEmptyState/PanelEmptyState.js +19 -9
- package/components/PanelEmptyState/PanelEmptyState.module.scss.js +6 -2
- package/components/ResourceSummary/ResourceSummary.module.scss.js +5 -4
- package/components/TextRefinementField/TextRefinementField.d.ts +4 -2
- package/components/TextRefinementField/TextRefinementField.d.ts.map +1 -1
- package/components/TextRefinementField/TextRefinementField.js +84 -55
- package/components/UnsavedChangesProvider/UnsavedChangesProvider.d.ts +22 -0
- package/components/UnsavedChangesProvider/UnsavedChangesProvider.d.ts.map +1 -0
- package/components/UnsavedChangesProvider/UnsavedChangesProvider.js +57 -0
- package/components/UnsavedChangesProvider/unsaved-changes-context.d.ts +44 -0
- package/components/UnsavedChangesProvider/unsaved-changes-context.d.ts.map +1 -0
- package/components/UnsavedChangesProvider/unsaved-changes-context.js +13 -0
- package/constants/breakpoint.d.ts +6 -0
- package/constants/breakpoint.d.ts.map +1 -1
- package/constants/breakpoint.js +2 -2
- package/conversation-transfer/conversation-transfer-queue.d.ts +16 -0
- package/conversation-transfer/conversation-transfer-queue.d.ts.map +1 -0
- package/conversation-transfer/conversation-transfer-queue.js +24 -0
- package/file-manager/DialFileManagerShell/DialFileManagerShell.d.ts +9 -0
- package/file-manager/DialFileManagerShell/DialFileManagerShell.d.ts.map +1 -1
- package/file-manager/DialFileManagerShell/DialFileManagerShell.js +330 -267
- package/file-manager/DialFileManagerShell/DialFileManagerShell.module.scss.js +8 -0
- package/file-manager/FileManagerAttachModal/FileManagerAttachModal.d.ts +7 -0
- package/file-manager/FileManagerAttachModal/FileManagerAttachModal.d.ts.map +1 -1
- package/file-manager/FileManagerAttachModal/FileManagerAttachModal.js +85 -80
- package/file-manager/FileManagerAttachModal/FileManagerAttachModal.module.scss.js +7 -0
- package/file-manager/OperationLoaderModal/OperationLoaderModal.d.ts +5 -0
- package/file-manager/OperationLoaderModal/OperationLoaderModal.d.ts.map +1 -1
- package/file-manager/OperationLoaderModal/OperationLoaderModal.js +25 -20
- package/file-manager/OperationLoaderModal/OperationLoaderModal.module.scss.js +4 -0
- package/file-manager/file-manager-controller.d.ts +11 -3
- package/file-manager/file-manager-controller.d.ts.map +1 -1
- package/file-manager/index.d.ts +1 -0
- package/file-manager/index.d.ts.map +1 -1
- package/file-manager/labels.d.ts +23 -2
- package/file-manager/labels.d.ts.map +1 -1
- package/file-manager/shell-styles.d.ts +37 -0
- package/file-manager/shell-styles.d.ts.map +1 -0
- package/file-manager/upload-batch.d.ts +46 -0
- package/file-manager/upload-batch.d.ts.map +1 -1
- package/file-manager/upload-batch.js +6 -2
- package/file-manager/upload-queue.d.ts +44 -4
- package/file-manager/upload-queue.d.ts.map +1 -1
- package/file-manager/upload-queue.js +45 -13
- package/file-manager.js +4 -4
- package/hooks/useAvailableHeightCap.js +1 -1
- package/hooks/useControlErrorAssociation.d.ts +3 -0
- package/hooks/useControlErrorAssociation.d.ts.map +1 -0
- package/hooks/useControlErrorAssociation.js +12 -0
- package/hooks/useIsMobile.js +1 -1
- package/hooks/useIsPhone.d.ts +3 -0
- package/hooks/useIsPhone.d.ts.map +1 -0
- package/hooks/useIsPhone.js +13 -0
- package/hooks/useIsTablet.d.ts +3 -0
- package/hooks/useIsTablet.d.ts.map +1 -0
- package/hooks/useIsTablet.js +13 -0
- package/hooks/useIsTextClipped.d.ts +26 -0
- package/hooks/useIsTextClipped.d.ts.map +1 -0
- package/hooks/useIsTextClipped.js +25 -0
- package/hooks/useIsVerticallyClamped.d.ts +16 -0
- package/hooks/useIsVerticallyClamped.d.ts.map +1 -0
- package/hooks/useIsVerticallyClamped.js +20 -0
- package/hooks/useTextRefinement.d.ts +1 -1
- package/hooks/useTextRefinement.d.ts.map +1 -1
- package/hooks/useTextRefinement.js +4 -4
- package/hooks/useUnsavedChangesGuard.js +1 -5
- package/hooks/useUnsavedChangesLeaveConfirmation.d.ts +12 -0
- package/hooks/useUnsavedChangesLeaveConfirmation.d.ts.map +1 -0
- package/hooks/useUnsavedChangesLeaveConfirmation.js +22 -0
- package/hooks/useUnsavedChangesLeaveGuard.d.ts +24 -0
- package/hooks/useUnsavedChangesLeaveGuard.d.ts.map +1 -0
- package/hooks/useUnsavedChangesLeaveGuard.js +24 -0
- package/index.css +2 -2
- package/index.d.ts +15 -0
- package/index.d.ts.map +1 -1
- package/index.js +93 -78
- package/models/auth.d.ts +2 -0
- package/models/auth.d.ts.map +1 -1
- package/models/chat.d.ts +2 -0
- package/models/chat.d.ts.map +1 -1
- package/models/conversation-classification.d.ts +5 -0
- package/models/conversation-classification.d.ts.map +1 -1
- package/models/conversation-classification.js +3 -1
- package/models/text-refinement.d.ts +6 -2
- package/models/text-refinement.d.ts.map +1 -1
- package/package.json +10 -17
- package/utils/dom.d.ts +8 -0
- package/utils/dom.d.ts.map +1 -0
- package/utils/dom.js +10 -0
- package/utils/format-price.js +10 -10
- package/utils/inline-segments.js +1 -1
- package/utils/latex.d.ts +4 -3
- package/utils/latex.d.ts.map +1 -1
- package/utils/latex.js +47 -41
- package/utils/message-attachment-to-display.js +1 -1
- package/utils/mime-type.js +1 -1
- package/utils/prompt-variables.js +5 -9
- package/utils/syntax-highlighting.js +8 -8
|
@@ -27,18 +27,22 @@ export interface MarkdownCodeBlockProps {
|
|
|
27
27
|
theme?: CodeBlockTheme;
|
|
28
28
|
/** Accessible label for the copy button. Defaults to `'Copy code'`. */
|
|
29
29
|
copyLabel?: string;
|
|
30
|
-
/** Message announced through the block's
|
|
30
|
+
/** Message announced through the block's polite kit `LiveRegion` after a copy completes. The copy button's own accessible name stays `copyLabel`. Defaults to `'Copied!'`. */
|
|
31
31
|
copiedLabel?: string;
|
|
32
32
|
/** Accessible label for the download button. Defaults to `'Download code'`. */
|
|
33
33
|
downloadLabel?: string;
|
|
34
|
+
/** Accessible label for the scrollable code region. Defaults to `'Scrollable code'`. */
|
|
35
|
+
scrollRegionAriaLabel?: string;
|
|
34
36
|
/** When true, hides the download button while still showing copy. Defaults to `false`. */
|
|
35
37
|
hideDownload?: boolean;
|
|
36
38
|
/** Extra classes applied to the outer container element. */
|
|
37
39
|
containerClassName?: string;
|
|
38
40
|
/** Extra classes applied to the sticky header bar. */
|
|
39
41
|
headerClassName?: string;
|
|
40
|
-
/** Typography class for the `<code>` element
|
|
42
|
+
/** Typography class for the code text — the `<code>` element, plus the highlighted `<pre>` when a language is detected. Defaults to `'dial-code-text'`. */
|
|
41
43
|
codeClassName?: string;
|
|
44
|
+
/** Whether the code keeps its own top padding below the header; `false` starts it right under the header. Defaults to `true`. */
|
|
45
|
+
hasContentTopPadding?: boolean;
|
|
42
46
|
/** CSS class applied to the language label in the header. Defaults to `'dial-tiny-lead-semi-text'` plus the module's `.languageLabel` class (`--text-secondary`). */
|
|
43
47
|
languageLabelClassName?: string;
|
|
44
48
|
/** Header text shown in place of `language`, for blocks whose highlighting id is not the name to display (e.g. `bash` highlighted, `cURL` shown). Defaults to the `language` value. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/MarkdownRenderer/CodeBlock/CodeBlock.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/MarkdownRenderer/CodeBlock/CodeBlock.tsx"],"names":[],"mappings":"AASA,OAAO,EAAQ,KAAK,EAAE,EAAQ,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAG/E,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAW5D,2EAA2E;AAC3E,MAAM,WAAW,uBAAuB;IACtC,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC,2FAA2F;IAC3F,QAAQ,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iEAAiE;IACjE,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8KAA8K;IAC9K,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wFAAwF;IACxF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,0FAA0F;IAC1F,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,4DAA4D;IAC5D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sDAAsD;IACtD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2JAA2J;IAC3J,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iIAAiI;IACjI,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qKAAqK;IACrK,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,uLAAuL;IACvL,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4IAA4I;IAC5I,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,wDAAwD;IACxD,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAClC;AAiBD,4FAA4F;AAC5F,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CA+JxD,CAAC"}
|
|
@@ -7,100 +7,100 @@ import { CHAT_SHARED_CLASS as o } from "../../../constants/public-class-names.js
|
|
|
7
7
|
import { useCodeCopy as s } from "../../../hooks/useCodeCopy.js";
|
|
8
8
|
import c from "./CodeBlock.module.scss.js";
|
|
9
9
|
import { restrainedSyntaxTheme as l } from "./syntax-theme.js";
|
|
10
|
-
import { DIAL_ICON_SIZE as u, DIAL_KIT_ICON_STROKE as d, ElementSize as f, GhostIconButton as p } from "@epam/ai-dial-ui-kit";
|
|
11
|
-
import { Suspense as
|
|
12
|
-
import { jsx as
|
|
13
|
-
import { IconCheck as
|
|
10
|
+
import { DIAL_ICON_SIZE as u, DIAL_KIT_ICON_STROKE as d, ElementSize as f, GhostIconButton as p, LiveRegion as m, LiveRegionElement as h } from "@epam/ai-dial-ui-kit";
|
|
11
|
+
import { Suspense as g, lazy as _, memo as v, useMemo as y } from "react";
|
|
12
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
13
|
+
import { IconCheck as S, IconCopy as C, IconDownload as w } from "@tabler/icons-react";
|
|
14
14
|
//#region src/components/MarkdownRenderer/CodeBlock/CodeBlock.tsx
|
|
15
|
-
var
|
|
15
|
+
var T = {
|
|
16
16
|
dark: l,
|
|
17
17
|
light: l
|
|
18
|
-
},
|
|
18
|
+
}, E = _(async () => {
|
|
19
19
|
let { Prism: e } = await import("react-syntax-highlighter");
|
|
20
20
|
return { default: e };
|
|
21
|
-
}),
|
|
22
|
-
let { isCopied:
|
|
23
|
-
r(
|
|
24
|
-
},
|
|
25
|
-
className: "p-4",
|
|
26
|
-
children: /* @__PURE__ */
|
|
27
|
-
className: t("whitespace-pre",
|
|
28
|
-
children:
|
|
21
|
+
}), D = v(({ language: _, value: v, isStreaming: D, theme: O = e.Dark, copyLabel: k = "Copy code", copiedLabel: A = "Copied!", downloadLabel: j = "Download code", scrollRegionAriaLabel: M = "Scrollable code", hideDownload: N = !1, hasContentTopPadding: P = !0, containerClassName: F, headerClassName: I, codeClassName: L = "dial-code-text", languageLabelClassName: R = "dial-tiny-lead-semi-text", title: z, titleSlot: B, colors: V }) => {
|
|
22
|
+
let { isCopied: H, copy: U } = s(v), W = y(() => a(v), [v]), G = O === e.Light, K = () => {
|
|
23
|
+
r(v, `code.${i(_)}`);
|
|
24
|
+
}, q = /* @__PURE__ */ b("pre", {
|
|
25
|
+
className: P ? "p-4" : "px-4 pt-0 pb-4",
|
|
26
|
+
children: /* @__PURE__ */ b("code", {
|
|
27
|
+
className: t("whitespace-pre", L),
|
|
28
|
+
children: v
|
|
29
29
|
})
|
|
30
|
+
}), J = n({
|
|
31
|
+
"--cm-code-block-bg": V?.background,
|
|
32
|
+
"--cm-code-block-border": V?.border,
|
|
33
|
+
"--cm-code-block-header-bg": V?.headerBackground,
|
|
34
|
+
"--cm-code-block-language": V?.language,
|
|
35
|
+
"--cm-code-block-copied": V?.copied,
|
|
36
|
+
"--cm-code-block-scrollbar": V?.scrollbar
|
|
30
37
|
});
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
style:
|
|
33
|
-
|
|
34
|
-
"--cm-code-block-border": L?.border,
|
|
35
|
-
"--cm-code-block-header-bg": L?.headerBackground,
|
|
36
|
-
"--cm-code-block-language": L?.language,
|
|
37
|
-
"--cm-code-block-copied": L?.copied,
|
|
38
|
-
"--cm-code-block-scrollbar": L?.scrollbar
|
|
39
|
-
}),
|
|
40
|
-
className: t("my-4 max-w-full [overflow:clip] rounded-xl border", c.container, V && c.containerLight, j, o.codeBlock),
|
|
38
|
+
return /* @__PURE__ */ x("div", {
|
|
39
|
+
style: J,
|
|
40
|
+
className: t("my-4 max-w-full overflow-clip rounded-xl border", c.container, G && c.containerLight, F, o.codeBlock),
|
|
41
41
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
className: t("sticky top-0 z-10 flex min-h-10 items-center justify-between px-4",
|
|
44
|
-
children: [
|
|
45
|
-
className: t(c.languageLabel,
|
|
46
|
-
children:
|
|
47
|
-
}), !
|
|
42
|
+
/* @__PURE__ */ x("div", {
|
|
43
|
+
className: t("sticky top-0 z-10 flex min-h-10 items-center justify-between px-4", B == null ? "py-2" : "py-0", c.header, I, o.codeBlockHeader),
|
|
44
|
+
children: [B ?? /* @__PURE__ */ b("span", {
|
|
45
|
+
className: t(c.languageLabel, R),
|
|
46
|
+
children: z ?? _
|
|
47
|
+
}), !D && /* @__PURE__ */ x("div", {
|
|
48
48
|
className: "flex items-center gap-1",
|
|
49
|
-
children: [!
|
|
50
|
-
icon: /* @__PURE__ */
|
|
49
|
+
children: [!N && /* @__PURE__ */ b(p, {
|
|
50
|
+
icon: /* @__PURE__ */ b(w, {
|
|
51
51
|
size: u.SM,
|
|
52
52
|
stroke: d
|
|
53
53
|
}),
|
|
54
|
-
"aria-label":
|
|
54
|
+
"aria-label": j,
|
|
55
55
|
size: f.Small,
|
|
56
|
-
onClick:
|
|
57
|
-
}), /* @__PURE__ */
|
|
58
|
-
icon:
|
|
56
|
+
onClick: K
|
|
57
|
+
}), /* @__PURE__ */ b(p, {
|
|
58
|
+
icon: H ? /* @__PURE__ */ b(S, {
|
|
59
59
|
size: u.SM,
|
|
60
60
|
className: c.copiedIcon,
|
|
61
61
|
"aria-hidden": !0,
|
|
62
62
|
stroke: d
|
|
63
|
-
}) : /* @__PURE__ */
|
|
63
|
+
}) : /* @__PURE__ */ b(C, {
|
|
64
64
|
size: u.SM,
|
|
65
65
|
"aria-hidden": !0,
|
|
66
66
|
stroke: d
|
|
67
67
|
}),
|
|
68
|
-
"aria-label":
|
|
68
|
+
"aria-label": k,
|
|
69
69
|
size: f.Small,
|
|
70
|
-
onClick:
|
|
70
|
+
onClick: U
|
|
71
71
|
})]
|
|
72
72
|
})]
|
|
73
73
|
}),
|
|
74
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ b("div", {
|
|
75
75
|
className: t(c.scrollContainer, "max-h-[60vh] overflow-auto"),
|
|
76
76
|
dir: "ltr",
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
role: "region",
|
|
78
|
+
"aria-label": M,
|
|
79
|
+
tabIndex: 0,
|
|
80
|
+
children: _ && W ? /* @__PURE__ */ b(g, {
|
|
81
|
+
fallback: q,
|
|
82
|
+
children: /* @__PURE__ */ b(E, {
|
|
83
|
+
language: _,
|
|
84
|
+
style: T[O] ?? l,
|
|
82
85
|
customStyle: {
|
|
83
86
|
margin: 0,
|
|
84
87
|
borderRadius: 0,
|
|
85
88
|
background: "transparent",
|
|
86
|
-
|
|
87
|
-
lineHeight: 1.5,
|
|
88
|
-
padding: "14px 16px",
|
|
89
|
-
letterSpacing: 0
|
|
89
|
+
padding: P ? "14px 16px" : "0 16px 14px"
|
|
90
90
|
},
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
className: L,
|
|
92
|
+
codeTagProps: { className: L },
|
|
93
|
+
children: v
|
|
93
94
|
})
|
|
94
|
-
}) :
|
|
95
|
+
}) : q
|
|
95
96
|
}),
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
children: R ? O : ""
|
|
97
|
+
/* @__PURE__ */ b(m, {
|
|
98
|
+
visuallyHidden: !0,
|
|
99
|
+
as: h.Span,
|
|
100
|
+
children: H ? A : ""
|
|
101
101
|
})
|
|
102
102
|
]
|
|
103
103
|
});
|
|
104
104
|
});
|
|
105
105
|
//#endregion
|
|
106
|
-
export {
|
|
106
|
+
export { D as MarkdownCodeBlock };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
//#region src/components/MarkdownRenderer/CodeBlock/CodeBlock.module.scss
|
|
2
|
+
var e = "_container_sqe5k_1", t = "_containerLight_sqe5k_6", n = "_header_sqe5k_10", r = "_languageLabel_sqe5k_15", i = "_copiedIcon_sqe5k_19", a = "_scrollContainer_sqe5k_23", o = {
|
|
3
|
+
container: e,
|
|
4
|
+
containerLight: t,
|
|
5
|
+
header: n,
|
|
6
|
+
languageLabel: r,
|
|
7
|
+
copiedIcon: i,
|
|
8
|
+
scrollContainer: a
|
|
8
9
|
};
|
|
9
10
|
//#endregion
|
|
10
|
-
export { e as default };
|
|
11
|
+
export { e as container, t as containerLight, i as copiedIcon, o as default, n as header, r as languageLabel, a as scrollContainer };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syntax-theme.d.ts","sourceRoot":"","sources":["../../../../src/components/MarkdownRenderer/CodeBlock/syntax-theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,2EAA2E;AAC3E,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"syntax-theme.d.ts","sourceRoot":"","sources":["../../../../src/components/MarkdownRenderer/CodeBlock/syntax-theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,2EAA2E;AAC3E,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AASnD,wHAAwH;AACxH,eAAO,MAAM,qBAAqB,EAAE,aA6DnC,CAAC"}
|
|
@@ -107,6 +107,8 @@ export interface MarkdownRendererProps {
|
|
|
107
107
|
tableScrollRegionAriaLabel?: string;
|
|
108
108
|
/** Accessible label for a block formula's horizontally scrollable region. Defaults to `'Scrollable formula'`. */
|
|
109
109
|
mathScrollRegionAriaLabel?: string;
|
|
110
|
+
/** Accessible label for a code block's scrollable region. Defaults to `'Scrollable code'`. */
|
|
111
|
+
codeBlockScrollRegionAriaLabel?: string;
|
|
110
112
|
}
|
|
111
113
|
/** CSS custom-property overrides for the `MarkdownRenderer` component. */
|
|
112
114
|
export interface MarkdownRendererColors {
|
|
@@ -132,6 +134,10 @@ export interface MarkdownRendererColors {
|
|
|
132
134
|
inlineCodeBackground?: string;
|
|
133
135
|
/** Text color for inline `<code>` spans. Defaults to `--text-primary`. */
|
|
134
136
|
inlineCodeText?: string;
|
|
137
|
+
/** Scrollbar thumb color of a horizontally scrolling display formula. Defaults to `--stroke-primary`. */
|
|
138
|
+
mathScrollbar?: string;
|
|
139
|
+
/** Focus-visible outline color of a scrollable display formula. Defaults to `--stroke-focus`. */
|
|
140
|
+
mathFocus?: string;
|
|
135
141
|
}
|
|
136
142
|
export declare const defaultMarkdownComponents: Components;
|
|
137
143
|
/** Markdown renderer with GFM support. Styling is driven by `classNames`; structural overrides via `components`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/MarkdownRenderer/MarkdownRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,EAAE,EAER,MAAM,OAAO,CAAC;AACf,OAAsB,EAEpB,KAAK,UAAU,EACf,KAAK,OAAO,EAEb,MAAM,gBAAgB,CAAC;AAOxB,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AASzD,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC7B,MAAM,uBAAuB,CAAC;AAK/B,0EAA0E;AAC1E,MAAM,WAAW,0BAA2B,SAAQ,uBAAuB;IACzE,uBAAuB;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,uBAAuB;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,uBAAuB;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,uBAAuB;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,uBAAuB;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,uBAAuB;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,iCAAiC;IACjC,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,4DAA4D;IAC5D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,+DAA+D;IAC/D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,yIAAyI;IACzI,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2DAA2D;IAC3D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,sEAAsE;IACtE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iEAAiE;IACjE,eAAe,CAAC,EAAE,MAA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AAE,MAAM,CAAC;IAChB,wFAAwF;IACxF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6EAA6E;IAC7E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sEAAsE;IACtE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mFAAmF;IACnF,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,0EAA0E;IAC1E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yGAAyG;IACzG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iGAAiG;IACjG,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAmLD,eAAO,MAAM,yBAAyB,EAAE,UAGvC,CAAC;AAkRF,oHAAoH;AACpH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAqKtD,CAAC"}
|
|
@@ -91,7 +91,7 @@ var O = [
|
|
|
91
91
|
}, H = (e) => {
|
|
92
92
|
let t = e?.properties?.align;
|
|
93
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: _ }) => ({
|
|
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: _, codeBlockScrollRegionAriaLabel: b }) => ({
|
|
95
95
|
h1: ({ children: e }) => /* @__PURE__ */ y("h1", {
|
|
96
96
|
className: t.h1,
|
|
97
97
|
children: e
|
|
@@ -117,7 +117,7 @@ var O = [
|
|
|
117
117
|
children: n
|
|
118
118
|
}),
|
|
119
119
|
p: ({ children: n }) => /* @__PURE__ */ y("p", {
|
|
120
|
-
className: e("break-
|
|
120
|
+
className: e("wrap-break-word", t.p),
|
|
121
121
|
children: n
|
|
122
122
|
}),
|
|
123
123
|
ul: ({ children: n }) => /* @__PURE__ */ y("ul", {
|
|
@@ -147,6 +147,7 @@ var O = [
|
|
|
147
147
|
copyLabel: r,
|
|
148
148
|
copiedLabel: i,
|
|
149
149
|
downloadLabel: o,
|
|
150
|
+
scrollRegionAriaLabel: b,
|
|
150
151
|
containerClassName: t.codeBlockContainer,
|
|
151
152
|
headerClassName: t.codeBlockHeader,
|
|
152
153
|
codeClassName: t.codeFont
|
|
@@ -163,7 +164,7 @@ var O = [
|
|
|
163
164
|
href: n,
|
|
164
165
|
target: "_blank",
|
|
165
166
|
rel: "noopener noreferrer",
|
|
166
|
-
className: e("break-
|
|
167
|
+
className: e("wrap-break-word underline decoration-current/60 underline-offset-2 hover:decoration-current focus-visible:outline-1 focus-visible:outline-offset-2", s.link, t.link),
|
|
167
168
|
children: r
|
|
168
169
|
}),
|
|
169
170
|
hr: () => /* @__PURE__ */ y("hr", { className: e("my-5 border-t", s.secondaryBorder, t.hr) }),
|
|
@@ -198,39 +199,39 @@ var O = [
|
|
|
198
199
|
},
|
|
199
200
|
th: ({ children: n, node: r }) => /* @__PURE__ */ y("th", {
|
|
200
201
|
scope: "col",
|
|
201
|
-
className: e("sticky top-0 z-
|
|
202
|
+
className: e("sticky top-0 z-2 max-w-96 px-3 py-2.5 text-start wrap-break-word whitespace-normal", H(r), l.rowDivider, l.tableHeaderCell, t.tableHeaderFont ?? "dial-tiny-lead-semi-text", t.tableCell, t.tableHeader),
|
|
202
203
|
children: n
|
|
203
204
|
}),
|
|
204
205
|
td: ({ children: n, node: r }) => /* @__PURE__ */ y("td", {
|
|
205
|
-
className: e("max-w-96 px-3 py-[7px] align-top
|
|
206
|
+
className: e("max-w-96 px-3 py-[7px] align-top wrap-anywhere whitespace-normal", H(r), l.rowDivider, t.tableBodyCell, t.tableCell),
|
|
206
207
|
children: n
|
|
207
208
|
})
|
|
208
|
-
}), G = m(({ content: i, containerClassName: a, isStreaming: s, streamCharactersPerSecond: c, classNames: l = L, components: u, urlTransform: d, rehypePlugins: p = P, isRawHtmlEnabled: m = !0, thinkingLabel: v = "Thinking", codeBlockCopyLabel: b, codeBlockCopiedLabel: S, codeBlockDownloadLabel: C, codeBlockTheme: w, colors: T, tableActionLabels: E, tableDownloadFilename: D, tableOnOpenInCanvas: k, tableScrollRegionAriaLabel: A, mathScrollRegionAriaLabel: F }) => {
|
|
209
|
-
let
|
|
209
|
+
}), G = m(({ content: i, containerClassName: a, isStreaming: s, streamCharactersPerSecond: c, classNames: l = L, components: u, urlTransform: d, rehypePlugins: p = P, isRawHtmlEnabled: m = !0, thinkingLabel: v = "Thinking", codeBlockCopyLabel: b, codeBlockCopiedLabel: S, codeBlockDownloadLabel: C, codeBlockTheme: w, colors: T, tableActionLabels: E, tableDownloadFilename: D, tableOnOpenInCanvas: k, tableScrollRegionAriaLabel: A, mathScrollRegionAriaLabel: F, codeBlockScrollRegionAriaLabel: B }) => {
|
|
210
|
+
let V = n(i, s, c), H = g(() => r(V), [V]), U = g(() => I(H), [H]), [G, K] = _(null);
|
|
210
211
|
h(() => {
|
|
211
|
-
if (!
|
|
212
|
+
if (!U || G) return;
|
|
212
213
|
let e = !1;
|
|
213
214
|
return (async () => {
|
|
214
215
|
let [t] = await Promise.all([import("rehype-katex"), import("katex/dist/katex.min.css")]);
|
|
215
|
-
e ||
|
|
216
|
+
e || K([t.default, {
|
|
216
217
|
output: "mathml",
|
|
217
218
|
strict: !1
|
|
218
219
|
}]);
|
|
219
220
|
})(), () => {
|
|
220
221
|
e = !0;
|
|
221
222
|
};
|
|
222
|
-
}, [
|
|
223
|
-
let
|
|
223
|
+
}, [U, G]);
|
|
224
|
+
let q = g(() => [
|
|
224
225
|
...m ? j : M,
|
|
225
|
-
...
|
|
226
|
+
...G ? [G] : [],
|
|
226
227
|
N,
|
|
227
228
|
o,
|
|
228
229
|
...p
|
|
229
230
|
], [
|
|
230
231
|
m,
|
|
231
|
-
|
|
232
|
+
G,
|
|
232
233
|
p
|
|
233
|
-
]),
|
|
234
|
+
]), J = t({
|
|
234
235
|
"--cm-markdown-border": T?.border,
|
|
235
236
|
"--cm-blockquote-border": T?.blockquoteBorder,
|
|
236
237
|
"--cm-blockquote-text": T?.blockquoteText,
|
|
@@ -239,8 +240,10 @@ var O = [
|
|
|
239
240
|
"--cm-table-header-text": T?.tableHeaderText,
|
|
240
241
|
"--cm-h6-text": T?.headingSixText,
|
|
241
242
|
"--cm-code-inline-bg": T?.inlineCodeBackground,
|
|
242
|
-
"--cm-code-inline-text": T?.inlineCodeText
|
|
243
|
-
|
|
243
|
+
"--cm-code-inline-text": T?.inlineCodeText,
|
|
244
|
+
"--cm-math-scrollbar": T?.mathScrollbar,
|
|
245
|
+
"--cm-math-focus": T?.mathFocus
|
|
246
|
+
}), Y = g(() => R(d), [d]), X = g(() => ({
|
|
244
247
|
...W(l, {
|
|
245
248
|
isStreaming: s,
|
|
246
249
|
codeBlockCopyLabel: b,
|
|
@@ -251,7 +254,8 @@ var O = [
|
|
|
251
254
|
tableDownloadFilename: D,
|
|
252
255
|
tableOnOpenInCanvas: k,
|
|
253
256
|
tableScrollRegionAriaLabel: A,
|
|
254
|
-
mathScrollRegionAriaLabel: F
|
|
257
|
+
mathScrollRegionAriaLabel: F,
|
|
258
|
+
codeBlockScrollRegionAriaLabel: B
|
|
255
259
|
}),
|
|
256
260
|
...z,
|
|
257
261
|
...u
|
|
@@ -267,20 +271,21 @@ var O = [
|
|
|
267
271
|
k,
|
|
268
272
|
A,
|
|
269
273
|
F,
|
|
274
|
+
B,
|
|
270
275
|
u
|
|
271
276
|
]);
|
|
272
|
-
return s && !
|
|
277
|
+
return s && !V ? /* @__PURE__ */ y(f, {
|
|
273
278
|
label: v,
|
|
274
279
|
colors: T
|
|
275
280
|
}) : /* @__PURE__ */ y("div", {
|
|
276
|
-
style:
|
|
277
|
-
className: e("
|
|
281
|
+
style: J,
|
|
282
|
+
className: e("wrap-anywhere", a),
|
|
278
283
|
children: /* @__PURE__ */ y(x, {
|
|
279
284
|
remarkPlugins: O,
|
|
280
|
-
rehypePlugins:
|
|
281
|
-
components:
|
|
282
|
-
urlTransform:
|
|
283
|
-
children:
|
|
285
|
+
rehypePlugins: q,
|
|
286
|
+
components: X,
|
|
287
|
+
urlTransform: Y,
|
|
288
|
+
children: H
|
|
284
289
|
})
|
|
285
290
|
});
|
|
286
291
|
});
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/components/MarkdownRenderer/MarkdownRenderer.module.scss
|
|
2
|
+
var e = "_thinking_1ql91_9", t = "_h6_1ql91_18", n = "_codeInline_1ql91_22", r = "_secondaryBorder_1ql91_27", i = "_blockquote_1ql91_31", a = "_link_1ql91_36", o = {
|
|
3
|
+
thinking: e,
|
|
3
4
|
"cm-shimmer": "_cm-shimmer_1ql91_1",
|
|
4
|
-
h6:
|
|
5
|
-
codeInline:
|
|
6
|
-
secondaryBorder:
|
|
7
|
-
blockquote:
|
|
8
|
-
link:
|
|
5
|
+
h6: t,
|
|
6
|
+
codeInline: n,
|
|
7
|
+
secondaryBorder: r,
|
|
8
|
+
blockquote: i,
|
|
9
|
+
link: a
|
|
9
10
|
};
|
|
10
11
|
//#endregion
|
|
11
|
-
export {
|
|
12
|
+
export { i as blockquote, n as codeInline, o as default, t as h6, a as link, r as secondaryBorder, e as thinking };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
//#region src/components/MarkdownRenderer/Math/MarkdownMathBlock.module.scss
|
|
2
|
+
var e = "_scrollContainer_n2oom_1", t = "_mathContent_n2oom_24", n = {
|
|
3
|
+
scrollContainer: e,
|
|
4
|
+
mathContent: t
|
|
4
5
|
};
|
|
5
6
|
//#endregion
|
|
6
|
-
export {
|
|
7
|
+
export { n as default, t as mathContent, e as scrollContainer };
|
|
@@ -12,7 +12,7 @@ var a = {}, o = r(({ content: r, containerClassName: o, isStreaming: s, streamCh
|
|
|
12
12
|
}) : /* @__PURE__ */ i("div", {
|
|
13
13
|
className: o,
|
|
14
14
|
children: /* @__PURE__ */ i("p", {
|
|
15
|
-
className: e(l.p, "
|
|
15
|
+
className: e(l.p, "wrap-anywhere whitespace-pre-wrap"),
|
|
16
16
|
children: f
|
|
17
17
|
})
|
|
18
18
|
});
|
|
@@ -23,6 +23,10 @@ export interface MarkdownTableColors {
|
|
|
23
23
|
rowDivider?: string;
|
|
24
24
|
/** Background of a body row on hover. Defaults to `--bg-control-accent-alpha-hover`. */
|
|
25
25
|
rowHoverBackground?: string;
|
|
26
|
+
/** Border color of the copy/download actions toolbar. Defaults to `--stroke-tertiary`. */
|
|
27
|
+
actionsBorder?: string;
|
|
28
|
+
/** Background of the copy/download actions toolbar. Defaults to `--bg-layer-raised`. */
|
|
29
|
+
actionsBackground?: string;
|
|
26
30
|
}
|
|
27
31
|
/** Props for {@link MarkdownTable}. */
|
|
28
32
|
export interface MarkdownTableProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownTable.d.ts","sourceRoot":"","sources":["../../../../src/components/MarkdownRenderer/Table/MarkdownTable.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MarkdownTable.d.ts","sourceRoot":"","sources":["../../../../src/components/MarkdownRenderer/Table/MarkdownTable.tsx"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,EAAE,EACP,KAAK,SAAS,EAMf,MAA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C,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,CAoKhD,CAAC"}
|
|
@@ -5,88 +5,93 @@ import { downloadTextFile as r } from "../../../utils/file-download.js";
|
|
|
5
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
|
-
import {
|
|
9
|
-
import { useMarkdownTableActions as
|
|
10
|
-
import { ElementSize as
|
|
11
|
-
import { memo as
|
|
12
|
-
import { jsx as
|
|
8
|
+
import { DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME as s, MARKDOWN_TABLE_CSV_MIME_TYPE as c, MarkdownTableCopyFormat as l, serializeMarkdownTableRows as u } from "./table-serialization.js";
|
|
9
|
+
import { useMarkdownTableActions as d } from "./useMarkdownTableActions/useMarkdownTableActions.js";
|
|
10
|
+
import { ElementSize as f, GhostIconButton as p, LiveRegion as m, LiveRegionElement as h } from "@epam/ai-dial-ui-kit";
|
|
11
|
+
import { memo as g, useCallback as _, useEffect as v, useRef as y, useState as b } from "react";
|
|
12
|
+
import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
13
13
|
//#region src/components/MarkdownRenderer/Table/MarkdownTable.tsx
|
|
14
|
-
var
|
|
15
|
-
let [
|
|
16
|
-
"--cm-markdown-border":
|
|
17
|
-
"--cm-table-scrollbar":
|
|
18
|
-
"--cm-table-fade":
|
|
19
|
-
"--cm-table-row-divider":
|
|
20
|
-
"--cm-table-row-hover-bg":
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
var C = 2e3, w = g(({ children: s, classNames: g, colors: w, actionLabels: T, downloadFilename: E, isStreaming: D, onOpenInCanvas: O, scrollRegionAriaLabel: k = "Scrollable table" }) => {
|
|
15
|
+
let [A, j] = b(!1), M = y(null), { scrollContainerRef: N, contentRef: P, hasContentBeyondStart: F, hasContentBeyondEnd: I, handleScroll: L } = a(), R = t({
|
|
16
|
+
"--cm-markdown-border": w?.border,
|
|
17
|
+
"--cm-table-scrollbar": w?.scrollbar,
|
|
18
|
+
"--cm-table-fade": w?.fade,
|
|
19
|
+
"--cm-table-row-divider": w?.rowDivider,
|
|
20
|
+
"--cm-table-row-hover-bg": w?.rowHoverBackground,
|
|
21
|
+
"--cm-table-actions-border": w?.actionsBorder,
|
|
22
|
+
"--cm-table-actions-bg": w?.actionsBackground
|
|
23
|
+
}), z = F || I;
|
|
24
|
+
v(() => () => {
|
|
25
|
+
M.current != null && clearTimeout(M.current);
|
|
24
26
|
}, []);
|
|
25
|
-
let
|
|
26
|
-
let e =
|
|
27
|
-
e
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
let B = _(() => {
|
|
28
|
+
let e = P.current;
|
|
29
|
+
if (e == null) return;
|
|
30
|
+
let t = u(Array.from(e.rows), l.Markdown);
|
|
31
|
+
n(t).then((e) => {
|
|
32
|
+
e && (M.current != null && clearTimeout(M.current), j(!0), M.current = setTimeout(() => {
|
|
33
|
+
j(!1);
|
|
34
|
+
}, C));
|
|
31
35
|
});
|
|
32
|
-
}, [
|
|
33
|
-
let e =
|
|
34
|
-
e
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
36
|
+
}, [P]), V = _(() => {
|
|
37
|
+
let e = P.current;
|
|
38
|
+
if (e == null) return;
|
|
39
|
+
let t = u(Array.from(e.rows), l.Csv);
|
|
40
|
+
r(`\uFEFF${t}`, E ?? "table.csv", c);
|
|
41
|
+
}, [P, E]), H = _(() => {
|
|
42
|
+
let e = P.current;
|
|
43
|
+
e != null && O != null && O(u(Array.from(e.rows), l.Markdown));
|
|
44
|
+
}, [P, O]), U = d({
|
|
45
|
+
actionLabels: T,
|
|
46
|
+
isCopied: A,
|
|
47
|
+
onCopy: B,
|
|
48
|
+
onDownloadCsv: V,
|
|
49
|
+
onOpenInCanvas: O == null ? void 0 : H
|
|
50
|
+
}), W = U.length > 0 && !D;
|
|
51
|
+
return /* @__PURE__ */ S("div", {
|
|
52
|
+
style: R,
|
|
53
|
+
className: e("group/table relative w-full max-w-full min-w-0 overflow-clip rounded-xl border", o.tableContainer, g.tableWrapper, i.table),
|
|
48
54
|
children: [
|
|
49
|
-
|
|
55
|
+
W && /* @__PURE__ */ x("div", {
|
|
50
56
|
className: "sticky top-0 z-10 h-0",
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
-
className: "absolute
|
|
53
|
-
children:
|
|
57
|
+
children: /* @__PURE__ */ x("div", {
|
|
58
|
+
className: e("absolute inset-e-2 top-2 flex items-center gap-1 rounded-lg border px-2 py-1 opacity-0 shadow-xs transition-opacity group-hover/table:opacity-100 focus-within:opacity-100", o.actions),
|
|
59
|
+
children: U.map((e) => /* @__PURE__ */ x(p, {
|
|
54
60
|
tooltipProps: { tooltip: e.label },
|
|
55
61
|
"aria-label": e.label,
|
|
56
|
-
icon: /* @__PURE__ */
|
|
62
|
+
icon: /* @__PURE__ */ x("span", {
|
|
57
63
|
"aria-hidden": !0,
|
|
58
64
|
children: e.icon
|
|
59
65
|
}),
|
|
60
|
-
size:
|
|
66
|
+
size: f.Small,
|
|
61
67
|
onClick: e.onClick
|
|
62
68
|
}, e.label))
|
|
63
69
|
})
|
|
64
70
|
}),
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
ref:
|
|
67
|
-
className: e("w-full max-w-full min-w-0 overflow-x-auto", o.scrollContainer,
|
|
68
|
-
[o.tableScrollFadeBoth]:
|
|
69
|
-
[o.tableScrollFadeStart]:
|
|
70
|
-
[o.tableScrollFadeEnd]: !
|
|
71
|
+
/* @__PURE__ */ x("div", {
|
|
72
|
+
ref: N,
|
|
73
|
+
className: e("w-full max-w-full min-w-0 overflow-x-auto", o.scrollContainer, g.tableScrollContainer, {
|
|
74
|
+
[o.tableScrollFadeBoth]: F && I,
|
|
75
|
+
[o.tableScrollFadeStart]: F && !I,
|
|
76
|
+
[o.tableScrollFadeEnd]: !F && I
|
|
71
77
|
}, i.tableScroll),
|
|
72
|
-
onScroll:
|
|
73
|
-
role:
|
|
74
|
-
"aria-label":
|
|
75
|
-
tabIndex:
|
|
76
|
-
children: /* @__PURE__ */
|
|
77
|
-
ref:
|
|
78
|
-
className: e("w-max min-w-full border-collapse",
|
|
79
|
-
children:
|
|
78
|
+
onScroll: L,
|
|
79
|
+
role: z ? "region" : void 0,
|
|
80
|
+
"aria-label": z ? k : void 0,
|
|
81
|
+
tabIndex: z ? 0 : void 0,
|
|
82
|
+
children: /* @__PURE__ */ x("table", {
|
|
83
|
+
ref: P,
|
|
84
|
+
className: e("w-max min-w-full border-collapse", g.tableFont ?? "dial-small-text"),
|
|
85
|
+
children: s
|
|
80
86
|
})
|
|
81
87
|
}),
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
children: O ? C.copiedLabel ?? "" : ""
|
|
88
|
+
T?.copyLabel && /* @__PURE__ */ x(m, {
|
|
89
|
+
visuallyHidden: !0,
|
|
90
|
+
as: h.Span,
|
|
91
|
+
children: A ? T.copiedLabel ?? "" : ""
|
|
87
92
|
})
|
|
88
93
|
]
|
|
89
94
|
});
|
|
90
95
|
});
|
|
91
96
|
//#endregion
|
|
92
|
-
export {
|
|
97
|
+
export { s as DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME, c as MARKDOWN_TABLE_CSV_MIME_TYPE, w as MarkdownTable, l as MarkdownTableCopyFormat, u as serializeMarkdownTableRows };
|