@ethora/chat-component-rn 26.8.4 → 26.8.6
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/README.md +55 -0
- package/lib/commonjs/assets/emojiData.js +40 -0
- package/lib/commonjs/assets/emojiData.js.map +1 -0
- package/lib/commonjs/assets/icons.js +1 -1
- package/lib/commonjs/assets/icons.js.map +1 -1
- package/lib/commonjs/components/Header/HeaderRoomList.js +12 -7
- package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatHeader.js +7 -9
- package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatRoom.js +47 -26
- package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatWrapper.js +58 -21
- package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/KeyboardInputDock.js +40 -0
- package/lib/commonjs/components/MainComponents/KeyboardInputDock.js.map +1 -0
- package/lib/commonjs/components/MainComponents/MessageContainer.js +4 -12
- package/lib/commonjs/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageList.js +110 -35
- package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/RoomList.js +32 -29
- package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/RoomStack.js +270 -0
- package/lib/commonjs/components/MainComponents/RoomStack.js.map +1 -0
- package/lib/commonjs/components/MainComponents/SystemMessage.js +6 -2
- package/lib/commonjs/components/MainComponents/SystemMessage.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/Avatar.js +5 -1
- package/lib/commonjs/components/MessageBubble/Avatar.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/BottomReplyContainer.js +17 -21
- package/lib/commonjs/components/MessageBubble/BottomReplyContainer.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/EmojiPickerSheet.js +447 -0
- package/lib/commonjs/components/MessageBubble/EmojiPickerSheet.js.map +1 -0
- package/lib/commonjs/components/MessageBubble/Message.js +200 -132
- package/lib/commonjs/components/MessageBubble/Message.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/MessageInteractions.js +213 -12
- package/lib/commonjs/components/MessageBubble/MessageInteractions.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/MessageReaction.js +113 -94
- package/lib/commonjs/components/MessageBubble/MessageReaction.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/MessageReply.js +66 -24
- package/lib/commonjs/components/MessageBubble/MessageReply.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +6 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/Modal/Modal.js +24 -0
- package/lib/commonjs/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/commonjs/components/Modals/Modal/SwipeBackLayer.js +178 -0
- package/lib/commonjs/components/Modals/Modal/SwipeBackLayer.js.map +1 -0
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js +28 -10
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +9 -3
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +5 -4
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessageEmoji.js +8 -9
- package/lib/commonjs/components/RoomComponents/styled/LastMessageEmoji.js.map +1 -1
- package/lib/commonjs/components/Thread/ThreadWrapper.js +265 -152
- package/lib/commonjs/components/Thread/ThreadWrapper.js.map +1 -1
- package/lib/commonjs/components/styled/DateLabel.js +6 -3
- package/lib/commonjs/components/styled/DateLabel.js.map +1 -1
- package/lib/commonjs/context/MessageNotificationContext.js +188 -9
- package/lib/commonjs/context/MessageNotificationContext.js.map +1 -1
- package/lib/commonjs/context/xmppProvider.js +22 -7
- package/lib/commonjs/context/xmppProvider.js.map +1 -1
- package/lib/commonjs/helpers/createRoomFromApi.js +36 -2
- package/lib/commonjs/helpers/createRoomFromApi.js.map +1 -1
- package/lib/commonjs/helpers/emoji.js +51 -0
- package/lib/commonjs/helpers/emoji.js.map +1 -0
- package/lib/commonjs/helpers/haptics.js +29 -0
- package/lib/commonjs/helpers/haptics.js.map +1 -0
- package/lib/commonjs/helpers/historyPreloadScheduler.js +32 -66
- package/lib/commonjs/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/commonjs/helpers/insertMessageWithDelimiter.js +21 -12
- package/lib/commonjs/helpers/insertMessageWithDelimiter.js.map +1 -1
- package/lib/commonjs/helpers/keyboardLayout.js +23 -1
- package/lib/commonjs/helpers/keyboardLayout.js.map +1 -1
- package/lib/commonjs/helpers/mamReactions.js +57 -0
- package/lib/commonjs/helpers/mamReactions.js.map +1 -0
- package/lib/commonjs/helpers/parseMessageReference.js +42 -0
- package/lib/commonjs/helpers/parseMessageReference.js.map +1 -0
- package/lib/commonjs/helpers/reactionsConfig.js +17 -0
- package/lib/commonjs/helpers/reactionsConfig.js.map +1 -0
- package/lib/commonjs/helpers/updateMessagesTillLast.js +17 -2
- package/lib/commonjs/helpers/updateMessagesTillLast.js.map +1 -1
- package/lib/commonjs/hooks/useHeapSender.js +3 -1
- package/lib/commonjs/hooks/useHeapSender.js.map +1 -1
- package/lib/commonjs/hooks/useMessageHeapState.js +3 -2
- package/lib/commonjs/hooks/useMessageHeapState.js.map +1 -1
- package/lib/commonjs/hooks/useRoomInitialization.js +16 -7
- package/lib/commonjs/hooks/useRoomInitialization.js.map +1 -1
- package/lib/commonjs/hooks/useSendMessage.js +14 -8
- package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js +1 -1
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/commonjs/networking/stanzaHandlers.js +106 -50
- package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
- package/lib/commonjs/networking/xmpp/getHistory.xmpp.js +29 -74
- package/lib/commonjs/networking/xmpp/getHistory.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/handleStanzas.xmpp.js +4 -0
- package/lib/commonjs/networking/xmpp/handleStanzas.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/mamRouter.js +186 -0
- package/lib/commonjs/networking/xmpp/mamRouter.js.map +1 -0
- package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js +41 -4
- package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmppClient.js +98 -23
- package/lib/commonjs/networking/xmppClient.js.map +1 -1
- package/lib/commonjs/roomStore/Middleware/newMessageMidlleware.js +29 -34
- package/lib/commonjs/roomStore/Middleware/newMessageMidlleware.js.map +1 -1
- package/lib/commonjs/roomStore/Middleware/perfMiddleware.js +51 -0
- package/lib/commonjs/roomStore/Middleware/perfMiddleware.js.map +1 -0
- package/lib/commonjs/roomStore/Middleware/reactionsMiddleware.js +66 -43
- package/lib/commonjs/roomStore/Middleware/reactionsMiddleware.js.map +1 -1
- package/lib/commonjs/roomStore/Middleware/unreadMidlleware.js +88 -68
- package/lib/commonjs/roomStore/Middleware/unreadMidlleware.js.map +1 -1
- package/lib/commonjs/roomStore/index.js +18 -14
- package/lib/commonjs/roomStore/index.js.map +1 -1
- package/lib/commonjs/roomStore/persistBackend.js +96 -0
- package/lib/commonjs/roomStore/persistBackend.js.map +1 -0
- package/lib/commonjs/roomStore/persistence.js +245 -50
- package/lib/commonjs/roomStore/persistence.js.map +1 -1
- package/lib/commonjs/roomStore/roomsSlice.js +282 -136
- package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
- package/lib/commonjs/theme/theme.js +3 -0
- package/lib/commonjs/theme/theme.js.map +1 -1
- package/lib/commonjs/utils/devLogger.js +14 -0
- package/lib/commonjs/utils/devLogger.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/assets/emojiData.js +36 -0
- package/lib/module/assets/emojiData.js.map +1 -0
- package/lib/module/assets/icons.js +1 -1
- package/lib/module/assets/icons.js.map +1 -1
- package/lib/module/components/Header/HeaderRoomList.js +12 -7
- package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/module/components/MainComponents/ChatHeader.js +8 -10
- package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/module/components/MainComponents/ChatRoom.js +49 -28
- package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/module/components/MainComponents/ChatWrapper.js +60 -23
- package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/KeyboardInputDock.js +33 -0
- package/lib/module/components/MainComponents/KeyboardInputDock.js.map +1 -0
- package/lib/module/components/MainComponents/MessageContainer.js +7 -14
- package/lib/module/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/module/components/MainComponents/MessageList.js +110 -35
- package/lib/module/components/MainComponents/MessageList.js.map +1 -1
- package/lib/module/components/MainComponents/RoomList.js +32 -29
- package/lib/module/components/MainComponents/RoomList.js.map +1 -1
- package/lib/module/components/MainComponents/RoomStack.js +266 -0
- package/lib/module/components/MainComponents/RoomStack.js.map +1 -0
- package/lib/module/components/MainComponents/SystemMessage.js +6 -2
- package/lib/module/components/MainComponents/SystemMessage.js.map +1 -1
- package/lib/module/components/MessageBubble/Avatar.js +5 -1
- package/lib/module/components/MessageBubble/Avatar.js.map +1 -1
- package/lib/module/components/MessageBubble/BottomReplyContainer.js +18 -22
- package/lib/module/components/MessageBubble/BottomReplyContainer.js.map +1 -1
- package/lib/module/components/MessageBubble/EmojiPickerSheet.js +438 -0
- package/lib/module/components/MessageBubble/EmojiPickerSheet.js.map +1 -0
- package/lib/module/components/MessageBubble/Message.js +203 -134
- package/lib/module/components/MessageBubble/Message.js.map +1 -1
- package/lib/module/components/MessageBubble/MessageInteractions.js +215 -14
- package/lib/module/components/MessageBubble/MessageInteractions.js.map +1 -1
- package/lib/module/components/MessageBubble/MessageReaction.js +115 -94
- package/lib/module/components/MessageBubble/MessageReaction.js.map +1 -1
- package/lib/module/components/MessageBubble/MessageReply.js +65 -24
- package/lib/module/components/MessageBubble/MessageReply.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +6 -1
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/module/components/Modals/Modal/Modal.js +25 -1
- package/lib/module/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/module/components/Modals/Modal/SwipeBackLayer.js +172 -0
- package/lib/module/components/Modals/Modal/SwipeBackLayer.js.map +1 -0
- package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js +29 -11
- package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +10 -4
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/module/components/RoomComponents/ChatRoomItem.js +5 -4
- package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessageEmoji.js +8 -9
- package/lib/module/components/RoomComponents/styled/LastMessageEmoji.js.map +1 -1
- package/lib/module/components/Thread/ThreadWrapper.js +264 -152
- package/lib/module/components/Thread/ThreadWrapper.js.map +1 -1
- package/lib/module/components/styled/DateLabel.js +6 -3
- package/lib/module/components/styled/DateLabel.js.map +1 -1
- package/lib/module/context/MessageNotificationContext.js +190 -11
- package/lib/module/context/MessageNotificationContext.js.map +1 -1
- package/lib/module/context/xmppProvider.js +22 -7
- package/lib/module/context/xmppProvider.js.map +1 -1
- package/lib/module/helpers/createRoomFromApi.js +36 -2
- package/lib/module/helpers/createRoomFromApi.js.map +1 -1
- package/lib/module/helpers/emoji.js +44 -0
- package/lib/module/helpers/emoji.js.map +1 -0
- package/lib/module/helpers/haptics.js +24 -0
- package/lib/module/helpers/haptics.js.map +1 -0
- package/lib/module/helpers/historyPreloadScheduler.js +32 -66
- package/lib/module/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/module/helpers/insertMessageWithDelimiter.js +21 -12
- package/lib/module/helpers/insertMessageWithDelimiter.js.map +1 -1
- package/lib/module/helpers/keyboardLayout.js +20 -0
- package/lib/module/helpers/keyboardLayout.js.map +1 -1
- package/lib/module/helpers/mamReactions.js +51 -0
- package/lib/module/helpers/mamReactions.js.map +1 -0
- package/lib/module/helpers/parseMessageReference.js +37 -0
- package/lib/module/helpers/parseMessageReference.js.map +1 -0
- package/lib/module/helpers/reactionsConfig.js +10 -0
- package/lib/module/helpers/reactionsConfig.js.map +1 -0
- package/lib/module/helpers/updateMessagesTillLast.js +17 -2
- package/lib/module/helpers/updateMessagesTillLast.js.map +1 -1
- package/lib/module/hooks/useHeapSender.js +3 -1
- package/lib/module/hooks/useHeapSender.js.map +1 -1
- package/lib/module/hooks/useMessageHeapState.js +3 -2
- package/lib/module/hooks/useMessageHeapState.js.map +1 -1
- package/lib/module/hooks/useRoomInitialization.js +17 -8
- package/lib/module/hooks/useRoomInitialization.js.map +1 -1
- package/lib/module/hooks/useSendMessage.js +14 -8
- package/lib/module/hooks/useSendMessage.js.map +1 -1
- package/lib/module/hooks/useUnreadMessagesCounter.js +1 -1
- package/lib/module/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/module/networking/stanzaHandlers.js +107 -51
- package/lib/module/networking/stanzaHandlers.js.map +1 -1
- package/lib/module/networking/xmpp/getHistory.xmpp.js +29 -74
- package/lib/module/networking/xmpp/getHistory.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/handleStanzas.xmpp.js +4 -0
- package/lib/module/networking/xmpp/handleStanzas.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/mamRouter.js +175 -0
- package/lib/module/networking/xmpp/mamRouter.js.map +1 -0
- package/lib/module/networking/xmpp/presenceInRoom.xmpp.js +38 -2
- package/lib/module/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
- package/lib/module/networking/xmppClient.js +99 -24
- package/lib/module/networking/xmppClient.js.map +1 -1
- package/lib/module/roomStore/Middleware/newMessageMidlleware.js +29 -34
- package/lib/module/roomStore/Middleware/newMessageMidlleware.js.map +1 -1
- package/lib/module/roomStore/Middleware/perfMiddleware.js +45 -0
- package/lib/module/roomStore/Middleware/perfMiddleware.js.map +1 -0
- package/lib/module/roomStore/Middleware/reactionsMiddleware.js +66 -43
- package/lib/module/roomStore/Middleware/reactionsMiddleware.js.map +1 -1
- package/lib/module/roomStore/Middleware/unreadMidlleware.js +89 -69
- package/lib/module/roomStore/Middleware/unreadMidlleware.js.map +1 -1
- package/lib/module/roomStore/index.js +19 -15
- package/lib/module/roomStore/index.js.map +1 -1
- package/lib/module/roomStore/persistBackend.js +89 -0
- package/lib/module/roomStore/persistBackend.js.map +1 -0
- package/lib/module/roomStore/persistence.js +245 -48
- package/lib/module/roomStore/persistence.js.map +1 -1
- package/lib/module/roomStore/roomsSlice.js +275 -134
- package/lib/module/roomStore/roomsSlice.js.map +1 -1
- package/lib/module/theme/theme.js +3 -0
- package/lib/module/theme/theme.js.map +1 -1
- package/lib/module/utils/devLogger.js +13 -0
- package/lib/module/utils/devLogger.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/assets/emojiData.d.ts +8 -0
- package/lib/typescript/assets/emojiData.d.ts.map +1 -0
- package/lib/typescript/components/Header/HeaderRoomList.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatHeader.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatRoom.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatWrapper.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/KeyboardInputDock.d.ts +16 -0
- package/lib/typescript/components/MainComponents/KeyboardInputDock.d.ts.map +1 -0
- package/lib/typescript/components/MainComponents/MessageContainer.d.ts +2 -2
- package/lib/typescript/components/MainComponents/MessageContainer.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MessageList.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/RoomList.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/RoomStack.d.ts +42 -0
- package/lib/typescript/components/MainComponents/RoomStack.d.ts.map +1 -0
- package/lib/typescript/components/MainComponents/SystemMessage.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/Avatar.d.ts +2 -0
- package/lib/typescript/components/MessageBubble/Avatar.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/BottomReplyContainer.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/EmojiPickerSheet.d.ts +11 -0
- package/lib/typescript/components/MessageBubble/EmojiPickerSheet.d.ts.map +1 -0
- package/lib/typescript/components/MessageBubble/Message.d.ts +2 -2
- package/lib/typescript/components/MessageBubble/Message.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/MessageInteractions.d.ts +2 -0
- package/lib/typescript/components/MessageBubble/MessageInteractions.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/MessageReaction.d.ts +1 -0
- package/lib/typescript/components/MessageBubble/MessageReaction.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/MessageReply.d.ts +7 -7
- package/lib/typescript/components/MessageBubble/MessageReply.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/Modal/Modal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/Modal/SwipeBackLayer.d.ts +16 -0
- package/lib/typescript/components/Modals/Modal/SwipeBackLayer.d.ts.map +1 -0
- package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/ChatRoomItem.d.ts +2 -2
- package/lib/typescript/components/RoomComponents/ChatRoomItem.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageEmoji.d.ts +3 -6
- package/lib/typescript/components/RoomComponents/styled/LastMessageEmoji.d.ts.map +1 -1
- package/lib/typescript/components/Thread/ThreadWrapper.d.ts +7 -1
- package/lib/typescript/components/Thread/ThreadWrapper.d.ts.map +1 -1
- package/lib/typescript/components/styled/DateLabel.d.ts +1 -0
- package/lib/typescript/components/styled/DateLabel.d.ts.map +1 -1
- package/lib/typescript/context/MessageNotificationContext.d.ts.map +1 -1
- package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
- package/lib/typescript/helpers/createRoomFromApi.d.ts.map +1 -1
- package/lib/typescript/helpers/emoji.d.ts +6 -0
- package/lib/typescript/helpers/emoji.d.ts.map +1 -0
- package/lib/typescript/helpers/haptics.d.ts +3 -0
- package/lib/typescript/helpers/haptics.d.ts.map +1 -0
- package/lib/typescript/helpers/historyPreloadScheduler.d.ts +1 -0
- package/lib/typescript/helpers/historyPreloadScheduler.d.ts.map +1 -1
- package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts.map +1 -1
- package/lib/typescript/helpers/keyboardLayout.d.ts +6 -0
- package/lib/typescript/helpers/keyboardLayout.d.ts.map +1 -1
- package/lib/typescript/helpers/mamReactions.d.ts +13 -0
- package/lib/typescript/helpers/mamReactions.d.ts.map +1 -0
- package/lib/typescript/helpers/parseMessageReference.d.ts +16 -0
- package/lib/typescript/helpers/parseMessageReference.d.ts.map +1 -0
- package/lib/typescript/helpers/reactionsConfig.d.ts +5 -0
- package/lib/typescript/helpers/reactionsConfig.d.ts.map +1 -0
- package/lib/typescript/helpers/updateMessagesTillLast.d.ts.map +1 -1
- package/lib/typescript/hooks/useHeapSender.d.ts.map +1 -1
- package/lib/typescript/hooks/useMessageHeapState.d.ts.map +1 -1
- package/lib/typescript/hooks/useRoomInitialization.d.ts +2 -2
- package/lib/typescript/hooks/useRoomInitialization.d.ts.map +1 -1
- package/lib/typescript/hooks/useSendMessage.d.ts.map +1 -1
- package/lib/typescript/networking/stanzaHandlers.d.ts +4 -2
- package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/getHistory.xmpp.d.ts +3 -1
- package/lib/typescript/networking/xmpp/getHistory.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/handleStanzas.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/mamRouter.d.ts +23 -0
- package/lib/typescript/networking/xmpp/mamRouter.d.ts.map +1 -0
- package/lib/typescript/networking/xmpp/presenceInRoom.xmpp.d.ts +1 -0
- package/lib/typescript/networking/xmpp/presenceInRoom.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmppClient.d.ts +22 -1
- package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
- package/lib/typescript/roomStore/Middleware/newMessageMidlleware.d.ts.map +1 -1
- package/lib/typescript/roomStore/Middleware/perfMiddleware.d.ts +4 -0
- package/lib/typescript/roomStore/Middleware/perfMiddleware.d.ts.map +1 -0
- package/lib/typescript/roomStore/Middleware/reactionsMiddleware.d.ts +9 -0
- package/lib/typescript/roomStore/Middleware/reactionsMiddleware.d.ts.map +1 -1
- package/lib/typescript/roomStore/Middleware/unreadMidlleware.d.ts.map +1 -1
- package/lib/typescript/roomStore/index.d.ts.map +1 -1
- package/lib/typescript/roomStore/persistBackend.d.ts +11 -0
- package/lib/typescript/roomStore/persistBackend.d.ts.map +1 -0
- package/lib/typescript/roomStore/persistence.d.ts +5 -6
- package/lib/typescript/roomStore/persistence.d.ts.map +1 -1
- package/lib/typescript/roomStore/roomsSlice.d.ts +41 -1
- package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
- package/lib/typescript/theme/theme.d.ts +4 -1
- package/lib/typescript/theme/theme.d.ts.map +1 -1
- package/lib/typescript/types/models/message.model.d.ts +4 -0
- package/lib/typescript/types/models/message.model.d.ts.map +1 -1
- package/lib/typescript/types/models/room.model.d.ts +16 -0
- package/lib/typescript/types/models/room.model.d.ts.map +1 -1
- package/lib/typescript/types/models/xmpp.model.d.ts +6 -1
- package/lib/typescript/types/models/xmpp.model.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +15 -3
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/lib/typescript/utils/devLogger.d.ts +8 -0
- package/lib/typescript/utils/devLogger.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +10 -1
- package/src/assets/emojiData.ts +2146 -0
- package/src/assets/icons.tsx +5 -5
- package/src/components/Header/HeaderRoomList.tsx +7 -5
- package/src/components/MainComponents/ChatHeader.tsx +16 -7
- package/src/components/MainComponents/ChatRoom.tsx +64 -32
- package/src/components/MainComponents/ChatWrapper.tsx +73 -21
- package/src/components/MainComponents/KeyboardInputDock.tsx +47 -0
- package/src/components/MainComponents/MessageContainer.tsx +7 -15
- package/src/components/MainComponents/MessageList.tsx +96 -43
- package/src/components/MainComponents/RoomList.tsx +28 -29
- package/src/components/MainComponents/RoomStack.tsx +309 -0
- package/src/components/MainComponents/SystemMessage.tsx +6 -2
- package/src/components/MessageBubble/Avatar.tsx +7 -1
- package/src/components/MessageBubble/BottomReplyContainer.tsx +19 -21
- package/src/components/MessageBubble/EmojiPickerSheet.tsx +468 -0
- package/src/components/MessageBubble/Message.tsx +146 -87
- package/src/components/MessageBubble/MessageInteractions.tsx +213 -12
- package/src/components/MessageBubble/MessageReaction.tsx +120 -96
- package/src/components/MessageBubble/MessageReply.tsx +65 -32
- package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +4 -0
- package/src/components/Modals/Modal/Modal.tsx +32 -1
- package/src/components/Modals/Modal/SwipeBackLayer.tsx +221 -0
- package/src/components/Modals/ProfileHeader/ProfileHeader.tsx +29 -8
- package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +6 -3
- package/src/components/RoomComponents/ChatRoomItem.tsx +11 -4
- package/src/components/RoomComponents/styled/LastMessageEmoji.tsx +7 -8
- package/src/components/Thread/ThreadWrapper.tsx +274 -198
- package/src/components/styled/DateLabel.tsx +7 -3
- package/src/context/MessageNotificationContext.tsx +205 -7
- package/src/context/xmppProvider.tsx +29 -9
- package/src/helpers/createRoomFromApi.tsx +37 -1
- package/src/helpers/emoji.ts +39 -0
- package/src/helpers/haptics.ts +19 -0
- package/src/helpers/historyPreloadScheduler.ts +37 -69
- package/src/helpers/insertMessageWithDelimiter.ts +23 -16
- package/src/helpers/keyboardLayout.ts +26 -0
- package/src/helpers/mamReactions.ts +59 -0
- package/src/helpers/parseMessageReference.ts +38 -0
- package/src/helpers/reactionsConfig.ts +13 -0
- package/src/helpers/updateMessagesTillLast.tsx +14 -2
- package/src/hooks/useHeapSender.tsx +3 -2
- package/src/hooks/useMessageHeapState.tsx +6 -2
- package/src/hooks/useRoomInitialization.tsx +32 -15
- package/src/hooks/useSendMessage.tsx +18 -11
- package/src/hooks/useUnreadMessagesCounter.ts +1 -1
- package/src/networking/stanzaHandlers.ts +116 -60
- package/src/networking/xmpp/getHistory.xmpp.ts +44 -106
- package/src/networking/xmpp/handleStanzas.xmpp.ts +2 -0
- package/src/networking/xmpp/mamRouter.ts +176 -0
- package/src/networking/xmpp/presenceInRoom.xmpp.ts +46 -3
- package/src/networking/xmppClient.ts +105 -20
- package/src/roomStore/Middleware/newMessageMidlleware.tsx +35 -38
- package/src/roomStore/Middleware/perfMiddleware.ts +50 -0
- package/src/roomStore/Middleware/reactionsMiddleware.tsx +53 -52
- package/src/roomStore/Middleware/unreadMidlleware.tsx +92 -80
- package/src/roomStore/index.ts +28 -27
- package/src/roomStore/persistBackend.ts +96 -0
- package/src/roomStore/persistence.ts +280 -73
- package/src/roomStore/roomsSlice.ts +304 -155
- package/src/theme/theme.ts +10 -1
- package/src/types/models/message.model.ts +4 -0
- package/src/types/models/room.model.ts +17 -0
- package/src/types/models/xmpp.model.ts +4 -2
- package/src/types/types.ts +15 -3
- package/src/utils/devLogger.ts +16 -0
- package/src/version.ts +1 -1
package/src/assets/icons.tsx
CHANGED
|
@@ -305,18 +305,18 @@ export const DeleteIcon = ({
|
|
|
305
305
|
</Svg>
|
|
306
306
|
);
|
|
307
307
|
|
|
308
|
-
export const CopyIcon = ({ color = '#
|
|
308
|
+
export const CopyIcon = ({ color = '#1F1F1F', ...props }) => (
|
|
309
309
|
<Svg width="24" height="24" viewBox="0 0 24 24" fill="none" {...props}>
|
|
310
310
|
<Path
|
|
311
311
|
d="M8 4V16C8 16.5304 8.21071 17.0391 8.58579 17.4142C8.96086 17.7893 9.46957 18 10 18H18C18.5304 18 19.0391 17.7893 19.4142 17.4142C19.7893 17.0391 20 16.5304 20 16V7.242C20 6.97556 19.9467 6.71181 19.8433 6.46624C19.7399 6.22068 19.5885 5.99824 19.398 5.812L16.083 2.57C15.7094 2.20466 15.2076 2.00007 14.685 2H10C9.46957 2 8.96086 2.21071 8.58579 2.58579C8.21071 2.96086 8 3.46957 8 4Z"
|
|
312
|
-
stroke=
|
|
312
|
+
stroke={color}
|
|
313
313
|
strokeWidth="2"
|
|
314
314
|
strokeLinecap="round"
|
|
315
315
|
strokeLinejoin="round"
|
|
316
316
|
/>
|
|
317
317
|
<Path
|
|
318
318
|
d="M16 18V20C16 20.5304 15.7893 21.0391 15.4142 21.4142C15.0391 21.7893 14.5304 22 14 22H6C5.46957 22 4.96086 21.7893 4.58579 21.4142C4.21071 21.0391 4 20.5304 4 20V9C4 8.46957 4.21071 7.96086 4.58579 7.58579C4.96086 7.21071 5.46957 7 6 7H8"
|
|
319
|
-
stroke=
|
|
319
|
+
stroke={color}
|
|
320
320
|
strokeWidth="2"
|
|
321
321
|
strokeLinecap="round"
|
|
322
322
|
strokeLinejoin="round"
|
|
@@ -324,11 +324,11 @@ export const CopyIcon = ({ color = '#8C8C8C', ...props }) => (
|
|
|
324
324
|
</Svg>
|
|
325
325
|
);
|
|
326
326
|
|
|
327
|
-
export const ReplyIcon = ({ color = '#
|
|
327
|
+
export const ReplyIcon = ({ color = '#1F1F1F', ...props }) => (
|
|
328
328
|
<Svg width="24" height="24" viewBox="0 0 24 24" fill="none" {...props}>
|
|
329
329
|
<Path
|
|
330
330
|
d="M9.89797 7.51968C9.9311 7.5051 9.96737 7.49907 10.0034 7.50217C10.0395 7.50526 10.0742 7.51737 10.1044 7.53738C10.1346 7.55739 10.1592 7.58467 10.1761 7.6167C10.193 7.64873 10.2015 7.68448 10.201 7.72068V9.45018C10.201 9.6491 10.28 9.83986 10.4206 9.98051C10.5613 10.1212 10.7521 10.2002 10.951 10.2002C11.9515 10.2002 13.9705 10.2077 15.901 11.4332C17.377 12.3692 18.886 14.0732 19.7935 17.2472C18.2635 15.7727 16.516 14.9732 14.986 14.5487C14.0456 14.2884 13.0791 14.1345 12.1045 14.0897C11.7056 14.0709 11.3059 14.0749 10.9075 14.1017H10.888L10.8805 14.1032L10.951 14.8502L10.876 14.1032C10.6908 14.1218 10.5192 14.2085 10.3945 14.3466C10.2698 14.4846 10.2008 14.6641 10.201 14.8502V16.5797C10.201 16.7417 10.036 16.8437 9.89797 16.7807L3.92197 12.3812L3.85897 12.3392C3.82635 12.3196 3.79936 12.2919 3.78063 12.2588C3.76189 12.2256 3.75204 12.1882 3.75204 12.1502C3.75204 12.1121 3.76189 12.0747 3.78063 12.0416C3.79936 12.0085 3.82635 11.9808 3.85897 11.9612L3.92197 11.9192L9.89797 7.51968ZM11.701 15.5792C11.804 15.5792 11.9155 15.5822 12.0355 15.5882C12.6865 15.6182 13.5865 15.7172 14.5855 15.9947C16.5745 16.5467 18.9295 17.7977 20.4955 20.6147C20.5802 20.7667 20.7151 20.8846 20.8771 20.9481C21.0392 21.0116 21.2183 21.0167 21.3837 20.9626C21.5492 20.9086 21.6907 20.7986 21.7839 20.6517C21.8772 20.5047 21.9165 20.3299 21.895 20.1572C21.199 14.5922 19.066 11.6642 16.705 10.1672C14.8375 8.98218 12.9145 8.75418 11.701 8.71068V7.72068C11.7011 7.41179 11.6179 7.10858 11.46 6.84305C11.3022 6.57753 11.0756 6.35953 10.8042 6.21207C10.5327 6.06461 10.2265 5.99314 9.91788 6.00522C9.60922 6.01729 9.30954 6.11246 9.05047 6.28068L3.05947 10.6907C2.81179 10.8453 2.60753 11.0604 2.46591 11.3157C2.3243 11.571 2.25 11.8582 2.25 12.1502C2.25 12.4422 2.3243 12.7293 2.46591 12.9847C2.60753 13.24 2.81179 13.4551 3.05947 13.6097L9.05047 18.0197C9.30954 18.1879 9.60922 18.2831 9.91788 18.2951C10.2265 18.3072 10.5327 18.2358 10.8042 18.0883C11.0756 17.9408 11.3022 17.7228 11.46 17.4573C11.6179 17.1918 11.7011 16.8886 11.701 16.5797V15.5792Z"
|
|
331
|
-
fill=
|
|
331
|
+
fill={color}
|
|
332
332
|
/>
|
|
333
333
|
</Svg>
|
|
334
334
|
);
|
|
@@ -9,6 +9,7 @@ import { BurgerMenuIcon } from '../../assets/icons';
|
|
|
9
9
|
import Button from '../styled/Button';
|
|
10
10
|
import { useTheme } from '../../hooks/useTheme';
|
|
11
11
|
import { useT } from '../../i18n/useT';
|
|
12
|
+
import { resolveHeaderHeight } from '../../helpers/headerLayout';
|
|
12
13
|
|
|
13
14
|
interface HeaderRoomListProps {
|
|
14
15
|
setDrawerOpen: () => void;
|
|
@@ -20,6 +21,9 @@ export const HeaderRoomList: FC<HeaderRoomListProps> = ({ setDrawerOpen }) => {
|
|
|
20
21
|
const t = useT();
|
|
21
22
|
const insets = useSafeAreaInsets();
|
|
22
23
|
const topInset = config?.headerLayout?.safeAreaTop ? insets.top : 0;
|
|
24
|
+
// Same fixed band as ChatHeader / modal headers: the safe-area inset is
|
|
25
|
+
// padded on top and the row (buttons + title) centers in the band below it.
|
|
26
|
+
const headerHeight = resolveHeaderHeight(config?.headerLayout?.height) + topInset;
|
|
23
27
|
|
|
24
28
|
const modalUser: any = selectedUser ?? user;
|
|
25
29
|
|
|
@@ -45,7 +49,7 @@ export const HeaderRoomList: FC<HeaderRoomListProps> = ({ setDrawerOpen }) => {
|
|
|
45
49
|
style={[
|
|
46
50
|
styles.headerContainer,
|
|
47
51
|
{ backgroundColor: theme.surface, shadowColor: theme.shadow },
|
|
48
|
-
|
|
52
|
+
{ height: headerHeight, paddingTop: topInset },
|
|
49
53
|
]}
|
|
50
54
|
>
|
|
51
55
|
{!config?.disableRoomMenu && config?.headerMenu ? (
|
|
@@ -66,7 +70,7 @@ export const HeaderRoomList: FC<HeaderRoomListProps> = ({ setDrawerOpen }) => {
|
|
|
66
70
|
) : (
|
|
67
71
|
<View style={styles.leftContainer} />
|
|
68
72
|
)}
|
|
69
|
-
<View style={styles.centerContainer}>
|
|
73
|
+
<View style={[styles.centerContainer, { top: topInset }]}>
|
|
70
74
|
{config?.headerLogo ? (
|
|
71
75
|
HeaderLogo
|
|
72
76
|
) : (
|
|
@@ -95,9 +99,6 @@ const styles = StyleSheet.create({
|
|
|
95
99
|
flexDirection: 'row',
|
|
96
100
|
alignItems: 'center',
|
|
97
101
|
paddingHorizontal: 16,
|
|
98
|
-
paddingTop: 16,
|
|
99
|
-
paddingBottom: 12,
|
|
100
|
-
minHeight: 56,
|
|
101
102
|
justifyContent: 'space-between',
|
|
102
103
|
borderBottomLeftRadius: 20,
|
|
103
104
|
borderBottomRightRadius: 20,
|
|
@@ -121,6 +122,7 @@ const styles = StyleSheet.create({
|
|
|
121
122
|
position: 'absolute',
|
|
122
123
|
left: 0,
|
|
123
124
|
right: 0,
|
|
125
|
+
bottom: 0,
|
|
124
126
|
alignItems: 'center',
|
|
125
127
|
justifyContent: 'center',
|
|
126
128
|
},
|
|
@@ -16,7 +16,8 @@ import Button from '../styled/Button';
|
|
|
16
16
|
import { BackIcon, BurgerMenuIcon } from '../../assets/icons';
|
|
17
17
|
import { CallButtons } from '../VideoCalls/CallButtons';
|
|
18
18
|
import { LanguageSelectorButton } from './LanguageSelectorButton';
|
|
19
|
-
import { useDispatch } from 'react-redux';
|
|
19
|
+
import { useDispatch, useSelector, useStore } from 'react-redux';
|
|
20
|
+
import type { RootState } from '../../roomStore';
|
|
20
21
|
import Composing from '../styled/StyledInputComponents/Composing';
|
|
21
22
|
import {
|
|
22
23
|
deleteRoom,
|
|
@@ -27,7 +28,6 @@ import { useXmppClient } from '../../context/xmppProvider';
|
|
|
27
28
|
import { setActiveModal } from '../../roomStore/chatSettingsSlice';
|
|
28
29
|
import { MODAL_TYPES } from '../../helpers/constants/MODAL_TYPES';
|
|
29
30
|
import { RoomMenu } from '../MenuRoom/MenuRoom';
|
|
30
|
-
import { useRoomState } from '../../hooks/useRoomState';
|
|
31
31
|
import { useChatSettingState } from '../../hooks/useChatSettingState';
|
|
32
32
|
import { useFileToken } from '../../hooks/useFileToken';
|
|
33
33
|
import { appendFileToken } from '../../helpers/secureFileUrl';
|
|
@@ -51,10 +51,18 @@ const ChatHeader: React.FC<ChatHeaderProps> = ({
|
|
|
51
51
|
const dispatch = useDispatch();
|
|
52
52
|
const { client } = useXmppClient();
|
|
53
53
|
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
|
|
54
|
+
const reduxStore = useStore<RootState>();
|
|
55
|
+
const activeRoomJID = useSelector(
|
|
56
|
+
(state: RootState) => state.rooms.activeRoomJID
|
|
57
|
+
);
|
|
58
|
+
const roomState = useSelector((state: RootState) =>
|
|
59
|
+
currentRoom?.jid ? state.rooms.rooms?.[currentRoom.jid] : undefined
|
|
60
|
+
);
|
|
57
61
|
const { config } = useChatSettingState();
|
|
62
|
+
const roomsList = useSelector((state: RootState) =>
|
|
63
|
+
config?.chatHeaderBurgerMenu ? state.rooms.rooms : null
|
|
64
|
+
);
|
|
65
|
+
const composing = roomState?.composing;
|
|
58
66
|
const theme = useTheme();
|
|
59
67
|
const t = useT();
|
|
60
68
|
|
|
@@ -67,11 +75,12 @@ const ChatHeader: React.FC<ChatHeaderProps> = ({
|
|
|
67
75
|
client?.leaveTheRoomStanza(activeRoomJID!);
|
|
68
76
|
dispatch(deleteRoom({ jid: activeRoomJID! }));
|
|
69
77
|
|
|
70
|
-
const nextRoomJID =
|
|
78
|
+
const nextRoomJID =
|
|
79
|
+
Object.keys(reduxStore.getState().rooms.rooms || {})[0] || null;
|
|
71
80
|
if (nextRoomJID) {
|
|
72
81
|
dispatch(setCurrentRoom({ roomJID: nextRoomJID }));
|
|
73
82
|
}
|
|
74
|
-
}, [activeRoomJID,
|
|
83
|
+
}, [activeRoomJID, reduxStore, dispatch, client]);
|
|
75
84
|
|
|
76
85
|
const handleHeaderChatMenu = () => {
|
|
77
86
|
Keyboard.dismiss();
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import React, { useState, useEffect, useCallback, useRef } from 'react';
|
|
4
4
|
import { ChatContainer, NonRoomChat } from '../styled/StyledComponents';
|
|
5
|
-
import { useDispatch } from 'react-redux';
|
|
5
|
+
import { useDispatch, useSelector, useStore } from 'react-redux';
|
|
6
|
+
import type { RootState } from '../../roomStore';
|
|
6
7
|
import MessageList from './MessageList';
|
|
7
8
|
import SendInput from '../styled/SendInput';
|
|
8
9
|
import {
|
|
@@ -27,8 +28,8 @@ import { ChooseChatMessage } from './ChooseChatMessage';
|
|
|
27
28
|
import { useRoomUrl } from '../../hooks/useRoomUrl';
|
|
28
29
|
import { useSendMessage } from '../../hooks/useSendMessage';
|
|
29
30
|
import { IConfig } from '../../types/models/config.model';
|
|
31
|
+
import type { IMessage } from '../../types/types';
|
|
30
32
|
import { useRoomInitialization } from '../../hooks/useRoomInitialization';
|
|
31
|
-
import { useRoomState } from '../../hooks/useRoomState';
|
|
32
33
|
import { useChatSettingState } from '../../hooks/useChatSettingState';
|
|
33
34
|
import { useTheme } from '../../hooks/useTheme';
|
|
34
35
|
import { isOwnMessage } from '../../helpers/isOwnMessage';
|
|
@@ -48,6 +49,7 @@ import {
|
|
|
48
49
|
KeyboardAvoidingView,
|
|
49
50
|
KeyboardStickyView,
|
|
50
51
|
} from 'react-native-keyboard-controller';
|
|
52
|
+
import { KeyboardInputDock } from './KeyboardInputDock';
|
|
51
53
|
import useComposing from '../../hooks/useComposing';
|
|
52
54
|
import { store } from '../../roomStore';
|
|
53
55
|
import {
|
|
@@ -58,6 +60,8 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
|
58
60
|
import {
|
|
59
61
|
getInputDockPaddingBottom,
|
|
60
62
|
getKeyboardVerticalOffset,
|
|
63
|
+
getKeyboardAvoidingOffset,
|
|
64
|
+
getInputDockKeyboardPadding,
|
|
61
65
|
} from '../../helpers/keyboardLayout';
|
|
62
66
|
|
|
63
67
|
interface ChatRoomProps {
|
|
@@ -70,6 +74,8 @@ interface ChatRoomProps {
|
|
|
70
74
|
eventHandlers?: IConfig['eventHandlers'];
|
|
71
75
|
}
|
|
72
76
|
|
|
77
|
+
const EMPTY_MESSAGES: IMessage[] = [];
|
|
78
|
+
|
|
73
79
|
const ChatRoom: React.FC<ChatRoomProps> = React.memo(
|
|
74
80
|
({
|
|
75
81
|
CustomMessageComponent,
|
|
@@ -101,14 +107,22 @@ const ChatRoom: React.FC<ChatRoomProps> = React.memo(
|
|
|
101
107
|
return storeConfig;
|
|
102
108
|
}, [storeConfig, propsEventHandlers]);
|
|
103
109
|
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
activeRoomJID,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
const reduxStore = useStore<RootState>();
|
|
111
|
+
const activeRoomJID = useSelector(
|
|
112
|
+
(state: RootState) => state.rooms.activeRoomJID,
|
|
113
|
+
);
|
|
114
|
+
const activeRoom = useSelector((state: RootState) =>
|
|
115
|
+
activeRoomJID ? state.rooms.rooms?.[activeRoomJID] : undefined,
|
|
116
|
+
);
|
|
117
|
+
const hasRooms = useSelector(
|
|
118
|
+
(state: RootState) => Object.keys(state.rooms.rooms || {}).length > 0,
|
|
119
|
+
);
|
|
120
|
+
const editAction = useSelector((state: RootState) => state.rooms.editAction);
|
|
121
|
+
const globalLoading = useSelector(
|
|
122
|
+
(state: RootState) => state.rooms.isLoading,
|
|
123
|
+
);
|
|
124
|
+
const loading = !!activeRoom?.isLoading;
|
|
125
|
+
const roomMessages = activeRoom?.messages || EMPTY_MESSAGES;
|
|
112
126
|
const {
|
|
113
127
|
sendMessage: sendMs,
|
|
114
128
|
sendMedia: sendMessageMedia,
|
|
@@ -180,15 +194,12 @@ const ChatRoom: React.FC<ChatRoomProps> = React.memo(
|
|
|
180
194
|
|
|
181
195
|
const loadMoreMessages = useCallback(
|
|
182
196
|
async (chatJID: string, max: number, idOfMessageBefore?: number) => {
|
|
183
|
-
|
|
197
|
+
const room = reduxStore.getState().rooms.rooms?.[chatJID];
|
|
198
|
+
if (isLoadingMore || room?.historyComplete) {return;}
|
|
184
199
|
const lastMsgId =
|
|
185
200
|
typeof idOfMessageBefore !== 'string'
|
|
186
201
|
? idOfMessageBefore
|
|
187
|
-
: Number(
|
|
188
|
-
roomsList[chatJID].messages[
|
|
189
|
-
roomsList[chatJID].messages.length - 2
|
|
190
|
-
]?.id,
|
|
191
|
-
);
|
|
202
|
+
: Number(room?.messages?.[(room?.messages?.length || 0) - 2]?.id);
|
|
192
203
|
setIsLoadingMore(true);
|
|
193
204
|
try {
|
|
194
205
|
// Return the promise so MessageList's `await loadMoreMessages`
|
|
@@ -202,7 +213,7 @@ const ChatRoom: React.FC<ChatRoomProps> = React.memo(
|
|
|
202
213
|
}
|
|
203
214
|
},
|
|
204
215
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
205
|
-
[client?.client?.jid, isLoadingMore,
|
|
216
|
+
[client?.client?.jid, isLoadingMore, reduxStore],
|
|
206
217
|
);
|
|
207
218
|
|
|
208
219
|
const onCloseEdit = () => {
|
|
@@ -328,12 +339,10 @@ const ChatRoom: React.FC<ChatRoomProps> = React.memo(
|
|
|
328
339
|
|
|
329
340
|
useRoomInitialization(
|
|
330
341
|
activeRoomJID || '',
|
|
331
|
-
roomsList,
|
|
332
342
|
(configWithEventHandlers || storeConfig || {}) as IConfig,
|
|
333
|
-
roomMessages.length,
|
|
334
343
|
);
|
|
335
344
|
|
|
336
|
-
if (
|
|
345
|
+
if (!hasRooms && !loading && !globalLoading) {
|
|
337
346
|
return (
|
|
338
347
|
<NonRoomChat>
|
|
339
348
|
{/* <Text>No room. Let's create one!</Text> */}
|
|
@@ -342,7 +351,7 @@ const ChatRoom: React.FC<ChatRoomProps> = React.memo(
|
|
|
342
351
|
);
|
|
343
352
|
}
|
|
344
353
|
|
|
345
|
-
if (!activeRoomJID || !
|
|
354
|
+
if (!activeRoomJID || !activeRoom) {
|
|
346
355
|
return <ChooseChatMessage />;
|
|
347
356
|
}
|
|
348
357
|
|
|
@@ -357,6 +366,13 @@ const ChatRoom: React.FC<ChatRoomProps> = React.memo(
|
|
|
357
366
|
configuredPadding: configWithEventHandlers?.inputDockPaddingBottom,
|
|
358
367
|
hostOwnsLayout: !!configWithEventHandlers?.disableKeyboardAvoidingView,
|
|
359
368
|
});
|
|
369
|
+
const keyboardAvoidingOffset = getKeyboardAvoidingOffset({
|
|
370
|
+
configuredOffset: configWithEventHandlers?.keyboardVerticalOffset ?? 0,
|
|
371
|
+
});
|
|
372
|
+
const inputDockKeyboardPadding = getInputDockKeyboardPadding({
|
|
373
|
+
platform: Platform.OS,
|
|
374
|
+
inputDockPaddingBottom,
|
|
375
|
+
});
|
|
360
376
|
|
|
361
377
|
// Keyboard avoidance is delegated to react-native-keyboard-controller's
|
|
362
378
|
// KeyboardAvoidingView. When the HOST app supplies its own keyboard
|
|
@@ -394,16 +410,26 @@ const ChatRoom: React.FC<ChatRoomProps> = React.memo(
|
|
|
394
410
|
: View;
|
|
395
411
|
const keyboardWrapperProps = avoidKeyboard
|
|
396
412
|
? {
|
|
397
|
-
|
|
413
|
+
// The dock's colour: the keyboard-height padding below the dock is
|
|
414
|
+
// this view's own box, and it shows around the keyboard's rounded
|
|
415
|
+
// top corners — it must read as a continuation of the dock.
|
|
416
|
+
style: { flex: 1, backgroundColor: theme.surface },
|
|
398
417
|
behavior: 'padding' as const,
|
|
399
|
-
keyboardVerticalOffset,
|
|
418
|
+
keyboardVerticalOffset: keyboardAvoidingOffset,
|
|
400
419
|
}
|
|
401
420
|
: { style: { flex: 1 } };
|
|
402
421
|
// Input dock: a plain View normally; under the sticky strategy it becomes
|
|
403
422
|
// a KeyboardStickyView so it (and only it) lifts with the keyboard.
|
|
423
|
+
// Under the avoiding-view strategy the dock's safe-area padding collapses
|
|
424
|
+
// while the keyboard is open (KeyboardInputDock), so the composer is glued
|
|
425
|
+
// to the keyboard.
|
|
426
|
+
const collapsingDock =
|
|
427
|
+
avoidKeyboard && inputDockKeyboardPadding !== inputDockPaddingBottom;
|
|
404
428
|
const InputDockTag: React.ComponentType<any> = stickyInput
|
|
405
429
|
? KeyboardStickyView
|
|
406
|
-
:
|
|
430
|
+
: collapsingDock
|
|
431
|
+
? KeyboardInputDock
|
|
432
|
+
: View;
|
|
407
433
|
const inputDockProps: any = {
|
|
408
434
|
// The dock carries the composer's white surface all the way to the
|
|
409
435
|
// bottom edge, so it needs the same rounded top and upward shadow —
|
|
@@ -422,6 +448,12 @@ const ChatRoom: React.FC<ChatRoomProps> = React.memo(
|
|
|
422
448
|
...(stickyInput
|
|
423
449
|
? { offset: { closed: 0, opened: keyboardVerticalOffset } }
|
|
424
450
|
: {}),
|
|
451
|
+
...(collapsingDock
|
|
452
|
+
? {
|
|
453
|
+
closedPadding: inputDockPaddingBottom,
|
|
454
|
+
openedPadding: inputDockKeyboardPadding,
|
|
455
|
+
}
|
|
456
|
+
: {}),
|
|
425
457
|
};
|
|
426
458
|
|
|
427
459
|
return (
|
|
@@ -439,7 +471,7 @@ const ChatRoom: React.FC<ChatRoomProps> = React.memo(
|
|
|
439
471
|
>
|
|
440
472
|
{!configWithEventHandlers?.disableHeader && (
|
|
441
473
|
<ChatHeader
|
|
442
|
-
currentRoom={
|
|
474
|
+
currentRoom={activeRoom}
|
|
443
475
|
handleBackClick={handleBackClick}
|
|
444
476
|
/>
|
|
445
477
|
)}
|
|
@@ -456,7 +488,7 @@ const ChatRoom: React.FC<ChatRoomProps> = React.memo(
|
|
|
456
488
|
>
|
|
457
489
|
<Loader color={configWithEventHandlers?.colors?.primary} />
|
|
458
490
|
</View>
|
|
459
|
-
) :
|
|
491
|
+
) : !hasRooms || !activeRoomJID ? (
|
|
460
492
|
<View
|
|
461
493
|
style={{
|
|
462
494
|
flex: 1,
|
|
@@ -518,18 +550,18 @@ const ChatRoom: React.FC<ChatRoomProps> = React.memo(
|
|
|
518
550
|
resetNewMessageCounter: () => {},
|
|
519
551
|
}}
|
|
520
552
|
typingIndicator={
|
|
521
|
-
|
|
553
|
+
activeRoom?.composing ? (
|
|
522
554
|
configWithEventHandlers?.customTypingIndicator
|
|
523
555
|
?.customComponent ? (
|
|
524
556
|
<configWithEventHandlers.customTypingIndicator.customComponent
|
|
525
557
|
usersTyping={
|
|
526
|
-
|
|
558
|
+
activeRoom?.composingList || []
|
|
527
559
|
}
|
|
528
560
|
text={
|
|
529
561
|
typeof configWithEventHandlers.customTypingIndicator
|
|
530
562
|
.text === 'function'
|
|
531
563
|
? configWithEventHandlers.customTypingIndicator.text(
|
|
532
|
-
|
|
564
|
+
activeRoom?.composingList || [],
|
|
533
565
|
)
|
|
534
566
|
: configWithEventHandlers.customTypingIndicator
|
|
535
567
|
.text || 'Typing...'
|
|
@@ -598,10 +630,10 @@ const ChatRoom: React.FC<ChatRoomProps> = React.memo(
|
|
|
598
630
|
'overlay' ||
|
|
599
631
|
configWithEventHandlers.customTypingIndicator.position ===
|
|
600
632
|
'floating') &&
|
|
601
|
-
|
|
633
|
+
activeRoom?.composing && (
|
|
602
634
|
<CustomTypingIndicator
|
|
603
635
|
usersTyping={
|
|
604
|
-
|
|
636
|
+
activeRoom?.composingList || ['User']
|
|
605
637
|
}
|
|
606
638
|
text={configWithEventHandlers.customTypingIndicator.text}
|
|
607
639
|
position={
|
|
@@ -611,7 +643,7 @@ const ChatRoom: React.FC<ChatRoomProps> = React.memo(
|
|
|
611
643
|
customComponent={
|
|
612
644
|
configWithEventHandlers.customTypingIndicator.customComponent
|
|
613
645
|
}
|
|
614
|
-
isVisible={
|
|
646
|
+
isVisible={activeRoom?.composing || false}
|
|
615
647
|
/>
|
|
616
648
|
)}
|
|
617
649
|
</ChatContainer>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React, {FC, useEffect, useMemo, useRef, useState} from 'react';
|
|
1
|
+
import React, {FC, useCallback, useEffect, useMemo, useRef, useState} from 'react';
|
|
2
2
|
import {useDispatch, useSelector} from 'react-redux';
|
|
3
3
|
import ChatRoom from './ChatRoom';
|
|
4
|
+
import {RoomStack, RoomStackHandle} from './RoomStack';
|
|
4
5
|
import {
|
|
5
6
|
setActiveModal,
|
|
6
7
|
setConfig,
|
|
@@ -37,7 +38,7 @@ import {ModalWrapper} from '../Modals/ModalWrapper/ModalWrapper';
|
|
|
37
38
|
import {useChatSettingState} from '../../hooks/useChatSettingState';
|
|
38
39
|
import {useTheme} from '../../hooks/useTheme';
|
|
39
40
|
import { usePendingNotification } from '../../hooks/usePendingNotification';
|
|
40
|
-
import {DeviceEventEmitter, Pressable, Text, View} from 'react-native';
|
|
41
|
+
import {DeviceEventEmitter, Keyboard, Pressable, Text, View} from 'react-native';
|
|
41
42
|
import {pushLog as devPushLog} from '../../utils/devLogger';
|
|
42
43
|
import {normalizeRoomJid} from '../../helpers/normalizeRoomJid';
|
|
43
44
|
import {buildSeedRoom} from '../../helpers/buildSeedRoom';
|
|
@@ -70,6 +71,10 @@ const ChatWrapper: FC<ChatWrapperProps> = ({
|
|
|
70
71
|
|
|
71
72
|
usePendingNotification();
|
|
72
73
|
const theme = useTheme();
|
|
74
|
+
const roomStackRef = useRef<RoomStackHandle>(null);
|
|
75
|
+
// Stable, so ChatRoom's React.memo holds across this root's re-renders.
|
|
76
|
+
// (A hook: must stay above the early LoginForm return.)
|
|
77
|
+
const popRoom = useCallback(() => roomStackRef.current?.pop(), []);
|
|
73
78
|
|
|
74
79
|
const [isInited, setInited] = useState(false);
|
|
75
80
|
const [showModal, setShowModal] = useState(false);
|
|
@@ -92,15 +97,18 @@ const ChatWrapper: FC<ChatWrapperProps> = ({
|
|
|
92
97
|
initMode,
|
|
93
98
|
} = useXmppClient();
|
|
94
99
|
|
|
95
|
-
const
|
|
100
|
+
const rooms = useSelector((state: RootState) => state.rooms.rooms);
|
|
101
|
+
const activeRoomJID = useSelector(
|
|
102
|
+
(state: RootState) => state.rooms.activeRoomJID,
|
|
103
|
+
);
|
|
104
|
+
const activeRoomMessages = useSelector((state: RootState) =>
|
|
105
|
+
activeRoomJID ? state.rooms.rooms[activeRoomJID]?.messages : undefined,
|
|
106
|
+
);
|
|
96
107
|
|
|
97
|
-
const activeMessage = useMemo(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
}, [rooms, activeRoomJID]);
|
|
108
|
+
const activeMessage = useMemo(
|
|
109
|
+
() => activeRoomMessages?.find(message => message?.activeMessage),
|
|
110
|
+
[activeRoomMessages],
|
|
111
|
+
);
|
|
104
112
|
|
|
105
113
|
const handleChangeChat = (chat: IRoom) => {
|
|
106
114
|
dispatch(setCurrentRoom({roomJID: chat.jid}));
|
|
@@ -123,6 +131,14 @@ const ChatWrapper: FC<ChatWrapperProps> = ({
|
|
|
123
131
|
dispatch(setDeleteModal({isDeleteModal: false}));
|
|
124
132
|
};
|
|
125
133
|
|
|
134
|
+
// A modal (chat profile, user profile, ...) covers the chat, so the
|
|
135
|
+
// composer's keyboard must not stay open on top of it.
|
|
136
|
+
useEffect(() => {
|
|
137
|
+
if (activeModal) {
|
|
138
|
+
Keyboard.dismiss();
|
|
139
|
+
}
|
|
140
|
+
}, [activeModal]);
|
|
141
|
+
|
|
126
142
|
// A host drives the reader's language from OUTSIDE the component through
|
|
127
143
|
// `config.translates.readerLocale` (their own switcher, or the testbed's
|
|
128
144
|
// Setup tab). Nothing was syncing it into `langSource`, so pinning it only
|
|
@@ -425,6 +441,22 @@ const ChatWrapper: FC<ChatWrapperProps> = ({
|
|
|
425
441
|
// the list. With `roomJID` or `disableRooms`, skip the list entirely.
|
|
426
442
|
const showRoomList =
|
|
427
443
|
!config?.disableRooms && !roomJID && !activeRoomJID;
|
|
444
|
+
// List mode: the room is pushed over the list and can be swiped back
|
|
445
|
+
// (RoomStack). With `roomJID` / `disableRooms` there is no list to return to.
|
|
446
|
+
const listMode = !config?.disableRooms && !roomJID;
|
|
447
|
+
|
|
448
|
+
// The open thread, over the room (a message with `activeMessage` set).
|
|
449
|
+
const threadView = activeMessage ? (
|
|
450
|
+
<ThreadWrapper
|
|
451
|
+
key={activeMessage.id}
|
|
452
|
+
activeMessage={activeMessage}
|
|
453
|
+
user={user}
|
|
454
|
+
customMessageComponent={CustomMessageComponent || Message}
|
|
455
|
+
/>
|
|
456
|
+
) : null;
|
|
457
|
+
const backToList = () => {
|
|
458
|
+
dispatch(setCurrentRoom({ roomJID: '' }));
|
|
459
|
+
};
|
|
428
460
|
|
|
429
461
|
return (
|
|
430
462
|
<>
|
|
@@ -489,10 +521,36 @@ const ChatWrapper: FC<ChatWrapperProps> = ({
|
|
|
489
521
|
Android. Wraps only the chat area — the global Modal /
|
|
490
522
|
ModalWrapper below stay above it. */}
|
|
491
523
|
<InteractionsOverlayProvider>
|
|
492
|
-
{
|
|
493
|
-
<
|
|
494
|
-
|
|
495
|
-
|
|
524
|
+
{listMode ? (
|
|
525
|
+
<RoomStack
|
|
526
|
+
ref={roomStackRef}
|
|
527
|
+
onBack={backToList}
|
|
528
|
+
roomBackground={theme.chatBackground}
|
|
529
|
+
// An open modal covers the room: back must not pull the
|
|
530
|
+
// room out from under it.
|
|
531
|
+
hardwareBack={!activeModal}
|
|
532
|
+
list={
|
|
533
|
+
<RoomList
|
|
534
|
+
chats={Object.values(rooms)}
|
|
535
|
+
onRoomClick={handleChangeChat}
|
|
536
|
+
/>
|
|
537
|
+
}
|
|
538
|
+
room={
|
|
539
|
+
showRoomList ? null : (
|
|
540
|
+
<ChatWrapperBox
|
|
541
|
+
style={{
|
|
542
|
+
...MainComponentStyles,
|
|
543
|
+
}}>
|
|
544
|
+
<ChatRoom
|
|
545
|
+
CustomMessageComponent={
|
|
546
|
+
CustomMessageComponent || Message
|
|
547
|
+
}
|
|
548
|
+
handleBackClick={popRoom}
|
|
549
|
+
/>
|
|
550
|
+
{threadView}
|
|
551
|
+
</ChatWrapperBox>
|
|
552
|
+
)
|
|
553
|
+
}
|
|
496
554
|
/>
|
|
497
555
|
) : (
|
|
498
556
|
<ChatWrapperBox
|
|
@@ -501,14 +559,8 @@ const ChatWrapper: FC<ChatWrapperProps> = ({
|
|
|
501
559
|
}}>
|
|
502
560
|
<ChatRoom
|
|
503
561
|
CustomMessageComponent={CustomMessageComponent || Message}
|
|
504
|
-
handleBackClick={
|
|
505
|
-
roomJID || config?.disableRooms
|
|
506
|
-
? undefined
|
|
507
|
-
: () => {
|
|
508
|
-
dispatch(setCurrentRoom({ roomJID: '' }));
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
562
|
/>
|
|
563
|
+
{threadView}
|
|
512
564
|
</ChatWrapperBox>
|
|
513
565
|
)}
|
|
514
566
|
</InteractionsOverlayProvider>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import { ViewProps } from 'react-native';
|
|
3
|
+
import Animated, {
|
|
4
|
+
interpolate,
|
|
5
|
+
useAnimatedStyle,
|
|
6
|
+
} from 'react-native-reanimated';
|
|
7
|
+
import { useReanimatedKeyboardAnimation } from 'react-native-keyboard-controller';
|
|
8
|
+
|
|
9
|
+
interface KeyboardInputDockProps extends ViewProps {
|
|
10
|
+
// Bottom padding while the keyboard is closed (the safe-area inset).
|
|
11
|
+
closedPadding: number;
|
|
12
|
+
// Bottom padding while the keyboard is open.
|
|
13
|
+
openedPadding: number;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Input dock for the KeyboardAvoidingView strategy on iOS. The dock's
|
|
18
|
+
* safe-area padding is only needed while the keyboard is closed; with the
|
|
19
|
+
* keyboard open it collapses in sync with the keyboard animation, so the
|
|
20
|
+
* composer sits right on top of the keyboard instead of leaving a band of
|
|
21
|
+
* dock (or chat background) between them.
|
|
22
|
+
*/
|
|
23
|
+
export const KeyboardInputDock: FC<KeyboardInputDockProps> = ({
|
|
24
|
+
closedPadding,
|
|
25
|
+
openedPadding,
|
|
26
|
+
style,
|
|
27
|
+
children,
|
|
28
|
+
...rest
|
|
29
|
+
}) => {
|
|
30
|
+
const { progress } = useReanimatedKeyboardAnimation();
|
|
31
|
+
const animatedStyle = useAnimatedStyle(
|
|
32
|
+
() => ({
|
|
33
|
+
paddingBottom: interpolate(
|
|
34
|
+
progress.value,
|
|
35
|
+
[0, 1],
|
|
36
|
+
[closedPadding, openedPadding]
|
|
37
|
+
),
|
|
38
|
+
}),
|
|
39
|
+
[closedPadding, openedPadding]
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<Animated.View {...rest} style={[style, animatedStyle]}>
|
|
44
|
+
{children}
|
|
45
|
+
</Animated.View>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { FC, Fragment, useMemo } from 'react';
|
|
1
|
+
import React, { FC, Fragment, memo, useMemo } from 'react';
|
|
2
2
|
import { IConfig, IMessage } from '../../types/types';
|
|
3
3
|
import { isOwnMessage } from '../../helpers/isOwnMessage';
|
|
4
4
|
import DateLabel from '../styled/DateLabel';
|
|
@@ -6,9 +6,6 @@ import SystemMessage from './SystemMessage';
|
|
|
6
6
|
import NewMessageLabel from '../styled/NewMessageLabel';
|
|
7
7
|
import {
|
|
8
8
|
Message,
|
|
9
|
-
MessageText,
|
|
10
|
-
MessageTimestamp,
|
|
11
|
-
UserName,
|
|
12
9
|
} from '../styled/StyledComponents';
|
|
13
10
|
import { View } from 'react-native';
|
|
14
11
|
|
|
@@ -35,7 +32,7 @@ interface MessageContainerProps {
|
|
|
35
32
|
className?: string;
|
|
36
33
|
}
|
|
37
34
|
|
|
38
|
-
|
|
35
|
+
const MessageContainerImpl: FC<MessageContainerProps> = ({
|
|
39
36
|
CustomMessage,
|
|
40
37
|
CustomDaySeparator,
|
|
41
38
|
CustomNewMessageLabel,
|
|
@@ -101,28 +98,23 @@ export const MessageContainer: FC<MessageContainerProps> = ({
|
|
|
101
98
|
<DateLabel date={messageDate} colors={config?.colors} />
|
|
102
99
|
)
|
|
103
100
|
) : null}
|
|
101
|
+
|
|
104
102
|
<MessageComponent
|
|
105
103
|
message={message}
|
|
106
104
|
isUser={isUser}
|
|
107
105
|
isReply={isReply}
|
|
108
106
|
className={className}
|
|
109
107
|
>
|
|
110
|
-
{
|
|
111
|
-
<>
|
|
112
|
-
<MessageTimestamp>
|
|
113
|
-
{messageDate.toLocaleTimeString()}
|
|
114
|
-
</MessageTimestamp>
|
|
115
|
-
<UserName>{message.user.name}: </UserName>
|
|
116
|
-
<MessageText>{message.body}</MessageText>
|
|
117
|
-
</>
|
|
118
|
-
) : (
|
|
108
|
+
{CustomMessage ? (
|
|
119
109
|
<MessageComponent
|
|
120
110
|
message={message}
|
|
121
111
|
isUser={isUser}
|
|
122
112
|
isReply={isReply}
|
|
123
113
|
/>
|
|
124
|
-
)}
|
|
114
|
+
) : null}
|
|
125
115
|
</MessageComponent>
|
|
126
116
|
</View>
|
|
127
117
|
);
|
|
128
118
|
};
|
|
119
|
+
|
|
120
|
+
export const MessageContainer = memo(MessageContainerImpl);
|