stream-chat-react 13.14.5 → 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.5";
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>;
@@ -17499,19 +17499,16 @@ var ModalGallery = (props) => {
17499
17499
  }),
17500
17500
  [images, t]
17501
17501
  );
17502
- return (
17503
- // @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)
17504
- /* @__PURE__ */ import_react97.default.createElement(
17505
- import_react_image_gallery.default,
17506
- {
17507
- items: formattedArray,
17508
- renderItem,
17509
- showIndex: true,
17510
- showPlayButton: false,
17511
- showThumbnails: false,
17512
- startIndex: index2
17513
- }
17514
- )
17502
+ return /* @__PURE__ */ import_react97.default.createElement(
17503
+ import_react_image_gallery.default,
17504
+ {
17505
+ items: formattedArray,
17506
+ renderItem,
17507
+ showIndex: true,
17508
+ showPlayButton: false,
17509
+ showThumbnails: false,
17510
+ startIndex: index2
17511
+ }
17515
17512
  );
17516
17513
  };
17517
17514
 
@@ -33042,6 +33039,7 @@ var MediaRecorderController = class {
33042
33039
  };
33043
33040
  this.pause = () => {
33044
33041
  if (this.recordingState.value !== "recording" /* RECORDING */) return;
33042
+ if (this.mediaRecorder?.state !== "recording") return;
33045
33043
  if (this.startTime) {
33046
33044
  this.recordedChunkDurations.push((/* @__PURE__ */ new Date()).getTime() - this.startTime);
33047
33045
  this.startTime = void 0;
@@ -33052,6 +33050,7 @@ var MediaRecorderController = class {
33052
33050
  };
33053
33051
  this.resume = () => {
33054
33052
  if (this.recordingState.value !== "paused" /* PAUSED */) return;
33053
+ if (this.mediaRecorder?.state !== "paused") return;
33055
33054
  this.startTime = (/* @__PURE__ */ new Date()).getTime();
33056
33055
  this.mediaRecorder?.resume();
33057
33056
  this.amplitudeRecorder?.start();
@@ -37424,7 +37423,7 @@ var useChat = ({
37424
37423
  };
37425
37424
  (0, import_react289.useEffect)(() => {
37426
37425
  if (!client) return;
37427
- const version = "13.14.5";
37426
+ const version = "13.14.6";
37428
37427
  const userAgent = client.getUserAgent();
37429
37428
  if (!userAgent.includes("stream-chat-react")) {
37430
37429
  client.setUserAgent(`stream-chat-react-${version}-${userAgent}`);