@100mslive/roomkit-react 0.1.15 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. package/dist/{HLSView-MXBOUQBG.js → HLSView-ADUOTLEX.js} +2 -2
  2. package/dist/Prebuilt/common/PeersSorter.d.ts +1 -0
  3. package/dist/Prebuilt/common/constants.d.ts +7 -4
  4. package/dist/Prebuilt/common/hooks.d.ts +1 -0
  5. package/dist/Prebuilt/components/Footer/ParticipantList.d.ts +17 -0
  6. package/dist/Prebuilt/components/Footer/RoleAccordion.d.ts +3 -2
  7. package/dist/Prebuilt/components/Footer/WhiteboardToggle.d.ts +2 -0
  8. package/dist/Prebuilt/components/Notifications/HandRaisedNotifications.d.ts +1 -0
  9. package/dist/Prebuilt/components/PreviousRoleInMetadata.d.ts +1 -0
  10. package/dist/Prebuilt/components/RemoveParticipant.d.ts +5 -0
  11. package/dist/Prebuilt/components/hooks/useCloseScreenshareWhiteboard.d.ts +4 -0
  12. package/dist/Prebuilt/layouts/WhiteboardView.d.ts +2 -0
  13. package/dist/{chunk-HEOH5H43.js → chunk-NEXHITYN.js} +1882 -7116
  14. package/dist/chunk-NEXHITYN.js.map +7 -0
  15. package/dist/index.cjs.js +2479 -7668
  16. package/dist/index.cjs.js.map +4 -4
  17. package/dist/index.js +1 -1
  18. package/dist/meta.cjs.json +438 -161
  19. package/dist/meta.esbuild.json +443 -166
  20. package/package.json +7 -7
  21. package/src/Prebuilt/AppStateContext.tsx +1 -1
  22. package/src/Prebuilt/common/PeersSorter.ts +12 -5
  23. package/src/Prebuilt/common/constants.ts +5 -6
  24. package/src/Prebuilt/common/hooks.ts +16 -0
  25. package/src/Prebuilt/common/utils.js +5 -6
  26. package/src/Prebuilt/components/AppData/AppData.tsx +1 -16
  27. package/src/Prebuilt/components/Chat/Chat.jsx +7 -30
  28. package/src/Prebuilt/components/Chat/ChatBody.jsx +107 -66
  29. package/src/Prebuilt/components/Chat/ChatFooter.tsx +21 -12
  30. package/src/Prebuilt/components/Chat/ChatSelector.tsx +25 -25
  31. package/src/Prebuilt/components/Chat/ChatSelectorContainer.tsx +15 -16
  32. package/src/Prebuilt/components/Chat/PinnedMessage.tsx +7 -2
  33. package/src/Prebuilt/components/ConferenceScreen.tsx +2 -0
  34. package/src/Prebuilt/components/Footer/ChatToggle.tsx +30 -7
  35. package/src/Prebuilt/components/Footer/Footer.tsx +2 -1
  36. package/src/Prebuilt/components/Footer/PaginatedParticipants.tsx +0 -1
  37. package/src/Prebuilt/components/Footer/{ParticipantList.jsx → ParticipantList.tsx} +169 -127
  38. package/src/Prebuilt/components/Footer/RoleAccordion.tsx +23 -13
  39. package/src/Prebuilt/components/Footer/WhiteboardToggle.tsx +34 -0
  40. package/src/Prebuilt/components/Notifications/HandRaisedNotifications.tsx +35 -0
  41. package/src/Prebuilt/components/Notifications/Notifications.tsx +14 -12
  42. package/src/Prebuilt/components/Notifications/PeerNotifications.tsx +7 -2
  43. package/src/Prebuilt/components/Polls/Voting/QuestionCard.jsx +10 -2
  44. package/src/Prebuilt/components/PreviousRoleInMetadata.tsx +21 -0
  45. package/src/Prebuilt/components/RemoveParticipant.tsx +35 -0
  46. package/src/Prebuilt/components/RoleChangeModal.jsx +1 -1
  47. package/src/Prebuilt/components/SidePaneTabs.tsx +0 -1
  48. package/src/Prebuilt/components/TileMenu/TileMenuContent.tsx +1 -1
  49. package/src/Prebuilt/components/Toast/ToastConfig.jsx +15 -3
  50. package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +1 -2
  51. package/src/Prebuilt/components/hooks/useCloseScreenshareWhiteboard.tsx +24 -0
  52. package/src/Prebuilt/layouts/VideoStreamingSection.tsx +20 -3
  53. package/src/Prebuilt/layouts/WhiteboardView.tsx +66 -0
  54. package/dist/chunk-HEOH5H43.js.map +0 -7
  55. package/src/Prebuilt/components/AppData/useAppLayout.js +0 -6
  56. package/src/Prebuilt/components/init/initUtils.js +0 -67
  57. /package/dist/{HLSView-MXBOUQBG.js.map → HLSView-ADUOTLEX.js.map} +0 -0
@@ -1,6 +0,0 @@
1
- import { selectAppDataByPath, useHMSStore } from '@100mslive/react-sdk';
2
- import { APP_DATA } from '../../common/constants';
3
-
4
- export const useAppLayout = path => {
5
- return useHMSStore(selectAppDataByPath(APP_DATA.appLayout, path));
6
- };
@@ -1,67 +0,0 @@
1
- // interface RoleConfig {
2
- // center?: HMSRoleName[];
3
- // sidepane?: HMSRoleName[];
4
- // selfRoleChangeTo?: HMSRoleName[];
5
- // remoteRoleChangeFor?: HMSRoleName[];
6
- // }
7
-
8
- // interface PolicyConfig {
9
- // [role: string]: RoleConfig;
10
- // }
11
-
12
- /**
13
- * check if a role is allowed to publish either of audio or video
14
- */
15
- function canPublishAV(role) {
16
- const params = role?.publishParams;
17
- if (params?.allowed) {
18
- return params.allowed.includes('video') || params.allowed.includes('audio');
19
- }
20
- return false;
21
- }
22
-
23
- /**
24
- * Figure out the layout for each role. There is some extra work being done
25
- * here currently to figure out the layout for roles other than local peer too
26
- * which can be avoided.
27
- */
28
- export const normalizeAppPolicyConfig = (roleNames, rolesMap, appPolicyConfig = {}) => {
29
- const newConfig = Object.assign({}, appPolicyConfig);
30
- // eslint-disable-next-line complexity
31
- roleNames.forEach(roleName => {
32
- if (!newConfig[roleName]) {
33
- newConfig[roleName] = {};
34
- }
35
- const subscribedRoles = rolesMap[roleName].subscribeParams?.subscribeToRoles || [];
36
-
37
- const isNotSubscribingOrSubscribingToSelf =
38
- subscribedRoles.length === 0 || (subscribedRoles.length === 1 && subscribedRoles[0] === roleName);
39
- if (!newConfig[roleName].center) {
40
- const publishingRoleNames = roleNames.filter(
41
- roleName => canPublishAV(rolesMap[roleName]) && subscribedRoles.includes(roleName),
42
- );
43
- if (isNotSubscribingOrSubscribingToSelf) {
44
- newConfig[roleName].center = [roleName];
45
- } else {
46
- // all other publishing roles apart from local role in center by default
47
- newConfig[roleName].center = publishingRoleNames.filter(rName => rName !== roleName);
48
- }
49
- }
50
- // everyone from my role is in sidepane by default if they can publish
51
- if (!newConfig[roleName].sidepane) {
52
- if (isNotSubscribingOrSubscribingToSelf) {
53
- newConfig[roleName].sidepane = [];
54
- } else {
55
- newConfig[roleName].sidepane = canPublishAV(rolesMap[roleName]) ? [roleName] : [];
56
- }
57
- }
58
- if (!newConfig[roleName].selfRoleChangeTo) {
59
- newConfig[roleName].selfRoleChangeTo = roleNames;
60
- }
61
- if (!newConfig[roleName].remoteRoleChangeFor) {
62
- newConfig[roleName].remoteRoleChangeFor = roleNames;
63
- }
64
- });
65
-
66
- return newConfig;
67
- };