llmasaservice-ui 0.2.4 → 0.2.5

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.css CHANGED
@@ -151,6 +151,19 @@
151
151
  .side-panel .scroll-button:hover {
152
152
  background-color: #0056b3;
153
153
  }
154
+ .side-panel table {
155
+ border-collapse: collapse;
156
+ margin-bottom: 1em;
157
+ border: 1px solid #777;
158
+ }
159
+ .side-panel th {
160
+ border: 1px solid #777;
161
+ padding: 8px;
162
+ }
163
+ .side-panel td {
164
+ border: 1px solid #777;
165
+ padding: 8px;
166
+ }
154
167
  .side-panel-dark {
155
168
  font-family:
156
169
  "Roboto",
@@ -306,26 +319,16 @@
306
319
  .side-panel-dark .scroll-button:hover {
307
320
  background-color: #0056b3;
308
321
  }
309
- .chat-status {
310
- display: flex;
311
- align-items: center;
312
- justify-content: center;
313
- padding: 10px;
314
- border-radius: 20px;
315
- background-color: #f0f0f0;
316
- }
317
- .loading-dots {
318
- font-size: 20px;
319
- animation: blink 1s linear infinite;
320
- }
321
- @keyframes blink {
322
- 0% {
323
- opacity: 1;
324
- }
325
- 50% {
326
- opacity: 0;
327
- }
328
- 100% {
329
- opacity: 1;
330
- }
322
+ .side-panel-dark table {
323
+ border-collapse: collapse;
324
+ margin-bottom: 1em;
325
+ border: 1px solid #ddd;
326
+ }
327
+ .side-panel-dark th {
328
+ border: 1px solid #ddd;
329
+ padding: 8px;
330
+ }
331
+ .side-panel-dark td {
332
+ border: 1px solid #ddd;
333
+ padding: 8px;
331
334
  }
package/dist/index.d.mts CHANGED
@@ -22,6 +22,9 @@ interface ChatPanelProps {
22
22
  url?: string | null;
23
23
  scrollToEnd?: boolean;
24
24
  }
25
- declare const ChatPanel: React.FC<ChatPanelProps>;
25
+ interface ExtraProps extends React.HTMLAttributes<HTMLElement> {
26
+ inline?: boolean;
27
+ }
28
+ declare const ChatPanel: React.FC<ChatPanelProps & ExtraProps>;
26
29
 
27
30
  export { ChatPanel, type ChatPanelProps };
package/dist/index.d.ts CHANGED
@@ -22,6 +22,9 @@ interface ChatPanelProps {
22
22
  url?: string | null;
23
23
  scrollToEnd?: boolean;
24
24
  }
25
- declare const ChatPanel: React.FC<ChatPanelProps>;
25
+ interface ExtraProps extends React.HTMLAttributes<HTMLElement> {
26
+ inline?: boolean;
27
+ }
28
+ declare const ChatPanel: React.FC<ChatPanelProps & ExtraProps>;
26
29
 
27
30
  export { ChatPanel, type ChatPanelProps };
package/dist/index.js CHANGED
@@ -55,6 +55,7 @@ module.exports = __toCommonJS(llmasaservice_ui_exports);
55
55
  var import_llmasaservice_client = require("llmasaservice-client");
56
56
  var import_react = __toESM(require("react"));
57
57
  var import_react_markdown = __toESM(require("react-markdown"));
58
+ var import_remark_gfm = __toESM(require("remark-gfm"));
58
59
  var ChatPanel = ({
59
60
  project_id,
60
61
  initialPrompt = "",
@@ -174,7 +175,7 @@ var ChatPanel = ({
174
175
  className: "side-panel" + (theme === "light" ? "" : "-dark")
175
176
  },
176
177
  /* @__PURE__ */ import_react.default.createElement("div", { className: "title" }, title),
177
- /* @__PURE__ */ import_react.default.createElement("div", { className: "responseArea", ref: responseAreaRef }, initialMessage && initialMessage !== "" ? /* @__PURE__ */ import_react.default.createElement("div", { className: "history-entry" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "response" }, /* @__PURE__ */ import_react.default.createElement(import_react_markdown.default, { className: markdownClass }, initialMessage))) : null, Object.entries(history).map(([prompt, response2], index) => /* @__PURE__ */ import_react.default.createElement("div", { className: "history-entry", key: index }, hideInitialPrompt && index === 0 ? null : /* @__PURE__ */ import_react.default.createElement("div", { className: "prompt" }, prompt), /* @__PURE__ */ import_react.default.createElement("div", { className: "response" }, index === Object.keys(history).length - 1 && isLoading ? /* @__PURE__ */ import_react.default.createElement("div", { className: "loading-text" }, "loading...") : null, /* @__PURE__ */ import_react.default.createElement(import_react_markdown.default, { className: markdownClass }, response2), /* @__PURE__ */ import_react.default.createElement("div", { className: "button-container" }, /* @__PURE__ */ import_react.default.createElement(
178
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "responseArea", ref: responseAreaRef }, initialMessage && initialMessage !== "" ? /* @__PURE__ */ import_react.default.createElement("div", { className: "history-entry" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "response" }, /* @__PURE__ */ import_react.default.createElement(import_react_markdown.default, { className: markdownClass, remarkPlugins: [import_remark_gfm.default] }, initialMessage))) : null, Object.entries(history).map(([prompt, response2], index) => /* @__PURE__ */ import_react.default.createElement("div", { className: "history-entry", key: index }, hideInitialPrompt && index === 0 ? null : /* @__PURE__ */ import_react.default.createElement("div", { className: "prompt" }, prompt), /* @__PURE__ */ import_react.default.createElement("div", { className: "response" }, index === Object.keys(history).length - 1 && isLoading ? /* @__PURE__ */ import_react.default.createElement("div", { className: "loading-text" }, "loading...") : null, /* @__PURE__ */ import_react.default.createElement(import_react_markdown.default, { className: markdownClass, remarkPlugins: [import_remark_gfm.default] }, response2), /* @__PURE__ */ import_react.default.createElement("div", { className: "button-container" }, /* @__PURE__ */ import_react.default.createElement(
178
179
  "button",
179
180
  {
180
181
  className: "copy-button",
package/dist/index.mjs CHANGED
@@ -22,6 +22,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
22
  import { useLLM } from "llmasaservice-client";
23
23
  import React, { useEffect, useRef, useState } from "react";
24
24
  import ReactMarkdown from "react-markdown";
25
+ import remarkGfm from "remark-gfm";
25
26
  var ChatPanel = ({
26
27
  project_id,
27
28
  initialPrompt = "",
@@ -141,7 +142,7 @@ var ChatPanel = ({
141
142
  className: "side-panel" + (theme === "light" ? "" : "-dark")
142
143
  },
143
144
  /* @__PURE__ */ React.createElement("div", { className: "title" }, title),
144
- /* @__PURE__ */ React.createElement("div", { className: "responseArea", ref: responseAreaRef }, initialMessage && initialMessage !== "" ? /* @__PURE__ */ React.createElement("div", { className: "history-entry" }, /* @__PURE__ */ React.createElement("div", { className: "response" }, /* @__PURE__ */ React.createElement(ReactMarkdown, { className: markdownClass }, initialMessage))) : null, Object.entries(history).map(([prompt, response2], index) => /* @__PURE__ */ React.createElement("div", { className: "history-entry", key: index }, hideInitialPrompt && index === 0 ? null : /* @__PURE__ */ React.createElement("div", { className: "prompt" }, prompt), /* @__PURE__ */ React.createElement("div", { className: "response" }, index === Object.keys(history).length - 1 && isLoading ? /* @__PURE__ */ React.createElement("div", { className: "loading-text" }, "loading...") : null, /* @__PURE__ */ React.createElement(ReactMarkdown, { className: markdownClass }, response2), /* @__PURE__ */ React.createElement("div", { className: "button-container" }, /* @__PURE__ */ React.createElement(
145
+ /* @__PURE__ */ React.createElement("div", { className: "responseArea", ref: responseAreaRef }, initialMessage && initialMessage !== "" ? /* @__PURE__ */ React.createElement("div", { className: "history-entry" }, /* @__PURE__ */ React.createElement("div", { className: "response" }, /* @__PURE__ */ React.createElement(ReactMarkdown, { className: markdownClass, remarkPlugins: [remarkGfm] }, initialMessage))) : null, Object.entries(history).map(([prompt, response2], index) => /* @__PURE__ */ React.createElement("div", { className: "history-entry", key: index }, hideInitialPrompt && index === 0 ? null : /* @__PURE__ */ React.createElement("div", { className: "prompt" }, prompt), /* @__PURE__ */ React.createElement("div", { className: "response" }, index === Object.keys(history).length - 1 && isLoading ? /* @__PURE__ */ React.createElement("div", { className: "loading-text" }, "loading...") : null, /* @__PURE__ */ React.createElement(ReactMarkdown, { className: markdownClass, remarkPlugins: [remarkGfm] }, response2), /* @__PURE__ */ React.createElement("div", { className: "button-container" }, /* @__PURE__ */ React.createElement(
145
146
  "button",
146
147
  {
147
148
  className: "copy-button",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "llmasaservice-ui",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Prebuilt UI components for LLMAsAService.io",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -30,6 +30,7 @@
30
30
  "@storybook/react-webpack5": "^8.2.7",
31
31
  "@storybook/test": "^8.2.7",
32
32
  "@types/react": "^18.3.3",
33
+ "@types/react-syntax-highlighter": "^15.5.13",
33
34
  "react": "^18.3.1",
34
35
  "storybook": "^8.2.7",
35
36
  "tsup": "^8.2.4",
@@ -44,7 +45,8 @@
44
45
  ],
45
46
  "dependencies": {
46
47
  "llmasaservice-client": "^0.4.0",
47
- "react-markdown": "^9.0.1"
48
+ "react-markdown": "^9.0.1",
49
+ "remark-gfm": "^4.0.0"
48
50
  },
49
51
  "peerDependencies": {
50
52
  "react": "^18.3.0",
package/src/ChatPanel.css CHANGED
@@ -165,6 +165,22 @@
165
165
  background-color: #0056b3;
166
166
  }
167
167
 
168
+ .side-panel table {
169
+ border-collapse: collapse;
170
+ margin-bottom: 1em;
171
+ border: 1px solid #777;
172
+ }
173
+
174
+ .side-panel th {
175
+ border: 1px solid #777;
176
+ padding: 8px;
177
+ }
178
+
179
+ .side-panel td {
180
+ border: 1px solid #777;
181
+ padding: 8px;
182
+ }
183
+
168
184
  .side-panel-dark {
169
185
  font-family: "Roboto", Arial, Helvetica, sans-serif;
170
186
  font-size: small;
@@ -322,28 +338,18 @@
322
338
  background-color: #0056b3;
323
339
  }
324
340
 
325
- .chat-status {
326
- display: flex;
327
- align-items: center;
328
- justify-content: center;
329
- padding: 10px;
330
- border-radius: 20px;
331
- background-color: #f0f0f0;
341
+ .side-panel-dark table {
342
+ border-collapse: collapse;
343
+ margin-bottom: 1em;
344
+ border: 1px solid #ddd;
332
345
  }
333
346
 
334
- .loading-dots {
335
- font-size: 20px;
336
- animation: blink 1s linear infinite;
347
+ .side-panel-dark th {
348
+ border: 1px solid #ddd;
349
+ padding: 8px;
337
350
  }
338
351
 
339
- @keyframes blink {
340
- 0% {
341
- opacity: 1;
342
- }
343
- 50% {
344
- opacity: 0;
345
- }
346
- 100% {
347
- opacity: 1;
348
- }
352
+ .side-panel-dark td {
353
+ border: 1px solid #ddd;
354
+ padding: 8px;
349
355
  }
package/src/ChatPanel.tsx CHANGED
@@ -2,7 +2,7 @@ import { LLMAsAServiceCustomer, useLLM } from "llmasaservice-client";
2
2
  import React, { useEffect, useRef, useState } from "react";
3
3
  import ReactMarkdown from "react-markdown";
4
4
  import "./ChatPanel.css";
5
- import ChatStatus from "./ChatStatus";
5
+ import remarkGfm from "remark-gfm";
6
6
 
7
7
  export interface ChatPanelProps {
8
8
  project_id: string;
@@ -23,7 +23,11 @@ export interface ChatPanelProps {
23
23
  scrollToEnd?: boolean;
24
24
  }
25
25
 
26
- const ChatPanel: React.FC<ChatPanelProps> = ({
26
+ interface ExtraProps extends React.HTMLAttributes<HTMLElement> {
27
+ inline?: boolean;
28
+ }
29
+
30
+ const ChatPanel: React.FC<ChatPanelProps & ExtraProps> = ({
27
31
  project_id,
28
32
  initialPrompt = "",
29
33
  title = "Chat",
@@ -173,7 +177,7 @@ const ChatPanel: React.FC<ChatPanelProps> = ({
173
177
  {initialMessage && initialMessage !== "" ? (
174
178
  <div className="history-entry">
175
179
  <div className="response">
176
- <ReactMarkdown className={markdownClass}>
180
+ <ReactMarkdown className={markdownClass} remarkPlugins={[remarkGfm]}>
177
181
  {initialMessage}
178
182
  </ReactMarkdown>
179
183
  </div>
@@ -189,7 +193,7 @@ const ChatPanel: React.FC<ChatPanelProps> = ({
189
193
  {index === Object.keys(history).length - 1 && isLoading ? (
190
194
  <div className="loading-text">loading...</div>
191
195
  ) : null}
192
- <ReactMarkdown className={markdownClass}>
196
+ <ReactMarkdown className={markdownClass} remarkPlugins={[remarkGfm]} >
193
197
  {response}
194
198
  </ReactMarkdown>
195
199
  <div className="button-container">