quickblox-react-ui-kit 0.2.0 → 0.2.2
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/CommonTypes/FunctionResult.d.ts +47 -0
- package/dist/Data/DefaultConfigurations.d.ts +7 -0
- package/dist/Data/Stubs.d.ts +1 -1
- package/dist/Data/source/AISource.d.ts +13 -0
- package/dist/Domain/entity/MessageEntity.d.ts +1 -1
- package/dist/Presentation/Views/Base/BaseViewModel.d.ts +10 -6
- package/dist/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/AIMessageWidget.d.ts +16 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/AIWidgetActions/AIWidgetActions.d.ts +14 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/SliderMenu.d.ts +23 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/Tone.d.ts +15 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/UseDefaultAIAssistAnswerWidget.d.ts +10 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/UseDefaultAIRephraseMessageWidget.d.ts +10 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/UseDefaultAITranslateWidget.d.ts +10 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/useDefaultVoiceInputWidget.d.ts +2 -2
- package/dist/Presentation/components/UI/Dialogs/MessagesView/ContextMenu.d.ts +2 -1
- package/dist/Presentation/components/UI/Dialogs/MessagesView/DropDownMenu/DropDownMenu.d.ts +26 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/DropDownMenu/ItemDropDownMenu/ItemDropDownMenu.d.ts +11 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/InComingMessage/AvatarContentIncomingUser/AvatarContentIncomingUser.d.ts +3 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/InComingMessage/InComingMessage.d.ts +15 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/MessagesView.d.ts +5 -5
- package/dist/Presentation/components/UI/Dialogs/MessagesView/OutGoingMessage/OutGoingMessage.d.ts +9 -0
- package/dist/Presentation/components/UI/svgs/Icons/AIWidgets/BookIcon/BookIcon.d.ts +3 -0
- package/dist/Presentation/components/UI/svgs/Icons/AIWidgets/HammerIcon/index.d.ts +3 -0
- package/dist/Presentation/components/UI/svgs/Icons/AIWidgets/HandshakeIcon/index.d.ts +3 -0
- package/dist/Presentation/components/UI/svgs/Icons/AIWidgets/MuscleIcon/index.d.ts +3 -0
- package/dist/Presentation/components/UI/svgs/Icons/AIWidgets/NecktieIcon/index.d.ts +3 -0
- package/dist/Presentation/components/UI/svgs/Icons/AIWidgets/NeutralFaceIcon/index.d.ts +3 -0
- package/dist/Presentation/components/UI/svgs/Icons/AIWidgets/PalmsUpTogetherIcon/index.d.ts +3 -0
- package/dist/Presentation/components/UI/svgs/Icons/AIWidgets/PerformingArtsIcon/index.d.ts +3 -0
- package/dist/Presentation/components/UI/svgs/Icons/AIWidgets/PointUpIcon/index.d.ts +3 -0
- package/dist/Presentation/components/UI/svgs/Icons/AIWidgets/SmileyIcon/index.d.ts +3 -0
- package/dist/Presentation/components/UI/svgs/Icons/AIWidgets/SmirkIcon/index.d.ts +3 -0
- package/dist/Presentation/components/UI/svgs/Icons/AIWidgets/WhiteCheckMarkIcon/index.d.ts +3 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/AssistAnswer/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Summarize/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Tone/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Media/Translate/index.d.ts +4 -0
- package/dist/Presentation/components/layouts/Desktop/QuickBloxUIKitDesktopLayout.d.ts +5 -5
- package/dist/Presentation/components/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider.d.ts +1 -1
- package/dist/QBconfig.d.ts +23 -0
- package/dist/index-ui.d.ts +5 -1
- package/dist/index-ui.js +361 -42
- package/global.d.ts +48 -6
- package/package.json +1 -1
- package/src/App.tsx +20 -14
- package/src/CommonTypes/FunctionResult.ts +54 -0
- package/src/Data/DefaultConfigurations.ts +197 -0
- package/src/Data/Stubs.ts +15 -15
- package/src/Data/mapper/MessageLocalDTOMapper.ts +3 -2
- package/src/Data/mapper/MessageRemoteDTOMapper.ts +3 -2
- package/src/Data/source/AISource.ts +133 -0
- package/src/Data/source/remote/Mapper/MessageDTOMapper.ts +3 -3
- package/src/Domain/entity/MessageEntity.ts +1 -1
- package/src/Presentation/Views/Base/BaseViewModel.ts +9 -4
- package/src/Presentation/Views/Dialogs/Dialogs.tsx +37 -21
- package/src/Presentation/components/UI/Dialogs/HeaderDialogs/HeaderDialogs.scss +2 -2
- package/src/Presentation/components/UI/Dialogs/HeaderDialogs/HeaderDialogs.tsx +5 -5
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/{AIWidget.ts → AIMessageWidget.ts} +14 -3
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/AIWidgetActions/AIWidgetActions.scss +55 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/AIWidgetActions/AIWidgetActions.tsx +116 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/SliderMenu.tsx +172 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/Tone.ts +21 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/UseDefaultAIAssistAnswerWidget.tsx +99 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/UseDefaultAIRephraseMessageWidget.tsx +105 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/UseDefaultAITranslateWidget.tsx +106 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/useDefaultVoiceInputWidget.tsx +7 -6
- package/src/Presentation/components/UI/Dialogs/MessagesView/ContextMenu.tsx +5 -6
- package/src/Presentation/components/UI/Dialogs/MessagesView/DropDownMenu/DropDownMenu.scss +84 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/DropDownMenu/DropDownMenu.tsx +105 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/DropDownMenu/ItemDropDownMenu/ItemDropDownMenu.scss +50 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/DropDownMenu/ItemDropDownMenu/ItemDropDownMenu.tsx +43 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/HeaderMessages/HeaderMessages.tsx +14 -11
- package/src/Presentation/components/UI/Dialogs/MessagesView/InComingMessage/AvatarContentIncomingUser/AvatarContentIncomingUser.scss +39 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/InComingMessage/AvatarContentIncomingUser/AvatarContentIncomingUser.tsx +26 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/InComingMessage/InComingMessage.scss +394 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/InComingMessage/InComingMessage.tsx +747 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/MessagesView.scss +88 -4
- package/src/Presentation/components/UI/Dialogs/MessagesView/MessagesView.tsx +589 -246
- package/src/Presentation/components/UI/Dialogs/MessagesView/OutGoingMessage/OutGoingMessage.scss +7 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/OutGoingMessage/OutGoingMessage.tsx +99 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/useMessagesViewModel.ts +7 -5
- package/src/Presentation/components/UI/svgs/Icons/AIWidgets/BookIcon/BookIcon.tsx +7 -0
- package/src/Presentation/components/UI/svgs/Icons/AIWidgets/HammerIcon/index.tsx +7 -0
- package/src/Presentation/components/UI/svgs/Icons/AIWidgets/HandshakeIcon/index.tsx +7 -0
- package/src/Presentation/components/UI/svgs/Icons/AIWidgets/MuscleIcon/index.tsx +7 -0
- package/src/Presentation/components/UI/svgs/Icons/AIWidgets/NecktieIcon/index.tsx +7 -0
- package/src/Presentation/components/UI/svgs/Icons/AIWidgets/NeutralFaceIcon/index.tsx +7 -0
- package/src/Presentation/components/UI/svgs/Icons/AIWidgets/PalmsUpTogetherIcon/index.tsx +7 -0
- package/src/Presentation/components/UI/svgs/Icons/AIWidgets/PerformingArtsIcon/index.tsx +7 -0
- package/src/Presentation/components/UI/svgs/Icons/AIWidgets/PointUpIcon/index.tsx +7 -0
- package/src/Presentation/components/UI/svgs/Icons/AIWidgets/SmileyIcon/index.tsx +20 -0
- package/src/Presentation/components/UI/svgs/Icons/AIWidgets/SmirkIcon/index.tsx +7 -0
- package/src/Presentation/components/UI/svgs/Icons/AIWidgets/WhiteCheckMarkIcon/index.tsx +7 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/AssistAnswer/AssistAnswer.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/AssistAnswer/index.tsx +93 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Summarize/Summarize.svg +6 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Summarize/index.tsx +58 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Tone/Tone.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Tone/index.tsx +34 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/Translate/Translate.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/Translate/index.tsx +35 -0
- package/src/Presentation/components/layouts/Desktop/QuickBloxUIKitDesktopLayout.tsx +110 -36
- package/src/Presentation/components/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider.tsx +7 -6
- package/src/QBconfig.ts +33 -3
- package/src/index-ui.ts +9 -0
- package/src/utils/parse.ts +1 -1
- package/dist/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/AIWidget.d.ts +0 -8
- package/dist/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/UseDefaultAIAssistAnswerWidgetWithProxy.d.ts +0 -9
- package/dist/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/UseDefaultTextInputWidget.d.ts +0 -2
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/UseDefaultAIAssistAnswerWidgetWithProxy.tsx +0 -136
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/UseDefaultTextInputWidget.tsx +0 -60
- /package/dist/Presentation/components/UI/svgs/Icons/{Media → AIWidgets}/AIWidget/index.d.ts +0 -0
- /package/src/Presentation/components/UI/svgs/Icons/{Media → AIWidgets}/AIWidget/Send.svg +0 -0
- /package/src/Presentation/components/UI/svgs/Icons/{Media → AIWidgets}/AIWidget/index.tsx +0 -0
|
@@ -15,10 +15,6 @@ import useMessagesViewModel from './useMessagesViewModel';
|
|
|
15
15
|
import LoaderComponent from '../../Placeholders/LoaderComponent/LoaderComponent';
|
|
16
16
|
import ErrorComponent from '../../Placeholders/ErrorComponent/ErrorComponent';
|
|
17
17
|
import HeaderMessages from './HeaderMessages/HeaderMessages';
|
|
18
|
-
import {
|
|
19
|
-
FunctionTypeVoidToVoid,
|
|
20
|
-
IChatMessage,
|
|
21
|
-
} from '../../../../Views/Base/BaseViewModel';
|
|
22
18
|
import VideoAttachmentComponent from './VideoAttachmentComponent/VideoAttachmentComponent';
|
|
23
19
|
import ImageAttachmentComponent from './ImageAttachmentComponent/ImageAttachmentComponent';
|
|
24
20
|
import { DialogType } from '../../../../../Domain/entity/DialogTypes';
|
|
@@ -31,32 +27,47 @@ import {
|
|
|
31
27
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
32
28
|
getDateShortFormatEU,
|
|
33
29
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
34
|
-
formatShortTime3,
|
|
30
|
+
// formatShortTime3,
|
|
35
31
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
36
|
-
formatShortTime4,
|
|
37
|
-
getTimeShort24hFormat,
|
|
32
|
+
// formatShortTime4,
|
|
33
|
+
// getTimeShort24hFormat,
|
|
38
34
|
} from '../../../../../utils/DateTimeFormatter';
|
|
39
|
-
import User from '../../svgs/Icons/Contents/User';
|
|
40
35
|
import ActiveSvg from '../../svgs/ActiveSvg/ActiveSvg';
|
|
41
36
|
import AttachmentIcon from '../../svgs/Icons/Media/Attachment';
|
|
42
37
|
import SendIcon from '../../svgs/Icons/Actions/Send';
|
|
43
38
|
import AudioAttachmentComponent from './AudioAttachmentComponent/AudioAttachmentComponent';
|
|
44
39
|
import AudioFile from '../../svgs/Icons/Media/AudioFile';
|
|
45
40
|
import VoiceIcon from '../../svgs/Icons/Actions/Voice';
|
|
46
|
-
import SentStatusIcon from '../../svgs/Icons/Status/Sent';
|
|
47
|
-
import ViewedDelivered from '../../svgs/Icons/Status/ViewedDelivered';
|
|
48
41
|
import { stringifyError } from '../../../../../utils/parse';
|
|
49
42
|
import VoiceRecordingProgress from './VoiceRecordingProgress/VoiceRecordingProgress';
|
|
50
43
|
import UiKitTheme from '../../../../assets/UiKitTheme';
|
|
51
|
-
import {
|
|
44
|
+
import { AIMessageWidget } from './AIWidgets/AIMessageWidget';
|
|
52
45
|
import { DialogsViewModel } from '../../../../Views/Dialogs/DialogViewModel';
|
|
53
46
|
import { HighLightLink, messageHasUrls } from './HighLightLink/HighLightLink';
|
|
54
47
|
import { loopToLimitTokens } from '../../../../../utils/utils';
|
|
48
|
+
import { OutGoingMessage } from './OutGoingMessage/OutGoingMessage';
|
|
49
|
+
import { InComingMessage } from './InComingMessage/InComingMessage';
|
|
50
|
+
import { Tone } from './AIWidgets/Tone';
|
|
51
|
+
import NecktieIcon from '../../svgs/Icons/AIWidgets/NecktieIcon';
|
|
52
|
+
import HandshakeIcon from '../../svgs/Icons/AIWidgets/HandshakeIcon';
|
|
53
|
+
import WhiteCheckMarkIcon from '../../svgs/Icons/AIWidgets/WhiteCheckMarkIcon';
|
|
54
|
+
import MuscleIcon from '../../svgs/Icons/AIWidgets/MuscleIcon';
|
|
55
|
+
import PalmsUpTogetherIcon from '../../svgs/Icons/AIWidgets/PalmsUpTogetherIcon';
|
|
56
|
+
import NeutralFaceIcon from '../../svgs/Icons/AIWidgets/NeutralFaceIcon';
|
|
57
|
+
import HammerIcon from '../../svgs/Icons/AIWidgets/HammerIcon';
|
|
58
|
+
import BookIcon from '../../svgs/Icons/AIWidgets/BookIcon/BookIcon';
|
|
59
|
+
import PointUpIcon from '../../svgs/Icons/AIWidgets/PointUpIcon';
|
|
60
|
+
import SmirkIcon from '../../svgs/Icons/AIWidgets/SmirkIcon';
|
|
61
|
+
import PerformingArtsIcon from '../../svgs/Icons/AIWidgets/PerformingArtsIcon';
|
|
62
|
+
import { FunctionTypeVoidToVoid } from '../../../../Views/Base/BaseViewModel';
|
|
63
|
+
import { IChatMessage } from '../../../../../Data/source/AISource';
|
|
64
|
+
// import ToneIcon from '../../svgs/Icons/Actions/Tone';
|
|
65
|
+
// import AIWidgetActions from './AIWidgets/AIWidgetActions/AIWidgetActions';
|
|
55
66
|
|
|
56
67
|
type HeaderDialogsMessagesProps = {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
68
|
+
AIRephrase?: AIMessageWidget;
|
|
69
|
+
AITranslate?: AIMessageWidget;
|
|
70
|
+
AIAssist?: AIMessageWidget;
|
|
60
71
|
dialogsViewModel: DialogsViewModel;
|
|
61
72
|
onDialogInformationHandler?: FunctionTypeVoidToVoid;
|
|
62
73
|
maxWidthToResize?: string;
|
|
@@ -68,11 +79,11 @@ type HeaderDialogsMessagesProps = {
|
|
|
68
79
|
// eslint-disable-next-line react/function-component-definition
|
|
69
80
|
const MessagesView: React.FC<HeaderDialogsMessagesProps> = ({
|
|
70
81
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
71
|
-
|
|
82
|
+
AIRephrase,
|
|
72
83
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
73
|
-
|
|
84
|
+
AITranslate,
|
|
74
85
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
75
|
-
|
|
86
|
+
AIAssist,
|
|
76
87
|
dialogsViewModel,
|
|
77
88
|
onDialogInformationHandler,
|
|
78
89
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -92,6 +103,7 @@ const MessagesView: React.FC<HeaderDialogsMessagesProps> = ({
|
|
|
92
103
|
currentContext.storage.REMOTE_DATA_SOURCE.authInformation?.userId;
|
|
93
104
|
const currentUserName =
|
|
94
105
|
currentContext.storage.REMOTE_DATA_SOURCE.authInformation?.userName;
|
|
106
|
+
// const translations: Record<number, string> = {};
|
|
95
107
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
96
108
|
const { connectionRepository, browserOnline } = useQBConnection();
|
|
97
109
|
const [dialogMessagesCount, setDialogMessageCount] = useState(100);
|
|
@@ -100,8 +112,8 @@ const MessagesView: React.FC<HeaderDialogsMessagesProps> = ({
|
|
|
100
112
|
const [messagesToView, setMessagesToView] = React.useState<MessageEntity[]>(
|
|
101
113
|
[],
|
|
102
114
|
);
|
|
103
|
-
const [waitAIWidget, setWaitAIWidget] = useState<boolean>(false);
|
|
104
115
|
|
|
116
|
+
const [waitAIWidget, setWaitAIWidget] = useState<boolean>(false);
|
|
105
117
|
const messageEntitiesToIChatMessageCollection = (
|
|
106
118
|
messageEntities: MessageEntity[],
|
|
107
119
|
): IChatMessage[] => {
|
|
@@ -211,23 +223,6 @@ const MessagesView: React.FC<HeaderDialogsMessagesProps> = ({
|
|
|
211
223
|
}
|
|
212
224
|
}, [dialogMessagesCount]);
|
|
213
225
|
//
|
|
214
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
215
|
-
const menuItems = [
|
|
216
|
-
{
|
|
217
|
-
title: 'Item 1',
|
|
218
|
-
action: () => {
|
|
219
|
-
console.log('Clicked on Item 1');
|
|
220
|
-
},
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
title: 'Item 2',
|
|
224
|
-
action: () => {
|
|
225
|
-
console.log('Clicked on Item 2');
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
// ... добавьте дополнительные элементы меню
|
|
229
|
-
];
|
|
230
|
-
//
|
|
231
226
|
|
|
232
227
|
const getSenderName = (sender?: UserEntity): string | undefined => {
|
|
233
228
|
if (!sender) return undefined;
|
|
@@ -237,6 +232,26 @@ const MessagesView: React.FC<HeaderDialogsMessagesProps> = ({
|
|
|
237
232
|
);
|
|
238
233
|
};
|
|
239
234
|
|
|
235
|
+
// function sendMessageToTranslate(message: MessageEntity) {
|
|
236
|
+
// if (!waitAIWidget) {
|
|
237
|
+
// setWaitAIWidget(true);
|
|
238
|
+
// AITranslation?.textToWidget(
|
|
239
|
+
// message.message,
|
|
240
|
+
// messageEntitiesToIChatMessageCollection(messagesToView),
|
|
241
|
+
// );
|
|
242
|
+
// }
|
|
243
|
+
// }
|
|
244
|
+
//
|
|
245
|
+
// function sendMessageToAIAssistAnswer(message: MessageEntity) {
|
|
246
|
+
// if (!waitAIWidget) {
|
|
247
|
+
// setWaitAIWidget(true);
|
|
248
|
+
// AIAnswerToMessage?.textToWidget(
|
|
249
|
+
// message.message,
|
|
250
|
+
// messageEntitiesToIChatMessageCollection(messagesToView),
|
|
251
|
+
// );
|
|
252
|
+
// }
|
|
253
|
+
// }
|
|
254
|
+
|
|
240
255
|
const renderMessage = (message: MessageEntity, index: number) => {
|
|
241
256
|
const SystemMessage = 'SystemMessage';
|
|
242
257
|
const IncomingMessage = 'IncomingMessage';
|
|
@@ -357,113 +372,56 @@ const MessagesView: React.FC<HeaderDialogsMessagesProps> = ({
|
|
|
357
372
|
);
|
|
358
373
|
} else if (messageTypes === IncomingMessage) {
|
|
359
374
|
messageView = (
|
|
360
|
-
<
|
|
361
|
-
className="message-view-container--incoming-message-wrapper"
|
|
375
|
+
<InComingMessage
|
|
362
376
|
key={message.id}
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
{getTimeShort24hFormat(message.date_sent)}
|
|
403
|
-
</div>
|
|
404
|
-
<div
|
|
405
|
-
className="message-view-container__incoming-time"
|
|
406
|
-
onClick={() => {
|
|
407
|
-
if (!waitAIWidget) {
|
|
408
|
-
setWaitAIWidget(true);
|
|
409
|
-
AIAnswerToMessage?.textToWidget(
|
|
410
|
-
message.message,
|
|
411
|
-
messageEntitiesToIChatMessageCollection(messagesToView),
|
|
412
|
-
);
|
|
413
|
-
}
|
|
414
|
-
}}
|
|
415
|
-
>
|
|
416
|
-
{AIAnswerToMessage?.renderWidget()}
|
|
417
|
-
</div>
|
|
418
|
-
{/* <ContextMenu items={menuItems} /> */}
|
|
419
|
-
</div>
|
|
377
|
+
theme={theme}
|
|
378
|
+
senderName={getSenderName(message.sender)}
|
|
379
|
+
message={message}
|
|
380
|
+
// element={messageContentRender(message)}
|
|
381
|
+
onLoader={() => {
|
|
382
|
+
// sendMessageToTranslate(message);
|
|
383
|
+
setWaitAIWidget(true);
|
|
384
|
+
}}
|
|
385
|
+
// renderWidget={
|
|
386
|
+
// <ContextMenu
|
|
387
|
+
// widgetToRender={
|
|
388
|
+
// <AIWidgetIcon applyZoom color="var(--main-elements)" />
|
|
389
|
+
// }
|
|
390
|
+
// items={[
|
|
391
|
+
// {
|
|
392
|
+
// title: 'AI Assist Answer',
|
|
393
|
+
// action: () => {
|
|
394
|
+
// sendMessageToAIAssistAnswer(message);
|
|
395
|
+
// },
|
|
396
|
+
// },
|
|
397
|
+
// {
|
|
398
|
+
// title: 'AI Translate',
|
|
399
|
+
// action: () => {
|
|
400
|
+
// sendMessageToTranslate(message);
|
|
401
|
+
// },
|
|
402
|
+
// },
|
|
403
|
+
// ]}
|
|
404
|
+
// />
|
|
405
|
+
// }
|
|
406
|
+
currentUserId={currentUserId}
|
|
407
|
+
messagesToView={messagesToView}
|
|
408
|
+
AITranslation={AITranslate}
|
|
409
|
+
AIAnswerToMessage={AIAssist}
|
|
410
|
+
// translationDATA={translations}
|
|
411
|
+
// index={index}
|
|
412
|
+
// updateData={(ind: number, v: string) => {
|
|
413
|
+
// translations[ind] = v;
|
|
414
|
+
// }}
|
|
415
|
+
/>
|
|
420
416
|
);
|
|
421
417
|
} else {
|
|
422
418
|
messageView = (
|
|
423
|
-
<
|
|
424
|
-
className="message-view-container--outgoing-message-wrapper"
|
|
419
|
+
<OutGoingMessage
|
|
425
420
|
key={message.id}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
<ViewedDelivered
|
|
431
|
-
width="13"
|
|
432
|
-
height="13"
|
|
433
|
-
applyZoom
|
|
434
|
-
color={theme ? theme.mainElements() : 'var(--main-elements)'}
|
|
435
|
-
/>
|
|
436
|
-
) : (
|
|
437
|
-
<SentStatusIcon
|
|
438
|
-
width="13"
|
|
439
|
-
height="13"
|
|
440
|
-
applyZoom
|
|
441
|
-
color={theme ? theme.mainElements() : 'var(--main-elements)'}
|
|
442
|
-
/>
|
|
443
|
-
)}
|
|
444
|
-
</div>
|
|
445
|
-
<div
|
|
446
|
-
style={theme ? { color: theme.mainText() } : {}}
|
|
447
|
-
className="message-view-container__incoming-time"
|
|
448
|
-
>
|
|
449
|
-
{getTimeShort24hFormat(message.date_sent)}
|
|
450
|
-
</div>
|
|
451
|
-
</div>
|
|
452
|
-
|
|
453
|
-
<div
|
|
454
|
-
style={
|
|
455
|
-
theme
|
|
456
|
-
? {
|
|
457
|
-
color: theme.mainText(),
|
|
458
|
-
backgroundColor: theme.outgoingBackground(),
|
|
459
|
-
}
|
|
460
|
-
: {}
|
|
461
|
-
}
|
|
462
|
-
className="message-view-container__outgoing-message"
|
|
463
|
-
>
|
|
464
|
-
{messageContentRender(message)}
|
|
465
|
-
</div>
|
|
466
|
-
</div>
|
|
421
|
+
message={message}
|
|
422
|
+
theme={theme}
|
|
423
|
+
element={messageContentRender(message)}
|
|
424
|
+
/>
|
|
467
425
|
);
|
|
468
426
|
}
|
|
469
427
|
|
|
@@ -686,10 +644,11 @@ const MessagesView: React.FC<HeaderDialogsMessagesProps> = ({
|
|
|
686
644
|
setFileToSend(voiceMessage);
|
|
687
645
|
if (useAudioWidget) {
|
|
688
646
|
setUseAudioWidget(false);
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
)
|
|
647
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
648
|
+
// AITranslation?.fileToWidget(
|
|
649
|
+
// voiceMessage,
|
|
650
|
+
// messageEntitiesToIChatMessageCollection(messagesToView),
|
|
651
|
+
// );
|
|
693
652
|
}
|
|
694
653
|
//
|
|
695
654
|
}
|
|
@@ -755,48 +714,203 @@ const MessagesView: React.FC<HeaderDialogsMessagesProps> = ({
|
|
|
755
714
|
}
|
|
756
715
|
|
|
757
716
|
useEffect(() => {
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
setMessageText(AIEditMessage?.textToContent);
|
|
763
|
-
setWidgetTextContent(AIEditMessage?.textToContent);
|
|
717
|
+
setWaitAIWidget(false);
|
|
718
|
+
if (AIRephrase?.textToContent && AIRephrase?.textToContent.length > 0) {
|
|
719
|
+
setMessageText(AIRephrase?.textToContent);
|
|
720
|
+
setWidgetTextContent(AIRephrase?.textToContent);
|
|
764
721
|
setTimeout(() => {
|
|
765
722
|
setWidgetTextContent('');
|
|
766
723
|
}, 45 * 1000);
|
|
767
724
|
}
|
|
768
|
-
}, [
|
|
725
|
+
}, [AIRephrase?.textToContent]);
|
|
769
726
|
|
|
770
727
|
useEffect(() => {
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
}
|
|
781
|
-
|
|
728
|
+
setWaitAIWidget(false);
|
|
729
|
+
// if (
|
|
730
|
+
// AITranslation?.textToContent &&
|
|
731
|
+
// AITranslation?.textToContent.length > 0
|
|
732
|
+
// ) {
|
|
733
|
+
// setMessageText(AITranslation?.textToContent);
|
|
734
|
+
// setWidgetTextContent(AITranslation?.textToContent);
|
|
735
|
+
// setTimeout(() => {
|
|
736
|
+
// setWidgetTextContent('');
|
|
737
|
+
// }, 45 * 1000);
|
|
738
|
+
// }
|
|
739
|
+
}, [AITranslate?.textToContent]);
|
|
782
740
|
|
|
783
741
|
useEffect(() => {
|
|
784
742
|
setWaitAIWidget(false);
|
|
785
|
-
if (
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
) {
|
|
789
|
-
setMessageText(AIAnswerToMessage?.textToContent);
|
|
790
|
-
setWidgetTextContent(AIAnswerToMessage?.textToContent);
|
|
743
|
+
if (AIAssist?.textToContent && AIAssist?.textToContent.length > 0) {
|
|
744
|
+
setMessageText(AIAssist?.textToContent);
|
|
745
|
+
setWidgetTextContent(AIAssist?.textToContent);
|
|
791
746
|
setTimeout(() => {
|
|
792
747
|
setWidgetTextContent('');
|
|
793
748
|
}, 45 * 1000);
|
|
794
749
|
}
|
|
795
|
-
}, [
|
|
796
|
-
|
|
750
|
+
}, [AIAssist?.textToContent]);
|
|
797
751
|
const useSubContent = subHeaderContent || false;
|
|
798
752
|
const useUpContent = upHeaderContent || false;
|
|
799
753
|
|
|
754
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
755
|
+
function getAIEditingMessagesItems() {
|
|
756
|
+
return [
|
|
757
|
+
{
|
|
758
|
+
title: 'Professional Tone',
|
|
759
|
+
icon: <NecktieIcon />,
|
|
760
|
+
action: () => {
|
|
761
|
+
if (messageText && messageText.length > 0 && !waitAIWidget) {
|
|
762
|
+
setWaitAIWidget(true);
|
|
763
|
+
AIRephrase?.textToWidget(
|
|
764
|
+
messageText,
|
|
765
|
+
messageEntitiesToIChatMessageCollection(messagesToView),
|
|
766
|
+
{ tone: Tone.Professional },
|
|
767
|
+
);
|
|
768
|
+
}
|
|
769
|
+
},
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
title: 'Friendly Tone',
|
|
773
|
+
icon: <HandshakeIcon />,
|
|
774
|
+
action: () => {
|
|
775
|
+
if (messageText && messageText.length > 0 && !waitAIWidget) {
|
|
776
|
+
setWaitAIWidget(true);
|
|
777
|
+
AIRephrase?.textToWidget(
|
|
778
|
+
messageText,
|
|
779
|
+
messageEntitiesToIChatMessageCollection(messagesToView),
|
|
780
|
+
{ tone: Tone.Friendly },
|
|
781
|
+
);
|
|
782
|
+
}
|
|
783
|
+
},
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
title: 'Encouraging Tone',
|
|
787
|
+
icon: <MuscleIcon />,
|
|
788
|
+
action: () => {
|
|
789
|
+
if (messageText && messageText.length > 0 && !waitAIWidget) {
|
|
790
|
+
setWaitAIWidget(true);
|
|
791
|
+
AIRephrase?.textToWidget(
|
|
792
|
+
messageText,
|
|
793
|
+
messageEntitiesToIChatMessageCollection(messagesToView),
|
|
794
|
+
{ tone: Tone.Encouraging },
|
|
795
|
+
);
|
|
796
|
+
}
|
|
797
|
+
},
|
|
798
|
+
},
|
|
799
|
+
{
|
|
800
|
+
title: 'Empathetic Tone',
|
|
801
|
+
icon: <PalmsUpTogetherIcon />,
|
|
802
|
+
action: () => {
|
|
803
|
+
if (messageText && messageText.length > 0 && !waitAIWidget) {
|
|
804
|
+
setWaitAIWidget(true);
|
|
805
|
+
AIRephrase?.textToWidget(
|
|
806
|
+
messageText,
|
|
807
|
+
messageEntitiesToIChatMessageCollection(messagesToView),
|
|
808
|
+
{ tone: Tone.Empathetic },
|
|
809
|
+
);
|
|
810
|
+
}
|
|
811
|
+
},
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
title: 'Neutral Tone',
|
|
815
|
+
icon: <NeutralFaceIcon />,
|
|
816
|
+
action: () => {
|
|
817
|
+
if (messageText && messageText.length > 0 && !waitAIWidget) {
|
|
818
|
+
setWaitAIWidget(true);
|
|
819
|
+
AIRephrase?.textToWidget(
|
|
820
|
+
messageText,
|
|
821
|
+
messageEntitiesToIChatMessageCollection(messagesToView),
|
|
822
|
+
{ tone: Tone.Neutral },
|
|
823
|
+
);
|
|
824
|
+
}
|
|
825
|
+
},
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
title: 'Assertive Tone',
|
|
829
|
+
icon: <HammerIcon />,
|
|
830
|
+
action: () => {
|
|
831
|
+
if (messageText && messageText.length > 0 && !waitAIWidget) {
|
|
832
|
+
setWaitAIWidget(true);
|
|
833
|
+
AIRephrase?.textToWidget(
|
|
834
|
+
messageText,
|
|
835
|
+
messageEntitiesToIChatMessageCollection(messagesToView),
|
|
836
|
+
{ tone: Tone.Assertive },
|
|
837
|
+
);
|
|
838
|
+
}
|
|
839
|
+
},
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
title: 'Instructive Tone',
|
|
843
|
+
icon: <BookIcon />,
|
|
844
|
+
action: () => {
|
|
845
|
+
if (messageText && messageText.length > 0 && !waitAIWidget) {
|
|
846
|
+
setWaitAIWidget(true);
|
|
847
|
+
AIRephrase?.textToWidget(
|
|
848
|
+
messageText,
|
|
849
|
+
messageEntitiesToIChatMessageCollection(messagesToView),
|
|
850
|
+
{ tone: Tone.Instructive },
|
|
851
|
+
);
|
|
852
|
+
}
|
|
853
|
+
},
|
|
854
|
+
},
|
|
855
|
+
{
|
|
856
|
+
title: 'Persuasive Tone',
|
|
857
|
+
icon: <PointUpIcon />,
|
|
858
|
+
action: () => {
|
|
859
|
+
if (messageText && messageText.length > 0 && !waitAIWidget) {
|
|
860
|
+
setWaitAIWidget(true);
|
|
861
|
+
AIRephrase?.textToWidget(
|
|
862
|
+
messageText,
|
|
863
|
+
messageEntitiesToIChatMessageCollection(messagesToView),
|
|
864
|
+
{ tone: Tone.Persuasive },
|
|
865
|
+
);
|
|
866
|
+
}
|
|
867
|
+
},
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
title: 'Sarcastic/Ironic Tone',
|
|
871
|
+
icon: <SmirkIcon />,
|
|
872
|
+
action: () => {
|
|
873
|
+
if (messageText && messageText.length > 0 && !waitAIWidget) {
|
|
874
|
+
setWaitAIWidget(true);
|
|
875
|
+
AIRephrase?.textToWidget(
|
|
876
|
+
messageText,
|
|
877
|
+
messageEntitiesToIChatMessageCollection(messagesToView),
|
|
878
|
+
{ tone: Tone.Sarcastic },
|
|
879
|
+
);
|
|
880
|
+
}
|
|
881
|
+
},
|
|
882
|
+
},
|
|
883
|
+
{
|
|
884
|
+
title: 'Poetic Tone',
|
|
885
|
+
icon: <PerformingArtsIcon />,
|
|
886
|
+
action: () => {
|
|
887
|
+
if (messageText && messageText.length > 0 && !waitAIWidget) {
|
|
888
|
+
setWaitAIWidget(true);
|
|
889
|
+
AIRephrase?.textToWidget(
|
|
890
|
+
messageText,
|
|
891
|
+
messageEntitiesToIChatMessageCollection(messagesToView),
|
|
892
|
+
{ tone: Tone.Poetic },
|
|
893
|
+
);
|
|
894
|
+
}
|
|
895
|
+
},
|
|
896
|
+
},
|
|
897
|
+
{
|
|
898
|
+
title: 'Back to original text',
|
|
899
|
+
icon: <WhiteCheckMarkIcon />,
|
|
900
|
+
action: () => {
|
|
901
|
+
if (messageText && messageText.length > 0 && !waitAIWidget) {
|
|
902
|
+
setWaitAIWidget(true);
|
|
903
|
+
AIRephrase?.textToWidget(
|
|
904
|
+
messageText,
|
|
905
|
+
messageEntitiesToIChatMessageCollection(messagesToView),
|
|
906
|
+
{ tone: Tone.Unchanged },
|
|
907
|
+
);
|
|
908
|
+
}
|
|
909
|
+
},
|
|
910
|
+
},
|
|
911
|
+
];
|
|
912
|
+
}
|
|
913
|
+
|
|
800
914
|
return (
|
|
801
915
|
<div
|
|
802
916
|
style={
|
|
@@ -927,28 +1041,54 @@ const MessagesView: React.FC<HeaderDialogsMessagesProps> = ({
|
|
|
927
1041
|
autoScrollToBottom={scrollUpToDown}
|
|
928
1042
|
/>
|
|
929
1043
|
)}
|
|
930
|
-
{(messagesViewModel?.loading || waitAIWidget) && (
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
1044
|
+
{/* {(messagesViewModel?.loading || waitAIWidget) && ( */}
|
|
1045
|
+
<div
|
|
1046
|
+
style={{
|
|
1047
|
+
display: 'flex',
|
|
1048
|
+
flexDirection: 'row',
|
|
1049
|
+
alignItems: 'center',
|
|
1050
|
+
justifyContent: 'center',
|
|
1051
|
+
}}
|
|
1052
|
+
>
|
|
1053
|
+
{messagesViewModel?.loading && (
|
|
1054
|
+
<div
|
|
1055
|
+
style={{
|
|
1056
|
+
height: '44px',
|
|
1057
|
+
width: '44px',
|
|
1058
|
+
}}
|
|
1059
|
+
>
|
|
1060
|
+
<LoaderComponent
|
|
1061
|
+
width="44"
|
|
1062
|
+
height="44"
|
|
1063
|
+
color="var(--color-background-info)"
|
|
1064
|
+
/>
|
|
1065
|
+
</div>
|
|
1066
|
+
)}
|
|
1067
|
+
</div>
|
|
1068
|
+
|
|
944
1069
|
<div
|
|
945
1070
|
style={theme ? { color: theme.mainElements() } : {}}
|
|
946
1071
|
className="message-view-container--warning-error"
|
|
947
1072
|
>
|
|
948
1073
|
{warningErrorText}
|
|
949
1074
|
</div>
|
|
1075
|
+
{/* <div> */}
|
|
1076
|
+
{/* <SliderMenu */}
|
|
1077
|
+
{/* width={680} */}
|
|
1078
|
+
{/* arrowColor="var(--chat-input)" */}
|
|
1079
|
+
{/* activeArrowColor="var(--divider)" */}
|
|
1080
|
+
{/* activeItemBorderColor="var(--main-elements)" */}
|
|
1081
|
+
{/* borderColor="var(--divider)" */}
|
|
1082
|
+
{/* backgroundColor="white" */}
|
|
1083
|
+
{/* itemBackgroundColor="var(--divider)" */}
|
|
1084
|
+
{/* itemWidth={130} */}
|
|
1085
|
+
{/* itemHeight={20} */}
|
|
1086
|
+
{/* fontSize={11} // Задаем размер шрифта */}
|
|
1087
|
+
{/* itemBorder="1px solid var(--divider)" */}
|
|
1088
|
+
{/* items={getAIEditingMessagesItems()} */}
|
|
1089
|
+
{/* /> */}
|
|
1090
|
+
{/* </div> */}
|
|
950
1091
|
</div>
|
|
951
|
-
|
|
952
1092
|
<div
|
|
953
1093
|
style={{
|
|
954
1094
|
flex: `flex: 1 1 ${maxWidthToResizing}`,
|
|
@@ -996,11 +1136,11 @@ const MessagesView: React.FC<HeaderDialogsMessagesProps> = ({
|
|
|
996
1136
|
}}
|
|
997
1137
|
/>
|
|
998
1138
|
</label>
|
|
999
|
-
{/* start
|
|
1000
|
-
{/* {
|
|
1139
|
+
{/* start InputWidgetToRightPlaceHolder */}
|
|
1140
|
+
{/* {InputWidgetToRightPlaceHolder && ( */}
|
|
1001
1141
|
{/* <div> */}
|
|
1002
1142
|
{/* <ActiveSvg */}
|
|
1003
|
-
{/* content={
|
|
1143
|
+
{/* content={InputWidgetToRightPlaceHolder.renderWidget()} */}
|
|
1004
1144
|
{/* clickAction={() => { */}
|
|
1005
1145
|
{/* console.log('click left place golder widget'); */}
|
|
1006
1146
|
{/* if (messagesViewModel?.loading) return; */}
|
|
@@ -1013,33 +1153,54 @@ const MessagesView: React.FC<HeaderDialogsMessagesProps> = ({
|
|
|
1013
1153
|
{/* /> */}
|
|
1014
1154
|
{/* </div> */}
|
|
1015
1155
|
{/* )} */}
|
|
1016
|
-
{/* end
|
|
1156
|
+
{/* end InputWidgetToRightPlaceHolder */}
|
|
1017
1157
|
{!isRecording && (
|
|
1018
|
-
<
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1158
|
+
<div className="input-text-message">
|
|
1159
|
+
<div className="type-message">
|
|
1160
|
+
<textarea
|
|
1161
|
+
style={theme ? { backgroundColor: theme.chatInput() } : {}}
|
|
1162
|
+
disabled={messagesViewModel?.loading}
|
|
1163
|
+
value={messageText}
|
|
1164
|
+
onFocus={() => {
|
|
1165
|
+
setVoiceMessage(false);
|
|
1166
|
+
}}
|
|
1167
|
+
onChange={(event) => {
|
|
1168
|
+
setMessageText(event.target.value);
|
|
1169
|
+
}}
|
|
1170
|
+
onInput={() => {
|
|
1171
|
+
messagesViewModel.sendTypingTextMessage();
|
|
1172
|
+
}}
|
|
1173
|
+
onKeyDown={(e) => {
|
|
1174
|
+
console.log(
|
|
1175
|
+
`onKeyDown: ${e.key} shift ${
|
|
1176
|
+
e.shiftKey ? 'true' : 'false'
|
|
1177
|
+
} ctrl ${e.ctrlKey ? 'true' : 'false'}`,
|
|
1178
|
+
);
|
|
1179
|
+
if (e.key === 'Enter' && !e.shiftKey && !e.ctrlKey) {
|
|
1180
|
+
sendTextMessageActions();
|
|
1181
|
+
}
|
|
1182
|
+
}}
|
|
1183
|
+
placeholder="enter text to send"
|
|
1184
|
+
/>
|
|
1185
|
+
</div>
|
|
1186
|
+
{/* <div className="right"> */}
|
|
1187
|
+
{/* {AIRephrase && ( */}
|
|
1188
|
+
{/* <div className="icon"> */}
|
|
1189
|
+
{/* <AIWidgetActions */}
|
|
1190
|
+
{/* widgetToRender={ */}
|
|
1191
|
+
{/* <ToneIcon */}
|
|
1192
|
+
{/* width="24" */}
|
|
1193
|
+
{/* height="24" */}
|
|
1194
|
+
{/* applyZoom */}
|
|
1195
|
+
{/* color={theme ? theme.mainText() : 'var(--main-text)'} */}
|
|
1196
|
+
{/* /> */}
|
|
1197
|
+
{/* } */}
|
|
1198
|
+
{/* items={getAIEditingMessagesItems()} */}
|
|
1199
|
+
{/* /> */}
|
|
1200
|
+
{/* </div> */}
|
|
1201
|
+
{/* )} */}
|
|
1202
|
+
{/* </div> */}
|
|
1203
|
+
</div>
|
|
1043
1204
|
)}
|
|
1044
1205
|
|
|
1045
1206
|
{isRecording && (
|
|
@@ -1058,23 +1219,192 @@ const MessagesView: React.FC<HeaderDialogsMessagesProps> = ({
|
|
|
1058
1219
|
}}
|
|
1059
1220
|
/>
|
|
1060
1221
|
)}
|
|
1061
|
-
{/*
|
|
1062
|
-
{/* {AIEditMessage && ( */}
|
|
1222
|
+
{/* {AIRephrase && ( */}
|
|
1063
1223
|
{/* <div> */}
|
|
1064
|
-
{/* <
|
|
1065
|
-
{/*
|
|
1066
|
-
{/*
|
|
1067
|
-
{/*
|
|
1068
|
-
{/*
|
|
1069
|
-
{/*
|
|
1070
|
-
{/*
|
|
1071
|
-
{/*
|
|
1072
|
-
{/*
|
|
1224
|
+
{/* /!* <ContextMenu *!/ */}
|
|
1225
|
+
{/* /!* widgetToRender={ *!/ */}
|
|
1226
|
+
{/* /!* <AIWidgetIcon *!/ */}
|
|
1227
|
+
{/* /!* applyZoom *!/ */}
|
|
1228
|
+
{/* /!* color="var(--main-elements)" *!/ */}
|
|
1229
|
+
{/* /!* width="24" *!/ */}
|
|
1230
|
+
{/* /!* height="24" *!/ */}
|
|
1231
|
+
{/* /!* /> *!/ */}
|
|
1232
|
+
{/* /!* } *!/ */}
|
|
1233
|
+
{/* /!* items={[ *!/ */}
|
|
1234
|
+
{/* /!* // { *!/ */}
|
|
1235
|
+
{/* /!* // title: 'AI Chat Summary', *!/ */}
|
|
1236
|
+
{/* /!* // // eslint-disable-next-line @typescript-eslint/no-empty-function *!/ */}
|
|
1237
|
+
{/* /!* // action: () => {}, *!/ */}
|
|
1238
|
+
{/* /!* // }, *!/ */}
|
|
1239
|
+
{/* /!* { *!/ */}
|
|
1240
|
+
{/* /!* title: 'AI Translate', *!/ */}
|
|
1241
|
+
{/* /!* action: () => { *!/ */}
|
|
1242
|
+
{/* /!* if ( *!/ */}
|
|
1243
|
+
{/* /!* messageText && *!/ */}
|
|
1244
|
+
{/* /!* messageText.length > 0 && *!/ */}
|
|
1245
|
+
{/* /!* !waitAIWidget *!/ */}
|
|
1246
|
+
{/* /!* ) { *!/ */}
|
|
1247
|
+
{/* /!* setWaitAIWidget(true); *!/ */}
|
|
1248
|
+
{/* /!* AITranslation?.textToWidget( *!/ */}
|
|
1249
|
+
{/* /!* messageText, *!/ */}
|
|
1250
|
+
{/* /!* messageEntitiesToIChatMessageCollection(messagesToView), *!/ */}
|
|
1251
|
+
{/* /!* ); *!/ */}
|
|
1252
|
+
{/* /!* } *!/ */}
|
|
1253
|
+
{/* /!* }, *!/ */}
|
|
1254
|
+
{/* /!* }, *!/ */}
|
|
1255
|
+
{/* /!* ]} *!/ */}
|
|
1256
|
+
{/* /!* /> *!/ */}
|
|
1257
|
+
{/* /!* <AIWidgetActions *!/ */}
|
|
1258
|
+
{/* /!* widgetToRender={ *!/ */}
|
|
1259
|
+
{/* /!* <AIWidgetIcon *!/ */}
|
|
1260
|
+
{/* /!* applyZoom *!/ */}
|
|
1261
|
+
{/* /!* color="var(--main-elements)" *!/ */}
|
|
1262
|
+
{/* /!* width="16" *!/ */}
|
|
1263
|
+
{/* /!* height="16" *!/ */}
|
|
1264
|
+
{/* /!* /> *!/ */}
|
|
1265
|
+
{/* /!* } *!/ */}
|
|
1266
|
+
{/* /!* items={[ *!/ */}
|
|
1267
|
+
{/* /!* { *!/ */}
|
|
1268
|
+
{/* /!* title: 'English', *!/ */}
|
|
1269
|
+
{/* /!* // eslint-disable-next-line @typescript-eslint/no-empty-function,@typescript-eslint/no-misused-promises *!/ */}
|
|
1270
|
+
{/* /!* action: async () => { *!/ */}
|
|
1271
|
+
{/* /!* if ( *!/ */}
|
|
1272
|
+
{/* /!* messageText && *!/ */}
|
|
1273
|
+
{/* /!* messageText.length > 0 && *!/ */}
|
|
1274
|
+
{/* /!* !waitAIWidget *!/ */}
|
|
1275
|
+
{/* /!* ) { *!/ */}
|
|
1276
|
+
{/* /!* setWaitAIWidget(true); *!/ */}
|
|
1277
|
+
{/* /!* const translation = await AITranslation?.textToWidget( *!/ */}
|
|
1278
|
+
{/* /!* messageText, *!/ */}
|
|
1279
|
+
{/* /!* messageEntitiesToIChatMessageCollection(messagesToView), *!/ */}
|
|
1280
|
+
{/* /!* { *!/ */}
|
|
1281
|
+
{/* /!* language: *!/ */}
|
|
1282
|
+
{/* /!* 'English' || *!/ */}
|
|
1283
|
+
{/* /!* QBConfig.configAIApi.AITranslateWidgetConfig *!/ */}
|
|
1284
|
+
{/* /!* .defaultLanguage, *!/ */}
|
|
1285
|
+
{/* /!* }, *!/ */}
|
|
1286
|
+
{/* /!* ); *!/ */}
|
|
1287
|
+
|
|
1288
|
+
{/* /!* setMessageText(translation || ''); *!/ */}
|
|
1289
|
+
{/* /!* } *!/ */}
|
|
1290
|
+
{/* /!* }, *!/ */}
|
|
1291
|
+
{/* /!* }, *!/ */}
|
|
1292
|
+
{/* /!* { *!/ */}
|
|
1293
|
+
{/* /!* title: 'Ukrainian', *!/ */}
|
|
1294
|
+
{/* /!* // eslint-disable-next-line @typescript-eslint/no-misused-promises *!/ */}
|
|
1295
|
+
{/* /!* action: async () => { *!/ */}
|
|
1296
|
+
{/* /!* if ( *!/ */}
|
|
1297
|
+
{/* /!* messageText && *!/ */}
|
|
1298
|
+
{/* /!* messageText.length > 0 && *!/ */}
|
|
1299
|
+
{/* /!* !waitAIWidget *!/ */}
|
|
1300
|
+
{/* /!* ) { *!/ */}
|
|
1301
|
+
{/* /!* setWaitAIWidget(true); *!/ */}
|
|
1302
|
+
{/* /!* const translation = await AITranslation?.textToWidget( *!/ */}
|
|
1303
|
+
{/* /!* messageText, *!/ */}
|
|
1304
|
+
{/* /!* messageEntitiesToIChatMessageCollection(messagesToView), *!/ */}
|
|
1305
|
+
{/* /!* { *!/ */}
|
|
1306
|
+
{/* /!* language: *!/ */}
|
|
1307
|
+
{/* /!* 'Ukrainian' || *!/ */}
|
|
1308
|
+
{/* /!* QBConfig.configAIApi.AITranslateWidgetConfig *!/ */}
|
|
1309
|
+
{/* /!* .defaultLanguage, *!/ */}
|
|
1310
|
+
{/* /!* }, *!/ */}
|
|
1311
|
+
{/* /!* ); *!/ */}
|
|
1312
|
+
|
|
1313
|
+
{/* /!* setMessageText(translation || ''); *!/ */}
|
|
1314
|
+
{/* /!* } *!/ */}
|
|
1315
|
+
{/* /!* }, *!/ */}
|
|
1316
|
+
{/* /!* }, *!/ */}
|
|
1317
|
+
{/* /!* { *!/ */}
|
|
1318
|
+
{/* /!* title: 'Spanish', *!/ */}
|
|
1319
|
+
{/* /!* // eslint-disable-next-line @typescript-eslint/no-misused-promises *!/ */}
|
|
1320
|
+
{/* /!* action: async () => { *!/ */}
|
|
1321
|
+
{/* /!* if ( *!/ */}
|
|
1322
|
+
{/* /!* messageText && *!/ */}
|
|
1323
|
+
{/* /!* messageText.length > 0 && *!/ */}
|
|
1324
|
+
{/* /!* !waitAIWidget *!/ */}
|
|
1325
|
+
{/* /!* ) { *!/ */}
|
|
1326
|
+
{/* /!* setWaitAIWidget(true); *!/ */}
|
|
1327
|
+
{/* /!* const translation = await AITranslation?.textToWidget( *!/ */}
|
|
1328
|
+
{/* /!* messageText, *!/ */}
|
|
1329
|
+
{/* /!* messageEntitiesToIChatMessageCollection(messagesToView), *!/ */}
|
|
1330
|
+
{/* /!* { *!/ */}
|
|
1331
|
+
{/* /!* language: *!/ */}
|
|
1332
|
+
{/* /!* 'Spanish' || *!/ */}
|
|
1333
|
+
{/* /!* QBConfig.configAIApi.AITranslateWidgetConfig *!/ */}
|
|
1334
|
+
{/* /!* .defaultLanguage, *!/ */}
|
|
1335
|
+
{/* /!* }, *!/ */}
|
|
1336
|
+
{/* /!* ); *!/ */}
|
|
1337
|
+
|
|
1338
|
+
{/* /!* setMessageText(translation || ''); *!/ */}
|
|
1339
|
+
{/* /!* } *!/ */}
|
|
1340
|
+
{/* /!* }, *!/ */}
|
|
1341
|
+
{/* /!* }, *!/ */}
|
|
1342
|
+
{/* /!* { *!/ */}
|
|
1343
|
+
{/* /!* title: 'Portuguese', *!/ */}
|
|
1344
|
+
{/* /!* // eslint-disable-next-line @typescript-eslint/no-misused-promises *!/ */}
|
|
1345
|
+
{/* /!* action: async () => { *!/ */}
|
|
1346
|
+
{/* /!* if ( *!/ */}
|
|
1347
|
+
{/* /!* messageText && *!/ */}
|
|
1348
|
+
{/* /!* messageText.length > 0 && *!/ */}
|
|
1349
|
+
{/* /!* !waitAIWidget *!/ */}
|
|
1350
|
+
{/* /!* ) { *!/ */}
|
|
1351
|
+
{/* /!* setWaitAIWidget(true); *!/ */}
|
|
1352
|
+
{/* /!* const translation = await AITranslation?.textToWidget( *!/ */}
|
|
1353
|
+
{/* /!* messageText, *!/ */}
|
|
1354
|
+
{/* /!* messageEntitiesToIChatMessageCollection(messagesToView), *!/ */}
|
|
1355
|
+
{/* /!* { *!/ */}
|
|
1356
|
+
{/* /!* language: *!/ */}
|
|
1357
|
+
{/* /!* 'Portuguese' || *!/ */}
|
|
1358
|
+
{/* /!* QBConfig.configAIApi.AITranslateWidgetConfig *!/ */}
|
|
1359
|
+
{/* /!* .defaultLanguage, *!/ */}
|
|
1360
|
+
{/* /!* }, *!/ */}
|
|
1361
|
+
{/* /!* ); *!/ */}
|
|
1362
|
+
|
|
1363
|
+
{/* /!* setMessageText(translation || ''); *!/ */}
|
|
1364
|
+
{/* /!* } *!/ */}
|
|
1365
|
+
{/* /!* }, *!/ */}
|
|
1366
|
+
{/* /!* }, *!/ */}
|
|
1367
|
+
{/* /!* { *!/ */}
|
|
1368
|
+
{/* /!* title: 'French', *!/ */}
|
|
1369
|
+
{/* /!* // eslint-disable-next-line @typescript-eslint/no-misused-promises *!/ */}
|
|
1370
|
+
{/* /!* action: async () => { *!/ */}
|
|
1371
|
+
{/* /!* if ( *!/ */}
|
|
1372
|
+
{/* /!* messageText && *!/ */}
|
|
1373
|
+
{/* /!* messageText.length > 0 && *!/ */}
|
|
1374
|
+
{/* /!* !waitAIWidget *!/ */}
|
|
1375
|
+
{/* /!* ) { *!/ */}
|
|
1376
|
+
{/* /!* setWaitAIWidget(true); *!/ */}
|
|
1377
|
+
{/* /!* const translation = await AITranslation?.textToWidget( *!/ */}
|
|
1378
|
+
{/* /!* messageText, *!/ */}
|
|
1379
|
+
{/* /!* messageEntitiesToIChatMessageCollection(messagesToView), *!/ */}
|
|
1380
|
+
{/* /!* { *!/ */}
|
|
1381
|
+
{/* /!* language: *!/ */}
|
|
1382
|
+
{/* /!* 'French' || *!/ */}
|
|
1383
|
+
{/* /!* QBConfig.configAIApi.AITranslateWidgetConfig *!/ */}
|
|
1384
|
+
{/* /!* .defaultLanguage, *!/ */}
|
|
1385
|
+
{/* /!* }, *!/ */}
|
|
1386
|
+
{/* /!* ); *!/ */}
|
|
1387
|
+
|
|
1388
|
+
{/* /!* setMessageText(translation || ''); *!/ */}
|
|
1389
|
+
{/* /!* } *!/ */}
|
|
1390
|
+
{/* /!* }, *!/ */}
|
|
1391
|
+
{/* /!* }, *!/ */}
|
|
1392
|
+
{/* /!* // { *!/ */}
|
|
1393
|
+
{/* /!* // title: 'German', *!/ */}
|
|
1394
|
+
{/* /!* // action: () => {}, *!/ */}
|
|
1395
|
+
{/* /!* // }, *!/ */}
|
|
1396
|
+
{/* /!* ]} *!/ */}
|
|
1397
|
+
{/* /!* /> *!/ */}
|
|
1398
|
+
{/* <AIWidgetActions */}
|
|
1399
|
+
{/* title="AI Rephrase Message" */}
|
|
1400
|
+
{/* widgetToRender={ */}
|
|
1401
|
+
{/* <AIWidgetIcon applyZoom color="blue" width="24" height="24" /> */}
|
|
1402
|
+
{/* } */}
|
|
1403
|
+
{/* items={getAIEditingMessagesItems()} */}
|
|
1073
1404
|
{/* /> */}
|
|
1074
1405
|
{/* </div> */}
|
|
1075
1406
|
{/* )} */}
|
|
1076
|
-
{
|
|
1077
|
-
{!isVoiceMessage && (
|
|
1407
|
+
{!isVoiceMessage && !waitAIWidget && (
|
|
1078
1408
|
<div>
|
|
1079
1409
|
<ActiveSvg
|
|
1080
1410
|
content={
|
|
@@ -1095,29 +1425,42 @@ const MessagesView: React.FC<HeaderDialogsMessagesProps> = ({
|
|
|
1095
1425
|
/>
|
|
1096
1426
|
</div>
|
|
1097
1427
|
)}
|
|
1098
|
-
{
|
|
1099
|
-
<div
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
color={isRecording ? 'var(--error)' : 'var(--input-elements)'}
|
|
1107
|
-
/>
|
|
1108
|
-
}
|
|
1109
|
-
clickAction={() => {
|
|
1110
|
-
console.log('click send voice message');
|
|
1111
|
-
if (messagesViewModel?.loading) return;
|
|
1112
|
-
setIsRecording(!isRecording);
|
|
1113
|
-
}}
|
|
1114
|
-
touchAction={() => {
|
|
1115
|
-
console.log('touch send message');
|
|
1116
|
-
if (messagesViewModel?.loading) return;
|
|
1117
|
-
setIsRecording(!isRecording);
|
|
1118
|
-
}}
|
|
1119
|
-
/>
|
|
1428
|
+
{waitAIWidget ? (
|
|
1429
|
+
<div
|
|
1430
|
+
style={{
|
|
1431
|
+
height: '44px',
|
|
1432
|
+
width: '24px',
|
|
1433
|
+
}}
|
|
1434
|
+
>
|
|
1435
|
+
<LoaderComponent width="24" height="24" color="var(--caption)" />
|
|
1120
1436
|
</div>
|
|
1437
|
+
) : (
|
|
1438
|
+
isVoiceMessage && (
|
|
1439
|
+
<div>
|
|
1440
|
+
<ActiveSvg
|
|
1441
|
+
content={
|
|
1442
|
+
<VoiceIcon
|
|
1443
|
+
width="21"
|
|
1444
|
+
height="18"
|
|
1445
|
+
applyZoom
|
|
1446
|
+
color={
|
|
1447
|
+
isRecording ? 'var(--error)' : 'var(--input-elements)'
|
|
1448
|
+
}
|
|
1449
|
+
/>
|
|
1450
|
+
}
|
|
1451
|
+
clickAction={() => {
|
|
1452
|
+
console.log('click send voice message');
|
|
1453
|
+
if (messagesViewModel?.loading) return;
|
|
1454
|
+
setIsRecording(!isRecording);
|
|
1455
|
+
}}
|
|
1456
|
+
touchAction={() => {
|
|
1457
|
+
console.log('touch send message');
|
|
1458
|
+
if (messagesViewModel?.loading) return;
|
|
1459
|
+
setIsRecording(!isRecording);
|
|
1460
|
+
}}
|
|
1461
|
+
/>
|
|
1462
|
+
</div>
|
|
1463
|
+
)
|
|
1121
1464
|
)}
|
|
1122
1465
|
</div>
|
|
1123
1466
|
{/* <div className="message-view-container--warning-error"> */}
|