@epam/ai-dial-chat-shared 1.1.0-dev.110 → 1.1.0-dev.111
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
2
|
import { CodeBlockTheme } from '../../../types/code-editor';
|
|
3
3
|
/** CSS custom-property overrides for the `MarkdownCodeBlock` component. */
|
|
4
4
|
export interface MarkdownCodeBlockColors {
|
|
@@ -31,6 +31,8 @@ export interface MarkdownCodeBlockProps {
|
|
|
31
31
|
copiedLabel?: string;
|
|
32
32
|
/** Accessible label for the download button. Defaults to `'Download code'`. */
|
|
33
33
|
downloadLabel?: string;
|
|
34
|
+
/** When true, hides the download button while still showing copy. Defaults to `false`. */
|
|
35
|
+
hideDownload?: boolean;
|
|
34
36
|
/** Extra classes applied to the outer container element. */
|
|
35
37
|
containerClassName?: string;
|
|
36
38
|
/** Extra classes applied to the sticky header bar. */
|
|
@@ -39,6 +41,8 @@ export interface MarkdownCodeBlockProps {
|
|
|
39
41
|
codeClassName?: string;
|
|
40
42
|
/** CSS class applied to the language label in the header. Defaults to `'dial-tiny-semi-text uppercase'` plus the module's `.languageLabel` class (`--text-secondary`). */
|
|
41
43
|
languageLabelClassName?: string;
|
|
44
|
+
/** Custom content rendered in the header in place of the plain `language` label, e.g. a language/endpoint select. Defaults to the plain language text. */
|
|
45
|
+
titleSlot?: ReactNode;
|
|
42
46
|
/** Color overrides applied as CSS custom properties. */
|
|
43
47
|
colors?: MarkdownCodeBlockColors;
|
|
44
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/MarkdownRenderer/CodeBlock/CodeBlock.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,EAAQ,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3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,0JAA0J;IAC1J,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,wDAAwD;IACxD,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAClC;AAOD,4FAA4F;AAC5F,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CA2HxD,CAAC"}
|
package/index.js
CHANGED
|
@@ -48806,26 +48806,26 @@ var oD = 2e3, sD = (e, t = oD) => {
|
|
|
48806
48806
|
}, mD = {
|
|
48807
48807
|
dark: pD,
|
|
48808
48808
|
light: pD
|
|
48809
|
-
}, hD = u(({ language: t, value: n, isStreaming: r, theme: o = fe.Dark, copyLabel: s = "Copy code", copiedLabel: c = "Copied!", downloadLabel: l = "Download code",
|
|
48810
|
-
let { isCopied:
|
|
48809
|
+
}, hD = u(({ language: t, value: n, isStreaming: r, theme: o = fe.Dark, copyLabel: s = "Copy code", copiedLabel: c = "Copied!", downloadLabel: l = "Download code", hideDownload: u = !1, containerClassName: d, headerClassName: f, codeClassName: p = "dial-code-text", languageLabelClassName: m = "dial-tiny-semi-text uppercase", titleSlot: h, colors: g }) => {
|
|
48810
|
+
let { isCopied: _, copy: v } = sD(n), x = o === fe.Light;
|
|
48811
48811
|
return /* @__PURE__ */ b("div", {
|
|
48812
48812
|
style: Gt({
|
|
48813
|
-
"--cm-code-block-bg":
|
|
48814
|
-
"--cm-code-block-border":
|
|
48815
|
-
"--cm-code-block-header-bg":
|
|
48816
|
-
"--cm-code-block-language":
|
|
48817
|
-
"--cm-code-block-copied":
|
|
48818
|
-
"--cm-code-block-scrollbar":
|
|
48813
|
+
"--cm-code-block-bg": g?.background,
|
|
48814
|
+
"--cm-code-block-border": g?.border,
|
|
48815
|
+
"--cm-code-block-header-bg": g?.headerBackground,
|
|
48816
|
+
"--cm-code-block-language": g?.language,
|
|
48817
|
+
"--cm-code-block-copied": g?.copied,
|
|
48818
|
+
"--cm-code-block-scrollbar": g?.scrollbar
|
|
48819
48819
|
}),
|
|
48820
|
-
className: Wt("my-4 max-w-full overflow-hidden rounded-xl border", cD.container,
|
|
48820
|
+
className: Wt("my-4 max-w-full overflow-hidden rounded-xl border", cD.container, x && cD.containerLight, d),
|
|
48821
48821
|
children: [/* @__PURE__ */ b("div", {
|
|
48822
|
-
className: Wt("flex min-h-10 items-center justify-between border-b px-
|
|
48823
|
-
children: [/* @__PURE__ */ y("span", {
|
|
48824
|
-
className: Wt(cD.languageLabel,
|
|
48822
|
+
className: Wt("flex min-h-10 items-center justify-between border-b px-4", h == null ? "py-2" : "py-0", cD.header, f),
|
|
48823
|
+
children: [h ?? /* @__PURE__ */ y("span", {
|
|
48824
|
+
className: Wt(cD.languageLabel, m),
|
|
48825
48825
|
children: t
|
|
48826
48826
|
}), !r && /* @__PURE__ */ b("div", {
|
|
48827
48827
|
className: "flex items-center gap-1",
|
|
48828
|
-
children: [/* @__PURE__ */ y(a, {
|
|
48828
|
+
children: [!u && /* @__PURE__ */ y(a, {
|
|
48829
48829
|
icon: /* @__PURE__ */ y(An, { size: e.SM }),
|
|
48830
48830
|
"aria-label": l,
|
|
48831
48831
|
size: i.Small,
|
|
@@ -48833,7 +48833,7 @@ var oD = 2e3, sD = (e, t = oD) => {
|
|
|
48833
48833
|
hn(n, `code.${fn(t)}`);
|
|
48834
48834
|
}
|
|
48835
48835
|
}), /* @__PURE__ */ y(a, {
|
|
48836
|
-
icon:
|
|
48836
|
+
icon: _ ? /* @__PURE__ */ y(On, {
|
|
48837
48837
|
size: e.SM,
|
|
48838
48838
|
className: cD.copiedIcon,
|
|
48839
48839
|
"aria-hidden": !0
|
|
@@ -48841,9 +48841,9 @@ var oD = 2e3, sD = (e, t = oD) => {
|
|
|
48841
48841
|
size: e.SM,
|
|
48842
48842
|
"aria-hidden": !0
|
|
48843
48843
|
}),
|
|
48844
|
-
"aria-label":
|
|
48844
|
+
"aria-label": _ ? c : s,
|
|
48845
48845
|
size: i.Small,
|
|
48846
|
-
onClick:
|
|
48846
|
+
onClick: v
|
|
48847
48847
|
})]
|
|
48848
48848
|
})]
|
|
48849
48849
|
}), /* @__PURE__ */ y("div", {
|
|
@@ -48861,12 +48861,12 @@ var oD = 2e3, sD = (e, t = oD) => {
|
|
|
48861
48861
|
padding: "14px 16px",
|
|
48862
48862
|
letterSpacing: 0
|
|
48863
48863
|
},
|
|
48864
|
-
codeTagProps: { className:
|
|
48864
|
+
codeTagProps: { className: p },
|
|
48865
48865
|
children: n
|
|
48866
48866
|
}) : /* @__PURE__ */ y("pre", {
|
|
48867
48867
|
className: "p-4",
|
|
48868
48868
|
children: /* @__PURE__ */ y("code", {
|
|
48869
|
-
className: Wt("whitespace-pre",
|
|
48869
|
+
className: Wt("whitespace-pre", p),
|
|
48870
48870
|
children: n
|
|
48871
48871
|
})
|
|
48872
48872
|
})
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-chat-shared",
|
|
3
3
|
"description": "Shared domain models, utilities, and UI components for AI DIAL Chat libraries",
|
|
4
|
-
"version": "1.1.0-dev.
|
|
4
|
+
"version": "1.1.0-dev.111",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|