stream-chat-react-native-core 9.2.0-beta.1 → 9.2.0-beta.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/README.md +1 -1
- package/lib/commonjs/a11y/hooks/useA11yLabel.js +4 -3
- package/lib/commonjs/a11y/hooks/useA11yLabel.js.map +1 -1
- package/lib/commonjs/a11y/hooks/useAccessibilityActivateAction.js +25 -0
- package/lib/commonjs/a11y/hooks/useAccessibilityActivateAction.js.map +1 -0
- package/lib/commonjs/a11y/index.js +11 -0
- package/lib/commonjs/a11y/index.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +20 -0
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.js +1 -0
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js +19 -2
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerContent.js +4 -3
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerContent.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentTypePickerButton.js +9 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentTypePickerButton.js.map +1 -1
- package/lib/commonjs/components/Channel/Channel.js +10 -1
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useMessageListPagination.js +26 -3
- package/lib/commonjs/components/Channel/hooks/useMessageListPagination.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelList.js +29 -4
- package/lib/commonjs/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/useChannelActions.js +314 -11
- package/lib/commonjs/components/ChannelList/hooks/useChannelActions.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +2 -2
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js.map +1 -1
- package/lib/commonjs/components/Message/hooks/useMessageActionHandlers.js +202 -15
- package/lib/commonjs/components/Message/hooks/useMessageActionHandlers.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MessageComposer.js +1 -1
- package/lib/commonjs/components/MessageInput/MessageComposerLeadingView.js +1 -1
- package/lib/commonjs/components/MessageInput/MessageComposerLeadingView.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MessageInputHeaderView.js +1 -1
- package/lib/commonjs/components/MessageInput/MessageInputHeaderView.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MessageInputTrailingView.js +1 -1
- package/lib/commonjs/components/MessageInput/MessageInputTrailingView.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/AttachmentPreview/AttachmentRemoveControl.js +16 -4
- package/lib/commonjs/components/MessageInput/components/AttachmentPreview/AttachmentRemoveControl.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js +7 -13
- package/lib/commonjs/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecorder.js +30 -6
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecorder.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingButton.js +34 -9
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/InputButtons/AttachButton.js +12 -3
- package/lib/commonjs/components/MessageInput/components/InputButtons/AttachButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/OutputButtons/EditButton.js +1 -0
- package/lib/commonjs/components/MessageInput/components/OutputButtons/EditButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/OutputButtons/SendButton.js +1 -0
- package/lib/commonjs/components/MessageInput/components/OutputButtons/SendButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/OutputButtons/index.js +1 -1
- package/lib/commonjs/components/MessageList/MessageFlashList.js +24 -4
- package/lib/commonjs/components/MessageList/MessageFlashList.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageList.js +24 -4
- package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
- package/lib/commonjs/components/MessageList/ScrollToBottomButton.js +12 -6
- package/lib/commonjs/components/MessageList/ScrollToBottomButton.js.map +1 -1
- package/lib/commonjs/components/MessageList/UnreadMessagesNotification.js +1 -0
- package/lib/commonjs/components/MessageList/UnreadMessagesNotification.js.map +1 -1
- package/lib/commonjs/components/MessageList/hooks/useScrollToBottomAccessibilityAction.js +47 -0
- package/lib/commonjs/components/MessageList/hooks/useScrollToBottomAccessibilityAction.js.map +1 -0
- package/lib/commonjs/components/MessageMenu/MessageActionListItem.js +12 -4
- package/lib/commonjs/components/MessageMenu/MessageActionListItem.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/MessageReactionPicker.js +1 -0
- package/lib/commonjs/components/MessageMenu/MessageReactionPicker.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/ReactionButton.js +9 -6
- package/lib/commonjs/components/MessageMenu/ReactionButton.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/hooks/useFetchReactions.js +23 -2
- package/lib/commonjs/components/MessageMenu/hooks/useFetchReactions.js.map +1 -1
- package/lib/commonjs/components/Notifications/Notification.js +232 -0
- package/lib/commonjs/components/Notifications/Notification.js.map +1 -0
- package/lib/commonjs/components/Notifications/NotificationList.js +120 -0
- package/lib/commonjs/components/Notifications/NotificationList.js.map +1 -0
- package/lib/commonjs/components/Notifications/NotificationTargetContext.js +45 -0
- package/lib/commonjs/components/Notifications/NotificationTargetContext.js.map +1 -0
- package/lib/commonjs/components/Notifications/hooks/index.js +59 -0
- package/lib/commonjs/components/Notifications/hooks/index.js.map +1 -0
- package/lib/commonjs/components/Notifications/hooks/useNotificationApi.js +133 -0
- package/lib/commonjs/components/Notifications/hooks/useNotificationApi.js.map +1 -0
- package/lib/commonjs/components/Notifications/hooks/useNotificationListController.js +133 -0
- package/lib/commonjs/components/Notifications/hooks/useNotificationListController.js.map +1 -0
- package/lib/commonjs/components/Notifications/hooks/useNotificationTarget.js +26 -0
- package/lib/commonjs/components/Notifications/hooks/useNotificationTarget.js.map +1 -0
- package/lib/commonjs/components/Notifications/hooks/useNotifications.js +26 -0
- package/lib/commonjs/components/Notifications/hooks/useNotifications.js.map +1 -0
- package/lib/commonjs/components/Notifications/hooks/useSystemNotifications.js +22 -0
- package/lib/commonjs/components/Notifications/hooks/useSystemNotifications.js.map +1 -0
- package/lib/commonjs/components/Notifications/index.js +59 -0
- package/lib/commonjs/components/Notifications/index.js.map +1 -0
- package/lib/commonjs/components/Notifications/notificationTarget.js +220 -0
- package/lib/commonjs/components/Notifications/notificationTarget.js.map +1 -0
- package/lib/commonjs/components/Notifications/notificationTranslations.js +137 -0
- package/lib/commonjs/components/Notifications/notificationTranslations.js.map +1 -0
- package/lib/commonjs/components/Poll/components/CreatePollHeader.js +2 -0
- package/lib/commonjs/components/Poll/components/CreatePollHeader.js.map +1 -1
- package/lib/commonjs/components/Poll/components/MultipleVotesSettings.js +2 -0
- package/lib/commonjs/components/Poll/components/MultipleVotesSettings.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollModalHeader.js +1 -0
- package/lib/commonjs/components/Poll/components/PollModalHeader.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollOption.js +14 -9
- package/lib/commonjs/components/Poll/components/PollOption.js.map +1 -1
- package/lib/commonjs/components/Poll/hooks/usePollState.js +35 -3
- package/lib/commonjs/components/Poll/hooks/usePollState.js.map +1 -1
- package/lib/commonjs/components/Reply/Reply.js +1 -0
- package/lib/commonjs/components/Reply/Reply.js.map +1 -1
- package/lib/commonjs/components/Thread/Thread.js +19 -11
- package/lib/commonjs/components/Thread/Thread.js.map +1 -1
- package/lib/commonjs/components/ThreadList/ThreadList.js +30 -9
- package/lib/commonjs/components/ThreadList/ThreadList.js.map +1 -1
- package/lib/commonjs/components/index.js +11 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/ui/Avatar/Avatar.js +6 -3
- package/lib/commonjs/components/ui/Avatar/Avatar.js.map +1 -1
- package/lib/commonjs/components/ui/Button/Button.js +16 -3
- package/lib/commonjs/components/ui/Button/Button.js.map +1 -1
- package/lib/commonjs/contexts/accessibilityContext/AccessibilityContext.js +21 -1
- package/lib/commonjs/contexts/accessibilityContext/AccessibilityContext.js.map +1 -1
- package/lib/commonjs/contexts/componentsContext/defaultComponents.js +4 -0
- package/lib/commonjs/contexts/componentsContext/defaultComponents.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +37 -0
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/themeContext/utils/theme.js +13 -0
- package/lib/commonjs/contexts/themeContext/utils/theme.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/useAudioPlayer.js +34 -1
- package/lib/commonjs/hooks/useAudioPlayer.js.map +1 -1
- package/lib/commonjs/hooks/useInAppNotificationsState.js.map +1 -1
- package/lib/commonjs/hooks/useLazyRef.js +13 -0
- package/lib/commonjs/hooks/useLazyRef.js.map +1 -0
- package/lib/commonjs/i18n/en.json +94 -1
- package/lib/commonjs/i18n/es.json +96 -3
- package/lib/commonjs/i18n/fr.json +94 -1
- package/lib/commonjs/i18n/he.json +94 -1
- package/lib/commonjs/i18n/hi.json +94 -1
- package/lib/commonjs/i18n/it.json +94 -1
- package/lib/commonjs/i18n/ja.json +94 -1
- package/lib/commonjs/i18n/ko.json +94 -1
- package/lib/commonjs/i18n/nl.json +94 -1
- package/lib/commonjs/i18n/pt-br.json +94 -1
- package/lib/commonjs/i18n/ru.json +94 -1
- package/lib/commonjs/i18n/tr.json +94 -1
- package/lib/commonjs/mock-builders/DB/mock.js +3 -1
- package/lib/commonjs/mock-builders/DB/mock.js.map +1 -1
- package/lib/commonjs/state-store/audio-player-pool.js +1 -0
- package/lib/commonjs/state-store/audio-player-pool.js.map +1 -1
- package/lib/commonjs/state-store/audio-player.js +92 -13
- package/lib/commonjs/state-store/audio-player.js.map +1 -1
- package/lib/commonjs/test-utils/BetterSqlite.js +3 -2
- package/lib/commonjs/test-utils/BetterSqlite.js.map +1 -1
- package/lib/commonjs/theme/generated/dark/StreamTokens.android.js +16 -16
- package/lib/commonjs/theme/generated/dark/StreamTokens.android.js.map +1 -1
- package/lib/commonjs/theme/generated/dark/StreamTokens.ios.js +8 -8
- package/lib/commonjs/theme/generated/dark/StreamTokens.ios.js.map +1 -1
- package/lib/commonjs/theme/generated/dark/StreamTokens.web.js +8 -8
- package/lib/commonjs/theme/generated/dark/StreamTokens.web.js.map +1 -1
- package/lib/commonjs/theme/generated/light/StreamTokens.android.js +16 -16
- package/lib/commonjs/theme/generated/light/StreamTokens.android.js.map +1 -1
- package/lib/commonjs/theme/generated/light/StreamTokens.ios.js +8 -8
- package/lib/commonjs/theme/generated/light/StreamTokens.ios.js.map +1 -1
- package/lib/commonjs/theme/generated/light/StreamTokens.web.js +8 -8
- package/lib/commonjs/theme/generated/light/StreamTokens.web.js.map +1 -1
- package/lib/commonjs/utils/animations/createBoundedZoomTransition.js +151 -0
- package/lib/commonjs/utils/animations/createBoundedZoomTransition.js.map +1 -0
- package/lib/commonjs/utils/{transitions.js → animations/transitions.js} +6 -0
- package/lib/commonjs/utils/animations/transitions.js.map +1 -0
- package/lib/commonjs/version.json +1 -1
- package/lib/module/a11y/hooks/useA11yLabel.js +4 -3
- package/lib/module/a11y/hooks/useA11yLabel.js.map +1 -1
- package/lib/module/a11y/hooks/useAccessibilityActivateAction.js +25 -0
- package/lib/module/a11y/hooks/useAccessibilityActivateAction.js.map +1 -0
- package/lib/module/a11y/index.js +11 -0
- package/lib/module/a11y/index.js.map +1 -1
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js +20 -0
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.js +1 -0
- package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js +19 -2
- package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerContent.js +4 -3
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerContent.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentTypePickerButton.js +9 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentTypePickerButton.js.map +1 -1
- package/lib/module/components/Channel/Channel.js +10 -1
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useMessageListPagination.js +26 -3
- package/lib/module/components/Channel/hooks/useMessageListPagination.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelList.js +29 -4
- package/lib/module/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/useChannelActions.js +314 -11
- package/lib/module/components/ChannelList/hooks/useChannelActions.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +2 -2
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js.map +1 -1
- package/lib/module/components/Message/hooks/useMessageActionHandlers.js +202 -15
- package/lib/module/components/Message/hooks/useMessageActionHandlers.js.map +1 -1
- package/lib/module/components/MessageInput/MessageComposer.js +1 -1
- package/lib/module/components/MessageInput/MessageComposerLeadingView.js +1 -1
- package/lib/module/components/MessageInput/MessageComposerLeadingView.js.map +1 -1
- package/lib/module/components/MessageInput/MessageInputHeaderView.js +1 -1
- package/lib/module/components/MessageInput/MessageInputHeaderView.js.map +1 -1
- package/lib/module/components/MessageInput/MessageInputTrailingView.js +1 -1
- package/lib/module/components/MessageInput/MessageInputTrailingView.js.map +1 -1
- package/lib/module/components/MessageInput/components/AttachmentPreview/AttachmentRemoveControl.js +16 -4
- package/lib/module/components/MessageInput/components/AttachmentPreview/AttachmentRemoveControl.js.map +1 -1
- package/lib/module/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js +7 -13
- package/lib/module/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js.map +1 -1
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecorder.js +30 -6
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecorder.js.map +1 -1
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingButton.js +34 -9
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingButton.js.map +1 -1
- package/lib/module/components/MessageInput/components/InputButtons/AttachButton.js +12 -3
- package/lib/module/components/MessageInput/components/InputButtons/AttachButton.js.map +1 -1
- package/lib/module/components/MessageInput/components/OutputButtons/EditButton.js +1 -0
- package/lib/module/components/MessageInput/components/OutputButtons/EditButton.js.map +1 -1
- package/lib/module/components/MessageInput/components/OutputButtons/SendButton.js +1 -0
- package/lib/module/components/MessageInput/components/OutputButtons/SendButton.js.map +1 -1
- package/lib/module/components/MessageInput/components/OutputButtons/index.js +1 -1
- package/lib/module/components/MessageList/MessageFlashList.js +24 -4
- package/lib/module/components/MessageList/MessageFlashList.js.map +1 -1
- package/lib/module/components/MessageList/MessageList.js +24 -4
- package/lib/module/components/MessageList/MessageList.js.map +1 -1
- package/lib/module/components/MessageList/ScrollToBottomButton.js +12 -6
- package/lib/module/components/MessageList/ScrollToBottomButton.js.map +1 -1
- package/lib/module/components/MessageList/UnreadMessagesNotification.js +1 -0
- package/lib/module/components/MessageList/UnreadMessagesNotification.js.map +1 -1
- package/lib/module/components/MessageList/hooks/useScrollToBottomAccessibilityAction.js +47 -0
- package/lib/module/components/MessageList/hooks/useScrollToBottomAccessibilityAction.js.map +1 -0
- package/lib/module/components/MessageMenu/MessageActionListItem.js +12 -4
- package/lib/module/components/MessageMenu/MessageActionListItem.js.map +1 -1
- package/lib/module/components/MessageMenu/MessageReactionPicker.js +1 -0
- package/lib/module/components/MessageMenu/MessageReactionPicker.js.map +1 -1
- package/lib/module/components/MessageMenu/ReactionButton.js +9 -6
- package/lib/module/components/MessageMenu/ReactionButton.js.map +1 -1
- package/lib/module/components/MessageMenu/hooks/useFetchReactions.js +23 -2
- package/lib/module/components/MessageMenu/hooks/useFetchReactions.js.map +1 -1
- package/lib/module/components/Notifications/Notification.js +232 -0
- package/lib/module/components/Notifications/Notification.js.map +1 -0
- package/lib/module/components/Notifications/NotificationList.js +120 -0
- package/lib/module/components/Notifications/NotificationList.js.map +1 -0
- package/lib/module/components/Notifications/NotificationTargetContext.js +45 -0
- package/lib/module/components/Notifications/NotificationTargetContext.js.map +1 -0
- package/lib/module/components/Notifications/hooks/index.js +59 -0
- package/lib/module/components/Notifications/hooks/index.js.map +1 -0
- package/lib/module/components/Notifications/hooks/useNotificationApi.js +133 -0
- package/lib/module/components/Notifications/hooks/useNotificationApi.js.map +1 -0
- package/lib/module/components/Notifications/hooks/useNotificationListController.js +133 -0
- package/lib/module/components/Notifications/hooks/useNotificationListController.js.map +1 -0
- package/lib/module/components/Notifications/hooks/useNotificationTarget.js +26 -0
- package/lib/module/components/Notifications/hooks/useNotificationTarget.js.map +1 -0
- package/lib/module/components/Notifications/hooks/useNotifications.js +26 -0
- package/lib/module/components/Notifications/hooks/useNotifications.js.map +1 -0
- package/lib/module/components/Notifications/hooks/useSystemNotifications.js +22 -0
- package/lib/module/components/Notifications/hooks/useSystemNotifications.js.map +1 -0
- package/lib/module/components/Notifications/index.js +59 -0
- package/lib/module/components/Notifications/index.js.map +1 -0
- package/lib/module/components/Notifications/notificationTarget.js +220 -0
- package/lib/module/components/Notifications/notificationTarget.js.map +1 -0
- package/lib/module/components/Notifications/notificationTranslations.js +137 -0
- package/lib/module/components/Notifications/notificationTranslations.js.map +1 -0
- package/lib/module/components/Poll/components/CreatePollHeader.js +2 -0
- package/lib/module/components/Poll/components/CreatePollHeader.js.map +1 -1
- package/lib/module/components/Poll/components/MultipleVotesSettings.js +2 -0
- package/lib/module/components/Poll/components/MultipleVotesSettings.js.map +1 -1
- package/lib/module/components/Poll/components/PollModalHeader.js +1 -0
- package/lib/module/components/Poll/components/PollModalHeader.js.map +1 -1
- package/lib/module/components/Poll/components/PollOption.js +14 -9
- package/lib/module/components/Poll/components/PollOption.js.map +1 -1
- package/lib/module/components/Poll/hooks/usePollState.js +35 -3
- package/lib/module/components/Poll/hooks/usePollState.js.map +1 -1
- package/lib/module/components/Reply/Reply.js +1 -0
- package/lib/module/components/Reply/Reply.js.map +1 -1
- package/lib/module/components/Thread/Thread.js +19 -11
- package/lib/module/components/Thread/Thread.js.map +1 -1
- package/lib/module/components/ThreadList/ThreadList.js +30 -9
- package/lib/module/components/ThreadList/ThreadList.js.map +1 -1
- package/lib/module/components/index.js +11 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/ui/Avatar/Avatar.js +6 -3
- package/lib/module/components/ui/Avatar/Avatar.js.map +1 -1
- package/lib/module/components/ui/Button/Button.js +16 -3
- package/lib/module/components/ui/Button/Button.js.map +1 -1
- package/lib/module/contexts/accessibilityContext/AccessibilityContext.js +21 -1
- package/lib/module/contexts/accessibilityContext/AccessibilityContext.js.map +1 -1
- package/lib/module/contexts/componentsContext/defaultComponents.js +4 -0
- package/lib/module/contexts/componentsContext/defaultComponents.js.map +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js +37 -0
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/contexts/themeContext/utils/theme.js +13 -0
- package/lib/module/contexts/themeContext/utils/theme.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/useAudioPlayer.js +34 -1
- package/lib/module/hooks/useAudioPlayer.js.map +1 -1
- package/lib/module/hooks/useInAppNotificationsState.js.map +1 -1
- package/lib/module/hooks/useLazyRef.js +13 -0
- package/lib/module/hooks/useLazyRef.js.map +1 -0
- package/lib/module/i18n/en.json +94 -1
- package/lib/module/i18n/es.json +96 -3
- package/lib/module/i18n/fr.json +94 -1
- package/lib/module/i18n/he.json +94 -1
- package/lib/module/i18n/hi.json +94 -1
- package/lib/module/i18n/it.json +94 -1
- package/lib/module/i18n/ja.json +94 -1
- package/lib/module/i18n/ko.json +94 -1
- package/lib/module/i18n/nl.json +94 -1
- package/lib/module/i18n/pt-br.json +94 -1
- package/lib/module/i18n/ru.json +94 -1
- package/lib/module/i18n/tr.json +94 -1
- package/lib/module/mock-builders/DB/mock.js +3 -1
- package/lib/module/mock-builders/DB/mock.js.map +1 -1
- package/lib/module/state-store/audio-player-pool.js +1 -0
- package/lib/module/state-store/audio-player-pool.js.map +1 -1
- package/lib/module/state-store/audio-player.js +92 -13
- package/lib/module/state-store/audio-player.js.map +1 -1
- package/lib/module/test-utils/BetterSqlite.js +3 -2
- package/lib/module/test-utils/BetterSqlite.js.map +1 -1
- package/lib/module/theme/generated/dark/StreamTokens.android.js +16 -16
- package/lib/module/theme/generated/dark/StreamTokens.android.js.map +1 -1
- package/lib/module/theme/generated/dark/StreamTokens.ios.js +8 -8
- package/lib/module/theme/generated/dark/StreamTokens.ios.js.map +1 -1
- package/lib/module/theme/generated/dark/StreamTokens.web.js +8 -8
- package/lib/module/theme/generated/dark/StreamTokens.web.js.map +1 -1
- package/lib/module/theme/generated/light/StreamTokens.android.js +16 -16
- package/lib/module/theme/generated/light/StreamTokens.android.js.map +1 -1
- package/lib/module/theme/generated/light/StreamTokens.ios.js +8 -8
- package/lib/module/theme/generated/light/StreamTokens.ios.js.map +1 -1
- package/lib/module/theme/generated/light/StreamTokens.web.js +8 -8
- package/lib/module/theme/generated/light/StreamTokens.web.js.map +1 -1
- package/lib/module/utils/animations/createBoundedZoomTransition.js +151 -0
- package/lib/module/utils/animations/createBoundedZoomTransition.js.map +1 -0
- package/lib/module/utils/{transitions.js → animations/transitions.js} +6 -0
- package/lib/module/utils/animations/transitions.js.map +1 -0
- package/lib/module/version.json +1 -1
- package/lib/typescript/a11y/a11yUtils.d.ts +3 -3
- package/lib/typescript/a11y/a11yUtils.d.ts.map +1 -1
- package/lib/typescript/a11y/hooks/useA11yLabel.d.ts +2 -1
- package/lib/typescript/a11y/hooks/useA11yLabel.d.ts.map +1 -1
- package/lib/typescript/a11y/hooks/useAccessibilityActivateAction.d.ts +17 -0
- package/lib/typescript/a11y/hooks/useAccessibilityActivateAction.d.ts.map +1 -0
- package/lib/typescript/a11y/index.d.ts +1 -0
- package/lib/typescript/a11y/index.d.ts.map +1 -1
- package/lib/typescript/components/AttachmentPicker/AttachmentPicker.d.ts.map +1 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.d.ts.map +1 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.d.ts.map +1 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentPickerContent.d.ts.map +1 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentTypePickerButton.d.ts +2 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentTypePickerButton.d.ts.map +1 -1
- package/lib/typescript/components/Channel/Channel.d.ts +1 -0
- package/lib/typescript/components/Channel/Channel.d.ts.map +1 -1
- package/lib/typescript/components/Channel/hooks/useMessageListPagination.d.ts.map +1 -1
- package/lib/typescript/components/ChannelList/ChannelList.d.ts +1 -0
- package/lib/typescript/components/ChannelList/ChannelList.d.ts.map +1 -1
- package/lib/typescript/components/ChannelList/hooks/useChannelActions.d.ts.map +1 -1
- package/lib/typescript/components/Message/hooks/useMessageActionHandlers.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/components/AttachmentPreview/AttachmentRemoveControl.d.ts +5 -2
- package/lib/typescript/components/MessageInput/components/AttachmentPreview/AttachmentRemoveControl.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/components/AudioRecorder/AudioRecorder.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/components/AudioRecorder/AudioRecordingButton.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/components/InputButtons/AttachButton.d.ts +1 -0
- package/lib/typescript/components/MessageInput/components/InputButtons/AttachButton.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/components/OutputButtons/EditButton.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/components/OutputButtons/SendButton.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/MessageFlashList.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/MessageList.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/ScrollToBottomButton.d.ts +2 -0
- package/lib/typescript/components/MessageList/ScrollToBottomButton.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/UnreadMessagesNotification.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/hooks/useScrollToBottomAccessibilityAction.d.ts +20 -0
- package/lib/typescript/components/MessageList/hooks/useScrollToBottomAccessibilityAction.d.ts.map +1 -0
- package/lib/typescript/components/MessageMenu/MessageActionListItem.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/MessageReactionPicker.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/ReactionButton.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/hooks/useFetchReactions.d.ts.map +1 -1
- package/lib/typescript/components/Notifications/Notification.d.ts +31 -0
- package/lib/typescript/components/Notifications/Notification.d.ts.map +1 -0
- package/lib/typescript/components/Notifications/NotificationList.d.ts +28 -0
- package/lib/typescript/components/Notifications/NotificationList.d.ts.map +1 -0
- package/lib/typescript/components/Notifications/NotificationTargetContext.d.ts +14 -0
- package/lib/typescript/components/Notifications/NotificationTargetContext.d.ts.map +1 -0
- package/lib/typescript/components/Notifications/hooks/index.d.ts +6 -0
- package/lib/typescript/components/Notifications/hooks/index.d.ts.map +1 -0
- package/lib/typescript/components/Notifications/hooks/useNotificationApi.d.ts +48 -0
- package/lib/typescript/components/Notifications/hooks/useNotificationApi.d.ts.map +1 -0
- package/lib/typescript/components/Notifications/hooks/useNotificationListController.d.ts +14 -0
- package/lib/typescript/components/Notifications/hooks/useNotificationListController.d.ts.map +1 -0
- package/lib/typescript/components/Notifications/hooks/useNotificationTarget.d.ts +3 -0
- package/lib/typescript/components/Notifications/hooks/useNotificationTarget.d.ts.map +1 -0
- package/lib/typescript/components/Notifications/hooks/useNotifications.d.ts +14 -0
- package/lib/typescript/components/Notifications/hooks/useNotifications.d.ts.map +1 -0
- package/lib/typescript/components/Notifications/hooks/useSystemNotifications.d.ts +9 -0
- package/lib/typescript/components/Notifications/hooks/useSystemNotifications.d.ts.map +1 -0
- package/lib/typescript/components/Notifications/index.d.ts +6 -0
- package/lib/typescript/components/Notifications/index.d.ts.map +1 -0
- package/lib/typescript/components/Notifications/notificationTarget.d.ts +55 -0
- package/lib/typescript/components/Notifications/notificationTarget.d.ts.map +1 -0
- package/lib/typescript/components/Notifications/notificationTranslations.d.ts +7 -0
- package/lib/typescript/components/Notifications/notificationTranslations.d.ts.map +1 -0
- package/lib/typescript/components/Poll/components/CreatePollHeader.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/MultipleVotesSettings.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/PollModalHeader.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/PollOption.d.ts.map +1 -1
- package/lib/typescript/components/Poll/hooks/usePollState.d.ts.map +1 -1
- package/lib/typescript/components/Reply/Reply.d.ts.map +1 -1
- package/lib/typescript/components/Thread/Thread.d.ts +1 -0
- package/lib/typescript/components/Thread/Thread.d.ts.map +1 -1
- package/lib/typescript/components/ThreadList/ThreadList.d.ts +3 -1
- package/lib/typescript/components/ThreadList/ThreadList.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +1 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/components/ui/Avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/components/ui/Button/Button.d.ts +10 -1
- package/lib/typescript/components/ui/Button/Button.d.ts.map +1 -1
- package/lib/typescript/contexts/accessibilityContext/AccessibilityContext.d.ts +1 -1
- package/lib/typescript/contexts/accessibilityContext/AccessibilityContext.d.ts.map +1 -1
- package/lib/typescript/contexts/componentsContext/defaultComponents.d.ts +3 -0
- package/lib/typescript/contexts/componentsContext/defaultComponents.d.ts.map +1 -1
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts.map +1 -1
- package/lib/typescript/contexts/themeContext/ThemeContext.d.ts +13 -0
- package/lib/typescript/contexts/themeContext/ThemeContext.d.ts.map +1 -1
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts +13 -0
- package/lib/typescript/contexts/themeContext/utils/theme.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/useAudioPlayer.d.ts.map +1 -1
- package/lib/typescript/hooks/useInAppNotificationsState.d.ts +6 -0
- package/lib/typescript/hooks/useInAppNotificationsState.d.ts.map +1 -1
- package/lib/typescript/hooks/useLazyRef.d.ts +7 -0
- package/lib/typescript/hooks/useLazyRef.d.ts.map +1 -0
- package/lib/typescript/i18n/en.json +94 -1
- package/lib/typescript/i18n/es.json +96 -3
- package/lib/typescript/i18n/fr.json +94 -1
- package/lib/typescript/i18n/he.json +94 -1
- package/lib/typescript/i18n/hi.json +94 -1
- package/lib/typescript/i18n/it.json +94 -1
- package/lib/typescript/i18n/ja.json +94 -1
- package/lib/typescript/i18n/ko.json +94 -1
- package/lib/typescript/i18n/nl.json +94 -1
- package/lib/typescript/i18n/pt-br.json +94 -1
- package/lib/typescript/i18n/ru.json +94 -1
- package/lib/typescript/i18n/tr.json +94 -1
- package/lib/typescript/state-store/audio-player-pool.d.ts.map +1 -1
- package/lib/typescript/state-store/audio-player.d.ts +13 -0
- package/lib/typescript/state-store/audio-player.d.ts.map +1 -1
- package/lib/typescript/test-utils/BetterSqlite.d.ts.map +1 -1
- package/lib/typescript/utils/animations/createBoundedZoomTransition.d.ts +21 -0
- package/lib/typescript/utils/animations/createBoundedZoomTransition.d.ts.map +1 -0
- package/lib/typescript/utils/animations/transitions.d.ts +21 -0
- package/lib/typescript/utils/animations/transitions.d.ts.map +1 -0
- package/lib/typescript/utils/i18n/Streami18n.d.ts +93 -0
- package/lib/typescript/utils/i18n/Streami18n.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/offline-support/offline-feature.tsx +40 -34
- package/src/a11y/a11yUtils.ts +2 -2
- package/src/a11y/hooks/useA11yLabel.ts +7 -4
- package/src/a11y/hooks/useAccessibilityActivateAction.ts +44 -0
- package/src/a11y/index.ts +1 -0
- package/src/components/AttachmentPicker/AttachmentPicker.tsx +23 -1
- package/src/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.tsx +1 -0
- package/src/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.tsx +15 -2
- package/src/components/AttachmentPicker/components/AttachmentPickerContent.tsx +4 -3
- package/src/components/AttachmentPicker/components/AttachmentTypePickerButton.tsx +9 -0
- package/src/components/AttachmentPicker/components/__tests__/AttachmentPickerContent.test.tsx +19 -18
- package/src/components/Channel/Channel.tsx +15 -1
- package/src/components/Channel/__tests__/useMessageListPagination.test.tsx +34 -2
- package/src/components/Channel/hooks/useMessageListPagination.tsx +19 -3
- package/src/components/ChannelList/ChannelList.tsx +27 -5
- package/src/components/ChannelList/__tests__/ChannelListView.test.tsx +16 -5
- package/src/components/ChannelList/hooks/__tests__/useChannelActions.test.tsx +123 -0
- package/src/components/ChannelList/hooks/useChannelActions.ts +181 -12
- package/src/components/ImageGallery/__tests__/ImageGalleryFooter.test.tsx +9 -3
- package/src/components/ImageGallery/__tests__/ImageGalleryHeader.test.tsx +4 -1
- package/src/components/ImageGallery/components/ImageGalleryFooter.tsx +2 -2
- package/src/components/ImageGallery/components/ImageGalleryHeader.tsx +1 -1
- package/src/components/ImageGallery/components/ImageGalleryVideoControl.tsx +1 -1
- package/src/components/Message/hooks/__tests__/useMessageActionHandlers.test.tsx +131 -0
- package/src/components/Message/hooks/useMessageActionHandlers.ts +133 -23
- package/src/components/MessageInput/MessageComposer.tsx +1 -1
- package/src/components/MessageInput/MessageComposerLeadingView.tsx +1 -1
- package/src/components/MessageInput/MessageInputHeaderView.tsx +1 -1
- package/src/components/MessageInput/MessageInputTrailingView.tsx +1 -1
- package/src/components/MessageInput/components/AttachmentPreview/AttachmentRemoveControl.tsx +18 -2
- package/src/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.tsx +1 -10
- package/src/components/MessageInput/components/AudioRecorder/AudioRecorder.tsx +13 -2
- package/src/components/MessageInput/components/AudioRecorder/AudioRecordingButton.tsx +35 -14
- package/src/components/MessageInput/components/InputButtons/AttachButton.tsx +13 -3
- package/src/components/MessageInput/components/OutputButtons/EditButton.tsx +1 -0
- package/src/components/MessageInput/components/OutputButtons/SendButton.tsx +1 -0
- package/src/components/MessageInput/components/OutputButtons/index.tsx +1 -1
- package/src/components/MessageList/MessageFlashList.tsx +26 -3
- package/src/components/MessageList/MessageList.tsx +26 -3
- package/src/components/MessageList/ScrollToBottomButton.tsx +18 -6
- package/src/components/MessageList/UnreadMessagesNotification.tsx +1 -0
- package/src/components/MessageList/__tests__/MessageList.test.tsx +221 -0
- package/src/components/MessageList/__tests__/ScrollToBottomButton.test.tsx +2 -2
- package/src/components/MessageList/__tests__/__snapshots__/ScrollToBottomButton.test.tsx.snap +3 -1
- package/src/components/MessageList/hooks/useScrollToBottomAccessibilityAction.ts +74 -0
- package/src/components/MessageMenu/MessageActionListItem.tsx +10 -4
- package/src/components/MessageMenu/MessageReactionPicker.tsx +1 -0
- package/src/components/MessageMenu/ReactionButton.tsx +7 -9
- package/src/components/MessageMenu/__tests__/MessageReactionPicker.test.tsx +13 -15
- package/src/components/MessageMenu/__tests__/MessageUserReactions.test.tsx +20 -18
- package/src/components/MessageMenu/__tests__/ReactionButton.test.tsx +18 -5
- package/src/components/MessageMenu/hooks/useFetchReactions.ts +17 -2
- package/src/components/Notifications/Notification.tsx +254 -0
- package/src/components/Notifications/NotificationList.tsx +160 -0
- package/src/components/Notifications/NotificationTargetContext.tsx +45 -0
- package/src/components/Notifications/__tests__/NotificationList.test.tsx +480 -0
- package/src/components/Notifications/__tests__/notificationTarget.test.ts +157 -0
- package/src/components/Notifications/hooks/__tests__/useNotificationApi.test.tsx +172 -0
- package/src/components/Notifications/hooks/__tests__/useNotificationTarget.test.tsx +85 -0
- package/src/components/Notifications/hooks/index.ts +5 -0
- package/src/components/Notifications/hooks/useNotificationApi.ts +248 -0
- package/src/components/Notifications/hooks/useNotificationListController.ts +160 -0
- package/src/components/Notifications/hooks/useNotificationTarget.ts +37 -0
- package/src/components/Notifications/hooks/useNotifications.ts +43 -0
- package/src/components/Notifications/hooks/useSystemNotifications.ts +33 -0
- package/src/components/Notifications/index.ts +5 -0
- package/src/components/Notifications/notificationTarget.ts +305 -0
- package/src/components/Notifications/notificationTranslations.ts +142 -0
- package/src/components/Poll/components/CreatePollHeader.tsx +2 -0
- package/src/components/Poll/components/MultipleVotesSettings.tsx +2 -0
- package/src/components/Poll/components/PollModalHeader.tsx +1 -0
- package/src/components/Poll/components/PollOption.tsx +10 -6
- package/src/components/Poll/hooks/usePollState.ts +26 -2
- package/src/components/Reply/Reply.tsx +4 -1
- package/src/components/Thread/Thread.tsx +24 -16
- package/src/components/Thread/__tests__/__snapshots__/Thread.test.tsx.snap +3 -0
- package/src/components/ThreadList/ThreadList.tsx +33 -9
- package/src/components/index.ts +2 -0
- package/src/components/ui/Avatar/Avatar.tsx +2 -1
- package/src/components/ui/Button/Button.tsx +26 -0
- package/src/components/ui/Button/__tests__/Button.test.tsx +44 -0
- package/src/contexts/accessibilityContext/AccessibilityContext.tsx +35 -1
- package/src/contexts/componentsContext/defaultComponents.ts +4 -0
- package/src/contexts/messageInputContext/MessageInputContext.tsx +36 -0
- package/src/contexts/themeContext/utils/theme.ts +26 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useAudioPlayer.ts +44 -3
- package/src/hooks/useInAppNotificationsState.ts +6 -0
- package/src/hooks/useLazyRef.ts +15 -0
- package/src/i18n/en.json +94 -1
- package/src/i18n/es.json +96 -3
- package/src/i18n/fr.json +94 -1
- package/src/i18n/he.json +94 -1
- package/src/i18n/hi.json +94 -1
- package/src/i18n/it.json +94 -1
- package/src/i18n/ja.json +94 -1
- package/src/i18n/ko.json +94 -1
- package/src/i18n/nl.json +94 -1
- package/src/i18n/pt-br.json +94 -1
- package/src/i18n/ru.json +94 -1
- package/src/i18n/tr.json +94 -1
- package/src/mock-builders/DB/mock.ts +2 -1
- package/src/state-store/__tests__/audio-player.test.ts +45 -0
- package/src/state-store/audio-player-pool.ts +1 -0
- package/src/state-store/audio-player.ts +108 -16
- package/src/test-utils/BetterSqlite.ts +3 -1
- package/src/theme/generated/dark/StreamTokens.android.ts +16 -16
- package/src/theme/generated/dark/StreamTokens.ios.ts +8 -8
- package/src/theme/generated/dark/StreamTokens.web.ts +8 -8
- package/src/theme/generated/light/StreamTokens.android.ts +16 -16
- package/src/theme/generated/light/StreamTokens.ios.ts +8 -8
- package/src/theme/generated/light/StreamTokens.web.ts +8 -8
- package/src/utils/animations/createBoundedZoomTransition.ts +117 -0
- package/src/utils/{transitions.ts → animations/transitions.ts} +6 -0
- package/src/version.json +1 -1
- package/lib/commonjs/utils/transitions.js.map +0 -1
- package/lib/module/utils/transitions.js.map +0 -1
- package/lib/typescript/utils/transitions.d.ts +0 -9
- package/lib/typescript/utils/transitions.d.ts.map +0 -1
|
@@ -19,6 +19,25 @@ import {
|
|
|
19
19
|
} from '../../../hooks';
|
|
20
20
|
import { useTranslatedMessage } from '../../../hooks/useTranslatedMessage';
|
|
21
21
|
import { NativeHandlers } from '../../../native';
|
|
22
|
+
import { useNotificationApi } from '../../Notifications';
|
|
23
|
+
|
|
24
|
+
const getErrorMessage = (error: unknown, fallback: string) =>
|
|
25
|
+
error instanceof Error && error.message ? error.message : fallback;
|
|
26
|
+
|
|
27
|
+
const getNotificationError = (error: unknown): Error | undefined => {
|
|
28
|
+
if (error instanceof Error) return error;
|
|
29
|
+
if (typeof error === 'string') return new Error(error);
|
|
30
|
+
if (error && typeof error === 'object' && 'message' in error) {
|
|
31
|
+
const message = error.message;
|
|
32
|
+
if (typeof message === 'string') return new Error(message);
|
|
33
|
+
}
|
|
34
|
+
return undefined;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const getNotificationErrorOptions = (error: unknown) => {
|
|
38
|
+
const originalError = getNotificationError(error);
|
|
39
|
+
return originalError ? { originalError } : {};
|
|
40
|
+
};
|
|
22
41
|
|
|
23
42
|
export const useWithPortalKeyboardSafety = <T extends unknown[]>(
|
|
24
43
|
callback: (...args: T) => void,
|
|
@@ -47,6 +66,7 @@ export const useMessageActionHandlers = ({
|
|
|
47
66
|
Pick<MessageContextValue, 'message'> &
|
|
48
67
|
Pick<MessageComposerAPIContextValue, 'setEditingState' | 'setQuotedMessage'>) => {
|
|
49
68
|
const { t } = useTranslationContext();
|
|
69
|
+
const { addNotification } = useNotificationApi();
|
|
50
70
|
const handleResendMessage = useStableCallback(() => retrySendMessage(message));
|
|
51
71
|
const translatedMessage = useTranslatedMessage(message);
|
|
52
72
|
|
|
@@ -74,7 +94,24 @@ export const useMessageActionHandlers = ({
|
|
|
74
94
|
{ style: 'cancel', text: t('Cancel') },
|
|
75
95
|
{
|
|
76
96
|
onPress: async () => {
|
|
77
|
-
|
|
97
|
+
try {
|
|
98
|
+
await deleteMessage(message);
|
|
99
|
+
addNotification({
|
|
100
|
+
message: t('Message deleted'),
|
|
101
|
+
options: { severity: 'success', type: 'api:message:delete:success' },
|
|
102
|
+
origin: { context: { message }, emitter: 'MessageActions' },
|
|
103
|
+
});
|
|
104
|
+
} catch (error) {
|
|
105
|
+
addNotification({
|
|
106
|
+
message: getErrorMessage(error, t('Error deleting message')),
|
|
107
|
+
options: {
|
|
108
|
+
...getNotificationErrorOptions(error),
|
|
109
|
+
severity: 'error',
|
|
110
|
+
type: 'api:message:delete:failed',
|
|
111
|
+
},
|
|
112
|
+
origin: { context: { message }, emitter: 'MessageActions' },
|
|
113
|
+
});
|
|
114
|
+
}
|
|
78
115
|
},
|
|
79
116
|
style: 'destructive',
|
|
80
117
|
text: t('Delete'),
|
|
@@ -97,10 +134,39 @@ export const useMessageActionHandlers = ({
|
|
|
97
134
|
return;
|
|
98
135
|
}
|
|
99
136
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
137
|
+
try {
|
|
138
|
+
if (isMuted) {
|
|
139
|
+
await client.unmuteUser(message.user.id);
|
|
140
|
+
addNotification({
|
|
141
|
+
message: t('{{ user }} has been unmuted', {
|
|
142
|
+
user: message.user?.name || message.user?.id,
|
|
143
|
+
}),
|
|
144
|
+
options: { severity: 'success', type: 'api:user:unmute:success' },
|
|
145
|
+
origin: { context: { message }, emitter: 'MessageActions' },
|
|
146
|
+
});
|
|
147
|
+
} else {
|
|
148
|
+
await client.muteUser(message.user.id);
|
|
149
|
+
addNotification({
|
|
150
|
+
message: t('{{ user }} has been muted', {
|
|
151
|
+
user: message.user?.name || message.user?.id,
|
|
152
|
+
}),
|
|
153
|
+
options: { severity: 'success', type: 'api:user:mute:success' },
|
|
154
|
+
origin: { context: { message }, emitter: 'MessageActions' },
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
} catch (error) {
|
|
158
|
+
addNotification({
|
|
159
|
+
message: getErrorMessage(
|
|
160
|
+
error,
|
|
161
|
+
isMuted ? t('Error unmuting a user ...') : t('Error muting a user ...'),
|
|
162
|
+
),
|
|
163
|
+
options: {
|
|
164
|
+
...getNotificationErrorOptions(error),
|
|
165
|
+
severity: 'error',
|
|
166
|
+
type: isMuted ? 'api:user:unmute:failed' : 'api:user:mute:failed',
|
|
167
|
+
},
|
|
168
|
+
origin: { context: { message }, emitter: 'MessageActions' },
|
|
169
|
+
});
|
|
104
170
|
}
|
|
105
171
|
});
|
|
106
172
|
|
|
@@ -118,11 +184,36 @@ export const useMessageActionHandlers = ({
|
|
|
118
184
|
});
|
|
119
185
|
|
|
120
186
|
const handleTogglePinMessage = useStableCallback(async () => {
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
187
|
+
const isPinned = !!message.pinned;
|
|
188
|
+
try {
|
|
189
|
+
if (!isPinned) {
|
|
190
|
+
await client.pinMessage(message, null);
|
|
191
|
+
addNotification({
|
|
192
|
+
message: t('Message pinned'),
|
|
193
|
+
options: { severity: 'success', type: 'api:message:pin:success' },
|
|
194
|
+
origin: { context: { message }, emitter: 'MessageActions' },
|
|
195
|
+
});
|
|
196
|
+
} else {
|
|
197
|
+
await client.unpinMessage(message);
|
|
198
|
+
addNotification({
|
|
199
|
+
message: t('Message unpinned'),
|
|
200
|
+
options: { severity: 'success', type: 'api:message:unpin:success' },
|
|
201
|
+
origin: { context: { message }, emitter: 'MessageActions' },
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
} catch (error) {
|
|
205
|
+
addNotification({
|
|
206
|
+
message: getErrorMessage(
|
|
207
|
+
error,
|
|
208
|
+
isPinned ? t('Error removing message pin') : t('Error pinning message'),
|
|
209
|
+
),
|
|
210
|
+
options: {
|
|
211
|
+
...getNotificationErrorOptions(error),
|
|
212
|
+
severity: 'error',
|
|
213
|
+
type: isPinned ? 'api:message:unpin:failed' : 'api:message:pin:failed',
|
|
214
|
+
},
|
|
215
|
+
origin: { context: { message }, emitter: 'MessageActions' },
|
|
216
|
+
});
|
|
126
217
|
}
|
|
127
218
|
});
|
|
128
219
|
|
|
@@ -143,15 +234,21 @@ export const useMessageActionHandlers = ({
|
|
|
143
234
|
onPress: async () => {
|
|
144
235
|
try {
|
|
145
236
|
await client.flagMessage(message.id);
|
|
146
|
-
|
|
237
|
+
addNotification({
|
|
238
|
+
message: t('Message has been successfully flagged'),
|
|
239
|
+
options: { severity: 'success', type: 'api:message:flag:success' },
|
|
240
|
+
origin: { context: { message }, emitter: 'MessageActions' },
|
|
241
|
+
});
|
|
147
242
|
} catch (error) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
243
|
+
addNotification({
|
|
244
|
+
message: getErrorMessage(error, t('Error adding flag')),
|
|
245
|
+
options: {
|
|
246
|
+
...getNotificationErrorOptions(error),
|
|
247
|
+
severity: 'error',
|
|
248
|
+
type: 'api:message:flag:failed',
|
|
249
|
+
},
|
|
250
|
+
origin: { context: { message }, emitter: 'MessageActions' },
|
|
251
|
+
});
|
|
155
252
|
}
|
|
156
253
|
},
|
|
157
254
|
text: t('Flag'),
|
|
@@ -167,13 +264,26 @@ export const useMessageActionHandlers = ({
|
|
|
167
264
|
}
|
|
168
265
|
try {
|
|
169
266
|
await channel.markUnread({ message_id: message.id });
|
|
267
|
+
addNotification({
|
|
268
|
+
message: t('Message marked as unread'),
|
|
269
|
+
options: { severity: 'success', type: 'api:message:markUnread:success' },
|
|
270
|
+
origin: { context: { message }, emitter: 'MessageActions' },
|
|
271
|
+
});
|
|
170
272
|
} catch (error) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
273
|
+
addNotification({
|
|
274
|
+
message: getErrorMessage(
|
|
275
|
+
error,
|
|
276
|
+
t(
|
|
277
|
+
'Error marking message unread. Cannot mark unread messages older than the newest 100 channel messages.',
|
|
278
|
+
),
|
|
175
279
|
),
|
|
176
|
-
|
|
280
|
+
options: {
|
|
281
|
+
...getNotificationErrorOptions(error),
|
|
282
|
+
severity: 'error',
|
|
283
|
+
type: 'api:message:markUnread:failed',
|
|
284
|
+
},
|
|
285
|
+
origin: { context: { message }, emitter: 'MessageActions' },
|
|
286
|
+
});
|
|
177
287
|
}
|
|
178
288
|
});
|
|
179
289
|
|
|
@@ -50,7 +50,7 @@ import { useStateStore } from '../../hooks/useStateStore';
|
|
|
50
50
|
import { AudioRecorderManagerState } from '../../state-store/audio-recorder-manager';
|
|
51
51
|
import { MessageInputHeightState } from '../../state-store/message-input-height-store';
|
|
52
52
|
import { primitives } from '../../theme';
|
|
53
|
-
import { transitions } from '../../utils/transitions';
|
|
53
|
+
import { transitions } from '../../utils/animations/transitions';
|
|
54
54
|
import { type TextInputOverrideComponent } from '../AutoCompleteInput/AutoCompleteInput';
|
|
55
55
|
import { CreatePoll } from '../Poll/CreatePollContent';
|
|
56
56
|
import { PortalWhileClosingView } from '../UIComponents/PortalWhileClosingView';
|
|
@@ -9,7 +9,7 @@ import { idleRecordingStateSelector } from './utils/audioRecorderSelectors';
|
|
|
9
9
|
import { useMessageInputContext } from '../../contexts/messageInputContext/MessageInputContext';
|
|
10
10
|
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
11
11
|
import { useStateStore } from '../../hooks/useStateStore';
|
|
12
|
-
import { transitions } from '../../utils/transitions';
|
|
12
|
+
import { transitions } from '../../utils/animations/transitions';
|
|
13
13
|
|
|
14
14
|
export const MessageComposerLeadingView = () => {
|
|
15
15
|
const {
|
|
@@ -17,7 +17,7 @@ import { useMessageInputContext } from '../../contexts/messageInputContext/Messa
|
|
|
17
17
|
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
18
18
|
import { useStateStore } from '../../hooks/useStateStore';
|
|
19
19
|
import { primitives } from '../../theme';
|
|
20
|
-
import { transitions } from '../../utils/transitions';
|
|
20
|
+
import { transitions } from '../../utils/animations/transitions';
|
|
21
21
|
|
|
22
22
|
export const MessageInputHeaderView = () => {
|
|
23
23
|
const {
|
|
@@ -11,7 +11,7 @@ import { useMessageInputContext } from '../../contexts/messageInputContext/Messa
|
|
|
11
11
|
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
12
12
|
import { useStateStore } from '../../hooks/useStateStore';
|
|
13
13
|
import { primitives } from '../../theme';
|
|
14
|
-
import { transitions } from '../../utils/transitions';
|
|
14
|
+
import { transitions } from '../../utils/animations/transitions';
|
|
15
15
|
|
|
16
16
|
export const MessageInputTrailingView = () => {
|
|
17
17
|
const {
|
package/src/components/MessageInput/components/AttachmentPreview/AttachmentRemoveControl.tsx
CHANGED
|
@@ -2,13 +2,22 @@ import React, { useMemo } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { Pressable, PressableProps, StyleSheet } from 'react-native';
|
|
4
4
|
|
|
5
|
+
import { useA11yLabel } from '../../../../a11y/hooks/useA11yLabel';
|
|
5
6
|
import { useTheme } from '../../../../contexts/themeContext/ThemeContext';
|
|
6
7
|
import { NewClose } from '../../../../icons/xmark';
|
|
7
8
|
import { primitives } from '../../../../theme';
|
|
8
9
|
|
|
9
|
-
type AttachmentRemoveControlProps = PressableProps
|
|
10
|
+
type AttachmentRemoveControlProps = PressableProps & {
|
|
11
|
+
accessibilityLabelKey?: string;
|
|
12
|
+
accessibilityLabelParams?: Record<string, unknown>;
|
|
13
|
+
};
|
|
10
14
|
|
|
11
|
-
export const AttachmentRemoveControl = ({
|
|
15
|
+
export const AttachmentRemoveControl = ({
|
|
16
|
+
accessibilityLabelKey = 'a11y/Remove attachment',
|
|
17
|
+
accessibilityLabelParams,
|
|
18
|
+
onPress,
|
|
19
|
+
...rest
|
|
20
|
+
}: AttachmentRemoveControlProps) => {
|
|
12
21
|
const {
|
|
13
22
|
theme: {
|
|
14
23
|
semantics,
|
|
@@ -18,9 +27,15 @@ export const AttachmentRemoveControl = ({ onPress }: AttachmentRemoveControlProp
|
|
|
18
27
|
},
|
|
19
28
|
} = useTheme();
|
|
20
29
|
const styles = useStyles();
|
|
30
|
+
const translatedAccessibilityLabel = useA11yLabel(
|
|
31
|
+
accessibilityLabelKey,
|
|
32
|
+
accessibilityLabelParams,
|
|
33
|
+
);
|
|
21
34
|
|
|
22
35
|
return (
|
|
23
36
|
<Pressable
|
|
37
|
+
accessibilityLabel={translatedAccessibilityLabel}
|
|
38
|
+
accessibilityRole='button'
|
|
24
39
|
hitSlop={15}
|
|
25
40
|
onPress={onPress}
|
|
26
41
|
style={({ pressed }) => [
|
|
@@ -31,6 +46,7 @@ export const AttachmentRemoveControl = ({ onPress }: AttachmentRemoveControlProp
|
|
|
31
46
|
dismiss,
|
|
32
47
|
]}
|
|
33
48
|
testID='remove-upload-preview'
|
|
49
|
+
{...rest}
|
|
34
50
|
>
|
|
35
51
|
<NewClose
|
|
36
52
|
height={16}
|
package/src/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.tsx
CHANGED
|
@@ -29,6 +29,7 @@ import { useComponentsContext } from '../../../../contexts/componentsContext/Com
|
|
|
29
29
|
import { useAttachmentManagerState } from '../../../../contexts/messageInputContext/hooks/useAttachmentManagerState';
|
|
30
30
|
import { useMessageInputContext } from '../../../../contexts/messageInputContext/MessageInputContext';
|
|
31
31
|
import { useTheme } from '../../../../contexts/themeContext/ThemeContext';
|
|
32
|
+
import { useLazyRef } from '../../../../hooks/useLazyRef';
|
|
32
33
|
import { isSoundPackageAvailable } from '../../../../native';
|
|
33
34
|
import { primitives } from '../../../../theme';
|
|
34
35
|
|
|
@@ -73,16 +74,6 @@ const ItemSeparatorComponent = () => {
|
|
|
73
74
|
return <View style={[styles.itemSeparator, itemSeparator]} />;
|
|
74
75
|
};
|
|
75
76
|
|
|
76
|
-
const useLazyRef = <T,>(getInitialValue: () => T) => {
|
|
77
|
-
const ref = useRef<T | null>(null);
|
|
78
|
-
|
|
79
|
-
if (ref.current === null) {
|
|
80
|
-
ref.current = getInitialValue();
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return ref as React.RefObject<T>;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
77
|
const getIsAudioAttachmentPreview =
|
|
87
78
|
(soundPackageAvailable: boolean) =>
|
|
88
79
|
(
|
|
@@ -23,6 +23,7 @@ import { Mic } from '../../../../icons/voice';
|
|
|
23
23
|
import { NativeHandlers } from '../../../../native';
|
|
24
24
|
import { AudioRecorderManagerState } from '../../../../state-store/audio-recorder-manager';
|
|
25
25
|
import { primitives } from '../../../../theme';
|
|
26
|
+
import { useNotificationApi } from '../../../Notifications';
|
|
26
27
|
|
|
27
28
|
type AudioRecorderPropsWithContext = Pick<
|
|
28
29
|
MessageInputContextValue,
|
|
@@ -59,6 +60,7 @@ const StopRecording = ({
|
|
|
59
60
|
|
|
60
61
|
return (
|
|
61
62
|
<Button
|
|
63
|
+
accessibilityLabelKey='a11y/Stop voice recording'
|
|
62
64
|
variant='destructive'
|
|
63
65
|
type='outline'
|
|
64
66
|
size='sm'
|
|
@@ -83,6 +85,7 @@ const UploadRecording = ({
|
|
|
83
85
|
|
|
84
86
|
return (
|
|
85
87
|
<Button
|
|
88
|
+
accessibilityLabelKey='a11y/Send voice recording'
|
|
86
89
|
variant='primary'
|
|
87
90
|
type='solid'
|
|
88
91
|
onPress={onUploadVoiceRecording}
|
|
@@ -98,12 +101,20 @@ const DeleteRecording = ({
|
|
|
98
101
|
}: {
|
|
99
102
|
deleteVoiceRecordingHandler: () => Promise<void>;
|
|
100
103
|
}) => {
|
|
101
|
-
const
|
|
104
|
+
const { addNotification } = useNotificationApi();
|
|
105
|
+
const { t } = useTranslationContext();
|
|
106
|
+
const onDeleteVoiceRecording = async () => {
|
|
102
107
|
NativeHandlers.triggerHaptic('impactMedium');
|
|
103
|
-
deleteVoiceRecordingHandler();
|
|
108
|
+
await deleteVoiceRecordingHandler();
|
|
109
|
+
addNotification({
|
|
110
|
+
message: t('Voice message deleted'),
|
|
111
|
+
options: { severity: 'info', type: 'audioRecording:cancel:success' },
|
|
112
|
+
origin: { emitter: 'AudioRecorder' },
|
|
113
|
+
});
|
|
104
114
|
};
|
|
105
115
|
return (
|
|
106
116
|
<Button
|
|
117
|
+
accessibilityLabelKey='a11y/Delete voice recording'
|
|
107
118
|
variant='secondary'
|
|
108
119
|
type='outline'
|
|
109
120
|
size='sm'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Linking, StyleSheet } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import { Gesture, GestureDetector, State } from 'react-native-gesture-handler';
|
|
5
5
|
import Animated, {
|
|
@@ -10,6 +10,7 @@ import Animated, {
|
|
|
10
10
|
withSpring,
|
|
11
11
|
} from 'react-native-reanimated';
|
|
12
12
|
|
|
13
|
+
import { useA11yLabel } from '../../../../a11y/hooks/useA11yLabel';
|
|
13
14
|
import { useActiveAudioPlayer } from '../../../../contexts/audioPlayerContext/AudioPlayerContext';
|
|
14
15
|
import {
|
|
15
16
|
MessageInputContextValue,
|
|
@@ -23,6 +24,7 @@ import { Mic } from '../../../../icons/voice';
|
|
|
23
24
|
import { NativeHandlers } from '../../../../native';
|
|
24
25
|
import { AudioRecorderManagerState } from '../../../../state-store/audio-recorder-manager';
|
|
25
26
|
import { primitives } from '../../../../theme';
|
|
27
|
+
import { useNotificationApi } from '../../../Notifications';
|
|
26
28
|
import { ButtonStylesConfig, useButtonStyles } from '../../../ui/Button/hooks/useButtonStyles';
|
|
27
29
|
import { useMicPositionContext } from '../../contexts/MicPositionContext';
|
|
28
30
|
|
|
@@ -83,6 +85,7 @@ export const AudioRecordingButtonWithContext = (props: AudioRecordingButtonProps
|
|
|
83
85
|
const pressed = useSharedValue(false);
|
|
84
86
|
|
|
85
87
|
const { t } = useTranslationContext();
|
|
88
|
+
const startVoiceRecordingAccessibilityLabel = useA11yLabel('a11y/Start voice recording');
|
|
86
89
|
const {
|
|
87
90
|
theme: {
|
|
88
91
|
messageComposer: { micButtonContainer },
|
|
@@ -90,6 +93,7 @@ export const AudioRecordingButtonWithContext = (props: AudioRecordingButtonProps
|
|
|
90
93
|
},
|
|
91
94
|
} = useTheme();
|
|
92
95
|
const buttonStyles = useButtonStyles(buttonStylesConfig);
|
|
96
|
+
const { addNotification } = useNotificationApi();
|
|
93
97
|
|
|
94
98
|
const onPressHandler = useStableCallback(() => {
|
|
95
99
|
if (handlePress) {
|
|
@@ -97,7 +101,14 @@ export const AudioRecordingButtonWithContext = (props: AudioRecordingButtonProps
|
|
|
97
101
|
}
|
|
98
102
|
if (!recording) {
|
|
99
103
|
NativeHandlers.triggerHaptic('notificationError');
|
|
100
|
-
|
|
104
|
+
addNotification({
|
|
105
|
+
message: 'Hold to record. Release to save.',
|
|
106
|
+
options: {
|
|
107
|
+
severity: 'info',
|
|
108
|
+
type: 'validation:audio:recording:hold-required',
|
|
109
|
+
},
|
|
110
|
+
origin: { emitter: 'AudioRecordingButton' },
|
|
111
|
+
});
|
|
101
112
|
}
|
|
102
113
|
});
|
|
103
114
|
|
|
@@ -113,18 +124,23 @@ export const AudioRecordingButtonWithContext = (props: AudioRecordingButtonProps
|
|
|
113
124
|
}
|
|
114
125
|
const permissionsGranted = await startVoiceRecording();
|
|
115
126
|
if (!permissionsGranted) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
127
|
+
addNotification({
|
|
128
|
+
message: 'Please allow Audio permissions in settings.',
|
|
129
|
+
options: {
|
|
130
|
+
actions: [
|
|
131
|
+
{
|
|
132
|
+
handler: () => {
|
|
133
|
+
Linking.openSettings();
|
|
134
|
+
},
|
|
135
|
+
label: t('Open Settings'),
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
duration: 0,
|
|
139
|
+
severity: 'warning',
|
|
140
|
+
type: 'permission:audio:recording:blocked',
|
|
122
141
|
},
|
|
123
|
-
{
|
|
124
|
-
|
|
125
|
-
style: 'cancel',
|
|
126
|
-
},
|
|
127
|
-
]);
|
|
142
|
+
origin: { emitter: 'AudioRecordingButton' },
|
|
143
|
+
});
|
|
128
144
|
return;
|
|
129
145
|
}
|
|
130
146
|
NativeHandlers.triggerHaptic('impactHeavy');
|
|
@@ -238,7 +254,12 @@ export const AudioRecordingButtonWithContext = (props: AudioRecordingButtonProps
|
|
|
238
254
|
|
|
239
255
|
return (
|
|
240
256
|
<GestureDetector gesture={Gesture.Simultaneous(panGesture, tapGesture)}>
|
|
241
|
-
<Animated.View
|
|
257
|
+
<Animated.View
|
|
258
|
+
accessibilityLabel={startVoiceRecordingAccessibilityLabel}
|
|
259
|
+
accessibilityRole='button'
|
|
260
|
+
accessible
|
|
261
|
+
style={[styles.container, animatedStyle, micButtonContainer]}
|
|
262
|
+
>
|
|
242
263
|
<Mic height={20} width={20} strokeWidth={1.5} stroke={buttonStyles.foregroundColor} />
|
|
243
264
|
</Animated.View>
|
|
244
265
|
</GestureDetector>
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
useMessageInputContext,
|
|
11
11
|
} from '../../../../contexts/messageInputContext/MessageInputContext';
|
|
12
12
|
import { useStableCallback } from '../../../../hooks';
|
|
13
|
+
import { useAttachmentPickerState } from '../../../../hooks/useAttachmentPickerState';
|
|
13
14
|
import { Plus } from '../../../../icons/plus';
|
|
14
15
|
import { Button } from '../../../ui/';
|
|
15
16
|
|
|
@@ -18,6 +19,7 @@ type AttachButtonPropsWithContext = Pick<MessageInputContextValue, 'handleAttach
|
|
|
18
19
|
disabled?: boolean;
|
|
19
20
|
/** Function that opens attachment options bottom sheet */
|
|
20
21
|
handleOnPress?: ((event: GestureResponderEvent) => void) & (() => void);
|
|
22
|
+
isAttachmentPickerOpen?: boolean;
|
|
21
23
|
} & { toggleAttachmentPicker: () => void };
|
|
22
24
|
|
|
23
25
|
const AttachButtonWithContext = (props: AttachButtonPropsWithContext) => {
|
|
@@ -25,6 +27,7 @@ const AttachButtonWithContext = (props: AttachButtonPropsWithContext) => {
|
|
|
25
27
|
disabled = false,
|
|
26
28
|
handleAttachButtonPress,
|
|
27
29
|
handleOnPress,
|
|
30
|
+
isAttachmentPickerOpen = false,
|
|
28
31
|
toggleAttachmentPicker,
|
|
29
32
|
} = props;
|
|
30
33
|
|
|
@@ -45,6 +48,9 @@ const AttachButtonWithContext = (props: AttachButtonPropsWithContext) => {
|
|
|
45
48
|
|
|
46
49
|
return (
|
|
47
50
|
<Button
|
|
51
|
+
accessibilityLabelKey={
|
|
52
|
+
isAttachmentPickerOpen ? 'a11y/Close attachments' : 'a11y/Add attachment'
|
|
53
|
+
}
|
|
48
54
|
variant='secondary'
|
|
49
55
|
type='outline'
|
|
50
56
|
size='lg'
|
|
@@ -61,15 +67,17 @@ const areEqual = (
|
|
|
61
67
|
prevProps: AttachButtonPropsWithContext,
|
|
62
68
|
nextProps: AttachButtonPropsWithContext,
|
|
63
69
|
) => {
|
|
64
|
-
const { handleOnPress: prevHandleOnPress } =
|
|
65
|
-
|
|
70
|
+
const { handleOnPress: prevHandleOnPress, isAttachmentPickerOpen: prevIsAttachmentPickerOpen } =
|
|
71
|
+
prevProps;
|
|
72
|
+
const { handleOnPress: nextHandleOnPress, isAttachmentPickerOpen: nextIsAttachmentPickerOpen } =
|
|
73
|
+
nextProps;
|
|
66
74
|
|
|
67
75
|
const handleOnPressEqual = prevHandleOnPress === nextHandleOnPress;
|
|
68
76
|
if (!handleOnPressEqual) {
|
|
69
77
|
return false;
|
|
70
78
|
}
|
|
71
79
|
|
|
72
|
-
return
|
|
80
|
+
return prevIsAttachmentPickerOpen === nextIsAttachmentPickerOpen;
|
|
73
81
|
};
|
|
74
82
|
|
|
75
83
|
const MemoizedAttachButton = React.memo(
|
|
@@ -86,6 +94,7 @@ export const AttachButton = (props: AttachButtonProps) => {
|
|
|
86
94
|
const { disableAttachmentPicker } = useAttachmentPickerContext();
|
|
87
95
|
const { inputBoxRef, handleAttachButtonPress, openAttachmentPicker } = useMessageInputContext();
|
|
88
96
|
const { attachmentPickerStore } = useAttachmentPickerContext();
|
|
97
|
+
const { selectedPicker } = useAttachmentPickerState();
|
|
89
98
|
|
|
90
99
|
const toggleAttachmentPicker = useStableCallback(() => {
|
|
91
100
|
if (attachmentPickerStore.state.getLatestValue().selectedPicker) {
|
|
@@ -100,6 +109,7 @@ export const AttachButton = (props: AttachButtonProps) => {
|
|
|
100
109
|
{...{
|
|
101
110
|
disableAttachmentPicker,
|
|
102
111
|
handleAttachButtonPress,
|
|
112
|
+
isAttachmentPickerOpen: !!selectedPicker,
|
|
103
113
|
toggleAttachmentPicker,
|
|
104
114
|
}}
|
|
105
115
|
{...props}
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
useMessageInputContext,
|
|
23
23
|
} from '../../../../contexts/messageInputContext/MessageInputContext';
|
|
24
24
|
import { useStateStore } from '../../../../hooks/useStateStore';
|
|
25
|
-
import { transitions } from '../../../../utils/transitions';
|
|
25
|
+
import { transitions } from '../../../../utils/animations/transitions';
|
|
26
26
|
import { AIStates, useAIState } from '../../../AITypingIndicatorView';
|
|
27
27
|
import { useIsCooldownActive } from '../../hooks/useIsCooldownActive';
|
|
28
28
|
|
|
@@ -14,6 +14,7 @@ import type { FlashListProps, FlashListRef } from '@shopify/flash-list';
|
|
|
14
14
|
import type { Channel, Event, LocalMessage, MessageResponse } from 'stream-chat';
|
|
15
15
|
|
|
16
16
|
import { useMessageList } from './hooks/useMessageList';
|
|
17
|
+
import { useScrollToBottomAccessibilityAction } from './hooks/useScrollToBottomAccessibilityAction';
|
|
17
18
|
import { useShouldScrollToRecentOnNewOwnMessage } from './hooks/useShouldScrollToRecentOnNewOwnMessage';
|
|
18
19
|
import { useTypingUsers } from './hooks/useTypingUsers';
|
|
19
20
|
import { InlineLoadingMoreIndicator } from './InlineLoadingMoreIndicator';
|
|
@@ -57,7 +58,7 @@ import { useStableCallback, useStateStore } from '../../hooks';
|
|
|
57
58
|
import { bumpOverlayLayoutRevision } from '../../state-store';
|
|
58
59
|
import { MessageInputHeightState } from '../../state-store/message-input-height-store';
|
|
59
60
|
import { primitives } from '../../theme';
|
|
60
|
-
import { transitions } from '../../utils/transitions';
|
|
61
|
+
import { transitions } from '../../utils/animations/transitions';
|
|
61
62
|
import { MessageWrapper } from '../Message/MessageItemView/MessageWrapper';
|
|
62
63
|
|
|
63
64
|
type FlashListContextApi = { getRef?: () => FlashListRef<LocalMessage> | null } | undefined;
|
|
@@ -297,6 +298,7 @@ const MessageFlashListWithContext = (props: MessageFlashListPropsWithContext) =>
|
|
|
297
298
|
EmptyStateIndicator,
|
|
298
299
|
MessageListLoadingIndicator: LoadingIndicator,
|
|
299
300
|
NetworkDownIndicator,
|
|
301
|
+
NotificationList,
|
|
300
302
|
ScrollToBottomButton,
|
|
301
303
|
StickyHeader,
|
|
302
304
|
TypingIndicator,
|
|
@@ -920,6 +922,19 @@ const MessageFlashListWithContext = (props: MessageFlashListPropsWithContext) =>
|
|
|
920
922
|
});
|
|
921
923
|
});
|
|
922
924
|
|
|
925
|
+
const scrollToBottomUnreadCount =
|
|
926
|
+
scrollToBottomButtonVisible && !threadList ? channel?.countUnread() : undefined;
|
|
927
|
+
const {
|
|
928
|
+
accessibilityActions: messageListAccessibilityActions,
|
|
929
|
+
onAccessibilityAction: messageListOnAccessibilityAction,
|
|
930
|
+
} = useScrollToBottomAccessibilityAction({
|
|
931
|
+
accessibilityActions: additionalFlashListProps?.accessibilityActions,
|
|
932
|
+
onAccessibilityAction: additionalFlashListProps?.onAccessibilityAction,
|
|
933
|
+
onScrollToBottom: goToNewMessages,
|
|
934
|
+
unreadCount: scrollToBottomUnreadCount,
|
|
935
|
+
visible: scrollToBottomButtonVisible,
|
|
936
|
+
});
|
|
937
|
+
|
|
923
938
|
const dismissImagePicker = useStableCallback(() => {
|
|
924
939
|
if (attachmentPickerStore.state.getLatestValue().selectedPicker) {
|
|
925
940
|
attachmentPickerStore.setSelectedPicker(undefined);
|
|
@@ -1072,10 +1087,17 @@ const MessageFlashListWithContext = (props: MessageFlashListPropsWithContext) =>
|
|
|
1072
1087
|
testID='message-flash-list'
|
|
1073
1088
|
viewabilityConfig={flatListViewabilityConfig}
|
|
1074
1089
|
{...additionalFlashListPropsExcludingStyle}
|
|
1090
|
+
accessibilityActions={messageListAccessibilityActions}
|
|
1091
|
+
onAccessibilityAction={messageListOnAccessibilityAction}
|
|
1075
1092
|
/>
|
|
1076
1093
|
</MessageListItemProvider>
|
|
1077
1094
|
)}
|
|
1078
|
-
<View
|
|
1095
|
+
<View
|
|
1096
|
+
accessibilityElementsHidden
|
|
1097
|
+
accessible={false}
|
|
1098
|
+
importantForAccessibility='no-hide-descendants'
|
|
1099
|
+
style={styles.stickyHeaderContainer}
|
|
1100
|
+
>
|
|
1079
1101
|
{messageListLengthAfterUpdate && StickyHeader ? (
|
|
1080
1102
|
<StickyHeader date={stickyHeaderDate} />
|
|
1081
1103
|
) : null}
|
|
@@ -1094,7 +1116,7 @@ const MessageFlashListWithContext = (props: MessageFlashListPropsWithContext) =>
|
|
|
1094
1116
|
<ScrollToBottomButton
|
|
1095
1117
|
onPress={goToNewMessages}
|
|
1096
1118
|
showNotification={scrollToBottomButtonVisible}
|
|
1097
|
-
unreadCount={
|
|
1119
|
+
unreadCount={scrollToBottomUnreadCount}
|
|
1098
1120
|
/>
|
|
1099
1121
|
</Animated.View>
|
|
1100
1122
|
<NetworkDownIndicator />
|
|
@@ -1106,6 +1128,7 @@ const MessageFlashListWithContext = (props: MessageFlashListPropsWithContext) =>
|
|
|
1106
1128
|
/>
|
|
1107
1129
|
</View>
|
|
1108
1130
|
) : null}
|
|
1131
|
+
<NotificationList bottomOffset={messageInputFloating ? messageInputHeight + 16 : undefined} />
|
|
1109
1132
|
</View>
|
|
1110
1133
|
);
|
|
1111
1134
|
};
|