@ethora/chat-component-rn 26.7.5 → 26.7.7
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/CHANGELOG.md +62 -0
- package/README.md +31 -8
- package/lib/commonjs/assets/icons.js +7 -2
- package/lib/commonjs/assets/icons.js.map +1 -1
- package/lib/commonjs/components/Header/HeaderRoomList.js +26 -7
- package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatHeader.js +5 -2
- package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatRoom.js +36 -14
- package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatWrapper.js +2 -0
- package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageList.js +7 -23
- package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js +14 -13
- package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
- package/lib/commonjs/components/MainComponents/RoomList.js +208 -35
- package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js +317 -98
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +320 -110
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +552 -213
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +226 -0
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -0
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +6 -2
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/commonjs/components/Modals/Modal/Modal.js +8 -0
- package/lib/commonjs/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js +2 -1
- package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js +202 -104
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js +8 -0
- package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js +556 -0
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js.map +1 -0
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js +210 -0
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js.map +1 -0
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js +4 -2
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js +7 -21
- package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +507 -244
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +74 -46
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/commonjs/components/Modals/styledModalComponents.js +9 -2
- package/lib/commonjs/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +17 -7
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/commonjs/components/styled/SendInput.js +80 -11
- package/lib/commonjs/components/styled/SendInput.js.map +1 -1
- package/lib/commonjs/components/styled/StyledComponents.js +9 -3
- package/lib/commonjs/components/styled/StyledComponents.js.map +1 -1
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js +11 -4
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/commonjs/context/xmppProvider.js +32 -39
- package/lib/commonjs/context/xmppProvider.js.map +1 -1
- package/lib/commonjs/helpers/getChatBackground.js +23 -0
- package/lib/commonjs/helpers/getChatBackground.js.map +1 -0
- package/lib/commonjs/helpers/mediaLibraryRuntime.js +31 -0
- package/lib/commonjs/helpers/mediaLibraryRuntime.js.map +1 -0
- package/lib/commonjs/helpers/pickImageAsset.js +68 -0
- package/lib/commonjs/helpers/pickImageAsset.js.map +1 -0
- package/lib/commonjs/helpers/pushPayload.js +71 -0
- package/lib/commonjs/helpers/pushPayload.js.map +1 -0
- package/lib/commonjs/helpers/sheetGestures.js +32 -0
- package/lib/commonjs/helpers/sheetGestures.js.map +1 -0
- package/lib/commonjs/helpers/updateMessagesTillLast.js +12 -40
- package/lib/commonjs/helpers/updateMessagesTillLast.js.map +1 -1
- package/lib/commonjs/hooks/useChatRoomFocus.js +3 -9
- package/lib/commonjs/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/commonjs/hooks/useLogout.js +0 -5
- package/lib/commonjs/hooks/useLogout.js.map +1 -1
- package/lib/commonjs/hooks/usePendingNotification.js +8 -11
- package/lib/commonjs/hooks/usePendingNotification.js.map +1 -1
- package/lib/commonjs/hooks/useSendMessage.js +23 -50
- package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
- package/lib/commonjs/i18n/strings.js +121 -1
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/main.js +19 -0
- package/lib/commonjs/main.js.map +1 -1
- package/lib/commonjs/networking/api-requests/user.api.js +59 -0
- package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
- package/lib/commonjs/networking/authRefresh.js +12 -2
- package/lib/commonjs/networking/authRefresh.js.map +1 -1
- package/lib/commonjs/networking/outboundQueue.js +0 -18
- package/lib/commonjs/networking/outboundQueue.js.map +1 -1
- package/lib/commonjs/networking/stanzaHandlers.js +1 -10
- package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
- package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js +8 -1
- package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/subscribeToRoomMessages.xmpp.js +5 -1
- package/lib/commonjs/networking/xmpp/subscribeToRoomMessages.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmppClient.js +62 -108
- package/lib/commonjs/networking/xmppClient.js.map +1 -1
- package/lib/commonjs/roomStore/chatSettingsSlice.js +3 -1
- package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/commonjs/roomStore/roomsSlice.js +3 -22
- package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
- package/lib/commonjs/services/pushSubscriptionService.js +15 -13
- package/lib/commonjs/services/pushSubscriptionService.js.map +1 -1
- package/lib/module/assets/icons.js +6 -1
- package/lib/module/assets/icons.js.map +1 -1
- package/lib/module/components/Header/HeaderRoomList.js +26 -7
- package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/module/components/MainComponents/ChatHeader.js +5 -2
- package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/module/components/MainComponents/ChatRoom.js +36 -14
- package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/module/components/MainComponents/ChatWrapper.js +2 -0
- package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/MessageList.js +8 -24
- package/lib/module/components/MainComponents/MessageList.js.map +1 -1
- package/lib/module/components/MainComponents/ProfileImagePlaceholder.js +14 -13
- package/lib/module/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
- package/lib/module/components/MainComponents/RoomList.js +207 -35
- package/lib/module/components/MainComponents/RoomList.js.map +1 -1
- package/lib/module/components/Menu/HeaderRoomListMenu.js +319 -101
- package/lib/module/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js +311 -113
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +555 -217
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +223 -0
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -0
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +6 -2
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/module/components/Modals/Modal/Modal.js +9 -1
- package/lib/module/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/ModalContent.js +2 -1
- package/lib/module/components/Modals/NewChatModal/ModalContent.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js +205 -106
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js +8 -0
- package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
- package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js +548 -0
- package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js.map +1 -0
- package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js +205 -0
- package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js.map +1 -0
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js +4 -2
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/EditUserModal.js +9 -23
- package/lib/module/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +509 -248
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +76 -48
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/module/components/Modals/styledModalComponents.js +9 -2
- package/lib/module/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/module/components/RoomComponents/ChatRoomItem.js +17 -7
- package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/module/components/styled/SendInput.js +81 -12
- package/lib/module/components/styled/SendInput.js.map +1 -1
- package/lib/module/components/styled/StyledComponents.js +9 -3
- package/lib/module/components/styled/StyledComponents.js.map +1 -1
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js +11 -4
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/module/context/xmppProvider.js +32 -39
- package/lib/module/context/xmppProvider.js.map +1 -1
- package/lib/module/helpers/getChatBackground.js +18 -0
- package/lib/module/helpers/getChatBackground.js.map +1 -0
- package/lib/module/helpers/mediaLibraryRuntime.js +25 -0
- package/lib/module/helpers/mediaLibraryRuntime.js.map +1 -0
- package/lib/module/helpers/pickImageAsset.js +63 -0
- package/lib/module/helpers/pickImageAsset.js.map +1 -0
- package/lib/module/helpers/pushPayload.js +63 -0
- package/lib/module/helpers/pushPayload.js.map +1 -0
- package/lib/module/helpers/sheetGestures.js +26 -0
- package/lib/module/helpers/sheetGestures.js.map +1 -0
- package/lib/module/helpers/updateMessagesTillLast.js +13 -41
- package/lib/module/helpers/updateMessagesTillLast.js.map +1 -1
- package/lib/module/hooks/useChatRoomFocus.js +3 -9
- package/lib/module/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/module/hooks/useLogout.js +0 -5
- package/lib/module/hooks/useLogout.js.map +1 -1
- package/lib/module/hooks/usePendingNotification.js +8 -11
- package/lib/module/hooks/usePendingNotification.js.map +1 -1
- package/lib/module/hooks/useSendMessage.js +24 -51
- package/lib/module/hooks/useSendMessage.js.map +1 -1
- package/lib/module/i18n/strings.js +121 -1
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/main.js +2 -1
- package/lib/module/main.js.map +1 -1
- package/lib/module/networking/api-requests/user.api.js +56 -0
- package/lib/module/networking/api-requests/user.api.js.map +1 -1
- package/lib/module/networking/authRefresh.js +12 -2
- package/lib/module/networking/authRefresh.js.map +1 -1
- package/lib/module/networking/outboundQueue.js +0 -17
- package/lib/module/networking/outboundQueue.js.map +1 -1
- package/lib/module/networking/stanzaHandlers.js +1 -10
- package/lib/module/networking/stanzaHandlers.js.map +1 -1
- package/lib/module/networking/xmpp/presenceInRoom.xmpp.js +8 -1
- package/lib/module/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/subscribeToRoomMessages.xmpp.js +5 -1
- package/lib/module/networking/xmpp/subscribeToRoomMessages.xmpp.js.map +1 -1
- package/lib/module/networking/xmppClient.js +62 -108
- package/lib/module/networking/xmppClient.js.map +1 -1
- package/lib/module/roomStore/chatSettingsSlice.js +3 -1
- package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/module/roomStore/roomsSlice.js +2 -20
- package/lib/module/roomStore/roomsSlice.js.map +1 -1
- package/lib/module/services/pushSubscriptionService.js +15 -13
- package/lib/module/services/pushSubscriptionService.js.map +1 -1
- package/lib/typescript/assets/icons.d.ts +16 -0
- package/lib/typescript/assets/icons.d.ts.map +1 -1
- 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/MessageList.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ProfileImagePlaceholder.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/RoomList.d.ts +7 -0
- package/lib/typescript/components/MainComponents/RoomList.d.ts.map +1 -1
- package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts +3 -0
- package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts.map +1 -1
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts +9 -0
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts +10 -0
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts +9 -0
- package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts.map +1 -0
- package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/Modal/Modal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts +4 -2
- package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts.map +1 -1
- package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts +1 -1
- package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/NewChatModal/UpdNewChatModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts +75 -0
- package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts.map +1 -0
- package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts +25 -0
- package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts.map +1 -0
- package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts +6 -1
- package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserProfileModal/EditUserModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts +16 -0
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts +1 -0
- package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/styledModalComponents.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/ChatRoomItem.d.ts.map +1 -1
- package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
- package/lib/typescript/components/styled/StyledComponents.d.ts.map +1 -1
- package/lib/typescript/components/styled/StyledInputComponents/StyledInputComponents.d.ts.map +1 -1
- package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
- package/lib/typescript/helpers/getChatBackground.d.ts +15 -0
- package/lib/typescript/helpers/getChatBackground.d.ts.map +1 -0
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts +3 -0
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts.map +1 -0
- package/lib/typescript/helpers/pickImageAsset.d.ts +27 -0
- package/lib/typescript/helpers/pickImageAsset.d.ts.map +1 -0
- package/lib/typescript/helpers/pushPayload.d.ts +7 -0
- package/lib/typescript/helpers/pushPayload.d.ts.map +1 -0
- package/lib/typescript/helpers/sheetGestures.d.ts +20 -0
- package/lib/typescript/helpers/sheetGestures.d.ts.map +1 -0
- package/lib/typescript/helpers/updateMessagesTillLast.d.ts.map +1 -1
- package/lib/typescript/hooks/useChatRoomFocus.d.ts.map +1 -1
- package/lib/typescript/hooks/useLogout.d.ts.map +1 -1
- package/lib/typescript/hooks/usePendingNotification.d.ts.map +1 -1
- package/lib/typescript/hooks/useSendMessage.d.ts.map +1 -1
- package/lib/typescript/i18n/strings.d.ts.map +1 -1
- package/lib/typescript/main.d.ts +3 -1
- package/lib/typescript/main.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/user.api.d.ts +27 -0
- package/lib/typescript/networking/api-requests/user.api.d.ts.map +1 -1
- package/lib/typescript/networking/authRefresh.d.ts +4 -1
- package/lib/typescript/networking/authRefresh.d.ts.map +1 -1
- package/lib/typescript/networking/outboundQueue.d.ts +0 -16
- package/lib/typescript/networking/outboundQueue.d.ts.map +1 -1
- package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/presenceInRoom.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/subscribeToRoomMessages.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmppClient.d.ts +8 -33
- package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
- package/lib/typescript/roomStore/roomsSlice.d.ts +1 -18
- package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
- package/lib/typescript/services/pushSubscriptionService.d.ts +1 -1
- package/lib/typescript/services/pushSubscriptionService.d.ts.map +1 -1
- package/lib/typescript/types/models/room.model.d.ts +0 -15
- package/lib/typescript/types/models/room.model.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +31 -20
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/package.json +6 -1
- package/src/assets/icons.tsx +48 -9
- package/src/components/Header/HeaderRoomList.tsx +24 -6
- package/src/components/MainComponents/ChatHeader.tsx +5 -2
- package/src/components/MainComponents/ChatRoom.tsx +38 -20
- package/src/components/MainComponents/ChatWrapper.tsx +3 -0
- package/src/components/MainComponents/MessageList.tsx +8 -24
- package/src/components/MainComponents/ProfileImagePlaceholder.tsx +21 -14
- package/src/components/MainComponents/RoomList.tsx +236 -39
- package/src/components/Menu/HeaderRoomListMenu.tsx +328 -75
- package/src/components/Modals/AttachSheet/AttachSheet.tsx +331 -97
- package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +598 -279
- package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +244 -0
- package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +4 -2
- package/src/components/Modals/Modal/Modal.tsx +7 -0
- package/src/components/Modals/NewChatModal/ModalContent.tsx +6 -3
- package/src/components/Modals/NewChatModal/NewChatModal.tsx +219 -117
- package/src/components/Modals/NewChatModal/UpdNewChatModal.tsx +12 -1
- package/src/components/Modals/ProfileHeader/ProfileHeader.tsx +615 -0
- package/src/components/Modals/ProfileHeader/ProfileMenu.tsx +217 -0
- package/src/components/Modals/SelectUsersModal/SelectUsersModal.tsx +14 -4
- package/src/components/Modals/UserProfileModal/EditUserModal.tsx +9 -25
- package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +617 -307
- package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +75 -58
- package/src/components/Modals/styledModalComponents.tsx +9 -2
- package/src/components/RoomComponents/ChatRoomItem.tsx +14 -7
- package/src/components/styled/SendInput.tsx +83 -12
- package/src/components/styled/StyledComponents.ts +9 -3
- package/src/components/styled/StyledInputComponents/StyledInputComponents.tsx +11 -4
- package/src/context/xmppProvider.tsx +36 -47
- package/src/helpers/getChatBackground.ts +18 -0
- package/src/helpers/mediaLibraryRuntime.ts +25 -0
- package/src/helpers/pickImageAsset.ts +68 -0
- package/src/helpers/pushPayload.ts +62 -0
- package/src/helpers/sheetGestures.ts +25 -0
- package/src/helpers/updateMessagesTillLast.tsx +17 -42
- package/src/hooks/useChatRoomFocus.ts +3 -11
- package/src/hooks/useLogout.tsx +0 -7
- package/src/hooks/usePendingNotification.ts +5 -11
- package/src/hooks/useSendMessage.tsx +24 -60
- package/src/i18n/strings.ts +121 -1
- package/src/main.ts +4 -1
- package/src/networking/api-requests/user.api.ts +71 -0
- package/src/networking/authRefresh.ts +25 -4
- package/src/networking/outboundQueue.ts +0 -29
- package/src/networking/stanzaHandlers.ts +1 -9
- package/src/networking/xmpp/presenceInRoom.xmpp.ts +6 -1
- package/src/networking/xmpp/subscribeToRoomMessages.xmpp.ts +12 -1
- package/src/networking/xmppClient.ts +65 -119
- package/src/roomStore/chatSettingsSlice.ts +3 -1
- package/src/roomStore/roomsSlice.ts +2 -20
- package/src/services/pushSubscriptionService.ts +18 -13
- package/src/types/models/room.model.ts +0 -15
- package/src/types/types.ts +33 -20
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
FlatList,
|
|
14
14
|
Pressable,
|
|
15
15
|
Animated,
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
NativeScrollEvent,
|
|
17
|
+
NativeSyntheticEvent,
|
|
18
18
|
} from 'react-native';
|
|
19
19
|
import { IRoom } from '../../types/types';
|
|
20
20
|
import { SearchInput } from '../InputComponents/Search';
|
|
@@ -35,6 +35,42 @@ interface RoomListProps {
|
|
|
35
35
|
onRoomClick?: (chat: IRoom) => void;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/** Page ground behind the room list, the search field and the header's
|
|
39
|
+
* rounded bottom corners. */
|
|
40
|
+
const LIST_BACKGROUND = '#E8EDF2';
|
|
41
|
+
|
|
42
|
+
/** A release that leaves the search strip in between is settled by
|
|
43
|
+
* scrolling to whichever end is nearer; this delay lets the platform tell
|
|
44
|
+
* us first whether the finger threw the list (momentum) or just let go. */
|
|
45
|
+
const SNAP_SETTLE_DELAY = 60;
|
|
46
|
+
|
|
47
|
+
const COLLAPSED_SCALE = 0.86;
|
|
48
|
+
|
|
49
|
+
const SEARCH_REST_GAP = 16;
|
|
50
|
+
|
|
51
|
+
export const searchRevealStyle = (
|
|
52
|
+
scrollY: Animated.Value,
|
|
53
|
+
hiddenOffset: number
|
|
54
|
+
) => {
|
|
55
|
+
const travel = Math.max(hiddenOffset, 1);
|
|
56
|
+
return {
|
|
57
|
+
opacity: scrollY.interpolate({
|
|
58
|
+
inputRange: [0, travel * 0.85],
|
|
59
|
+
outputRange: [1, 0],
|
|
60
|
+
extrapolate: 'clamp' as const,
|
|
61
|
+
}),
|
|
62
|
+
transform: [
|
|
63
|
+
{
|
|
64
|
+
scale: scrollY.interpolate({
|
|
65
|
+
inputRange: [0, travel],
|
|
66
|
+
outputRange: [1, COLLAPSED_SCALE],
|
|
67
|
+
extrapolate: 'clamp' as const,
|
|
68
|
+
}),
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
|
|
38
74
|
const RoomList: React.FC<RoomListProps> = ({
|
|
39
75
|
chats,
|
|
40
76
|
burgerMenu = false,
|
|
@@ -47,9 +83,12 @@ const RoomList: React.FC<RoomListProps> = ({
|
|
|
47
83
|
const [searchTerm, setSearchTerm] = useState('');
|
|
48
84
|
const [isLongPress, setIsLongPress] = useState(false);
|
|
49
85
|
const [isDrawerOpen, setDrawerOpen] = useState(false);
|
|
86
|
+
const [isSearchFocused, setSearchFocused] = useState(false);
|
|
50
87
|
|
|
51
88
|
const pressTimer = useRef<NodeJS.Timeout | null>(null);
|
|
52
89
|
const containerRef = useRef<View>(null);
|
|
90
|
+
const listRef = useRef<FlatList<IRoom> | null>(null);
|
|
91
|
+
const scrollY = useRef(new Animated.Value(0)).current;
|
|
53
92
|
|
|
54
93
|
const drawerAnimation = useRef(new Animated.Value(0)).current;
|
|
55
94
|
const overlayAnimation = useRef(new Animated.Value(0)).current;
|
|
@@ -120,6 +159,124 @@ const RoomList: React.FC<RoomListProps> = ({
|
|
|
120
159
|
}
|
|
121
160
|
}, [burgerMenu]);
|
|
122
161
|
|
|
162
|
+
// The search field is the list's own header rather than a bar pinned
|
|
163
|
+
// above it: it lives in the scrollable content, so the list opens
|
|
164
|
+
// already scrolled past it (rooms first, no search in sight) and
|
|
165
|
+
// dragging the content down brings it back with the finger — the way
|
|
166
|
+
// Telegram's chat list behaves. A pinned bar could not do this on
|
|
167
|
+
// Android, where a list sitting at offset 0 has nothing left to drag.
|
|
168
|
+
const searchBarHeight = useRef(0);
|
|
169
|
+
const [measuredBarHeight, setMeasuredBarHeight] = useState(0);
|
|
170
|
+
const listHeight = useRef(0);
|
|
171
|
+
const contentHeight = useRef(0);
|
|
172
|
+
/** The list starts hidden-search only once, and only before the user
|
|
173
|
+
* has touched it — chats arriving later must not yank the view. */
|
|
174
|
+
const didInitialHide = useRef(false);
|
|
175
|
+
const hasDragged = useRef(false);
|
|
176
|
+
const inMomentum = useRef(false);
|
|
177
|
+
const settleTimer = useRef<NodeJS.Timeout | null>(null);
|
|
178
|
+
|
|
179
|
+
// A search being typed in (or just focused) is never tucked away
|
|
180
|
+
// under the header, whichever way the list is then dragged.
|
|
181
|
+
const searchIsActive = useRef(false);
|
|
182
|
+
searchIsActive.current = isSearchFocused || searchTerm.length > 0;
|
|
183
|
+
|
|
184
|
+
/** How far the list can scroll — the strip can only be hidden fully
|
|
185
|
+
* when the rooms below it are tall enough to take its place. */
|
|
186
|
+
const maxOffset = () => contentHeight.current - listHeight.current;
|
|
187
|
+
|
|
188
|
+
const hiddenOffset = () =>
|
|
189
|
+
Math.max(searchBarHeight.current - SEARCH_REST_GAP, 0);
|
|
190
|
+
|
|
191
|
+
const hideSearchInitially = useCallback(() => {
|
|
192
|
+
if (didInitialHide.current || hasDragged.current) return;
|
|
193
|
+
const hidden = hiddenOffset();
|
|
194
|
+
if (!hidden || !listHeight.current || !contentHeight.current) return;
|
|
195
|
+
if (maxOffset() < hidden) return;
|
|
196
|
+
didInitialHide.current = true;
|
|
197
|
+
listRef.current?.scrollToOffset({ offset: hidden, animated: false });
|
|
198
|
+
}, []);
|
|
199
|
+
|
|
200
|
+
/** The magnet: a strip left half-way in or out settles to whichever
|
|
201
|
+
* end it is closer to. */
|
|
202
|
+
const snapSearch = useCallback((offset: number) => {
|
|
203
|
+
const hidden = hiddenOffset();
|
|
204
|
+
if (!hidden || maxOffset() < hidden) return;
|
|
205
|
+
if (offset <= 0 || offset >= hidden) return;
|
|
206
|
+
const hide = !searchIsActive.current && offset > hidden / 2;
|
|
207
|
+
listRef.current?.scrollToOffset({
|
|
208
|
+
offset: hide ? hidden : 0,
|
|
209
|
+
animated: true,
|
|
210
|
+
});
|
|
211
|
+
}, []);
|
|
212
|
+
|
|
213
|
+
const clearSettleTimer = () => {
|
|
214
|
+
if (settleTimer.current) {
|
|
215
|
+
clearTimeout(settleTimer.current);
|
|
216
|
+
settleTimer.current = null;
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
useEffect(() => clearSettleTimer, []);
|
|
221
|
+
|
|
222
|
+
const handleScroll = useMemo(
|
|
223
|
+
() =>
|
|
224
|
+
Animated.event([{ nativeEvent: { contentOffset: { y: scrollY } } }], {
|
|
225
|
+
useNativeDriver: true,
|
|
226
|
+
}),
|
|
227
|
+
[scrollY]
|
|
228
|
+
);
|
|
229
|
+
|
|
230
|
+
const revealStyle = useMemo(
|
|
231
|
+
() =>
|
|
232
|
+
searchRevealStyle(
|
|
233
|
+
scrollY,
|
|
234
|
+
Math.max(measuredBarHeight - SEARCH_REST_GAP, 0)
|
|
235
|
+
),
|
|
236
|
+
[scrollY, measuredBarHeight]
|
|
237
|
+
);
|
|
238
|
+
|
|
239
|
+
const handleScrollBeginDrag = useCallback(() => {
|
|
240
|
+
hasDragged.current = true;
|
|
241
|
+
clearSettleTimer();
|
|
242
|
+
}, []);
|
|
243
|
+
|
|
244
|
+
const handleScrollEndDrag = useCallback(
|
|
245
|
+
(e: NativeSyntheticEvent<NativeScrollEvent>) => {
|
|
246
|
+
const offset = e.nativeEvent.contentOffset.y;
|
|
247
|
+
inMomentum.current = false;
|
|
248
|
+
clearSettleTimer();
|
|
249
|
+
// A flick keeps scrolling after the release; snapping now would
|
|
250
|
+
// fight it, so wait a beat and let momentum claim the gesture.
|
|
251
|
+
settleTimer.current = setTimeout(() => {
|
|
252
|
+
settleTimer.current = null;
|
|
253
|
+
if (!inMomentum.current) snapSearch(offset);
|
|
254
|
+
}, SNAP_SETTLE_DELAY);
|
|
255
|
+
},
|
|
256
|
+
[snapSearch]
|
|
257
|
+
);
|
|
258
|
+
|
|
259
|
+
const handleMomentumBegin = useCallback(() => {
|
|
260
|
+
inMomentum.current = true;
|
|
261
|
+
clearSettleTimer();
|
|
262
|
+
}, []);
|
|
263
|
+
|
|
264
|
+
const handleMomentumEnd = useCallback(
|
|
265
|
+
(e: NativeSyntheticEvent<NativeScrollEvent>) => {
|
|
266
|
+
inMomentum.current = false;
|
|
267
|
+
snapSearch(e.nativeEvent.contentOffset.y);
|
|
268
|
+
},
|
|
269
|
+
[snapSearch]
|
|
270
|
+
);
|
|
271
|
+
|
|
272
|
+
// Tapping the field pulls it fully into view even if it was caught
|
|
273
|
+
// half-way, so the caret never sits under the header.
|
|
274
|
+
useEffect(() => {
|
|
275
|
+
if (isSearchFocused) {
|
|
276
|
+
listRef.current?.scrollToOffset({ offset: 0, animated: true });
|
|
277
|
+
}
|
|
278
|
+
}, [isSearchFocused]);
|
|
279
|
+
|
|
123
280
|
const toggleDrawer = () => {
|
|
124
281
|
if (isDrawerOpen) {
|
|
125
282
|
closeDrawer();
|
|
@@ -157,6 +314,33 @@ const RoomList: React.FC<RoomListProps> = ({
|
|
|
157
314
|
});
|
|
158
315
|
};
|
|
159
316
|
|
|
317
|
+
const searchHeader = (
|
|
318
|
+
<View
|
|
319
|
+
testID="room-list-search"
|
|
320
|
+
style={styles.searchBar}
|
|
321
|
+
onLayout={(e) => {
|
|
322
|
+
const height = e.nativeEvent.layout.height;
|
|
323
|
+
searchBarHeight.current = height;
|
|
324
|
+
setMeasuredBarHeight((prev) => (prev === height ? prev : height));
|
|
325
|
+
hideSearchInitially();
|
|
326
|
+
}}
|
|
327
|
+
>
|
|
328
|
+
<Animated.View
|
|
329
|
+
testID="room-list-search-field"
|
|
330
|
+
style={[styles.searchField, revealStyle]}
|
|
331
|
+
>
|
|
332
|
+
<SearchInput
|
|
333
|
+
icon={<SearchIcon height={20} />}
|
|
334
|
+
value={searchTerm}
|
|
335
|
+
onChangeText={handleSearchChange}
|
|
336
|
+
onFocus={() => setSearchFocused(true)}
|
|
337
|
+
onBlur={() => setSearchFocused(false)}
|
|
338
|
+
placeholder={t('search.placeholder')}
|
|
339
|
+
/>
|
|
340
|
+
</Animated.View>
|
|
341
|
+
</View>
|
|
342
|
+
);
|
|
343
|
+
|
|
160
344
|
return (
|
|
161
345
|
<>
|
|
162
346
|
{burgerMenu && !open && (
|
|
@@ -180,39 +364,46 @@ const RoomList: React.FC<RoomListProps> = ({
|
|
|
180
364
|
<>
|
|
181
365
|
<View style={styles.scrollContainer}>
|
|
182
366
|
<HeaderRoomList setDrawerOpen={toggleDrawer} />
|
|
183
|
-
{
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
367
|
+
<View style={styles.listArea}>
|
|
368
|
+
{/* Animated.FlatList, so the reveal runs on the native
|
|
369
|
+
thread off the very same scroll it follows. */}
|
|
370
|
+
<Animated.FlatList
|
|
371
|
+
ref={listRef}
|
|
372
|
+
data={filteredChats}
|
|
373
|
+
keyExtractor={(item) => item.jid}
|
|
374
|
+
ListHeaderComponent={searchHeader}
|
|
375
|
+
onLayout={(e) => {
|
|
376
|
+
listHeight.current = e.nativeEvent.layout.height;
|
|
377
|
+
hideSearchInitially();
|
|
378
|
+
}}
|
|
379
|
+
onContentSizeChange={(_w, h) => {
|
|
380
|
+
contentHeight.current = h;
|
|
381
|
+
hideSearchInitially();
|
|
382
|
+
}}
|
|
383
|
+
onScroll={handleScroll}
|
|
384
|
+
scrollEventThrottle={16}
|
|
385
|
+
onScrollBeginDrag={handleScrollBeginDrag}
|
|
386
|
+
onScrollEndDrag={handleScrollEndDrag}
|
|
387
|
+
onMomentumScrollBegin={handleMomentumBegin}
|
|
388
|
+
onMomentumScrollEnd={handleMomentumEnd}
|
|
389
|
+
keyboardShouldPersistTaps="handled"
|
|
390
|
+
renderItem={({ item }) => (
|
|
391
|
+
<Pressable
|
|
392
|
+
// Stable testID so e2e drivers can target a room
|
|
393
|
+
// row by its jid local-part (e.g. Main chat under
|
|
394
|
+
// app id `..._...759` → testID `room-...759`).
|
|
395
|
+
testID={`room-${(item.jid || '').split('@')[0]}`}
|
|
396
|
+
accessibilityLabel={`room-${item.title || item.name}`}
|
|
397
|
+
onPress={() => performClick(item)}
|
|
398
|
+
onPressIn={handlePressIn}
|
|
399
|
+
onPressOut={handlePressOut}
|
|
400
|
+
>
|
|
401
|
+
<ChatRoomItem chat={item} config={config} />
|
|
402
|
+
</Pressable>
|
|
403
|
+
)}
|
|
404
|
+
style={styles.chatList}
|
|
195
405
|
/>
|
|
196
406
|
</View>
|
|
197
|
-
<FlatList
|
|
198
|
-
data={filteredChats}
|
|
199
|
-
keyExtractor={(item) => item.jid}
|
|
200
|
-
renderItem={({ item }) => (
|
|
201
|
-
<Pressable
|
|
202
|
-
// Stable testID so e2e drivers can target a room
|
|
203
|
-
// row by its jid local-part (e.g. Main chat under
|
|
204
|
-
// app id `..._...759` → testID `room-...759`).
|
|
205
|
-
testID={`room-${(item.jid || '').split('@')[0]}`}
|
|
206
|
-
accessibilityLabel={`room-${item.title || item.name}`}
|
|
207
|
-
onPress={() => performClick(item)}
|
|
208
|
-
onPressIn={handlePressIn}
|
|
209
|
-
onPressOut={handlePressOut}
|
|
210
|
-
>
|
|
211
|
-
<ChatRoomItem chat={item} config={config} />
|
|
212
|
-
</Pressable>
|
|
213
|
-
)}
|
|
214
|
-
style={styles.chatList}
|
|
215
|
-
/>
|
|
216
407
|
|
|
217
408
|
<HeaderRoomListMenu
|
|
218
409
|
closeDrawer={closeDrawer}
|
|
@@ -238,7 +429,7 @@ const styles = StyleSheet.create({
|
|
|
238
429
|
width: '100%',
|
|
239
430
|
height: '100%',
|
|
240
431
|
flex: 1,
|
|
241
|
-
backgroundColor:
|
|
432
|
+
backgroundColor: LIST_BACKGROUND,
|
|
242
433
|
},
|
|
243
434
|
scrollContainer: {
|
|
244
435
|
flexGrow: 1,
|
|
@@ -249,21 +440,27 @@ const styles = StyleSheet.create({
|
|
|
249
440
|
padding: 16,
|
|
250
441
|
justifyContent: 'space-between',
|
|
251
442
|
},
|
|
443
|
+
listArea: {
|
|
444
|
+
flex: 1,
|
|
445
|
+
},
|
|
252
446
|
searchBar: {
|
|
447
|
+
paddingBottom: 4,
|
|
253
448
|
// `row` matters: SearchInputWrapper is `flex: 1` plus a fixed 44px
|
|
254
449
|
// height. In a column parent that flex resolves VERTICALLY against a
|
|
255
450
|
// parent with no height of its own and collapses the field to nothing
|
|
256
|
-
// but its magnifier. As a row it resolves to width
|
|
257
|
-
// meant back when the field was a list-header child.
|
|
451
|
+
// but its magnifier. As a row it resolves to width.
|
|
258
452
|
flexDirection: 'row',
|
|
259
453
|
paddingTop: 8,
|
|
260
|
-
|
|
261
|
-
|
|
454
|
+
backgroundColor: 'transparent',
|
|
455
|
+
},
|
|
456
|
+
searchField: {
|
|
457
|
+
flexDirection: 'row',
|
|
458
|
+
flex: 1,
|
|
262
459
|
},
|
|
263
460
|
chatList: {
|
|
264
461
|
flex: 1,
|
|
265
462
|
paddingHorizontal: 16,
|
|
266
|
-
backgroundColor:
|
|
463
|
+
backgroundColor: LIST_BACKGROUND,
|
|
267
464
|
},
|
|
268
465
|
});
|
|
269
466
|
|