quickblox-react-ui-kit 0.4.2-beta.2 → 0.4.2-beta.4
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/.storybook/main.ts +26 -0
- package/.storybook/preview.ts +16 -0
- package/dist/CommonTypes/CommonTypes.d.ts +16 -0
- package/dist/Presentation/Views/DialogList/DialogList.d.ts +8 -26
- package/dist/Presentation/layouts/Desktop/QuickBloxUIKitDesktopLayout.d.ts +1 -14
- package/dist/hooks/useQuickBloxUIKit.d.ts +110 -0
- package/dist/index-ui.d.ts +16 -1
- package/dist/index-ui.js +3289 -3248
- package/dist/index-ui.js.map +1 -1
- package/package.json +2 -2
- package/public/favicon.ico +0 -0
- package/public/index.html +47 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/quickblox.js +52585 -0
- package/public/quickblox.min.js +1 -0
- package/public/robots.txt +3 -0
- package/src/App.scss +3 -0
- package/src/App.tsx +232 -0
- package/src/CommonTypes/BaseViewModel.ts +95 -0
- package/src/CommonTypes/CommonTypes.ts +214 -0
- package/src/CommonTypes/FunctionResult.ts +7 -0
- package/src/Data/Creator.ts +105 -0
- package/src/Data/DefaultConfigurations.ts +277 -0
- package/src/Data/Stubs.ts +1241 -0
- package/src/Data/dto/dialog/LocalDialogDTO.ts +42 -0
- package/src/Data/dto/dialog/LocalDialogsDTO.ts +21 -0
- package/src/Data/dto/dialog/RemoteDialogDTO.ts +58 -0
- package/src/Data/dto/dialog/RemoteDialogsDTO.ts +21 -0
- package/src/Data/dto/file/LocalFileDTO.ts +26 -0
- package/src/Data/dto/file/RemoteFileDTO.ts +26 -0
- package/src/Data/dto/message/LocalMessageDTO.ts +49 -0
- package/src/Data/dto/message/LocalMessagesDTO.ts +21 -0
- package/src/Data/dto/message/RemoteMessageDTO.ts +57 -0
- package/src/Data/dto/message/RemoteMessagesDTO.ts +21 -0
- package/src/Data/dto/user/LocalUserDTO.ts +37 -0
- package/src/Data/dto/user/LocalUsersDTO.ts +21 -0
- package/src/Data/dto/user/RemoteUserDTO.ts +37 -0
- package/src/Data/dto/user/RemoteUsersDTO.ts +21 -0
- package/src/Data/mapper/DialogLocalDTOMapper.ts +736 -0
- package/src/Data/mapper/DialogRemoteDTOMapper.ts +748 -0
- package/src/Data/mapper/FileLocalDTOMapper.ts +216 -0
- package/src/Data/mapper/FileRemoteDTOMapper.ts +230 -0
- package/src/Data/mapper/IMapper.ts +4 -0
- package/src/Data/mapper/MessageLocalDTOMapper.ts +426 -0
- package/src/Data/mapper/MessageRemoteDTOMapper.ts +465 -0
- package/src/Data/mapper/UserLocalDTOMapper.ts +387 -0
- package/src/Data/mapper/UserRemoteDTOMapper.ts +398 -0
- package/src/Data/repository/ConnectionRepository.ts +135 -0
- package/src/Data/repository/DialogsRepository.ts +374 -0
- package/src/Data/repository/EventMessagesRepository.ts +325 -0
- package/src/Data/repository/FileRepository.ts +107 -0
- package/src/Data/repository/MessagesRepository.ts +291 -0
- package/src/Data/repository/UsersRepository.ts +297 -0
- package/src/Data/source/AISource.ts +133 -0
- package/src/Data/source/exception/LocalDataSourceException.ts +17 -0
- package/src/Data/source/exception/MapperDTOException.ts +22 -0
- package/src/Data/source/exception/RemoteDataSourceException.ts +28 -0
- package/src/Data/source/exception/RepositoryException.ts +27 -0
- package/src/Data/source/local/ChatLocalStorageDataSource.ts +260 -0
- package/src/Data/source/local/ILocalDataSource.ts +41 -0
- package/src/Data/source/local/ILocalFileDataSource.ts +11 -0
- package/src/Data/source/local/LocalDataSource.ts +353 -0
- package/src/Data/source/local/LocalFileDataSource.ts +20 -0
- package/src/Data/source/remote/IRemoteDataSource.ts +127 -0
- package/src/Data/source/remote/Mapper/DialogDTOMapper.ts +453 -0
- package/src/Data/source/remote/Mapper/FileDTOMapper.ts +274 -0
- package/src/Data/source/remote/Mapper/IDTOMapper.ts +4 -0
- package/src/Data/source/remote/Mapper/MessageDTOMapper.ts +608 -0
- package/src/Data/source/remote/Mapper/UserDTOMapper.ts +344 -0
- package/src/Data/source/remote/RemoteDataSource.ts +1503 -0
- package/src/Domain/entity/Chat.ts +4 -0
- package/src/Domain/entity/ChatMessageAttachmentEntity.ts +15 -0
- package/src/Domain/entity/CustomDataEntity.ts +3 -0
- package/src/Domain/entity/DialogEntity.ts +15 -0
- package/src/Domain/entity/DialogEventInfo.ts +19 -0
- package/src/Domain/entity/DialogTypes.ts +7 -0
- package/src/Domain/entity/EventMessageType.ts +7 -0
- package/src/Domain/entity/FileEntity.ts +11 -0
- package/src/Domain/entity/FileTypes.ts +9 -0
- package/src/Domain/entity/GroupDialogEntity.ts +54 -0
- package/src/Domain/entity/LastMessageEntity.ts +5 -0
- package/src/Domain/entity/MessageEntity.ts +25 -0
- package/src/Domain/entity/NotificationTypes.ts +9 -0
- package/src/Domain/entity/PrivateDialogEntity.ts +46 -0
- package/src/Domain/entity/PublicDialogEntity.ts +80 -0
- package/src/Domain/entity/UserEntity.ts +13 -0
- package/src/Domain/exception/domain/DomainExecption.ts +5 -0
- package/src/Domain/repository/IDialogsRepository.ts +42 -0
- package/src/Domain/repository/IFileRepository.ts +9 -0
- package/src/Domain/repository/IMessagesRepository.ts +28 -0
- package/src/Domain/repository/IUsersRepository.ts +13 -0
- package/src/Domain/repository/Pagination.ts +48 -0
- package/src/Domain/use_cases/CreateDialogUseCase.ts +79 -0
- package/src/Domain/use_cases/ForwardMessagesUseCase.ts +73 -0
- package/src/Domain/use_cases/GetAllDialogsUseCase.ts +20 -0
- package/src/Domain/use_cases/GetAllDialogsUseCaseWithMock.ts +40 -0
- package/src/Domain/use_cases/GetAllMessagesForDialog.ts +61 -0
- package/src/Domain/use_cases/GetAllUsersUseCase.ts +34 -0
- package/src/Domain/use_cases/GetDialogByIdUseCase.ts +32 -0
- package/src/Domain/use_cases/GetUsersByIdsUseCase.ts +22 -0
- package/src/Domain/use_cases/LeaveDialogUseCase.ts +116 -0
- package/src/Domain/use_cases/RemoveUsersFromTheDialogUseCase.ts +118 -0
- package/src/Domain/use_cases/ReplyMessagesUseCase.ts +35 -0
- package/src/Domain/use_cases/SendTextMessageUseCase.ts +27 -0
- package/src/Domain/use_cases/SubscribeToDialogEventsUseCase.ts +160 -0
- package/src/Domain/use_cases/SubscribeToDialogsUpdatesUseCase.ts +68 -0
- package/src/Domain/use_cases/SubscribeToDialogsUpdatesUseCaseWithMock.ts +45 -0
- package/src/Domain/use_cases/SyncDialogsUseCase.ts +177 -0
- package/src/Domain/use_cases/UpdateCurrentDialogInDataSourceUseCase.ts +31 -0
- package/src/Domain/use_cases/UpdateDialogUseCase.ts +77 -0
- package/src/Domain/use_cases/UploadFileUseCase.ts +24 -0
- package/src/Domain/use_cases/UserTypingMessageUseCase.ts +50 -0
- package/src/Domain/use_cases/ai/AIAnswerAssistUseCase.ts +69 -0
- package/src/Domain/use_cases/ai/AIAnswerAssistWithProxyUseCase.ts +57 -0
- package/src/Domain/use_cases/ai/AIAnswerAssistWithSDKUseCase.ts +50 -0
- package/src/Domain/use_cases/ai/AIRephraseUseCase.ts +89 -0
- package/src/Domain/use_cases/ai/AIRephraseWithProxyUseCase.ts +62 -0
- package/src/Domain/use_cases/ai/AITranslateUseCase.ts +76 -0
- package/src/Domain/use_cases/ai/AITranslateWithProxyUseCase.ts +63 -0
- package/src/Domain/use_cases/ai/AITranslateWithSDKUseCase.ts +107 -0
- package/src/Domain/use_cases/base/BaseUseCase.ts +77 -0
- package/src/Domain/use_cases/base/IUseCase.ts +5 -0
- package/src/Domain/use_cases/base/Subscribable/ISubscribable.ts +6 -0
- package/src/Domain/use_cases/base/Subscribable/SubscriptionPerformer.ts +144 -0
- package/src/Presentation/.gitkeep +0 -0
- package/src/Presentation/Views/Dialog/AIComponents/AIAssist/AIAssist.scss +39 -0
- package/src/Presentation/Views/Dialog/AIComponents/AIAssist/AIAssist.tsx +71 -0
- package/src/Presentation/Views/Dialog/AIComponents/AIAssistComponent/AIAssistComponent.scss +32 -0
- package/src/Presentation/Views/Dialog/AIComponents/AIAssistComponent/AIAssistComponent.tsx +28 -0
- package/src/Presentation/Views/Dialog/AIComponents/AITranslate/AITranslate.scss +77 -0
- package/src/Presentation/Views/Dialog/AIComponents/AITranslate/AITranslate.tsx +126 -0
- package/src/Presentation/Views/Dialog/AIComponents/AITranslateComponent/AITranslateComponent.scss +47 -0
- package/src/Presentation/Views/Dialog/AIComponents/AITranslateComponent/AITranslateComponent.tsx +78 -0
- package/src/Presentation/Views/Dialog/AIWidgets/AIMessageWidget.ts +40 -0
- package/src/Presentation/Views/Dialog/AIWidgets/AIRephraseWidget/AIRephraseWidget.scss +25 -0
- package/src/Presentation/Views/Dialog/AIWidgets/AIRephraseWidget/AIRephraseWidget.tsx +186 -0
- package/src/Presentation/Views/Dialog/AIWidgets/AIWidgetActions/AIWidgetActions.scss +55 -0
- package/src/Presentation/Views/Dialog/AIWidgets/AIWidgetActions/AIWidgetActions.tsx +122 -0
- package/src/Presentation/Views/Dialog/AIWidgets/ErrorMessageIcon.tsx +98 -0
- package/src/Presentation/Views/Dialog/AIWidgets/SliderMenu.tsx +172 -0
- package/src/Presentation/Views/Dialog/AIWidgets/Tone.ts +21 -0
- package/src/Presentation/Views/Dialog/AIWidgets/UseDefaultAIAssistAnswerWidget.tsx +72 -0
- package/src/Presentation/Views/Dialog/AIWidgets/UseDefaultAIAssistAnswerWidgetWithProxy.tsx +72 -0
- package/src/Presentation/Views/Dialog/AIWidgets/UseDefaultAIAssistAnswerWidgetWithSDK.tsx +74 -0
- package/src/Presentation/Views/Dialog/AIWidgets/UseDefaultAIRephraseMessageWidget.tsx +96 -0
- package/src/Presentation/Views/Dialog/AIWidgets/UseDefaultAIRephraseMessageWidgetWithProxy.tsx +94 -0
- package/src/Presentation/Views/Dialog/AIWidgets/UseDefaultAITranslateWidget.tsx +78 -0
- package/src/Presentation/Views/Dialog/AIWidgets/UseDefaultAITranslateWidgetWithProxy.tsx +78 -0
- package/src/Presentation/Views/Dialog/AIWidgets/UseDefaultAITranslateWidgetWithSDK.tsx +70 -0
- package/src/Presentation/Views/Dialog/AIWidgets/useDefaultVoiceInputWidget.tsx +88 -0
- package/src/Presentation/Views/Dialog/ContextMenu/ContextMenu.scss +58 -0
- package/src/Presentation/Views/Dialog/ContextMenu/ContextMenu.tsx +93 -0
- package/src/Presentation/Views/Dialog/Dialog.scss +368 -0
- package/src/Presentation/Views/Dialog/Dialog.tsx +100 -0
- package/src/Presentation/Views/Dialog/DialogHeader/DialogBackIcon/DialogBackIcon.scss +29 -0
- package/src/Presentation/Views/Dialog/DialogHeader/DialogBackIcon/DialogBackIcon.tsx +34 -0
- package/src/Presentation/Views/Dialog/DialogHeader/DialogHeader.scss +114 -0
- package/src/Presentation/Views/Dialog/DialogHeader/DialogHeader.tsx +51 -0
- package/src/Presentation/Views/Dialog/DialogHeader/DialogInfoIcon/DialogInfoIcon.scss +53 -0
- package/src/Presentation/Views/Dialog/DialogHeader/DialogInfoIcon/DialogInfoIcon.tsx +58 -0
- package/src/Presentation/Views/Dialog/DialogViewModel.ts +26 -0
- package/src/Presentation/Views/Dialog/DropDownMenu/DropDownMenu.scss +84 -0
- package/src/Presentation/Views/Dialog/DropDownMenu/DropDownMenu.tsx +105 -0
- package/src/Presentation/Views/Dialog/DropDownMenu/ItemDropDownMenu/ItemDropDownMenu.scss +50 -0
- package/src/Presentation/Views/Dialog/DropDownMenu/ItemDropDownMenu/ItemDropDownMenu.tsx +43 -0
- package/src/Presentation/Views/Dialog/ErrorToast/ErrorToast.scss +26 -0
- package/src/Presentation/Views/Dialog/ErrorToast/ErrorToast.tsx +23 -0
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogListItem/DialogListItem.scss +74 -0
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogListItem/DialogListItem.tsx +96 -0
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogsWithSearch.scss +50 -0
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogsWithSearch.tsx +97 -0
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/SearchComponent/SearchComponent.scss +98 -0
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/SearchComponent/SearchComponent.tsx +65 -0
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/ForwardMessageFlow.scss +159 -0
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/ForwardMessageFlow.tsx +122 -0
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/ForwardMessagePreview/ForwardMessagePreview.scss +100 -0
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/ForwardMessagePreview/ForwardMessagePreview.tsx +90 -0
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/InputForForwarding/InputForForwarding.scss +95 -0
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/InputForForwarding/InputForForwarding.tsx +47 -0
- package/src/Presentation/Views/Dialog/InputMessage/InputMessage.scss +92 -0
- package/src/Presentation/Views/Dialog/InputMessage/InputMessage.tsx +145 -0
- package/src/Presentation/Views/Dialog/Message/HighLightLink/HighLightLink.scss +97 -0
- package/src/Presentation/Views/Dialog/Message/HighLightLink/HighLightLink.tsx +114 -0
- package/src/Presentation/Views/Dialog/Message/IncomingForwardedMessage/IncomingForwardedMessage.scss +250 -0
- package/src/Presentation/Views/Dialog/Message/IncomingForwardedMessage/IncomingForwardedMessage.tsx +290 -0
- package/src/Presentation/Views/Dialog/Message/IncomingMessage/AvatarContentIncomingUser/AvatarContentIncomingUser.scss +22 -0
- package/src/Presentation/Views/Dialog/Message/IncomingMessage/AvatarContentIncomingUser/AvatarContentIncomingUser.tsx +32 -0
- package/src/Presentation/Views/Dialog/Message/IncomingMessage/IncomingMessage.scss +241 -0
- package/src/Presentation/Views/Dialog/Message/IncomingMessage/IncomingMessage.tsx +316 -0
- package/src/Presentation/Views/Dialog/Message/IncomingMessage/MessageContentComponent/MessageContentComponent.scss +4 -0
- package/src/Presentation/Views/Dialog/Message/IncomingMessage/MessageContentComponent/MessageContentComponent.tsx +67 -0
- package/src/Presentation/Views/Dialog/Message/IncomingRepliedMessage/IncomingRepliedMessage.scss +250 -0
- package/src/Presentation/Views/Dialog/Message/IncomingRepliedMessage/IncomingRepliedMessage.tsx +298 -0
- package/src/Presentation/Views/Dialog/Message/Message.tsx +378 -0
- package/src/Presentation/Views/Dialog/Message/MessageAttachment/AudioAttachment/AudioAttachment.scss +31 -0
- package/src/Presentation/Views/Dialog/Message/MessageAttachment/AudioAttachment/AudioAttachment.tsx +155 -0
- package/src/Presentation/Views/Dialog/Message/MessageAttachment/DefaultAttachment/DefaultAttachment.scss +76 -0
- package/src/Presentation/Views/Dialog/Message/MessageAttachment/DefaultAttachment/DefaultAttachment.tsx +50 -0
- package/src/Presentation/Views/Dialog/Message/MessageAttachment/ImageAttachment/ImageAttachment.scss +14 -0
- package/src/Presentation/Views/Dialog/Message/MessageAttachment/ImageAttachment/ImageAttachment.tsx +50 -0
- package/src/Presentation/Views/Dialog/Message/MessageAttachment/MessageAttachment.tsx +92 -0
- package/src/Presentation/Views/Dialog/Message/MessageAttachment/VideoAttachment/VideoAttachment.scss +18 -0
- package/src/Presentation/Views/Dialog/Message/MessageAttachment/VideoAttachment/VideoAttachment.tsx +58 -0
- package/src/Presentation/Views/Dialog/Message/MessageContextMenu/MessageContextMenu.scss +10 -0
- package/src/Presentation/Views/Dialog/Message/MessageContextMenu/MessageContextMenu.tsx +61 -0
- package/src/Presentation/Views/Dialog/Message/OutgoinForwardedMessage/OutgoinForwardedMessage.scss +160 -0
- package/src/Presentation/Views/Dialog/Message/OutgoinForwardedMessage/OutgoinForwardedMessage.tsx +133 -0
- package/src/Presentation/Views/Dialog/Message/OutgoingMessage/OutgoingMessage.scss +122 -0
- package/src/Presentation/Views/Dialog/Message/OutgoingMessage/OutgoingMessage.tsx +104 -0
- package/src/Presentation/Views/Dialog/Message/OutgoingRepliedMessage/OutgoingRepliedMessage.scss +155 -0
- package/src/Presentation/Views/Dialog/Message/OutgoingRepliedMessage/OutgoingRepliedMessage.tsx +103 -0
- package/src/Presentation/Views/Dialog/MessageContextMenu/MessageContextMenu.scss +19 -0
- package/src/Presentation/Views/Dialog/MessageContextMenu/MessageContextMenu.tsx +78 -0
- package/src/Presentation/Views/Dialog/MessageItem/MessageItem.scss +21 -0
- package/src/Presentation/Views/Dialog/MessageItem/MessageItem.tsx +378 -0
- package/src/Presentation/Views/Dialog/SystemDateBanner/SystemDateBanner.scss +23 -0
- package/src/Presentation/Views/Dialog/SystemDateBanner/SystemDateBanner.tsx +17 -0
- package/src/Presentation/Views/Dialog/SystemMessageBanner/SystemMessageBanner.scss +21 -0
- package/src/Presentation/Views/Dialog/SystemMessageBanner/SystemMessageBanner.tsx +17 -0
- package/src/Presentation/Views/Dialog/VoiceMessage/VoiceMessage.tsx +21 -0
- package/src/Presentation/Views/Dialog/useDialogViewModel.ts +765 -0
- package/src/Presentation/Views/DialogInfo/DialogInfo.scss +237 -0
- package/src/Presentation/Views/DialogInfo/DialogInfo.tsx +495 -0
- package/src/Presentation/Views/DialogInfo/DialogMemberButton/DialogMembersButton.scss +42 -0
- package/src/Presentation/Views/DialogInfo/DialogMemberButton/DialogMembersButton.tsx +26 -0
- package/src/Presentation/Views/DialogInfo/MembersList/MembersList.scss +85 -0
- package/src/Presentation/Views/DialogInfo/MembersList/MembersList.tsx +74 -0
- package/src/Presentation/Views/DialogInfo/UsersList/SingleUser/SingleUser.scss +66 -0
- package/src/Presentation/Views/DialogInfo/UsersList/SingleUser/SingleUser.tsx +71 -0
- package/src/Presentation/Views/DialogInfo/UsersList/UsersList.scss +0 -0
- package/src/Presentation/Views/DialogInfo/UsersList/UsersList.tsx +71 -0
- package/src/Presentation/Views/DialogInfo/UsersList/UsersListViewModel.ts +15 -0
- package/src/Presentation/Views/DialogInfo/UsersList/useUsersListViewModel.ts +125 -0
- package/src/Presentation/Views/DialogList/DialogList.scss +150 -0
- package/src/Presentation/Views/DialogList/DialogList.tsx +70 -0
- package/src/Presentation/Views/DialogList/DialogListViewModel.ts +25 -0
- package/src/Presentation/Views/DialogList/useDialogListViewModel.ts +579 -0
- package/src/Presentation/Views/DialogListHeader/DialogListHeader.scss +68 -0
- package/src/Presentation/Views/DialogListHeader/DialogListHeader.tsx +90 -0
- package/src/Presentation/Views/EditDialog/EditDialog.scss +175 -0
- package/src/Presentation/Views/EditDialog/EditDialog.tsx +273 -0
- package/src/Presentation/Views/EditDialog/UserAvatar/UserAvatar.scss +32 -0
- package/src/Presentation/Views/EditDialog/UserAvatar/UserAvatar.tsx +59 -0
- package/src/Presentation/Views/Flow/CreateDialog/CreateDialog.scss +93 -0
- package/src/Presentation/Views/Flow/CreateDialog/CreateDialog.tsx +69 -0
- package/src/Presentation/Views/Flow/CreateDialogFlow/CreateNewDialogFlow.tsx +191 -0
- package/src/Presentation/Views/Flow/LeaveDialogFlow/LeaveDialogFlow.tsx +37 -0
- package/src/Presentation/Views/InviteMembers/InviteMembers.scss +202 -0
- package/src/Presentation/Views/InviteMembers/InviteMembers.tsx +316 -0
- package/src/Presentation/Views/InviteMembers/InviteMembersViewModel.ts +18 -0
- package/src/Presentation/Views/InviteMembers/InviteUsersList/SingleUserWithCheckBox/SingleUserWithCheckBox.scss +90 -0
- package/src/Presentation/Views/InviteMembers/InviteUsersList/SingleUserWithCheckBox/SingleUserWithCheckBox.tsx +122 -0
- package/src/Presentation/Views/InviteMembers/InviteUsersResultViewModel.ts +12 -0
- package/src/Presentation/Views/InviteMembers/NotFoundContent/NotFoundContent.scss +38 -0
- package/src/Presentation/Views/InviteMembers/NotFoundContent/NotFoundContent.tsx +22 -0
- package/src/Presentation/Views/InviteMembers/useInviteMembersViewModel.ts +146 -0
- package/src/Presentation/Views/Navigation/More.svg +7 -0
- package/src/Presentation/Views/PreviewDialog/PreviewDialog.scss +211 -0
- package/src/Presentation/Views/PreviewDialog/PreviewDialog.tsx +332 -0
- package/src/Presentation/Views/PreviewDialog/PreviewDialogContextMenu/PreviewDialogContextMenu.scss +9 -0
- package/src/Presentation/Views/PreviewDialog/PreviewDialogContextMenu/PreviewDialogContextMenu.tsx +59 -0
- package/src/Presentation/Views/PreviewDialog/PreviewDialogViewModel.ts +42 -0
- package/src/Presentation/Views/YesNoQuestion/YesNoQuestion.scss +11 -0
- package/src/Presentation/Views/YesNoQuestion/YesNoQuestion.tsx +48 -0
- package/src/Presentation/assets/fonts/.gitkeep +0 -0
- package/src/Presentation/assets/fonts/Roboto-Bold.eot +0 -0
- package/src/Presentation/assets/fonts/Roboto-Bold.ttf +0 -0
- package/src/Presentation/assets/fonts/Roboto-Bold.woff +0 -0
- package/src/Presentation/assets/fonts/Roboto-Bold.woff2 +0 -0
- package/src/Presentation/assets/fonts/Roboto-Medium.eot +0 -0
- package/src/Presentation/assets/fonts/Roboto-Medium.ttf +0 -0
- package/src/Presentation/assets/fonts/Roboto-Medium.woff +0 -0
- package/src/Presentation/assets/fonts/Roboto-Medium.woff2 +0 -0
- package/src/Presentation/assets/fonts/Roboto-Regular.eot +0 -0
- package/src/Presentation/assets/fonts/Roboto-Regular.ttf +0 -0
- package/src/Presentation/assets/fonts/Roboto-Regular.woff +0 -0
- package/src/Presentation/assets/fonts/Roboto-Regular.woff2 +0 -0
- package/src/Presentation/assets/img/Artem_Koltunov_Selfi.png +0 -0
- package/src/Presentation/assets/img/bee-img.png +0 -0
- package/src/Presentation/assets/img/web-doc.png +0 -0
- package/src/Presentation/components/Button.js +5 -0
- package/src/Presentation/components/Navbar.tsx +45 -0
- package/src/Presentation/components/TextInput.js +10 -0
- package/src/Presentation/components/UI/Buttons/ActiveButton/ActiveButton.tsx +40 -0
- package/src/Presentation/components/UI/Buttons/MainBoundedButton/MainBoundedButton.scss +0 -0
- package/src/Presentation/components/UI/Buttons/MainBoundedButton/MainBoundedButton.tsx +30 -0
- package/src/Presentation/components/UI/Buttons/MainButton/MainButton.css +103 -0
- package/src/Presentation/components/UI/Buttons/MainButton/MainButton.tsx +62 -0
- package/src/Presentation/components/UI/Elements/SwitchButton/SwitchButton.scss +61 -0
- package/src/Presentation/components/UI/Elements/SwitchButton/SwitchButton.tsx +48 -0
- package/src/Presentation/components/UI/Placeholders/ErrorComponent/ErrorComponent.scss +74 -0
- package/src/Presentation/components/UI/Placeholders/ErrorComponent/ErrorComponent.tsx +52 -0
- package/src/Presentation/components/UI/Placeholders/LoaderComponent/LoaderComponent.scss +21 -0
- package/src/Presentation/components/UI/Placeholders/LoaderComponent/LoaderComponent.tsx +44 -0
- package/src/Presentation/components/UI/svgs/ActiveSvg/ActiveSvg.scss +3 -0
- package/src/Presentation/components/UI/svgs/ActiveSvg/ActiveSvg.tsx +45 -0
- package/src/Presentation/components/UI/svgs/Icons/AIWidgets/AIWidget/Send.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/AIWidgets/AIWidget/index.tsx +39 -0
- package/src/Presentation/components/UI/svgs/Icons/AIWidgets/BookIcon/BookIcon.tsx +7 -0
- package/src/Presentation/components/UI/svgs/Icons/AIWidgets/BotIcon/BotIcon.svg +5 -0
- package/src/Presentation/components/UI/svgs/Icons/AIWidgets/BotIcon/BotIcon.tsx +50 -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/Add/Add.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Add/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/AddContact/Add contact.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/AddContact/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Archive/Archive.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Archive/index.tsx +22 -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/Copy/Copy.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Copy/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Delete/Delete.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Delete/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Download/Download.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Download/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Edit/Edit.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Edit/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/EditDots/EditDots.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/EditDots/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Emoji/Emoji.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Emoji/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/ForwardFilled/Forward filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/ForwardFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Hungup/Hungup.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Hungup/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/IncomeCall/Income call.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/IncomeCall/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Like/Like.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Like/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/NewChat/New chat.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/NewChat/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/OutcomeCall/Outcome call.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/OutcomeCall/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Phone/Phone.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Phone/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/PhoneFilled/Phone filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/PhoneFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Remove/Remove.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Remove/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Remove2/Remove2.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Remove2/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/ReplyFilled/Reply filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/ReplyFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Send/Send.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Send/index.tsx +38 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Share/Share.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Share/index.tsx +22 -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/SwapCamera/Swap camera.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/SwapCamera/index.tsx +22 -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/Actions/Unarchive/Unarchive.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Unarchive/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/VideoIcon/Video.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/VideoIcon/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Voice/Voice.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Voice/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Brodcast/Broadcast.svg +7 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Brodcast/index.tsx +38 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Chat/Chat.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Chat/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/ChatFilled/Chat filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/ChatFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Conference/Conference.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Conference/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Contact/Contact.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Contact/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/ContactFilled/Contact filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/ContactFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/GroupChat/Group chat.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/GroupChat/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Notifications/Notifications.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Notifications/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/PrivateChat/Private chat.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/PrivateChat/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/PublicChannel/Public channel.svg +7 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/PublicChannel/index.tsx +67 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Stream/Stream.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Stream/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/StreamFilled/Stream filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/StreamFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/User/User.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/User/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/IconsCommonTypes.ts +6 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/Attachment/Attachment.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/Attachment/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/AudioFile/Audio file.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/AudioFile/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/BrokenFile/Broken file.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/BrokenFile/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/Camera/Camera.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/Camera/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/GifFile/GIF file.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/GifFile/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageEmpty/Image.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageEmpty/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageFile/File.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageFile/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageFilled/Image filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/LinkWeb/Link.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/LinkWeb/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/Location/Location.svg +4 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/Location/index.tsx +26 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/TextDocument/Text document.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/TextDocument/index.tsx +22 -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/UI/svgs/Icons/Media/VideoFile/Video file.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/VideoFile/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Admin/Admin.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Admin/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Banned/Banned.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Banned/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Freeze/Freeze.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Freeze/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Moderations/Moderations.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Moderations/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Muted/Muted.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Muted/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/ArrowLeft/Arrow left.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/ArrowLeft/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/ArrowRight/Arrow right.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/ArrowRight/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Back/Back.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Back/index.tsx +34 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Close/Close.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Close/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Down/Down.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Down/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Leave/Leave.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Leave/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/More/More.svg +7 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/More/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Next/Next.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Next/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Plus/Plus.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Plus/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Refresh/Refresh.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Refresh/index.tsx +36 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Search/Search.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Search/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Settings/Settings.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Settings/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/SettingsField/Settings filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/SettingsField/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Error/Error.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Error/index.tsx +36 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Help/Help.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Help/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Information/Information.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Information/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/InformationFill/index.tsx +40 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Loader/Loader.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Loader/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Mention/Mention.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Mention/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Sent/Sent.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Sent/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/ViewedDelivered/Viewed_Delivered.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/ViewedDelivered/index.tsx +38 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CameraOff/Camera off.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CameraOff/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CameraOn/Camera on.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CameraOn/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CheckOff/Check off.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CheckOff/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CheckOn/Check on.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CheckOn/index.tsx +24 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Favourite/Favourite.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Favourite/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/FavouriteFilled/Favourite filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/FavouriteFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/FullScreen/Full screen.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/FullScreen/inex.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Hide/Hide.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Hide/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/ImagePlay/Play.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/ImagePlay/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Louder/Louder.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Louder/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/MicOff/Mic off.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/MicOff/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/MicOn/Mic on.svg +4 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/MicOn/index.tsx +26 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Minimize/Minimize.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Minimize/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/NotifyOff/Notify off.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/NotifyOff/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/NotifyOn/Notify on.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/NotifyOn/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Pause/Pause.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Pause/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Quite/Quite.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Quite/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Record/Record.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Record/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Screenshare/Screenshare.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Screenshare/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Show/Show.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Show/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Speaker/Speaker.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Speaker/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/SpeakerOff/Speaker off.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/SpeakerOff/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/StopRecord/Stop record.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/StopRecord/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/StopShare/Stop share.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/StopShare/index.tsx +22 -0
- package/src/Presentation/components/containers/ColumnContainer/ColumnContainer.scss +16 -0
- package/src/Presentation/components/containers/ColumnContainer/ColumnContainer.tsx +27 -0
- package/src/Presentation/components/containers/RowCenterContainer/RowCenterContainer.scss +45 -0
- package/src/Presentation/components/containers/RowCenterContainer/RowCenterContainer.tsx +88 -0
- package/src/Presentation/components/containers/RowLeftContainer/RowLeftContainer.scss +45 -0
- package/src/Presentation/components/containers/RowLeftContainer/RowLeftContainer.tsx +90 -0
- package/src/Presentation/components/containers/RowRightContainer/RowRightContainer.scss +46 -0
- package/src/Presentation/components/containers/RowRightContainer/RowRightContainer.tsx +90 -0
- package/src/Presentation/components/containers/ScrollableContainer/ScrollableContainer.scss +45 -0
- package/src/Presentation/components/containers/ScrollableContainer/ScrollableContainer.tsx +102 -0
- package/src/Presentation/components/containers/SectionList/hooks/createUseComponent.ts +20 -0
- package/src/Presentation/components/containers/SectionList/hooks/index.ts +4 -0
- package/src/Presentation/components/containers/SectionList/hooks/useMobileLayout.ts +27 -0
- package/src/Presentation/components/containers/SectionList/hooks/usePrevious.ts +11 -0
- package/src/Presentation/components/containers/SectionList/hooks/useVisibility.ts +17 -0
- package/src/Presentation/components/containers/SectionList/index.tsx +52 -0
- package/src/Presentation/components/containers/SectionList/styles.css +50 -0
- package/src/Presentation/components/containers/SectionList/useComponent.ts +136 -0
- package/src/Presentation/icons/actions/add-contact.svg +3 -0
- package/src/Presentation/icons/actions/add.svg +3 -0
- package/src/Presentation/icons/actions/archive.svg +3 -0
- package/src/Presentation/icons/actions/copy.svg +3 -0
- package/src/Presentation/icons/actions/delete.svg +3 -0
- package/src/Presentation/icons/actions/download.svg +3 -0
- package/src/Presentation/icons/actions/edit.svg +3 -0
- package/src/Presentation/icons/actions/emoji.svg +3 -0
- package/src/Presentation/icons/actions/forward-filled.svg +3 -0
- package/src/Presentation/icons/actions/hungup.svg +3 -0
- package/src/Presentation/icons/actions/income-call.svg +3 -0
- package/src/Presentation/icons/actions/index.ts +26 -0
- package/src/Presentation/icons/actions/like.svg +3 -0
- package/src/Presentation/icons/actions/new-chat.svg +3 -0
- package/src/Presentation/icons/actions/outcome-call.svg +3 -0
- package/src/Presentation/icons/actions/phone-filled.svg +3 -0
- package/src/Presentation/icons/actions/phone.svg +3 -0
- package/src/Presentation/icons/actions/remove-2.svg +3 -0
- package/src/Presentation/icons/actions/remove.svg +3 -0
- package/src/Presentation/icons/actions/rephrase.svg +6 -0
- package/src/Presentation/icons/actions/reply-filled.svg +3 -0
- package/src/Presentation/icons/actions/robot.svg +5 -0
- package/src/Presentation/icons/actions/send.svg +3 -0
- package/src/Presentation/icons/actions/share.svg +3 -0
- package/src/Presentation/icons/actions/swap-camera.svg +3 -0
- package/src/Presentation/icons/actions/translate.svg +3 -0
- package/src/Presentation/icons/actions/unarchive.svg +3 -0
- package/src/Presentation/icons/actions/video.svg +3 -0
- package/src/Presentation/icons/actions/voice.svg +3 -0
- package/src/Presentation/icons/contents/broadcast.svg +7 -0
- package/src/Presentation/icons/contents/chat-filled.svg +3 -0
- package/src/Presentation/icons/contents/chat.svg +3 -0
- package/src/Presentation/icons/contents/conference.svg +3 -0
- package/src/Presentation/icons/contents/contact-filled.svg +3 -0
- package/src/Presentation/icons/contents/contact.svg +3 -0
- package/src/Presentation/icons/contents/group-chat.svg +3 -0
- package/src/Presentation/icons/contents/index.ts +13 -0
- package/src/Presentation/icons/contents/notifications.svg +3 -0
- package/src/Presentation/icons/contents/private-chat.svg +3 -0
- package/src/Presentation/icons/contents/public-channel.svg +7 -0
- package/src/Presentation/icons/contents/stream-filled.svg +3 -0
- package/src/Presentation/icons/contents/stream.svg +3 -0
- package/src/Presentation/icons/contents/user.svg +3 -0
- package/src/Presentation/icons/index.ts +7 -0
- package/src/Presentation/icons/media/attachment.svg +3 -0
- package/src/Presentation/icons/media/audio-file.svg +3 -0
- package/src/Presentation/icons/media/broken-file.svg +3 -0
- package/src/Presentation/icons/media/camera.svg +3 -0
- package/src/Presentation/icons/media/file.svg +3 -0
- package/src/Presentation/icons/media/gif-file.svg +3 -0
- package/src/Presentation/icons/media/image-filled.svg +3 -0
- package/src/Presentation/icons/media/image.svg +3 -0
- package/src/Presentation/icons/media/index.ts +12 -0
- package/src/Presentation/icons/media/link.svg +3 -0
- package/src/Presentation/icons/media/location.svg +4 -0
- package/src/Presentation/icons/media/text-document.svg +3 -0
- package/src/Presentation/icons/media/video-file.svg +3 -0
- package/src/Presentation/icons/moderation/admin.svg +3 -0
- package/src/Presentation/icons/moderation/banned.svg +3 -0
- package/src/Presentation/icons/moderation/freeze.svg +3 -0
- package/src/Presentation/icons/moderation/index.ts +5 -0
- package/src/Presentation/icons/moderation/moderations.svg +3 -0
- package/src/Presentation/icons/moderation/muted.svg +3 -0
- package/src/Presentation/icons/navigation/arrow-left.svg +3 -0
- package/src/Presentation/icons/navigation/arrow-right.svg +3 -0
- package/src/Presentation/icons/navigation/back.svg +3 -0
- package/src/Presentation/icons/navigation/close.svg +3 -0
- package/src/Presentation/icons/navigation/down.svg +3 -0
- package/src/Presentation/icons/navigation/index.ts +12 -0
- package/src/Presentation/icons/navigation/leave.svg +3 -0
- package/src/Presentation/icons/navigation/more.svg +3 -0
- package/src/Presentation/icons/navigation/next.svg +3 -0
- package/src/Presentation/icons/navigation/plus.svg +3 -0
- package/src/Presentation/icons/navigation/refresh.svg +3 -0
- package/src/Presentation/icons/navigation/search.svg +3 -0
- package/src/Presentation/icons/navigation/settings-filled.svg +3 -0
- package/src/Presentation/icons/navigation/settings.svg +3 -0
- package/src/Presentation/icons/status/error.svg +3 -0
- package/src/Presentation/icons/status/help.svg +3 -0
- package/src/Presentation/icons/status/index.ts +7 -0
- package/src/Presentation/icons/status/information.svg +3 -0
- package/src/Presentation/icons/status/loader.svg +3 -0
- package/src/Presentation/icons/status/mention.svg +3 -0
- package/src/Presentation/icons/status/sent.svg +3 -0
- package/src/Presentation/icons/status/viewed-delivered.svg +3 -0
- package/src/Presentation/icons/toggle/camera-off.svg +3 -0
- package/src/Presentation/icons/toggle/camera-on.svg +3 -0
- package/src/Presentation/icons/toggle/check-off.svg +3 -0
- package/src/Presentation/icons/toggle/check-on.svg +3 -0
- package/src/Presentation/icons/toggle/favorite.svg +3 -0
- package/src/Presentation/icons/toggle/favourite.svg +3 -0
- package/src/Presentation/icons/toggle/full-screen.svg +3 -0
- package/src/Presentation/icons/toggle/hide.svg +3 -0
- package/src/Presentation/icons/toggle/index.ts +23 -0
- package/src/Presentation/icons/toggle/louder.svg +3 -0
- package/src/Presentation/icons/toggle/mic-off.svg +3 -0
- package/src/Presentation/icons/toggle/mic-on.svg +4 -0
- package/src/Presentation/icons/toggle/minimize.svg +3 -0
- package/src/Presentation/icons/toggle/notify-off.svg +3 -0
- package/src/Presentation/icons/toggle/notify-on.svg +3 -0
- package/src/Presentation/icons/toggle/pause.svg +3 -0
- package/src/Presentation/icons/toggle/play.svg +3 -0
- package/src/Presentation/icons/toggle/quite.svg +3 -0
- package/src/Presentation/icons/toggle/record.svg +3 -0
- package/src/Presentation/icons/toggle/screenshare.svg +3 -0
- package/src/Presentation/icons/toggle/show.svg +3 -0
- package/src/Presentation/icons/toggle/speaker off.svg +3 -0
- package/src/Presentation/icons/toggle/speaker-off.svg +3 -0
- package/src/Presentation/icons/toggle/speaker.svg +3 -0
- package/src/Presentation/icons/toggle/stop-record.svg +3 -0
- package/src/Presentation/icons/toggle/stop-share.svg +3 -0
- package/src/Presentation/layouts/Desktop/DesktopLayout.scss +62 -0
- package/src/Presentation/layouts/Desktop/DesktopLayout.tsx +89 -0
- package/src/Presentation/layouts/Desktop/QuickBloxUIKitDesktopLayout.tsx +740 -0
- package/src/Presentation/layouts/LayoutCommonTypes.ts +7 -0
- package/src/Presentation/layouts/TestStage/CompanyLogo/CompanyLogo.tsx +27 -0
- package/src/Presentation/layouts/TestStage/LoginView/Login.scss +72 -0
- package/src/Presentation/layouts/TestStage/LoginView/Login.tsx +91 -0
- package/src/Presentation/providers/ProviderProps.ts +5 -0
- package/src/Presentation/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider.tsx +375 -0
- package/src/Presentation/providers/QuickBloxUIKitProvider/useEventMessagesRepository.ts +10 -0
- package/src/Presentation/providers/QuickBloxUIKitProvider/useQBConnection.ts +54 -0
- package/src/Presentation/providers/QuickBloxUIKitProvider/useQbInitializedDataContext.ts +83 -0
- package/src/Presentation/providers/QuickBloxUIKitProvider/useQbUIKitDataContext.ts +11 -0
- package/src/Presentation/themes/DarkTheme.ts +58 -0
- package/src/Presentation/themes/DefaultThemes/CustomTheme.ts +58 -0
- package/src/Presentation/themes/DefaultThemes/DefaultTheme.ts +58 -0
- package/src/Presentation/themes/LightTheme.ts +58 -0
- package/src/Presentation/themes/ThemeScheme.ts +83 -0
- package/src/Presentation/themes/UiKitTheme.ts +37 -0
- package/src/Presentation/themes/styles/_fonts.scss +32 -0
- package/src/Presentation/themes/styles/_mixins.scss +6 -0
- package/src/Presentation/themes/styles/_theme_colors_scheme.scss +56 -0
- package/src/Presentation/themes/styles/_theme_colors_scheme_green.scss +57 -0
- package/src/Presentation/themes/styles/_theme_colors_scheme_pink.scss +72 -0
- package/src/Presentation/themes/styles/_theme_dark.scss +37 -0
- package/src/Presentation/themes/styles/_theme_light.scss +38 -0
- package/src/Presentation/themes/styles/_variables.scss +54 -0
- package/src/Presentation/ui-components/Avatar/Avatar.scss +58 -0
- package/src/Presentation/ui-components/Avatar/Avatar.tsx +30 -0
- package/src/Presentation/ui-components/Avatar/avatar.stories.tsx +78 -0
- package/src/Presentation/ui-components/Badge/Badge.scss +23 -0
- package/src/Presentation/ui-components/Badge/Badge.stories.ts +64 -0
- package/src/Presentation/ui-components/Badge/Badge.tsx +23 -0
- package/src/Presentation/ui-components/Button/Button.scss +133 -0
- package/src/Presentation/ui-components/Button/Button.stories.ts +93 -0
- package/src/Presentation/ui-components/Button/Button.tsx +49 -0
- package/src/Presentation/ui-components/CheckBox/CheckBox.scss +10 -0
- package/src/Presentation/ui-components/CheckBox/CheckBox.tsx +23 -0
- package/src/Presentation/ui-components/DialogBanner/DialogBanner.scss +29 -0
- package/src/Presentation/ui-components/DialogBanner/DialogBanner.stories.ts +39 -0
- package/src/Presentation/ui-components/DialogBanner/DialogBanner.tsx +16 -0
- package/src/Presentation/ui-components/DialogItemPreview/DialogItemPreview.scss +71 -0
- package/src/Presentation/ui-components/DialogItemPreview/DialogItemPreview.stories.tsx +194 -0
- package/src/Presentation/ui-components/DialogItemPreview/DialogItemPreview.tsx +73 -0
- package/src/Presentation/ui-components/DialogWindow/DialogWindow.scss +56 -0
- package/src/Presentation/ui-components/DialogWindow/DialogWindow.stories.tsx +107 -0
- package/src/Presentation/ui-components/DialogWindow/DialogWindow.tsx +44 -0
- package/src/Presentation/ui-components/Dropdown/Dropdown.scss +82 -0
- package/src/Presentation/ui-components/Dropdown/Dropdown.stories.tsx +150 -0
- package/src/Presentation/ui-components/Dropdown/Dropdown.tsx +92 -0
- package/src/Presentation/ui-components/Dropdown/DropdownOption.tsx +38 -0
- package/src/Presentation/ui-components/Header/Header.scss +72 -0
- package/src/Presentation/ui-components/Header/Header.stories.tsx +117 -0
- package/src/Presentation/ui-components/Header/Header.tsx +51 -0
- package/src/Presentation/ui-components/Loader/Loader.scss +27 -0
- package/src/Presentation/ui-components/Loader/Loader.stories.ts +42 -0
- package/src/Presentation/ui-components/Loader/Loader.tsx +15 -0
- package/src/Presentation/ui-components/Message/Bubble/AttachmentBubble/AttachmentBubble.tsx +71 -0
- package/src/Presentation/ui-components/Message/Bubble/AudioBubble/AudioBubble.scss +84 -0
- package/src/Presentation/ui-components/Message/Bubble/AudioBubble/AudioBubble.tsx +162 -0
- package/src/Presentation/ui-components/Message/Bubble/FileBubble/FileBubble.scss +29 -0
- package/src/Presentation/ui-components/Message/Bubble/FileBubble/FileBubble.tsx +16 -0
- package/src/Presentation/ui-components/Message/Bubble/ImageBubble/ImageBubble.scss +16 -0
- package/src/Presentation/ui-components/Message/Bubble/ImageBubble/ImageBubble.tsx +25 -0
- package/src/Presentation/ui-components/Message/Bubble/TextBubble/TextBubble.scss +40 -0
- package/src/Presentation/ui-components/Message/Bubble/TextBubble/TextBubble.tsx +22 -0
- package/src/Presentation/ui-components/Message/Bubble/VideoBubble/VideoBubble.scss +27 -0
- package/src/Presentation/ui-components/Message/Bubble/VideoBubble/VideoBubble.tsx +34 -0
- package/src/Presentation/ui-components/Message/FileUrl/FileUrl.scss +58 -0
- package/src/Presentation/ui-components/Message/FileUrl/FileUrl.tsx +43 -0
- package/src/Presentation/ui-components/Message/Message.scss +136 -0
- package/src/Presentation/ui-components/Message/Message.stories.tsx +328 -0
- package/src/Presentation/ui-components/Message/Message.tsx +85 -0
- package/src/Presentation/ui-components/Message/MessageCaption/MessageCaption.scss +90 -0
- package/src/Presentation/ui-components/Message/MessageCaption/MessageCaption.tsx +46 -0
- package/src/Presentation/ui-components/Message/TimeAndStatus/TimeAndStatus.scss +51 -0
- package/src/Presentation/ui-components/Message/TimeAndStatus/TimeAndStatus.tsx +32 -0
- package/src/Presentation/ui-components/MessageInput/AttachmentUploader/AttachmentUploader.tsx +38 -0
- package/src/Presentation/ui-components/MessageInput/MessageInput.scss +137 -0
- package/src/Presentation/ui-components/MessageInput/MessageInput.stories.tsx +145 -0
- package/src/Presentation/ui-components/MessageInput/MessageInput.tsx +161 -0
- package/src/Presentation/ui-components/MessageInput/ReplyMessagePreview/ReplyImagePreviewAttachment/ReplyImagePreviewAttachment.scss +16 -0
- package/src/Presentation/ui-components/MessageInput/ReplyMessagePreview/ReplyImagePreviewAttachment/ReplyImagePreviewAttachment.tsx +27 -0
- package/src/Presentation/ui-components/MessageInput/ReplyMessagePreview/ReplyMessagePreview.scss +140 -0
- package/src/Presentation/ui-components/MessageInput/ReplyMessagePreview/ReplyMessagePreview.tsx +101 -0
- package/src/Presentation/ui-components/MessageInput/VoiceRecordingProgress/VoiceRecordingProgress.scss +35 -0
- package/src/Presentation/ui-components/MessageInput/VoiceRecordingProgress/VoiceRecordingProgress.tsx +79 -0
- package/src/Presentation/ui-components/MessageSeparator/MessageSeparator.scss +30 -0
- package/src/Presentation/ui-components/MessageSeparator/MessageSeparator.stories.ts +160 -0
- package/src/Presentation/ui-components/MessageSeparator/MessageSeparator.tsx +34 -0
- package/src/Presentation/ui-components/Placeholder/Placeholder.scss +51 -0
- package/src/Presentation/ui-components/Placeholder/Placeholder.stories.tsx +91 -0
- package/src/Presentation/ui-components/Placeholder/Placeholder.tsx +38 -0
- package/src/Presentation/ui-components/PreviewFileMessage/PreviewFileMessage.scss +30 -0
- package/src/Presentation/ui-components/PreviewFileMessage/PreviewFileMessage.stories.ts +77 -0
- package/src/Presentation/ui-components/PreviewFileMessage/PreviewFileMessage.tsx +38 -0
- package/src/Presentation/ui-components/SettingsItem/SettingsItem.scss +69 -0
- package/src/Presentation/ui-components/SettingsItem/SettingsItem.stories.tsx +184 -0
- package/src/Presentation/ui-components/SettingsItem/SettingsItem.tsx +56 -0
- package/src/Presentation/ui-components/TextField/TextField.scss +91 -0
- package/src/Presentation/ui-components/TextField/TextField.stories.ts +108 -0
- package/src/Presentation/ui-components/TextField/TextField.tsx +88 -0
- package/src/Presentation/ui-components/Toast/Toast.scss +22 -0
- package/src/Presentation/ui-components/Toast/Toast.stories.tsx +50 -0
- package/src/Presentation/ui-components/Toast/ToastProvider.tsx +29 -0
- package/src/Presentation/ui-components/UserListItem/UserListItem.scss +33 -0
- package/src/Presentation/ui-components/UserListItem/UserListItem.stories.tsx +130 -0
- package/src/Presentation/ui-components/UserListItem/UserListItem.tsx +43 -0
- package/src/Presentation/ui-components/index.ts +19 -0
- package/src/QBconfig.ts +151 -0
- package/src/hooks/useModal.ts +13 -0
- package/src/hooks/useQuickBloxUIKit.ts +1103 -0
- package/src/index-ui.ts +183 -0
- package/src/index.scss +28 -0
- package/src/index.tsx +25 -0
- package/src/logo.svg +1 -0
- package/src/package_artan_react_ui.json +91 -0
- package/src/package_original.json +115 -0
- package/src/qb-api-calls/index.ts +670 -0
- package/src/react-app-env.d.ts +1 -0
- package/src/setupTests.ts +5 -0
- package/src/utils/DateTimeFormatter.ts +90 -0
- package/src/utils/formatFileSize.ts +8 -0
- package/src/utils/parse.ts +76 -0
- package/src/utils/utils.ts +102 -0
|
@@ -0,0 +1,1103 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import '../Presentation/Views/Dialog/Dialog.scss';
|
|
3
|
+
import '../Presentation/Views/Dialog/DialogHeader/DialogInfoIcon/DialogInfoIcon.scss';
|
|
4
|
+
import { Tone } from 'qb-ai-rephrase/src/Tone';
|
|
5
|
+
import { toast } from 'react-toastify';
|
|
6
|
+
import useQbInitializedDataContext from '../Presentation/providers/QuickBloxUIKitProvider/useQbInitializedDataContext';
|
|
7
|
+
import { DialogEntity } from '../Domain/entity/DialogEntity';
|
|
8
|
+
import { DialogListViewModel } from '../Presentation/Views/DialogList/DialogListViewModel';
|
|
9
|
+
import useDialogListViewModel from '../Presentation/Views/DialogList/useDialogListViewModel';
|
|
10
|
+
import { Pagination } from '../Domain/repository/Pagination';
|
|
11
|
+
import {
|
|
12
|
+
ForwardMessagesParams,
|
|
13
|
+
ReplyMessagesParams,
|
|
14
|
+
} from '../CommonTypes/BaseViewModel';
|
|
15
|
+
import { AIMessageWidget } from '../Presentation/Views/Dialog/AIWidgets/AIMessageWidget';
|
|
16
|
+
import UseDefaultAIAssistAnswerWidget from '../Presentation/Views/Dialog/AIWidgets/UseDefaultAIAssistAnswerWidget';
|
|
17
|
+
import UseDefaultAITranslateWidget from '../Presentation/Views/Dialog/AIWidgets/UseDefaultAITranslateWidget';
|
|
18
|
+
import UseDefaultAIRephraseMessageWidget from '../Presentation/Views/Dialog/AIWidgets/UseDefaultAIRephraseMessageWidget';
|
|
19
|
+
import { DefaultConfigurations } from '../Data/DefaultConfigurations';
|
|
20
|
+
import UseDefaultAIAssistAnswerWidgetWithProxy from '../Presentation/Views/Dialog/AIWidgets/UseDefaultAIAssistAnswerWidgetWithProxy';
|
|
21
|
+
import UseDefaultAITranslateWidgetWithProxy from '../Presentation/Views/Dialog/AIWidgets/UseDefaultAITranslateWidgetWithProxy';
|
|
22
|
+
import UseDefaultAIRephraseMessageWidgetWithProxy from '../Presentation/Views/Dialog/AIWidgets/UseDefaultAIRephraseMessageWidgetWithProxy';
|
|
23
|
+
import { DialogType } from '../Domain/entity/DialogTypes';
|
|
24
|
+
import { GroupDialogEntity } from '../Domain/entity/GroupDialogEntity';
|
|
25
|
+
import { PrivateDialogEntity } from '../Domain/entity/PrivateDialogEntity';
|
|
26
|
+
import { DialogViewModel } from '../Presentation/Views/Dialog/DialogViewModel';
|
|
27
|
+
import useDialogViewModel from '../Presentation/Views/Dialog/useDialogViewModel';
|
|
28
|
+
import { MessageEntity } from '../Domain/entity/MessageEntity';
|
|
29
|
+
import { stringifyError } from '../utils/parse';
|
|
30
|
+
import { useMobileLayout } from '../Presentation/components/containers/SectionList/hooks';
|
|
31
|
+
import { MessageDTOMapper } from '../Data/source/remote/Mapper/MessageDTOMapper';
|
|
32
|
+
import useUsersListViewModel from '../Presentation/Views/DialogInfo/UsersList/useUsersListViewModel';
|
|
33
|
+
import useModal from './useModal';
|
|
34
|
+
import useQBConnection from '../Presentation/providers/QuickBloxUIKitProvider/useQBConnection';
|
|
35
|
+
import { ProxyConfig, QuickBloxUIKitProps } from '../CommonTypes/CommonTypes';
|
|
36
|
+
import EventMessageType from '../Domain/entity/EventMessageType';
|
|
37
|
+
import { formatFileSize } from '../utils/formatFileSize';
|
|
38
|
+
import UseDefaultAIAssistAnswerWidgetWithSDK from '../Presentation/Views/Dialog/AIWidgets/UseDefaultAIAssistAnswerWidgetWithSDK';
|
|
39
|
+
import UseDefaultAITranslateWidgetWithSDK from '../Presentation/Views/Dialog/AIWidgets/UseDefaultAITranslateWidgetWithSDK';
|
|
40
|
+
import { UsersListViewModel } from '../Presentation/Views/DialogInfo/UsersList/UsersListViewModel';
|
|
41
|
+
|
|
42
|
+
interface QuickBloxUIKitReturn {
|
|
43
|
+
constants: {
|
|
44
|
+
mimeType: string;
|
|
45
|
+
messagePerPage: number;
|
|
46
|
+
maxFileSize?: number;
|
|
47
|
+
maxWidthToResizing: string;
|
|
48
|
+
workHeight: string;
|
|
49
|
+
messagesContainerMobileHeight: string;
|
|
50
|
+
messagesContainerHeight: string;
|
|
51
|
+
clientContainerHeight: string;
|
|
52
|
+
headerHeight: number;
|
|
53
|
+
dialogListScrollableHeight: number;
|
|
54
|
+
};
|
|
55
|
+
data: {
|
|
56
|
+
isOnline: boolean;
|
|
57
|
+
isMobile: boolean;
|
|
58
|
+
width: number;
|
|
59
|
+
height: number;
|
|
60
|
+
breakpoint: number;
|
|
61
|
+
selectedDialog?: DialogEntity;
|
|
62
|
+
dialogAvatarUrl: string;
|
|
63
|
+
showDialogList: boolean;
|
|
64
|
+
showDialogMessages: boolean;
|
|
65
|
+
showDialogInformation: boolean;
|
|
66
|
+
needDialogInformation: boolean;
|
|
67
|
+
isRecording: boolean;
|
|
68
|
+
stream?: MediaStream;
|
|
69
|
+
permission: boolean;
|
|
70
|
+
resultAudioBlob?: Blob;
|
|
71
|
+
audioChunks: Blob[];
|
|
72
|
+
fileToSend?: File | null;
|
|
73
|
+
messageText: string;
|
|
74
|
+
isLeaving: boolean;
|
|
75
|
+
waitAIWidget: boolean;
|
|
76
|
+
maxTokensForAIRephrase: number;
|
|
77
|
+
defaultAIRephraseWidget?: AIMessageWidget;
|
|
78
|
+
defaultAITranslateWidget?: AIMessageWidget;
|
|
79
|
+
defaultAIAssistWidget?: AIMessageWidget;
|
|
80
|
+
rephraseTones: Tone[];
|
|
81
|
+
mimeType: string;
|
|
82
|
+
messagePerPage: number;
|
|
83
|
+
enableForwarding: boolean;
|
|
84
|
+
enableReplying: boolean;
|
|
85
|
+
maxFileSize?: number;
|
|
86
|
+
userName?: string;
|
|
87
|
+
currentUserId?: number;
|
|
88
|
+
sessionToken?: string;
|
|
89
|
+
forwardMessage: MessageEntity | null;
|
|
90
|
+
newModal: ReturnType<typeof useModal>;
|
|
91
|
+
isOpen: boolean;
|
|
92
|
+
warningErrorText: string;
|
|
93
|
+
isAllMembersShow: boolean;
|
|
94
|
+
scrollUpToDown: boolean;
|
|
95
|
+
needRefresh: boolean;
|
|
96
|
+
forwardMessageModal: ReturnType<typeof useModal>;
|
|
97
|
+
showReplyMessage: boolean;
|
|
98
|
+
messagesToReply: MessageEntity[];
|
|
99
|
+
};
|
|
100
|
+
models: {
|
|
101
|
+
dialogsViewModel: DialogListViewModel;
|
|
102
|
+
messagesViewModel: DialogViewModel;
|
|
103
|
+
userViewModel: UsersListViewModel;
|
|
104
|
+
currentContext: ReturnType<typeof useQbInitializedDataContext>;
|
|
105
|
+
};
|
|
106
|
+
handlers: {
|
|
107
|
+
setSelectedDialog: (dialog: DialogEntity | undefined) => void;
|
|
108
|
+
setShowDialogList: (value: boolean) => void;
|
|
109
|
+
setShowDialogMessages: (value: boolean) => void;
|
|
110
|
+
setShowDialogInformation: (value: boolean) => void;
|
|
111
|
+
setNeedDialogInformation: (value: boolean) => void;
|
|
112
|
+
handleLeaveDialog: () => void;
|
|
113
|
+
leaveDialogHandler: (dialog: DialogEntity) => void;
|
|
114
|
+
createDialogHandler: () => void;
|
|
115
|
+
getDialogPhotoFileForPreview: () => Promise<void>;
|
|
116
|
+
getMicrophonePermission: () => Promise<void>;
|
|
117
|
+
startRecording: () => Promise<void>;
|
|
118
|
+
stopRecording: () => void;
|
|
119
|
+
setForwardMessage: (message: MessageEntity | null) => void;
|
|
120
|
+
setWarningErrorText: (text: string) => void;
|
|
121
|
+
setIsAllMembersShow: (value: boolean) => void;
|
|
122
|
+
informationCloseHandler: () => void;
|
|
123
|
+
informationOpenHandler: () => void;
|
|
124
|
+
setIsRecording: (value: boolean) => void;
|
|
125
|
+
fetchMoreData: () => void;
|
|
126
|
+
sendTextMessageActions: (textToSend: string) => void;
|
|
127
|
+
ChangeFileHandler: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
128
|
+
handleOnReply: (message: MessageEntity) => void;
|
|
129
|
+
handleSendData: (
|
|
130
|
+
dialogsForForward: DialogEntity[],
|
|
131
|
+
messagesForForward: MessageEntity[],
|
|
132
|
+
relatedText: string,
|
|
133
|
+
) => void;
|
|
134
|
+
handleHeightChange: (newHeight: number) => void;
|
|
135
|
+
closeReplyMessageFlowHandler: () => void;
|
|
136
|
+
setMessageText: (text: string) => void;
|
|
137
|
+
setWaitAIWidget: (value: boolean) => void;
|
|
138
|
+
handleDialogOnClick: () => void;
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
// part 1 includes end
|
|
142
|
+
export default function useQuickBloxUIKit({
|
|
143
|
+
AIRephrase = undefined,
|
|
144
|
+
AITranslate = undefined,
|
|
145
|
+
AIAssist = undefined,
|
|
146
|
+
uikitHeightOffset = '0px',
|
|
147
|
+
}: QuickBloxUIKitProps): QuickBloxUIKitReturn {
|
|
148
|
+
// 103
|
|
149
|
+
const mimeType = 'audio/webm;codecs=opus'; // audio/ogg audio/mpeg audio/webm audio/x-wav audio/mp4
|
|
150
|
+
const messagePerPage = 47;
|
|
151
|
+
|
|
152
|
+
const currentContext = useQbInitializedDataContext();
|
|
153
|
+
const QBConfig =
|
|
154
|
+
currentContext.InitParams.qbConfig ||
|
|
155
|
+
DefaultConfigurations.getDefaultQBConfig();
|
|
156
|
+
const userName =
|
|
157
|
+
currentContext.storage.REMOTE_DATA_SOURCE.authInformation?.userName;
|
|
158
|
+
const currentUserId =
|
|
159
|
+
currentContext.storage.REMOTE_DATA_SOURCE.authInformation?.userId;
|
|
160
|
+
const sessionToken =
|
|
161
|
+
currentContext.storage.REMOTE_DATA_SOURCE.authInformation?.sessionToken;
|
|
162
|
+
const { enableForwarding } = QBConfig.appConfig;
|
|
163
|
+
const { enableReplying } = QBConfig.appConfig;
|
|
164
|
+
const { maxFileSize } = currentContext.InitParams;
|
|
165
|
+
|
|
166
|
+
const maxTokensForAIRephrase =
|
|
167
|
+
currentContext.InitParams.qbConfig.configAIApi.AIRephraseWidgetConfig
|
|
168
|
+
.maxTokens;
|
|
169
|
+
|
|
170
|
+
const rephraseTones: Tone[] =
|
|
171
|
+
currentContext.InitParams.qbConfig.configAIApi.AIRephraseWidgetConfig.Tones;
|
|
172
|
+
|
|
173
|
+
let defaultAIRephraseWidget = AIRephrase?.AIWidget;
|
|
174
|
+
let defaultAITranslateWidget = AITranslate?.AIWidget;
|
|
175
|
+
let defaultAIAssistWidget = AIAssist?.AIWidget;
|
|
176
|
+
|
|
177
|
+
const getAIAssistAnswer = (): void => {
|
|
178
|
+
if (QBConfig.configAIApi.AIAnswerAssistWidgetConfig.smartChatAssistantId) {
|
|
179
|
+
defaultAIAssistWidget = UseDefaultAIAssistAnswerWidgetWithSDK(
|
|
180
|
+
currentContext.storage.REMOTE_DATA_SOURCE,
|
|
181
|
+
QBConfig.configAIApi.AIAnswerAssistWidgetConfig.smartChatAssistantId,
|
|
182
|
+
);
|
|
183
|
+
} else if (AIAssist?.enabled && !AIAssist?.default) {
|
|
184
|
+
defaultAIAssistWidget = AIAssist.AIWidget;
|
|
185
|
+
} else if (
|
|
186
|
+
AIAssist?.enabled ||
|
|
187
|
+
QBConfig.configAIApi.AIAnswerAssistWidgetConfig.useDefault
|
|
188
|
+
) {
|
|
189
|
+
if (
|
|
190
|
+
!QBConfig.configAIApi.AIAnswerAssistWidgetConfig.useDefault ||
|
|
191
|
+
(AIAssist && !AIAssist?.default)
|
|
192
|
+
) {
|
|
193
|
+
defaultAIAssistWidget = undefined;
|
|
194
|
+
} else {
|
|
195
|
+
const { apiKey } = QBConfig.configAIApi.AIAnswerAssistWidgetConfig;
|
|
196
|
+
let token = '';
|
|
197
|
+
const proxyConfig: ProxyConfig =
|
|
198
|
+
QBConfig.configAIApi.AIAnswerAssistWidgetConfig.proxyConfig ||
|
|
199
|
+
DefaultConfigurations.getDefaultProxyConfig();
|
|
200
|
+
|
|
201
|
+
if (apiKey) {
|
|
202
|
+
token = apiKey;
|
|
203
|
+
defaultAIAssistWidget = UseDefaultAIAssistAnswerWidget({
|
|
204
|
+
...proxyConfig,
|
|
205
|
+
apiKeyOrSessionToken: token,
|
|
206
|
+
});
|
|
207
|
+
} else {
|
|
208
|
+
token = sessionToken || '';
|
|
209
|
+
defaultAIAssistWidget = UseDefaultAIAssistAnswerWidgetWithProxy({
|
|
210
|
+
...proxyConfig,
|
|
211
|
+
apiKeyOrSessionToken: token,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
const getAITranslate = (): void => {
|
|
218
|
+
if (QBConfig.configAIApi.AITranslateWidgetConfig.smartChatAssistantId) {
|
|
219
|
+
defaultAITranslateWidget = UseDefaultAITranslateWidgetWithSDK(
|
|
220
|
+
currentContext.storage.REMOTE_DATA_SOURCE,
|
|
221
|
+
QBConfig.configAIApi.AITranslateWidgetConfig.smartChatAssistantId,
|
|
222
|
+
);
|
|
223
|
+
} else if (AITranslate?.enabled && !AITranslate?.default) {
|
|
224
|
+
defaultAITranslateWidget = AITranslate.AIWidget;
|
|
225
|
+
} else if (
|
|
226
|
+
AITranslate?.enabled ||
|
|
227
|
+
QBConfig.configAIApi.AITranslateWidgetConfig.useDefault
|
|
228
|
+
) {
|
|
229
|
+
if (
|
|
230
|
+
!QBConfig.configAIApi.AITranslateWidgetConfig.useDefault ||
|
|
231
|
+
(AITranslate && !AITranslate?.default)
|
|
232
|
+
) {
|
|
233
|
+
defaultAITranslateWidget = undefined;
|
|
234
|
+
} else {
|
|
235
|
+
const { apiKey } = QBConfig.configAIApi.AITranslateWidgetConfig;
|
|
236
|
+
let token = '';
|
|
237
|
+
const proxyConfig: ProxyConfig =
|
|
238
|
+
QBConfig.configAIApi.AITranslateWidgetConfig.proxyConfig ||
|
|
239
|
+
DefaultConfigurations.getDefaultProxyConfig();
|
|
240
|
+
|
|
241
|
+
if (apiKey) {
|
|
242
|
+
token = apiKey;
|
|
243
|
+
defaultAITranslateWidget = UseDefaultAITranslateWidget({
|
|
244
|
+
...proxyConfig,
|
|
245
|
+
apiKeyOrSessionToken: token,
|
|
246
|
+
});
|
|
247
|
+
} else {
|
|
248
|
+
token = sessionToken || '';
|
|
249
|
+
defaultAITranslateWidget = UseDefaultAITranslateWidgetWithProxy({
|
|
250
|
+
...proxyConfig,
|
|
251
|
+
apiKeyOrSessionToken: token,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
const getAIRephrase = (): void => {
|
|
258
|
+
if (AIRephrase?.enabled && !AIRephrase?.default) {
|
|
259
|
+
defaultAIRephraseWidget = AIRephrase.AIWidget;
|
|
260
|
+
} else if (
|
|
261
|
+
AIRephrase?.enabled ||
|
|
262
|
+
QBConfig.configAIApi.AIRephraseWidgetConfig.useDefault
|
|
263
|
+
) {
|
|
264
|
+
if (
|
|
265
|
+
!QBConfig.configAIApi.AIRephraseWidgetConfig.useDefault ||
|
|
266
|
+
(AIRephrase && !AIRephrase?.default)
|
|
267
|
+
) {
|
|
268
|
+
defaultAIRephraseWidget = undefined;
|
|
269
|
+
} else {
|
|
270
|
+
const { apiKey } = QBConfig.configAIApi.AIRephraseWidgetConfig;
|
|
271
|
+
let token = '';
|
|
272
|
+
const proxyConfig: ProxyConfig =
|
|
273
|
+
QBConfig.configAIApi.AIRephraseWidgetConfig.proxyConfig ||
|
|
274
|
+
DefaultConfigurations.getDefaultProxyConfig();
|
|
275
|
+
|
|
276
|
+
if (apiKey) {
|
|
277
|
+
token = apiKey;
|
|
278
|
+
defaultAIRephraseWidget = UseDefaultAIRephraseMessageWidget({
|
|
279
|
+
...proxyConfig,
|
|
280
|
+
apiKeyOrSessionToken: token,
|
|
281
|
+
});
|
|
282
|
+
} else {
|
|
283
|
+
token = sessionToken || '';
|
|
284
|
+
defaultAIRephraseWidget = UseDefaultAIRephraseMessageWidgetWithProxy({
|
|
285
|
+
...proxyConfig,
|
|
286
|
+
apiKeyOrSessionToken: token,
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
getAITranslate();
|
|
294
|
+
getAIRephrase();
|
|
295
|
+
getAIAssistAnswer();
|
|
296
|
+
|
|
297
|
+
const dialogsViewModel: DialogListViewModel =
|
|
298
|
+
useDialogListViewModel(currentContext);
|
|
299
|
+
|
|
300
|
+
const messagesViewModel: DialogViewModel = useDialogViewModel(
|
|
301
|
+
dialogsViewModel.entity?.type,
|
|
302
|
+
dialogsViewModel.entity,
|
|
303
|
+
);
|
|
304
|
+
|
|
305
|
+
const [forwardMessage, setForwardMessage] = useState<MessageEntity | null>(
|
|
306
|
+
null,
|
|
307
|
+
);
|
|
308
|
+
const forwardMessageModal = useModal();
|
|
309
|
+
const [selectedDialog, setSelectedDialog] = React.useState<DialogEntity>();
|
|
310
|
+
const userViewModel = useUsersListViewModel(selectedDialog);
|
|
311
|
+
const [dialogAvatarUrl, setDialogAvatarUrl] = React.useState('');
|
|
312
|
+
|
|
313
|
+
const { browserOnline, connectionStatus, connectionRepository } =
|
|
314
|
+
useQBConnection();
|
|
315
|
+
|
|
316
|
+
const [isOnline, setIsOnline] = useState<boolean>(
|
|
317
|
+
browserOnline && connectionStatus,
|
|
318
|
+
);
|
|
319
|
+
|
|
320
|
+
connectionRepository.subscribe(
|
|
321
|
+
(status) => {
|
|
322
|
+
console.log(
|
|
323
|
+
`Connection status: ${status ? 'CONNECTED' : 'DISCONNECTED'}`,
|
|
324
|
+
);
|
|
325
|
+
if (status) setIsOnline(true);
|
|
326
|
+
else setIsOnline(false);
|
|
327
|
+
},
|
|
328
|
+
EventMessageType.LocalMessage,
|
|
329
|
+
'DESKTOP_LAYOUT',
|
|
330
|
+
);
|
|
331
|
+
|
|
332
|
+
const [needRefresh, setNeedRefresh] = useState(false);
|
|
333
|
+
const toastConnectionErrorId = React.useRef(null);
|
|
334
|
+
|
|
335
|
+
//
|
|
336
|
+
const [waitAIWidget, setWaitAIWidget] = useState<boolean>(false);
|
|
337
|
+
const [messageText, setMessageText] = useState<string>('');
|
|
338
|
+
|
|
339
|
+
const [showReplyMessage, setShowReplyMessage] = useState(false);
|
|
340
|
+
const [messagesToReply, setMessagesToReply] = useState<MessageEntity[]>([]);
|
|
341
|
+
const [isMobile, width, height, breakpoint] = useMobileLayout();
|
|
342
|
+
const [clientHeight, setClientHeight] = useState<number>(0);
|
|
343
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
344
|
+
const [scrollUpToDown, setScrollUpToDown] = React.useState(false);
|
|
345
|
+
const [needDialogInformation, setNeedDialogInformation] = useState(false);
|
|
346
|
+
const informationCloseHandler = (): void => {
|
|
347
|
+
setNeedDialogInformation(false);
|
|
348
|
+
};
|
|
349
|
+
const informationOpenHandler = (): void => {
|
|
350
|
+
setNeedDialogInformation(true);
|
|
351
|
+
};
|
|
352
|
+
//
|
|
353
|
+
const maxWidthToResizing =
|
|
354
|
+
selectedDialog && needDialogInformation
|
|
355
|
+
? '$message-view-container-wrapper-min-width'
|
|
356
|
+
: '1040px';
|
|
357
|
+
const workHeight = isMobile
|
|
358
|
+
? `calc(${height.toString()}px - ${uikitHeightOffset} - 28px)`
|
|
359
|
+
: `calc(100vh - ${uikitHeightOffset} - 28px)`;
|
|
360
|
+
const messagesContainerMobileHeight = showReplyMessage
|
|
361
|
+
? `calc(${clientHeight}px - 128px - 64px - 16px)`
|
|
362
|
+
: `calc(${clientHeight}px - 128px - 16px)`;
|
|
363
|
+
const messagesContainerHeight = showReplyMessage
|
|
364
|
+
? `calc(${clientHeight}px - 128px - 64px)`
|
|
365
|
+
: `calc(${clientHeight}px - 128px - 1px)`;
|
|
366
|
+
const clientContainerHeight = `${clientHeight - 5}px`;
|
|
367
|
+
const headerHeight = 64;
|
|
368
|
+
const dialogListScrollableHeight = clientHeight - headerHeight - 6;
|
|
369
|
+
|
|
370
|
+
const [warningErrorText, setWarningErrorText] = useState<string>('');
|
|
371
|
+
const [useAudioWidget, setUseAudioWidget] = useState<boolean>(false);
|
|
372
|
+
const [fileToSend, setFileToSend] = useState<File | null>(null);
|
|
373
|
+
const [isRecording, setIsRecording] = useState(false);
|
|
374
|
+
const [permission, setPermission] = useState(false);
|
|
375
|
+
const [stream, setStream] = useState<MediaStream>();
|
|
376
|
+
const mediaRecorder = useRef<MediaRecorder>();
|
|
377
|
+
const [resultAudioBlob, setResultAudioBlob] = useState<Blob>();
|
|
378
|
+
const [audioChunks, setAudioChunks] = useState<Array<Blob>>([]);
|
|
379
|
+
const newModal = useModal();
|
|
380
|
+
const [dialogToLeave, setDialogToLeave] = useState<DialogEntity>();
|
|
381
|
+
const [showDialogList, setShowDialogList] = useState<boolean>(true);
|
|
382
|
+
const [showDialogMessages, setShowDialogMessages] = useState<boolean>(true);
|
|
383
|
+
const [showDialogInformation, setShowDialogInformation] =
|
|
384
|
+
useState<boolean>(false);
|
|
385
|
+
const [isAllMembersShow, setIsAllMembersShow] = React.useState(false);
|
|
386
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
387
|
+
|
|
388
|
+
const isAuthProcessed = (): boolean => {
|
|
389
|
+
console.log('call isAuthProcessed');
|
|
390
|
+
const result =
|
|
391
|
+
currentContext.storage.REMOTE_DATA_SOURCE.needInit === false &&
|
|
392
|
+
currentContext.storage.REMOTE_DATA_SOURCE.authProcessed &&
|
|
393
|
+
currentContext.storage.CONNECTION_REPOSITORY.needInit === false;
|
|
394
|
+
|
|
395
|
+
console.log(
|
|
396
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
397
|
+
`initialValue.REMOTE_DATA_SOURCE_MOCK.needInit: ${currentContext.storage.REMOTE_DATA_SOURCE.needInit}`,
|
|
398
|
+
);
|
|
399
|
+
console.log(
|
|
400
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
401
|
+
`initialValue.REMOTE_DATA_SOURCE_MOCK.authProcessed: ${currentContext.storage.REMOTE_DATA_SOURCE.authProcessed}`,
|
|
402
|
+
);
|
|
403
|
+
|
|
404
|
+
console.log(
|
|
405
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
406
|
+
`initialValue.CONNECTION_REPOSITORY.needInit: ${currentContext.storage.CONNECTION_REPOSITORY.needInit}`,
|
|
407
|
+
);
|
|
408
|
+
|
|
409
|
+
return result;
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
const fetchMoreData = () => {
|
|
413
|
+
if (messagesViewModel.pagination.hasNextPage()) {
|
|
414
|
+
const newPagination = messagesViewModel.pagination;
|
|
415
|
+
|
|
416
|
+
newPagination.perPage = messagePerPage;
|
|
417
|
+
newPagination.nextPage();
|
|
418
|
+
|
|
419
|
+
messagesViewModel.getMessages(newPagination);
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
const getUserAvatarByUid = async () => {
|
|
424
|
+
let result = '';
|
|
425
|
+
const participants: Array<number> =
|
|
426
|
+
dialogsViewModel?.entity &&
|
|
427
|
+
dialogsViewModel?.entity.type === DialogType.private
|
|
428
|
+
? [
|
|
429
|
+
(dialogsViewModel?.entity as unknown as PrivateDialogEntity)
|
|
430
|
+
.participantId,
|
|
431
|
+
]
|
|
432
|
+
: [];
|
|
433
|
+
|
|
434
|
+
if (participants.length > 0) {
|
|
435
|
+
const senderUser = await userViewModel.getUserById(participants[0]);
|
|
436
|
+
|
|
437
|
+
result = senderUser?.photo || '';
|
|
438
|
+
} else {
|
|
439
|
+
result = '';
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
return result;
|
|
443
|
+
};
|
|
444
|
+
|
|
445
|
+
async function getDialogPhotoFileForPreview() {
|
|
446
|
+
const tmpFileUrl: string = await getUserAvatarByUid();
|
|
447
|
+
|
|
448
|
+
if (tmpFileUrl && tmpFileUrl.length > 0) {
|
|
449
|
+
setDialogAvatarUrl(tmpFileUrl);
|
|
450
|
+
} else {
|
|
451
|
+
setDialogAvatarUrl('');
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
const showErrorMessage = (errorMessage: string) => {
|
|
456
|
+
setWarningErrorText(errorMessage);
|
|
457
|
+
setTimeout(() => {
|
|
458
|
+
setWarningErrorText('');
|
|
459
|
+
}, 3000);
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
const closeReplyMessageFlowHandler = () => {
|
|
463
|
+
setMessagesToReply([]);
|
|
464
|
+
setShowReplyMessage(false);
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
const repliedActions = (replyData: ReplyMessagesParams): void => {
|
|
468
|
+
// eslint-disable-next-line promise/catch-or-return
|
|
469
|
+
messagesViewModel
|
|
470
|
+
.sendReplyMessages(replyData)
|
|
471
|
+
.then((opResult: boolean) => {
|
|
472
|
+
// eslint-disable-next-line promise/always-return
|
|
473
|
+
if (opResult) {
|
|
474
|
+
toast('Message have been replied');
|
|
475
|
+
} else {
|
|
476
|
+
toast('Message have not been replied');
|
|
477
|
+
}
|
|
478
|
+
})
|
|
479
|
+
.catch((reason) => {
|
|
480
|
+
const errorMessage = stringifyError(reason);
|
|
481
|
+
|
|
482
|
+
toast(errorMessage);
|
|
483
|
+
})
|
|
484
|
+
.finally(() => {
|
|
485
|
+
setMessageText('');
|
|
486
|
+
closeReplyMessageFlowHandler();
|
|
487
|
+
});
|
|
488
|
+
};
|
|
489
|
+
|
|
490
|
+
const getMicrophonePermission = async () => {
|
|
491
|
+
if (window) {
|
|
492
|
+
try {
|
|
493
|
+
const mediaStream = await navigator.mediaDevices.getUserMedia({
|
|
494
|
+
audio: true,
|
|
495
|
+
video: false,
|
|
496
|
+
});
|
|
497
|
+
|
|
498
|
+
setPermission(true);
|
|
499
|
+
setStream(mediaStream);
|
|
500
|
+
} catch (err) {
|
|
501
|
+
showErrorMessage(
|
|
502
|
+
`The MediaRecorder API throws exception ${stringifyError(err)} .`,
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
} else {
|
|
506
|
+
showErrorMessage(
|
|
507
|
+
'The MediaRecorder API is not supported in your browser.',
|
|
508
|
+
);
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/require-await
|
|
513
|
+
const startRecording = async () => {
|
|
514
|
+
if (!stream) return;
|
|
515
|
+
const mimeTypes = [
|
|
516
|
+
'audio/aac',
|
|
517
|
+
'audio/mp4',
|
|
518
|
+
'audio/mpeg',
|
|
519
|
+
'audio/ogg',
|
|
520
|
+
'audio/wav',
|
|
521
|
+
'audio/webm',
|
|
522
|
+
'audio/3gpp',
|
|
523
|
+
'audio/flac',
|
|
524
|
+
'audio/x-aiff',
|
|
525
|
+
'audio/x-m4a',
|
|
526
|
+
];
|
|
527
|
+
|
|
528
|
+
console.log('MIME TYPES: ');
|
|
529
|
+
mimeTypes.forEach((mType) => {
|
|
530
|
+
if (MediaRecorder.isTypeSupported(mimeType)) {
|
|
531
|
+
console.log(`${mType} is supported`);
|
|
532
|
+
} else {
|
|
533
|
+
console.log(`${mType} is not supported`);
|
|
534
|
+
}
|
|
535
|
+
});
|
|
536
|
+
// audio/mp4;codecs=mp4a audio/webm;codecs=opus audio/webm;codecs=vp9,opus
|
|
537
|
+
const mimeContent = window.MediaRecorder.isTypeSupported('audio/mp4')
|
|
538
|
+
? 'audio/mp4;codecs=mp4a'
|
|
539
|
+
: 'audio/webm;codecs=opus';
|
|
540
|
+
|
|
541
|
+
const media = new MediaRecorder(stream, { mimeType: mimeContent });
|
|
542
|
+
|
|
543
|
+
mediaRecorder.current = media;
|
|
544
|
+
mediaRecorder.current.start();
|
|
545
|
+
|
|
546
|
+
const localAudioChunks: any[] = [];
|
|
547
|
+
|
|
548
|
+
mediaRecorder.current.ondataavailable = (event) => {
|
|
549
|
+
if (typeof event.data === 'undefined') return;
|
|
550
|
+
if (event.data.size === 0) return;
|
|
551
|
+
localAudioChunks.push(event.data);
|
|
552
|
+
};
|
|
553
|
+
|
|
554
|
+
setAudioChunks(localAudioChunks);
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
558
|
+
const stopRecording = () => {
|
|
559
|
+
if (!mediaRecorder.current) return;
|
|
560
|
+
mediaRecorder.current.stop();
|
|
561
|
+
|
|
562
|
+
mediaRecorder.current.onstop = () => {
|
|
563
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
564
|
+
const mimeContent = window.MediaRecorder.isTypeSupported(
|
|
565
|
+
'audio/mp4;codecs=mp4a',
|
|
566
|
+
)
|
|
567
|
+
? 'audio/mp4;codecs=mp4a'
|
|
568
|
+
: 'audio/webm;codecs=opus';
|
|
569
|
+
// const audioBlob = new Blob(audioChunks, { type: mimeContent }); // mimeType
|
|
570
|
+
// const mp4Blob = new Blob(recordedChunks, { type: 'video/mp4' });
|
|
571
|
+
|
|
572
|
+
// const audioBlob = new Blob(audioChunks, { type: 'video/mp4' }); // mimeType
|
|
573
|
+
// const audioBlob = new Blob(audioChunks, { type: 'audio/mp4' }); // mimeType
|
|
574
|
+
const audioBlob = new Blob(audioChunks, { type: 'audio/mp4' });
|
|
575
|
+
|
|
576
|
+
setResultAudioBlob(audioBlob);
|
|
577
|
+
|
|
578
|
+
setAudioChunks([]);
|
|
579
|
+
//
|
|
580
|
+
stream?.getAudioTracks().forEach((track) => {
|
|
581
|
+
track.stop();
|
|
582
|
+
});
|
|
583
|
+
setPermission(false);
|
|
584
|
+
//
|
|
585
|
+
};
|
|
586
|
+
};
|
|
587
|
+
|
|
588
|
+
const blobToFile = (theBlob: Blob, fileName: string): File => {
|
|
589
|
+
const b: any = theBlob;
|
|
590
|
+
|
|
591
|
+
// A Blob() is almost a File() - it's just missing the two properties below which we will add
|
|
592
|
+
b.lastModifiedDate = new Date();
|
|
593
|
+
b.name = fileName;
|
|
594
|
+
|
|
595
|
+
// Cast to a File() type
|
|
596
|
+
const resultFile = theBlob as unknown as File;
|
|
597
|
+
|
|
598
|
+
return resultFile;
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
function sendTextMessageActions(textToSend: string) {
|
|
602
|
+
if (isOnline) {
|
|
603
|
+
// closeReplyMessageFlowHandler
|
|
604
|
+
if (messagesViewModel?.loading) return;
|
|
605
|
+
// setVoiceMessage(true);
|
|
606
|
+
if (textToSend.length > 0 && textToSend.length <= 1000) {
|
|
607
|
+
setMessageText('');
|
|
608
|
+
if (showReplyMessage && messagesToReply?.length > 0) {
|
|
609
|
+
const replyData: ReplyMessagesParams = {
|
|
610
|
+
messagesToReply,
|
|
611
|
+
relatedTextMessage: textToSend,
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
repliedActions(replyData);
|
|
615
|
+
} else {
|
|
616
|
+
messagesViewModel.sendTextMessage(textToSend);
|
|
617
|
+
setMessageText('');
|
|
618
|
+
}
|
|
619
|
+
setMessageText('');
|
|
620
|
+
} else {
|
|
621
|
+
setWarningErrorText(
|
|
622
|
+
'length of text message must be less then 1000 chars.',
|
|
623
|
+
);
|
|
624
|
+
setTimeout(() => {
|
|
625
|
+
setWarningErrorText('');
|
|
626
|
+
}, 3000);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
const ChangeFileHandler = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
632
|
+
if (isOnline) {
|
|
633
|
+
const reader = new FileReader();
|
|
634
|
+
const file = event.currentTarget.files
|
|
635
|
+
? event.currentTarget.files[0]
|
|
636
|
+
: null;
|
|
637
|
+
|
|
638
|
+
reader.onloadend = () => {
|
|
639
|
+
setFileToSend(file);
|
|
640
|
+
};
|
|
641
|
+
|
|
642
|
+
if (file !== null) reader.readAsDataURL(file);
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
|
|
646
|
+
const handleOnReply = (message: MessageEntity): void => {
|
|
647
|
+
setMessagesToReply([message]);
|
|
648
|
+
setShowReplyMessage(true);
|
|
649
|
+
};
|
|
650
|
+
|
|
651
|
+
const handleSendData = (
|
|
652
|
+
dialogsForForward: DialogEntity[],
|
|
653
|
+
messagesForForward: MessageEntity[],
|
|
654
|
+
relatedText: string,
|
|
655
|
+
) => {
|
|
656
|
+
const forwardingData: ForwardMessagesParams = {
|
|
657
|
+
messagesToForward: messagesForForward,
|
|
658
|
+
targetDialogs: dialogsForForward,
|
|
659
|
+
relatedTextMessage:
|
|
660
|
+
relatedText || MessageDTOMapper.FORWARD_MESSAGE_PREFIX,
|
|
661
|
+
};
|
|
662
|
+
|
|
663
|
+
messagesViewModel
|
|
664
|
+
.sendForwardedMessages(forwardingData)
|
|
665
|
+
.then((opResult: boolean) => {
|
|
666
|
+
if (opResult) {
|
|
667
|
+
toast('Message have been forwarded');
|
|
668
|
+
} else {
|
|
669
|
+
toast('Message have not been forwarded');
|
|
670
|
+
}
|
|
671
|
+
forwardMessageModal.toggleModal();
|
|
672
|
+
|
|
673
|
+
return null;
|
|
674
|
+
})
|
|
675
|
+
.catch((reason) => {
|
|
676
|
+
const errorMessage = stringifyError(reason);
|
|
677
|
+
|
|
678
|
+
forwardMessageModal.toggleModal();
|
|
679
|
+
showErrorMessage(errorMessage);
|
|
680
|
+
});
|
|
681
|
+
};
|
|
682
|
+
|
|
683
|
+
const handleHeightChange = (newHeight: number) => {
|
|
684
|
+
console.log('The new height is:', newHeight);
|
|
685
|
+
setClientHeight(newHeight);
|
|
686
|
+
};
|
|
687
|
+
|
|
688
|
+
const leaveDialogHandler = (dialog: DialogEntity) => {
|
|
689
|
+
if (isOnline) {
|
|
690
|
+
setDialogToLeave(dialog);
|
|
691
|
+
}
|
|
692
|
+
};
|
|
693
|
+
|
|
694
|
+
const handleDialogOnClick = () => {
|
|
695
|
+
if (isOpen) {
|
|
696
|
+
setDialogToLeave(undefined);
|
|
697
|
+
}
|
|
698
|
+
setIsOpen((state) => !state);
|
|
699
|
+
};
|
|
700
|
+
|
|
701
|
+
const [isLeaving, setIsLeaving] = useState(false);
|
|
702
|
+
const toastLeavingId = React.useRef(null);
|
|
703
|
+
const handleLeaveDialog = () => {
|
|
704
|
+
if (dialogToLeave) {
|
|
705
|
+
setIsLeaving(true);
|
|
706
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
707
|
+
// @ts-ignore
|
|
708
|
+
toastLeavingId.current = toast('leaving dialog', {
|
|
709
|
+
autoClose: false,
|
|
710
|
+
isLoading: true,
|
|
711
|
+
});
|
|
712
|
+
// eslint-disable-next-line promise/catch-or-return
|
|
713
|
+
dialogsViewModel
|
|
714
|
+
.deleteDialog(dialogToLeave as GroupDialogEntity)
|
|
715
|
+
.then((result) => {
|
|
716
|
+
// eslint-disable-next-line promise/always-return
|
|
717
|
+
if (!result) {
|
|
718
|
+
toast('Dialog have not been left');
|
|
719
|
+
}
|
|
720
|
+
handleDialogOnClick();
|
|
721
|
+
})
|
|
722
|
+
.catch((e) => {
|
|
723
|
+
console.log(e);
|
|
724
|
+
toast("Can't leave dialog");
|
|
725
|
+
})
|
|
726
|
+
.finally(() => {
|
|
727
|
+
setIsLeaving(false);
|
|
728
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
729
|
+
// @ts-ignore
|
|
730
|
+
toast.dismiss(toastLeavingId.current);
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
};
|
|
734
|
+
|
|
735
|
+
const createDialogHandler = () => {
|
|
736
|
+
if (isOnline) {
|
|
737
|
+
newModal.toggleModal();
|
|
738
|
+
}
|
|
739
|
+
};
|
|
740
|
+
|
|
741
|
+
useEffect(() => {
|
|
742
|
+
const codeVersion = '0.4.2';
|
|
743
|
+
|
|
744
|
+
console.log(`React UIKit CODE VERSION IS ${codeVersion}`);
|
|
745
|
+
if (isAuthProcessed()) {
|
|
746
|
+
const pagination: Pagination = new Pagination();
|
|
747
|
+
|
|
748
|
+
dialogsViewModel?.getDialogs(pagination);
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
return () => {
|
|
752
|
+
dialogsViewModel.release();
|
|
753
|
+
};
|
|
754
|
+
}, []);
|
|
755
|
+
useEffect(() => {
|
|
756
|
+
if (isAuthProcessed()) {
|
|
757
|
+
const pagination: Pagination = new Pagination();
|
|
758
|
+
|
|
759
|
+
dialogsViewModel?.getDialogs(pagination);
|
|
760
|
+
}
|
|
761
|
+
}, [currentContext.InitParams]);
|
|
762
|
+
useEffect(() => {
|
|
763
|
+
if (isMobile) {
|
|
764
|
+
if (!selectedDialog) {
|
|
765
|
+
setShowDialogList(true);
|
|
766
|
+
} else {
|
|
767
|
+
setShowDialogList(false);
|
|
768
|
+
}
|
|
769
|
+
const canShowMessages =
|
|
770
|
+
selectedDialog && !(showDialogInformation && needDialogInformation);
|
|
771
|
+
|
|
772
|
+
if (canShowMessages) {
|
|
773
|
+
setShowDialogMessages(true);
|
|
774
|
+
} else {
|
|
775
|
+
setShowDialogMessages(false);
|
|
776
|
+
}
|
|
777
|
+
if (selectedDialog && showDialogInformation)
|
|
778
|
+
setShowDialogInformation(true);
|
|
779
|
+
else setShowDialogInformation(false);
|
|
780
|
+
} else {
|
|
781
|
+
setShowDialogList(true);
|
|
782
|
+
setShowDialogMessages(true);
|
|
783
|
+
setShowDialogInformation(true);
|
|
784
|
+
}
|
|
785
|
+
}, [isMobile]);
|
|
786
|
+
|
|
787
|
+
useEffect(() => {
|
|
788
|
+
if (browserOnline) {
|
|
789
|
+
setIsOnline(true);
|
|
790
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/ban-ts-comment
|
|
791
|
+
// @ts-ignore
|
|
792
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
793
|
+
toast.dismiss(toastConnectionErrorId.current);
|
|
794
|
+
} else {
|
|
795
|
+
setIsOnline(false);
|
|
796
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/ban-ts-comment
|
|
797
|
+
// @ts-ignore
|
|
798
|
+
toastConnectionErrorId.current = toast('Connection ...', {
|
|
799
|
+
autoClose: false,
|
|
800
|
+
isLoading: true,
|
|
801
|
+
});
|
|
802
|
+
}
|
|
803
|
+
}, [browserOnline && connectionStatus]);
|
|
804
|
+
useEffect(() => {
|
|
805
|
+
if (!isOnline) {
|
|
806
|
+
setNeedRefresh(true);
|
|
807
|
+
}
|
|
808
|
+
}, [isOnline]);
|
|
809
|
+
useEffect(() => {
|
|
810
|
+
if (isOnline && needRefresh) {
|
|
811
|
+
if (messagesViewModel.entity) {
|
|
812
|
+
messagesViewModel.getMessages(new Pagination(0, messagePerPage));
|
|
813
|
+
|
|
814
|
+
setNeedRefresh(false);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}, [isOnline]);
|
|
818
|
+
useEffect(() => {
|
|
819
|
+
if (dialogsViewModel.entity) {
|
|
820
|
+
getDialogPhotoFileForPreview().catch();
|
|
821
|
+
userViewModel.entity = dialogsViewModel.entity;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
return () => {
|
|
825
|
+
if (dialogAvatarUrl) {
|
|
826
|
+
URL.revokeObjectURL(dialogAvatarUrl);
|
|
827
|
+
}
|
|
828
|
+
};
|
|
829
|
+
}, [dialogsViewModel.entity]);
|
|
830
|
+
useEffect(() => {
|
|
831
|
+
console.log(
|
|
832
|
+
`Clear selected dialog: ${
|
|
833
|
+
selectedDialog?.name || 'Dialog Name is empty'
|
|
834
|
+
}`,
|
|
835
|
+
);
|
|
836
|
+
if (!dialogsViewModel.entity) {
|
|
837
|
+
setSelectedDialog(undefined);
|
|
838
|
+
}
|
|
839
|
+
}, [dialogsViewModel.entity]);
|
|
840
|
+
useEffect(() => {
|
|
841
|
+
messagesViewModel.entity = dialogsViewModel.entity;
|
|
842
|
+
// setMessagesToView([]);
|
|
843
|
+
setMessageText('');
|
|
844
|
+
}, [dialogsViewModel.entity]);
|
|
845
|
+
useEffect(() => {
|
|
846
|
+
if (userViewModel.entity) {
|
|
847
|
+
userViewModel.getUsers();
|
|
848
|
+
}
|
|
849
|
+
}, [userViewModel.entity]);
|
|
850
|
+
useEffect(() => {
|
|
851
|
+
if (selectedDialog && selectedDialog) {
|
|
852
|
+
dialogsViewModel.entity = selectedDialog;
|
|
853
|
+
userViewModel.entity = selectedDialog;
|
|
854
|
+
|
|
855
|
+
if (isMobile) {
|
|
856
|
+
setShowDialogList(false);
|
|
857
|
+
setShowDialogMessages(true);
|
|
858
|
+
}
|
|
859
|
+
} else {
|
|
860
|
+
setShowDialogList(true);
|
|
861
|
+
}
|
|
862
|
+
}, [selectedDialog]);
|
|
863
|
+
useEffect(() => {
|
|
864
|
+
if (messagesViewModel.entity) {
|
|
865
|
+
messagesViewModel.getMessages(new Pagination(0, messagePerPage));
|
|
866
|
+
}
|
|
867
|
+
}, [messagesViewModel.entity]);
|
|
868
|
+
useEffect(() => {
|
|
869
|
+
if (!isMobile && messagesViewModel.entity) {
|
|
870
|
+
dialogsViewModel.setWaitLoadingStatus(messagesViewModel?.loading);
|
|
871
|
+
const timeoutId = setTimeout(() => {
|
|
872
|
+
dialogsViewModel.setWaitLoadingStatus(false); // wait only for 3 sec
|
|
873
|
+
}, 3000);
|
|
874
|
+
|
|
875
|
+
return () => clearTimeout(timeoutId);
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
return () => {
|
|
879
|
+
// Placeholder: Cleanup handler is not required
|
|
880
|
+
};
|
|
881
|
+
}, [messagesViewModel?.loading]);
|
|
882
|
+
useEffect(() => {
|
|
883
|
+
const MAXSIZE = maxFileSize || 90 * 1000000;
|
|
884
|
+
const MAXSIZE_FOR_MESSAGE = MAXSIZE / (1024 * 1024);
|
|
885
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
886
|
+
const flag = fileToSend?.size && fileToSend?.size < MAXSIZE;
|
|
887
|
+
|
|
888
|
+
if (fileToSend?.size && fileToSend?.size < MAXSIZE) {
|
|
889
|
+
if (showReplyMessage && messagesToReply?.length > 0) {
|
|
890
|
+
const replyData: ReplyMessagesParams = {
|
|
891
|
+
messagesToReply,
|
|
892
|
+
relatedFileMessage: fileToSend,
|
|
893
|
+
relatedTextMessage:
|
|
894
|
+
messageText || MessageDTOMapper.REPLY_MESSAGE_PREFIX,
|
|
895
|
+
};
|
|
896
|
+
|
|
897
|
+
repliedActions(replyData);
|
|
898
|
+
} else if (isOnline) {
|
|
899
|
+
// eslint-disable-next-line promise/catch-or-return
|
|
900
|
+
messagesViewModel
|
|
901
|
+
.sendAttachmentMessage(fileToSend)
|
|
902
|
+
.then((resultOperation) => {
|
|
903
|
+
// eslint-disable-next-line promise/always-return
|
|
904
|
+
if (!resultOperation) {
|
|
905
|
+
toast(`Incorrect data`);
|
|
906
|
+
}
|
|
907
|
+
})
|
|
908
|
+
.finally(() => {
|
|
909
|
+
setFileToSend(null);
|
|
910
|
+
});
|
|
911
|
+
}
|
|
912
|
+
} else if (fileToSend) {
|
|
913
|
+
toast(
|
|
914
|
+
`file size ${formatFileSize(
|
|
915
|
+
fileToSend?.size,
|
|
916
|
+
)} must be less then ${MAXSIZE_FOR_MESSAGE} mb.`,
|
|
917
|
+
);
|
|
918
|
+
setFileToSend(null);
|
|
919
|
+
}
|
|
920
|
+
}, [fileToSend]);
|
|
921
|
+
useEffect(() => {
|
|
922
|
+
const fileExt = 'mp4';
|
|
923
|
+
|
|
924
|
+
if (resultAudioBlob) {
|
|
925
|
+
const voiceMessage = blobToFile(
|
|
926
|
+
resultAudioBlob,
|
|
927
|
+
`${userName || ''}_voice_message.${fileExt}`,
|
|
928
|
+
);
|
|
929
|
+
|
|
930
|
+
setFileToSend(voiceMessage);
|
|
931
|
+
if (useAudioWidget) {
|
|
932
|
+
setUseAudioWidget(false);
|
|
933
|
+
}
|
|
934
|
+
//
|
|
935
|
+
}
|
|
936
|
+
}, [resultAudioBlob]);
|
|
937
|
+
useEffect(() => {
|
|
938
|
+
// setFileToSend(null);
|
|
939
|
+
if (isRecording) {
|
|
940
|
+
if (!permission) {
|
|
941
|
+
// eslint-disable-next-line promise/catch-or-return,promise/always-return
|
|
942
|
+
getMicrophonePermission().catch(() => {
|
|
943
|
+
showErrorMessage(`Have no audio.`);
|
|
944
|
+
});
|
|
945
|
+
} else {
|
|
946
|
+
// eslint-disable-next-line promise/catch-or-return,promise/always-return
|
|
947
|
+
startRecording().then(() => {
|
|
948
|
+
setWarningErrorText(`Your voice is recording during for 1 minutes`);
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
} else {
|
|
952
|
+
if (permission && mediaRecorder.current) {
|
|
953
|
+
stopRecording();
|
|
954
|
+
}
|
|
955
|
+
setWarningErrorText('');
|
|
956
|
+
}
|
|
957
|
+
}, [isRecording]);
|
|
958
|
+
useEffect(() => {
|
|
959
|
+
if (isRecording && permission) {
|
|
960
|
+
// eslint-disable-next-line promise/always-return,promise/catch-or-return
|
|
961
|
+
startRecording().then(() => {
|
|
962
|
+
setWarningErrorText(`Your voice is recording during for 1 minutes`);
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
}, [permission]);
|
|
966
|
+
useEffect(() => {
|
|
967
|
+
setWaitAIWidget(false);
|
|
968
|
+
if (
|
|
969
|
+
defaultAIRephraseWidget?.textToContent &&
|
|
970
|
+
defaultAIRephraseWidget?.textToContent.length > 0
|
|
971
|
+
) {
|
|
972
|
+
setMessageText(defaultAIRephraseWidget?.textToContent);
|
|
973
|
+
}
|
|
974
|
+
}, [defaultAIRephraseWidget?.textToContent]);
|
|
975
|
+
useEffect(() => {
|
|
976
|
+
setWaitAIWidget(false);
|
|
977
|
+
}, [defaultAITranslateWidget?.textToContent]);
|
|
978
|
+
useEffect(() => {
|
|
979
|
+
setWaitAIWidget(false);
|
|
980
|
+
if (
|
|
981
|
+
defaultAIAssistWidget?.textToContent &&
|
|
982
|
+
defaultAIAssistWidget?.textToContent.length > 0
|
|
983
|
+
) {
|
|
984
|
+
setMessageText(defaultAIAssistWidget?.textToContent);
|
|
985
|
+
}
|
|
986
|
+
}, [defaultAIAssistWidget?.textToContent]);
|
|
987
|
+
useEffect(() => {
|
|
988
|
+
if (isMobile) {
|
|
989
|
+
if (needDialogInformation) {
|
|
990
|
+
setShowDialogMessages(false);
|
|
991
|
+
setShowDialogInformation(true);
|
|
992
|
+
} else {
|
|
993
|
+
setShowDialogMessages(true);
|
|
994
|
+
setShowDialogInformation(false);
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
}, [needDialogInformation]);
|
|
998
|
+
useEffect(() => {
|
|
999
|
+
if (dialogToLeave) {
|
|
1000
|
+
handleDialogOnClick();
|
|
1001
|
+
}
|
|
1002
|
+
}, [dialogToLeave]);
|
|
1003
|
+
|
|
1004
|
+
//
|
|
1005
|
+
// Rendering
|
|
1006
|
+
//
|
|
1007
|
+
// 972
|
|
1008
|
+
return {
|
|
1009
|
+
constants: {
|
|
1010
|
+
mimeType,
|
|
1011
|
+
messagePerPage,
|
|
1012
|
+
maxFileSize,
|
|
1013
|
+
maxWidthToResizing,
|
|
1014
|
+
workHeight,
|
|
1015
|
+
messagesContainerMobileHeight,
|
|
1016
|
+
messagesContainerHeight,
|
|
1017
|
+
clientContainerHeight,
|
|
1018
|
+
headerHeight,
|
|
1019
|
+
dialogListScrollableHeight,
|
|
1020
|
+
},
|
|
1021
|
+
data: {
|
|
1022
|
+
isOnline,
|
|
1023
|
+
isMobile: Boolean(isMobile),
|
|
1024
|
+
width: Number(width),
|
|
1025
|
+
height: Number(height),
|
|
1026
|
+
breakpoint: Number(breakpoint),
|
|
1027
|
+
selectedDialog,
|
|
1028
|
+
dialogAvatarUrl,
|
|
1029
|
+
showDialogList,
|
|
1030
|
+
showDialogMessages,
|
|
1031
|
+
showDialogInformation,
|
|
1032
|
+
needDialogInformation,
|
|
1033
|
+
isRecording,
|
|
1034
|
+
stream,
|
|
1035
|
+
permission,
|
|
1036
|
+
resultAudioBlob,
|
|
1037
|
+
audioChunks,
|
|
1038
|
+
fileToSend,
|
|
1039
|
+
messageText,
|
|
1040
|
+
isLeaving,
|
|
1041
|
+
waitAIWidget,
|
|
1042
|
+
defaultAIRephraseWidget,
|
|
1043
|
+
defaultAITranslateWidget,
|
|
1044
|
+
defaultAIAssistWidget,
|
|
1045
|
+
mimeType,
|
|
1046
|
+
messagePerPage,
|
|
1047
|
+
maxTokensForAIRephrase,
|
|
1048
|
+
rephraseTones,
|
|
1049
|
+
enableForwarding,
|
|
1050
|
+
enableReplying,
|
|
1051
|
+
maxFileSize,
|
|
1052
|
+
userName,
|
|
1053
|
+
currentUserId,
|
|
1054
|
+
sessionToken,
|
|
1055
|
+
forwardMessage,
|
|
1056
|
+
warningErrorText,
|
|
1057
|
+
isAllMembersShow,
|
|
1058
|
+
scrollUpToDown,
|
|
1059
|
+
needRefresh,
|
|
1060
|
+
forwardMessageModal,
|
|
1061
|
+
newModal,
|
|
1062
|
+
isOpen,
|
|
1063
|
+
showReplyMessage,
|
|
1064
|
+
messagesToReply,
|
|
1065
|
+
},
|
|
1066
|
+
models: {
|
|
1067
|
+
dialogsViewModel,
|
|
1068
|
+
messagesViewModel,
|
|
1069
|
+
userViewModel,
|
|
1070
|
+
currentContext,
|
|
1071
|
+
},
|
|
1072
|
+
handlers: {
|
|
1073
|
+
setSelectedDialog,
|
|
1074
|
+
setShowDialogList,
|
|
1075
|
+
setShowDialogMessages,
|
|
1076
|
+
setShowDialogInformation,
|
|
1077
|
+
setNeedDialogInformation,
|
|
1078
|
+
handleLeaveDialog,
|
|
1079
|
+
getDialogPhotoFileForPreview,
|
|
1080
|
+
getMicrophonePermission,
|
|
1081
|
+
startRecording,
|
|
1082
|
+
stopRecording,
|
|
1083
|
+
setForwardMessage,
|
|
1084
|
+
informationCloseHandler,
|
|
1085
|
+
informationOpenHandler,
|
|
1086
|
+
setIsRecording,
|
|
1087
|
+
setIsAllMembersShow,
|
|
1088
|
+
fetchMoreData,
|
|
1089
|
+
sendTextMessageActions,
|
|
1090
|
+
ChangeFileHandler,
|
|
1091
|
+
handleOnReply,
|
|
1092
|
+
handleSendData,
|
|
1093
|
+
handleHeightChange,
|
|
1094
|
+
leaveDialogHandler,
|
|
1095
|
+
createDialogHandler,
|
|
1096
|
+
setWarningErrorText,
|
|
1097
|
+
closeReplyMessageFlowHandler,
|
|
1098
|
+
setMessageText,
|
|
1099
|
+
setWaitAIWidget,
|
|
1100
|
+
handleDialogOnClick,
|
|
1101
|
+
},
|
|
1102
|
+
};
|
|
1103
|
+
}
|