stream-chat-react 13.2.3 → 13.4.0

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 (97) hide show
  1. package/dist/components/Attachment/Attachment.d.ts +5 -3
  2. package/dist/components/Attachment/Attachment.js +12 -5
  3. package/dist/components/Attachment/AttachmentContainer.d.ts +4 -3
  4. package/dist/components/Attachment/AttachmentContainer.js +5 -1
  5. package/dist/components/Attachment/Geolocation.d.ts +13 -0
  6. package/dist/components/Attachment/Geolocation.js +34 -0
  7. package/dist/components/Attachment/icons.d.ts +2 -0
  8. package/dist/components/Attachment/icons.js +5 -0
  9. package/dist/components/Attachment/index.d.ts +3 -1
  10. package/dist/components/Attachment/index.js +3 -1
  11. package/dist/components/Attachment/utils.d.ts +4 -1
  12. package/dist/components/Channel/Channel.d.ts +1 -1
  13. package/dist/components/Channel/Channel.js +2 -0
  14. package/dist/components/ChannelPreview/utils.js +3 -0
  15. package/dist/components/Chat/hooks/useChat.js +1 -1
  16. package/dist/components/Dialog/DialogAnchor.d.ts +3 -2
  17. package/dist/components/Dialog/DialogAnchor.js +7 -2
  18. package/dist/components/Form/Dropdown.d.ts +14 -0
  19. package/dist/components/Form/Dropdown.js +49 -0
  20. package/dist/components/Form/SwitchField.js +3 -1
  21. package/dist/components/Location/ShareLocationDialog.d.ts +18 -0
  22. package/dist/components/Location/ShareLocationDialog.js +139 -0
  23. package/dist/components/Location/hooks/useLiveLocationSharingManager.d.ts +18 -0
  24. package/dist/components/Location/hooks/useLiveLocationSharingManager.js +57 -0
  25. package/dist/components/Location/index.d.ts +1 -0
  26. package/dist/components/Location/index.js +1 -0
  27. package/dist/components/Message/MessageSimple.js +6 -1
  28. package/dist/components/Message/index.d.ts +3 -1
  29. package/dist/components/Message/index.js +3 -1
  30. package/dist/components/Message/renderText/renderText.d.ts +1 -1
  31. package/dist/components/Message/renderText/renderText.js +1 -1
  32. package/dist/components/MessageInput/AttachmentPreviewList/AttachmentPreviewList.d.ts +3 -1
  33. package/dist/components/MessageInput/AttachmentPreviewList/AttachmentPreviewList.js +35 -26
  34. package/dist/components/MessageInput/AttachmentPreviewList/GeolocationPreview.d.ts +13 -0
  35. package/dist/components/MessageInput/AttachmentPreviewList/GeolocationPreview.js +25 -0
  36. package/dist/components/MessageInput/AttachmentPreviewList/index.d.ts +1 -0
  37. package/dist/components/MessageInput/AttachmentSelector.d.ts +2 -1
  38. package/dist/components/MessageInput/AttachmentSelector.js +34 -12
  39. package/dist/components/MessageInput/MessageInput.d.ts +3 -1
  40. package/dist/components/MessageInput/MessageInput.js +7 -3
  41. package/dist/components/MessageInput/hooks/index.d.ts +1 -0
  42. package/dist/components/MessageInput/hooks/index.js +1 -0
  43. package/dist/components/MessageInput/hooks/useAttachmentsForPreview.d.ts +17 -0
  44. package/dist/components/MessageInput/hooks/useAttachmentsForPreview.js +22 -0
  45. package/dist/components/MessageInput/index.d.ts +1 -1
  46. package/dist/components/Modal/Modal.d.ts +8 -3
  47. package/dist/components/Modal/Modal.js +19 -8
  48. package/dist/components/Poll/PollActions/AddCommentForm.js +8 -0
  49. package/dist/components/Poll/PollActions/SuggestPollOptionForm.js +6 -3
  50. package/dist/components/Poll/PollCreationDialog/PollCreationDialogControls.js +4 -1
  51. package/dist/components/TextareaComposer/SuggestionList/SuggestionListItem.js +4 -1
  52. package/dist/components/index.d.ts +2 -1
  53. package/dist/components/index.js +2 -0
  54. package/dist/context/ComponentContext.d.ts +3 -0
  55. package/dist/css/v2/index.css +1 -1
  56. package/dist/css/v2/index.layout.css +1 -1
  57. package/dist/experimental/index.browser.cjs +11 -0
  58. package/dist/experimental/index.browser.cjs.map +2 -2
  59. package/dist/experimental/index.node.cjs +11 -0
  60. package/dist/experimental/index.node.cjs.map +2 -2
  61. package/dist/i18n/Streami18n.d.ts +21 -0
  62. package/dist/i18n/TranslationBuilder/notifications/NotificationTranslationTopic.js +2 -0
  63. package/dist/i18n/TranslationBuilder/notifications/pollVoteCountTrespass.d.ts +3 -0
  64. package/dist/i18n/TranslationBuilder/notifications/pollVoteCountTrespass.js +1 -0
  65. package/dist/i18n/de.json +22 -1
  66. package/dist/i18n/en.json +22 -1
  67. package/dist/i18n/es.json +22 -1
  68. package/dist/i18n/fr.json +22 -1
  69. package/dist/i18n/hi.json +22 -1
  70. package/dist/i18n/it.json +22 -1
  71. package/dist/i18n/ja.json +22 -1
  72. package/dist/i18n/ko.json +22 -1
  73. package/dist/i18n/nl.json +22 -1
  74. package/dist/i18n/pt.json +22 -1
  75. package/dist/i18n/ru.json +22 -1
  76. package/dist/i18n/tr.json +22 -1
  77. package/dist/index.browser.cjs +2610 -1727
  78. package/dist/index.browser.cjs.map +4 -4
  79. package/dist/index.node.cjs +2622 -1727
  80. package/dist/index.node.cjs.map +4 -4
  81. package/dist/scss/v2/AttachmentList/AttachmentList-layout.scss +50 -0
  82. package/dist/scss/v2/AttachmentList/AttachmentList-theme.scss +56 -0
  83. package/dist/scss/v2/AttachmentPreviewList/AttachmentPreviewList-layout.scss +3 -0
  84. package/dist/scss/v2/AttachmentPreviewList/AttachmentPreviewList-theme.scss +11 -0
  85. package/dist/scss/v2/Dialog/Dialog-layout.scss +1 -2
  86. package/dist/scss/v2/Form/Form-layout.scss +40 -0
  87. package/dist/scss/v2/Form/Form-theme.scss +62 -0
  88. package/dist/scss/v2/Location/Location-layout.scss +52 -0
  89. package/dist/scss/v2/Location/Location-theme.scss +32 -0
  90. package/dist/scss/v2/MessageInput/MessageInput-theme.scss +7 -0
  91. package/dist/scss/v2/Modal/Modal-layout.scss +2 -0
  92. package/dist/scss/v2/Poll/Poll-layout.scss +0 -35
  93. package/dist/scss/v2/Poll/Poll-theme.scss +0 -28
  94. package/dist/scss/v2/_icons.scss +1 -0
  95. package/dist/scss/v2/index.layout.scss +1 -0
  96. package/dist/scss/v2/index.scss +1 -0
  97. package/package.json +6 -6
@@ -1,12 +1,15 @@
1
1
  import clsx from 'clsx';
2
2
  import React, { useCallback, useLayoutEffect, useRef } from 'react';
3
3
  import { useMessageComposer } from '../../MessageInput';
4
+ import { useMessageInputContext } from '../../../context';
4
5
  export const SuggestionListItem = React.forwardRef(function SuggestionListItem({ className, component: Component, focused, item, onMouseEnter }, innerRef) {
5
6
  const { textComposer } = useMessageComposer();
7
+ const { textareaRef } = useMessageInputContext();
6
8
  const containerRef = useRef(null);
7
9
  const handleSelect = useCallback(() => {
8
10
  textComposer.handleSelect(item);
9
- }, [item, textComposer]);
11
+ textareaRef.current?.focus();
12
+ }, [item, textareaRef, textComposer]);
10
13
  useLayoutEffect(() => {
11
14
  if (!focused)
12
15
  return;
@@ -14,10 +14,11 @@ export * from './Gallery';
14
14
  export * from './InfiniteScrollPaginator';
15
15
  export * from './Loading';
16
16
  export * from './LoadMore';
17
+ export * from './Location';
17
18
  export * from './MediaRecorder';
18
19
  export * from './Message';
19
20
  export * from './MessageActions';
20
- export type { MessageBouncePromptProps } from './MessageBounce';
21
+ export * from './MessageBounce';
21
22
  export * from './MessageInput';
22
23
  export * from './MessageList';
23
24
  export * from './Modal';
@@ -14,9 +14,11 @@ export * from './Gallery';
14
14
  export * from './InfiniteScrollPaginator';
15
15
  export * from './Loading';
16
16
  export * from './LoadMore';
17
+ export * from './Location';
17
18
  export * from './MediaRecorder';
18
19
  export * from './Message';
19
20
  export * from './MessageActions';
21
+ export * from './MessageBounce';
20
22
  export * from './MessageInput';
21
23
  export * from './MessageList';
22
24
  export * from './Modal';
@@ -5,6 +5,7 @@ import type { SuggestionItemProps, SuggestionListProps } from '../components/Tex
5
5
  import type { SearchProps, SearchResultsPresearchProps, SearchSourceResultListProps } from '../experimental';
6
6
  import type { PropsWithChildrenOnly, UnknownType } from '../types/types';
7
7
  import type { StopAIGenerationButtonProps } from '../components/MessageInput/StopAIGenerationButton';
8
+ import type { ShareLocationDialogProps } from '../components/Location';
8
9
  export type ComponentContextValue = {
9
10
  /** Custom UI component to display a message attachment, defaults to and accepts same props as: [Attachment](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Attachment/Attachment.tsx) */
10
11
  Attachment?: React.ComponentType<AttachmentProps>;
@@ -143,6 +144,8 @@ export type ComponentContextValue = {
143
144
  SendButton?: React.ComponentType<SendButtonProps>;
144
145
  /** Custom UI component checkbox that indicates message to be sent to main channel, defaults to and accepts same props as: [SendToChannelCheckbox](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageInput/SendToChannelCheckbox.tsx) */
145
146
  SendToChannelCheckbox?: React.ComponentType;
147
+ /** Custom UI component to render the location sharing dialog, defaults to and accepts same props as: [ShareLocationDialog](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Location/ShareLocationDialog.tsx) */
148
+ ShareLocationDialog?: React.ComponentType<ShareLocationDialogProps>;
146
149
  /** Custom UI component button for initiating audio recording, defaults to and accepts same props as: [StartRecordingAudioButton](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MediaRecorder/AudioRecorder/AudioRecordingButtons.tsx) */
147
150
  StartRecordingAudioButton?: React.ComponentType<StartRecordingAudioButtonProps>;
148
151
  StopAIGenerationButton?: React.ComponentType<StopAIGenerationButtonProps> | null;