llmasaservice-ui 0.9.5 → 0.9.7

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
@@ -86,6 +86,7 @@ interface AgentPanelProps {
86
86
  thumbsUpClick?: (callId: string) => void;
87
87
  thumbsDownClick?: (callId: string) => void;
88
88
  theme?: "light" | "dark";
89
+ markdownClass?: string;
89
90
  width?: string;
90
91
  height?: string;
91
92
  url?: string;
package/dist/index.d.ts CHANGED
@@ -86,6 +86,7 @@ interface AgentPanelProps {
86
86
  thumbsUpClick?: (callId: string) => void;
87
87
  thumbsDownClick?: (callId: string) => void;
88
88
  theme?: "light" | "dark";
89
+ markdownClass?: string;
89
90
  width?: string;
90
91
  height?: string;
91
92
  url?: string;
package/dist/index.js CHANGED
@@ -500,22 +500,24 @@ var ChatPanel = ({
500
500
  }
501
501
  if (needsUpdate) {
502
502
  ensureConversation().then((convId) => {
503
- console.log(
504
- "updating conversation with customer id and email",
505
- convId,
506
- currentCustomer
507
- );
508
- const r = fetch(`${publicAPIUrl}/conversations/${convId}`, {
509
- method: "POST",
510
- headers: {
511
- "Content-Type": "application/json"
512
- },
513
- body: JSON.stringify({
514
- project_id: project_id != null ? project_id : "",
515
- customerId: updatedValues.customer_id,
516
- customerEmail: updatedValues.customer_user_email
517
- })
518
- });
503
+ if (convId && convId !== "") {
504
+ console.log(
505
+ "updating conversation with customer id and email",
506
+ convId,
507
+ currentCustomer
508
+ );
509
+ const r = fetch(`${publicAPIUrl}/conversations/${convId}`, {
510
+ method: "POST",
511
+ headers: {
512
+ "Content-Type": "application/json"
513
+ },
514
+ body: JSON.stringify({
515
+ project_id: project_id != null ? project_id : "",
516
+ customerId: updatedValues.customer_id,
517
+ customerEmail: updatedValues.customer_user_email
518
+ })
519
+ });
520
+ }
519
521
  });
520
522
  setCurrentCustomer(updatedValues);
521
523
  }
@@ -1375,7 +1377,7 @@ var AgentPanel = ({
1375
1377
  thumbsUpClick,
1376
1378
  thumbsDownClick,
1377
1379
  theme,
1378
- //markdownClass = null,
1380
+ markdownClass = null,
1379
1381
  width,
1380
1382
  height,
1381
1383
  url = "https://chat.llmasaservice.io/",
@@ -1456,6 +1458,7 @@ var AgentPanel = ({
1456
1458
  url,
1457
1459
  title: (_a = agentData == null ? void 0 : agentData.displayTitle) != null ? _a : "",
1458
1460
  theme: theme ? theme : (agentData == null ? void 0 : agentData.displayTheme) === "light" ? "light" : "dark",
1461
+ markdownClass: markdownClass != null ? markdownClass : void 0,
1459
1462
  cssUrl: (_b = agentData == null ? void 0 : agentData.cssUrl) != null ? _b : "",
1460
1463
  height: height ? height : (_c = agentData == null ? void 0 : agentData.displayHeight) != null ? _c : "100vh",
1461
1464
  width: width ? width : (_d = agentData == null ? void 0 : agentData.displayWidth) != null ? _d : "100%",
package/dist/index.mjs CHANGED
@@ -466,22 +466,24 @@ var ChatPanel = ({
466
466
  }
467
467
  if (needsUpdate) {
468
468
  ensureConversation().then((convId) => {
469
- console.log(
470
- "updating conversation with customer id and email",
471
- convId,
472
- currentCustomer
473
- );
474
- const r = fetch(`${publicAPIUrl}/conversations/${convId}`, {
475
- method: "POST",
476
- headers: {
477
- "Content-Type": "application/json"
478
- },
479
- body: JSON.stringify({
480
- project_id: project_id != null ? project_id : "",
481
- customerId: updatedValues.customer_id,
482
- customerEmail: updatedValues.customer_user_email
483
- })
484
- });
469
+ if (convId && convId !== "") {
470
+ console.log(
471
+ "updating conversation with customer id and email",
472
+ convId,
473
+ currentCustomer
474
+ );
475
+ const r = fetch(`${publicAPIUrl}/conversations/${convId}`, {
476
+ method: "POST",
477
+ headers: {
478
+ "Content-Type": "application/json"
479
+ },
480
+ body: JSON.stringify({
481
+ project_id: project_id != null ? project_id : "",
482
+ customerId: updatedValues.customer_id,
483
+ customerEmail: updatedValues.customer_user_email
484
+ })
485
+ });
486
+ }
485
487
  });
486
488
  setCurrentCustomer(updatedValues);
487
489
  }
@@ -1341,7 +1343,7 @@ var AgentPanel = ({
1341
1343
  thumbsUpClick,
1342
1344
  thumbsDownClick,
1343
1345
  theme,
1344
- //markdownClass = null,
1346
+ markdownClass = null,
1345
1347
  width,
1346
1348
  height,
1347
1349
  url = "https://chat.llmasaservice.io/",
@@ -1422,6 +1424,7 @@ var AgentPanel = ({
1422
1424
  url,
1423
1425
  title: (_a = agentData == null ? void 0 : agentData.displayTitle) != null ? _a : "",
1424
1426
  theme: theme ? theme : (agentData == null ? void 0 : agentData.displayTheme) === "light" ? "light" : "dark",
1427
+ markdownClass: markdownClass != null ? markdownClass : void 0,
1425
1428
  cssUrl: (_b = agentData == null ? void 0 : agentData.cssUrl) != null ? _b : "",
1426
1429
  height: height ? height : (_c = agentData == null ? void 0 : agentData.displayHeight) != null ? _c : "100vh",
1427
1430
  width: width ? width : (_d = agentData == null ? void 0 : agentData.displayWidth) != null ? _d : "100%",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "llmasaservice-ui",
3
- "version": "0.9.5",
3
+ "version": "0.9.7",
4
4
  "description": "Prebuilt UI components for LLMAsAService.io",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -18,7 +18,7 @@ export interface AgentPanelProps {
18
18
  thumbsUpClick?: (callId: string) => void;
19
19
  thumbsDownClick?: (callId: string) => void;
20
20
  theme?: "light" | "dark";
21
- //markdownClass?: string;
21
+ markdownClass?: string;
22
22
  width?: string;
23
23
  height?: string;
24
24
  url?: string;
@@ -78,7 +78,7 @@ const AgentPanel: React.FC<AgentPanelProps & ExtraProps> = ({
78
78
  thumbsUpClick,
79
79
  thumbsDownClick,
80
80
  theme,
81
- //markdownClass = null,
81
+ markdownClass = null,
82
82
  width,
83
83
  height,
84
84
  url = "https://chat.llmasaservice.io/",
@@ -178,6 +178,7 @@ const AgentPanel: React.FC<AgentPanelProps & ExtraProps> = ({
178
178
  ? "light"
179
179
  : "dark"
180
180
  }
181
+ markdownClass={markdownClass ?? undefined}
181
182
  cssUrl={agentData?.cssUrl ?? ""}
182
183
  height={height ? height : agentData?.displayHeight ?? "100vh"}
183
184
  width={width ? width : agentData?.displayWidth ?? "100%"}
package/src/ChatPanel.tsx CHANGED
@@ -510,23 +510,25 @@ const ChatPanel: React.FC<ChatPanelProps & ExtraProps> = ({
510
510
  if (needsUpdate) {
511
511
  // update the customer id and email in the conversation
512
512
  ensureConversation().then((convId) => {
513
- console.log(
514
- "updating conversation with customer id and email",
515
- convId,
516
- currentCustomer
517
- );
513
+ if (convId && convId !== "") {
514
+ console.log(
515
+ "updating conversation with customer id and email",
516
+ convId,
517
+ currentCustomer
518
+ );
518
519
 
519
- const r = fetch(`${publicAPIUrl}/conversations/${convId}`, {
520
- method: "POST",
521
- headers: {
522
- "Content-Type": "application/json",
523
- },
524
- body: JSON.stringify({
525
- project_id: project_id ?? "",
526
- customerId: updatedValues.customer_id,
527
- customerEmail: updatedValues.customer_user_email,
528
- }),
529
- });
520
+ const r = fetch(`${publicAPIUrl}/conversations/${convId}`, {
521
+ method: "POST",
522
+ headers: {
523
+ "Content-Type": "application/json",
524
+ },
525
+ body: JSON.stringify({
526
+ project_id: project_id ?? "",
527
+ customerId: updatedValues.customer_id,
528
+ customerEmail: updatedValues.customer_user_email,
529
+ }),
530
+ });
531
+ }
530
532
  });
531
533
 
532
534
  setCurrentCustomer(updatedValues);