@100mslive/roomkit-react 0.1.20-alpha.1 → 0.2.0
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/README.md +27 -2
- package/dist/{HLSView-PJLISGG4.js → HLSView-ULB4DC6B.js} +2 -2
- package/dist/Input/Input.d.ts +3 -3
- package/dist/Prebuilt/components/Chat/ChatActions.d.ts +2 -1
- package/dist/Prebuilt/components/Polls/CreateQuestions/DeleteQuestionModal.d.ts +6 -0
- package/dist/Prebuilt/components/Polls/CreateQuestions/QuestionForm.d.ts +22 -0
- package/dist/Prebuilt/components/Polls/CreateQuestions/SavedQuestion.d.ts +11 -0
- package/dist/Prebuilt/components/Polls/Voting/StandardVoting.d.ts +5 -0
- package/dist/Prebuilt/components/Polls/Voting/TimedVoting.d.ts +5 -0
- package/dist/Prebuilt/components/Polls/Voting/Voting.d.ts +5 -0
- package/dist/Prebuilt/components/Polls/common/Line.d.ts +2 -0
- package/dist/Prebuilt/components/Polls/common/OptionInputWithDelete.d.ts +8 -0
- package/dist/Prebuilt/components/Polls/common/StatusIndicator.d.ts +4 -0
- package/dist/Prebuilt/components/Polls/common/VoteCount.d.ts +4 -0
- package/dist/Prebuilt/components/Polls/common/VoteProgress.d.ts +6 -0
- package/dist/Prebuilt/components/Polls/common/VoterList.d.ts +4 -0
- package/dist/Prebuilt/components/TileMenu/utils.d.ts +5 -0
- package/dist/Prebuilt/components/hooks/usePinnedBy.d.ts +1 -0
- package/dist/Prebuilt/components/hooks/{useSetPinnedMessages.d.ts → usePinnedMessages.d.ts} +6 -1
- package/dist/TextArea/TextArea.d.ts +441 -0
- package/dist/TextArea/index.d.ts +1 -0
- package/dist/Toast/Toast.d.ts +1 -1
- package/dist/{chunk-QENB2CO7.js → chunk-GVA4I77Z.js} +2803 -2743
- package/dist/chunk-GVA4I77Z.js.map +7 -0
- package/dist/index.cjs.js +3038 -2969
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/meta.cjs.json +475 -388
- package/dist/meta.esbuild.json +485 -396
- package/package.json +7 -8
- package/src/Button/Button.tsx +4 -4
- package/src/Input/Input.tsx +1 -1
- package/src/Prebuilt/App.tsx +2 -0
- package/src/Prebuilt/components/Chat/ChatActions.tsx +25 -8
- package/src/Prebuilt/components/Chat/ChatBody.tsx +64 -21
- package/src/Prebuilt/components/Chat/ChatFooter.tsx +1 -0
- package/src/Prebuilt/components/Chat/PinnedMessage.tsx +2 -2
- package/src/Prebuilt/components/Header/AdditionalRoomState.jsx +1 -38
- package/src/Prebuilt/components/Header/StreamActions.tsx +1 -1
- package/src/Prebuilt/components/Polls/CreatePollQuiz/PollsQuizMenu.jsx +11 -1
- package/src/Prebuilt/components/Polls/CreateQuestions/{DeleteQuestionModal.jsx → DeleteQuestionModal.tsx} +9 -1
- package/src/Prebuilt/components/Polls/CreateQuestions/{QuestionForm.jsx → QuestionForm.tsx} +71 -30
- package/src/Prebuilt/components/Polls/CreateQuestions/{SavedQuestion.jsx → SavedQuestion.tsx} +24 -15
- package/src/Prebuilt/components/Polls/Voting/LeaderboardSummary.tsx +1 -1
- package/src/Prebuilt/components/Polls/Voting/QuestionCard.jsx +61 -80
- package/src/Prebuilt/components/Polls/Voting/{StandardVoting.jsx → StandardVoting.tsx} +3 -7
- package/src/Prebuilt/components/Polls/Voting/{TimedVoting.jsx → TimedVoting.tsx} +4 -7
- package/src/Prebuilt/components/Polls/Voting/{Voting.jsx → Voting.tsx} +4 -3
- package/src/Prebuilt/components/Polls/common/Line.tsx +4 -0
- package/src/Prebuilt/components/Polls/common/{OptionInputWithDelete.jsx → OptionInputWithDelete.tsx} +14 -2
- package/src/Prebuilt/components/Polls/common/SingleChoiceOptions.jsx +1 -1
- package/src/Prebuilt/components/Polls/common/{StatusIndicator.jsx → StatusIndicator.tsx} +1 -2
- package/src/Prebuilt/components/Polls/common/{VoteCount.jsx → VoteCount.tsx} +1 -2
- package/src/Prebuilt/components/Polls/common/{VoteProgress.jsx → VoteProgress.tsx} +3 -2
- package/src/Prebuilt/components/Polls/common/{VoterList.jsx → VoterList.tsx} +1 -1
- package/src/Prebuilt/components/TileMenu/TileMenu.jsx +3 -1
- package/src/Prebuilt/components/TileMenu/TileMenuContent.tsx +15 -3
- package/src/Prebuilt/components/TileMenu/utils.ts +7 -0
- package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +7 -3
- package/src/Prebuilt/components/VideoTile.jsx +2 -4
- package/src/Prebuilt/components/hooks/usePinnedBy.tsx +22 -0
- package/src/Prebuilt/components/hooks/{useSetPinnedMessages.ts → usePinnedMessages.ts} +2 -2
- package/src/Prebuilt/components/hooks/useUnreadPollQuizPresent.tsx +1 -4
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +0 -1
- package/src/TextArea/TextArea.tsx +30 -0
- package/src/TextArea/index.tsx +1 -0
- package/src/index.ts +1 -0
- package/src/store/StorybookSDK.ts +3 -1
- package/dist/Prebuilt/plugins/whiteboard/ToggleWhiteboard.d.ts +0 -5
- package/dist/chunk-QENB2CO7.js.map +0 -7
- package/src/Prebuilt/components/Polls/common/Votes.jsx +0 -72
- package/src/Prebuilt/layouts/WhiteboardView.jsx +0 -40
- package/src/Prebuilt/plugins/whiteboard/PusherCommunicationProvider.js +0 -110
- package/src/Prebuilt/plugins/whiteboard/README.md +0 -29
- package/src/Prebuilt/plugins/whiteboard/ToggleWhiteboard.tsx +0 -37
- package/src/Prebuilt/plugins/whiteboard/Whiteboard.css +0 -12
- package/src/Prebuilt/plugins/whiteboard/Whiteboard.jsx +0 -11
- package/src/Prebuilt/plugins/whiteboard/WhiteboardEvents.js +0 -8
- package/src/Prebuilt/plugins/whiteboard/index.js +0 -3
- package/src/Prebuilt/plugins/whiteboard/useMultiplayerState.js +0 -212
- package/src/Prebuilt/plugins/whiteboard/useWhiteboardMetadata.js +0 -47
- /package/dist/{HLSView-PJLISGG4.js.map → HLSView-ULB4DC6B.js.map} +0 -0
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"prebuilt",
|
|
11
11
|
"roomkit"
|
|
12
12
|
],
|
|
13
|
-
"version": "0.
|
|
13
|
+
"version": "0.2.0",
|
|
14
14
|
"author": "100ms",
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"files": [
|
|
@@ -76,10 +76,10 @@
|
|
|
76
76
|
"react": ">=17.0.2 <19.0.0"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@100mslive/hls-player": "0.
|
|
80
|
-
"@100mslive/hms-virtual-background": "1.
|
|
81
|
-
"@100mslive/react-icons": "0.
|
|
82
|
-
"@100mslive/react-sdk": "0.
|
|
79
|
+
"@100mslive/hls-player": "0.2.0",
|
|
80
|
+
"@100mslive/hms-virtual-background": "1.12.0",
|
|
81
|
+
"@100mslive/react-icons": "0.9.0",
|
|
82
|
+
"@100mslive/react-sdk": "0.9.0",
|
|
83
83
|
"@100mslive/types-prebuilt": "0.12.5",
|
|
84
84
|
"@emoji-mart/data": "^1.0.6",
|
|
85
85
|
"@emoji-mart/react": "^1.0.1",
|
|
@@ -100,9 +100,8 @@
|
|
|
100
100
|
"@radix-ui/react-tooltip": "1.0.6",
|
|
101
101
|
"@stitches/react": "^1.2.8",
|
|
102
102
|
"emoji-mart": "^5.2.2",
|
|
103
|
-
"eventemitter2": "^6.4.
|
|
103
|
+
"eventemitter2": "^6.4.9",
|
|
104
104
|
"lodash.merge": "^4.6.2",
|
|
105
|
-
"pusher-js": "^7.0.3",
|
|
106
105
|
"qrcode.react": "^3.1.0",
|
|
107
106
|
"react-draggable": "^4.4.5",
|
|
108
107
|
"react-intersection-observer": "^9.4.3",
|
|
@@ -115,5 +114,5 @@
|
|
|
115
114
|
"uuid": "^8.3.2",
|
|
116
115
|
"worker-timers": "^7.0.40"
|
|
117
116
|
},
|
|
118
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "4141fa5d88b73328867609b0ceaa5a5ac67135d0"
|
|
119
118
|
}
|
package/src/Button/Button.tsx
CHANGED
|
@@ -139,10 +139,10 @@ const StyledButton = styled('button', {
|
|
|
139
139
|
variants: {
|
|
140
140
|
variant: {
|
|
141
141
|
standard: getButtonVariants(
|
|
142
|
-
'$
|
|
143
|
-
'$
|
|
144
|
-
'$
|
|
145
|
-
'$
|
|
142
|
+
'$secondary_default',
|
|
143
|
+
'$secondary_bright',
|
|
144
|
+
'$secondary_dim',
|
|
145
|
+
'$secondary_disabled',
|
|
146
146
|
'$on_surface_high',
|
|
147
147
|
'$on_surface_low',
|
|
148
148
|
),
|
package/src/Input/Input.tsx
CHANGED
package/src/Prebuilt/App.tsx
CHANGED
|
@@ -25,6 +25,7 @@ import { Notifications } from './components/Notifications';
|
|
|
25
25
|
import { PreviewScreen } from './components/Preview/PreviewScreen';
|
|
26
26
|
// @ts-ignore: No implicit Any
|
|
27
27
|
import { ToastContainer } from './components/Toast/ToastContainer';
|
|
28
|
+
import { VBHandler } from './components/VirtualBackground/VBHandler';
|
|
28
29
|
import { RoomLayoutContext, RoomLayoutProvider, useRoomLayout } from './provider/roomLayoutProvider';
|
|
29
30
|
import { DialogContainerProvider } from '../context/DialogContext';
|
|
30
31
|
import { Box } from '../Layout';
|
|
@@ -124,6 +125,7 @@ export const HMSPrebuilt = React.forwardRef<HMSPrebuiltRefType, HMSPrebuiltProps
|
|
|
124
125
|
// leave room when component unmounts
|
|
125
126
|
useEffect(
|
|
126
127
|
() => () => {
|
|
128
|
+
VBHandler.reset();
|
|
127
129
|
reactiveStore?.current?.hmsActions.leave();
|
|
128
130
|
},
|
|
129
131
|
[],
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
EyeCloseIcon,
|
|
8
8
|
PeopleRemoveIcon,
|
|
9
9
|
PinIcon,
|
|
10
|
+
ReplyGroupIcon,
|
|
10
11
|
ReplyIcon,
|
|
11
12
|
VerticalMenuIcon,
|
|
12
13
|
} from '@100mslive/react-icons';
|
|
@@ -21,7 +22,7 @@ import { ToastManager } from '../Toast/ToastManager';
|
|
|
21
22
|
import { MwebChatOption } from './MwebChatOption';
|
|
22
23
|
import { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
|
23
24
|
import { useChatBlacklist, useIsPeerBlacklisted } from '../hooks/useChatBlacklist';
|
|
24
|
-
import {
|
|
25
|
+
import { usePinnedMessages } from '../hooks/usePinnedMessages';
|
|
25
26
|
import { SESSION_STORE_KEY } from '../../common/constants';
|
|
26
27
|
|
|
27
28
|
const iconStyle = { height: '1.125rem', width: '1.125rem' };
|
|
@@ -36,6 +37,7 @@ const tooltipBoxCSS = {
|
|
|
36
37
|
export const ChatActions = ({
|
|
37
38
|
showPinAction,
|
|
38
39
|
onReply,
|
|
40
|
+
onReplyGroup,
|
|
39
41
|
showReply,
|
|
40
42
|
message,
|
|
41
43
|
sentByLocalPeer,
|
|
@@ -45,6 +47,7 @@ export const ChatActions = ({
|
|
|
45
47
|
}: {
|
|
46
48
|
showPinAction: boolean;
|
|
47
49
|
onReply: () => void;
|
|
50
|
+
onReplyGroup: () => void;
|
|
48
51
|
showReply: boolean;
|
|
49
52
|
message: HMSMessage;
|
|
50
53
|
sentByLocalPeer: boolean;
|
|
@@ -53,16 +56,15 @@ export const ChatActions = ({
|
|
|
53
56
|
setOpenSheet: (value: boolean) => void;
|
|
54
57
|
}) => {
|
|
55
58
|
const { elements } = useRoomLayoutConferencingScreen();
|
|
56
|
-
const { can_hide_message, can_block_user } = elements?.chat?.real_time_controls || {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
};
|
|
59
|
+
const { can_hide_message = false, can_block_user = false } = elements?.chat?.real_time_controls || {};
|
|
60
|
+
const { roles_whitelist = [] } = elements?.chat || {};
|
|
61
|
+
|
|
60
62
|
const [open, setOpen] = useState(false);
|
|
61
63
|
const actions = useHMSActions();
|
|
62
64
|
const canRemoveOthers = useHMSStore(selectPermissions)?.removeOthers;
|
|
63
65
|
const { blacklistItem: blacklistPeer } = useChatBlacklist(SESSION_STORE_KEY.CHAT_PEER_BLACKLIST);
|
|
64
66
|
const localPeerName = useHMSStore(selectLocalPeerName);
|
|
65
|
-
const { setPinnedMessages, unpinBlacklistedMessages } =
|
|
67
|
+
const { setPinnedMessages, unpinBlacklistedMessages } = usePinnedMessages();
|
|
66
68
|
|
|
67
69
|
const { blacklistItem: blacklistMessage, blacklistedIDs: blacklistedMessageIDs } = useChatBlacklist(
|
|
68
70
|
SESSION_STORE_KEY.CHAT_MESSAGE_BLACKLIST,
|
|
@@ -104,12 +106,19 @@ export const ChatActions = ({
|
|
|
104
106
|
}
|
|
105
107
|
> = {
|
|
106
108
|
reply: {
|
|
107
|
-
text:
|
|
108
|
-
tooltipText:
|
|
109
|
+
text: 'Reply privately',
|
|
110
|
+
tooltipText: 'Reply privately',
|
|
109
111
|
icon: <ReplyIcon style={iconStyle} />,
|
|
110
112
|
onClick: onReply,
|
|
111
113
|
show: showReply,
|
|
112
114
|
},
|
|
115
|
+
replyGroup: {
|
|
116
|
+
text: 'Reply to group',
|
|
117
|
+
tooltipText: 'Reply to group',
|
|
118
|
+
icon: <ReplyGroupIcon style={iconStyle} />,
|
|
119
|
+
onClick: onReplyGroup,
|
|
120
|
+
show: !!message.senderRole && roles_whitelist.includes(message.senderRole),
|
|
121
|
+
},
|
|
113
122
|
pin: {
|
|
114
123
|
text: 'Pin message',
|
|
115
124
|
tooltipText: 'Pin',
|
|
@@ -213,6 +222,7 @@ export const ChatActions = ({
|
|
|
213
222
|
p: '$2',
|
|
214
223
|
opacity: open ? 1 : 0,
|
|
215
224
|
position: 'absolute',
|
|
225
|
+
top: 0,
|
|
216
226
|
right: 0,
|
|
217
227
|
zIndex: 1,
|
|
218
228
|
'@md': { opacity: 1 },
|
|
@@ -225,6 +235,13 @@ export const ChatActions = ({
|
|
|
225
235
|
</IconButton>
|
|
226
236
|
</Tooltip>
|
|
227
237
|
) : null}
|
|
238
|
+
{options.replyGroup.show ? (
|
|
239
|
+
<Tooltip boxCss={tooltipBoxCSS} title={options.replyGroup.tooltipText}>
|
|
240
|
+
<IconButton data-testid="reply_group_message_btn" onClick={options.replyGroup.onClick}>
|
|
241
|
+
{options.replyGroup.icon}
|
|
242
|
+
</IconButton>
|
|
243
|
+
</Tooltip>
|
|
244
|
+
) : null}
|
|
228
245
|
{options.pin.show ? (
|
|
229
246
|
<Tooltip boxCss={tooltipBoxCSS} title={options.pin.tooltipText}>
|
|
230
247
|
<IconButton data-testid="pin_message_btn" onClick={options.pin.onClick}>
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
HMSRoleName,
|
|
9
9
|
selectHMSMessages,
|
|
10
10
|
selectLocalPeerID,
|
|
11
|
+
selectLocalPeerName,
|
|
11
12
|
selectLocalPeerRoleName,
|
|
12
13
|
selectPeerNameByID,
|
|
13
14
|
selectSessionStore,
|
|
@@ -16,6 +17,7 @@ import {
|
|
|
16
17
|
useHMSStore,
|
|
17
18
|
useHMSVanillaStore,
|
|
18
19
|
} from '@100mslive/react-sdk';
|
|
20
|
+
import { SolidPinIcon } from '@100mslive/react-icons';
|
|
19
21
|
import { Box, Flex } from '../../../Layout';
|
|
20
22
|
import { Text } from '../../../Text';
|
|
21
23
|
import { config as cssConfig, styled } from '../../../Theme';
|
|
@@ -25,6 +27,7 @@ import { EmptyChat } from './EmptyChat';
|
|
|
25
27
|
import { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
|
26
28
|
// @ts-ignore: No implicit Any
|
|
27
29
|
import { useSetSubscribedChatSelector } from '../AppData/useUISettings';
|
|
30
|
+
import { usePinnedBy } from '../hooks/usePinnedBy';
|
|
28
31
|
import { CHAT_SELECTOR, SESSION_STORE_KEY } from '../../common/constants';
|
|
29
32
|
|
|
30
33
|
const formatTime = (date: Date) => {
|
|
@@ -45,13 +48,25 @@ function getRowHeight(index: number) {
|
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
const setRowHeight = (index: number, id: string, size: number) => {
|
|
48
|
-
if (rowHeights[index]?.id === id && rowHeights[index]?.size) {
|
|
51
|
+
if (rowHeights[index]?.id === id && rowHeights[index]?.size === size) {
|
|
49
52
|
return;
|
|
50
53
|
}
|
|
51
54
|
listInstance?.resetAfterIndex(Math.max(index - 1, 0));
|
|
52
55
|
Object.assign(rowHeights, { [index]: { size, id } });
|
|
53
56
|
};
|
|
54
57
|
|
|
58
|
+
const getMessageBackgroundColor = (
|
|
59
|
+
messageType: string,
|
|
60
|
+
selectedPeerID: string,
|
|
61
|
+
selectedRole: string,
|
|
62
|
+
isOverlay: boolean,
|
|
63
|
+
) => {
|
|
64
|
+
if (messageType && !(selectedPeerID || selectedRole)) {
|
|
65
|
+
return isOverlay ? 'rgba(0, 0, 0, 0.64)' : '$surface_default';
|
|
66
|
+
}
|
|
67
|
+
return '';
|
|
68
|
+
};
|
|
69
|
+
|
|
55
70
|
const MessageTypeContainer = ({ left, right }: { left?: string; right?: string }) => {
|
|
56
71
|
return (
|
|
57
72
|
<Flex
|
|
@@ -166,7 +181,6 @@ const ChatMessage = React.memo(
|
|
|
166
181
|
const rowRef = useRef<HTMLDivElement | null>(null);
|
|
167
182
|
const isMobile = useMedia(cssConfig.media.md);
|
|
168
183
|
const isPrivateChatEnabled = !!elements?.chat?.private_chat_enabled;
|
|
169
|
-
const roleWhiteList = elements?.chat?.roles_whitelist || [];
|
|
170
184
|
const isOverlay = elements?.chat?.is_overlay && isMobile;
|
|
171
185
|
const localPeerId = useHMSStore(selectLocalPeerID);
|
|
172
186
|
const [selectedRole, setRoleSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.ROLE);
|
|
@@ -177,13 +191,7 @@ const ChatMessage = React.memo(
|
|
|
177
191
|
});
|
|
178
192
|
const [openSheet, setOpenSheet] = useState(false);
|
|
179
193
|
const showPinAction = !!elements?.chat?.allow_pinning_messages;
|
|
180
|
-
|
|
181
|
-
if (message.recipientRoles && roleWhiteList.includes(message.recipientRoles[0])) {
|
|
182
|
-
showReply = true;
|
|
183
|
-
} else if (message.sender !== selectedPeer.id && message.sender !== localPeerId && isPrivateChatEnabled) {
|
|
184
|
-
showReply = true;
|
|
185
|
-
}
|
|
186
|
-
|
|
194
|
+
const showReply = message.sender !== selectedPeer.id && message.sender !== localPeerId && isPrivateChatEnabled;
|
|
187
195
|
useLayoutEffect(() => {
|
|
188
196
|
if (rowRef.current) {
|
|
189
197
|
setRowHeight(index, message.id, rowRef.current.clientHeight);
|
|
@@ -208,12 +216,7 @@ const ChatMessage = React.memo(
|
|
|
208
216
|
flexWrap: 'wrap',
|
|
209
217
|
position: 'relative',
|
|
210
218
|
// Theme independent color, token should not be used for transparent chat
|
|
211
|
-
|
|
212
|
-
messageType && !(selectedPeer.id || selectedRole)
|
|
213
|
-
? isOverlay
|
|
214
|
-
? 'rgba(0, 0, 0, 0.64)'
|
|
215
|
-
: '$surface_default'
|
|
216
|
-
: undefined,
|
|
219
|
+
background: getMessageBackgroundColor(messageType, selectedPeer.id, selectedRole, !!isOverlay),
|
|
217
220
|
r: '$1',
|
|
218
221
|
p: '$4',
|
|
219
222
|
userSelect: 'none',
|
|
@@ -231,6 +234,7 @@ const ChatMessage = React.memo(
|
|
|
231
234
|
}
|
|
232
235
|
}}
|
|
233
236
|
>
|
|
237
|
+
<PinnedBy messageId={message.id} index={index} rowRef={rowRef} />
|
|
234
238
|
<Text
|
|
235
239
|
css={{
|
|
236
240
|
color: isOverlay ? '#FFF' : '$on_surface_high',
|
|
@@ -258,7 +262,7 @@ const ChatMessage = React.memo(
|
|
|
258
262
|
variant="sub2"
|
|
259
263
|
css={{ color: isOverlay ? '#FFF' : '$on_surface_high', fontWeight: '$semiBold' }}
|
|
260
264
|
>
|
|
261
|
-
{message.senderName}
|
|
265
|
+
{message.sender === localPeerId ? `${message.senderName} (You)` : message.senderName}
|
|
262
266
|
</SenderName>
|
|
263
267
|
</Tooltip>
|
|
264
268
|
)}
|
|
@@ -291,12 +295,13 @@ const ChatMessage = React.memo(
|
|
|
291
295
|
message={message}
|
|
292
296
|
sentByLocalPeer={message.sender === localPeerId}
|
|
293
297
|
onReply={() => {
|
|
294
|
-
|
|
295
|
-
|
|
298
|
+
setRoleSelector('');
|
|
299
|
+
setPeerSelector({ id: message.sender, name: message.senderName });
|
|
300
|
+
}}
|
|
301
|
+
onReplyGroup={() => {
|
|
302
|
+
if (message.senderRole) {
|
|
303
|
+
setRoleSelector(message.senderRole);
|
|
296
304
|
setPeerSelector({});
|
|
297
|
-
} else {
|
|
298
|
-
setRoleSelector('');
|
|
299
|
-
setPeerSelector({ id: message.sender, name: message.senderName });
|
|
300
305
|
}
|
|
301
306
|
}}
|
|
302
307
|
showReply={showReply}
|
|
@@ -424,3 +429,41 @@ export const ChatBody = React.forwardRef<VariableSizeList, { scrollToBottom: (co
|
|
|
424
429
|
return <VirtualizedChatMessages messages={filteredMessages} ref={listRef} scrollToBottom={scrollToBottom} />;
|
|
425
430
|
},
|
|
426
431
|
);
|
|
432
|
+
|
|
433
|
+
const PinnedBy = ({
|
|
434
|
+
messageId,
|
|
435
|
+
index,
|
|
436
|
+
rowRef,
|
|
437
|
+
}: {
|
|
438
|
+
messageId: string;
|
|
439
|
+
index: number;
|
|
440
|
+
rowRef?: React.MutableRefObject<HTMLDivElement | null>;
|
|
441
|
+
}) => {
|
|
442
|
+
const pinnedBy = usePinnedBy(messageId);
|
|
443
|
+
const localPeerName = useHMSStore(selectLocalPeerName);
|
|
444
|
+
|
|
445
|
+
useLayoutEffect(() => {
|
|
446
|
+
if (rowRef?.current) {
|
|
447
|
+
if (pinnedBy) {
|
|
448
|
+
rowRef.current.style.background =
|
|
449
|
+
'linear-gradient(277deg, var(--hms-ui-colors-surface_default) 0%, var(--hms-ui-colors-surface_dim) 60.87%)';
|
|
450
|
+
} else {
|
|
451
|
+
rowRef.current.style.background = '';
|
|
452
|
+
}
|
|
453
|
+
setRowHeight(index, messageId, rowRef?.current.clientHeight);
|
|
454
|
+
}
|
|
455
|
+
}, [index, messageId, pinnedBy, rowRef]);
|
|
456
|
+
|
|
457
|
+
if (!pinnedBy) {
|
|
458
|
+
return null;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
return (
|
|
462
|
+
<Flex align="center" css={{ gap: '$2', mb: '$2', color: '$on_surface_low' }}>
|
|
463
|
+
<SolidPinIcon height={12} width={12} />
|
|
464
|
+
<Text variant="xs" css={{ color: 'inherit' }}>
|
|
465
|
+
Pinned by {localPeerName === pinnedBy ? 'you' : pinnedBy}
|
|
466
|
+
</Text>
|
|
467
|
+
</Flex>
|
|
468
|
+
);
|
|
469
|
+
};
|
|
@@ -214,6 +214,7 @@ export const ChatFooter = ({ onSend, children }: { onSend: (count: number) => vo
|
|
|
214
214
|
'&:valid ~ .send-msg': { color: '$on_surface_high' },
|
|
215
215
|
'& ~ .send-msg': { color: '$on_surface_low' },
|
|
216
216
|
'&::placeholder': { color: '$on_surface_medium' },
|
|
217
|
+
border: 'none',
|
|
217
218
|
}}
|
|
218
219
|
placeholder={message_placeholder}
|
|
219
220
|
ref={inputRef}
|
|
@@ -11,7 +11,7 @@ import { ArrowNavigation } from './ArrowNavigation';
|
|
|
11
11
|
import { AnnotisedMessage } from './ChatBody';
|
|
12
12
|
import { StickIndicator } from './StickIndicator';
|
|
13
13
|
import { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
|
14
|
-
import {
|
|
14
|
+
import { usePinnedMessages } from '../hooks/usePinnedMessages';
|
|
15
15
|
import { SESSION_STORE_KEY } from '../../common/constants';
|
|
16
16
|
|
|
17
17
|
const PINNED_MESSAGE_LENGTH = 75;
|
|
@@ -19,7 +19,7 @@ const PINNED_MESSAGE_LENGTH = 75;
|
|
|
19
19
|
export const PinnedMessage = () => {
|
|
20
20
|
const pinnedMessages = useHMSStore(selectSessionStore(SESSION_STORE_KEY.PINNED_MESSAGES));
|
|
21
21
|
const [pinnedMessageIndex, setPinnedMessageIndex] = useState(0);
|
|
22
|
-
const { removePinnedMessage } =
|
|
22
|
+
const { removePinnedMessage } = usePinnedMessages();
|
|
23
23
|
const isMobile = useMedia(cssConfig.media.md);
|
|
24
24
|
|
|
25
25
|
const { elements } = useRoomLayoutConferencingScreen();
|
|
@@ -5,12 +5,10 @@ import {
|
|
|
5
5
|
ChevronDownIcon,
|
|
6
6
|
ChevronUpIcon,
|
|
7
7
|
MusicIcon,
|
|
8
|
-
PencilDrawIcon,
|
|
9
8
|
ShareScreenIcon,
|
|
10
9
|
VideoPlayerIcon,
|
|
11
10
|
} from '@100mslive/react-icons';
|
|
12
11
|
import { Box, Dropdown, Flex, Text, Tooltip } from '../../../';
|
|
13
|
-
import { useWhiteboardMetadata } from '../../plugins/whiteboard/useWhiteboardMetadata';
|
|
14
12
|
import { useUISettings } from '../AppData/useUISettings';
|
|
15
13
|
import { usePlaylistMusic } from '../hooks/usePlaylistMusic';
|
|
16
14
|
import { useScreenshareAudio } from '../hooks/useScreenshareAudio';
|
|
@@ -57,16 +55,9 @@ export const AdditionalRoomState = () => {
|
|
|
57
55
|
const { screenSharingPeerName, screenSharingPeerId, screenShareVideoTrackId } = useScreenShare();
|
|
58
56
|
|
|
59
57
|
const isVideoScreenSharingOn = !!screenShareVideoTrackId;
|
|
60
|
-
const { whiteboardOwner, amIWhiteboardOwner, toggleWhiteboard } = useWhiteboardMetadata();
|
|
61
58
|
const shouldShowScreenShareState = isAudioOnly && isVideoScreenSharingOn;
|
|
62
59
|
const shouldShowVideoState = isAudioOnly && isVideoPlayListPlaying;
|
|
63
|
-
if (
|
|
64
|
-
isPlaylistInactive &&
|
|
65
|
-
isAudioshareInactive &&
|
|
66
|
-
!shouldShowScreenShareState &&
|
|
67
|
-
!shouldShowVideoState &&
|
|
68
|
-
!whiteboardOwner
|
|
69
|
-
) {
|
|
60
|
+
if (isPlaylistInactive && isAudioshareInactive && !shouldShowScreenShareState && !shouldShowVideoState) {
|
|
70
61
|
return null;
|
|
71
62
|
}
|
|
72
63
|
|
|
@@ -112,13 +103,6 @@ export const AdditionalRoomState = () => {
|
|
|
112
103
|
</Flex>
|
|
113
104
|
</Tooltip>
|
|
114
105
|
)}
|
|
115
|
-
{whiteboardOwner && (
|
|
116
|
-
<Tooltip title="Whiteboard">
|
|
117
|
-
<Flex align="center" css={{ color: '$on_primary_high', mx: '$2' }}>
|
|
118
|
-
<PencilDrawIcon width={24} height={24} />
|
|
119
|
-
</Flex>
|
|
120
|
-
</Tooltip>
|
|
121
|
-
)}
|
|
122
106
|
<Box css={{ '@lg': { display: 'none' }, color: '$on_surface_low' }}>
|
|
123
107
|
{open ? <ChevronUpIcon /> : <ChevronDownIcon />}
|
|
124
108
|
</Box>
|
|
@@ -190,27 +174,6 @@ export const AdditionalRoomState = () => {
|
|
|
190
174
|
</Text>
|
|
191
175
|
</Dropdown.Item>
|
|
192
176
|
)}
|
|
193
|
-
{whiteboardOwner && (
|
|
194
|
-
<Dropdown.Item css={{ color: '$on_primary_high' }}>
|
|
195
|
-
<PencilDrawIcon width={24} height={24} />
|
|
196
|
-
<Text variant="sm" css={{ ml: '$2', flex: '1 1 0' }}>
|
|
197
|
-
Whiteboard Owner - {whiteboardOwner.name}
|
|
198
|
-
{amIWhiteboardOwner && '(You)'}
|
|
199
|
-
</Text>
|
|
200
|
-
{amIWhiteboardOwner && (
|
|
201
|
-
<Text
|
|
202
|
-
variant="sm"
|
|
203
|
-
css={{ color: '$alert_error_default', ml: '$2', cursor: 'pointer' }}
|
|
204
|
-
onClick={e => {
|
|
205
|
-
e.preventDefault();
|
|
206
|
-
toggleWhiteboard();
|
|
207
|
-
}}
|
|
208
|
-
>
|
|
209
|
-
Stop
|
|
210
|
-
</Text>
|
|
211
|
-
)}
|
|
212
|
-
</Dropdown.Item>
|
|
213
|
-
)}
|
|
214
177
|
</Dropdown.Content>
|
|
215
178
|
</Dropdown.Root>
|
|
216
179
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { useMedia } from 'react-use';
|
|
3
|
-
import { HMSRecordingState } from '@100mslive/hms-video';
|
|
3
|
+
import { HMSRecordingState } from '@100mslive/hms-video-store';
|
|
4
4
|
import {
|
|
5
5
|
HMSRoomState,
|
|
6
6
|
selectHLSState,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @ts-check
|
|
2
|
-
import React, { useMemo, useState } from 'react';
|
|
2
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import {
|
|
4
4
|
selectLocalPeerRoleName,
|
|
5
5
|
selectPermissions,
|
|
@@ -74,6 +74,14 @@ const AddMenu = () => {
|
|
|
74
74
|
const { setPollState } = usePollViewState();
|
|
75
75
|
const [interactionType, setInteractionType] = useState(INTERACTION_TYPE.POLL);
|
|
76
76
|
|
|
77
|
+
const inputRef = useRef(null);
|
|
78
|
+
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
if (inputRef.current) {
|
|
81
|
+
inputRef.current.focus();
|
|
82
|
+
}
|
|
83
|
+
}, [interactionType]);
|
|
84
|
+
|
|
77
85
|
const handleCreate = id => {
|
|
78
86
|
setPollState({
|
|
79
87
|
[POLL_STATE.pollInView]: id,
|
|
@@ -117,7 +125,9 @@ const AddMenu = () => {
|
|
|
117
125
|
<Flex direction="column">
|
|
118
126
|
<Text variant="body2" css={{ mb: '$4' }}>{`Name this ${interactionType.toLowerCase()}`}</Text>
|
|
119
127
|
<Input
|
|
128
|
+
ref={inputRef}
|
|
120
129
|
type="text"
|
|
130
|
+
placeholder="Enter a name to continue"
|
|
121
131
|
value={title}
|
|
122
132
|
onChange={event => setTitle(event.target.value)}
|
|
123
133
|
css={{
|
|
@@ -5,7 +5,15 @@ import { Box, Flex } from '../../../../Layout';
|
|
|
5
5
|
import { Dialog } from '../../../../Modal';
|
|
6
6
|
import { Text } from '../../../../Text';
|
|
7
7
|
|
|
8
|
-
export const DeleteQuestionModal = ({
|
|
8
|
+
export const DeleteQuestionModal = ({
|
|
9
|
+
open,
|
|
10
|
+
setOpen,
|
|
11
|
+
removeQuestion,
|
|
12
|
+
}: {
|
|
13
|
+
open: boolean;
|
|
14
|
+
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
15
|
+
removeQuestion: () => void;
|
|
16
|
+
}) => {
|
|
9
17
|
return (
|
|
10
18
|
<Dialog.Root open={open}>
|
|
11
19
|
<Dialog.Overlay />
|