@100mslive/roomkit-react 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/AudioLevel/AudioLevel.d.ts +5 -8
- package/dist/AudioLevel/index.d.ts +2 -1
- package/dist/AudioLevel/useBorderAudioLevel.d.ts +8 -0
- package/dist/{HLSView-3S74KF3A.js → HLSView-DDGPZHA2.js} +5 -4
- package/dist/{HLSView-3S74KF3A.js.map → HLSView-DDGPZHA2.js.map} +2 -2
- package/dist/Prebuilt/App.d.ts +1 -0
- package/dist/Prebuilt/AppContext.d.ts +1 -0
- package/dist/Prebuilt/components/Chip.d.ts +12 -0
- package/dist/Prebuilt/components/Footer/PaginatedParticipants.d.ts +5 -0
- package/dist/Prebuilt/components/Footer/RoleAccordion.d.ts +10 -3
- package/dist/Prebuilt/components/Notifications/HeadlessEndRoomListener.d.ts +2 -0
- package/dist/Prebuilt/components/PrebuiltDialogPortal.d.ts +4 -0
- package/dist/Prebuilt/components/PrebuiltTileElements.d.ts +2198 -0
- package/dist/{VirtualBackground-3TI5NA4V.js → VirtualBackground-UVZJVOA2.js} +3 -3
- package/dist/{chunk-5DQ3WTED.js → chunk-6SQTFOK6.js} +2 -2
- package/dist/{chunk-5DQ3WTED.js.map → chunk-6SQTFOK6.js.map} +1 -1
- package/dist/{chunk-36X4ZCLC.js → chunk-HUMNPIYI.js} +2 -2
- package/dist/{chunk-Z7P5WITU.js → chunk-PRM33R4R.js} +591 -1186
- package/dist/chunk-PRM33R4R.js.map +7 -0
- package/dist/{conference-JNABIZBG.js → conference-N7S47TDK.js} +1505 -717
- package/dist/conference-N7S47TDK.js.map +7 -0
- package/dist/index.cjs.js +3083 -2825
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +4 -2
- package/dist/meta.cjs.json +1107 -740
- package/dist/meta.esbuild.json +1160 -791
- package/package.json +6 -6
- package/src/AudioLevel/AudioLevel.tsx +79 -30
- package/src/AudioLevel/audio-level.png +0 -0
- package/src/AudioLevel/index.ts +2 -1
- package/src/AudioLevel/useBorderAudioLevel.tsx +34 -0
- package/src/Prebuilt/App.tsx +6 -0
- package/src/Prebuilt/AppContext.tsx +2 -0
- package/src/Prebuilt/common/constants.js +1 -1
- package/src/Prebuilt/common/utils.js +0 -7
- package/src/Prebuilt/components/AppData/AppData.jsx +1 -1
- package/src/Prebuilt/components/AppData/useUISettings.js +1 -1
- package/src/Prebuilt/components/{Chip.jsx → Chip.tsx} +18 -3
- package/src/Prebuilt/components/Footer/PaginatedParticipants.tsx +94 -0
- package/src/Prebuilt/components/Footer/ParticipantList.jsx +67 -26
- package/src/Prebuilt/components/Footer/RoleAccordion.tsx +91 -49
- package/src/Prebuilt/components/Footer/RoleOptions.tsx +1 -1
- package/src/Prebuilt/components/Leave/DesktopLeaveRoom.tsx +7 -4
- package/src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx +3 -2
- package/src/Prebuilt/components/MoreSettings/EmbedUrl.jsx +3 -2
- package/src/Prebuilt/components/MwebLandscapePrompt.jsx +58 -0
- package/src/Prebuilt/components/Notifications/HLSFailureModal.jsx +3 -2
- package/src/Prebuilt/components/Notifications/HeadlessEndRoomListener.tsx +23 -0
- package/src/Prebuilt/components/Notifications/Notifications.jsx +1 -1
- package/src/Prebuilt/components/Notifications/PermissionErrorModal.jsx +3 -2
- package/src/Prebuilt/components/PrebuiltDialogPortal.tsx +6 -0
- package/src/Prebuilt/components/PrebuiltTileElements.tsx +5 -0
- package/src/Prebuilt/components/Preview/PreviewJoin.tsx +11 -7
- package/src/Prebuilt/components/RoleChangeModal.jsx +3 -2
- package/src/Prebuilt/components/RoleChangeRequest/RequestPrompt.tsx +3 -2
- package/src/Prebuilt/components/Settings/SettingsModal.jsx +3 -2
- package/src/Prebuilt/components/Settings/StartRecording.jsx +3 -2
- package/src/Prebuilt/components/SidePaneTabs.tsx +31 -5
- package/src/Prebuilt/components/StatsForNerds.jsx +3 -2
- package/src/Prebuilt/components/VideoTile.jsx +21 -83
- package/src/Prebuilt/components/conference.jsx +4 -3
- package/src/Prebuilt/components/hooks/useDropdownSelection.jsx +1 -1
- package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +3 -2
- package/src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx +4 -29
- package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +3 -2
- package/src/Prebuilt/layouts/HLSView.jsx +1 -0
- package/src/Prebuilt/layouts/SidePane.tsx +1 -0
- package/src/Prebuilt/primitives/DialogContent.jsx +5 -4
- package/dist/chunk-Z7P5WITU.js.map +0 -7
- package/dist/conference-JNABIZBG.js.map +0 -7
- /package/dist/{VirtualBackground-3TI5NA4V.js.map → VirtualBackground-UVZJVOA2.js.map} +0 -0
- /package/dist/{chunk-36X4ZCLC.js.map → chunk-HUMNPIYI.js.map} +0 -0
@@ -1,13 +1,14 @@
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
2
2
|
import { useMedia } from 'react-use';
|
3
|
-
import { ConferencingScreen } from '@100mslive/types-prebuilt';
|
3
|
+
import { ConferencingScreen, DefaultConferencingScreen_Elements } from '@100mslive/types-prebuilt';
|
4
4
|
import { selectPeerCount, useHMSStore } from '@100mslive/react-sdk';
|
5
5
|
import { CrossIcon } from '@100mslive/react-icons';
|
6
6
|
// @ts-ignore: No implicit Any
|
7
7
|
import { Chat } from './Chat/Chat';
|
8
|
+
import { PaginatedParticipants } from './Footer/PaginatedParticipants';
|
8
9
|
// @ts-ignore: No implicit Any
|
9
10
|
import { ParticipantList } from './Footer/ParticipantList';
|
10
|
-
import { config as cssConfig, Flex, IconButton, Tabs, Text } from '../..';
|
11
|
+
import { Box, config as cssConfig, Flex, IconButton, Tabs, Text } from '../..';
|
11
12
|
import { Tooltip } from '../../Tooltip';
|
12
13
|
// @ts-ignore: No implicit Any
|
13
14
|
import { useRoomLayoutConferencingScreen } from '../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
@@ -46,6 +47,7 @@ export const SidePaneTabs = React.memo<{
|
|
46
47
|
const toggleParticipants = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
47
48
|
const resetSidePane = useSidepaneReset();
|
48
49
|
const [activeTab, setActiveTab] = useState(active);
|
50
|
+
const [activeRole, setActiveRole] = useState('');
|
49
51
|
const peerCount = useHMSStore(selectPeerCount);
|
50
52
|
const { elements } = useRoomLayoutConferencingScreen();
|
51
53
|
const showChat = !!elements?.chat;
|
@@ -53,6 +55,7 @@ export const SidePaneTabs = React.memo<{
|
|
53
55
|
const hideTabs = !(showChat && showParticipants);
|
54
56
|
const isMobile = useMedia(cssConfig.media.md);
|
55
57
|
const isOverlayChat = !!elements?.chat?.is_overlay && isMobile;
|
58
|
+
const { off_stage_roles = [] } = (elements as DefaultConferencingScreen_Elements)?.on_stage_exp || {};
|
56
59
|
const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
|
57
60
|
|
58
61
|
useEffect(() => {
|
@@ -69,6 +72,25 @@ export const SidePaneTabs = React.memo<{
|
|
69
72
|
setActiveTab(active);
|
70
73
|
}, [active]);
|
71
74
|
|
75
|
+
if (activeRole) {
|
76
|
+
return (
|
77
|
+
<Flex
|
78
|
+
direction="column"
|
79
|
+
css={{
|
80
|
+
color: '$on_primary_high',
|
81
|
+
h: '100%',
|
82
|
+
marginTop: hideControls && isOverlayChat ? '$17' : '0',
|
83
|
+
transition: 'margin 0.3s ease-in-out',
|
84
|
+
position: 'relative',
|
85
|
+
}}
|
86
|
+
>
|
87
|
+
<Box css={{ position: 'absolute', left: 0, top: 0, size: '100%', zIndex: 21, bg: '$surface_dim' }}>
|
88
|
+
<PaginatedParticipants roleName={activeRole} onBack={() => setActiveRole('')} />
|
89
|
+
</Box>
|
90
|
+
</Flex>
|
91
|
+
);
|
92
|
+
}
|
93
|
+
|
72
94
|
return (
|
73
95
|
<Flex
|
74
96
|
direction="column"
|
@@ -95,7 +117,11 @@ export const SidePaneTabs = React.memo<{
|
|
95
117
|
)}
|
96
118
|
</Text>
|
97
119
|
|
98
|
-
{showChat ?
|
120
|
+
{showChat ? (
|
121
|
+
<Chat screenType={screenType} />
|
122
|
+
) : (
|
123
|
+
<ParticipantList offStageRoles={off_stage_roles} onActive={setActiveRole} />
|
124
|
+
)}
|
99
125
|
</>
|
100
126
|
) : (
|
101
127
|
<Tabs.Root
|
@@ -129,7 +155,7 @@ export const SidePaneTabs = React.memo<{
|
|
129
155
|
</Tabs.Trigger>
|
130
156
|
</Tabs.List>
|
131
157
|
<Tabs.Content value={SIDE_PANE_OPTIONS.PARTICIPANTS} css={{ p: 0 }}>
|
132
|
-
<ParticipantList />
|
158
|
+
<ParticipantList offStageRoles={off_stage_roles} onActive={setActiveRole} />
|
133
159
|
</Tabs.Content>
|
134
160
|
<Tabs.Content value={SIDE_PANE_OPTIONS.CHAT} css={{ p: 0 }}>
|
135
161
|
<Chat screenType={screenType} />
|
@@ -141,7 +167,7 @@ export const SidePaneTabs = React.memo<{
|
|
141
167
|
|
142
168
|
{isOverlayChat && isChatOpen ? null : (
|
143
169
|
<IconButton
|
144
|
-
css={{ position: 'absolute', right: '$
|
170
|
+
css={{ position: 'absolute', right: '$9', top: '$11', '@md': { top: '$8', right: '$6' } }}
|
145
171
|
onClick={e => {
|
146
172
|
e.stopPropagation();
|
147
173
|
if (activeTab === SIDE_PANE_OPTIONS.CHAT) {
|
@@ -15,6 +15,7 @@ import { Dialog } from '../../Modal';
|
|
15
15
|
import { Switch } from '../../Switch';
|
16
16
|
import { Text } from '../../Text';
|
17
17
|
import { DialogDropdownTrigger } from '../primitives/DropdownTrigger';
|
18
|
+
import { PrebuiltDialogPortal } from './PrebuiltDialogPortal';
|
18
19
|
import { useSetUiSettings } from './AppData/useUISettings';
|
19
20
|
import { useDropdownSelection } from './hooks/useDropdownSelection';
|
20
21
|
import { UI_SETTINGS } from '../common/constants';
|
@@ -39,7 +40,7 @@ export const StatsForNerds = ({ onOpenChange }) => {
|
|
39
40
|
|
40
41
|
return (
|
41
42
|
<Dialog.Root defaultOpen onOpenChange={onOpenChange}>
|
42
|
-
<
|
43
|
+
<PrebuiltDialogPortal>
|
43
44
|
<Dialog.Overlay />
|
44
45
|
<Dialog.Content
|
45
46
|
css={{
|
@@ -118,7 +119,7 @@ export const StatsForNerds = ({ onOpenChange }) => {
|
|
118
119
|
<TrackStats trackID={selectedStat.id} layer={selectedStat.layer} local={selectedStat.local} />
|
119
120
|
)}
|
120
121
|
</Dialog.Content>
|
121
|
-
</
|
122
|
+
</PrebuiltDialogPortal>
|
122
123
|
</Dialog.Root>
|
123
124
|
);
|
124
125
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { Fragment, useCallback,
|
1
|
+
import React, { Fragment, useCallback, useRef, useState } from 'react';
|
2
2
|
import { useMedia } from 'react-use';
|
3
3
|
import {
|
4
4
|
selectAudioTrackByPeerID,
|
@@ -8,26 +8,26 @@ import {
|
|
8
8
|
selectPeerMetadata,
|
9
9
|
selectPeerNameByID,
|
10
10
|
selectSessionStore,
|
11
|
-
selectTrackAudioByID,
|
12
11
|
selectVideoTrackByID,
|
13
12
|
selectVideoTrackByPeerID,
|
14
13
|
useHMSStore,
|
15
|
-
useHMSVanillaStore,
|
16
14
|
} from '@100mslive/react-sdk';
|
17
15
|
import { BrbTileIcon, HandIcon, MicOffIcon } from '@100mslive/react-icons';
|
18
16
|
import TileConnection from './Connection/TileConnection';
|
19
17
|
import TileMenu, { isSameTile } from './TileMenu/TileMenu';
|
18
|
+
import { AudioLevel } from '../../AudioLevel';
|
20
19
|
import { Avatar } from '../../Avatar';
|
21
|
-
import { Box, Flex } from '../../Layout';
|
22
20
|
import { VideoTileStats } from '../../Stats';
|
23
|
-
import { config as cssConfig
|
21
|
+
import { config as cssConfig } from '../../Theme';
|
24
22
|
import { Video } from '../../Video';
|
25
23
|
import { StyledVideoTile } from '../../VideoTile';
|
26
24
|
import { getVideoTileLabel } from './peerTileUtils';
|
25
|
+
import { PrebuiltAttributeBox, PrebuiltAudioIndicator } from './PrebuiltTileElements';
|
27
26
|
import { useSetAppDataByKey, useUISettings } from './AppData/useUISettings';
|
28
|
-
import { getAttributeBoxSize } from '../common/utils';
|
29
27
|
import { APP_DATA, SESSION_STORE_KEY, UI_SETTINGS } from '../common/constants';
|
30
28
|
|
29
|
+
const iconDims = { height: '1rem', width: '1rem' };
|
30
|
+
|
31
31
|
const Tile = ({
|
32
32
|
peerId,
|
33
33
|
trackId,
|
@@ -77,20 +77,8 @@ const Tile = ({
|
|
77
77
|
const ref = useRef(null);
|
78
78
|
const calculatedHeight = ref.current?.clientHeight || '';
|
79
79
|
const calculatedWidth = ref.current?.clientWidth || '';
|
80
|
-
|
81
80
|
const isTileBigEnoughToShowStats = calculatedHeight >= 180 && calculatedWidth >= 180;
|
82
|
-
|
83
|
-
const avatarSize = useMemo(() => {
|
84
|
-
if (!calculatedWidth || !calculatedHeight) {
|
85
|
-
return undefined;
|
86
|
-
}
|
87
|
-
if (calculatedWidth <= 150 || calculatedHeight <= 150) {
|
88
|
-
return 'small';
|
89
|
-
} else if (calculatedWidth <= 300 || calculatedHeight <= 300) {
|
90
|
-
return 'medium';
|
91
|
-
}
|
92
|
-
return 'large';
|
93
|
-
}, [calculatedWidth, calculatedHeight]);
|
81
|
+
const avatarSize = 'medium';
|
94
82
|
|
95
83
|
return (
|
96
84
|
<StyledVideoTile.Root
|
@@ -139,14 +127,13 @@ const Tile = ({
|
|
139
127
|
|
140
128
|
{!hideAudioMuteOnTile ? (
|
141
129
|
isAudioMuted ? (
|
142
|
-
<
|
143
|
-
|
144
|
-
|
145
|
-
>
|
146
|
-
<MicOffIcon />
|
147
|
-
</StyledVideoTile.AudioIndicator>
|
130
|
+
<PrebuiltAudioIndicator data-testid="participant_audio_mute_icon">
|
131
|
+
<MicOffIcon style={iconDims} />
|
132
|
+
</PrebuiltAudioIndicator>
|
148
133
|
) : (
|
149
|
-
<
|
134
|
+
<PrebuiltAudioIndicator>
|
135
|
+
<AudioLevel trackId={audioTrack?.id} />
|
136
|
+
</PrebuiltAudioIndicator>
|
150
137
|
)
|
151
138
|
) : null}
|
152
139
|
{isMouseHovered || (isDragabble && isMobile) ? (
|
@@ -158,7 +145,7 @@ const Tile = ({
|
|
158
145
|
enableSpotlightingPeer={enableSpotlightingPeer}
|
159
146
|
/>
|
160
147
|
) : null}
|
161
|
-
{!hideMetadataOnTile && <PeerMetadata peerId={peerId}
|
148
|
+
{!hideMetadataOnTile && <PeerMetadata peerId={peerId} />}
|
162
149
|
|
163
150
|
<TileConnection
|
164
151
|
hideLabel={hideParticipantNameOnTile}
|
@@ -175,56 +162,7 @@ const Tile = ({
|
|
175
162
|
);
|
176
163
|
};
|
177
164
|
|
178
|
-
const
|
179
|
-
keyframes({
|
180
|
-
'50%': {
|
181
|
-
transform: `scale3d(1,${value},1)`,
|
182
|
-
},
|
183
|
-
'100%': {
|
184
|
-
transform: `scale3d(1,1,1)`,
|
185
|
-
},
|
186
|
-
});
|
187
|
-
|
188
|
-
const AudioLevelIndicator = ({ trackId, value, delay }) => {
|
189
|
-
const vanillaStore = useHMSVanillaStore();
|
190
|
-
const ref = useRef();
|
191
|
-
|
192
|
-
useEffect(() => {
|
193
|
-
const unsubscribe = vanillaStore.subscribe(audioLevel => {
|
194
|
-
if (ref.current) {
|
195
|
-
ref.current.style['animation'] = `${heightAnimation(
|
196
|
-
audioLevel ? value : 1,
|
197
|
-
)} 0.3s cubic-bezier(0.61, 1, 0.88, 1) infinite ${delay}s`;
|
198
|
-
}
|
199
|
-
}, selectTrackAudioByID(trackId));
|
200
|
-
return unsubscribe;
|
201
|
-
}, [vanillaStore, trackId, value, delay]);
|
202
|
-
return (
|
203
|
-
<Box
|
204
|
-
ref={ref}
|
205
|
-
css={{
|
206
|
-
w: 4,
|
207
|
-
height: 6,
|
208
|
-
r: 2,
|
209
|
-
bg: '$on_primary_high',
|
210
|
-
}}
|
211
|
-
/>
|
212
|
-
);
|
213
|
-
};
|
214
|
-
|
215
|
-
export const AudioLevel = ({ trackId }) => {
|
216
|
-
return (
|
217
|
-
<StyledVideoTile.AudioIndicator>
|
218
|
-
<Flex align="center" justify="center" css={{ gap: '$2' }}>
|
219
|
-
{[3, 2, 3].map((v, i) => (
|
220
|
-
<AudioLevelIndicator trackId={trackId} value={v} delay={i * 0.15} key={i} />
|
221
|
-
))}
|
222
|
-
</Flex>
|
223
|
-
</StyledVideoTile.AudioIndicator>
|
224
|
-
);
|
225
|
-
};
|
226
|
-
|
227
|
-
const PeerMetadata = ({ peerId, height, width }) => {
|
165
|
+
const PeerMetadata = ({ peerId }) => {
|
228
166
|
const metaData = useHMSStore(selectPeerMetadata(peerId));
|
229
167
|
const isBRB = metaData?.isBRBOn || false;
|
230
168
|
const isHandRaised = useHMSStore(selectHasPeerHandRaised(peerId));
|
@@ -232,14 +170,14 @@ const PeerMetadata = ({ peerId, height, width }) => {
|
|
232
170
|
return (
|
233
171
|
<Fragment>
|
234
172
|
{isHandRaised ? (
|
235
|
-
<
|
236
|
-
<HandIcon
|
237
|
-
</
|
173
|
+
<PrebuiltAttributeBox data-testid="raiseHand_icon_onTile">
|
174
|
+
<HandIcon style={iconDims} />
|
175
|
+
</PrebuiltAttributeBox>
|
238
176
|
) : null}
|
239
177
|
{isBRB ? (
|
240
|
-
<
|
241
|
-
<BrbTileIcon
|
242
|
-
</
|
178
|
+
<PrebuiltAttributeBox data-testid="brb_icon_onTile">
|
179
|
+
<BrbTileIcon style={iconDims} />
|
180
|
+
</PrebuiltAttributeBox>
|
243
181
|
) : null}
|
244
182
|
</Fragment>
|
245
183
|
);
|
@@ -29,7 +29,7 @@ import { APP_DATA, isAndroid, isIOS, isIPadOS } from '../common/constants';
|
|
29
29
|
const Conference = () => {
|
30
30
|
const navigate = useNavigate();
|
31
31
|
const { roomId, role } = useParams();
|
32
|
-
const { userName, endpoints } = useHMSPrebuiltContext();
|
32
|
+
const { userName, endpoints, onJoin: onJoinFunc } = useHMSPrebuiltContext();
|
33
33
|
const screenProps = useRoomLayoutConferencingScreen();
|
34
34
|
const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
|
35
35
|
const roomState = useHMSStore(selectRoomState);
|
@@ -109,13 +109,14 @@ const Conference = () => {
|
|
109
109
|
}, [authTokenInAppData, endpoints?.init, hmsActions, isConnectedToRoom, isPreviewScreenEnabled, roomState, userName]);
|
110
110
|
|
111
111
|
useEffect(() => {
|
112
|
+
onJoinFunc?.();
|
112
113
|
return () => {
|
113
114
|
PictureInPicture.stop().catch(error => console.error('stopping pip', error));
|
114
115
|
};
|
115
116
|
}, []);
|
116
117
|
|
117
|
-
if (!isConnectedToRoom) {
|
118
|
-
return <FullPageProgress text=
|
118
|
+
if (!isConnectedToRoom && ![HMSRoomState.Reconnecting, HMSRoomState.Disconnected].includes(roomState)) {
|
119
|
+
return <FullPageProgress text={roomState === HMSRoomState.Connecting ? 'Joining...' : ''} />;
|
119
120
|
}
|
120
121
|
|
121
122
|
return (
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React, { useState } from 'react';
|
2
2
|
import { Dialog, Flex } from '../../../';
|
3
3
|
import { DialogInputFile } from '../../primitives/DialogContent';
|
4
|
+
import { PrebuiltDialogPortal } from '../PrebuiltDialogPortal';
|
4
5
|
import { PDFHeader } from './pdfHeader';
|
5
6
|
import { SubmitPDF } from './submitPdf';
|
6
7
|
import { UploadedFile } from './uploadedFile';
|
@@ -10,7 +11,7 @@ export function PDFFileOptions({ onOpenChange }) {
|
|
10
11
|
|
11
12
|
return !pdfFile ? (
|
12
13
|
<Dialog.Root defaultOpen onOpenChange={onOpenChange}>
|
13
|
-
<
|
14
|
+
<PrebuiltDialogPortal>
|
14
15
|
<Dialog.Overlay />
|
15
16
|
<Dialog.Content
|
16
17
|
css={{
|
@@ -34,7 +35,7 @@ export function PDFFileOptions({ onOpenChange }) {
|
|
34
35
|
<SubmitPDF pdfFile={pdfFile} onOpenChange={onOpenChange} />
|
35
36
|
</Flex>
|
36
37
|
</Dialog.Content>
|
37
|
-
</
|
38
|
+
</PrebuiltDialogPortal>
|
38
39
|
</Dialog.Root>
|
39
40
|
) : (
|
40
41
|
<UploadedFile pdfFile={pdfFile} setPDFFile={setPDFFile} onOpenChange={onOpenChange} />
|
@@ -3,7 +3,7 @@ import { useScreenShare } from '@100mslive/react-sdk';
|
|
3
3
|
import { StarIcon, VerticalMenuIcon } from '@100mslive/react-icons';
|
4
4
|
import PDFShareImg from './../../images/pdf-share.png';
|
5
5
|
import ScreenShareImg from './../../images/screen-share.png';
|
6
|
-
import { Box,
|
6
|
+
import { Box, Dropdown, Flex, IconButton, Text, Tooltip } from '../../../';
|
7
7
|
import { ShareMenuIcon } from '../ShareMenuIcon';
|
8
8
|
import { PDFFileOptions } from './pdfFileOptions';
|
9
9
|
|
@@ -75,7 +75,8 @@ export function ShareScreenOptions() {
|
|
75
75
|
alignItems: 'flex-start',
|
76
76
|
gap: '$8',
|
77
77
|
px: '$10',
|
78
|
-
|
78
|
+
pt: '$6',
|
79
|
+
pb: '$10',
|
79
80
|
'&:hover': {
|
80
81
|
bg: '$transparent',
|
81
82
|
cursor: 'default',
|
@@ -163,7 +164,7 @@ export function ShareScreenOptions() {
|
|
163
164
|
align="center"
|
164
165
|
css={{
|
165
166
|
position: 'absolute',
|
166
|
-
top: '
|
167
|
+
top: '35%',
|
167
168
|
left: '54%',
|
168
169
|
padding: '$2 $4',
|
169
170
|
r: '$2',
|
@@ -200,32 +201,6 @@ export function ShareScreenOptions() {
|
|
200
201
|
</Flex>
|
201
202
|
</Flex>
|
202
203
|
</Dropdown.Item>
|
203
|
-
<Dropdown.Item
|
204
|
-
css={{
|
205
|
-
px: '$10',
|
206
|
-
pb: '$10',
|
207
|
-
pt: '$6',
|
208
|
-
'&:hover': {
|
209
|
-
bg: '$transparent',
|
210
|
-
cursor: 'default',
|
211
|
-
},
|
212
|
-
}}
|
213
|
-
>
|
214
|
-
<Button
|
215
|
-
variant="standard"
|
216
|
-
outlined
|
217
|
-
type="submit"
|
218
|
-
onClick={() => {
|
219
|
-
updateState(MODALS.SHARE, false);
|
220
|
-
}}
|
221
|
-
data-testid="share_btn"
|
222
|
-
css={{
|
223
|
-
w: '100%',
|
224
|
-
}}
|
225
|
-
>
|
226
|
-
Cancel
|
227
|
-
</Button>
|
228
|
-
</Dropdown.Item>
|
229
204
|
</Dropdown.Content>
|
230
205
|
</Dropdown.Root>
|
231
206
|
{openModals.has(MODALS.PDF_SHARE) && (
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
2
2
|
import { TrashIcon } from '@100mslive/react-icons';
|
3
3
|
import { Dialog, Flex, Text } from '../../../';
|
4
4
|
import { DialogRow } from '../../primitives/DialogContent';
|
5
|
+
import { PrebuiltDialogPortal } from '../PrebuiltDialogPortal';
|
5
6
|
import { PDFHeader } from './pdfHeader';
|
6
7
|
import { PDFInfo } from './pdfInfo';
|
7
8
|
import { SubmitPDF } from './submitPdf';
|
@@ -10,7 +11,7 @@ export const UploadedFile = ({ pdfFile, setPDFFile, onOpenChange }) => {
|
|
10
11
|
const [fileName, ext] = pdfFile.name.split('.');
|
11
12
|
return (
|
12
13
|
<Dialog.Root defaultOpen onOpenChange={onOpenChange}>
|
13
|
-
<
|
14
|
+
<PrebuiltDialogPortal>
|
14
15
|
<Dialog.Overlay />
|
15
16
|
<Dialog.Content
|
16
17
|
css={{
|
@@ -65,7 +66,7 @@ export const UploadedFile = ({ pdfFile, setPDFFile, onOpenChange }) => {
|
|
65
66
|
<SubmitPDF pdfFile={pdfFile} onOpenChange={onOpenChange} />
|
66
67
|
</Flex>
|
67
68
|
</Dialog.Content>
|
68
|
-
</
|
69
|
+
</PrebuiltDialogPortal>
|
69
70
|
</Dialog.Root>
|
70
71
|
);
|
71
72
|
};
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import React, { useRef } from 'react';
|
2
2
|
import { CheckIcon, CloudUploadIcon, CrossIcon } from '@100mslive/react-icons';
|
3
|
+
import { PrebuiltDialogPortal } from '../components/PrebuiltDialogPortal';
|
3
4
|
import { Button } from '../../Button';
|
4
5
|
import { Checkbox } from '../../Checkbox';
|
5
6
|
import { HorizontalDivider } from '../../Divider';
|
@@ -14,7 +15,7 @@ import { Text } from '../../Text';
|
|
14
15
|
|
15
16
|
export const DialogContent = ({ Icon, title, closeable = true, children, css, iconCSS = {}, ...props }) => {
|
16
17
|
return (
|
17
|
-
<
|
18
|
+
<PrebuiltDialogPortal>
|
18
19
|
<Dialog.Overlay />
|
19
20
|
<Dialog.Content css={{ width: 'min(600px, 100%)', ...css }} {...props}>
|
20
21
|
<Dialog.Title>
|
@@ -35,7 +36,7 @@ export const DialogContent = ({ Icon, title, closeable = true, children, css, ic
|
|
35
36
|
<HorizontalDivider css={{ mt: '0.8rem' }} />
|
36
37
|
<Box>{children}</Box>
|
37
38
|
</Dialog.Content>
|
38
|
-
</
|
39
|
+
</PrebuiltDialogPortal>
|
39
40
|
);
|
40
41
|
};
|
41
42
|
|
@@ -60,7 +61,7 @@ export const ErrorDialog = ({ open = true, onOpenChange, title, children, ...pro
|
|
60
61
|
|
61
62
|
export const RequestDialog = ({ open = true, onOpenChange, title, body, actionText = 'Accept', onAction, Icon }) => (
|
62
63
|
<Dialog.Root open={open} onOpenChange={onOpenChange}>
|
63
|
-
<
|
64
|
+
<PrebuiltDialogPortal>
|
64
65
|
<Dialog.Overlay />
|
65
66
|
<Dialog.Content css={{ width: 'min(400px,80%)', p: '$10' }}>
|
66
67
|
<Dialog.Title css={{ p: 0, display: 'flex', flexDirection: 'row', gap: '$md' }}>
|
@@ -97,7 +98,7 @@ export const RequestDialog = ({ open = true, onOpenChange, title, body, actionTe
|
|
97
98
|
</Box>
|
98
99
|
</Flex>
|
99
100
|
</Dialog.Content>
|
100
|
-
</
|
101
|
+
</PrebuiltDialogPortal>
|
101
102
|
</Dialog.Root>
|
102
103
|
);
|
103
104
|
|