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.
Files changed (43) hide show
  1. package/INTEGRATION_GUIDE.md +423 -0
  2. package/dist/components/Attachment/AttachmentActions.js +7 -2
  3. package/dist/components/Chat/hooks/useChat.js +1 -1
  4. package/dist/components/Message/ReminderNotification.js +2 -2
  5. package/dist/components/Message/hooks/useMuteHandler.js +2 -2
  6. package/dist/components/MessageInput/AttachmentPreviewList/AttachmentPreviewList.js +1 -1
  7. package/dist/components/MessageInput/AttachmentPreviewList/FileAttachmentPreview.d.ts +2 -1
  8. package/dist/components/MessageInput/AttachmentPreviewList/FileAttachmentPreview.js +3 -2
  9. package/dist/components/MessageInput/AttachmentPreviewList/ImageAttachmentPreview.js +1 -1
  10. package/dist/components/MessageInput/AttachmentPreviewList/VoiceRecordingPreview.js +1 -1
  11. package/dist/components/MessageInput/SendButton.js +3 -1
  12. package/dist/components/Poll/PollCreationDialog/MultipleAnswersField.js +6 -2
  13. package/dist/components/Poll/PollCreationDialog/NameField.js +5 -2
  14. package/dist/components/Poll/PollCreationDialog/OptionFieldSet.js +6 -2
  15. package/dist/components/TextareaComposer/SuggestionList/CommandItem.js +21 -3
  16. package/dist/css/v2/index.css +1 -1
  17. package/dist/css/v2/index.layout.css +1 -1
  18. package/dist/experimental/Search/SearchResults/SearchResultsHeader.js +7 -2
  19. package/dist/experimental/Search/SearchResults/SearchSourceResultsLoadingIndicator.js +3 -1
  20. package/dist/experimental/index.browser.cjs +18 -2
  21. package/dist/experimental/index.browser.cjs.map +2 -2
  22. package/dist/experimental/index.node.cjs +18 -2
  23. package/dist/experimental/index.node.cjs.map +2 -2
  24. package/dist/i18n/Streami18n.d.ts +90 -78
  25. package/dist/i18n/de.json +91 -89
  26. package/dist/i18n/en.json +91 -79
  27. package/dist/i18n/es.json +99 -97
  28. package/dist/i18n/fr.json +99 -97
  29. package/dist/i18n/hi.json +91 -89
  30. package/dist/i18n/it.json +99 -97
  31. package/dist/i18n/ja.json +88 -86
  32. package/dist/i18n/ko.json +88 -86
  33. package/dist/i18n/nl.json +91 -89
  34. package/dist/i18n/pt.json +99 -97
  35. package/dist/i18n/ru.json +104 -102
  36. package/dist/i18n/tr.json +91 -89
  37. package/dist/index.browser.cjs +1607 -1518
  38. package/dist/index.browser.cjs.map +2 -2
  39. package/dist/index.node.cjs +1607 -1518
  40. package/dist/index.node.cjs.map +2 -2
  41. package/dist/scss/v2/Message/Message-layout.scss +1 -0
  42. package/dist/scss/v2/Poll/Poll-layout.scss +4 -0
  43. 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
  };