llmasaservice-ui 0.2.11 → 0.2.12
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/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -2
- package/dist/index.mjs +3 -2
- package/package.json +1 -1
- package/src/ChatPanel.tsx +4 -2
- package/types/declarations.d.ts +10 -10
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LLMAsAServiceCustomer } from 'llmasaservice-client';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import PrismStyle from 'react-syntax-highlighter';
|
|
3
4
|
|
|
4
5
|
interface ChatPanelProps {
|
|
5
6
|
project_id: string;
|
|
@@ -21,6 +22,7 @@ interface ChatPanelProps {
|
|
|
21
22
|
height?: string;
|
|
22
23
|
url?: string | null;
|
|
23
24
|
scrollToEnd?: boolean;
|
|
25
|
+
prismStyle?: PrismStyle;
|
|
24
26
|
}
|
|
25
27
|
interface ExtraProps extends React.HTMLAttributes<HTMLElement> {
|
|
26
28
|
inline?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LLMAsAServiceCustomer } from 'llmasaservice-client';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import PrismStyle from 'react-syntax-highlighter';
|
|
3
4
|
|
|
4
5
|
interface ChatPanelProps {
|
|
5
6
|
project_id: string;
|
|
@@ -21,6 +22,7 @@ interface ChatPanelProps {
|
|
|
21
22
|
height?: string;
|
|
22
23
|
url?: string | null;
|
|
23
24
|
scrollToEnd?: boolean;
|
|
25
|
+
prismStyle?: PrismStyle;
|
|
24
26
|
}
|
|
25
27
|
interface ExtraProps extends React.HTMLAttributes<HTMLElement> {
|
|
26
28
|
inline?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -87,7 +87,8 @@ var ChatPanel = ({
|
|
|
87
87
|
height = "100vh",
|
|
88
88
|
url = null,
|
|
89
89
|
scrollToEnd = false,
|
|
90
|
-
initialMessage = ""
|
|
90
|
+
initialMessage = "",
|
|
91
|
+
prismStyle = theme === "light" ? import_material_light.default : import_material_dark.default
|
|
91
92
|
}) => {
|
|
92
93
|
const { send, response, idle, stop } = (0, import_llmasaservice_client.useLLM)({
|
|
93
94
|
project_id,
|
|
@@ -232,7 +233,7 @@ var ChatPanel = ({
|
|
|
232
233
|
), /* @__PURE__ */ import_react.default.createElement(
|
|
233
234
|
import_react_syntax_highlighter.Prism,
|
|
234
235
|
__spreadValues({
|
|
235
|
-
style:
|
|
236
|
+
style: prismStyle,
|
|
236
237
|
PreTag: "div",
|
|
237
238
|
language: match[1]
|
|
238
239
|
}, props),
|
package/dist/index.mjs
CHANGED
|
@@ -54,7 +54,8 @@ var ChatPanel = ({
|
|
|
54
54
|
height = "100vh",
|
|
55
55
|
url = null,
|
|
56
56
|
scrollToEnd = false,
|
|
57
|
-
initialMessage = ""
|
|
57
|
+
initialMessage = "",
|
|
58
|
+
prismStyle = theme === "light" ? materialLight : materialDark
|
|
58
59
|
}) => {
|
|
59
60
|
const { send, response, idle, stop } = useLLM({
|
|
60
61
|
project_id,
|
|
@@ -199,7 +200,7 @@ var ChatPanel = ({
|
|
|
199
200
|
), /* @__PURE__ */ React.createElement(
|
|
200
201
|
SyntaxHighlighter,
|
|
201
202
|
__spreadValues({
|
|
202
|
-
style:
|
|
203
|
+
style: prismStyle,
|
|
203
204
|
PreTag: "div",
|
|
204
205
|
language: match[1]
|
|
205
206
|
}, props),
|
package/package.json
CHANGED
package/src/ChatPanel.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import ReactMarkdown from "react-markdown";
|
|
|
4
4
|
import "./ChatPanel.css";
|
|
5
5
|
import remarkGfm from "remark-gfm";
|
|
6
6
|
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
|
|
7
|
-
|
|
7
|
+
import PrismStyle from "react-syntax-highlighter";
|
|
8
8
|
import materialDark from 'react-syntax-highlighter/dist/cjs/styles/prism/material-dark.js';
|
|
9
9
|
import materialLight from "react-syntax-highlighter/dist/cjs/styles/prism/material-light.js";
|
|
10
10
|
|
|
@@ -25,6 +25,7 @@ export interface ChatPanelProps {
|
|
|
25
25
|
height?: string;
|
|
26
26
|
url?: string | null;
|
|
27
27
|
scrollToEnd?: boolean;
|
|
28
|
+
prismStyle?: PrismStyle;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
interface ExtraProps extends React.HTMLAttributes<HTMLElement> {
|
|
@@ -48,6 +49,7 @@ const ChatPanel: React.FC<ChatPanelProps & ExtraProps> = ({
|
|
|
48
49
|
url = null,
|
|
49
50
|
scrollToEnd = false,
|
|
50
51
|
initialMessage = "",
|
|
52
|
+
prismStyle = theme === "light" ? materialLight: materialDark,
|
|
51
53
|
}) => {
|
|
52
54
|
const { send, response, idle, stop } = useLLM({
|
|
53
55
|
project_id: project_id,
|
|
@@ -211,7 +213,7 @@ const ChatPanel: React.FC<ChatPanelProps & ExtraProps> = ({
|
|
|
211
213
|
</button>
|
|
212
214
|
</div>
|
|
213
215
|
<SyntaxHighlighter
|
|
214
|
-
style={
|
|
216
|
+
style={prismStyle}
|
|
215
217
|
PreTag="div"
|
|
216
218
|
language={match[1]}
|
|
217
219
|
{...props}
|
package/types/declarations.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
declare module
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
declare module "react-syntax-highlighter/dist/cjs/styles/prism/material-dark.js" {
|
|
2
|
+
import { PrismStyle } from "react-syntax-highlighter";
|
|
3
|
+
const style: PrismStyle;
|
|
4
|
+
export default style;
|
|
5
|
+
}
|
|
6
|
+
declare module "react-syntax-highlighter/dist/cjs/styles/prism/material-light.js" {
|
|
7
|
+
import { PrismStyle } from "react-syntax-highlighter";
|
|
8
|
+
const style: PrismStyle;
|
|
9
|
+
export default style;
|
|
10
|
+
}
|