stream-chat-react-native-core 5.39.6 → 5.40.0-beta.1
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/components/AttachmentPicker/components/AttachmentPickerSelectionBar.js +27 -0
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerSelectionBar.js.map +1 -1
- package/lib/commonjs/components/Channel/Channel.js +17 -4
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js +7 -1
- package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js +5 -1
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useLatestMessagePreview.js +46 -3
- package/lib/commonjs/components/ChannelPreview/hooks/useLatestMessagePreview.js.map +1 -1
- package/lib/commonjs/components/Chat/Chat.js +2 -0
- package/lib/commonjs/components/Chat/Chat.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/handleEventToSyncDB.js +10 -0
- package/lib/commonjs/components/Chat/hooks/handleEventToSyncDB.js.map +1 -1
- package/lib/commonjs/components/Message/Message.js +13 -0
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +31 -15
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MessageInput.js +44 -1
- package/lib/commonjs/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/NativeAttachmentPicker.js +18 -1
- package/lib/commonjs/components/MessageInput/components/NativeAttachmentPicker.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +10 -0
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js.map +1 -1
- package/lib/commonjs/components/Poll/CreatePollContent.js +386 -0
- package/lib/commonjs/components/Poll/CreatePollContent.js.map +1 -0
- package/lib/commonjs/components/Poll/Poll.js +112 -0
- package/lib/commonjs/components/Poll/Poll.js.map +1 -0
- package/lib/commonjs/components/Poll/components/Button.js +513 -0
- package/lib/commonjs/components/Poll/components/Button.js.map +1 -0
- package/lib/commonjs/components/Poll/components/CreatePollIcon.js +23 -0
- package/lib/commonjs/components/Poll/components/CreatePollIcon.js.map +1 -0
- package/lib/commonjs/components/Poll/components/CreatePollOptions.js +281 -0
- package/lib/commonjs/components/Poll/components/CreatePollOptions.js.map +1 -0
- package/lib/commonjs/components/Poll/components/PollAnswersList.js +154 -0
- package/lib/commonjs/components/Poll/components/PollAnswersList.js.map +1 -0
- package/lib/commonjs/components/Poll/components/PollInputDialog.js +139 -0
- package/lib/commonjs/components/Poll/components/PollInputDialog.js.map +1 -0
- package/lib/commonjs/components/Poll/components/PollModalHeader.js +60 -0
- package/lib/commonjs/components/Poll/components/PollModalHeader.js.map +1 -0
- package/lib/commonjs/components/Poll/components/PollOption.js +209 -0
- package/lib/commonjs/components/Poll/components/PollOption.js.map +1 -0
- package/lib/commonjs/components/Poll/components/PollResults/PollOptionFullResults.js +123 -0
- package/lib/commonjs/components/Poll/components/PollResults/PollOptionFullResults.js.map +1 -0
- package/lib/commonjs/components/Poll/components/PollResults/PollResultItem.js +152 -0
- package/lib/commonjs/components/Poll/components/PollResults/PollResultItem.js.map +1 -0
- package/lib/commonjs/components/Poll/components/PollResults/PollResults.js +101 -0
- package/lib/commonjs/components/Poll/components/PollResults/PollResults.js.map +1 -0
- package/lib/commonjs/components/Poll/components/PollResults/index.js +37 -0
- package/lib/commonjs/components/Poll/components/PollResults/index.js.map +1 -0
- package/lib/commonjs/components/Poll/components/index.js +92 -0
- package/lib/commonjs/components/Poll/components/index.js.map +1 -0
- package/lib/commonjs/components/Poll/hooks/usePollAnswersPagination.js +129 -0
- package/lib/commonjs/components/Poll/hooks/usePollAnswersPagination.js.map +1 -0
- package/lib/commonjs/components/Poll/hooks/usePollOptionVotesPagination.js +140 -0
- package/lib/commonjs/components/Poll/hooks/usePollOptionVotesPagination.js.map +1 -0
- package/lib/commonjs/components/Poll/hooks/usePollState.js +103 -0
- package/lib/commonjs/components/Poll/hooks/usePollState.js.map +1 -0
- package/lib/commonjs/components/Poll/hooks/usePollStateStore.js +13 -0
- package/lib/commonjs/components/Poll/hooks/usePollStateStore.js.map +1 -0
- package/lib/commonjs/components/Poll/index.js +81 -0
- package/lib/commonjs/components/Poll/index.js.map +1 -0
- package/lib/commonjs/components/Reply/Reply.js +1 -1
- package/lib/commonjs/components/Reply/Reply.js.map +1 -1
- package/lib/commonjs/components/index.js +11 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/contexts/attachmentPickerContext/AttachmentPickerContext.js.map +1 -1
- package/lib/commonjs/contexts/index.js +11 -0
- package/lib/commonjs/contexts/index.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +26 -3
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +9 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js.map +1 -1
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayContext.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js +4 -0
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/commonjs/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +3 -0
- package/lib/commonjs/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js.map +1 -1
- package/lib/commonjs/contexts/pollContext/createPollContentContext.js +33 -0
- package/lib/commonjs/contexts/pollContext/createPollContentContext.js.map +1 -0
- package/lib/commonjs/contexts/pollContext/index.js +26 -0
- package/lib/commonjs/contexts/pollContext/index.js.map +1 -0
- package/lib/commonjs/contexts/pollContext/pollContext.js +33 -0
- package/lib/commonjs/contexts/pollContext/pollContext.js.map +1 -0
- package/lib/commonjs/contexts/themeContext/utils/theme.js +126 -0
- package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/commonjs/i18n/en.json +34 -0
- package/lib/commonjs/i18n/es.json +38 -0
- package/lib/commonjs/i18n/fr.json +38 -0
- package/lib/commonjs/i18n/he.json +38 -0
- package/lib/commonjs/i18n/hi.json +34 -0
- package/lib/commonjs/i18n/it.json +38 -0
- package/lib/commonjs/i18n/ja.json +34 -0
- package/lib/commonjs/i18n/ko.json +34 -0
- package/lib/commonjs/i18n/nl.json +34 -0
- package/lib/commonjs/i18n/pt-br.json +38 -0
- package/lib/commonjs/i18n/ru.json +42 -0
- package/lib/commonjs/i18n/tr.json +34 -0
- package/lib/commonjs/icons/Back.js +19 -0
- package/lib/commonjs/icons/Back.js.map +1 -0
- package/lib/commonjs/icons/DragHandle.js +21 -0
- package/lib/commonjs/icons/DragHandle.js.map +1 -0
- package/lib/commonjs/icons/PollThumbnail.js +19 -0
- package/lib/commonjs/icons/PollThumbnail.js.map +1 -0
- package/lib/commonjs/icons/SendPoll.js +19 -0
- package/lib/commonjs/icons/SendPoll.js.map +1 -0
- package/lib/commonjs/icons/index.js +44 -0
- package/lib/commonjs/icons/index.js.map +1 -1
- package/lib/commonjs/store/QuickSqliteClient.js +1 -1
- package/lib/commonjs/store/apis/index.js +11 -0
- package/lib/commonjs/store/apis/index.js.map +1 -1
- package/lib/commonjs/store/apis/updatePollMessage.js +50 -0
- package/lib/commonjs/store/apis/updatePollMessage.js.map +1 -0
- package/lib/commonjs/store/mappers/mapMessageToStorable.js +5 -1
- package/lib/commonjs/store/mappers/mapMessageToStorable.js.map +1 -1
- package/lib/commonjs/store/mappers/mapStorableToMessage.js +5 -1
- package/lib/commonjs/store/mappers/mapStorableToMessage.js.map +1 -1
- package/lib/commonjs/store/schema.js +2 -0
- package/lib/commonjs/store/schema.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerSelectionBar.js +27 -0
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerSelectionBar.js.map +1 -1
- package/lib/module/components/Channel/Channel.js +17 -4
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js +7 -1
- package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js +5 -1
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/module/components/ChannelPreview/hooks/useLatestMessagePreview.js +46 -3
- package/lib/module/components/ChannelPreview/hooks/useLatestMessagePreview.js.map +1 -1
- package/lib/module/components/Chat/Chat.js +2 -0
- package/lib/module/components/Chat/Chat.js.map +1 -1
- package/lib/module/components/Chat/hooks/handleEventToSyncDB.js +10 -0
- package/lib/module/components/Chat/hooks/handleEventToSyncDB.js.map +1 -1
- package/lib/module/components/Message/Message.js +13 -0
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageContent.js +31 -15
- package/lib/module/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/module/components/MessageInput/MessageInput.js +44 -1
- package/lib/module/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/module/components/MessageInput/components/NativeAttachmentPicker.js +18 -1
- package/lib/module/components/MessageInput/components/NativeAttachmentPicker.js.map +1 -1
- package/lib/module/components/MessageOverlay/MessageOverlay.js +10 -0
- package/lib/module/components/MessageOverlay/MessageOverlay.js.map +1 -1
- package/lib/module/components/Poll/CreatePollContent.js +386 -0
- package/lib/module/components/Poll/CreatePollContent.js.map +1 -0
- package/lib/module/components/Poll/Poll.js +112 -0
- package/lib/module/components/Poll/Poll.js.map +1 -0
- package/lib/module/components/Poll/components/Button.js +513 -0
- package/lib/module/components/Poll/components/Button.js.map +1 -0
- package/lib/module/components/Poll/components/CreatePollIcon.js +23 -0
- package/lib/module/components/Poll/components/CreatePollIcon.js.map +1 -0
- package/lib/module/components/Poll/components/CreatePollOptions.js +281 -0
- package/lib/module/components/Poll/components/CreatePollOptions.js.map +1 -0
- package/lib/module/components/Poll/components/PollAnswersList.js +154 -0
- package/lib/module/components/Poll/components/PollAnswersList.js.map +1 -0
- package/lib/module/components/Poll/components/PollInputDialog.js +139 -0
- package/lib/module/components/Poll/components/PollInputDialog.js.map +1 -0
- package/lib/module/components/Poll/components/PollModalHeader.js +60 -0
- package/lib/module/components/Poll/components/PollModalHeader.js.map +1 -0
- package/lib/module/components/Poll/components/PollOption.js +209 -0
- package/lib/module/components/Poll/components/PollOption.js.map +1 -0
- package/lib/module/components/Poll/components/PollResults/PollOptionFullResults.js +123 -0
- package/lib/module/components/Poll/components/PollResults/PollOptionFullResults.js.map +1 -0
- package/lib/module/components/Poll/components/PollResults/PollResultItem.js +152 -0
- package/lib/module/components/Poll/components/PollResults/PollResultItem.js.map +1 -0
- package/lib/module/components/Poll/components/PollResults/PollResults.js +101 -0
- package/lib/module/components/Poll/components/PollResults/PollResults.js.map +1 -0
- package/lib/module/components/Poll/components/PollResults/index.js +37 -0
- package/lib/module/components/Poll/components/PollResults/index.js.map +1 -0
- package/lib/module/components/Poll/components/index.js +92 -0
- package/lib/module/components/Poll/components/index.js.map +1 -0
- package/lib/module/components/Poll/hooks/usePollAnswersPagination.js +129 -0
- package/lib/module/components/Poll/hooks/usePollAnswersPagination.js.map +1 -0
- package/lib/module/components/Poll/hooks/usePollOptionVotesPagination.js +140 -0
- package/lib/module/components/Poll/hooks/usePollOptionVotesPagination.js.map +1 -0
- package/lib/module/components/Poll/hooks/usePollState.js +103 -0
- package/lib/module/components/Poll/hooks/usePollState.js.map +1 -0
- package/lib/module/components/Poll/hooks/usePollStateStore.js +13 -0
- package/lib/module/components/Poll/hooks/usePollStateStore.js.map +1 -0
- package/lib/module/components/Poll/index.js +81 -0
- package/lib/module/components/Poll/index.js.map +1 -0
- package/lib/module/components/Reply/Reply.js +1 -1
- package/lib/module/components/Reply/Reply.js.map +1 -1
- package/lib/module/components/index.js +11 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/contexts/attachmentPickerContext/AttachmentPickerContext.js.map +1 -1
- package/lib/module/contexts/index.js +11 -0
- package/lib/module/contexts/index.js.map +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js +26 -3
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +9 -1
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js.map +1 -1
- package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/module/contexts/overlayContext/OverlayContext.js.map +1 -1
- package/lib/module/contexts/overlayContext/OverlayProvider.js +4 -0
- package/lib/module/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/module/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +3 -0
- package/lib/module/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js.map +1 -1
- package/lib/module/contexts/pollContext/createPollContentContext.js +33 -0
- package/lib/module/contexts/pollContext/createPollContentContext.js.map +1 -0
- package/lib/module/contexts/pollContext/index.js +26 -0
- package/lib/module/contexts/pollContext/index.js.map +1 -0
- package/lib/module/contexts/pollContext/pollContext.js +33 -0
- package/lib/module/contexts/pollContext/pollContext.js.map +1 -0
- package/lib/module/contexts/themeContext/utils/theme.js +126 -0
- package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/module/i18n/en.json +34 -0
- package/lib/module/i18n/es.json +38 -0
- package/lib/module/i18n/fr.json +38 -0
- package/lib/module/i18n/he.json +38 -0
- package/lib/module/i18n/hi.json +34 -0
- package/lib/module/i18n/it.json +38 -0
- package/lib/module/i18n/ja.json +34 -0
- package/lib/module/i18n/ko.json +34 -0
- package/lib/module/i18n/nl.json +34 -0
- package/lib/module/i18n/pt-br.json +38 -0
- package/lib/module/i18n/ru.json +42 -0
- package/lib/module/i18n/tr.json +34 -0
- package/lib/module/icons/Back.js +19 -0
- package/lib/module/icons/Back.js.map +1 -0
- package/lib/module/icons/DragHandle.js +21 -0
- package/lib/module/icons/DragHandle.js.map +1 -0
- package/lib/module/icons/PollThumbnail.js +19 -0
- package/lib/module/icons/PollThumbnail.js.map +1 -0
- package/lib/module/icons/SendPoll.js +19 -0
- package/lib/module/icons/SendPoll.js.map +1 -0
- package/lib/module/icons/index.js +44 -0
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/store/QuickSqliteClient.js +1 -1
- package/lib/module/store/apis/index.js +11 -0
- package/lib/module/store/apis/index.js.map +1 -1
- package/lib/module/store/apis/updatePollMessage.js +50 -0
- package/lib/module/store/apis/updatePollMessage.js.map +1 -0
- package/lib/module/store/mappers/mapMessageToStorable.js +5 -1
- package/lib/module/store/mappers/mapMessageToStorable.js.map +1 -1
- package/lib/module/store/mappers/mapStorableToMessage.js +5 -1
- package/lib/module/store/mappers/mapStorableToMessage.js.map +1 -1
- package/lib/module/store/schema.js +2 -0
- package/lib/module/store/schema.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentPickerSelectionBar.d.ts.map +1 -1
- package/lib/typescript/components/Channel/Channel.d.ts +2 -2
- package/lib/typescript/components/Channel/Channel.d.ts.map +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts.map +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts.map +1 -1
- package/lib/typescript/components/ChannelPreview/hooks/useLatestMessagePreview.d.ts +5 -1
- package/lib/typescript/components/ChannelPreview/hooks/useLatestMessagePreview.d.ts.map +1 -1
- package/lib/typescript/components/Chat/Chat.d.ts.map +1 -1
- package/lib/typescript/components/Chat/hooks/handleEventToSyncDB.d.ts.map +1 -1
- package/lib/typescript/components/Message/Message.d.ts +1 -1
- package/lib/typescript/components/Message/Message.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageSimple/MessageContent.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/MessageInput.d.ts +1 -1
- package/lib/typescript/components/MessageInput/MessageInput.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/components/NativeAttachmentPicker.d.ts.map +1 -1
- package/lib/typescript/components/MessageOverlay/MessageOverlay.d.ts.map +1 -1
- package/lib/typescript/components/Poll/CreatePollContent.d.ts +6 -0
- package/lib/typescript/components/Poll/CreatePollContent.d.ts.map +1 -0
- package/lib/typescript/components/Poll/Poll.d.ts +13 -0
- package/lib/typescript/components/Poll/Poll.d.ts.map +1 -0
- package/lib/typescript/components/Poll/components/Button.d.ts +35 -0
- package/lib/typescript/components/Poll/components/Button.d.ts.map +1 -0
- package/lib/typescript/components/Poll/components/CreatePollIcon.d.ts +3 -0
- package/lib/typescript/components/Poll/components/CreatePollIcon.d.ts.map +1 -0
- package/lib/typescript/components/Poll/components/CreatePollOptions.d.ts +34 -0
- package/lib/typescript/components/Poll/components/CreatePollOptions.d.ts.map +1 -0
- package/lib/typescript/components/Poll/components/PollAnswersList.d.ts +15 -0
- package/lib/typescript/components/Poll/components/PollAnswersList.d.ts.map +1 -0
- package/lib/typescript/components/Poll/components/PollInputDialog.d.ts +10 -0
- package/lib/typescript/components/Poll/components/PollInputDialog.d.ts.map +1 -0
- package/lib/typescript/components/Poll/components/PollModalHeader.d.ts +7 -0
- package/lib/typescript/components/Poll/components/PollModalHeader.d.ts.map +1 -0
- package/lib/typescript/components/Poll/components/PollOption.d.ts +16 -0
- package/lib/typescript/components/Poll/components/PollOption.d.ts.map +1 -0
- package/lib/typescript/components/Poll/components/PollResults/PollOptionFullResults.d.ts +18 -0
- package/lib/typescript/components/Poll/components/PollResults/PollOptionFullResults.d.ts.map +1 -0
- package/lib/typescript/components/Poll/components/PollResults/PollResultItem.d.ts +9 -0
- package/lib/typescript/components/Poll/components/PollResults/PollResultItem.d.ts.map +1 -0
- package/lib/typescript/components/Poll/components/PollResults/PollResults.d.ts +10 -0
- package/lib/typescript/components/Poll/components/PollResults/PollResults.d.ts.map +1 -0
- package/lib/typescript/components/Poll/components/PollResults/index.d.ts +4 -0
- package/lib/typescript/components/Poll/components/PollResults/index.d.ts.map +1 -0
- package/lib/typescript/components/Poll/components/index.d.ts +9 -0
- package/lib/typescript/components/Poll/components/index.d.ts.map +1 -0
- package/lib/typescript/components/Poll/hooks/usePollAnswersPagination.d.ts +29 -0
- package/lib/typescript/components/Poll/hooks/usePollAnswersPagination.d.ts.map +1 -0
- package/lib/typescript/components/Poll/hooks/usePollOptionVotesPagination.d.ts +32 -0
- package/lib/typescript/components/Poll/hooks/usePollOptionVotesPagination.d.ts.map +1 -0
- package/lib/typescript/components/Poll/hooks/usePollState.d.ts +26 -0
- package/lib/typescript/components/Poll/hooks/usePollState.d.ts.map +1 -0
- package/lib/typescript/components/Poll/hooks/usePollStateStore.d.ts +3 -0
- package/lib/typescript/components/Poll/hooks/usePollStateStore.d.ts.map +1 -0
- package/lib/typescript/components/Poll/index.d.ts +8 -0
- package/lib/typescript/components/Poll/index.d.ts.map +1 -0
- package/lib/typescript/components/Reply/Reply.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/contexts/attachmentPickerContext/AttachmentPickerContext.d.ts +7 -1
- package/lib/typescript/contexts/attachmentPickerContext/AttachmentPickerContext.d.ts.map +1 -1
- package/lib/typescript/contexts/index.d.ts +1 -0
- package/lib/typescript/contexts/index.d.ts.map +1 -1
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +11 -2
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts.map +1 -1
- package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts +1 -1
- package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts.map +1 -1
- package/lib/typescript/contexts/messageOverlayContext/MessageOverlayContext.d.ts +2 -1
- package/lib/typescript/contexts/messageOverlayContext/MessageOverlayContext.d.ts.map +1 -1
- package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +9 -1
- package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts.map +1 -1
- package/lib/typescript/contexts/overlayContext/OverlayContext.d.ts +1 -1
- package/lib/typescript/contexts/overlayContext/OverlayContext.d.ts.map +1 -1
- package/lib/typescript/contexts/overlayContext/OverlayProvider.d.ts.map +1 -1
- package/lib/typescript/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.d.ts +3 -0
- package/lib/typescript/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.d.ts.map +1 -1
- package/lib/typescript/contexts/pollContext/createPollContentContext.d.ts +20 -0
- package/lib/typescript/contexts/pollContext/createPollContentContext.d.ts.map +1 -0
- package/lib/typescript/contexts/pollContext/index.d.ts +3 -0
- package/lib/typescript/contexts/pollContext/index.d.ts.map +1 -0
- package/lib/typescript/contexts/pollContext/pollContext.d.ts +14 -0
- package/lib/typescript/contexts/pollContext/pollContext.d.ts.map +1 -0
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts +126 -0
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts.map +1 -1
- package/lib/typescript/i18n/en.json +34 -0
- package/lib/typescript/i18n/es.json +38 -0
- package/lib/typescript/i18n/fr.json +38 -0
- package/lib/typescript/i18n/he.json +38 -0
- package/lib/typescript/i18n/hi.json +34 -0
- package/lib/typescript/i18n/it.json +38 -0
- package/lib/typescript/i18n/ja.json +34 -0
- package/lib/typescript/i18n/ko.json +34 -0
- package/lib/typescript/i18n/nl.json +34 -0
- package/lib/typescript/i18n/pt-br.json +38 -0
- package/lib/typescript/i18n/ru.json +42 -0
- package/lib/typescript/i18n/tr.json +34 -0
- package/lib/typescript/icons/Back.d.ts +4 -0
- package/lib/typescript/icons/Back.d.ts.map +1 -0
- package/lib/typescript/icons/DragHandle.d.ts +4 -0
- package/lib/typescript/icons/DragHandle.d.ts.map +1 -0
- package/lib/typescript/icons/PollThumbnail.d.ts +4 -0
- package/lib/typescript/icons/PollThumbnail.d.ts.map +1 -0
- package/lib/typescript/icons/SendPoll.d.ts +4 -0
- package/lib/typescript/icons/SendPoll.d.ts.map +1 -0
- package/lib/typescript/icons/index.d.ts +4 -0
- package/lib/typescript/icons/index.d.ts.map +1 -1
- package/lib/typescript/store/apis/index.d.ts +1 -0
- package/lib/typescript/store/apis/index.d.ts.map +1 -1
- package/lib/typescript/store/apis/updatePollMessage.d.ts +7 -0
- package/lib/typescript/store/apis/updatePollMessage.d.ts.map +1 -0
- package/lib/typescript/store/mappers/mapMessageToStorable.d.ts.map +1 -1
- package/lib/typescript/store/mappers/mapStorableToMessage.d.ts.map +1 -1
- package/lib/typescript/store/schema.d.ts +2 -0
- package/lib/typescript/store/schema.d.ts.map +1 -1
- package/lib/typescript/utils/i18n/Streami18n.d.ts +34 -0
- package/lib/typescript/utils/i18n/Streami18n.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/AttachmentPicker/components/AttachmentPickerSelectionBar.tsx +35 -2
- package/src/components/Channel/Channel.tsx +27 -4
- package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +16 -1
- package/src/components/Channel/hooks/useCreateMessagesContext.ts +5 -0
- package/src/components/ChannelPreview/hooks/useLatestMessagePreview.ts +63 -4
- package/src/components/Chat/Chat.tsx +2 -0
- package/src/components/Chat/hooks/handleEventToSyncDB.ts +19 -0
- package/src/components/Message/Message.tsx +15 -1
- package/src/components/Message/MessageSimple/MessageContent.tsx +16 -0
- package/src/components/MessageInput/MessageInput.tsx +58 -1
- package/src/components/MessageInput/__tests__/MessageInput.test.js +2 -0
- package/src/components/MessageInput/components/NativeAttachmentPicker.tsx +29 -2
- package/src/components/MessageOverlay/MessageOverlay.tsx +10 -0
- package/src/components/Poll/CreatePollContent.tsx +299 -0
- package/src/components/Poll/Poll.tsx +126 -0
- package/src/components/Poll/components/Button.tsx +465 -0
- package/src/components/Poll/components/CreatePollIcon.tsx +14 -0
- package/src/components/Poll/components/CreatePollOptions.tsx +351 -0
- package/src/components/Poll/components/PollAnswersList.tsx +134 -0
- package/src/components/Poll/components/PollInputDialog.tsx +117 -0
- package/src/components/Poll/components/PollModalHeader.tsx +42 -0
- package/src/components/Poll/components/PollOption.tsx +172 -0
- package/src/components/Poll/components/PollResults/PollOptionFullResults.tsx +108 -0
- package/src/components/Poll/components/PollResults/PollResultItem.tsx +115 -0
- package/src/components/Poll/components/PollResults/PollResults.tsx +79 -0
- package/src/components/Poll/components/PollResults/index.ts +3 -0
- package/src/components/Poll/components/index.ts +8 -0
- package/src/components/Poll/hooks/usePollAnswersPagination.ts +109 -0
- package/src/components/Poll/hooks/usePollOptionVotesPagination.ts +119 -0
- package/src/components/Poll/hooks/usePollState.ts +122 -0
- package/src/components/Poll/hooks/usePollStateStore.ts +13 -0
- package/src/components/Poll/index.ts +10 -0
- package/src/components/Reply/Reply.tsx +2 -0
- package/src/components/index.ts +1 -0
- package/src/contexts/attachmentPickerContext/AttachmentPickerContext.tsx +12 -1
- package/src/contexts/index.ts +1 -0
- package/src/contexts/messageInputContext/MessageInputContext.tsx +38 -10
- package/src/contexts/messageInputContext/__tests__/pickFile.test.tsx +4 -2
- package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +9 -0
- package/src/contexts/messageOverlayContext/MessageOverlayContext.tsx +2 -1
- package/src/contexts/messagesContext/MessagesContext.tsx +15 -2
- package/src/contexts/overlayContext/OverlayContext.tsx +1 -0
- package/src/contexts/overlayContext/OverlayProvider.tsx +3 -0
- package/src/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.tsx +3 -0
- package/src/contexts/pollContext/createPollContentContext.tsx +49 -0
- package/src/contexts/pollContext/index.ts +2 -0
- package/src/contexts/pollContext/pollContext.tsx +43 -0
- package/src/contexts/themeContext/utils/theme.ts +233 -0
- package/src/i18n/en.json +34 -0
- package/src/i18n/es.json +38 -0
- package/src/i18n/fr.json +38 -0
- package/src/i18n/he.json +38 -0
- package/src/i18n/hi.json +34 -0
- package/src/i18n/it.json +38 -0
- package/src/i18n/ja.json +34 -0
- package/src/i18n/ko.json +34 -0
- package/src/i18n/nl.json +34 -0
- package/src/i18n/pt-br.json +38 -0
- package/src/i18n/ru.json +42 -0
- package/src/i18n/tr.json +34 -0
- package/src/icons/Back.tsx +12 -0
- package/src/icons/DragHandle.tsx +9 -0
- package/src/icons/PollThumbnail.tsx +12 -0
- package/src/icons/SendPoll.tsx +12 -0
- package/src/icons/index.ts +4 -0
- package/src/store/QuickSqliteClient.ts +1 -1
- package/src/store/apis/index.ts +1 -0
- package/src/store/apis/updatePollMessage.ts +48 -0
- package/src/store/mappers/mapMessageToStorable.ts +4 -0
- package/src/store/mappers/mapStorableToMessage.ts +4 -0
- package/src/store/schema.ts +4 -0
- package/src/version.json +1 -1
|
@@ -126,17 +126,23 @@ export declare class Streami18n {
|
|
|
126
126
|
[key: string]: DefaultStreamChatGenerics | Partial<{
|
|
127
127
|
"1 Reply": string;
|
|
128
128
|
"1 Thread Reply": string;
|
|
129
|
+
"Add a comment": string;
|
|
130
|
+
"Add an option": string;
|
|
129
131
|
"Allow access to your Gallery": string;
|
|
130
132
|
"Allow camera access in device settings": string;
|
|
131
133
|
"Also send to channel": string;
|
|
134
|
+
Anonymous: string;
|
|
135
|
+
"Anonymous poll": string;
|
|
132
136
|
"Are you sure you want to permanently delete this message?": string;
|
|
133
137
|
"Are you sure?": string;
|
|
138
|
+
"Ask a question": string;
|
|
134
139
|
"Ban User": string;
|
|
135
140
|
"Block User": string;
|
|
136
141
|
Cancel: string;
|
|
137
142
|
"Cannot Flag Message": string;
|
|
138
143
|
"Consider how your comment might make others feel and be sure to follow our Community Guidelines": string;
|
|
139
144
|
"Copy Message": string;
|
|
145
|
+
"Create Poll": string;
|
|
140
146
|
Delete: string;
|
|
141
147
|
"Delete Message": string;
|
|
142
148
|
"Device camera is used to take photos or videos.": string;
|
|
@@ -147,6 +153,7 @@ export declare class Streami18n {
|
|
|
147
153
|
"Editing Message": string;
|
|
148
154
|
"Emoji matching": string;
|
|
149
155
|
"Empty message...": string;
|
|
156
|
+
"End Vote": string;
|
|
150
157
|
"Error loading": string;
|
|
151
158
|
"Error loading channel list...": string;
|
|
152
159
|
"Error loading messages for this channel...": string;
|
|
@@ -166,9 +173,11 @@ export declare class Streami18n {
|
|
|
166
173
|
"Loading threads...": string;
|
|
167
174
|
"Loading...": string;
|
|
168
175
|
"Maximum number of files reached": string;
|
|
176
|
+
"Maximum votes per person": string;
|
|
169
177
|
"Message Reactions": string;
|
|
170
178
|
"Message deleted": string;
|
|
171
179
|
"Message flagged": string;
|
|
180
|
+
"Multiple answers": string;
|
|
172
181
|
"Mute User": string;
|
|
173
182
|
"No chats here yet\u2026": string;
|
|
174
183
|
"No threads here yet": string;
|
|
@@ -177,6 +186,8 @@ export declare class Streami18n {
|
|
|
177
186
|
Ok: string;
|
|
178
187
|
"Only visible to you": string;
|
|
179
188
|
"Open Settings": string;
|
|
189
|
+
Option: string;
|
|
190
|
+
Options: string;
|
|
180
191
|
Photo: string;
|
|
181
192
|
"Photos and Videos": string;
|
|
182
193
|
"Pin to Conversation": string;
|
|
@@ -184,28 +195,48 @@ export declare class Streami18n {
|
|
|
184
195
|
"Please allow Audio permissions in settings.": string;
|
|
185
196
|
"Please enable access to your photos and videos so you can share them.": string;
|
|
186
197
|
"Please select a channel first": string;
|
|
198
|
+
"Poll Comments": string;
|
|
199
|
+
"Poll Options": string;
|
|
200
|
+
"Poll Results": string;
|
|
201
|
+
Questions: string;
|
|
187
202
|
"Reconnecting...": string;
|
|
188
203
|
Reply: string;
|
|
189
204
|
"Reply to Message": string;
|
|
190
205
|
Resend: string;
|
|
206
|
+
SEND: string;
|
|
191
207
|
"Search GIFs": string;
|
|
208
|
+
"See all {{count}} options_one": string;
|
|
209
|
+
"See all {{count}} options_other": string;
|
|
192
210
|
"Select More Photos": string;
|
|
211
|
+
"Select one": string;
|
|
212
|
+
"Select one or more": string;
|
|
213
|
+
"Select up to {{count}}_one": string;
|
|
214
|
+
"Select up to {{count}}_other": string;
|
|
193
215
|
"Send Anyway": string;
|
|
194
216
|
"Send a message": string;
|
|
195
217
|
"Sending links is not allowed in this conversation": string;
|
|
218
|
+
"Show All": string;
|
|
196
219
|
"Slow mode ON": string;
|
|
220
|
+
"Suggest an option": string;
|
|
197
221
|
"The message has been reported to a moderator.": string;
|
|
198
222
|
"The source message was deleted": string;
|
|
223
|
+
"This is already an option": string;
|
|
199
224
|
"This reply was deleted": string;
|
|
200
225
|
"Thread Reply": string;
|
|
226
|
+
"Type a number from 2 to 10": string;
|
|
201
227
|
"Unban User": string;
|
|
202
228
|
"Unblock User": string;
|
|
203
229
|
"Unknown User": string;
|
|
204
230
|
"Unmute User": string;
|
|
205
231
|
"Unpin from Conversation": string;
|
|
206
232
|
"Unread Messages": string;
|
|
233
|
+
"Update your comment": string;
|
|
207
234
|
Video: string;
|
|
235
|
+
"View Results": string;
|
|
236
|
+
"View {{count}} comments_one": string;
|
|
237
|
+
"View {{count}} comments_other": string;
|
|
208
238
|
"Voice message": string;
|
|
239
|
+
"Vote ended": string;
|
|
209
240
|
You: string;
|
|
210
241
|
"You can't send messages in this channel": string;
|
|
211
242
|
"replied to": string;
|
|
@@ -215,6 +246,7 @@ export declare class Streami18n {
|
|
|
215
246
|
"timestamp/MessageEditedTimestamp": string;
|
|
216
247
|
"timestamp/MessageSystem": string;
|
|
217
248
|
"timestamp/MessageTimestamp": string;
|
|
249
|
+
"timestamp/PollVote": string;
|
|
218
250
|
"timestamp/StickyHeader": string;
|
|
219
251
|
"timestamp/ThreadListItem": string;
|
|
220
252
|
"{{ firstUser }} and {{ nonSelfUserLength }} more are typing": string;
|
|
@@ -222,6 +254,8 @@ export declare class Streami18n {
|
|
|
222
254
|
"{{ replyCount }} Replies": string;
|
|
223
255
|
"{{ replyCount }} Thread Replies": string;
|
|
224
256
|
"{{ user }} is typing": string;
|
|
257
|
+
"{{count}} votes_one": string;
|
|
258
|
+
"{{count}} votes_other": string;
|
|
225
259
|
"\uD83C\uDFD9 Attachment...": string;
|
|
226
260
|
}>;
|
|
227
261
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Streami18n.d.ts","sourceRoot":"","sources":["../../../../src/utils/i18n/Streami18n.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAa,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEvD,OAAO,KAAK,cAAc,MAAM,iBAAiB,CAAC;AAGlD,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EAErB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sDAAsD,CAAC;AAC5F,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAahD,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AAEzB;;;;GAIG;AACH,OAAO,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAoGnE,KAAK,oBAAoB,GAAG,OAAO,KAAK,GAAG,OAAO,cAAc,CAAC;AAajE,KAAK,iBAAiB,GAAG;IACvB,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC,4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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAA2B;IAE1C;;OAEG;IACG,cAAc;;;;IAmBpB;;OAEG;IACH,mBAAmB,CACjB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,OAAO,CAAC,OAAO,cAAc,CAAC,GAAG,yBAAyB,EACvE,iBAAiB,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC;IA+BtC,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC;IASvD;;;OAGG;IACG,WAAW,CAAC,QAAQ,EAAE,MAAM;IAoBlC,2BAA2B,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,SAAS,KAAK,IAAI;;;IAW5D,8BAA8B,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,SAAS,KAAK,IAAI;;;IAW/D,iBAAiB,CAAC,SAAS,EAAE,SAAS;CAQvC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stream-chat-react-native-core",
|
|
3
3
|
"description": "The official React Native and Expo components for Stream Chat, a service for building chat applications",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.40.0-beta.1",
|
|
5
5
|
"author": {
|
|
6
6
|
"company": "Stream.io Inc",
|
|
7
7
|
"name": "Stream.io Inc"
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"path": "0.12.7",
|
|
79
79
|
"react-native-markdown-package": "1.8.2",
|
|
80
80
|
"react-native-url-polyfill": "^1.3.0",
|
|
81
|
-
"stream-chat": "8.
|
|
81
|
+
"stream-chat": "8.42.0"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
84
|
"react-native-quick-sqlite": ">=5.1.0",
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import {
|
|
5
|
+
useChannelContext,
|
|
6
|
+
useMessagesContext,
|
|
7
|
+
useOwnCapabilitiesContext,
|
|
8
|
+
} from '../../../contexts';
|
|
4
9
|
import { useAttachmentPickerContext } from '../../../contexts/attachmentPickerContext/AttachmentPickerContext';
|
|
5
10
|
import { useMessageInputContext } from '../../../contexts/messageInputContext/MessageInputContext';
|
|
6
11
|
import { useTheme } from '../../../contexts/themeContext/ThemeContext';
|
|
@@ -21,14 +26,25 @@ export const AttachmentPickerSelectionBar = () => {
|
|
|
21
26
|
attachmentSelectionBarHeight,
|
|
22
27
|
CameraSelectorIcon,
|
|
23
28
|
closePicker,
|
|
29
|
+
CreatePollIcon,
|
|
24
30
|
FileSelectorIcon,
|
|
25
31
|
ImageSelectorIcon,
|
|
26
32
|
selectedPicker,
|
|
27
33
|
setSelectedPicker,
|
|
28
34
|
} = useAttachmentPickerContext();
|
|
29
35
|
|
|
30
|
-
const {
|
|
31
|
-
|
|
36
|
+
const {
|
|
37
|
+
hasCameraPicker,
|
|
38
|
+
hasFilePicker,
|
|
39
|
+
imageUploads,
|
|
40
|
+
openPollCreationDialog,
|
|
41
|
+
pickFile,
|
|
42
|
+
sendMessage,
|
|
43
|
+
takeAndUploadImage,
|
|
44
|
+
} = useMessageInputContext();
|
|
45
|
+
const { threadList } = useChannelContext();
|
|
46
|
+
const { hasCreatePoll } = useMessagesContext();
|
|
47
|
+
const ownCapabilities = useOwnCapabilitiesContext();
|
|
32
48
|
|
|
33
49
|
const {
|
|
34
50
|
theme: {
|
|
@@ -51,6 +67,12 @@ export const AttachmentPickerSelectionBar = () => {
|
|
|
51
67
|
pickFile();
|
|
52
68
|
};
|
|
53
69
|
|
|
70
|
+
const openPollCreationModal = () => {
|
|
71
|
+
setSelectedPicker(undefined);
|
|
72
|
+
closePicker();
|
|
73
|
+
openPollCreationDialog?.({ sendMessage });
|
|
74
|
+
};
|
|
75
|
+
|
|
54
76
|
return (
|
|
55
77
|
<View style={[styles.container, container, { height: attachmentSelectionBarHeight }]}>
|
|
56
78
|
<TouchableOpacity
|
|
@@ -93,6 +115,17 @@ export const AttachmentPickerSelectionBar = () => {
|
|
|
93
115
|
</View>
|
|
94
116
|
</TouchableOpacity>
|
|
95
117
|
) : null}
|
|
118
|
+
{!threadList && hasCreatePoll && ownCapabilities.sendPoll ? ( // do not allow poll creation in threads
|
|
119
|
+
<TouchableOpacity
|
|
120
|
+
hitSlop={{ bottom: 15, top: 15 }}
|
|
121
|
+
onPress={openPollCreationModal}
|
|
122
|
+
testID='create-poll-touchable'
|
|
123
|
+
>
|
|
124
|
+
<View style={[styles.icon, icon]}>
|
|
125
|
+
<CreatePollIcon />
|
|
126
|
+
</View>
|
|
127
|
+
</TouchableOpacity>
|
|
128
|
+
) : null}
|
|
96
129
|
</View>
|
|
97
130
|
);
|
|
98
131
|
};
|
|
@@ -208,6 +208,7 @@ const throttleOptions = {
|
|
|
208
208
|
leading: true,
|
|
209
209
|
trailing: true,
|
|
210
210
|
};
|
|
211
|
+
|
|
211
212
|
const debounceOptions = {
|
|
212
213
|
leading: true,
|
|
213
214
|
trailing: true,
|
|
@@ -330,6 +331,8 @@ export type ChannelPropsWithContext<
|
|
|
330
331
|
| 'TypingIndicatorContainer'
|
|
331
332
|
| 'UrlPreview'
|
|
332
333
|
| 'VideoThumbnail'
|
|
334
|
+
| 'PollContent'
|
|
335
|
+
| 'hasCreatePoll'
|
|
333
336
|
>
|
|
334
337
|
> &
|
|
335
338
|
Partial<Pick<ThreadContextValue<StreamChatGenerics>, 'allowThreadMessagesInChannel'>> & {
|
|
@@ -417,7 +420,7 @@ export type ChannelPropsWithContext<
|
|
|
417
420
|
* Tells if channel is rendering a thread list
|
|
418
421
|
*/
|
|
419
422
|
threadList?: boolean;
|
|
420
|
-
}
|
|
423
|
+
} & Partial<Pick<InputMessageInputContextValue, 'openPollCreationDialog' | 'CreatePollContent'>>;
|
|
421
424
|
|
|
422
425
|
const ChannelWithContext = <
|
|
423
426
|
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
@@ -459,6 +462,7 @@ const ChannelWithContext = <
|
|
|
459
462
|
CommandsButton = CommandsButtonDefault,
|
|
460
463
|
compressImageQuality,
|
|
461
464
|
CooldownTimer = CooldownTimerDefault,
|
|
465
|
+
CreatePollContent,
|
|
462
466
|
DateHeader = DateHeaderDefault,
|
|
463
467
|
deletedMessagesVisibilityType = 'always',
|
|
464
468
|
disableIfFrozenChannel = true,
|
|
@@ -499,9 +503,10 @@ const ChannelWithContext = <
|
|
|
499
503
|
handleReaction,
|
|
500
504
|
handleRetry,
|
|
501
505
|
handleThreadReply,
|
|
506
|
+
// If pickDocument isn't available, default to hiding the file picker
|
|
502
507
|
hasCameraPicker = isImagePickerAvailable(),
|
|
503
508
|
hasCommands = true,
|
|
504
|
-
|
|
509
|
+
hasCreatePoll,
|
|
505
510
|
hasFilePicker = pickDocument !== null,
|
|
506
511
|
hasImagePicker = true,
|
|
507
512
|
hideDateSeparators = false,
|
|
@@ -539,7 +544,7 @@ const ChannelWithContext = <
|
|
|
539
544
|
MessageAvatar = MessageAvatarDefault,
|
|
540
545
|
MessageBounce = MessageBounceDefault,
|
|
541
546
|
MessageContent = MessageContentDefault,
|
|
542
|
-
messageContentOrder = ['quoted_reply', 'gallery', 'files', 'text', 'attachments'],
|
|
547
|
+
messageContentOrder = ['quoted_reply', 'gallery', 'files', 'poll', 'text', 'attachments'],
|
|
543
548
|
MessageDeleted = MessageDeletedDefault,
|
|
544
549
|
MessageEditedTimestamp = MessageEditedTimestampDefault,
|
|
545
550
|
MessageError = MessageErrorDefault,
|
|
@@ -565,8 +570,10 @@ const ChannelWithContext = <
|
|
|
565
570
|
onLongPressMessage,
|
|
566
571
|
onPressInMessage,
|
|
567
572
|
onPressMessage,
|
|
573
|
+
openPollCreationDialog,
|
|
568
574
|
OverlayReactionList = OverlayReactionListDefault,
|
|
569
575
|
overrideOwnCapabilities,
|
|
576
|
+
PollContent,
|
|
570
577
|
ReactionList = ReactionListDefault,
|
|
571
578
|
read,
|
|
572
579
|
Reply = ReplyDefault,
|
|
@@ -652,6 +659,7 @@ const ChannelWithContext = <
|
|
|
652
659
|
const uploadAbortControllerRef = useRef<Map<string, AbortController>>(new Map());
|
|
653
660
|
|
|
654
661
|
const channelId = channel?.id || '';
|
|
662
|
+
const pollCreationEnabled = !channel.disconnected && !!channel?.id && channel?.getConfig()?.polls;
|
|
655
663
|
|
|
656
664
|
useEffect(() => {
|
|
657
665
|
const initChannel = async () => {
|
|
@@ -844,7 +852,13 @@ const ChannelWithContext = <
|
|
|
844
852
|
setThreadMessages(updatedThreadMessages);
|
|
845
853
|
}
|
|
846
854
|
|
|
847
|
-
if (
|
|
855
|
+
if (
|
|
856
|
+
channel &&
|
|
857
|
+
thread?.id &&
|
|
858
|
+
event.message?.id === thread.id &&
|
|
859
|
+
!threadInstance &&
|
|
860
|
+
!thread.poll_id
|
|
861
|
+
) {
|
|
848
862
|
const updatedThread = channel.state.formatMessage(event.message);
|
|
849
863
|
setThread(updatedThread);
|
|
850
864
|
}
|
|
@@ -1548,6 +1562,8 @@ const ChannelWithContext = <
|
|
|
1548
1562
|
attachments,
|
|
1549
1563
|
mentioned_users,
|
|
1550
1564
|
parent_id,
|
|
1565
|
+
poll,
|
|
1566
|
+
poll_id,
|
|
1551
1567
|
text,
|
|
1552
1568
|
...extraFields
|
|
1553
1569
|
}: Partial<StreamMessage<StreamChatGenerics>>) => {
|
|
@@ -1569,6 +1585,8 @@ const ChannelWithContext = <
|
|
|
1569
1585
|
id: userId,
|
|
1570
1586
|
})) || [],
|
|
1571
1587
|
parent_id,
|
|
1588
|
+
poll,
|
|
1589
|
+
poll_id,
|
|
1572
1590
|
reactions: [],
|
|
1573
1591
|
status: MessageStatusTypes.SENDING,
|
|
1574
1592
|
text,
|
|
@@ -2283,6 +2301,7 @@ const ChannelWithContext = <
|
|
|
2283
2301
|
CommandsButton,
|
|
2284
2302
|
compressImageQuality,
|
|
2285
2303
|
CooldownTimer,
|
|
2304
|
+
CreatePollContent,
|
|
2286
2305
|
doDocUploadRequest,
|
|
2287
2306
|
doImageUploadRequest,
|
|
2288
2307
|
editing,
|
|
@@ -2308,6 +2327,7 @@ const ChannelWithContext = <
|
|
|
2308
2327
|
MoreOptionsButton,
|
|
2309
2328
|
numberOfLines,
|
|
2310
2329
|
onChangeText,
|
|
2330
|
+
openPollCreationDialog,
|
|
2311
2331
|
quotedMessage,
|
|
2312
2332
|
SendButton,
|
|
2313
2333
|
sendImageAsync,
|
|
@@ -2372,6 +2392,8 @@ const ChannelWithContext = <
|
|
|
2372
2392
|
handleReaction,
|
|
2373
2393
|
handleRetry,
|
|
2374
2394
|
handleThreadReply,
|
|
2395
|
+
hasCreatePoll:
|
|
2396
|
+
hasCreatePoll === undefined ? pollCreationEnabled : hasCreatePoll && pollCreationEnabled,
|
|
2375
2397
|
ImageLoadingFailedIndicator,
|
|
2376
2398
|
ImageLoadingIndicator,
|
|
2377
2399
|
initialScrollToFirstUnreadMessage: !messageId && initialScrollToFirstUnreadMessage, // when messageId is set, we scroll to the messageId instead of first unread
|
|
@@ -2405,6 +2427,7 @@ const ChannelWithContext = <
|
|
|
2405
2427
|
onPressInMessage,
|
|
2406
2428
|
onPressMessage,
|
|
2407
2429
|
OverlayReactionList,
|
|
2430
|
+
PollContent,
|
|
2408
2431
|
ReactionList,
|
|
2409
2432
|
removeMessage,
|
|
2410
2433
|
Reply,
|
|
@@ -27,6 +27,7 @@ export const useCreateInputMessageInputContext = <
|
|
|
27
27
|
CommandsButton,
|
|
28
28
|
compressImageQuality,
|
|
29
29
|
CooldownTimer,
|
|
30
|
+
CreatePollContent,
|
|
30
31
|
doDocUploadRequest,
|
|
31
32
|
doImageUploadRequest,
|
|
32
33
|
editing,
|
|
@@ -52,6 +53,7 @@ export const useCreateInputMessageInputContext = <
|
|
|
52
53
|
MoreOptionsButton,
|
|
53
54
|
numberOfLines,
|
|
54
55
|
onChangeText,
|
|
56
|
+
openPollCreationDialog,
|
|
55
57
|
quotedMessage,
|
|
56
58
|
SendButton,
|
|
57
59
|
sendImageAsync,
|
|
@@ -59,6 +61,7 @@ export const useCreateInputMessageInputContext = <
|
|
|
59
61
|
SendMessageDisallowedIndicator,
|
|
60
62
|
setInputRef,
|
|
61
63
|
setQuotedMessageState,
|
|
64
|
+
showPollCreationDialog,
|
|
62
65
|
ShowThreadMessageInChannelButton,
|
|
63
66
|
StartAudioRecordingButton,
|
|
64
67
|
UploadProgressIndicator,
|
|
@@ -97,6 +100,7 @@ export const useCreateInputMessageInputContext = <
|
|
|
97
100
|
CommandsButton,
|
|
98
101
|
compressImageQuality,
|
|
99
102
|
CooldownTimer,
|
|
103
|
+
CreatePollContent,
|
|
100
104
|
doDocUploadRequest,
|
|
101
105
|
doImageUploadRequest,
|
|
102
106
|
editing,
|
|
@@ -122,6 +126,7 @@ export const useCreateInputMessageInputContext = <
|
|
|
122
126
|
MoreOptionsButton,
|
|
123
127
|
numberOfLines,
|
|
124
128
|
onChangeText,
|
|
129
|
+
openPollCreationDialog,
|
|
125
130
|
quotedMessage,
|
|
126
131
|
SendButton,
|
|
127
132
|
sendImageAsync,
|
|
@@ -129,12 +134,22 @@ export const useCreateInputMessageInputContext = <
|
|
|
129
134
|
SendMessageDisallowedIndicator,
|
|
130
135
|
setInputRef,
|
|
131
136
|
setQuotedMessageState,
|
|
137
|
+
showPollCreationDialog,
|
|
132
138
|
ShowThreadMessageInChannelButton,
|
|
133
139
|
StartAudioRecordingButton,
|
|
134
140
|
UploadProgressIndicator,
|
|
135
141
|
}),
|
|
136
142
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
137
|
-
[
|
|
143
|
+
[
|
|
144
|
+
compressImageQuality,
|
|
145
|
+
channelId,
|
|
146
|
+
editingDep,
|
|
147
|
+
initialValue,
|
|
148
|
+
maxMessageLength,
|
|
149
|
+
quotedMessageId,
|
|
150
|
+
CreatePollContent,
|
|
151
|
+
showPollCreationDialog,
|
|
152
|
+
],
|
|
138
153
|
);
|
|
139
154
|
|
|
140
155
|
return inputMessageInputContext;
|
|
@@ -43,6 +43,7 @@ export const useCreateMessagesContext = <
|
|
|
43
43
|
handleReaction,
|
|
44
44
|
handleRetry,
|
|
45
45
|
handleThreadReply,
|
|
46
|
+
hasCreatePoll,
|
|
46
47
|
ImageLoadingFailedIndicator,
|
|
47
48
|
ImageLoadingIndicator,
|
|
48
49
|
initialScrollToFirstUnreadMessage,
|
|
@@ -76,6 +77,7 @@ export const useCreateMessagesContext = <
|
|
|
76
77
|
onPressInMessage,
|
|
77
78
|
onPressMessage,
|
|
78
79
|
OverlayReactionList,
|
|
80
|
+
PollContent,
|
|
79
81
|
ReactionList,
|
|
80
82
|
removeMessage,
|
|
81
83
|
Reply,
|
|
@@ -142,6 +144,7 @@ export const useCreateMessagesContext = <
|
|
|
142
144
|
handleReaction,
|
|
143
145
|
handleRetry,
|
|
144
146
|
handleThreadReply,
|
|
147
|
+
hasCreatePoll,
|
|
145
148
|
ImageLoadingFailedIndicator,
|
|
146
149
|
ImageLoadingIndicator,
|
|
147
150
|
initialScrollToFirstUnreadMessage,
|
|
@@ -175,6 +178,7 @@ export const useCreateMessagesContext = <
|
|
|
175
178
|
onPressInMessage,
|
|
176
179
|
onPressMessage,
|
|
177
180
|
OverlayReactionList,
|
|
181
|
+
PollContent,
|
|
178
182
|
ReactionList,
|
|
179
183
|
removeMessage,
|
|
180
184
|
Reply,
|
|
@@ -205,6 +209,7 @@ export const useCreateMessagesContext = <
|
|
|
205
209
|
supportedReactionsLength,
|
|
206
210
|
myMessageTheme,
|
|
207
211
|
targetedMessage,
|
|
212
|
+
hasCreatePoll,
|
|
208
213
|
],
|
|
209
214
|
);
|
|
210
215
|
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import { TFunction } from 'i18next';
|
|
4
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
Channel,
|
|
6
|
+
ChannelState,
|
|
7
|
+
MessageResponse,
|
|
8
|
+
PollState,
|
|
9
|
+
PollVote,
|
|
10
|
+
StreamChat,
|
|
11
|
+
UserResponse,
|
|
12
|
+
} from 'stream-chat';
|
|
5
13
|
|
|
6
14
|
import { useChatContext } from '../../../contexts/chatContext/ChatContext';
|
|
7
15
|
import { useTranslationContext } from '../../../contexts/translationContext/TranslationContext';
|
|
8
16
|
|
|
17
|
+
import { useStateStore } from '../../../hooks';
|
|
9
18
|
import { useTranslatedMessage } from '../../../hooks/useTranslatedMessage';
|
|
10
19
|
import type { DefaultStreamChatGenerics } from '../../../types/types';
|
|
11
20
|
import { stringifyMessage } from '../../../utils/utils';
|
|
@@ -28,6 +37,18 @@ export type LatestMessagePreview<
|
|
|
28
37
|
created_at?: string | Date;
|
|
29
38
|
};
|
|
30
39
|
|
|
40
|
+
export type LatestMessagePreviewSelectorReturnType = {
|
|
41
|
+
created_by?: UserResponse | null;
|
|
42
|
+
latest_votes_by_option?: Record<string, PollVote[]>;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const selector = <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(
|
|
46
|
+
nextValue: PollState<StreamChatGenerics>,
|
|
47
|
+
): LatestMessagePreviewSelectorReturnType => ({
|
|
48
|
+
created_by: nextValue.created_by,
|
|
49
|
+
latest_votes_by_option: nextValue.latest_votes_by_option,
|
|
50
|
+
});
|
|
51
|
+
|
|
31
52
|
const getMessageSenderName = <
|
|
32
53
|
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
33
54
|
>(
|
|
@@ -77,6 +98,7 @@ const getLatestMessageDisplayText = <
|
|
|
77
98
|
client: StreamChat<StreamChatGenerics>,
|
|
78
99
|
message: LatestMessage<StreamChatGenerics> | undefined,
|
|
79
100
|
t: (key: string) => string,
|
|
101
|
+
pollState: LatestMessagePreviewSelectorReturnType | undefined,
|
|
80
102
|
) => {
|
|
81
103
|
if (!message) return [{ bold: false, text: t('Nothing yet...') }];
|
|
82
104
|
const isMessageTypeDeleted = message.type === 'deleted';
|
|
@@ -123,6 +145,28 @@ const getLatestMessageDisplayText = <
|
|
|
123
145
|
{ bold: false, text: t('🏙 Attachment...') },
|
|
124
146
|
];
|
|
125
147
|
}
|
|
148
|
+
if (message.poll && pollState) {
|
|
149
|
+
const { created_by, latest_votes_by_option } = pollState;
|
|
150
|
+
let latestVotes;
|
|
151
|
+
if (latest_votes_by_option) {
|
|
152
|
+
latestVotes = Object.values(latest_votes_by_option)
|
|
153
|
+
.map((votes) => votes?.[0])
|
|
154
|
+
.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime());
|
|
155
|
+
}
|
|
156
|
+
let previewAction = 'created';
|
|
157
|
+
let previewUser = created_by;
|
|
158
|
+
if (latestVotes && latestVotes.length && latestVotes[0]?.user) {
|
|
159
|
+
previewAction = 'voted';
|
|
160
|
+
previewUser = latestVotes[0]?.user;
|
|
161
|
+
}
|
|
162
|
+
const previewMessage = `${
|
|
163
|
+
client.userID === previewUser?.id ? 'You' : previewUser?.name
|
|
164
|
+
} ${previewAction}: ${message.poll.name}`;
|
|
165
|
+
return [
|
|
166
|
+
{ bold: false, text: '📊 ' },
|
|
167
|
+
{ bold: false, text: previewMessage },
|
|
168
|
+
];
|
|
169
|
+
}
|
|
126
170
|
return [
|
|
127
171
|
{ bold: boldOwner, text: messageSenderText },
|
|
128
172
|
{ bold: false, text: t('Empty message...') },
|
|
@@ -171,13 +215,14 @@ const getLatestMessagePreview = <
|
|
|
171
215
|
>(params: {
|
|
172
216
|
channel: Channel<StreamChatGenerics>;
|
|
173
217
|
client: StreamChat<StreamChatGenerics>;
|
|
218
|
+
pollState: LatestMessagePreviewSelectorReturnType | undefined;
|
|
174
219
|
readEvents: boolean;
|
|
175
220
|
t: TFunction;
|
|
176
221
|
lastMessage?:
|
|
177
222
|
| ReturnType<ChannelState<StreamChatGenerics>['formatMessage']>
|
|
178
223
|
| MessageResponse<StreamChatGenerics>;
|
|
179
224
|
}) => {
|
|
180
|
-
const { channel, client, lastMessage, readEvents, t } = params;
|
|
225
|
+
const { channel, client, lastMessage, pollState, readEvents, t } = params;
|
|
181
226
|
|
|
182
227
|
const messages = channel.state.messages;
|
|
183
228
|
|
|
@@ -202,7 +247,7 @@ const getLatestMessagePreview = <
|
|
|
202
247
|
return {
|
|
203
248
|
created_at: message?.created_at,
|
|
204
249
|
messageObject: message,
|
|
205
|
-
previews: getLatestMessageDisplayText(channel, client, message, t),
|
|
250
|
+
previews: getLatestMessageDisplayText(channel, client, message, t, pollState),
|
|
206
251
|
status: getLatestMessageReadStatus(channel, client, message, readEvents),
|
|
207
252
|
};
|
|
208
253
|
};
|
|
@@ -261,6 +306,12 @@ export const useLatestMessagePreview = <
|
|
|
261
306
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
262
307
|
}, [channelConfigExists]);
|
|
263
308
|
|
|
309
|
+
const pollId = lastMessage?.poll_id ?? '';
|
|
310
|
+
const poll = client.polls.fromState(pollId);
|
|
311
|
+
const pollState: LatestMessagePreviewSelectorReturnType =
|
|
312
|
+
useStateStore(poll?.state, selector) ?? {};
|
|
313
|
+
const { created_by, latest_votes_by_option } = pollState;
|
|
314
|
+
|
|
264
315
|
useEffect(
|
|
265
316
|
() =>
|
|
266
317
|
setLatestMessagePreview(
|
|
@@ -268,12 +319,20 @@ export const useLatestMessagePreview = <
|
|
|
268
319
|
channel,
|
|
269
320
|
client,
|
|
270
321
|
lastMessage: translatedLastMessage,
|
|
322
|
+
pollState,
|
|
271
323
|
readEvents,
|
|
272
324
|
t,
|
|
273
325
|
}),
|
|
274
326
|
),
|
|
275
327
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
276
|
-
[
|
|
328
|
+
[
|
|
329
|
+
channelLastMessageString,
|
|
330
|
+
forceUpdate,
|
|
331
|
+
readEvents,
|
|
332
|
+
readStatus,
|
|
333
|
+
latest_votes_by_option,
|
|
334
|
+
created_by,
|
|
335
|
+
],
|
|
277
336
|
);
|
|
278
337
|
|
|
279
338
|
return latestMessagePreview;
|
|
@@ -219,9 +219,11 @@ const ChatWithContext = <
|
|
|
219
219
|
if (!client) return;
|
|
220
220
|
|
|
221
221
|
client.threads.registerSubscriptions();
|
|
222
|
+
client.polls.registerSubscriptions();
|
|
222
223
|
|
|
223
224
|
return () => {
|
|
224
225
|
client.threads.unregisterSubscriptions();
|
|
226
|
+
client.polls.unregisterSubscriptions();
|
|
225
227
|
};
|
|
226
228
|
}, [client]);
|
|
227
229
|
|
|
@@ -4,6 +4,7 @@ import { deleteChannel } from '../../../store/apis/deleteChannel';
|
|
|
4
4
|
import { deleteMember } from '../../../store/apis/deleteMember';
|
|
5
5
|
import { deleteMessagesForChannel } from '../../../store/apis/deleteMessagesForChannel';
|
|
6
6
|
import { updateMessage } from '../../../store/apis/updateMessage';
|
|
7
|
+
import { updatePollMessage } from '../../../store/apis/updatePollMessage';
|
|
7
8
|
import { upsertChannelData } from '../../../store/apis/upsertChannelData';
|
|
8
9
|
import { upsertChannelDataFromChannel } from '../../../store/apis/upsertChannelDataFromChannel';
|
|
9
10
|
import { upsertChannels } from '../../../store/apis/upsertChannels';
|
|
@@ -223,5 +224,23 @@ export const handleEventToSyncDB = <
|
|
|
223
224
|
}
|
|
224
225
|
}
|
|
225
226
|
|
|
227
|
+
if (
|
|
228
|
+
[
|
|
229
|
+
'poll.closed',
|
|
230
|
+
'poll.updated',
|
|
231
|
+
'poll.vote_casted',
|
|
232
|
+
'poll.vote_changed',
|
|
233
|
+
'poll.vote_removed',
|
|
234
|
+
].includes(type)
|
|
235
|
+
) {
|
|
236
|
+
const poll = event.poll;
|
|
237
|
+
if (poll) {
|
|
238
|
+
return updatePollMessage({
|
|
239
|
+
flush,
|
|
240
|
+
poll,
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
226
245
|
return [];
|
|
227
246
|
};
|