@100mslive/roomkit-react 0.4.3-alpha.0 → 0.4.3-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Prebuilt/App.d.ts +1 -0
- package/dist/Prebuilt/AppContext.d.ts +1 -0
- package/dist/index.cjs.css +2 -2
- package/dist/index.cjs.css.map +1 -1
- package/dist/index.cjs.js +79 -11
- package/dist/index.cjs.js.map +3 -3
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/index.js +79 -11
- package/dist/index.js.map +3 -3
- package/dist/meta.cjs.json +22 -17
- package/dist/meta.esbuild.json +22 -17
- package/package.json +8 -20
- package/src/Prebuilt/App.tsx +6 -1
- package/src/Prebuilt/AppContext.tsx +1 -0
- package/src/Prebuilt/layouts/HLSView.jsx +51 -4
- package/src/Accordion/Accordion.stories.tsx +0 -50
- package/src/Avatar/Avatar.stories.tsx +0 -33
- package/src/Button/Button.mdx +0 -43
- package/src/Button/Button.stories.tsx +0 -52
- package/src/Chat/Chat.mdx +0 -39
- package/src/Chat/Chat.stories.tsx +0 -39
- package/src/Checkbox/Checkbox.stories.tsx +0 -61
- package/src/Divider/HorizontalDivider.stories.tsx +0 -34
- package/src/Divider/VerticalDivider.stories.tsx +0 -40
- package/src/Dropdown/Dropdown.stories.tsx +0 -94
- package/src/Fieldset/Fieldset.stories.tsx +0 -29
- package/src/Footer/Footer.stories.tsx +0 -61
- package/src/Icons/Icons.stories.mdx +0 -10
- package/src/Icons/IconsList.jsx +0 -17
- package/src/Input/Input.stories.tsx +0 -25
- package/src/Input/PasswordInput.stories.tsx +0 -53
- package/src/Introduction/Integrating.stories.mdx +0 -100
- package/src/Introduction/Introduction.stories.mdx +0 -9
- package/src/Link/Link.stories.tsx +0 -18
- package/src/Loading/Loading.mdx +0 -15
- package/src/Loading/Loading.stories.tsx +0 -37
- package/src/Modal/Dialog.mdx +0 -19
- package/src/Modal/Dialog.stories.tsx +0 -68
- package/src/Pagination/StyledPagination.stories.tsx +0 -80
- package/src/Popover/Popover.mdx +0 -9
- package/src/Popover/Popover.stories.tsx +0 -95
- package/src/Prebuilt/Prebuilt.stories.tsx +0 -46
- package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.stories.tsx +0 -40
- package/src/QRCode/QRCode.mdx +0 -9
- package/src/QRCode/QRCode.stories.tsx +0 -29
- package/src/RadioGroup/RadioGroup.stories.tsx +0 -32
- package/src/ReactSelect/ReactSelect.stories.tsx +0 -83
- package/src/Select/Select.stories.tsx +0 -33
- package/src/Sheet/Sheet.mdx +0 -19
- package/src/Sheet/Sheet.stories.tsx +0 -103
- package/src/Slider/Slider.stories.tsx +0 -21
- package/src/Switch/Switch.mdx +0 -11
- package/src/Switch/Switch.stories.tsx +0 -46
- package/src/Tabs/Tabs.stories.tsx +0 -77
- package/src/Text/Text.stories.tsx +0 -21
- package/src/Theme/Theme.stories.mdx +0 -8
- package/src/Theme/ThemeStory.jsx +0 -56
- package/src/Toast/AppToast.stories.tsx +0 -56
- package/src/Toast/Toast.mdx +0 -19
- package/src/Toast/Toast.stories.tsx +0 -57
- package/src/Tooltip/Tooltip.stories.tsx +0 -62
- package/src/Video/UseVideo.mdx +0 -22
- package/src/Video/UseVideo.stories.tsx +0 -26
- package/src/Video/Video.mdx +0 -24
- package/src/Video/Video.stories.tsx +0 -27
- package/src/VideoList/VideoList.stories.tsx +0 -92
- package/src/VideoTile/VideoTile.mdx +0 -28
- package/src/VideoTile/VideoTile.stories.tsx +0 -32
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { ComponentStory } from '@storybook/react';
|
|
3
|
-
import { selectPeers, useHMSStore, useVideoList } from '@100mslive/react-sdk';
|
|
4
|
-
import { MicOffIcon } from '@100mslive/react-icons';
|
|
5
|
-
import { Video } from '../Video/Video';
|
|
6
|
-
import { StyledVideoTile } from '../VideoTile';
|
|
7
|
-
import { StyledVideoList } from './StyledVideoList';
|
|
8
|
-
import { getLeft } from './videoListUtils';
|
|
9
|
-
|
|
10
|
-
const VideoListMeta = {
|
|
11
|
-
title: 'Video/VideoList',
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export default VideoListMeta;
|
|
15
|
-
|
|
16
|
-
const VideoTile: React.FC<{ width: number; height: number; trackId: string; name: string }> = ({
|
|
17
|
-
width,
|
|
18
|
-
height,
|
|
19
|
-
trackId,
|
|
20
|
-
name,
|
|
21
|
-
}) => {
|
|
22
|
-
return (
|
|
23
|
-
<StyledVideoTile.Root css={{ width, height }}>
|
|
24
|
-
<StyledVideoTile.Container>
|
|
25
|
-
<Video trackId={trackId} />
|
|
26
|
-
<StyledVideoTile.Info>{name}</StyledVideoTile.Info>
|
|
27
|
-
<StyledVideoTile.AudioIndicator>
|
|
28
|
-
<MicOffIcon />
|
|
29
|
-
</StyledVideoTile.AudioIndicator>
|
|
30
|
-
</StyledVideoTile.Container>
|
|
31
|
-
</StyledVideoTile.Root>
|
|
32
|
-
);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
interface VideoListProps {
|
|
36
|
-
maxTileCount: number;
|
|
37
|
-
aspectRatio: {
|
|
38
|
-
width: number;
|
|
39
|
-
height: number;
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const VideoListStory: React.FC<VideoListProps> = ({ maxTileCount, aspectRatio }) => {
|
|
44
|
-
const peers = useHMSStore(selectPeers);
|
|
45
|
-
const [page] = useState(0);
|
|
46
|
-
const { ref, pagesWithTiles } = useVideoList({
|
|
47
|
-
peers,
|
|
48
|
-
offsetY: 50,
|
|
49
|
-
maxTileCount,
|
|
50
|
-
aspectRatio,
|
|
51
|
-
});
|
|
52
|
-
return (
|
|
53
|
-
<StyledVideoList.Root css={{ height: '100vh', width: '100%' }} ref={ref}>
|
|
54
|
-
<StyledVideoList.Container>
|
|
55
|
-
{pagesWithTiles && pagesWithTiles.length > 0
|
|
56
|
-
? pagesWithTiles.map((tiles, pageNo) => (
|
|
57
|
-
<StyledVideoList.View
|
|
58
|
-
css={{
|
|
59
|
-
left: getLeft(pageNo, page),
|
|
60
|
-
transition: 'left 0.3s ease-in-out',
|
|
61
|
-
}}
|
|
62
|
-
>
|
|
63
|
-
{tiles.map((tile, i) =>
|
|
64
|
-
tile.track?.source === 'screen' ? null : (
|
|
65
|
-
<VideoTile
|
|
66
|
-
key={tile.track?.id || tile.peer.id + i}
|
|
67
|
-
width={tile.width}
|
|
68
|
-
height={tile.height}
|
|
69
|
-
trackId={tile.track?.id || ''}
|
|
70
|
-
name={tile.peer.name}
|
|
71
|
-
/>
|
|
72
|
-
),
|
|
73
|
-
)}
|
|
74
|
-
</StyledVideoList.View>
|
|
75
|
-
))
|
|
76
|
-
: null}
|
|
77
|
-
</StyledVideoList.Container>
|
|
78
|
-
</StyledVideoList.Root>
|
|
79
|
-
);
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const Template: ComponentStory<typeof VideoListStory> = args => <VideoListStory {...args} />;
|
|
83
|
-
|
|
84
|
-
export const Example = Template.bind({});
|
|
85
|
-
|
|
86
|
-
Example.args = {
|
|
87
|
-
maxTileCount: 2,
|
|
88
|
-
aspectRatio: {
|
|
89
|
-
width: 2,
|
|
90
|
-
height: 1,
|
|
91
|
-
},
|
|
92
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
## VideoTile
|
|
2
|
-
|
|
3
|
-
import { Story } from '@storybook/addon-docs';
|
|
4
|
-
|
|
5
|
-
Building a `<VideoTile />` component is all about composing styled/unstyled component provided by `../`. We will create a basic videotile by composing `StyledVideoTile`.
|
|
6
|
-
|
|
7
|
-
```jsx
|
|
8
|
-
import { StyledVideoTile, Video } from '../';
|
|
9
|
-
|
|
10
|
-
const VideoTileStory = () => {
|
|
11
|
-
return (
|
|
12
|
-
// width,height of the tile
|
|
13
|
-
<StyledVideoTile.Root css={{ width: 500, height: 300 }}>
|
|
14
|
-
<StyledVideoTile.Container>
|
|
15
|
-
{/* trackId of the peer */}
|
|
16
|
-
<Video trackId="1" />
|
|
17
|
-
{/* Meta info */}
|
|
18
|
-
<StyledVideoTile.Info>Deepankar</StyledVideoTile.Info>
|
|
19
|
-
<StyledVideoTile.AudioIndicator>
|
|
20
|
-
<MicOffIcon />
|
|
21
|
-
</StyledVideoTile.AudioIndicator>
|
|
22
|
-
</StyledVideoTile.Container>
|
|
23
|
-
</StyledVideoTile.Root>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
<Story id="video-videotile--example" />
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { MicOffIcon } from '@100mslive/react-icons';
|
|
3
|
-
import { Video } from '../Video/Video';
|
|
4
|
-
import { StyledVideoTile } from './StyledVideoTile';
|
|
5
|
-
import VideoTileDocs from './VideoTile.mdx';
|
|
6
|
-
|
|
7
|
-
const VideoTileMeta = {
|
|
8
|
-
title: 'Video/VideoTile',
|
|
9
|
-
parameters: {
|
|
10
|
-
docs: {
|
|
11
|
-
page: VideoTileDocs,
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default VideoTileMeta;
|
|
17
|
-
|
|
18
|
-
const VideoTileStory = () => {
|
|
19
|
-
return (
|
|
20
|
-
<StyledVideoTile.Root css={{ width: 500, height: 300 }}>
|
|
21
|
-
<StyledVideoTile.Container>
|
|
22
|
-
<Video trackId="1" />
|
|
23
|
-
<StyledVideoTile.Info>Deepankar</StyledVideoTile.Info>
|
|
24
|
-
<StyledVideoTile.AudioIndicator>
|
|
25
|
-
<MicOffIcon />
|
|
26
|
-
</StyledVideoTile.AudioIndicator>
|
|
27
|
-
</StyledVideoTile.Container>
|
|
28
|
-
</StyledVideoTile.Root>
|
|
29
|
-
);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const Example = VideoTileStory.bind({});
|