@100mslive/roomkit-react 0.3.12-alpha.6 → 0.3.12-alpha.7
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/{HLSView-KCRIRMQE.css → HLSView-5NGWLWHH.css} +3 -3
- package/dist/{HLSView-KCRIRMQE.css.map → HLSView-5NGWLWHH.css.map} +1 -1
- package/dist/{HLSView-K5XFYK3X.js → HLSView-Z6DOGESA.js} +2 -2
- package/dist/Prebuilt/common/constants.d.ts +1 -0
- package/dist/{chunk-FQVXDJIG.js → chunk-KBVFTNP3.js} +128 -88
- package/dist/chunk-KBVFTNP3.js.map +7 -0
- package/dist/index.cjs.css +2 -2
- package/dist/index.cjs.css.map +1 -1
- package/dist/index.cjs.js +90 -49
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/index.js +1 -1
- package/dist/meta.cjs.json +46 -31
- package/dist/meta.esbuild.json +58 -43
- package/package.json +8 -8
- package/src/Prebuilt/common/constants.ts +1 -0
- package/src/Prebuilt/components/AppData/AppData.tsx +9 -1
- package/src/Prebuilt/components/AppData/useUISettings.js +10 -0
- package/src/Prebuilt/components/AudioVideoToggle.tsx +27 -8
- package/src/Prebuilt/components/MoreSettings/CaptionContent.tsx +6 -6
- package/src/Prebuilt/components/Notifications/Notifications.tsx +1 -1
- package/src/Prebuilt/components/Notifications/TranscriptionNotifications.tsx +2 -2
- package/src/Prebuilt/components/Polls/Voting/Voting.tsx +6 -4
- package/src/Prebuilt/components/Streaming/Common.jsx +5 -4
- package/src/Prebuilt/plugins/CaptionsViewer.tsx +32 -26
- package/dist/chunk-FQVXDJIG.js.map +0 -7
- /package/dist/{HLSView-K5XFYK3X.js.map → HLSView-Z6DOGESA.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
selectLocalPeer,
|
|
4
4
|
selectPeerNameByID,
|
|
5
5
|
selectPermissions,
|
|
6
6
|
selectPollByID,
|
|
@@ -31,7 +31,9 @@ export const Voting = ({ id, toggleVoting }: { id: string; toggleVoting: () => v
|
|
|
31
31
|
const showSingleView = poll?.type === 'quiz' && poll.state === 'started';
|
|
32
32
|
const fetchedInitialResponses = useRef(false);
|
|
33
33
|
const [savedResponses, setSavedResponses] = useState<Record<any, any>>({});
|
|
34
|
-
const
|
|
34
|
+
const localPeer = useHMSStore(selectLocalPeer);
|
|
35
|
+
const localPeerId = localPeer?.id;
|
|
36
|
+
const customerUserId = localPeer?.customerUserId;
|
|
35
37
|
|
|
36
38
|
// To reset whenever a different poll is opened
|
|
37
39
|
useEffect(() => {
|
|
@@ -51,7 +53,7 @@ export const Voting = ({ id, toggleVoting }: { id: string; toggleVoting: () => v
|
|
|
51
53
|
|
|
52
54
|
useEffect(() => {
|
|
53
55
|
if (poll?.questions) {
|
|
54
|
-
const localPeerResponses = getPeerResponses(poll.questions, localPeerId);
|
|
56
|
+
const localPeerResponses = getPeerResponses(poll.questions, localPeerId, customerUserId);
|
|
55
57
|
// @ts-ignore
|
|
56
58
|
localPeerResponses?.forEach(response => {
|
|
57
59
|
if (response) {
|
|
@@ -63,7 +65,7 @@ export const Voting = ({ id, toggleVoting }: { id: string; toggleVoting: () => v
|
|
|
63
65
|
}
|
|
64
66
|
});
|
|
65
67
|
}
|
|
66
|
-
}, [localPeerId, poll?.questions, id]);
|
|
68
|
+
}, [localPeerId, poll?.questions, id, customerUserId]);
|
|
67
69
|
|
|
68
70
|
if (!poll) {
|
|
69
71
|
return null;
|
|
@@ -43,18 +43,19 @@ export const ContentHeader = ({ onBack, onClose, title = '', content }) => {
|
|
|
43
43
|
css={{ w: '100%', py: '$8', px: '$10', cursor: 'pointer', borderBottom: '1px solid $border_bright', mb: '$8' }}
|
|
44
44
|
>
|
|
45
45
|
{onBack ? (
|
|
46
|
-
<
|
|
46
|
+
<Flex
|
|
47
|
+
align="center"
|
|
47
48
|
css={{
|
|
48
|
-
alignSelf: 'center',
|
|
49
49
|
mr: '$8',
|
|
50
|
+
color: '$on_surface_high',
|
|
50
51
|
}}
|
|
51
52
|
onClick={onBack}
|
|
52
53
|
data-testid="go_back"
|
|
53
54
|
>
|
|
54
55
|
<ChevronLeftIcon />
|
|
55
|
-
</
|
|
56
|
+
</Flex>
|
|
56
57
|
) : null}
|
|
57
|
-
<Box css={{ flex: '1 1 0' }}>
|
|
58
|
+
<Box css={{ flex: '1 1 0', display: 'flex', alignItems: 'center' }}>
|
|
58
59
|
{title ? (
|
|
59
60
|
<Text
|
|
60
61
|
variant="tiny"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import Draggable from 'react-draggable';
|
|
2
3
|
import { useMedia } from 'react-use';
|
|
3
4
|
import {
|
|
4
5
|
HMSTranscript,
|
|
@@ -178,6 +179,8 @@ export const CaptionsViewer = () => {
|
|
|
178
179
|
|
|
179
180
|
const isTranscriptionEnabled = useHMSStore(selectIsTranscriptionEnabled);
|
|
180
181
|
|
|
182
|
+
const nodeRef = useRef<HTMLDivElement>(null);
|
|
183
|
+
|
|
181
184
|
useEffect(() => {
|
|
182
185
|
const timeInterval = setInterval(() => {
|
|
183
186
|
if (!captionQueue) {
|
|
@@ -205,30 +208,33 @@ export const CaptionsViewer = () => {
|
|
|
205
208
|
return null;
|
|
206
209
|
}
|
|
207
210
|
return (
|
|
208
|
-
<
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
211
|
+
<Draggable bounds="parent" nodeRef={nodeRef} defaultPosition={{ x: isMobile ? 0 : -200, y: 0 }}>
|
|
212
|
+
<Box
|
|
213
|
+
ref={nodeRef}
|
|
214
|
+
css={{
|
|
215
|
+
position: 'absolute',
|
|
216
|
+
w: isMobile ? '100%' : '40%',
|
|
217
|
+
bottom: showCaptionAtTop ? '' : '0',
|
|
218
|
+
top: showCaptionAtTop ? '0' : '',
|
|
219
|
+
left: isMobile ? 0 : '50%',
|
|
220
|
+
transform: isMobile ? '' : 'translateX(-50%)',
|
|
221
|
+
background: '#000000A3',
|
|
222
|
+
overflow: 'clip',
|
|
223
|
+
zIndex: 10,
|
|
224
|
+
height: 'fit-content',
|
|
225
|
+
r: '$1',
|
|
226
|
+
p: '$6',
|
|
227
|
+
transition: 'bottom 0.3s ease-in-out',
|
|
228
|
+
'&:empty': { display: 'none' },
|
|
229
|
+
}}
|
|
230
|
+
>
|
|
231
|
+
<Flex direction="column">
|
|
232
|
+
{dataToShow.map((data: { [key: string]: string }, index: number) => {
|
|
233
|
+
const key = Object.keys(data)[0];
|
|
234
|
+
return <TranscriptView key={index} peer_id={key} data={data[key]} />;
|
|
235
|
+
})}
|
|
236
|
+
</Flex>
|
|
237
|
+
</Box>
|
|
238
|
+
</Draggable>
|
|
233
239
|
);
|
|
234
240
|
};
|