@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isDateAfter","isDateBefore","deepMerge","target","source","key","undefined","Array","isArray","insertMessageWithDelimiter","roomMessages","message","lastViewedTimestamp","existingIndex","findIndex","msg","id","xmppId","existing","preservedUserId","user","merged","pending","newMessageDate","date","lastMessage","length","firstMessage","
|
|
1
|
+
{"version":3,"names":["isDateAfter","isDateBefore","msgSortableMs","resolveMarkerMs","marker","Number","isFinite","raw","toString","trim","asNumber","parsed","Date","parse","deepMerge","target","source","key","undefined","Array","isArray","insertMessageWithDelimiter","roomMessages","message","lastViewedTimestamp","existingIndex","findIndex","msg","id","xmppId","existing","preservedUserId","user","merged","pending","newMessageDate","date","lastMessage","length","firstMessage","index","push","lastViewedMs","newMessageMs","some","delimiterIndex","firstUnreadMs","anchorMs","splice","name","token","refreshToken","toISOString","body","roomJid","unshift","i"],"sourceRoot":"../../../src","sources":["helpers/insertMessageWithDelimiter.ts"],"mappings":";;AACA,SAASA,WAAW,EAAEC,Y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,CAACH,cAAc,EAAE,CAAC,EAAE;UACrCjB,EAAE,EAAE,eAAe;UACnBI,IAAI,EAAE;YACJJ,EAAE,EAAE,QAAQ;YACZqB,IAAI,EAAE/B,SAAS;YACfgC,KAAK,EAAE,EAAE;YACTC,YAAY,EAAE;UAChB,CAAC;UACDf,IAAI,EAAE,IAAIxB,IAAI,CAACmC,QAAQ,CAAC,CAACK,WAAW,CAAC,CAAC;UACtCC,IAAI,EAAE,cAAc;UACpBC,OAAO,EAAE;QACX,CAAC,CAAC;MACJ;IACF;EACF,CAAC,MAAM,IACLrD,YAAY,CAACkC,cAAc,CAAC3B,QAAQ,CAAC,CAAC,EAAE+B,YAAY,EAAEH,IAAI,EAAE5B,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC,EAC7E;IACAc,YAAY,CAACiC,OAAO,CAAChC,OAAO,CAAC;EAC/B,CAAC,MAAM;IACL,KAAK,IAAIiC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGlC,YAAY,CAACgB,MAAM,EAAEkB,CAAC,EAAE,EAAE;MAC5C,IACEvD,YAAY,CAACkC,cAAc,CAAC3B,QAAQ,CAAC,CAAC,EAAEc,YAAY,CAACkC,CAAC,CAAC,CAACpB,IAAI,EAAE5B,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC,EAC/E;QACAc,YAAY,CAAC0B,MAAM,CAACQ,CAAC,EAAE,CAAC,EAAEjC,OAAO,CAAC;QAClC;MACF;IACF;EACF;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Bug #41: during reconnect catch-up (app was backgrounded/offline, then
|
|
5
|
+
* comes back online), messages replayed from MAM could transiently render
|
|
6
|
+
* on the RIGHT (as if sent by the current user) before flipping to the
|
|
7
|
+
* LEFT a moment later. Root cause: `message.user.id === walletAddress`
|
|
8
|
+
* treats `undefined === undefined` (or `'' === ''`) as a match, and the
|
|
9
|
+
* two sides could independently be empty for one frame -- the message's
|
|
10
|
+
* sender id before the MAM-derived value settled, and/or the current
|
|
11
|
+
* user's id before it rehydrated. Two blank ids must never compare equal.
|
|
12
|
+
*
|
|
13
|
+
* A second, related issue: the same logical sender id can show up in
|
|
14
|
+
* different shapes depending on which code path produced it -- a bare
|
|
15
|
+
* id ("wallet123") or a bare JID with an incidental session resource
|
|
16
|
+
* ("wallet123@host/sessionResource", as `senderJID` attrs carry on the
|
|
17
|
+
* wire -- see src/assets/test.xml). In every shape used in this
|
|
18
|
+
* codebase the identifying segment is the part BEFORE the first '@' (or
|
|
19
|
+
* before '/' when there's no '@'); anything after that -- domain,
|
|
20
|
+
* resource -- is noise. Comparing raw strings with `===` fails whenever
|
|
21
|
+
* one side still carries that noise and the other doesn't. Normalizing
|
|
22
|
+
* both sides (strip resource, strip domain, lowercase) before comparing
|
|
23
|
+
* makes the check tolerant of that drift.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Strip a MUC resource (`room@host/resource` -> `room@host`) and then a
|
|
28
|
+
* JID domain (`local@host` -> `local`), lowercasing the result. Applies
|
|
29
|
+
* to both plain ids and full/partial JIDs so either shape normalizes to
|
|
30
|
+
* the same comparable value.
|
|
31
|
+
*/
|
|
32
|
+
const normalizeId = raw => {
|
|
33
|
+
const value = String(raw ?? '').trim();
|
|
34
|
+
if (!value) {
|
|
35
|
+
return '';
|
|
36
|
+
}
|
|
37
|
+
const withoutResource = value.split('/')[0];
|
|
38
|
+
const withoutDomain = withoutResource.includes('@') ? withoutResource.split('@')[0] : withoutResource;
|
|
39
|
+
return withoutDomain.toLowerCase();
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// Same precedence the rest of the app uses when it needs "who am I" as a
|
|
43
|
+
// single id: xmppUsername first, walletAddress as the fallback.
|
|
44
|
+
const resolveCurrentUserId = currentUser => {
|
|
45
|
+
if (typeof currentUser === 'string') {
|
|
46
|
+
return currentUser;
|
|
47
|
+
}
|
|
48
|
+
if (!currentUser) {
|
|
49
|
+
return '';
|
|
50
|
+
}
|
|
51
|
+
return currentUser.xmppUsername || currentUser.walletAddress || currentUser.id || '';
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Robustly determine whether `message` was sent by `currentUser`. Never
|
|
56
|
+
* returns true from two blank/undefined ids, and tolerates bare-id vs.
|
|
57
|
+
* full-JID mismatches between the sender id and the current user id.
|
|
58
|
+
*/
|
|
59
|
+
export const isOwnMessage = (message, currentUser) => {
|
|
60
|
+
const messageUserId = normalizeId(message?.user?.id);
|
|
61
|
+
if (!messageUserId) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
const currentUserId = normalizeId(resolveCurrentUserId(currentUser));
|
|
65
|
+
if (!currentUserId) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
return messageUserId === currentUserId;
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=isOwnMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["normalizeId","raw","value","String","trim","withoutResource","split","withoutDomain","includes","toLowerCase","resolveCurrentUserId","currentUser","xmppUsername","walletAddress","id","isOwnMessage","message","messageUserId","user","currentUserId"],"sourceRoot":"../../../src","sources":["helpers/isOwnMessage.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,WAAW,GAAIC,GAAY,IAAa;EAC5C,MAAMC,KAAK,GAAGC,MAAM,CAACF,GAAG,IAAI,EAAE,CAAC,CAACG,IAAI,CAAC,CAAC;EACtC,IAAI,CAACF,KAAK,EAAE;IACV,OAAO,EAAE;EACX;EACA,MAAMG,eAAe,GAAGH,KAAK,CAACI,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;EAC3C,MAAMC,aAAa,GAAGF,eAAe,CAACG,QAAQ,CAAC,GAAG,CAAC,GAC/CH,eAAe,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAC7BD,eAAe;EACnB,OAAOE,aAAa,CAACE,WAAW,CAAC,CAAC;AACpC,CAAC;;AAED;AACA;AACA,MAAMC,oBAAoB,GAAIC,WAAkC,IAAa;EAC3E,IAAI,OAAOA,WAAW,KAAK,QAAQ,EAAE;IACnC,OAAOA,WAAW;EACpB;EACA,IAAI,CAACA,WAAW,EAAE;IAChB,OAAO,EAAE;EACX;EACA,OACEA,WAAW,CAACC,YAAY,IAAID,WAAW,CAACE,aAAa,IAAIF,WAAW,CAACG,EAAE,IAAI,EAAE;AAEjF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,GAAGA,CAC1BC,OAAkD,EAClDL,WAAkC,KACtB;EACZ,MAAMM,aAAa,GAAGjB,WAAW,CAACgB,OAAO,EAAEE,IAAI,EAAEJ,EAAE,CAAC;EACpD,IAAI,CAACG,aAAa,EAAE;IAClB,OAAO,KAAK;EACd;EAEA,MAAME,aAAa,GAAGnB,WAAW,CAACU,oBAAoB,CAACC,WAAW,CAAC,CAAC;EACpE,IAAI,CAACQ,aAAa,EAAE;IAClB,OAAO,KAAK;EACd;EAEA,OAAOF,aAAa,KAAKE,aAAa;AACxC,CAAC","ignoreList":[]}
|
|
@@ -9,6 +9,16 @@ export const getKeyboardVerticalOffset = ({
|
|
|
9
9
|
export const getInputDockPaddingBottom = ({
|
|
10
10
|
platform,
|
|
11
11
|
bottomInset = 0,
|
|
12
|
-
keyboardVisible = false
|
|
13
|
-
|
|
12
|
+
keyboardVisible = false,
|
|
13
|
+
configuredPadding,
|
|
14
|
+
hostOwnsLayout = false
|
|
15
|
+
}) => {
|
|
16
|
+
if (typeof configuredPadding === 'number') {
|
|
17
|
+
return configuredPadding;
|
|
18
|
+
}
|
|
19
|
+
if (hostOwnsLayout) {
|
|
20
|
+
return 0;
|
|
21
|
+
}
|
|
22
|
+
return platform === 'ios' ? bottomInset : ANDROID_INPUT_DOCK_GAP;
|
|
23
|
+
};
|
|
14
24
|
//# sourceMappingURL=keyboardLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ANDROID_INPUT_DOCK_GAP","getKeyboardVerticalOffset","platform","configuredOffset","bottomInset","getInputDockPaddingBottom","keyboardVisible"],"sourceRoot":"../../../src","sources":["helpers/keyboardLayout.ts"],"mappings":";;AAOA,OAAO,MAAMA,sBAAsB,GAAG,EAAE;AAExC,OAAO,MAAMC,yBAAyB,GAAGA,CAAC;EACxCC,QAAQ;EACRC,gBAAgB,GAAG,CAAC;EACpBC,WAAW,GAAG;AACI,CAAC,KACnBD,gBAAgB,IAAID,QAAQ,KAAK,KAAK,GAAGE,WAAW,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"names":["ANDROID_INPUT_DOCK_GAP","getKeyboardVerticalOffset","platform","configuredOffset","bottomInset","getInputDockPaddingBottom","keyboardVisible","configuredPadding","hostOwnsLayout"],"sourceRoot":"../../../src","sources":["helpers/keyboardLayout.ts"],"mappings":";;AAOA,OAAO,MAAMA,sBAAsB,GAAG,EAAE;AAExC,OAAO,MAAMC,yBAAyB,GAAGA,CAAC;EACxCC,QAAQ;EACRC,gBAAgB,GAAG,CAAC;EACpBC,WAAW,GAAG;AACI,CAAC,KACnBD,gBAAgB,IAAID,QAAQ,KAAK,KAAK,GAAGE,WAAW,GAAG,CAAC,CAAC;AAc3D,OAAO,MAAMC,yBAAyB,GAAGA,CAAC;EACxCH,QAAQ;EACRE,WAAW,GAAG,CAAC;EACfE,eAAe,GAAG,KAAK;EACvBC,iBAAiB;EACjBC,cAAc,GAAG;AACG,CAAC,KAAa;EAClC,IAAI,OAAOD,iBAAiB,KAAK,QAAQ,EAAE;IACzC,OAAOA,iBAAiB;EAC1B;EACA,IAAIC,cAAc,EAAE;IAClB,OAAO,CAAC;EACV;EACA,OAAON,QAAQ,KAAK,KAAK,GAAGE,WAAW,GAAGJ,sBAAsB;AAClE,CAAC","ignoreList":[]}
|
|
@@ -2,11 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Text, View, Linking, StyleSheet } from 'react-native';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Optional palette for the colour-bearing nodes (links, code grounds, quote
|
|
8
|
+
* rule). Helpers can't use hooks; callers pass the resolved theme. Omitted →
|
|
9
|
+
* the historical hard-coded colours, so existing output is unchanged.
|
|
10
|
+
*/
|
|
5
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
-
export const MarkDown = text => {
|
|
12
|
+
export const MarkDown = (text, theme) => {
|
|
7
13
|
if (typeof text !== 'string') {
|
|
8
14
|
return [text];
|
|
9
15
|
}
|
|
16
|
+
|
|
17
|
+
// Colour overrides layered over the static StyleSheet below.
|
|
18
|
+
const themed = theme ? {
|
|
19
|
+
link: {
|
|
20
|
+
color: theme.primary
|
|
21
|
+
},
|
|
22
|
+
codeInline: {
|
|
23
|
+
backgroundColor: theme.surfaceSecondary
|
|
24
|
+
},
|
|
25
|
+
codeBlock: {
|
|
26
|
+
backgroundColor: theme.surfaceSecondary
|
|
27
|
+
},
|
|
28
|
+
quote: {
|
|
29
|
+
borderLeftColor: theme.border
|
|
30
|
+
}
|
|
31
|
+
} : undefined;
|
|
10
32
|
let key = 0;
|
|
11
33
|
const elements = [];
|
|
12
34
|
const lines = text.split('\n');
|
|
@@ -48,14 +70,14 @@ export const MarkDown = text => {
|
|
|
48
70
|
}, `s-${key++}`));
|
|
49
71
|
} else if (/^`.*`$/.test(token)) {
|
|
50
72
|
output.push(/*#__PURE__*/_jsx(Text, {
|
|
51
|
-
style: styles.codeInline,
|
|
73
|
+
style: [styles.codeInline, themed?.codeInline],
|
|
52
74
|
children: token.slice(1, -1).trim()
|
|
53
75
|
}, `code-${key++}`));
|
|
54
76
|
} else if (/^https:\/\//.test(token)) {
|
|
55
77
|
output.push(/*#__PURE__*/_jsx(Text, {
|
|
56
78
|
children: /*#__PURE__*/_jsx(Text, {
|
|
57
79
|
onPress: () => Linking.openURL(token),
|
|
58
|
-
style: styles.link,
|
|
80
|
+
style: [styles.link, themed?.link],
|
|
59
81
|
children: token
|
|
60
82
|
})
|
|
61
83
|
}, `link-${key++}`));
|
|
@@ -117,7 +139,7 @@ export const MarkDown = text => {
|
|
|
117
139
|
if (inCodeBlock && line.trim() === '```') {
|
|
118
140
|
inCodeBlock = false;
|
|
119
141
|
elements.push(/*#__PURE__*/_jsx(View, {
|
|
120
|
-
style: styles.codeBlock,
|
|
142
|
+
style: [styles.codeBlock, themed?.codeBlock],
|
|
121
143
|
children: /*#__PURE__*/_jsx(Text, {
|
|
122
144
|
style: styles.codeBlockText,
|
|
123
145
|
children: codeBuffer.join('\n')
|
|
@@ -145,7 +167,7 @@ export const MarkDown = text => {
|
|
|
145
167
|
}
|
|
146
168
|
if (line.startsWith('>')) {
|
|
147
169
|
elements.push(/*#__PURE__*/_jsx(View, {
|
|
148
|
-
style: styles.quote,
|
|
170
|
+
style: [styles.quote, themed?.quote],
|
|
149
171
|
children: parseInline(line.replace(/^>\s*/, '')).map((el, idx) => /*#__PURE__*/_jsx(React.Fragment, {
|
|
150
172
|
children: el
|
|
151
173
|
}, idx))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","View","Linking","StyleSheet","jsx","_jsx","jsxs","_jsxs","MarkDown","text","key","elements","lines","split","inCodeBlock","codeLanguage","codeBuffer","parseInline","input","output","regex","lastIndex","match","exec","index","push","slice","token","test","style","styles","bold","children","italic","strike","
|
|
1
|
+
{"version":3,"names":["React","Text","View","Linking","StyleSheet","jsx","_jsx","jsxs","_jsxs","MarkDown","text","theme","themed","link","color","primary","codeInline","backgroundColor","surfaceSecondary","codeBlock","quote","borderLeftColor","border","undefined","key","elements","lines","split","inCodeBlock","codeLanguage","codeBuffer","parseInline","input","output","regex","lastIndex","match","exec","index","push","slice","token","test","style","styles","bold","children","italic","strike","trim","onPress","openURL","length","parseList","startIndex","items","line","isOrdered","start","parseInt","i","currentLine","itemText","replace","listItem","listMarker","listItemContent","map","el","idx","Fragment","ListTag","list","newIndex","startsWith","codeBlockText","join","level","content","headingStyle","h1","break","paragraph","create","fontWeight","fontStyle","textDecorationLine","paddingHorizontal","paddingVertical","borderRadius","fontFamily","fontSize","padding","marginVertical","marginTop","marginBottom","h2","h3","h4","h5","h6","borderLeftWidth","paddingLeft","flexDirection","marginRight","minWidth","flex","height"],"sourceRoot":"../../../src","sources":["helpers/markdownParser.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,OAAO,EAAEC,UAAU,QAA0B,cAAc;;AAGhF;AACA;AACA;AACA;AACA;AAJA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAUA,OAAO,MAAMC,QAAQ,GAAGA,CACtBC,IAAY,EACZC,KAAqB,KACQ;EAC7B,IAAI,OAAOD,IAAI,KAAK,QAAQ,EAAE;IAAC,OAAO,CAACA,IAAI,CAAC;EAAC;;EAE7C;EACA,MAAME,MAAM,GAAGD,KAAK,GAChB;IACEE,IAAI,EAAE;MAAEC,KAAK,EAAEH,KAAK,CAACI;IAAQ,CAAC;IAC9BC,UAAU,EAAE;MAAEC,eAAe,EAAEN,KAAK,CAACO;IAAiB,CAAC;IACvDC,SAAS,EAAE;MAAEF,eAAe,EAAEN,KAAK,CAACO;IAAiB,CAAC;IACtDE,KAAK,EAAE;MAAEC,eAAe,EAAEV,KAAK,CAACW;IAAO;EACzC,CAAC,GACDC,SAAS;EAEb,IAAIC,GAAG,GAAG,CAAC;EACX,MAAMC,QAAkC,GAAG,EAAE;EAC7C,MAAMC,KAAK,GAAGhB,IAAI,CAACiB,KAAK,CAAC,IAAI,CAAC;EAE9B,IAAIC,WAAW,GAAG,KAAK;E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AAE;IACFT,QAAQ,EAAE,EAAE;IACZP,UAAU,EAAE,MAAM;IAClBU,SAAS,EAAE,EAAE;IACbC,YAAY,EAAE;EAChB,CAAC;EACD3E,KAAK,EAAE;IACLiF,eAAe,EAAE,CAAC;IAClBhF,eAAe,EAAE,MAAM;IACvBiF,WAAW,EAAE,EAAE;IACfT,cAAc,EAAE;EAClB,CAAC;EACDrB,IAAI,EAAE;IACJqB,cAAc,EAAE,CAAC;IACjBS,WAAW,EAAE;EACf,CAAC;EACDtC,QAAQ,EAAE;IACRuC,aAAa,EAAE,KAAK;IACpBR,YAAY,EAAE;EAChB,CAAC;EACD9B,UAAU,EAAE;IACVuC,WAAW,EAAE,CAAC;IACdC,QAAQ,EAAE;EACZ,CAAC;EACDvC,eAAe,EAAE;IACfwC,IAAI,EAAE;EACR,CAAC;EACDxB,SAAS,EAAE;IACTW,cAAc,EAAE;EAClB,CAAC;EACDZ,KAAK,EAAE;IACL0B,MAAM,EAAE;EACV;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
let cached;
|
|
4
|
+
export const getMediaLibrary = () => {
|
|
5
|
+
if (cached !== undefined) {
|
|
6
|
+
return cached;
|
|
7
|
+
}
|
|
8
|
+
try {
|
|
9
|
+
const legacy = require('expo-media-library/legacy');
|
|
10
|
+
if (legacy?.getAssetsAsync) {
|
|
11
|
+
cached = legacy;
|
|
12
|
+
return cached;
|
|
13
|
+
}
|
|
14
|
+
} catch {}
|
|
15
|
+
try {
|
|
16
|
+
cached = require('expo-media-library') ?? null;
|
|
17
|
+
} catch {
|
|
18
|
+
cached = null;
|
|
19
|
+
}
|
|
20
|
+
return cached;
|
|
21
|
+
};
|
|
22
|
+
export const __resetMediaLibraryCache = () => {
|
|
23
|
+
cached = undefined;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=mediaLibraryRuntime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cached","getMediaLibrary","undefined","legacy","require","getAssetsAsync","__resetMediaLibraryCache"],"sourceRoot":"../../../src","sources":["helpers/mediaLibraryRuntime.ts"],"mappings":";;AAAA,IAAIA,MAAuB;AAE3B,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAAkB;EAC/C,IAAID,MAAM,KAAKE,SAAS,EAAE;IAAC,OAAOF,MAAM;EAAC;EACzC,IAAI;IACF,MAAMG,MAAM,GAAGC,OAAO,CAAC,2BAA2B,CAAC;IAEnD,IAAID,MAAM,EAAEE,cAAc,EAAE;MAC1BL,MAAM,GAAGG,MAAM;MACf,OAAOH,MAAM;IACf;EACF,CAAC,CAAC,MAAM,CACR;EAEA,IAAI;IACFA,MAAM,GAAGI,OAAO,CAAC,oBAAoB,CAAC,IAAI,IAAI;EAChD,CAAC,CAAC,MAAM;IACNJ,MAAM,GAAG,IAAI;EACf;EACA,OAAOA,MAAM;AACf,CAAC;AAED,OAAO,MAAMM,wBAAwB,GAAGA,CAAA,KAAM;EAC5CN,MAAM,GAAGE,SAAS;AACpB,CAAC","ignoreList":[]}
|
|
@@ -227,17 +227,10 @@ export function ensureFilenameHasExtension(fileName, mime) {
|
|
|
227
227
|
return `${base}${getExtensionForMime(mime)}`;
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
*
|
|
237
|
-
* Always returns a string with a valid extension.
|
|
238
|
-
*/
|
|
239
|
-
export function deriveDisplayFilename(opts) {
|
|
240
|
-
const candidate = opts.fileName && opts.fileName.trim() || opts.originalName && opts.originalName.trim() || filenameFromUrl(opts.url) || '';
|
|
241
|
-
return ensureFilenameHasExtension(candidate, opts.mime);
|
|
242
|
-
}
|
|
230
|
+
// NOTE: the "which name wins" decision (originalName vs the stored
|
|
231
|
+
// fileName vs the URL) lives in helpers/getDisplayFileName.ts - that is
|
|
232
|
+
// the single source of truth used across display, save, share and
|
|
233
|
+
// download call sites (bug #40: this used to be duplicated here with
|
|
234
|
+
// the priority backwards, so attachments showed/saved under the
|
|
235
|
+
// server's hash name instead of the sender's original one).
|
|
243
236
|
//# sourceMappingURL=mimeToExtension.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MIME_TO_EXT","VALID_EXT_RE","AUDIO_EXTENSIONS","IOS_AUDIO_PLAYBACK_EXTENSIONS","IOS_AUDIO_UNSUPPORTED_EXTENSIONS","AUDIO_EXT_RE","RegExp","map","e","replace","join","IOS_AUDIO_PLAYBACK_EXT_RE","AUDIO_NAME_HINT_RE","isLikelyAudio","mime","fileName","url","opts","m","toLowerCase","startsWith","durationNum","duration","Number","isFinite","waveForm","trim","length","name","originalName","urlLast","filenameFromUrl","test","urlPath","noQuery","split","decodeURIComponent","getExtensionForMime","normalized","last","pop","getLowerExtension","value","match","shouldCacheAudioForIosPlayback","src","urlName","candidates","hasIosPlayableName","some","getIosAudioPlaybackCacheExtension","candidate","ext","isUnsupportedAudioForIosPlayback","includes","ensureFilenameHasExtension","base","Date","now"
|
|
1
|
+
{"version":3,"names":["MIME_TO_EXT","VALID_EXT_RE","AUDIO_EXTENSIONS","IOS_AUDIO_PLAYBACK_EXTENSIONS","IOS_AUDIO_UNSUPPORTED_EXTENSIONS","AUDIO_EXT_RE","RegExp","map","e","replace","join","IOS_AUDIO_PLAYBACK_EXT_RE","AUDIO_NAME_HINT_RE","isLikelyAudio","mime","fileName","url","opts","m","toLowerCase","startsWith","durationNum","duration","Number","isFinite","waveForm","trim","length","name","originalName","urlLast","filenameFromUrl","test","urlPath","noQuery","split","decodeURIComponent","getExtensionForMime","normalized","last","pop","getLowerExtension","value","match","shouldCacheAudioForIosPlayback","src","urlName","candidates","hasIosPlayableName","some","getIosAudioPlaybackCacheExtension","candidate","ext","isUnsupportedAudioForIosPlayback","includes","ensureFilenameHasExtension","base","Date","now"],"sourceRoot":"../../../src","sources":["helpers/mimeToExtension.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;EAAC;EAC1C,OAAO,GAAGA,IAAI,GAAGnB,mBAAmB,CAACvB,IAAI,CAAC,EAAE;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Count messages strictly newer than a given millisecond timestamp using
|
|
4
|
+
// `msg.id` (the server-authoritative microsecond timestamp prefixed by a
|
|
5
|
+
// 13-digit millis, see `helpers/dateComparison`'s
|
|
6
|
+
// `getHighResolutionTimestamp`) rather than `msg.date`, which can be
|
|
7
|
+
// derived client-side (`createMessageFromXml` falls back to `Date.now()`
|
|
8
|
+
// for realtime stanzas without a `date` attr) and drift from what the
|
|
9
|
+
// server actually assigned.
|
|
10
|
+
//
|
|
11
|
+
// Extracted to its own module (rather than living in roomsSlice.ts, its
|
|
12
|
+
// original home) so helpers that need the SAME ordering source - notably
|
|
13
|
+
// `insertMessageWithDelimiter.ts`, which decides where the "New messages"
|
|
14
|
+
// divider sits - can import it without creating a roomStore <-> helpers
|
|
15
|
+
// import cycle (roomsSlice.ts already imports insertMessageWithDelimiter).
|
|
16
|
+
// roomsSlice.ts re-exports this for backward compatibility with existing
|
|
17
|
+
// call sites.
|
|
18
|
+
export const msgSortableMs = msg => {
|
|
19
|
+
const id = String(msg?.id || '');
|
|
20
|
+
const m = /^(\d{13})/.exec(id);
|
|
21
|
+
if (m) {
|
|
22
|
+
return Number(m[1]);
|
|
23
|
+
}
|
|
24
|
+
if (msg?.date) {
|
|
25
|
+
const t = new Date(msg.date).getTime();
|
|
26
|
+
if (Number.isFinite(t)) {
|
|
27
|
+
return t;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return 0;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=msgSortableMs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["msgSortableMs","msg","id","String","m","exec","Number","date","t","Date","getTime","isFinite"],"sourceRoot":"../../../src","sources":["helpers/msgSortableMs.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,aAAa,GAAIC,GAAQ,IAAa;EACjD,MAAMC,EAAE,GAAGC,MAAM,CAACF,GAAG,EAAEC,EAAE,IAAI,EAAE,CAAC;EAChC,MAAME,CAAC,GAAG,WAAW,CAACC,IAAI,CAACH,EAAE,CAAC;EAC9B,IAAIE,CAAC,EAAE;IAAC,OAAOE,MAAM,CAACF,CAAC,CAAC,CAAC,CAAC,CAAC;EAAC;EAC5B,IAAIH,GAAG,EAAEM,IAAI,EAAE;IACb,MAAMC,CAAC,GAAG,IAAIC,IAAI,CAACR,GAAG,CAACM,IAAW,CAAC,CAACG,OAAO,CAAC,CAAC;IAC7C,IAAIJ,MAAM,CAACK,QAAQ,CAACH,CAAC,CAAC,EAAE;MAAC,OAAOA,CAAC;IAAC;EACpC;EACA,OAAO,CAAC;AACV,CAAC","ignoreList":[]}
|
|
@@ -4,6 +4,21 @@ import React from 'react';
|
|
|
4
4
|
import { Text, View, Pressable, Linking, Platform, ScrollView } from 'react-native';
|
|
5
5
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
6
|
let elementKeyCounter = 0;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Colours the parser needs. Helpers can't call hooks, so the caller passes
|
|
10
|
+
* the resolved theme (Message.tsx does); with nothing passed the historical
|
|
11
|
+
* hard-coded values apply, so the output is unchanged for other callers.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const DEFAULT_BODY_COLORS = {
|
|
15
|
+
primary: '#0a66c2',
|
|
16
|
+
text: '#24292f',
|
|
17
|
+
surface: '#fff',
|
|
18
|
+
surfaceSecondary: '#f6f8fa',
|
|
19
|
+
surfaceHighlight: '#e8f3ff',
|
|
20
|
+
border: '#e1e4e8'
|
|
21
|
+
};
|
|
7
22
|
export const decodeHTMLEntities = text => {
|
|
8
23
|
const entities = {
|
|
9
24
|
'&': '&',
|
|
@@ -19,7 +34,13 @@ export const decodeHTMLEntities = text => {
|
|
|
19
34
|
};
|
|
20
35
|
return text.replace(/&[a-zA-Z0-9#]+;/g, m => entities[m] || m);
|
|
21
36
|
};
|
|
22
|
-
|
|
37
|
+
|
|
38
|
+
// Only the colour-bearing entries read from `c`; the rest is static layout.
|
|
39
|
+
// Historical light values that were slightly off-token (#f1f3f4 inline code
|
|
40
|
+
// ground, #333 inline code ink, #d0d7de / #e7e9ec / #eef0f2 table hairlines)
|
|
41
|
+
// are kept when no theme is passed and collapse onto the theme tokens
|
|
42
|
+
// otherwise.
|
|
43
|
+
const buildStyles = (c, themed) => ({
|
|
23
44
|
bold: {
|
|
24
45
|
fontWeight: 'bold'
|
|
25
46
|
},
|
|
@@ -30,11 +51,11 @@ const styles = {
|
|
|
30
51
|
textDecorationLine: 'line-through'
|
|
31
52
|
},
|
|
32
53
|
link: {
|
|
33
|
-
color:
|
|
54
|
+
color: c.primary,
|
|
34
55
|
textDecorationLine: 'underline'
|
|
35
56
|
},
|
|
36
57
|
codeInlineBox: {
|
|
37
|
-
backgroundColor: '#f1f3f4',
|
|
58
|
+
backgroundColor: themed ? c.surfaceSecondary : '#f1f3f4',
|
|
38
59
|
borderRadius: 3,
|
|
39
60
|
paddingVertical: 1,
|
|
40
61
|
paddingHorizontal: 4
|
|
@@ -45,14 +66,14 @@ const styles = {
|
|
|
45
66
|
android: 'monospace'
|
|
46
67
|
}),
|
|
47
68
|
fontSize: 13,
|
|
48
|
-
color: '#333'
|
|
69
|
+
color: themed ? c.text : '#333'
|
|
49
70
|
},
|
|
50
71
|
codeBlock: {
|
|
51
|
-
backgroundColor:
|
|
72
|
+
backgroundColor: c.surfaceSecondary,
|
|
52
73
|
padding: 12,
|
|
53
74
|
borderRadius: 6,
|
|
54
75
|
borderWidth: 1,
|
|
55
|
-
borderColor:
|
|
76
|
+
borderColor: c.border,
|
|
56
77
|
marginVertical: 8
|
|
57
78
|
},
|
|
58
79
|
codeBlockText: {
|
|
@@ -61,30 +82,45 @@ const styles = {
|
|
|
61
82
|
android: 'monospace'
|
|
62
83
|
}),
|
|
63
84
|
fontSize: 14,
|
|
64
|
-
color:
|
|
85
|
+
color: c.text,
|
|
65
86
|
lineHeight: 20
|
|
66
87
|
},
|
|
67
88
|
h: [{
|
|
89
|
+
...(themed ? {
|
|
90
|
+
color: c.text
|
|
91
|
+
} : null),
|
|
68
92
|
fontWeight: 'bold',
|
|
69
93
|
fontSize: 32,
|
|
70
94
|
marginTop: 24,
|
|
71
95
|
marginBottom: 16
|
|
72
96
|
}, {
|
|
97
|
+
...(themed ? {
|
|
98
|
+
color: c.text
|
|
99
|
+
} : null),
|
|
73
100
|
fontWeight: 'bold',
|
|
74
101
|
fontSize: 24,
|
|
75
102
|
marginTop: 20,
|
|
76
103
|
marginBottom: 14
|
|
77
104
|
}, {
|
|
105
|
+
...(themed ? {
|
|
106
|
+
color: c.text
|
|
107
|
+
} : null),
|
|
78
108
|
fontWeight: 'bold',
|
|
79
109
|
fontSize: 20,
|
|
80
110
|
marginTop: 16,
|
|
81
111
|
marginBottom: 12
|
|
82
112
|
}, {
|
|
113
|
+
...(themed ? {
|
|
114
|
+
color: c.text
|
|
115
|
+
} : null),
|
|
83
116
|
fontWeight: 'bold',
|
|
84
117
|
fontSize: 18,
|
|
85
118
|
marginTop: 14,
|
|
86
119
|
marginBottom: 10
|
|
87
120
|
}, {
|
|
121
|
+
...(themed ? {
|
|
122
|
+
color: c.text
|
|
123
|
+
} : null),
|
|
88
124
|
fontWeight: 'bold',
|
|
89
125
|
fontSize: 16,
|
|
90
126
|
marginTop: 12,
|
|
@@ -97,7 +133,7 @@ const styles = {
|
|
|
97
133
|
}],
|
|
98
134
|
quote: {
|
|
99
135
|
borderLeftWidth: 3,
|
|
100
|
-
borderLeftColor: '#ccc',
|
|
136
|
+
borderLeftColor: themed ? c.border : '#ccc',
|
|
101
137
|
paddingLeft: 10,
|
|
102
138
|
marginVertical: 4
|
|
103
139
|
},
|
|
@@ -106,7 +142,7 @@ const styles = {
|
|
|
106
142
|
},
|
|
107
143
|
hr: {
|
|
108
144
|
height: 1,
|
|
109
|
-
backgroundColor:
|
|
145
|
+
backgroundColor: c.border,
|
|
110
146
|
marginVertical: 20
|
|
111
147
|
},
|
|
112
148
|
listItemRow: {
|
|
@@ -128,24 +164,28 @@ const styles = {
|
|
|
128
164
|
marginTop: 2,
|
|
129
165
|
borderRadius: 3,
|
|
130
166
|
borderWidth: 1,
|
|
131
|
-
borderColor: '#bbb',
|
|
132
|
-
backgroundColor:
|
|
167
|
+
borderColor: themed ? c.border : '#bbb',
|
|
168
|
+
backgroundColor: c.surface,
|
|
133
169
|
alignItems: 'center',
|
|
134
170
|
justifyContent: 'center'
|
|
135
171
|
},
|
|
172
|
+
checkboxBoxChecked: {
|
|
173
|
+
backgroundColor: c.surfaceHighlight,
|
|
174
|
+
borderColor: c.primary
|
|
175
|
+
},
|
|
136
176
|
checkboxTick: {
|
|
137
177
|
fontSize: 12,
|
|
138
|
-
color:
|
|
178
|
+
color: c.primary
|
|
139
179
|
},
|
|
140
180
|
tableContainer: {
|
|
141
181
|
marginVertical: 12
|
|
142
182
|
},
|
|
143
183
|
tableInner: {
|
|
144
184
|
borderWidth: 1,
|
|
145
|
-
borderColor: '#d0d7de',
|
|
185
|
+
borderColor: themed ? c.border : '#d0d7de',
|
|
146
186
|
borderRadius: 6,
|
|
147
187
|
overflow: 'hidden',
|
|
148
|
-
backgroundColor:
|
|
188
|
+
backgroundColor: c.surface
|
|
149
189
|
},
|
|
150
190
|
tableRow: {
|
|
151
191
|
flexDirection: 'row'
|
|
@@ -154,27 +194,47 @@ const styles = {
|
|
|
154
194
|
flex: 1,
|
|
155
195
|
paddingVertical: 10,
|
|
156
196
|
paddingHorizontal: 12,
|
|
157
|
-
backgroundColor:
|
|
197
|
+
backgroundColor: c.surfaceSecondary,
|
|
158
198
|
borderRightWidth: 1,
|
|
159
|
-
borderRightColor: '#d0d7de'
|
|
199
|
+
borderRightColor: themed ? c.border : '#d0d7de'
|
|
160
200
|
},
|
|
161
201
|
td: {
|
|
162
202
|
flex: 1,
|
|
163
203
|
paddingVertical: 10,
|
|
164
204
|
paddingHorizontal: 12,
|
|
165
205
|
borderTopWidth: 1,
|
|
166
|
-
borderTopColor: '#e7e9ec',
|
|
206
|
+
borderTopColor: themed ? c.border : '#e7e9ec',
|
|
167
207
|
borderRightWidth: 1,
|
|
168
|
-
borderRightColor: '#eef0f2'
|
|
208
|
+
borderRightColor: themed ? c.border : '#eef0f2'
|
|
169
209
|
},
|
|
170
210
|
lastCell: {
|
|
171
211
|
borderRightWidth: 0
|
|
172
212
|
},
|
|
173
213
|
cellText: {
|
|
174
|
-
color:
|
|
214
|
+
color: c.text,
|
|
175
215
|
fontSize: 14,
|
|
176
216
|
lineHeight: 20
|
|
177
217
|
}
|
|
218
|
+
});
|
|
219
|
+
const DEFAULT_STYLES = buildStyles(DEFAULT_BODY_COLORS, false);
|
|
220
|
+
|
|
221
|
+
// Module-level like `elementKeyCounter`: parseMessageBody is synchronous,
|
|
222
|
+
// so setting this at entry is safe, and it keeps the render helpers below
|
|
223
|
+
// signature-free. The theme object from useTheme is memoized, so the
|
|
224
|
+
// one-entry cache means styles are rebuilt only when the palette changes,
|
|
225
|
+
// not per message.
|
|
226
|
+
let styles = DEFAULT_STYLES;
|
|
227
|
+
let cachedTheme;
|
|
228
|
+
let cachedStyles = DEFAULT_STYLES;
|
|
229
|
+
const resolveStyles = theme => {
|
|
230
|
+
if (!theme) {
|
|
231
|
+
return DEFAULT_STYLES;
|
|
232
|
+
}
|
|
233
|
+
if (theme !== cachedTheme) {
|
|
234
|
+
cachedTheme = theme;
|
|
235
|
+
cachedStyles = buildStyles(theme, true);
|
|
236
|
+
}
|
|
237
|
+
return cachedStyles;
|
|
178
238
|
};
|
|
179
239
|
const renderTextWithLinks = text => {
|
|
180
240
|
const urlRegex = /(https?:\/\/[\w.-]+(?:\.[\w.-]+)+[\w\-\._~:\/?#[\]@!\$&'()\*\+,;=.]+)/g;
|
|
@@ -318,13 +378,14 @@ const renderMarkdownTableRN = (headers, separator, dataRows) => {
|
|
|
318
378
|
// and code blocks keep their own semantic sizes. Markdown wraps text in
|
|
319
379
|
// <View>s, which break RN's Text-style inheritance — so the size has to be set
|
|
320
380
|
// on the leaf <Text>s here rather than on the bubble wrapper.
|
|
321
|
-
export const parseMessageBody = (text, baseStyle) => {
|
|
381
|
+
export const parseMessageBody = (text, baseStyle, theme) => {
|
|
322
382
|
if (typeof text !== 'string') {
|
|
323
383
|
return /*#__PURE__*/_jsx(View, {});
|
|
324
384
|
}
|
|
325
385
|
const lines = text.split('\n');
|
|
326
386
|
const elements = [];
|
|
327
387
|
elementKeyCounter = 0;
|
|
388
|
+
styles = resolveStyles(theme);
|
|
328
389
|
let listBuffer = [];
|
|
329
390
|
let inCodeBlock = false;
|
|
330
391
|
let codeLang = '';
|
|
@@ -351,10 +412,7 @@ export const parseMessageBody = (text, baseStyle) => {
|
|
|
351
412
|
contentEl = /*#__PURE__*/_jsxs(View, {
|
|
352
413
|
style: styles.checkboxRow,
|
|
353
414
|
children: [/*#__PURE__*/_jsx(View, {
|
|
354
|
-
style: [styles.checkboxBox, item.checked &&
|
|
355
|
-
backgroundColor: '#e8f3ff',
|
|
356
|
-
borderColor: '#0a66c2'
|
|
357
|
-
}],
|
|
415
|
+
style: [styles.checkboxBox, item.checked && styles.checkboxBoxChecked],
|
|
358
416
|
children: item.checked ? /*#__PURE__*/_jsx(Text, {
|
|
359
417
|
style: styles.checkboxTick,
|
|
360
418
|
children: "\u2713"
|