stream-chat-react 13.6.4 → 13.6.6
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/dist/components/ChannelPreview/utils.js +7 -1
- package/dist/components/Chat/hooks/useChat.js +1 -1
- package/dist/components/Message/renderText/renderText.js +6 -0
- package/dist/components/MessageInput/AttachmentSelector.js +6 -3
- package/dist/experimental/index.browser.cjs +4862 -1799
- package/dist/experimental/index.browser.cjs.map +4 -4
- package/dist/experimental/index.node.cjs +4812 -1749
- package/dist/experimental/index.node.cjs.map +4 -4
- package/dist/index.browser.cjs +3225 -3213
- package/dist/index.browser.cjs.map +4 -4
- package/dist/index.node.cjs +1334 -1322
- package/dist/index.node.cjs.map +4 -4
- package/package.json +1 -1
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ReactMarkdown from 'react-markdown';
|
|
3
|
-
|
|
3
|
+
import { htmlToTextPlugin } from '../Message';
|
|
4
|
+
import remarkGfm from 'remark-gfm';
|
|
5
|
+
const remarkPlugins = [
|
|
6
|
+
htmlToTextPlugin,
|
|
7
|
+
[remarkGfm, { singleTilde: false }],
|
|
8
|
+
];
|
|
9
|
+
export const renderPreviewText = (text) => (React.createElement(ReactMarkdown, { remarkPlugins: remarkPlugins, skipHtml: true }, text));
|
|
4
10
|
const getLatestPollVote = (latestVotesByOption) => {
|
|
5
11
|
let latestVote;
|
|
6
12
|
for (const optionVotes of Object.values(latestVotesByOption)) {
|
|
@@ -24,7 +24,7 @@ export const useChat = ({ client, defaultLanguage = 'en', i18nInstance, initialN
|
|
|
24
24
|
useEffect(() => {
|
|
25
25
|
if (!client)
|
|
26
26
|
return;
|
|
27
|
-
const version = "13.6.
|
|
27
|
+
const version = "13.6.6";
|
|
28
28
|
const userAgent = client.getUserAgent();
|
|
29
29
|
if (!userAgent.includes('stream-chat-react')) {
|
|
30
30
|
// result looks like: 'stream-chat-react-2.3.2-stream-chat-javascript-client-browser-2.2.2'
|
|
@@ -88,14 +88,17 @@ const useAttachmentSelectorActionsFiltered = (original) => {
|
|
|
88
88
|
const { PollCreationDialog = DefaultPollCreationDialog, ShareLocationDialog = DefaultLocationDialog, } = useComponentContext();
|
|
89
89
|
const { channelCapabilities } = useChannelStateContext();
|
|
90
90
|
const messageComposer = useMessageComposer();
|
|
91
|
+
const channelConfig = messageComposer.channel.getConfig();
|
|
91
92
|
return original
|
|
92
93
|
.filter((action) => {
|
|
93
94
|
if (action.type === 'uploadFile')
|
|
94
|
-
return channelCapabilities['upload-file'];
|
|
95
|
+
return channelCapabilities['upload-file'] && channelConfig?.uploads;
|
|
95
96
|
if (action.type === 'createPoll')
|
|
96
|
-
return channelCapabilities['send-poll'] &&
|
|
97
|
+
return (channelCapabilities['send-poll'] &&
|
|
98
|
+
!messageComposer.threadId &&
|
|
99
|
+
channelConfig?.polls);
|
|
97
100
|
if (action.type === 'addLocation') {
|
|
98
|
-
return
|
|
101
|
+
return channelConfig?.shared_locations && !messageComposer.threadId;
|
|
99
102
|
}
|
|
100
103
|
return true;
|
|
101
104
|
})
|