@ethora/chat-component-rn 26.8.1 → 26.8.3
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 +110 -0
- package/README.md +70 -11
- package/lib/commonjs/assets/EmptyChatIllustration.js +7 -6
- package/lib/commonjs/assets/EmptyChatIllustration.js.map +1 -1
- package/lib/commonjs/assets/icons.js +7 -2
- package/lib/commonjs/assets/icons.js.map +1 -1
- package/lib/commonjs/components/AuthForms/Login.js +27 -12
- package/lib/commonjs/components/AuthForms/Login.js.map +1 -1
- package/lib/commonjs/components/ContextMenu/ContextMenuComponents.js +12 -4
- package/lib/commonjs/components/ContextMenu/ContextMenuComponents.js.map +1 -1
- package/lib/commonjs/components/DropdownMenu/DropdownMenu.js +16 -9
- package/lib/commonjs/components/DropdownMenu/DropdownMenu.js.map +1 -1
- package/lib/commonjs/components/ExampleComponents/CustomMessage.js +25 -7
- package/lib/commonjs/components/ExampleComponents/CustomMessage.js.map +1 -1
- package/lib/commonjs/components/ExampleComponents/CustomTypingIndicatorExamples.js +18 -6
- package/lib/commonjs/components/ExampleComponents/CustomTypingIndicatorExamples.js.map +1 -1
- package/lib/commonjs/components/Header/HeaderRoomList.js +34 -10
- package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/commonjs/components/InputComponents/Search.js +13 -4
- package/lib/commonjs/components/InputComponents/Search.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatHeader.js +18 -6
- package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatRoom.js +154 -15
- package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatWrapper.js +42 -19
- package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/LanguageSelectorModal.js +37 -10
- package/lib/commonjs/components/MainComponents/LanguageSelectorModal.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 +72 -28
- 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 +22 -8
- 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/RNStyled.js +12 -4
- package/lib/commonjs/components/MainComponents/RNStyled.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ReduxWrapper.js +25 -8
- package/lib/commonjs/components/MainComponents/ReduxWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/RoomList.js +214 -38
- package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/Select.js +29 -8
- package/lib/commonjs/components/MainComponents/Select.js.map +1 -1
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js +329 -99
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/BottomReplyContainer.js +24 -8
- package/lib/commonjs/components/MessageBubble/BottomReplyContainer.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/Message.js +46 -24
- package/lib/commonjs/components/MessageBubble/Message.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/MessageInteractions.js +15 -4
- package/lib/commonjs/components/MessageBubble/MessageInteractions.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/MessageReaction.js +10 -5
- package/lib/commonjs/components/MessageBubble/MessageReaction.js.map +1 -1
- package/lib/commonjs/components/Modals/AddMembersModal/AddMembersModal.js +1 -5
- package/lib/commonjs/components/Modals/AddMembersModal/AddMembersModal.js.map +1 -1
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +345 -118
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +599 -203
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/DeleteChatModal.js +5 -7
- package/lib/commonjs/components/Modals/ChatProfileModal/DeleteChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +230 -0
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -0
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +89 -36
- 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/ModalHeaderComponent.js +8 -2
- package/lib/commonjs/components/Modals/ModalHeaderComponent.js.map +1 -1
- package/lib/commonjs/components/Modals/ModalWrapper/ModalWrapper.js +8 -8
- package/lib/commonjs/components/Modals/ModalWrapper/ModalWrapper.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js +3 -6
- package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js +205 -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 +215 -0
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js.map +1 -0
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js +7 -9
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/commonjs/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js +8 -6
- package/lib/commonjs/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js.map +1 -1
- package/lib/commonjs/components/Modals/SettingsModals/Referrals/Referrals.js +7 -2
- package/lib/commonjs/components/Modals/SettingsModals/Referrals/Referrals.js.map +1 -1
- package/lib/commonjs/components/Modals/SettingsModals/SharedStyledComponents.js +7 -3
- package/lib/commonjs/components/Modals/SettingsModals/SharedStyledComponents.js.map +1 -1
- package/lib/commonjs/components/Modals/SettingsModals/Visibility/RadioInput.js +10 -6
- package/lib/commonjs/components/Modals/SettingsModals/Visibility/RadioInput.js.map +1 -1
- package/lib/commonjs/components/Modals/SettingsModals/Visibility/VisibilityModal.js +7 -6
- package/lib/commonjs/components/Modals/SettingsModals/Visibility/VisibilityModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js +10 -22
- package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +510 -244
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +77 -46
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/commonjs/components/Modals/styledModalComponents.js +68 -17
- package/lib/commonjs/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +30 -10
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastAudioMessage.js +6 -2
- package/lib/commonjs/components/RoomComponents/styled/LastAudioMessage.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/RoomComponents/styled/StyledRoomComponents.js +6 -0
- package/lib/commonjs/components/RoomComponents/styled/StyledRoomComponents.js.map +1 -1
- package/lib/commonjs/components/Thread/ThreadWrapper.js +9 -2
- package/lib/commonjs/components/Thread/ThreadWrapper.js.map +1 -1
- package/lib/commonjs/components/Toast/Toast.js +3 -1
- package/lib/commonjs/components/Toast/Toast.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 +18 -12
- package/lib/commonjs/components/styled/AudioMessage.js.map +1 -1
- package/lib/commonjs/components/styled/Button.js +18 -9
- package/lib/commonjs/components/styled/Button.js.map +1 -1
- package/lib/commonjs/components/styled/DateLabel.js +8 -5
- package/lib/commonjs/components/styled/DateLabel.js.map +1 -1
- package/lib/commonjs/components/styled/MediaModal.js +27 -21
- package/lib/commonjs/components/styled/MediaModal.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/RoomListComponents/index.js +60 -38
- package/lib/commonjs/components/styled/RoomListComponents/index.js.map +1 -1
- package/lib/commonjs/components/styled/SendInput.js +93 -19
- package/lib/commonjs/components/styled/SendInput.js.map +1 -1
- package/lib/commonjs/components/styled/StyledComponents.js +75 -25
- package/lib/commonjs/components/styled/StyledComponents.js.map +1 -1
- package/lib/commonjs/components/styled/StyledInput.js +32 -18
- package/lib/commonjs/components/styled/StyledInput.js.map +1 -1
- package/lib/commonjs/components/styled/StyledInputComponents/CustomTypingIndicator.js +13 -8
- package/lib/commonjs/components/styled/StyledInputComponents/CustomTypingIndicator.js.map +1 -1
- package/lib/commonjs/components/styled/StyledInputComponents/MediaComponents.js +20 -9
- package/lib/commonjs/components/styled/StyledInputComponents/MediaComponents.js.map +1 -1
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js +50 -22
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/commonjs/components/styled/TreadLabel.js +6 -3
- package/lib/commonjs/components/styled/TreadLabel.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/MessageNotificationContext.js +14 -3
- package/lib/commonjs/context/MessageNotificationContext.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 +26 -0
- package/lib/commonjs/helpers/getChatBackground.js.map +1 -0
- package/lib/commonjs/helpers/getDateLabelColor.js +3 -1
- package/lib/commonjs/helpers/getDateLabelColor.js.map +1 -1
- package/lib/commonjs/helpers/getDisplayFileName.js +79 -0
- package/lib/commonjs/helpers/getDisplayFileName.js.map +1 -0
- package/lib/commonjs/helpers/getIconColor.js +4 -1
- package/lib/commonjs/helpers/getIconColor.js.map +1 -1
- package/lib/commonjs/helpers/getSenderNameColor.js +3 -1
- package/lib/commonjs/helpers/getSenderNameColor.js.map +1 -1
- 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/markdownParser.js +27 -5
- package/lib/commonjs/helpers/markdownParser.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/parseMessageBody.js +82 -24
- package/lib/commonjs/helpers/parseMessageBody.js.map +1 -1
- 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/useCustomTypingIndicator.js +7 -3
- package/lib/commonjs/hooks/useCustomTypingIndicator.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 +33 -10
- 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/useTheme.js +35 -0
- package/lib/commonjs/hooks/useTheme.js.map +1 -0
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js +6 -1
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/commonjs/i18n/strings.js +163 -37
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/main.js +119 -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/push.api.js +130 -45
- package/lib/commonjs/networking/api-requests/push.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 +22 -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/pushRegistration.js +250 -0
- package/lib/commonjs/services/pushRegistration.js.map +1 -0
- package/lib/commonjs/services/pushSubscriptionService.js +15 -37
- package/lib/commonjs/services/pushSubscriptionService.js.map +1 -1
- package/lib/commonjs/theme/index.js +38 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/commonjs/theme/styled.d.js +4 -0
- package/lib/commonjs/theme/styled.d.js.map +1 -0
- package/lib/commonjs/theme/theme.js +137 -0
- package/lib/commonjs/theme/theme.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/module/assets/EmptyChatIllustration.js +7 -6
- package/lib/module/assets/EmptyChatIllustration.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/AuthForms/Login.js +27 -12
- package/lib/module/components/AuthForms/Login.js.map +1 -1
- package/lib/module/components/ContextMenu/ContextMenuComponents.js +12 -4
- package/lib/module/components/ContextMenu/ContextMenuComponents.js.map +1 -1
- package/lib/module/components/DropdownMenu/DropdownMenu.js +16 -9
- package/lib/module/components/DropdownMenu/DropdownMenu.js.map +1 -1
- package/lib/module/components/ExampleComponents/CustomMessage.js +25 -7
- package/lib/module/components/ExampleComponents/CustomMessage.js.map +1 -1
- package/lib/module/components/ExampleComponents/CustomTypingIndicatorExamples.js +18 -6
- package/lib/module/components/ExampleComponents/CustomTypingIndicatorExamples.js.map +1 -1
- package/lib/module/components/Header/HeaderRoomList.js +34 -10
- package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/module/components/InputComponents/Search.js +13 -4
- package/lib/module/components/InputComponents/Search.js.map +1 -1
- package/lib/module/components/MainComponents/ChatHeader.js +18 -6
- package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/module/components/MainComponents/ChatRoom.js +156 -17
- package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/module/components/MainComponents/ChatWrapper.js +43 -20
- package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/LanguageSelectorModal.js +37 -10
- package/lib/module/components/MainComponents/LanguageSelectorModal.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 +72 -29
- 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 +22 -8
- 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/RNStyled.js +12 -4
- package/lib/module/components/MainComponents/RNStyled.js.map +1 -1
- package/lib/module/components/MainComponents/ReduxWrapper.js +25 -8
- package/lib/module/components/MainComponents/ReduxWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/RoomList.js +213 -38
- package/lib/module/components/MainComponents/RoomList.js.map +1 -1
- package/lib/module/components/MainComponents/Select.js +29 -8
- package/lib/module/components/MainComponents/Select.js.map +1 -1
- package/lib/module/components/Menu/HeaderRoomListMenu.js +331 -102
- package/lib/module/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/module/components/MessageBubble/BottomReplyContainer.js +24 -8
- package/lib/module/components/MessageBubble/BottomReplyContainer.js.map +1 -1
- package/lib/module/components/MessageBubble/Message.js +47 -25
- package/lib/module/components/MessageBubble/Message.js.map +1 -1
- package/lib/module/components/MessageBubble/MessageInteractions.js +15 -4
- package/lib/module/components/MessageBubble/MessageInteractions.js.map +1 -1
- package/lib/module/components/MessageBubble/MessageReaction.js +10 -5
- package/lib/module/components/MessageBubble/MessageReaction.js.map +1 -1
- package/lib/module/components/Modals/AddMembersModal/AddMembersModal.js +2 -6
- package/lib/module/components/Modals/AddMembersModal/AddMembersModal.js.map +1 -1
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js +336 -121
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +603 -208
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/DeleteChatModal.js +6 -8
- package/lib/module/components/Modals/ChatProfileModal/DeleteChatModal.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +225 -0
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -0
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +90 -37
- 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/ModalHeaderComponent.js +8 -2
- package/lib/module/components/Modals/ModalHeaderComponent.js.map +1 -1
- package/lib/module/components/Modals/ModalWrapper/ModalWrapper.js +10 -10
- package/lib/module/components/Modals/ModalWrapper/ModalWrapper.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/ModalContent.js +4 -7
- package/lib/module/components/Modals/NewChatModal/ModalContent.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js +208 -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 +210 -0
- package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js.map +1 -0
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js +8 -10
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/module/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js +8 -6
- package/lib/module/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js.map +1 -1
- package/lib/module/components/Modals/SettingsModals/Referrals/Referrals.js +7 -2
- package/lib/module/components/Modals/SettingsModals/Referrals/Referrals.js.map +1 -1
- package/lib/module/components/Modals/SettingsModals/SharedStyledComponents.js +7 -3
- package/lib/module/components/Modals/SettingsModals/SharedStyledComponents.js.map +1 -1
- package/lib/module/components/Modals/SettingsModals/Visibility/RadioInput.js +10 -6
- package/lib/module/components/Modals/SettingsModals/Visibility/RadioInput.js.map +1 -1
- package/lib/module/components/Modals/SettingsModals/Visibility/VisibilityModal.js +7 -6
- package/lib/module/components/Modals/SettingsModals/Visibility/VisibilityModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/EditUserModal.js +11 -24
- package/lib/module/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +512 -248
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +79 -48
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/module/components/Modals/styledModalComponents.js +67 -16
- package/lib/module/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/module/components/RoomComponents/ChatRoomItem.js +30 -10
- package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastAudioMessage.js +6 -2
- package/lib/module/components/RoomComponents/styled/LastAudioMessage.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/RoomComponents/styled/StyledRoomComponents.js +6 -0
- package/lib/module/components/RoomComponents/styled/StyledRoomComponents.js.map +1 -1
- package/lib/module/components/Thread/ThreadWrapper.js +9 -2
- package/lib/module/components/Thread/ThreadWrapper.js.map +1 -1
- package/lib/module/components/Toast/Toast.js +3 -1
- package/lib/module/components/Toast/Toast.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 +18 -12
- package/lib/module/components/styled/AudioMessage.js.map +1 -1
- package/lib/module/components/styled/Button.js +17 -9
- package/lib/module/components/styled/Button.js.map +1 -1
- package/lib/module/components/styled/DateLabel.js +8 -5
- package/lib/module/components/styled/DateLabel.js.map +1 -1
- package/lib/module/components/styled/MediaModal.js +29 -23
- package/lib/module/components/styled/MediaModal.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/RoomListComponents/index.js +62 -39
- package/lib/module/components/styled/RoomListComponents/index.js.map +1 -1
- package/lib/module/components/styled/SendInput.js +94 -20
- package/lib/module/components/styled/SendInput.js.map +1 -1
- package/lib/module/components/styled/StyledComponents.js +75 -25
- package/lib/module/components/styled/StyledComponents.js.map +1 -1
- package/lib/module/components/styled/StyledInput.js +32 -18
- package/lib/module/components/styled/StyledInput.js.map +1 -1
- package/lib/module/components/styled/StyledInputComponents/CustomTypingIndicator.js +13 -8
- package/lib/module/components/styled/StyledInputComponents/CustomTypingIndicator.js.map +1 -1
- package/lib/module/components/styled/StyledInputComponents/MediaComponents.js +20 -9
- package/lib/module/components/styled/StyledInputComponents/MediaComponents.js.map +1 -1
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js +50 -22
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/module/components/styled/TreadLabel.js +6 -3
- package/lib/module/components/styled/TreadLabel.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/MessageNotificationContext.js +14 -3
- package/lib/module/context/MessageNotificationContext.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 +22 -0
- package/lib/module/helpers/getChatBackground.js.map +1 -0
- package/lib/module/helpers/getDateLabelColor.js +4 -1
- package/lib/module/helpers/getDateLabelColor.js.map +1 -1
- package/lib/module/helpers/getDisplayFileName.js +73 -0
- package/lib/module/helpers/getDisplayFileName.js.map +1 -0
- package/lib/module/helpers/getIconColor.js +5 -1
- package/lib/module/helpers/getIconColor.js.map +1 -1
- package/lib/module/helpers/getSenderNameColor.js +4 -1
- package/lib/module/helpers/getSenderNameColor.js.map +1 -1
- 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/markdownParser.js +27 -5
- package/lib/module/helpers/markdownParser.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/parseMessageBody.js +82 -24
- package/lib/module/helpers/parseMessageBody.js.map +1 -1
- 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/useCustomTypingIndicator.js +8 -3
- package/lib/module/hooks/useCustomTypingIndicator.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 +33 -10
- 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/useTheme.js +30 -0
- package/lib/module/hooks/useTheme.js.map +1 -0
- package/lib/module/hooks/useUnreadMessagesCounter.js +6 -1
- package/lib/module/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/module/i18n/strings.js +163 -37
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/main.js +17 -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/push.api.js +119 -45
- package/lib/module/networking/api-requests/push.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 +21 -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/pushRegistration.js +239 -0
- package/lib/module/services/pushRegistration.js.map +1 -0
- package/lib/module/services/pushSubscriptionService.js +15 -37
- package/lib/module/services/pushSubscriptionService.js.map +1 -1
- package/lib/module/theme/index.js +7 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/theme/styled.d.js +6 -0
- package/lib/module/theme/styled.d.js.map +1 -0
- package/lib/module/theme/theme.js +131 -0
- package/lib/module/theme/theme.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/typescript/assets/EmptyChatIllustration.d.ts +1 -0
- package/lib/typescript/assets/EmptyChatIllustration.d.ts.map +1 -1
- package/lib/typescript/assets/icons.d.ts +24 -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/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/lib/typescript/components/ExampleComponents/CustomMessage.d.ts.map +1 -1
- package/lib/typescript/components/Header/HeaderRoomList.d.ts.map +1 -1
- package/lib/typescript/components/InputComponents/Search.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/LanguageSelectorModal.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/ReduxWrapper.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/MainComponents/Select.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/MessageBubble/BottomReplyContainer.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/Message.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/MessageInteractions.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/MessageReaction.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/DeleteChatModal.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/ModalHeaderComponent.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ModalWrapper/ModalWrapper.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/SettingsModals/ManageDataModal/ManageDataModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/SettingsModals/Referrals/Referrals.d.ts.map +1 -1
- package/lib/typescript/components/Modals/SettingsModals/SharedStyledComponents.d.ts +2 -2
- package/lib/typescript/components/Modals/SettingsModals/SharedStyledComponents.d.ts.map +1 -1
- package/lib/typescript/components/Modals/SettingsModals/Visibility/RadioInput.d.ts.map +1 -1
- package/lib/typescript/components/Modals/SettingsModals/Visibility/VisibilityModal.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 +2 -0
- 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/LastAudioMessage.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/RoomComponents/styled/StyledRoomComponents.d.ts.map +1 -1
- package/lib/typescript/components/Thread/ThreadWrapper.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/Button.d.ts.map +1 -1
- package/lib/typescript/components/styled/DateLabel.d.ts.map +1 -1
- package/lib/typescript/components/styled/MediaModal.d.ts +2 -2
- package/lib/typescript/components/styled/MediaModal.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/RoomListComponents/index.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/StyledInput.d.ts.map +1 -1
- package/lib/typescript/components/styled/StyledInputComponents/MediaComponents.d.ts.map +1 -1
- package/lib/typescript/components/styled/StyledInputComponents/StyledInputComponents.d.ts.map +1 -1
- package/lib/typescript/components/styled/TreadLabel.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/MessageNotificationContext.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/getAvatarColor.d.ts +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/getDateLabelColor.d.ts +3 -7
- package/lib/typescript/helpers/getDateLabelColor.d.ts.map +1 -1
- package/lib/typescript/helpers/getDisplayFileName.d.ts +49 -0
- package/lib/typescript/helpers/getDisplayFileName.d.ts.map +1 -0
- package/lib/typescript/helpers/getIconColor.d.ts +4 -7
- package/lib/typescript/helpers/getIconColor.d.ts.map +1 -1
- package/lib/typescript/helpers/getSenderNameColor.d.ts +3 -7
- package/lib/typescript/helpers/getSenderNameColor.d.ts.map +1 -1
- 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/markdownParser.d.ts +8 -1
- package/lib/typescript/helpers/markdownParser.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/parseMessageBody.d.ts +8 -1
- package/lib/typescript/helpers/parseMessageBody.d.ts.map +1 -1
- 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/useCustomTypingIndicator.d.ts +2 -0
- package/lib/typescript/hooks/useCustomTypingIndicator.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/useTheme.d.ts +16 -0
- package/lib/typescript/hooks/useTheme.d.ts.map +1 -0
- 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 +16 -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/push.api.d.ts +46 -3
- package/lib/typescript/networking/api-requests/push.api.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/rooms.api.d.ts +1 -0
- package/lib/typescript/networking/api-requests/rooms.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/pushRegistration.d.ts +21 -0
- package/lib/typescript/services/pushRegistration.d.ts.map +1 -0
- package/lib/typescript/services/pushSubscriptionService.d.ts +1 -5
- package/lib/typescript/services/pushSubscriptionService.d.ts.map +1 -1
- package/lib/typescript/theme/index.d.ts +5 -0
- package/lib/typescript/theme/index.d.ts.map +1 -0
- package/lib/typescript/theme/theme.d.ts +113 -0
- package/lib/typescript/theme/theme.d.ts.map +1 -0
- package/lib/typescript/types/models/room.model.d.ts +1 -0
- package/lib/typescript/types/models/room.model.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +70 -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/EmptyChatIllustration.tsx +7 -5
- package/src/assets/icons.tsx +72 -9
- package/src/components/AuthForms/Login.tsx +14 -12
- package/src/components/ContextMenu/ContextMenuComponents.tsx +4 -4
- package/src/components/DropdownMenu/DropdownMenu.tsx +14 -6
- package/src/components/ExampleComponents/CustomMessage.tsx +9 -8
- package/src/components/ExampleComponents/CustomTypingIndicatorExamples.tsx +6 -6
- package/src/components/Header/HeaderRoomList.tsx +35 -8
- package/src/components/InputComponents/Search.tsx +7 -4
- package/src/components/MainComponents/ChatHeader.tsx +18 -6
- package/src/components/MainComponents/ChatRoom.tsx +164 -15
- package/src/components/MainComponents/ChatWrapper.tsx +44 -26
- package/src/components/MainComponents/LanguageSelectorModal.tsx +33 -7
- package/src/components/MainComponents/LoginWrapper.tsx +1 -0
- package/src/components/MainComponents/MediaMessage.tsx +63 -26
- package/src/components/MainComponents/MessageContainer.tsx +5 -1
- package/src/components/MainComponents/MessageList.tsx +36 -7
- package/src/components/MainComponents/ProfileImagePlaceholder.tsx +21 -14
- package/src/components/MainComponents/RNStyled.tsx +4 -4
- package/src/components/MainComponents/ReduxWrapper.tsx +23 -7
- package/src/components/MainComponents/RoomList.tsx +243 -40
- package/src/components/MainComponents/Select.tsx +13 -8
- package/src/components/Menu/HeaderRoomListMenu.tsx +347 -77
- package/src/components/MessageBubble/BottomReplyContainer.tsx +16 -11
- package/src/components/MessageBubble/Message.tsx +48 -25
- package/src/components/MessageBubble/MessageInteractions.tsx +17 -4
- package/src/components/MessageBubble/MessageReaction.tsx +9 -4
- package/src/components/Modals/AddMembersModal/AddMembersModal.tsx +2 -2
- package/src/components/Modals/AttachSheet/AttachSheet.tsx +376 -106
- package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +639 -283
- package/src/components/Modals/ChatProfileModal/DeleteChatModal.tsx +6 -4
- package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +248 -0
- package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +93 -47
- package/src/components/Modals/FilePreviewModal/PdfView.tsx +2 -1
- package/src/components/Modals/Modal/Modal.tsx +7 -0
- package/src/components/Modals/ModalHeaderComponent.tsx +9 -2
- package/src/components/Modals/ModalWrapper/ModalWrapper.tsx +14 -6
- package/src/components/Modals/NewChatModal/ModalContent.tsx +8 -5
- package/src/components/Modals/NewChatModal/NewChatModal.tsx +223 -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 +224 -0
- package/src/components/Modals/SelectUsersModal/SelectUsersModal.tsx +16 -7
- package/src/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.tsx +8 -6
- package/src/components/Modals/SettingsModals/Referrals/Referrals.tsx +5 -3
- package/src/components/Modals/SettingsModals/SharedStyledComponents.ts +4 -4
- package/src/components/Modals/SettingsModals/Visibility/RadioInput.tsx +9 -5
- package/src/components/Modals/SettingsModals/Visibility/VisibilityModal.tsx +7 -7
- package/src/components/Modals/UserProfileModal/EditUserModal.tsx +12 -26
- package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +621 -307
- package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +84 -58
- package/src/components/Modals/styledModalComponents.tsx +31 -16
- package/src/components/RoomComponents/ChatRoomItem.tsx +30 -6
- package/src/components/RoomComponents/styled/LastAudioMessage.tsx +4 -2
- 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/RoomComponents/styled/StyledRoomComponents.ts +2 -0
- package/src/components/Thread/ThreadWrapper.tsx +6 -5
- package/src/components/Toast/Toast.tsx +1 -1
- package/src/components/VideoCalls/VideoCallSession.tsx +8 -3
- package/src/components/styled/AudioMessage.tsx +14 -10
- package/src/components/styled/Button.tsx +15 -8
- package/src/components/styled/DateLabel.tsx +7 -3
- package/src/components/styled/MediaModal.tsx +30 -25
- package/src/components/styled/MessageImage.tsx +53 -7
- package/src/components/styled/RoomListComponents/index.tsx +60 -35
- package/src/components/styled/SendInput.tsx +106 -20
- package/src/components/styled/StyledComponents.ts +38 -25
- package/src/components/styled/StyledInput.tsx +35 -21
- package/src/components/styled/StyledInputComponents/CustomTypingIndicator.tsx +8 -8
- package/src/components/styled/StyledInputComponents/MediaComponents.tsx +20 -7
- package/src/components/styled/StyledInputComponents/StyledInputComponents.tsx +26 -23
- package/src/components/styled/TreadLabel.tsx +9 -3
- package/src/components/styled/UnsupportedType.tsx +14 -4
- package/src/components/styled/VideoMessage.tsx +131 -54
- package/src/context/MessageNotificationContext.tsx +18 -4
- 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 +20 -0
- package/src/helpers/getDateLabelColor.ts +5 -3
- package/src/helpers/getDisplayFileName.ts +87 -0
- package/src/helpers/getIconColor.ts +6 -3
- package/src/helpers/getSenderNameColor.ts +5 -3
- 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/markdownParser.tsx +29 -5
- package/src/helpers/mediaLibraryRuntime.ts +25 -0
- package/src/helpers/mimeToExtension.ts +6 -22
- package/src/helpers/msgSortableMs.ts +25 -0
- package/src/helpers/parseMessageBody.tsx +79 -26
- 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/useCustomTypingIndicator.tsx +7 -3
- package/src/hooks/useFileToken.ts +7 -0
- package/src/hooks/useLogout.tsx +39 -12
- package/src/hooks/usePendingNotification.ts +5 -11
- package/src/hooks/useSendMessage.tsx +60 -15
- package/src/hooks/useTheme.ts +41 -0
- package/src/hooks/useUnreadMessagesCounter.ts +11 -0
- package/src/i18n/strings.ts +163 -37
- package/src/main.ts +57 -2
- package/src/networking/api-requests/auth.api.ts +156 -48
- package/src/networking/api-requests/push.api.ts +185 -62
- package/src/networking/api-requests/roomMembers.api.ts +1 -1
- package/src/networking/api-requests/rooms.api.ts +18 -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/pushRegistration.ts +356 -0
- package/src/services/pushSubscriptionService.ts +18 -47
- package/src/theme/index.ts +10 -0
- package/src/theme/styled.d.ts +9 -0
- package/src/theme/theme.ts +243 -0
- package/src/types/models/room.model.ts +1 -0
- package/src/types/types.ts +96 -5
- package/src/version.ts +1 -1
- package/lib/commonjs/context/PushNotificationProvider.js +0 -79
- package/lib/commonjs/context/PushNotificationProvider.js.map +0 -1
- package/lib/commonjs/hooks/usePushNotifications.js +0 -110
- package/lib/commonjs/hooks/usePushNotifications.js.map +0 -1
- package/lib/commonjs/services/pushNotifications.js +0 -143
- package/lib/commonjs/services/pushNotifications.js.map +0 -1
- package/lib/module/context/PushNotificationProvider.js +0 -79
- package/lib/module/context/PushNotificationProvider.js.map +0 -1
- package/lib/module/hooks/usePushNotifications.js +0 -106
- package/lib/module/hooks/usePushNotifications.js.map +0 -1
- package/lib/module/services/pushNotifications.js +0 -130
- package/lib/module/services/pushNotifications.js.map +0 -1
- package/lib/typescript/context/PushNotificationProvider.d.ts +0 -2
- package/lib/typescript/context/PushNotificationProvider.d.ts.map +0 -1
- package/lib/typescript/hooks/usePushNotifications.d.ts +0 -5
- package/lib/typescript/hooks/usePushNotifications.d.ts.map +0 -1
- package/lib/typescript/services/pushNotifications.d.ts +0 -10
- package/lib/typescript/services/pushNotifications.d.ts.map +0 -1
- package/src/context/PushNotificationProvider.tsx +0 -78
- package/src/hooks/usePushNotifications.ts +0 -131
- package/src/services/pushNotifications.ts +0 -170
|
@@ -4,6 +4,7 @@ import { useDispatch, useSelector } from 'react-redux';
|
|
|
4
4
|
import { getActiveRoom, RootState } from '../../../roomStore';
|
|
5
5
|
import {
|
|
6
6
|
CloseButton,
|
|
7
|
+
CloseButtonText,
|
|
7
8
|
GroupContainer,
|
|
8
9
|
ModalBackground,
|
|
9
10
|
ModalContainer,
|
|
@@ -11,8 +12,8 @@ import {
|
|
|
11
12
|
} from '../styledModalComponents';
|
|
12
13
|
import { deleteRoom as deleteRoomApi } from '../../../networking/api-requests/rooms.api';
|
|
13
14
|
import { deleteRoom as deleteRoomAction } from '../../../roomStore/roomsSlice';
|
|
14
|
-
import { Text } from 'react-native';
|
|
15
15
|
import { useToast } from '../../../context/ToastContext';
|
|
16
|
+
import { useTheme } from '../../../hooks/useTheme';
|
|
16
17
|
import { useT } from '../../../i18n/useT';
|
|
17
18
|
|
|
18
19
|
interface DeleteChatModalProps {
|
|
@@ -26,6 +27,7 @@ const DeleteChatModal: React.FC<DeleteChatModalProps> = ({
|
|
|
26
27
|
}) => {
|
|
27
28
|
const dispatch = useDispatch();
|
|
28
29
|
const { showToast } = useToast();
|
|
30
|
+
const theme = useTheme();
|
|
29
31
|
const t = useT();
|
|
30
32
|
const activeRoom = useSelector((state: RootState) => getActiveRoom(state));
|
|
31
33
|
|
|
@@ -59,7 +61,7 @@ const DeleteChatModal: React.FC<DeleteChatModalProps> = ({
|
|
|
59
61
|
<ModalBackground>
|
|
60
62
|
<ModalContainer>
|
|
61
63
|
<CloseButton onPress={handleCloseModal}>
|
|
62
|
-
<
|
|
64
|
+
<CloseButtonText>×</CloseButtonText>
|
|
63
65
|
</CloseButton>
|
|
64
66
|
<ModalTitle>{t('modal.deleteChat.title')}</ModalTitle>
|
|
65
67
|
|
|
@@ -77,9 +79,9 @@ const DeleteChatModal: React.FC<DeleteChatModalProps> = ({
|
|
|
77
79
|
style={{
|
|
78
80
|
width: '100%',
|
|
79
81
|
borderWidth: 1,
|
|
80
|
-
borderColor:
|
|
82
|
+
borderColor: theme.danger,
|
|
81
83
|
}}
|
|
82
|
-
color=
|
|
84
|
+
color={theme.danger}
|
|
83
85
|
unstyled
|
|
84
86
|
variant="outlined"
|
|
85
87
|
/>
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
|
|
3
|
+
import React, { useMemo, useState } from 'react';
|
|
4
|
+
import {
|
|
5
|
+
ActivityIndicator,
|
|
6
|
+
Modal,
|
|
7
|
+
StyleSheet,
|
|
8
|
+
Text,
|
|
9
|
+
TextInput,
|
|
10
|
+
TouchableOpacity,
|
|
11
|
+
View,
|
|
12
|
+
} from 'react-native';
|
|
13
|
+
import { useSelector } from 'react-redux';
|
|
14
|
+
import { getActiveRoom, RootState } from '../../../roomStore';
|
|
15
|
+
import { postReportRoom } from '../../../networking/api-requests/rooms.api';
|
|
16
|
+
import { useToast } from '../../../context/ToastContext';
|
|
17
|
+
import { useT } from '../../../i18n/useT';
|
|
18
|
+
import { getIconColor } from '../../../helpers/getIconColor';
|
|
19
|
+
import { useChatSettingState } from '../../../hooks/useChatSettingState';
|
|
20
|
+
import { useTheme } from '../../../hooks/useTheme';
|
|
21
|
+
import type { ChatTheme } from '../../../theme/theme';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Category ids go to `POST /v1/chats/reports/{chatName}` as-is; the labels
|
|
25
|
+
* come from the i18n table, which already carried `report.category.*`
|
|
26
|
+
* strings in all six locales with nothing rendering them until now.
|
|
27
|
+
*/
|
|
28
|
+
const CATEGORIES = [
|
|
29
|
+
'spam',
|
|
30
|
+
'violence',
|
|
31
|
+
'childAbuse',
|
|
32
|
+
'pornography',
|
|
33
|
+
'personalDetails',
|
|
34
|
+
'illegalDrugs',
|
|
35
|
+
'other',
|
|
36
|
+
] as const;
|
|
37
|
+
|
|
38
|
+
interface ReportChatModalProps {
|
|
39
|
+
visible: boolean;
|
|
40
|
+
onClose: () => void;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const ReportChatModal: React.FC<ReportChatModalProps> = ({
|
|
44
|
+
visible,
|
|
45
|
+
onClose,
|
|
46
|
+
}) => {
|
|
47
|
+
const t = useT();
|
|
48
|
+
const { showToast } = useToast();
|
|
49
|
+
const { config } = useChatSettingState();
|
|
50
|
+
const activeRoom = useSelector((state: RootState) => getActiveRoom(state));
|
|
51
|
+
const [category, setCategory] = useState<string | null>(null);
|
|
52
|
+
const [details, setDetails] = useState('');
|
|
53
|
+
const [sending, setSending] = useState(false);
|
|
54
|
+
const primary = getIconColor(config);
|
|
55
|
+
const theme = useTheme();
|
|
56
|
+
const styles = useMemo(() => createStyles(theme), [theme]);
|
|
57
|
+
|
|
58
|
+
const close = () => {
|
|
59
|
+
setCategory(null);
|
|
60
|
+
setDetails('');
|
|
61
|
+
onClose();
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const submit = async () => {
|
|
65
|
+
if (!category || sending) {return;}
|
|
66
|
+
setSending(true);
|
|
67
|
+
try {
|
|
68
|
+
await postReportRoom({
|
|
69
|
+
chatName: activeRoom?.jid?.split('@')[0] || '',
|
|
70
|
+
category,
|
|
71
|
+
text: details.trim() || undefined,
|
|
72
|
+
});
|
|
73
|
+
showToast({
|
|
74
|
+
id: Date.now().toString(),
|
|
75
|
+
title: 'Success',
|
|
76
|
+
message: t('modal.report.chatTitle'),
|
|
77
|
+
type: 'success',
|
|
78
|
+
});
|
|
79
|
+
close();
|
|
80
|
+
} catch (error) {
|
|
81
|
+
console.error('Failed to report chat:', error);
|
|
82
|
+
showToast({
|
|
83
|
+
id: Date.now().toString(),
|
|
84
|
+
title: 'Error',
|
|
85
|
+
message: t('modal.report.chatTitle'),
|
|
86
|
+
type: 'error',
|
|
87
|
+
});
|
|
88
|
+
} finally {
|
|
89
|
+
setSending(false);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<Modal
|
|
95
|
+
transparent
|
|
96
|
+
visible={visible}
|
|
97
|
+
animationType="fade"
|
|
98
|
+
onRequestClose={close}
|
|
99
|
+
>
|
|
100
|
+
<View style={styles.backdrop}>
|
|
101
|
+
<TouchableOpacity
|
|
102
|
+
testID="report-backdrop"
|
|
103
|
+
style={StyleSheet.absoluteFill}
|
|
104
|
+
activeOpacity={1}
|
|
105
|
+
onPress={close}
|
|
106
|
+
/>
|
|
107
|
+
<View style={styles.card}>
|
|
108
|
+
<Text style={styles.title}>{t('modal.report.chatTitle')}</Text>
|
|
109
|
+
<View style={styles.categories}>
|
|
110
|
+
{CATEGORIES.map((id) => {
|
|
111
|
+
const selected = category === id;
|
|
112
|
+
return (
|
|
113
|
+
<TouchableOpacity
|
|
114
|
+
key={id}
|
|
115
|
+
testID={`report-category-${id}`}
|
|
116
|
+
activeOpacity={0.7}
|
|
117
|
+
onPress={() => setCategory(id)}
|
|
118
|
+
style={[
|
|
119
|
+
styles.category,
|
|
120
|
+
selected && { borderColor: primary, backgroundColor: primary + '14' },
|
|
121
|
+
]}
|
|
122
|
+
>
|
|
123
|
+
<Text
|
|
124
|
+
style={[styles.categoryLabel, selected && { color: primary }]}
|
|
125
|
+
>
|
|
126
|
+
{t(`report.category.${id}`)}
|
|
127
|
+
</Text>
|
|
128
|
+
</TouchableOpacity>
|
|
129
|
+
);
|
|
130
|
+
})}
|
|
131
|
+
</View>
|
|
132
|
+
{category === 'other' && (
|
|
133
|
+
<TextInput
|
|
134
|
+
testID="report-details"
|
|
135
|
+
style={styles.input}
|
|
136
|
+
placeholder={t('modal.report.otherDetails')}
|
|
137
|
+
placeholderTextColor={theme.textMuted}
|
|
138
|
+
value={details}
|
|
139
|
+
onChangeText={setDetails}
|
|
140
|
+
multiline
|
|
141
|
+
/>
|
|
142
|
+
)}
|
|
143
|
+
<View style={styles.buttons}>
|
|
144
|
+
<TouchableOpacity
|
|
145
|
+
activeOpacity={0.7}
|
|
146
|
+
style={[styles.button, styles.cancel]}
|
|
147
|
+
onPress={close}
|
|
148
|
+
>
|
|
149
|
+
<Text style={styles.cancelLabel}>{t('action.cancel')}</Text>
|
|
150
|
+
</TouchableOpacity>
|
|
151
|
+
<TouchableOpacity
|
|
152
|
+
testID="report-submit"
|
|
153
|
+
activeOpacity={0.7}
|
|
154
|
+
disabled={!category || sending}
|
|
155
|
+
style={[
|
|
156
|
+
styles.button,
|
|
157
|
+
{ backgroundColor: primary, opacity: !category || sending ? 0.5 : 1 },
|
|
158
|
+
]}
|
|
159
|
+
onPress={submit}
|
|
160
|
+
>
|
|
161
|
+
{sending ? (
|
|
162
|
+
<ActivityIndicator color={theme.textOnPrimary} />
|
|
163
|
+
) : (
|
|
164
|
+
<Text style={styles.submitLabel}>{t('action.send')}</Text>
|
|
165
|
+
)}
|
|
166
|
+
</TouchableOpacity>
|
|
167
|
+
</View>
|
|
168
|
+
</View>
|
|
169
|
+
</View>
|
|
170
|
+
</Modal>
|
|
171
|
+
);
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
const createStyles = (theme: ChatTheme) => StyleSheet.create({
|
|
175
|
+
backdrop: {
|
|
176
|
+
flex: 1,
|
|
177
|
+
backgroundColor: theme.overlay,
|
|
178
|
+
alignItems: 'center',
|
|
179
|
+
justifyContent: 'center',
|
|
180
|
+
padding: 24,
|
|
181
|
+
},
|
|
182
|
+
card: {
|
|
183
|
+
width: '100%',
|
|
184
|
+
borderRadius: 16,
|
|
185
|
+
backgroundColor: theme.surface,
|
|
186
|
+
padding: 20,
|
|
187
|
+
},
|
|
188
|
+
title: {
|
|
189
|
+
fontSize: 18,
|
|
190
|
+
fontWeight: '600',
|
|
191
|
+
color: theme.text,
|
|
192
|
+
marginBottom: 16,
|
|
193
|
+
},
|
|
194
|
+
categories: {
|
|
195
|
+
flexDirection: 'row',
|
|
196
|
+
flexWrap: 'wrap',
|
|
197
|
+
gap: 8,
|
|
198
|
+
},
|
|
199
|
+
category: {
|
|
200
|
+
paddingHorizontal: 12,
|
|
201
|
+
paddingVertical: 8,
|
|
202
|
+
borderRadius: 20,
|
|
203
|
+
borderWidth: 1,
|
|
204
|
+
borderColor: theme.border,
|
|
205
|
+
},
|
|
206
|
+
categoryLabel: {
|
|
207
|
+
fontSize: 14,
|
|
208
|
+
color: theme.text,
|
|
209
|
+
},
|
|
210
|
+
input: {
|
|
211
|
+
marginTop: 16,
|
|
212
|
+
minHeight: 80,
|
|
213
|
+
borderRadius: 12,
|
|
214
|
+
borderWidth: 1,
|
|
215
|
+
borderColor: theme.border,
|
|
216
|
+
padding: 12,
|
|
217
|
+
fontSize: 14,
|
|
218
|
+
color: theme.text,
|
|
219
|
+
textAlignVertical: 'top',
|
|
220
|
+
},
|
|
221
|
+
buttons: {
|
|
222
|
+
flexDirection: 'row',
|
|
223
|
+
gap: 12,
|
|
224
|
+
marginTop: 20,
|
|
225
|
+
},
|
|
226
|
+
button: {
|
|
227
|
+
flex: 1,
|
|
228
|
+
height: 44,
|
|
229
|
+
borderRadius: 12,
|
|
230
|
+
alignItems: 'center',
|
|
231
|
+
justifyContent: 'center',
|
|
232
|
+
},
|
|
233
|
+
cancel: {
|
|
234
|
+
backgroundColor: theme.surfaceSecondary,
|
|
235
|
+
},
|
|
236
|
+
cancelLabel: {
|
|
237
|
+
fontSize: 16,
|
|
238
|
+
fontWeight: '500',
|
|
239
|
+
color: theme.text,
|
|
240
|
+
},
|
|
241
|
+
submitLabel: {
|
|
242
|
+
fontSize: 16,
|
|
243
|
+
fontWeight: '600',
|
|
244
|
+
color: theme.textOnPrimary,
|
|
245
|
+
},
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
export default ReportChatModal;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { withFileToken } from '../../../helpers/secureFileUrl';
|
|
2
3
|
import styled from 'styled-components/native';
|
|
3
4
|
import {
|
|
4
5
|
CenterContainer,
|
|
@@ -7,6 +8,7 @@ import {
|
|
|
7
8
|
import { SaveIcon } from '../../../assets/icons';
|
|
8
9
|
import ModalHeaderComponent from '../ModalHeaderComponent';
|
|
9
10
|
import { useChatSettingState } from '../../../hooks/useChatSettingState';
|
|
11
|
+
import { useTheme } from '../../../hooks/useTheme';
|
|
10
12
|
import { chatTextStyle } from '../../../helpers/typography';
|
|
11
13
|
import { useDispatch, useSelector } from 'react-redux';
|
|
12
14
|
import Button from '../../styled/Button';
|
|
@@ -25,12 +27,17 @@ import {
|
|
|
25
27
|
import { useVideoPlayer, VideoView } from 'expo-video';
|
|
26
28
|
import { PlayIcon } from '../../../assets/icons';
|
|
27
29
|
import * as FileSystem from 'expo-file-system/legacy';
|
|
28
|
-
import
|
|
30
|
+
import { getMediaLibrary } from '../../../helpers/mediaLibraryRuntime';
|
|
29
31
|
import { useToast } from '../../../context/ToastContext';
|
|
30
32
|
import PdfViewer from './PdfView';
|
|
31
33
|
import DocumentViewer from './DocumentViewer';
|
|
32
34
|
import AudioMessage from '../../styled/AudioMessage';
|
|
33
|
-
import {
|
|
35
|
+
import { isLikelyAudio } from '../../../helpers/mimeToExtension';
|
|
36
|
+
import {
|
|
37
|
+
getDisplayFileName,
|
|
38
|
+
getUniqueFileName,
|
|
39
|
+
sanitizeFileNameForPath,
|
|
40
|
+
} from '../../../helpers/getDisplayFileName';
|
|
34
41
|
|
|
35
42
|
// MIME types Google's gview embed renders reliably. Everything else
|
|
36
43
|
// falls through to the info-card so the user can still download.
|
|
@@ -82,9 +89,10 @@ const ModalVideo: React.FC<{ uri: string }> = ({ uri }) => {
|
|
|
82
89
|
contentFit="contain"
|
|
83
90
|
nativeControls
|
|
84
91
|
surfaceType="textureView"
|
|
85
|
-
//
|
|
86
|
-
// `
|
|
87
|
-
fullscreenOptions
|
|
92
|
+
// Fullscreen stays available by default on both expo-video lines:
|
|
93
|
+
// `allowsFullscreen` (SDK 54, default true) was replaced by
|
|
94
|
+
// `fullscreenOptions.enable` (SDK 57, default true). Passing neither
|
|
95
|
+
// keeps this file compiling against both.
|
|
88
96
|
/>
|
|
89
97
|
{/* Play affordance shown immediately on open; tapping starts
|
|
90
98
|
playback and the native controls take over. */}
|
|
@@ -115,6 +123,10 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
|
|
|
115
123
|
const dispatch = useDispatch();
|
|
116
124
|
const { showToast } = useToast();
|
|
117
125
|
const { config } = useChatSettingState();
|
|
126
|
+
const theme = useTheme();
|
|
127
|
+
// Info / audio cards: light keeps its warm tint (not in the palette),
|
|
128
|
+
// dark sits them on the secondary surface.
|
|
129
|
+
const cardBackground = theme.dark ? theme.surfaceSecondary : '#FFF8ED';
|
|
118
130
|
|
|
119
131
|
// Cache the SAF directory the user granted so saving several documents
|
|
120
132
|
// in a row doesn't re-prompt for a folder every time (Android only).
|
|
@@ -126,7 +138,22 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
|
|
|
126
138
|
|
|
127
139
|
if (!activeFile) {return null;}
|
|
128
140
|
|
|
141
|
+
// Bug #40: prefer the sender's original name over the server's stored
|
|
142
|
+
// hash name everywhere this modal shows or saves/shares the file.
|
|
143
|
+
// Sanitized so it's safe to use as an actual path segment (strips path
|
|
144
|
+
// separators/control chars) when writing to disk below.
|
|
145
|
+
const displayFileName = sanitizeFileNameForPath(
|
|
146
|
+
getDisplayFileName({
|
|
147
|
+
originalName: activeFile.originalName,
|
|
148
|
+
fileName: activeFile.fileName,
|
|
149
|
+
location: activeFile.fileURL,
|
|
150
|
+
mimetype: activeFile.mimetype,
|
|
151
|
+
})
|
|
152
|
+
);
|
|
153
|
+
|
|
129
154
|
const requestStoragePermission = async () => {
|
|
155
|
+
const MediaLibrary = getMediaLibrary();
|
|
156
|
+
if (!MediaLibrary?.requestPermissionsAsync) {return false;}
|
|
130
157
|
try {
|
|
131
158
|
const { status } = await MediaLibrary.requestPermissionsAsync();
|
|
132
159
|
return status === 'granted';
|
|
@@ -147,16 +174,11 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
|
|
|
147
174
|
}
|
|
148
175
|
|
|
149
176
|
try {
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
activeFile.mimetype
|
|
153
|
-
);
|
|
154
|
-
|
|
155
|
-
const filePath = FileSystem.cacheDirectory + fileName;
|
|
156
|
-
const download = await FileSystem.downloadAsync(activeFile.fileURL, filePath);
|
|
177
|
+
const filePath = FileSystem.cacheDirectory + displayFileName;
|
|
178
|
+
const download = await FileSystem.downloadAsync(withFileToken(activeFile.fileURL), filePath);
|
|
157
179
|
|
|
158
180
|
if (download.status === 200) {
|
|
159
|
-
await
|
|
181
|
+
await getMediaLibrary()?.saveToLibraryAsync(download.uri);
|
|
160
182
|
showToast({
|
|
161
183
|
id: Date.now().toString(),
|
|
162
184
|
title: 'Success',
|
|
@@ -167,18 +189,40 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
|
|
|
167
189
|
Alert.alert('Error', 'Failed to save the file.');
|
|
168
190
|
}
|
|
169
191
|
} catch (err) {
|
|
170
|
-
Alert.alert('Error', `Failed to save the file: ${
|
|
192
|
+
Alert.alert('Error', `Failed to save the file: ${displayFileName}`);
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
// Best-effort existing-name lookup for the Android SAF branch below: SAF
|
|
197
|
+
// hands back content URIs, not plain names, so this decodes each one and
|
|
198
|
+
// takes its last path segment. If the provider's URI shape doesn't match
|
|
199
|
+
// what we expect, we fail open (empty set) rather than block the save -
|
|
200
|
+
// worst case we skip de-duplication, we never crash the save flow.
|
|
201
|
+
const listSafDirectoryNames = async (
|
|
202
|
+
saf: any,
|
|
203
|
+
dirUri: string
|
|
204
|
+
): Promise<Set<string>> => {
|
|
205
|
+
try {
|
|
206
|
+
const uris: string[] = await saf.readDirectoryAsync(dirUri);
|
|
207
|
+
const names = uris.map((uri) => {
|
|
208
|
+
try {
|
|
209
|
+
const decoded = decodeURIComponent(uri);
|
|
210
|
+
const last = decoded.split('/').pop() || '';
|
|
211
|
+
return last.includes(':') ? last.split(':').pop() || '' : last;
|
|
212
|
+
} catch {
|
|
213
|
+
return '';
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
return new Set(names.filter(Boolean));
|
|
217
|
+
} catch {
|
|
218
|
+
return new Set<string>();
|
|
171
219
|
}
|
|
172
220
|
};
|
|
173
221
|
|
|
174
222
|
const saveFileToDownloads = async () => {
|
|
175
223
|
try {
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
activeFile.mimetype
|
|
179
|
-
);
|
|
180
|
-
const filePath = FileSystem.cacheDirectory + fileName;
|
|
181
|
-
const download = await FileSystem.downloadAsync(activeFile.fileURL, filePath);
|
|
224
|
+
const filePath = FileSystem.cacheDirectory + displayFileName;
|
|
225
|
+
const download = await FileSystem.downloadAsync(withFileToken(activeFile.fileURL), filePath);
|
|
182
226
|
|
|
183
227
|
if (download.status !== 200) {
|
|
184
228
|
Alert.alert('Error', 'Failed to save the file.');
|
|
@@ -201,7 +245,16 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
|
|
|
201
245
|
safDirUriRef.current = dirUri;
|
|
202
246
|
}
|
|
203
247
|
|
|
204
|
-
|
|
248
|
+
// Avoid silently overwriting a different attachment that happens
|
|
249
|
+
// to share the same display name (common now that we prefer the
|
|
250
|
+
// human-picked name over the unique server hash - bug #40) by
|
|
251
|
+
// suffixing " (1)", " (2)", ... on a collision.
|
|
252
|
+
const existingNames = await listSafDirectoryNames(saf, dirUri as string);
|
|
253
|
+
const uniqueName = await getUniqueFileName(
|
|
254
|
+
displayFileName,
|
|
255
|
+
async (candidate) => existingNames.has(candidate)
|
|
256
|
+
);
|
|
257
|
+
const baseName = uniqueName.replace(/\.[^/.]+$/, '');
|
|
205
258
|
const mime = activeFile.mimetype || 'application/octet-stream';
|
|
206
259
|
const base64 = await FileSystem.readAsStringAsync(download.uri, {
|
|
207
260
|
encoding: FileSystem.EncodingType.Base64,
|
|
@@ -228,7 +281,7 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
|
|
|
228
281
|
// user may cancel), so we don't show a "Save successful" toast here.
|
|
229
282
|
await Share.share({
|
|
230
283
|
url: download.uri,
|
|
231
|
-
title:
|
|
284
|
+
title: displayFileName,
|
|
232
285
|
});
|
|
233
286
|
} catch (err) {
|
|
234
287
|
console.error('Error saving file:', err);
|
|
@@ -271,15 +324,15 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
|
|
|
271
324
|
<FullScreenImage
|
|
272
325
|
source={{
|
|
273
326
|
uri:
|
|
274
|
-
activeFile.fileURL ||
|
|
327
|
+
withFileToken(activeFile.fileURL) ||
|
|
275
328
|
'https://as2.ftcdn.net/v2/jpg/02/51/95/53/1000_F_251955356_FAQH0U1y1TZw3ZcdPGybwUkH90a3VAhb.jpg',
|
|
276
329
|
}}
|
|
277
330
|
resizeMode="contain"
|
|
278
|
-
accessibilityLabel={
|
|
331
|
+
accessibilityLabel={displayFileName}
|
|
279
332
|
/>
|
|
280
333
|
);
|
|
281
334
|
case activeFile.mimetype.startsWith('video/'):
|
|
282
|
-
return <ModalVideo uri={activeFile.fileURL} />;
|
|
335
|
+
return <ModalVideo uri={withFileToken(activeFile.fileURL)} />;
|
|
283
336
|
case activeFile.mimetype.includes('application/octet-stream'):
|
|
284
337
|
return (
|
|
285
338
|
<View
|
|
@@ -287,15 +340,15 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
|
|
|
287
340
|
width: '100%',
|
|
288
341
|
padding: 20,
|
|
289
342
|
gap: 12,
|
|
290
|
-
backgroundColor:
|
|
343
|
+
backgroundColor: cardBackground,
|
|
291
344
|
borderRadius: 16,
|
|
292
345
|
}}
|
|
293
346
|
>
|
|
294
|
-
<Text style={{ fontSize: 16, fontWeight: '600' }}>
|
|
347
|
+
<Text style={{ fontSize: 16, fontWeight: '600', color: theme.text }}>
|
|
295
348
|
Voice message
|
|
296
349
|
</Text>
|
|
297
350
|
<AudioMessage
|
|
298
|
-
src={activeFile.fileURL}
|
|
351
|
+
src={withFileToken(activeFile.fileURL)}
|
|
299
352
|
mimeType={activeFile.mimetype}
|
|
300
353
|
fileName={activeFile.fileName}
|
|
301
354
|
originalName={activeFile.originalName}
|
|
@@ -324,18 +377,15 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
|
|
|
324
377
|
width: '100%',
|
|
325
378
|
padding: 20,
|
|
326
379
|
gap: 12,
|
|
327
|
-
backgroundColor:
|
|
380
|
+
backgroundColor: cardBackground,
|
|
328
381
|
borderRadius: 16,
|
|
329
382
|
}}
|
|
330
383
|
>
|
|
331
|
-
<Text style={{ fontSize: 16, fontWeight: '600' }}>
|
|
332
|
-
{
|
|
333
|
-
activeFile.originalName || activeFile.fileName,
|
|
334
|
-
activeFile.mimetype
|
|
335
|
-
)}
|
|
384
|
+
<Text style={{ fontSize: 16, fontWeight: '600', color: theme.text }}>
|
|
385
|
+
{displayFileName}
|
|
336
386
|
</Text>
|
|
337
387
|
<AudioMessage
|
|
338
|
-
src={activeFile.fileURL}
|
|
388
|
+
src={withFileToken(activeFile.fileURL)}
|
|
339
389
|
mimeType={activeFile.mimetype}
|
|
340
390
|
fileName={activeFile.fileName}
|
|
341
391
|
originalName={activeFile.originalName}
|
|
@@ -345,12 +395,8 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
|
|
|
345
395
|
</View>
|
|
346
396
|
);
|
|
347
397
|
case activeFile.mimetype === 'application/pdf':
|
|
348
|
-
return <PdfViewer pdfUrl={activeFile.fileURL} />;
|
|
398
|
+
return <PdfViewer pdfUrl={withFileToken(activeFile.fileURL)} />;
|
|
349
399
|
default: {
|
|
350
|
-
const displayName = ensureFilenameHasExtension(
|
|
351
|
-
activeFile.fileName,
|
|
352
|
-
activeFile.mimetype
|
|
353
|
-
);
|
|
354
400
|
// Office docs (.docx / .xlsx / .pptx / .doc / .xls / .ppt /
|
|
355
401
|
// .txt / .csv / .rtf) → render inline via Google's gview embed
|
|
356
402
|
// — fixes the "blank preview" complaint for docs (bug #9).
|
|
@@ -358,7 +404,7 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
|
|
|
358
404
|
return (
|
|
359
405
|
<DocumentViewer
|
|
360
406
|
url={activeFile.fileURL}
|
|
361
|
-
fileName={
|
|
407
|
+
fileName={displayFileName}
|
|
362
408
|
/>
|
|
363
409
|
);
|
|
364
410
|
}
|
|
@@ -368,19 +414,19 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
|
|
|
368
414
|
return (
|
|
369
415
|
<View
|
|
370
416
|
style={{
|
|
371
|
-
backgroundColor:
|
|
417
|
+
backgroundColor: cardBackground,
|
|
372
418
|
borderRadius: 16,
|
|
373
419
|
padding: 20,
|
|
374
420
|
gap: 8,
|
|
375
421
|
}}
|
|
376
422
|
>
|
|
377
|
-
<Text style={{ fontSize: 16, fontWeight: '600' }}>
|
|
378
|
-
{
|
|
423
|
+
<Text style={{ fontSize: 16, fontWeight: '600', color: theme.text }}>
|
|
424
|
+
{displayFileName}
|
|
379
425
|
</Text>
|
|
380
|
-
<Text style={{ color:
|
|
426
|
+
<Text style={{ color: theme.textSecondary }}>
|
|
381
427
|
{activeFile.mimetype || 'unknown type'}
|
|
382
428
|
</Text>
|
|
383
|
-
<Text style={{ marginTop: 8 }}>
|
|
429
|
+
<Text style={{ marginTop: 8, color: theme.text }}>
|
|
384
430
|
This file format can't be previewed inline. Tap the save icon
|
|
385
431
|
above to download it.
|
|
386
432
|
</Text>
|
|
@@ -399,7 +445,7 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
|
|
|
399
445
|
rightMenu={
|
|
400
446
|
<>
|
|
401
447
|
<Button onPress={saveClick}>
|
|
402
|
-
<SaveIcon />
|
|
448
|
+
<SaveIcon color={theme.textSecondary} />
|
|
403
449
|
</Button>
|
|
404
450
|
</>
|
|
405
451
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { withFileToken } from '../../../helpers/secureFileUrl';
|
|
2
3
|
import { ActivityIndicator, Platform, StyleSheet, Text, View } from 'react-native';
|
|
3
4
|
import { WebView } from 'react-native-webview';
|
|
4
5
|
import * as FileSystem from 'expo-file-system/legacy';
|
|
@@ -25,7 +26,7 @@ const PdfViewer: React.FC<PdfViewerProps> = ({ pdfUrl }) => {
|
|
|
25
26
|
const run = async () => {
|
|
26
27
|
try {
|
|
27
28
|
const target = FileSystem.cacheDirectory + `pdf-${Date.now()}.pdf`;
|
|
28
|
-
const result = await FileSystem.downloadAsync(pdfUrl, target);
|
|
29
|
+
const result = await FileSystem.downloadAsync(withFileToken(pdfUrl), target);
|
|
29
30
|
if (cancelled) {return;}
|
|
30
31
|
setLocalUri(result.uri);
|
|
31
32
|
} catch (e: any) {
|
|
@@ -37,6 +37,13 @@ const Modal: React.FC<ModalProps> = ({ children, modal, setOpenModal }) => {
|
|
|
37
37
|
|
|
38
38
|
return <ModalComponent handleCloseModal={handleClose} />;
|
|
39
39
|
};
|
|
40
|
+
// Modals that present themselves (a real RN <Modal>, so the dim covers
|
|
41
|
+
// the whole window rather than stopping at this component's frame) must
|
|
42
|
+
// not also sit inside the shared in-tree backdrop — that would dim twice.
|
|
43
|
+
if (modal === MODAL_TYPES.NEW_CHAT) {
|
|
44
|
+
return <>{renderModalContent()}{children}</>;
|
|
45
|
+
}
|
|
46
|
+
|
|
40
47
|
return (
|
|
41
48
|
modal && (
|
|
42
49
|
<ModalBackground
|
|
@@ -10,6 +10,7 @@ import { Text, StyleProp, TextStyle } from 'react-native';
|
|
|
10
10
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
11
11
|
import { resolveHeaderHeight } from '../../helpers/headerLayout';
|
|
12
12
|
import { useChatSettingState } from '../../hooks/useChatSettingState';
|
|
13
|
+
import { useTheme } from '../../hooks/useTheme';
|
|
13
14
|
|
|
14
15
|
interface ModalHeaderComponentProps {
|
|
15
16
|
handleCloseModal?: any;
|
|
@@ -34,6 +35,7 @@ const ModalHeaderComponent: React.FC<ModalHeaderComponentProps> = ({
|
|
|
34
35
|
// (notch / Dynamic Island / nothing).
|
|
35
36
|
const insets = useSafeAreaInsets();
|
|
36
37
|
const { config } = useChatSettingState();
|
|
38
|
+
const theme = useTheme();
|
|
37
39
|
// Same band height as the in-chat header, sitting BELOW the status-bar
|
|
38
40
|
// inset. Total = inset + band; paddingTop carries the inset and the band
|
|
39
41
|
// is the content area (centered via HeaderContainer's align-items:center),
|
|
@@ -52,8 +54,13 @@ const ModalHeaderComponent: React.FC<ModalHeaderComponentProps> = ({
|
|
|
52
54
|
leftMenu
|
|
53
55
|
) : (
|
|
54
56
|
<>
|
|
55
|
-
<Button
|
|
56
|
-
|
|
57
|
+
<Button
|
|
58
|
+
EndIcon={<BackIcon color={theme.textSecondary} />}
|
|
59
|
+
onPress={handleCloseModal}
|
|
60
|
+
/>
|
|
61
|
+
<Text style={[{ color: theme.text }, titleStyle]}>
|
|
62
|
+
{headerTitle ?? 'Go back'}
|
|
63
|
+
</Text>
|
|
57
64
|
</>
|
|
58
65
|
)}
|
|
59
66
|
</HeaderLeft>
|