llmasaservice-ui 0.6.0 → 0.6.1
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.js +27 -30
- package/dist/index.mjs +27 -30
- package/package.json +1 -1
- package/src/ChatPanel.tsx +41 -36
package/dist/index.js
CHANGED
|
@@ -507,36 +507,33 @@ var ChatPanel = ({
|
|
|
507
507
|
};
|
|
508
508
|
const convertHistoryToHTML = (history2) => {
|
|
509
509
|
const stylesheet = `
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
margin-left: 25px;
|
|
538
|
-
}
|
|
539
|
-
</style>
|
|
510
|
+
<style>
|
|
511
|
+
.conversation-history {
|
|
512
|
+
font-family: Arial, sans-serif;
|
|
513
|
+
line-height: 1.5; /* Slightly increase line height for readability */
|
|
514
|
+
}
|
|
515
|
+
.history-entry {
|
|
516
|
+
margin-bottom: 15px;
|
|
517
|
+
}
|
|
518
|
+
.prompt-container, .response-container {
|
|
519
|
+
margin-bottom: 10px; /* Adjusted spacing */
|
|
520
|
+
}
|
|
521
|
+
.prompt, .response {
|
|
522
|
+
display: block; /* Ensure they take up the full row */
|
|
523
|
+
margin: 5px 0; /* Add vertical spacing */
|
|
524
|
+
padding: 10px; /* Increase padding for better spacing */
|
|
525
|
+
border-radius: 5px;
|
|
526
|
+
max-width: 80%; /* Keep width constrained */
|
|
527
|
+
}
|
|
528
|
+
.prompt {
|
|
529
|
+
background-color: #efefef;
|
|
530
|
+
margin-left: 0; /* Align to the left */
|
|
531
|
+
}
|
|
532
|
+
.response {
|
|
533
|
+
background-color: #f0fcfd;
|
|
534
|
+
margin-left: 25px; /* Indent slightly for visual differentiation */
|
|
535
|
+
}
|
|
536
|
+
</style>
|
|
540
537
|
`;
|
|
541
538
|
let html = `
|
|
542
539
|
<html>
|
package/dist/index.mjs
CHANGED
|
@@ -474,36 +474,33 @@ var ChatPanel = ({
|
|
|
474
474
|
};
|
|
475
475
|
const convertHistoryToHTML = (history2) => {
|
|
476
476
|
const stylesheet = `
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
margin-left: 25px;
|
|
505
|
-
}
|
|
506
|
-
</style>
|
|
477
|
+
<style>
|
|
478
|
+
.conversation-history {
|
|
479
|
+
font-family: Arial, sans-serif;
|
|
480
|
+
line-height: 1.5; /* Slightly increase line height for readability */
|
|
481
|
+
}
|
|
482
|
+
.history-entry {
|
|
483
|
+
margin-bottom: 15px;
|
|
484
|
+
}
|
|
485
|
+
.prompt-container, .response-container {
|
|
486
|
+
margin-bottom: 10px; /* Adjusted spacing */
|
|
487
|
+
}
|
|
488
|
+
.prompt, .response {
|
|
489
|
+
display: block; /* Ensure they take up the full row */
|
|
490
|
+
margin: 5px 0; /* Add vertical spacing */
|
|
491
|
+
padding: 10px; /* Increase padding for better spacing */
|
|
492
|
+
border-radius: 5px;
|
|
493
|
+
max-width: 80%; /* Keep width constrained */
|
|
494
|
+
}
|
|
495
|
+
.prompt {
|
|
496
|
+
background-color: #efefef;
|
|
497
|
+
margin-left: 0; /* Align to the left */
|
|
498
|
+
}
|
|
499
|
+
.response {
|
|
500
|
+
background-color: #f0fcfd;
|
|
501
|
+
margin-left: 25px; /* Indent slightly for visual differentiation */
|
|
502
|
+
}
|
|
503
|
+
</style>
|
|
507
504
|
`;
|
|
508
505
|
let html = `
|
|
509
506
|
<html>
|
package/package.json
CHANGED
package/src/ChatPanel.tsx
CHANGED
|
@@ -119,7 +119,8 @@ const ChatPanel: React.FC<ChatPanelProps & ExtraProps> = ({
|
|
|
119
119
|
const [isAtBottom, setIsAtBottom] = useState(true);
|
|
120
120
|
const [isEmailModalOpen, setIsEmailModalOpen] = useState(false);
|
|
121
121
|
const [isCallToActionModalOpen, setIsCallToActionModalOpen] = useState(false);
|
|
122
|
-
const [hasSentCallToActionEmail, setHasSentCallToActionEmail] =
|
|
122
|
+
const [hasSentCallToActionEmail, setHasSentCallToActionEmail] =
|
|
123
|
+
useState(false);
|
|
123
124
|
|
|
124
125
|
const handleSendEmail = (to: string, from: string) => {
|
|
125
126
|
sendConversationsViaEmail(to, `Conversation History from ${title}`, from);
|
|
@@ -129,17 +130,23 @@ const ChatPanel: React.FC<ChatPanelProps & ExtraProps> = ({
|
|
|
129
130
|
|
|
130
131
|
useEffect(() => {
|
|
131
132
|
const handleBeforeUnload = (event: BeforeUnloadEvent) => {
|
|
132
|
-
if (
|
|
133
|
+
if (
|
|
134
|
+
callToActionMustSendEmail &&
|
|
135
|
+
showCallToAction &&
|
|
136
|
+
callToActionEmailAddress &&
|
|
137
|
+
callToActionEmailAddress !== "" &&
|
|
138
|
+
!hasSentCallToActionEmail
|
|
139
|
+
) {
|
|
133
140
|
event.preventDefault();
|
|
134
|
-
event.returnValue =
|
|
141
|
+
event.returnValue = ""; // Chrome requires returnValue to be set
|
|
135
142
|
setIsCallToActionModalOpen(true);
|
|
136
143
|
}
|
|
137
144
|
};
|
|
138
145
|
|
|
139
|
-
window.addEventListener(
|
|
146
|
+
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
140
147
|
|
|
141
148
|
return () => {
|
|
142
|
-
window.removeEventListener(
|
|
149
|
+
window.removeEventListener("beforeunload", handleBeforeUnload);
|
|
143
150
|
};
|
|
144
151
|
}, []);
|
|
145
152
|
|
|
@@ -489,36 +496,33 @@ const ChatPanel: React.FC<ChatPanelProps & ExtraProps> = ({
|
|
|
489
496
|
[prompt: string]: { callId: string; content: string };
|
|
490
497
|
}): string => {
|
|
491
498
|
const stylesheet = `
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
margin-left: 25px;
|
|
520
|
-
}
|
|
521
|
-
</style>
|
|
499
|
+
<style>
|
|
500
|
+
.conversation-history {
|
|
501
|
+
font-family: Arial, sans-serif;
|
|
502
|
+
line-height: 1.5; /* Slightly increase line height for readability */
|
|
503
|
+
}
|
|
504
|
+
.history-entry {
|
|
505
|
+
margin-bottom: 15px;
|
|
506
|
+
}
|
|
507
|
+
.prompt-container, .response-container {
|
|
508
|
+
margin-bottom: 10px; /* Adjusted spacing */
|
|
509
|
+
}
|
|
510
|
+
.prompt, .response {
|
|
511
|
+
display: block; /* Ensure they take up the full row */
|
|
512
|
+
margin: 5px 0; /* Add vertical spacing */
|
|
513
|
+
padding: 10px; /* Increase padding for better spacing */
|
|
514
|
+
border-radius: 5px;
|
|
515
|
+
max-width: 80%; /* Keep width constrained */
|
|
516
|
+
}
|
|
517
|
+
.prompt {
|
|
518
|
+
background-color: #efefef;
|
|
519
|
+
margin-left: 0; /* Align to the left */
|
|
520
|
+
}
|
|
521
|
+
.response {
|
|
522
|
+
background-color: #f0fcfd;
|
|
523
|
+
margin-left: 25px; /* Indent slightly for visual differentiation */
|
|
524
|
+
}
|
|
525
|
+
</style>
|
|
522
526
|
`;
|
|
523
527
|
|
|
524
528
|
let html = `
|
|
@@ -791,6 +795,7 @@ const ChatPanel: React.FC<ChatPanelProps & ExtraProps> = ({
|
|
|
791
795
|
)}
|
|
792
796
|
|
|
793
797
|
<div ref={bottomRef} />
|
|
798
|
+
|
|
794
799
|
{hasScroll && !isAtBottom && (
|
|
795
800
|
<button className="scroll-button" onClick={scrollToBottom}>
|
|
796
801
|
↓
|
|
@@ -820,7 +825,7 @@ const ChatPanel: React.FC<ChatPanelProps & ExtraProps> = ({
|
|
|
820
825
|
</button>
|
|
821
826
|
)}
|
|
822
827
|
|
|
823
|
-
{
|
|
828
|
+
{showCallToAction && callToActionEmailAddress && (
|
|
824
829
|
<button
|
|
825
830
|
className="save-button"
|
|
826
831
|
onClick={() => setIsCallToActionModalOpen(true)}
|