@ethora/chat-component-rn 26.8.1 → 26.8.2
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 +96 -0
- package/README.md +43 -10
- package/lib/commonjs/assets/icons.js +7 -2
- package/lib/commonjs/assets/icons.js.map +1 -1
- package/lib/commonjs/components/AuthForms/Login.js +4 -4
- package/lib/commonjs/components/AuthForms/Login.js.map +1 -1
- package/lib/commonjs/components/Header/HeaderRoomList.js +29 -8
- package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatHeader.js +9 -3
- package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatRoom.js +150 -14
- package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatWrapper.js +34 -13
- package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/LoginWrapper.js +2 -1
- package/lib/commonjs/components/MainComponents/LoginWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MediaMessage.js +29 -9
- package/lib/commonjs/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageContainer.js +5 -1
- package/lib/commonjs/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageList.js +13 -5
- 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 +322 -110
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +546 -203
- 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 +69 -27
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js +2 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.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 -106
- 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 +563 -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 +21 -7
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js +22 -3
- package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js +17 -3
- package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js +17 -3
- package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/VideoCallSession.js +6 -3
- package/lib/commonjs/components/VideoCalls/VideoCallSession.js.map +1 -1
- package/lib/commonjs/components/styled/AudioMessage.js +2 -1
- package/lib/commonjs/components/styled/AudioMessage.js.map +1 -1
- package/lib/commonjs/components/styled/MessageImage.js +37 -9
- package/lib/commonjs/components/styled/MessageImage.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/components/styled/UnsupportedType.js +14 -4
- package/lib/commonjs/components/styled/UnsupportedType.js.map +1 -1
- package/lib/commonjs/components/styled/VideoMessage.js +119 -61
- package/lib/commonjs/components/styled/VideoMessage.js.map +1 -1
- package/lib/commonjs/context/xmppProvider.js +184 -59
- package/lib/commonjs/context/xmppProvider.js.map +1 -1
- package/lib/commonjs/helpers/createMessageFromXml.js +19 -1
- package/lib/commonjs/helpers/createMessageFromXml.js.map +1 -1
- package/lib/commonjs/helpers/ensureScopedChatCache.js +2 -2
- package/lib/commonjs/helpers/ensureScopedChatCache.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/getDisplayFileName.js +79 -0
- package/lib/commonjs/helpers/getDisplayFileName.js.map +1 -0
- package/lib/commonjs/helpers/getServerReadTimestamp.js +188 -0
- package/lib/commonjs/helpers/getServerReadTimestamp.js.map +1 -0
- package/lib/commonjs/helpers/historyPreloadScheduler.js +65 -2
- package/lib/commonjs/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/commonjs/helpers/initXmppRooms.js +14 -8
- package/lib/commonjs/helpers/initXmppRooms.js.map +1 -1
- package/lib/commonjs/helpers/insertMessageWithDelimiter.js +51 -9
- package/lib/commonjs/helpers/insertMessageWithDelimiter.js.map +1 -1
- package/lib/commonjs/helpers/isOwnMessage.js +75 -0
- package/lib/commonjs/helpers/isOwnMessage.js.map +1 -0
- package/lib/commonjs/helpers/keyboardLayout.js +12 -2
- package/lib/commonjs/helpers/keyboardLayout.js.map +1 -1
- package/lib/commonjs/helpers/mediaLibraryRuntime.js +31 -0
- package/lib/commonjs/helpers/mediaLibraryRuntime.js.map +1 -0
- package/lib/commonjs/helpers/mimeToExtension.js +6 -14
- package/lib/commonjs/helpers/mimeToExtension.js.map +1 -1
- package/lib/commonjs/helpers/msgSortableMs.js +37 -0
- package/lib/commonjs/helpers/msgSortableMs.js.map +1 -0
- package/lib/commonjs/helpers/persistCrypto.js +122 -0
- package/lib/commonjs/helpers/persistCrypto.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/resolveInitBeforeLoadUser.js +130 -17
- package/lib/commonjs/helpers/resolveInitBeforeLoadUser.js.map +1 -1
- package/lib/commonjs/helpers/secureFileUrl.js +101 -0
- package/lib/commonjs/helpers/secureFileUrl.js.map +1 -0
- package/lib/commonjs/helpers/secureKeyValue.js +83 -0
- package/lib/commonjs/helpers/secureKeyValue.js.map +1 -0
- package/lib/commonjs/helpers/secureStoreRuntime.js +59 -0
- package/lib/commonjs/helpers/secureStoreRuntime.js.map +1 -0
- package/lib/commonjs/helpers/secureUserStorage.js +75 -0
- package/lib/commonjs/helpers/secureUserStorage.js.map +1 -0
- package/lib/commonjs/helpers/shallowEqual.js +36 -0
- package/lib/commonjs/helpers/shallowEqual.js.map +1 -0
- package/lib/commonjs/helpers/sheetGestures.js +32 -0
- package/lib/commonjs/helpers/sheetGestures.js.map +1 -0
- package/lib/commonjs/hooks/useChatRoomFocus.js +45 -12
- package/lib/commonjs/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/commonjs/hooks/useChatWrapperInit.js +30 -10
- package/lib/commonjs/hooks/useChatWrapperInit.js.map +1 -1
- package/lib/commonjs/hooks/useComposing.js +27 -0
- package/lib/commonjs/hooks/useComposing.js.map +1 -1
- package/lib/commonjs/hooks/useFileToken.js +10 -0
- package/lib/commonjs/hooks/useFileToken.js.map +1 -0
- package/lib/commonjs/hooks/useLogout.js +23 -7
- 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 +50 -14
- package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js +6 -1
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/commonjs/i18n/strings.js +145 -37
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/main.js +44 -0
- package/lib/commonjs/main.js.map +1 -1
- package/lib/commonjs/networking/api-requests/auth.api.js +134 -60
- package/lib/commonjs/networking/api-requests/auth.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/roomMembers.api.js +1 -1
- package/lib/commonjs/networking/api-requests/roomMembers.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/rooms.api.js +9 -9
- package/lib/commonjs/networking/api-requests/rooms.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/user.api.js +68 -9
- package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
- package/lib/commonjs/networking/apiClient.js +62 -112
- package/lib/commonjs/networking/apiClient.js.map +1 -1
- package/lib/commonjs/networking/authRefresh.js +332 -0
- package/lib/commonjs/networking/authRefresh.js.map +1 -0
- package/lib/commonjs/networking/stanzaHandlers.js +41 -28
- package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
- package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js +46 -8
- package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.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 +124 -8
- package/lib/commonjs/networking/xmppClient.js.map +1 -1
- package/lib/commonjs/roomStore/chatSettingsSlice.js +26 -7
- package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/commonjs/roomStore/index.js +35 -2
- package/lib/commonjs/roomStore/index.js.map +1 -1
- package/lib/commonjs/roomStore/persistence.js +226 -23
- package/lib/commonjs/roomStore/persistence.js.map +1 -1
- package/lib/commonjs/roomStore/roomsSlice.js +151 -38
- 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/commonjs/version.js +1 -1
- package/lib/module/assets/icons.js +6 -1
- package/lib/module/assets/icons.js.map +1 -1
- package/lib/module/components/AuthForms/Login.js +4 -4
- package/lib/module/components/AuthForms/Login.js.map +1 -1
- package/lib/module/components/Header/HeaderRoomList.js +29 -8
- package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/module/components/MainComponents/ChatHeader.js +9 -3
- package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/module/components/MainComponents/ChatRoom.js +152 -16
- package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/module/components/MainComponents/ChatWrapper.js +35 -14
- package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/LoginWrapper.js +2 -1
- package/lib/module/components/MainComponents/LoginWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/MediaMessage.js +30 -10
- package/lib/module/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/module/components/MainComponents/MessageContainer.js +5 -1
- package/lib/module/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/module/components/MainComponents/MessageList.js +13 -5
- 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 +313 -113
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +549 -207
- 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 +70 -28
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/module/components/Modals/FilePreviewModal/PdfView.js +2 -1
- package/lib/module/components/Modals/FilePreviewModal/PdfView.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 -108
- 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 +555 -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 +21 -7
- package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessageFile.js +22 -3
- package/lib/module/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js +17 -3
- package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessageVideo.js +17 -3
- package/lib/module/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
- package/lib/module/components/VideoCalls/VideoCallSession.js +6 -3
- package/lib/module/components/VideoCalls/VideoCallSession.js.map +1 -1
- package/lib/module/components/styled/AudioMessage.js +2 -1
- package/lib/module/components/styled/AudioMessage.js.map +1 -1
- package/lib/module/components/styled/MessageImage.js +37 -9
- package/lib/module/components/styled/MessageImage.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/components/styled/UnsupportedType.js +14 -4
- package/lib/module/components/styled/UnsupportedType.js.map +1 -1
- package/lib/module/components/styled/VideoMessage.js +120 -62
- package/lib/module/components/styled/VideoMessage.js.map +1 -1
- package/lib/module/context/xmppProvider.js +184 -60
- package/lib/module/context/xmppProvider.js.map +1 -1
- package/lib/module/helpers/createMessageFromXml.js +19 -1
- package/lib/module/helpers/createMessageFromXml.js.map +1 -1
- package/lib/module/helpers/ensureScopedChatCache.js +2 -2
- package/lib/module/helpers/ensureScopedChatCache.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/getDisplayFileName.js +73 -0
- package/lib/module/helpers/getDisplayFileName.js.map +1 -0
- package/lib/module/helpers/getServerReadTimestamp.js +181 -0
- package/lib/module/helpers/getServerReadTimestamp.js.map +1 -0
- package/lib/module/helpers/historyPreloadScheduler.js +66 -3
- package/lib/module/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/module/helpers/initXmppRooms.js +14 -8
- package/lib/module/helpers/initXmppRooms.js.map +1 -1
- package/lib/module/helpers/insertMessageWithDelimiter.js +52 -9
- package/lib/module/helpers/insertMessageWithDelimiter.js.map +1 -1
- package/lib/module/helpers/isOwnMessage.js +70 -0
- package/lib/module/helpers/isOwnMessage.js.map +1 -0
- package/lib/module/helpers/keyboardLayout.js +12 -2
- package/lib/module/helpers/keyboardLayout.js.map +1 -1
- package/lib/module/helpers/mediaLibraryRuntime.js +25 -0
- package/lib/module/helpers/mediaLibraryRuntime.js.map +1 -0
- package/lib/module/helpers/mimeToExtension.js +6 -13
- package/lib/module/helpers/mimeToExtension.js.map +1 -1
- package/lib/module/helpers/msgSortableMs.js +32 -0
- package/lib/module/helpers/msgSortableMs.js.map +1 -0
- package/lib/module/helpers/persistCrypto.js +115 -0
- package/lib/module/helpers/persistCrypto.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/resolveInitBeforeLoadUser.js +130 -16
- package/lib/module/helpers/resolveInitBeforeLoadUser.js.map +1 -1
- package/lib/module/helpers/secureFileUrl.js +91 -0
- package/lib/module/helpers/secureFileUrl.js.map +1 -0
- package/lib/module/helpers/secureKeyValue.js +75 -0
- package/lib/module/helpers/secureKeyValue.js.map +1 -0
- package/lib/module/helpers/secureStoreRuntime.js +52 -0
- package/lib/module/helpers/secureStoreRuntime.js.map +1 -0
- package/lib/module/helpers/secureUserStorage.js +72 -0
- package/lib/module/helpers/secureUserStorage.js.map +1 -0
- package/lib/module/helpers/shallowEqual.js +31 -0
- package/lib/module/helpers/shallowEqual.js.map +1 -0
- package/lib/module/helpers/sheetGestures.js +26 -0
- package/lib/module/helpers/sheetGestures.js.map +1 -0
- package/lib/module/hooks/useChatRoomFocus.js +46 -13
- package/lib/module/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/module/hooks/useChatWrapperInit.js +30 -10
- package/lib/module/hooks/useChatWrapperInit.js.map +1 -1
- package/lib/module/hooks/useComposing.js +28 -1
- package/lib/module/hooks/useComposing.js.map +1 -1
- package/lib/module/hooks/useFileToken.js +5 -0
- package/lib/module/hooks/useFileToken.js.map +1 -0
- package/lib/module/hooks/useLogout.js +23 -7
- 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 +52 -16
- package/lib/module/hooks/useSendMessage.js.map +1 -1
- package/lib/module/hooks/useUnreadMessagesCounter.js +6 -1
- package/lib/module/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/module/i18n/strings.js +145 -37
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/main.js +14 -2
- package/lib/module/main.js.map +1 -1
- package/lib/module/networking/api-requests/auth.api.js +131 -59
- package/lib/module/networking/api-requests/auth.api.js.map +1 -1
- package/lib/module/networking/api-requests/roomMembers.api.js +1 -1
- package/lib/module/networking/api-requests/roomMembers.api.js.map +1 -1
- package/lib/module/networking/api-requests/rooms.api.js +9 -9
- package/lib/module/networking/api-requests/rooms.api.js.map +1 -1
- package/lib/module/networking/api-requests/user.api.js +64 -7
- package/lib/module/networking/api-requests/user.api.js.map +1 -1
- package/lib/module/networking/apiClient.js +61 -113
- package/lib/module/networking/apiClient.js.map +1 -1
- package/lib/module/networking/authRefresh.js +321 -0
- package/lib/module/networking/authRefresh.js.map +1 -0
- package/lib/module/networking/stanzaHandlers.js +41 -28
- package/lib/module/networking/stanzaHandlers.js.map +1 -1
- package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js +46 -8
- package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.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 +124 -8
- package/lib/module/networking/xmppClient.js.map +1 -1
- package/lib/module/roomStore/chatSettingsSlice.js +26 -7
- package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/module/roomStore/index.js +37 -4
- package/lib/module/roomStore/index.js.map +1 -1
- package/lib/module/roomStore/persistence.js +223 -22
- package/lib/module/roomStore/persistence.js.map +1 -1
- package/lib/module/roomStore/roomsSlice.js +139 -34
- 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/module/version.js +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/AuthForms/Login.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/LoginWrapper.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MediaMessage.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MessageContainer.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MessageList.d.ts +10 -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/FilePreviewModal/PdfView.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/RoomComponents/styled/LastMessageFile.d.ts +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageFile.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessagePhoto.d.ts +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessagePhoto.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageVideo.d.ts +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageVideo.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/VideoCallSession.d.ts.map +1 -1
- package/lib/typescript/components/styled/AudioMessage.d.ts.map +1 -1
- package/lib/typescript/components/styled/MessageImage.d.ts +14 -0
- package/lib/typescript/components/styled/MessageImage.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/components/styled/UnsupportedType.d.ts.map +1 -1
- package/lib/typescript/components/styled/VideoMessage.d.ts +8 -0
- package/lib/typescript/components/styled/VideoMessage.d.ts.map +1 -1
- package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
- package/lib/typescript/helpers/createMessageFromXml.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/getDisplayFileName.d.ts +49 -0
- package/lib/typescript/helpers/getDisplayFileName.d.ts.map +1 -0
- package/lib/typescript/helpers/getServerReadTimestamp.d.ts +108 -0
- package/lib/typescript/helpers/getServerReadTimestamp.d.ts.map +1 -0
- package/lib/typescript/helpers/historyPreloadScheduler.d.ts.map +1 -1
- package/lib/typescript/helpers/initXmppRooms.d.ts.map +1 -1
- package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts +1 -1
- package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts.map +1 -1
- package/lib/typescript/helpers/isOwnMessage.d.ts +36 -0
- package/lib/typescript/helpers/isOwnMessage.d.ts.map +1 -0
- package/lib/typescript/helpers/keyboardLayout.d.ts +5 -1
- package/lib/typescript/helpers/keyboardLayout.d.ts.map +1 -1
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts +3 -0
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts.map +1 -0
- package/lib/typescript/helpers/mimeToExtension.d.ts +0 -15
- package/lib/typescript/helpers/mimeToExtension.d.ts.map +1 -1
- package/lib/typescript/helpers/msgSortableMs.d.ts +2 -0
- package/lib/typescript/helpers/msgSortableMs.d.ts.map +1 -0
- package/lib/typescript/helpers/persistCrypto.d.ts +13 -0
- package/lib/typescript/helpers/persistCrypto.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/resolveInitBeforeLoadUser.d.ts.map +1 -1
- package/lib/typescript/helpers/secureFileUrl.d.ts +7 -0
- package/lib/typescript/helpers/secureFileUrl.d.ts.map +1 -0
- package/lib/typescript/helpers/secureKeyValue.d.ts +13 -0
- package/lib/typescript/helpers/secureKeyValue.d.ts.map +1 -0
- package/lib/typescript/helpers/secureStoreRuntime.d.ts +29 -0
- package/lib/typescript/helpers/secureStoreRuntime.d.ts.map +1 -0
- package/lib/typescript/helpers/secureUserStorage.d.ts +23 -0
- package/lib/typescript/helpers/secureUserStorage.d.ts.map +1 -0
- package/lib/typescript/helpers/shallowEqual.d.ts +11 -0
- package/lib/typescript/helpers/shallowEqual.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/hooks/useChatRoomFocus.d.ts +4 -1
- package/lib/typescript/hooks/useChatRoomFocus.d.ts.map +1 -1
- package/lib/typescript/hooks/useChatWrapperInit.d.ts.map +1 -1
- package/lib/typescript/hooks/useComposing.d.ts.map +1 -1
- package/lib/typescript/hooks/useFileToken.d.ts +2 -0
- package/lib/typescript/hooks/useFileToken.d.ts.map +1 -0
- 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/hooks/useUnreadMessagesCounter.d.ts +1 -0
- package/lib/typescript/hooks/useUnreadMessagesCounter.d.ts.map +1 -1
- package/lib/typescript/i18n/strings.d.ts.map +1 -1
- package/lib/typescript/main.d.ts +9 -2
- package/lib/typescript/main.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/auth.api.d.ts +3 -1
- package/lib/typescript/networking/api-requests/auth.api.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/apiClient.d.ts +12 -6
- package/lib/typescript/networking/apiClient.d.ts.map +1 -1
- package/lib/typescript/networking/authRefresh.d.ts +95 -0
- package/lib/typescript/networking/authRefresh.d.ts.map +1 -0
- package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts +10 -2
- package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.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 +14 -0
- package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts +16 -0
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
- package/lib/typescript/roomStore/index.d.ts.map +1 -1
- package/lib/typescript/roomStore/persistence.d.ts +18 -1
- package/lib/typescript/roomStore/persistence.d.ts.map +1 -1
- package/lib/typescript/roomStore/roomsSlice.d.ts +43 -3
- 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/types.d.ts +50 -5
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +41 -28
- package/src/assets/icons.tsx +48 -9
- package/src/components/AuthForms/Login.tsx +3 -3
- package/src/components/Header/HeaderRoomList.tsx +29 -7
- package/src/components/MainComponents/ChatHeader.tsx +9 -3
- package/src/components/MainComponents/ChatRoom.tsx +161 -15
- package/src/components/MainComponents/ChatWrapper.tsx +36 -20
- package/src/components/MainComponents/LoginWrapper.tsx +1 -0
- package/src/components/MainComponents/MediaMessage.tsx +26 -8
- package/src/components/MainComponents/MessageContainer.tsx +5 -1
- package/src/components/MainComponents/MessageList.tsx +23 -4
- 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 +333 -97
- package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +600 -282
- package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +244 -0
- package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +79 -38
- package/src/components/Modals/FilePreviewModal/PdfView.tsx +2 -1
- 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 -119
- package/src/components/Modals/NewChatModal/UpdNewChatModal.tsx +12 -1
- package/src/components/Modals/ProfileHeader/ProfileHeader.tsx +624 -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 +18 -3
- package/src/components/RoomComponents/styled/LastMessageFile.tsx +28 -4
- package/src/components/RoomComponents/styled/LastMessagePhoto.tsx +18 -3
- package/src/components/RoomComponents/styled/LastMessageVideo.tsx +18 -3
- package/src/components/VideoCalls/VideoCallSession.tsx +8 -3
- package/src/components/styled/AudioMessage.tsx +2 -1
- package/src/components/styled/MessageImage.tsx +53 -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/components/styled/UnsupportedType.tsx +14 -4
- package/src/components/styled/VideoMessage.tsx +131 -54
- package/src/context/xmppProvider.tsx +216 -57
- package/src/helpers/createMessageFromXml.ts +20 -1
- package/src/helpers/ensureScopedChatCache.ts +2 -2
- package/src/helpers/getChatBackground.ts +18 -0
- package/src/helpers/getDisplayFileName.ts +87 -0
- package/src/helpers/getServerReadTimestamp.ts +197 -0
- package/src/helpers/historyPreloadScheduler.ts +80 -3
- package/src/helpers/initXmppRooms.tsx +14 -10
- package/src/helpers/insertMessageWithDelimiter.ts +55 -19
- package/src/helpers/isOwnMessage.ts +90 -0
- package/src/helpers/keyboardLayout.ts +23 -2
- package/src/helpers/mediaLibraryRuntime.ts +25 -0
- package/src/helpers/mimeToExtension.ts +6 -22
- package/src/helpers/msgSortableMs.ts +25 -0
- package/src/helpers/persistCrypto.ts +127 -0
- package/src/helpers/pickImageAsset.ts +68 -0
- package/src/helpers/pushPayload.ts +62 -0
- package/src/helpers/resolveInitBeforeLoadUser.ts +125 -18
- package/src/helpers/secureFileUrl.ts +103 -0
- package/src/helpers/secureKeyValue.ts +80 -0
- package/src/helpers/secureStoreRuntime.ts +62 -0
- package/src/helpers/secureUserStorage.ts +80 -0
- package/src/helpers/shallowEqual.ts +33 -0
- package/src/helpers/sheetGestures.ts +25 -0
- package/src/hooks/useChatRoomFocus.ts +49 -9
- package/src/hooks/useChatWrapperInit.ts +30 -10
- package/src/hooks/useComposing.tsx +37 -1
- package/src/hooks/useFileToken.ts +7 -0
- package/src/hooks/useLogout.tsx +29 -9
- package/src/hooks/usePendingNotification.ts +5 -11
- package/src/hooks/useSendMessage.tsx +60 -15
- package/src/hooks/useUnreadMessagesCounter.ts +11 -0
- package/src/i18n/strings.ts +145 -37
- package/src/main.ts +26 -2
- package/src/networking/api-requests/auth.api.ts +156 -48
- package/src/networking/api-requests/roomMembers.api.ts +1 -1
- package/src/networking/api-requests/rooms.api.ts +9 -9
- package/src/networking/api-requests/user.api.ts +79 -7
- package/src/networking/apiClient.ts +68 -123
- package/src/networking/authRefresh.ts +451 -0
- package/src/networking/stanzaHandlers.ts +44 -28
- package/src/networking/xmpp/flushLastViewedToPrivateStore.ts +71 -10
- package/src/networking/xmpp/presenceInRoom.xmpp.ts +6 -1
- package/src/networking/xmpp/subscribeToRoomMessages.xmpp.ts +12 -1
- package/src/networking/xmppClient.ts +141 -9
- package/src/roomStore/chatSettingsSlice.ts +34 -10
- package/src/roomStore/index.ts +40 -4
- package/src/roomStore/persistence.ts +234 -24
- package/src/roomStore/roomsSlice.ts +161 -29
- package/src/services/pushSubscriptionService.ts +18 -13
- package/src/types/types.ts +72 -5
- package/src/version.ts +1 -1
|
@@ -69,27 +69,27 @@ export const ProfileImagePlaceholder: React.FC<
|
|
|
69
69
|
if (words.length === 0) {return '';}
|
|
70
70
|
|
|
71
71
|
if (words.length >= 2) {
|
|
72
|
-
const firstLetter = /^[
|
|
72
|
+
const firstLetter = /^[\p{L}\p{N}]$/u.test(words[0]?.[0] || '')
|
|
73
73
|
? words[0][0].toUpperCase()
|
|
74
74
|
: '';
|
|
75
|
-
const secondLetter = /^[
|
|
75
|
+
const secondLetter = /^[\p{L}\p{N}]$/u.test(words[1]?.[0] || '')
|
|
76
76
|
? words[1][0].toUpperCase()
|
|
77
77
|
: '';
|
|
78
78
|
return firstLetter + secondLetter;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
if (words.length === 1 && words[0].length >= 2) {
|
|
82
|
-
const firstLetter = /^[
|
|
82
|
+
const firstLetter = /^[\p{L}\p{N}]$/u.test(words[0][0] || '')
|
|
83
83
|
? words[0][0].toUpperCase()
|
|
84
84
|
: '';
|
|
85
|
-
const secondLetter = /^[
|
|
85
|
+
const secondLetter = /^[\p{L}\p{N}]$/u.test(words[0][1] || '')
|
|
86
86
|
? words[0][1].toUpperCase()
|
|
87
87
|
: '';
|
|
88
88
|
return firstLetter + secondLetter;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
if (words.length === 1 && words[0].length === 1) {
|
|
92
|
-
return /^[
|
|
92
|
+
return /^[\p{L}\p{N}]$/u.test(words[0][0] || '')
|
|
93
93
|
? words[0][0].toUpperCase()
|
|
94
94
|
: '';
|
|
95
95
|
}
|
|
@@ -97,16 +97,26 @@ export const ProfileImagePlaceholder: React.FC<
|
|
|
97
97
|
return '';
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
-
const getInitials = () =>
|
|
100
|
+
const getInitials = () =>
|
|
101
|
+
!imageSource && name ? getTwoUppercaseLetters(name) : '';
|
|
102
|
+
|
|
103
|
+
const imageSource =
|
|
104
|
+
typeof icon === 'string' && icon
|
|
105
|
+
? { uri: icon }
|
|
106
|
+
: typeof icon === 'number'
|
|
107
|
+
? icon
|
|
108
|
+
: icon && typeof (icon as any).uri === 'string' && (icon as any).uri
|
|
109
|
+
? (icon as any)
|
|
110
|
+
: null;
|
|
101
111
|
|
|
102
112
|
return (
|
|
103
113
|
<Wrapper
|
|
104
|
-
bgColor={
|
|
114
|
+
bgColor={imageSource ? 'transparent' : backgroundColor?.backgroundColor}
|
|
105
115
|
size={size}
|
|
106
116
|
isClickable={active || !!upload?.active}
|
|
107
117
|
>
|
|
108
118
|
<AvatarCircle
|
|
109
|
-
bgColor={
|
|
119
|
+
bgColor={imageSource ? 'transparent' : backgroundColor?.backgroundColor}
|
|
110
120
|
size={size}
|
|
111
121
|
isClickable={active || !!upload?.active}
|
|
112
122
|
onPress={
|
|
@@ -117,11 +127,8 @@ export const ProfileImagePlaceholder: React.FC<
|
|
|
117
127
|
: undefined
|
|
118
128
|
}
|
|
119
129
|
>
|
|
120
|
-
{
|
|
121
|
-
<AvatarImage
|
|
122
|
-
source={typeof icon === 'string' ? { uri: icon } : icon as any}
|
|
123
|
-
size={size}
|
|
124
|
-
/>
|
|
130
|
+
{imageSource ? (
|
|
131
|
+
<AvatarImage source={imageSource} size={size} />
|
|
125
132
|
) : placeholderIcon ? (
|
|
126
133
|
placeholderIcon
|
|
127
134
|
) : (
|
|
@@ -140,7 +147,7 @@ export const ProfileImagePlaceholder: React.FC<
|
|
|
140
147
|
</Overlay>
|
|
141
148
|
)}
|
|
142
149
|
</AvatarCircle>
|
|
143
|
-
{remove?.enabled &&
|
|
150
|
+
{remove?.enabled && imageSource && role !== 'participant' && (
|
|
144
151
|
<RemoveButton onPress={remove.onRemoveClick}>
|
|
145
152
|
<RemoveButtonText>×</RemoveButtonText>
|
|
146
153
|
</RemoveButton>
|
|
@@ -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
|
|