@100mslive/roomkit-react 0.1.1 → 0.1.2-alpha.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (242) hide show
  1. package/README.md +18 -0
  2. package/dist/Accordion/Accordion.d.ts +62 -138
  3. package/dist/Accordion/index.d.ts +62 -138
  4. package/dist/{ActiveSpeakerView-G32BDM5F.js → ActiveSpeakerView-4XPIRZOK.js} +6 -6
  5. package/dist/{ActiveSpeakerView-LW4WDBC6.css → ActiveSpeakerView-ADEYHQMU.css} +2 -2
  6. package/dist/{PinnedTrackView-OAA4HAID.css.map → ActiveSpeakerView-ADEYHQMU.css.map} +2 -2
  7. package/dist/Avatar/Avatar.d.ts +31 -69
  8. package/dist/Button/Button.d.ts +31 -69
  9. package/dist/Checkbox/Checkbox.d.ts +62 -138
  10. package/dist/Collapsible/Collapsible.d.ts +93 -207
  11. package/dist/Divider/Divider.d.ts +62 -138
  12. package/dist/Dropdown/Dropdown.d.ts +372 -828
  13. package/dist/Fieldset/Fieldset.d.ts +31 -69
  14. package/dist/Footer/Footer.d.ts +248 -552
  15. package/dist/{HLSView-DIQQF2PP.css → HLSView-DWEEMZ6Z.css} +2 -2
  16. package/dist/{HLSView-DIQQF2PP.css.map → HLSView-DWEEMZ6Z.css.map} +2 -2
  17. package/dist/{HLSView-ZYNT3HJD.js → HLSView-I26CVF5U.js} +16 -16
  18. package/dist/HLSView-I26CVF5U.js.map +7 -0
  19. package/dist/IconButton/IconButton.d.ts +31 -69
  20. package/dist/Input/Input.d.ts +189 -417
  21. package/dist/Label/Label.d.ts +31 -69
  22. package/dist/Layout/Box.d.ts +31 -69
  23. package/dist/Layout/Flex.d.ts +31 -69
  24. package/dist/Link/Link.d.ts +31 -69
  25. package/dist/Modal/Dialog.d.ts +248 -552
  26. package/dist/Modal/DialogContent.d.ts +217 -483
  27. package/dist/Pagination/StyledPagination.d.ts +124 -276
  28. package/dist/{PinnedTrackView-OAA4HAID.css → PinnedTrackView-5DPVVOZW.css} +2 -2
  29. package/dist/{conference-LE4T3ZNF.css.map → PinnedTrackView-5DPVVOZW.css.map} +2 -2
  30. package/dist/{PinnedTrackView-GTXL2UTS.js → PinnedTrackView-GGTCNH5V.js} +6 -6
  31. package/dist/Popover/index.d.ts +93 -207
  32. package/dist/Prebuilt/provider/roomLayoutProvider/constants/index.d.ts +2 -0
  33. package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.d.ts +9 -0
  34. package/dist/Prebuilt/provider/roomLayoutProvider/index.d.ts +9 -0
  35. package/dist/Progress/index.d.ts +62 -138
  36. package/dist/RadioGroup/RadioGroup.d.ts +93 -207
  37. package/dist/ReactSelect/ReactSelect.d.ts +310 -690
  38. package/dist/Select/Select.d.ts +93 -207
  39. package/dist/Slider/Slider.d.ts +31 -69
  40. package/dist/Stats/StyledStats.d.ts +186 -414
  41. package/dist/Switch/Switch.d.ts +31 -69
  42. package/dist/Tabs/Tabs.d.ts +124 -276
  43. package/dist/Text/Text.d.ts +31 -69
  44. package/dist/Theme/ThemeProvider.d.ts +63 -140
  45. package/dist/Theme/base.config.d.ts +31 -53
  46. package/dist/Theme/index.d.ts +0 -1
  47. package/dist/Theme/stitches.config.d.ts +404 -915
  48. package/dist/TileMenu/StyledMenuTile.d.ts +217 -483
  49. package/dist/Toast/Toast.d.ts +187 -415
  50. package/dist/Video/Video.d.ts +31 -69
  51. package/dist/VideoList/StyledVideoList.d.ts +93 -207
  52. package/dist/VideoTile/StyledVideoTile.d.ts +279 -621
  53. package/dist/{VirtualBackground-HWU22Q6S.js → VirtualBackground-ZRRE4DUA.js} +4 -3
  54. package/dist/{VirtualBackground-HWU22Q6S.js.map → VirtualBackground-ZRRE4DUA.js.map} +2 -2
  55. package/dist/{chunk-4VY5NUK7.js → chunk-4ISMCWQA.js} +49 -146
  56. package/dist/chunk-4ISMCWQA.js.map +7 -0
  57. package/dist/{chunk-TEHZYXCJ.js → chunk-KKLZ7K2L.js} +167 -164
  58. package/dist/chunk-KKLZ7K2L.js.map +7 -0
  59. package/dist/chunk-LUND6FLY.js +8626 -0
  60. package/dist/chunk-LUND6FLY.js.map +7 -0
  61. package/dist/chunk-MYK3T45M.js +58 -0
  62. package/dist/chunk-MYK3T45M.js.map +7 -0
  63. package/dist/{chunk-A2PNZIK7.js → chunk-THORW2WT.js} +4 -4
  64. package/dist/{chunk-A2PNZIK7.js.map → chunk-THORW2WT.js.map} +1 -1
  65. package/dist/{conference-YHO2J3Z6.js → conference-5TDUAQ6K.js} +593 -532
  66. package/dist/conference-5TDUAQ6K.js.map +7 -0
  67. package/dist/{conference-LE4T3ZNF.css → conference-BDCDGBIS.css} +2 -2
  68. package/dist/{ActiveSpeakerView-LW4WDBC6.css.map → conference-BDCDGBIS.css.map} +2 -2
  69. package/dist/index.cjs.css +1 -1
  70. package/dist/index.cjs.css.map +2 -2
  71. package/dist/index.cjs.js +2952 -2662
  72. package/dist/index.cjs.js.map +4 -4
  73. package/dist/index.css +1 -1
  74. package/dist/index.css.map +2 -2
  75. package/dist/index.js +4 -8
  76. package/dist/meta.cjs.json +750 -484
  77. package/dist/meta.esbuild.json +844 -581
  78. package/dist/{transcription-L6VBK75V.js → transcription-PYTSSAOB.js} +3 -3
  79. package/package.json +13 -9
  80. package/src/Accordion/Accordion.tsx +3 -3
  81. package/src/AudioLevel/AudioLevel.tsx +1 -1
  82. package/src/Avatar/Avatar.tsx +8 -3
  83. package/src/Button/Button.tsx +76 -20
  84. package/src/Checkbox/Checkbox.tsx +4 -4
  85. package/src/Collapsible/Collapsible.tsx +1 -1
  86. package/src/Divider/Divider.tsx +2 -2
  87. package/src/Divider/HorizontalDivider.stories.tsx +2 -2
  88. package/src/Divider/VerticalDivider.stories.tsx +1 -1
  89. package/src/Dropdown/Dropdown.stories.tsx +3 -3
  90. package/src/Dropdown/Dropdown.tsx +16 -14
  91. package/src/IconButton/IconButton.tsx +8 -7
  92. package/src/Input/Input.tsx +9 -8
  93. package/src/Input/PasswordInput.stories.tsx +2 -2
  94. package/src/Label/Label.tsx +1 -1
  95. package/src/Link/Link.tsx +4 -4
  96. package/src/Loading/Loading.tsx +7 -10
  97. package/src/Modal/Dialog.stories.tsx +2 -2
  98. package/src/Modal/DialogContent.tsx +3 -3
  99. package/src/Pagination/StyledPagination.tsx +4 -4
  100. package/src/Popover/Popover.stories.tsx +5 -5
  101. package/src/Popover/index.tsx +1 -1
  102. package/src/Prebuilt/App.jsx +101 -68
  103. package/src/Prebuilt/IconButton.jsx +2 -2
  104. package/src/Prebuilt/Prebuilt.stories.tsx +8 -2
  105. package/src/Prebuilt/common/constants.js +0 -1
  106. package/src/Prebuilt/common/utils.js +0 -6
  107. package/src/Prebuilt/components/AppData/AppData.jsx +7 -4
  108. package/src/Prebuilt/components/AppData/useUISettings.js +0 -4
  109. package/src/Prebuilt/components/AudioVideoToggle.jsx +73 -20
  110. package/src/Prebuilt/components/BottomActionSheet/BottomActionSheet.jsx +1 -1
  111. package/src/Prebuilt/components/Chat/Chat.jsx +6 -2
  112. package/src/Prebuilt/components/Chat/ChatBody.jsx +13 -11
  113. package/src/Prebuilt/components/Chat/ChatFooter.jsx +2 -2
  114. package/src/Prebuilt/components/Chat/ChatHeader.jsx +3 -3
  115. package/src/Prebuilt/components/Chat/ChatSelector.jsx +2 -2
  116. package/src/Prebuilt/components/Chat/useEmojiPickerStyles.js +6 -6
  117. package/src/Prebuilt/components/Chip.jsx +24 -0
  118. package/src/Prebuilt/components/Connection/ConnectionIndicator.jsx +6 -6
  119. package/src/Prebuilt/components/Connection/TileConnection.jsx +2 -2
  120. package/src/Prebuilt/components/Connection/connectionQualityUtils.js +4 -4
  121. package/src/Prebuilt/components/EmojiReaction.jsx +13 -10
  122. package/src/Prebuilt/components/ErrorBoundary.jsx +2 -2
  123. package/src/Prebuilt/components/FullPageProgress.jsx +5 -3
  124. package/src/Prebuilt/components/GoLiveButton.jsx +1 -4
  125. package/src/Prebuilt/components/HMSVideo/HLSQualitySelector.jsx +2 -2
  126. package/src/Prebuilt/components/HMSVideo/PlayButton.jsx +1 -1
  127. package/src/Prebuilt/components/HMSVideo/VideoProgress.jsx +3 -3
  128. package/src/Prebuilt/components/HMSVideo/VideoTime.jsx +3 -1
  129. package/src/Prebuilt/components/HMSVideo/VolumeControl.jsx +1 -1
  130. package/src/Prebuilt/components/Header/AdditionalRoomState.jsx +17 -17
  131. package/src/Prebuilt/components/Header/AmbientMusic.jsx +1 -1
  132. package/src/Prebuilt/components/Header/ConferencingHeader.jsx +4 -6
  133. package/src/Prebuilt/components/Header/HeaderComponents.jsx +10 -5
  134. package/src/Prebuilt/components/Header/ParticipantFilter.jsx +2 -2
  135. package/src/Prebuilt/components/Header/ParticipantList.jsx +2 -2
  136. package/src/Prebuilt/components/Header/StreamActions.jsx +9 -19
  137. package/src/Prebuilt/components/Header/StreamingHeader.jsx +5 -6
  138. package/src/Prebuilt/components/HlsStatsOverlay.jsx +2 -2
  139. package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.jsx +102 -0
  140. package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.stories.tsx +40 -0
  141. package/src/Prebuilt/components/LeaveRoom.jsx +11 -11
  142. package/src/Prebuilt/components/MetaActions.jsx +2 -2
  143. package/src/Prebuilt/components/MoreSettings/BulkRoleChangeModal.jsx +2 -2
  144. package/src/Prebuilt/components/MoreSettings/ChangeSelfRole.jsx +1 -1
  145. package/src/Prebuilt/components/MoreSettings/MoreSettings.jsx +1 -0
  146. package/src/Prebuilt/components/Notifications/HLSFailureModal.jsx +69 -0
  147. package/src/Prebuilt/components/Notifications/Notifications.jsx +1 -3
  148. package/src/Prebuilt/components/Notifications/PermissionErrorModal.jsx +108 -26
  149. package/src/Prebuilt/components/Notifications/ReconnectNotifications.jsx +1 -1
  150. package/src/Prebuilt/components/PIP/pipUtils.js +2 -2
  151. package/src/Prebuilt/components/Playlist/Playlist.jsx +4 -4
  152. package/src/Prebuilt/components/Playlist/PlaylistControls.jsx +3 -3
  153. package/src/Prebuilt/components/Playlist/PlaylistItem.jsx +3 -3
  154. package/src/Prebuilt/components/Playlist/VideoPlayer.jsx +4 -4
  155. package/src/Prebuilt/components/PostLeave.jsx +4 -4
  156. package/src/Prebuilt/components/Preview/PreviewContainer.jsx +17 -6
  157. package/src/Prebuilt/components/Preview/PreviewForm.jsx +74 -0
  158. package/src/Prebuilt/components/Preview/PreviewJoin.jsx +100 -37
  159. package/src/Prebuilt/components/RoleChangeModal.jsx +3 -3
  160. package/src/Prebuilt/components/ScreenshareDisplay.jsx +2 -2
  161. package/src/Prebuilt/components/Settings/DeviceSettings.jsx +3 -9
  162. package/src/Prebuilt/components/Settings/SettingsModal.jsx +8 -32
  163. package/src/Prebuilt/components/Settings/StartRecording.jsx +4 -12
  164. package/src/Prebuilt/components/Settings/SwitchWithLabel.jsx +2 -3
  165. package/src/Prebuilt/components/Settings/common.js +26 -0
  166. package/src/Prebuilt/components/StatsForNerds.jsx +5 -5
  167. package/src/Prebuilt/components/Streaming/Common.jsx +11 -11
  168. package/src/Prebuilt/components/Streaming/HLSStreaming.jsx +6 -12
  169. package/src/Prebuilt/components/Streaming/RTMPStreaming.jsx +4 -6
  170. package/src/Prebuilt/components/Streaming/StreamingLanding.jsx +4 -4
  171. package/src/Prebuilt/components/TileMenu.jsx +7 -7
  172. package/src/Prebuilt/components/Toast/ToastConfig.jsx +12 -20
  173. package/src/Prebuilt/components/conference.jsx +9 -2
  174. package/src/Prebuilt/components/hooks/useDropdownSelection.jsx +1 -4
  175. package/src/Prebuilt/components/pdfAnnotator/pdfErrorView.jsx +2 -2
  176. package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +1 -1
  177. package/src/Prebuilt/components/pdfAnnotator/pdfHeader.jsx +1 -1
  178. package/src/Prebuilt/components/pdfAnnotator/pdfInfo.jsx +2 -2
  179. package/src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx +12 -20
  180. package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +4 -4
  181. package/src/Prebuilt/images/Logo.svg +8 -0
  182. package/src/Prebuilt/images/first_person.png +0 -0
  183. package/src/Prebuilt/images/rtmp.png +0 -0
  184. package/src/Prebuilt/index.d.ts +6 -1
  185. package/src/Prebuilt/layouts/HLSView.jsx +1 -1
  186. package/src/Prebuilt/layouts/InsetView.jsx +0 -3
  187. package/src/Prebuilt/layouts/NonPublisherView.jsx +2 -2
  188. package/src/Prebuilt/layouts/SidePane.jsx +1 -1
  189. package/src/Prebuilt/layouts/WaitingView.jsx +2 -2
  190. package/src/Prebuilt/layouts/mainView.jsx +42 -5
  191. package/src/Prebuilt/plugins/FlyingEmoji.jsx +2 -2
  192. package/src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx +1 -0
  193. package/src/Prebuilt/plugins/whiteboard/ToggleWhiteboard.jsx +1 -3
  194. package/src/Prebuilt/primitives/DialogContent.jsx +4 -4
  195. package/src/Prebuilt/primitives/DropdownTrigger.jsx +3 -3
  196. package/src/Prebuilt/provider/roomLayoutProvider/constants/index.ts +33 -0
  197. package/src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts +57 -0
  198. package/src/Prebuilt/provider/roomLayoutProvider/index.tsx +26 -0
  199. package/src/Progress/index.tsx +2 -2
  200. package/src/RadioGroup/RadioGroup.tsx +3 -3
  201. package/src/ReactSelect/ReactSelect.stories.tsx +7 -7
  202. package/src/ReactSelect/ReactSelect.tsx +8 -8
  203. package/src/Select/Select.tsx +6 -6
  204. package/src/Slider/Slider.tsx +5 -5
  205. package/src/Stats/Stats.tsx +12 -2
  206. package/src/Stats/StyledStats.tsx +3 -3
  207. package/src/Switch/Switch.tsx +5 -5
  208. package/src/Tabs/Tabs.stories.tsx +2 -2
  209. package/src/Tabs/Tabs.tsx +2 -2
  210. package/src/Text/Text.tsx +2 -2
  211. package/src/Theme/ThemeProvider.tsx +4 -7
  212. package/src/Theme/ThemeStory.jsx +17 -19
  213. package/src/Theme/base.config.ts +31 -59
  214. package/src/Theme/index.tsx +0 -1
  215. package/src/Theme/stitches.config.ts +2 -7
  216. package/src/TileMenu/StyledMenuTile.tsx +9 -8
  217. package/src/Toast/Toast.tsx +10 -9
  218. package/src/Tooltip/Tooltip.stories.tsx +1 -1
  219. package/src/Tooltip/Tooltip.tsx +4 -4
  220. package/src/Video/Video.tsx +1 -1
  221. package/src/VideoTile/StyledVideoTile.tsx +12 -12
  222. package/src/assets/android-perm-0.png +0 -0
  223. package/src/assets/android-perm-1.png +0 -0
  224. package/src/assets/ios-perm-0.png +0 -0
  225. package/src/fixtures/chats.ts +1 -1
  226. package/dist/HLSView-ZYNT3HJD.js.map +0 -7
  227. package/dist/Theme/themes.d.ts +0 -64
  228. package/dist/chunk-4VY5NUK7.js.map +0 -7
  229. package/dist/chunk-BSQIN5RC.js +0 -65
  230. package/dist/chunk-BSQIN5RC.js.map +0 -7
  231. package/dist/chunk-TEHZYXCJ.js.map +0 -7
  232. package/dist/chunk-ZET2HMGS.js +0 -8331
  233. package/dist/chunk-ZET2HMGS.js.map +0 -7
  234. package/dist/conference-YHO2J3Z6.js.map +0 -7
  235. package/src/Prebuilt/components/Preview/PreviewName.jsx +0 -37
  236. package/src/Prebuilt/components/Streaming/RTMPIcon.jsx +0 -69
  237. package/src/Prebuilt/hms.js +0 -7
  238. package/src/Prebuilt/plugins/confetti.jsx +0 -60
  239. package/src/Theme/themes.ts +0 -70
  240. /package/dist/{ActiveSpeakerView-G32BDM5F.js.map → ActiveSpeakerView-4XPIRZOK.js.map} +0 -0
  241. /package/dist/{PinnedTrackView-GTXL2UTS.js.map → PinnedTrackView-GGTCNH5V.js.map} +0 -0
  242. /package/dist/{transcription-L6VBK75V.js.map → transcription-PYTSSAOB.js.map} +0 -0
@@ -1,16 +1,20 @@
1
- import React, { Suspense, useEffect } from 'react';
1
+ import React, { Suspense, useCallback, useEffect } from 'react';
2
+ import { JoinForm_JoinBtnType } from '@100mslive/types-prebuilt/elements/join_form';
2
3
  import {
3
4
  selectIsConnectedToRoom,
4
5
  selectLocalPeerRoleName,
5
6
  selectPeerScreenSharing,
6
7
  selectPeerSharingAudio,
7
8
  selectPeerSharingVideoPlaylist,
9
+ selectPermissions,
8
10
  selectTemplateAppData,
9
11
  useHMSActions,
10
12
  useHMSStore,
13
+ useRecordingStreaming,
11
14
  } from '@100mslive/react-sdk';
12
15
  import FullPageProgress from '../components/FullPageProgress';
13
16
  import { Flex } from '../../Layout';
17
+ import { useRoomLayout } from '../provider/roomLayoutProvider';
14
18
  import { EmbedView } from './EmbedView';
15
19
  import { InsetView } from './InsetView';
16
20
  import { MainGridView } from './mainGridView';
@@ -25,11 +29,12 @@ import {
25
29
  useIsHeadless,
26
30
  usePDFAnnotator,
27
31
  usePinnedTrack,
32
+ useSetAppDataByKey,
28
33
  useUISettings,
29
34
  useUrlToEmbed,
30
35
  useWaitingViewerRole,
31
36
  } from '../components/AppData/useUISettings';
32
- import { SESSION_STORE_KEY, UI_MODE_ACTIVE_SPEAKER } from '../common/constants';
37
+ import { APP_DATA, SESSION_STORE_KEY, UI_MODE_ACTIVE_SPEAKER } from '../common/constants';
33
38
 
34
39
  // const WhiteboardView = React.lazy(() => import("./WhiteboardView"));
35
40
  const HLSView = React.lazy(() => import('./HLSView'));
@@ -52,7 +57,30 @@ export const ConferenceMainView = () => {
52
57
  const hlsViewerRole = useHLSViewerRole();
53
58
  const waitingViewerRole = useWaitingViewerRole();
54
59
  const urlToIframe = useUrlToEmbed();
55
- const pdfAnntatorActive = usePDFAnnotator();
60
+ const pdfAnnotatorActive = usePDFAnnotator();
61
+
62
+ const { isHLSRunning } = useRecordingStreaming();
63
+ const [isHLSStarted, setHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
64
+ const permissions = useHMSStore(selectPermissions);
65
+ const roomLayout = useRoomLayout();
66
+ const { join_form: joinForm = {} } = roomLayout?.screens?.preview?.default?.elements || {};
67
+
68
+ const startHLS = useCallback(async () => {
69
+ try {
70
+ if (isHLSStarted) {
71
+ return;
72
+ }
73
+ setHLSStarted(true);
74
+ await hmsActions.startHLSStreaming({});
75
+ } catch (error) {
76
+ if (error.message.includes('invalid input')) {
77
+ await startHLS();
78
+ return;
79
+ }
80
+ setHLSStarted(false);
81
+ }
82
+ }, [hmsActions, isHLSStarted, setHLSStarted]);
83
+
56
84
  useEffect(() => {
57
85
  if (!isConnected) {
58
86
  return;
@@ -66,8 +94,17 @@ export const ConferenceMainView = () => {
66
94
  hmsActions.audioPlaylist.setList(audioPlaylist);
67
95
  }
68
96
 
97
+ // Is a streaming kit and broadcaster joins
98
+ if (
99
+ permissions?.hlsStreaming &&
100
+ !isHLSRunning &&
101
+ joinForm.join_btn_type === JoinForm_JoinBtnType.JOIN_BTN_TYPE_JOIN_AND_GO_LIVE
102
+ ) {
103
+ startHLS();
104
+ }
105
+
69
106
  hmsActions.sessionStore.observe([SESSION_STORE_KEY.PINNED_MESSAGE, SESSION_STORE_KEY.SPOTLIGHT]);
70
- }, [isConnected, hmsActions]);
107
+ }, [isConnected, hmsActions, permissions, joinForm]);
71
108
 
72
109
  if (!localPeerRole) {
73
110
  // we don't know the role yet to decide how to render UI
@@ -79,7 +116,7 @@ export const ConferenceMainView = () => {
79
116
  ViewComponent = HLSView;
80
117
  } else if (localPeerRole === waitingViewerRole) {
81
118
  ViewComponent = WaitingView;
82
- } else if (pdfAnntatorActive) {
119
+ } else if (pdfAnnotatorActive) {
83
120
  ViewComponent = PDFView;
84
121
  } else if (urlToIframe) {
85
122
  ViewComponent = EmbedView;
@@ -110,7 +110,7 @@ export function FlyingEmoji() {
110
110
  css={{
111
111
  width: 'fit-content',
112
112
  padding: '$2 $4',
113
- background: '$surfaceLight',
113
+ background: '$surface_bright',
114
114
  borderRadius: '$1',
115
115
  }}
116
116
  >
@@ -118,7 +118,7 @@ export function FlyingEmoji() {
118
118
  css={{
119
119
  fontSize: '$space$6',
120
120
  lineHeight: '$xs',
121
- color: '$textHighEmp',
121
+ color: '$on_surface_high',
122
122
  }}
123
123
  >
124
124
  {emoji.senderName}
@@ -71,6 +71,7 @@ export const VirtualBackground = () => {
71
71
 
72
72
  return (
73
73
  <Tooltip
74
+ boxCss={{ zIndex: '100' }}
74
75
  title={isVBLoading ? 'Adding virtual background' : `Turn ${!isVBPresent ? 'on' : 'off'} virtual background`}
75
76
  >
76
77
  <IconButton
@@ -25,9 +25,7 @@ export const ToggleWhiteboard = () => {
25
25
 
26
26
  return (
27
27
  <Tooltip
28
- title={`${
29
- whiteboardActive ? (amIWhiteboardOwner ? `Stop whiteboard` : `Can't stop whiteboard`) : 'Start whiteboard'
30
- }`}
28
+ title={whiteboardActive ? (amIWhiteboardOwner ? `Stop whiteboard` : `Can't stop whiteboard`) : 'Start whiteboard'}
31
29
  key="whiteboard"
32
30
  >
33
31
  <IconButton
@@ -21,7 +21,7 @@ export const DialogContent = ({ Icon, title, closeable = true, children, css, ic
21
21
  <Flex justify="between">
22
22
  <Flex align="center" css={{ mb: '$1' }}>
23
23
  {Icon ? (
24
- <Box css={{ mr: '$2', color: '$textPrimary', ...iconCSS }}>
24
+ <Box css={{ mr: '$2', color: '$on_primary_high', ...iconCSS }}>
25
25
  <Icon />
26
26
  </Box>
27
27
  ) : null}
@@ -49,7 +49,7 @@ export const ErrorDialog = ({ open = true, onOpenChange, title, children, ...pro
49
49
  onEscapeKeyDown={e => e.preventDefault()}
50
50
  onPointerDownOutside={e => e.preventDefault()}
51
51
  closeable={false}
52
- iconCSS={{ color: '$error' }}
52
+ iconCSS={{ color: '$alert_error_default' }}
53
53
  {...props}
54
54
  >
55
55
  <Box css={{ mt: '$lg' }}>{children}</Box>
@@ -73,7 +73,7 @@ export const RequestDialog = ({ open = true, onOpenChange, title, body, actionTe
73
73
  fontWeight: 400,
74
74
  mt: '$4',
75
75
  mb: '$10',
76
- c: '$textMedEmp',
76
+ c: '$on_surface_medium',
77
77
  }}
78
78
  >
79
79
  {body}
@@ -195,7 +195,7 @@ export const DialogInputFile = ({ value, onChange, placeholder, disabled, type,
195
195
  position: 'relative',
196
196
  cursor: 'pointer',
197
197
  py: '$12',
198
- border: '1px dashed $borderLight',
198
+ border: '1px dashed $border_bright',
199
199
  r: '$1',
200
200
  height: 'max(140px, 30%)',
201
201
  alignItems: 'center',
@@ -8,8 +8,8 @@ const DialogDropdownTrigger = React.forwardRef(({ title, css, open, icon, titleC
8
8
  asChild
9
9
  data-testid={`${title}_selector`}
10
10
  css={{
11
- border: '1px solid $borderLight',
12
- bg: '$surfaceLight',
11
+ border: '1px solid $border_bright',
12
+ bg: '$surface_bright',
13
13
  r: '$1',
14
14
  p: '$6 $9',
15
15
  zIndex: 10,
@@ -21,7 +21,7 @@ const DialogDropdownTrigger = React.forwardRef(({ title, css, open, icon, titleC
21
21
  css={{
22
22
  display: 'flex',
23
23
  justifyContent: 'space-between',
24
- color: '$textHighEmp',
24
+ color: '$on_surface_high',
25
25
  w: '100%',
26
26
  }}
27
27
  >
@@ -0,0 +1,33 @@
1
+ import type { Layout } from '@100mslive/types-prebuilt';
2
+ import { JoinForm_JoinBtnType } from '@100mslive/types-prebuilt/elements/join_form';
3
+
4
+ export const defaultLayout: Layout = {
5
+ id: '',
6
+ role_id: '',
7
+ template_id: '',
8
+ app_id: '',
9
+ typography: {
10
+ font_family: 'Inter',
11
+ },
12
+ themes: [],
13
+ options: {},
14
+ screens: {
15
+ preview: {
16
+ default: {
17
+ elements: {
18
+ preview_header: {
19
+ title: 'Get Started',
20
+ sub_title: 'Setup your audio and video before joining',
21
+ },
22
+ join_form: {
23
+ join_btn_type: JoinForm_JoinBtnType.JOIN_BTN_TYPE_JOIN_AND_GO_LIVE,
24
+ join_btn_label: 'Join Now',
25
+ go_live_btn_label: 'Go Live',
26
+ },
27
+ },
28
+ },
29
+ },
30
+ conferencing: {},
31
+ leave: {},
32
+ },
33
+ };
@@ -0,0 +1,57 @@
1
+ import { useEffect, useRef, useState } from 'react';
2
+ import type { GetResponse, Layout } from '@100mslive/types-prebuilt';
3
+ import { defaultLayout } from '../constants';
4
+
5
+ // TODO: remove this usage
6
+ const fetchWithRetry = async (url = '', options = {}) => {
7
+ const MAX_RETRIES = 4;
8
+ let error = Error('something went wrong');
9
+ for (let i = 0; i < MAX_RETRIES; i++) {
10
+ try {
11
+ return await fetch(url, options);
12
+ } catch (err) {
13
+ error = err as Error;
14
+ }
15
+ }
16
+ console.error('Fetch failed after max retries', { url, options });
17
+ throw error;
18
+ };
19
+
20
+ // this should take endpoint and return
21
+ export type useFetchRoomLayoutProps = {
22
+ endpoint?: string;
23
+ authToken: string;
24
+ };
25
+
26
+ export type useFetchRoomLayoutResponse = {
27
+ layout: Layout | undefined;
28
+ };
29
+
30
+ export const useFetchRoomLayout = ({
31
+ endpoint = '',
32
+ authToken = '',
33
+ }: useFetchRoomLayoutProps): useFetchRoomLayoutResponse => {
34
+ const [layout, setLayout] = useState<Layout | undefined>(undefined);
35
+ const isFetchInProgress = useRef(false);
36
+ useEffect(() => {
37
+ (async () => {
38
+ if (isFetchInProgress.current || !authToken) {
39
+ return;
40
+ }
41
+ if (!endpoint) {
42
+ setLayout(defaultLayout);
43
+ }
44
+ isFetchInProgress.current = true;
45
+ const resp = await fetchWithRetry(endpoint, {
46
+ headers: {
47
+ Authorization: `Bearer ${authToken}`,
48
+ },
49
+ });
50
+ const layoutResp: GetResponse = await resp.json();
51
+ setLayout(layoutResp.data[0]);
52
+ isFetchInProgress.current = false;
53
+ })();
54
+ }, [authToken, endpoint]);
55
+
56
+ return { layout };
57
+ };
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import type { Layout } from '@100mslive/types-prebuilt';
3
+ import merge from 'lodash.merge';
4
+ // @ts-ignore: fix types
5
+ import { useAuthToken } from '../../components/AppData/useUISettings';
6
+ import { useFetchRoomLayout } from './hooks/useFetchRoomLayout';
7
+
8
+ export type RoomLayoutProviderProps = {
9
+ roomLayoutEndpoint?: string;
10
+ overrideLayout?: Layout;
11
+ };
12
+
13
+ export const RoomLayoutContext = React.createContext<Layout | undefined>(undefined);
14
+
15
+ export const RoomLayoutProvider: React.FC<React.PropsWithChildren<RoomLayoutProviderProps>> = ({
16
+ children,
17
+ roomLayoutEndpoint,
18
+ overrideLayout,
19
+ }) => {
20
+ const authToken: string = useAuthToken();
21
+ let { layout } = useFetchRoomLayout({ authToken, endpoint: roomLayoutEndpoint });
22
+ layout = merge(layout, overrideLayout);
23
+ return <RoomLayoutContext.Provider value={layout}>{children}</RoomLayoutContext.Provider>;
24
+ };
25
+
26
+ export const useRoomLayout = (): Layout | undefined => React.useContext(RoomLayoutContext);
@@ -1,13 +1,13 @@
1
1
  import { Indicator, Root } from '@radix-ui/react-progress';
2
2
  import { styled } from '../Theme';
3
3
 
4
- const StyledIndicator = styled(Indicator, { h: '$4', backgroundColor: '$primaryDefault' });
4
+ const StyledIndicator = styled(Indicator, { h: '$4', backgroundColor: '$primary_default' });
5
5
 
6
6
  const StyledRoot = styled(Root, {
7
7
  w: '100%',
8
8
  h: '$4',
9
9
  borderRadius: '$round',
10
- backgroundColor: '$secondaryDark',
10
+ backgroundColor: '$secondary_dim',
11
11
  overflow: 'hidden',
12
12
  });
13
13
 
@@ -7,10 +7,10 @@ const RadioGroupRoot = styled(RadioGroupPrimitive.Root, {
7
7
  });
8
8
 
9
9
  const RadioGroupItem = styled(RadioGroupPrimitive.Item, {
10
- bg: '$white',
10
+ bg: '$on_primary_high',
11
11
  width: '$8',
12
12
  height: '$8',
13
- border: '1px solid $brandDefault',
13
+ border: '1px solid $primary_default',
14
14
  cursor: 'pointer',
15
15
  borderRadius: '$round',
16
16
  '&:focus': {
@@ -23,7 +23,7 @@ const RadioGroupItem = styled(RadioGroupPrimitive.Item, {
23
23
  },
24
24
  });
25
25
  const RadioGroupIndicator = styled(RadioGroupPrimitive.Indicator, {
26
- bg: '$brandDefault',
26
+ bg: '$primary_default',
27
27
  });
28
28
 
29
29
  export const RadioGroup = {
@@ -37,14 +37,14 @@ const data: {
37
37
  const Template: ComponentStory<typeof Select.Root> = () => {
38
38
  return (
39
39
  <Select.Root defaultValue="blueberry">
40
- <Select.Trigger css={{ bg: '$bgSecondary' }}>
40
+ <Select.Trigger css={{ bg: '$background_dim' }}>
41
41
  <Select.Value />
42
- <Flex css={{ color: '$textPrimary' }}>
42
+ <Flex css={{ color: '$on_primary_high' }}>
43
43
  <ChevronDownIcon />
44
44
  </Flex>
45
45
  </Select.Trigger>
46
46
  <Select.Content>
47
- <Select.ScrollUpButton css={{ color: '$textPrimary' }}>
47
+ <Select.ScrollUpButton css={{ color: '$on_primary_high' }}>
48
48
  <ChevronUpIcon />
49
49
  </Select.ScrollUpButton>
50
50
  <Select.Viewport>
@@ -52,7 +52,7 @@ const Template: ComponentStory<typeof Select.Root> = () => {
52
52
  <>
53
53
  <Select.Group>
54
54
  <Select.Label>
55
- <Text variant="xs" css={{ color: '$textSecondary' }}>
55
+ <Text variant="xs" css={{ color: '$on_primary_medium' }}>
56
56
  {item}
57
57
  </Text>
58
58
  </Select.Label>
@@ -61,17 +61,17 @@ const Template: ComponentStory<typeof Select.Root> = () => {
61
61
  <Select.ItemText>
62
62
  <Text variant="md">{type?.name}</Text>
63
63
  </Select.ItemText>
64
- <Select.ItemIndicator css={{ color: '$textPrimary' }}>
64
+ <Select.ItemIndicator css={{ color: '$on_primary_high' }}>
65
65
  <CheckIcon />
66
66
  </Select.ItemIndicator>
67
67
  </Select.Item>
68
68
  ))}
69
69
  </Select.Group>
70
- {index < Object.keys(data).length - 1 && <Select.Separator css={{ bg: '$borderDefault' }} />}
70
+ {index < Object.keys(data).length - 1 && <Select.Separator css={{ bg: '$border_default' }} />}
71
71
  </>
72
72
  ))}
73
73
  </Select.Viewport>
74
- <Select.ScrollDownButton css={{ color: '$textPrimary' }}>
74
+ <Select.ScrollDownButton css={{ color: '$on_primary_high' }}>
75
75
  <ChevronDownIcon />
76
76
  </Select.ScrollDownButton>
77
77
  </Select.Content>
@@ -12,8 +12,8 @@ const StyledTrigger = styled(SelectPrimitive.SelectTrigger, {
12
12
  padding: '$8',
13
13
  lineHeight: '$px',
14
14
  gap: '$8',
15
- backgroundColor: '$secondaryDefault',
16
- color: '$white',
15
+ backgroundColor: '$secondary_default',
16
+ color: '$on_primary_high',
17
17
  fontSize: '$8',
18
18
  cursor: 'pointer',
19
19
  r: '$1',
@@ -21,7 +21,7 @@ const StyledTrigger = styled(SelectPrimitive.SelectTrigger, {
21
21
 
22
22
  const StyledContent = styled(SelectPrimitive.Content, {
23
23
  overflow: 'hidden',
24
- backgroundColor: '$surfaceLight',
24
+ backgroundColor: '$surface_bright',
25
25
  r: '$1',
26
26
  h: '$80',
27
27
  });
@@ -45,12 +45,12 @@ const StyledItem = styled(SelectPrimitive.Item, {
45
45
  const StyledLabel = styled(SelectPrimitive.Label, {
46
46
  p: '$4 $8',
47
47
  lineHeight: '$10',
48
- color: '$white',
48
+ color: '$on_primary_high',
49
49
  });
50
50
 
51
51
  const StyledSeparator = styled(SelectPrimitive.Separator, {
52
52
  height: '$px',
53
- backgroundColor: '$white',
53
+ backgroundColor: '$on_primary_high',
54
54
  margin: '$4',
55
55
  opacity: 0.4,
56
56
  });
@@ -62,7 +62,7 @@ const StyledItemIndicator = styled(SelectPrimitive.ItemIndicator, {
62
62
  display: 'inline-flex',
63
63
  alignItems: 'center',
64
64
  justifyContent: 'center',
65
- color: '$white',
65
+ color: '$on_primary_high',
66
66
  });
67
67
 
68
68
  const scrollButtonStyles = {
@@ -70,8 +70,8 @@ const scrollButtonStyles = {
70
70
  alignItems: 'center',
71
71
  justifyContent: 'center',
72
72
  p: '$4',
73
- backgroundColor: '$surfaceLight',
74
- color: '$white',
73
+ backgroundColor: '$surface_bright',
74
+ color: '$on_primary_high',
75
75
  cursor: 'default',
76
76
  };
77
77
 
@@ -3,13 +3,13 @@ import { ChevronDownIcon } from '@100mslive/react-icons';
3
3
  import { styled } from '../Theme';
4
4
 
5
5
  const Root = styled('div', {
6
- color: '$textPrimary',
6
+ color: '$on_primary_high',
7
7
  display: 'inline-flex',
8
8
  position: 'relative',
9
9
  outline: 'none',
10
10
  overflow: 'hidden',
11
11
  borderRadius: '$1',
12
- backgroundColor: '$menuBg',
12
+ backgroundColor: '$surface_default',
13
13
  maxWidth: '100%',
14
14
  });
15
15
 
@@ -21,15 +21,15 @@ const SelectRoot = styled('select', {
21
21
  lineHeight: 'inherit',
22
22
  textTransform: 'none',
23
23
  appearance: 'none',
24
- color: '$textAccentHigh',
24
+ color: '$on_secondary_high',
25
25
  padding: '5px',
26
26
  paddingLeft: '12px',
27
27
  paddingRight: '30px',
28
28
  border: 'none',
29
29
  borderRadius: '8px',
30
- backgroundColor: '$secondaryDefault',
30
+ backgroundColor: '$secondary_default',
31
31
  '&:not([disabled]):focus-visible': {
32
- boxShadow: '0 0 0 3px $colors$brandDefault',
32
+ boxShadow: '0 0 0 3px $colors$primary_default',
33
33
  },
34
34
  '&[disabled]': {
35
35
  opacity: 0.5,
@@ -38,7 +38,7 @@ const SelectRoot = styled('select', {
38
38
  });
39
39
 
40
40
  const Arrow = styled('span', {
41
- color: '$textAccentMedium',
41
+ color: '$on_secondary_high',
42
42
  width: '30px',
43
43
  height: '100%',
44
44
  position: 'absolute',
@@ -17,7 +17,7 @@ const Root = styled(BaseSlider.Root, {
17
17
  });
18
18
 
19
19
  const Track = styled(BaseSlider.Track, {
20
- backgroundColor: '$secondaryGray',
20
+ backgroundColor: '$surface_bright',
21
21
  position: 'relative',
22
22
  flexGrow: 1,
23
23
  borderRadius: '$round',
@@ -27,7 +27,7 @@ const Track = styled(BaseSlider.Track, {
27
27
 
28
28
  const Range = styled(BaseSlider.Range, {
29
29
  position: 'absolute',
30
- backgroundColor: '$primaryDefault',
30
+ backgroundColor: '$primary_default',
31
31
  borderRadius: '$round',
32
32
  height: '100%',
33
33
  });
@@ -37,11 +37,11 @@ const Thumb = styled(BaseSlider.Thumb, {
37
37
  display: 'block',
38
38
  width: '$8',
39
39
  height: '$8',
40
- backgroundColor: '$primaryDefault',
40
+ backgroundColor: '$primary_default',
41
41
  cursor: 'pointer',
42
- boxShadow: `0 2px 10px $colors$grayDefault`,
42
+ boxShadow: `0 2px 10px $colors$surface_default`,
43
43
  borderRadius: 10,
44
- '&:hover': { backgroundColor: '$primaryDefault' },
44
+ '&:hover': { backgroundColor: '$primary_default' },
45
45
  '&:focus': { boxShadow: 'none' },
46
46
  });
47
47
 
@@ -120,7 +120,7 @@ export function VideoTileStats({ videoTrackID, audioTrackID, peerID, isLocal = f
120
120
  value={formatBytes(audioTrackStats?.bitrate, 'b/s')}
121
121
  />
122
122
 
123
- <StatsRow show={isNotNullish(downlinkScore)} label="Downlink" value={`${downlinkScore}`} />
123
+ <StatsRow show={isNotNullish(downlinkScore)} label="Downlink" value={downlinkScore} />
124
124
 
125
125
  <StatsRow show={isNotNullish(videoTrackStats?.codec)} label="Codec(V)" value={videoTrackStats?.codec} />
126
126
 
@@ -174,7 +174,17 @@ const TrackPacketsLostRow = ({
174
174
  );
175
175
  };
176
176
 
177
- const RawStatsRow = ({ label = '', value = '', tooltip = '', show = true }) => {
177
+ const RawStatsRow = ({
178
+ label = '',
179
+ value = '',
180
+ tooltip = '',
181
+ show = true,
182
+ }: {
183
+ label: string;
184
+ value?: string | number;
185
+ show?: boolean;
186
+ tooltip?: string;
187
+ }) => {
178
188
  const statsLabel = <Stats.Label css={{ fontWeight: !value ? '$semiBold' : '$regular' }}>{label}</Stats.Label>;
179
189
 
180
190
  return (
@@ -1,7 +1,7 @@
1
1
  import { styled } from '../Theme';
2
2
 
3
3
  export const Root = styled('div', {
4
- backgroundColor: '$statsBg',
4
+ backgroundColor: 'rgba(0,0,0,0.75)',
5
5
  position: 'absolute',
6
6
  top: '$3',
7
7
  left: '$3',
@@ -26,12 +26,12 @@ export const Row = styled('tr', {
26
26
  });
27
27
 
28
28
  export const Label = styled('td', {
29
- color: '$textPrimary',
29
+ color: '$on_primary_high',
30
30
  fontWeight: '$regular',
31
31
  });
32
32
 
33
33
  export const Value = styled('td', {
34
- color: '$textPrimary',
34
+ color: '$on_primary_high',
35
35
  });
36
36
 
37
37
  export const Gap = styled('tr', {
@@ -6,14 +6,14 @@ const SwitchRoot = styled(BaseSwitch.Root, {
6
6
  all: 'unset',
7
7
  width: '30px',
8
8
  height: '14px',
9
- border: 'solid $space$px $secondaryDefault',
9
+ border: 'solid $space$px $secondary_default',
10
10
  borderRadius: '$3',
11
11
  p: '$2',
12
12
  position: 'relative',
13
13
  cursor: 'pointer',
14
14
  '&[data-state="checked"]': {
15
- backgroundColor: '$primaryDefault',
16
- border: 'solid $space$px $primaryDefault',
15
+ backgroundColor: '$primary_default',
16
+ border: 'solid $space$px $primary_default',
17
17
  },
18
18
  '&:focus': {
19
19
  outline: 'none',
@@ -30,14 +30,14 @@ const SwitchThumb = styled(BaseSwitch.Thumb, {
30
30
  position: 'absolute',
31
31
  width: '$md',
32
32
  height: '$md',
33
- backgroundColor: '$secondaryDefault',
33
+ backgroundColor: '$secondary_default',
34
34
  borderRadius: '$round',
35
35
  transition: 'right 500ms ease-in',
36
36
  left: '$2',
37
37
  '&[data-state="checked"]': {
38
38
  left: 'unset',
39
39
  right: '$2',
40
- backgroundColor: '$textAccentHigh',
40
+ backgroundColor: '$on_primary_high',
41
41
  },
42
42
  });
43
43
 
@@ -52,13 +52,13 @@ const Template: ComponentStory<typeof Tabs.Root> = ({
52
52
  >
53
53
  <Tabs.List
54
54
  aria-label="tabs example"
55
- css={{ bg: '$bgSecondary', r: '$1', '&[data-orientation="vertical"]': { flexDirection: 'column' } }}
55
+ css={{ bg: '$background_dim', r: '$1', '&[data-orientation="vertical"]': { flexDirection: 'column' } }}
56
56
  >
57
57
  <Tabs.Trigger value="tab1">One</Tabs.Trigger>
58
58
  <Tabs.Trigger value="tab2">Two</Tabs.Trigger>
59
59
  <Tabs.Trigger value="tab3">Three</Tabs.Trigger>
60
60
  </Tabs.List>
61
- <Box css={{ r: '$1', bg: '$bgTertiary' }}>
61
+ <Box css={{ r: '$1', bg: '$surface_brighter' }}>
62
62
  <Tabs.Content value="tab1">
63
63
  <Text>Tab one content</Text>
64
64
  </Tabs.Content>
package/src/Tabs/Tabs.tsx CHANGED
@@ -18,11 +18,11 @@ const StyledTrigger = styled(TabsPrimitive.Trigger, {
18
18
  alignItems: 'center',
19
19
  fontSize: '$sm',
20
20
  lineHeight: '$sm',
21
- color: '$textHighEmp',
21
+ color: '$on_surface_high',
22
22
  userSelect: 'none',
23
23
  cursor: 'pointer',
24
24
  '&[data-state="active"]': {
25
- bg: '$surfaceLighter',
25
+ bg: '$surface_brighter',
26
26
  r: '$1',
27
27
  },
28
28
  });
package/src/Text/Text.tsx CHANGED
@@ -129,12 +129,12 @@ export const Text = styled('p', {
129
129
  fontFamily: '$sans',
130
130
  fontWeight: '$regular',
131
131
  margin: 0,
132
- color: '$textPrimary',
132
+ color: '$on_surface_high',
133
133
  variants: {
134
134
  variant: textVariants,
135
135
  color: {
136
136
  white: {
137
- color: '$white',
137
+ color: '$on_surface_high',
138
138
  },
139
139
  },
140
140
  inline: {