@ethora/chat-component-rn 26.8.5 → 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/MainComponents/ChatHeader.js +7 -9
- package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatRoom.js +24 -23
- package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatWrapper.js +22 -16
- package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
- 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 +133 -65
- package/lib/commonjs/components/MainComponents/RoomStack.js.map +1 -1
- 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/Modal/SwipeBackLayer.js +76 -44
- package/lib/commonjs/components/Modals/Modal/SwipeBackLayer.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/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/MainComponents/ChatHeader.js +8 -10
- package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/module/components/MainComponents/ChatRoom.js +25 -24
- package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/module/components/MainComponents/ChatWrapper.js +23 -17
- package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
- 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 +131 -63
- package/lib/module/components/MainComponents/RoomStack.js.map +1 -1
- 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/Modal/SwipeBackLayer.js +76 -44
- package/lib/module/components/Modals/Modal/SwipeBackLayer.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/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/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/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 +7 -2
- package/lib/typescript/components/MainComponents/RoomStack.d.ts.map +1 -1
- 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/Modal/SwipeBackLayer.d.ts +2 -1
- package/lib/typescript/components/Modals/Modal/SwipeBackLayer.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/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/MainComponents/ChatHeader.tsx +16 -7
- package/src/components/MainComponents/ChatRoom.tsx +35 -29
- package/src/components/MainComponents/ChatWrapper.tsx +28 -10
- 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 +156 -83
- 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/Modal/SwipeBackLayer.tsx +114 -63
- 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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","useState","View","Text","TouchableOpacity","Animated","
|
|
1
|
+
{"version":3,"names":["React","useMemo","useRef","useState","View","Text","TouchableOpacity","Animated","StyleSheet","useTheme","getEmojiNativeById","jsx","_jsx","jsxs","_jsxs","MessageReaction","reaction","color","changeReaction","userName","interactive","theme","tooltipEmoji","setTooltipEmoji","fadeAnim","Value","current","reactionDetails","result","Object","values","forEach","emoji","data","em","count","users","push","senderFirstName","senderLastName","trim","keys","length","showTooltip","timing","toValue","duration","useNativeDriver","start","hideTooltip","style","styles","row","children","entries","map","details","isUserReacted","includes","chipWrap","testID","activeOpacity","disabled","onPress","onLongPress","onPressOut","chip","backgroundColor","surface","borderColor","border","shadowColor","shadow","pointerEvents","tint","glyph","textSecondary","tooltip","opacity","transform","translateY","interpolate","inputRange","outputRange","text","tooltipText","filter","Boolean","join","create","flexDirection","flexWrap","alignItems","gap","position","paddingVertical","paddingHorizontal","borderRadius","borderWidth","hairlineWidth","shadowOpacity","shadowOffset","width","height","shadowRadius","elevation","top","right","bottom","left","fontSize","marginRight","fontWeight","maxWidth"],"sourceRoot":"../../../../src","sources":["components/MessageBubble/MessageReaction.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAQC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC5D,SAASC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AAEjF,SAASC,QAAQ,QAAQ,sBAAsB;AAC/C,SAASC,kBAAkB,QAAQ,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAWzD,OAAO,MAAMC,eAAyC,GAAGA,CAAC;EACxDC,QAAQ;EACRC,KAAK;EACLC,cAAc;EACdC,QAAQ;EACRC,WAAW,GAAG;AAChB,CAAC,KAAK;EACJ,MAAMC,KAAK,GAAGZ,QAAQ,CAAC,CAAC;EACxB,MAAM,CAACa,YAAY,EAAEC,eAAe,CAAC,GAAGpB,QAAQ,CAAgB,IAAI,CAAC;EACrE,MAAMqB,QAAQ,GAAGtB,MAAM,CAAC,IAAIK,QAAQ,CAACkB,KAAK,CAAC,CAAC,CAAC,CAAC,CAACC,OAAO;EAEtD,MAAMC,eAAe,GAAG1B,OAAO,CAAC,MAAM;IACpC,MAAM2B,MAA0D,GAAG,CAAC,CAAC;IACrEC,MAAM,CAACC,MAAM,CAACd,QAAQ,IAAI,CAAC,CAAC,CAAC,CAACe,OAAO,CAAC,CAAC;MAAEC,KAAK;MAAEC;IAAK,CAAC,KAAK;MACzD,CAACD,KAAK,IAAI,EAAE,EAAED,OAAO,CAAEG,EAAE,IAAK;QAC5B,IAAI,CAACN,MAAM,CAACM,EAAE,CAAC,EAAE;UAACN,MAAM,CAACM,EAAE,CAAC,GAAG;YAAEC,KAAK,EAAE,CAAC;YAAEC,KAAK,EAAE;UAAG,CAAC;QAAC;QACvDR,MAAM,CAACM,EAAE,CAAC,CAACC,K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AI,EAAE;IACJoB,QAAQ,EAAE,UAAU;IAAEY,GAAG,EAAE,CAAC;IAAEC,KAAK,EAAE,CAAC;IAAEC,MAAM,EAAE,CAAC;IAAEC,IAAI,EAAE,CAAC;IAC1DZ,YAAY,EAAE;EAChB,CAAC;EACDtB,KAAK,EAAE;IACLmC,QAAQ,EAAE,EAAE;IACZC,WAAW,EAAE;EACf,CAAC;EACD5E,KAAK,EAAE;IACL2E,QAAQ,EAAE,EAAE;IACZE,UAAU,EAAE;EACd,CAAC;EACDnC,OAAO,EAAE;IACPiB,QAAQ,EAAE,UAAU;IACpBc,MAAM,EAAE,EAAE;IACVC,IAAI,EAAE,CAAC;IACPZ,YAAY,EAAE,CAAC;IACfD,iBAAiB,EAAE,EAAE;IACrBD,eAAe,EAAE,CAAC;IAClBkB,QAAQ,EAAE;EACZ,CAAC;EACD5B,WAAW,EAAE;IACXyB,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,35 +1,76 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
border-start-color: ${props => props.isUser ? props.configColor : 'transparent'};
|
|
13
|
-
border-end-width: ${props => !props.isUser ? 4 : 0}px;
|
|
14
|
-
border-end-color: ${props => !props.isUser ? props.configColor : 'transparent'};
|
|
15
|
-
`;
|
|
16
|
-
const StyledText = styled.Text`
|
|
17
|
-
font-size: 14px;
|
|
18
|
-
overflow: hidden;
|
|
19
|
-
`;
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
|
5
|
+
import { useTheme } from '../../hooks/useTheme';
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
/**
|
|
8
|
+
* Quote of the parent at the top of a reply that was also sent to the
|
|
9
|
+
* channel (WhatsApp-style): accent bar, author, up to two lines of text.
|
|
10
|
+
* Tapping opens the parent's thread.
|
|
11
|
+
*/
|
|
20
12
|
export const MessageReply = ({
|
|
21
13
|
isUser,
|
|
22
14
|
text,
|
|
23
|
-
|
|
15
|
+
userName,
|
|
16
|
+
color,
|
|
24
17
|
handleReplyMessage
|
|
25
18
|
}) => {
|
|
26
|
-
|
|
19
|
+
const theme = useTheme();
|
|
20
|
+
const accent = color || theme.primary;
|
|
21
|
+
return /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
22
|
+
testID: "message-reply-quote",
|
|
23
|
+
activeOpacity: 0.7,
|
|
27
24
|
onPress: handleReplyMessage,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
25
|
+
style: [styles.quote, {
|
|
26
|
+
// A tint of the bubble's own ground, so it reads on both sides
|
|
27
|
+
// and in both themes.
|
|
28
|
+
backgroundColor: isUser ? 'rgba(0,0,0,0.12)' : theme.surfaceSecondary
|
|
29
|
+
}],
|
|
30
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
31
|
+
style: [styles.bar, {
|
|
32
|
+
backgroundColor: accent
|
|
33
|
+
}]
|
|
34
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
35
|
+
style: styles.body,
|
|
36
|
+
children: [!!userName && /*#__PURE__*/_jsx(Text, {
|
|
37
|
+
numberOfLines: 1,
|
|
38
|
+
style: [styles.author, {
|
|
39
|
+
color: accent
|
|
40
|
+
}],
|
|
41
|
+
children: userName
|
|
42
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
43
|
+
numberOfLines: 2,
|
|
44
|
+
style: [styles.text, {
|
|
45
|
+
color: isUser ? theme.messageTextUser : theme.text
|
|
46
|
+
}],
|
|
47
|
+
children: text
|
|
48
|
+
})]
|
|
49
|
+
})]
|
|
33
50
|
});
|
|
34
51
|
};
|
|
52
|
+
const styles = StyleSheet.create({
|
|
53
|
+
quote: {
|
|
54
|
+
flexDirection: 'row',
|
|
55
|
+
borderRadius: 8,
|
|
56
|
+
overflow: 'hidden',
|
|
57
|
+
marginBottom: 8
|
|
58
|
+
},
|
|
59
|
+
bar: {
|
|
60
|
+
width: 4
|
|
61
|
+
},
|
|
62
|
+
body: {
|
|
63
|
+
flexShrink: 1,
|
|
64
|
+
paddingVertical: 6,
|
|
65
|
+
paddingHorizontal: 10
|
|
66
|
+
},
|
|
67
|
+
author: {
|
|
68
|
+
fontSize: 13,
|
|
69
|
+
fontWeight: '600',
|
|
70
|
+
marginBottom: 2
|
|
71
|
+
},
|
|
72
|
+
text: {
|
|
73
|
+
fontSize: 14
|
|
74
|
+
}
|
|
75
|
+
});
|
|
35
76
|
//# sourceMappingURL=MessageReply.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","Text","TouchableOpacity","View","useTheme","jsx","_jsx","jsxs","_jsxs","MessageReply","isUser","text","userName","color","handleReplyMessage","theme","accent","primary","testID","activeOpacity","onPress","style","styles","quote","backgroundColor","surfaceSecondary","children","bar","body","numberOfLines","author","messageTextUser","create","flexDirection","borderRadius","overflow","marginBottom","width","flexShrink","paddingVertical","paddingHorizontal","fontSize","fontWeight"],"sourceRoot":"../../../../src","sources":["components/MessageBubble/MessageReply.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAc,OAAO;AACjC,SAASC,UAAU,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AACvE,SAASC,QAAQ,QAAQ,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAWhD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAmC,GAAGA,CAAC;EAClDC,MAAM;EACNC,IAAI;EACJC,QAAQ;EACRC,KAAK;EACLC;AACF,CAAC,KAAK;EACJ,MAAMC,KAAK,GAAGX,QAAQ,CAA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E;EACT,CAAC;EACDT,IAAI,EAAE;IACJU,UAAU,EAAE,CAAC;IACbC,eAAe,EAAE,CAAC;IAClBC,iBAAiB,EAAE;EACrB,CAAC;EACDV,MAAM,EAAE;IACNW,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBN,YAAY,EAAE;EAChB,CAAC;EACDzB,IAAI,EAAE;IACJ8B,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React, { useCallback, useEffect, useRef } from 'react';
|
|
4
|
-
import { BackHandler, Keyboard, StyleSheet, useWindowDimensions, View } from 'react-native';
|
|
5
|
-
import Animated, { interpolate, runOnJS, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
3
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { Animated, BackHandler, Keyboard, StyleSheet, useWindowDimensions, View } from 'react-native';
|
|
6
5
|
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
7
6
|
import { COMPLETE_DISTANCE, COMPLETE_VELOCITY, EDGE_WIDTH, LIST_DIM, POP, PUSH } from '../../MainComponents/RoomStack';
|
|
8
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
8
|
/**
|
|
10
9
|
* Full-screen modal layer with the same navigation feel as RoomStack: it
|
|
11
10
|
* slides in from the right, and a swipe from the left edge drags it back
|
|
12
|
-
* out over whatever is underneath (the room or the list).
|
|
11
|
+
* out over whatever is underneath (the room or the list). Like RoomStack it
|
|
12
|
+
* runs on RN's own `Animated`, one value driving every layer.
|
|
13
13
|
*/
|
|
14
14
|
export const SwipeBackLayer = ({
|
|
15
15
|
onClose,
|
|
@@ -18,29 +18,60 @@ export const SwipeBackLayer = ({
|
|
|
18
18
|
const {
|
|
19
19
|
width: windowWidth
|
|
20
20
|
} = useWindowDimensions();
|
|
21
|
-
const width =
|
|
22
|
-
const
|
|
23
|
-
|
|
21
|
+
const [width, setWidth] = useState(windowWidth);
|
|
22
|
+
const widthRef = useRef(width);
|
|
23
|
+
widthRef.current = width;
|
|
24
|
+
const x = useRef(new Animated.Value(windowWidth)).current;
|
|
25
|
+
const closing = useRef(false);
|
|
26
|
+
const slideTo = useCallback((toValue, config, done) => {
|
|
27
|
+
Animated.timing(x, {
|
|
28
|
+
toValue,
|
|
29
|
+
...config,
|
|
30
|
+
useNativeDriver: true
|
|
31
|
+
}).start(({
|
|
32
|
+
finished
|
|
33
|
+
}) => done?.(finished));
|
|
34
|
+
}, [x]);
|
|
24
35
|
useEffect(() => {
|
|
25
|
-
|
|
36
|
+
slideTo(0, PUSH);
|
|
26
37
|
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
27
38
|
|
|
28
39
|
const onCloseRef = useRef(onClose);
|
|
29
40
|
onCloseRef.current = onClose;
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
|
|
41
|
+
const [closeCount, setCloseCount] = useState(0);
|
|
42
|
+
const finish = useCallback(() => {
|
|
43
|
+
onCloseRef.current();
|
|
44
|
+
setCloseCount(count => count + 1);
|
|
45
|
+
}, []);
|
|
46
|
+
|
|
47
|
+
// `onClose` normally unmounts this layer. If it is still here afterwards
|
|
48
|
+
// (the modal did not close), slide the screen back rather than leave it
|
|
49
|
+
// parked off-screen.
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (closeCount === 0) {
|
|
33
52
|
return;
|
|
34
53
|
}
|
|
35
|
-
closing.
|
|
36
|
-
|
|
37
|
-
|
|
54
|
+
closing.current = false;
|
|
55
|
+
slideTo(0, POP);
|
|
56
|
+
}, [closeCount]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
57
|
+
|
|
58
|
+
const slideOut = useCallback(() => {
|
|
59
|
+
closing.current = true;
|
|
60
|
+
slideTo(widthRef.current, POP, finished => {
|
|
38
61
|
if (finished) {
|
|
39
|
-
|
|
62
|
+
finish();
|
|
63
|
+
} else {
|
|
64
|
+
closing.current = false;
|
|
40
65
|
}
|
|
41
66
|
});
|
|
42
|
-
}, [finish]);
|
|
43
|
-
|
|
67
|
+
}, [finish, slideTo]);
|
|
68
|
+
const close = useCallback(() => {
|
|
69
|
+
if (closing.current) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
Keyboard.dismiss();
|
|
73
|
+
slideOut();
|
|
74
|
+
}, [slideOut]);
|
|
44
75
|
useEffect(() => {
|
|
45
76
|
const sub = BackHandler.addEventListener('hardwareBackPress', () => {
|
|
46
77
|
close();
|
|
@@ -48,57 +79,58 @@ export const SwipeBackLayer = ({
|
|
|
48
79
|
});
|
|
49
80
|
return () => sub.remove();
|
|
50
81
|
}, [close]);
|
|
51
|
-
const
|
|
52
|
-
const swipeBack = Gesture.Pan().hitSlop({
|
|
82
|
+
const swipeBack = useMemo(() => Gesture.Pan().runOnJS(true).hitSlop({
|
|
53
83
|
left: 0,
|
|
54
84
|
width: EDGE_WIDTH
|
|
55
85
|
}).activeOffsetX(12).failOffsetY([-16, 16]).onStart(() => {
|
|
56
|
-
|
|
86
|
+
if (closing.current) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
Keyboard.dismiss();
|
|
90
|
+
x.stopAnimation();
|
|
57
91
|
}).onUpdate(e => {
|
|
58
|
-
if (closing.
|
|
92
|
+
if (closing.current) {
|
|
59
93
|
return;
|
|
60
94
|
}
|
|
61
|
-
x.
|
|
95
|
+
x.setValue(Math.min(Math.max(e.translationX, 0), widthRef.current));
|
|
62
96
|
}).onEnd(e => {
|
|
63
|
-
if (closing.
|
|
97
|
+
if (closing.current) {
|
|
64
98
|
return;
|
|
65
99
|
}
|
|
66
|
-
const complete =
|
|
100
|
+
const complete = e.translationX > widthRef.current * COMPLETE_DISTANCE || e.velocityX > COMPLETE_VELOCITY;
|
|
67
101
|
if (complete) {
|
|
68
|
-
|
|
69
|
-
x.value = withTiming(width.value, POP, finished => {
|
|
70
|
-
if (finished) {
|
|
71
|
-
runOnJS(finish)();
|
|
72
|
-
}
|
|
73
|
-
});
|
|
102
|
+
slideOut();
|
|
74
103
|
} else {
|
|
75
|
-
|
|
104
|
+
slideTo(0, POP);
|
|
76
105
|
}
|
|
77
|
-
});
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}));
|
|
83
|
-
const dimStyle = useAnimatedStyle(() => ({
|
|
84
|
-
opacity: interpolate(x.value, [0, width.value], [LIST_DIM, 0])
|
|
85
|
-
}));
|
|
106
|
+
}), [slideOut, slideTo, x]);
|
|
107
|
+
const dimOpacity = useMemo(() => x.interpolate({
|
|
108
|
+
inputRange: [0, width],
|
|
109
|
+
outputRange: [LIST_DIM, 0],
|
|
110
|
+
extrapolate: 'clamp'
|
|
111
|
+
}), [x, width]);
|
|
86
112
|
return /*#__PURE__*/_jsxs(View, {
|
|
87
113
|
pointerEvents: "box-none",
|
|
88
114
|
style: styles.host,
|
|
89
115
|
onLayout: e => {
|
|
90
116
|
const next = e.nativeEvent.layout.width;
|
|
91
|
-
if (next > 0) {
|
|
92
|
-
|
|
117
|
+
if (next > 0 && next !== widthRef.current) {
|
|
118
|
+
setWidth(next);
|
|
93
119
|
}
|
|
94
120
|
},
|
|
95
121
|
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
96
122
|
pointerEvents: "none",
|
|
97
|
-
style: [styles.fill, styles.dim,
|
|
123
|
+
style: [styles.fill, styles.dim, {
|
|
124
|
+
opacity: dimOpacity
|
|
125
|
+
}]
|
|
98
126
|
}), /*#__PURE__*/_jsx(GestureDetector, {
|
|
99
127
|
gesture: swipeBack,
|
|
100
128
|
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
101
|
-
style: [styles.fill, styles.screen,
|
|
129
|
+
style: [styles.fill, styles.screen, {
|
|
130
|
+
transform: [{
|
|
131
|
+
translateX: x
|
|
132
|
+
}]
|
|
133
|
+
}],
|
|
102
134
|
children: children(close)
|
|
103
135
|
})
|
|
104
136
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useMemo","useRef","useState","Animated","BackHandler","Keyboard","StyleSheet","useWindowDimensions","View","Gesture","GestureDetector","COMPLETE_DISTANCE","COMPLETE_VELOCITY","EDGE_WIDTH","LIST_DIM","POP","PUSH","jsx","_jsx","jsxs","_jsxs","SwipeBackLayer","onClose","children","width","windowWidth","setWidth","widthRef","current","x","Value","closing","slideTo","toValue","config","done","timing","useNativeDriver","start","finished","onCloseRef","closeCount","setCloseCount","finish","count","slideOut","close","dismiss","sub","addEventListener","remove","swipeBack","Pan","runOnJS","hitSlop","left","activeOffsetX","failOffsetY","onStart","stopAnimation","onUpdate","e","setValue","Math","min","max","translationX","onEnd","complete","velocityX","dimOpacity","interpolate","inputRange","outputRange","extrapolate","pointerEvents","style","styles","host","onLayout","next","nativeEvent","layout","fill","dim","opacity","gesture","screen","transform","translateX","create","position","top","right","bottom","zIndex","overflow","backgroundColor","justifyContent","alignItems","shadowColor","shadowOffset","height","shadowOpacity","shadowRadius"],"sourceRoot":"../../../../../src","sources":["components/Modals/Modal/SwipeBackLayer.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAEVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SACEC,QAAQ,EACRC,WAAW,EACXC,QAAQ,EACRC,UAAU,EACVC,mBAAmB,EACnBC,IAAI,QACC,cAAc;AACrB,SAASC,OAAO,EAAEC,eAAe,QAAQ,8BAA8B;AACvE,SACEC,iBAAiB,EACjBC,iBAAiB,EACjBC,UAAU,EACVC,QAAQ,EACRC,GAAG,EACHC,IAAI,QACC,gCAAgC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AASxC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAA6C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CAAC;IACTvC,IAAI,EAAE;EACR,CAAC;EACD6B,GAAG,EAAE;IACHa,eAAe,EAAE;EACnB,CAAC;EACD;EACAV,MAAM,EAAE;IACNW,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBC,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE;MAAE7E,KAAK,EAAE,CAAC,CAAC;MAAE8E,MAAM,EAAE;IAAE,CAAC;IACtCC,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE;EAChB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React, { useCallback, useMemo } from 'react';
|
|
4
|
+
import { UNREAD_CAP_PAGE } from '../../roomStore/roomsSlice';
|
|
4
5
|
import { useSelector } from 'react-redux';
|
|
5
6
|
import { useFileToken } from '../../hooks/useFileToken';
|
|
6
7
|
import { appendFileToken } from '../../helpers/secureFileUrl';
|
|
@@ -57,7 +58,7 @@ const ChatRoomItem = ({
|
|
|
57
58
|
}, [usersSet]);
|
|
58
59
|
const lastMessage = useMemo(() => {
|
|
59
60
|
if (!chat?.messages || chat.messages.length === 0) {
|
|
60
|
-
return undefined;
|
|
61
|
+
return chat?.lastMessage?.body ? withAuthorFallback(chat.lastMessage) : undefined;
|
|
61
62
|
}
|
|
62
63
|
for (let i = chat.messages.length - 1; i >= 0; i--) {
|
|
63
64
|
const msg = chat.messages[i];
|
|
@@ -66,7 +67,7 @@ const ChatRoomItem = ({
|
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
69
|
return undefined;
|
|
69
|
-
}, [chat?.messages, withAuthorFallback]);
|
|
70
|
+
}, [chat?.messages, chat?.lastMessage, withAuthorFallback]);
|
|
70
71
|
|
|
71
72
|
// Mirrors web's formatter: tolerates undefined/garbage inputs (returns
|
|
72
73
|
// undefined instead of "NaN:NaN"), and uses HH:MM today / MM/DD this
|
|
@@ -181,7 +182,7 @@ const ChatRoomItem = ({
|
|
|
181
182
|
fontSize: 14,
|
|
182
183
|
fontWeight: '600'
|
|
183
184
|
},
|
|
184
|
-
children: chat.unreadMessages || ''
|
|
185
|
+
children: chat.unreadCapped && (chat.unreadMessages || 0) >= UNREAD_CAP_PAGE ? `${chat.unreadMessages}+` : chat.unreadMessages || ''
|
|
185
186
|
})
|
|
186
187
|
}) : null]
|
|
187
188
|
}), isDriver &&
|
|
@@ -199,5 +200,5 @@ const ChatRoomItem = ({
|
|
|
199
200
|
})]
|
|
200
201
|
}, index);
|
|
201
202
|
};
|
|
202
|
-
export default ChatRoomItem;
|
|
203
|
+
export default /*#__PURE__*/React.memo(ChatRoomItem);
|
|
203
204
|
//# sourceMappingURL=ChatRoomItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useMemo","useSelector","useFileToken","appendFileToken","ProfileImagePlaceholder","ChatItem","ChatInfo","ChatName","UserCount","Composing","Text","View","LastMessageItem","LastRoomMessageText","useTheme","resolveTheme","jsx","_jsx","jsxs","_jsxs","ChatRoomItem","chat","index","isDriver","config","storeTheme","theme","fileToken","displayName","String","title","name","trim","usersSet","state","rooms","withAuthorFallback","message","rawUserId","user","id","localId","split","entry","fromUsersSet","firstName","lastName","safeName","lastMessage","messages","length","undefined","i","msg","deleted","isDeleted","formatTimeToHHMM","isoTime","date","Date","trimmed","test","parseInt","isNaN","getTime","now","getFullYear","year","month","getMonth","toString","padStart","day","getDate","toDateString","hours","getHours","minutes","getMinutes","stamp","createdAt","children","pointerEvents","icon","active","style","flexDirection","justifyContent","flex","width","paddingVertical","paddingRight","borderBottomWidth","borderBottomColor","divider","alignItems","text","color","textSecondary","fontSize","minHeight","composing","usersTyping","composingList","
|
|
1
|
+
{"version":3,"names":["React","useCallback","useMemo","UNREAD_CAP_PAGE","useSelector","useFileToken","appendFileToken","ProfileImagePlaceholder","ChatItem","ChatInfo","ChatName","UserCount","Composing","Text","View","LastMessageItem","LastRoomMessageText","useTheme","resolveTheme","jsx","_jsx","jsxs","_jsxs","ChatRoomItem","chat","index","isDriver","config","storeTheme","theme","fileToken","displayName","String","title","name","trim","usersSet","state","rooms","withAuthorFallback","message","rawUserId","user","id","localId","split","entry","fromUsersSet","firstName","lastName","safeName","lastMessage","messages","length","body","undefined","i","msg","deleted","isDeleted","formatTimeToHHMM","isoTime","date","Date","trimmed","test","parseInt","isNaN","getTime","now","getFullYear","year","month","getMonth","toString","padStart","day","getDate","toDateString","hours","getHours","minutes","getMinutes","stamp","createdAt","children","pointerEvents","icon","active","style","flexDirection","justifyContent","flex","width","paddingVertical","paddingRight","borderBottomWidth","borderBottomColor","divider","alignItems","text","color","textSecondary","fontSize","minHeight","composing","usersTyping","composingList","historyComplete","unreadMessages","borderRadius","backgroundColor","primary","padding","minWidth","display","marginLeft","fontWeight","unreadCapped","height","marginTop","memo"],"sourceRoot":"../../../../src","sources":["components/RoomComponents/ChatRoomItem.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACnD,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,WAAW,QAAQ,aAAa;AAGzC,SAASC,YAAY,QAAQ,0BAA0B;AACvD,SAASC,eAAe,QAAQ,6BAA6B;AAE7D,SAASC,uBAAuB,QAAQ,2CAA2C;AACnF,SACEC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EAERC,SAAS,QACJ,8BAA8B;AACrC,OAAOC,SAAS,MAAM,2CAA2C;AACjE,SAASC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,SAASC,mBAAmB,QAAQ,+BAA+B;AACnE,SAASC,QAAQ,QAAQ,sBAAsB;AAC/C,SAASC,YAAY,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AASjD,MAAMC,YAAyC,GAAGA,CAAC;EACjDC,IAAI;EACJC,KAAK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AAQ;YACpBiB,UAAU,EAAE;UACd,CAAE;UAAA/B,QAAA,eAEFjE,IAAA,CAACP,IAAI;YACH4E,KAAK,EAAE;cACL;cACAY,KAAK,EAAExE,KAAK,CAACuE,IAAI;cACjBG,QAAQ,EAAE,EAAE;cACZc,UAAU,EAAE;YACd,CAAE;YAAAhC,QAAA,EAED7D,IAAI,CAAC8F,YAAY,IAAI,CAAC9F,IAAI,CAACqF,cAAc,IAAI,CAAC,KAAK1G,eAAe,GAC/D,GAAGqB,IAAI,CAACqF,cAAc,GAAG,GACzBrF,IAAI,CAACqF,cAAc,IAAI;UAAE,CACzB;QAAC,CACH,CAAC,GACL,IAAI;MAAA,CACJ,CAAC,EACNnF,QAAQ;MAAA;MACP;MACA;MACA;MACAN,IAAA,CAACN,IAAI;QACH2E,KAAK,EAAE;UAAE8B,MAAM,EAAE,CAAC;UAAER,eAAe,EAAElF,KAAK,CAACqE,OAAO;UAAEsB,SAAS,EAAE;QAAE;MAAE,CACpE,CACF;IAAA,CACG,CAAC;EAAA,GA3IM/F,KA4IL,CAAC;AAEf,CAAC;AAED,4BAAezB,KAAK,CAACyH,IAAI,CAAClG,YAAY,CAAC","ignoreList":[]}
|
|
@@ -2,24 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { LastRoomMessageContainer, LastRoomMessageName, LastRoomMessageText } from './StyledRoomComponents';
|
|
5
|
+
import { getEmojiNativeById } from '../../../helpers/emoji';
|
|
5
6
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* not an `:id:`) so we just render it as-is — no emoji-id resolution
|
|
11
|
-
* library needed. If a legacy payload still ships an `:id:`, it
|
|
12
|
-
* renders verbatim instead of crashing.
|
|
8
|
+
* The room-list preview when the latest event in a room is a reaction.
|
|
9
|
+
* The stanza carries the emoji's short name (`joy`, `+1`), as on web — it
|
|
10
|
+
* is resolved to the glyph here; a glyph or unknown id renders as is.
|
|
13
11
|
*/
|
|
14
12
|
const LastMessageEmoji = ({
|
|
15
13
|
user,
|
|
16
14
|
emoji
|
|
17
15
|
}) => {
|
|
16
|
+
const name = (user?.name || '').trim();
|
|
18
17
|
return /*#__PURE__*/_jsxs(LastRoomMessageContainer, {
|
|
19
|
-
children: [/*#__PURE__*/_jsxs(LastRoomMessageName, {
|
|
20
|
-
children: [
|
|
18
|
+
children: [!!name && /*#__PURE__*/_jsxs(LastRoomMessageName, {
|
|
19
|
+
children: [name, ":"]
|
|
21
20
|
}), /*#__PURE__*/_jsx(LastRoomMessageText, {
|
|
22
|
-
children: emoji
|
|
21
|
+
children: emoji ? getEmojiNativeById(emoji) : ''
|
|
23
22
|
})]
|
|
24
23
|
});
|
|
25
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","LastRoomMessageContainer","LastRoomMessageName","LastRoomMessageText","jsxs","_jsxs","jsx","_jsx","LastMessageEmoji","user","emoji","
|
|
1
|
+
{"version":3,"names":["React","LastRoomMessageContainer","LastRoomMessageName","LastRoomMessageText","getEmojiNativeById","jsxs","_jsxs","jsx","_jsx","LastMessageEmoji","user","emoji","name","trim","children"],"sourceRoot":"../../../../../src","sources":["components/RoomComponents/styled/LastMessageEmoji.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAc,OAAO;AACjC,SACEC,wBAAwB,EACxBC,mBAAmB,EACnBC,mBAAmB,QACd,wBAAwB;AAE/B,SAASC,kBAAkB,QAAQ,wBAAwB;AAAC,SAAAC,IAAA,IAAAC,KAAA,EAAAC,GAAA,IAAAC,IAAA;AAI5D;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAA2C,GAAGA,CAAC;EAAEC,IAAI;EAAEC;AAAM,CAAC,KAAK;EACvE,MAAMC,IAAI,GAAG,CAACF,IAAI,EAAEE,IAAI,IAAI,EAAE,EAAEC,IAAI,CAAC,CAAC;EACtC,oBACEP,KAAA,CAACL,wBAAwB;IAAAa,QAAA,GACtB,CAAC,CAACF,IAAI,iBAAIN,KAAA,CAACJ,mBAAmB;MAAAY,QAAA,GAAEF,IAAI,EAAC,GAAC;IAAA,CAAqB,CAAC,eAC7DJ,IAAA,CAACL,mBAAmB;MAAAW,QAAA,EAAEH,KAAK,GAAGP,kBAAkB,CAACO,KAAK,CAAC,GAAG;IAAE,CAAsB,CAAC;EAAA,CAC3D,CAAC;AAE/B,CAAC;AAED,eAAeF,gBAAgB","ignoreList":[]}
|