stream-chat-react 13.13.0 → 13.13.2
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/INTEGRATION_GUIDE.md +423 -0
- package/dist/components/Attachment/AttachmentActions.js +7 -2
- package/dist/components/Chat/hooks/useChat.js +1 -1
- package/dist/components/Message/ReminderNotification.js +2 -2
- package/dist/components/Message/hooks/useMuteHandler.js +2 -2
- package/dist/components/MessageInput/AttachmentPreviewList/AttachmentPreviewList.js +1 -1
- package/dist/components/MessageInput/AttachmentPreviewList/FileAttachmentPreview.d.ts +2 -1
- package/dist/components/MessageInput/AttachmentPreviewList/FileAttachmentPreview.js +3 -2
- package/dist/components/MessageInput/AttachmentPreviewList/ImageAttachmentPreview.js +1 -1
- package/dist/components/MessageInput/AttachmentPreviewList/VoiceRecordingPreview.js +1 -1
- package/dist/components/MessageInput/SendButton.js +3 -1
- package/dist/components/Poll/PollCreationDialog/MultipleAnswersField.js +6 -2
- package/dist/components/Poll/PollCreationDialog/NameField.js +5 -2
- package/dist/components/Poll/PollCreationDialog/OptionFieldSet.js +6 -2
- package/dist/components/TextareaComposer/SuggestionList/CommandItem.js +21 -3
- package/dist/css/v2/index.css +1 -1
- package/dist/css/v2/index.layout.css +1 -1
- package/dist/experimental/Search/SearchResults/SearchResultsHeader.js +7 -2
- package/dist/experimental/Search/SearchResults/SearchSourceResultsLoadingIndicator.js +3 -1
- package/dist/experimental/index.browser.cjs +18 -2
- package/dist/experimental/index.browser.cjs.map +2 -2
- package/dist/experimental/index.node.cjs +18 -2
- package/dist/experimental/index.node.cjs.map +2 -2
- package/dist/i18n/Streami18n.d.ts +90 -78
- package/dist/i18n/de.json +91 -89
- package/dist/i18n/en.json +91 -79
- package/dist/i18n/es.json +99 -97
- package/dist/i18n/fr.json +99 -97
- package/dist/i18n/hi.json +91 -89
- package/dist/i18n/it.json +99 -97
- package/dist/i18n/ja.json +88 -86
- package/dist/i18n/ko.json +88 -86
- package/dist/i18n/nl.json +91 -89
- package/dist/i18n/pt.json +99 -97
- package/dist/i18n/ru.json +104 -102
- package/dist/i18n/tr.json +91 -89
- package/dist/index.browser.cjs +1607 -1518
- package/dist/index.browser.cjs.map +2 -2
- package/dist/index.node.cjs +1607 -1518
- package/dist/index.node.cjs.map +2 -2
- package/dist/scss/v2/Message/Message-layout.scss +1 -0
- package/dist/scss/v2/Poll/Poll-layout.scss +4 -0
- package/package.json +9 -8
|
@@ -1,11 +1,29 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
1
2
|
import React from 'react';
|
|
3
|
+
import { useTranslationContext } from '../../../context';
|
|
2
4
|
export const CommandItem = (props) => {
|
|
5
|
+
const { t } = useTranslationContext();
|
|
3
6
|
const { entity } = props;
|
|
7
|
+
const knownArgsTranslations = useMemo(() => ({
|
|
8
|
+
ban: t('ban-command-args'),
|
|
9
|
+
giphy: t('giphy-command-args'),
|
|
10
|
+
mute: t('mute-command-args'),
|
|
11
|
+
unban: t('unban-command-args'),
|
|
12
|
+
unmute: t('unmute-command-args'),
|
|
13
|
+
}), [t]);
|
|
14
|
+
const knownDescriptionTranslations = useMemo(() => ({
|
|
15
|
+
ban: t('ban-command-description'),
|
|
16
|
+
giphy: t('giphy-command-description'),
|
|
17
|
+
mute: t('mute-command-description'),
|
|
18
|
+
unban: t('unban-command-description'),
|
|
19
|
+
unmute: t('unmute-command-description'),
|
|
20
|
+
}), [t]);
|
|
4
21
|
return (React.createElement("div", { className: 'str-chat__slash-command' },
|
|
5
22
|
React.createElement("span", { className: 'str-chat__slash-command-header' },
|
|
6
23
|
React.createElement("strong", null, entity.name),
|
|
7
|
-
|
|
8
|
-
entity.args),
|
|
24
|
+
' ',
|
|
25
|
+
entity.args && (knownArgsTranslations[entity.name ?? ''] ?? t(entity.args))),
|
|
9
26
|
React.createElement("br", null),
|
|
10
|
-
React.createElement("span", { className: 'str-chat__slash-command-description' }, entity.description
|
|
27
|
+
React.createElement("span", { className: 'str-chat__slash-command-description' }, entity.description &&
|
|
28
|
+
(knownDescriptionTranslations[entity.name ?? ''] ?? t(entity.description)))));
|
|
11
29
|
};
|