stream-chat-react-native-core 10.0.0-rc.2 → 10.0.0-rc.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/lib/commonjs/ai-components/README.md +50 -2
- package/lib/commonjs/ai-components/index.js +24 -0
- package/lib/commonjs/ai-components/index.js.map +1 -1
- package/lib/commonjs/ai-components/message-composer/ComposerView.js +4 -2
- package/lib/commonjs/ai-components/message-composer/ComposerView.js.map +1 -1
- package/lib/commonjs/ai-components/message-composer/SpeechToTextButton.js +4 -1
- package/lib/commonjs/ai-components/message-composer/SpeechToTextButton.js.map +1 -1
- package/lib/commonjs/ai-components/native/AIDictation.js +6 -0
- package/lib/commonjs/ai-components/native/AIDictation.js.map +1 -1
- package/lib/commonjs/ai-components/store/dictation/store.js +4 -2
- package/lib/commonjs/ai-components/store/dictation/store.js.map +1 -1
- package/lib/commonjs/ai-components/store/dictation/useDictationState.js +4 -2
- package/lib/commonjs/ai-components/store/dictation/useDictationState.js.map +1 -1
- package/lib/commonjs/ai-components/store/index.js +22 -0
- package/lib/commonjs/ai-components/store/index.js.map +1 -1
- package/lib/commonjs/ai-components/theme.js +3 -0
- package/lib/commonjs/ai-components/theme.js.map +1 -1
- package/lib/commonjs/ai-components/transcription/useDictation.js +7 -3
- package/lib/commonjs/ai-components/transcription/useDictation.js.map +1 -1
- package/lib/commonjs/ai-components/transcription/useDictationAudioLevel.js +32 -0
- package/lib/commonjs/ai-components/transcription/useDictationAudioLevel.js.map +1 -0
- package/lib/commonjs/ai-components/voice-visualization/VoiceGlow.js +79 -0
- package/lib/commonjs/ai-components/voice-visualization/VoiceGlow.js.map +1 -0
- package/lib/commonjs/ai-components/voice-visualization/VoiceVisualizationView.js +147 -0
- package/lib/commonjs/ai-components/voice-visualization/VoiceVisualizationView.js.map +1 -0
- package/lib/commonjs/ai-components/voice-visualization/VoiceWave.js +58 -0
- package/lib/commonjs/ai-components/voice-visualization/VoiceWave.js.map +1 -0
- package/lib/commonjs/ai-components/voice-visualization/bounce.js +60 -0
- package/lib/commonjs/ai-components/voice-visualization/bounce.js.map +1 -0
- package/lib/commonjs/ai-components/voice-visualization/driver.js +208 -0
- package/lib/commonjs/ai-components/voice-visualization/driver.js.map +1 -0
- package/lib/commonjs/ai-components/voice-visualization/glowShader.js +218 -0
- package/lib/commonjs/ai-components/voice-visualization/glowShader.js.map +1 -0
- package/lib/commonjs/ai-components/voice-visualization/index.js +18 -0
- package/lib/commonjs/ai-components/voice-visualization/index.js.map +1 -0
- package/lib/commonjs/ai-components/voice-visualization/math.js +70 -0
- package/lib/commonjs/ai-components/voice-visualization/math.js.map +1 -0
- package/lib/commonjs/ai-components/voice-visualization/palette.js +47 -0
- package/lib/commonjs/ai-components/voice-visualization/palette.js.map +1 -0
- package/lib/commonjs/ai-components/voice-visualization/simplex.js +77 -0
- package/lib/commonjs/ai-components/voice-visualization/simplex.js.map +1 -0
- package/lib/commonjs/ai-components/voice-visualization/styles.js +33 -0
- package/lib/commonjs/ai-components/voice-visualization/styles.js.map +1 -0
- package/lib/commonjs/ai-components/voice-visualization/types.js +4 -0
- package/lib/commonjs/ai-components/voice-visualization/types.js.map +1 -0
- package/lib/commonjs/ai-components/voice-visualization/useReduceMotion.js +28 -0
- package/lib/commonjs/ai-components/voice-visualization/useReduceMotion.js.map +1 -0
- package/lib/commonjs/ai-components/voice-visualization/useVoiceVisualization.js +129 -0
- package/lib/commonjs/ai-components/voice-visualization/useVoiceVisualization.js.map +1 -0
- package/lib/commonjs/ai-components/voice-visualization/waveGeometry.js +124 -0
- package/lib/commonjs/ai-components/voice-visualization/waveGeometry.js.map +1 -0
- package/lib/commonjs/components/Channel/hooks/useChannelLifecycle.js +2 -1
- package/lib/commonjs/components/Channel/hooks/useChannelLifecycle.js.map +1 -1
- package/lib/commonjs/components/ChannelDetails/components/members/ChannelMemberItem.js +1 -1
- package/lib/commonjs/components/ChannelDetails/components/members/ChannelMemberItem.js.map +1 -1
- package/lib/commonjs/components/ChannelDetails/hooks/useChannelDetailsMemberStatusText.js +1 -1
- package/lib/commonjs/components/ChannelDetails/hooks/useChannelDetailsMemberStatusText.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListView.js +0 -2
- package/lib/commonjs/components/ChannelList/ChannelListView.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js +1 -1
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelDetailsBottomSheet.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelDetailsBottomSheet.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelLastMessagePreview.js +1 -0
- package/lib/commonjs/components/ChannelPreview/ChannelLastMessagePreview.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelMessagePreviewDeliveryStatus.js +2 -0
- package/lib/commonjs/components/ChannelPreview/ChannelMessagePreviewDeliveryStatus.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewTitle.js +1 -0
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewTitle.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewView.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewView.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewData.js +5 -5
- package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewData.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.js +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewPollLabel.js +4 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewPollLabel.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useConnectionLifecycle.js +6 -2
- package/lib/commonjs/components/Chat/hooks/useConnectionLifecycle.js.map +1 -1
- package/lib/commonjs/components/Indicators/LoadingErrorIndicator.js +5 -0
- package/lib/commonjs/components/Indicators/LoadingErrorIndicator.js.map +1 -1
- package/lib/commonjs/components/Message/Message.js +1 -1
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageStatus.js +4 -0
- package/lib/commonjs/components/Message/MessageItemView/MessageStatus.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageWrapper.js +7 -4
- package/lib/commonjs/components/Message/MessageItemView/MessageWrapper.js.map +1 -1
- package/lib/commonjs/components/Message/hooks/useCreateMessageActionHandlers.js +3 -3
- package/lib/commonjs/components/Message/hooks/useCreateMessageActionHandlers.js.map +1 -1
- package/lib/commonjs/components/Message/hooks/useProcessReactions.js +2 -2
- package/lib/commonjs/components/Message/hooks/useProcessReactions.js.map +1 -1
- package/lib/commonjs/components/Message/hooks/useUserMuteActive.js +1 -1
- package/lib/commonjs/components/Message/hooks/useUserMuteActive.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MessageComposer.js +2 -1
- package/lib/commonjs/components/MessageInput/MessageComposer.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageFlashList.js +2 -2
- package/lib/commonjs/components/MessageList/MessageFlashList.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageList.js +2 -2
- package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
- package/lib/commonjs/components/MessageList/hooks/useOwnUnreadCount.js +1 -1
- package/lib/commonjs/components/MessageList/hooks/useOwnUnreadCount.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/MessageUserReactionsItem.js +1 -1
- package/lib/commonjs/components/MessageMenu/MessageUserReactionsItem.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/hooks/useMessageOwnReactions.js +2 -2
- package/lib/commonjs/components/MessageMenu/hooks/useMessageOwnReactions.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollAnswersList.js +1 -1
- package/lib/commonjs/components/Poll/components/PollAnswersList.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollButtons.js +1 -1
- package/lib/commonjs/components/Poll/components/PollButtons.js.map +1 -1
- package/lib/commonjs/components/Poll/hook/useIsPollCreatedByCurrentUser.js +1 -1
- package/lib/commonjs/components/Poll/hook/useIsPollCreatedByCurrentUser.js.map +1 -1
- package/lib/commonjs/components/Thread/Thread.js +1 -1
- package/lib/commonjs/components/Thread/Thread.js.map +1 -1
- package/lib/commonjs/components/ThreadList/ThreadListItem.js +1 -1
- package/lib/commonjs/components/ThreadList/ThreadListItem.js.map +1 -1
- package/lib/commonjs/components/ThreadList/ThreadListUnreadBanner.js +9 -2
- package/lib/commonjs/components/ThreadList/ThreadListUnreadBanner.js.map +1 -1
- package/lib/commonjs/components/index.js +24 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/contexts/componentsContext/defaultComponents.js +0 -2
- package/lib/commonjs/contexts/componentsContext/defaultComponents.js.map +1 -1
- package/lib/commonjs/contexts/liveLocationManagerContext/LiveLocationManagerContext.js +1 -1
- package/lib/commonjs/contexts/liveLocationManagerContext/LiveLocationManagerContext.js.map +1 -1
- package/lib/commonjs/hooks/actions/useChannelActionItems.js +1 -1
- package/lib/commonjs/hooks/actions/useChannelActionItems.js.map +1 -1
- package/lib/commonjs/hooks/actions/useChannelActions.js +2 -2
- package/lib/commonjs/hooks/actions/useChannelActions.js.map +1 -1
- package/lib/commonjs/hooks/actions/useChannelMemberActionItems.js +1 -1
- package/lib/commonjs/hooks/actions/useChannelMemberActionItems.js.map +1 -1
- package/lib/commonjs/hooks/index.js +11 -0
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/hooks/messagePreview/useMessageDeliveryStatus.js +6 -6
- package/lib/commonjs/hooks/messagePreview/useMessageDeliveryStatus.js.map +1 -1
- package/lib/commonjs/hooks/useIsDirectChat.js +1 -1
- package/lib/commonjs/hooks/useIsDirectChat.js.map +1 -1
- package/lib/commonjs/i18n/runtimeDefaults.js +1 -0
- package/lib/commonjs/i18n/runtimeDefaults.js.map +1 -1
- package/lib/commonjs/store/apis/getChannelMessages.js +5 -3
- package/lib/commonjs/store/apis/getChannelMessages.js.map +1 -1
- package/lib/commonjs/store/apis/getChannels.js +6 -3
- package/lib/commonjs/store/apis/getChannels.js.map +1 -1
- package/lib/commonjs/store/apis/getChannelsForFilterSort.js +2 -1
- package/lib/commonjs/store/apis/getChannelsForFilterSort.js.map +1 -1
- package/lib/commonjs/store/apis/queries/selectMessagesForChannels.js +7 -5
- package/lib/commonjs/store/apis/queries/selectMessagesForChannels.js.map +1 -1
- package/lib/commonjs/utils/installNativeMultipartAdapter.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/ai-components/README.md +50 -2
- package/lib/module/ai-components/index.js +24 -0
- package/lib/module/ai-components/index.js.map +1 -1
- package/lib/module/ai-components/message-composer/ComposerView.js +4 -2
- package/lib/module/ai-components/message-composer/ComposerView.js.map +1 -1
- package/lib/module/ai-components/message-composer/SpeechToTextButton.js +4 -1
- package/lib/module/ai-components/message-composer/SpeechToTextButton.js.map +1 -1
- package/lib/module/ai-components/native/AIDictation.js +6 -0
- package/lib/module/ai-components/native/AIDictation.js.map +1 -1
- package/lib/module/ai-components/store/dictation/store.js +4 -2
- package/lib/module/ai-components/store/dictation/store.js.map +1 -1
- package/lib/module/ai-components/store/dictation/useDictationState.js +4 -2
- package/lib/module/ai-components/store/dictation/useDictationState.js.map +1 -1
- package/lib/module/ai-components/store/index.js +22 -0
- package/lib/module/ai-components/store/index.js.map +1 -1
- package/lib/module/ai-components/theme.js +3 -0
- package/lib/module/ai-components/theme.js.map +1 -1
- package/lib/module/ai-components/transcription/useDictation.js +7 -3
- package/lib/module/ai-components/transcription/useDictation.js.map +1 -1
- package/lib/module/ai-components/transcription/useDictationAudioLevel.js +32 -0
- package/lib/module/ai-components/transcription/useDictationAudioLevel.js.map +1 -0
- package/lib/module/ai-components/voice-visualization/VoiceGlow.js +79 -0
- package/lib/module/ai-components/voice-visualization/VoiceGlow.js.map +1 -0
- package/lib/module/ai-components/voice-visualization/VoiceVisualizationView.js +147 -0
- package/lib/module/ai-components/voice-visualization/VoiceVisualizationView.js.map +1 -0
- package/lib/module/ai-components/voice-visualization/VoiceWave.js +58 -0
- package/lib/module/ai-components/voice-visualization/VoiceWave.js.map +1 -0
- package/lib/module/ai-components/voice-visualization/bounce.js +60 -0
- package/lib/module/ai-components/voice-visualization/bounce.js.map +1 -0
- package/lib/module/ai-components/voice-visualization/driver.js +208 -0
- package/lib/module/ai-components/voice-visualization/driver.js.map +1 -0
- package/lib/module/ai-components/voice-visualization/glowShader.js +218 -0
- package/lib/module/ai-components/voice-visualization/glowShader.js.map +1 -0
- package/lib/module/ai-components/voice-visualization/index.js +18 -0
- package/lib/module/ai-components/voice-visualization/index.js.map +1 -0
- package/lib/module/ai-components/voice-visualization/math.js +70 -0
- package/lib/module/ai-components/voice-visualization/math.js.map +1 -0
- package/lib/module/ai-components/voice-visualization/palette.js +47 -0
- package/lib/module/ai-components/voice-visualization/palette.js.map +1 -0
- package/lib/module/ai-components/voice-visualization/simplex.js +77 -0
- package/lib/module/ai-components/voice-visualization/simplex.js.map +1 -0
- package/lib/module/ai-components/voice-visualization/styles.js +33 -0
- package/lib/module/ai-components/voice-visualization/styles.js.map +1 -0
- package/lib/module/ai-components/voice-visualization/types.js +4 -0
- package/lib/module/ai-components/voice-visualization/types.js.map +1 -0
- package/lib/module/ai-components/voice-visualization/useReduceMotion.js +28 -0
- package/lib/module/ai-components/voice-visualization/useReduceMotion.js.map +1 -0
- package/lib/module/ai-components/voice-visualization/useVoiceVisualization.js +129 -0
- package/lib/module/ai-components/voice-visualization/useVoiceVisualization.js.map +1 -0
- package/lib/module/ai-components/voice-visualization/waveGeometry.js +124 -0
- package/lib/module/ai-components/voice-visualization/waveGeometry.js.map +1 -0
- package/lib/module/components/Channel/hooks/useChannelLifecycle.js +2 -1
- package/lib/module/components/Channel/hooks/useChannelLifecycle.js.map +1 -1
- package/lib/module/components/ChannelDetails/components/members/ChannelMemberItem.js +1 -1
- package/lib/module/components/ChannelDetails/components/members/ChannelMemberItem.js.map +1 -1
- package/lib/module/components/ChannelDetails/hooks/useChannelDetailsMemberStatusText.js +1 -1
- package/lib/module/components/ChannelDetails/hooks/useChannelDetailsMemberStatusText.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListView.js +0 -2
- package/lib/module/components/ChannelList/ChannelListView.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js +1 -1
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelDetailsBottomSheet.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelDetailsBottomSheet.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelLastMessagePreview.js +1 -0
- package/lib/module/components/ChannelPreview/ChannelLastMessagePreview.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelMessagePreviewDeliveryStatus.js +2 -0
- package/lib/module/components/ChannelPreview/ChannelMessagePreviewDeliveryStatus.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewTitle.js +1 -0
- package/lib/module/components/ChannelPreview/ChannelPreviewTitle.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewView.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewView.js.map +1 -1
- package/lib/module/components/ChannelPreview/hooks/useChannelPreviewData.js +5 -5
- package/lib/module/components/ChannelPreview/hooks/useChannelPreviewData.js.map +1 -1
- package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js +1 -1
- package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js.map +1 -1
- package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.js +1 -1
- package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.js.map +1 -1
- package/lib/module/components/ChannelPreview/hooks/useChannelPreviewPollLabel.js +4 -1
- package/lib/module/components/ChannelPreview/hooks/useChannelPreviewPollLabel.js.map +1 -1
- package/lib/module/components/Chat/hooks/useConnectionLifecycle.js +6 -2
- package/lib/module/components/Chat/hooks/useConnectionLifecycle.js.map +1 -1
- package/lib/module/components/Indicators/LoadingErrorIndicator.js +5 -0
- package/lib/module/components/Indicators/LoadingErrorIndicator.js.map +1 -1
- package/lib/module/components/Message/Message.js +1 -1
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/MessageStatus.js +4 -0
- package/lib/module/components/Message/MessageItemView/MessageStatus.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/MessageWrapper.js +7 -4
- package/lib/module/components/Message/MessageItemView/MessageWrapper.js.map +1 -1
- package/lib/module/components/Message/hooks/useCreateMessageActionHandlers.js +3 -3
- package/lib/module/components/Message/hooks/useCreateMessageActionHandlers.js.map +1 -1
- package/lib/module/components/Message/hooks/useProcessReactions.js +2 -2
- package/lib/module/components/Message/hooks/useProcessReactions.js.map +1 -1
- package/lib/module/components/Message/hooks/useUserMuteActive.js +1 -1
- package/lib/module/components/Message/hooks/useUserMuteActive.js.map +1 -1
- package/lib/module/components/MessageInput/MessageComposer.js +2 -1
- package/lib/module/components/MessageInput/MessageComposer.js.map +1 -1
- package/lib/module/components/MessageList/MessageFlashList.js +2 -2
- package/lib/module/components/MessageList/MessageFlashList.js.map +1 -1
- package/lib/module/components/MessageList/MessageList.js +2 -2
- package/lib/module/components/MessageList/MessageList.js.map +1 -1
- package/lib/module/components/MessageList/hooks/useOwnUnreadCount.js +1 -1
- package/lib/module/components/MessageList/hooks/useOwnUnreadCount.js.map +1 -1
- package/lib/module/components/MessageMenu/MessageUserReactionsItem.js +1 -1
- package/lib/module/components/MessageMenu/MessageUserReactionsItem.js.map +1 -1
- package/lib/module/components/MessageMenu/hooks/useMessageOwnReactions.js +2 -2
- package/lib/module/components/MessageMenu/hooks/useMessageOwnReactions.js.map +1 -1
- package/lib/module/components/Poll/components/PollAnswersList.js +1 -1
- package/lib/module/components/Poll/components/PollAnswersList.js.map +1 -1
- package/lib/module/components/Poll/components/PollButtons.js +1 -1
- package/lib/module/components/Poll/components/PollButtons.js.map +1 -1
- package/lib/module/components/Poll/hook/useIsPollCreatedByCurrentUser.js +1 -1
- package/lib/module/components/Poll/hook/useIsPollCreatedByCurrentUser.js.map +1 -1
- package/lib/module/components/Thread/Thread.js +1 -1
- package/lib/module/components/Thread/Thread.js.map +1 -1
- package/lib/module/components/ThreadList/ThreadListItem.js +1 -1
- package/lib/module/components/ThreadList/ThreadListItem.js.map +1 -1
- package/lib/module/components/ThreadList/ThreadListUnreadBanner.js +9 -2
- package/lib/module/components/ThreadList/ThreadListUnreadBanner.js.map +1 -1
- package/lib/module/components/index.js +24 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/contexts/componentsContext/defaultComponents.js +0 -2
- package/lib/module/contexts/componentsContext/defaultComponents.js.map +1 -1
- package/lib/module/contexts/liveLocationManagerContext/LiveLocationManagerContext.js +1 -1
- package/lib/module/contexts/liveLocationManagerContext/LiveLocationManagerContext.js.map +1 -1
- package/lib/module/hooks/actions/useChannelActionItems.js +1 -1
- package/lib/module/hooks/actions/useChannelActionItems.js.map +1 -1
- package/lib/module/hooks/actions/useChannelActions.js +2 -2
- package/lib/module/hooks/actions/useChannelActions.js.map +1 -1
- package/lib/module/hooks/actions/useChannelMemberActionItems.js +1 -1
- package/lib/module/hooks/actions/useChannelMemberActionItems.js.map +1 -1
- package/lib/module/hooks/index.js +11 -0
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/messagePreview/useMessageDeliveryStatus.js +6 -6
- package/lib/module/hooks/messagePreview/useMessageDeliveryStatus.js.map +1 -1
- package/lib/module/hooks/useIsDirectChat.js +1 -1
- package/lib/module/hooks/useIsDirectChat.js.map +1 -1
- package/lib/module/i18n/runtimeDefaults.js +1 -0
- package/lib/module/i18n/runtimeDefaults.js.map +1 -1
- package/lib/module/store/apis/getChannelMessages.js +5 -3
- package/lib/module/store/apis/getChannelMessages.js.map +1 -1
- package/lib/module/store/apis/getChannels.js +6 -3
- package/lib/module/store/apis/getChannels.js.map +1 -1
- package/lib/module/store/apis/getChannelsForFilterSort.js +2 -1
- package/lib/module/store/apis/getChannelsForFilterSort.js.map +1 -1
- package/lib/module/store/apis/queries/selectMessagesForChannels.js +7 -5
- package/lib/module/store/apis/queries/selectMessagesForChannels.js.map +1 -1
- package/lib/module/utils/installNativeMultipartAdapter.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/ai-components/index.d.ts +3 -1
- package/lib/typescript/ai-components/index.d.ts.map +1 -1
- package/lib/typescript/ai-components/message-composer/ComposerView.d.ts.map +1 -1
- package/lib/typescript/ai-components/native/AIDictation.d.ts +6 -0
- package/lib/typescript/ai-components/native/AIDictation.d.ts.map +1 -1
- package/lib/typescript/ai-components/store/dictation/store.d.ts +7 -0
- package/lib/typescript/ai-components/store/dictation/store.d.ts.map +1 -1
- package/lib/typescript/ai-components/store/dictation/useDictationState.d.ts +1 -0
- package/lib/typescript/ai-components/store/dictation/useDictationState.d.ts.map +1 -1
- package/lib/typescript/ai-components/store/index.d.ts +2 -0
- package/lib/typescript/ai-components/store/index.d.ts.map +1 -1
- package/lib/typescript/ai-components/theme.d.ts +13 -0
- package/lib/typescript/ai-components/theme.d.ts.map +1 -1
- package/lib/typescript/ai-components/transcription/useDictation.d.ts +9 -1
- package/lib/typescript/ai-components/transcription/useDictation.d.ts.map +1 -1
- package/lib/typescript/ai-components/transcription/useDictationAudioLevel.d.ts +11 -0
- package/lib/typescript/ai-components/transcription/useDictationAudioLevel.d.ts.map +1 -0
- package/lib/typescript/ai-components/voice-visualization/VoiceGlow.d.ts +13 -0
- package/lib/typescript/ai-components/voice-visualization/VoiceGlow.d.ts.map +1 -0
- package/lib/typescript/ai-components/voice-visualization/VoiceVisualizationView.d.ts +26 -0
- package/lib/typescript/ai-components/voice-visualization/VoiceVisualizationView.d.ts.map +1 -0
- package/lib/typescript/ai-components/voice-visualization/VoiceWave.d.ts +13 -0
- package/lib/typescript/ai-components/voice-visualization/VoiceWave.d.ts.map +1 -0
- package/lib/typescript/ai-components/voice-visualization/bounce.d.ts +20 -0
- package/lib/typescript/ai-components/voice-visualization/bounce.d.ts.map +1 -0
- package/lib/typescript/ai-components/voice-visualization/driver.d.ts +96 -0
- package/lib/typescript/ai-components/voice-visualization/driver.d.ts.map +1 -0
- package/lib/typescript/ai-components/voice-visualization/glowShader.d.ts +7 -0
- package/lib/typescript/ai-components/voice-visualization/glowShader.d.ts.map +1 -0
- package/lib/typescript/ai-components/voice-visualization/index.d.ts +4 -0
- package/lib/typescript/ai-components/voice-visualization/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/voice-visualization/math.d.ts +26 -0
- package/lib/typescript/ai-components/voice-visualization/math.d.ts.map +1 -0
- package/lib/typescript/ai-components/voice-visualization/palette.d.ts +18 -0
- package/lib/typescript/ai-components/voice-visualization/palette.d.ts.map +1 -0
- package/lib/typescript/ai-components/voice-visualization/simplex.d.ts +11 -0
- package/lib/typescript/ai-components/voice-visualization/simplex.d.ts.map +1 -0
- package/lib/typescript/ai-components/voice-visualization/styles.d.ts +24 -0
- package/lib/typescript/ai-components/voice-visualization/styles.d.ts.map +1 -0
- package/lib/typescript/ai-components/voice-visualization/types.d.ts +45 -0
- package/lib/typescript/ai-components/voice-visualization/types.d.ts.map +1 -0
- package/lib/typescript/ai-components/voice-visualization/useReduceMotion.d.ts +10 -0
- package/lib/typescript/ai-components/voice-visualization/useReduceMotion.d.ts.map +1 -0
- package/lib/typescript/ai-components/voice-visualization/useVoiceVisualization.d.ts +18 -0
- package/lib/typescript/ai-components/voice-visualization/useVoiceVisualization.d.ts.map +1 -0
- package/lib/typescript/ai-components/voice-visualization/waveGeometry.d.ts +25 -0
- package/lib/typescript/ai-components/voice-visualization/waveGeometry.d.ts.map +1 -0
- package/lib/typescript/components/Channel/hooks/useChannelLifecycle.d.ts.map +1 -1
- package/lib/typescript/components/ChannelList/ChannelListView.d.ts +1 -1
- package/lib/typescript/components/ChannelList/ChannelListView.d.ts.map +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelMessagePreviewDeliveryStatus.d.ts.map +1 -1
- package/lib/typescript/components/ChannelPreview/hooks/useChannelPreviewData.d.ts.map +1 -1
- package/lib/typescript/components/Chat/hooks/useConnectionLifecycle.d.ts +5 -4
- package/lib/typescript/components/Chat/hooks/useConnectionLifecycle.d.ts.map +1 -1
- package/lib/typescript/components/Indicators/LoadingErrorIndicator.d.ts +1 -1
- package/lib/typescript/components/Indicators/LoadingErrorIndicator.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageStatus.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageWrapper.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/MessageComposer.d.ts.map +1 -1
- package/lib/typescript/components/ThreadList/ThreadListUnreadBanner.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +2 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/contexts/componentsContext/defaultComponents.d.ts +0 -1
- package/lib/typescript/contexts/componentsContext/defaultComponents.d.ts.map +1 -1
- package/lib/typescript/hooks/index.d.ts +1 -0
- package/lib/typescript/hooks/index.d.ts.map +1 -1
- package/lib/typescript/hooks/messagePreview/useMessageDeliveryStatus.d.ts +3 -0
- package/lib/typescript/hooks/messagePreview/useMessageDeliveryStatus.d.ts.map +1 -1
- package/lib/typescript/i18n/keys.d.ts +3 -1
- package/lib/typescript/i18n/keys.d.ts.map +1 -1
- package/lib/typescript/i18n/runtimeDefaults.d.ts +1 -0
- package/lib/typescript/i18n/runtimeDefaults.d.ts.map +1 -1
- package/lib/typescript/store/apis/getChannelMessages.d.ts +2 -1
- package/lib/typescript/store/apis/getChannelMessages.d.ts.map +1 -1
- package/lib/typescript/store/apis/getChannels.d.ts +3 -1
- package/lib/typescript/store/apis/getChannels.d.ts.map +1 -1
- package/lib/typescript/store/apis/getChannelsForFilterSort.d.ts.map +1 -1
- package/lib/typescript/store/apis/queries/selectMessagesForChannels.d.ts +3 -1
- package/lib/typescript/store/apis/queries/selectMessagesForChannels.d.ts.map +1 -1
- package/lib/typescript/utils/installNativeMultipartAdapter.d.ts +5 -3
- package/lib/typescript/utils/installNativeMultipartAdapter.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/__tests__/offline-support/offline-feature.tsx +7 -7
- package/src/__tests__/offline-support/optimistic-update.tsx +5 -5
- package/src/ai-components/README.md +50 -2
- package/src/ai-components/__tests__/VoiceVisualization.test.tsx +208 -0
- package/src/ai-components/__tests__/dictation.test.tsx +58 -1
- package/src/ai-components/__tests__/voiceDriver.test.ts +317 -0
- package/src/ai-components/__tests__/voicePalette.test.ts +124 -0
- package/src/ai-components/index.ts +3 -1
- package/src/ai-components/message-composer/ComposerView.tsx +6 -3
- package/src/ai-components/message-composer/SpeechToTextButton.tsx +5 -2
- package/src/ai-components/native/AIDictation.ts +11 -0
- package/src/ai-components/store/dictation/store.ts +9 -0
- package/src/ai-components/store/dictation/useDictationState.ts +2 -1
- package/src/ai-components/store/index.ts +2 -0
- package/src/ai-components/theme.ts +16 -0
- package/src/ai-components/transcription/useDictation.ts +16 -3
- package/src/ai-components/transcription/useDictationAudioLevel.ts +38 -0
- package/src/ai-components/voice-visualization/VoiceGlow.tsx +79 -0
- package/src/ai-components/voice-visualization/VoiceVisualizationView.tsx +179 -0
- package/src/ai-components/voice-visualization/VoiceWave.tsx +67 -0
- package/src/ai-components/voice-visualization/bounce.ts +61 -0
- package/src/ai-components/voice-visualization/driver.ts +240 -0
- package/src/ai-components/voice-visualization/glowShader.ts +227 -0
- package/src/ai-components/voice-visualization/index.ts +3 -0
- package/src/ai-components/voice-visualization/math.ts +73 -0
- package/src/ai-components/voice-visualization/palette.ts +59 -0
- package/src/ai-components/voice-visualization/simplex.ts +92 -0
- package/src/ai-components/voice-visualization/styles.ts +42 -0
- package/src/ai-components/voice-visualization/types.ts +44 -0
- package/src/ai-components/voice-visualization/useReduceMotion.ts +34 -0
- package/src/ai-components/voice-visualization/useVoiceVisualization.ts +153 -0
- package/src/ai-components/voice-visualization/waveGeometry.ts +137 -0
- package/src/components/Channel/__tests__/Channel.test.tsx +44 -5
- package/src/components/Channel/hooks/useChannelLifecycle.ts +4 -1
- package/src/components/ChannelDetails/__tests__/ChannelDetails.test.tsx +1 -1
- package/src/components/ChannelDetails/__tests__/ChannelDetailsActionsSection.test.tsx +1 -1
- package/src/components/ChannelDetails/__tests__/ChannelDetailsEditButton.test.tsx +1 -1
- package/src/components/ChannelDetails/__tests__/ChannelDetailsMemberSection.test.tsx +1 -1
- package/src/components/ChannelDetails/__tests__/ChannelDetailsNavHeader.test.tsx +1 -1
- package/src/components/ChannelDetails/__tests__/ChannelDetailsProfile.test.tsx +2 -2
- package/src/components/ChannelDetails/__tests__/ChannelEditDetailsForm.test.tsx +1 -1
- package/src/components/ChannelDetails/__tests__/ChannelEditDetailsFormContent.test.tsx +2 -2
- package/src/components/ChannelDetails/__tests__/ChannelEditName.test.tsx +1 -1
- package/src/components/ChannelDetails/__tests__/members/ChannelAddMembersForm.test.tsx +1 -1
- package/src/components/ChannelDetails/__tests__/members/ChannelMemberActionsSheet.test.tsx +2 -2
- package/src/components/ChannelDetails/__tests__/members/ChannelMemberItem.test.tsx +1 -1
- package/src/components/ChannelDetails/__tests__/useChannelDetailsMemberStatusText.test.tsx +1 -1
- package/src/components/ChannelDetails/components/members/ChannelMemberItem.tsx +1 -1
- package/src/components/ChannelDetails/hooks/useChannelDetailsMemberStatusText.ts +1 -1
- package/src/components/ChannelList/ChannelListView.tsx +1 -3
- package/src/components/ChannelList/__tests__/ChannelList.test.tsx +44 -0
- package/src/components/ChannelList/hooks/usePaginatedChannels.ts +1 -1
- package/src/components/ChannelPreview/ChannelDetailsBottomSheet.tsx +1 -1
- package/src/components/ChannelPreview/ChannelLastMessagePreview.tsx +1 -1
- package/src/components/ChannelPreview/ChannelMessagePreviewDeliveryStatus.tsx +8 -2
- package/src/components/ChannelPreview/ChannelPreviewTitle.tsx +1 -1
- package/src/components/ChannelPreview/ChannelPreviewView.tsx +1 -1
- package/src/components/ChannelPreview/__tests__/ChannelPreview.test.tsx +4 -4
- package/src/components/ChannelPreview/__tests__/ChannelPreviewView.test.tsx +40 -0
- package/src/components/ChannelPreview/hooks/__tests__/useChannelPreviewData.test.tsx +51 -0
- package/src/components/ChannelPreview/hooks/__tests__/useChannelPreviewDisplayName.test.tsx +1 -1
- package/src/components/ChannelPreview/hooks/__tests__/useChannelPreviewDisplayPresence.test.tsx +1 -1
- package/src/components/ChannelPreview/hooks/__tests__/useChannelPreviewPollLabel.test.tsx +87 -0
- package/src/components/ChannelPreview/hooks/useChannelPreviewData.ts +3 -4
- package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayName.ts +1 -1
- package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.ts +1 -1
- package/src/components/ChannelPreview/hooks/useChannelPreviewPollLabel.ts +1 -1
- package/src/components/Chat/__tests__/Chat.test.tsx +31 -1
- package/src/components/Chat/hooks/useConnectionLifecycle.ts +12 -6
- package/src/components/Indicators/LoadingErrorIndicator.tsx +8 -1
- package/src/components/Message/Message.tsx +1 -1
- package/src/components/Message/MessageItemView/MessageStatus.tsx +16 -2
- package/src/components/Message/MessageItemView/MessageWrapper.tsx +14 -4
- package/src/components/Message/MessageItemView/__tests__/MessageStatus.test.tsx +21 -0
- package/src/components/Message/hooks/__tests__/useCreateMessageActionHandlers.test.tsx +1 -1
- package/src/components/Message/hooks/__tests__/useUserMuteActive.test.tsx +1 -1
- package/src/components/Message/hooks/useCreateMessageActionHandlers.ts +3 -3
- package/src/components/Message/hooks/useProcessReactions.ts +2 -2
- package/src/components/Message/hooks/useUserMuteActive.ts +1 -1
- package/src/components/MessageInput/MessageComposer.tsx +4 -2
- package/src/components/MessageList/MessageFlashList.tsx +2 -2
- package/src/components/MessageList/MessageList.tsx +2 -2
- package/src/components/MessageList/__tests__/MessageList.test.tsx +26 -8
- package/src/components/MessageList/__tests__/ScrollToBottomButton.test.tsx +3 -3
- package/src/components/MessageList/hooks/useOwnUnreadCount.ts +1 -1
- package/src/components/MessageMenu/MessageUserReactionsItem.tsx +1 -1
- package/src/components/MessageMenu/hooks/useMessageOwnReactions.ts +2 -2
- package/src/components/Poll/components/PollAnswersList.tsx +1 -1
- package/src/components/Poll/components/PollButtons.tsx +1 -1
- package/src/components/Poll/hook/useIsPollCreatedByCurrentUser.ts +1 -1
- package/src/components/Thread/Thread.tsx +1 -1
- package/src/components/Thread/__tests__/Thread.test.tsx +4 -2
- package/src/components/ThreadList/ThreadListItem.tsx +1 -1
- package/src/components/ThreadList/ThreadListUnreadBanner.tsx +6 -2
- package/src/components/ThreadList/__tests__/ThreadList.test.tsx +21 -0
- package/src/components/index.ts +2 -0
- package/src/contexts/componentsContext/defaultComponents.ts +0 -2
- package/src/contexts/liveLocationManagerContext/LiveLocationManagerContext.tsx +1 -1
- package/src/hooks/__tests__/useChannelMuteActive.test.tsx +1 -1
- package/src/hooks/__tests__/useIsDirectChat.test.tsx +1 -1
- package/src/hooks/actions/__tests__/useChannelActionItems.test.tsx +1 -1
- package/src/hooks/actions/__tests__/useChannelActions.test.tsx +1 -1
- package/src/hooks/actions/__tests__/useChannelMemberActionItems.test.tsx +6 -6
- package/src/hooks/actions/useChannelActionItems.tsx +1 -1
- package/src/hooks/actions/useChannelActions.ts +2 -2
- package/src/hooks/actions/useChannelMemberActionItems.tsx +1 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/messagePreview/__tests__/useMessageDeliveryStatus.test.tsx +57 -32
- package/src/hooks/messagePreview/useMessageDeliveryStatus.ts +13 -7
- package/src/hooks/useIsDirectChat.ts +1 -1
- package/src/i18n/__tests__/catalog.fixture.json +2 -0
- package/src/i18n/keys.ts +3 -0
- package/src/i18n/runtimeDefaults.ts +1 -0
- package/src/store/__tests__/selectMessagesForChannels.test.ts +34 -12
- package/src/store/apis/getChannelMessages.ts +4 -1
- package/src/store/apis/getChannels.ts +5 -1
- package/src/store/apis/getChannelsForFilterSort.ts +1 -0
- package/src/store/apis/queries/selectMessagesForChannels.ts +7 -2
- package/src/utils/installNativeMultipartAdapter.ts +5 -3
- package/src/version.json +1 -1
|
@@ -197,7 +197,7 @@ export const useCreateMessageActionHandlers = ({
|
|
|
197
197
|
|
|
198
198
|
const isMuted = isUserMuted(
|
|
199
199
|
client.mutedUsersStore.getLatestValue().mutedUsers,
|
|
200
|
-
client.
|
|
200
|
+
client.userId,
|
|
201
201
|
message.user.id,
|
|
202
202
|
);
|
|
203
203
|
|
|
@@ -371,9 +371,9 @@ export const useCreateMessageActionHandlers = ({
|
|
|
371
371
|
const userExistingReaction = own_reactions.find((reaction) => {
|
|
372
372
|
// `own_reactions` should only hold the current user's reactions; checked anyway so a bad
|
|
373
373
|
// message update cannot break toggling.
|
|
374
|
-
if (reaction.user && client.
|
|
374
|
+
if (reaction.user && client.userId === reaction.user.id && reaction.type === reactionType) {
|
|
375
375
|
return true;
|
|
376
|
-
} else if (reaction.user && client.
|
|
376
|
+
} else if (reaction.user && client.userId !== reaction.user.id) {
|
|
377
377
|
console.warn(
|
|
378
378
|
'message.own_reactions contained reactions from a different user, this indicates a bug',
|
|
379
379
|
);
|
|
@@ -113,7 +113,7 @@ export const useProcessReactions = (props: UseProcessReactionsParams) => {
|
|
|
113
113
|
Icon: getEmojiByReactionType(reactionType, supportedReactions),
|
|
114
114
|
lastReactionAt: convertTimestampToDate(last_reaction_at) ?? null,
|
|
115
115
|
latestReactedUserNames,
|
|
116
|
-
own: isOwnReaction(reactionType, own_reactions, latest_reactions, client.
|
|
116
|
+
own: isOwnReaction(reactionType, own_reactions, latest_reactions, client.userId),
|
|
117
117
|
type: reactionType,
|
|
118
118
|
unlistedReactedUserCount: count - latestReactedUserNames.length,
|
|
119
119
|
};
|
|
@@ -126,7 +126,7 @@ export const useProcessReactions = (props: UseProcessReactionsParams) => {
|
|
|
126
126
|
totalReactionCount: unsortedReactions.reduce((total, { count }) => total + count, 0),
|
|
127
127
|
};
|
|
128
128
|
}, [
|
|
129
|
-
client.
|
|
129
|
+
client.userId,
|
|
130
130
|
reaction_groups,
|
|
131
131
|
own_reactions,
|
|
132
132
|
latest_reactions,
|
|
@@ -32,7 +32,7 @@ export const isUserMuted = (
|
|
|
32
32
|
*/
|
|
33
33
|
export const useUserMuteActive = (user: UserResponse | null | undefined) => {
|
|
34
34
|
const { client } = useChatContext();
|
|
35
|
-
const currentUserId = client?.
|
|
35
|
+
const currentUserId = client?.userId;
|
|
36
36
|
const userId = user?.id;
|
|
37
37
|
|
|
38
38
|
const selector = useCallback(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useMemo } from 'react';
|
|
2
|
-
import { StyleSheet, View } from 'react-native';
|
|
2
|
+
import { Platform, StyleSheet, View } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import Animated, {
|
|
5
5
|
Extrapolation,
|
|
@@ -328,7 +328,9 @@ const MessageComposerWithContext = (props: MessageComposerPropsWithContext) => {
|
|
|
328
328
|
}));
|
|
329
329
|
const { bottom } = useSafeAreaInsets();
|
|
330
330
|
|
|
331
|
-
const
|
|
331
|
+
const safeAreaBottomOffset = Platform.OS === 'android' ? bottom + 16 : bottom;
|
|
332
|
+
const BOTTOM_OFFSET =
|
|
333
|
+
isKeyboardVisible || selectedPicker ? 16 : bottom ? safeAreaBottomOffset : 16;
|
|
332
334
|
|
|
333
335
|
const micPositionContextValue = useMemo(
|
|
334
336
|
() => ({ micPositionX, micPositionY }),
|
|
@@ -321,7 +321,7 @@ const MessageFlashListWithContext = (props: MessageFlashListPropsWithContext) =>
|
|
|
321
321
|
channel,
|
|
322
322
|
markRead,
|
|
323
323
|
readEvents,
|
|
324
|
-
userId: client.
|
|
324
|
+
userId: client.userId,
|
|
325
325
|
});
|
|
326
326
|
|
|
327
327
|
const renderItem = useCallback(
|
|
@@ -343,7 +343,7 @@ const MessageFlashListWithContext = (props: MessageFlashListPropsWithContext) =>
|
|
|
343
343
|
|
|
344
344
|
const shouldScrollToRecentOnNewOwnMessageRef = useShouldScrollToRecentOnNewOwnMessage(
|
|
345
345
|
rawMessageList,
|
|
346
|
-
client.
|
|
346
|
+
client.userId,
|
|
347
347
|
);
|
|
348
348
|
|
|
349
349
|
const [autoscrollToRecent, setAutoscrollToRecent] = useState(true);
|
|
@@ -321,7 +321,7 @@ const MessageListWithContext = (props: MessageListPropsWithContext) => {
|
|
|
321
321
|
channel,
|
|
322
322
|
markRead,
|
|
323
323
|
readEvents,
|
|
324
|
-
userId: client.
|
|
324
|
+
userId: client.userId,
|
|
325
325
|
});
|
|
326
326
|
|
|
327
327
|
const previousDerivedItemsRef = useRef<Map<string, MessageListItemWithNeighbours>>(undefined);
|
|
@@ -355,7 +355,7 @@ const MessageListWithContext = (props: MessageListPropsWithContext) => {
|
|
|
355
355
|
|
|
356
356
|
const shouldScrollToRecentOnNewOwnMessageRef = useShouldScrollToRecentOnNewOwnMessage(
|
|
357
357
|
rawMessageList,
|
|
358
|
-
client.
|
|
358
|
+
client.userId,
|
|
359
359
|
);
|
|
360
360
|
|
|
361
361
|
const [autoscrollToRecent, setAutoscrollToRecent] = useState(false);
|
|
@@ -1375,7 +1375,9 @@ describe('MessageList in a thread', () => {
|
|
|
1375
1375
|
expect(markReadLocally).not.toHaveBeenCalled();
|
|
1376
1376
|
});
|
|
1377
1377
|
|
|
1378
|
-
|
|
1378
|
+
// The LLC seeds the thread's snapshot from the channel's read state, which says nothing about the
|
|
1379
|
+
// replies, so a thread draws no separator from either snapshot.
|
|
1380
|
+
it('draws no unread separator in a thread', async () => {
|
|
1379
1381
|
const { channel, queryAllByLabelText, replies, threadInstance } = await setup();
|
|
1380
1382
|
|
|
1381
1383
|
act(() =>
|
|
@@ -1386,12 +1388,28 @@ describe('MessageList in a thread', () => {
|
|
|
1386
1388
|
);
|
|
1387
1389
|
expect(queryAllByLabelText('Inline unread indicator')).toHaveLength(0);
|
|
1388
1390
|
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1391
|
+
// The first reply too, whose separator row would be the parent message.
|
|
1392
|
+
for (const firstUnread of [replies[0], replies[3]]) {
|
|
1393
|
+
await act(async () => {
|
|
1394
|
+
threadInstance.messagePaginator.unreadStateSnapshot.partialNext({
|
|
1395
|
+
firstUnreadMessageId: firstUnread.id,
|
|
1396
|
+
unreadCount: 2,
|
|
1397
|
+
});
|
|
1398
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
1399
|
+
});
|
|
1400
|
+
expect(queryAllByLabelText('Inline unread indicator')).toHaveLength(0);
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
// The live boundary, from the read time rather than a frozen first-unread ID.
|
|
1404
|
+
await act(async () => {
|
|
1405
|
+
threadInstance.messagePaginator.unreadStateSnapshot.next({
|
|
1406
|
+
firstUnreadMessageId: null,
|
|
1407
|
+
lastReadAt: replies[1].created_at,
|
|
1408
|
+
lastReadMessageId: replies[1].id,
|
|
1409
|
+
unreadCount: 3,
|
|
1410
|
+
});
|
|
1411
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
1412
|
+
});
|
|
1413
|
+
expect(queryAllByLabelText('Inline unread indicator')).toHaveLength(0);
|
|
1396
1414
|
});
|
|
1397
1415
|
});
|
|
@@ -75,7 +75,7 @@ describe('ScrollToBottomButton', () => {
|
|
|
75
75
|
const i18nInstance = new Streami18n();
|
|
76
76
|
const translators = await i18nInstance.init();
|
|
77
77
|
// The button reads OUR user's count from `channel.state` (a v10 reactive StateStore) via
|
|
78
|
-
// `useStateStore`, keyed by the chat client's
|
|
78
|
+
// `useStateStore`, keyed by the chat client's `userId`. Seed the `read` slice with 3 unread
|
|
79
79
|
// for that user.
|
|
80
80
|
const channel = {
|
|
81
81
|
state: generateChannelState({
|
|
@@ -91,7 +91,7 @@ describe('ScrollToBottomButton', () => {
|
|
|
91
91
|
const { getByTestId, getByText } = render(
|
|
92
92
|
<ThemeProvider>
|
|
93
93
|
<TranslationProvider value={{ ...translators, t } as unknown as TranslationContextValue}>
|
|
94
|
-
<ChatProvider value={{ client: {
|
|
94
|
+
<ChatProvider value={{ client: { userId: 'me' } } as unknown as ChatContextValue}>
|
|
95
95
|
<ChannelProvider value={{ channel } as unknown as ChannelContextValue}>
|
|
96
96
|
<ScrollToBottomButton onPress={() => null} showNotification={true} />
|
|
97
97
|
</ChannelProvider>
|
|
@@ -139,7 +139,7 @@ describe('ScrollToBottomButton', () => {
|
|
|
139
139
|
<ThemeProvider>
|
|
140
140
|
<AccessibilityProvider value={{ enabled: true }}>
|
|
141
141
|
<TranslationProvider value={{ ...translators, userLanguage: 'en' }}>
|
|
142
|
-
<ChatProvider value={{ client: {
|
|
142
|
+
<ChatProvider value={{ client: { userId: 'me' } } as unknown as ChatContextValue}>
|
|
143
143
|
<ChannelProvider value={{ channel } as unknown as ChannelContextValue}>
|
|
144
144
|
<ScrollToBottomButton onPress={() => null} showNotification={true} />
|
|
145
145
|
</ChannelProvider>
|
|
@@ -14,7 +14,7 @@ import { useStateStore } from '../../../hooks/useStateStore';
|
|
|
14
14
|
*/
|
|
15
15
|
export const useOwnUnreadCount = (channel: Channel | undefined) => {
|
|
16
16
|
const { client } = useChatContext();
|
|
17
|
-
const userId = client?.
|
|
17
|
+
const userId = client?.userId;
|
|
18
18
|
const selector = useMemo(
|
|
19
19
|
() => (state: ReadState) => ({
|
|
20
20
|
unreadCount: userId ? (state.read[userId]?.unread_messages ?? 0) : 0,
|
|
@@ -36,7 +36,7 @@ export const MessageUserReactionsItem = ({
|
|
|
36
36
|
const styles = useStyles();
|
|
37
37
|
|
|
38
38
|
const { client } = useChatContext();
|
|
39
|
-
const isOwnReaction = client.
|
|
39
|
+
const isOwnReaction = client.userId === id;
|
|
40
40
|
const { t } = useTranslationContext();
|
|
41
41
|
|
|
42
42
|
const { handleReaction } = useMessageContext();
|
|
@@ -10,9 +10,9 @@ export const useMessageOwnReactions = () => {
|
|
|
10
10
|
const ownReactionTypes = message?.own_reactions?.map((reaction) => reaction.type) || [];
|
|
11
11
|
const latestReactionTypesByCurrentUser =
|
|
12
12
|
message?.latest_reactions
|
|
13
|
-
?.filter((reaction) => reaction.user?.id === client.
|
|
13
|
+
?.filter((reaction) => reaction.user?.id === client.userId)
|
|
14
14
|
.map((reaction) => reaction.type) || [];
|
|
15
15
|
|
|
16
16
|
return Array.from(new Set([...ownReactionTypes, ...latestReactionTypesByCurrentUser]));
|
|
17
|
-
}, [client.
|
|
17
|
+
}, [client.userId, message?.latest_reactions, message?.own_reactions]);
|
|
18
18
|
};
|
|
@@ -96,7 +96,7 @@ export const PollAnswerListItem = ({ answer }: { answer: PollVoteResponseData })
|
|
|
96
96
|
[answer.updated_at, t, tDateTimeParser],
|
|
97
97
|
);
|
|
98
98
|
|
|
99
|
-
const isMyAnswer = client.
|
|
99
|
+
const isMyAnswer = client.userId === answer.user?.id;
|
|
100
100
|
|
|
101
101
|
const isAnonymous = useMemo(
|
|
102
102
|
() => votingVisibility === 'anonymous' && !isMyAnswer,
|
|
@@ -229,7 +229,7 @@ export const EndVoteButton = () => {
|
|
|
229
229
|
const { client } = useChatContext();
|
|
230
230
|
const styles = useStyles();
|
|
231
231
|
|
|
232
|
-
return !isClosed && createdBy?.id === client.
|
|
232
|
+
return !isClosed && createdBy?.id === client.userId ? (
|
|
233
233
|
<GenericPollButton
|
|
234
234
|
label={t('poll.endVote.label', 'End Vote')}
|
|
235
235
|
onPress={endVote}
|
|
@@ -138,7 +138,7 @@ export const Thread = (props: PropsWithChildren<ThreadProps>) => {
|
|
|
138
138
|
.toTail()
|
|
139
139
|
.catch((err: unknown) => console.warn('Reloading the thread replies failed:', err));
|
|
140
140
|
|
|
141
|
-
return <LoadingErrorIndicator error={lastQueryError} listType='
|
|
141
|
+
return <LoadingErrorIndicator error={lastQueryError} listType='thread' retry={retry} />;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
return (
|
|
@@ -328,6 +328,8 @@ describe('Thread', () => {
|
|
|
328
328
|
await waitFor(() => {
|
|
329
329
|
expect(screen.getByTestId('loading-error')).toBeTruthy();
|
|
330
330
|
});
|
|
331
|
+
// The thread's own copy, not the channel's "Error loading messages for this channel...".
|
|
332
|
+
expect(screen.getByTestId('loading-error')).toHaveTextContent('Error loading replies...');
|
|
331
333
|
});
|
|
332
334
|
|
|
333
335
|
it('retries the reply query — and only the reply query — from the indicator', async () => {
|
|
@@ -511,10 +513,10 @@ describe('Thread lifecycle', () => {
|
|
|
511
513
|
generateMessage({ reply_count: 3, user }),
|
|
512
514
|
);
|
|
513
515
|
const readState = (unreadMessageCount: number) => ({
|
|
514
|
-
[chatClient.
|
|
516
|
+
[chatClient.userId as string]: {
|
|
515
517
|
lastReadAt: 1,
|
|
516
518
|
unreadMessageCount,
|
|
517
|
-
user: { id: chatClient.
|
|
519
|
+
user: { id: chatClient.userId as string },
|
|
518
520
|
},
|
|
519
521
|
});
|
|
520
522
|
return { markRead, parentMessage, readState, testChannel };
|
|
@@ -158,7 +158,7 @@ export const ThreadListItem = (props: ThreadListItemProps) => {
|
|
|
158
158
|
channel: nextValue.channel,
|
|
159
159
|
deletedAt: nextValue.deletedAt,
|
|
160
160
|
ownUnreadMessageCount:
|
|
161
|
-
(client.
|
|
161
|
+
(client.userId && nextValue.read[client.userId]?.unreadMessageCount) || 0,
|
|
162
162
|
parentMessage: nextValue.parentMessage,
|
|
163
163
|
}) as const,
|
|
164
164
|
[client],
|
|
@@ -11,13 +11,15 @@ import { primitives } from '../../theme';
|
|
|
11
11
|
const selector = (nextValue: ThreadManagerState) =>
|
|
12
12
|
({ unseenThreadIds: nextValue.unseenThreadIds }) as const;
|
|
13
13
|
|
|
14
|
-
// The paginator records a failed
|
|
14
|
+
// The paginator records a failed query and clears it on the next successful one.
|
|
15
15
|
const lastQueryErrorSelector = (nextValue: { lastQueryError?: Error }) => ({
|
|
16
16
|
lastQueryError: nextValue.lastQueryError,
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
export const ThreadListUnreadBanner = () => {
|
|
20
|
+
// we need the two extra states so we can tell the client's states apart
|
|
20
21
|
const [loading, setLoading] = useState(false);
|
|
22
|
+
const [reloadFailed, setReloadFailed] = useState(false);
|
|
21
23
|
const { client } = useChatContext();
|
|
22
24
|
const { icons } = useComponentsContext();
|
|
23
25
|
const { t } = useTranslationContext();
|
|
@@ -48,8 +50,10 @@ export const ThreadListUnreadBanner = () => {
|
|
|
48
50
|
setLoading(true);
|
|
49
51
|
try {
|
|
50
52
|
await client.threads.reload();
|
|
53
|
+
setReloadFailed(!!client.threads.paginator.lastQueryError);
|
|
51
54
|
} catch {
|
|
52
55
|
// Only with the paginator's `throwErrors`; the error is already in its state.
|
|
56
|
+
setReloadFailed(true);
|
|
53
57
|
} finally {
|
|
54
58
|
setLoading(false);
|
|
55
59
|
}
|
|
@@ -64,7 +68,7 @@ export const ThreadListUnreadBanner = () => {
|
|
|
64
68
|
);
|
|
65
69
|
}
|
|
66
70
|
|
|
67
|
-
if (lastQueryError) {
|
|
71
|
+
if (reloadFailed && lastQueryError) {
|
|
68
72
|
return (
|
|
69
73
|
<Pressable onPress={handlePress} style={pressableStyle}>
|
|
70
74
|
<icons.ExclamationCircle stroke={semantics.textSecondary} height={20} width={20} />
|
|
@@ -179,4 +179,25 @@ describe('ThreadList loading states', () => {
|
|
|
179
179
|
await waitFor(() => expect(rows()).toHaveLength(2));
|
|
180
180
|
expect(screen.queryByText("Couldn't load new threads. Tap to retry")).toBeNull();
|
|
181
181
|
});
|
|
182
|
+
|
|
183
|
+
it('keeps the new threads count when a different thread query failed', async () => {
|
|
184
|
+
jest
|
|
185
|
+
.spyOn(chatClient, 'queryThreadsAndHydrate')
|
|
186
|
+
.mockResolvedValueOnce({ next: undefined, threads: [makeThread()] });
|
|
187
|
+
render(
|
|
188
|
+
<Chat client={chatClient}>
|
|
189
|
+
<ThreadList isFocused />
|
|
190
|
+
</Chat>,
|
|
191
|
+
);
|
|
192
|
+
await waitFor(() => expect(rows()).toHaveLength(1));
|
|
193
|
+
|
|
194
|
+
// A failed next page, for example: the paginator records it the same way as a failed reload.
|
|
195
|
+
act(() => {
|
|
196
|
+
chatClient.threads.paginator.state.partialNext({ lastQueryError: new Error('offline') });
|
|
197
|
+
chatClient.threads.state.partialNext({ unseenThreadIds: ['a'] });
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
await waitFor(() => expect(screen.getByText('1 new thread')).toBeTruthy());
|
|
201
|
+
expect(screen.queryByText("Couldn't load new threads. Tap to retry")).toBeNull();
|
|
202
|
+
});
|
|
182
203
|
});
|
package/src/components/index.ts
CHANGED
|
@@ -150,7 +150,9 @@ export * from './MessageList/hooks/useMarkRead';
|
|
|
150
150
|
// Only the constant, for integrators running their own `jumpToMessage`.
|
|
151
151
|
export { DEFAULT_HIGHLIGHT_DURATION } from './MessageList/hooks/useMessageListFocus';
|
|
152
152
|
export * from './MessageList/hooks/useMessageList';
|
|
153
|
+
export * from './MessageList/hooks/useOwnUnreadCount';
|
|
153
154
|
export * from './MessageList/hooks/useTypingString';
|
|
155
|
+
export * from './MessageList/hooks/useTypingUsers';
|
|
154
156
|
export * from './MessageList/InlineDateSeparator';
|
|
155
157
|
export * from './MessageList/InlineLoadingMoreIndicator';
|
|
156
158
|
export * from './MessageList/InlineLoadingMoreRecentIndicator';
|
|
@@ -149,7 +149,6 @@ import { StopMessageStreamingButton } from '../../components/MessageInput/StopMe
|
|
|
149
149
|
import { DateHeader } from '../../components/MessageList/DateHeader';
|
|
150
150
|
import { InlineDateSeparator } from '../../components/MessageList/InlineDateSeparator';
|
|
151
151
|
import { InlineUnreadIndicator } from '../../components/MessageList/InlineUnreadIndicator';
|
|
152
|
-
import { MessageList } from '../../components/MessageList/MessageList';
|
|
153
152
|
import { MessageSystem } from '../../components/MessageList/MessageSystem';
|
|
154
153
|
import { NetworkDownIndicator } from '../../components/MessageList/NetworkDownIndicator';
|
|
155
154
|
import { ScrollToBottomButton } from '../../components/MessageList/ScrollToBottomButton';
|
|
@@ -448,7 +447,6 @@ const components = {
|
|
|
448
447
|
MessageInputLeadingView,
|
|
449
448
|
MessageInputTrailingView,
|
|
450
449
|
MessageItemView,
|
|
451
|
-
MessageList,
|
|
452
450
|
MessagePinnedHeader,
|
|
453
451
|
MessageReactionPicker,
|
|
454
452
|
MessageReminderHeader,
|
|
@@ -35,7 +35,7 @@ export const LiveLocationManagerProvider = (
|
|
|
35
35
|
}
|
|
36
36
|
return new LiveLocationManager({
|
|
37
37
|
client,
|
|
38
|
-
getDeviceId: getDeviceId ?? (() => `react-native-${Platform.OS}-${client.
|
|
38
|
+
getDeviceId: getDeviceId ?? (() => `react-native-${Platform.OS}-${client.userId}`),
|
|
39
39
|
watchLocation,
|
|
40
40
|
});
|
|
41
41
|
}, [client, getDeviceId, watchLocation]);
|
|
@@ -21,7 +21,7 @@ const createClient = ({
|
|
|
21
21
|
// muted USERS stay client-global — useMutedUsers reads them reactively from mutedUsersStore.
|
|
22
22
|
mutedUsersStore: new StateStore({ mutedUsers }),
|
|
23
23
|
on: jest.fn(() => ({ unsubscribe: jest.fn() })),
|
|
24
|
-
|
|
24
|
+
userId: CURRENT_USER_ID,
|
|
25
25
|
}) as never;
|
|
26
26
|
|
|
27
27
|
// Back the mock channel with a real StateStore (so `useStateStore` can subscribe to `members` and
|
|
@@ -23,7 +23,7 @@ describe('useIsDirectChat', () => {
|
|
|
23
23
|
jest
|
|
24
24
|
.spyOn(ChatContext, 'useChatContext')
|
|
25
25
|
.mockImplementation(
|
|
26
|
-
() => ({ client: {
|
|
26
|
+
() => ({ client: { userId: OWN_USER_ID } }) as unknown as ChatContextValue,
|
|
27
27
|
);
|
|
28
28
|
});
|
|
29
29
|
|
|
@@ -58,7 +58,7 @@ const createClient = () => ({
|
|
|
58
58
|
unblockUser: jest.fn(),
|
|
59
59
|
unmuteUser: jest.fn(),
|
|
60
60
|
uploadImage: jest.fn().mockResolvedValue({ file: 'https://cdn.example.com/uploaded.png' }),
|
|
61
|
-
|
|
61
|
+
userId: 'current-user-id',
|
|
62
62
|
});
|
|
63
63
|
|
|
64
64
|
const createChannel = (client: ReturnType<typeof createClient>) =>
|
|
@@ -35,15 +35,15 @@ const createMemberMock = (userId = 'target-user-id'): ChannelMemberResponse =>
|
|
|
35
35
|
user_id: userId,
|
|
36
36
|
}) as ChannelMemberResponse;
|
|
37
37
|
|
|
38
|
-
const createChannelMock = (params?: { blockedUserIds?: string[];
|
|
39
|
-
const { blockedUserIds = [],
|
|
38
|
+
const createChannelMock = (params?: { blockedUserIds?: string[]; userId?: string }): Channel => {
|
|
39
|
+
const { blockedUserIds = [], userId = 'current-user-id' } = params ?? {};
|
|
40
40
|
return {
|
|
41
41
|
getClient: () => ({
|
|
42
42
|
blockedUsers: {
|
|
43
43
|
getLatestValue: () => ({ userIds: blockedUserIds }),
|
|
44
44
|
subscribeWithSelector: () => () => {},
|
|
45
45
|
},
|
|
46
|
-
|
|
46
|
+
userId,
|
|
47
47
|
}),
|
|
48
48
|
} as unknown as Channel;
|
|
49
49
|
};
|
|
@@ -84,7 +84,7 @@ describe('useChannelMemberActionItems', () => {
|
|
|
84
84
|
});
|
|
85
85
|
|
|
86
86
|
it('returns no action items when the member is the current user', () => {
|
|
87
|
-
const currentUserChannel = createChannelMock({
|
|
87
|
+
const currentUserChannel = createChannelMock({ userId: 'target-user-id' });
|
|
88
88
|
|
|
89
89
|
const { result } = renderHook(() =>
|
|
90
90
|
useChannelMemberActionItems({ channel: currentUserChannel, member }),
|
|
@@ -101,7 +101,7 @@ describe('useChannelMemberActionItems', () => {
|
|
|
101
101
|
});
|
|
102
102
|
|
|
103
103
|
const wrapper = ({ children }: PropsWithChildren) => (
|
|
104
|
-
<ChatProvider value={{ client: { mutedUsersStore,
|
|
104
|
+
<ChatProvider value={{ client: { mutedUsersStore, userId: 'current-user-id' } } as never}>
|
|
105
105
|
{children}
|
|
106
106
|
</ChatProvider>
|
|
107
107
|
);
|
|
@@ -166,7 +166,7 @@ describe('useChannelMemberActionItems', () => {
|
|
|
166
166
|
jest
|
|
167
167
|
.spyOn(useChannelOwnCapabilitiesModule, 'useChannelOwnCapabilities')
|
|
168
168
|
.mockReturnValue(['update-channel-members']);
|
|
169
|
-
const currentUserChannel = createChannelMock({
|
|
169
|
+
const currentUserChannel = createChannelMock({ userId: 'target-user-id' });
|
|
170
170
|
|
|
171
171
|
const { result } = renderHook(() =>
|
|
172
172
|
useChannelMemberActionItems({ channel: currentUserChannel, member }),
|
|
@@ -112,7 +112,7 @@ export const buildDefaultChannelActionItems: BuildDefaultChannelActionItems = (
|
|
|
112
112
|
t,
|
|
113
113
|
channel,
|
|
114
114
|
} = channelActionItemsParams;
|
|
115
|
-
const ownUserId = channel.getClient().
|
|
115
|
+
const ownUserId = channel.getClient().userId;
|
|
116
116
|
|
|
117
117
|
const actionItems: ChannelActionItem[] = [
|
|
118
118
|
{
|
|
@@ -39,7 +39,7 @@ export type ChannelActions = {
|
|
|
39
39
|
export const getOtherUserInDirectChannel = (channel: Channel) => {
|
|
40
40
|
const members = Object.values(channel.state.members);
|
|
41
41
|
return members.length === 2
|
|
42
|
-
? members.find((member) => member.user?.id !== channel.getClient().
|
|
42
|
+
? members.find((member) => member.user?.id !== channel.getClient().userId)
|
|
43
43
|
: undefined;
|
|
44
44
|
};
|
|
45
45
|
|
|
@@ -62,7 +62,7 @@ export const useChannelActions = (channel: Channel) => {
|
|
|
62
62
|
const { client } = useChatContext();
|
|
63
63
|
const { addNotification } = useNotificationApi();
|
|
64
64
|
const { t } = useTranslationContext();
|
|
65
|
-
const ownUserId = client.
|
|
65
|
+
const ownUserId = client.userId;
|
|
66
66
|
|
|
67
67
|
const pin = useStableCallback(async (options?: ChannelActionOptions) => {
|
|
68
68
|
try {
|
|
@@ -211,7 +211,7 @@ export const useChannelMemberActionItems = ({
|
|
|
211
211
|
|
|
212
212
|
const isBlocked = blockedUserIds.includes(member.user?.id ?? '');
|
|
213
213
|
|
|
214
|
-
const isCurrentUser = member.user?.id === channel.getClient().
|
|
214
|
+
const isCurrentUser = member.user?.id === channel.getClient().userId;
|
|
215
215
|
|
|
216
216
|
const channelMemberActionItemsParams = useMemo<ChannelMemberActionItemsParams>(
|
|
217
217
|
() => ({
|
package/src/hooks/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './useChannelMuteActive';
|
|
|
13
13
|
export * from './useIsDirectChat';
|
|
14
14
|
export * from './useIsChannelMember';
|
|
15
15
|
export * from './useStreami18n';
|
|
16
|
+
export * from './useTranslatedMessage';
|
|
16
17
|
export * from './useViewport';
|
|
17
18
|
export * from './useScreenDimensions';
|
|
18
19
|
export * from './useScreenOrientation';
|