quickblox-react-ui-kit 0.3.0-beta.1 → 0.3.0-beta.3
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/README.md +5 -1
- package/dist/Data/repository/DialogsRepository.d.ts +1 -0
- package/dist/Data/source/remote/IRemoteDataSource.d.ts +1 -0
- package/dist/Data/source/remote/RemoteDataSource.d.ts +2 -0
- package/dist/Domain/entity/DialogEventInfo.d.ts +4 -0
- package/dist/Domain/use_cases/GetAllMessagesForDialog.d.ts +3 -3
- package/dist/Domain/use_cases/UpdateCurrentDialogInDataSourceUseCase.d.ts +10 -0
- package/dist/Presentation/Views/Dialog/AIComponents/AIAssist/AIAssist.d.ts +16 -0
- package/dist/Presentation/Views/Dialog/AIComponents/AITranslate/AITranslate.d.ts +20 -0
- package/dist/Presentation/Views/Dialog/DialogViewModel.d.ts +2 -0
- package/dist/Presentation/Views/Dialog/MessageItem/MessageItem.d.ts +22 -0
- package/dist/Presentation/Views/DialogInfo/DialogInfo.d.ts +1 -2
- package/dist/Presentation/Views/DialogList/DialogList.d.ts +5 -3
- package/dist/Presentation/Views/Flow/CreateDialogFlow/CreateNewDialogFlow.d.ts +3 -0
- package/dist/Presentation/Views/YesNoQuestion/YesNoQuestion.d.ts +0 -1
- package/dist/Presentation/ui-components/Message/Message.d.ts +3 -3
- package/dist/Presentation/ui-components/Message/Message.stories.d.ts +0 -1
- package/dist/Presentation/ui-components/MessageInput/MessageInput.stories.d.ts +4 -4
- package/dist/Presentation/ui-components/Placeholder/Placeholder.d.ts +2 -2
- package/dist/Presentation/ui-components/UserListItem/UserListItem.d.ts +11 -0
- package/dist/Presentation/ui-components/UserListItem/UserListItem.stories.d.ts +86 -0
- package/dist/Presentation/ui-components/index.d.ts +6 -0
- package/dist/hooks/useModal.d.ts +5 -0
- package/dist/index-ui.js +1924 -2183
- package/dist/index-ui.js.map +1 -1
- package/dist/qb-api-calls/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/App.tsx +2 -2
- package/src/Data/DefaultConfigurations.ts +4 -4
- package/src/Data/repository/DialogsRepository.ts +16 -0
- package/src/Data/source/remote/IRemoteDataSource.ts +2 -0
- package/src/Data/source/remote/RemoteDataSource.ts +89 -10
- package/src/Domain/entity/DialogEventInfo.ts +4 -0
- package/src/Domain/use_cases/GetAllMessagesForDialog.ts +3 -3
- package/src/Domain/use_cases/GetDialogByIdUseCase.ts +5 -1
- package/src/Domain/use_cases/UpdateCurrentDialogInDataSourceUseCase.ts +31 -0
- package/src/Presentation/Views/Dialog/AIComponents/AIAssist/AIAssist.tsx +64 -0
- package/src/Presentation/Views/Dialog/AIComponents/AITranslate/AITranslate.tsx +117 -0
- package/src/Presentation/Views/Dialog/Dialog.tsx +0 -22
- package/src/Presentation/Views/Dialog/DialogViewModel.ts +2 -0
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogsWithSearch.scss +10 -0
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogsWithSearch.tsx +12 -13
- package/src/Presentation/{ui-components/Message → Views/Dialog}/MessageContextMenu/MessageContextMenu.tsx +2 -2
- package/src/Presentation/{ui-components → Views/Dialog}/MessageItem/MessageItem.scss +1 -2
- package/src/Presentation/Views/Dialog/MessageItem/MessageItem.tsx +372 -0
- package/src/Presentation/Views/Dialog/useDialogViewModel.ts +65 -32
- package/src/Presentation/Views/DialogInfo/DialogInfo.scss +17 -11
- package/src/Presentation/Views/DialogInfo/DialogInfo.tsx +115 -120
- package/src/Presentation/Views/DialogInfo/MembersList/MembersList.scss +8 -99
- package/src/Presentation/Views/DialogInfo/MembersList/MembersList.tsx +9 -29
- package/src/Presentation/Views/DialogInfo/UsersList/UsersList.tsx +8 -6
- package/src/Presentation/Views/DialogInfo/UsersList/useUsersListViewModel.ts +3 -1
- package/src/Presentation/Views/DialogList/DialogList.scss +19 -5
- package/src/Presentation/Views/DialogList/DialogList.tsx +91 -56
- package/src/Presentation/Views/DialogList/useDialogListViewModel.ts +111 -27
- package/src/Presentation/Views/EditDialog/EditDialog.scss +7 -46
- package/src/Presentation/Views/EditDialog/EditDialog.tsx +50 -67
- package/src/Presentation/Views/Flow/CreateDialogFlow/CreateNewDialogFlow.tsx +10 -19
- package/src/Presentation/Views/Flow/LeaveDialogFlow/LeaveDialogFlow.tsx +0 -11
- package/src/Presentation/Views/InviteMembers/InviteMembers.scss +61 -16
- package/src/Presentation/Views/InviteMembers/InviteMembers.tsx +53 -78
- package/src/Presentation/Views/PreviewDialog/PreviewDialog.scss +5 -1
- package/src/Presentation/Views/PreviewDialog/PreviewDialog.tsx +1 -0
- package/src/Presentation/Views/YesNoQuestion/YesNoQuestion.tsx +6 -18
- package/src/Presentation/icons/media/video-file.svg +2 -2
- package/src/Presentation/layouts/Desktop/DesktopLayout.scss +24 -8
- package/src/Presentation/layouts/Desktop/QuickBloxUIKitDesktopLayout.tsx +233 -200
- package/src/Presentation/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider.tsx +1 -2
- package/src/Presentation/ui-components/Avatar/avatar.stories.tsx +1 -1
- package/src/Presentation/ui-components/Badge/Badge.stories.ts +1 -1
- package/src/Presentation/ui-components/Button/Button.stories.ts +1 -1
- package/src/Presentation/ui-components/DialogBanner/DialogBanner.stories.ts +2 -1
- package/src/Presentation/ui-components/DialogItemPreview/DialogItemPreview.stories.tsx +29 -1
- package/src/Presentation/ui-components/DialogItemPreview/DialogItemPreview.tsx +4 -1
- package/src/Presentation/ui-components/DialogWindow/DialogWindow.scss +5 -0
- package/src/Presentation/ui-components/DialogWindow/DialogWindow.stories.tsx +2 -1
- package/src/Presentation/ui-components/Dropdown/Dropdown.stories.tsx +6 -4
- package/src/Presentation/ui-components/Dropdown/Dropdown.tsx +10 -2
- package/src/Presentation/ui-components/Header/Header.stories.tsx +2 -1
- package/src/Presentation/ui-components/Loader/Loader.stories.ts +2 -2
- package/src/Presentation/ui-components/Loader/Loader.tsx +1 -1
- package/src/Presentation/ui-components/Message/Bubble/AttachmentBubble/AttachmentBubble.tsx +13 -2
- package/src/Presentation/ui-components/Message/Bubble/AudioBubble/AudioBubble.scss +13 -0
- package/src/Presentation/ui-components/Message/Bubble/AudioBubble/AudioBubble.tsx +16 -2
- package/src/Presentation/ui-components/Message/Bubble/VideoBubble/VideoBubble.scss +9 -0
- package/src/Presentation/ui-components/Message/Bubble/VideoBubble/VideoBubble.tsx +15 -17
- package/src/Presentation/ui-components/Message/Message.scss +0 -7
- package/src/Presentation/ui-components/Message/Message.stories.tsx +103 -36
- package/src/Presentation/ui-components/Message/Message.tsx +5 -5
- package/src/Presentation/ui-components/Message/TimeAndStatus/TimeAndStatus.scss +1 -4
- package/src/Presentation/ui-components/MessageInput/MessageInput.stories.tsx +16 -8
- package/src/Presentation/ui-components/MessageSeparator/MessageSeparator.scss +0 -1
- package/src/Presentation/ui-components/MessageSeparator/MessageSeparator.stories.ts +3 -1
- package/src/Presentation/ui-components/Placeholder/Placeholder.scss +1 -1
- package/src/Presentation/ui-components/Placeholder/Placeholder.stories.tsx +4 -8
- package/src/Presentation/ui-components/Placeholder/Placeholder.tsx +10 -4
- package/src/Presentation/ui-components/PreviewFileMessage/PreviewFileMessage.stories.ts +12 -1
- package/src/Presentation/ui-components/SettingsItem/SettingsItem.stories.tsx +5 -1
- package/src/Presentation/ui-components/TextField/TextField.scss +1 -0
- package/src/Presentation/ui-components/TextField/TextField.stories.ts +7 -2
- package/src/Presentation/ui-components/Toast/Toast.scss +2 -3
- package/src/Presentation/ui-components/Toast/Toast.stories.tsx +1 -1
- package/src/Presentation/ui-components/Toast/ToastProvider.tsx +0 -1
- 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 +6 -0
- package/src/QBconfig.ts +4 -4
- package/src/hooks/useModal.ts +13 -0
- package/src/index.scss +0 -2
- package/src/qb-api-calls/index.ts +1 -0
- package/storybook-static/426.be971fb5.iframe.bundle.js +157 -0
- package/storybook-static/426.be971fb5.iframe.bundle.js.map +1 -0
- package/storybook-static/433.dffc897e.iframe.bundle.js +1 -0
- package/storybook-static/603.4cf0423b.iframe.bundle.js +1 -0
- package/storybook-static/607.b04b9f0b.iframe.bundle.js +1 -0
- package/storybook-static/729.734b4ae4.iframe.bundle.js +1 -0
- package/storybook-static/758.e75a5a47.iframe.bundle.js +14 -0
- package/storybook-static/758.e75a5a47.iframe.bundle.js.map +1 -0
- package/storybook-static/768.e44c05aa.iframe.bundle.js +351 -0
- package/storybook-static/768.e44c05aa.iframe.bundle.js.map +1 -0
- package/storybook-static/797.b3873e04.iframe.bundle.js +1 -0
- package/storybook-static/926.f5308089.iframe.bundle.js +508 -0
- package/storybook-static/926.f5308089.iframe.bundle.js.map +1 -0
- package/storybook-static/Presentation-ui-components-Avatar-avatar-stories.cf806856.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-Badge-Badge-stories.9449e470.iframe.bundle.js +14 -0
- package/storybook-static/Presentation-ui-components-Badge-Badge-stories.9449e470.iframe.bundle.js.map +1 -0
- package/storybook-static/Presentation-ui-components-Button-Button-stories.4fac7996.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-DialogBanner-DialogBanner-stories.fa91d2c7.iframe.bundle.js +10 -0
- package/storybook-static/Presentation-ui-components-DialogBanner-DialogBanner-stories.fa91d2c7.iframe.bundle.js.map +1 -0
- package/storybook-static/Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.90aa44c5.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-DialogWindow-DialogWindow-stories.3523a670.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-Dropdown-Dropdown-stories.aacf2ec2.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-Header-Header-stories.073c4507.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-Loader-Loader-stories.9bf3fb63.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-Message-Message-stories.343dfae0.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-MessageInput-MessageInput-stories.262a0cf2.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-MessageSeparator-MessageSeparator-stories.a7d43c0b.iframe.bundle.js +10 -0
- package/storybook-static/Presentation-ui-components-MessageSeparator-MessageSeparator-stories.a7d43c0b.iframe.bundle.js.map +1 -0
- package/storybook-static/Presentation-ui-components-Placeholder-Placeholder-stories.871f508c.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-PreviewFileMessage-PreviewFileMessage-stories.1661d95b.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-SettingsItem-SettingsItem-stories.8f6fca84.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-TextField-TextField-stories.4a2eef3e.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-Toast-Toast-stories.55e63162.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-UserListItem-UserListItem-stories.04d3eefe.iframe.bundle.js +1 -0
- package/storybook-static/docs-Introduction-mdx.ac401482.iframe.bundle.js +10 -0
- package/storybook-static/docs-Introduction-mdx.ac401482.iframe.bundle.js.map +1 -0
- package/storybook-static/docs-Styling-mdx.1d6c1212.iframe.bundle.js +10 -0
- package/storybook-static/docs-Styling-mdx.1d6c1212.iframe.bundle.js.map +1 -0
- package/storybook-static/favicon.ico +0 -0
- package/storybook-static/favicon.svg +7 -0
- package/storybook-static/iframe.html +355 -0
- package/storybook-static/index.html +131 -0
- package/storybook-static/index.json +1 -0
- package/storybook-static/logo192.png +0 -0
- package/storybook-static/logo512.png +0 -0
- package/storybook-static/main.597d432b.iframe.bundle.js +1 -0
- package/storybook-static/manifest.json +25 -0
- package/storybook-static/project.json +1 -0
- package/storybook-static/quickblox.js +54609 -0
- package/storybook-static/robots.txt +3 -0
- package/storybook-static/runtime~main.e945879b.iframe.bundle.js +1 -0
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-backgrounds-3/manager-bundle.js +12 -0
- package/storybook-static/sb-addons/essentials-backgrounds-3/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +63 -0
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js.LEGAL.txt +18 -0
- package/storybook-static/sb-addons/essentials-measure-5/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-measure-5/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-outline-6/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-outline-6/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-toolbars-4/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-toolbars-4/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/interactions-8/manager-bundle.js +12 -0
- package/storybook-static/sb-addons/interactions-8/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/links-0/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/links-0/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/onboarding-7/manager-bundle.js +503 -0
- package/storybook-static/sb-addons/onboarding-7/manager-bundle.js.LEGAL.txt +48 -0
- package/storybook-static/sb-addons/viewport-9/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/viewport-9/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-common-assets/fonts.css +31 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/sb-manager/WithTooltip-V3YHNWJZ-LVYLGZW2.js +1 -0
- package/storybook-static/sb-manager/chunk-2IXBUOFS.js +7 -0
- package/storybook-static/sb-manager/chunk-INSKDKQB.js +348 -0
- package/storybook-static/sb-manager/chunk-NGTUFCUO.js +9 -0
- package/storybook-static/sb-manager/chunk-NMB3SATH.js +406 -0
- package/storybook-static/sb-manager/chunk-ZEU7PDD3.js +1 -0
- package/storybook-static/sb-manager/formatter-SWP5E3XI-7BGIK6BL.js +156 -0
- package/storybook-static/sb-manager/globals-module-info.js +1 -0
- package/storybook-static/sb-manager/globals.js +1 -0
- package/storybook-static/sb-manager/index.js +1 -0
- package/storybook-static/sb-manager/runtime.js +1 -0
- package/storybook-static/sb-manager/syntaxhighlighter-V7JZZA35-DXZCI2WR.js +1 -0
- package/storybook-static/sb-preview/globals.js +1 -0
- package/storybook-static/sb-preview/runtime.js +112 -0
- package/storybook-static/static/css/Presentation-ui-components-Avatar-avatar-stories.807573c8.chunk.css +3 -0
- package/storybook-static/static/css/Presentation-ui-components-Avatar-avatar-stories.807573c8.chunk.css.map +1 -0
- package/storybook-static/static/css/Presentation-ui-components-Badge-Badge-stories.7b8317f8.chunk.css +3 -0
- package/storybook-static/static/css/Presentation-ui-components-Badge-Badge-stories.7b8317f8.chunk.css.map +1 -0
- package/storybook-static/static/css/Presentation-ui-components-Button-Button-stories.1b6e1c55.chunk.css +4 -0
- package/storybook-static/static/css/Presentation-ui-components-Button-Button-stories.1b6e1c55.chunk.css.map +1 -0
- package/storybook-static/static/css/Presentation-ui-components-DialogBanner-DialogBanner-stories.bd07fad3.chunk.css +3 -0
- package/storybook-static/static/css/Presentation-ui-components-DialogBanner-DialogBanner-stories.bd07fad3.chunk.css.map +1 -0
- package/storybook-static/static/css/Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.e720ff21.chunk.css +7 -0
- package/storybook-static/static/css/Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.e720ff21.chunk.css.map +1 -0
- package/storybook-static/static/css/Presentation-ui-components-DialogWindow-DialogWindow-stories.6fb3af8d.chunk.css +6 -0
- package/storybook-static/static/css/Presentation-ui-components-DialogWindow-DialogWindow-stories.6fb3af8d.chunk.css.map +1 -0
- package/storybook-static/static/css/Presentation-ui-components-Dropdown-Dropdown-stories.66965d64.chunk.css +5 -0
- package/storybook-static/static/css/Presentation-ui-components-Dropdown-Dropdown-stories.66965d64.chunk.css.map +1 -0
- package/storybook-static/static/css/Presentation-ui-components-Header-Header-stories.cdc47631.chunk.css +4 -0
- package/storybook-static/static/css/Presentation-ui-components-Header-Header-stories.cdc47631.chunk.css.map +1 -0
- package/storybook-static/static/css/Presentation-ui-components-Loader-Loader-stories.dab34da1.chunk.css +3 -0
- package/storybook-static/static/css/Presentation-ui-components-Loader-Loader-stories.dab34da1.chunk.css.map +1 -0
- package/storybook-static/static/css/Presentation-ui-components-Message-Message-stories.0e129b10.chunk.css +14 -0
- package/storybook-static/static/css/Presentation-ui-components-Message-Message-stories.0e129b10.chunk.css.map +1 -0
- package/storybook-static/static/css/Presentation-ui-components-MessageInput-MessageInput-stories.0e99d80b.chunk.css +7 -0
- package/storybook-static/static/css/Presentation-ui-components-MessageInput-MessageInput-stories.0e99d80b.chunk.css.map +1 -0
- package/storybook-static/static/css/Presentation-ui-components-MessageSeparator-MessageSeparator-stories.34aa36b2.chunk.css +3 -0
- package/storybook-static/static/css/Presentation-ui-components-MessageSeparator-MessageSeparator-stories.34aa36b2.chunk.css.map +1 -0
- package/storybook-static/static/css/Presentation-ui-components-Placeholder-Placeholder-stories.cb7fb80a.chunk.css +3 -0
- package/storybook-static/static/css/Presentation-ui-components-Placeholder-Placeholder-stories.cb7fb80a.chunk.css.map +1 -0
- package/storybook-static/static/css/Presentation-ui-components-PreviewFileMessage-PreviewFileMessage-stories.015ac417.chunk.css +3 -0
- package/storybook-static/static/css/Presentation-ui-components-PreviewFileMessage-PreviewFileMessage-stories.015ac417.chunk.css.map +1 -0
- package/storybook-static/static/css/Presentation-ui-components-SettingsItem-SettingsItem-stories.7b98a5d4.chunk.css +5 -0
- package/storybook-static/static/css/Presentation-ui-components-SettingsItem-SettingsItem-stories.7b98a5d4.chunk.css.map +1 -0
- package/storybook-static/static/css/Presentation-ui-components-TextField-TextField-stories.412027f8.chunk.css +4 -0
- package/storybook-static/static/css/Presentation-ui-components-TextField-TextField-stories.412027f8.chunk.css.map +1 -0
- package/storybook-static/static/css/Presentation-ui-components-Toast-Toast-stories.11d83296.chunk.css +754 -0
- package/storybook-static/static/css/Presentation-ui-components-Toast-Toast-stories.11d83296.chunk.css.map +1 -0
- package/storybook-static/static/css/Presentation-ui-components-UserListItem-UserListItem-stories.4d072348.chunk.css +7 -0
- package/storybook-static/static/css/Presentation-ui-components-UserListItem-UserListItem-stories.4d072348.chunk.css.map +1 -0
- package/storybook-static/static/css/main.6fa55a2c.css +5 -0
- package/storybook-static/static/css/main.6fa55a2c.css.map +1 -0
- package/storybook-static/static/media/add-contact.e7e7b8b15edebe99cae9c46963126e7c.svg +3 -0
- package/storybook-static/static/media/add.5cbe1f2c489b81396863f7128e3d26e7.svg +3 -0
- package/storybook-static/static/media/admin.476c2854d7ad23f2afdedac2d9bd6815.svg +3 -0
- package/storybook-static/static/media/archive.d0a72898f3c47a4194d18f560a54e109.svg +3 -0
- package/storybook-static/static/media/arrow-left.5005351d4fa6a7c074dd9780fb49dcc8.svg +3 -0
- package/storybook-static/static/media/arrow-right.1be3b599e21158807fdf72f4976179a2.svg +3 -0
- package/storybook-static/static/media/attachment.a58b8549f46ae5bbe93be779cd9f2037.svg +3 -0
- package/storybook-static/static/media/audio-file.40179c472f715fc74d4da607da96aa5e.svg +3 -0
- package/storybook-static/static/media/back.b541e72fe05542e145575c8851558998.svg +3 -0
- package/storybook-static/static/media/banned.c7c74bfa1c833263f3ab42d0529132d1.svg +3 -0
- package/storybook-static/static/media/broadcast.55273926379e5f486ccfdfab1a310b2d.svg +7 -0
- package/storybook-static/static/media/broken-file.bc084278a0d284b7901b47f24001caa6.svg +3 -0
- package/storybook-static/static/media/camera-off.8e01960815ce7620a1039d0fc5f758b2.svg +3 -0
- package/storybook-static/static/media/camera-on.ddd56e36fa505d618ab772e23c8381e6.svg +3 -0
- package/storybook-static/static/media/camera.a5a215695fba60146e649094188f37e2.svg +3 -0
- package/storybook-static/static/media/chat-filled.aaf0b778d198e7b8f632a68299a8fd13.svg +3 -0
- package/storybook-static/static/media/chat.59cd437f21fe7043682dd04cbe6377be.svg +3 -0
- package/storybook-static/static/media/check-off.0c0256f00eeb75770ffc2fbd2b59eab0.svg +3 -0
- package/storybook-static/static/media/check-on.80442753ef6922df1913453f50099315.svg +3 -0
- package/storybook-static/static/media/close.c145af996de81b25f3930bf36d88b161.svg +3 -0
- package/storybook-static/static/media/conference.ffbdf37c0510c796138f18e6c1205204.svg +3 -0
- package/storybook-static/static/media/contact-filled.f04f56ba3f98ade5d7ced7814d8a5fa8.svg +3 -0
- package/storybook-static/static/media/contact.40a8b8104c3a448b81108ffede850963.svg +3 -0
- package/storybook-static/static/media/copy.100bd0fff933cbde8ad4bc2ac281c845.svg +3 -0
- package/storybook-static/static/media/delete.287c9b4b3b0e58cb081c6e388e68b409.svg +3 -0
- package/storybook-static/static/media/down.7a43a3d78885f40616ce111c86c108a4.svg +3 -0
- package/storybook-static/static/media/download.43c26d404dd023e42aaacc52151f7a59.svg +3 -0
- package/storybook-static/static/media/edit.8d813af82ecab84303ee3c97bd7bc562.svg +3 -0
- package/storybook-static/static/media/emoji.9a202cbb16735f3c83ba8772f0218aa4.svg +3 -0
- package/storybook-static/static/media/error.ec60e2052661b82f27b7ce270ae133a7.svg +3 -0
- package/storybook-static/static/media/favorite.194d78057be6cd7968c85e7b5822f82a.svg +3 -0
- package/storybook-static/static/media/file.e537292693b3c89c023fd383c70bd221.svg +3 -0
- package/storybook-static/static/media/forward-filled.43120a68057427c89c88b28d9b20dd90.svg +3 -0
- package/storybook-static/static/media/freeze.35619771e645b649c38e0427d9b39a25.svg +3 -0
- package/storybook-static/static/media/full-screen.6b01c93e069421c69bda2bbde5d01336.svg +3 -0
- package/storybook-static/static/media/gif-file.2c46a5df6c8397f5b9088e66aee3fd44.svg +3 -0
- package/storybook-static/static/media/group-chat.19d5305cab6017d494ac35ecb285a9fe.svg +3 -0
- package/storybook-static/static/media/help.786f48518c96c8e7098296d68245c339.svg +3 -0
- package/storybook-static/static/media/hide.2785264246d70868717984a5ad44d4c9.svg +3 -0
- package/storybook-static/static/media/hungup.e5d2289a9e8cd755bd1ee36b738305a2.svg +3 -0
- package/storybook-static/static/media/image-filled.8afb62b142d786e90102f1cac73a9c13.svg +3 -0
- package/storybook-static/static/media/image.64092dadd5215c8d3ba99ccac753d743.svg +3 -0
- package/storybook-static/static/media/income-call.60ca2d367a00d582f4b6f4a5f2047e27.svg +3 -0
- package/storybook-static/static/media/information.8217e163c334852f143e7199c97fab1d.svg +3 -0
- package/storybook-static/static/media/leave.ae5422a12edec1b61484ff2932819c77.svg +3 -0
- package/storybook-static/static/media/like.45662989373aa524cd580fb42432e0bc.svg +3 -0
- package/storybook-static/static/media/link.74f567c3ee4366d79fb81d73eb8c0919.svg +3 -0
- package/storybook-static/static/media/loader.2eb72391c5267453edb4106528c075ad.svg +3 -0
- package/storybook-static/static/media/location.cab52453404524c345ec7efdd86fa66b.svg +4 -0
- package/storybook-static/static/media/louder.133519141541a9cd2f0e898534b39732.svg +3 -0
- package/storybook-static/static/media/mention.6c4885bb0ea5ca85c8962f6f51ac1cb4.svg +3 -0
- package/storybook-static/static/media/mic-off.43e60427600bcf7fd78fb840ff50d804.svg +3 -0
- package/storybook-static/static/media/mic-on.5a52100de3770550b3a57a76827843c2.svg +4 -0
- package/storybook-static/static/media/minimize.a849dd3a36ece08b992a773d135a0c3f.svg +3 -0
- package/storybook-static/static/media/moderations.07c8d1fe96b0b8bb5911f6cc37f764c6.svg +3 -0
- package/storybook-static/static/media/more.4ed9ad54ae110d9760b6e9698d821960.svg +3 -0
- package/storybook-static/static/media/muted.cb37ac3c577c87c800466aa7aee65af2.svg +3 -0
- package/storybook-static/static/media/new-chat.124e0351bd0e19ff4c5fdbabbe5c6027.svg +3 -0
- package/storybook-static/static/media/next.97a0eeea1f8daa2d31c8452f29908bf1.svg +3 -0
- package/storybook-static/static/media/notifications.ab8e847ae04e2bec9209dbdd1054b0f2.svg +3 -0
- package/storybook-static/static/media/notify-off.4a669a3a8cbd38b3309dbc4c909f6089.svg +3 -0
- package/storybook-static/static/media/notify-on.ea9ffc856ad6cdbe87184af558c78eec.svg +3 -0
- package/storybook-static/static/media/outcome-call.9f5fec07823796ad78963a06cdcf629e.svg +3 -0
- package/storybook-static/static/media/pause.27eb8c32999f10d05d6a200165d798a9.svg +3 -0
- package/storybook-static/static/media/phone-filled.e969511d74935af26ef366f575929f68.svg +3 -0
- package/storybook-static/static/media/phone.6355580a064a488b6317372d71f84c00.svg +3 -0
- package/storybook-static/static/media/play.00bfe0e9c94dc6dfb230262e45b2f860.svg +3 -0
- package/storybook-static/static/media/plus.d3953cb1cf830bcfc41c8cc6133b13b1.svg +3 -0
- package/storybook-static/static/media/private-chat.c68f36baf025b9d20ad1f801a2396e7a.svg +3 -0
- package/storybook-static/static/media/public-channel.7a6ada7f30c44fb4a99021df0eb0e996.svg +7 -0
- package/storybook-static/static/media/quite.9f45e2152fe6c499a776cb387ee4859f.svg +3 -0
- package/storybook-static/static/media/record.e49ee7da793b2ce446a4e7128970c0cc.svg +3 -0
- package/storybook-static/static/media/refresh.6e955728d9ec086f34e9adaaaafacf3e.svg +3 -0
- package/storybook-static/static/media/remove-2.8a7700757f02c941f03c37c7e495bf63.svg +3 -0
- package/storybook-static/static/media/remove.831e69b70db1b3eb72a49444b8aa1e16.svg +3 -0
- package/storybook-static/static/media/rephrase.551171aa8903b31746a58a95528b1f68.svg +6 -0
- package/storybook-static/static/media/reply-filled.17ed65506e902f17bb22e87ffac93314.svg +3 -0
- package/storybook-static/static/media/screenshare.c2f94264a7640ea1bbb2a22f7d570038.svg +3 -0
- package/storybook-static/static/media/search.25663e60d71e01c64fdfc83df7460ab0.svg +3 -0
- package/storybook-static/static/media/send.d298db52aafdb846a46c9d180ad45946.svg +3 -0
- package/storybook-static/static/media/sent.f427753e5502fd7783a08e5f0e0d2f35.svg +3 -0
- package/storybook-static/static/media/settings-filled.bd9b60ff4e9eae911e4e2bc69e8e79ca.svg +3 -0
- package/storybook-static/static/media/share.7ce8283aa267fb065c568d65b482e211.svg +3 -0
- package/storybook-static/static/media/show.de1782527c4a7fa14101dffbfba8aea6.svg +3 -0
- package/storybook-static/static/media/speaker-off.fe84597c4b68f4f761e12f789dc58718.svg +3 -0
- package/storybook-static/static/media/speaker.e7ff48a73ca43188703b36dfecd932b5.svg +3 -0
- package/storybook-static/static/media/stop-record.a2e9d50a0930c24af43d7f357093be81.svg +3 -0
- package/storybook-static/static/media/stop-share.d1be236e01dd924ba711e1e17f41054c.svg +3 -0
- package/storybook-static/static/media/stream-filled.c40bae61fea25455602a61db5e77fa71.svg +3 -0
- package/storybook-static/static/media/stream.700f4f8ce0cee0ae1ef56132867427fe.svg +3 -0
- package/storybook-static/static/media/swap-camera.bc3a4652106f5c57d14b4dcbffff08a5.svg +3 -0
- package/storybook-static/static/media/text-document.cad7e87368501b96de2a939d08852dcd.svg +3 -0
- package/storybook-static/static/media/unarchive.1b1a7438cd8eb6fee80e6ac89baa195b.svg +3 -0
- package/storybook-static/static/media/user.911c7ae778615185b285ce0ae4068486.svg +3 -0
- package/storybook-static/static/media/video-file.dc2971be489b2af7b1c04dcc55bfe881.svg +3 -0
- package/storybook-static/static/media/video.bbcc2109285c18eea02ede86920de0dd.svg +3 -0
- package/storybook-static/static/media/viewed-delivered.f43360dc87235a6cf574ff53f73dd777.svg +3 -0
- package/storybook-static/static/media/voice.b937c8a1f744050bec2cd389ad2a1f3a.svg +3 -0
- package/storybook-static/stories.json +1 -0
- package/dist/Presentation/providers/ModalContextProvider/Modal.d.ts +0 -14
- package/dist/Presentation/providers/ModalContextProvider/ModalContextProvider.d.ts +0 -4
- package/dist/Presentation/providers/ModalContextProvider/useModal.d.ts +0 -11
- package/dist/Presentation/ui-components/Message/AIAssist/AIAssist.d.ts +0 -9
- package/dist/Presentation/ui-components/Message/AITranslate/AITranslate.d.ts +0 -13
- package/dist/Presentation/ui-components/MessageItem/MessageItem.d.ts +0 -25
- package/src/Presentation/providers/ModalContextProvider/Modal.scss +0 -76
- package/src/Presentation/providers/ModalContextProvider/Modal.tsx +0 -80
- package/src/Presentation/providers/ModalContextProvider/ModalContextProvider.tsx +0 -38
- package/src/Presentation/providers/ModalContextProvider/useModal.ts +0 -39
- package/src/Presentation/ui-components/Message/AIAssist/AIAssist.tsx +0 -25
- package/src/Presentation/ui-components/Message/AITranslate/AITranslate.tsx +0 -79
- package/src/Presentation/ui-components/MessageItem/MessageItem.tsx +0 -332
- /package/dist/Presentation/{ui-components/Message → Views/Dialog}/MessageContextMenu/MessageContextMenu.d.ts +0 -0
- /package/src/Presentation/{ui-components/Message → Views/Dialog/AIComponents}/AIAssist/AIAssist.scss +0 -0
- /package/src/Presentation/{ui-components/Message → Views/Dialog/AIComponents}/AITranslate/AITranslate.scss +0 -0
- /package/src/Presentation/{ui-components/Message → Views/Dialog}/MessageContextMenu/MessageContextMenu.scss +0 -0
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { FunctionTypeVoidToVoid } from '../../../../CommonTypes/BaseViewModel';
|
|
2
|
-
import { ReactComponent as RobotSvg } from '../../../icons/actions/robot.svg';
|
|
3
|
-
import './AIAssist.scss';
|
|
4
|
-
|
|
5
|
-
interface AITrascribeComponentProps {
|
|
6
|
-
onAssistAnswer: FunctionTypeVoidToVoid;
|
|
7
|
-
waitAIWidget: boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export default function AIAssist({
|
|
11
|
-
onAssistAnswer,
|
|
12
|
-
waitAIWidget,
|
|
13
|
-
}: AITrascribeComponentProps) {
|
|
14
|
-
return (
|
|
15
|
-
<div className="ai-assist-answer">
|
|
16
|
-
<div className="ai-assist-answer__icon" onClick={onAssistAnswer}>
|
|
17
|
-
{waitAIWidget ? (
|
|
18
|
-
<div />
|
|
19
|
-
) : (
|
|
20
|
-
<RobotSvg className="ai-assist-answer__icon__media-robot" />
|
|
21
|
-
)}
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import './AITranslate.scss';
|
|
2
|
-
import {
|
|
3
|
-
FunctionTypeStringToVoid,
|
|
4
|
-
FunctionTypeVoidToVoid,
|
|
5
|
-
} from '../../../../CommonTypes/BaseViewModel';
|
|
6
|
-
import Dropdown from '../../Dropdown/Dropdown';
|
|
7
|
-
import { ReactComponent as TranslateSvg } from '../../../icons/actions/translate.svg';
|
|
8
|
-
import { Option } from '../../Dropdown/DropdownOption';
|
|
9
|
-
|
|
10
|
-
interface AITranslateComponentProps {
|
|
11
|
-
onTranslate: FunctionTypeStringToVoid;
|
|
12
|
-
onClickOriginalText: FunctionTypeVoidToVoid;
|
|
13
|
-
originalTextMessage: boolean;
|
|
14
|
-
waitAIWidget: boolean;
|
|
15
|
-
defaultLanguageForAITranslate: string;
|
|
16
|
-
languagesForAITranslate: string[];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default function AITranslate({
|
|
20
|
-
onTranslate,
|
|
21
|
-
onClickOriginalText,
|
|
22
|
-
originalTextMessage,
|
|
23
|
-
waitAIWidget,
|
|
24
|
-
defaultLanguageForAITranslate,
|
|
25
|
-
languagesForAITranslate,
|
|
26
|
-
}: AITranslateComponentProps) {
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
28
|
-
|
|
29
|
-
const options: Option[] = [];
|
|
30
|
-
|
|
31
|
-
if (languagesForAITranslate.length > 0) {
|
|
32
|
-
languagesForAITranslate.forEach((item) => {
|
|
33
|
-
options.push({ value: item, label: item });
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<div className="ai-translate">
|
|
39
|
-
<div
|
|
40
|
-
className={
|
|
41
|
-
waitAIWidget ? 'translate__caption--disable' : 'ai-translate__caption'
|
|
42
|
-
}
|
|
43
|
-
>
|
|
44
|
-
<div
|
|
45
|
-
className="ai-translate__caption__label"
|
|
46
|
-
onClick={() => {
|
|
47
|
-
if (waitAIWidget) return;
|
|
48
|
-
|
|
49
|
-
if (originalTextMessage) {
|
|
50
|
-
onTranslate(defaultLanguageForAITranslate);
|
|
51
|
-
} else {
|
|
52
|
-
onClickOriginalText();
|
|
53
|
-
}
|
|
54
|
-
}}
|
|
55
|
-
>
|
|
56
|
-
{originalTextMessage ? 'Show translation' : 'Show original'}
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
<div>
|
|
60
|
-
<Dropdown
|
|
61
|
-
options={options}
|
|
62
|
-
disabled={waitAIWidget}
|
|
63
|
-
onSelect={(language) => onTranslate(language)}
|
|
64
|
-
>
|
|
65
|
-
<div
|
|
66
|
-
// className={
|
|
67
|
-
// waitAIWidget
|
|
68
|
-
// ? 'ai-translate__icon-disable'
|
|
69
|
-
// : 'ai-translate__icon'
|
|
70
|
-
// }
|
|
71
|
-
className="ai-translate__icon"
|
|
72
|
-
>
|
|
73
|
-
<TranslateSvg className="ai-translate__icon__media-translate" />
|
|
74
|
-
</div>
|
|
75
|
-
</Dropdown>
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
);
|
|
79
|
-
}
|
|
@@ -1,332 +0,0 @@
|
|
|
1
|
-
import React, { RefObject, useState } from 'react';
|
|
2
|
-
import { MessageEntity } from '../../../Domain/entity/MessageEntity';
|
|
3
|
-
import { getTimeShort24hFormat } from '../../../utils/DateTimeFormatter';
|
|
4
|
-
import Message from '../Message/Message';
|
|
5
|
-
import TextBubble from '../Message/Bubble/TextBubble/TextBubble';
|
|
6
|
-
import AttachmentBubble from '../Message/Bubble/AttachmentBubble/AttachmentBubble';
|
|
7
|
-
import AIAssist from '../Message/AIAssist/AIAssist';
|
|
8
|
-
import MessageContextMenu from '../Message/MessageContextMenu/MessageContextMenu';
|
|
9
|
-
import { FunctionTypeMessageEntityToVoid } from '../../../CommonTypes/BaseViewModel';
|
|
10
|
-
import './MessageItem.scss';
|
|
11
|
-
import AITranslate from '../Message/AITranslate/AITranslate';
|
|
12
|
-
import { AIMessageWidget } from '../../Views/Dialog/AIWidgets/AIMessageWidget';
|
|
13
|
-
import { AIUtils } from '../../../utils/utils';
|
|
14
|
-
import Loader from '../Loader/Loader';
|
|
15
|
-
import MessageSeparator from '../MessageSeparator/MessageSeparator';
|
|
16
|
-
import { MessageDTOMapper } from '../../../Data/source/remote/Mapper/MessageDTOMapper';
|
|
17
|
-
|
|
18
|
-
export type MessageItemProps = {
|
|
19
|
-
message: MessageEntity;
|
|
20
|
-
userId?: number;
|
|
21
|
-
AITranslateWidget: AIMessageWidget;
|
|
22
|
-
AIAssistWidget: AIMessageWidget;
|
|
23
|
-
maxTokens: number;
|
|
24
|
-
defaultTranslationLanguage?: string;
|
|
25
|
-
enableForwarding: boolean;
|
|
26
|
-
enableReplying: boolean;
|
|
27
|
-
onReply: FunctionTypeMessageEntityToVoid;
|
|
28
|
-
onForward: FunctionTypeMessageEntityToVoid;
|
|
29
|
-
// defaultGetSenderName: GetUserNameFct;
|
|
30
|
-
languagesForAITranslate: string[];
|
|
31
|
-
listRef?: RefObject<HTMLDivElement>;
|
|
32
|
-
messagesToView: MessageEntity[];
|
|
33
|
-
loading: boolean;
|
|
34
|
-
onStartLoader: () => void;
|
|
35
|
-
onStopLoader: () => void;
|
|
36
|
-
onErrorToast: (messageError: string) => void;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export default function MessageItem({
|
|
40
|
-
message,
|
|
41
|
-
userId,
|
|
42
|
-
enableForwarding,
|
|
43
|
-
enableReplying,
|
|
44
|
-
onReply,
|
|
45
|
-
onForward,
|
|
46
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
47
|
-
listRef,
|
|
48
|
-
messagesToView,
|
|
49
|
-
loading,
|
|
50
|
-
AITranslateWidget,
|
|
51
|
-
AIAssistWidget,
|
|
52
|
-
maxTokens,
|
|
53
|
-
defaultTranslationLanguage,
|
|
54
|
-
languagesForAITranslate,
|
|
55
|
-
onStartLoader,
|
|
56
|
-
onStopLoader,
|
|
57
|
-
onErrorToast,
|
|
58
|
-
}: // defaultGetSenderName,
|
|
59
|
-
// languagesForAITranslate,
|
|
60
|
-
MessageItemProps) {
|
|
61
|
-
const [waitAITranslateWidget, setWaitAITranslateWidget] =
|
|
62
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
63
|
-
useState<boolean>(loading);
|
|
64
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
65
|
-
const [widgetTextContent, setWidgetTextContent] = useState<string>('');
|
|
66
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
67
|
-
const [originalTextMessage, setOriginalTextMessage] = useState<boolean>(true);
|
|
68
|
-
const senderName =
|
|
69
|
-
message.sender?.full_name ||
|
|
70
|
-
message.sender?.login ||
|
|
71
|
-
message.sender?.email ||
|
|
72
|
-
// currentUserName ||
|
|
73
|
-
'';
|
|
74
|
-
|
|
75
|
-
const TypeSystemMessage = 'system';
|
|
76
|
-
const TypeIncomingMessage = 'incoming';
|
|
77
|
-
const TypeOutgoingMessage = 'outgoing';
|
|
78
|
-
|
|
79
|
-
const subTypeMessage = message.qb_message_action?.includes('forward')
|
|
80
|
-
? 'forward'
|
|
81
|
-
: 'reply';
|
|
82
|
-
|
|
83
|
-
async function sendMessageToTranslate(
|
|
84
|
-
messageToTranslatr: MessageEntity,
|
|
85
|
-
messagesToViewTranslate: MessageEntity[],
|
|
86
|
-
currentUserId?: number,
|
|
87
|
-
AITranslation?: AIMessageWidget,
|
|
88
|
-
selectedLanguage?: string,
|
|
89
|
-
) {
|
|
90
|
-
if (!waitAITranslateWidget) {
|
|
91
|
-
setWaitAITranslateWidget(true);
|
|
92
|
-
await AITranslation?.textToWidget(
|
|
93
|
-
messageToTranslatr.message,
|
|
94
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-unsafe-call
|
|
95
|
-
AIUtils.messageEntitiesToIChatMessageCollection(
|
|
96
|
-
messagesToViewTranslate,
|
|
97
|
-
currentUserId,
|
|
98
|
-
maxTokens,
|
|
99
|
-
),
|
|
100
|
-
{
|
|
101
|
-
language: selectedLanguage,
|
|
102
|
-
},
|
|
103
|
-
)
|
|
104
|
-
.then((textTranslate) => {
|
|
105
|
-
// eslint-disable-next-line promise/always-return
|
|
106
|
-
setWidgetTextContent(textTranslate || '');
|
|
107
|
-
// eslint-disable-next-line promise/always-return
|
|
108
|
-
if (textTranslate === 'Translation failed.') {
|
|
109
|
-
onErrorToast('Translation failed.');
|
|
110
|
-
}
|
|
111
|
-
setWaitAITranslateWidget(false);
|
|
112
|
-
setOriginalTextMessage(false);
|
|
113
|
-
})
|
|
114
|
-
.catch(() => {
|
|
115
|
-
onErrorToast('Translation failed.');
|
|
116
|
-
setWaitAITranslateWidget(false);
|
|
117
|
-
setOriginalTextMessage(true);
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function sendMessageToAIAssistAnswer(
|
|
123
|
-
messageToAssist: MessageEntity,
|
|
124
|
-
messagesToViewAssist: MessageEntity[],
|
|
125
|
-
currentUserId?: number,
|
|
126
|
-
AIAnswerToMessage?: AIMessageWidget,
|
|
127
|
-
) {
|
|
128
|
-
if (!loading) {
|
|
129
|
-
// setWaitAIWidget(true);
|
|
130
|
-
onStartLoader();
|
|
131
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
132
|
-
AIAnswerToMessage?.textToWidget(
|
|
133
|
-
messageToAssist.message,
|
|
134
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-unsafe-call
|
|
135
|
-
AIUtils.messageEntitiesToIChatMessageCollection(
|
|
136
|
-
messagesToViewAssist,
|
|
137
|
-
currentUserId,
|
|
138
|
-
maxTokens,
|
|
139
|
-
),
|
|
140
|
-
)
|
|
141
|
-
// eslint-disable-next-line promise/always-return
|
|
142
|
-
.then(() => {
|
|
143
|
-
// setWaitAITranslateWidget(false);
|
|
144
|
-
onStopLoader();
|
|
145
|
-
})
|
|
146
|
-
.catch(() => {
|
|
147
|
-
onErrorToast('Assist failed.');
|
|
148
|
-
// setWaitAITranslateWidget(false);
|
|
149
|
-
onStopLoader();
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
const checkMessageType = (m: MessageEntity): string => {
|
|
155
|
-
if (m.notification_type && m.notification_type.length > 0) {
|
|
156
|
-
return TypeSystemMessage;
|
|
157
|
-
}
|
|
158
|
-
if (
|
|
159
|
-
(m.sender && m.sender.id.toString() !== userId?.toString()) ||
|
|
160
|
-
m.sender_id.toString() !== userId?.toString()
|
|
161
|
-
) {
|
|
162
|
-
return TypeIncomingMessage;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
return TypeOutgoingMessage;
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
function renderAITranslate(item: MessageEntity) {
|
|
169
|
-
return (
|
|
170
|
-
<AITranslate
|
|
171
|
-
waitAIWidget={loading}
|
|
172
|
-
onTranslate={() => {
|
|
173
|
-
sendMessageToTranslate(
|
|
174
|
-
item,
|
|
175
|
-
messagesToView,
|
|
176
|
-
userId,
|
|
177
|
-
AITranslateWidget,
|
|
178
|
-
defaultTranslationLanguage,
|
|
179
|
-
);
|
|
180
|
-
}}
|
|
181
|
-
defaultLanguageForAITranslate={defaultTranslationLanguage!}
|
|
182
|
-
languagesForAITranslate={languagesForAITranslate}
|
|
183
|
-
onClickOriginalText={() => {
|
|
184
|
-
setOriginalTextMessage(true);
|
|
185
|
-
setWidgetTextContent('');
|
|
186
|
-
}}
|
|
187
|
-
originalTextMessage={originalTextMessage}
|
|
188
|
-
/>
|
|
189
|
-
);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
function renderAIAssist(item: MessageEntity) {
|
|
193
|
-
return (
|
|
194
|
-
<AIAssist
|
|
195
|
-
onAssistAnswer={() => {
|
|
196
|
-
sendMessageToAIAssistAnswer(
|
|
197
|
-
item,
|
|
198
|
-
messagesToView,
|
|
199
|
-
userId,
|
|
200
|
-
AIAssistWidget,
|
|
201
|
-
);
|
|
202
|
-
}}
|
|
203
|
-
waitAIWidget={loading}
|
|
204
|
-
/>
|
|
205
|
-
);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
function renderAdditionalPart(
|
|
209
|
-
currentMessageType: 'incoming' | 'outgoing',
|
|
210
|
-
item: MessageEntity,
|
|
211
|
-
) {
|
|
212
|
-
return loading && currentMessageType === 'incoming' ? (
|
|
213
|
-
<Loader size="sm" className="message-item-additional-part__loader" />
|
|
214
|
-
) : (
|
|
215
|
-
<div className="message-item-additional-part__actions">
|
|
216
|
-
<MessageContextMenu
|
|
217
|
-
message={message}
|
|
218
|
-
onReply={onReply}
|
|
219
|
-
onForward={onForward}
|
|
220
|
-
enableReplying={enableReplying}
|
|
221
|
-
enableForwarding={enableForwarding}
|
|
222
|
-
/>
|
|
223
|
-
{currentMessageType === 'incoming' &&
|
|
224
|
-
!(item.attachments && item.attachments.length > 0) &&
|
|
225
|
-
renderAIAssist(item)}
|
|
226
|
-
</div>
|
|
227
|
-
);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
function renderForwardedReplyMessageSegment(
|
|
231
|
-
currentMessageType: 'incoming' | 'outgoing',
|
|
232
|
-
) {
|
|
233
|
-
return message.qb_original_messages &&
|
|
234
|
-
message.qb_original_messages?.length > 0 ? (
|
|
235
|
-
<div>
|
|
236
|
-
{message.qb_original_messages.map((item) => {
|
|
237
|
-
return (
|
|
238
|
-
<Message
|
|
239
|
-
userName={senderName}
|
|
240
|
-
time={getTimeShort24hFormat(message.date_sent)}
|
|
241
|
-
type={currentMessageType}
|
|
242
|
-
subtype={subTypeMessage}
|
|
243
|
-
enableSelect={false}
|
|
244
|
-
isSelect={false}
|
|
245
|
-
disabled={false}
|
|
246
|
-
bottomPart={
|
|
247
|
-
!(item.attachments && item.attachments.length > 0)
|
|
248
|
-
? renderAITranslate(item)
|
|
249
|
-
: undefined
|
|
250
|
-
}
|
|
251
|
-
additionalPart={
|
|
252
|
-
<div className="message-item-additional-part">
|
|
253
|
-
{renderAdditionalPart(currentMessageType, item)}
|
|
254
|
-
</div>
|
|
255
|
-
}
|
|
256
|
-
>
|
|
257
|
-
{item.attachments && item.attachments.length > 0 ? (
|
|
258
|
-
<div>
|
|
259
|
-
{/* eslint-disable-next-line @typescript-eslint/no-shadow */}
|
|
260
|
-
{item.attachments.map((attachment) => {
|
|
261
|
-
return (
|
|
262
|
-
<AttachmentBubble
|
|
263
|
-
attachment={attachment}
|
|
264
|
-
typeMessage={currentMessageType}
|
|
265
|
-
/>
|
|
266
|
-
);
|
|
267
|
-
})}
|
|
268
|
-
</div>
|
|
269
|
-
) : (
|
|
270
|
-
<TextBubble
|
|
271
|
-
text={originalTextMessage ? item.message : widgetTextContent}
|
|
272
|
-
type={currentMessageType}
|
|
273
|
-
/>
|
|
274
|
-
)}
|
|
275
|
-
</Message>
|
|
276
|
-
);
|
|
277
|
-
})}
|
|
278
|
-
</div>
|
|
279
|
-
) : null;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
const messageTypes: string = checkMessageType(message);
|
|
283
|
-
|
|
284
|
-
if (messageTypes === TypeSystemMessage) {
|
|
285
|
-
return <MessageSeparator text={message.message} type="system" />;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
return messageTypes === TypeIncomingMessage ||
|
|
289
|
-
messageTypes === TypeOutgoingMessage ? (
|
|
290
|
-
<div>
|
|
291
|
-
{renderForwardedReplyMessageSegment(messageTypes)}
|
|
292
|
-
{!message.message.includes(MessageDTOMapper.FORWARD_MESSAGE_PREFIX) && (
|
|
293
|
-
<Message
|
|
294
|
-
userName={senderName}
|
|
295
|
-
time={getTimeShort24hFormat(message.date_sent)}
|
|
296
|
-
type={messageTypes}
|
|
297
|
-
enableSelect={false}
|
|
298
|
-
isSelect={false}
|
|
299
|
-
disabled={false}
|
|
300
|
-
bottomPart={
|
|
301
|
-
!(message.attachments && message.attachments.length > 0)
|
|
302
|
-
? renderAITranslate(message)
|
|
303
|
-
: undefined
|
|
304
|
-
}
|
|
305
|
-
additionalPart={
|
|
306
|
-
<div className="message-item-additional-part">
|
|
307
|
-
{renderAdditionalPart(messageTypes, message)}
|
|
308
|
-
</div>
|
|
309
|
-
}
|
|
310
|
-
>
|
|
311
|
-
{message.attachments && message.attachments.length > 0 ? (
|
|
312
|
-
<div>
|
|
313
|
-
{message.attachments.map((attachment) => {
|
|
314
|
-
return (
|
|
315
|
-
<AttachmentBubble
|
|
316
|
-
attachment={attachment}
|
|
317
|
-
typeMessage={messageTypes}
|
|
318
|
-
/>
|
|
319
|
-
);
|
|
320
|
-
})}
|
|
321
|
-
</div>
|
|
322
|
-
) : (
|
|
323
|
-
<TextBubble
|
|
324
|
-
text={originalTextMessage ? message.message : widgetTextContent}
|
|
325
|
-
type={messageTypes}
|
|
326
|
-
/>
|
|
327
|
-
)}
|
|
328
|
-
</Message>
|
|
329
|
-
)}
|
|
330
|
-
</div>
|
|
331
|
-
) : null;
|
|
332
|
-
}
|
|
File without changes
|
/package/src/Presentation/{ui-components/Message → Views/Dialog/AIComponents}/AIAssist/AIAssist.scss
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|