@stream-io/video-react-sdk 0.0.58 → 0.0.59

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/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ### [0.0.59](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-0.0.58...@stream-io/video-react-sdk-0.0.59) (2023-06-30)
6
+
7
+ ### Dependency Updates
8
+
9
+ * `@stream-io/i18n` updated to version `0.0.7`
10
+ * `@stream-io/video-react-bindings` updated to version `0.0.30`
11
+
12
+ ### Documentation
13
+
14
+ * **react-sdk:** add CallStats docs ([#735](https://github.com/GetStream/stream-video-js/issues/735)) ([8fb2c15](https://github.com/GetStream/stream-video-js/commit/8fb2c1501a53121dd5dd30a3bbfeee74af0ad63c))
15
+ * **react-sdk:** add SpeakingWhileMutedNotification docs ([#732](https://github.com/GetStream/stream-video-js/issues/732)) ([bdb9daa](https://github.com/GetStream/stream-video-js/commit/bdb9daaf921b0a790fa8013dded2ff1559d95fc9))
16
+
5
17
  ### [0.0.58](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-0.0.57...@stream-io/video-react-sdk-0.0.58) (2023-06-29)
6
18
 
7
19
  ### Dependency Updates
@@ -1,3 +1,5 @@
1
- /// <reference types="react" />
2
- import { ChildrenOnly } from '../../types';
3
- export declare const SpeakingWhileMutedNotification: ({ children }: ChildrenOnly) => JSX.Element;
1
+ import { PropsWithChildren } from 'react';
2
+ export type SpeakingWhileMutedNotificationProps = {
3
+ text?: string;
4
+ };
5
+ export declare const SpeakingWhileMutedNotification: ({ children, text, }: PropsWithChildren<SpeakingWhileMutedNotificationProps>) => JSX.Element;
@@ -1,12 +1,14 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from 'react';
3
3
  import { createSoundDetector, SfuModels } from '@stream-io/video-client';
4
- import { useLocalParticipant } from '@stream-io/video-react-bindings';
4
+ import { useI18n, useLocalParticipant } from '@stream-io/video-react-bindings';
5
5
  import { useMediaDevices } from '../../core';
6
6
  import { Notification } from './Notification';
7
- export const SpeakingWhileMutedNotification = ({ children }) => {
7
+ export const SpeakingWhileMutedNotification = ({ children, text, }) => {
8
8
  const localParticipant = useLocalParticipant();
9
9
  const { getAudioStream } = useMediaDevices();
10
+ const { t } = useI18n();
11
+ const message = text !== null && text !== void 0 ? text : t('You are muted. Unmute to speak.');
10
12
  const isAudioMute = !(localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.publishedTracks.includes(SfuModels.TrackType.AUDIO));
11
13
  const audioDeviceId = localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.audioDeviceId;
12
14
  const [isSpeakingWhileMuted, setIsSpeakingWhileMuted] = useState(false);
@@ -42,6 +44,6 @@ export const SpeakingWhileMutedNotification = ({ children }) => {
42
44
  setIsSpeakingWhileMuted(false);
43
45
  };
44
46
  }, [isSpeakingWhileMuted]);
45
- return (_jsx(Notification, Object.assign({ message: "You are muted. Unmute to speak.", isVisible: isSpeakingWhileMuted }, { children: children })));
47
+ return (_jsx(Notification, Object.assign({ message: message, isVisible: isSpeakingWhileMuted }, { children: children })));
46
48
  };
47
49
  //# sourceMappingURL=SpeakingWhileMutedNotification.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SpeakingWhileMutedNotification.js","sourceRoot":"","sources":["../../../../src/components/Notification/SpeakingWhileMutedNotification.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,gB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OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,GAAG,CAAC,CAAC;YAC7D,CAAC,CAAC,CAAC;YACL,uBAAuB,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC;IAEjD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,oBAAoB;YAAE,OAAO;QAClC,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;YAC9B,uBAAuB,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC,EAAE,IAAI,CAAC,CAAC;QACT,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,uBAAuB,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC3B,OAAO,CACL,KAAC,YAAY,kBACX,OAAO,EAAC,iCAAiC,EACzC,SAAS,EAAE,oBAAoB,gBAE9B,QAAQ,IACI,CAChB,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"SpeakingWhileMutedNotification.js","sourceRoot":"","sources":["../../../../src/components/Notification/SpeakingWhileMutedNotification.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE/E,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAS9C,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,EAC7C,QAAQ,EACR,IAAI,GACmD,EAAE,EAAE;IAC3D,MAAM,gBAAgB,GAAG,mBAAmB,EAAE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,EAAE,EAAE;gBACb,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,GAAG,CAAC,CAAC;YAC7D,CAAC,CAAC,CAAC;YACL,uBAAuB,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC;IAEjD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,oBAAoB;YAAE,OAAO;QAClC,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;YAC9B,uBAAuB,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC,EAAE,IAAI,CAAC,CAAC;QACT,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,uBAAuB,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC3B,OAAO,CACL,KAAC,YAAY,kBAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,oBAAoB,gBAC5D,QAAQ,IACI,CAChB,CAAC;AACJ,CAAC,CAAC"}
package/package.json CHANGED
@@ -29,9 +29,9 @@
29
29
  "@floating-ui/react": "^0.22.0",
30
30
  "@nivo/core": "^0.80.0",
31
31
  "@nivo/line": "^0.80.0",
32
- "@stream-io/i18n": "^0.0.6",
32
+ "@stream-io/i18n": "^0.0.7",
33
33
  "@stream-io/video-client": "^0.0.28",
34
- "@stream-io/video-react-bindings": "^0.0.29",
34
+ "@stream-io/video-react-bindings": "^0.0.30",
35
35
  "clsx": "^1.2.1",
36
36
  "rxjs": "~7.8.1"
37
37
  },
@@ -50,5 +50,5 @@
50
50
  "rimraf": "^3.0.2",
51
51
  "typescript": "^4.9.5"
52
52
  },
53
- "version": "0.0.58"
53
+ "version": "0.0.59"
54
54
  }
@@ -1,15 +1,26 @@
1
- import { useEffect, useState } from 'react';
1
+ import { PropsWithChildren, useEffect, useState } from 'react';
2
2
  import { createSoundDetector, SfuModels } from '@stream-io/video-client';
3
- import { useLocalParticipant } from '@stream-io/video-react-bindings';
3
+ import { useI18n, useLocalParticipant } from '@stream-io/video-react-bindings';
4
4
 
5
5
  import { useMediaDevices } from '../../core';
6
6
  import { Notification } from './Notification';
7
- import { ChildrenOnly } from '../../types';
8
7
 
9
- export const SpeakingWhileMutedNotification = ({ children }: ChildrenOnly) => {
8
+ export type SpeakingWhileMutedNotificationProps = {
9
+ /*
10
+ Text message displayed by the notification.
11
+ */
12
+ text?: string;
13
+ };
14
+
15
+ export const SpeakingWhileMutedNotification = ({
16
+ children,
17
+ text,
18
+ }: PropsWithChildren<SpeakingWhileMutedNotificationProps>) => {
10
19
  const localParticipant = useLocalParticipant();
11
20
  const { getAudioStream } = useMediaDevices();
21
+ const { t } = useI18n();
12
22
 
23
+ const message = text ?? t('You are muted. Unmute to speak.');
13
24
  const isAudioMute = !localParticipant?.publishedTracks.includes(
14
25
  SfuModels.TrackType.AUDIO,
15
26
  );
@@ -51,10 +62,7 @@ export const SpeakingWhileMutedNotification = ({ children }: ChildrenOnly) => {
51
62
  };
52
63
  }, [isSpeakingWhileMuted]);
53
64
  return (
54
- <Notification
55
- message="You are muted. Unmute to speak."
56
- isVisible={isSpeakingWhileMuted}
57
- >
65
+ <Notification message={message} isVisible={isSpeakingWhileMuted}>
58
66
  {children}
59
67
  </Notification>
60
68
  );