@aslaluroba/help-center-react 3.2.5 → 3.2.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/README.md +0 -3
- package/dist/components/shared/Button/button.d.ts +3 -3
- package/dist/components/ui/index.d.ts +0 -1
- package/dist/core/api.d.ts +4 -4
- package/dist/index.css +1 -1
- package/dist/index.esm.js +15543 -15136
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +15546 -15145
- package/dist/index.js.map +1 -1
- package/dist/lib/theme-utils.d.ts +0 -9
- package/dist/lib/types.d.ts +6 -3
- package/dist/services.esm.js +9474 -9222
- package/dist/services.esm.js.map +1 -1
- package/dist/services.js +9472 -9222
- package/dist/services.js.map +1 -1
- package/dist/ui/chatbot-popup/active-chat-actions.d.ts +7 -0
- package/dist/ui/chatbot-popup/chat-window-screen/action-button.d.ts +10 -0
- package/dist/ui/chatbot-popup/chat-window-screen/footer.d.ts +1 -0
- package/dist/ui/chatbot-popup/chat-window-screen/header.d.ts +2 -5
- package/dist/ui/chatbot-popup/chat-window-screen/in-chat-review.d.ts +9 -0
- package/dist/ui/chatbot-popup/chat-window-screen/index.d.ts +7 -3
- package/dist/ui/chatbot-popup/chat-window-screen/typing-indicator.d.ts +6 -0
- package/dist/ui/chatbot-popup/error-screen/index.d.ts +0 -1
- package/dist/ui/chatbot-popup/loading-screen/index.d.ts +0 -2
- package/dist/ui/chatbot-popup/options-list-screen/company-card.d.ts +9 -0
- package/dist/ui/chatbot-popup/options-list-screen/header.d.ts +1 -2
- package/dist/ui/chatbot-popup/options-list-screen/helpscreen-intro.d.ts +6 -0
- package/dist/ui/chatbot-popup/options-list-screen/helpscreen-list.d.ts +10 -0
- package/dist/ui/chatbot-popup/options-list-screen/helpscreen-option.d.ts +9 -0
- package/dist/ui/chatbot-popup/options-list-screen/index.d.ts +1 -4
- package/dist/ui/help-center.d.ts +2 -5
- package/dist/ui/help-popup.d.ts +16 -7
- package/dist/ui/review-dialog/index.d.ts +2 -1
- package/package.json +35 -29
- package/src/components/shared/Button/button.tsx +11 -18
- package/src/components/shared/Card/card.tsx +8 -8
- package/src/components/ui/agent-response/agent-response.tsx +4 -4
- package/src/components/ui/image-attachment.tsx +8 -8
- package/src/components/ui/image-preview-dialog.tsx +41 -41
- package/src/components/ui/index.ts +0 -1
- package/src/core/AblyService.ts +22 -17
- package/src/core/api.ts +9 -7
- package/src/globals.css +216 -50
- package/src/lib/theme-utils.ts +1 -33
- package/src/lib/types.ts +7 -4
- package/src/locales/ar.json +16 -6
- package/src/locales/en.json +16 -6
- package/src/types/icons.d.ts +6 -0
- package/src/ui/chatbot-popup/active-chat-actions.tsx +39 -0
- package/src/ui/chatbot-popup/chat-window-screen/action-button.tsx +37 -0
- package/src/ui/chatbot-popup/chat-window-screen/footer.tsx +42 -43
- package/src/ui/chatbot-popup/chat-window-screen/header.tsx +34 -67
- package/src/ui/chatbot-popup/chat-window-screen/in-chat-review.tsx +83 -0
- package/src/ui/chatbot-popup/chat-window-screen/index.tsx +49 -42
- package/src/ui/chatbot-popup/chat-window-screen/typing-indicator.tsx +27 -0
- package/src/ui/chatbot-popup/error-screen/index.tsx +7 -7
- package/src/ui/chatbot-popup/loading-screen/index.tsx +6 -17
- package/src/ui/chatbot-popup/options-list-screen/company-card.tsx +37 -0
- package/src/ui/chatbot-popup/options-list-screen/header.tsx +12 -31
- package/src/ui/chatbot-popup/options-list-screen/helpscreen-intro.tsx +32 -0
- package/src/ui/chatbot-popup/options-list-screen/helpscreen-list.tsx +48 -0
- package/src/ui/chatbot-popup/options-list-screen/helpscreen-option.tsx +38 -0
- package/src/ui/chatbot-popup/options-list-screen/index.tsx +44 -38
- package/src/ui/confirmation-modal/index.tsx +27 -12
- package/src/ui/floating-message.tsx +8 -7
- package/src/ui/help-button.tsx +5 -5
- package/src/ui/help-center.tsx +71 -59
- package/src/ui/help-popup.tsx +114 -91
- package/src/ui/powered-by.tsx +49 -7
- package/src/ui/review-dialog/index.tsx +48 -65
- package/src/ui/review-dialog/rating.tsx +7 -7
- package/dist/components/ui/header.d.ts +0 -6
- package/dist/ui/chatbot-popup/home-screen/card.d.ts +0 -6
- package/dist/ui/chatbot-popup/home-screen/chat-now-card.d.ts +0 -5
- package/dist/ui/chatbot-popup/home-screen/index.d.ts +0 -7
- package/dist/ui/chatbot-popup/options-list-screen/expanded-option.d.ts +0 -7
- package/dist/ui/chatbot-popup/options-list-screen/option-card.d.ts +0 -5
- package/src/assets/icons/arrowRight.svg +0 -3
- package/src/assets/icons/chat.svg +0 -4
- package/src/assets/icons/close.svg +0 -1
- package/src/assets/icons/closeCircle.svg +0 -3
- package/src/assets/icons/closeCirclePrimary.svg +0 -4
- package/src/assets/icons/envelope.svg +0 -3
- package/src/assets/icons/paperclip.svg +0 -3
- package/src/assets/icons/threeDots.svg +0 -3
- package/src/assets/icons/user.svg +0 -3
- package/src/assets/icons/x.svg +0 -4
- package/src/assets/logoColors.svg +0 -5
- package/src/assets/logo_ai.svg +0 -14
- package/src/assets/thinking-logo.svg +0 -3
- package/src/components/ui/header.tsx +0 -22
- package/src/ui/chatbot-popup/home-screen/card.tsx +0 -33
- package/src/ui/chatbot-popup/home-screen/chat-now-card.tsx +0 -36
- package/src/ui/chatbot-popup/home-screen/index.tsx +0 -44
- package/src/ui/chatbot-popup/options-list-screen/expanded-option.tsx +0 -37
- package/src/ui/chatbot-popup/options-list-screen/option-card.tsx +0 -31
- /package/src/assets/{icons/seperator.svg → seperator.svg} +0 -0
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Button } from "@/components";
|
|
2
2
|
import { useLocalTranslation } from "@/useLocalTranslation";
|
|
3
|
+
import SolarChatRoundUnreadBoldDuotone from '~icons/solar/chat-round-unread-bold-duotone'
|
|
4
|
+
import SolarCloseCircleLineDuotone from '~icons/solar/close-circle-line-duotone'
|
|
5
|
+
import SolarPlain2BoldDuotone from '~icons/solar/plain-2-bold-duotone'
|
|
3
6
|
|
|
4
7
|
interface ConfirmationModalProps {
|
|
5
8
|
title: string;
|
|
@@ -12,27 +15,39 @@ const ConfirmationModal = ({ title, message, onCancel, onConfirm }: Confirmation
|
|
|
12
15
|
const { t } = useLocalTranslation();
|
|
13
16
|
|
|
14
17
|
return (
|
|
15
|
-
<div className='babylai
|
|
16
|
-
<div className='babylai
|
|
17
|
-
<div className='babylai-
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
<div className='babylai:absolute babylai:inset-0 babylai:z-50 babylai:flex babylai:items-end babylai:rounded-3xl babylai:overflow-hidden'>
|
|
19
|
+
<div className='babylai:absolute babylai:inset-0 babylai:bg-black/60' onClick={onCancel}></div>
|
|
20
|
+
<div className='babylai:flex babylai:flex-col babylai:bg-card babylai:rounded-2xl babylai:p-6 babylai:pb-5 babylai:w-full babylai:z-50 babylai:shadow-lg'>
|
|
21
|
+
<button className="babylai:cursor-pointer babylai:mb-6 babylai:ms-auto babylai:text-card-foreground"
|
|
22
|
+
type='button'
|
|
23
|
+
onClick={onCancel}
|
|
24
|
+
>
|
|
25
|
+
<SolarCloseCircleLineDuotone className="babylai:w-6 babylai:h-6" />
|
|
26
|
+
</button>
|
|
27
|
+
|
|
28
|
+
<section className="babylai:flex babylai:items-center babylai:justify-center babylai:border-b babylai:border-black-white-200 babylai:pb-6 babylai:mb-6">
|
|
29
|
+
<div className="babylai:flex babylai:items-center babylai:justify-center babylai:w-20 babylai:h-20 babylai:rounded-full babylai:p-3 babylai:bg-primary/15 babylai:text-primary">
|
|
30
|
+
<SolarChatRoundUnreadBoldDuotone className="babylai:w-16 babylai:h-16" />
|
|
31
|
+
</div>
|
|
32
|
+
</section>
|
|
33
|
+
|
|
34
|
+
<h3 className='babylai:text-2xl babylai:text-center babylai:font-bold babylai:mb-2 babylai:text-card-foreground'>{title}</h3>
|
|
35
|
+
|
|
36
|
+
<p className='babylai:text-sm babylai:text-center babylai:text-muted-foreground'>{message}</p>
|
|
37
|
+
|
|
38
|
+
<div className='babylai:flex babylai:justify-between babylai:gap-3 babylai:mt-6'>
|
|
21
39
|
<Button
|
|
22
|
-
variant='default'
|
|
23
|
-
size='sm'
|
|
24
40
|
onClick={onConfirm}
|
|
25
|
-
|
|
41
|
+
variant='secondary'
|
|
26
42
|
>
|
|
27
43
|
{t('homeSdk.ConfirmationModal.confirmation_button')}
|
|
28
44
|
</Button>
|
|
29
45
|
<Button
|
|
30
|
-
variant='outline'
|
|
31
|
-
size='sm'
|
|
32
46
|
onClick={onCancel}
|
|
33
|
-
|
|
47
|
+
variant='default'
|
|
34
48
|
>
|
|
35
49
|
{t('homeSdk.ConfirmationModal.cancel_button')}
|
|
50
|
+
<SolarPlain2BoldDuotone className="babylai:w-6 babylai:h-6" />
|
|
36
51
|
</Button>
|
|
37
52
|
</div>
|
|
38
53
|
</div>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import MaterialSymbolsCloseSmallOutlineRounded from '~icons/material-symbols/close-small-outline-rounded'
|
|
2
|
+
|
|
2
3
|
interface FloatingMessageProps {
|
|
3
4
|
message: string
|
|
4
5
|
onClose: () => void
|
|
@@ -8,16 +9,16 @@ const FloatingMessage = ({ message, onClose }: FloatingMessageProps) => {
|
|
|
8
9
|
return (
|
|
9
10
|
<div
|
|
10
11
|
className="
|
|
11
|
-
babylai
|
|
12
|
-
babylai
|
|
12
|
+
babylai:fixed babylai:bottom-16 babylai:right-4
|
|
13
|
+
babylai:z-50 babylai:flex babylai:flex-col babylai:items-end babylai:animate-[float_2s_infinite_ease-in-out]"
|
|
13
14
|
>
|
|
14
|
-
<div className="babylai
|
|
15
|
-
<p className="babylai
|
|
15
|
+
<div className="babylai:bg-primary-500 babylai:text-white babylai:py-3 babylai:px-4 babylai:rounded-3xl babylai:shadow-lg babylai:mb-4 babylai:max-w-[200px] babylai:relative after:babylai:content-[''] after:babylai:absolute after:babylai:-bottom-[10px] after:babylai:right-5 after:babylai:w-0 after:babylai:h-0 after:babylai:border-l-[10px] after:babylai:border-r-[10px] after:babylai:border-t-[10px] after:babylai:border-l-transparent after:babylai:border-r-transparent after:babylai:border-t-primary-500">
|
|
16
|
+
<p className="babylai:text-xs babylai:font-bold babylai:m-0">{message}</p>
|
|
16
17
|
<button
|
|
17
|
-
className="babylai
|
|
18
|
+
className="babylai:absolute babylai:-top-2 babylai:-right-2 babylai:w-5 babylai:h-5 babylai:rounded-full babylai:bg-white babylai:border-none babylai:cursor-pointer babylai:flex babylai:items-center babylai:justify-center babylai:text-black-white-700 babylai:p-[3px] babylai:hover:bg-primary-400 babylai:hover:text-white babylai:shadow-md"
|
|
18
19
|
onClick={onClose}
|
|
19
20
|
>
|
|
20
|
-
<
|
|
21
|
+
<MaterialSymbolsCloseSmallOutlineRounded className="babylai:w-8 babylai:h-8" />
|
|
21
22
|
</button>
|
|
22
23
|
</div>
|
|
23
24
|
</div>
|
package/src/ui/help-button.tsx
CHANGED
|
@@ -9,14 +9,14 @@ const HelpButton = ({ onClick }: HelpButtonProps) => {
|
|
|
9
9
|
return (
|
|
10
10
|
<button
|
|
11
11
|
className="
|
|
12
|
-
babylai
|
|
13
|
-
babylai-
|
|
14
|
-
babylai
|
|
15
|
-
babylai
|
|
12
|
+
babylai:fixed babylai:z-50 babylai:bottom-4 babylai:right-4
|
|
13
|
+
babylai:p-4
|
|
14
|
+
babylai:rounded-full babylai:bg-primary-500 babylai:flex babylai:items-center
|
|
15
|
+
babylai:justify-center babylai:border-[0.5px] babylai:border-black-white-50 "
|
|
16
16
|
onClick={onClick}
|
|
17
17
|
aria-label="Need Help?"
|
|
18
18
|
>
|
|
19
|
-
<Logo className="babylai
|
|
19
|
+
<Logo className="babylai:w-8 babylai:h-8 babylai:text-primary-500" />
|
|
20
20
|
</button>
|
|
21
21
|
)
|
|
22
22
|
}
|
package/src/ui/help-center.tsx
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import ReviewDialog from '@/ui/review-dialog';
|
|
2
1
|
import { useCallback, useEffect, useState } from 'react';
|
|
3
2
|
import { apiRequest } from '../core/api';
|
|
4
3
|
import { ClientAblyService } from '../core/AblyService';
|
|
@@ -10,12 +9,12 @@ import HelpButton from './help-button';
|
|
|
10
9
|
import HelpPopup from './help-popup';
|
|
11
10
|
import { defaultLanguage } from '@/i18n';
|
|
12
11
|
import { LanguageProvider } from '@/lib/LanguageContext';
|
|
13
|
-
import {
|
|
12
|
+
import { getPrimaryColorStyles } from '@/lib/theme-utils';
|
|
14
13
|
import { useActionHandler } from '@/lib/custom-hooks/useActionHandler';
|
|
15
14
|
|
|
16
15
|
interface HelpCenterProps {
|
|
17
16
|
helpScreenId: string;
|
|
18
|
-
language
|
|
17
|
+
language?: 'ar' | 'en';
|
|
19
18
|
user?: {
|
|
20
19
|
id?: string;
|
|
21
20
|
name?: string;
|
|
@@ -24,10 +23,7 @@ interface HelpCenterProps {
|
|
|
24
23
|
};
|
|
25
24
|
showArrow?: boolean;
|
|
26
25
|
messageLabel?: string | null;
|
|
27
|
-
showHelpScreen?: boolean;
|
|
28
26
|
primaryColor?: string;
|
|
29
|
-
secondaryColor?: string;
|
|
30
|
-
logoUrl?: string;
|
|
31
27
|
}
|
|
32
28
|
|
|
33
29
|
const HelpCenterContent = ({
|
|
@@ -35,11 +31,8 @@ const HelpCenterContent = ({
|
|
|
35
31
|
user,
|
|
36
32
|
showArrow = true,
|
|
37
33
|
messageLabel = null,
|
|
38
|
-
showHelpScreen = false,
|
|
39
34
|
primaryColor,
|
|
40
|
-
|
|
41
|
-
logoUrl,
|
|
42
|
-
language,
|
|
35
|
+
language = defaultLanguage,
|
|
43
36
|
}: HelpCenterProps) => {
|
|
44
37
|
const { t } = useLocalTranslation();
|
|
45
38
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -51,12 +44,15 @@ const HelpCenterContent = ({
|
|
|
51
44
|
|
|
52
45
|
const [sessionId, setSessionId] = useState<string | null>(null);
|
|
53
46
|
const [reviewSessionId, setReviewSessionId] = useState<string | null>(null);
|
|
47
|
+
const [inChatReviewSessionId, setInChatReviewSessionId] = useState<string | null>(null);
|
|
54
48
|
const [isAblyConnected, setIsAblyConnected] = useState(false);
|
|
55
49
|
const [isChatClosed, setIsChatClosed] = useState(false);
|
|
56
50
|
const [messages, setMessages] = useState<Message[]>([]);
|
|
57
51
|
const [needsAgent, setNeedsAgent] = useState(false);
|
|
58
52
|
const [assistantStatus, setAssistantStatus] = useState('idle');
|
|
59
53
|
const [isReviewDialogOpen, setIsReviewDialogOpen] = useState(false);
|
|
54
|
+
const [isSubmittingReview, setIsSubmittingReview] = useState(false);
|
|
55
|
+
const [navigateToOptionsListAfterReview, setNavigateToOptionsListAfterReview] = useState(false);
|
|
60
56
|
|
|
61
57
|
const actionHandler = useActionHandler();
|
|
62
58
|
|
|
@@ -73,7 +69,8 @@ const HelpCenterContent = ({
|
|
|
73
69
|
message: string,
|
|
74
70
|
senderType: number,
|
|
75
71
|
needsAgent: boolean,
|
|
76
|
-
|
|
72
|
+
attachmentUrls: string[] = [],
|
|
73
|
+
attachmentIds: string[] = []
|
|
77
74
|
) => {
|
|
78
75
|
if (needsAgent) {
|
|
79
76
|
setNeedsAgent(true);
|
|
@@ -86,8 +83,8 @@ const HelpCenterContent = ({
|
|
|
86
83
|
messageContent: message,
|
|
87
84
|
sentAt: new Date(),
|
|
88
85
|
isSeen: true,
|
|
89
|
-
|
|
90
|
-
...(
|
|
86
|
+
...(attachmentUrls.length > 0 && { attachmentUrls }),
|
|
87
|
+
...(attachmentIds.length > 0 && { attachmentIds }),
|
|
91
88
|
};
|
|
92
89
|
|
|
93
90
|
return [...prevMessages, newMessage];
|
|
@@ -96,43 +93,54 @@ const HelpCenterContent = ({
|
|
|
96
93
|
setAssistantStatus('idle');
|
|
97
94
|
};
|
|
98
95
|
|
|
99
|
-
const handleEndChat = useCallback(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
try {
|
|
103
|
-
await ClientAblyService.stopConnection();
|
|
104
|
-
setIsAblyConnected(false);
|
|
105
|
-
setAssistantStatus('idle');
|
|
106
|
-
|
|
107
|
-
const response = await apiRequest(`Client/ClientChatSession/${sessionId}/close`, 'POST', null, {
|
|
108
|
-
language: language,
|
|
109
|
-
});
|
|
110
|
-
if (!response.ok) throw new Error('Failed to close chat session');
|
|
96
|
+
const handleEndChat = useCallback(
|
|
97
|
+
async (options?: { fromChatScreen?: boolean }) => {
|
|
98
|
+
if (!sessionId || !selectedOption) return;
|
|
111
99
|
|
|
112
|
-
|
|
113
|
-
setReviewSessionId(sessionId);
|
|
100
|
+
const fromChatScreen = options?.fromChatScreen === true;
|
|
114
101
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
102
|
+
try {
|
|
103
|
+
await ClientAblyService.stopConnection();
|
|
104
|
+
setIsAblyConnected(false);
|
|
105
|
+
setAssistantStatus('idle');
|
|
119
106
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
107
|
+
const response = await apiRequest(`Client/ClientChatSession/${sessionId}/close`, 'POST', null, {
|
|
108
|
+
language: language,
|
|
109
|
+
});
|
|
110
|
+
if (!response.ok) throw new Error('Failed to close chat session');
|
|
111
|
+
|
|
112
|
+
setReviewSessionId(sessionId);
|
|
113
|
+
setSessionId(null);
|
|
114
|
+
|
|
115
|
+
if (fromChatScreen) {
|
|
116
|
+
setInChatReviewSessionId(sessionId);
|
|
117
|
+
setIsChatClosed(true);
|
|
118
|
+
// Keep selectedOption and messages; do not open popup
|
|
119
|
+
} else {
|
|
120
|
+
setSelectedOption(null);
|
|
121
|
+
setMessages([]);
|
|
122
|
+
setIsReviewDialogOpen(true);
|
|
123
|
+
}
|
|
124
|
+
} catch (err) {
|
|
125
|
+
setError('Failed to end chat session');
|
|
126
|
+
setAssistantStatus('idle');
|
|
127
|
+
setReviewSessionId(sessionId);
|
|
128
|
+
setSessionId(null);
|
|
129
|
+
if (!fromChatScreen) {
|
|
130
|
+
setSelectedOption(null);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
[language, selectedOption, sessionId]
|
|
135
|
+
);
|
|
130
136
|
|
|
131
137
|
const handleSendChatReview = async ({ comment, rating }: ReviewProps) => {
|
|
132
138
|
if (!reviewSessionId) return;
|
|
133
139
|
|
|
134
140
|
const payload = { rating, comment };
|
|
141
|
+
const wasInChatReview = !!inChatReviewSessionId;
|
|
135
142
|
|
|
143
|
+
setIsSubmittingReview(true);
|
|
136
144
|
try {
|
|
137
145
|
const response = await apiRequest(`Client/ClientChatSession/${reviewSessionId}/review`, 'POST', payload, {
|
|
138
146
|
language,
|
|
@@ -140,17 +148,24 @@ const HelpCenterContent = ({
|
|
|
140
148
|
if (!response.ok) throw new Error('Failed to send chat review');
|
|
141
149
|
|
|
142
150
|
handleCloseChatReview();
|
|
143
|
-
|
|
151
|
+
if (wasInChatReview) {
|
|
152
|
+
setNavigateToOptionsListAfterReview(true);
|
|
153
|
+
}
|
|
154
|
+
} catch (err) {
|
|
144
155
|
setError('Failed to send chat review');
|
|
156
|
+
} finally {
|
|
157
|
+
setIsSubmittingReview(false);
|
|
145
158
|
}
|
|
146
159
|
};
|
|
147
160
|
|
|
148
161
|
const handleCloseChatReview = () => {
|
|
149
162
|
setIsReviewDialogOpen(false);
|
|
150
163
|
setReviewSessionId(null);
|
|
164
|
+
setInChatReviewSessionId(null);
|
|
151
165
|
};
|
|
152
166
|
|
|
153
167
|
const handleStartChat = async (option: Option) => {
|
|
168
|
+
setInChatReviewSessionId(null);
|
|
154
169
|
setMessages([
|
|
155
170
|
{
|
|
156
171
|
id: Date.now(),
|
|
@@ -310,10 +325,9 @@ const HelpCenterContent = ({
|
|
|
310
325
|
setNeedsAgent(true);
|
|
311
326
|
});
|
|
312
327
|
|
|
313
|
-
// "end_session" →
|
|
328
|
+
// "end_session" → close session and show in-chat review (user stays in chat)
|
|
314
329
|
actionHandler.registerHandler('end_session', () => {
|
|
315
|
-
|
|
316
|
-
void handleEndChat();
|
|
330
|
+
void handleEndChat({ fromChatScreen: true });
|
|
317
331
|
});
|
|
318
332
|
|
|
319
333
|
return () => {
|
|
@@ -342,10 +356,10 @@ const HelpCenterContent = ({
|
|
|
342
356
|
}
|
|
343
357
|
}, [isOpen, helpScreenId]);
|
|
344
358
|
|
|
345
|
-
const themeStyles =
|
|
359
|
+
const themeStyles = getPrimaryColorStyles(primaryColor);
|
|
346
360
|
|
|
347
361
|
return (
|
|
348
|
-
<div className='babylai-
|
|
362
|
+
<div className='babylai-theme-root babylai:mb-4' style={themeStyles}>
|
|
349
363
|
{showArrowAnimation && !isOpen && (
|
|
350
364
|
<FloatingMessage onClose={handleCloseArrowAnimation} message={messageLabel || t('homeSdk.needAssistance')} />
|
|
351
365
|
)}
|
|
@@ -369,16 +383,20 @@ const HelpCenterContent = ({
|
|
|
369
383
|
assistantStatus={assistantStatus}
|
|
370
384
|
sessionId={sessionId}
|
|
371
385
|
isChatClosed={isChatClosed}
|
|
372
|
-
isAblyConnected={isAblyConnected}
|
|
373
386
|
selectedOption={selectedOption}
|
|
374
387
|
setSelectedOption={setSelectedOption}
|
|
375
|
-
|
|
376
|
-
|
|
388
|
+
inChatReviewSessionId={inChatReviewSessionId}
|
|
389
|
+
onInChatReviewSubmit={handleSendChatReview}
|
|
390
|
+
onInChatReviewDone={handleCloseChatReview}
|
|
391
|
+
navigateToOptionsListAfterReview={navigateToOptionsListAfterReview}
|
|
392
|
+
onNavigatedToOptionsList={() => setNavigateToOptionsListAfterReview(false)}
|
|
393
|
+
isReviewDialogOpen={isReviewDialogOpen}
|
|
394
|
+
reviewSessionId={reviewSessionId}
|
|
395
|
+
isSubmittingReview={isSubmittingReview}
|
|
396
|
+
onReviewDialogSubmit={handleSendChatReview}
|
|
397
|
+
onReviewDialogClose={handleCloseChatReview}
|
|
377
398
|
/>
|
|
378
399
|
)}
|
|
379
|
-
{isOpen && !!isReviewDialogOpen && reviewSessionId && (
|
|
380
|
-
<ReviewDialog handleSubmit={handleSendChatReview} onClose={handleCloseChatReview} />
|
|
381
|
-
)}
|
|
382
400
|
</div>
|
|
383
401
|
);
|
|
384
402
|
};
|
|
@@ -390,10 +408,7 @@ const HelpCenter = ({
|
|
|
390
408
|
showArrow = true,
|
|
391
409
|
language = defaultLanguage,
|
|
392
410
|
messageLabel = null,
|
|
393
|
-
showHelpScreen = false,
|
|
394
411
|
primaryColor,
|
|
395
|
-
secondaryColor,
|
|
396
|
-
logoUrl,
|
|
397
412
|
}: HelpCenterProps) => {
|
|
398
413
|
return (
|
|
399
414
|
<LanguageProvider language={language}>
|
|
@@ -403,10 +418,7 @@ const HelpCenter = ({
|
|
|
403
418
|
user={user}
|
|
404
419
|
showArrow={showArrow}
|
|
405
420
|
messageLabel={messageLabel}
|
|
406
|
-
showHelpScreen={showHelpScreen}
|
|
407
421
|
primaryColor={primaryColor}
|
|
408
|
-
secondaryColor={secondaryColor}
|
|
409
|
-
logoUrl={logoUrl}
|
|
410
422
|
/>
|
|
411
423
|
</LanguageProvider>
|
|
412
424
|
);
|