@100mslive/roomkit-react 0.3.22-alpha.0 → 0.3.22-alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. package/dist/Accordion/Accordion.d.ts +134 -322
  2. package/dist/Accordion/index.d.ts +134 -322
  3. package/dist/Avatar/Avatar.d.ts +47 -141
  4. package/dist/Button/Button.d.ts +47 -141
  5. package/dist/Checkbox/Checkbox.d.ts +134 -322
  6. package/dist/Collapsible/Collapsible.d.ts +201 -483
  7. package/dist/Divider/Divider.d.ts +134 -322
  8. package/dist/Dropdown/Dropdown.d.ts +804 -1932
  9. package/dist/Fieldset/Fieldset.d.ts +47 -141
  10. package/dist/Footer/Footer.d.ts +536 -1288
  11. package/dist/{HLSView-EPPGI6XI.js → HLSView-LCFZPBH3.js} +2 -2
  12. package/dist/{HLSView-JYFTZVCM.css → HLSView-Z2JID2W7.css} +3 -3
  13. package/dist/{HLSView-JYFTZVCM.css.map → HLSView-Z2JID2W7.css.map} +1 -1
  14. package/dist/IconButton/IconButton.d.ts +47 -141
  15. package/dist/Input/Input.d.ts +362 -926
  16. package/dist/Label/Label.d.ts +47 -141
  17. package/dist/Layout/Box.d.ts +47 -141
  18. package/dist/Layout/Flex.d.ts +47 -141
  19. package/dist/Link/Link.d.ts +47 -141
  20. package/dist/Modal/Dialog.d.ts +329 -987
  21. package/dist/Modal/DialogContent.d.ts +469 -1127
  22. package/dist/Pagination/StyledPagination.d.ts +268 -644
  23. package/dist/Popover/index.d.ts +201 -483
  24. package/dist/Prebuilt/IconButton.d.ts +134 -322
  25. package/dist/Prebuilt/components/Chat/ChatBody.d.ts +134 -322
  26. package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +335 -805
  27. package/dist/Prebuilt/components/Notifications/DeviceChangeNotifications.d.ts +1 -0
  28. package/dist/Prebuilt/components/Notifications/DeviceInUseError.d.ts +2 -0
  29. package/dist/Prebuilt/components/Notifications/ErrorNotifications.d.ts +1 -0
  30. package/dist/Prebuilt/components/Notifications/MessageNotifications.d.ts +1 -0
  31. package/dist/Prebuilt/components/Notifications/PollNotificationModal.d.ts +1 -0
  32. package/dist/Prebuilt/components/Settings/common.d.ts +134 -322
  33. package/dist/Progress/index.d.ts +134 -322
  34. package/dist/RadioGroup/RadioGroup.d.ts +201 -483
  35. package/dist/ReactSelect/ReactSelect.d.ts +670 -1610
  36. package/dist/Select/Select.d.ts +201 -483
  37. package/dist/Sheet/Sheet.d.ts +329 -987
  38. package/dist/Slider/Slider.d.ts +47 -141
  39. package/dist/Stats/StyledStats.d.ts +402 -966
  40. package/dist/Switch/Switch.d.ts +47 -141
  41. package/dist/Tabs/Tabs.d.ts +268 -644
  42. package/dist/Text/Text.d.ts +47 -141
  43. package/dist/TextArea/TextArea.d.ts +47 -141
  44. package/dist/Theme/base.config.d.ts +26 -78
  45. package/dist/Theme/stitches.config.d.ts +1046 -1493
  46. package/dist/TileMenu/StyledMenuTile.d.ts +469 -1127
  47. package/dist/Toast/Toast.d.ts +382 -946
  48. package/dist/Video/Video.d.ts +47 -141
  49. package/dist/VideoList/StyledVideoList.d.ts +201 -483
  50. package/dist/VideoTile/StyledVideoTile.d.ts +670 -1610
  51. package/dist/{chunk-ZAX5VT7V.js → chunk-CRGZUJSX.js} +1000 -875
  52. package/dist/chunk-CRGZUJSX.js.map +7 -0
  53. package/dist/index.cjs.css +2 -2
  54. package/dist/index.cjs.css.map +1 -1
  55. package/dist/index.cjs.js +1038 -861
  56. package/dist/index.cjs.js.map +4 -4
  57. package/dist/index.css +2 -2
  58. package/dist/index.css.map +1 -1
  59. package/dist/index.js +1 -1
  60. package/dist/meta.cjs.json +348 -78
  61. package/dist/meta.esbuild.json +355 -85
  62. package/package.json +8 -8
  63. package/src/Avatar/Avatar.tsx +1 -1
  64. package/src/Popover/Popover.stories.tsx +1 -1
  65. package/src/Prebuilt/components/Header/common.jsx +6 -5
  66. package/src/Prebuilt/components/Notifications/DeviceChangeNotifications.tsx +18 -0
  67. package/src/Prebuilt/components/Notifications/DeviceInUseError.tsx +79 -0
  68. package/src/Prebuilt/components/Notifications/ErrorNotifications.tsx +56 -0
  69. package/src/Prebuilt/components/Notifications/MessageNotifications.tsx +24 -0
  70. package/src/Prebuilt/components/Notifications/Notifications.tsx +13 -159
  71. package/src/Prebuilt/components/Notifications/PeerNotifications.tsx +23 -2
  72. package/src/Prebuilt/components/Notifications/PollNotificationModal.tsx +71 -0
  73. package/src/Prebuilt/components/Notifications/ReconnectNotifications.tsx +1 -5
  74. package/src/Prebuilt/components/Notifications/TrackBulkUnmuteModal.tsx +7 -5
  75. package/src/Prebuilt/components/Notifications/TrackNotifications.tsx +23 -1
  76. package/src/Prebuilt/components/Notifications/TrackUnmuteModal.tsx +13 -5
  77. package/src/Prebuilt/components/StatsForNerds.jsx +32 -3
  78. package/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +2 -2
  79. package/src/Prebuilt/components/VirtualBackground/VBOption.tsx +3 -1
  80. package/src/Prebuilt/components/VirtualBackground/VBPicker.tsx +6 -0
  81. package/dist/chunk-ZAX5VT7V.js.map +0 -7
  82. /package/dist/{HLSView-EPPGI6XI.js.map → HLSView-LCFZPBH3.js.map} +0 -0
@@ -1,17 +1,39 @@
1
1
  import { useEffect } from 'react';
2
2
  import { HMSNotificationTypes, useHMSNotifications } from '@100mslive/react-sdk';
3
+ // @ts-ignore: No implicit Any
4
+ import { ToastManager } from '../Toast/ToastManager';
3
5
 
4
6
  const notificationTypes = [
5
7
  HMSNotificationTypes.TRACK_ADDED,
6
8
  HMSNotificationTypes.TRACK_REMOVED,
7
9
  HMSNotificationTypes.TRACK_MUTED,
8
10
  HMSNotificationTypes.TRACK_UNMUTED,
11
+ HMSNotificationTypes.CHANGE_TRACK_STATE_REQUEST,
9
12
  ];
13
+
10
14
  export const TrackNotifications = () => {
11
15
  const notification = useHMSNotifications(notificationTypes);
12
16
  useEffect(() => {
13
17
  if (notification) {
14
- console.debug(`[${notification.type}]`, notification);
18
+ switch (notification.type) {
19
+ case HMSNotificationTypes.TRACK_ADDED:
20
+ case HMSNotificationTypes.TRACK_REMOVED:
21
+ case HMSNotificationTypes.TRACK_MUTED:
22
+ case HMSNotificationTypes.TRACK_UNMUTED:
23
+ console.debug(`[${notification.type}]`, notification);
24
+ break;
25
+ case HMSNotificationTypes.CHANGE_TRACK_STATE_REQUEST:
26
+ {
27
+ const track = notification.data?.track;
28
+ if (!notification.data.enabled) {
29
+ ToastManager.addToast({
30
+ title: `Your ${track.source} ${track.type} was muted by
31
+ ${notification.data.requestedBy?.name}.`,
32
+ });
33
+ }
34
+ }
35
+ break;
36
+ }
15
37
  }
16
38
  }, [notification]);
17
39
 
@@ -8,20 +8,28 @@ import {
8
8
  import { MicOnIcon } from '@100mslive/react-icons';
9
9
  // @ts-ignore: No implicit Any
10
10
  import { RequestDialog } from '../../primitives/DialogContent';
11
+ // @ts-ignore: No implicit Any
12
+ import { ToastManager } from '../Toast/ToastManager';
13
+
14
+ const notificationTypes = [
15
+ HMSNotificationTypes.CHANGE_TRACK_STATE_REQUEST,
16
+ HMSNotificationTypes.ROOM_ENDED,
17
+ HMSNotificationTypes.REMOVED_FROM_ROOM,
18
+ ];
11
19
 
12
20
  export const TrackUnmuteModal = () => {
13
21
  const hmsActions = useHMSActions();
14
- const notification = useHMSNotifications([
15
- HMSNotificationTypes.CHANGE_TRACK_STATE_REQUEST,
16
- HMSNotificationTypes.ROOM_ENDED,
17
- HMSNotificationTypes.REMOVED_FROM_ROOM,
18
- ]);
22
+ const notification = useHMSNotifications(notificationTypes);
19
23
  const [muteNotification, setMuteNotification] = useState<HMSChangeTrackStateRequest | null>(null);
20
24
 
21
25
  useEffect(() => {
22
26
  switch (notification?.type) {
23
27
  case HMSNotificationTypes.REMOVED_FROM_ROOM:
24
28
  case HMSNotificationTypes.ROOM_ENDED:
29
+ ToastManager.addToast({
30
+ title: `${notification.message}.
31
+ ${notification.data.reason && `Reason: ${notification.data.reason}`}`,
32
+ });
25
33
  setMuteNotification(null);
26
34
  break;
27
35
  case HMSNotificationTypes.CHANGE_TRACK_STATE_REQUEST:
@@ -5,9 +5,11 @@ import {
5
5
  selectLocalPeerID,
6
6
  selectPeersMap,
7
7
  selectTracksMap,
8
+ useHMSActions,
8
9
  useHMSStatsStore,
9
10
  useHMSStore,
10
11
  } from '@100mslive/react-sdk';
12
+ import { Accordion } from '../../Accordion';
11
13
  import { HorizontalDivider } from '../../Divider';
12
14
  import { Dropdown } from '../../Dropdown';
13
15
  import { Label } from '../../Label';
@@ -27,6 +29,8 @@ export const StatsForNerds = ({ onOpenChange }) => {
27
29
  () => [{ id: 'local-peer', label: 'Local Peer Stats' }, ...tracksWithLabels],
28
30
  [tracksWithLabels],
29
31
  );
32
+ const hmsActions = useHMSActions();
33
+ const details = hmsActions.getDebugInfo();
30
34
  const [selectedStat, setSelectedStat] = useState(statsOptions[0]);
31
35
  const [showStatsOnTiles, setShowStatsOnTiles] = useSetUiSettings(UI_SETTINGS.showStatsOnTiles);
32
36
  const [open, setOpen] = useState(false);
@@ -46,7 +50,7 @@ export const StatsForNerds = ({ onOpenChange }) => {
46
50
  <Dialog.Content
47
51
  css={{
48
52
  width: 'min(500px, 95%)',
49
- maxHeight: '100%',
53
+ height: 'min(656px, 90%)',
50
54
  overflowY: 'auto',
51
55
  }}
52
56
  >
@@ -70,6 +74,7 @@ export const StatsForNerds = ({ onOpenChange }) => {
70
74
  </Text>
71
75
  </Flex>
72
76
  {/* Select */}
77
+
73
78
  <Flex
74
79
  direction="column"
75
80
  css={{
@@ -119,6 +124,9 @@ export const StatsForNerds = ({ onOpenChange }) => {
119
124
  ) : (
120
125
  <TrackStats trackID={selectedStat.id} layer={selectedStat.layer} local={selectedStat.local} />
121
126
  )}
127
+ <Flex justify="start" gap={4} css={{ m: '$10 0', w: '100%' }}>
128
+ <DebugInfo details={details} />
129
+ </Flex>
122
130
  </Dialog.Content>
123
131
  </Dialog.Portal>
124
132
  </Dialog.Root>
@@ -229,8 +237,29 @@ const TrackStats = ({ trackID, layer, local }) => {
229
237
  );
230
238
  };
231
239
 
232
- const StatsRow = React.memo(({ label, value }) => (
233
- <Box css={{ bg: '$surface_bright', w: 'calc(50% - $6)', p: '$8', r: '$3' }}>
240
+ const DebugInfo = ({ details }) => {
241
+ return (
242
+ <Accordion.Root type="single" collapsible css={{ w: '100%' }}>
243
+ <Accordion.Item value="Debug Info">
244
+ <Accordion.Header>
245
+ <Label variant="body2" css={{ c: '$on_surface_high' }}>
246
+ Debug Info
247
+ </Label>
248
+ </Accordion.Header>
249
+ <Accordion.Content>
250
+ <Flex css={{ flexWrap: 'wrap', mt: '$10', gap: '$10' }}>
251
+ <StatsRow css={{ w: '100%' }} label="Websocket URL" value={details?.websocketURL} />
252
+ <StatsRow css={{ w: '100%' }} label="Init Endpoint" value={details?.initEndpoint} />
253
+ <StatsRow css={{ w: '100%' }} label="Enabled flags" value={details?.enabledFlags?.join(', ')} />
254
+ </Flex>
255
+ </Accordion.Content>
256
+ </Accordion.Item>
257
+ </Accordion.Root>
258
+ );
259
+ };
260
+
261
+ const StatsRow = React.memo(({ label, value, css }) => (
262
+ <Box css={{ bg: '$surface_bright', w: 'calc(50% - $6)', p: '$8', r: '$3', ...css }}>
234
263
  <Text
235
264
  variant="overline"
236
265
  css={{
@@ -70,9 +70,9 @@ const SecondarySection = ({
70
70
  rootCSS={{
71
71
  padding: 0,
72
72
  maxWidth: 240,
73
- aspectRatio: 16 / 9,
73
+ aspectRatio: '16 / 9',
74
74
  ...(hasSidebar ? { w: '100%' } : { h: '100%' }),
75
- '@md': { aspectRatio: 1 },
75
+ '@md': { aspectRatio: '1' },
76
76
  }}
77
77
  objectFit="contain"
78
78
  {...tileLayoutProps}
@@ -25,7 +25,9 @@ const Root = ({
25
25
  bg: '$surface_bright',
26
26
  border: `4px solid ${isActive ? '$primary_default' : '$surface_dim'}`,
27
27
  cursor: 'pointer',
28
- '&:hover': { border: '4px solid $primary_dim' },
28
+ '@media (hover:hover)': {
29
+ '&:hover': { border: '4px solid $primary_dim' },
30
+ },
29
31
  ...(mediaURL ? { height: '$20', backgroundImage: `url("${mediaURL}")`, backgroundSize: 'cover' } : {}),
30
32
  }}
31
33
  onClick={async () => {
@@ -180,6 +180,9 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
180
180
  onClick: async () => {
181
181
  await VBHandler.removeEffects();
182
182
  hmsActions.setAppData(APP_DATA.background, HMSVirtualBackgroundTypes.NONE);
183
+ if (isMobile) {
184
+ toggleVB();
185
+ }
183
186
  },
184
187
  supported: true,
185
188
  },
@@ -235,6 +238,9 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
235
238
  onClick: async () => {
236
239
  await VBHandler?.setBackground(mediaURL);
237
240
  hmsActions.setAppData(APP_DATA.background, mediaURL);
241
+ if (isMobile) {
242
+ toggleVB();
243
+ }
238
244
  },
239
245
  supported: true,
240
246
  }))}