isometrik-plugin-chat-sdk 1.0.0
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/LICENSE +21 -0
- package/dist/cjs/BlockChatList-720a703e.js +423 -0
- package/dist/cjs/BlockChatList-720a703e.js.map +1 -0
- package/dist/cjs/DocumentMessageBubble-c79bfbe5.js +493 -0
- package/dist/cjs/DocumentMessageBubble-c79bfbe5.js.map +1 -0
- package/dist/cjs/Image-67c52acd.js +135 -0
- package/dist/cjs/Image-67c52acd.js.map +1 -0
- package/dist/cjs/ImageMessageBubble-1218fb66.js +675 -0
- package/dist/cjs/ImageMessageBubble-1218fb66.js.map +1 -0
- package/dist/cjs/IsometrikLogo-976b1c34.js +44 -0
- package/dist/cjs/IsometrikLogo-976b1c34.js.map +1 -0
- package/dist/cjs/MessageSearch-5fc9dc00.js +5892 -0
- package/dist/cjs/MessageSearch-5fc9dc00.js.map +1 -0
- package/dist/cjs/ReactionsContainer-a6ce9059.js +375 -0
- package/dist/cjs/ReactionsContainer-a6ce9059.js.map +1 -0
- package/dist/cjs/Text-fedf6eab.js +60 -0
- package/dist/cjs/Text-fedf6eab.js.map +1 -0
- package/dist/cjs/VideoMessageBubble-c4694a78.js +571 -0
- package/dist/cjs/VideoMessageBubble-c4694a78.js.map +1 -0
- package/dist/cjs/WebChat-403e7ab1.js +2884 -0
- package/dist/cjs/WebChat-403e7ab1.js.map +1 -0
- package/dist/cjs/app-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/audio-bubble_8.cjs.entry.js +21011 -0
- package/dist/cjs/audio-bubble_8.cjs.entry.js.map +1 -0
- package/dist/cjs/block-chat-list.cjs.entry.js +16 -0
- package/dist/cjs/block-chat-list.cjs.entry.js.map +1 -0
- package/dist/cjs/chat-app.cjs.entry.js +55 -0
- package/dist/cjs/chat-app.cjs.entry.js.map +1 -0
- package/dist/cjs/chat-assets-6ab1faa6.js +9 -0
- package/dist/cjs/chat-assets-6ab1faa6.js.map +1 -0
- package/dist/cjs/chat-creds-f4cbf400.js +38 -0
- package/dist/cjs/chat-creds-f4cbf400.js.map +1 -0
- package/dist/cjs/chat-document-message-bubble.cjs.entry.js +24 -0
- package/dist/cjs/chat-document-message-bubble.cjs.entry.js.map +1 -0
- package/dist/cjs/chat-image-message-bubble.cjs.entry.js +26 -0
- package/dist/cjs/chat-image-message-bubble.cjs.entry.js.map +1 -0
- package/dist/cjs/chat-video-message-bubble.cjs.entry.js +24 -0
- package/dist/cjs/chat-video-message-bubble.cjs.entry.js.map +1 -0
- package/dist/cjs/content-eca5336c.js +81 -0
- package/dist/cjs/content-eca5336c.js.map +1 -0
- package/dist/cjs/dialog-drawer-9d04911c.js +5313 -0
- package/dist/cjs/dialog-drawer-9d04911c.js.map +1 -0
- package/dist/cjs/forward-memebers.cjs.entry.js +128 -0
- package/dist/cjs/forward-memebers.cjs.entry.js.map +1 -0
- package/dist/cjs/group-members-a60fb1cb.js +41 -0
- package/dist/cjs/group-members-a60fb1cb.js.map +1 -0
- package/dist/cjs/groupcast-49dae5ab.js +202 -0
- package/dist/cjs/groupcast-49dae5ab.js.map +1 -0
- package/dist/cjs/imagePlaceholder-030cc566.js +4365 -0
- package/dist/cjs/imagePlaceholder-030cc566.js.map +1 -0
- package/dist/cjs/index-9afe62b6.js +3129 -0
- package/dist/cjs/index-9afe62b6.js.map +1 -0
- package/dist/cjs/index.cjs.js +148 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/isometrik-webchat.cjs.js +54 -0
- package/dist/cjs/isometrik-webchat.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +17 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/login-page.cjs.entry.js +85 -0
- package/dist/cjs/login-page.cjs.entry.js.map +1 -0
- package/dist/cjs/member-add.cjs.entry.js +122 -0
- package/dist/cjs/member-add.cjs.entry.js.map +1 -0
- package/dist/cjs/message-reaction-976f6261.js +24 -0
- package/dist/cjs/message-reaction-976f6261.js.map +1 -0
- package/dist/cjs/my-component.cjs.entry.js +29 -0
- package/dist/cjs/my-component.cjs.entry.js.map +1 -0
- package/dist/cjs/reaction-container.cjs.entry.js +52 -0
- package/dist/cjs/reaction-container.cjs.entry.js.map +1 -0
- package/dist/cjs/shadow-css-7c4dbc43.js +336 -0
- package/dist/cjs/shadow-css-7c4dbc43.js.map +1 -0
- package/dist/cjs/signup-page.cjs.entry.js +143 -0
- package/dist/cjs/signup-page.cjs.entry.js.map +1 -0
- package/dist/cjs/taguser-aca04ed9.js +512 -0
- package/dist/cjs/taguser-aca04ed9.js.map +1 -0
- package/dist/cjs/theme-provider_2.cjs.entry.js +113 -0
- package/dist/cjs/theme-provider_2.cjs.entry.js.map +1 -0
- package/dist/cjs/toast-helper-defae4a5.js +84 -0
- package/dist/cjs/toast-helper-defae4a5.js.map +1 -0
- package/dist/cjs/utils-bcad3386.js +9 -0
- package/dist/cjs/utils-bcad3386.js.map +1 -0
- package/dist/collection/api/conversations.js +12 -0
- package/dist/collection/api/group-members.js +36 -0
- package/dist/collection/api/groupcast.js +183 -0
- package/dist/collection/api/membership-control.js +13 -0
- package/dist/collection/api/message-reaction.js +16 -0
- package/dist/collection/api/social-accounts.js +282 -0
- package/dist/collection/app-root.js +51 -0
- package/dist/collection/app-root.js.map +1 -0
- package/dist/collection/assets/images/avatar.svg +1 -0
- package/dist/collection/assets/images/chatdefaultbg.svg +6140 -0
- package/dist/collection/assets/images/equalizer.svg +1 -0
- package/dist/collection/assets/images/imagePlaceholder.svg +2 -0
- package/dist/collection/assets/images/link.svg +1 -0
- package/dist/collection/assets/images/videoPlaceholder.svg +4 -0
- package/dist/collection/assets/images/videoThumbnail.svg +1 -0
- package/dist/collection/assets/svg/ExcelDocument.js +2 -0
- package/dist/collection/assets/svg/IsometrikLogo.js +38 -0
- package/dist/collection/assets/svg/Moon.svg +1 -0
- package/dist/collection/assets/svg/NoChatPlaceholder.js +16 -0
- package/dist/collection/assets/svg/NoContactsPlaceholder.js +9 -0
- package/dist/collection/assets/svg/NoMessagePlaceholder.svg +13 -0
- package/dist/collection/assets/svg/PdfDocument.js +2 -0
- package/dist/collection/assets/svg/ProfilePlaceholder.js +1 -0
- package/dist/collection/assets/svg/SelectChatPlaceholder.js +13 -0
- package/dist/collection/assets/svg/Sun.svg +1 -0
- package/dist/collection/assets/svg/broadcast-selected.svg +4 -0
- package/dist/collection/assets/svg/broadcst-default.svg +4 -0
- package/dist/collection/assets/svg/close.svg +1 -0
- package/dist/collection/assets/svg/group.svg +7 -0
- package/dist/collection/assets/svg/login.svg +3051 -0
- package/dist/collection/assets/svg/message-add.svg +5 -0
- package/dist/collection/assets/svg/message-bold.svg +3 -0
- package/dist/collection/assets/svg/message-outline.svg +5 -0
- package/dist/collection/collection-manifest.json +32 -0
- package/dist/collection/components/ChatUIComponent/AddMember.js +144 -0
- package/dist/collection/components/ChatUIComponent/AddMember.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/AudioBubble.js +528 -0
- package/dist/collection/components/ChatUIComponent/AudioBubble.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/BlockChatList.js +114 -0
- package/dist/collection/components/ChatUIComponent/BlockChatList.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ChatDocumentMessageBubble.js +11 -0
- package/dist/collection/components/ChatUIComponent/ChatDocumentMessageBubble.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ChatImageMessageBubble.js +11 -0
- package/dist/collection/components/ChatUIComponent/ChatImageMessageBubble.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ChatOwnProfile/Profile.js +540 -0
- package/dist/collection/components/ChatUIComponent/ChatOwnProfile/Profile.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ChatOwnProfile/profile-page.css +252 -0
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js +1175 -0
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ChatVideoMessageBubble.js +11 -0
- package/dist/collection/components/ChatUIComponent/ChatVideoMessageBubble.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +790 -0
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ForwardMessageList.js +152 -0
- package/dist/collection/components/ChatUIComponent/ForwardMessageList.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/GroupCast.js +218 -0
- package/dist/collection/components/ChatUIComponent/GroupCast.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js +590 -0
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ReactionContainer.js +103 -0
- package/dist/collection/components/ChatUIComponent/ReactionContainer.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js +1352 -0
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/WebChatBody/web-chat-body.css +277 -0
- package/dist/collection/components/Login.js +118 -0
- package/dist/collection/components/Login.js.map +1 -0
- package/dist/collection/components/Signup.js +177 -0
- package/dist/collection/components/Signup.js.map +1 -0
- package/dist/collection/components/chat-main.js +131 -0
- package/dist/collection/components/chat-main.js.map +1 -0
- package/dist/collection/components/my-component/my-component.css +3 -0
- package/dist/collection/components/my-component/my-component.js +83 -0
- package/dist/collection/components/my-component/my-component.js.map +1 -0
- package/dist/collection/components/my-component/web-chat/WebChat.js +2686 -0
- package/dist/collection/components/my-component/web-chat/WebChat.js.map +1 -0
- package/dist/collection/components/my-component/web-chat/WebchatRightSide.js +675 -0
- package/dist/collection/components/my-component/web-chat/WebchatRightSide.js.map +1 -0
- package/dist/collection/components/my-component/web-chat/web-chat.css +336 -0
- package/dist/collection/components/theme-provider.js +182 -0
- package/dist/collection/components/theme-provider.js.map +1 -0
- package/dist/collection/constants/chat-assets.js +12 -0
- package/dist/collection/constants/chat-creds.js +31 -0
- package/dist/collection/constants/content.js +75 -0
- package/dist/collection/constants/urls.js +1 -0
- package/dist/collection/index.js +135 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/lib/helpers.js +205 -0
- package/dist/collection/lib/taguser.js +123 -0
- package/dist/collection/store/conversation.js +25 -0
- package/dist/collection/store/conversation.js.map +1 -0
- package/dist/collection/store/group-members.js +24 -0
- package/dist/collection/store/group-members.js.map +1 -0
- package/dist/collection/store/unread-count.js +18 -0
- package/dist/collection/store/unread-count.js.map +1 -0
- package/dist/collection/stories/Components/ActionsPopup/ActionsPopup.js +222 -0
- package/dist/collection/stories/Components/ActionsPopup/ActionsPopup.stories.js +148 -0
- package/dist/collection/stories/Components/AttachmentBox/AttachmentBox.js +211 -0
- package/dist/collection/stories/Components/AttachmentBox/AttachmentPreview/AttachmentPreview.js +708 -0
- package/dist/collection/stories/Components/AttachmentBox/AttachmentPreview/AttachmentPreview.stories.js +57 -0
- package/dist/collection/stories/Components/AttachmentBox/Attachmentbox.stories.js +74 -0
- package/dist/collection/stories/Components/AttachmentBox/CameraPreview.js +231 -0
- package/dist/collection/stories/Components/BlockUsers/BlockUsers.js +337 -0
- package/dist/collection/stories/Components/Body/Body.js +48 -0
- package/dist/collection/stories/Components/Body/Body.stories.js +33 -0
- package/dist/collection/stories/Components/Buttons/Buttons.js +65 -0
- package/dist/collection/stories/Components/Buttons/Buttons.stories.js +132 -0
- package/dist/collection/stories/Components/ChatSidebar/ChatSidebar.js +951 -0
- package/dist/collection/stories/Components/ChatSidebar/ChatSidebar.stories.js +75 -0
- package/dist/collection/stories/Components/ChatSidebar/ContextMenu.js +109 -0
- package/dist/collection/stories/Components/ChatTile/ChatTile.js +290 -0
- package/dist/collection/stories/Components/ChatTile/ChatTile.stories.js +180 -0
- package/dist/collection/stories/Components/Chip/Chip.js +111 -0
- package/dist/collection/stories/Components/Chip/Chip.stories.js +149 -0
- package/dist/collection/stories/Components/ContactInfo/ContactInfo.js +1491 -0
- package/dist/collection/stories/Components/ContactInfo/ContactInfo.stories.js +118 -0
- package/dist/collection/stories/Components/ContactInfo/MediaList.js +147 -0
- package/dist/collection/stories/Components/ContactInfo/ProfileInfo.js +1219 -0
- package/dist/collection/stories/Components/ContactTile/ContactTile.js +416 -0
- package/dist/collection/stories/Components/ContactTile/ContactTile.stories.js +60 -0
- package/dist/collection/stories/Components/Dialog-Drawer/confirm.js +113 -0
- package/dist/collection/stories/Components/Dialog-Drawer/deletemessage.js +97 -0
- package/dist/collection/stories/Components/Dialog-Drawer/dialog-drawer.js +264 -0
- package/dist/collection/stories/Components/EmojiReactions/EmojiReactions.js +179 -0
- package/dist/collection/stories/Components/Footer/Footer.js +4 -0
- package/dist/collection/stories/Components/Footer/Footer.stories.js +155 -0
- package/dist/collection/stories/Components/ForwardMessage/ForwardMessageContainer.js +433 -0
- package/dist/collection/stories/Components/ForwardMessage/ForwardMessageContainer.stories.js +110 -0
- package/dist/collection/stories/Components/ForwardMessage/ForwardUi.js +46 -0
- package/dist/collection/stories/Components/GroupChatContacts/GroupChatContacts.js +546 -0
- package/dist/collection/stories/Components/GroupChatContacts/GroupChatContacts.stories.js +56 -0
- package/dist/collection/stories/Components/GroupInfo/GroupInfo.js +394 -0
- package/dist/collection/stories/Components/GroupInfo/GroupInfo.stories.js +107 -0
- package/dist/collection/stories/Components/Head/ClosedHeader/ClosedHead.js +129 -0
- package/dist/collection/stories/Components/Head/ClosedHeader/ClosedHead.stories.js +78 -0
- package/dist/collection/stories/Components/Head/Head.js +672 -0
- package/dist/collection/stories/Components/Head/Head.stories.js +91 -0
- package/dist/collection/stories/Components/Icon/Icon.js +115 -0
- package/dist/collection/stories/Components/Image/Image.js +41 -0
- package/dist/collection/stories/Components/Image/Image.stories.js +49 -0
- package/dist/collection/stories/Components/Image/Img.stories.js +178 -0
- package/dist/collection/stories/Components/Inputbox/Input.js +206 -0
- package/dist/collection/stories/Components/Inputbox/Input.stories.js +87 -0
- package/dist/collection/stories/Components/InstagramAccounts/InstagramAccountsPanel.js +605 -0
- package/dist/collection/stories/Components/Loader/Spinner/Spinner.js +60 -0
- package/dist/collection/stories/Components/Loader/Spinner/Spinner.stories.js +38 -0
- package/dist/collection/stories/Components/MainPlaceHolder/MainChatPlaceHolder.js +78 -0
- package/dist/collection/stories/Components/MainPlaceHolder/MainPlaceHolder.stories.js +130 -0
- package/dist/collection/stories/Components/MediaGallery/MediaGallery.js +868 -0
- package/dist/collection/stories/Components/MediaGallery/MediaGallery.stories.js +81 -0
- package/dist/collection/stories/Components/MembersList/MembersList.js +348 -0
- package/dist/collection/stories/Components/MessageBubble/AudioMessageBubble/AudioMesaageBubble.js +533 -0
- package/dist/collection/stories/Components/MessageBubble/DocumentMessageBubble/DocumentMessageBubble.js +484 -0
- package/dist/collection/stories/Components/MessageBubble/DocumentMessageBubble/DocumentMessageBubble.stories.js +54 -0
- package/dist/collection/stories/Components/MessageBubble/ImageMessageBubble/ImageMessageBubble.js +683 -0
- package/dist/collection/stories/Components/MessageBubble/ImageMessageBubble/ImageMessageBubble.stories.js +49 -0
- package/dist/collection/stories/Components/MessageBubble/IncomingTextMessageBubble/IncomingTextMessageBubble.js +450 -0
- package/dist/collection/stories/Components/MessageBubble/IncomingTextMessageBubble/IncomingTextMessageBubble.stories.js +56 -0
- package/dist/collection/stories/Components/MessageBubble/LinkMessageBubble/LinkMessageBubble.js +721 -0
- package/dist/collection/stories/Components/MessageBubble/OutgoingTextMessageBubble/OutgoingTextMessageBubble.js +139 -0
- package/dist/collection/stories/Components/MessageBubble/OutgoingTextMessageBubble/OutgoingTextMessageBubble.stories.js +63 -0
- package/dist/collection/stories/Components/MessageBubble/VideoMessageBubble/VideoMessageBubble.js +576 -0
- package/dist/collection/stories/Components/MessageBubble/VideoMessageBubble/VideoMessageBubble.stories.js +50 -0
- package/dist/collection/stories/Components/MessageDatePill/MessageDatePill.js +66 -0
- package/dist/collection/stories/Components/MessageDatePill/MessageDatePill.stories.js +48 -0
- package/dist/collection/stories/Components/MessageInfo/MessageInfo.js +465 -0
- package/dist/collection/stories/Components/MessageInfo/MessageInfo.stories.js +111 -0
- package/dist/collection/stories/Components/MessageSearch/MessageSearch.js +242 -0
- package/dist/collection/stories/Components/MessageSearchBar/SearchBar.js +523 -0
- package/dist/collection/stories/Components/MessageSearchBar/SearchBar.stories.js +98 -0
- package/dist/collection/stories/Components/MessageUnreadCount/MessageUnreadCount.js +51 -0
- package/dist/collection/stories/Components/MessageUnreadCount/MessageUnreadCount.stories.js +79 -0
- package/dist/collection/stories/Components/NewChatSidebar/NewChatSidebar.js +560 -0
- package/dist/collection/stories/Components/NewChatSidebar/NewChatSidebar.stories.js +56 -0
- package/dist/collection/stories/Components/Placeholder/NoContactsPlaceholder.js +57 -0
- package/dist/collection/stories/Components/Popup/ConfirmationPopup/DeleteConfirmationPopup/DeletePopup.js +114 -0
- package/dist/collection/stories/Components/ProfileSidebar/ProfileSidebar.js +166 -0
- package/dist/collection/stories/Components/ProfileSidebar/ProfileSidebar.stories.js +125 -0
- package/dist/collection/stories/Components/ProfileTab/ProfileTab.js +939 -0
- package/dist/collection/stories/Components/ProfileTab/ProfileTab.stories.js +144 -0
- package/dist/collection/stories/Components/ReactionsContainer/ReactionsContainer.js +166 -0
- package/dist/collection/stories/Components/ReactionsContainer/ReactionsContainer.stories.js +115 -0
- package/dist/collection/stories/Components/ReactionsContainer/ReactionsInfoCard/ReactionsInfoCard.js +98 -0
- package/dist/collection/stories/Components/ReactionsContainer/ReactionsInfoCard/ReactionsInfoCard.stories.js +55 -0
- package/dist/collection/stories/Components/ReadMark/BlueReadMark/BlueReadMark.js +27 -0
- package/dist/collection/stories/Components/ReadMark/BlueReadMark/BlueReadMark.stories.js +28 -0
- package/dist/collection/stories/Components/ReadMark/ClockMark/ClockMark.js +26 -0
- package/dist/collection/stories/Components/ReadMark/ClockMark/ClockMark.stories.js +33 -0
- package/dist/collection/stories/Components/ReadMark/DoubleMark/DoubleMark.js +27 -0
- package/dist/collection/stories/Components/ReadMark/DoubleMark/DoubleMark.stories.js +28 -0
- package/dist/collection/stories/Components/ReadMark/SingleMark/SingleMark.js +38 -0
- package/dist/collection/stories/Components/ReadMark/SingleMark/SingleMark.stories.js +33 -0
- package/dist/collection/stories/Components/ReplyBlock/MediaIcons.js +16 -0
- package/dist/collection/stories/Components/ReplyBlock/ReplyBlock.js +196 -0
- package/dist/collection/stories/Components/ReplyBlock/ReplyBlock.stories.js +57 -0
- package/dist/collection/stories/Components/ReplyMessageContainer/ReplyMessageContainer.js +645 -0
- package/dist/collection/stories/Components/ReplyMessageContainer/ReplyMessageContainer.stories.js +58 -0
- package/dist/collection/stories/Components/SearchableList/SearchableList.js +393 -0
- package/dist/collection/stories/Components/SearchableList/SearchableList.stories.js +65 -0
- package/dist/collection/stories/Components/SharePopup/SharePopup.js +152 -0
- package/dist/collection/stories/Components/SharePopup/SharePopup.stories.js +47 -0
- package/dist/collection/stories/Components/Splitscreen/Splitscreen.js +157 -0
- package/dist/collection/stories/Components/Splitscreen/Splitscreen.stories.js +100 -0
- package/dist/collection/stories/Components/TestFooter/MentionUserList.js +194 -0
- package/dist/collection/stories/Components/TestFooter/TestFooter.js +1339 -0
- package/dist/collection/stories/Components/TestFooter/TestFooter.stories.js +89 -0
- package/dist/collection/stories/Components/Text/Text.js +57 -0
- package/dist/collection/stories/Components/Text/Text.stories.js +83 -0
- package/dist/collection/stories/Components/TextStyle/TextStyle.js +38 -0
- package/dist/collection/stories/Components/TextStyle/TextStyle.stories.js +50 -0
- package/dist/collection/stories/Components/Time/Timestamp.js +50 -0
- package/dist/collection/stories/Components/Time/Timestamp.stories.js +34 -0
- package/dist/collection/stories/Components/Toaster/Toaster.js +94 -0
- package/dist/collection/stories/Components/Toaster/Toaster.stories.js +108 -0
- package/dist/collection/stories/Components/Toaster/toast-helper.js +79 -0
- package/dist/collection/stories/Components/Toaster/toast-helper.js.map +1 -0
- package/dist/collection/stories/Components/final/final.js +86 -0
- package/dist/collection/stories/Components/final/final.stories.js +30 -0
- package/dist/collection/stories/assets/SEARCH ICON.svg +1 -0
- package/dist/collection/types/ConversationDetailsTypes.js +2 -0
- package/dist/collection/types/ConversationDetailsTypes.js.map +1 -0
- package/dist/collection/utils/chatSdk.js +14 -0
- package/dist/collection/utils/getFomattedDate.js +34 -0
- package/dist/collection/utils/getFomattedDate.js.map +1 -0
- package/dist/collection/utils/unixTimeConverter.js +28 -0
- package/dist/collection/utils/utils.js +4 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/esm/BlockChatList-9fc3a42b.js +421 -0
- package/dist/esm/BlockChatList-9fc3a42b.js.map +1 -0
- package/dist/esm/DocumentMessageBubble-b67726f2.js +491 -0
- package/dist/esm/DocumentMessageBubble-b67726f2.js.map +1 -0
- package/dist/esm/Image-bb9efda3.js +121 -0
- package/dist/esm/Image-bb9efda3.js.map +1 -0
- package/dist/esm/ImageMessageBubble-0e473f6e.js +673 -0
- package/dist/esm/ImageMessageBubble-0e473f6e.js.map +1 -0
- package/dist/esm/IsometrikLogo-14db76af.js +42 -0
- package/dist/esm/IsometrikLogo-14db76af.js.map +1 -0
- package/dist/esm/MessageSearch-4101a627.js +5875 -0
- package/dist/esm/MessageSearch-4101a627.js.map +1 -0
- package/dist/esm/ReactionsContainer-bdd74a3c.js +373 -0
- package/dist/esm/ReactionsContainer-bdd74a3c.js.map +1 -0
- package/dist/esm/Text-3b0b3898.js +58 -0
- package/dist/esm/Text-3b0b3898.js.map +1 -0
- package/dist/esm/VideoMessageBubble-88a7a53e.js +569 -0
- package/dist/esm/VideoMessageBubble-88a7a53e.js.map +1 -0
- package/dist/esm/WebChat-5448d615.js +2882 -0
- package/dist/esm/WebChat-5448d615.js.map +1 -0
- package/dist/esm/app-globals-0f993ce5.js +5 -0
- package/dist/esm/app-globals-0f993ce5.js.map +1 -0
- package/dist/esm/audio-bubble_8.entry.js +21001 -0
- package/dist/esm/audio-bubble_8.entry.js.map +1 -0
- package/dist/esm/block-chat-list.entry.js +8 -0
- package/dist/esm/block-chat-list.entry.js.map +1 -0
- package/dist/esm/chat-app.entry.js +51 -0
- package/dist/esm/chat-app.entry.js.map +1 -0
- package/dist/esm/chat-assets-bd8778d5.js +6 -0
- package/dist/esm/chat-assets-bd8778d5.js.map +1 -0
- package/dist/esm/chat-creds-ff086f05.js +35 -0
- package/dist/esm/chat-creds-ff086f05.js.map +1 -0
- package/dist/esm/chat-document-message-bubble.entry.js +20 -0
- package/dist/esm/chat-document-message-bubble.entry.js.map +1 -0
- package/dist/esm/chat-image-message-bubble.entry.js +22 -0
- package/dist/esm/chat-image-message-bubble.entry.js.map +1 -0
- package/dist/esm/chat-video-message-bubble.entry.js +20 -0
- package/dist/esm/chat-video-message-bubble.entry.js.map +1 -0
- package/dist/esm/content-5aea5e39.js +79 -0
- package/dist/esm/content-5aea5e39.js.map +1 -0
- package/dist/esm/dialog-drawer-9fa083b1.js +5304 -0
- package/dist/esm/dialog-drawer-9fa083b1.js.map +1 -0
- package/dist/esm/forward-memebers.entry.js +124 -0
- package/dist/esm/forward-memebers.entry.js.map +1 -0
- package/dist/esm/group-members-bb3c8db7.js +37 -0
- package/dist/esm/group-members-bb3c8db7.js.map +1 -0
- package/dist/esm/groupcast-d1c54a27.js +187 -0
- package/dist/esm/groupcast-d1c54a27.js.map +1 -0
- package/dist/esm/imagePlaceholder-e544f70b.js +4360 -0
- package/dist/esm/imagePlaceholder-e544f70b.js.map +1 -0
- package/dist/esm/index-fddf30b7.js +3093 -0
- package/dist/esm/index-fddf30b7.js.map +1 -0
- package/dist/esm/index.js +139 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/isometrik-webchat.js +49 -0
- package/dist/esm/isometrik-webchat.js.map +1 -0
- package/dist/esm/loader.js +13 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/login-page.entry.js +81 -0
- package/dist/esm/login-page.entry.js.map +1 -0
- package/dist/esm/member-add.entry.js +118 -0
- package/dist/esm/member-add.entry.js.map +1 -0
- package/dist/esm/message-reaction-ad47ea1a.js +20 -0
- package/dist/esm/message-reaction-ad47ea1a.js.map +1 -0
- package/dist/esm/my-component.entry.js +25 -0
- package/dist/esm/my-component.entry.js.map +1 -0
- package/dist/esm/reaction-container.entry.js +48 -0
- package/dist/esm/reaction-container.entry.js.map +1 -0
- package/dist/esm/shadow-css-7ad5caf8.js +334 -0
- package/dist/esm/shadow-css-7ad5caf8.js.map +1 -0
- package/dist/esm/signup-page.entry.js +139 -0
- package/dist/esm/signup-page.entry.js.map +1 -0
- package/dist/esm/taguser-e9032d65.js +510 -0
- package/dist/esm/taguser-e9032d65.js.map +1 -0
- package/dist/esm/theme-provider_2.entry.js +108 -0
- package/dist/esm/theme-provider_2.entry.js.map +1 -0
- package/dist/esm/toast-helper-840fd8dc.js +82 -0
- package/dist/esm/toast-helper-840fd8dc.js.map +1 -0
- package/dist/esm/utils-11fcde98.js +7 -0
- package/dist/esm/utils-11fcde98.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/isometrik-webchat/index.esm.js +2 -0
- package/dist/isometrik-webchat/index.esm.js.map +1 -0
- package/dist/isometrik-webchat/isometrik-webchat.css +2 -0
- package/dist/isometrik-webchat/isometrik-webchat.esm.js +2 -0
- package/dist/isometrik-webchat/isometrik-webchat.esm.js.map +1 -0
- package/dist/isometrik-webchat/p-12774661.js +2 -0
- package/dist/isometrik-webchat/p-12774661.js.map +1 -0
- package/dist/isometrik-webchat/p-12e56271.js +549 -0
- package/dist/isometrik-webchat/p-12e56271.js.map +1 -0
- package/dist/isometrik-webchat/p-1415e589.js +2 -0
- package/dist/isometrik-webchat/p-1415e589.js.map +1 -0
- package/dist/isometrik-webchat/p-18f8d210.js +13 -0
- package/dist/isometrik-webchat/p-18f8d210.js.map +1 -0
- package/dist/isometrik-webchat/p-1b2461f4.js +357 -0
- package/dist/isometrik-webchat/p-1b2461f4.js.map +1 -0
- package/dist/isometrik-webchat/p-229095d4.js +2 -0
- package/dist/isometrik-webchat/p-229095d4.js.map +1 -0
- package/dist/isometrik-webchat/p-2953d06a.entry.js +2 -0
- package/dist/isometrik-webchat/p-2953d06a.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-3004a123.js +2 -0
- package/dist/isometrik-webchat/p-3004a123.js.map +1 -0
- package/dist/isometrik-webchat/p-3044698a.js +2 -0
- package/dist/isometrik-webchat/p-3044698a.js.map +1 -0
- package/dist/isometrik-webchat/p-40517d7f.js +1098 -0
- package/dist/isometrik-webchat/p-40517d7f.js.map +1 -0
- package/dist/isometrik-webchat/p-42a62cf2.js +2 -0
- package/dist/isometrik-webchat/p-42a62cf2.js.map +1 -0
- package/dist/isometrik-webchat/p-48e1d174.js +45 -0
- package/dist/isometrik-webchat/p-48e1d174.js.map +1 -0
- package/dist/isometrik-webchat/p-48e243ec.entry.js +2 -0
- package/dist/isometrik-webchat/p-48e243ec.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-4d2aca06.js +257 -0
- package/dist/isometrik-webchat/p-4d2aca06.js.map +1 -0
- package/dist/isometrik-webchat/p-610bfd8a.js +2 -0
- package/dist/isometrik-webchat/p-610bfd8a.js.map +1 -0
- package/dist/isometrik-webchat/p-674e4bb0.js +9 -0
- package/dist/isometrik-webchat/p-674e4bb0.js.map +1 -0
- package/dist/isometrik-webchat/p-8490e13d.js +192 -0
- package/dist/isometrik-webchat/p-8490e13d.js.map +1 -0
- package/dist/isometrik-webchat/p-858b0da8.entry.js +2 -0
- package/dist/isometrik-webchat/p-858b0da8.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-89108249.entry.js +5010 -0
- package/dist/isometrik-webchat/p-89108249.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-8dcdea59.js +2963 -0
- package/dist/isometrik-webchat/p-8dcdea59.js.map +1 -0
- package/dist/isometrik-webchat/p-92d0b21c.js +2 -0
- package/dist/isometrik-webchat/p-92d0b21c.js.map +1 -0
- package/dist/isometrik-webchat/p-ada9c8e8.entry.js +2 -0
- package/dist/isometrik-webchat/p-ada9c8e8.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-adbb398d.entry.js +2 -0
- package/dist/isometrik-webchat/p-adbb398d.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-b07dd267.js +2 -0
- package/dist/isometrik-webchat/p-b07dd267.js.map +1 -0
- package/dist/isometrik-webchat/p-bf0aeb22.entry.js +2 -0
- package/dist/isometrik-webchat/p-bf0aeb22.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-bfd51dd4.entry.js +2 -0
- package/dist/isometrik-webchat/p-bfd51dd4.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-c50aa410.entry.js +2 -0
- package/dist/isometrik-webchat/p-c50aa410.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-cd34448c.entry.js +2 -0
- package/dist/isometrik-webchat/p-cd34448c.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-d4b8ece6.entry.js +2 -0
- package/dist/isometrik-webchat/p-d4b8ece6.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-de8a8642.js +197 -0
- package/dist/isometrik-webchat/p-de8a8642.js.map +1 -0
- package/dist/isometrik-webchat/p-e09b32eb.js +591 -0
- package/dist/isometrik-webchat/p-e09b32eb.js.map +1 -0
- package/dist/isometrik-webchat/p-e1255160.js +2 -0
- package/dist/isometrik-webchat/p-e1255160.js.map +1 -0
- package/dist/isometrik-webchat/p-e3731295.js +274 -0
- package/dist/isometrik-webchat/p-e3731295.js.map +1 -0
- package/dist/isometrik-webchat/p-e4efea64.entry.js +2 -0
- package/dist/isometrik-webchat/p-e4efea64.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-ef6e482a.entry.js +2 -0
- package/dist/isometrik-webchat/p-ef6e482a.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-f1f5d5bd.js +3 -0
- package/dist/isometrik-webchat/p-f1f5d5bd.js.map +1 -0
- package/dist/isometrik-webchat/p-ff9f3dfe.js +203 -0
- package/dist/isometrik-webchat/p-ff9f3dfe.js.map +1 -0
- package/dist/loader/cdn.js +1 -0
- package/dist/loader/index.cjs.js +1 -0
- package/dist/loader/index.d.ts +24 -0
- package/dist/loader/index.es2017.js +1 -0
- package/dist/loader/index.js +2 -0
- package/dist/loader/package.json +11 -0
- package/dist/types/app-root.d.ts +0 -0
- package/dist/types/components/ChatUIComponent/AddMember.d.ts +13 -0
- package/dist/types/components/ChatUIComponent/AudioBubble.d.ts +39 -0
- package/dist/types/components/ChatUIComponent/BlockChatList.d.ts +13 -0
- package/dist/types/components/ChatUIComponent/ChatDocumentMessageBubble.d.ts +5 -0
- package/dist/types/components/ChatUIComponent/ChatImageMessageBubble.d.ts +5 -0
- package/dist/types/components/ChatUIComponent/ChatOwnProfile/Profile.d.ts +42 -0
- package/dist/types/components/ChatUIComponent/ChatSidebar/ChatSidebar.d.ts +85 -0
- package/dist/types/components/ChatUIComponent/ChatVideoMessageBubble.d.ts +5 -0
- package/dist/types/components/ChatUIComponent/Footer/ChatFooter.d.ts +154 -0
- package/dist/types/components/ChatUIComponent/ForwardMessageList.d.ts +15 -0
- package/dist/types/components/ChatUIComponent/GroupCast.d.ts +26 -0
- package/dist/types/components/ChatUIComponent/Header/WebChatHeader.d.ts +45 -0
- package/dist/types/components/ChatUIComponent/ReactionContainer.d.ts +12 -0
- package/dist/types/components/ChatUIComponent/WebChatBody/WebChatBody.d.ts +120 -0
- package/dist/types/components/Login.d.ts +13 -0
- package/dist/types/components/Signup.d.ts +17 -0
- package/dist/types/components/chat-main.d.ts +15 -0
- package/dist/types/components/my-component/my-component.d.ts +16 -0
- package/dist/types/components/my-component/web-chat/WebchatRightSide.d.ts +42 -0
- package/dist/types/components/theme-provider.d.ts +44 -0
- package/dist/types/components.d.ts +838 -0
- package/dist/types/index.d.ts +37 -0
- package/dist/types/stencil-public-runtime.d.ts +1678 -0
- package/dist/types/store/conversation.d.ts +17 -0
- package/dist/types/store/group-members.d.ts +18 -0
- package/dist/types/store/unread-count.d.ts +10 -0
- package/dist/types/stories/Components/Toaster/toast-helper.d.ts +8 -0
- package/dist/types/types/ConversationDetailsTypes.d.ts +52 -0
- package/dist/types/utils/getFomattedDate.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +89 -0
- package/readme.md +569 -0
|
@@ -0,0 +1,951 @@
|
|
|
1
|
+
import { css, html, LitElement } from 'lit';
|
|
2
|
+
import '../MessageSearchBar/SearchBar';
|
|
3
|
+
import '../ChatTile/ChatTile';
|
|
4
|
+
import { formatUnixTimestamp } from '../../../utils/unixTimeConverter';
|
|
5
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
6
|
+
import './ContextMenu';
|
|
7
|
+
import { debounce } from '../../../lib/helpers';
|
|
8
|
+
import '../../../stories/Components/Loader/Spinner/Spinner';
|
|
9
|
+
import '../NewChatSidebar/NewChatSidebar';
|
|
10
|
+
|
|
11
|
+
class ChatSidebar extends LitElement {
|
|
12
|
+
static properties = {
|
|
13
|
+
conversationData: { type: Array },
|
|
14
|
+
displayTitle: { type: String },
|
|
15
|
+
customTypes: { type: Array },
|
|
16
|
+
onChatTileSelected: { type: Function },
|
|
17
|
+
unreadMessageCount: { type: String },
|
|
18
|
+
tileCount: { type: Number },
|
|
19
|
+
imageHeight: { type: String },
|
|
20
|
+
imageWidth: { type: String },
|
|
21
|
+
imageRadius: { type: String },
|
|
22
|
+
userNameColor: { type: String },
|
|
23
|
+
userNameFontFamily: { type: String },
|
|
24
|
+
userNameFontWeight: { type: String },
|
|
25
|
+
usernameFontSize: { type: String },
|
|
26
|
+
usernameFontStyle: { type: String },
|
|
27
|
+
chatPreviewColor: { type: String },
|
|
28
|
+
chatPreviewFontFamily: { type: String },
|
|
29
|
+
chatPreviewFontWeight: { type: String },
|
|
30
|
+
chatPreviewFontSize: { type: String },
|
|
31
|
+
chatPreviewFontStyle: { type: String },
|
|
32
|
+
unreadCountColor: { type: String },
|
|
33
|
+
unreadCountFontSize: { type: String },
|
|
34
|
+
unreadCountBgColor: { type: String },
|
|
35
|
+
unreadCountBorderRadius: { type: String },
|
|
36
|
+
messageDateColor: { type: String },
|
|
37
|
+
messageDateFontFamily: { type: String },
|
|
38
|
+
messageDateFontWeight: { type: String },
|
|
39
|
+
messageDateFontSize: { type: String },
|
|
40
|
+
messageDateFontStyle: { type: String },
|
|
41
|
+
padding: { type: String },
|
|
42
|
+
usernamePadding: { type: String },
|
|
43
|
+
chatPreviewPadding: { type: String },
|
|
44
|
+
messageDatePadding: { type: String },
|
|
45
|
+
bgColor: { type: String },
|
|
46
|
+
borderWidth: { type: String },
|
|
47
|
+
borderColor: { type: String },
|
|
48
|
+
borderStyle: { type: String },
|
|
49
|
+
height: { type: String },
|
|
50
|
+
width: { type: String },
|
|
51
|
+
searchQuery: { type: String },
|
|
52
|
+
isChatFilter: { type: Boolean },
|
|
53
|
+
selectedCustomType: { type: String },
|
|
54
|
+
isAllChats: { type: Boolean },
|
|
55
|
+
nonBlockedContacts: { type: Array },
|
|
56
|
+
filterTabsContainer: { type: Object },
|
|
57
|
+
filterTab: { type: Object },
|
|
58
|
+
filterTabHover: { type: Object },
|
|
59
|
+
filterTabActive: { type: Object },
|
|
60
|
+
isSidebarHeaderSearch: { type: Boolean },
|
|
61
|
+
isSidebarHeaderLabel: { type: Boolean },
|
|
62
|
+
sidebarHeaderLabel: { type: String },
|
|
63
|
+
sidebarColor: { type: String },
|
|
64
|
+
sidebarSelectedColor: { type: String },
|
|
65
|
+
contextMenuX: { type: Number },
|
|
66
|
+
contextMenuY: { type: Number },
|
|
67
|
+
isContextMenuOpen: { type: Boolean },
|
|
68
|
+
isMqttConnected: { type: Boolean },
|
|
69
|
+
selectedTileForMenu: { type: Object },
|
|
70
|
+
|
|
71
|
+
isConfirmationDialogOpen: { type: Boolean },
|
|
72
|
+
confirmationMessage: { type: String },
|
|
73
|
+
confirmationOnConfirm: { type: Function },
|
|
74
|
+
isNoContactsFound: { type: Boolean },
|
|
75
|
+
exitedGroups: { type: Array },
|
|
76
|
+
selectedConversationFromURL: { type: String },
|
|
77
|
+
selectedTileId: { type: String },
|
|
78
|
+
handleSearchData: { type: Function },
|
|
79
|
+
typingConversationId: { type: String },
|
|
80
|
+
isConversationLoading: { type: Boolean },
|
|
81
|
+
isTyping: { type: Boolean },
|
|
82
|
+
typingUserName: { type: String },
|
|
83
|
+
allMessages: { type: Array },
|
|
84
|
+
userMetaData: { type: Object },
|
|
85
|
+
isLoading: { type: Boolean },
|
|
86
|
+
isGroupCreationLoading: { type: Boolean },
|
|
87
|
+
hasMoreConversations: { type: Boolean },
|
|
88
|
+
isPaginationMember: { type: Boolean },
|
|
89
|
+
isLoadingMember: { type: Boolean },
|
|
90
|
+
hasMoreMembers: { type: Boolean },
|
|
91
|
+
renderComponentName: { type: String },
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
static styles = css`
|
|
95
|
+
:host {
|
|
96
|
+
display: block;
|
|
97
|
+
height: 100%;
|
|
98
|
+
width: 100%;
|
|
99
|
+
min-width: 0;
|
|
100
|
+
min-height: 0;
|
|
101
|
+
overflow: hidden;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.chat-sidebar-container {
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
height: 100%;
|
|
108
|
+
min-height: 0;
|
|
109
|
+
box-sizing: border-box;
|
|
110
|
+
padding: 14px 0 10px;
|
|
111
|
+
gap: 10px;
|
|
112
|
+
position: relative;
|
|
113
|
+
font-family: var(--font-sans);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.chat-sidebar-search {
|
|
117
|
+
height: auto;
|
|
118
|
+
flex-shrink: 0;
|
|
119
|
+
width: 100%;
|
|
120
|
+
box-sizing: border-box;
|
|
121
|
+
padding: 0 12px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.chat-sidebar-list {
|
|
125
|
+
flex: 1;
|
|
126
|
+
min-height: 0;
|
|
127
|
+
overflow-y: auto;
|
|
128
|
+
overflow-x: hidden;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
chat-tile:hover {
|
|
132
|
+
background-color: transparent;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.chat-sidebar-list::-webkit-scrollbar {
|
|
136
|
+
width: 5px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.chat-sidebar-list::-webkit-scrollbar-track {
|
|
140
|
+
background: transparent;
|
|
141
|
+
}
|
|
142
|
+
.chat-sidebar-list::-webkit-scrollbar-thumb {
|
|
143
|
+
background-color: var(--bg-secondary-color) !important;
|
|
144
|
+
border-radius: 10px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.search-placeholder {
|
|
148
|
+
display: flex;
|
|
149
|
+
align-items: center;
|
|
150
|
+
justify-content: flex-start;
|
|
151
|
+
flex-direction: column;
|
|
152
|
+
gap: 0;
|
|
153
|
+
margin: 20px 12px 12px;
|
|
154
|
+
padding: 28px 16px 24px;
|
|
155
|
+
text-align: center;
|
|
156
|
+
border: 1px dashed var(--border-subtle, #eaeaea);
|
|
157
|
+
border-radius: var(--radius-lg, 16px);
|
|
158
|
+
background: var(--bg-secondary-color, #fafafa);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.search-placeholder .empty-mark {
|
|
162
|
+
position: relative;
|
|
163
|
+
width: 64px;
|
|
164
|
+
height: 46px;
|
|
165
|
+
margin-bottom: 16px;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.search-placeholder .empty-mark span {
|
|
169
|
+
position: absolute;
|
|
170
|
+
width: 40px;
|
|
171
|
+
height: 28px;
|
|
172
|
+
background: var(--primary, #000000);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.search-placeholder .empty-mark span:first-child {
|
|
176
|
+
left: 0;
|
|
177
|
+
top: 0;
|
|
178
|
+
opacity: 0.18;
|
|
179
|
+
border-radius: 14px 14px 4px 14px;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.search-placeholder .empty-mark span:last-child {
|
|
183
|
+
right: 0;
|
|
184
|
+
bottom: 0;
|
|
185
|
+
border-radius: 14px 14px 14px 4px;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.search-placeholder strong {
|
|
189
|
+
font-weight: 600;
|
|
190
|
+
font-size: 15px;
|
|
191
|
+
letter-spacing: -0.03em;
|
|
192
|
+
color: var(--text-primary-color);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.search-placeholder p {
|
|
196
|
+
margin: 6px 0 0;
|
|
197
|
+
font-size: 12.5px;
|
|
198
|
+
font-weight: 400;
|
|
199
|
+
line-height: 1.45;
|
|
200
|
+
color: var(--text-secondary-color);
|
|
201
|
+
max-width: 22ch;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.search-placeholder button {
|
|
205
|
+
margin-top: 14px;
|
|
206
|
+
border: none;
|
|
207
|
+
cursor: pointer;
|
|
208
|
+
font-family: inherit;
|
|
209
|
+
font-size: 12.5px;
|
|
210
|
+
font-weight: 600;
|
|
211
|
+
color: var(--primary-foreground, #ffffff);
|
|
212
|
+
background: var(--primary, #000000);
|
|
213
|
+
border-radius: var(--radius-pill, 999px);
|
|
214
|
+
padding: 8px 14px;
|
|
215
|
+
transition: transform 120ms ease, filter 160ms ease;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.search-placeholder button:hover {
|
|
219
|
+
filter: brightness(1.06);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.search-placeholder button:active {
|
|
223
|
+
transform: scale(0.98);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.confirmation-dialog-overlay {
|
|
227
|
+
position: fixed;
|
|
228
|
+
top: 0;
|
|
229
|
+
left: 0;
|
|
230
|
+
right: 0;
|
|
231
|
+
bottom: 0;
|
|
232
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
233
|
+
display: flex;
|
|
234
|
+
justify-content: center;
|
|
235
|
+
align-items: center;
|
|
236
|
+
z-index: 1000;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.confirmation-dialog {
|
|
240
|
+
background-color: var(--bg-primary-color);
|
|
241
|
+
padding: 20px;
|
|
242
|
+
border-radius: 8px;
|
|
243
|
+
min-width: var(--sidebar-width);
|
|
244
|
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.confirmation-dialog-message {
|
|
248
|
+
color: var(--text-primary-color);
|
|
249
|
+
margin-bottom: 20px;
|
|
250
|
+
text-align: center;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.confirmation-dialog-buttons {
|
|
254
|
+
display: flex;
|
|
255
|
+
justify-content: center;
|
|
256
|
+
gap: 10px;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.confirmation-dialog-button {
|
|
260
|
+
padding: 8px 16px;
|
|
261
|
+
border: none;
|
|
262
|
+
border-radius: 4px;
|
|
263
|
+
cursor: pointer;
|
|
264
|
+
font-size: 14px;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.confirm-button {
|
|
268
|
+
background-color: #dc3545;
|
|
269
|
+
color: white;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.cancel-button {
|
|
273
|
+
background-color: var(--bg-secondary-color);
|
|
274
|
+
color: var(--text-primary-color);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.loading-container {
|
|
278
|
+
width: calc(100% - 35px); //because of padding of chat-sidebar-container + scrollbarwidth
|
|
279
|
+
position: absolute;
|
|
280
|
+
bottom: 0;
|
|
281
|
+
left: 0;
|
|
282
|
+
background-color: var(--bg-primary-color);
|
|
283
|
+
padding: 10px;
|
|
284
|
+
margin-right: 15px;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
@media (max-width: 768px) {
|
|
288
|
+
.loading-container {
|
|
289
|
+
width: 100%;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
`;
|
|
293
|
+
|
|
294
|
+
constructor() {
|
|
295
|
+
super();
|
|
296
|
+
this.conversationData = [];
|
|
297
|
+
this.customTypes = [];
|
|
298
|
+
this.selectedCustomType = null;
|
|
299
|
+
this.isAllChats = false;
|
|
300
|
+
this.tileCount = 20;
|
|
301
|
+
this.imageHeight = '48px';
|
|
302
|
+
this.imageWidth = '48px';
|
|
303
|
+
this.imageRadius = 'var(--radius-sm)';
|
|
304
|
+
this.userNameColor = 'var(--text-primary-color)';
|
|
305
|
+
this.userNameFontFamily = 'var(--font-sans)';
|
|
306
|
+
this.userNameFontWeight = '600';
|
|
307
|
+
this.usernameFontSize = '15px';
|
|
308
|
+
this.usernameFontStyle = 'normal';
|
|
309
|
+
this.chatPreviewColor = 'var(--text-last-seen)';
|
|
310
|
+
this.chatPreviewFontFamily = 'var(--font-sans)';
|
|
311
|
+
this.chatPreviewFontWeight = 'normal';
|
|
312
|
+
this.chatPreviewFontSize = '13px';
|
|
313
|
+
this.chatPreviewFontStyle = 'normal';
|
|
314
|
+
this.unreadCountColor = '#ffffff';
|
|
315
|
+
this.unreadCountFontSize = '10px';
|
|
316
|
+
this.unreadCountBgColor = 'var(--success, #0070f3)';
|
|
317
|
+
this.unreadCountHeight = '18px';
|
|
318
|
+
this.unreadCountWidth = '18px';
|
|
319
|
+
this.unreadCountBorderRadius = '50%';
|
|
320
|
+
this.messageDateColor = 'var(--text-last-seen)';
|
|
321
|
+
this.messageDateFontFamily = 'var(--font-sans)';
|
|
322
|
+
this.messageDateFontWeight = '500';
|
|
323
|
+
this.messageDateFontSize = '11px';
|
|
324
|
+
this.messageDateFontStyle = 'normal';
|
|
325
|
+
this.padding = '14px 14px';
|
|
326
|
+
this.usernamePadding = '1px';
|
|
327
|
+
this.chatPreviewPadding = '1px';
|
|
328
|
+
this.messageDatePadding = '1px';
|
|
329
|
+
this.bgColor = 'var(--bg-primary-color)';
|
|
330
|
+
this.borderWidth = '1px';
|
|
331
|
+
this.borderColor = 'color-mix(in srgb, var(--primary) 16%, transparent)';
|
|
332
|
+
this.borderStyle = 'solid';
|
|
333
|
+
this.height = 'fit-content';
|
|
334
|
+
this.width = 'calc(100% - 24px)';
|
|
335
|
+
this.searchQuery = '';
|
|
336
|
+
this.contextMenuX = 0;
|
|
337
|
+
this.contextMenuY = 0;
|
|
338
|
+
this.isContextMenuOpen = false;
|
|
339
|
+
this.selectedTileForMenu = null;
|
|
340
|
+
this.isConfirmationDialogOpen = false;
|
|
341
|
+
this.confirmationMessage = '';
|
|
342
|
+
this.confirmationOnConfirm = null;
|
|
343
|
+
this.exitedGroups = [];
|
|
344
|
+
this.renderComponentName = 'Sidebar';
|
|
345
|
+
this.selectedConversationFromURL = this.getConversationIdFromURL();
|
|
346
|
+
this.selectedTileId = this.getConversationIdFromURL();
|
|
347
|
+
this.debouncedSearchHandler = debounce(query => {
|
|
348
|
+
this.handleSearchData(query);
|
|
349
|
+
}, 500);
|
|
350
|
+
this.isLoading = false;
|
|
351
|
+
this.isGroupCreationLoading = false;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
firstUpdated() {
|
|
355
|
+
// Called after the component's first render
|
|
356
|
+
this.updateStyles();
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
willUpdate(changedProperties) {
|
|
360
|
+
if (changedProperties.has('filterTabsContainer') || changedProperties.has('filterTab') || changedProperties.has('filterTabHover') || changedProperties.has('filterTabActive')) {
|
|
361
|
+
// Schedule style update after render
|
|
362
|
+
this.updateComplete.then(() => this.updateStyles());
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
if (changedProperties.has('conversationData')) {
|
|
366
|
+
if (this.isLoading && !this.isGroupCreationLoading) {
|
|
367
|
+
setTimeout(() => {
|
|
368
|
+
this.isLoading = false;
|
|
369
|
+
this.requestUpdate();
|
|
370
|
+
}, 300);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
updateStyles() {
|
|
376
|
+
if (!this.shadowRoot) return;
|
|
377
|
+
|
|
378
|
+
const styleElement = document.createElement('style');
|
|
379
|
+
|
|
380
|
+
const css = `
|
|
381
|
+
.chat-filter-tabs {
|
|
382
|
+
${Object.entries(this.filterTabsContainer)
|
|
383
|
+
.map(([key, value]) => `${key}: ${value};`)
|
|
384
|
+
.join('\n')}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.filter-tab {
|
|
388
|
+
${Object.entries(this.filterTab)
|
|
389
|
+
.map(([key, value]) => `${key}: ${value};`)
|
|
390
|
+
.join('\n')}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.filter-tab:hover {
|
|
394
|
+
${Object.entries(this.filterTabHover)
|
|
395
|
+
.map(([key, value]) => `${key}: ${value};`)
|
|
396
|
+
.join('\n')}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.filter-tab.active {
|
|
400
|
+
background-color: var(--text-primary-color) !important;
|
|
401
|
+
color: var(--white) !important;
|
|
402
|
+
${Object.entries(this.filterTabActive)
|
|
403
|
+
.map(([key, value]) => `${key}: ${value};`)
|
|
404
|
+
.join('\n')}
|
|
405
|
+
}
|
|
406
|
+
`;
|
|
407
|
+
|
|
408
|
+
styleElement.textContent = css;
|
|
409
|
+
|
|
410
|
+
const oldStyle = this.shadowRoot.querySelector('style[data-dynamic]');
|
|
411
|
+
if (oldStyle) {
|
|
412
|
+
oldStyle.remove();
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
styleElement.setAttribute('data-dynamic', 'true');
|
|
416
|
+
this.shadowRoot.appendChild(styleElement);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
handleSearchInput(e) {
|
|
420
|
+
this.searchQuery = e.detail.value?.toLowerCase();
|
|
421
|
+
this.debouncedSearchHandler(this.searchQuery);
|
|
422
|
+
this.requestUpdate();
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
handleTabClick(customType) {
|
|
426
|
+
this.selectedCustomType = this.selectedCustomType === customType ? null : customType;
|
|
427
|
+
this.isAllChats = customType === 'all';
|
|
428
|
+
this.requestUpdate();
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
applyHoverStyles(e) {
|
|
432
|
+
Object.assign(e.target.style, this.filterTabHover);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
removeHoverStyles(e) {
|
|
436
|
+
// Reset to the default filterTab styles or active styles if it's active
|
|
437
|
+
const isActive = e.target.classList.contains('active');
|
|
438
|
+
Object.assign(e.target.style, isActive ? this.filterTabActive : this.filterTab);
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
handleRightClick(e, tile) {
|
|
442
|
+
e.preventDefault();
|
|
443
|
+
this.contextMenuX = e.clientX;
|
|
444
|
+
this.contextMenuY = e.clientY;
|
|
445
|
+
this.isContextMenuOpen = true;
|
|
446
|
+
this.selectedTileForMenu = tile;
|
|
447
|
+
this.requestUpdate();
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
handleMenuItemSelected(e) {
|
|
451
|
+
const { action } = e.detail;
|
|
452
|
+
switch (action) {
|
|
453
|
+
case 'delete':
|
|
454
|
+
const isExitedGroup = this.exitedGroups.includes(this.selectedTileForMenu?.conversationId);
|
|
455
|
+
|
|
456
|
+
if (this.selectedTileForMenu?.isGroup && !isExitedGroup) {
|
|
457
|
+
// Handle group exit
|
|
458
|
+
const tileToDelete = this.selectedTileForMenu;
|
|
459
|
+
this.isConfirmationDialogOpen = true;
|
|
460
|
+
this.confirmationMessage = 'Are you sure you want to exit this group?';
|
|
461
|
+
|
|
462
|
+
this.confirmationOnConfirm = () => {
|
|
463
|
+
const conversationId = tileToDelete?.conversationId;
|
|
464
|
+
this.dispatchEvent(
|
|
465
|
+
new CustomEvent('exit-group', {
|
|
466
|
+
detail: {
|
|
467
|
+
conversationId: tileToDelete.conversationId,
|
|
468
|
+
},
|
|
469
|
+
bubbles: true,
|
|
470
|
+
composed: true,
|
|
471
|
+
}),
|
|
472
|
+
);
|
|
473
|
+
// After successful exit, add to exitedGroups
|
|
474
|
+
this.handleGroupExitSuccess(conversationId);
|
|
475
|
+
this.isConfirmationDialogOpen = false;
|
|
476
|
+
this.isContextMenuOpen = false;
|
|
477
|
+
};
|
|
478
|
+
} else {
|
|
479
|
+
// Regular delete for non-group chats or exited groups
|
|
480
|
+
this.dispatchEvent(
|
|
481
|
+
new CustomEvent('delete-conversation', {
|
|
482
|
+
detail: {
|
|
483
|
+
conversationId: this.selectedTileForMenu.conversationId,
|
|
484
|
+
isGroup: this.selectedTileForMenu?.isGroup || false,
|
|
485
|
+
},
|
|
486
|
+
bubbles: true,
|
|
487
|
+
composed: true,
|
|
488
|
+
}),
|
|
489
|
+
);
|
|
490
|
+
}
|
|
491
|
+
break;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
handleScroll(event) {
|
|
496
|
+
const element = event.target;
|
|
497
|
+
const threshold = 10;
|
|
498
|
+
|
|
499
|
+
if (element.scrollHeight - element.scrollTop <= element.clientHeight + threshold && this.hasMoreConversations) {
|
|
500
|
+
this.isLoading = true;
|
|
501
|
+
this.dispatchEvent(
|
|
502
|
+
new CustomEvent('chat-tile-list-scrolled-to-bottom', {
|
|
503
|
+
bubbles: true,
|
|
504
|
+
composed: true,
|
|
505
|
+
}),
|
|
506
|
+
);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
handleGroupExitSuccess(conversationId) {
|
|
511
|
+
this.exitedGroups = [...this.exitedGroups, conversationId];
|
|
512
|
+
this.requestUpdate();
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
handleMenuClosed() {
|
|
516
|
+
this.isContextMenuOpen = false;
|
|
517
|
+
this.selectedTileForMenu = null;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
getConversationIdFromURL() {
|
|
521
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
522
|
+
return urlParams.get('conversation');
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
isTileSelected(tileConversationId) {
|
|
526
|
+
const urlConversationId = this.getConversationIdFromURL();
|
|
527
|
+
return tileConversationId === urlConversationId;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
getMessageBody(tile, userMetaData) {
|
|
531
|
+
const { senderId, senderName, body, attachments } = tile.lastMessageDetails;
|
|
532
|
+
if (!body) return '';
|
|
533
|
+
const isGroup = tile?.isGroup;
|
|
534
|
+
const sender = senderId === userMetaData.userId ? 'You' : senderName || '';
|
|
535
|
+
let messageContent = '';
|
|
536
|
+
if (body === 'AttachmentMessage:Multiple' && attachments?.length) {
|
|
537
|
+
const lastAttachment = attachments[attachments.length - 1];
|
|
538
|
+
if (lastAttachment?.mimeType?.includes('video')) {
|
|
539
|
+
messageContent = 'Video';
|
|
540
|
+
} else if (lastAttachment?.mimeType?.includes('image')) {
|
|
541
|
+
messageContent = 'Image';
|
|
542
|
+
} else if (lastAttachment?.mimeType?.includes('audio')) {
|
|
543
|
+
messageContent = 'Audio';
|
|
544
|
+
} else {
|
|
545
|
+
messageContent = 'Document';
|
|
546
|
+
}
|
|
547
|
+
} else if (body === 'AttachmentMessage:Image') {
|
|
548
|
+
messageContent = 'Image';
|
|
549
|
+
} else if (body === 'AttachmentMessage:Video') {
|
|
550
|
+
messageContent = 'Video';
|
|
551
|
+
} else if (body === 'AttachmentMessage:File') {
|
|
552
|
+
messageContent = 'Document';
|
|
553
|
+
} else if (body === 'AttachmentMessage:Audio') {
|
|
554
|
+
messageContent = 'Document';
|
|
555
|
+
} else {
|
|
556
|
+
messageContent = body;
|
|
557
|
+
}
|
|
558
|
+
return isGroup ? `${sender}: ${messageContent}` : messageContent;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
getReactionEmoji(reactionType) {
|
|
562
|
+
const emojiMap = {
|
|
563
|
+
star: '⭐',
|
|
564
|
+
crying_with_laughter: '😂',
|
|
565
|
+
yes: '👍',
|
|
566
|
+
no: '❌',
|
|
567
|
+
party: '🥳',
|
|
568
|
+
high_five: '✋',
|
|
569
|
+
rock: '🪨',
|
|
570
|
+
facepal: '🤦',
|
|
571
|
+
sarcastic: '🙄',
|
|
572
|
+
talking_too_much: '🤫',
|
|
573
|
+
crying: '😭',
|
|
574
|
+
heart: '❤️',
|
|
575
|
+
surprised: '😮',
|
|
576
|
+
bowing: '🙇',
|
|
577
|
+
};
|
|
578
|
+
return emojiMap[reactionType.toLowerCase()] || reactionType;
|
|
579
|
+
}
|
|
580
|
+
getLastMessageText(tile, userMetaData) {
|
|
581
|
+
if (!tile?.lastMessageDetails) return '';
|
|
582
|
+
const { action, initiatorId, initiatorName, memberName, userId, userName, members, memberAdded, reactionType } = tile.lastMessageDetails;
|
|
583
|
+
switch (action) {
|
|
584
|
+
case 'conversationCreated':
|
|
585
|
+
return 'Conversation Created';
|
|
586
|
+
case 'reactionRemove':
|
|
587
|
+
return `${userId === userMetaData.userId ? 'You' : userName} removed ${this.getReactionEmoji(reactionType)}`;
|
|
588
|
+
case 'reactionAdd':
|
|
589
|
+
return `${userId === userMetaData.userId ? 'You' : userName} reacted ${this.getReactionEmoji(reactionType)}`;
|
|
590
|
+
case 'removeAdmin':
|
|
591
|
+
return `${initiatorId === userMetaData.userId ? 'You' : initiatorName} removed ${memberName === userMetaData.userName ? 'you' : memberName} as an admin`;
|
|
592
|
+
case 'addAdmin':
|
|
593
|
+
return `${initiatorId === userMetaData.userId ? 'You' : initiatorName} made ${memberName === userMetaData.userName ? 'you' : memberName} an admin`;
|
|
594
|
+
case 'membersAdd':
|
|
595
|
+
return `${userId === userMetaData.userId || tile?.createdBy === userMetaData.userId ? 'You' : userName} added ${(members?.[0]?.memberId === userMetaData.userId || memberAdded?.[0] === userMetaData.userName) ? 'you' : members?.[0]?.memberName || memberAdded?.[0]}`;
|
|
596
|
+
case 'membersRemove':
|
|
597
|
+
return `${userId === userMetaData.userId ? 'You' : userName} removed ${(members?.[0]?.memberId === userMetaData.userId || memberAdded?.[0] === userMetaData.userName) ? 'you' : members?.[0]?.memberName || memberAdded?.[0]}`;
|
|
598
|
+
case 'conversationTitleUpdated':
|
|
599
|
+
return 'Conversation Title Updated';
|
|
600
|
+
case 'conversationImageUpdated':
|
|
601
|
+
return 'Conversation Image Updated';
|
|
602
|
+
case 'userBlockConversation':
|
|
603
|
+
return `${initiatorId === userMetaData?.userId ? '🚫 You blocked' + ' ' + tile?.lastMessageDetails?.opponentName : '🚫' + initiatorName + ' ' + 'blocked you'}`;
|
|
604
|
+
case 'userUnblockConversation':
|
|
605
|
+
return `${initiatorId === userMetaData?.userId ? 'You unblocked' + ' ' + tile?.lastMessageDetails?.opponentName : initiatorName + ' ' + 'unblocked you'}`;
|
|
606
|
+
default:
|
|
607
|
+
return this.getMessageBody(tile, userMetaData);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
handleNewChatClick(e) {
|
|
612
|
+
this.renderComponentName = 'NewContact';
|
|
613
|
+
this.dispatchEvent(
|
|
614
|
+
new CustomEvent('new-chat-clicked', {
|
|
615
|
+
bubbles: true,
|
|
616
|
+
composed: true,
|
|
617
|
+
}),
|
|
618
|
+
);
|
|
619
|
+
}
|
|
620
|
+
closeContactList() {
|
|
621
|
+
this.renderComponentName = 'Sidebar';
|
|
622
|
+
this.requestUpdate();
|
|
623
|
+
}
|
|
624
|
+
getMediaType(tile) {
|
|
625
|
+
if (tile?.lastMessageDetails?.attachments?.length > 0) {
|
|
626
|
+
const lastAttachment = tile.lastMessageDetails.attachments[tile.lastMessageDetails.attachments.length - 1];
|
|
627
|
+
const mimeType = lastAttachment.mimeType;
|
|
628
|
+
|
|
629
|
+
if (mimeType?.includes('video')) {
|
|
630
|
+
return 2; // Video
|
|
631
|
+
} else if (mimeType?.includes('image')) {
|
|
632
|
+
return 1; // Image
|
|
633
|
+
} else if (mimeType?.includes('audio')) {
|
|
634
|
+
return 4; // Audio
|
|
635
|
+
} else {
|
|
636
|
+
return 3; // Other
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
return 0; // No attachment
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
render() {
|
|
643
|
+
const typesToUse = this.customTypes.length > 0 ? this.customTypes : [...new Set(this.conversationData.map(tile => tile.customType))].map(type => ({ type, label: type }));
|
|
644
|
+
|
|
645
|
+
const filteredConversations = this.conversationData.filter(tile => {
|
|
646
|
+
const searchQuery = this.searchQuery?.trim()?.toLowerCase();
|
|
647
|
+
const tileTitle =
|
|
648
|
+
this.displayTitle && tile.conversationId === this.selectedTileId ? this.displayTitle : tile.isGroup ? tile.conversationTitle : tile?.opponentDetails?.userName;
|
|
649
|
+
|
|
650
|
+
const searchableText = tileTitle?.toLowerCase().trim() || '';
|
|
651
|
+
const matchesText = searchableText.includes(searchQuery);
|
|
652
|
+
const matchesCustomType = this.selectedCustomType ? tile.customType === this.selectedCustomType : true;
|
|
653
|
+
|
|
654
|
+
return matchesText && matchesCustomType;
|
|
655
|
+
});
|
|
656
|
+
|
|
657
|
+
const allChatsButton = html`
|
|
658
|
+
<button
|
|
659
|
+
class="filter-tab ${this.selectedCustomType === 'all' ? 'active' : ''}"
|
|
660
|
+
style=${styleMap(this.filterTab)}
|
|
661
|
+
@click="${() => this.handleTabClick('all')}"
|
|
662
|
+
@mouseenter="${this.applyHoverStyles}"
|
|
663
|
+
@mouseleave="${this.removeHoverStyles}"
|
|
664
|
+
>
|
|
665
|
+
All
|
|
666
|
+
</button>
|
|
667
|
+
`;
|
|
668
|
+
|
|
669
|
+
return this.renderComponentName === 'NewContact'
|
|
670
|
+
? html`
|
|
671
|
+
<new-chat-sidebar
|
|
672
|
+
.closeNewChatSidebar=${() => this.closeContactList()}
|
|
673
|
+
height="100%"
|
|
674
|
+
width="100%"
|
|
675
|
+
bgColor="var(--bg-primary-color)"
|
|
676
|
+
textColor="var(--text-primary-color)"
|
|
677
|
+
.nonBlockedContacts=${this.nonBlockedContacts}
|
|
678
|
+
.isNoContactsFound=${this.isNoContactsFound}
|
|
679
|
+
.isLoading=${this.isLoading}
|
|
680
|
+
.isPaginationMember=${this.isPaginationMember}
|
|
681
|
+
.isLoadingMember=${this.isLoadingMember}
|
|
682
|
+
.hasMoreMembers=${this.hasMoreMembers}
|
|
683
|
+
></new-chat-sidebar>
|
|
684
|
+
`
|
|
685
|
+
: html`
|
|
686
|
+
<div class="chat-sidebar-container" style="background-color: ${this.sidebarColor || 'var(--bg-primary-color)'}">
|
|
687
|
+
<div class="chat-sidebar-search">
|
|
688
|
+
<message-search-bar
|
|
689
|
+
.isSearchBar=${this.isSidebarHeaderSearch}
|
|
690
|
+
label=${this.isSidebarHeaderLabel ? this.sidebarHeaderLabel || 'Chats' : ''}
|
|
691
|
+
labelColor="var(--text-primary-color)"
|
|
692
|
+
labelFontFamily="var(--font-sans)"
|
|
693
|
+
labelFontWeight="600"
|
|
694
|
+
labelFontSize="var(--title-font-size)"
|
|
695
|
+
labelFontStyle="normal"
|
|
696
|
+
searchBarIconAlt="Search Icon"
|
|
697
|
+
searchBarIconWidth="30px"
|
|
698
|
+
searchBarIconHeight="30px"
|
|
699
|
+
borderRadius="var(--radius-sm)"
|
|
700
|
+
borderWidth="1px"
|
|
701
|
+
borderColor="color-mix(in srgb, var(--primary) 20%, transparent)"
|
|
702
|
+
padding="0"
|
|
703
|
+
margin="0"
|
|
704
|
+
width="100%"
|
|
705
|
+
inputBgColor="var(--bg-primary-color)"
|
|
706
|
+
inputFontColor="var(--text-primary-color)"
|
|
707
|
+
inputPlaceholder="Search or start new chat"
|
|
708
|
+
.nonBlockedContacts="${this.nonBlockedContacts}"
|
|
709
|
+
inputPlaceholderColor="var(--text-last-seen)"
|
|
710
|
+
@searchConversation="${this.handleSearchInput}"
|
|
711
|
+
.isNoContactsFound=${this.isNoContactsFound}
|
|
712
|
+
.handleNewChatClick=${() => this.handleNewChatClick()}
|
|
713
|
+
.isMqttConnected=${this.isMqttConnected}
|
|
714
|
+
.userMetaData=${this.userMetaData}
|
|
715
|
+
></message-search-bar>
|
|
716
|
+
</div>
|
|
717
|
+
${this.isChatFilter
|
|
718
|
+
? html`
|
|
719
|
+
<div class="chat-filter-tabs" style=${styleMap(this.filterTabsContainer)}>
|
|
720
|
+
${allChatsButton}
|
|
721
|
+
${typesToUse.map(({ type, label }) => {
|
|
722
|
+
return html`
|
|
723
|
+
<button
|
|
724
|
+
@click="${() => this.handleTabClick(type)}"
|
|
725
|
+
class="filter-tab ${this.selectedCustomType === type ? 'active' : ''}"
|
|
726
|
+
style=${styleMap(this.filterTab)}
|
|
727
|
+
@mouseenter="${this.applyHoverStyles}"
|
|
728
|
+
@mouseout="${this.removeHoverStyles}"
|
|
729
|
+
>
|
|
730
|
+
${label}
|
|
731
|
+
</button>
|
|
732
|
+
`;
|
|
733
|
+
})}
|
|
734
|
+
</div>
|
|
735
|
+
`
|
|
736
|
+
: ''}
|
|
737
|
+
<div class="chat-sidebar-list" @scroll="${this.handleScroll}">
|
|
738
|
+
${this.isConversationLoading
|
|
739
|
+
? html`<div class="loading-container-top">
|
|
740
|
+
<spinner-loader
|
|
741
|
+
height="15px"
|
|
742
|
+
width="15px"
|
|
743
|
+
spinTime="1s"
|
|
744
|
+
spinnerPrimaryColor="var(--bg-primary-color)"
|
|
745
|
+
spinnerSecondaryColor="var(--text-primary-color)"
|
|
746
|
+
spinnerBorderWidth="2px"
|
|
747
|
+
></spinner-loader>
|
|
748
|
+
</div>`
|
|
749
|
+
: filteredConversations.length > 0
|
|
750
|
+
? filteredConversations.map(tile => {
|
|
751
|
+
const formattedMessageDate =
|
|
752
|
+
tile?.lastMessageDetails?.action === 'conversationCreated'
|
|
753
|
+
? formatUnixTimestamp(tile?.lastMessageDetails?.createdAt || tile?.lastMessageDetails?.conversationDetails?.createdAt || tile?.createdAt)
|
|
754
|
+
: tile?.lastMessageDetails?.action === 'addAdmin' ||
|
|
755
|
+
tile?.lastMessageDetails?.action === 'removeAdmin' ||
|
|
756
|
+
tile?.lastMessageDetails?.action === 'membersAdd' ||
|
|
757
|
+
tile?.lastMessageDetails?.action === 'membersRemove'
|
|
758
|
+
? formatUnixTimestamp(tile?.lastMessageDetails?.sentAt)
|
|
759
|
+
: tile?.lastMessageDetails?.updatedAt
|
|
760
|
+
? formatUnixTimestamp(tile.lastMessageDetails.updatedAt)
|
|
761
|
+
: '';
|
|
762
|
+
const isSelected = this.isTileSelected(tile.conversationId);
|
|
763
|
+
const messageDateColor = tile?.unreadMessagesCount > 0 ? this.unreadCountBgColor : this.messageDateColor;
|
|
764
|
+
|
|
765
|
+
return html`
|
|
766
|
+
<chat-tile
|
|
767
|
+
@click=${() => {
|
|
768
|
+
this.onChatTileSelected(
|
|
769
|
+
new CustomEvent('chatTileSelected', {
|
|
770
|
+
detail: {
|
|
771
|
+
...tile,
|
|
772
|
+
conversationId: tile.conversationId,
|
|
773
|
+
},
|
|
774
|
+
}),
|
|
775
|
+
);
|
|
776
|
+
this.selectedTileId = tile.conversationId;
|
|
777
|
+
}}
|
|
778
|
+
@contextmenu=${e => this.handleRightClick(e, tile)}
|
|
779
|
+
.imageSrc=${tile?.isGroup ? tile?.conversationImageUrl : tile?.opponentDetails?.userProfileImageUrl || tile?.lastMessageDetails?.userProfileImageUrl}
|
|
780
|
+
.imageAlt=${(tile?.isGroup ? tile?.conversationTitle : tile?.opponentDetails?.userName) + ' profile image'}
|
|
781
|
+
.imageHeight=${this.imageHeight}
|
|
782
|
+
.imageWidth=${this.imageWidth}
|
|
783
|
+
.imageRadius=${this.imageRadius}
|
|
784
|
+
.username=${this.displayTitle && tile.conversationId === this.selectedTileId
|
|
785
|
+
? this.displayTitle
|
|
786
|
+
: tile.isGroup
|
|
787
|
+
? tile.conversationTitle
|
|
788
|
+
: tile?.opponentDetails?.userName || tile?.lastMessageDetails?.userName}
|
|
789
|
+
.userNameFontWeight=${this.userNameFontWeight}
|
|
790
|
+
.userNameColor=${this.userNameColor}
|
|
791
|
+
.userNameFontSize=${this.usernameFontSize}
|
|
792
|
+
.chatPreview=${this.getLastMessageText(tile, this.userMetaData)}
|
|
793
|
+
.mediaType=${this.getMediaType(tile)}
|
|
794
|
+
.chatPreviewColor=${this.chatPreviewColor}
|
|
795
|
+
.chatPreviewFontSize=${this.chatPreviewFontSize}
|
|
796
|
+
.unreadCount=${this.unreadMessageCount || (tile?.unreadMessagesCount > 0 ? tile?.unreadMessagesCount : '')}
|
|
797
|
+
.unreadCountColor=${this.unreadCountColor}
|
|
798
|
+
.unreadCountBgColor=${this.unreadCountBgColor}
|
|
799
|
+
.unreadCountBorderRadius=${this.unreadCountBorderRadius}
|
|
800
|
+
.unreadCountFontSize=${this.unreadCountFontSize}
|
|
801
|
+
.unreadCountHeight=${this.unreadCountHeight}
|
|
802
|
+
.unreadCountWidth=${this.unreadCountWidth}
|
|
803
|
+
.messageDate=${formattedMessageDate || undefined}
|
|
804
|
+
.messageDateColor=${messageDateColor}
|
|
805
|
+
.messageDateFontSize=${this.messageDateFontSize}
|
|
806
|
+
.padding=${this.padding}
|
|
807
|
+
.bgColor=${this.sidebarColor || this.bgColor}
|
|
808
|
+
.borderWidth=${this.borderWidth}
|
|
809
|
+
.borderColor=${this.borderColor}
|
|
810
|
+
.borderStyle=${this.borderStyle}
|
|
811
|
+
.height=${this.height}
|
|
812
|
+
.width=${this.width}
|
|
813
|
+
.isSelected=${isSelected}
|
|
814
|
+
.sidebarSelectedColor=${this.sidebarSelectedColor}
|
|
815
|
+
.isSelfMessage=${tile.lastMessageDetails?.senderId === this.userMetaData.userId}
|
|
816
|
+
.isRead=${tile.lastMessageDetails?.isReadByAllMembers ||
|
|
817
|
+
tile?.lastMessageDetails?.readByAll ||
|
|
818
|
+
tile?.lastMessageDetails?.readBy?.length === tile?.members?.length - 1}
|
|
819
|
+
.isDelivered=${tile.lastMessageDetails?.isDeliveredToAllMembers ||
|
|
820
|
+
tile?.lastMessageDetails?.deliveredToAll ||
|
|
821
|
+
tile?.members?.length - 1 === tile?.lastMessageDetails?.deliveredTo?.length}
|
|
822
|
+
.isPending=${tile.lastMessageDetails?.isPendingAllMembers}
|
|
823
|
+
.imageTextColor=${'var(--text-primary-color)'}
|
|
824
|
+
.isTyping=${this.isTyping && this.typingConversationId === tile.conversationId}
|
|
825
|
+
.typingUserName=${tile.isGroup ? this.typingUserName : null}
|
|
826
|
+
></chat-tile>
|
|
827
|
+
`;
|
|
828
|
+
})
|
|
829
|
+
: html`<div class="search-placeholder">
|
|
830
|
+
<div class="empty-mark" aria-hidden="true"><span></span><span></span></div>
|
|
831
|
+
<strong>No chats yet</strong>
|
|
832
|
+
<p>Start a conversation to see it here.</p>
|
|
833
|
+
</div>`}
|
|
834
|
+
${this.isLoading && this.hasMoreConversations
|
|
835
|
+
? html`<div class="loading-container">
|
|
836
|
+
<spinner-loader
|
|
837
|
+
height="15px"
|
|
838
|
+
width="15px"
|
|
839
|
+
spinTime="1s"
|
|
840
|
+
spinnerPrimaryColor="var(--bg-primary-color)"
|
|
841
|
+
spinnerSecondaryColor="var(--text-primary-color)"
|
|
842
|
+
spinnerBorderWidth="2px"
|
|
843
|
+
></spinner-loader>
|
|
844
|
+
</div>`
|
|
845
|
+
: null}
|
|
846
|
+
</div>
|
|
847
|
+
|
|
848
|
+
${this.isContextMenuOpen
|
|
849
|
+
? html`
|
|
850
|
+
<context-menu
|
|
851
|
+
.x=${this.contextMenuX}
|
|
852
|
+
.y=${this.contextMenuY}
|
|
853
|
+
.isOpen=${this.isContextMenuOpen}
|
|
854
|
+
.menuItems=${[
|
|
855
|
+
{
|
|
856
|
+
label: this.selectedTileForMenu?.isGroup && !this.exitedGroups.includes(this.selectedTileForMenu?.conversationId) ? 'Exit Group' : 'Delete Chat',
|
|
857
|
+
action: 'delete',
|
|
858
|
+
type: 'danger',
|
|
859
|
+
},
|
|
860
|
+
]}
|
|
861
|
+
@menu-item-selected=${this.handleMenuItemSelected}
|
|
862
|
+
@menu-closed=${this.handleMenuClosed}
|
|
863
|
+
></context-menu>
|
|
864
|
+
`
|
|
865
|
+
: ''}
|
|
866
|
+
${this.isConfirmationDialogOpen
|
|
867
|
+
? html`
|
|
868
|
+
<div class="confirmation-dialog-overlay">
|
|
869
|
+
<div class="confirmation-dialog">
|
|
870
|
+
<div class="confirmation-dialog-message">${this.confirmationMessage}</div>
|
|
871
|
+
<div class="confirmation-dialog-buttons">
|
|
872
|
+
<button class="confirmation-dialog-button cancel-button" @click=${() => (this.isConfirmationDialogOpen = false)}>Cancel</button>
|
|
873
|
+
<button class="confirmation-dialog-button confirm-button" @click=${this.confirmationOnConfirm}>Exit</button>
|
|
874
|
+
</div>
|
|
875
|
+
</div>
|
|
876
|
+
</div>
|
|
877
|
+
`
|
|
878
|
+
: ''}
|
|
879
|
+
</div>
|
|
880
|
+
`;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
connectedCallback() {
|
|
884
|
+
super.connectedCallback();
|
|
885
|
+
|
|
886
|
+
this.handleMessageReadStatus = this.handleMessageReadStatus.bind(this);
|
|
887
|
+
window.addEventListener('messageReadStatusUpdated', this.handleMessageReadStatus);
|
|
888
|
+
|
|
889
|
+
this.handleConversationNotFound = this.handleConversationNotFound.bind(this);
|
|
890
|
+
window.addEventListener('conversationNotFound', this.handleConversationNotFound);
|
|
891
|
+
|
|
892
|
+
this.handleOpenNewChat = () => this.handleNewChatClick();
|
|
893
|
+
window.addEventListener('open-new-chat', this.handleOpenNewChat);
|
|
894
|
+
|
|
895
|
+
this.selectedTileId = this.getConversationIdFromURL();
|
|
896
|
+
window.addEventListener('popstate', () => {
|
|
897
|
+
this.selectedTileId = this.getConversationIdFromURL();
|
|
898
|
+
this.requestUpdate();
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
disconnectedCallback() {
|
|
903
|
+
super.disconnectedCallback();
|
|
904
|
+
|
|
905
|
+
window.removeEventListener('messageReadStatusUpdated', this.handleMessageReadStatus);
|
|
906
|
+
|
|
907
|
+
window.removeEventListener('conversationNotFound', this.handleConversationNotFound);
|
|
908
|
+
window.removeEventListener('open-new-chat', this.handleOpenNewChat);
|
|
909
|
+
|
|
910
|
+
if (this.debouncedSearchHandler && typeof this.debouncedSearchHandler.cancel === 'function') {
|
|
911
|
+
this.debouncedSearchHandler?.cancel();
|
|
912
|
+
}
|
|
913
|
+
window.removeEventListener('popstate', () => {
|
|
914
|
+
this.selectedTileId = this.getConversationIdFromURL();
|
|
915
|
+
this.requestUpdate();
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
updated(changedProperties) {
|
|
920
|
+
super.updated(changedProperties);
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
handleConversationNotFound(event) {
|
|
924
|
+
this.isLoading = false;
|
|
925
|
+
this.isConversationLoading = false;
|
|
926
|
+
this.requestUpdate();
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
handleMessageReadStatus(event) {
|
|
930
|
+
const { conversationId, isRead, isDelivered } = event.detail.detail;
|
|
931
|
+
this.conversationData = this.conversationData.map(conversation => {
|
|
932
|
+
if (conversation.conversationId === conversationId) {
|
|
933
|
+
const updatedConversation = {
|
|
934
|
+
...conversation,
|
|
935
|
+
lastMessageDetails: {
|
|
936
|
+
...conversation.lastMessageDetails,
|
|
937
|
+
isReadByAllMembers: isRead,
|
|
938
|
+
isDeliveredToAllMembers: isDelivered,
|
|
939
|
+
},
|
|
940
|
+
};
|
|
941
|
+
return updatedConversation;
|
|
942
|
+
}
|
|
943
|
+
return conversation;
|
|
944
|
+
});
|
|
945
|
+
|
|
946
|
+
// Force a re-render
|
|
947
|
+
this.requestUpdate();
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
customElements.define('chat-sidebar', ChatSidebar);
|