@100mslive/roomkit-react 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. package/dist/{HLSView-4NSE37G7.js → HLSView-3S74KF3A.js} +23 -4
  2. package/dist/HLSView-3S74KF3A.js.map +7 -0
  3. package/dist/Prebuilt/components/RoleChangeRequest/RequestPrompt.d.ts +9 -0
  4. package/dist/VideoTile/StyledVideoTile.d.ts +445 -3
  5. package/dist/{VirtualBackground-A5UM363O.js → VirtualBackground-3TI5NA4V.js} +3 -3
  6. package/dist/{chunk-BUWIMYLW.js → chunk-36X4ZCLC.js} +2 -2
  7. package/dist/{chunk-NMOZ33TX.js → chunk-5DQ3WTED.js} +3 -2
  8. package/dist/{chunk-NMOZ33TX.js.map → chunk-5DQ3WTED.js.map} +2 -2
  9. package/dist/{chunk-Q6U22HIE.js → chunk-Z7P5WITU.js} +223 -200
  10. package/dist/chunk-Z7P5WITU.js.map +7 -0
  11. package/dist/{conference-S7R3O4OC.js → conference-JNABIZBG.js} +534 -504
  12. package/dist/conference-JNABIZBG.js.map +7 -0
  13. package/dist/index.cjs.js +1011 -924
  14. package/dist/index.cjs.js.map +4 -4
  15. package/dist/index.js +2 -2
  16. package/dist/meta.cjs.json +241 -167
  17. package/dist/meta.esbuild.json +276 -203
  18. package/package.json +6 -6
  19. package/src/Input/Input.tsx +1 -1
  20. package/src/Prebuilt/common/hooks.js +1 -2
  21. package/src/Prebuilt/common/utils.js +7 -2
  22. package/src/Prebuilt/components/Chat/ChatBody.jsx +125 -106
  23. package/src/Prebuilt/components/Chat/ChatFooter.tsx +1 -0
  24. package/src/Prebuilt/components/Footer/Footer.tsx +4 -1
  25. package/src/Prebuilt/components/Footer/ParticipantList.jsx +8 -9
  26. package/src/Prebuilt/components/Header/ParticipantFilter.jsx +9 -12
  27. package/src/Prebuilt/components/Leave/DesktopLeaveRoom.tsx +36 -44
  28. package/src/Prebuilt/components/Leave/MwebLeaveRoom.tsx +23 -35
  29. package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx +4 -2
  30. package/src/Prebuilt/components/Notifications/Notifications.jsx +14 -1
  31. package/src/Prebuilt/components/Notifications/PeerNotifications.jsx +4 -15
  32. package/src/Prebuilt/components/Preview/PreviewJoin.tsx +12 -5
  33. package/src/Prebuilt/components/RaiseHand.jsx +3 -6
  34. package/src/Prebuilt/components/RoleChangeRequest/RequestPrompt.tsx +66 -0
  35. package/src/Prebuilt/components/RoleChangeRequest/RoleChangeRequestModal.tsx +89 -0
  36. package/src/Prebuilt/components/SidePaneTabs.tsx +21 -2
  37. package/src/Prebuilt/components/VideoTile.jsx +24 -15
  38. package/src/Prebuilt/components/conference.jsx +1 -1
  39. package/src/Prebuilt/components/hooks/useMetadata.jsx +15 -4
  40. package/src/Prebuilt/layouts/HLSView.jsx +20 -1
  41. package/src/Prebuilt/layouts/SidePane.tsx +0 -1
  42. package/src/Tooltip/Tooltip.tsx +1 -1
  43. package/src/VideoTile/StyledVideoTile.tsx +10 -14
  44. package/src/fixtures/peers.ts +5 -3
  45. package/dist/HLSView-4NSE37G7.js.map +0 -7
  46. package/dist/chunk-Q6U22HIE.js.map +0 -7
  47. package/dist/conference-S7R3O4OC.js.map +0 -7
  48. package/src/Prebuilt/components/RoleChangeRequestModal.tsx +0 -120
  49. /package/dist/Prebuilt/components/{RoleChangeRequestModal.d.ts → RoleChangeRequest/RoleChangeRequestModal.d.ts} +0 -0
  50. /package/dist/{VirtualBackground-A5UM363O.js.map → VirtualBackground-3TI5NA4V.js.map} +0 -0
  51. /package/dist/{chunk-BUWIMYLW.js.map → chunk-36X4ZCLC.js.map} +0 -0
@@ -1,120 +0,0 @@
1
- import React, { useEffect } from 'react';
2
- import {
3
- selectLocalPeerName,
4
- selectLocalPeerRoleName,
5
- selectRoleChangeRequest,
6
- useCustomEvent,
7
- useHMSActions,
8
- useHMSStore,
9
- } from '@100mslive/react-sdk';
10
- // @ts-ignore: No implicit Any
11
- import { PreviewControls, PreviewTile } from './Preview/PreviewJoin';
12
- import { Box, Button, Dialog, Flex, Text } from '../..';
13
- // @ts-ignore: No implicit Any
14
- import { useMyMetadata } from './hooks/useMetadata';
15
- // @ts-ignore: No implicit Any
16
- import { ROLE_CHANGE_DECLINED } from '../common/constants';
17
-
18
- export const RoleChangeRequestModal = () => {
19
- const hmsActions = useHMSActions();
20
- const { updateMetaData } = useMyMetadata();
21
- const currentRole = useHMSStore(selectLocalPeerRoleName);
22
- const roleChangeRequest = useHMSStore(selectRoleChangeRequest);
23
- const name = useHMSStore(selectLocalPeerName);
24
- const { sendEvent } = useCustomEvent({ type: ROLE_CHANGE_DECLINED });
25
-
26
- useEffect(() => {
27
- if (!roleChangeRequest?.role) {
28
- return;
29
- }
30
- (async () => {
31
- await hmsActions.preview({ asRole: roleChangeRequest.role.name });
32
- })();
33
- }, [hmsActions, roleChangeRequest, currentRole, updateMetaData]);
34
-
35
- if (!roleChangeRequest?.role) {
36
- return null;
37
- }
38
-
39
- const body = (
40
- <>
41
- <Text css={{ fontWeight: 400, c: '$on_surface_medium', textAlign: 'center' }}>
42
- Setup your audio and video before joining
43
- </Text>
44
- <Flex
45
- align="center"
46
- justify="center"
47
- css={{
48
- '@sm': { width: '100%' },
49
- flexDirection: 'column',
50
- mt: '$6',
51
- }}
52
- >
53
- <PreviewTile name={name || ''} />
54
- <PreviewControls hideSettings={true} />
55
- </Flex>
56
- </>
57
- );
58
-
59
- return (
60
- <RequestDialog
61
- title={`You're invited to join the ${roleChangeRequest.role.name} role`}
62
- onOpenChange={async value => {
63
- if (!value) {
64
- await hmsActions.rejectChangeRole(roleChangeRequest);
65
- sendEvent({ ...roleChangeRequest, peerName: name }, { peerId: roleChangeRequest.requestedBy?.id });
66
- await hmsActions.cancelMidCallPreview();
67
- await updateMetaData({ isHandRaised: false });
68
- }
69
- }}
70
- body={body}
71
- onAction={async () => {
72
- await hmsActions.acceptChangeRole(roleChangeRequest);
73
- await updateMetaData({ isHandRaised: false, prevRole: currentRole });
74
- }}
75
- actionText="Accept"
76
- />
77
- );
78
- };
79
-
80
- const RequestDialog = ({
81
- open = true,
82
- onOpenChange,
83
- title,
84
- body,
85
- actionText = 'Accept',
86
- onAction,
87
- }: {
88
- open?: boolean;
89
- onOpenChange: (value: boolean) => void;
90
- title: string;
91
- body: React.ReactNode;
92
- actionText?: string;
93
- onAction: () => void;
94
- }) => (
95
- <Dialog.Root open={open} onOpenChange={onOpenChange}>
96
- <Dialog.Portal>
97
- <Dialog.Overlay />
98
- <Dialog.Content css={{ p: '$10' }}>
99
- <Dialog.Title css={{ p: 0, display: 'flex', flexDirection: 'row', gap: '$md', justifyContent: 'center' }}>
100
- <Text variant="h6">{title}</Text>
101
- </Dialog.Title>
102
- <Box css={{ mt: '$4', mb: '$10' }}>{body}</Box>
103
- <Flex justify="center" align="center" css={{ width: '100%', gap: '$md' }}>
104
- <Box css={{ width: '50%' }}>
105
- <Dialog.Close css={{ width: '100%' }}>
106
- <Button variant="standard" outlined css={{ width: '100%' }}>
107
- Cancel
108
- </Button>
109
- </Dialog.Close>
110
- </Box>
111
- <Box css={{ width: '50%' }}>
112
- <Button variant="primary" css={{ width: '100%' }} onClick={onAction}>
113
- {actionText}
114
- </Button>
115
- </Box>
116
- </Flex>
117
- </Dialog.Content>
118
- </Dialog.Portal>
119
- </Dialog.Root>
120
- );