llmasaservice-ui 0.2.10 → 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 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
@@ -69,7 +69,8 @@ var import_react = __toESM(require("react"));
69
69
  var import_react_markdown = __toESM(require("react-markdown"));
70
70
  var import_remark_gfm = __toESM(require("remark-gfm"));
71
71
  var import_react_syntax_highlighter = require("react-syntax-highlighter");
72
- var import_prism = require("react-syntax-highlighter/dist/esm/styles/prism");
72
+ var import_material_dark = __toESM(require("react-syntax-highlighter/dist/cjs/styles/prism/material-dark.js"));
73
+ var import_material_light = __toESM(require("react-syntax-highlighter/dist/cjs/styles/prism/material-light.js"));
73
74
  var ChatPanel = ({
74
75
  project_id,
75
76
  initialPrompt = "",
@@ -86,7 +87,8 @@ var ChatPanel = ({
86
87
  height = "100vh",
87
88
  url = null,
88
89
  scrollToEnd = false,
89
- initialMessage = ""
90
+ initialMessage = "",
91
+ prismStyle = theme === "light" ? import_material_light.default : import_material_dark.default
90
92
  }) => {
91
93
  const { send, response, idle, stop } = (0, import_llmasaservice_client.useLLM)({
92
94
  project_id,
@@ -231,7 +233,7 @@ var ChatPanel = ({
231
233
  ), /* @__PURE__ */ import_react.default.createElement(
232
234
  import_react_syntax_highlighter.Prism,
233
235
  __spreadValues({
234
- style: theme === "light" ? import_prism.materialLight : import_prism.materialDark,
236
+ style: prismStyle,
235
237
  PreTag: "div",
236
238
  language: match[1]
237
239
  }, props),
package/dist/index.mjs CHANGED
@@ -36,7 +36,8 @@ import React, { useEffect, useRef, useState } from "react";
36
36
  import ReactMarkdown from "react-markdown";
37
37
  import remarkGfm from "remark-gfm";
38
38
  import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
39
- import { materialLight, materialDark } from "react-syntax-highlighter/dist/esm/styles/prism";
39
+ import materialDark from "react-syntax-highlighter/dist/cjs/styles/prism/material-dark.js";
40
+ import materialLight from "react-syntax-highlighter/dist/cjs/styles/prism/material-light.js";
40
41
  var ChatPanel = ({
41
42
  project_id,
42
43
  initialPrompt = "",
@@ -53,7 +54,8 @@ var ChatPanel = ({
53
54
  height = "100vh",
54
55
  url = null,
55
56
  scrollToEnd = false,
56
- initialMessage = ""
57
+ initialMessage = "",
58
+ prismStyle = theme === "light" ? materialLight : materialDark
57
59
  }) => {
58
60
  const { send, response, idle, stop } = useLLM({
59
61
  project_id,
@@ -198,7 +200,7 @@ var ChatPanel = ({
198
200
  ), /* @__PURE__ */ React.createElement(
199
201
  SyntaxHighlighter,
200
202
  __spreadValues({
201
- style: theme === "light" ? materialLight : materialDark,
203
+ style: prismStyle,
202
204
  PreTag: "div",
203
205
  language: match[1]
204
206
  }, props),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "llmasaservice-ui",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
  "description": "Prebuilt UI components for LLMAsAService.io",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
package/src/ChatPanel.tsx CHANGED
@@ -4,11 +4,9 @@ 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
-
8
- //import materialDark from "react-syntax-highlighter/dist/cjs/styles/prism/material-dark";
9
- //import materialDark from 'react-syntax-highlighter/dist/cjs/styles/prism/material-dark.js';
10
- //import materialLight from "react-syntax-highlighter/dist/cjs/styles/prism/material-light.js";
11
- import { materialLight, materialDark } from "react-syntax-highlighter/dist/esm/styles/prism";
7
+ import PrismStyle from "react-syntax-highlighter";
8
+ import materialDark from 'react-syntax-highlighter/dist/cjs/styles/prism/material-dark.js';
9
+ import materialLight from "react-syntax-highlighter/dist/cjs/styles/prism/material-light.js";
12
10
 
13
11
  export interface ChatPanelProps {
14
12
  project_id: string;
@@ -27,6 +25,7 @@ export interface ChatPanelProps {
27
25
  height?: string;
28
26
  url?: string | null;
29
27
  scrollToEnd?: boolean;
28
+ prismStyle?: PrismStyle;
30
29
  }
31
30
 
32
31
  interface ExtraProps extends React.HTMLAttributes<HTMLElement> {
@@ -50,6 +49,7 @@ const ChatPanel: React.FC<ChatPanelProps & ExtraProps> = ({
50
49
  url = null,
51
50
  scrollToEnd = false,
52
51
  initialMessage = "",
52
+ prismStyle = theme === "light" ? materialLight: materialDark,
53
53
  }) => {
54
54
  const { send, response, idle, stop } = useLLM({
55
55
  project_id: project_id,
@@ -213,7 +213,7 @@ const ChatPanel: React.FC<ChatPanelProps & ExtraProps> = ({
213
213
  </button>
214
214
  </div>
215
215
  <SyntaxHighlighter
216
- style={theme === "light" ? materialLight : materialDark}
216
+ style={prismStyle}
217
217
  PreTag="div"
218
218
  language={match[1]}
219
219
  {...props}
@@ -1,10 +1,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
- }
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
+ }