@100mslive/roomkit-react 0.2.6-alpha.5 → 0.2.6-alpha.7

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -62,7 +62,7 @@ import {
62
62
  theme,
63
63
  useBorderAudioLevel,
64
64
  useTheme
65
- } from "./chunk-HWYKJQTV.js";
65
+ } from "./chunk-YHMYZQEP.js";
66
66
  export {
67
67
  Accordion,
68
68
  AudioLevel,
@@ -4523,7 +4523,7 @@
4523
4523
  "format": "cjs"
4524
4524
  },
4525
4525
  "../hms-video-store/dist/index.js": {
4526
- "bytes": 322541,
4526
+ "bytes": 322683,
4527
4527
  "imports": [
4528
4528
  {
4529
4529
  "path": "../../node_modules/reselect/es/index.js",
@@ -6287,7 +6287,7 @@
6287
6287
  "format": "esm"
6288
6288
  },
6289
6289
  "src/Prebuilt/components/Polls/CreatePollQuiz/PollsQuizMenu.tsx": {
6290
- "bytes": 7747,
6290
+ "bytes": 8005,
6291
6291
  "imports": [
6292
6292
  {
6293
6293
  "path": "react",
@@ -7489,7 +7489,7 @@
7489
7489
  "format": "esm"
7490
7490
  },
7491
7491
  "src/Prebuilt/components/Chat/ChatBody.tsx": {
7492
- "bytes": 14776,
7492
+ "bytes": 14835,
7493
7493
  "imports": [
7494
7494
  {
7495
7495
  "path": "react",
@@ -7973,7 +7973,7 @@
7973
7973
  "format": "esm"
7974
7974
  },
7975
7975
  "src/Prebuilt/components/Chat/PinnedMessage.tsx": {
7976
- "bytes": 5067,
7976
+ "bytes": 5026,
7977
7977
  "imports": [
7978
7978
  {
7979
7979
  "path": "react",
@@ -10741,7 +10741,7 @@
10741
10741
  "format": "esm"
10742
10742
  },
10743
10743
  "src/Prebuilt/layouts/HLSView.jsx": {
10744
- "bytes": 18115,
10744
+ "bytes": 17554,
10745
10745
  "imports": [
10746
10746
  {
10747
10747
  "path": "react",
@@ -12790,7 +12790,7 @@
12790
12790
  "imports": [],
12791
12791
  "exports": [],
12792
12792
  "inputs": {},
12793
- "bytes": 3167561
12793
+ "bytes": 3167600
12794
12794
  },
12795
12795
  "dist/index.cjs.js": {
12796
12796
  "imports": [
@@ -15499,7 +15499,7 @@
15499
15499
  "entryPoint": "src/index.ts",
15500
15500
  "inputs": {
15501
15501
  "<define:process.env>": {
15502
- "bytesInOutput": 18159
15502
+ "bytesInOutput": 18167
15503
15503
  },
15504
15504
  "src/Theme/base.config.ts": {
15505
15505
  "bytesInOutput": 6104
@@ -16090,7 +16090,7 @@
16090
16090
  "bytesInOutput": 1165
16091
16091
  },
16092
16092
  "src/Prebuilt/components/Polls/CreatePollQuiz/PollsQuizMenu.tsx": {
16093
- "bytesInOutput": 9104
16093
+ "bytesInOutput": 9610
16094
16094
  },
16095
16095
  "src/Prebuilt/components/Polls/CreateQuestions/DeleteQuestionModal.tsx": {
16096
16096
  "bytesInOutput": 2786
@@ -16177,7 +16177,7 @@
16177
16177
  "bytesInOutput": 920
16178
16178
  },
16179
16179
  "src/Prebuilt/components/Chat/ChatBody.tsx": {
16180
- "bytesInOutput": 17105
16180
+ "bytesInOutput": 17147
16181
16181
  },
16182
16182
  "src/Prebuilt/components/Chat/ChatSelector.tsx": {
16183
16183
  "bytesInOutput": 8560
@@ -16204,7 +16204,7 @@
16204
16204
  "bytesInOutput": 827
16205
16205
  },
16206
16206
  "src/Prebuilt/components/Chat/PinnedMessage.tsx": {
16207
- "bytesInOutput": 6150
16207
+ "bytesInOutput": 6106
16208
16208
  },
16209
16209
  "src/Prebuilt/components/Chat/Chat.tsx": {
16210
16210
  "bytesInOutput": 4402
@@ -16378,7 +16378,7 @@
16378
16378
  "bytesInOutput": 4598
16379
16379
  },
16380
16380
  "src/Prebuilt/layouts/HLSView.jsx": {
16381
- "bytesInOutput": 21671
16381
+ "bytesInOutput": 21219
16382
16382
  },
16383
16383
  "src/Prebuilt/layouts/VideoStreamingSection.tsx": {
16384
16384
  "bytesInOutput": 4111
@@ -16507,7 +16507,7 @@
16507
16507
  "bytesInOutput": 2980
16508
16508
  }
16509
16509
  },
16510
- "bytes": 1488659
16510
+ "bytes": 1488719
16511
16511
  }
16512
16512
  }
16513
16513
  }
@@ -4523,7 +4523,7 @@
4523
4523
  "format": "cjs"
4524
4524
  },
4525
4525
  "../hms-video-store/dist/index.js": {
4526
- "bytes": 322541,
4526
+ "bytes": 322683,
4527
4527
  "imports": [
4528
4528
  {
4529
4529
  "path": "../../node_modules/reselect/es/index.js",
@@ -6287,7 +6287,7 @@
6287
6287
  "format": "esm"
6288
6288
  },
6289
6289
  "src/Prebuilt/components/Polls/CreatePollQuiz/PollsQuizMenu.tsx": {
6290
- "bytes": 7747,
6290
+ "bytes": 8005,
6291
6291
  "imports": [
6292
6292
  {
6293
6293
  "path": "react",
@@ -7489,7 +7489,7 @@
7489
7489
  "format": "esm"
7490
7490
  },
7491
7491
  "src/Prebuilt/components/Chat/ChatBody.tsx": {
7492
- "bytes": 14776,
7492
+ "bytes": 14835,
7493
7493
  "imports": [
7494
7494
  {
7495
7495
  "path": "react",
@@ -7973,7 +7973,7 @@
7973
7973
  "format": "esm"
7974
7974
  },
7975
7975
  "src/Prebuilt/components/Chat/PinnedMessage.tsx": {
7976
- "bytes": 5067,
7976
+ "bytes": 5026,
7977
7977
  "imports": [
7978
7978
  {
7979
7979
  "path": "react",
@@ -10741,7 +10741,7 @@
10741
10741
  "format": "esm"
10742
10742
  },
10743
10743
  "src/Prebuilt/layouts/HLSView.jsx": {
10744
- "bytes": 18115,
10744
+ "bytes": 17554,
10745
10745
  "imports": [
10746
10746
  {
10747
10747
  "path": "react",
@@ -12795,7 +12795,7 @@
12795
12795
  "dist/index.js": {
12796
12796
  "imports": [
12797
12797
  {
12798
- "path": "dist/chunk-HWYKJQTV.js",
12798
+ "path": "dist/chunk-YHMYZQEP.js",
12799
12799
  "kind": "import-statement"
12800
12800
  }
12801
12801
  ],
@@ -12868,16 +12868,16 @@
12868
12868
  "inputs": {},
12869
12869
  "bytes": 1822
12870
12870
  },
12871
- "dist/HLSView-EWCMUTSW.js.map": {
12871
+ "dist/HLSView-XYQZRLID.js.map": {
12872
12872
  "imports": [],
12873
12873
  "exports": [],
12874
12874
  "inputs": {},
12875
- "bytes": 59619
12875
+ "bytes": 58854
12876
12876
  },
12877
- "dist/HLSView-EWCMUTSW.js": {
12877
+ "dist/HLSView-XYQZRLID.js": {
12878
12878
  "imports": [
12879
12879
  {
12880
- "path": "dist/chunk-HWYKJQTV.js",
12880
+ "path": "dist/chunk-YHMYZQEP.js",
12881
12881
  "kind": "import-statement"
12882
12882
  },
12883
12883
  {
@@ -12997,7 +12997,7 @@
12997
12997
  "entryPoint": "src/Prebuilt/layouts/HLSView.jsx",
12998
12998
  "inputs": {
12999
12999
  "src/Prebuilt/layouts/HLSView.jsx": {
13000
- "bytesInOutput": 17725
13000
+ "bytesInOutput": 17353
13001
13001
  },
13002
13002
  "src/Prebuilt/components/HlsStatsOverlay.jsx": {
13003
13003
  "bytesInOutput": 3521
@@ -13039,15 +13039,15 @@
13039
13039
  "bytesInOutput": 3992
13040
13040
  }
13041
13041
  },
13042
- "bytes": 37344
13042
+ "bytes": 36972
13043
13043
  },
13044
- "dist/chunk-HWYKJQTV.js.map": {
13044
+ "dist/chunk-YHMYZQEP.js.map": {
13045
13045
  "imports": [],
13046
13046
  "exports": [],
13047
13047
  "inputs": {},
13048
- "bytes": 3103727
13048
+ "bytes": 3104535
13049
13049
  },
13050
- "dist/chunk-HWYKJQTV.js": {
13050
+ "dist/chunk-YHMYZQEP.js": {
13051
13051
  "imports": [
13052
13052
  {
13053
13053
  "path": "react",
@@ -15300,7 +15300,7 @@
15300
15300
  "external": true
15301
15301
  },
15302
15302
  {
15303
- "path": "dist/HLSView-EWCMUTSW.js",
15303
+ "path": "dist/HLSView-XYQZRLID.js",
15304
15304
  "kind": "dynamic-import"
15305
15305
  },
15306
15306
  {
@@ -15722,7 +15722,7 @@
15722
15722
  ],
15723
15723
  "inputs": {
15724
15724
  "<define:process.env>": {
15725
- "bytesInOutput": 18159
15725
+ "bytesInOutput": 18167
15726
15726
  },
15727
15727
  "../../node_modules/lodash/lodash.js": {
15728
15728
  "bytesInOutput": 224267
@@ -16292,7 +16292,7 @@
16292
16292
  "bytesInOutput": 735
16293
16293
  },
16294
16294
  "src/Prebuilt/components/Polls/CreatePollQuiz/PollsQuizMenu.tsx": {
16295
- "bytesInOutput": 7536
16295
+ "bytesInOutput": 7983
16296
16296
  },
16297
16297
  "src/Prebuilt/components/Streaming/Common.jsx": {
16298
16298
  "bytesInOutput": 2247
@@ -16367,7 +16367,7 @@
16367
16367
  "bytesInOutput": 3466
16368
16368
  },
16369
16369
  "src/Prebuilt/components/Chat/ChatBody.tsx": {
16370
- "bytesInOutput": 14354
16370
+ "bytesInOutput": 14396
16371
16371
  },
16372
16372
  "src/Prebuilt/components/Chat/ChatActions.tsx": {
16373
16373
  "bytesInOutput": 9785
@@ -16409,7 +16409,7 @@
16409
16409
  "bytesInOutput": 2916
16410
16410
  },
16411
16411
  "src/Prebuilt/components/Chat/PinnedMessage.tsx": {
16412
- "bytesInOutput": 4980
16412
+ "bytesInOutput": 4944
16413
16413
  },
16414
16414
  "src/Prebuilt/components/Chat/ArrowNavigation.tsx": {
16415
16415
  "bytesInOutput": 1021
@@ -16649,7 +16649,7 @@
16649
16649
  "bytesInOutput": 651
16650
16650
  }
16651
16651
  },
16652
- "bytes": 1266239
16652
+ "bytes": 1266700
16653
16653
  }
16654
16654
  }
16655
16655
  }
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "prebuilt",
11
11
  "roomkit"
12
12
  ],
13
- "version": "0.2.6-alpha.5",
13
+ "version": "0.2.6-alpha.7",
14
14
  "author": "100ms",
15
15
  "license": "MIT",
16
16
  "repository": {
@@ -82,10 +82,10 @@
82
82
  "react": ">=17.0.2 <19.0.0"
83
83
  },
84
84
  "dependencies": {
85
- "@100mslive/hls-player": "0.2.6-alpha.5",
86
- "@100mslive/hms-virtual-background": "1.12.6-alpha.5",
87
- "@100mslive/react-icons": "0.9.6-alpha.5",
88
- "@100mslive/react-sdk": "0.9.6-alpha.5",
85
+ "@100mslive/hls-player": "0.2.6-alpha.7",
86
+ "@100mslive/hms-virtual-background": "1.12.6-alpha.7",
87
+ "@100mslive/react-icons": "0.9.6-alpha.7",
88
+ "@100mslive/react-sdk": "0.9.6-alpha.7",
89
89
  "@100mslive/types-prebuilt": "0.12.6",
90
90
  "@emoji-mart/data": "^1.0.6",
91
91
  "@emoji-mart/react": "^1.0.1",
@@ -120,5 +120,5 @@
120
120
  "uuid": "^8.3.2",
121
121
  "worker-timers": "^7.0.40"
122
122
  },
123
- "gitHead": "dd470c3002085468208fabc315a48ce80321e4ed"
123
+ "gitHead": "bfc59894d860031e9aac66d839b0b3febdc3961b"
124
124
  }
@@ -136,7 +136,7 @@ const Link = styled('a', {
136
136
  },
137
137
  });
138
138
 
139
- export const AnnotisedMessage = ({ message }: { message: string }) => {
139
+ export const AnnotisedMessage = ({ message, length }: { message: string; length?: number }) => {
140
140
  if (!message) {
141
141
  return <Fragment />;
142
142
  }
@@ -149,10 +149,10 @@ export const AnnotisedMessage = ({ message }: { message: string }) => {
149
149
  .map(part =>
150
150
  URL_REGEX.test(part) ? (
151
151
  <Link href={part} key={part} target="_blank" rel="noopener noreferrer">
152
- {part}
152
+ {part.slice(0, length)}
153
153
  </Link>
154
154
  ) : (
155
- part
155
+ part.slice(0, length)
156
156
  ),
157
157
  )}
158
158
  </Fragment>
@@ -103,10 +103,8 @@ export const PinnedMessage = () => {
103
103
  title={pinnedMessages[pinnedMessageIndex]?.text}
104
104
  >
105
105
  <AnnotisedMessage
106
- message={`${currentPinnedMessage.slice(
107
- 0,
108
- hideOverflow ? PINNED_MESSAGE_LENGTH : currentPinnedMessage.length,
109
- )}`}
106
+ message={currentPinnedMessage}
107
+ length={hideOverflow ? PINNED_MESSAGE_LENGTH : currentPinnedMessage.length}
110
108
  />
111
109
  {canOverflow ? (
112
110
  <span style={{ cursor: 'pointer' }} onClick={() => setHideOverflow(prev => !prev)}>
@@ -195,6 +195,13 @@ const AddMenu = () => {
195
195
  const PrevMenu = () => {
196
196
  const hmsActions = useHMSActions();
197
197
  const polls = useHMSStore(selectPolls);
198
+ const sortedPolls = useMemo(
199
+ () =>
200
+ polls
201
+ ?.sort((a, b) => (b.createdAt?.getTime() || 0) - (a.createdAt?.getTime() || 0))
202
+ ?.sort((a, b) => (b.state === 'started' ? 1 : 0) - (a.state === 'started' ? 1 : 0)),
203
+ [polls],
204
+ );
198
205
  const permissions = useHMSStore(selectPermissions);
199
206
 
200
207
  useEffect(() => {
@@ -217,7 +224,7 @@ const PrevMenu = () => {
217
224
  Previous Polls and Quizzes
218
225
  </Text>
219
226
  <Flex direction="column" css={{ gap: '$10', mt: '$8' }}>
220
- {polls?.map(poll => (
227
+ {sortedPolls?.map(poll => (
221
228
  <InteractionCard key={poll.id} id={poll.id} title={poll.title} status={poll.state} />
222
229
  ))}
223
230
  </Flex>
@@ -351,7 +351,6 @@ const HLSView = () => {
351
351
  </IconButton>
352
352
  </Box>
353
353
  )}
354
-
355
354
  <Flex
356
355
  ref={controlsRef}
357
356
  direction="column"
@@ -371,90 +370,78 @@ const HLSView = () => {
371
370
  }}
372
371
  >
373
372
  {!isMobile && (
374
- <Flex direction="column">
375
- <Box>
376
- {hlsPlayer && (
377
- <HMSVideoPlayer.Progress
378
- hlsPlayer={hlsPlayer}
379
- onValueChange={time => {
380
- hlsPlayer.seekTo(time);
381
- }}
382
- />
373
+ <HMSVideoPlayer.Controls.Root
374
+ css={{
375
+ p: '$4 $8',
376
+ }}
377
+ >
378
+ <HMSVideoPlayer.Controls.Left>
379
+ <HMSVideoPlayer.PlayButton
380
+ onClick={async () => {
381
+ isPaused ? await hlsPlayer?.play() : hlsPlayer?.pause();
382
+ }}
383
+ isPaused={isPaused}
384
+ />
385
+ <HMSVideoPlayer.Duration hlsPlayer={hlsPlayer} />
386
+ <HMSVideoPlayer.Volume hlsPlayer={hlsPlayer} />
387
+ <IconButton
388
+ variant="standard"
389
+ css={{ px: '$2' }}
390
+ onClick={async () => {
391
+ await hlsPlayer.seekToLivePosition();
392
+ setIsVideoLive(true);
393
+ }}
394
+ key="jump-to-live_btn"
395
+ data-testid="jump-to-live_btn"
396
+ >
397
+ <Tooltip title="Go to Live" side="top">
398
+ <Flex justify="center" gap={2} align="center">
399
+ <Box
400
+ css={{
401
+ height: '$4',
402
+ width: '$4',
403
+ background: isVideoLive ? '$alert_error_default' : '$on_primary_medium',
404
+ r: '$1',
405
+ }}
406
+ />
407
+ <Text
408
+ variant={{
409
+ '@sm': 'xs',
410
+ }}
411
+ css={{
412
+ c: isVideoLive ? '$on_surface_high' : '$on_surface_medium',
413
+ }}
414
+ >
415
+ {isVideoLive ? 'LIVE' : 'GO LIVE'}
416
+ </Text>
417
+ </Flex>
418
+ </Tooltip>
419
+ </IconButton>
420
+ </HMSVideoPlayer.Controls.Left>
421
+
422
+ <HMSVideoPlayer.Controls.Right>
423
+ {hasCaptions && (
424
+ <HLSCaptionSelector onClick={() => hlsPlayer?.toggleCaption()} isEnabled={isCaptionEnabled} />
383
425
  )}
384
- </Box>
385
- <HMSVideoPlayer.Controls.Root
386
- css={{
387
- p: '$4 $8',
388
- }}
389
- >
390
- <HMSVideoPlayer.Controls.Left>
391
- <HMSVideoPlayer.PlayButton
392
- onClick={async () => {
393
- isPaused ? await hlsPlayer?.play() : hlsPlayer?.pause();
394
- }}
395
- isPaused={isPaused}
426
+ {availableLayers.length > 0 ? (
427
+ <HLSQualitySelector
428
+ layers={availableLayers}
429
+ onOpen={setQualityDropDownOpen}
430
+ open={qualityDropDownOpen}
431
+ selection={currentSelectedQuality}
432
+ onQualityChange={handleQuality}
433
+ isAuto={isUserSelectedAuto}
396
434
  />
397
- <HMSVideoPlayer.Duration hlsPlayer={hlsPlayer} />
398
- <HMSVideoPlayer.Volume hlsPlayer={hlsPlayer} />
399
- <IconButton
400
- variant="standard"
401
- css={{ px: '$2' }}
402
- onClick={async () => {
403
- await hlsPlayer.seekToLivePosition();
404
- setIsVideoLive(true);
405
- }}
406
- key="jump-to-live_btn"
407
- data-testid="jump-to-live_btn"
408
- >
409
- <Tooltip title="Go to Live" side="top">
410
- <Flex justify="center" gap={2} align="center">
411
- <Box
412
- css={{
413
- height: '$4',
414
- width: '$4',
415
- background: isVideoLive ? '$alert_error_default' : '$on_primary_medium',
416
- r: '$1',
417
- }}
418
- />
419
- <Text
420
- variant={{
421
- '@sm': 'xs',
422
- }}
423
- css={{
424
- c: isVideoLive ? '$on_surface_high' : '$on_surface_medium',
425
- }}
426
- >
427
- {isVideoLive ? 'LIVE' : 'GO LIVE'}
428
- </Text>
429
- </Flex>
430
- </Tooltip>
431
- </IconButton>
432
- </HMSVideoPlayer.Controls.Left>
433
-
434
- <HMSVideoPlayer.Controls.Right>
435
- {hasCaptions && (
436
- <HLSCaptionSelector onClick={() => hlsPlayer?.toggleCaption()} isEnabled={isCaptionEnabled} />
437
- )}
438
- {availableLayers.length > 0 ? (
439
- <HLSQualitySelector
440
- layers={availableLayers}
441
- onOpen={setQualityDropDownOpen}
442
- open={qualityDropDownOpen}
443
- selection={currentSelectedQuality}
444
- onQualityChange={handleQuality}
445
- isAuto={isUserSelectedAuto}
446
- />
447
- ) : null}
448
- {isFullScreenSupported ? (
449
- <FullScreenButton
450
- isFullScreen={isFullScreen}
451
- onToggle={toggle}
452
- icon={isFullScreen ? <ShrinkIcon /> : <ExpandIcon />}
453
- />
454
- ) : null}
455
- </HMSVideoPlayer.Controls.Right>
456
- </HMSVideoPlayer.Controls.Root>
457
- </Flex>
435
+ ) : null}
436
+ {isFullScreenSupported ? (
437
+ <FullScreenButton
438
+ isFullScreen={isFullScreen}
439
+ onToggle={toggle}
440
+ icon={isFullScreen ? <ShrinkIcon /> : <ExpandIcon />}
441
+ />
442
+ ) : null}
443
+ </HMSVideoPlayer.Controls.Right>
444
+ </HMSVideoPlayer.Controls.Root>
458
445
  )}
459
446
  </Flex>
460
447
  </HMSVideoPlayer.Root>