@100mslive/roomkit-react 0.3.22-alpha.3 → 0.3.22-alpha.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Accordion/Accordion.d.ts +322 -134
- package/dist/Accordion/index.d.ts +322 -134
- package/dist/Avatar/Avatar.d.ts +141 -47
- package/dist/Button/Button.d.ts +141 -47
- package/dist/Checkbox/Checkbox.d.ts +322 -134
- package/dist/Collapsible/Collapsible.d.ts +483 -201
- package/dist/Divider/Divider.d.ts +322 -134
- package/dist/Dropdown/Dropdown.d.ts +1932 -804
- package/dist/Fieldset/Fieldset.d.ts +141 -47
- package/dist/Footer/Footer.d.ts +1288 -536
- package/dist/{HLSView-EYGGK6BH.js → HLSView-CSOBLYBP.js} +24 -38
- package/dist/HLSView-CSOBLYBP.js.map +7 -0
- package/dist/{PDFView-RMR33QH4.css → HLSView-QZMIDGI4.css} +3 -3
- package/dist/{LeaveScreen-ZAG5UJZL.css.map → HLSView-QZMIDGI4.css.map} +1 -1
- package/dist/IconButton/IconButton.d.ts +141 -47
- package/dist/Input/Input.d.ts +926 -362
- package/dist/Label/Label.d.ts +141 -47
- package/dist/Layout/Box.d.ts +141 -47
- package/dist/Layout/Flex.d.ts +141 -47
- package/dist/Link/Link.d.ts +141 -47
- package/dist/Modal/Dialog.d.ts +987 -329
- package/dist/Modal/DialogContent.d.ts +1127 -469
- package/dist/Pagination/StyledPagination.d.ts +644 -268
- package/dist/Popover/index.d.ts +483 -201
- package/dist/Prebuilt/IconButton.d.ts +322 -134
- package/dist/Prebuilt/components/Chat/ChatBody.d.ts +322 -134
- package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +805 -335
- package/dist/Prebuilt/components/Settings/common.d.ts +322 -134
- package/dist/Progress/index.d.ts +322 -134
- package/dist/RadioGroup/RadioGroup.d.ts +483 -201
- package/dist/ReactSelect/ReactSelect.d.ts +1610 -670
- package/dist/Select/Select.d.ts +483 -201
- package/dist/Sheet/Sheet.d.ts +987 -329
- package/dist/Slider/Slider.d.ts +141 -47
- package/dist/Stats/StyledStats.d.ts +966 -402
- package/dist/Switch/Switch.d.ts +141 -47
- package/dist/Tabs/Tabs.d.ts +644 -268
- package/dist/Text/Text.d.ts +141 -47
- package/dist/TextArea/TextArea.d.ts +141 -47
- package/dist/Theme/base.config.d.ts +78 -26
- package/dist/Theme/stitches.config.d.ts +1514 -1067
- package/dist/TileMenu/StyledMenuTile.d.ts +1127 -469
- package/dist/Toast/Toast.d.ts +946 -382
- package/dist/Video/Video.d.ts +141 -47
- package/dist/VideoList/StyledVideoList.d.ts +483 -201
- package/dist/VideoTile/StyledVideoTile.d.ts +1610 -670
- package/dist/chunk-4VBHLZDR.js +34747 -0
- package/dist/chunk-4VBHLZDR.js.map +7 -0
- package/dist/index.cjs.css +2 -2
- package/dist/index.cjs.css.map +1 -1
- package/dist/index.cjs.js +22358 -22561
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/index.js +15 -25
- package/dist/meta.cjs.json +5299 -5657
- package/dist/meta.esbuild.json +6290 -9146
- package/package.json +8 -8
- package/src/Avatar/Avatar.tsx +1 -1
- package/src/Popover/Popover.stories.tsx +1 -1
- package/src/Prebuilt/App.tsx +2 -6
- package/src/Prebuilt/components/Chat/Chat.tsx +8 -12
- package/src/Prebuilt/components/Chat/ChatFooter.tsx +1 -1
- package/src/Prebuilt/components/Notifications/Notifications.tsx +159 -13
- package/src/Prebuilt/components/Notifications/PeerNotifications.tsx +2 -9
- package/src/Prebuilt/components/Notifications/ReconnectNotifications.tsx +5 -1
- package/src/Prebuilt/components/Notifications/TrackBulkUnmuteModal.tsx +5 -7
- package/src/Prebuilt/components/Notifications/TrackNotifications.tsx +1 -23
- package/src/Prebuilt/components/Notifications/TrackUnmuteModal.tsx +5 -13
- package/src/Prebuilt/components/StatsForNerds.jsx +3 -32
- package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +31 -43
- package/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +2 -2
- package/src/Prebuilt/components/VirtualBackground/VBOption.tsx +1 -3
- package/src/Prebuilt/components/VirtualBackground/VBPicker.tsx +0 -6
- package/src/Prebuilt/layouts/HLSView.jsx +0 -1
- package/src/Prebuilt/layouts/PDFView.jsx +0 -1
- package/src/Prebuilt/layouts/SidePane.tsx +6 -12
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +34 -35
- package/dist/ConferenceScreen-CSVWECB5.js +0 -1778
- package/dist/ConferenceScreen-CSVWECB5.js.map +0 -7
- package/dist/ConferenceScreen-YRURU3RV.css +0 -2780
- package/dist/ConferenceScreen-YRURU3RV.css.map +0 -7
- package/dist/EmbedView-N2E4DZQA.js +0 -17
- package/dist/EmbedView-N2E4DZQA.js.map +0 -7
- package/dist/EmbedView-S54NTHF5.css +0 -2780
- package/dist/EmbedView-S54NTHF5.css.map +0 -7
- package/dist/EmojiReaction-3X4ST4AU.js +0 -11
- package/dist/EmojiReaction-3X4ST4AU.js.map +0 -7
- package/dist/HLSView-EYGGK6BH.js.map +0 -7
- package/dist/HLSView-LBTFLMI4.css +0 -2780
- package/dist/HLSView-LBTFLMI4.css.map +0 -7
- package/dist/LeaveScreen-D6XU64JL.js +0 -556
- package/dist/LeaveScreen-D6XU64JL.js.map +0 -7
- package/dist/LeaveScreen-ZAG5UJZL.css +0 -2780
- package/dist/MoreSettings-R7B4BSNT.css +0 -2780
- package/dist/MoreSettings-R7B4BSNT.css.map +0 -7
- package/dist/MoreSettings-TBJVM7OY.js +0 -16
- package/dist/MoreSettings-TBJVM7OY.js.map +0 -7
- package/dist/PDFView-JOIJDP65.js +0 -84
- package/dist/PDFView-JOIJDP65.js.map +0 -7
- package/dist/PDFView-RMR33QH4.css.map +0 -7
- package/dist/Polls-IN3V2HFI.js +0 -1584
- package/dist/Polls-IN3V2HFI.js.map +0 -7
- package/dist/Polls-JW7JWGTE.css +0 -2780
- package/dist/Polls-JW7JWGTE.css.map +0 -7
- package/dist/Prebuilt/components/Notifications/DeviceChangeNotifications.d.ts +0 -1
- package/dist/Prebuilt/components/Notifications/ErrorNotifications.d.ts +0 -1
- package/dist/Prebuilt/components/Notifications/MessageNotifications.d.ts +0 -1
- package/dist/Prebuilt/components/Notifications/PollNotificationModal.d.ts +0 -1
- package/dist/Prebuilt/components/Notifications/RoleChangeNotification.d.ts +0 -1
- package/dist/RaiseHand-WES4KKMD.js +0 -10
- package/dist/RaiseHand-WES4KKMD.js.map +0 -7
- package/dist/RoleProminence-4ZBDBCMU.css +0 -2780
- package/dist/RoleProminence-4ZBDBCMU.css.map +0 -7
- package/dist/RoleProminence-PB32DLIB.js +0 -116
- package/dist/RoleProminence-PB32DLIB.js.map +0 -7
- package/dist/RoomDetailsPane-CZH2SNLE.js +0 -53
- package/dist/RoomDetailsPane-CZH2SNLE.js.map +0 -7
- package/dist/RoomDetailsPane-XWH2KEFI.css +0 -2780
- package/dist/RoomDetailsPane-XWH2KEFI.css.map +0 -7
- package/dist/ScreenshareLayout-XVENPVK3.js +0 -358
- package/dist/ScreenshareLayout-XVENPVK3.js.map +0 -7
- package/dist/ScreenshareLayout-YUW3KHAB.css +0 -2780
- package/dist/ScreenshareLayout-YUW3KHAB.css.map +0 -7
- package/dist/SidePaneTabs-QXCDHOGG.js +0 -1354
- package/dist/SidePaneTabs-QXCDHOGG.js.map +0 -7
- package/dist/SidePaneTabs-WQGVOWRP.css +0 -2780
- package/dist/SidePaneTabs-WQGVOWRP.css.map +0 -7
- package/dist/VBPicker-XN74N67R.js +0 -322
- package/dist/VBPicker-XN74N67R.js.map +0 -7
- package/dist/VBPicker-YDM2YIOM.css +0 -2780
- package/dist/VBPicker-YDM2YIOM.css.map +0 -7
- package/dist/WaitingView-77PRTIBV.js +0 -10
- package/dist/WaitingView-77PRTIBV.js.map +0 -7
- package/dist/WhiteboardLayout-FZC7SOSG.js +0 -96
- package/dist/WhiteboardLayout-FZC7SOSG.js.map +0 -7
- package/dist/WhiteboardLayout-MNTUWEVK.css +0 -2780
- package/dist/WhiteboardLayout-MNTUWEVK.css.map +0 -7
- package/dist/android-perm-1.png +0 -0
- package/dist/audio-level.png +0 -0
- package/dist/chunk-26D5FDBW.js +0 -16812
- package/dist/chunk-26D5FDBW.js.map +0 -7
- package/dist/chunk-2J5WS52X.js +0 -2595
- package/dist/chunk-2J5WS52X.js.map +0 -7
- package/dist/chunk-2LWOQMYY.js +0 -30
- package/dist/chunk-2LWOQMYY.js.map +0 -7
- package/dist/chunk-3MRQJSIY.js +0 -171
- package/dist/chunk-3MRQJSIY.js.map +0 -7
- package/dist/chunk-4X4WB7X3.js +0 -98
- package/dist/chunk-4X4WB7X3.js.map +0 -7
- package/dist/chunk-7QZJMUHM.js +0 -90
- package/dist/chunk-7QZJMUHM.js.map +0 -7
- package/dist/chunk-ABCV7TX5.js +0 -71
- package/dist/chunk-ABCV7TX5.js.map +0 -7
- package/dist/chunk-BQOT4DK7.js +0 -418
- package/dist/chunk-BQOT4DK7.js.map +0 -7
- package/dist/chunk-ENHSO6YN.js +0 -6337
- package/dist/chunk-ENHSO6YN.js.map +0 -7
- package/dist/chunk-JKWX7W4K.js +0 -161
- package/dist/chunk-JKWX7W4K.js.map +0 -7
- package/dist/chunk-LO4BXA4G.js +0 -114
- package/dist/chunk-LO4BXA4G.js.map +0 -7
- package/dist/chunk-MRVWNFXC.js +0 -59
- package/dist/chunk-MRVWNFXC.js.map +0 -7
- package/dist/chunk-OA4HW7HW.js +0 -262
- package/dist/chunk-OA4HW7HW.js.map +0 -7
- package/dist/chunk-PJQSPAFZ.js +0 -178
- package/dist/chunk-PJQSPAFZ.js.map +0 -7
- package/dist/chunk-QHQKY35W.js +0 -830
- package/dist/chunk-QHQKY35W.js.map +0 -7
- package/dist/chunk-QKXHQ6DV.js +0 -254
- package/dist/chunk-QKXHQ6DV.js.map +0 -7
- package/dist/chunk-RTWNTT77.js +0 -62
- package/dist/chunk-RTWNTT77.js.map +0 -7
- package/dist/chunk-TBXRX6MK.js +0 -576
- package/dist/chunk-TBXRX6MK.js.map +0 -7
- package/dist/chunk-TCOPR3BK.js +0 -487
- package/dist/chunk-TCOPR3BK.js.map +0 -7
- package/dist/chunk-VKORP2LF.js +0 -41
- package/dist/chunk-VKORP2LF.js.map +0 -7
- package/dist/chunk-YYVDCP5Z.js +0 -136
- package/dist/chunk-YYVDCP5Z.js.map +0 -7
- package/dist/empty-chat.svg +0 -12
- package/dist/ios-perm-0.png +0 -0
- package/dist/pdf-share.png +0 -0
- package/dist/screen-share.png +0 -0
- package/dist/transaction_error.svg +0 -12
- package/src/Prebuilt/components/Notifications/DeviceChangeNotifications.tsx +0 -18
- package/src/Prebuilt/components/Notifications/ErrorNotifications.tsx +0 -56
- package/src/Prebuilt/components/Notifications/MessageNotifications.tsx +0 -24
- package/src/Prebuilt/components/Notifications/PollNotificationModal.tsx +0 -71
- package/src/Prebuilt/components/Notifications/RoleChangeNotification.tsx +0 -24
@@ -1,7 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"version": 3,
|
3
|
-
"sources": ["../src/Prebuilt/components/Footer/ParticipantList.tsx", "../src/Prebuilt/components/RemoveParticipant.tsx", "../src/Prebuilt/components/Footer/RoleAccordion.tsx", "../src/Prebuilt/components/Footer/RoleOptions.tsx", "../src/Prebuilt/components/hooks/useGroupOnStageActions.tsx", "../src/Prebuilt/components/hooks/usePeerOnStageActions.tsx"],
|
4
|
-
"sourcesContent": ["import React, { Fragment, useCallback, useState } from 'react';\nimport { useDebounce, useMedia } from 'react-use';\nimport {\n HMSPeer,\n HMSPeerType,\n HMSRoleName,\n selectAvailableRoleNames,\n selectHandRaisedPeers,\n selectHasPeerHandRaised,\n selectIsLargeRoom,\n selectIsPeerAudioEnabled,\n selectLocalPeerID,\n selectPeerCount,\n selectPermissions,\n useHMSStore,\n} from '@100mslive/react-sdk';\nimport {\n AddIcon,\n CallIcon,\n ChangeRoleIcon,\n CrossIcon,\n HandIcon,\n MicOffIcon,\n PeopleIcon,\n PersonSettingsIcon,\n SearchIcon,\n VerticalMenuIcon,\n} from '@100mslive/react-icons';\nimport { Accordion, Box, Button, config as cssConfig, Dropdown, Flex, Input, Text, textEllipsis } from '../../..';\n// @ts-ignore: No implicit Any\nimport IconButton from '../../IconButton';\nimport { ConnectionIndicator } from '../Connection/ConnectionIndicator';\nimport { RemoveParticipant } from '../RemoveParticipant';\nimport { RoleChangeModal } from '../RoleChangeModal';\nimport { RoleAccordion } from './RoleAccordion';\nimport { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';\n// @ts-ignore: No implicit Any\nimport { useIsSidepaneTypeOpen, useSidepaneToggle } from '../AppData/useSidepane';\nimport { useSidepaneResetOnLayoutUpdate } from '../AppData/useSidepaneResetOnLayoutUpdate';\nimport { usePeerOnStageActions } from '../hooks/usePeerOnStageActions';\nimport { useParticipants } from '../../common/hooks';\n// @ts-ignore: No implicit Any\nimport { getFormattedCount } from '../../common/utils';\nimport { SIDE_PANE_OPTIONS } from '../../common/constants';\n\nexport const ParticipantList = ({\n offStageRoles = [],\n onActive,\n}: {\n offStageRoles: HMSRoleName[];\n onActive: (role: string) => void;\n}) => {\n const [filter, setFilter] = useState<{ search?: string } | undefined>();\n const { participants, isConnected, peerCount } = useParticipants(filter);\n const isLargeRoom = useHMSStore(selectIsLargeRoom);\n const peersOrderedByRoles: Record<string, HMSPeer[]> = {};\n\n const handRaisedPeers = useHMSStore(selectHandRaisedPeers);\n\n participants.forEach(participant => {\n if (participant.roleName) {\n if (peersOrderedByRoles[participant.roleName] === undefined) {\n peersOrderedByRoles[participant.roleName] = [];\n }\n peersOrderedByRoles[participant.roleName].push(participant);\n }\n });\n\n // prefill off_stage roles of large rooms to load more peers\n if (isLargeRoom) {\n offStageRoles.forEach(role => {\n if (!peersOrderedByRoles[role]) {\n peersOrderedByRoles[role] = [];\n }\n });\n }\n\n useSidepaneResetOnLayoutUpdate('participant_list', SIDE_PANE_OPTIONS.PARTICIPANTS);\n\n const onSearch = useCallback((value: string) => {\n setFilter(filterValue => {\n if (!filterValue) {\n filterValue = {};\n }\n filterValue.search = value.toLowerCase();\n return { ...filterValue };\n });\n }, []);\n\n if (peerCount === 0) {\n return null;\n }\n\n return (\n <Fragment>\n <Flex\n direction=\"column\"\n css={{\n size: '100%',\n gap: '$4',\n }}\n >\n {!filter?.search && participants.length === 0 ? null : <ParticipantSearch onSearch={onSearch} inSidePane />}\n <VirtualizedParticipants\n peersOrderedByRoles={peersOrderedByRoles}\n handRaisedList={handRaisedPeers}\n isConnected={!!isConnected}\n filter={filter}\n offStageRoles={offStageRoles}\n isLargeRoom={isLargeRoom}\n onActive={onActive}\n >\n {participants.length === 0 ? (\n <Flex\n align=\"center\"\n justify=\"center\"\n className=\"emptyParticipants\"\n css={{ w: '100%', p: '$8 0', display: 'none' }}\n >\n <Text variant=\"sm\">{!filter ? 'No participants' : 'No matching participants'}</Text>\n </Flex>\n ) : null}\n </VirtualizedParticipants>\n </Flex>\n </Fragment>\n );\n};\n\nexport const ParticipantCount = () => {\n const peerCount = useHMSStore(selectPeerCount);\n const toggleSidepane = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);\n const isPeerListOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.PARTICIPANTS);\n\n if (peerCount === 0) {\n return null;\n }\n return (\n <IconButton\n css={{\n w: 'auto',\n p: '$4',\n h: 'auto',\n bg: isPeerListOpen ? '$surface_brighter' : '',\n }}\n onClick={() => {\n if (peerCount > 0) {\n toggleSidepane();\n }\n }}\n data-testid=\"participant_list\"\n >\n <PeopleIcon />\n <Text variant=\"sm\" css={{ mx: '$4', c: 'inherit' }}>\n {getFormattedCount(peerCount)}\n </Text>\n </IconButton>\n );\n};\n\nexport const Participant = ({\n peer,\n isConnected,\n isHandRaisedAccordion,\n style,\n}: {\n peer: HMSPeer;\n isConnected: boolean;\n isHandRaisedAccordion?: boolean;\n style: React.CSSProperties;\n}) => {\n const localPeerId = useHMSStore(selectLocalPeerID);\n return (\n <Flex\n key={peer.id}\n css={{\n w: '100%',\n p: '$4 $8',\n pr: '$6',\n h: '$16',\n '&:hover .participant_item': { display: 'flex' },\n }}\n align=\"center\"\n justify=\"between\"\n data-testid={'participant_' + peer.name}\n style={style}\n >\n <Text\n variant=\"sm\"\n css={{ ...textEllipsis('100%'), flex: '1 1 0', mr: '$8', fontWeight: '$semiBold', color: '$on_surface_high' }}\n >\n {peer.name} {localPeerId === peer.id ? '(You)' : ''}\n </Text>\n {isConnected && peer.roleName ? (\n <ParticipantActions\n peerId={peer.id}\n peerType={peer.type}\n role={peer.roleName}\n isHandRaisedAccordion={isHandRaisedAccordion}\n />\n ) : null}\n </Flex>\n );\n};\n\nconst VirtualizedParticipants = ({\n peersOrderedByRoles = {},\n isConnected,\n filter,\n handRaisedList = [],\n offStageRoles,\n isLargeRoom,\n onActive,\n children,\n}: {\n peersOrderedByRoles: Record<string, HMSPeer[]>;\n isConnected: boolean;\n filter: undefined | { search?: string };\n handRaisedList: HMSPeer[];\n offStageRoles: HMSRoleName[];\n isLargeRoom: boolean;\n onActive: (role: string) => void;\n children: React.ReactNode;\n}) => {\n return (\n <Flex\n direction=\"column\"\n css={{\n gap: '$8',\n overflowY: 'auto',\n overflowX: 'hidden',\n pr: '$10',\n mr: '-$10',\n flex: '1 1 0',\n '& > div:empty ~ .emptyParticipants': {\n display: 'flex',\n },\n }}\n >\n <Accordion.Root type={isLargeRoom ? 'single' : 'multiple'} collapsible>\n {handRaisedList.length > 0 ? (\n <RoleAccordion\n peerList={handRaisedList}\n roleName=\"Hand Raised\"\n filter={filter}\n isConnected={isConnected}\n isHandRaisedAccordion\n offStageRoles={offStageRoles}\n />\n ) : null}\n {Object.keys(peersOrderedByRoles).map(role => (\n <RoleAccordion\n key={role}\n peerList={peersOrderedByRoles[role]}\n roleName={role}\n isConnected={isConnected}\n filter={filter}\n offStageRoles={offStageRoles}\n onActive={onActive}\n />\n ))}\n </Accordion.Root>\n {children}\n </Flex>\n );\n};\n\n/**\n * shows settings to change for a participant like changing their role\n */\nconst ParticipantActions = React.memo(\n ({\n peerId,\n peerType,\n role,\n isHandRaisedAccordion,\n }: {\n peerId: string;\n role: string;\n isHandRaisedAccordion?: boolean;\n peerType: HMSPeerType;\n }) => {\n const isHandRaised = useHMSStore(selectHasPeerHandRaised(peerId));\n const canChangeRole = useHMSStore(selectPermissions)?.changeRole;\n const canRemoveOthers = useHMSStore(selectPermissions)?.removeOthers;\n const { elements } = useRoomLayoutConferencingScreen();\n const { on_stage_exp } = elements || {};\n const shouldShowMoreActions = (on_stage_exp && canChangeRole) || canRemoveOthers;\n const isAudioMuted = !useHMSStore(selectIsPeerAudioEnabled(peerId));\n\n return (\n <Flex\n align=\"center\"\n css={{\n flexShrink: 0,\n gap: '$8',\n }}\n >\n {isHandRaisedAccordion ? (\n <HandRaisedAccordionParticipantActions peerId={peerId} role={role} />\n ) : (\n <>\n <ConnectionIndicator peerId={peerId} />\n {peerType === HMSPeerType.SIP && (\n <Flex\n align=\"center\"\n justify=\"center\"\n css={{ p: '$1', c: '$on_surface_high', bg: '$surface_bright', borderRadius: '$round' }}\n >\n <CallIcon width={19} height={19} />\n </Flex>\n )}\n {isHandRaised && (\n <Flex\n align=\"center\"\n justify=\"center\"\n css={{ p: '$1', c: '$on_surface_high', bg: '$surface_bright', borderRadius: '$round' }}\n >\n <HandIcon height={19} width={19} />\n </Flex>\n )}\n {isAudioMuted ? (\n <Flex\n align=\"center\"\n justify=\"center\"\n css={{ p: '$2', c: '$on_surface_high', bg: '$surface_bright', borderRadius: '$round' }}\n >\n <MicOffIcon height={19} width={19} />\n </Flex>\n ) : null}\n\n {shouldShowMoreActions ? <ParticipantMoreActions peerId={peerId} role={role} /> : null}\n </>\n )}\n </Flex>\n );\n },\n);\n\nconst quickActionStyle = { p: '$1', borderRadius: '$round' };\nconst HandRaisedAccordionParticipantActions = ({ peerId, role }: { peerId: string; role: string }) => {\n const { handleStageAction, lowerPeerHand, shouldShowStageRoleChange, isInStage } = usePeerOnStageActions({\n peerId,\n role,\n });\n if (!shouldShowStageRoleChange) {\n return null;\n }\n return (\n <>\n <Button variant=\"standard\" css={quickActionStyle} onClick={lowerPeerHand}>\n <CrossIcon height={18} width={18} />\n </Button>\n {!isInStage && (\n <Button variant=\"primary\" onClick={handleStageAction} css={quickActionStyle}>\n <AddIcon height={18} width={18} />\n </Button>\n )}\n </>\n );\n};\n\nconst ParticipantMoreActions = ({ peerId, role }: { peerId: string; role: string }) => {\n const {\n open,\n setOpen,\n bring_to_stage_label,\n remove_from_stage_label,\n handleStageAction,\n isInStage,\n shouldShowStageRoleChange,\n } = usePeerOnStageActions({ peerId, role });\n const canChangeRole = !!useHMSStore(selectPermissions)?.changeRole;\n const [openRoleChangeModal, setOpenRoleChangeModal] = useState(false);\n const roles = useHMSStore(selectAvailableRoleNames);\n\n return (\n <>\n <Dropdown.Root open={open} onOpenChange={value => setOpen(value)} modal={false}>\n <Dropdown.Trigger\n asChild\n data-testid=\"participant_more_actions\"\n className=\"participant_item\"\n css={{\n p: '$1',\n r: '$0',\n c: '$on_surface_high',\n display: open ? 'flex' : 'none',\n '&:hover': {\n bg: '$surface_bright',\n },\n '@md': {\n display: 'flex',\n },\n }}\n tabIndex={0}\n >\n <Box css={{ my: 'auto' }}>\n <VerticalMenuIcon />\n </Box>\n </Dropdown.Trigger>\n <Dropdown.Portal>\n <Dropdown.Content align=\"end\" sideOffset={8} css={{ w: '$64', bg: '$surface_default' }}>\n {shouldShowStageRoleChange ? (\n <Dropdown.Item css={{ bg: '$surface_default' }} onClick={() => handleStageAction()}>\n <ChangeRoleIcon />\n <Text variant=\"sm\" css={{ ml: '$4', fontWeight: '$semiBold', c: '$on_surface_high' }}>\n {isInStage ? remove_from_stage_label : bring_to_stage_label}\n </Text>\n </Dropdown.Item>\n ) : null}\n\n {canChangeRole && roles.length > 1 ? (\n <Dropdown.Item css={{ bg: '$surface_default' }} onClick={() => setOpenRoleChangeModal(true)}>\n <PersonSettingsIcon />\n <Text variant=\"sm\" css={{ ml: '$4', fontWeight: '$semiBold', c: '$on_surface_high' }}>\n Switch Role\n </Text>\n </Dropdown.Item>\n ) : null}\n <RemoveParticipant peerId={peerId} />\n </Dropdown.Content>\n </Dropdown.Portal>\n </Dropdown.Root>\n {openRoleChangeModal && <RoleChangeModal peerId={peerId} onOpenChange={setOpenRoleChangeModal} />}\n </>\n );\n};\n\nexport const ParticipantSearch = ({\n onSearch,\n placeholder = 'Search for participants',\n inSidePane = false,\n}: {\n inSidePane?: boolean;\n placeholder?: string;\n onSearch: (val: string) => void;\n}) => {\n const [value, setValue] = React.useState('');\n const isMobile = useMedia(cssConfig.media.md);\n\n useDebounce(\n () => {\n onSearch(value);\n },\n 300,\n [value, onSearch],\n );\n\n return (\n <Flex\n align=\"center\"\n css={{\n p: isMobile ? '0' : '$2 0',\n mb: '$2',\n position: 'relative',\n color: '$on_surface_medium',\n mt: inSidePane ? '$4' : '',\n }}\n onClick={e => e.stopPropagation()}\n >\n <SearchIcon style={{ position: 'absolute', left: '0.5rem' }} />\n <Input\n type=\"text\"\n placeholder={placeholder}\n css={{ w: '100%', p: '$6', pl: '$14', bg: inSidePane ? '$surface_default' : '$surface_dim' }}\n value={value}\n onKeyDown={event => {\n event.stopPropagation();\n }}\n onChange={event => {\n setValue(event.currentTarget.value);\n }}\n autoComplete=\"off\"\n aria-autocomplete=\"none\"\n />\n </Flex>\n );\n};\n", "import React from 'react';\nimport { HMSPeerID, selectLocalPeerID, selectPermissions, useHMSActions, useHMSStore } from '@100mslive/react-sdk';\nimport { PeopleRemoveIcon } from '@100mslive/react-icons';\n// @ts-ignore: No implicit Any\nimport { ToastManager } from './Toast/ToastManager';\nimport { Dropdown } from '../../Dropdown';\nimport { Text } from '../../Text';\n\nexport const RemoveParticipant = ({ peerId }: { peerId: HMSPeerID }) => {\n const canRemoveOthers = useHMSStore(selectPermissions)?.removeOthers;\n const localPeerId = useHMSStore(selectLocalPeerID);\n const actions = useHMSActions();\n\n if (peerId === localPeerId || !canRemoveOthers) {\n return null;\n }\n return (\n <Dropdown.Item\n css={{ color: '$alert_error_default', bg: '$surface_default' }}\n onClick={async () => {\n try {\n await actions.removePeer(peerId, '');\n } catch (error) {\n const ex = error as Error;\n ToastManager.addToast({ title: ex.message, variant: 'error' });\n }\n }}\n >\n <PeopleRemoveIcon />\n <Text variant=\"sm\" css={{ ml: '$4', color: 'inherit', fontWeight: '$semiBold' }}>\n Remove Participant\n </Text>\n </Dropdown.Item>\n );\n};\n", "import React, { useEffect } from 'react';\nimport { useMeasure } from 'react-use';\nimport { FixedSizeList } from 'react-window';\nimport { HMSPeer, selectIsLargeRoom, useHMSStore, usePaginatedParticipants } from '@100mslive/react-sdk';\nimport { AddIcon, ChevronRightIcon, CrossIcon } from '@100mslive/react-icons';\nimport { Accordion } from '../../../Accordion';\nimport { Button } from '../../../Button';\nimport { HorizontalDivider } from '../../../Divider';\nimport { Flex } from '../../../Layout';\nimport { Text } from '../../../Text';\nimport { Participant } from './ParticipantList';\nimport { RoleOptions } from './RoleOptions';\nimport { useGroupOnStageActions } from '../hooks/useGroupOnStageActions';\n// @ts-ignore: No implicit Any\nimport { getFormattedCount } from '../../common/utils';\n\nexport const ROW_HEIGHT = 50;\nconst ITER_TIMER = 5000;\n\nexport interface ItemData {\n peerList: HMSPeer[];\n isHandRaisedAccordion?: boolean;\n isConnected: boolean;\n}\n\nexport function itemKey(index: number, data: ItemData) {\n return data.peerList[index]?.id;\n}\n\nexport const VirtualizedParticipantItem = React.memo(\n ({ index, data, style }: { index: number; data: ItemData; style: React.CSSProperties }) => {\n return (\n <Participant\n key={data.peerList[index].id}\n peer={data.peerList[index]}\n isHandRaisedAccordion={data.isHandRaisedAccordion}\n isConnected={data.isConnected}\n style={style}\n />\n );\n },\n);\n\nexport const RoleAccordion = ({\n peerList = [],\n roleName,\n isConnected,\n filter,\n isHandRaisedAccordion = false,\n offStageRoles,\n onActive,\n}: ItemData & {\n roleName: string;\n isHandRaisedAccordion?: boolean;\n filter?: { search?: string };\n offStageRoles: string[];\n onActive?: (role: string) => void;\n}) => {\n const [ref, { width }] = useMeasure<HTMLDivElement>();\n const isLargeRoom = useHMSStore(selectIsLargeRoom);\n const { peers, total, loadPeers } = usePaginatedParticipants({ role: roleName, limit: 10 });\n const isOffStageRole = roleName && offStageRoles.includes(roleName);\n let peersInAccordion = peerList;\n // for large rooms, peer list would be empty\n if (isOffStageRole && isLargeRoom) {\n peersInAccordion = peers;\n if (filter?.search) {\n peersInAccordion = peersInAccordion.filter(peer => peer.name.toLowerCase().includes(filter.search || ''));\n }\n }\n const { bringAllToStage, bring_to_stage_label, canBringToStage, lowerAllHands } = useGroupOnStageActions({\n peers: peersInAccordion,\n });\n\n useEffect(() => {\n if (!isOffStageRole || !isLargeRoom) {\n return;\n }\n loadPeers();\n const interval = setInterval(() => {\n loadPeers();\n }, ITER_TIMER);\n return () => clearInterval(interval);\n }, [isOffStageRole, isLargeRoom]); //eslint-disable-line\n\n if (peersInAccordion.length === 0 || (isHandRaisedAccordion && filter?.search)) {\n return null;\n }\n\n const height = ROW_HEIGHT * peersInAccordion.length;\n const hasNext = total > peersInAccordion.length && !filter?.search;\n\n return (\n <Accordion.Item value={roleName} css={{ '&:hover .role_actions': { visibility: 'visible' }, mb: '$8' }} ref={ref}>\n <Accordion.Header\n chevronID={`role_accordion_btn_${roleName}`}\n iconStyles={{ c: '$on_surface_high' }}\n css={{\n textTransform: 'capitalize',\n p: '$6 $8',\n fontSize: '$sm',\n fontWeight: '$semiBold',\n c: '$on_surface_medium',\n borderRadius: '$1',\n border: '1px solid $border_default',\n '&[data-state=\"open\"]': {\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n },\n }}\n >\n <Flex justify=\"between\" align=\"center\" css={{ flexGrow: 1, pr: '$6' }}>\n <Text\n variant=\"sm\"\n css={{ fontWeight: '$semiBold', textTransform: 'capitalize', color: '$on_surface_medium' }}\n >\n {roleName} {`(${getFormattedCount(isLargeRoom && isOffStageRole ? total : peerList.length)})`}\n </Text>\n <RoleOptions roleName={roleName} peerList={peersInAccordion} />\n </Flex>\n </Accordion.Header>\n <Accordion.Content contentStyles={{ border: '1px solid $border_default', borderTop: 'none' }}>\n <FixedSizeList\n itemSize={ROW_HEIGHT}\n itemData={{\n peerList: isHandRaisedAccordion\n ? peersInAccordion.sort((a, b) => {\n try {\n const aHandRaisedAt = JSON.parse(a.metadata || '{}').handRaisedAt;\n const bHandRaisedAt = JSON.parse(b.metadata || '{}').handRaisedAt;\n return aHandRaisedAt - bHandRaisedAt;\n } catch (err) {\n return 0;\n }\n })\n : peersInAccordion,\n isConnected,\n isHandRaisedAccordion,\n }}\n itemKey={itemKey}\n itemCount={peersInAccordion.length}\n width={width}\n height={height}\n >\n {VirtualizedParticipantItem}\n </FixedSizeList>\n {offStageRoles?.includes(roleName) && hasNext ? (\n <Flex\n align=\"center\"\n justify=\"end\"\n css={{\n gap: '$1',\n cursor: 'pointer',\n color: '$on_surface_high',\n p: '$6',\n borderTop: '1px solid $border_default',\n }}\n onClick={() => onActive?.(roleName)}\n >\n <Text variant=\"sm\" css={{ color: 'inherit' }}>\n View All\n </Text>\n <ChevronRightIcon />\n </Flex>\n ) : null}\n {isHandRaisedAccordion && canBringToStage && (\n <>\n <HorizontalDivider />\n <Flex css={{ w: '100%', p: '$6', gap: '$4' }} justify=\"center\">\n <Button variant=\"standard\" onClick={lowerAllHands} icon css={{ pl: '$2' }}>\n <CrossIcon /> Lower all hands\n </Button>\n\n <Button onClick={bringAllToStage} icon css={{ pl: '$2' }}>\n <AddIcon /> {bring_to_stage_label}\n </Button>\n </Flex>\n </>\n )}\n </Accordion.Content>\n </Accordion.Item>\n );\n};\n", "import React, { useState } from 'react';\nimport { DefaultConferencingScreen_Elements } from '@100mslive/types-prebuilt';\nimport { match } from 'ts-pattern';\nimport {\n HMSPeer,\n selectPermissions,\n selectRoleByRoleName,\n selectTracksMap,\n useHMSActions,\n useHMSStore,\n} from '@100mslive/react-sdk';\nimport {\n MicOffIcon,\n MicOnIcon,\n PersonRectangleIcon,\n RemoveUserIcon,\n VerticalMenuIcon,\n VideoOffIcon,\n VideoOnIcon,\n} from '@100mslive/react-icons';\nimport { Dropdown } from '../../../Dropdown';\nimport { Flex } from '../../../Layout';\nimport { Text } from '../../../Text';\nimport { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';\n// @ts-ignore: No implicit Any\nimport { getMetadata } from '../../common/utils';\n\nconst dropdownItemCSS = { backgroundColor: '$surface_default', gap: '$4', p: '$8' };\nconst optionTextCSS = {\n fontWeight: '$semiBold',\n color: '$on_surface_high',\n textTransform: 'none',\n whiteSpace: 'nowrap',\n};\n\nconst DropdownWrapper = ({ children }: { children: React.ReactNode }) => {\n const [openOptions, setOpenOptions] = useState(false);\n if (React.Children.toArray(children).length === 0) {\n return null;\n }\n return (\n <Dropdown.Root open={openOptions} onOpenChange={setOpenOptions}>\n <Dropdown.Trigger\n data-testid=\"role_group_options\"\n onClick={e => e.stopPropagation()}\n className=\"role_actions\"\n asChild\n css={{\n p: '$1',\n r: '$0',\n c: '$on_surface_high',\n visibility: openOptions ? 'visible' : 'hidden',\n '&:hover': {\n c: '$on_surface_medium',\n },\n '@md': {\n visibility: 'visible',\n },\n }}\n >\n <Flex>\n <VerticalMenuIcon />\n </Flex>\n </Dropdown.Trigger>\n <Dropdown.Content\n onClick={e => e.stopPropagation()}\n css={{ w: 'max-content', bg: '$surface_default', py: 0 }}\n align=\"end\"\n >\n {children}\n </Dropdown.Content>\n </Dropdown.Root>\n );\n};\n\nexport const RoleOptions = ({ roleName, peerList }: { roleName: string; peerList: HMSPeer[] }) => {\n const permissions = useHMSStore(selectPermissions);\n const hmsActions = useHMSActions();\n const { elements } = useRoomLayoutConferencingScreen();\n const { on_stage_role, off_stage_roles = [] } = (elements as DefaultConferencingScreen_Elements)?.on_stage_exp || {};\n const canRemoveRoleFromStage = permissions?.changeRole && roleName === on_stage_role;\n const role = useHMSStore(selectRoleByRoleName(roleName));\n const tracks = useHMSStore(selectTracksMap);\n if (!role) {\n return null;\n }\n const canPublishAudio = role.publishParams.allowed.includes('audio');\n const canPublishVideo = role.publishParams.allowed.includes('video');\n\n let isVideoOnForSomePeers = false;\n let isAudioOnForSomePeers = false;\n\n peerList.forEach(peer => {\n if (peer.isLocal) {\n return;\n }\n const isAudioOn = !!peer.audioTrack && tracks[peer.audioTrack]?.enabled;\n const isVideoOn = !!peer.videoTrack && tracks[peer.videoTrack]?.enabled;\n isAudioOnForSomePeers = isAudioOnForSomePeers || isAudioOn;\n isVideoOnForSomePeers = isVideoOnForSomePeers || isVideoOn;\n });\n\n const setTrackEnabled = async (type: 'audio' | 'video', enabled = false) => {\n try {\n await hmsActions.setRemoteTracksEnabled({ roles: [roleName], source: 'regular', type, enabled });\n } catch (e) {\n console.error(e);\n }\n };\n\n // on stage and off stage roles\n const canRemoveRoleFromRoom =\n permissions?.removeOthers && (on_stage_role === roleName || off_stage_roles?.includes(roleName));\n\n if (\n peerList.length === 0 ||\n // if only local peer is present no need to show any options\n (peerList.length === 1 && peerList[0].isLocal) ||\n !role\n ) {\n return null;\n }\n\n const removeAllFromStage = () => {\n peerList.forEach(peer => {\n const prevRole = getMetadata(peer.metadata).prevRole;\n if (prevRole) {\n hmsActions.changeRoleOfPeer(peer.id, prevRole, true);\n }\n });\n };\n\n const removePeersFromRoom = async () => {\n try {\n peerList.forEach(async peer => {\n await hmsActions.removePeer(peer.id, '');\n });\n } catch (e) {\n console.error(e);\n }\n };\n\n return (\n <DropdownWrapper>\n {canRemoveRoleFromStage ? (\n <Dropdown.Item\n css={{ ...dropdownItemCSS, borderBottom: '1px solid $border_bright' }}\n onClick={removeAllFromStage}\n >\n <PersonRectangleIcon />\n <Text variant=\"sm\" css={optionTextCSS}>\n Remove all from Stage\n </Text>\n </Dropdown.Item>\n ) : null}\n\n {match({ canPublishAudio, isAudioOnForSomePeers, canMute: permissions?.mute, canUnmute: permissions?.unmute })\n .with({ canPublishAudio: true, isAudioOnForSomePeers: true, canMute: true }, () => {\n return (\n <Dropdown.Item css={dropdownItemCSS} onClick={() => setTrackEnabled('audio', false)}>\n <MicOffIcon />\n <Text variant=\"sm\" css={optionTextCSS}>\n Mute Audio for All\n </Text>\n </Dropdown.Item>\n );\n })\n .with({ canPublishAudio: true, isAudioOnForSomePeers: false, canUnmute: true }, () => {\n return (\n <Dropdown.Item css={dropdownItemCSS} onClick={() => setTrackEnabled('audio', true)}>\n <MicOnIcon />\n <Text variant=\"sm\" css={optionTextCSS}>\n Request to Unmute Audio for All\n </Text>\n </Dropdown.Item>\n );\n })\n .otherwise(() => null)}\n {match({ canPublishVideo, isVideoOnForSomePeers, canMute: permissions?.mute, canUnmute: permissions?.unmute })\n .with({ canPublishVideo: true, isVideoOnForSomePeers: true, canMute: true }, () => {\n return (\n <Dropdown.Item css={dropdownItemCSS} onClick={() => setTrackEnabled('video', false)}>\n <VideoOffIcon />\n <Text variant=\"sm\" css={optionTextCSS}>\n Mute Video for All\n </Text>\n </Dropdown.Item>\n );\n })\n .with({ canPublishVideo: true, isVideoOnForSomePeers: false, canUnmute: true }, () => {\n return (\n <Dropdown.Item css={dropdownItemCSS} onClick={() => setTrackEnabled('video', true)}>\n <VideoOnIcon />\n <Text variant=\"sm\" css={optionTextCSS}>\n Request to Unmute Video for All\n </Text>\n </Dropdown.Item>\n );\n })\n .otherwise(() => null)}\n\n {canRemoveRoleFromRoom ? (\n <Dropdown.Item\n css={{ ...dropdownItemCSS, borderTop: '1px solid $border_bright', color: '$alert_error_default' }}\n onClick={removePeersFromRoom}\n >\n <RemoveUserIcon />\n <Text variant=\"sm\" css={{ ...optionTextCSS, color: 'inherit' }}>\n Remove all from Room\n </Text>\n </Dropdown.Item>\n ) : null}\n </DropdownWrapper>\n );\n};\n", "import { match, P } from 'ts-pattern';\nimport { HMSPeer, selectPermissions, useHMSActions, useHMSStore } from '@100mslive/react-sdk';\nimport { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';\n\nexport const useGroupOnStageActions = ({ peers }: { peers: HMSPeer[] }) => {\n const hmsActions = useHMSActions();\n const { elements } = useRoomLayoutConferencingScreen();\n const {\n bring_to_stage_label,\n remove_from_stage_label,\n on_stage_role,\n off_stage_roles = [],\n skip_preview_for_role_change = false,\n } = elements.on_stage_exp || {};\n const canChangeRole = useHMSStore(selectPermissions)?.changeRole;\n\n const offStageRolePeers = peers.filter(peer =>\n match({ on_stage_role, bring_to_stage_label, roleName: peer.roleName })\n .with(\n {\n on_stage_role: P.when(role => !!role),\n bring_to_stage_label: P.when(label => !!label),\n roleName: P.when(role => !!role && off_stage_roles.includes(role)),\n },\n () => true,\n )\n .otherwise(() => false),\n );\n\n const lowerAllHands = async () => {\n return Promise.all(peers.map(peer => hmsActions.lowerRemotePeerHand(peer.id)));\n };\n\n const bringAllToStage = () => {\n if (!canChangeRole || !on_stage_role) {\n return;\n }\n return Promise.all(\n offStageRolePeers.map(peer => {\n return hmsActions.changeRoleOfPeer(peer.id, on_stage_role, skip_preview_for_role_change).then(() => {\n return skip_preview_for_role_change ? hmsActions.lowerRemotePeerHand(peer.id) : null;\n });\n }),\n );\n };\n\n return {\n lowerAllHands,\n bringAllToStage,\n canBringToStage: canChangeRole && offStageRolePeers.length > 0,\n bring_to_stage_label,\n remove_from_stage_label,\n };\n};\n", "import { useState } from 'react';\nimport { selectPeerMetadata, selectPermissions, useHMSActions, useHMSStore } from '@100mslive/react-sdk';\nimport { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';\n\nexport const usePeerOnStageActions = ({ peerId, role }: { peerId: string; role: string }) => {\n const hmsActions = useHMSActions();\n const { elements } = useRoomLayoutConferencingScreen();\n const {\n bring_to_stage_label,\n remove_from_stage_label,\n on_stage_role,\n off_stage_roles = [],\n skip_preview_for_role_change = false,\n } = elements.on_stage_exp || {};\n const isInStage = role === on_stage_role;\n const canChangeRole = useHMSStore(selectPermissions)?.changeRole;\n const shouldShowStageRoleChange =\n canChangeRole &&\n ((isInStage && remove_from_stage_label) || (off_stage_roles?.includes(role) && bring_to_stage_label));\n const prevRole = useHMSStore(selectPeerMetadata(peerId))?.prevRole;\n const [open, setOpen] = useState(false);\n\n const lowerPeerHand = async () => {\n await hmsActions.lowerRemotePeerHand(peerId);\n };\n\n const handleStageAction = async () => {\n if (isInStage) {\n prevRole && hmsActions.changeRoleOfPeer(peerId, prevRole, true);\n } else if (on_stage_role) {\n await hmsActions.changeRoleOfPeer(peerId, on_stage_role, skip_preview_for_role_change);\n if (skip_preview_for_role_change) {\n await lowerPeerHand();\n }\n }\n setOpen(false);\n };\n\n return {\n open,\n setOpen,\n lowerPeerHand,\n handleStageAction,\n shouldShowStageRoleChange,\n isInStage,\n bring_to_stage_label,\n remove_from_stage_label,\n };\n};\n"],
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,OAAOA,UAAS,UAAU,aAAa,YAAAC,iBAAgB;AACvD,SAAS,aAAa,gBAAgB;AACtC;AAAA,EAEE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA,qBAAAC;AAAA,EACA;AAAA,EACA,qBAAAC;AAAA,EACA;AAAA,EACA,qBAAAC;AAAA,EACA,eAAAC;AAAA,OACK;AACP;AAAA,EACE,WAAAC;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAAC;AAAA,EACA;AAAA,EACA,cAAAC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,oBAAAC;AAAA,OACK;;;AC3BP;AAAA,OAAO,WAAW;AAClB,SAAoB,mBAAmB,mBAAmB,eAAe,mBAAmB;AAC5F,SAAS,wBAAwB;AAM1B,IAAM,oBAAoB,CAAC,EAAE,OAAO,MAA6B;AARxE;AASE,QAAM,mBAAkB,iBAAY,iBAAiB,MAA7B,mBAAgC;AACxD,QAAM,cAAc,YAAY,iBAAiB;AACjD,QAAM,UAAU,cAAc;AAE9B,MAAI,WAAW,eAAe,CAAC,iBAAiB;AAC9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EACA,cAAc;AAAA,EACd,aAAa;AACf,MAIM;AACJ,QAAM,CAAC,OAAO,QAAQ,IAAIA,OAAM,SAAS,EAAE;AAC3C,QAAM,WAAW,SAAS,OAAU,MAAM,EAAE;AAE5C;AAAA,IACE,MAAM;AACJ,eAAS,KAAK;AAAA,IAChB;AAAA,IACA;AAAA,IACA,CAAC,OAAO,QAAQ;AAAA,EAClB;AAEA,SACE,gBAAAA,OAAA;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,KAAK;AAAA,QACH,GAAG,WAAW,MAAM;AAAA,QACpB,IAAI;AAAA,QACJ,UAAU;AAAA,QACV,OAAO;AAAA,QACP,IAAI,aAAa,OAAO;AAAA,MAC1B;AAAA,MACA,SAAS,OAAK,EAAE,gBAAgB;AAAA;AAAA,IAEhC,gBAAAA,OAAA,cAAC,cAAW,OAAO,EAAE,UAAU,YAAY,MAAM,SAAS,GAAG;AAAA,IAC7D,gBAAAA,OAAA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL;AAAA,QACA,KAAK,EAAE,GAAG,QAAQ,GAAG,MAAM,IAAI,OAAO,IAAI,aAAa,qBAAqB,eAAe;AAAA,QAC3F;AAAA,QACA,WAAW,WAAS;AAClB,gBAAM,gBAAgB;AAAA,QACxB;AAAA,QACA,UAAU,WAAS;AACjB,mBAAS,MAAM,cAAc,KAAK;AAAA,QACpC;AAAA,QACA,cAAa;AAAA,QACb,qBAAkB;AAAA;AAAA,IACpB;AAAA,EACF;AAEJ;",
|
6
|
-
"names": ["React", "useState", "selectIsLargeRoom", "selectLocalPeerID", "selectPermissions", "useHMSStore", "AddIcon", "CrossIcon", "MicOffIcon", "VerticalMenuIcon", "React", "useHMSStore", "React", "selectPermissions", "useHMSActions", "useHMSStore", "React", "useHMSStore", "selectPermissions", "useHMSActions", "match", "selectPermissions", "useHMSActions", "useHMSStore", "useHMSActions", "useHMSStore", "selectPermissions", "match", "React", "useHMSStore", "useState", "selectPermissions", "useHMSActions", "useHMSStore", "useHMSActions", "useHMSStore", "selectPermissions", "useState", "useState", "useHMSStore", "selectIsLargeRoom", "React", "selectLocalPeerID", "selectPermissions", "MicOffIcon", "CrossIcon", "AddIcon", "VerticalMenuIcon"]
|
7
|
-
}
|
package/dist/chunk-QKXHQ6DV.js
DELETED
@@ -1,254 +0,0 @@
|
|
1
|
-
import {
|
2
|
-
Button,
|
3
|
-
HorizontalDivider,
|
4
|
-
Loading,
|
5
|
-
Popover,
|
6
|
-
Sheet,
|
7
|
-
_s
|
8
|
-
} from "./chunk-26D5FDBW.js";
|
9
|
-
import {
|
10
|
-
Text
|
11
|
-
} from "./chunk-JKWX7W4K.js";
|
12
|
-
import {
|
13
|
-
ToastManager,
|
14
|
-
useRecordingHandler
|
15
|
-
} from "./chunk-BQOT4DK7.js";
|
16
|
-
import {
|
17
|
-
Box,
|
18
|
-
Flex
|
19
|
-
} from "./chunk-7QZJMUHM.js";
|
20
|
-
import {
|
21
|
-
Tooltip,
|
22
|
-
formatTime,
|
23
|
-
useRoomLayoutConferencingScreen
|
24
|
-
} from "./chunk-ENHSO6YN.js";
|
25
|
-
import {
|
26
|
-
__async,
|
27
|
-
config,
|
28
|
-
init_define_process_env
|
29
|
-
} from "./chunk-TBXRX6MK.js";
|
30
|
-
|
31
|
-
// src/Prebuilt/components/Header/StreamActions.tsx
|
32
|
-
init_define_process_env();
|
33
|
-
import React, { useCallback, useEffect, useRef, useState } from "react";
|
34
|
-
import { useMedia } from "react-use";
|
35
|
-
import {
|
36
|
-
HMSRoomState,
|
37
|
-
selectHLSState,
|
38
|
-
selectIsConnectedToRoom,
|
39
|
-
selectPermissions,
|
40
|
-
selectRecordingState,
|
41
|
-
selectRoomState,
|
42
|
-
useHMSActions,
|
43
|
-
useHMSStore,
|
44
|
-
useRecordingStreaming
|
45
|
-
} from "@100mslive/react-sdk";
|
46
|
-
import { AlertTriangleIcon, CrossIcon, PauseCircleIcon, RecordIcon } from "@100mslive/react-icons";
|
47
|
-
var getRecordingText = ({
|
48
|
-
isBrowserRecordingOn,
|
49
|
-
isServerRecordingOn,
|
50
|
-
isHLSRecordingOn
|
51
|
-
}, delimiter = ", ") => {
|
52
|
-
if (!isBrowserRecordingOn && !isServerRecordingOn && !isHLSRecordingOn) {
|
53
|
-
return "";
|
54
|
-
}
|
55
|
-
const title = [];
|
56
|
-
if (isBrowserRecordingOn) {
|
57
|
-
title.push("Browser");
|
58
|
-
}
|
59
|
-
if (isServerRecordingOn) {
|
60
|
-
title.push("Server");
|
61
|
-
}
|
62
|
-
if (isHLSRecordingOn) {
|
63
|
-
title.push("HLS");
|
64
|
-
}
|
65
|
-
return title.join(delimiter);
|
66
|
-
};
|
67
|
-
var LiveStatus = () => {
|
68
|
-
var _a;
|
69
|
-
const { isHLSRunning, isRTMPRunning } = useRecordingStreaming();
|
70
|
-
const hlsState = useHMSStore(selectHLSState);
|
71
|
-
const isMobile = useMedia(config.media.md);
|
72
|
-
const intervalRef = useRef(null);
|
73
|
-
const { screenType } = useRoomLayoutConferencingScreen();
|
74
|
-
const [liveTime, setLiveTime] = useState(0);
|
75
|
-
const startTimer = useCallback(() => {
|
76
|
-
intervalRef.current = setInterval(() => {
|
77
|
-
var _a2;
|
78
|
-
const timeStamp = (_a2 = hlsState == null ? void 0 : hlsState.variants[0]) == null ? void 0 : _a2[screenType === "hls_live_streaming" ? "startedAt" : "initialisedAt"];
|
79
|
-
if ((hlsState == null ? void 0 : hlsState.running) && timeStamp) {
|
80
|
-
setLiveTime(Date.now() - timeStamp.getTime());
|
81
|
-
}
|
82
|
-
}, 1e3);
|
83
|
-
}, [hlsState == null ? void 0 : hlsState.running, hlsState == null ? void 0 : hlsState.variants, screenType]);
|
84
|
-
useEffect(() => {
|
85
|
-
if (hlsState == null ? void 0 : hlsState.running) {
|
86
|
-
startTimer();
|
87
|
-
}
|
88
|
-
if (!(hlsState == null ? void 0 : hlsState.running) && intervalRef.current) {
|
89
|
-
clearInterval(intervalRef.current);
|
90
|
-
}
|
91
|
-
return () => {
|
92
|
-
if (intervalRef.current) {
|
93
|
-
clearInterval(intervalRef.current);
|
94
|
-
}
|
95
|
-
};
|
96
|
-
}, [hlsState.running, isMobile, startTimer]);
|
97
|
-
if (!isHLSRunning && !isRTMPRunning) {
|
98
|
-
return null;
|
99
|
-
}
|
100
|
-
return /* @__PURE__ */ React.createElement(
|
101
|
-
Flex,
|
102
|
-
{
|
103
|
-
align: "center",
|
104
|
-
gap: "1",
|
105
|
-
css: {
|
106
|
-
border: "1px solid $border_default",
|
107
|
-
padding: "$4 $6 $4 $6",
|
108
|
-
borderRadius: "$1"
|
109
|
-
}
|
110
|
-
},
|
111
|
-
/* @__PURE__ */ React.createElement(Box, { css: { w: "$4", h: "$4", r: "$round", bg: "$alert_error_default", mr: "$2" } }),
|
112
|
-
/* @__PURE__ */ React.createElement(Flex, { align: "center", gap: "2" }, /* @__PURE__ */ React.createElement(Text, { variant: !isMobile ? "button" : "body2" }, "LIVE"), /* @__PURE__ */ React.createElement(Text, { variant: "caption" }, ((_a = hlsState == null ? void 0 : hlsState.variants) == null ? void 0 : _a.length) > 0 && isHLSRunning ? formatTime(liveTime) : ""))
|
113
|
-
);
|
114
|
-
};
|
115
|
-
var RecordingStatus = () => {
|
116
|
-
const { isBrowserRecordingOn, isServerRecordingOn, isHLSRecordingOn, isRecordingOn } = useRecordingStreaming();
|
117
|
-
const permissions = useHMSStore(selectPermissions);
|
118
|
-
const isMobile = useMedia(config.media.md);
|
119
|
-
if (!isRecordingOn || // if only browser recording is enabled, stop recording is shown
|
120
|
-
// so no need to show this as it duplicates
|
121
|
-
[permissions == null ? void 0 : permissions.browserRecording, !isServerRecordingOn, !isHLSRecordingOn, isBrowserRecordingOn].every(
|
122
|
-
(value) => !!value
|
123
|
-
)) {
|
124
|
-
if (!(isMobile && isRecordingOn))
|
125
|
-
return null;
|
126
|
-
}
|
127
|
-
return /* @__PURE__ */ React.createElement(
|
128
|
-
Tooltip,
|
129
|
-
{
|
130
|
-
boxCss: { zIndex: 1 },
|
131
|
-
title: getRecordingText({
|
132
|
-
isBrowserRecordingOn,
|
133
|
-
isServerRecordingOn,
|
134
|
-
isHLSRecordingOn
|
135
|
-
})
|
136
|
-
},
|
137
|
-
/* @__PURE__ */ React.createElement(
|
138
|
-
Flex,
|
139
|
-
{
|
140
|
-
css: {
|
141
|
-
color: "$alert_error_default",
|
142
|
-
alignItems: "center"
|
143
|
-
}
|
144
|
-
},
|
145
|
-
/* @__PURE__ */ React.createElement(RecordIcon, { width: 24, height: 24 })
|
146
|
-
)
|
147
|
-
);
|
148
|
-
};
|
149
|
-
var RecordingPauseStatus = () => {
|
150
|
-
const recording = useHMSStore(selectRecordingState);
|
151
|
-
if (recording.hls && recording.hls.state === _s.PAUSED) {
|
152
|
-
return /* @__PURE__ */ React.createElement(
|
153
|
-
Tooltip,
|
154
|
-
{
|
155
|
-
boxCss: { zIndex: 1 },
|
156
|
-
title: getRecordingText({
|
157
|
-
isBrowserRecordingOn: false,
|
158
|
-
isServerRecordingOn: false,
|
159
|
-
isHLSRecordingOn: true
|
160
|
-
})
|
161
|
-
},
|
162
|
-
/* @__PURE__ */ React.createElement(
|
163
|
-
Flex,
|
164
|
-
{
|
165
|
-
css: {
|
166
|
-
color: "$on_surface_high",
|
167
|
-
alignItems: "center"
|
168
|
-
}
|
169
|
-
},
|
170
|
-
/* @__PURE__ */ React.createElement(PauseCircleIcon, { width: 24, height: 24 })
|
171
|
-
)
|
172
|
-
);
|
173
|
-
}
|
174
|
-
return null;
|
175
|
-
};
|
176
|
-
var StartRecording = () => {
|
177
|
-
const permissions = useHMSStore(selectPermissions);
|
178
|
-
const [open, setOpen] = useState(false);
|
179
|
-
const { startRecording, recordingStarted } = useRecordingHandler();
|
180
|
-
const { isBrowserRecordingOn, isStreamingOn, isHLSRunning } = useRecordingStreaming();
|
181
|
-
const hmsActions = useHMSActions();
|
182
|
-
if (!(permissions == null ? void 0 : permissions.browserRecording) || isHLSRunning) {
|
183
|
-
return null;
|
184
|
-
}
|
185
|
-
if (isBrowserRecordingOn) {
|
186
|
-
return /* @__PURE__ */ React.createElement(Popover.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React.createElement(Popover.Trigger, { asChild: true }, /* @__PURE__ */ React.createElement(Button, { variant: "danger", "data-testid": "stop_recording", icon: true, outlined: true, onClick: () => setOpen(true) }, /* @__PURE__ */ React.createElement(RecordIcon, null), /* @__PURE__ */ React.createElement(Text, { as: "span", css: { "@md": { display: "none" }, color: "currentColor" } }, "Stop Recording"))), /* @__PURE__ */ React.createElement(Popover.Portal, null, /* @__PURE__ */ React.createElement(Popover.Content, { align: "end", sideOffset: 8, css: { w: "$64" } }, /* @__PURE__ */ React.createElement(Text, { variant: "body1", css: { color: "$on_surface_medium" } }, "Are you sure you want to end the recording?"), /* @__PURE__ */ React.createElement(
|
187
|
-
Button,
|
188
|
-
{
|
189
|
-
"data-testid": "stop_recording_confirm",
|
190
|
-
variant: "danger",
|
191
|
-
icon: true,
|
192
|
-
css: { ml: "auto" },
|
193
|
-
onClick: () => __async(void 0, null, function* () {
|
194
|
-
try {
|
195
|
-
yield hmsActions.stopRTMPAndRecording();
|
196
|
-
} catch (error) {
|
197
|
-
const err = error;
|
198
|
-
ToastManager.addToast({
|
199
|
-
title: err.message,
|
200
|
-
variant: "error"
|
201
|
-
});
|
202
|
-
}
|
203
|
-
setOpen(false);
|
204
|
-
})
|
205
|
-
},
|
206
|
-
"Stop"
|
207
|
-
))));
|
208
|
-
}
|
209
|
-
return /* @__PURE__ */ React.createElement(
|
210
|
-
Button,
|
211
|
-
{
|
212
|
-
"data-testid": "start_recording",
|
213
|
-
variant: "standard",
|
214
|
-
icon: true,
|
215
|
-
disabled: recordingStarted || isStreamingOn,
|
216
|
-
onClick: () => __async(void 0, null, function* () {
|
217
|
-
yield startRecording();
|
218
|
-
})
|
219
|
-
},
|
220
|
-
recordingStarted ? /* @__PURE__ */ React.createElement(Loading, { size: 24, color: "currentColor" }) : /* @__PURE__ */ React.createElement(RecordIcon, null),
|
221
|
-
/* @__PURE__ */ React.createElement(Text, { as: "span", css: { "@md": { display: "none" }, color: "currentColor" } }, recordingStarted ? "Starting" : "Start", " Recording")
|
222
|
-
);
|
223
|
-
};
|
224
|
-
var StreamActions = () => {
|
225
|
-
const isConnected = useHMSStore(selectIsConnectedToRoom);
|
226
|
-
const isMobile = useMedia(config.media.md);
|
227
|
-
const roomState = useHMSStore(selectRoomState);
|
228
|
-
return /* @__PURE__ */ React.createElement(Flex, { align: "center", css: { gap: "$4" } }, !isMobile && /* @__PURE__ */ React.createElement(Flex, { align: "center", css: { gap: "$4" } }, /* @__PURE__ */ React.createElement(RecordingPauseStatus, null), /* @__PURE__ */ React.createElement(RecordingStatus, null), roomState !== HMSRoomState.Preview ? /* @__PURE__ */ React.createElement(LiveStatus, null) : null), isConnected && !isMobile ? /* @__PURE__ */ React.createElement(StartRecording, null) : null);
|
229
|
-
};
|
230
|
-
var StopRecordingInSheet = ({
|
231
|
-
onStopRecording,
|
232
|
-
onClose
|
233
|
-
}) => {
|
234
|
-
return /* @__PURE__ */ React.createElement(Sheet.Root, { open: true }, /* @__PURE__ */ React.createElement(Sheet.Content, null, /* @__PURE__ */ React.createElement(Sheet.Title, { css: { p: "$10" } }, /* @__PURE__ */ React.createElement(Flex, { direction: "row", justify: "between", css: { w: "100%", c: "$alert_error_default" } }, /* @__PURE__ */ React.createElement(Flex, { justify: "start", align: "center", gap: "3" }, /* @__PURE__ */ React.createElement(AlertTriangleIcon, null), /* @__PURE__ */ React.createElement(Text, { variant: "h5", css: { c: "$alert_error_default" } }, "Stop Recording")), /* @__PURE__ */ React.createElement(Sheet.Close, { css: { color: "white" }, onClick: onClose }, /* @__PURE__ */ React.createElement(CrossIcon, null)))), /* @__PURE__ */ React.createElement(HorizontalDivider, null), /* @__PURE__ */ React.createElement(Box, { as: "div", css: { p: "$10", overflowY: "scroll", maxHeight: "70vh" } }, /* @__PURE__ */ React.createElement(Text, { variant: "caption", css: { c: "$on_surface_medium", pb: "$8" } }, "Are you sure you want to stop recording? You can\u2019t undo this action."), /* @__PURE__ */ React.createElement(
|
235
|
-
Button,
|
236
|
-
{
|
237
|
-
variant: "danger",
|
238
|
-
css: { width: "100%" },
|
239
|
-
type: "submit",
|
240
|
-
"data-testid": "popup_change_btn",
|
241
|
-
onClick: onStopRecording
|
242
|
-
},
|
243
|
-
"Stop"
|
244
|
-
))));
|
245
|
-
};
|
246
|
-
|
247
|
-
export {
|
248
|
-
LiveStatus,
|
249
|
-
RecordingStatus,
|
250
|
-
RecordingPauseStatus,
|
251
|
-
StreamActions,
|
252
|
-
StopRecordingInSheet
|
253
|
-
};
|
254
|
-
//# sourceMappingURL=chunk-QKXHQ6DV.js.map
|
@@ -1,7 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"version": 3,
|
3
|
-
"sources": ["../src/Prebuilt/components/Header/StreamActions.tsx"],
|
4
|
-
"sourcesContent": ["import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { useMedia } from 'react-use';\nimport { HMSRecordingState } from '@100mslive/hms-video-store';\nimport {\n HMSRoomState,\n selectHLSState,\n selectIsConnectedToRoom,\n selectPermissions,\n selectRecordingState,\n selectRoomState,\n useHMSActions,\n useHMSStore,\n useRecordingStreaming,\n} from '@100mslive/react-sdk';\nimport { AlertTriangleIcon, CrossIcon, PauseCircleIcon, RecordIcon } from '@100mslive/react-icons';\nimport { Box, Button, config as cssConfig, Flex, HorizontalDivider, Loading, Popover, Text, Tooltip } from '../../..';\nimport { Sheet } from '../../../Sheet';\n// @ts-ignore\nimport { ToastManager } from '../Toast/ToastManager';\nimport { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';\nimport { useRecordingHandler } from '../../common/hooks';\n// @ts-ignore\nimport { formatTime } from '../../common/utils';\n\nexport const getRecordingText = (\n {\n isBrowserRecordingOn,\n isServerRecordingOn,\n isHLSRecordingOn,\n }: { isBrowserRecordingOn: boolean; isServerRecordingOn: boolean; isHLSRecordingOn: boolean },\n delimiter = ', ',\n) => {\n if (!isBrowserRecordingOn && !isServerRecordingOn && !isHLSRecordingOn) {\n return '';\n }\n const title: string[] = [];\n if (isBrowserRecordingOn) {\n title.push('Browser');\n }\n if (isServerRecordingOn) {\n title.push('Server');\n }\n if (isHLSRecordingOn) {\n title.push('HLS');\n }\n return title.join(delimiter);\n};\n\nexport const LiveStatus = () => {\n const { isHLSRunning, isRTMPRunning } = useRecordingStreaming();\n const hlsState = useHMSStore(selectHLSState);\n const isMobile = useMedia(cssConfig.media.md);\n const intervalRef = useRef<NodeJS.Timeout | null>(null);\n const { screenType } = useRoomLayoutConferencingScreen();\n const [liveTime, setLiveTime] = useState(0);\n\n const startTimer = useCallback(() => {\n intervalRef.current = setInterval(() => {\n const timeStamp = hlsState?.variants[0]?.[screenType === 'hls_live_streaming' ? 'startedAt' : 'initialisedAt'];\n if (hlsState?.running && timeStamp) {\n setLiveTime(Date.now() - timeStamp.getTime());\n }\n }, 1000);\n }, [hlsState?.running, hlsState?.variants, screenType]);\n\n useEffect(() => {\n if (hlsState?.running) {\n startTimer();\n }\n if (!hlsState?.running && intervalRef.current) {\n clearInterval(intervalRef.current);\n }\n return () => {\n if (intervalRef.current) {\n clearInterval(intervalRef.current);\n }\n };\n }, [hlsState.running, isMobile, startTimer]);\n\n if (!isHLSRunning && !isRTMPRunning) {\n return null;\n }\n return (\n <Flex\n align=\"center\"\n gap=\"1\"\n css={{\n border: '1px solid $border_default',\n padding: '$4 $6 $4 $6',\n borderRadius: '$1',\n }}\n >\n <Box css={{ w: '$4', h: '$4', r: '$round', bg: '$alert_error_default', mr: '$2' }} />\n <Flex align=\"center\" gap=\"2\">\n <Text variant={!isMobile ? 'button' : 'body2'}>LIVE</Text>\n <Text variant=\"caption\">{hlsState?.variants?.length > 0 && isHLSRunning ? formatTime(liveTime) : ''}</Text>\n </Flex>\n </Flex>\n );\n};\n\nexport const RecordingStatus = () => {\n const { isBrowserRecordingOn, isServerRecordingOn, isHLSRecordingOn, isRecordingOn } = useRecordingStreaming();\n const permissions = useHMSStore(selectPermissions);\n const isMobile = useMedia(cssConfig.media.md);\n\n if (\n !isRecordingOn ||\n // if only browser recording is enabled, stop recording is shown\n // so no need to show this as it duplicates\n [permissions?.browserRecording, !isServerRecordingOn, !isHLSRecordingOn, isBrowserRecordingOn].every(\n value => !!value,\n )\n ) {\n // show recording icon in mobile without popover\n if (!(isMobile && isRecordingOn)) return null;\n }\n\n return (\n <Tooltip\n boxCss={{ zIndex: 1 }}\n title={getRecordingText({\n isBrowserRecordingOn,\n isServerRecordingOn,\n isHLSRecordingOn,\n })}\n >\n <Flex\n css={{\n color: '$alert_error_default',\n alignItems: 'center',\n }}\n >\n <RecordIcon width={24} height={24} />\n </Flex>\n </Tooltip>\n );\n};\n\nexport const RecordingPauseStatus = () => {\n const recording = useHMSStore(selectRecordingState);\n if (recording.hls && recording.hls.state === HMSRecordingState.PAUSED) {\n return (\n <Tooltip\n boxCss={{ zIndex: 1 }}\n title={getRecordingText({\n isBrowserRecordingOn: false,\n isServerRecordingOn: false,\n isHLSRecordingOn: true,\n })}\n >\n <Flex\n css={{\n color: '$on_surface_high',\n alignItems: 'center',\n }}\n >\n <PauseCircleIcon width={24} height={24} />\n </Flex>\n </Tooltip>\n );\n }\n return null;\n};\n\nconst StartRecording = () => {\n const permissions = useHMSStore(selectPermissions);\n const [open, setOpen] = useState(false);\n const { startRecording, recordingStarted } = useRecordingHandler();\n const { isBrowserRecordingOn, isStreamingOn, isHLSRunning } = useRecordingStreaming();\n const hmsActions = useHMSActions();\n if (!permissions?.browserRecording || isHLSRunning) {\n return null;\n }\n if (isBrowserRecordingOn) {\n return (\n <Popover.Root open={open} onOpenChange={setOpen}>\n <Popover.Trigger asChild>\n <Button variant=\"danger\" data-testid=\"stop_recording\" icon outlined onClick={() => setOpen(true)}>\n <RecordIcon />\n <Text as=\"span\" css={{ '@md': { display: 'none' }, color: 'currentColor' }}>\n Stop Recording\n </Text>\n </Button>\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Content align=\"end\" sideOffset={8} css={{ w: '$64' }}>\n <Text variant=\"body1\" css={{ color: '$on_surface_medium' }}>\n Are you sure you want to end the recording?\n </Text>\n <Button\n data-testid=\"stop_recording_confirm\"\n variant=\"danger\"\n icon\n css={{ ml: 'auto' }}\n onClick={async () => {\n try {\n await hmsActions.stopRTMPAndRecording();\n } catch (error) {\n const err = error as Error;\n ToastManager.addToast({\n title: err.message,\n variant: 'error',\n });\n }\n setOpen(false);\n }}\n >\n Stop\n </Button>\n </Popover.Content>\n </Popover.Portal>\n </Popover.Root>\n );\n }\n return (\n <Button\n data-testid=\"start_recording\"\n variant=\"standard\"\n icon\n disabled={recordingStarted || isStreamingOn}\n onClick={async () => {\n await startRecording();\n }}\n >\n {recordingStarted ? <Loading size={24} color=\"currentColor\" /> : <RecordIcon />}\n <Text as=\"span\" css={{ '@md': { display: 'none' }, color: 'currentColor' }}>\n {recordingStarted ? 'Starting' : 'Start'} Recording\n </Text>\n </Button>\n );\n};\n\n/**\n * @description only start recording button will be shown.\n */\nexport const StreamActions = () => {\n const isConnected = useHMSStore(selectIsConnectedToRoom);\n const isMobile = useMedia(cssConfig.media.md);\n const roomState = useHMSStore(selectRoomState);\n\n return (\n <Flex align=\"center\" css={{ gap: '$4' }}>\n {!isMobile && (\n <Flex align=\"center\" css={{ gap: '$4' }}>\n <RecordingPauseStatus />\n <RecordingStatus />\n {roomState !== HMSRoomState.Preview ? <LiveStatus /> : null}\n </Flex>\n )}\n {isConnected && !isMobile ? <StartRecording /> : null}\n </Flex>\n );\n};\n\nexport const StopRecordingInSheet = ({\n onStopRecording,\n onClose,\n}: {\n onStopRecording: () => void;\n onClose: () => void;\n}) => {\n return (\n <Sheet.Root open={true}>\n <Sheet.Content>\n <Sheet.Title css={{ p: '$10' }}>\n <Flex direction=\"row\" justify=\"between\" css={{ w: '100%', c: '$alert_error_default' }}>\n <Flex justify=\"start\" align=\"center\" gap=\"3\">\n <AlertTriangleIcon />\n <Text variant=\"h5\" css={{ c: '$alert_error_default' }}>\n Stop Recording\n </Text>\n </Flex>\n <Sheet.Close css={{ color: 'white' }} onClick={onClose}>\n <CrossIcon />\n </Sheet.Close>\n </Flex>\n </Sheet.Title>\n <HorizontalDivider />\n <Box as=\"div\" css={{ p: '$10', overflowY: 'scroll', maxHeight: '70vh' }}>\n <Text variant=\"caption\" css={{ c: '$on_surface_medium', pb: '$8' }}>\n Are you sure you want to stop recording? You can\u2019t undo this action.\n </Text>\n <Button\n variant=\"danger\"\n css={{ width: '100%' }}\n type=\"submit\"\n data-testid=\"popup_change_btn\"\n onClick={onStopRecording}\n >\n Stop\n </Button>\n </Box>\n </Sheet.Content>\n </Sheet.Root>\n );\n};\n"],
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,OAAO,SAAS,aAAa,WAAW,QAAQ,gBAAgB;AAChE,SAAS,gBAAgB;AAEzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,mBAAmB,WAAW,iBAAiB,kBAAkB;AAUnE,IAAM,mBAAmB,CAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF,GACA,YAAY,SACT;AACH,MAAI,CAAC,wBAAwB,CAAC,uBAAuB,CAAC,kBAAkB;AACtE,WAAO;AAAA,EACT;AACA,QAAM,QAAkB,CAAC;AACzB,MAAI,sBAAsB;AACxB,UAAM,KAAK,SAAS;AAAA,EACtB;AACA,MAAI,qBAAqB;AACvB,UAAM,KAAK,QAAQ;AAAA,EACrB;AACA,MAAI,kBAAkB;AACpB,UAAM,KAAK,KAAK;AAAA,EAClB;AACA,SAAO,MAAM,KAAK,SAAS;AAC7B;AAEO,IAAM,aAAa,MAAM;AAhDhC;AAiDE,QAAM,EAAE,cAAc,cAAc,IAAI,sBAAsB;AAC9D,QAAM,WAAW,Y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,uBAAuB,KAAG,gBAEvD,CACF,GACA,oCAAC,MAAM,OAAN,EAAY,KAAK,EAAE,OAAO,QAAQ,GAAG,SAAS,WAC7C,oCAAC,eAAU,CACb,CACF,CACF,GACA,oCAAC,uBAAkB,GACnB,oCAAC,OAAI,IAAG,OAAM,KAAK,EAAE,GAAG,OAAO,WAAW,UAAU,WAAW,OAAO,KACpE,oCAAC,QAAK,SAAQ,WAAU,KAAK,EAAE,GAAG,sBAAsB,IAAI,KAAK,KAAG,2EAEpE,GACA;AAAA,IAAC;AAAA;AAAA,MACC,SAAQ;AAAA,MACR,KAAK,EAAE,OAAO,OAAO;AAAA,MACrB,MAAK;AAAA,MACL,eAAY;AAAA,MACZ,SAAS;AAAA;AAAA,IACV;AAAA,EAED,CACF,CACF,CACF;AAEJ;",
|
6
|
-
"names": ["_a"]
|
7
|
-
}
|
package/dist/chunk-RTWNTT77.js
DELETED
@@ -1,62 +0,0 @@
|
|
1
|
-
import {
|
2
|
-
__async,
|
3
|
-
init_define_process_env
|
4
|
-
} from "./chunk-TBXRX6MK.js";
|
5
|
-
|
6
|
-
// src/Prebuilt/components/hooks/useMetadata.tsx
|
7
|
-
init_define_process_env();
|
8
|
-
import { useCallback } from "react";
|
9
|
-
import {
|
10
|
-
selectHasPeerHandRaised,
|
11
|
-
selectLocalPeerID,
|
12
|
-
selectPeerMetadata,
|
13
|
-
useHMSActions,
|
14
|
-
useHMSStore,
|
15
|
-
useHMSVanillaStore
|
16
|
-
} from "@100mslive/react-sdk";
|
17
|
-
var useMyMetadata = () => {
|
18
|
-
const hmsActions = useHMSActions();
|
19
|
-
const localPeerId = useHMSStore(selectLocalPeerID);
|
20
|
-
const vanillaStore = useHMSVanillaStore();
|
21
|
-
const metaData = useHMSStore(selectPeerMetadata(localPeerId));
|
22
|
-
const isHandRaised = useHMSStore(selectHasPeerHandRaised(localPeerId));
|
23
|
-
const update = (updatedFields) => __async(void 0, null, function* () {
|
24
|
-
try {
|
25
|
-
const currentMetadata = vanillaStore.getState(selectPeerMetadata(localPeerId));
|
26
|
-
yield hmsActions.changeMetadata(Object.assign(currentMetadata, updatedFields));
|
27
|
-
return true;
|
28
|
-
} catch (error) {
|
29
|
-
console.error("failed to update metadata ", updatedFields);
|
30
|
-
}
|
31
|
-
return false;
|
32
|
-
});
|
33
|
-
const toggleHandRaise = useCallback(() => __async(void 0, null, function* () {
|
34
|
-
if (isHandRaised) {
|
35
|
-
yield hmsActions.lowerLocalPeerHand();
|
36
|
-
yield update({ handRaisedAt: void 0 });
|
37
|
-
} else {
|
38
|
-
yield hmsActions.raiseLocalPeerHand();
|
39
|
-
yield update({ isBRBOn: false, handRaisedAt: Date.now() });
|
40
|
-
}
|
41
|
-
}), [isHandRaised]);
|
42
|
-
const toggleBRB = useCallback(() => __async(void 0, null, function* () {
|
43
|
-
const newValue = !(metaData == null ? void 0 : metaData.isBRBOn);
|
44
|
-
yield update({ isBRBOn: newValue });
|
45
|
-
if (newValue) {
|
46
|
-
yield hmsActions.lowerLocalPeerHand();
|
47
|
-
}
|
48
|
-
}), [metaData == null ? void 0 : metaData.isBRBOn]);
|
49
|
-
return {
|
50
|
-
isHandRaised,
|
51
|
-
isBRBOn: !!(metaData == null ? void 0 : metaData.isBRBOn),
|
52
|
-
metaData,
|
53
|
-
updateMetaData: update,
|
54
|
-
toggleHandRaise,
|
55
|
-
toggleBRB
|
56
|
-
};
|
57
|
-
};
|
58
|
-
|
59
|
-
export {
|
60
|
-
useMyMetadata
|
61
|
-
};
|
62
|
-
//# sourceMappingURL=chunk-RTWNTT77.js.map
|
@@ -1,7 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"version": 3,
|
3
|
-
"sources": ["../src/Prebuilt/components/hooks/useMetadata.tsx"],
|
4
|
-
"sourcesContent": ["import { useCallback } from 'react';\nimport {\n selectHasPeerHandRaised,\n selectLocalPeerID,\n selectPeerMetadata,\n useHMSActions,\n useHMSStore,\n useHMSVanillaStore,\n} from '@100mslive/react-sdk';\n\nexport const useMyMetadata = () => {\n const hmsActions = useHMSActions();\n const localPeerId = useHMSStore(selectLocalPeerID);\n const vanillaStore = useHMSVanillaStore();\n const metaData = useHMSStore(selectPeerMetadata(localPeerId));\n const isHandRaised = useHMSStore(selectHasPeerHandRaised(localPeerId));\n\n const update = async (updatedFields: Record<string, any>) => {\n try {\n // get current state from store and merge updated fields\n const currentMetadata = vanillaStore.getState(selectPeerMetadata(localPeerId));\n await hmsActions.changeMetadata(Object.assign(currentMetadata, updatedFields));\n return true;\n } catch (error) {\n console.error('failed to update metadata ', updatedFields);\n }\n return false;\n };\n\n const toggleHandRaise = useCallback(async () => {\n if (isHandRaised) {\n await hmsActions.lowerLocalPeerHand();\n await update({ handRaisedAt: undefined });\n } else {\n await hmsActions.raiseLocalPeerHand();\n await update({ isBRBOn: false, handRaisedAt: Date.now() });\n }\n }, [isHandRaised]); //eslint-disable-line\n\n const toggleBRB = useCallback(async () => {\n const newValue = !metaData?.isBRBOn;\n await update({ isBRBOn: newValue });\n if (newValue) {\n await hmsActions.lowerLocalPeerHand();\n }\n }, [metaData?.isBRBOn]); //eslint-disable-line\n\n return {\n isHandRaised,\n isBRBOn: !!metaData?.isBRBOn,\n metaData,\n updateMetaData: update,\n toggleHandRaise,\n toggleBRB,\n };\n};\n"],
|
5
|
-
"mappings": ";;;;;;AAAA;AAAA,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,IAAM,gBAAgB,MAAM;AACjC,QAAM,aAAa,cAAc;AACjC,QAAM,cAAc,YAAY,iBAAiB;AACjD,QAAM,eAAe,mBAAmB;AACxC,QAAM,WAAW,YAAY,mBAAmB,WAAW,CAAC;AAC5D,QAAM,eAAe,YAAY,wBAAwB,WAAW,CAAC;AAErE,QAAM,SAAS,CAAO,kBAAuC;AAC3D,QAAI;AAEF,YAAM,kBAAkB,aAAa,SAAS,mBAAmB,WAAW,CAAC;AAC7E,YAAM,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