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,75 @@
|
|
|
1
|
+
export const WEB_CONTENT = {
|
|
2
|
+
CHAT: {
|
|
3
|
+
GROUP_INFO: {
|
|
4
|
+
GROUP_MEMBERS : {
|
|
5
|
+
TITLE: 'Group Members',
|
|
6
|
+
ADD_MEMBER: 'Add Member',
|
|
7
|
+
REMOVE_MEMBER: 'Remove Member',
|
|
8
|
+
REMOVE: 'Remove', //only remove as name will be shown against remove
|
|
9
|
+
MAKE_ADMIN: 'Make Admin',
|
|
10
|
+
REMOVE_ADMIN: 'Remove Admin',
|
|
11
|
+
BLOCK_MEMBER: 'Block Member',
|
|
12
|
+
UNBLOCK_MEMBER: 'Unblock Member',
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
GROUP_CAST: {
|
|
16
|
+
CREATE_GROUP_CAST: 'Create Group Cast',
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
ERROR_MESSAGES: {
|
|
20
|
+
GENERIC_ERROR: "Something went wrong. Please try again.",
|
|
21
|
+
},
|
|
22
|
+
CONSENT_MESSAGES: {
|
|
23
|
+
REMOVE_MEMBER: (name) => `Are you sure you want to remove ${name} from the group?`,
|
|
24
|
+
CANCEL: 'Cancel',
|
|
25
|
+
REMOVE: 'Remove',
|
|
26
|
+
MAKE_ADMIN: (name) => `Are you sure you want to make ${name} an admin?`,
|
|
27
|
+
REMOVE_ADMIN: (name) => `Are you sure you want to remove ${name} as admin?`,
|
|
28
|
+
},
|
|
29
|
+
MESSAGE_ACTIONS: {
|
|
30
|
+
INFO: 'Message Info',
|
|
31
|
+
FORWARD: 'Forward',
|
|
32
|
+
REPLY: 'Reply',
|
|
33
|
+
DELETE: 'Delete',
|
|
34
|
+
DELETE_FOR_SELF: 'Delete for me',
|
|
35
|
+
DELETE_FOR_EVERYONE: 'Delete for everyone',
|
|
36
|
+
},
|
|
37
|
+
CONVERSATION_ACTIONS: {
|
|
38
|
+
CLEAR_CHAT: 'Clear Chat',
|
|
39
|
+
CLOSE_CHAT: 'Close Chat',
|
|
40
|
+
SEARCH_CHAT: 'Search Chat',
|
|
41
|
+
BLOCK_CHAT: 'Block Chat',
|
|
42
|
+
|
|
43
|
+
},
|
|
44
|
+
PLACEHOLDER_CONTENT: {
|
|
45
|
+
NO_CONTACTS_FOUND: {
|
|
46
|
+
TITLE: 'No contacts found',
|
|
47
|
+
DESCRIPTION: 'No users are available right now. Try refreshing the page or searching again after some time.',
|
|
48
|
+
},
|
|
49
|
+
SEARCH_CHAT: {
|
|
50
|
+
NO_RESULTS_FOUND: 'No results found',
|
|
51
|
+
SEARCH_FOR_MSG: "Search for messages",
|
|
52
|
+
MESSAGE: 'Message',
|
|
53
|
+
},
|
|
54
|
+
SEARCH_FOR_NAME_OR_NUMBER: 'Search name or number',
|
|
55
|
+
UNSUPPORTED_MEDIA: 'No images or videos found',
|
|
56
|
+
LOADING:"Loading..."
|
|
57
|
+
},
|
|
58
|
+
POPUP_MESSAGES: {
|
|
59
|
+
DELETE_LABEL: 'Delete Message?',
|
|
60
|
+
SHARE_MEDIA_LABEL: 'Share Media',
|
|
61
|
+
},
|
|
62
|
+
REACTIONS: {
|
|
63
|
+
REMOVE_REACTION_ON_TAP: 'Tap To Remove',
|
|
64
|
+
REACTIONS_TAP_INFO: 'Tap on any tab to see list'
|
|
65
|
+
},
|
|
66
|
+
UNSUPPORTED_MEDIA_TYPES:'Unsupported media type',
|
|
67
|
+
PLEASE_WAIT:"Please wait...",
|
|
68
|
+
BLOCK_CHAT_MESSAGE:" Can't send a message to blocked contact ",
|
|
69
|
+
LOGIN:'Log In',
|
|
70
|
+
LOGIN_DESC:'Enter your email and password to continue',
|
|
71
|
+
EMAIL:'Enter Email',
|
|
72
|
+
PASSWORD:"Enter Password",
|
|
73
|
+
LOG_IN:"Login"
|
|
74
|
+
|
|
75
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const GROUP_PROFILE_PLACEHOLDER_IMAGE = 'https://chatstorage.isometrik.ai/5eb3db9ba9252000014f82ff/e1241039-2fef-4830-b927-5bb3424f1764/Users/65eabd45837d05000165d096_1739274360060.svg'
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview entry point for your component library
|
|
3
|
+
*
|
|
4
|
+
* This is the entry point for your component library. Use this file to export utilities,
|
|
5
|
+
* constants or data structure that accompany your components.
|
|
6
|
+
*
|
|
7
|
+
* DO NOT use this file to export your components. Instead, use the recommended approaches
|
|
8
|
+
* to consume components of this package as outlined in the `README.md`.
|
|
9
|
+
*/
|
|
10
|
+
export { format } from './utils/utils';
|
|
11
|
+
export const initializeChat = function (props) {
|
|
12
|
+
if (!props.licenseKey ||
|
|
13
|
+
!props.appSecret ||
|
|
14
|
+
!props.userSecret ||
|
|
15
|
+
!props.userToken ||
|
|
16
|
+
!props.isometrikUserId ||
|
|
17
|
+
!props.projectId ||
|
|
18
|
+
!props.keysetId ||
|
|
19
|
+
!props.accountId) {
|
|
20
|
+
console.error('Missing required props to Initialize chat!');
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
console.log(props, 'props');
|
|
24
|
+
// First create the theme provider wrapper
|
|
25
|
+
const themeProvider = document.createElement('theme-provider');
|
|
26
|
+
// Set default theme mode
|
|
27
|
+
if (props.defaultTheme) {
|
|
28
|
+
themeProvider.setAttribute('mode', props.defaultTheme);
|
|
29
|
+
}
|
|
30
|
+
// Set the theme path based on priority:
|
|
31
|
+
// 1. Custom theme path if provided
|
|
32
|
+
// 2. Single theme URL (with both light/dark variants)
|
|
33
|
+
if (props.themeUrl) {
|
|
34
|
+
themeProvider.setAttribute('theme-path', props.themeUrl);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
// Default theme URL with both themes
|
|
38
|
+
themeProvider.setAttribute('theme-path', 'https://isometrik-website-bucket.s3.ap-south-1.amazonaws.com/styles/chat-combined-theme.css');
|
|
39
|
+
}
|
|
40
|
+
// Create the chat component
|
|
41
|
+
const chatComponent = document.createElement('web-chat');
|
|
42
|
+
// Set all the properties
|
|
43
|
+
chatComponent.baseUrl = (props === null || props === void 0 ? void 0 : props.baseUrl) || 'https://apis.isometrik.io';
|
|
44
|
+
chatComponent.hostUrl = (props === null || props === void 0 ? void 0 : props.hostUrl) || 'wss://connections.isometrik.io:2053/mqtt';
|
|
45
|
+
chatComponent.licenseKey = props.licenseKey;
|
|
46
|
+
chatComponent.appSecret = props.appSecret;
|
|
47
|
+
chatComponent.userSecret = props.userSecret;
|
|
48
|
+
chatComponent.userToken = props.userToken;
|
|
49
|
+
chatComponent.isometrikUserId = props.isometrikUserId;
|
|
50
|
+
chatComponent.projectId = props.projectId;
|
|
51
|
+
chatComponent.keysetId = props.keysetId;
|
|
52
|
+
chatComponent.accountId = props.accountId;
|
|
53
|
+
chatComponent.defaultTheme = props.defaultTheme || 'light';
|
|
54
|
+
chatComponent.themeUrl = props.themeUrl || 'https://isometrik-website-bucket.s3.ap-south-1.amazonaws.com/styles/chat-combined-theme.css';
|
|
55
|
+
// Set the style to take 100% width and height of the parent container
|
|
56
|
+
chatComponent.style.width = '100%';
|
|
57
|
+
chatComponent.style.height = '100%';
|
|
58
|
+
// Append the chat component to the theme provider
|
|
59
|
+
themeProvider.appendChild(chatComponent);
|
|
60
|
+
// Set styles for the theme provider as well
|
|
61
|
+
themeProvider.style.width = '100%';
|
|
62
|
+
themeProvider.style.height = '100%';
|
|
63
|
+
themeProvider.style.display = 'block';
|
|
64
|
+
// Find the container and append the theme provider to it
|
|
65
|
+
const container = props.containerId ? document.getElementById(props.containerId) : document.body;
|
|
66
|
+
if (container) {
|
|
67
|
+
console.log('isometrik web chat initialized and appended to container with id', props.containerId);
|
|
68
|
+
container.appendChild(themeProvider);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
console.error('Container with the specified ID not found. Appending to body instead.');
|
|
72
|
+
document.body.appendChild(themeProvider);
|
|
73
|
+
}
|
|
74
|
+
// Store reference to components for later use
|
|
75
|
+
if (typeof window !== 'undefined') {
|
|
76
|
+
window.__isometrikChatComponents = window.__isometrikChatComponents || {};
|
|
77
|
+
window.__isometrikChatComponents.themeProvider = themeProvider;
|
|
78
|
+
window.__isometrikChatComponents.chatComponent = chatComponent;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
export const customChatSidebar = function (props) {
|
|
82
|
+
const chatComponent = document.querySelector('web-chat');
|
|
83
|
+
if (!chatComponent) {
|
|
84
|
+
console.error("Isometrik chat is not initialized");
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (props.isChatFilter !== undefined) {
|
|
88
|
+
chatComponent.isChatFilter = props.isChatFilter;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
export const switchChatTheme = function (theme) {
|
|
92
|
+
var _a;
|
|
93
|
+
const chatElements = document.getElementsByTagName('web-chat');
|
|
94
|
+
for (let i = 0; i < chatElements.length; i++) {
|
|
95
|
+
const chatWeb = chatElements[i];
|
|
96
|
+
chatWeb.defaultTheme = theme;
|
|
97
|
+
// Update the theme provider mode instead of changing the theme path
|
|
98
|
+
const themeProvider = (_a = window.__isometrikChatComponents) === null || _a === void 0 ? void 0 : _a.themeProvider;
|
|
99
|
+
if (themeProvider) {
|
|
100
|
+
themeProvider.setAttribute('mode', theme);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
// New function to apply a custom theme
|
|
105
|
+
export const applyCustomTheme = function (customTheme) {
|
|
106
|
+
const themeProvider = document.querySelector('theme-provider');
|
|
107
|
+
if (!themeProvider) {
|
|
108
|
+
console.error("Theme provider is not initialized");
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (customTheme.themePath) {
|
|
112
|
+
themeProvider.setAttribute('theme-path', customTheme.themePath);
|
|
113
|
+
}
|
|
114
|
+
if (customTheme.themeObject) {
|
|
115
|
+
themeProvider.themeObject = customTheme.themeObject;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
// New function to toggle between light and dark themes
|
|
119
|
+
export const toggleTheme = function () {
|
|
120
|
+
const themeProvider = document.querySelector('theme-provider');
|
|
121
|
+
if (!themeProvider) {
|
|
122
|
+
console.error("Theme provider is not initialized");
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
// Use the built-in toggleTheme method of theme-provider
|
|
126
|
+
themeProvider.toggleTheme();
|
|
127
|
+
};
|
|
128
|
+
if (typeof window !== 'undefined') {
|
|
129
|
+
window.initializeChat = initializeChat;
|
|
130
|
+
window.chatSidebarProps = customChatSidebar;
|
|
131
|
+
window.switchChatTheme = switchChatTheme;
|
|
132
|
+
window.applyCustomTheme = applyCustomTheme;
|
|
133
|
+
window.toggleTheme = toggleTheme; // Expose the toggle function
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * @fileoverview entry point for your component library\n *\n * This is the entry point for your component library. Use this file to export utilities,\n * constants or data structure that accompany your components.\n *\n * DO NOT use this file to export your components. Instead, use the recommended approaches\n * to consume components of this package as outlined in the `README.md`.\n */\nexport { format } from './utils/utils';\nexport type * from './components.d.ts';\n\nexport const initializeChat = function(props: {\n baseUrl?: string;\n hostUrl?: string;\n licenseKey: string;\n appSecret: string;\n userSecret: string;\n userToken: string;\n isometrikUserId: string;\n projectId: string;\n keysetId: string;\n accountId: string;\n defaultTheme?: 'dark' | 'light';\n themeUrl?: string; // Single theme file URL\n containerId?: string;\n}) {\n if (\n !props.licenseKey ||\n !props.appSecret ||\n !props.userSecret ||\n !props.userToken ||\n !props.isometrikUserId ||\n !props.projectId ||\n !props.keysetId ||\n !props.accountId\n ) {\n console.error('Missing required props to Initialize chat!');\n return;\n }\n console.log(props, 'props');\n \n // First create the theme provider wrapper\n const themeProvider = document.createElement('theme-provider');\n \n // Set default theme mode\n if (props.defaultTheme) {\n themeProvider.setAttribute('mode', props.defaultTheme);\n }\n \n // Set the theme path based on priority:\n // 1. Custom theme path if provided\n // 2. Single theme URL (with both light/dark variants)\n if (props.themeUrl) {\n themeProvider.setAttribute('theme-path', props.themeUrl);\n } else {\n // Default theme URL with both themes\n themeProvider.setAttribute('theme-path', 'https://isometrik-website-bucket.s3.ap-south-1.amazonaws.com/styles/chat-combined-theme.css');\n }\n \n // Create the chat component\n const chatComponent = document.createElement('web-chat');\n \n // Set all the properties\n chatComponent.baseUrl = props?.baseUrl || 'https://apis.isometrik.io';\n chatComponent.hostUrl = props?.hostUrl || 'wss://connections.isometrik.io:2053/mqtt';\n chatComponent.licenseKey = props.licenseKey;\n chatComponent.appSecret = props.appSecret;\n chatComponent.userSecret = props.userSecret;\n chatComponent.userToken = props.userToken;\n chatComponent.isometrikUserId = props.isometrikUserId;\n chatComponent.projectId = props.projectId;\n chatComponent.keysetId = props.keysetId;\n chatComponent.accountId = props.accountId;\n chatComponent.defaultTheme = props.defaultTheme || 'light';\n chatComponent.themeUrl = props.themeUrl || 'https://isometrik-website-bucket.s3.ap-south-1.amazonaws.com/styles/chat-combined-theme.css';\n \n // Set the style to take 100% width and height of the parent container\n chatComponent.style.width = '100%';\n chatComponent.style.height = '100%';\n \n // Append the chat component to the theme provider\n themeProvider.appendChild(chatComponent);\n \n // Set styles for the theme provider as well\n themeProvider.style.width = '100%';\n themeProvider.style.height = '100%';\n themeProvider.style.display = 'block';\n \n // Find the container and append the theme provider to it\n const container = props.containerId ? document.getElementById(props.containerId) : document.body;\n if (container) {\n console.log('isometrik web chat initialized and appended to container with id', props.containerId);\n container.appendChild(themeProvider);\n } else {\n console.error('Container with the specified ID not found. Appending to body instead.');\n document.body.appendChild(themeProvider);\n }\n \n // Store reference to components for later use\n if (typeof window !== 'undefined') {\n (window as any).__isometrikChatComponents = (window as any).__isometrikChatComponents || {};\n (window as any).__isometrikChatComponents.themeProvider = themeProvider;\n (window as any).__isometrikChatComponents.chatComponent = chatComponent;\n }\n};\n\nexport const customChatSidebar = function(props: {\n isChatFilter?: boolean\n}) {\n const chatComponent = document.querySelector('web-chat');\n if(!chatComponent) {\n console.error(\"Isometrik chat is not initialized\");\n return;\n }\n \n if (props.isChatFilter !== undefined) {\n chatComponent.isChatFilter = props.isChatFilter;\n }\n};\n\nexport const switchChatTheme = function(theme: 'dark' | 'light') {\n const chatElements = document.getElementsByTagName('web-chat');\n \n for (let i = 0; i < chatElements.length; i++) {\n const chatWeb = chatElements[i];\n chatWeb.defaultTheme = theme;\n \n // Update the theme provider mode instead of changing the theme path\n const themeProvider = (window as any).__isometrikChatComponents?.themeProvider;\n if (themeProvider) {\n themeProvider.setAttribute('mode', theme);\n }\n }\n};\n\n// New function to apply a custom theme\nexport const applyCustomTheme = function(customTheme: {\n themePath?: string;\n themeObject?: { [key: string]: string };\n}) {\n const themeProvider = document.querySelector('theme-provider');\n if (!themeProvider) {\n console.error(\"Theme provider is not initialized\");\n return;\n }\n \n if (customTheme.themePath) {\n themeProvider.setAttribute('theme-path', customTheme.themePath);\n }\n \n if (customTheme.themeObject) {\n (themeProvider as any).themeObject = customTheme.themeObject;\n }\n};\n\n// New function to toggle between light and dark themes\nexport const toggleTheme = function() {\n const themeProvider = document.querySelector('theme-provider');\n if (!themeProvider) {\n console.error(\"Theme provider is not initialized\");\n return;\n }\n\n // Use the built-in toggleTheme method of theme-provider\n themeProvider.toggleTheme();\n};\n\nif (typeof window !== 'undefined') {\n (window as any).initializeChat = initializeChat;\n (window as any).chatSidebarProps = customChatSidebar;\n (window as any).switchChatTheme = switchChatTheme;\n (window as any).applyCustomTheme = applyCustomTheme;\n (window as any).toggleTheme = toggleTheme; // Expose the toggle function\n}"]}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import FingerprintJS from "@fingerprintjs/fingerprintjs";
|
|
2
|
+
|
|
3
|
+
export const getDeviceID = async () => {
|
|
4
|
+
const fp = await FingerprintJS.load()
|
|
5
|
+
const result = await fp.get();
|
|
6
|
+
return result.visitorId
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export const getFormattedTime = (lastSeen, isLastSeen = false) => {
|
|
11
|
+
if (!lastSeen) return '';
|
|
12
|
+
|
|
13
|
+
if (lastSeen === '-1') {
|
|
14
|
+
return 'online';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
const timestamp = typeof lastSeen === 'string' ? parseInt(lastSeen) : lastSeen;
|
|
19
|
+
const date = new Date(timestamp);
|
|
20
|
+
|
|
21
|
+
if (isNaN(date.getTime())) {
|
|
22
|
+
return '';
|
|
23
|
+
}
|
|
24
|
+
const now = new Date();
|
|
25
|
+
const diffInSeconds = Math.floor((now - date) / 1000);
|
|
26
|
+
const diffInMinutes = Math.floor(diffInSeconds / 60);
|
|
27
|
+
const diffInHours = Math.floor(diffInMinutes / 60);
|
|
28
|
+
const diffInDays = Math.floor(diffInHours / 24);
|
|
29
|
+
|
|
30
|
+
const timeString = date.toLocaleTimeString([], {
|
|
31
|
+
hour: '2-digit',
|
|
32
|
+
minute: '2-digit',
|
|
33
|
+
hour12: true,
|
|
34
|
+
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
if (!isLastSeen) {
|
|
38
|
+
return date.toLocaleString([], { timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (diffInSeconds < 60) {
|
|
42
|
+
return 'last seen just now';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (date.getDate() === now.getDate() &&
|
|
46
|
+
date.getMonth() === now.getMonth() &&
|
|
47
|
+
date.getFullYear() === now.getFullYear()) {
|
|
48
|
+
return `last seen today at ${timeString}`;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const yesterday = new Date(now);
|
|
52
|
+
yesterday.setDate(yesterday.getDate() - 1);
|
|
53
|
+
if (date.getDate() === yesterday.getDate() &&
|
|
54
|
+
date.getMonth() === yesterday.getMonth() &&
|
|
55
|
+
date.getFullYear() === yesterday.getFullYear()) {
|
|
56
|
+
return `last seen yesterday at ${timeString}`;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (diffInDays < 7) {
|
|
60
|
+
const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
|
61
|
+
return `last seen ${days[date.getDay()]} at ${timeString}`;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return `last seen on ${date.toLocaleDateString([], { timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone })} at ${timeString}`;
|
|
65
|
+
|
|
66
|
+
} catch (error) {
|
|
67
|
+
console.error('Error formatting last seen date:', error);
|
|
68
|
+
return '';
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const getFormattedDeliveryTime = (timestamp) => {
|
|
73
|
+
if (timestamp === 0) return '----';
|
|
74
|
+
|
|
75
|
+
try {
|
|
76
|
+
const timeValue = typeof timestamp === 'string' ? parseInt(timestamp) : timestamp;
|
|
77
|
+
const date = new Date(timeValue);
|
|
78
|
+
|
|
79
|
+
if (isNaN(date.getTime())) return '';
|
|
80
|
+
|
|
81
|
+
const now = new Date();
|
|
82
|
+
const diffInSeconds = Math.floor((now - date) / 1000);
|
|
83
|
+
const timeString = date.toLocaleTimeString([], {
|
|
84
|
+
hour: '2-digit',
|
|
85
|
+
minute: '2-digit',
|
|
86
|
+
hour12: true,
|
|
87
|
+
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// Today case
|
|
91
|
+
if (date.getDate() === now.getDate() &&
|
|
92
|
+
date.getMonth() === now.getMonth() &&
|
|
93
|
+
date.getFullYear() === now.getFullYear()) {
|
|
94
|
+
return `Today at ${timeString}`;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Yesterday case
|
|
98
|
+
const yesterday = new Date(now);
|
|
99
|
+
yesterday.setDate(yesterday.getDate() - 1);
|
|
100
|
+
if (date.getDate() === yesterday.getDate() &&
|
|
101
|
+
date.getMonth() === yesterday.getMonth() &&
|
|
102
|
+
date.getFullYear() === yesterday.getFullYear()) {
|
|
103
|
+
return `Yesterday at ${timeString}`;
|
|
104
|
+
}
|
|
105
|
+
return `${date.toLocaleDateString([], { timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone })} at ${timeString}`;
|
|
106
|
+
|
|
107
|
+
} catch (error) {
|
|
108
|
+
console.error(`Error formatting date:`, error);
|
|
109
|
+
return '';
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export const debounce = (func, time) => {
|
|
114
|
+
let timeout;
|
|
115
|
+
return function executedFunction(...args) {
|
|
116
|
+
const later = () => {
|
|
117
|
+
clearTimeout(timeout);
|
|
118
|
+
func(...args);
|
|
119
|
+
};
|
|
120
|
+
clearTimeout(timeout);
|
|
121
|
+
timeout = setTimeout(later, time);
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export const parseMessageWithLink = (message = '') => {
|
|
126
|
+
if (!message) return { text: '', url: '' };
|
|
127
|
+
|
|
128
|
+
const urlRegex = /(https?:\/\/[^\s]+)/g;
|
|
129
|
+
const match = urlRegex.exec(message);
|
|
130
|
+
|
|
131
|
+
if (match) {
|
|
132
|
+
// Get the URL
|
|
133
|
+
const url = match[0];
|
|
134
|
+
|
|
135
|
+
// Get the text without the URL
|
|
136
|
+
const textBeforeUrl = message.substring(0, match.index);
|
|
137
|
+
const textAfterUrl = message.substring(match.index + url.length);
|
|
138
|
+
const text = textBeforeUrl + textAfterUrl;
|
|
139
|
+
|
|
140
|
+
return { text: text.trim(), url };
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return { text: message, url: '' };
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export const generateProfileImageByInitials = (name, height = 100, width = 100, fillColor = '#000000', textColor = '#ffffff') => {
|
|
147
|
+
const canvas = document.createElement('canvas')
|
|
148
|
+
canvas.width = width;
|
|
149
|
+
canvas.height = height;
|
|
150
|
+
|
|
151
|
+
const ctx = canvas.getContext('2d')
|
|
152
|
+
ctx.fillStyle = fillColor;
|
|
153
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
154
|
+
ctx.font = 'bold 40px Arial';
|
|
155
|
+
ctx.fillStyle = textColor;
|
|
156
|
+
ctx.textAlign = 'center';
|
|
157
|
+
ctx.textBaseline = 'middle';
|
|
158
|
+
|
|
159
|
+
let initials = '';
|
|
160
|
+
const nameParts = name?.trim()?.split(' ');
|
|
161
|
+
|
|
162
|
+
if (nameParts?.length >= 2) {
|
|
163
|
+
initials = nameParts?.[0]?.[0].toUpperCase() + nameParts?.[1]?.[0].toUpperCase();
|
|
164
|
+
} else if (nameParts?.length === 1) {
|
|
165
|
+
initials = nameParts?.[0]?.slice(0, 1)?.toUpperCase();
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
ctx.fillText(initials, canvas.width / 2, canvas.height / 2);
|
|
169
|
+
|
|
170
|
+
return canvas.toDataURL();
|
|
171
|
+
}
|
|
172
|
+
function deleteCookie(cookieName) {
|
|
173
|
+
document.cookie = `${cookieName}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`;
|
|
174
|
+
}
|
|
175
|
+
export const clearAll=() =>{
|
|
176
|
+
deleteCookie('userToken');
|
|
177
|
+
deleteCookie('isometrikUserId');
|
|
178
|
+
localStorage.removeItem('preferred-theme');
|
|
179
|
+
const url = new URL(window.location.href);
|
|
180
|
+
url.searchParams.delete('conversation');
|
|
181
|
+
window.history.pushState({}, '', url.toString());
|
|
182
|
+
window.location.reload();
|
|
183
|
+
}
|
|
184
|
+
export const convertSecondsToMinutes = (seconds) => {
|
|
185
|
+
try {
|
|
186
|
+
let minutes = Math.floor(seconds / 60);
|
|
187
|
+
let remainingSeconds = seconds % 60;
|
|
188
|
+
if (minutes < 10) {
|
|
189
|
+
minutes = `0${minutes}`
|
|
190
|
+
}
|
|
191
|
+
if (remainingSeconds < 10) {
|
|
192
|
+
remainingSeconds = `0${remainingSeconds}`
|
|
193
|
+
}
|
|
194
|
+
return `${minutes}:${remainingSeconds}`;
|
|
195
|
+
} catch (error) {
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export const getGroupcastUrlQuery = () =>{
|
|
200
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
201
|
+
const isGroupcast = urlParams.has('groupcast');
|
|
202
|
+
const groupcastId = urlParams.get('groupcast');
|
|
203
|
+
return { isGroupcast, groupcastId };
|
|
204
|
+
}
|
|
205
|
+
export default { getDeviceID, getFormattedTime, debounce, parseMessageWithLink, generateProfileImageByInitials, getFormattedDeliveryTime,convertSecondsToMinutes, getGroupcastUrlQuery }
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
|
|
3
|
+
export const processTextWithMentions = (
|
|
4
|
+
text = '',
|
|
5
|
+
mentionedUsers = [],
|
|
6
|
+
handleMentionClick = () => { },
|
|
7
|
+
isSelf = true
|
|
8
|
+
) => {
|
|
9
|
+
if (!text) return '';
|
|
10
|
+
|
|
11
|
+
const segments = [];
|
|
12
|
+
|
|
13
|
+
let remainingText = text;
|
|
14
|
+
|
|
15
|
+
for (const user of mentionedUsers || []) {
|
|
16
|
+
const userName = user?.userName;
|
|
17
|
+
if (!userName) continue;
|
|
18
|
+
|
|
19
|
+
const mention = `@${userName}`;
|
|
20
|
+
|
|
21
|
+
let parts = remainingText.split(mention);
|
|
22
|
+
if (parts.length <= 1) continue;
|
|
23
|
+
|
|
24
|
+
let newSegments = [];
|
|
25
|
+
let processedText = '';
|
|
26
|
+
|
|
27
|
+
for (let i = 0; i < parts.length; i++) {
|
|
28
|
+
if (parts[i]) {
|
|
29
|
+
newSegments.push({ type: 'text', content: parts[i] });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (i < parts.length - 1) {
|
|
33
|
+
newSegments.push({
|
|
34
|
+
type: 'mention',
|
|
35
|
+
content: mention,
|
|
36
|
+
user: user
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
segments.push(...newSegments);
|
|
42
|
+
remainingText = '';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (segments.length === 0 && text) {
|
|
46
|
+
segments.push({ type: 'text', content: text });
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const finalSegments = [];
|
|
50
|
+
for (const segment of segments) {
|
|
51
|
+
if (segment.type === 'text') {
|
|
52
|
+
const processedLinks = processLinks(segment.content);
|
|
53
|
+
finalSegments.push(...processedLinks);
|
|
54
|
+
} else {
|
|
55
|
+
finalSegments.push(segment);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return finalSegments.map(segment => {
|
|
60
|
+
if (segment.type === 'text') {
|
|
61
|
+
return segment.content;
|
|
62
|
+
} else if (segment.type === 'mention') {
|
|
63
|
+
return html`
|
|
64
|
+
<span
|
|
65
|
+
class="mention"
|
|
66
|
+
style="color: ${isSelf ? 'var(--text-outgoing-message)' : 'var(--text-incoming-message)'}; font-weight: bold;cursor: pointer;"
|
|
67
|
+
@click=${() => handleMentionClick(segment.user)}
|
|
68
|
+
>${segment.content}</span>
|
|
69
|
+
`;
|
|
70
|
+
} else if (segment.type === 'link') {
|
|
71
|
+
return html`
|
|
72
|
+
<a
|
|
73
|
+
href=${segment.url}
|
|
74
|
+
target="_blank"
|
|
75
|
+
rel="noopener noreferrer"
|
|
76
|
+
style="color: ${isSelf ? 'var(--text-outgoing-message)' : 'var(--text-incoming-message)'};"
|
|
77
|
+
>${segment.content}</a>
|
|
78
|
+
`;
|
|
79
|
+
}
|
|
80
|
+
return '';
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const processLinks = (text) => {
|
|
85
|
+
if (!text) return [{ type: 'text', content: '' }];
|
|
86
|
+
|
|
87
|
+
const urlRegex = /https?:\/\/[^\s]+/g;
|
|
88
|
+
let match;
|
|
89
|
+
let lastIndex = 0;
|
|
90
|
+
const segments = [];
|
|
91
|
+
|
|
92
|
+
if (!text.match(urlRegex)) {
|
|
93
|
+
return [{ type: 'text', content: text }];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
while ((match = urlRegex.exec(text)) !== null) {
|
|
97
|
+
if (match.index > lastIndex) {
|
|
98
|
+
segments.push({
|
|
99
|
+
type: 'text',
|
|
100
|
+
content: text.substring(lastIndex, match.index)
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const url = match[0];
|
|
105
|
+
|
|
106
|
+
segments.push({
|
|
107
|
+
type: 'link',
|
|
108
|
+
content: url,
|
|
109
|
+
url: url
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
lastIndex = match.index + url.length;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (lastIndex < text.length) {
|
|
116
|
+
segments.push({
|
|
117
|
+
type: 'text',
|
|
118
|
+
content: text.substring(lastIndex)
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return segments;
|
|
123
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createStore } from "@stencil/store";
|
|
2
|
+
const { state, onChange } = createStore({
|
|
3
|
+
conversationTitle: '',
|
|
4
|
+
conversationId: '',
|
|
5
|
+
isGroup: false,
|
|
6
|
+
conversationImageUrl: '',
|
|
7
|
+
opponentDetails: {
|
|
8
|
+
userName: '',
|
|
9
|
+
userProfileImageUrl: ''
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
export const conversationStore = {
|
|
13
|
+
state,
|
|
14
|
+
// Update conversation title
|
|
15
|
+
updateTitle(newTitle) {
|
|
16
|
+
state.conversationTitle = newTitle;
|
|
17
|
+
},
|
|
18
|
+
// Update entire conversation details
|
|
19
|
+
updateConversationDetails(details) {
|
|
20
|
+
Object.assign(state, details);
|
|
21
|
+
},
|
|
22
|
+
// Subscribe to changes
|
|
23
|
+
onChange: onChange
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=conversation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../src/store/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAa7C,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,WAAW,CAAoB;IACzD,iBAAiB,EAAE,EAAE;IACrB,cAAc,EAAE,EAAE;IAClB,OAAO,EAAE,KAAK;IACd,oBAAoB,EAAE,EAAE;IACxB,eAAe,EAAE;QACf,QAAQ,EAAE,EAAE;QACZ,mBAAmB,EAAE,EAAE;KACxB;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,KAAK;IAEL,4BAA4B;IAC5B,WAAW,CAAC,QAAgB;QAC1B,KAAK,CAAC,iBAAiB,GAAG,QAAQ,CAAC;IACrC,CAAC;IAED,qCAAqC;IACrC,yBAAyB,CAAC,OAAmC;QAC3D,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAChC,CAAC;IAED,uBAAuB;IACvB,QAAQ,EAAE,QAAQ;CACnB,CAAC","sourcesContent":["import { createStore } from \"@stencil/store\";\n\ninterface ConversationState {\n conversationTitle: string;\n conversationId: string;\n isGroup: boolean;\n conversationImageUrl: string;\n opponentDetails?: {\n userName: string;\n userProfileImageUrl: string;\n };\n}\n\nconst { state, onChange } = createStore<ConversationState>({\n conversationTitle: '',\n conversationId: '',\n isGroup: false,\n conversationImageUrl: '',\n opponentDetails: {\n userName: '',\n userProfileImageUrl: ''\n }\n});\n\nexport const conversationStore = {\n state,\n \n // Update conversation title\n updateTitle(newTitle: string) {\n state.conversationTitle = newTitle;\n },\n\n // Update entire conversation details\n updateConversationDetails(details: Partial<ConversationState>) {\n Object.assign(state, details);\n },\n\n // Subscribe to changes\n onChange: onChange\n}; "]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createStore } from "@stencil/store";
|
|
2
|
+
const { state } = createStore({
|
|
3
|
+
members: [],
|
|
4
|
+
currentConversationId: null
|
|
5
|
+
});
|
|
6
|
+
export const groupMembersStore = {
|
|
7
|
+
state,
|
|
8
|
+
initializeMembers(members, conversationId) {
|
|
9
|
+
state.members = members;
|
|
10
|
+
state.currentConversationId = conversationId;
|
|
11
|
+
},
|
|
12
|
+
updateAdminStatus(userId, isAdmin) {
|
|
13
|
+
state.members = state.members.map(member => {
|
|
14
|
+
return member.userId === userId ? Object.assign(Object.assign({}, member), { isAdmin }) : member;
|
|
15
|
+
});
|
|
16
|
+
},
|
|
17
|
+
getMembers() {
|
|
18
|
+
return state.members;
|
|
19
|
+
},
|
|
20
|
+
getCurrentConversationId() {
|
|
21
|
+
return state.currentConversationId;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=group-members.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-members.js","sourceRoot":"","sources":["../../src/store/group-members.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAc7C,MAAM,EAAE,KAAK,EAAE,GAAG,WAAW,CAAoB;IAC/C,OAAO,EAAE,EAAE;IACX,qBAAqB,EAAE,IAAI;CAC5B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,KAAK;IAEL,iBAAiB,CAAC,OAAsB,EAAE,cAAsB;QAC9D,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;QACxB,KAAK,CAAC,qBAAqB,GAAG,cAAc,CAAC;IAC/C,CAAC;IAED,iBAAiB,CAAC,MAAc,EAAE,OAAgB;QAChD,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YACzC,OAAO,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,iCAAM,MAAM,KAAE,OAAO,IAAG,CAAC,CAAC,MAAM,CAAC;QACpE,CAAC,CAAC,CAAC;IACL,CAAC;IAED,UAAU;QACR,OAAO,KAAK,CAAC,OAAO,CAAC;IACvB,CAAC;IAED,wBAAwB;QACtB,OAAO,KAAK,CAAC,qBAAqB,CAAC;IACrC,CAAC;CACF,CAAC","sourcesContent":["import { createStore } from \"@stencil/store\";\n\ninterface GroupMember {\n userId: string;\n userName: string;\n userProfileImageUrl: string;\n isAdmin: boolean;\n}\n\ninterface GroupMembersState {\n members: GroupMember[];\n currentConversationId: string | null;\n}\n\nconst { state } = createStore<GroupMembersState>({\n members: [],\n currentConversationId: null\n});\n\nexport const groupMembersStore = {\n state,\n\n initializeMembers(members: GroupMember[], conversationId: string) {\n state.members = members;\n state.currentConversationId = conversationId;\n },\n\n updateAdminStatus(userId: string, isAdmin: boolean) {\n state.members = state.members.map(member => {\n return member.userId === userId ? { ...member, isAdmin } : member;\n });\n },\n\n getMembers() {\n return state.members;\n },\n\n getCurrentConversationId() {\n return state.currentConversationId;\n }\n};"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createStore } from "@stencil/store";
|
|
2
|
+
const { state, onChange } = createStore({
|
|
3
|
+
totalUnreadCount: 0
|
|
4
|
+
});
|
|
5
|
+
export const unreadCountStore = {
|
|
6
|
+
state,
|
|
7
|
+
// Update total unread count
|
|
8
|
+
updateTotalUnreadCount(count) {
|
|
9
|
+
state.totalUnreadCount = count;
|
|
10
|
+
},
|
|
11
|
+
// Get current unread count
|
|
12
|
+
getTotalUnreadCount() {
|
|
13
|
+
return state.totalUnreadCount;
|
|
14
|
+
},
|
|
15
|
+
// Subscribe to changes
|
|
16
|
+
onChange: onChange
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=unread-count.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unread-count.js","sourceRoot":"","sources":["../../src/store/unread-count.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAM7C,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,WAAW,CAAmB;IACxD,gBAAgB,EAAE,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,KAAK;IAEL,4BAA4B;IAC5B,sBAAsB,CAAC,KAAa;QAClC,KAAK,CAAC,gBAAgB,GAAG,KAAK,CAAC;IACjC,CAAC;IAED,2BAA2B;IAC3B,mBAAmB;QACjB,OAAO,KAAK,CAAC,gBAAgB,CAAC;IAChC,CAAC;IAED,uBAAuB;IACvB,QAAQ,EAAE,QAAQ;CACnB,CAAC","sourcesContent":["import { createStore } from \"@stencil/store\";\n\ninterface UnreadCountState {\n totalUnreadCount: number;\n}\n\nconst { state, onChange } = createStore<UnreadCountState>({\n totalUnreadCount: 0\n});\n\nexport const unreadCountStore = {\n state,\n \n // Update total unread count\n updateTotalUnreadCount(count: number) {\n state.totalUnreadCount = count;\n },\n\n // Get current unread count\n getTotalUnreadCount() {\n return state.totalUnreadCount;\n },\n\n // Subscribe to changes\n onChange: onChange\n}; "]}
|