stream-chat-react 13.14.4 → 13.14.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.
@@ -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.14.4";
27
+ const version = "13.14.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'
@@ -19,7 +19,5 @@ export const ModalGallery = (props) => {
19
19
  source: imageSrc,
20
20
  };
21
21
  }), [images, t]);
22
- return (
23
- // @ts-expect-error ignore the TS error as react-image-gallery was on @types/react@18 while stream-chat-react being upgraded to React 19 (https://github.com/xiaolin/react-image-gallery/issues/809)
24
- React.createElement(ImageGallery, { items: formattedArray, renderItem: renderItem, showIndex: true, showPlayButton: false, showThumbnails: false, startIndex: index }));
22
+ return (React.createElement(ImageGallery, { items: formattedArray, renderItem: renderItem, showIndex: true, showPlayButton: false, showThumbnails: false, startIndex: index }));
25
23
  };
@@ -195,6 +195,11 @@ export class MediaRecorderController {
195
195
  this.pause = () => {
196
196
  if (this.recordingState.value !== MediaRecordingState.RECORDING)
197
197
  return;
198
+ // The native recorder can transition to 'inactive' on its own (e.g. iOS Safari
199
+ // interruptions or a preceding stop) while recordingState still reads RECORDING.
200
+ // Calling pause() on a non-recording recorder throws InvalidStateError.
201
+ if (this.mediaRecorder?.state !== 'recording')
202
+ return;
198
203
  if (this.startTime) {
199
204
  this.recordedChunkDurations.push(new Date().getTime() - this.startTime);
200
205
  this.startTime = undefined;
@@ -206,6 +211,10 @@ export class MediaRecorderController {
206
211
  this.resume = () => {
207
212
  if (this.recordingState.value !== MediaRecordingState.PAUSED)
208
213
  return;
214
+ // resume() is only valid on a 'paused' recorder; the native recorder may have gone
215
+ // inactive while recordingState still reads PAUSED, which would throw InvalidStateError.
216
+ if (this.mediaRecorder?.state !== 'paused')
217
+ return;
209
218
  this.startTime = new Date().getTime();
210
219
  this.mediaRecorder?.resume();
211
220
  this.amplitudeRecorder?.start();
@@ -5,10 +5,10 @@ import type { UserResponse } from 'stream-chat';
5
5
  import type { PluggableList } from 'unified';
6
6
  import type { MentionProps } from './componentRenderers';
7
7
  export type RenderTextPluginConfigurator = (defaultPlugins: PluggableList) => PluggableList;
8
- export declare const defaultAllowedTagNames: Array<keyof JSX.IntrinsicElements | 'emoji' | 'mention'>;
8
+ export declare const defaultAllowedTagNames: Array<keyof React.JSX.IntrinsicElements | 'emoji' | 'mention'>;
9
9
  export declare const markDownRenderers: RenderTextOptions['customMarkDownRenderers'];
10
10
  export type RenderTextOptions = {
11
- allowedTagNames?: Array<keyof JSX.IntrinsicElements | 'emoji' | 'mention' | (string & {})>;
11
+ allowedTagNames?: Array<keyof React.JSX.IntrinsicElements | 'emoji' | 'mention' | (string & {})>;
12
12
  customMarkDownRenderers?: Options['components'] & Partial<{
13
13
  emoji: ComponentType;
14
14
  mention: ComponentType<MentionProps>;
@@ -1,3 +1,4 @@
1
+ export * from './AttachmentSelectorContext';
1
2
  export * from './ChannelActionContext';
2
3
  export * from './ChannelListContext';
3
4
  export * from './ChannelStateContext';
@@ -1,3 +1,4 @@
1
+ export * from './AttachmentSelectorContext';
1
2
  export * from './ChannelActionContext';
2
3
  export * from './ChannelListContext';
3
4
  export * from './ChannelStateContext';