@100mslive/roomkit-react 0.3.3-alpha.3 → 0.3.3-alpha.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. package/dist/Accordion/Accordion.d.ts +0 -1
  2. package/dist/Accordion/index.d.ts +0 -1
  3. package/dist/{HLSView-BCIIVR2T.js → HLSView-VUANLYLS.js} +166 -331
  4. package/dist/HLSView-VUANLYLS.js.map +7 -0
  5. package/dist/IconButton/IconButton.d.ts +1 -1
  6. package/dist/Modal/Dialog.d.ts +1 -1
  7. package/dist/Prebuilt/IconButton.d.ts +3 -2
  8. package/dist/Prebuilt/components/Footer/ChatToggle.d.ts +1 -3
  9. package/dist/Prebuilt/components/HMSVideo/PlayPauseButton.d.ts +2 -2
  10. package/dist/Prebuilt/components/HMSVideo/{SeekControl.d.ts → SeekControls.d.ts} +2 -2
  11. package/dist/Prebuilt/components/HMSVideo/index.d.ts +11 -15
  12. package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +2 -2
  13. package/dist/Prebuilt/components/RaiseHand.d.ts +1 -1
  14. package/dist/Prebuilt/layouts/WhiteboardView.d.ts +2 -0
  15. package/dist/Sheet/Sheet.d.ts +1 -1
  16. package/dist/{chunk-W47ZJGSD.js → chunk-5WTUTVRO.js} +540 -617
  17. package/dist/chunk-5WTUTVRO.js.map +7 -0
  18. package/dist/index.cjs.js +1426 -1686
  19. package/dist/index.cjs.js.map +4 -4
  20. package/dist/index.js +1 -1
  21. package/dist/meta.cjs.json +169 -248
  22. package/dist/meta.esbuild.json +180 -260
  23. package/package.json +7 -7
  24. package/src/Accordion/Accordion.tsx +4 -4
  25. package/src/IconButton/IconButton.tsx +7 -2
  26. package/src/Prebuilt/IconButton.tsx +10 -6
  27. package/src/Prebuilt/components/Chat/ChatBody.tsx +0 -10
  28. package/src/Prebuilt/components/Chat/ChatFooter.tsx +4 -2
  29. package/src/Prebuilt/components/ConferenceScreen.tsx +4 -1
  30. package/src/Prebuilt/components/Footer/ChatToggle.tsx +2 -2
  31. package/src/Prebuilt/components/Footer/Footer.tsx +4 -1
  32. package/src/Prebuilt/components/Footer/ParticipantList.tsx +1 -4
  33. package/src/Prebuilt/components/Footer/RoleAccordion.tsx +6 -6
  34. package/src/Prebuilt/components/Footer/WhiteboardToggle.tsx +3 -17
  35. package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +0 -1
  36. package/src/Prebuilt/components/HMSVideo/PlayPauseButton.tsx +2 -2
  37. package/src/Prebuilt/components/HMSVideo/{SeekControl.tsx → SeekControls.tsx} +2 -2
  38. package/src/Prebuilt/components/HMSVideo/VideoProgress.tsx +3 -7
  39. package/src/Prebuilt/components/HMSVideo/index.ts +4 -5
  40. package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.tsx +7 -7
  41. package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx +1 -0
  42. package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx +5 -1
  43. package/src/Prebuilt/components/PreviousRoleInMetadata.tsx +1 -0
  44. package/src/Prebuilt/components/RaiseHand.tsx +1 -7
  45. package/src/Prebuilt/components/RoleChangeRequest/RoleChangeRequestModal.tsx +1 -0
  46. package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +4 -27
  47. package/src/Prebuilt/components/hooks/useCloseScreenshareWhiteboard.tsx +5 -13
  48. package/src/Prebuilt/components/hooks/{useMetadata.tsx → useMetadata.jsx} +8 -2
  49. package/src/Prebuilt/layouts/HLSView.jsx +78 -115
  50. package/src/Prebuilt/layouts/VideoStreamingSection.tsx +17 -1
  51. package/src/Prebuilt/layouts/WhiteboardView.tsx +69 -0
  52. package/dist/HLSView-BCIIVR2T.js.map +0 -7
  53. package/dist/Prebuilt/components/HMSVideo/PlayPauseSeekControls.d.ts +0 -14
  54. package/dist/Prebuilt/components/VideoLayouts/WhiteboardLayout.d.ts +0 -3
  55. package/dist/Prebuilt/components/hooks/useMetadata.d.ts +0 -8
  56. package/dist/chunk-W47ZJGSD.js.map +0 -7
  57. package/src/Prebuilt/components/HMSVideo/PlayPauseSeekControls.tsx +0 -158
  58. package/src/Prebuilt/components/VideoLayouts/WhiteboardLayout.tsx +0 -95
@@ -1,158 +0,0 @@
1
- import React from 'react';
2
- import { useMedia } from 'react-use';
3
- import { BackwardArrowIcon, ForwardArrowIcon } from '@100mslive/react-icons';
4
- import { Box, Flex } from '../../../Layout';
5
- import { Text } from '../../../Text';
6
- import { config } from '../../../Theme';
7
- import { PlayPauseButton } from './PlayPauseButton';
8
- import { SeekControl } from './SeekControl';
9
- import { useIsLandscape } from '../../common/hooks';
10
-
11
- // desktop buttons
12
- export const PlayPauseSeekControls = ({
13
- isPaused,
14
- onSeekTo,
15
- }: {
16
- isPaused: boolean;
17
- onSeekTo: (value: number) => void;
18
- }) => {
19
- return (
20
- <>
21
- <SeekControl
22
- onClick={e => {
23
- e.stopPropagation();
24
- onSeekTo(-10);
25
- }}
26
- title="backward"
27
- >
28
- <BackwardArrowIcon width={20} height={20} />
29
- </SeekControl>
30
- <PlayPauseButton isPaused={isPaused} />
31
- <SeekControl
32
- onClick={e => {
33
- e.stopPropagation();
34
- onSeekTo(10);
35
- }}
36
- title="forward"
37
- >
38
- <ForwardArrowIcon width={20} height={20} />
39
- </SeekControl>
40
- </>
41
- );
42
- };
43
-
44
- // overlay handlers
45
- export const PlayPauseSeekOverlayControls = ({
46
- isPaused,
47
- showControls,
48
- hoverControlsVisible,
49
- }: {
50
- isPaused: boolean;
51
- showControls: boolean;
52
- hoverControlsVisible: {
53
- seekBackward: boolean;
54
- seekForward: boolean;
55
- pausePlay: boolean;
56
- };
57
- }) => {
58
- const isMobile = useMedia(config.media.md);
59
- const isLandscape = useIsLandscape();
60
-
61
- if (!isMobile && !isLandscape) {
62
- // show desktopOverflow icons
63
- return (
64
- <>
65
- <Flex
66
- css={{
67
- bg: 'rgba(0, 0, 0, 0.6)',
68
- r: '$round',
69
- size: '$24',
70
- visibility: hoverControlsVisible.seekBackward ? `` : `hidden`,
71
- opacity: hoverControlsVisible.seekBackward ? `1` : '0',
72
- }}
73
- direction="column"
74
- align="center"
75
- >
76
- <SeekControl title="backward">
77
- <BackwardArrowIcon width={52} height={52} />
78
- </SeekControl>
79
- <Text variant="body2" css={{ fontWeight: '$regular' }}>
80
- 10 secs
81
- </Text>
82
- </Flex>
83
- <Box
84
- css={{
85
- bg: 'rgba(0, 0, 0, 0.6)',
86
- r: '$round',
87
- visibility: hoverControlsVisible.pausePlay ? `` : `hidden`,
88
- opacity: hoverControlsVisible.pausePlay ? `1` : '0',
89
- }}
90
- >
91
- <PlayPauseButton isPaused={isPaused} width={48} height={48} />
92
- </Box>
93
- <Flex
94
- css={{
95
- bg: 'rgba(0, 0, 0, 0.6)',
96
- r: '$round',
97
- size: '$24',
98
- visibility: hoverControlsVisible.seekForward ? `` : `hidden`,
99
- opacity: hoverControlsVisible.seekForward ? `1` : '0',
100
- }}
101
- direction="column"
102
- align="center"
103
- >
104
- <SeekControl title="forward">
105
- <ForwardArrowIcon width={52} height={52} />
106
- </SeekControl>
107
- <Text variant="body2" css={{ fontWeight: '$regular' }}>
108
- 10 secs
109
- </Text>
110
- </Flex>
111
- </>
112
- );
113
- }
114
-
115
- return (
116
- <Flex
117
- align="center"
118
- justify="center"
119
- css={{
120
- position: 'absolute',
121
- bg: '#00000066',
122
- display: 'inline-flex',
123
- gap: '$2',
124
- zIndex: 1,
125
- size: '100%',
126
- visibility: showControls ? `` : `hidden`,
127
- opacity: showControls ? `1` : '0',
128
- }}
129
- >
130
- <SeekControl
131
- title="backward"
132
- css={{
133
- visibility: hoverControlsVisible.seekBackward ? `` : `hidden`,
134
- opacity: hoverControlsVisible.seekBackward ? `1` : '0',
135
- }}
136
- >
137
- <BackwardArrowIcon width={32} height={32} />
138
- </SeekControl>
139
- <Box
140
- css={{
141
- bg: 'rgba(0, 0, 0, 0.6)',
142
- r: '$round',
143
- }}
144
- >
145
- <PlayPauseButton isPaused={isPaused} width={48} height={48} />
146
- </Box>
147
- <SeekControl
148
- title="forward"
149
- css={{
150
- visibility: hoverControlsVisible.seekForward ? `` : `hidden`,
151
- opacity: hoverControlsVisible.seekForward ? `1` : '0',
152
- }}
153
- >
154
- <ForwardArrowIcon width={32} height={32} />
155
- </SeekControl>
156
- </Flex>
157
- );
158
- };
@@ -1,95 +0,0 @@
1
- import React, { useEffect, useMemo } from 'react';
2
- import { useMedia } from 'react-use';
3
- import { selectPeerByCondition, selectWhiteboard, useHMSStore, useWhiteboard } from '@100mslive/react-sdk';
4
- import { Box } from '../../../Layout';
5
- import { config as cssConfig } from '../../../Theme';
6
- import { InsetTile } from '../InsetTile';
7
- import { SecondaryTiles } from '../SecondaryTiles';
8
- import { LayoutMode } from '../Settings/LayoutSettings';
9
- import { LayoutProps } from './interface';
10
- import { ProminenceLayout } from './ProminenceLayout';
11
- // @ts-ignore: No implicit Any
12
- import { useSetUiSettings } from '../AppData/useUISettings';
13
- import { UI_SETTINGS } from '../../common/constants';
14
-
15
- const WhiteboardEmbed = () => {
16
- const isMobile = useMedia(cssConfig.media.md);
17
- const { iframeRef } = useWhiteboard(isMobile);
18
-
19
- return (
20
- <Box
21
- css={{
22
- mx: '$8',
23
- flex: '3 1 0',
24
- '@lg': {
25
- flex: '2 1 0',
26
- display: 'flex',
27
- alignItems: 'center',
28
- },
29
- }}
30
- >
31
- <iframe
32
- title="Whiteboard View"
33
- ref={iframeRef}
34
- style={{
35
- width: '100%',
36
- height: '100%',
37
- border: 0,
38
- borderRadius: '0.75rem',
39
- }}
40
- allow="autoplay; clipboard-write;"
41
- referrerPolicy="no-referrer"
42
- />
43
- </Box>
44
- );
45
- };
46
-
47
- export const WhiteboardLayout = ({ peers, onPageChange, onPageSize, edgeToEdge }: LayoutProps) => {
48
- const whiteboard = useHMSStore(selectWhiteboard);
49
- const whiteboardOwner = useHMSStore(selectPeerByCondition(peer => peer.customerUserId === whiteboard?.owner));
50
- const [layoutMode, setLayoutMode] = useSetUiSettings(UI_SETTINGS.layoutMode);
51
- const isMobile = useMedia(cssConfig.media.md);
52
- const hasSidebar = !isMobile && layoutMode === LayoutMode.SIDEBAR;
53
- const secondaryPeers = useMemo(() => {
54
- if (layoutMode === LayoutMode.SPOTLIGHT) {
55
- return [];
56
- }
57
- if (isMobile || layoutMode === LayoutMode.SIDEBAR) {
58
- return whiteboardOwner
59
- ? [whiteboardOwner, ...peers.filter(p => p.id !== whiteboardOwner?.id)] //keep active sharing peer as first tile
60
- : peers;
61
- }
62
- return peers.filter(p => p.id !== whiteboardOwner?.id);
63
- }, [whiteboardOwner, peers, isMobile, layoutMode]);
64
-
65
- useEffect(() => {
66
- if (isMobile) {
67
- setLayoutMode(LayoutMode.GALLERY);
68
- return;
69
- }
70
- if (layoutMode === LayoutMode.SIDEBAR) {
71
- return;
72
- }
73
- setLayoutMode(LayoutMode.SIDEBAR);
74
- return () => {
75
- // reset to gallery once whiteboard is stopped
76
- setLayoutMode(LayoutMode.GALLERY);
77
- };
78
- }, [isMobile]); // eslint-disable-line react-hooks/exhaustive-deps
79
-
80
- return (
81
- <ProminenceLayout.Root edgeToEdge={edgeToEdge} hasSidebar={hasSidebar}>
82
- <ProminenceLayout.ProminentSection>
83
- <WhiteboardEmbed />
84
- </ProminenceLayout.ProminentSection>
85
- <SecondaryTiles
86
- peers={secondaryPeers}
87
- onPageChange={onPageChange}
88
- onPageSize={onPageSize}
89
- edgeToEdge={edgeToEdge}
90
- hasSidebar={hasSidebar}
91
- />
92
- {layoutMode === LayoutMode.SPOTLIGHT && whiteboardOwner && <InsetTile peerId={whiteboardOwner?.id} />}
93
- </ProminenceLayout.Root>
94
- );
95
- };