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.
- package/dist/components/Chat/hooks/useChat.js +1 -1
- package/dist/components/Gallery/ModalGallery.js +1 -3
- package/dist/components/MediaRecorder/classes/MediaRecorderController.js +9 -0
- package/dist/components/Message/renderText/renderText.d.ts +2 -2
- package/dist/context/index.d.ts +1 -0
- package/dist/context/index.js +1 -0
- package/dist/index.browser.cjs +1362 -1361
- package/dist/index.browser.cjs.map +4 -4
- package/dist/index.node.cjs +1364 -1361
- package/dist/index.node.cjs.map +4 -4
- package/package.json +3 -2
|
@@ -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.
|
|
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>;
|
package/dist/context/index.d.ts
CHANGED
package/dist/context/index.js
CHANGED