@webinex/chatify 1.0.3-rc3 → 2.0.0-alpha10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Chatify-DGRV4QKP.js +2203 -0
- package/dist/Chatify-DGRV4QKP.js.map +1 -0
- package/dist/Chatify.css +670 -0
- package/dist/audit.css +60 -0
- package/dist/audit.js +242 -0
- package/dist/audit.js.map +1 -0
- package/dist/index.js +97 -0
- package/dist/index.js.map +1 -0
- package/dist/types/audit/AuditChatList.d.ts +9 -0
- package/dist/types/audit/AuditConversationPanel.d.ts +10 -0
- package/dist/types/audit/AuditPanel.d.ts +14 -0
- package/dist/types/audit/AuditPanelCustomizeValue.d.ts +9 -0
- package/dist/types/audit/AuditSearch.d.ts +5 -0
- package/dist/types/audit/AuditSearchValue.d.ts +14 -0
- package/dist/types/audit/auditApi.d.ts +97 -0
- package/dist/types/audit/index.d.ts +17 -0
- package/dist/types/core/api/api.d.ts +17295 -0
- package/dist/types/core/api/baseApi.d.ts +15 -0
- package/dist/types/core/api/index.d.ts +1 -0
- package/dist/types/core/client.d.ts +86 -0
- package/dist/types/core/constants.d.ts +1 -0
- package/dist/types/core/debounce.d.ts +27 -0
- package/dist/types/core/index.d.ts +4 -0
- package/dist/types/core/types.d.ts +127 -0
- package/dist/{esm/types → types}/index.d.ts +0 -1
- package/dist/types/ui/Chat/ChatContext.d.ts +10 -0
- package/dist/types/ui/Chat/ChatEditableHeaderName.d.ts +1 -0
- package/dist/types/ui/Chat/ChatHeaderActions.d.ts +1 -0
- package/dist/types/ui/Chat/ChatPanel.d.ts +13 -0
- package/dist/types/ui/Chat/ChatView.d.ts +16 -0
- package/dist/types/ui/Chat/Members/ChatMembersButton.d.ts +1 -0
- package/dist/types/ui/Chat/Members/ChatMembersPanel.d.ts +1 -0
- package/dist/types/ui/Chat/Members/ChatMembersPreview.d.ts +1 -0
- package/dist/types/ui/Chat/Members/index.d.ts +11 -0
- package/dist/types/ui/Chat/index.d.ts +6 -0
- package/dist/types/ui/ChatGroup/ChatGroupContext.d.ts +12 -0
- package/dist/types/ui/ChatGroup/ChatGroupPanel.d.ts +15 -0
- package/dist/types/ui/ChatGroup/Create/CreateChatButton.d.ts +1 -0
- package/dist/{esm/types/ui/CreateChatPanel → types/ui/ChatGroup/Create}/CreateChatForm.d.ts +1 -2
- package/dist/types/ui/ChatGroup/Create/CreateChatMemberInput.d.ts +4 -0
- package/dist/types/ui/ChatGroup/Create/CreateChatNameInput.d.ts +4 -0
- package/dist/types/ui/ChatGroup/Create/CreateChatPanel.d.ts +1 -0
- package/dist/types/ui/ChatGroup/Create/index.d.ts +17 -0
- package/dist/types/ui/ChatGroup/Layout/ChatGroupAside.d.ts +1 -0
- package/dist/types/ui/ChatGroup/Layout/ChatGroupBody.d.ts +1 -0
- package/dist/types/ui/ChatGroup/Layout/ChatGroupFooter.d.ts +1 -0
- package/dist/types/ui/ChatGroup/Layout/ChatGroupHeader.d.ts +1 -0
- package/dist/types/ui/ChatGroup/Layout/ChatGroupMain.d.ts +1 -0
- package/dist/types/ui/ChatGroup/Layout/index.d.ts +17 -0
- package/dist/types/ui/ChatGroup/List/ChatListPanel.d.ts +1 -0
- package/dist/types/ui/ChatGroup/List/index.d.ts +6 -0
- package/dist/types/ui/ChatGroup/index.d.ts +5 -0
- package/dist/types/ui/Chatify.d.ts +9 -0
- package/dist/types/ui/Conversation/Conversation.d.ts +22 -0
- package/dist/types/ui/Conversation/ConversationActions.d.ts +1 -0
- package/dist/types/ui/Conversation/ConversationBody.d.ts +1 -0
- package/dist/types/ui/Conversation/ConversationContext.d.ts +23 -0
- package/dist/types/ui/Conversation/ConversationHeader.d.ts +1 -0
- package/dist/types/ui/Conversation/ConversationName.d.ts +1 -0
- package/dist/types/ui/Conversation/InputBox/InputBox.d.ts +1 -0
- package/dist/types/ui/Conversation/InputBox/InputBoxFile.d.ts +7 -0
- package/dist/types/ui/Conversation/InputBox/InputBoxFileList.d.ts +7 -0
- package/dist/types/ui/Conversation/InputBox/InputFilesBox.d.ts +11 -0
- package/dist/types/ui/Conversation/InputBox/InputSubmitButtonBox.d.ts +6 -0
- package/dist/types/ui/Conversation/InputBox/InputTextBox.d.ts +9 -0
- package/dist/types/ui/Conversation/InputBox/index.d.ts +21 -0
- package/dist/types/ui/Conversation/Message/MessageAuthor.d.ts +2 -0
- package/dist/types/ui/Conversation/Message/MessageBox.d.ts +5 -0
- package/dist/types/ui/Conversation/Message/MessageContent.d.ts +2 -0
- package/dist/types/ui/Conversation/Message/MessageFile.d.ts +5 -0
- package/dist/types/ui/Conversation/Message/MessageFileList.d.ts +2 -0
- package/dist/types/ui/Conversation/Message/MessageInfoBox.d.ts +2 -0
- package/dist/{esm/types/ui → types/ui/Conversation}/Message/MessageRow.d.ts +1 -1
- package/dist/types/ui/Conversation/Message/MessageText.d.ts +2 -0
- package/dist/types/ui/Conversation/Message/index.d.ts +26 -0
- package/dist/types/ui/Conversation/NextObserver/NextMessagesObserver.d.ts +5 -0
- package/dist/types/ui/Conversation/NextObserver/index.d.ts +1 -0
- package/dist/types/ui/Conversation/ReadObserver/MessageReadObserver.d.ts +6 -0
- package/dist/types/ui/Conversation/ReadObserver/index.d.ts +1 -0
- package/dist/types/ui/Conversation/SendingMessage/SendingMessageBox.d.ts +6 -0
- package/dist/types/ui/Conversation/SendingMessage/SendingMessageContent.d.ts +2 -0
- package/dist/types/ui/Conversation/SendingMessage/SendingMessageInfoBox.d.ts +2 -0
- package/dist/types/ui/Conversation/SendingMessage/SendingMessageText.d.ts +2 -0
- package/dist/types/ui/Conversation/SendingMessage/index.d.ts +14 -0
- package/dist/types/ui/Conversation/SystemMessage/SystemMessageBox.d.ts +5 -0
- package/dist/types/ui/Conversation/SystemMessage/SystemMessageRow.d.ts +9 -0
- package/dist/types/ui/Conversation/SystemMessage/index.d.ts +8 -0
- package/dist/types/ui/Conversation/index.d.ts +12 -0
- package/dist/types/ui/Thread/ThreadActions.d.ts +1 -0
- package/dist/types/ui/Thread/ThreadContext.d.ts +8 -0
- package/dist/types/ui/Thread/ThreadPanel.d.ts +14 -0
- package/dist/types/ui/Thread/index.d.ts +3 -0
- package/dist/types/ui/color.d.ts +6 -0
- package/dist/types/ui/common/Avatar.d.ts +5 -0
- package/dist/types/ui/common/ChatList/ChatList.d.ts +16 -0
- package/dist/types/ui/common/ChatList/ChatListItemAvatar.d.ts +2 -0
- package/dist/types/ui/common/ChatList/ChatListItemBox.d.ts +9 -0
- package/dist/types/ui/common/ChatList/ChatListItemLastMessage.d.ts +2 -0
- package/dist/types/ui/common/ChatList/ChatListItemLastMessageAuthor.d.ts +2 -0
- package/dist/types/ui/common/ChatList/ChatListItemLastMessageContent.d.ts +2 -0
- package/dist/types/ui/common/ChatList/ChatListItemLastMessageSentAt.d.ts +2 -0
- package/dist/types/ui/common/ChatList/ChatListItemName.d.ts +2 -0
- package/dist/types/ui/common/ChatList/ChatListItemUnreadCount.d.ts +2 -0
- package/dist/types/ui/common/ChatList/ChatListValue.d.ts +8 -0
- package/dist/types/ui/common/ChatList/index.d.ts +30 -0
- package/dist/types/ui/common/Icon.d.ts +21 -0
- package/dist/types/ui/common/MessageSkeleton.d.ts +4 -0
- package/dist/types/ui/common/index.d.ts +12 -0
- package/dist/types/ui/customize.d.ts +9 -0
- package/dist/types/ui/index.d.ts +9 -0
- package/dist/{esm/types → types}/ui/localizer.d.ts +14 -8
- package/dist/types/ui/useFormatter.d.ts +3 -0
- package/package.json +81 -92
- package/src/audit/AuditChatList.tsx +25 -0
- package/src/audit/AuditConversationPanel.tsx +48 -0
- package/src/audit/AuditPanel.tsx +76 -0
- package/src/audit/AuditPanelCustomizeValue.ts +11 -0
- package/src/audit/AuditSearch.tsx +89 -0
- package/src/audit/AuditSearchValue.tsx +42 -0
- package/src/audit/auditApi.tsx +113 -0
- package/src/audit/index.d.ts +18 -0
- package/src/audit/index.tsx +28 -0
- package/src/audit/styles.scss +72 -0
- package/src/core/api/api.ts +655 -0
- package/src/core/api/baseApi.ts +38 -0
- package/src/core/api/index.ts +1 -0
- package/src/core/client.ts +287 -143
- package/src/core/constants.ts +1 -0
- package/src/core/debounce.ts +90 -0
- package/src/core/index.ts +4 -17
- package/src/core/types.tsx +182 -0
- package/src/index.ts +2 -3
- package/src/styles/aside.scss +26 -132
- package/src/styles/chat-list.scss +138 -0
- package/src/styles/chat.scss +11 -211
- package/src/styles/conversation.scss +200 -0
- package/src/styles/index.scss +161 -108
- package/src/styles/input.scss +148 -72
- package/src/styles/keyframes.scss +14 -14
- package/src/styles/members.scss +13 -0
- package/src/styles/mixins.scss +25 -20
- package/src/styles/variables.scss +13 -10
- package/src/ui/Chat/ChatContext.tsx +30 -0
- package/src/ui/{ChatPanel/ChatHeaderName.tsx → Chat/ChatEditableHeaderName.tsx} +63 -69
- package/src/ui/Chat/ChatHeaderActions.tsx +19 -0
- package/src/ui/Chat/ChatPanel.tsx +30 -0
- package/src/ui/Chat/ChatView.tsx +115 -0
- package/src/ui/Chat/Members/ChatMembersButton.tsx +9 -0
- package/src/ui/{ChatPanel → Chat/Members}/ChatMembersPanel.tsx +112 -121
- package/src/ui/Chat/Members/ChatMembersPreview.tsx +25 -0
- package/src/ui/Chat/Members/index.ts +13 -0
- package/src/ui/Chat/index.ts +6 -0
- package/src/ui/ChatGroup/ChatGroupContext.tsx +50 -0
- package/src/ui/ChatGroup/ChatGroupPanel.tsx +73 -0
- package/src/ui/ChatGroup/Create/CreateChatButton.tsx +15 -0
- package/src/ui/{CreateChatPanel → ChatGroup/Create}/CreateChatForm.tsx +36 -36
- package/src/ui/{CreateChatPanel → ChatGroup/Create}/CreateChatMemberInput.tsx +65 -66
- package/src/ui/{CreateChatPanel → ChatGroup/Create}/CreateChatNameInput.tsx +25 -25
- package/src/ui/{CreateChatPanel → ChatGroup/Create}/CreateChatPanel.tsx +45 -49
- package/src/ui/ChatGroup/Create/index.ts +19 -0
- package/src/ui/ChatGroup/Layout/ChatGroupAside.tsx +12 -0
- package/src/ui/ChatGroup/Layout/ChatGroupBody.tsx +10 -0
- package/src/ui/ChatGroup/Layout/ChatGroupFooter.tsx +3 -0
- package/src/ui/ChatGroup/Layout/ChatGroupHeader.tsx +5 -0
- package/src/ui/ChatGroup/Layout/ChatGroupMain.tsx +17 -0
- package/src/ui/ChatGroup/Layout/index.ts +19 -0
- package/src/ui/ChatGroup/List/ChatListPanel.tsx +28 -0
- package/src/ui/ChatGroup/List/index.ts +8 -0
- package/src/ui/ChatGroup/index.ts +5 -0
- package/src/ui/Chatify.tsx +15 -154
- package/src/ui/Conversation/Conversation.tsx +92 -0
- package/src/ui/Conversation/ConversationActions.tsx +12 -0
- package/src/ui/Conversation/ConversationBody.tsx +28 -0
- package/src/ui/Conversation/ConversationContext.ts +30 -0
- package/src/ui/Conversation/ConversationHeader.tsx +19 -0
- package/src/ui/Conversation/ConversationName.tsx +7 -0
- package/src/ui/Conversation/InputBox/InputBox.tsx +126 -0
- package/src/ui/Conversation/InputBox/InputBoxFile.tsx +38 -0
- package/src/ui/Conversation/InputBox/InputBoxFileList.tsx +21 -0
- package/src/ui/Conversation/InputBox/InputFilesBox.tsx +78 -0
- package/src/ui/Conversation/InputBox/InputSubmitButtonBox.tsx +26 -0
- package/src/ui/{InputBox → Conversation/InputBox}/InputTextBox.tsx +61 -51
- package/src/ui/Conversation/InputBox/index.ts +23 -0
- package/src/ui/{Message → Conversation/Message}/MessageAuthor.tsx +13 -13
- package/src/ui/{Message → Conversation/Message}/MessageBox.tsx +20 -20
- package/src/ui/{Message → Conversation/Message}/MessageContent.tsx +15 -11
- package/src/ui/Conversation/Message/MessageFile.tsx +54 -0
- package/src/ui/Conversation/Message/MessageFileList.tsx +14 -0
- package/src/ui/{Message → Conversation/Message}/MessageInfoBox.tsx +28 -26
- package/src/ui/{Message → Conversation/Message}/MessageRow.tsx +28 -28
- package/src/ui/{Message → Conversation/Message}/MessageText.tsx +7 -7
- package/src/ui/Conversation/Message/index.ts +28 -0
- package/src/ui/{Next.tsx → Conversation/NextObserver/NextMessagesObserver.tsx} +47 -48
- package/src/ui/Conversation/NextObserver/index.ts +1 -0
- package/src/ui/{MessageReadObserver.tsx → Conversation/ReadObserver/MessageReadObserver.tsx} +49 -45
- package/src/ui/Conversation/ReadObserver/index.ts +1 -0
- package/src/ui/{SendingMessage → Conversation/SendingMessage}/SendingMessageBox.tsx +16 -16
- package/src/ui/{SendingMessage → Conversation/SendingMessage}/SendingMessageContent.tsx +13 -13
- package/src/ui/{SendingMessage → Conversation/SendingMessage}/SendingMessageInfoBox.tsx +13 -13
- package/src/ui/{SendingMessage → Conversation/SendingMessage}/SendingMessageText.tsx +7 -7
- package/src/ui/Conversation/SendingMessage/index.ts +16 -0
- package/src/ui/{SystemMessage → Conversation/SystemMessage}/SystemMessageBox.tsx +20 -20
- package/src/ui/Conversation/SystemMessage/SystemMessageRow.tsx +28 -0
- package/src/ui/Conversation/SystemMessage/index.ts +10 -0
- package/src/ui/Conversation/index.ts +13 -0
- package/src/ui/Thread/ThreadActions.tsx +22 -0
- package/src/ui/Thread/ThreadContext.ts +13 -0
- package/src/ui/Thread/ThreadPanel.tsx +127 -0
- package/src/ui/Thread/index.tsx +3 -0
- package/src/ui/color.ts +20 -0
- package/src/ui/common/Avatar.tsx +20 -0
- package/src/ui/common/ChatList/ChatList.tsx +84 -0
- package/src/ui/common/ChatList/ChatListItemAvatar.tsx +22 -0
- package/src/ui/common/ChatList/ChatListItemBox.tsx +32 -0
- package/src/ui/{ChatList → common/ChatList}/ChatListItemLastMessage.tsx +15 -15
- package/src/ui/common/ChatList/ChatListItemLastMessageAuthor.tsx +15 -0
- package/src/ui/common/ChatList/ChatListItemLastMessageContent.tsx +21 -0
- package/src/ui/{ChatList → common/ChatList}/ChatListItemLastMessageSentAt.tsx +22 -22
- package/src/ui/common/ChatList/ChatListItemName.tsx +8 -0
- package/src/ui/{ChatList → common/ChatList}/ChatListItemUnreadCount.tsx +12 -12
- package/src/ui/common/ChatList/ChatListValue.ts +9 -0
- package/src/ui/common/ChatList/index.ts +32 -0
- package/src/ui/common/Icon.tsx +46 -0
- package/src/ui/{MessageSkeleton.tsx → common/MessageSkeleton.tsx} +20 -19
- package/src/ui/common/index.ts +14 -0
- package/src/ui/customize.tsx +51 -45
- package/src/ui/index.ts +11 -11
- package/src/ui/localizer.tsx +108 -84
- package/src/ui/useFormatter.tsx +17 -0
- package/dist/css/chatify.css +0 -528
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/types/ChatifyContext.d.ts +0 -11
- package/dist/esm/types/core/action.d.ts +0 -151
- package/dist/esm/types/core/client.d.ts +0 -36
- package/dist/esm/types/core/index.d.ts +0 -17
- package/dist/esm/types/core/models.d.ts +0 -70
- package/dist/esm/types/core/reducer.d.ts +0 -11
- package/dist/esm/types/core/state.d.ts +0 -55
- package/dist/esm/types/core/useAddChatMutation.d.ts +0 -2
- package/dist/esm/types/core/useAddMemberMutation.d.ts +0 -2
- package/dist/esm/types/core/useFetchNextMutation.d.ts +0 -3
- package/dist/esm/types/core/useGetAccountsQuery.d.ts +0 -3
- package/dist/esm/types/core/useGetChatListQuery.d.ts +0 -3
- package/dist/esm/types/core/useGetChatQuery.d.ts +0 -5
- package/dist/esm/types/core/useGetMessagesQuery.d.ts +0 -4
- package/dist/esm/types/core/useReadMonitor.d.ts +0 -1
- package/dist/esm/types/core/useRemoveMemberMutation.d.ts +0 -2
- package/dist/esm/types/core/useSendMutation.d.ts +0 -2
- package/dist/esm/types/core/useSignalRMonitor.d.ts +0 -2
- package/dist/esm/types/core/useUpdateChatNameMutation.d.ts +0 -2
- package/dist/esm/types/ui/AddChatButton.d.ts +0 -2
- package/dist/esm/types/ui/Avatar.d.ts +0 -6
- package/dist/esm/types/ui/ChatList/ChatList.d.ts +0 -2
- package/dist/esm/types/ui/ChatList/ChatListItemBox.d.ts +0 -6
- package/dist/esm/types/ui/ChatList/ChatListItemLastMessage.d.ts +0 -3
- package/dist/esm/types/ui/ChatList/ChatListItemLastMessageAuthor.d.ts +0 -3
- package/dist/esm/types/ui/ChatList/ChatListItemLastMessageContent.d.ts +0 -3
- package/dist/esm/types/ui/ChatList/ChatListItemLastMessageSentAt.d.ts +0 -3
- package/dist/esm/types/ui/ChatList/ChatListItemName.d.ts +0 -3
- package/dist/esm/types/ui/ChatList/ChatListItemUnreadCount.d.ts +0 -3
- package/dist/esm/types/ui/ChatList/index.d.ts +0 -8
- package/dist/esm/types/ui/ChatName.d.ts +0 -5
- package/dist/esm/types/ui/ChatPanel/ChatBody.d.ts +0 -5
- package/dist/esm/types/ui/ChatPanel/ChatHeader.d.ts +0 -5
- package/dist/esm/types/ui/ChatPanel/ChatHeaderMembers.d.ts +0 -5
- package/dist/esm/types/ui/ChatPanel/ChatHeaderName.d.ts +0 -5
- package/dist/esm/types/ui/ChatPanel/ChatMembersButton.d.ts +0 -5
- package/dist/esm/types/ui/ChatPanel/ChatMembersPanel.d.ts +0 -5
- package/dist/esm/types/ui/ChatPanel/ChatPanel.d.ts +0 -5
- package/dist/esm/types/ui/ChatPanel/index.d.ts +0 -6
- package/dist/esm/types/ui/Chatify.d.ts +0 -72
- package/dist/esm/types/ui/CreateChatPanel/CreateChatMemberInput.d.ts +0 -5
- package/dist/esm/types/ui/CreateChatPanel/CreateChatNameInput.d.ts +0 -5
- package/dist/esm/types/ui/CreateChatPanel/CreateChatPanel.d.ts +0 -2
- package/dist/esm/types/ui/CreateChatPanel/index.d.ts +0 -4
- package/dist/esm/types/ui/Icon.d.ts +0 -17
- package/dist/esm/types/ui/InputBox/InputBox.d.ts +0 -2
- package/dist/esm/types/ui/InputBox/InputFilesBox.d.ts +0 -2
- package/dist/esm/types/ui/InputBox/InputSubmitButtonBox.d.ts +0 -5
- package/dist/esm/types/ui/InputBox/InputTextBox.d.ts +0 -7
- package/dist/esm/types/ui/InputBox/index.d.ts +0 -4
- package/dist/esm/types/ui/Layout/Aside.d.ts +0 -2
- package/dist/esm/types/ui/Layout/Body.d.ts +0 -2
- package/dist/esm/types/ui/Layout/Footer.d.ts +0 -2
- package/dist/esm/types/ui/Layout/Header.d.ts +0 -2
- package/dist/esm/types/ui/Layout/Main.d.ts +0 -2
- package/dist/esm/types/ui/Layout/index.d.ts +0 -5
- package/dist/esm/types/ui/Message/MessageAuthor.d.ts +0 -3
- package/dist/esm/types/ui/Message/MessageBox.d.ts +0 -6
- package/dist/esm/types/ui/Message/MessageContent.d.ts +0 -3
- package/dist/esm/types/ui/Message/MessageInfoBox.d.ts +0 -3
- package/dist/esm/types/ui/Message/MessageText.d.ts +0 -3
- package/dist/esm/types/ui/Message/index.d.ts +0 -6
- package/dist/esm/types/ui/MessageReadObserver.d.ts +0 -6
- package/dist/esm/types/ui/MessageSkeleton.d.ts +0 -4
- package/dist/esm/types/ui/Next.d.ts +0 -4
- package/dist/esm/types/ui/SendingMessage/SendingMessageBox.d.ts +0 -7
- package/dist/esm/types/ui/SendingMessage/SendingMessageContent.d.ts +0 -3
- package/dist/esm/types/ui/SendingMessage/SendingMessageInfoBox.d.ts +0 -3
- package/dist/esm/types/ui/SendingMessage/SendingMessageText.d.ts +0 -3
- package/dist/esm/types/ui/SendingMessage/index.d.ts +0 -4
- package/dist/esm/types/ui/SystemMessage/SystemMessageBox.d.ts +0 -6
- package/dist/esm/types/ui/SystemMessage/SystemMessageRow.d.ts +0 -9
- package/dist/esm/types/ui/SystemMessage/index.d.ts +0 -2
- package/dist/esm/types/ui/customize.d.ts +0 -11
- package/dist/esm/types/ui/index.d.ts +0 -11
- package/dist/esm/types/util/index.d.ts +0 -2
- package/dist/esm/types/util/uniqBy.d.ts +0 -1
- package/dist/esm/types/util/uniqId.d.ts +0 -1
- package/dist/index.d.ts +0 -637
- package/src/ChatifyContext.tsx +0 -41
- package/src/core/action.tsx +0 -431
- package/src/core/models.tsx +0 -82
- package/src/core/reducer.tsx +0 -87
- package/src/core/state.ts +0 -93
- package/src/core/useAddChatMutation.tsx +0 -28
- package/src/core/useAddMemberMutation.tsx +0 -25
- package/src/core/useFetchNextMutation.tsx +0 -28
- package/src/core/useGetAccountsQuery.tsx +0 -30
- package/src/core/useGetChatListQuery.tsx +0 -30
- package/src/core/useGetChatQuery.tsx +0 -31
- package/src/core/useGetMessagesQuery.tsx +0 -35
- package/src/core/useReadMonitor.tsx +0 -32
- package/src/core/useRemoveMemberMutation.tsx +0 -23
- package/src/core/useSendMutation.tsx +0 -24
- package/src/core/useSignalRMonitor.tsx +0 -66
- package/src/core/useUpdateChatNameMutation.tsx +0 -23
- package/src/ui/AddChatButton.tsx +0 -17
- package/src/ui/Avatar.tsx +0 -18
- package/src/ui/ChatList/ChatList.tsx +0 -42
- package/src/ui/ChatList/ChatListItemBox.tsx +0 -22
- package/src/ui/ChatList/ChatListItemLastMessageAuthor.tsx +0 -20
- package/src/ui/ChatList/ChatListItemLastMessageContent.tsx +0 -21
- package/src/ui/ChatList/ChatListItemName.tsx +0 -13
- package/src/ui/ChatList/index.ts +0 -8
- package/src/ui/ChatName.tsx +0 -10
- package/src/ui/ChatPanel/ChatBody.tsx +0 -44
- package/src/ui/ChatPanel/ChatHeader.tsx +0 -31
- package/src/ui/ChatPanel/ChatHeaderMembers.tsx +0 -28
- package/src/ui/ChatPanel/ChatMembersButton.tsx +0 -21
- package/src/ui/ChatPanel/ChatPanel.tsx +0 -27
- package/src/ui/ChatPanel/index.ts +0 -6
- package/src/ui/CreateChatPanel/index.ts +0 -4
- package/src/ui/Icon.tsx +0 -35
- package/src/ui/InputBox/InputBox.tsx +0 -38
- package/src/ui/InputBox/InputFilesBox.tsx +0 -9
- package/src/ui/InputBox/InputSubmitButtonBox.tsx +0 -17
- package/src/ui/InputBox/index.ts +0 -4
- package/src/ui/Layout/Aside.tsx +0 -12
- package/src/ui/Layout/Body.tsx +0 -10
- package/src/ui/Layout/Footer.tsx +0 -3
- package/src/ui/Layout/Header.tsx +0 -5
- package/src/ui/Layout/Main.tsx +0 -15
- package/src/ui/Layout/index.ts +0 -5
- package/src/ui/Message/index.ts +0 -6
- package/src/ui/SendingMessage/index.ts +0 -4
- package/src/ui/SystemMessage/SystemMessageRow.tsx +0 -43
- package/src/ui/SystemMessage/index.ts +0 -2
- package/src/util/index.ts +0 -2
- package/src/util/uniqBy.tsx +0 -17
- package/src/util/uniqId.tsx +0 -3
package/dist/css/chatify.css
DELETED
|
@@ -1,528 +0,0 @@
|
|
|
1
|
-
@keyframes fadeInFromNone {
|
|
2
|
-
0% {
|
|
3
|
-
display: none;
|
|
4
|
-
opacity: 0;
|
|
5
|
-
}
|
|
6
|
-
1% {
|
|
7
|
-
opacity: 0;
|
|
8
|
-
}
|
|
9
|
-
100% {
|
|
10
|
-
opacity: 1;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
.wxchtf-aside {
|
|
14
|
-
flex: none;
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-flow: column nowrap;
|
|
17
|
-
background: #ffffff;
|
|
18
|
-
border-top-left-radius: 24px;
|
|
19
|
-
border-bottom-left-radius: 24px;
|
|
20
|
-
padding-top: 15px;
|
|
21
|
-
width: 320px;
|
|
22
|
-
position: relative;
|
|
23
|
-
overflow: hidden;
|
|
24
|
-
}
|
|
25
|
-
.wxchtf-aside::before {
|
|
26
|
-
position: absolute;
|
|
27
|
-
content: "";
|
|
28
|
-
left: 0;
|
|
29
|
-
bottom: 0;
|
|
30
|
-
width: calc(100% - 10px);
|
|
31
|
-
height: 20px;
|
|
32
|
-
z-index: 1;
|
|
33
|
-
background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 100%);
|
|
34
|
-
}
|
|
35
|
-
.wxchtf-aside .wxchtf-chat-list.ant-menu {
|
|
36
|
-
flex: 1 1 auto;
|
|
37
|
-
height: 100px;
|
|
38
|
-
overflow-y: auto;
|
|
39
|
-
border-inline-end: none;
|
|
40
|
-
padding-bottom: 2rem;
|
|
41
|
-
}
|
|
42
|
-
.wxchtf-aside .wxchtf-chat-list.ant-menu::-webkit-scrollbar {
|
|
43
|
-
width: 8px;
|
|
44
|
-
height: 8px;
|
|
45
|
-
}
|
|
46
|
-
.wxchtf-aside .wxchtf-chat-list.ant-menu::-webkit-scrollbar-track {
|
|
47
|
-
background-color: #f1f1f1;
|
|
48
|
-
}
|
|
49
|
-
.wxchtf-aside .wxchtf-chat-list.ant-menu::-webkit-scrollbar-thumb {
|
|
50
|
-
background-color: #dfdfdf;
|
|
51
|
-
}
|
|
52
|
-
.wxchtf-aside .wxchtf-chat-list.ant-menu .ant-menu-item + .ant-menu-item {
|
|
53
|
-
margin-top: 8px;
|
|
54
|
-
}
|
|
55
|
-
.wxchtf-aside .wxchtf-chat-list.ant-menu .ant-menu-item {
|
|
56
|
-
padding: 0;
|
|
57
|
-
height: unset;
|
|
58
|
-
margin: 0;
|
|
59
|
-
margin-left: 8px;
|
|
60
|
-
width: calc(100% - 16px);
|
|
61
|
-
border-radius: 8px;
|
|
62
|
-
line-height: 1.5;
|
|
63
|
-
}
|
|
64
|
-
.wxchtf-aside .wxchtf-chat-list.ant-menu .ant-menu-item.ant-menu-item-selected {
|
|
65
|
-
background-color: #e4f7f7;
|
|
66
|
-
}
|
|
67
|
-
.wxchtf-aside .wxchtf-chat-list.ant-menu .ant-menu-item.ant-menu-item-selected .wxchtf-chat-name {
|
|
68
|
-
font-weight: 600;
|
|
69
|
-
}
|
|
70
|
-
.wxchtf-aside .wxchtf-chat-list.ant-menu .ant-menu-item .wxchtf-chat {
|
|
71
|
-
padding-inline: 10px;
|
|
72
|
-
padding-block: 8.5px;
|
|
73
|
-
position: relative;
|
|
74
|
-
}
|
|
75
|
-
.wxchtf-aside .wxchtf-chat-list.ant-menu .ant-menu-item .wxchtf-chat.--unread .wxchtf-chat-last {
|
|
76
|
-
font-weight: bold;
|
|
77
|
-
}
|
|
78
|
-
.wxchtf-aside .wxchtf-chat-list.ant-menu .ant-menu-item .wxchtf-chat.--unread .wxchtf-chat-name {
|
|
79
|
-
font-weight: bold;
|
|
80
|
-
max-width: 100%;
|
|
81
|
-
}
|
|
82
|
-
.wxchtf-aside .wxchtf-chat-list.ant-menu .ant-menu-item .wxchtf-chat .wxchtf-chat-name {
|
|
83
|
-
display: inline-block;
|
|
84
|
-
font-weight: 500;
|
|
85
|
-
}
|
|
86
|
-
.wxchtf-aside .wxchtf-chat-list.ant-menu .ant-menu-item .wxchtf-chat .wxchtf-unread-count {
|
|
87
|
-
background-color: #ff4d4f;
|
|
88
|
-
border-radius: 50%;
|
|
89
|
-
width: 16px;
|
|
90
|
-
height: 16px;
|
|
91
|
-
padding: 0;
|
|
92
|
-
font-size: 10px;
|
|
93
|
-
position: absolute;
|
|
94
|
-
top: 32px;
|
|
95
|
-
right: 13px;
|
|
96
|
-
color: white;
|
|
97
|
-
line-height: 16px;
|
|
98
|
-
font-weight: bold;
|
|
99
|
-
text-align: center;
|
|
100
|
-
}
|
|
101
|
-
.wxchtf-aside .wxchtf-chat-list.ant-menu .ant-menu-item .wxchtf-chat .wxchtf-chat-last {
|
|
102
|
-
color: rgba(14, 15, 23, 0.6);
|
|
103
|
-
font-style: italic;
|
|
104
|
-
overflow: hidden;
|
|
105
|
-
text-overflow: ellipsis;
|
|
106
|
-
white-space: nowrap;
|
|
107
|
-
line-height: 25px;
|
|
108
|
-
}
|
|
109
|
-
.wxchtf-aside .wxchtf-chat-list.ant-menu .ant-menu-item .wxchtf-chat .wxchtf-chat-last .wxchtf-chat-last-author {
|
|
110
|
-
display: inline-block;
|
|
111
|
-
margin-right: 0.5rem;
|
|
112
|
-
}
|
|
113
|
-
.wxchtf-aside .wxchtf-chat-list.ant-menu .ant-menu-item .wxchtf-chat .wxchtf-chat-last .wxchtf-chat-last-author .ant-avatar {
|
|
114
|
-
display: inline-block;
|
|
115
|
-
border: none;
|
|
116
|
-
margin-right: 5px;
|
|
117
|
-
width: 25px;
|
|
118
|
-
height: 25px;
|
|
119
|
-
line-height: 23px;
|
|
120
|
-
}
|
|
121
|
-
.wxchtf-aside .wxchtf-chat-list.ant-menu .ant-menu-item .wxchtf-chat .wxchtf-chat-last .wxchtf-chat-last-author::after {
|
|
122
|
-
content: ":";
|
|
123
|
-
}
|
|
124
|
-
.wxchtf-aside .wxchtf-chat-list.ant-menu .ant-menu-item .wxchtf-chat .wxchtf-chat-last .wxchtf-chat-last-message {
|
|
125
|
-
display: inline;
|
|
126
|
-
}
|
|
127
|
-
.wxchtf-aside .wxchtf-chat-list.ant-menu .ant-menu-item .wxchtf-chat .wxchtf-chat-last .wxchtf-chat-last-sent-at {
|
|
128
|
-
position: absolute;
|
|
129
|
-
top: 7px;
|
|
130
|
-
right: 13px;
|
|
131
|
-
font-size: 0.8em;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.wxchtf-chatify .wxchtf-chat-panel {
|
|
135
|
-
flex: auto;
|
|
136
|
-
display: flex;
|
|
137
|
-
flex-flow: row nowrap;
|
|
138
|
-
}
|
|
139
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main {
|
|
140
|
-
flex: 1;
|
|
141
|
-
display: flex;
|
|
142
|
-
flex-flow: column nowrap;
|
|
143
|
-
}
|
|
144
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-header {
|
|
145
|
-
padding: 15px 20px;
|
|
146
|
-
line-height: 24px;
|
|
147
|
-
z-index: 1;
|
|
148
|
-
box-shadow: 0px 2px 4px 0px rgba(88, 99, 107, 0.04), 0px 1px 9px -1px rgba(88, 99, 107, 0.04), 0px 1px 2px 0px rgba(88, 99, 107, 0.06);
|
|
149
|
-
}
|
|
150
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-header .wxchtf-chat-name {
|
|
151
|
-
font-weight: 600;
|
|
152
|
-
font-size: 16px;
|
|
153
|
-
flex: none;
|
|
154
|
-
}
|
|
155
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-header .wxchtf-chat-name.--editable {
|
|
156
|
-
cursor: pointer;
|
|
157
|
-
}
|
|
158
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-header .wxchtf-chat-members {
|
|
159
|
-
display: inline-flex;
|
|
160
|
-
gap: 6px;
|
|
161
|
-
}
|
|
162
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body {
|
|
163
|
-
flex: 1 1 auto;
|
|
164
|
-
height: 100px;
|
|
165
|
-
overflow-y: auto;
|
|
166
|
-
background: white;
|
|
167
|
-
padding: 2rem 1rem;
|
|
168
|
-
padding-right: 1rem;
|
|
169
|
-
display: flex;
|
|
170
|
-
flex-flow: column-reverse nowrap;
|
|
171
|
-
align-items: center;
|
|
172
|
-
}
|
|
173
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body::-webkit-scrollbar {
|
|
174
|
-
width: 8px;
|
|
175
|
-
height: 8px;
|
|
176
|
-
}
|
|
177
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body::-webkit-scrollbar-track {
|
|
178
|
-
background-color: #f1f1f1;
|
|
179
|
-
}
|
|
180
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body::-webkit-scrollbar-thumb {
|
|
181
|
-
background-color: #dfdfdf;
|
|
182
|
-
}
|
|
183
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message,
|
|
184
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message,
|
|
185
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-system-message,
|
|
186
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message-skeleton {
|
|
187
|
-
margin-bottom: 8px;
|
|
188
|
-
max-width: 1110px;
|
|
189
|
-
width: 100%;
|
|
190
|
-
}
|
|
191
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message:first-child,
|
|
192
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message:first-child,
|
|
193
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-system-message:first-child,
|
|
194
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message-skeleton:first-child {
|
|
195
|
-
margin-bottom: 0;
|
|
196
|
-
}
|
|
197
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message,
|
|
198
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message {
|
|
199
|
-
display: flex;
|
|
200
|
-
flex-flow: row nowrap;
|
|
201
|
-
align-items: flex-start;
|
|
202
|
-
}
|
|
203
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message:not(.--my) .wxchtf-message-content,
|
|
204
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message:not(.--my) .wxchtf-sending-message-content,
|
|
205
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message:not(.--my) .wxchtf-message-content,
|
|
206
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message:not(.--my) .wxchtf-sending-message-content {
|
|
207
|
-
border-bottom-left-radius: 0;
|
|
208
|
-
}
|
|
209
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message.--my,
|
|
210
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message.--my {
|
|
211
|
-
direction: rtl;
|
|
212
|
-
justify-content: flex-start;
|
|
213
|
-
}
|
|
214
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message.--my .wxchtf-message-author,
|
|
215
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message.--my .wxchtf-message-author {
|
|
216
|
-
display: none;
|
|
217
|
-
}
|
|
218
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message.--my .wxchtf-message-content,
|
|
219
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message.--my .wxchtf-sending-message-content,
|
|
220
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message.--my .wxchtf-message-content,
|
|
221
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message.--my .wxchtf-sending-message-content {
|
|
222
|
-
direction: ltr;
|
|
223
|
-
border-bottom-right-radius: 0;
|
|
224
|
-
background-color: #e4f7f7;
|
|
225
|
-
}
|
|
226
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message.--my .wxchtf-message-info-box,
|
|
227
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message.--my .wxchtf-message-info-box {
|
|
228
|
-
text-align: right;
|
|
229
|
-
}
|
|
230
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message .wxchtf-message-author,
|
|
231
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message .wxchtf-message-author {
|
|
232
|
-
margin-right: 15px;
|
|
233
|
-
}
|
|
234
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message .wxchtf-message-author .ant-avatar,
|
|
235
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message .wxchtf-message-author .ant-avatar {
|
|
236
|
-
width: 40px;
|
|
237
|
-
height: 40px;
|
|
238
|
-
line-height: 38px;
|
|
239
|
-
}
|
|
240
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message .wxchtf-message-info-box,
|
|
241
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message .wxchtf-sending-message-info-box,
|
|
242
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message .wxchtf-message-info-box,
|
|
243
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message .wxchtf-sending-message-info-box {
|
|
244
|
-
text-align: left;
|
|
245
|
-
margin-bottom: 3px;
|
|
246
|
-
}
|
|
247
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message .wxchtf-message-info-box .wxchtf-message-author-name,
|
|
248
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message .wxchtf-message-info-box .wxchtf-message-sent-at,
|
|
249
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message .wxchtf-message-info-box .wxchtf-message-read-box,
|
|
250
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message .wxchtf-message-info-box .wxchtf-sending-message-sending-box,
|
|
251
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message .wxchtf-sending-message-info-box .wxchtf-message-author-name,
|
|
252
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message .wxchtf-sending-message-info-box .wxchtf-message-sent-at,
|
|
253
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message .wxchtf-sending-message-info-box .wxchtf-message-read-box,
|
|
254
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message .wxchtf-sending-message-info-box .wxchtf-sending-message-sending-box,
|
|
255
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message .wxchtf-message-info-box .wxchtf-message-author-name,
|
|
256
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message .wxchtf-message-info-box .wxchtf-message-sent-at,
|
|
257
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message .wxchtf-message-info-box .wxchtf-message-read-box,
|
|
258
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message .wxchtf-message-info-box .wxchtf-sending-message-sending-box,
|
|
259
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message .wxchtf-sending-message-info-box .wxchtf-message-author-name,
|
|
260
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message .wxchtf-sending-message-info-box .wxchtf-message-sent-at,
|
|
261
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message .wxchtf-sending-message-info-box .wxchtf-message-read-box,
|
|
262
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message .wxchtf-sending-message-info-box .wxchtf-sending-message-sending-box {
|
|
263
|
-
display: inline-block;
|
|
264
|
-
font-size: 0.85em;
|
|
265
|
-
opacity: 0.5;
|
|
266
|
-
}
|
|
267
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message .wxchtf-message-info-box .wxchtf-message-sent-at,
|
|
268
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message .wxchtf-message-info-box .wxchtf-message-read-box,
|
|
269
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message .wxchtf-message-info-box .wxchtf-sending-message-sending-box,
|
|
270
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message .wxchtf-sending-message-info-box .wxchtf-message-sent-at,
|
|
271
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message .wxchtf-sending-message-info-box .wxchtf-message-read-box,
|
|
272
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message .wxchtf-sending-message-info-box .wxchtf-sending-message-sending-box,
|
|
273
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message .wxchtf-message-info-box .wxchtf-message-sent-at,
|
|
274
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message .wxchtf-message-info-box .wxchtf-message-read-box,
|
|
275
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message .wxchtf-message-info-box .wxchtf-sending-message-sending-box,
|
|
276
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message .wxchtf-sending-message-info-box .wxchtf-message-sent-at,
|
|
277
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message .wxchtf-sending-message-info-box .wxchtf-message-read-box,
|
|
278
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message .wxchtf-sending-message-info-box .wxchtf-sending-message-sending-box {
|
|
279
|
-
margin-left: 5px;
|
|
280
|
-
}
|
|
281
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message .wxchtf-message-content,
|
|
282
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message .wxchtf-sending-message-content,
|
|
283
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message .wxchtf-message-content,
|
|
284
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message .wxchtf-sending-message-content {
|
|
285
|
-
width: fit-content;
|
|
286
|
-
min-width: 300px;
|
|
287
|
-
max-width: 70%;
|
|
288
|
-
padding: 12px 19px;
|
|
289
|
-
background: white;
|
|
290
|
-
background-color: #f5f5f5;
|
|
291
|
-
display: block;
|
|
292
|
-
white-space: pre-wrap;
|
|
293
|
-
overflow-wrap: break-word;
|
|
294
|
-
border-radius: 24px;
|
|
295
|
-
}
|
|
296
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message .wxchtf-message-content .wxchtf-message-text,
|
|
297
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message .wxchtf-sending-message-content .wxchtf-message-text,
|
|
298
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message .wxchtf-message-content .wxchtf-message-text,
|
|
299
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-sending-message .wxchtf-sending-message-content .wxchtf-message-text {
|
|
300
|
-
line-height: 21px;
|
|
301
|
-
}
|
|
302
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-system-message {
|
|
303
|
-
font-style: italic;
|
|
304
|
-
position: relative;
|
|
305
|
-
text-align: center;
|
|
306
|
-
color: rgba(14, 15, 23, 0.6);
|
|
307
|
-
}
|
|
308
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-system-message .wxchtf-text,
|
|
309
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-system-message .wxchtf-timestamp {
|
|
310
|
-
position: relative;
|
|
311
|
-
z-index: 1;
|
|
312
|
-
padding-inline: 8px;
|
|
313
|
-
display: inline-block;
|
|
314
|
-
font-size: 0.85em;
|
|
315
|
-
background-color: white;
|
|
316
|
-
}
|
|
317
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-system-message .wxchtf-timestamp {
|
|
318
|
-
padding-left: 10px;
|
|
319
|
-
}
|
|
320
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-system-message::after {
|
|
321
|
-
content: "";
|
|
322
|
-
position: absolute;
|
|
323
|
-
height: 1px;
|
|
324
|
-
width: 100%;
|
|
325
|
-
left: 0;
|
|
326
|
-
top: 50%;
|
|
327
|
-
z-index: 0;
|
|
328
|
-
background-color: rgba(0, 0, 0, 0.0588235294);
|
|
329
|
-
}
|
|
330
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message-skeleton {
|
|
331
|
-
display: flex;
|
|
332
|
-
flex-flow: row nowrap;
|
|
333
|
-
align-items: flex-end;
|
|
334
|
-
}
|
|
335
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message-skeleton .wxchtf-avatar {
|
|
336
|
-
margin-right: 15px;
|
|
337
|
-
}
|
|
338
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message-skeleton .wxchtf-avatar .ant-skeleton-avatar {
|
|
339
|
-
width: 40px;
|
|
340
|
-
height: 40px;
|
|
341
|
-
line-height: 40px;
|
|
342
|
-
}
|
|
343
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-main .wxchtf-chat-body .wxchtf-message-skeleton .wxchtf-content {
|
|
344
|
-
width: 300px;
|
|
345
|
-
height: 100px;
|
|
346
|
-
border-radius: 10px;
|
|
347
|
-
border-bottom-left-radius: 0;
|
|
348
|
-
}
|
|
349
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-members-panel {
|
|
350
|
-
min-width: 300px;
|
|
351
|
-
box-shadow: -4px 0px 20px -5px rgba(12, 217, 226, 0.0784313725), -2px 1px 12px rgba(0, 110, 114, 0.0588235294);
|
|
352
|
-
}
|
|
353
|
-
.wxchtf-chatify .wxchtf-chat-panel .wxchtf-chat-members-panel .wxchtf-chat-members-list .wxchtf-chat-members-list-item {
|
|
354
|
-
padding-inline: 1rem;
|
|
355
|
-
border-block-end: none;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
.wxchtf-input-form {
|
|
359
|
-
flex: none;
|
|
360
|
-
max-height: 300px;
|
|
361
|
-
display: flex;
|
|
362
|
-
flex-flow: column nowrap;
|
|
363
|
-
padding: 12px 20px 20px 20px;
|
|
364
|
-
}
|
|
365
|
-
.wxchtf-input-form .wxchtf-input-box {
|
|
366
|
-
flex: none;
|
|
367
|
-
display: flex;
|
|
368
|
-
flex-flow: row nowrap;
|
|
369
|
-
padding: 8px;
|
|
370
|
-
max-width: 1110px;
|
|
371
|
-
width: 100%;
|
|
372
|
-
margin: auto;
|
|
373
|
-
background: rgb(245, 245, 245);
|
|
374
|
-
border-radius: 40px;
|
|
375
|
-
}
|
|
376
|
-
.wxchtf-input-form .wxchtf-input-box .wxchtf-add-files-box,
|
|
377
|
-
.wxchtf-input-form .wxchtf-input-box .wxchtf-submit-btn-box {
|
|
378
|
-
align-items: center;
|
|
379
|
-
}
|
|
380
|
-
.wxchtf-input-form .wxchtf-input-box .wxchtf-add-files-box button,
|
|
381
|
-
.wxchtf-input-form .wxchtf-input-box .wxchtf-submit-btn-box button {
|
|
382
|
-
width: unset;
|
|
383
|
-
}
|
|
384
|
-
.wxchtf-input-form .wxchtf-input-box .wxchtf-add-files-box svg,
|
|
385
|
-
.wxchtf-input-form .wxchtf-input-box .wxchtf-submit-btn-box svg {
|
|
386
|
-
font-size: 18px;
|
|
387
|
-
color: rgba(14, 15, 23, 0.25);
|
|
388
|
-
}
|
|
389
|
-
.wxchtf-input-form .wxchtf-input-box .wxchtf-add-files-box {
|
|
390
|
-
flex: none;
|
|
391
|
-
display: flex;
|
|
392
|
-
padding: 0 1rem;
|
|
393
|
-
align-items: flex-end;
|
|
394
|
-
}
|
|
395
|
-
.wxchtf-input-form .wxchtf-input-box .wxchtf-add-files-box .ant-btn.ant-btn-icon-only .anticon {
|
|
396
|
-
font-size: 1.5rem;
|
|
397
|
-
}
|
|
398
|
-
.wxchtf-input-form .wxchtf-input-box .wxchtf-text-input-box {
|
|
399
|
-
flex: auto;
|
|
400
|
-
margin-left: 16px;
|
|
401
|
-
margin-right: 16px;
|
|
402
|
-
}
|
|
403
|
-
.wxchtf-input-form .wxchtf-input-box .wxchtf-text-input-box textarea {
|
|
404
|
-
resize: none;
|
|
405
|
-
border: none;
|
|
406
|
-
outline: none;
|
|
407
|
-
box-shadow: none;
|
|
408
|
-
background: transparent;
|
|
409
|
-
padding-inline: 0;
|
|
410
|
-
font-size: 13px;
|
|
411
|
-
line-height: 26px;
|
|
412
|
-
}
|
|
413
|
-
.wxchtf-input-form .wxchtf-input-box .wxchtf-text-input-box textarea::-webkit-scrollbar {
|
|
414
|
-
width: 8px;
|
|
415
|
-
height: 8px;
|
|
416
|
-
}
|
|
417
|
-
.wxchtf-input-form .wxchtf-input-box .wxchtf-text-input-box textarea::-webkit-scrollbar-track {
|
|
418
|
-
background-color: #f1f1f1;
|
|
419
|
-
}
|
|
420
|
-
.wxchtf-input-form .wxchtf-input-box .wxchtf-text-input-box textarea::-webkit-scrollbar-thumb {
|
|
421
|
-
background-color: #dfdfdf;
|
|
422
|
-
}
|
|
423
|
-
.wxchtf-input-form .wxchtf-input-box .wxchtf-submit-btn-box {
|
|
424
|
-
flex: none;
|
|
425
|
-
display: flex;
|
|
426
|
-
padding: 0 1rem;
|
|
427
|
-
align-items: flex-end;
|
|
428
|
-
margin-left: 1rem;
|
|
429
|
-
}
|
|
430
|
-
.wxchtf-input-form .wxchtf-input-box .wxchtf-submit-btn-box .ant-btn.ant-btn-icon-only .anticon {
|
|
431
|
-
font-size: 1.5rem;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
.wxchtf-chatify {
|
|
435
|
-
display: flex;
|
|
436
|
-
flex-flow: column nowrap;
|
|
437
|
-
background: white;
|
|
438
|
-
border-radius: 24px;
|
|
439
|
-
}
|
|
440
|
-
.wxchtf-chatify .wxchtf-header {
|
|
441
|
-
min-height: 2rem;
|
|
442
|
-
}
|
|
443
|
-
.wxchtf-chatify .wxchtf-body {
|
|
444
|
-
flex: 1 0;
|
|
445
|
-
display: flex;
|
|
446
|
-
flex-flow: row nowrap;
|
|
447
|
-
}
|
|
448
|
-
.wxchtf-chatify .wxchtf-footer {
|
|
449
|
-
min-height: 2rem;
|
|
450
|
-
}
|
|
451
|
-
.wxchtf-chatify .wxchtf-add-btn-wrapper {
|
|
452
|
-
width: 100%;
|
|
453
|
-
text-align: right;
|
|
454
|
-
padding-inline: 0.5rem;
|
|
455
|
-
margin-bottom: 1rem;
|
|
456
|
-
}
|
|
457
|
-
.wxchtf-chatify .wxchtf-add-btn-wrapper .wxchtf-add-btn {
|
|
458
|
-
border: none;
|
|
459
|
-
background-color: #e4f7f7;
|
|
460
|
-
height: 50px;
|
|
461
|
-
padding: 0;
|
|
462
|
-
line-height: 50px;
|
|
463
|
-
min-width: 150px;
|
|
464
|
-
border-radius: 50px;
|
|
465
|
-
font-weight: 600;
|
|
466
|
-
opacity: 0.9;
|
|
467
|
-
box-shadow: none;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
.wxchtf-main {
|
|
471
|
-
flex: auto;
|
|
472
|
-
display: flex;
|
|
473
|
-
flex-flow: column nowrap;
|
|
474
|
-
border-top-right-radius: 24px;
|
|
475
|
-
border-bottom-right-radius: 24px;
|
|
476
|
-
box-shadow: 0px 6px 30px 0px rgba(12, 217, 226, 0.0784313725), 0px 1px 12px 0px rgba(0, 110, 114, 0.0588235294);
|
|
477
|
-
z-index: 2;
|
|
478
|
-
}
|
|
479
|
-
.wxchtf-main .wxchtf-create-chat-panel {
|
|
480
|
-
display: flex;
|
|
481
|
-
flex-flow: column nowrap;
|
|
482
|
-
justify-content: center;
|
|
483
|
-
align-items: center;
|
|
484
|
-
height: 100%;
|
|
485
|
-
position: relative;
|
|
486
|
-
}
|
|
487
|
-
.wxchtf-main .wxchtf-create-chat-panel .wxchtf-create-chat-panel-close {
|
|
488
|
-
position: absolute;
|
|
489
|
-
right: 25px;
|
|
490
|
-
top: 25px;
|
|
491
|
-
}
|
|
492
|
-
.wxchtf-main .wxchtf-create-chat-panel form {
|
|
493
|
-
padding: 2rem;
|
|
494
|
-
max-width: 700px;
|
|
495
|
-
width: 100%;
|
|
496
|
-
}
|
|
497
|
-
.wxchtf-main .wxchtf-create-chat-panel form .wxchtf-create-chat-member-input-list {
|
|
498
|
-
max-height: 15rem;
|
|
499
|
-
overflow-y: auto;
|
|
500
|
-
}
|
|
501
|
-
.wxchtf-main .wxchtf-create-chat-panel form .wxchtf-create-chat-member-input-list::-webkit-scrollbar {
|
|
502
|
-
width: 8px;
|
|
503
|
-
height: 8px;
|
|
504
|
-
}
|
|
505
|
-
.wxchtf-main .wxchtf-create-chat-panel form .wxchtf-create-chat-member-input-list::-webkit-scrollbar-track {
|
|
506
|
-
background-color: #f1f1f1;
|
|
507
|
-
}
|
|
508
|
-
.wxchtf-main .wxchtf-create-chat-panel form .wxchtf-create-chat-member-input-list::-webkit-scrollbar-thumb {
|
|
509
|
-
background-color: #dfdfdf;
|
|
510
|
-
}
|
|
511
|
-
.wxchtf-main .wxchtf-create-chat-panel form .wxchtf-create-chat-member-input-list .ant-list-item {
|
|
512
|
-
padding-inline: 0.5rem;
|
|
513
|
-
}
|
|
514
|
-
.wxchtf-main .wxchtf-create-chat-panel form .wxchtf-create-chat-member-input-list .ant-list-item.--selected {
|
|
515
|
-
background-color: #e6f4ff;
|
|
516
|
-
}
|
|
517
|
-
.wxchtf-main .wxchtf-create-chat-panel form .wxchtf-create-chat-member-input-list .ant-list-item .ant-checkbox-wrapper {
|
|
518
|
-
width: 100%;
|
|
519
|
-
}
|
|
520
|
-
.wxchtf-main .wxchtf-create-chat-panel form .wxchtf-create-chat-member-input-list .ant-list-item .ant-checkbox-wrapper > span:last-child {
|
|
521
|
-
flex: 1;
|
|
522
|
-
}
|
|
523
|
-
.wxchtf-main .wxchtf-create-chat-panel form .wxchtf-create-chat-member-input-list .ant-list-item .ant-checkbox-wrapper > span:last-child .ant-list-item-meta {
|
|
524
|
-
align-items: center;
|
|
525
|
-
}
|
|
526
|
-
.wxchtf-main .wxchtf-create-chat-panel form .wxchtf-create-chat-member-input-list .ant-list-item .ant-checkbox-wrapper > span:last-child .ant-list-item-meta .ant-list-item-meta-content h4 {
|
|
527
|
-
margin-bottom: 0;
|
|
528
|
-
}
|
package/dist/esm/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as e,Fragment as t,jsxs as a}from"react/jsx-runtime";import s,{useRef as n,useCallback as r,useContext as i,useState as c,useEffect as d,useMemo as o,memo as u}from"react";import*as h from"@microsoft/signalr";import{shallowEqual as m}from"shallow-equal";import{produce as l}from"immer";import f from"dayjs";import{Avatar as g,Menu as v,Button as y,Form as p,Input as b,List as I,Checkbox as x,Skeleton as q,Tooltip as C,Row as w,Col as _,Space as N}from"antd";import M from"@ant-design/icons/SendOutlined";import j from"@ant-design/icons/PaperClipOutlined";import O from"@ant-design/icons/UserAddOutlined";import F from"@ant-design/icons/UsergroupAddOutlined";import L from"@ant-design/icons/UserDeleteOutlined";import R from"@ant-design/icons/UsergroupDeleteOutlined";import k from"@ant-design/icons/TeamOutlined";import S from"@ant-design/icons/EditOutlined";import B from"@ant-design/icons/CloseOutlined";import A from"is-hotkey";function T(e,t,a,s){return new(a||(a=Promise))((function(n,r){function i(e){try{d(s.next(e))}catch(e){r(e)}}function c(e){try{d(s.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(i,c)}d((s=s.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const U={hubUri:"/api/chatify/hub",headersFactory:()=>Promise.resolve({})},z=["chatify://new-message","chatify://chat-created","chatify://read","chatify://member-added","chatify://member-removed","chatify://chat-name-changed"];class H{constructor(e){this._connection=null,this._subscribers={},this._reconnectSubscribers=[],this.connect=()=>T(this,void 0,void 0,(function*(){const e=yield this._config.signalR.headersFactory();this._connection=(new h.HubConnectionBuilder).withUrl(this._config.signalR.hubUri,{accessTokenFactory:this._config.signalR.accessTokenFactory?this._config.signalR.accessTokenFactory:void 0,headers:e}).withAutomaticReconnect().build(),z.forEach((e=>{this._connection.on(e,((...t)=>{var a;null===(a=this._subscribers[e])||void 0===a||a.forEach((e=>e(t)))}))})),this._connection.onreconnected((()=>this._reconnectSubscribers.forEach((e=>e())))),yield this._connection.start()})),this.subscribe=(e,t)=>{var a;return this._subscribers[e]=null!==(a=this._subscribers[e])&&void 0!==a?a:[],this._subscribers[e].push(t),()=>this._subscribers[e].filter((e=>e!==t))},this.subscribeReconnect=e=>(this._reconnectSubscribers.push(e),()=>this._reconnectSubscribers.filter((t=>t!==e))),this.accounts=()=>T(this,void 0,void 0,(function*(){const{data:e}=yield this.axios.get("account");return e})),this.chats=()=>T(this,void 0,void 0,(function*(){const{data:e}=yield this.axios.get("chat");return e})),this.chat=e=>T(this,void 0,void 0,(function*(){const{data:t}=yield this.axios.get(`chat/${e}`);return t})),this.addChat=e=>T(this,void 0,void 0,(function*(){const{data:t}=yield this.axios.post("chat",e);return t})),this.messages=e=>T(this,void 0,void 0,(function*(){const{chatId:t,skip:a=0,take:s=20}=e,n=encodeURIComponent(JSON.stringify({skip:a,take:s})),{data:r}=yield this.axios.get(`chat/${t}/message?pagingRule=${n}`);return r})),this.send=e=>T(this,void 0,void 0,(function*(){const{chatId:t}=e,a=function(e,t){var a={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(a[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(e);n<s.length;n++)t.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(e,s[n])&&(a[s[n]]=e[s[n]])}return a}(e,["chatId"]);yield this.axios.post(`chat/${t}/message`,a)})),this.read=e=>T(this,void 0,void 0,(function*(){yield this.axios.put("chat/message/read",e)})),this.removeMember=e=>T(this,void 0,void 0,(function*(){yield this.axios.delete(`chat/${e.chatId}/member`,{data:e})})),this.updateChatName=e=>T(this,void 0,void 0,(function*(){yield this.axios.put(`chat/${e.id}/name`,e)})),this.addMember=e=>T(this,void 0,void 0,(function*(){yield this.axios.post(`chat/${e.chatId}/member`,e)})),this._config=Object.assign(Object.assign({},e),{signalR:Object.assign(Object.assign({},U),e.signalR)})}get axios(){return this._config.axios}}const P={update:(e,{mutation:t})=>{t(e)},messages_fetch:(e,{chatId:t,requestId:a})=>{e.query.messages[t]=Object.assign(Object.assign({},e.query.messages[t]),{uninitialized:!1,isFetching:!0,requestId:a})},messages_fulfilled:(e,{chatId:t,messages:a,hasMore:s})=>{const n=e.query.messages[t];n.error=void 0,n.isFetching=!1,n.data=a.map((e=>Object.assign({type:"message"},e))),n.requestId=void 0,s&&n.data.push({type:"next"})},messages_rejected:(e,{chatId:t,error:a})=>{const s=e.query.messages[t];s.error=a,s.isFetching=!1,s.requestId=void 0},fetchNext_fetch:(e,{chatId:t})=>{e.mutation.fetchNext={isFetching:!0}},fetchNext_fulfilled:(e,{chatId:t,messages:a,hasMore:s})=>{e.mutation.fetchNext={isFetching:!1,error:void 0},e.query.messages[t].data=e.query.messages[t].data.filter((e=>"next"!==e.type)),e.query.messages[t].data.push(...a.map((e=>Object.assign({type:"message"},e)))),s&&e.query.messages[t].data.push({type:"next"})},fetchNext_rejected:(e,{chatId:t,error:a})=>{e.mutation.fetchNext={isFetching:!1,error:a}},chatList_fetch:(e,{requestId:t})=>{e.query.chatList.isFetching=!0,e.query.chatList.uninitialized=!1,e.query.chatList.requestId=t},chatList_fulfilled:(e,{chats:t})=>{t=t.sort(((e,t)=>-e.message.id.substring(47).localeCompare(t.message.id.substring(47)))),e.query.chatList.isFetching=!1,e.query.chatList.error=void 0,e.query.chatList.data=t,e.query.chatList.requestId=void 0,void 0===e.ui.chatId&&t.length>0&&(e.ui.view="chat",e.ui.chatId=t[0].id)},chatList_rejected:(e,{error:t})=>{e.query.chatList.isFetching=!1,e.query.chatList.error=t,e.query.chatList.requestId=void 0},removeMember_fetch:e=>{e.mutation.removeMember={isFetching:!0}},removeMember_fulfilled:e=>{e.mutation.removeMember={isFetching:!1,error:void 0}},removeMember_rejected:(e,{error:t})=>{e.mutation.removeMember={isFetching:!1,error:t}},addMember_fetch:e=>{e.mutation.addMember={isFetching:!0}},addMember_fulfilled:e=>{e.mutation.addMember={isFetching:!1,error:void 0}},addMember_rejected:(e,{error:t})=>{e.mutation.addMember={isFetching:!1,error:t}},updateChatName_fetch:e=>{e.mutation.updateChatName={isFetching:!0}},updateChatName_fulfilled:e=>{e.mutation.updateChatName={isFetching:!1,error:void 0}},updateChatName_rejected:(e,{error:t})=>{e.mutation.updateChatName={isFetching:!1,error:t}},addChat_fetch:e=>{e.mutation.addChat={isFetching:!0}},addChat_fulfilled:e=>{e.mutation.addChat={isFetching:!1,error:void 0}},addChat_rejected:(e,{error:t})=>{e.mutation.addChat={isFetching:!1,error:t}},accounts_fetch:(e,{requestId:t})=>{e.query.accounts={isFetching:!0,uninitialized:!1,requestId:t}},accounts_fulfilled:(e,{accounts:t})=>{e.query.accounts.data=t,e.query.accounts.isFetching=!1,e.query.accounts.error=void 0,e.query.accounts.requestId=void 0},accounts_rejected:(e,{error:t})=>{e.query.accounts.isFetching=!1,e.query.accounts.error=t,e.query.accounts.requestId=void 0},chat_open:(e,{chatId:t})=>{e.ui.chatId=t,e.ui.view="chat"},new_chat_open:e=>{e.ui.view="new-chat"},new_chat_close:e=>{var t,a;e.ui.chatId?e.ui.view="chat":(null===(t=e.query.chatList.data)||void 0===t?void 0:t.length)?(e.ui.view="chat",e.ui.chatId=null===(a=e.query.chatList.data[0])||void 0===a?void 0:a.id):e.ui.view=void 0},toggle_members_view:e=>{e.ui.showMembers=!e.ui.showMembers},message_received:(e,{message:t,requestId:a,me:s})=>{var n,r;const i=e.query.messages[t.chatId];(null==i?void 0:i.data)&&(i.data.unshift(Object.assign({type:"message"},t)),i.data=i.data.filter((e=>"sending"!==e.type||e.requestId!==a)));const c=null===(r=null===(n=e.query.chatList)||void 0===n?void 0:n.data)||void 0===r?void 0:r.find((e=>e.id===t.chatId));c&&(c.message=t),c&&t.sentBy.id!==s&&c.totalUnreadCount++,c&&t.sentBy.id===s&&(c.lastReadMessageId=t.id,c.totalUnreadCount=0)},chat_created:(e,{chat:t})=>{var a,s;null===(s=null===(a=e.query.chatList)||void 0===a?void 0:a.data)||void 0===s||s.unshift(t)},read:(e,{id:t,timestamp:a})=>{const s=e.queue.read.queued.filter((e=>e.substring(0,36)===t.substring(0,36)));s.some((e=>e.localeCompare(t)>=0))||(e.queue.read.queued.filter((e=>s.includes(e))),e.queue.read.queued.push(t),e.queue.read.timestamp=a)},read_send:(e,{id:t})=>{e.queue.read.queued=e.queue.read.queued.filter((e=>e!==t)),e.queue.read.processing.push(t)},read_reject:(e,{id:t,timestamp:a})=>{e.queue.read.queued.push(t),e.queue.read.processing=e.queue.read.processing.filter((e=>e!==t)),e.queue.read.timestamp=a},read_received:(e,{events:t})=>{var a;e.queue.read.processing=e.queue.read.processing.filter((e=>{const a=t.find((t=>t.chatId===e.substring(0,36)));return!a||a.newLastReadMessageId.localeCompare(e)>=0}));for(const s of t){e.queue.read.processing=e.queue.read.processing.filter((e=>e.substring(0,36)!==s.chatId||e.localeCompare(s.newLastReadMessageId)>0));const t=null===(a=e.query.chatList.data)||void 0===a?void 0:a.find((e=>e.id===s.chatId));t&&(t.lastReadMessageId=s.newLastReadMessageId,t.totalUnreadCount=t.totalUnreadCount-s.readCount)}},member_added:(e,{chatId:t,chatName:a,account:s,me:n,message:r,withHistory:i})=>{var c,d,o,u,h;const{chats:m,messages:l,chatList:f}=e.query;null===(d=null===(c=m[t])||void 0===c?void 0:c.data)||void 0===d||d.members.push(s);const g=null===(o=null==f?void 0:f.data)||void 0===o?void 0:o.find((e=>e.id===t));return s.id!==n&&null!=g&&(g.message=r,g.totalUnreadCount++),null===(h=null===(u=l[t])||void 0===u?void 0:u.data)||void 0===h||h.unshift(Object.assign({type:"message"},r)),s.id!==n||void 0===f.data||g||f.data.unshift({id:t,name:a,message:r,totalUnreadCount:1,active:!0,lastReadMessageId:null}),s.id===n&&g&&(g.active=!0,g.message=r,g.totalUnreadCount++),e},member_removed:(e,{chatId:t,accountId:a,deleteHistory:s,me:n,message:r})=>{var i;const{chats:c,chatList:d}=e.query,o=c[t];if((null==o?void 0:o.data)&&(o.data.members=o.data.members.filter((e=>e.id!==a))),a===n&&e.query.chats[t].data&&delete e.query.chats[t],a===n&&s&&(null==d?void 0:d.data)&&(d.data=d.data.filter((e=>e.id!==t)),e.ui.chatId===t&&(e.ui.chatId=null===(i=d.data.at(0))||void 0===i?void 0:i.id)),a===n&&!s&&(null==d?void 0:d.data)){d.data.find((e=>e.id===t)).active=!1}if(a===n&&s||!e.query.messages[t].data||e.query.messages[t].data.unshift(Object.assign(Object.assign({},r),{type:"message"})),(a!==n||!s)&&e.query.chatList.data){const a=e.query.chatList.data.find((e=>e.id===t));a.message=r,a.totalUnreadCount++}a===n&&s&&e.query.messages[t].data&&delete e.query.messages[t]},chat_fetch:(e,{chatId:t,requestId:a})=>{e.query.chats[t]={isFetching:!0,uninitialized:!1,data:void 0,error:void 0,requestId:a}},chat_fulfilled:(e,{chat:t})=>{const a=e.query.chats[t.id];a.isFetching=!1,a.error=void 0,a.data=t,a.requestId=void 0},chat_rejected:(e,{chatId:t,error:a})=>{const s=e.query.chats[t];s.isFetching=!1,s.error=a,s.requestId=void 0},send_fetch:(e,{chatId:t,text:a,files:s,requestId:n})=>{var r;e.mutation.send={isFetching:!0,error:void 0},null===(r=e.query.messages[t].data)||void 0===r||r.push({type:"sending",text:a,files:s,requestId:n})},send_fulfilled:(e,{chatId:t,requestId:a})=>{e.mutation.send={isFetching:!1,error:void 0}},send_rejected:(e,{chatId:t,requestId:a,error:s})=>{var n;e.mutation.send={isFetching:!1,error:s},e.query.messages[t].data=null===(n=e.query.messages[t].data)||void 0===n?void 0:n.filter((e=>"sending"!==e.type||e.requestId!==a))},chatNameChanged_received:(e,{chatId:t,newName:a,message:s})=>{if(e.query.chatList.data){const n=e.query.chatList.data.find((e=>e.id===t));n.name=a,n.message=s,n.totalUnreadCount++}e.query.chats[t].data&&(e.query.chats[t].data.name=a),e.query.messages[t].data&&e.query.messages[t].data.unshift(Object.assign({type:"message"},s))}},E=Object.freeze({uninitialized:!1,isFetching:!0,data:void 0,error:void 0}),D={ui:{showMembers:!1},query:{messages:{},chats:{},chatList:{uninitialized:!0,isFetching:!1,data:void 0,error:void 0},accounts:{uninitialized:!0,isFetching:!1,data:void 0,error:void 0}},mutation:{fetchNext:{isFetching:!1,error:void 0},removeMember:{isFetching:!1,error:void 0},addMember:{isFetching:!1,error:void 0},updateChatName:{isFetching:!1,error:void 0},addChat:{isFetching:!1,error:void 0},send:{isFetching:!1,error:void 0}},queue:{read:{queued:[],processing:[],timestamp:0},send:{queued:[],processing:[],timestamp:0}}};function $(){const e=n(D),t=n([]),a=r((a=>{const s=function(e,t){const a=l(e,(e=>P[t.type](e,t.data)));return console.debug("[Chatify]: ",t,a),a}(e.current,a);e.current!==s&&(e.current=s,t.current.forEach((e=>e(s))))}),[]),s=r((e=>(t.current.push(e),()=>{t.current=t.current.filter((t=>t!==e))})),[]);return[e,a,s]}const K=s.createContext(null);function Y({children:t}){const a=$();return e(K.Provider,{value:a,children:t})}function W(){return i(K)[1]}function J(){const[e]=i(K);return e}function G(e,t){const[a,,s]=i(K),r=n(e(a.current)),[o,u]=c(r.current);return d((()=>{const t=e(a.current);return m(r.current,t)||(r.current=t,u(t)),s((t=>{const a=e(t);m(a,r.current)||(r.current=a,u(a))}))}),[]),o}function V(e,t){const a=W();d((()=>{let s=[];return t.connect().then((()=>{s.push(t.subscribe("chatify://new-message",(([t,s])=>{a({type:"message_received",data:{message:t,requestId:s,me:e}})}))),s.push(t.subscribe("chatify://chat-created",(([e,t])=>{a({type:"chat_created",data:{chat:e,requestId:t}})}))),s.push(t.subscribe("chatify://read",(([e])=>{a({type:"read_received",data:{events:e}})}))),s.push(t.subscribe("chatify://member-added",(([t,s,n,r,i])=>{a({type:"member_added",data:{chatId:t,chatName:s,account:n,me:e,message:r,withHistory:i}})}))),s.push(t.subscribe("chatify://member-removed",(([t,s,n,r])=>{a({type:"member_removed",data:{chatId:t,accountId:s,deleteHistory:n,me:e,message:r}})}))),s.push(t.subscribe("chatify://chat-name-changed",(([e,t,s])=>{a({type:"chatNameChanged_received",data:{chatId:e,newName:t,message:s}})})))})),()=>{s.forEach((e=>e()))}}),[])}const Q=s.createContext(null),X=s.createContext(null);function Z(){return i(X)}function ee(){return i(Q)}function te(a){const{children:s}=a;return V(ee(),Z()),e(t,{children:s})}function ae({value:t,children:a}){return e(X.Provider,{value:t.client,children:e(Q.Provider,{value:t.me,children:e(Y,{children:e(te,{children:a})})})})}function se(){return Date.now().toString(36)+Math.random().toString(36).substring(2)}function ne(e){var t;const a=n(se()),{chatId:s}=e,r=Z(),i=J(),c=null!==(t=G((e=>e.query.chats[s])))&&void 0!==t?t:E,o=W();return d((()=>{var e;!1!==(null===(e=i.current.query.chats[s])||void 0===e?void 0:e.uninitialized)&&(o({type:"chat_fetch",data:{chatId:s,requestId:a.current}}),r.chat(s).then((e=>o({type:"chat_fulfilled",data:{chat:e}}))).catch((e=>o({type:"chat_rejected",data:{chatId:s,error:e}}))))}),[s]),null!=c?c:E}function re(){var e;const t=n(se()),a=J(),s=Z(),r=null!==(e=G((e=>e.query.chatList)))&&void 0!==e?e:E,i=W();return d((()=>{!1!==a.current.query.chatList.uninitialized&&(i({type:"chatList_fetch",data:{requestId:t.current}}),s.chats().then((e=>i({type:"chatList_fulfilled",data:{chats:e}}))).catch((e=>i({type:"chatList_rejected",data:{error:e}}))))}),[]),null!=r?r:E}function ie({chatId:e}){const t=J();G((e=>e.mutation.fetchNext));const a=W(),s=Z();return[r((()=>{var n;const r=null===(n=t.current.query.messages[e].data)||void 0===n?void 0:n.filter((e=>"message"===e.type)).length;a({type:"fetchNext_fetch",data:{chatId:e}}),s.messages({chatId:e,skip:r,take:16}).then((t=>a({type:"fetchNext_fulfilled",data:{chatId:e,messages:t.slice(0,15),hasMore:16===t.length}}))).catch((t=>a({type:"fetchNext_rejected",data:{chatId:e,error:t}})))}),[e]),t.current.mutation.fetchNext]}function ce(e){var t;const{chatId:a}=e,s=n(se()),r=J(),i=W();G((e=>e.query.messages[a]));const c=Z();return d((()=>{var e;!1!==(null===(e=r.current.query.messages[a])||void 0===e?void 0:e.uninitialized)&&(i({type:"messages_fetch",data:{requestId:s.current,chatId:a}}),c.messages({chatId:a,skip:0,take:16}).then((e=>i({type:"messages_fulfilled",data:{chatId:a,messages:e.slice(0,15),hasMore:16===e.length}}))).catch((e=>i({type:"messages_rejected",data:{chatId:a,error:e}}))))}),[a]),null!==(t=r.current.query.messages[a])&&void 0!==t?t:E}function de(){var e;const t=n(se()),a=Z(),s=J(),r=null!==(e=G((e=>e.query.accounts)))&&void 0!==e?e:E,i=W();return d((()=>{!1!==s.current.query.accounts.uninitialized&&(i({type:"accounts_fetch",data:{requestId:t.current}}),a.accounts().then((e=>i({type:"accounts_fulfilled",data:{accounts:e}}))).catch((e=>i({type:"accounts_rejected",data:{error:e}}))))}),[]),null!=r?r:E}function oe(){const e=Z(),t=W(),a=J();return[r((a=>(t({type:"addChat_fetch",data:void 0}),e.addChat(a).then((e=>(t({type:"addChat_fulfilled",data:void 0}),e))).catch((e=>{throw t({type:"addChat_rejected",data:{error:e}}),e})))),[]),a.current.mutation.addChat]}function ue(){const e=Z(),[t,a]=G((e=>[e.queue.read.queued,e.queue.read.timestamp])),s=W(),r=n(null);d((()=>{0!==t.length&&(r.current&&clearTimeout(r.current),r.current=setTimeout((()=>{for(const a of t)s({type:"read_send",data:{id:a}}),e.read({id:a}).catch((()=>s({type:"read_reject",data:{id:a,timestamp:(new Date).getTime()}})))}),100))}),[a])}function he(){const e=Z(),t=W(),a=J();G((e=>e.mutation.addMember));return[r((a=>{t({type:"addMember_fetch",data:void 0}),e.addMember(a).then((()=>t({type:"addMember_fulfilled",data:void 0}))).catch((e=>t({type:"addMember_rejected",data:{error:e}})))}),[t]),a.current.mutation.addMember]}function me(){const e=J();G((e=>e.mutation.removeMember));const t=W(),a=Z();return[r((e=>{t({type:"removeMember_fetch",data:void 0}),a.removeMember(e).then((()=>t({type:"removeMember_fulfilled",data:void 0}))).catch((e=>t({type:"removeMember_rejected",data:{error:e}})))}),[]),e.current.mutation.removeMember]}function le(){const e=J();G((e=>e.mutation.send));const t=W(),a=Z();return[r((e=>{const{chatId:s,requestId:n,files:r,text:i}=e;t({type:"send_fetch",data:{chatId:s,requestId:n,files:r,text:i}}),a.send(e).then((()=>t({type:"send_fulfilled",data:{chatId:s,requestId:n}}))).catch((e=>t({type:"send_rejected",data:{chatId:s,requestId:n,error:e}})))}),[]),e.current.mutation.send]}function fe(){const e=J();G((e=>e.mutation.updateChatName));const t=W(),a=Z();return[r((e=>{t({type:"updateChatName_fetch",data:void 0}),a.updateChatName(e).then((()=>t({type:"updateChatName_fulfilled",data:void 0}))).catch((e=>t({type:"updateChatName_rejected",data:{error:e}})))}),[]),e.current.mutation.updateChatName]}const ge=s.createContext(null);function ve(){return i(ge)}const ye={isToday:e=>f(e).isSame(f(),"day"),timestamp:e=>f(e).format("HH:mm"),dateTime:e=>f(e).format("DD/MM/YYYY HH:mm"),message:{read:()=>"Read",reading:()=>"Reading...",sending:()=>"Sending..."},addChat:{title:()=>"Add chat",name:{label:()=>"Name",required:()=>"Name is required",max250:()=>"Max 250 characters allowed"},members:{label:()=>"Members",required:()=>"Members is required"},submitBtn:()=>"Submit"},system:{chatCreated:()=>"Chat created",memberAdded:()=>"New member added",memberRemoved:()=>"Member removed",chatNameChanged:e=>`Chat name changed to '${e}'`},input:{placeholder:()=>"Start typing (Ctrl/⌘Cmd + Enter to send) ..."},settings:{members:()=>"Members"}},pe=s.createContext(null);function be(t){const{children:a,value:s}=t;return e(pe.Provider,{value:s,children:a})}function Ie(t,a){const n=s.forwardRef(((s,n)=>{const r=function(e){return i(pe)[e]}(t);return null===r?null:e(r||a,Object.assign({},s,{ref:n}))}));return a.displayName=a.displayName||t,n.displayName="Customizable."+a.displayName,Object.assign(n,{key:t,Component:a})}const xe=Ie("ChatName",(a=>{const{name:s}=a;return e(t,{children:s})})),qe=Ie("ChatListItemName",(t=>{const{name:a}=t.chat;return e("div",{className:"wxchtf-chat-name",children:e(xe,{name:a})})})),Ce=Ie("ChatListItemUnreadCount",(t=>{const{totalUnreadCount:a}=t.chat;return a<=0?null:e("div",{className:"wxchtf-unread-count",children:a})}));function we(e,t){if("chatify://chat-created"===t)return e.system.chatCreated();if(t.startsWith("chatify://member-added"))return e.system.memberAdded();if(t.startsWith("chatify://member-removed"))return e.system.memberRemoved();if(t.startsWith("chatify://chat-name-changed::")){const a=JSON.parse(t.substring(29));return e.system.chatNameChanged(a.newName)}return t}const _e=Ie("SystemMessageRow",(t=>{const{message:s,containerRef:n}=t,{text:r,sentAt:i}=s,c=ve();return a("div",{ref:n,className:"wxchtf-system-message",children:[e("div",{className:"wxchtf-text",children:we(c,r)}),e("div",{className:"wxchtf-timestamp",children:c.timestamp(i)})]})})),Ne=Ie("ChatListItemLastMessageContent",(t=>{const{message:a}=t.chat,s=ve();return e("div",{className:"wxchtf-chat-last-message",children:"chatify::system"===a.sentBy.id?we(s,a.text):a.text})})),Me=t=>{const{account:a}=t;return e(g,{src:a.avatar})};Me.displayName="Avatar";const je=Ie("Avatar",Me),Oe=Ie("ChatListItemLastMessageAuthor",(t=>{const{message:s}=t.chat;return"chatify::system"===s.sentBy.id?null:a("div",{className:"wxchtf-chat-last-author",children:[e(je,{account:s.sentBy})," ",s.sentBy.name]})})),Fe=Ie("ChatListItemLastMessageSentAt",(t=>{const{chat:{message:{sentAt:a}}}=t,s=ve();return e("div",{className:"wxchtf-chat-last-sent-at",children:s.isToday(a)?s.timestamp(a):s.dateTime(a)})})),Le=Ie("ChatListItemLastMessage",(t=>a("div",{className:"wxchtf-chat-last",children:[e(Oe,Object.assign({},t)),e(Ne,Object.assign({},t)),e(Fe,Object.assign({},t))]}))),Re=Ie("ChatListItemBox",(t=>{const{message:s,lastReadMessageId:n}=t.chat,r=null!=n&&n.localeCompare(s.id)>=0;return a("div",{className:"wxchtf-chat"+(r?"":" --unread"),children:[e(qe,Object.assign({},t)),e(Ce,Object.assign({},t)),e(Le,Object.assign({},t))]})}));const ke=Ie("ChatList",(()=>{const a=G((e=>e.ui.chatId)),s=o((()=>a?[a]:[]),[a]),n=function(){const e=W();return r((t=>e({type:"chat_open",data:{chatId:t.selectedKeys[0]}})),[e])}(),i=function(){const{data:t}=re();return o((()=>null==t?void 0:t.slice().sort(((e,t)=>-e.message.id.substring(47).localeCompare(t.message.id.substring(47)))).map((t=>({key:t.id,label:e(Re,{chat:t})})))),[t])}();return e(t,{children:i&&e(v,{className:"wxchtf-chat-list",selectedKeys:s,onSelect:n,items:i})})})),Se=Ie("AddChatButton",(()=>{const t=W(),a=r((()=>t({type:"new_chat_open",data:void 0})),[t]);return e("span",{className:"wxchtf-add-btn-wrapper",children:e(y,{className:"wxchtf-add-btn",onClick:a,icon:"+",children:"Add chat"})})})),Be=Ie("Aside",(()=>a("div",{className:"wxchtf-aside",children:[e(Se,{}),e(ke,{})]}))),Ae=Ie("Header",(()=>e("div",{className:"wxchtf-header"}))),Te=Ie("Footer",(()=>e("div",{className:"wxchtf-footer"}))),Ue=Ie("CreateChatNameInput",(t=>{const{name:a}=t,s=ve();return e(p.Item,{name:a,label:s.addChat.name.label(),rules:[{required:!0,message:s.addChat.name.required()},{max:250,message:s.addChat.name.max250()}],children:e(b,{})})}));function ze(t){const{value:a,onChange:s}=t,{data:n,isFetching:r}=de(),i=ee(),c=o((()=>{var e;return null!==(e=null==n?void 0:n.filter((e=>e.id!==i)))&&void 0!==e?e:[]}),[n,i]);return e(I,{rowKey:"id",className:"wxchtf-create-chat-member-input-list",loading:r,dataSource:c,renderItem:t=>{const n=a.includes(t.id);return e(I.Item,{className:n?"--selected":"",children:e(x,{checked:n,onChange:()=>s(a.includes(t.id)?a.filter((e=>e!==t.id)):[...a,t.id]),children:e(I.Item.Meta,{avatar:e(je,{account:t}),title:t.name})})})}})}const He=Ie("CreateChatMemberInput",(t=>{const{name:a}=t,s=ve();return e(p.Item,{label:s.addChat.members.label(),rules:[{required:!0,message:s.addChat.members.required()}],name:a,children:e(ze,{})})})),Pe={name:"",members:[]},Ee=Ie("CreateChatForm",(t=>{const{value:s=Pe,onSubmit:n,busy:r=!1}=t,i=ve();return a(p,{onFinish:n,layout:"vertical",disabled:r,initialValues:s,children:[e(Ue,{name:"name"}),e(He,{name:"members"}),e(y,{loading:r,type:"primary",block:!0,htmlType:"submit",children:i.addChat.submitBtn()})]})})),De={attach:j,send:M,"remove-member":L,"remove-member-delete-history":R,"add-member":O,"add-member-with-history":F,members:k,edit:S,close:B},$e=Ie("Icon",(t=>{const{type:a}=t,s=De[a];return s?e(s,{}):null}));const Ke=Ie("CreateChatPanel",(()=>{const t=ve(),[s,n]=function(){const[e,{isFetching:t}]=oe(),a=W();return[r((t=>e({name:t.name,members:t.members,requestId:se()}).then((e=>a({type:"chat_open",data:{chatId:e}})))),[e,a]),t]}(),i=function(){const e=W();return r((()=>e({type:"new_chat_close",data:void 0})),[e])}();return a("div",{className:"wxchtf-create-chat-panel",children:[e(y,{onClick:i,className:"wxchtf-create-chat-panel-close",type:"link",icon:e($e,{type:"close"})}),e("h3",{children:t.addChat.title()}),e(Ee,{busy:null!=n&&n,onSubmit:s})]})})),Ye=Ie("MessageAuthor",(t=>{const{sentBy:a}=t.message;return e("div",{className:"wxchtf-message-author",children:e(je,{account:a})})})),We=Ie("MessageReadObserver",(a=>{const{message:s,messageRef:r}=a,i=W(),c=G((e=>{const t=e.query.chatList.data.find((e=>e.id===s.chatId)).lastReadMessageId;return null!=t&&s.id.localeCompare(t)<=0})),u=n(c);d((()=>{u.current=u.current||c}),[c]);const h=o((()=>new IntersectionObserver((([e])=>{e.isIntersecting&&!u.current&&(u.current=!0,i({type:"read",data:{id:s.id,timestamp:(new Date).getTime()}}))}))),[]);return d((()=>(h.observe(r.current),()=>h.disconnect())),[h]),e(t,{})})),Je=Ie("MessageText",(t=>{const{text:a}=t.message;return e("div",{className:"wxchtf-message-text",children:a})})),Ge=Ie("MessageContent",(t=>e("div",{className:"wxchtf-message-content",children:e(Je,Object.assign({},t))}))),Ve=Ie("MessageInfoBox",(t=>{const{message:s}=t,{id:n,sentBy:r,sentAt:i}=s,c=ee(),d=r.id===c,o=ve(),u=G((e=>e.queue.read.queued.includes(n)));return a("div",{className:"wxchtf-message-info-box",children:[!d&&a("div",{className:"wxchtf-message-author-name",children:[r.name,","]}),e("div",{className:"wxchtf-message-sent-at",children:o.timestamp(i)}),!d&&e("div",{className:"wxchtf-message-read-box",children:u?o.message.reading():o.message.read()})]})})),Qe=Ie("MessageRow",(t=>{const{message:s,containerRef:n}=t,{sentBy:r}=s,i=ee(),c=r.id===i;return a("div",{ref:n,className:"wxchtf-message"+(c?" --my":""),children:[e(Ye,Object.assign({},t)),a("div",{children:[e(Ve,Object.assign({},t)),e(Ge,Object.assign({},t))]})]})})),Xe=Ie("MessageBox",(s=>{const r=n(null);return a(t,{children:[e(We,Object.assign({messageRef:r},s)),e(Qe,Object.assign({containerRef:r},s))]})}));function Ze(s){const{count:n=1}=s;return e(t,{children:Array.from(Array(n)).map(((t,s)=>a("div",{className:"wxchtf-message-skeleton",children:[e(q.Avatar,{className:"wxchtf-avatar",active:!0}),e(q.Button,{active:!0,className:"wxchtf-content"})]},s)))})}function et(t){const{chatId:a}=t,[s,{isFetching:r}]=ie({chatId:a}),[i,u]=c(!1),h=n(null),m=n(),l=o((()=>new IntersectionObserver((([e])=>{e.isIntersecting?m.current=setTimeout((()=>u(!0)),200):clearTimeout(m.current)}))),[]);return d((()=>(l.observe(h.current),()=>l.disconnect())),[l]),d((()=>{i&&s()}),[i]),r||i?e(Ze,{count:4}):e("div",{className:"wxchtf-next",ref:h})}const tt=Ie("SendingMessageText",(t=>{const{text:a}=t;return e("div",{className:"wxchtf-sending-message-text",children:a})})),at=Ie("SendingMessageInfoBox",(t=>{const a=ve();return e("div",{className:"wxchtf-sending-message-info-box",children:e("div",{className:"wxchtf-sending-message-sending-box",children:a.message.sending()})})})),st=Ie("SendingMessageContent",(t=>a("div",{className:"wxchtf-sending-message-content",children:[e(tt,Object.assign({},t)),e(at,Object.assign({},t))]}))),nt=Ie("SendingMessageBox",(t=>e("div",{className:"wxchtf-sending-message",children:e(st,Object.assign({},t))}))),rt=Ie("SystemMessageBox",(s=>{const r=n(null);return a(t,{children:[e(We,Object.assign({messageRef:r},s)),e(_e,Object.assign({containerRef:r},s))]})})),it=Ie("ChatBody",(t=>{const{id:s}=t,{data:n}=ce({chatId:s});return a("div",{className:"wxchtf-chat-body",children:[!n&&e(Ze,{count:5}),null==n?void 0:n.map(((t,a)=>{if("message"===t.type&&"chatify::system"===t.sentBy.id)return e(rt,{message:t},t.id);switch(t.type){case"message":return e(Xe,{message:t},t.id);case"sending":return e(nt,{text:t.text,files:t.files},t.requestId);case"next":return e(et,{chatId:s},"next-"+n.length+"-"+a);default:return null}}))]})})),ct=Ie("ChatHeaderMembers",(t=>{const{id:a}=t,{data:s}=ne({chatId:a});return(null==s?void 0:s.members)?e(g.Group,{maxCount:5,children:s.members.map((t=>e(C,{title:t.name,children:e(je,{account:t})},t.id)))}):null})),dt=Ie("ChatMembersButton",(t=>{const a=W(),s=r((()=>a({type:"toggle_members_view",data:void 0})),[a]);return e(y,{onClick:s,type:"link",icon:e($e,{type:"members"})})})),ot=A("escape"),ut=A("enter");const ht=Ie("ChatHeaderName",(t=>{const{id:a}=t,s=G((e=>e.query.chatList.data.find((e=>e.id===a)))),n=s.name,[r,i]=c(""),[o,u]=c(!1),h=function(e,t){const[a]=fe();return()=>a({id:e,name:t})}(a,r);return d((()=>{o&&i(n)}),[o,n]),s.active?e(C,o?{defaultOpen:!0,title:"Press Enter to save new chat name or Escape to cancel editing",children:e(b,{value:r,onChange:e=>i(e.target.value),onBlur:()=>u(!1),onKeyDown:e=>{ot(e)?u(!1):ut(e)&&(u(!1),r!==n&&""!==r.trim()&&h())},autoFocus:!0})}:{title:"Click to edit name...",children:e("span",{className:"wxchtf-chat-name --editable",onClick:()=>u(!0),children:e(xe,{name:n})})}):e("span",{className:"wxchtf-chat-name",children:n})})),mt=Ie("ChatHeader",(t=>{const{id:s}=t,n=G((e=>e.query.chatList.data.find((e=>e.id===s))));return e("div",{className:"wxchtf-chat-header",children:a(w,{justify:"space-between",align:"middle",children:[e(_,{children:e(ht,{id:s})}),n.active&&a(_,{className:"wxchtf-chat-members",children:[e(ct,{id:s}),e(dt,{id:s})]})]})})})),lt=Ie("InputFilesBox",(()=>e("div",{className:"wxchtf-add-files-box",children:e(y,{type:"link",icon:e($e,{type:"attach"}),className:"wxchtf-add-files-btn"})}))),ft=A("ctrl+enter"),gt={maxRows:5,minRows:1},vt=Ie("InputTextBox",u((t=>{const{value:a,onChange:s,onSend:n}=t,i=ve(),c=r((e=>s(e.target.value)),[s]),d=r((e=>{ft(e)&&n(a)}),[n,a]);return e("div",{className:"wxchtf-text-input-box",children:e(b.TextArea,{value:a,onChange:c,autoSize:gt,className:"wxchtf-text-input-textarea",placeholder:i.input.placeholder(),onKeyDown:d})})}))),yt=Ie("InputSubmitButtonBox",(t=>{const{onSubmit:a}=t;return e("div",{className:"wxchtf-submit-btn-box",children:e(y,{onClick:a,type:"link",icon:e($e,{type:"send"}),className:"wxchtf-submit-btn"})})}));const pt=Ie("InputBox",(()=>{const[t,s]=c(""),n=function(e,t){const a=G((e=>e.ui.chatId)),[s]=le();return r((()=>{0!==e.length&&(t(""),s({chatId:a,text:e,files:[],requestId:se()}))}),[a,e])}(t,s);return e("div",{className:"wxchtf-input-form",children:a("div",{className:"wxchtf-input-box",children:[e(lt,{}),e(vt,{value:t,onSend:n,onChange:s}),e(yt,{onSubmit:n})]})})}));function bt(e,t,a){const[s,n]=he();return[r((()=>s({chatId:e,accountId:t,withHistory:a})),[s,e,t,a]),n]}function It(e,t,a){const[s,n]=me();return[r((()=>s({chatId:e,accountId:t,deleteHistory:a})),[s,e,t,a]),n]}const xt=Ie("ChatMemberListItem",(t=>{const{chatId:s}=t,{data:n}=ne({chatId:s}),{data:r}=de(),i=r.find((e=>e.id===t.id)),c=n.members.some((e=>e.id===i.id)),[d]=bt(s,i.id,!1),[o]=bt(s,i.id,!0),[u]=It(s,i.id,!1),[h]=It(s,i.id,!0);return e(I.Item,{className:"wxchtf-chat-members-list-item",actions:c?[e(C,{title:"Remove (keep history)",children:e(y,{onClick:u,type:"link",icon:e($e,{type:"remove-member"})})},"remove"),e(C,{title:"Remove (delete history)",children:e(y,{onClick:h,type:"link",icon:e($e,{type:"remove-member-delete-history"})})},"remove_delete_history")]:[e(C,{title:"Add (no history)",children:e(y,{onClick:d,type:"link",icon:e($e,{type:"add-member"})})},"add_no_history"),e(C,{title:"Add (share history)",children:e(y,{onClick:o,type:"link",icon:e($e,{type:"add-member-with-history"})})},"add")],children:a(N,{children:[e(je,{account:i}),e("span",{children:i.name})]})})})),qt=Ie("ChatMembersPanel",(t=>{const{id:a}=t,{data:s}=ne({chatId:a}),{data:n}=de(),r=o((()=>null==n?void 0:n.slice().sort(((e,t)=>((null==s?void 0:s.members.some((t=>t.id===e.id)))?-100:0)-((null==s?void 0:s.members.some((e=>e.id===t.id)))?-100:0)+e.name.localeCompare(t.name)))),[n,s]);return(null==s?void 0:s.members)&&n?e("div",{className:"wxchtf-chat-members-panel",children:e(I,{className:"wxchtf-chat-members-list",dataSource:r,renderItem:t=>e(xt,{id:t.id,chatId:a})})}):null})),Ct=Ie("ChatPanel",(t=>{const{id:s}=t,n=G((e=>e.query.chatList.data.find((e=>e.id===s)))),r=G((e=>e.ui.showMembers));return a("div",{className:"wxchtf-chat-panel",children:[a("div",{className:"wxchtf-chat-main",children:[e(mt,{id:s}),e(it,{id:s}),n.active&&e(pt,{})]}),r&&e(qt,{id:s})]})})),wt=Ie("Main",(()=>{const{view:t,chatId:s}=G((e=>({view:e.ui.view,chatId:e.ui.chatId})));return a("div",{className:"wxchtf-main",children:["chat"===t&&s&&e(Ct,{id:s},s),"new-chat"===t&&e(Ke,{})]})})),_t=Ie("Body",(()=>a("div",{className:"wxchtf-body",children:[e(Be,{}),e(wt,{})]})));function Nt(t){const{className:s="",style:n}=t;return ue(),a("div",{className:s+" wxchtf-chatify",style:n,children:[e(Ae,{}),e(_t,{}),e(Te,{})]})}const Mt={Header:null,Footer:null},jt=t=>{const{localizer:a=ye,customize:s=Mt}=t,n=o((()=>Object.assign({},Mt,s)),[s]);return e(ge.Provider,{value:a,children:e(be,{value:n,children:e(Nt,Object.assign({},t))})})};jt.displayName="Chatify";export{P as ACTIONS,Se as AddChatButton,je as Avatar,mt as ChatHeader,ct as ChatHeaderMembers,Re as ChatListItemBox,jt as Chatify,H as ChatifyClient,ae as ChatifyContext,E as FETCH_QUERY_STATE,Ae as Header,De as ICONS,D as INITIAL_STATE,$e as Icon,ge as LocalizerContext,Xe as MessageBox,Y as ReducerProvider,rt as SystemMessageBox,ye as defaultLocalizer,oe as useAddChatMutation,he as useAddMemberMutation,Z as useClient,W as useDispatch,ie as useFetchNextMutation,de as useGetAccountsQuery,re as useGetChatListQuery,ne as useGetChatQuery,ce as useGetMessagesQuery,ve as useLocalizer,ee as useMe,ue as useReadMonitor,$ as useReducer,me as useRemoveMemberMutation,G as useSelect,le as useSendMutation,V as useSignalRMonitor,J as useStateRef,fe as useUpdateChatNameMutation};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|