@stream-io/video-react-sdk 0.0.1-alpha.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +101 -0
- package/LICENSE +219 -0
- package/README.md +5 -0
- package/dist/css/styles.css +2244 -0
- package/dist/css/styles.css.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/src/components/Avatar/Avatar.d.ts +14 -0
- package/dist/src/components/Avatar/Avatar.js +11 -0
- package/dist/src/components/Avatar/Avatar.js.map +1 -0
- package/dist/src/components/Avatar/index.d.ts +1 -0
- package/dist/src/components/Avatar/index.js +2 -0
- package/dist/src/components/Avatar/index.js.map +1 -0
- package/dist/src/components/Button/CompositeButton.d.ts +16 -0
- package/dist/src/components/Button/CompositeButton.js +13 -0
- package/dist/src/components/Button/CompositeButton.js.map +1 -0
- package/dist/src/components/Button/CopyToClipboardButton.d.ts +27 -0
- package/dist/src/components/Button/CopyToClipboardButton.js +54 -0
- package/dist/src/components/Button/CopyToClipboardButton.js.map +1 -0
- package/dist/src/components/Button/IconButton.d.ts +7 -0
- package/dist/src/components/Button/IconButton.js +26 -0
- package/dist/src/components/Button/IconButton.js.map +1 -0
- package/dist/src/components/Button/TextButton.d.ts +2 -0
- package/dist/src/components/Button/TextButton.js +17 -0
- package/dist/src/components/Button/TextButton.js.map +1 -0
- package/dist/src/components/Button/index.d.ts +4 -0
- package/dist/src/components/Button/index.js +5 -0
- package/dist/src/components/Button/index.js.map +1 -0
- package/dist/src/components/CallControls/AcceptCallButton.d.ts +7 -0
- package/dist/src/components/CallControls/AcceptCallButton.js +27 -0
- package/dist/src/components/CallControls/AcceptCallButton.js.map +1 -0
- package/dist/src/components/CallControls/CallControls.d.ts +5 -0
- package/dist/src/components/CallControls/CallControls.js +5 -0
- package/dist/src/components/CallControls/CallControls.js.map +1 -0
- package/dist/src/components/CallControls/CallStatsButton.d.ts +2 -0
- package/dist/src/components/CallControls/CallStatsButton.js +8 -0
- package/dist/src/components/CallControls/CallStatsButton.js.map +1 -0
- package/dist/src/components/CallControls/CancelCallButton.d.ts +7 -0
- package/dist/src/components/CallControls/CancelCallButton.js +27 -0
- package/dist/src/components/CallControls/CancelCallButton.js.map +1 -0
- package/dist/src/components/CallControls/ReactionsButton.d.ts +11 -0
- package/dist/src/components/CallControls/ReactionsButton.js +32 -0
- package/dist/src/components/CallControls/ReactionsButton.js.map +1 -0
- package/dist/src/components/CallControls/RecordCallButton.d.ts +5 -0
- package/dist/src/components/CallControls/RecordCallButton.js +55 -0
- package/dist/src/components/CallControls/RecordCallButton.js.map +1 -0
- package/dist/src/components/CallControls/ScreenShareButton.d.ts +5 -0
- package/dist/src/components/CallControls/ScreenShareButton.js +54 -0
- package/dist/src/components/CallControls/ScreenShareButton.js.map +1 -0
- package/dist/src/components/CallControls/ToggleAudioButton.d.ts +9 -0
- package/dist/src/components/CallControls/ToggleAudioButton.js +73 -0
- package/dist/src/components/CallControls/ToggleAudioButton.js.map +1 -0
- package/dist/src/components/CallControls/ToggleAudioOutputButton.d.ts +5 -0
- package/dist/src/components/CallControls/ToggleAudioOutputButton.js +9 -0
- package/dist/src/components/CallControls/ToggleAudioOutputButton.js.map +1 -0
- package/dist/src/components/CallControls/ToggleVideoButton.d.ts +10 -0
- package/dist/src/components/CallControls/ToggleVideoButton.js +70 -0
- package/dist/src/components/CallControls/ToggleVideoButton.js.map +1 -0
- package/dist/src/components/CallControls/index.d.ts +10 -0
- package/dist/src/components/CallControls/index.js +11 -0
- package/dist/src/components/CallControls/index.js.map +1 -0
- package/dist/src/components/CallParticipantsList/BlockedUserListing.d.ts +4 -0
- package/dist/src/components/CallParticipantsList/BlockedUserListing.js +18 -0
- package/dist/src/components/CallParticipantsList/BlockedUserListing.js.map +1 -0
- package/dist/src/components/CallParticipantsList/CallParticipantListHeader.d.ts +6 -0
- package/dist/src/components/CallParticipantsList/CallParticipantListHeader.js +7 -0
- package/dist/src/components/CallParticipantsList/CallParticipantListHeader.js.map +1 -0
- package/dist/src/components/CallParticipantsList/CallParticipantListing.d.ts +8 -0
- package/dist/src/components/CallParticipantsList/CallParticipantListing.js +4 -0
- package/dist/src/components/CallParticipantsList/CallParticipantListing.js.map +1 -0
- package/dist/src/components/CallParticipantsList/CallParticipantListingItem.d.ts +16 -0
- package/dist/src/components/CallParticipantsList/CallParticipantListingItem.js +85 -0
- package/dist/src/components/CallParticipantsList/CallParticipantListingItem.js.map +1 -0
- package/dist/src/components/CallParticipantsList/CallParticipantsList.d.ts +15 -0
- package/dist/src/components/CallParticipantsList/CallParticipantsList.js +81 -0
- package/dist/src/components/CallParticipantsList/CallParticipantsList.js.map +1 -0
- package/dist/src/components/CallParticipantsList/EmptyParticipantSearchList.d.ts +2 -0
- package/dist/src/components/CallParticipantsList/EmptyParticipantSearchList.js +5 -0
- package/dist/src/components/CallParticipantsList/EmptyParticipantSearchList.js.map +1 -0
- package/dist/src/components/CallParticipantsList/index.d.ts +3 -0
- package/dist/src/components/CallParticipantsList/index.js +4 -0
- package/dist/src/components/CallParticipantsList/index.js.map +1 -0
- package/dist/src/components/CallRecordingList/CallRecordingList.d.ts +20 -0
- package/dist/src/components/CallRecordingList/CallRecordingList.js +9 -0
- package/dist/src/components/CallRecordingList/CallRecordingList.js.map +1 -0
- package/dist/src/components/CallRecordingList/CallRecordingListHeader.d.ts +7 -0
- package/dist/src/components/CallRecordingList/CallRecordingListHeader.js +8 -0
- package/dist/src/components/CallRecordingList/CallRecordingListHeader.js.map +1 -0
- package/dist/src/components/CallRecordingList/CallRecordingListItem.d.ts +7 -0
- package/dist/src/components/CallRecordingList/CallRecordingListItem.js +11 -0
- package/dist/src/components/CallRecordingList/CallRecordingListItem.js.map +1 -0
- package/dist/src/components/CallRecordingList/EmptyCallRecordingListing.d.ts +2 -0
- package/dist/src/components/CallRecordingList/EmptyCallRecordingListing.js +5 -0
- package/dist/src/components/CallRecordingList/EmptyCallRecordingListing.js.map +1 -0
- package/dist/src/components/CallRecordingList/LoadingCallRecordingListing.d.ts +7 -0
- package/dist/src/components/CallRecordingList/LoadingCallRecordingListing.js +7 -0
- package/dist/src/components/CallRecordingList/LoadingCallRecordingListing.js.map +1 -0
- package/dist/src/components/CallRecordingList/index.d.ts +5 -0
- package/dist/src/components/CallRecordingList/index.js +6 -0
- package/dist/src/components/CallRecordingList/index.js.map +1 -0
- package/dist/src/components/CallStats/CallStats.d.ts +6 -0
- package/dist/src/components/CallStats/CallStats.js +69 -0
- package/dist/src/components/CallStats/CallStats.js.map +1 -0
- package/dist/src/components/CallStats/CallStatsLatencyChart.d.ts +7 -0
- package/dist/src/components/CallStats/CallStatsLatencyChart.js +39 -0
- package/dist/src/components/CallStats/CallStatsLatencyChart.js.map +1 -0
- package/dist/src/components/CallStats/index.d.ts +2 -0
- package/dist/src/components/CallStats/index.js +3 -0
- package/dist/src/components/CallStats/index.js.map +1 -0
- package/dist/src/components/Debug/DebugParticipantPublishQuality.d.ts +6 -0
- package/dist/src/components/Debug/DebugParticipantPublishQuality.js +46 -0
- package/dist/src/components/Debug/DebugParticipantPublishQuality.js.map +1 -0
- package/dist/src/components/Debug/DebugStatsView.d.ts +7 -0
- package/dist/src/components/Debug/DebugStatsView.js +51 -0
- package/dist/src/components/Debug/DebugStatsView.js.map +1 -0
- package/dist/src/components/Debug/useIsDebugMode.d.ts +5 -0
- package/dist/src/components/Debug/useIsDebugMode.js +18 -0
- package/dist/src/components/Debug/useIsDebugMode.js.map +1 -0
- package/dist/src/components/DeviceSettings/DeviceSelector.d.ts +7 -0
- package/dist/src/components/DeviceSettings/DeviceSelector.js +26 -0
- package/dist/src/components/DeviceSettings/DeviceSelector.js.map +1 -0
- package/dist/src/components/DeviceSettings/DeviceSelectorAudio.d.ts +9 -0
- package/dist/src/components/DeviceSettings/DeviceSelectorAudio.js +20 -0
- package/dist/src/components/DeviceSettings/DeviceSelectorAudio.js.map +1 -0
- package/dist/src/components/DeviceSettings/DeviceSelectorVideo.d.ts +5 -0
- package/dist/src/components/DeviceSettings/DeviceSelectorVideo.js +11 -0
- package/dist/src/components/DeviceSettings/DeviceSelectorVideo.js.map +1 -0
- package/dist/src/components/DeviceSettings/DeviceSettings.d.ts +2 -0
- package/dist/src/components/DeviceSettings/DeviceSettings.js +15 -0
- package/dist/src/components/DeviceSettings/DeviceSettings.js.map +1 -0
- package/dist/src/components/DeviceSettings/index.d.ts +4 -0
- package/dist/src/components/DeviceSettings/index.js +5 -0
- package/dist/src/components/DeviceSettings/index.js.map +1 -0
- package/dist/src/components/Icon/Icon.d.ts +5 -0
- package/dist/src/components/Icon/Icon.js +4 -0
- package/dist/src/components/Icon/Icon.js.map +1 -0
- package/dist/src/components/Icon/index.d.ts +1 -0
- package/dist/src/components/Icon/index.js +2 -0
- package/dist/src/components/Icon/index.js.map +1 -0
- package/dist/src/components/LoadingIndicator/LoadingIndicator.d.ts +11 -0
- package/dist/src/components/LoadingIndicator/LoadingIndicator.js +6 -0
- package/dist/src/components/LoadingIndicator/LoadingIndicator.js.map +1 -0
- package/dist/src/components/LoadingIndicator/index.d.ts +1 -0
- package/dist/src/components/LoadingIndicator/index.js +2 -0
- package/dist/src/components/LoadingIndicator/index.js.map +1 -0
- package/dist/src/components/Menu/GenericMenu.d.ts +3 -0
- package/dist/src/components/Menu/GenericMenu.js +20 -0
- package/dist/src/components/Menu/GenericMenu.js.map +1 -0
- package/dist/src/components/Menu/MenuToggle.d.ts +12 -0
- package/dist/src/components/Menu/MenuToggle.js +40 -0
- package/dist/src/components/Menu/MenuToggle.js.map +1 -0
- package/dist/src/components/Menu/index.d.ts +2 -0
- package/dist/src/components/Menu/index.js +3 -0
- package/dist/src/components/Menu/index.js.map +1 -0
- package/dist/src/components/Notification/Notification.d.ts +11 -0
- package/dist/src/components/Notification/Notification.js +25 -0
- package/dist/src/components/Notification/Notification.js.map +1 -0
- package/dist/src/components/Notification/PermissionNotification.d.ts +33 -0
- package/dist/src/components/Notification/PermissionNotification.js +26 -0
- package/dist/src/components/Notification/PermissionNotification.js.map +1 -0
- package/dist/src/components/Notification/SpeakingWhileMutedNotification.d.ts +3 -0
- package/dist/src/components/Notification/SpeakingWhileMutedNotification.js +47 -0
- package/dist/src/components/Notification/SpeakingWhileMutedNotification.js.map +1 -0
- package/dist/src/components/Notification/index.d.ts +3 -0
- package/dist/src/components/Notification/index.js +4 -0
- package/dist/src/components/Notification/index.js.map +1 -0
- package/dist/src/components/PendingCallPanel/PendingCallControls.d.ts +2 -0
- package/dist/src/components/PendingCallPanel/PendingCallControls.js +13 -0
- package/dist/src/components/PendingCallPanel/PendingCallControls.js.map +1 -0
- package/dist/src/components/PendingCallPanel/PendingCallPanel.d.ts +14 -0
- package/dist/src/components/PendingCallPanel/PendingCallPanel.js +43 -0
- package/dist/src/components/PendingCallPanel/PendingCallPanel.js.map +1 -0
- package/dist/src/components/PendingCallPanel/index.d.ts +2 -0
- package/dist/src/components/PendingCallPanel/index.js +3 -0
- package/dist/src/components/PendingCallPanel/index.js.map +1 -0
- package/dist/src/components/Permissions/PermissionRequests.d.ts +8 -0
- package/dist/src/components/Permissions/PermissionRequests.js +103 -0
- package/dist/src/components/Permissions/PermissionRequests.js.map +1 -0
- package/dist/src/components/Permissions/index.d.ts +1 -0
- package/dist/src/components/Permissions/index.js +2 -0
- package/dist/src/components/Permissions/index.js.map +1 -0
- package/dist/src/components/Reaction/Reaction.d.ts +10 -0
- package/dist/src/components/Reaction/Reaction.js +28 -0
- package/dist/src/components/Reaction/Reaction.js.map +1 -0
- package/dist/src/components/Reaction/index.d.ts +1 -0
- package/dist/src/components/Reaction/index.js +2 -0
- package/dist/src/components/Reaction/index.js.map +1 -0
- package/dist/src/components/Search/SearchInput.d.ts +14 -0
- package/dist/src/components/Search/SearchInput.js +34 -0
- package/dist/src/components/Search/SearchInput.js.map +1 -0
- package/dist/src/components/Search/SearchResults.d.ts +14 -0
- package/dist/src/components/Search/SearchResults.js +12 -0
- package/dist/src/components/Search/SearchResults.js.map +1 -0
- package/dist/src/components/Search/hooks/index.d.ts +1 -0
- package/dist/src/components/Search/hooks/index.js +2 -0
- package/dist/src/components/Search/hooks/index.js.map +1 -0
- package/dist/src/components/Search/hooks/useSearch.d.ts +15 -0
- package/dist/src/components/Search/hooks/useSearch.js +39 -0
- package/dist/src/components/Search/hooks/useSearch.js.map +1 -0
- package/dist/src/components/Search/index.d.ts +2 -0
- package/dist/src/components/Search/index.js +3 -0
- package/dist/src/components/Search/index.js.map +1 -0
- package/dist/src/components/StreamCall/CallParticipantsScreenView.d.ts +5 -0
- package/dist/src/components/StreamCall/CallParticipantsScreenView.js +34 -0
- package/dist/src/components/StreamCall/CallParticipantsScreenView.js.map +1 -0
- package/dist/src/components/StreamCall/CallParticipantsView.d.ts +5 -0
- package/dist/src/components/StreamCall/CallParticipantsView.js +10 -0
- package/dist/src/components/StreamCall/CallParticipantsView.js.map +1 -0
- package/dist/src/components/StreamCall/Stage.d.ts +8 -0
- package/dist/src/components/StreamCall/Stage.js +13 -0
- package/dist/src/components/StreamCall/Stage.js.map +1 -0
- package/dist/src/components/StreamCall/index.d.ts +3 -0
- package/dist/src/components/StreamCall/index.js +4 -0
- package/dist/src/components/StreamCall/index.js.map +1 -0
- package/dist/src/components/StreamTheme/StreamTheme.d.ts +5 -0
- package/dist/src/components/StreamTheme/StreamTheme.js +18 -0
- package/dist/src/components/StreamTheme/StreamTheme.js.map +1 -0
- package/dist/src/components/StreamTheme/index.d.ts +1 -0
- package/dist/src/components/StreamTheme/index.js +2 -0
- package/dist/src/components/StreamTheme/index.js.map +1 -0
- package/dist/src/components/Tooltip/Tooltip.d.ts +15 -0
- package/dist/src/components/Tooltip/Tooltip.js +22 -0
- package/dist/src/components/Tooltip/Tooltip.js.map +1 -0
- package/dist/src/components/Tooltip/WithTooltip.d.ts +5 -0
- package/dist/src/components/Tooltip/WithTooltip.js +23 -0
- package/dist/src/components/Tooltip/WithTooltip.js.map +1 -0
- package/dist/src/components/Tooltip/hooks/index.d.ts +1 -0
- package/dist/src/components/Tooltip/hooks/index.js +2 -0
- package/dist/src/components/Tooltip/hooks/index.js.map +1 -0
- package/dist/src/components/Tooltip/hooks/useEnterLeaveHandlers.d.ts +6 -0
- package/dist/src/components/Tooltip/hooks/useEnterLeaveHandlers.js +14 -0
- package/dist/src/components/Tooltip/hooks/useEnterLeaveHandlers.js.map +1 -0
- package/dist/src/components/Tooltip/index.d.ts +2 -0
- package/dist/src/components/Tooltip/index.js +3 -0
- package/dist/src/components/Tooltip/index.js.map +1 -0
- package/dist/src/components/Video/VideoPreview.d.ts +28 -0
- package/dist/src/components/Video/VideoPreview.js +75 -0
- package/dist/src/components/Video/VideoPreview.js.map +1 -0
- package/dist/src/components/Video/index.d.ts +4 -0
- package/dist/src/components/Video/index.js +5 -0
- package/dist/src/components/Video/index.js.map +1 -0
- package/dist/src/components/index.d.ts +16 -0
- package/dist/src/components/index.js +17 -0
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/core/components/Audio/Audio.d.ts +6 -0
- package/dist/src/core/components/Audio/Audio.js +39 -0
- package/dist/src/core/components/Audio/Audio.js.map +1 -0
- package/dist/src/core/components/Audio/index.d.ts +1 -0
- package/dist/src/core/components/Audio/index.js +2 -0
- package/dist/src/core/components/Audio/index.js.map +1 -0
- package/dist/src/core/components/CallLayout/PaginatedGridLayout.d.ts +17 -0
- package/dist/src/core/components/CallLayout/PaginatedGridLayout.js +38 -0
- package/dist/src/core/components/CallLayout/PaginatedGridLayout.js.map +1 -0
- package/dist/src/core/components/CallLayout/SpeakerLayout.d.ts +8 -0
- package/dist/src/core/components/CallLayout/SpeakerLayout.js +74 -0
- package/dist/src/core/components/CallLayout/SpeakerLayout.js.map +1 -0
- package/dist/src/core/components/CallLayout/index.d.ts +2 -0
- package/dist/src/core/components/CallLayout/index.js +3 -0
- package/dist/src/core/components/CallLayout/index.js.map +1 -0
- package/dist/src/core/components/ParticipantView/DefaultParticipantViewUI.d.ts +18 -0
- package/dist/src/core/components/ParticipantView/DefaultParticipantViewUI.js +36 -0
- package/dist/src/core/components/ParticipantView/DefaultParticipantViewUI.js.map +1 -0
- package/dist/src/core/components/ParticipantView/ParticipantView.d.ts +79 -0
- package/dist/src/core/components/ParticipantView/ParticipantView.js +33 -0
- package/dist/src/core/components/ParticipantView/ParticipantView.js.map +1 -0
- package/dist/src/core/components/ParticipantView/index.d.ts +2 -0
- package/dist/src/core/components/ParticipantView/index.js +3 -0
- package/dist/src/core/components/ParticipantView/index.js.map +1 -0
- package/dist/src/core/components/StreamCall/StreamCall.d.ts +73 -0
- package/dist/src/core/components/StreamCall/StreamCall.js +60 -0
- package/dist/src/core/components/StreamCall/StreamCall.js.map +1 -0
- package/dist/src/core/components/StreamCall/index.d.ts +1 -0
- package/dist/src/core/components/StreamCall/index.js +2 -0
- package/dist/src/core/components/StreamCall/index.js.map +1 -0
- package/dist/src/core/components/Video/BaseVideo.d.ts +9 -0
- package/dist/src/core/components/Video/BaseVideo.js +48 -0
- package/dist/src/core/components/Video/BaseVideo.js.map +1 -0
- package/dist/src/core/components/Video/DefaultVideoPlaceholder.d.ts +6 -0
- package/dist/src/core/components/Video/DefaultVideoPlaceholder.js +9 -0
- package/dist/src/core/components/Video/DefaultVideoPlaceholder.js.map +1 -0
- package/dist/src/core/components/Video/Video.d.ts +13 -0
- package/dist/src/core/components/Video/Video.js +154 -0
- package/dist/src/core/components/Video/Video.js.map +1 -0
- package/dist/src/core/components/Video/index.d.ts +2 -0
- package/dist/src/core/components/Video/index.js +3 -0
- package/dist/src/core/components/Video/index.js.map +1 -0
- package/dist/src/core/components/index.d.ts +6 -0
- package/dist/src/core/components/index.js +6 -0
- package/dist/src/core/components/index.js.map +1 -0
- package/dist/src/core/contexts/MediaDevicesContext.d.ts +180 -0
- package/dist/src/core/contexts/MediaDevicesContext.js +177 -0
- package/dist/src/core/contexts/MediaDevicesContext.js.map +1 -0
- package/dist/src/core/contexts/index.d.ts +1 -0
- package/dist/src/core/contexts/index.js +2 -0
- package/dist/src/core/contexts/index.js.map +1 -0
- package/dist/src/core/hooks/index.d.ts +4 -0
- package/dist/src/core/hooks/index.js +5 -0
- package/dist/src/core/hooks/index.js.map +1 -0
- package/dist/src/core/hooks/useAudioPublisher.d.ts +12 -0
- package/dist/src/core/hooks/useAudioPublisher.js +95 -0
- package/dist/src/core/hooks/useAudioPublisher.js.map +1 -0
- package/dist/src/core/hooks/useDevices.d.ts +80 -0
- package/dist/src/core/hooks/useDevices.js +113 -0
- package/dist/src/core/hooks/useDevices.js.map +1 -0
- package/dist/src/core/hooks/useTrackElementVisibility.d.ts +6 -0
- package/dist/src/core/hooks/useTrackElementVisibility.js +27 -0
- package/dist/src/core/hooks/useTrackElementVisibility.js.map +1 -0
- package/dist/src/core/hooks/useVideoPublisher.d.ts +12 -0
- package/dist/src/core/hooks/useVideoPublisher.js +120 -0
- package/dist/src/core/hooks/useVideoPublisher.js.map +1 -0
- package/dist/src/core/index.d.ts +3 -0
- package/dist/src/core/index.js +4 -0
- package/dist/src/core/index.js.map +1 -0
- package/dist/src/hooks/index.d.ts +2 -0
- package/dist/src/hooks/index.js +3 -0
- package/dist/src/hooks/index.js.map +1 -0
- package/dist/src/hooks/useFloatingUIPreset.d.ts +9 -0
- package/dist/src/hooks/useFloatingUIPreset.js +30 -0
- package/dist/src/hooks/useFloatingUIPreset.js.map +1 -0
- package/dist/src/hooks/useScrollPosition.d.ts +6 -0
- package/dist/src/hooks/useScrollPosition.js +63 -0
- package/dist/src/hooks/useScrollPosition.js.map +1 -0
- package/dist/src/types/components.d.ts +7 -0
- package/dist/src/types/components.js +2 -0
- package/dist/src/types/components.js.map +1 -0
- package/dist/src/types/index.d.ts +1 -0
- package/dist/src/types/index.js +2 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/utilities/applyElementToRef.d.ts +2 -0
- package/dist/src/utilities/applyElementToRef.js +8 -0
- package/dist/src/utilities/applyElementToRef.js.map +1 -0
- package/dist/src/utilities/chunk.d.ts +1 -0
- package/dist/src/utilities/chunk.js +5 -0
- package/dist/src/utilities/chunk.js.map +1 -0
- package/dist/src/utilities/index.d.ts +3 -0
- package/dist/src/utilities/index.js +4 -0
- package/dist/src/utilities/index.js.map +1 -0
- package/dist/src/utilities/isComponentType.d.ts +2 -0
- package/dist/src/utilities/isComponentType.js +7 -0
- package/dist/src/utilities/isComponentType.js.map +1 -0
- package/index.ts +18 -0
- package/package.json +51 -0
- package/src/components/Avatar/Avatar.tsx +45 -0
- package/src/components/Avatar/index.ts +1 -0
- package/src/components/Button/CompositeButton.tsx +50 -0
- package/src/components/Button/CopyToClipboardButton.tsx +129 -0
- package/src/components/Button/IconButton.tsx +32 -0
- package/src/components/Button/TextButton.tsx +12 -0
- package/src/components/Button/index.ts +4 -0
- package/src/components/CallControls/AcceptCallButton.tsx +36 -0
- package/src/components/CallControls/CallControls.tsx +26 -0
- package/src/components/CallControls/CallStatsButton.tsx +20 -0
- package/src/components/CallControls/CancelCallButton.tsx +36 -0
- package/src/components/CallControls/ReactionsButton.tsx +74 -0
- package/src/components/CallControls/RecordCallButton.tsx +73 -0
- package/src/components/CallControls/ScreenShareButton.tsx +84 -0
- package/src/components/CallControls/ToggleAudioButton.tsx +123 -0
- package/src/components/CallControls/ToggleAudioOutputButton.tsx +21 -0
- package/src/components/CallControls/ToggleVideoButton.tsx +116 -0
- package/src/components/CallControls/index.ts +10 -0
- package/src/components/CallParticipantsList/BlockedUserListing.tsx +37 -0
- package/src/components/CallParticipantsList/CallParticipantListHeader.tsx +29 -0
- package/src/components/CallParticipantsList/CallParticipantListing.tsx +22 -0
- package/src/components/CallParticipantsList/CallParticipantListingItem.tsx +273 -0
- package/src/components/CallParticipantsList/CallParticipantsList.tsx +255 -0
- package/src/components/CallParticipantsList/EmptyParticipantSearchList.tsx +7 -0
- package/src/components/CallParticipantsList/index.ts +3 -0
- package/src/components/CallRecordingList/CallRecordingList.tsx +60 -0
- package/src/components/CallRecordingList/CallRecordingListHeader.tsx +29 -0
- package/src/components/CallRecordingList/CallRecordingListItem.tsx +67 -0
- package/src/components/CallRecordingList/EmptyCallRecordingListing.tsx +11 -0
- package/src/components/CallRecordingList/LoadingCallRecordingListing.tsx +21 -0
- package/src/components/CallRecordingList/index.ts +5 -0
- package/src/components/CallStats/CallStats.tsx +162 -0
- package/src/components/CallStats/CallStatsLatencyChart.tsx +58 -0
- package/src/components/CallStats/index.ts +2 -0
- package/src/components/Debug/DebugParticipantPublishQuality.tsx +62 -0
- package/src/components/Debug/DebugStatsView.tsx +108 -0
- package/src/components/Debug/useIsDebugMode.ts +24 -0
- package/src/components/DeviceSettings/DeviceSelector.tsx +106 -0
- package/src/components/DeviceSettings/DeviceSelectorAudio.tsx +57 -0
- package/src/components/DeviceSettings/DeviceSelectorVideo.tsx +22 -0
- package/src/components/DeviceSettings/DeviceSettings.tsx +39 -0
- package/src/components/DeviceSettings/index.ts +4 -0
- package/src/components/Icon/Icon.tsx +11 -0
- package/src/components/Icon/index.ts +1 -0
- package/src/components/LoadingIndicator/LoadingIndicator.tsx +28 -0
- package/src/components/LoadingIndicator/index.ts +1 -0
- package/src/components/Menu/GenericMenu.tsx +16 -0
- package/src/components/Menu/MenuToggle.tsx +81 -0
- package/src/components/Menu/index.ts +2 -0
- package/src/components/Notification/Notification.tsx +61 -0
- package/src/components/Notification/PermissionNotification.tsx +97 -0
- package/src/components/Notification/SpeakingWhileMutedNotification.tsx +61 -0
- package/src/components/Notification/index.ts +3 -0
- package/src/components/PendingCallPanel/PendingCallControls.tsx +27 -0
- package/src/components/PendingCallPanel/PendingCallPanel.tsx +93 -0
- package/src/components/PendingCallPanel/index.ts +2 -0
- package/src/components/Permissions/PermissionRequests.tsx +176 -0
- package/src/components/Permissions/index.ts +1 -0
- package/src/components/Reaction/Reaction.tsx +48 -0
- package/src/components/Reaction/index.ts +1 -0
- package/src/components/Search/SearchInput.tsx +56 -0
- package/src/components/Search/SearchResults.tsx +40 -0
- package/src/components/Search/hooks/index.ts +1 -0
- package/src/components/Search/hooks/useSearch.ts +52 -0
- package/src/components/Search/index.ts +2 -0
- package/src/components/StreamCall/CallParticipantsScreenView.tsx +125 -0
- package/src/components/StreamCall/CallParticipantsView.tsx +24 -0
- package/src/components/StreamCall/Stage.tsx +22 -0
- package/src/components/StreamCall/index.ts +4 -0
- package/src/components/StreamTheme/StreamTheme.tsx +19 -0
- package/src/components/StreamTheme/index.ts +1 -0
- package/src/components/Tooltip/Tooltip.tsx +51 -0
- package/src/components/Tooltip/WithTooltip.tsx +39 -0
- package/src/components/Tooltip/hooks/index.ts +1 -0
- package/src/components/Tooltip/hooks/useEnterLeaveHandlers.ts +28 -0
- package/src/components/Tooltip/index.ts +2 -0
- package/src/components/Video/VideoPreview.tsx +152 -0
- package/src/components/Video/index.ts +4 -0
- package/src/components/index.ts +16 -0
- package/src/core/components/Audio/Audio.tsx +42 -0
- package/src/core/components/Audio/index.ts +1 -0
- package/src/core/components/CallLayout/PaginatedGridLayout.tsx +159 -0
- package/src/core/components/CallLayout/SpeakerLayout.tsx +231 -0
- package/src/core/components/CallLayout/index.ts +2 -0
- package/src/core/components/ParticipantView/DefaultParticipantViewUI.tsx +160 -0
- package/src/core/components/ParticipantView/ParticipantView.tsx +156 -0
- package/src/core/components/ParticipantView/index.ts +2 -0
- package/src/core/components/StreamCall/StreamCall.tsx +157 -0
- package/src/core/components/StreamCall/index.ts +1 -0
- package/src/core/components/Video/BaseVideo.tsx +53 -0
- package/src/core/components/Video/DefaultVideoPlaceholder.tsx +36 -0
- package/src/core/components/Video/Video.tsx +252 -0
- package/src/core/components/Video/index.ts +2 -0
- package/src/core/components/index.ts +8 -0
- package/src/core/contexts/MediaDevicesContext.tsx +416 -0
- package/src/core/contexts/index.ts +1 -0
- package/src/core/hooks/index.ts +4 -0
- package/src/core/hooks/useAudioPublisher.ts +124 -0
- package/src/core/hooks/useDevices.ts +161 -0
- package/src/core/hooks/useTrackElementVisibility.ts +44 -0
- package/src/core/hooks/useVideoPublisher.ts +152 -0
- package/src/core/index.ts +3 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useFloatingUIPreset.ts +50 -0
- package/src/hooks/useScrollPosition.ts +95 -0
- package/src/types/components.ts +7 -0
- package/src/types/index.ts +1 -0
- package/src/utilities/applyElementToRef.ts +12 -0
- package/src/utilities/chunk.ts +8 -0
- package/src/utilities/index.ts +3 -0
- package/src/utilities/isComponentType.ts +9 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { pairwise } from 'rxjs';
|
|
3
|
+
import { getAudioDevices, getAudioOutputDevices, getVideoDevices, } from '@stream-io/video-client';
|
|
4
|
+
/**
|
|
5
|
+
* Observes changes in connected devices and maintains an up-to-date array of connected MediaDeviceInfo objects.
|
|
6
|
+
* @param observeDevices
|
|
7
|
+
* @category Device Management
|
|
8
|
+
*/
|
|
9
|
+
export const useDevices = (observeDevices) => {
|
|
10
|
+
const [devices, setDevices] = useState([]);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
const subscription = observeDevices().subscribe(setDevices);
|
|
13
|
+
return () => {
|
|
14
|
+
subscription.unsubscribe();
|
|
15
|
+
};
|
|
16
|
+
}, [observeDevices]);
|
|
17
|
+
return devices;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Observes changes and maintains an array of connected video input devices
|
|
21
|
+
* @category Device Management
|
|
22
|
+
*/
|
|
23
|
+
export const useVideoDevices = () => useDevices(getVideoDevices);
|
|
24
|
+
/**
|
|
25
|
+
* Observes changes and maintains an array of connected audio input devices
|
|
26
|
+
* @category Device Management
|
|
27
|
+
*/
|
|
28
|
+
export const useAudioInputDevices = () => useDevices(getAudioDevices);
|
|
29
|
+
/**
|
|
30
|
+
* Observes changes and maintains an array of connected audio output devices
|
|
31
|
+
* @category Device Management
|
|
32
|
+
*/
|
|
33
|
+
export const useAudioOutputDevices = () => useDevices(getAudioOutputDevices);
|
|
34
|
+
/**
|
|
35
|
+
* Verifies that newly selected device id exists among the registered devices.
|
|
36
|
+
* If the selected device id is not found among existing devices, switches to the default device.
|
|
37
|
+
* @param devices$
|
|
38
|
+
* @param switchToDefaultDevice
|
|
39
|
+
* @param selectedDeviceId
|
|
40
|
+
* @category Device Management
|
|
41
|
+
*/
|
|
42
|
+
export const useDeviceFallback = (devices$, switchToDefaultDevice, selectedDeviceId) => {
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
const validateDeviceId = devices$.pipe().subscribe((devices) => {
|
|
45
|
+
const deviceFound = devices.find((device) => device.deviceId === selectedDeviceId);
|
|
46
|
+
if (!deviceFound)
|
|
47
|
+
switchToDefaultDevice();
|
|
48
|
+
});
|
|
49
|
+
return () => {
|
|
50
|
+
validateDeviceId.unsubscribe();
|
|
51
|
+
};
|
|
52
|
+
}, [devices$, selectedDeviceId, switchToDefaultDevice]);
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Verifies that newly selected video device id exists among the registered devices.
|
|
56
|
+
* If the selected device id is not found among existing devices, switches to the default video device.
|
|
57
|
+
* @param switchToDefaultDevice
|
|
58
|
+
* @param selectedDeviceId
|
|
59
|
+
* @category Device Management
|
|
60
|
+
*/
|
|
61
|
+
export const useVideoDeviceFallback = (switchToDefaultDevice, selectedDeviceId) => useDeviceFallback(getVideoDevices(), switchToDefaultDevice, selectedDeviceId);
|
|
62
|
+
/**
|
|
63
|
+
* Verifies that newly selected audio input device id exists among the registered devices.
|
|
64
|
+
* If the selected device id is not found among existing devices, switches to the default audio input device.
|
|
65
|
+
* @param switchToDefaultDevice
|
|
66
|
+
* @param selectedDeviceId
|
|
67
|
+
* @category Device Management
|
|
68
|
+
*/
|
|
69
|
+
export const useAudioInputDeviceFallback = (switchToDefaultDevice, selectedDeviceId) => useDeviceFallback(getAudioDevices(), switchToDefaultDevice, selectedDeviceId);
|
|
70
|
+
/**
|
|
71
|
+
* Verifies that newly selected audio output device id exists among the registered devices.
|
|
72
|
+
* If the selected device id is not found among existing devices, switches to the default audio output device.
|
|
73
|
+
* @param switchToDefaultDevice
|
|
74
|
+
* @param selectedDeviceId
|
|
75
|
+
* @category Device Management
|
|
76
|
+
*/
|
|
77
|
+
export const useAudioOutputDeviceFallback = (switchToDefaultDevice, selectedDeviceId) => useDeviceFallback(getAudioOutputDevices(), switchToDefaultDevice, selectedDeviceId);
|
|
78
|
+
/**
|
|
79
|
+
* Observes devices of certain kind are made unavailable and executes onDisconnect callback
|
|
80
|
+
* @param observeDevices
|
|
81
|
+
* @param onDisconnect
|
|
82
|
+
* @category Device Management
|
|
83
|
+
*/
|
|
84
|
+
export const useOnUnavailableDevices = (observeDevices, onDisconnect) => {
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
const subscription = observeDevices
|
|
87
|
+
.pipe(pairwise())
|
|
88
|
+
.subscribe(([prev, current]) => {
|
|
89
|
+
if (prev.length > 0 && current.length === 0)
|
|
90
|
+
onDisconnect();
|
|
91
|
+
});
|
|
92
|
+
return () => subscription.unsubscribe();
|
|
93
|
+
}, [observeDevices, onDisconnect]);
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Observes disconnect of all video devices and executes onDisconnect callback
|
|
97
|
+
* @param onDisconnect
|
|
98
|
+
* @category Device Management
|
|
99
|
+
*/
|
|
100
|
+
export const useOnUnavailableVideoDevices = (onDisconnect) => useOnUnavailableDevices(getVideoDevices(), onDisconnect);
|
|
101
|
+
/**
|
|
102
|
+
* Observes disconnect of all audio input devices and executes onDisconnect callback
|
|
103
|
+
* @param onDisconnect
|
|
104
|
+
* @category Device Management
|
|
105
|
+
*/
|
|
106
|
+
export const useOnUnavailableAudioInputDevices = (onDisconnect) => useOnUnavailableDevices(getAudioDevices(), onDisconnect);
|
|
107
|
+
/**
|
|
108
|
+
* Observes disconnect of all audio output devices and executes onDisconnect callback
|
|
109
|
+
* @param onDisconnect
|
|
110
|
+
* @category Device Management
|
|
111
|
+
*/
|
|
112
|
+
export const useOnUnavailableAudioOutputDevices = (onDisconnect) => useOnUnavailableDevices(getAudioOutputDevices(), onDisconnect);
|
|
113
|
+
//# sourceMappingURL=useDevices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDevices.js","sourceRoot":"","sources":["../../../../src/core/hooks/useDevices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAc,QAAQ,EAAE,MAAM,MAAM,CAAC;AAC5C,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,eAAe,GAChB,MAAM,yBAAyB,CAAC;AAEjC;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,cAAmD,EACnD,EAAE;IACF,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAoB,EAAE,CAAC,CAAC;IAE9D,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,YAAY,GAAG,cAAc,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAE5D,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,WAAW,EAAE,CAAC;QAC7B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AAEjE;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AAEtE;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;AAE7E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,QAAuC,EACvC,qBAAiC,EACjC,gBAAyB,EACzB,EAAE;IACF,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,gBAAgB,GAAG,QAAQ,CAA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,GAAG,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;gBAAE,YAAY,EAAE,CAAC;QAC9D,CAAC,CAAC,CAAC;QAEL,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;IAC1C,CAAC,EAAE,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC,CAAC;AACrC,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,YAAwB,EAAE,EAAE,CACvE,uBAAuB,CAAC,eAAe,EAAE,EAAE,YAAY,CAAC,CAAC;AAE3D;;;;GAIG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,YAAwB,EAAE,EAAE,CAC5E,uBAAuB,CAAC,eAAe,EAAE,EAAE,YAAY,CAAC,CAAC;AAE3D;;;;GAIG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,YAAwB,EAAE,EAAE,CAC7E,uBAAuB,CAAC,qBAAqB,EAAE,EAAE,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ViewportTracker } from '@stream-io/video-client';
|
|
2
|
+
export declare const useTrackElementVisibility: <T extends HTMLElement>({ trackedElement, viewportTracker: propsViewportTracker, sessionId, }: {
|
|
3
|
+
trackedElement: T | null;
|
|
4
|
+
sessionId: string;
|
|
5
|
+
viewportTracker?: ViewportTracker | undefined;
|
|
6
|
+
}) => void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { VisibilityState } from '@stream-io/video-client';
|
|
3
|
+
import { useCall } from '@stream-io/video-react-bindings';
|
|
4
|
+
export const useTrackElementVisibility = ({ trackedElement, viewportTracker: propsViewportTracker, sessionId, }) => {
|
|
5
|
+
const call = useCall();
|
|
6
|
+
const viewportTracker = propsViewportTracker !== null && propsViewportTracker !== void 0 ? propsViewportTracker : call === null || call === void 0 ? void 0 : call.viewportTracker;
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (!trackedElement || !viewportTracker || !call)
|
|
9
|
+
return;
|
|
10
|
+
const unobserve = viewportTracker.observe(trackedElement, (entry) => {
|
|
11
|
+
call.state.updateParticipant(sessionId, (p) => (Object.assign(Object.assign({}, p), { viewportVisibilityState:
|
|
12
|
+
// observer triggers when element is "moved" to be a fullscreen element
|
|
13
|
+
// keep it VISIBLE if that happens to prevent fullscreen with placeholder
|
|
14
|
+
entry.isIntersecting || document.fullscreenElement === trackedElement
|
|
15
|
+
? VisibilityState.VISIBLE
|
|
16
|
+
: VisibilityState.INVISIBLE })));
|
|
17
|
+
});
|
|
18
|
+
return () => {
|
|
19
|
+
unobserve();
|
|
20
|
+
// reset visibility state to UNKNOWN upon cleanup
|
|
21
|
+
// so that the layouts that are not actively observed
|
|
22
|
+
// can still function normally (runtime layout switching)
|
|
23
|
+
call.state.updateParticipant(sessionId, (p) => (Object.assign(Object.assign({}, p), { viewportVisibilityState: VisibilityState.UNKNOWN })));
|
|
24
|
+
};
|
|
25
|
+
}, [trackedElement, viewportTracker, call, sessionId]);
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=useTrackElementVisibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTrackElementVisibility.js","sourceRoot":"","sources":["../../../../src/core/hooks/useTrackElementVisibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAmB,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAE1D,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAwB,EAC/D,cAAc,EACd,eAAe,EAAE,oBAAoB,EACrC,SAAS,GAKV,EAAE,EAAE;IACH,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IAEvB,MAAM,eAAe,GAAG,oBAAoB,aAApB,oBAAoB,cAApB,oBAAoB,GAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,eAAe,CAAC;IAEtE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,cAAc,IAAI,CAAC,eAAe,IAAI,CAAC,IAAI;YAAE,OAAO;QAEzD,MAAM,SAAS,GAAG,eAAe,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,EAAE;YAClE,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,iCAC1C,CAAC,KACJ,uBAAuB;gBACrB,uEAAuE;gBACvE,yEAAyE;gBACzE,KAAK,CAAC,cAAc,IAAI,QAAQ,CAAC,iBAAiB,KAAK,cAAc;oBACnE,CAAC,CAAC,eAAe,CAAC,OAAO;oBACzB,CAAC,CAAC,eAAe,CAAC,SAAS,IAC/B,CAAC,CAAC;QACN,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,SAAS,EAAE,CAAC;YACZ,iDAAiD;YACjD,qDAAqD;YACrD,yDAAyD;YACzD,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,iCAC1C,CAAC,KACJ,uBAAuB,EAAE,eAAe,CAAC,OAAO,IAChD,CAAC,CAAC;QACN,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,cAAc,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;AACzD,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
export type VideoPublisherInit = {
|
|
5
|
+
initialVideoMuted?: boolean;
|
|
6
|
+
videoDeviceId?: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
* @category Device Management
|
|
11
|
+
*/
|
|
12
|
+
export declare const useVideoPublisher: ({ initialVideoMuted, videoDeviceId, }: VideoPublisherInit) => () => Promise<void>;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { useCallback, useEffect } from 'react';
|
|
11
|
+
import { map } from 'rxjs';
|
|
12
|
+
import { CallingState, getVideoStream, OwnCapability, SfuModels, VideoSettingsCameraFacingEnum, watchForAddedDefaultVideoDevice, watchForDisconnectedVideoDevice, } from '@stream-io/video-client';
|
|
13
|
+
import { useCall, useCallCallingState, useCallMetadata, useCallState, useLocalParticipant, } from '@stream-io/video-react-bindings';
|
|
14
|
+
import { useDebugPreferredVideoCodec } from '../../components/Debug/useIsDebugMode';
|
|
15
|
+
/**
|
|
16
|
+
* @internal
|
|
17
|
+
* @category Device Management
|
|
18
|
+
*/
|
|
19
|
+
export const useVideoPublisher = ({ initialVideoMuted, videoDeviceId, }) => {
|
|
20
|
+
const call = useCall();
|
|
21
|
+
const callState = useCallState();
|
|
22
|
+
const callingState = useCallCallingState();
|
|
23
|
+
const participant = useLocalParticipant();
|
|
24
|
+
const { localParticipant$ } = callState;
|
|
25
|
+
const preferredCodec = useDebugPreferredVideoCodec();
|
|
26
|
+
const isPublishingVideo = participant === null || participant === void 0 ? void 0 : participant.publishedTracks.includes(SfuModels.TrackType.VIDEO);
|
|
27
|
+
const metadata = useCallMetadata();
|
|
28
|
+
const videoSettings = metadata === null || metadata === void 0 ? void 0 : metadata.settings.video;
|
|
29
|
+
const targetResolution = videoSettings === null || videoSettings === void 0 ? void 0 : videoSettings.target_resolution;
|
|
30
|
+
const publishVideoStream = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
+
if (!call)
|
|
32
|
+
return;
|
|
33
|
+
if (!call.permissionsContext.hasPermission(OwnCapability.SEND_VIDEO)) {
|
|
34
|
+
throw new Error(`No permission to publish video`);
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
const videoStream = yield getVideoStream({
|
|
38
|
+
deviceId: videoDeviceId,
|
|
39
|
+
width: targetResolution === null || targetResolution === void 0 ? void 0 : targetResolution.width,
|
|
40
|
+
height: targetResolution === null || targetResolution === void 0 ? void 0 : targetResolution.height,
|
|
41
|
+
facingMode: toFacingMode(videoSettings === null || videoSettings === void 0 ? void 0 : videoSettings.camera_facing),
|
|
42
|
+
});
|
|
43
|
+
yield call.publishVideoStream(videoStream, { preferredCodec });
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
console.log('Failed to publish video stream', e);
|
|
47
|
+
}
|
|
48
|
+
}), [
|
|
49
|
+
call,
|
|
50
|
+
preferredCodec,
|
|
51
|
+
targetResolution === null || targetResolution === void 0 ? void 0 : targetResolution.height,
|
|
52
|
+
targetResolution === null || targetResolution === void 0 ? void 0 : targetResolution.width,
|
|
53
|
+
videoDeviceId,
|
|
54
|
+
videoSettings === null || videoSettings === void 0 ? void 0 : videoSettings.camera_facing,
|
|
55
|
+
]);
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (callingState === CallingState.JOINED && !initialVideoMuted) {
|
|
58
|
+
publishVideoStream().catch((e) => {
|
|
59
|
+
console.error('Failed to publish video stream', e);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}, [callingState, initialVideoMuted, publishVideoStream]);
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (!localParticipant$)
|
|
65
|
+
return;
|
|
66
|
+
const subscription = watchForDisconnectedVideoDevice(localParticipant$.pipe(map((p) => p === null || p === void 0 ? void 0 : p.videoDeviceId))).subscribe(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
67
|
+
if (!call)
|
|
68
|
+
return;
|
|
69
|
+
call.setVideoDevice(undefined);
|
|
70
|
+
yield call.stopPublish(SfuModels.TrackType.VIDEO);
|
|
71
|
+
}));
|
|
72
|
+
return () => {
|
|
73
|
+
subscription.unsubscribe();
|
|
74
|
+
};
|
|
75
|
+
}, [localParticipant$, call]);
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
if (!(participant === null || participant === void 0 ? void 0 : participant.videoStream) || !call || !isPublishingVideo)
|
|
78
|
+
return;
|
|
79
|
+
const [track] = participant.videoStream.getVideoTracks();
|
|
80
|
+
const selectedVideoDeviceId = track.getSettings().deviceId;
|
|
81
|
+
const republishDefaultDevice = watchForAddedDefaultVideoDevice().subscribe(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
82
|
+
if (!(call &&
|
|
83
|
+
participant.videoStream &&
|
|
84
|
+
selectedVideoDeviceId === 'default'))
|
|
85
|
+
return;
|
|
86
|
+
// We need to stop the original track first in order
|
|
87
|
+
// we can retrieve the new default device stream
|
|
88
|
+
track.stop();
|
|
89
|
+
const videoStream = yield getVideoStream({
|
|
90
|
+
deviceId: 'default',
|
|
91
|
+
});
|
|
92
|
+
yield call.publishVideoStream(videoStream);
|
|
93
|
+
}));
|
|
94
|
+
const handleTrackEnded = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
95
|
+
if (selectedVideoDeviceId === videoDeviceId) {
|
|
96
|
+
const videoStream = yield getVideoStream({
|
|
97
|
+
deviceId: videoDeviceId,
|
|
98
|
+
});
|
|
99
|
+
yield call.publishVideoStream(videoStream);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
track.addEventListener('ended', handleTrackEnded);
|
|
103
|
+
return () => {
|
|
104
|
+
track.removeEventListener('ended', handleTrackEnded);
|
|
105
|
+
republishDefaultDevice.unsubscribe();
|
|
106
|
+
};
|
|
107
|
+
}, [videoDeviceId, call, participant === null || participant === void 0 ? void 0 : participant.videoStream, isPublishingVideo]);
|
|
108
|
+
return publishVideoStream;
|
|
109
|
+
};
|
|
110
|
+
const toFacingMode = (value) => {
|
|
111
|
+
switch (value) {
|
|
112
|
+
case VideoSettingsCameraFacingEnum.FRONT:
|
|
113
|
+
return 'user';
|
|
114
|
+
case VideoSettingsCameraFacingEnum.BACK:
|
|
115
|
+
return 'environment';
|
|
116
|
+
default:
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
//# sourceMappingURL=useVideoPublisher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useVideoPublisher.js","sourceRoot":"","sources":["../../../../src/core/hooks/useVideoPublisher.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EACL,YAAY,EACZ,cAAc,EACd,aAAa,EACb,SAAS,EACT,6BAA6B,EAC7B,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,OAAO,EACP,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AAUpF;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAChC,iBAAiB,EACjB,aAAa,GACM,EAAE,EAAE;IACvB,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;IACjC,MAAM,YAAY,GAAG,mBAAmB,EAAE,CAAC;IAC3C,MAAM,WAAW,GAAG,mBAAmB,EAAE,CAAC;IAC1C,MAAM,EAAE,i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AC,KAAgD,EAAE,EAAE;IACxE,QAAQ,KAAK,EAAE;QACb,KAAK,6BAA6B,CAAC,KAAK;YACtC,OAAO,MAAM,CAAC;QAChB,KAAK,6BAA6B,CAAC,IAAI;YACrC,OAAO,aAAa,CAAC;QACvB;YACE,OAAO,SAAS,CAAC;KACpB;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { UseFloatingProps } from '@floating-ui/react';
|
|
2
|
+
export declare const useFloatingUIPreset: ({ placement, strategy, }: Pick<UseFloatingProps, 'placement' | 'strategy'>) => {
|
|
3
|
+
refs: import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
|
|
4
|
+
x: number | null;
|
|
5
|
+
y: number | null;
|
|
6
|
+
domReference: Element | null;
|
|
7
|
+
floating: HTMLElement | null;
|
|
8
|
+
strategy: import("@floating-ui/react").Strategy;
|
|
9
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { offset, autoUpdate, size, useFloating, shift, flip, } from '@floating-ui/react';
|
|
3
|
+
export const useFloatingUIPreset = ({ placement, strategy, }) => {
|
|
4
|
+
const { refs, x, y, update, elements: { domReference, floating }, } = useFloating({
|
|
5
|
+
placement,
|
|
6
|
+
strategy,
|
|
7
|
+
middleware: [
|
|
8
|
+
offset(10),
|
|
9
|
+
shift(),
|
|
10
|
+
flip(),
|
|
11
|
+
size({
|
|
12
|
+
padding: 10,
|
|
13
|
+
apply: ({ availableHeight, elements }) => {
|
|
14
|
+
Object.assign(elements.floating.style, {
|
|
15
|
+
maxHeight: `${availableHeight}px`,
|
|
16
|
+
});
|
|
17
|
+
},
|
|
18
|
+
}),
|
|
19
|
+
],
|
|
20
|
+
});
|
|
21
|
+
// handle window resizing
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (!domReference || !floating)
|
|
24
|
+
return;
|
|
25
|
+
const cleanup = autoUpdate(domReference, floating, update);
|
|
26
|
+
return () => cleanup();
|
|
27
|
+
}, [domReference, floating, update]);
|
|
28
|
+
return { refs, x, y, domReference, floating, strategy };
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=useFloatingUIPreset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFloatingUIPreset.js","sourceRoot":"","sources":["../../../src/hooks/useFloatingUIPreset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EACL,MAAM,EACN,UAAU,EACV,IAAI,EACJ,WAAW,EACX,KAAK,EACL,IAAI,GACL,MAAM,oBAAoB,CAAC;AAG5B,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAClC,SAAS,EACT,QAAQ,GACyC,EAAE,EAAE;IACrD,MAAM,EACJ,IAAI,EACJ,CAAC,EACD,CAAC,EACD,MAAM,EACN,QAAQ,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,GACrC,GAAG,WAAW,CAAC;QACd,SAAS;QACT,QAAQ;QACR,UAAU,EAAE;YACV,MAAM,CAAC,EAAE,CAAC;YACV,KAAK,EAAE;YACP,IAAI,EAAE;YACN,IAAI,CAAC;gBACH,OAAO,EAAE,EAAE;gBACX,KAAK,EAAE,CAAC,EAAE,eAAe,EAAE,QAAQ,EAAE,EAAE,EAAE;oBACvC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE;wBACrC,SAAS,EAAE,GAAG,eAAe,IAAI;qBAClC,CAAC,CAAC;gBACL,CAAC;aACF,CAAC;SACH;KACF,CAAC,CAAC;IAEH,yBAAyB;IACzB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,YAAY,IAAI,CAAC,QAAQ;YAAE,OAAO;QAEvC,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAE3D,OAAO,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IAErC,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AAC1D,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook which observes element's scroll position and returns text value based on the
|
|
3
|
+
* position of the scrollbar (`top`, `bottom`, `between` and `null` if no scrollbar is available)
|
|
4
|
+
*/
|
|
5
|
+
export declare const useVerticalScrollPosition: (scrollElement: HTMLElement | null, threshold?: number) => "bottom" | "top" | "between" | null;
|
|
6
|
+
export declare const useHorizontalScrollPosition: (scrollElement: HTMLElement | null, threshold?: number) => "end" | "start" | "between" | null;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
const SCROLL_THRESHOLD = 10;
|
|
3
|
+
/**
|
|
4
|
+
* Hook which observes element's scroll position and returns text value based on the
|
|
5
|
+
* position of the scrollbar (`top`, `bottom`, `between` and `null` if no scrollbar is available)
|
|
6
|
+
*/
|
|
7
|
+
export const useVerticalScrollPosition = (scrollElement, threshold = SCROLL_THRESHOLD) => {
|
|
8
|
+
const [scrollPosition, setScrollPosition] = useState(null);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (!scrollElement)
|
|
11
|
+
return;
|
|
12
|
+
const scrollHandler = () => {
|
|
13
|
+
const element = scrollElement;
|
|
14
|
+
const hasVerticalScrollbar = element.scrollHeight > element.clientHeight;
|
|
15
|
+
if (!hasVerticalScrollbar)
|
|
16
|
+
return setScrollPosition(null);
|
|
17
|
+
const isAtTheTop = element.scrollTop <= threshold;
|
|
18
|
+
if (isAtTheTop)
|
|
19
|
+
return setScrollPosition('top');
|
|
20
|
+
const isAtTheBottom = Math.abs(element.scrollHeight - element.scrollTop - element.clientHeight) <= threshold;
|
|
21
|
+
if (isAtTheBottom)
|
|
22
|
+
return setScrollPosition('bottom');
|
|
23
|
+
setScrollPosition('between');
|
|
24
|
+
};
|
|
25
|
+
const resizeObserver = new ResizeObserver(scrollHandler);
|
|
26
|
+
resizeObserver.observe(scrollElement);
|
|
27
|
+
scrollElement.addEventListener('scroll', scrollHandler);
|
|
28
|
+
return () => {
|
|
29
|
+
scrollElement.removeEventListener('scroll', scrollHandler);
|
|
30
|
+
resizeObserver.disconnect();
|
|
31
|
+
};
|
|
32
|
+
}, [scrollElement, threshold]);
|
|
33
|
+
return scrollPosition;
|
|
34
|
+
};
|
|
35
|
+
export const useHorizontalScrollPosition = (scrollElement, threshold = SCROLL_THRESHOLD) => {
|
|
36
|
+
const [scrollPosition, setScrollPosition] = useState(null);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (!scrollElement)
|
|
39
|
+
return;
|
|
40
|
+
const scrollHandler = () => {
|
|
41
|
+
const element = scrollElement;
|
|
42
|
+
const hasHorizontalScrollbar = element.scrollWidth > element.clientWidth;
|
|
43
|
+
if (!hasHorizontalScrollbar)
|
|
44
|
+
return setScrollPosition(null);
|
|
45
|
+
const isAtTheStart = element.scrollLeft <= threshold;
|
|
46
|
+
if (isAtTheStart)
|
|
47
|
+
return setScrollPosition('start');
|
|
48
|
+
const isAtTheEnd = Math.abs(element.scrollWidth - element.scrollLeft - element.clientWidth) <= threshold;
|
|
49
|
+
if (isAtTheEnd)
|
|
50
|
+
return setScrollPosition('end');
|
|
51
|
+
setScrollPosition('between');
|
|
52
|
+
};
|
|
53
|
+
const resizeObserver = new ResizeObserver(scrollHandler);
|
|
54
|
+
resizeObserver.observe(scrollElement);
|
|
55
|
+
scrollElement.addEventListener('scroll', scrollHandler);
|
|
56
|
+
return () => {
|
|
57
|
+
scrollElement.removeEventListener('scroll', scrollHandler);
|
|
58
|
+
resizeObserver.disconnect();
|
|
59
|
+
};
|
|
60
|
+
}, [scrollElement, threshold]);
|
|
61
|
+
return scrollPosition;
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=useScrollPosition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScrollPosition.js","sourceRoot":"","sources":["../../../src/hooks/useScrollPosition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAE5B;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,aAAiC,EACjC,YAAoB,gBAAgB,EACpC,EAAE;IACF,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAElD,IAAI,CAAC,CAAC;IAER,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,aAAa;YAAE,OAAO;QAE3B,MAAM,aAAa,GAAG,GAAG,EAAE;YACzB,MAAM,OAAO,GAAG,aAAa,CAAC;YAE9B,MAAM,oBAAoB,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;YAEzE,IAAI,CAAC,oBAAoB;gBAAE,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC;YAE1D,MAAM,UAAU,GAAG,OAAO,CAAC,SAAS,IAAI,SAAS,CAAC;YAClD,IAAI,UAAU;gBAAE,OAAO,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAEhD,MAAM,aAAa,GACjB,IAAI,CAAC,GAAG,CACN,OA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d,IAAI,CAAC,GAAG,CACN,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,WAAW,CAC/D,IAAI,SAAS,CAAC;YAEjB,IAAI,UAAU;gBAAE,OAAO,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAEhD,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAC/B,CAAC,CAAC;QAEF,MAAM,cAAc,GAAG,IAAI,cAAc,CAAC,aAAa,CAAC,CAAC;QACzD,cAAc,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAEtC,aAAa,CAAC,gBAAgB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;QACxD,OAAO,GAAG,EAAE;YACV,aAAa,CAAC,mBAAmB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;YAC3D,cAAc,CAAC,UAAU,EAAE,CAAC;QAC9B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC;IAE/B,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../../src/types/components.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applyElementToRef.js","sourceRoot":"","sources":["../../../src/utilities/applyElementToRef.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,GAAoB,EACpB,OAAU,EACV,EAAE;IACF,IAAI,CAAC,GAAG;QAAE,OAAO;IAEjB,IAAI,OAAO,GAAG,KAAK,UAAU;QAAE,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC;IAEnD,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC;AACxB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const chunk: <T extends unknown[]>(array: T, size: number) => T[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk.js","sourceRoot":"","sources":["../../../src/utilities/chunk.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG,CAAsB,KAAQ,EAAE,IAAY,EAAE,EAAE;IACnE,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAElD,OAAO,KAAK,CAAC,IAAI,CACf,EAAE,MAAM,EAAE,UAAU,EAAE,EACtB,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,GAAG,KAAK,EAAE,IAAI,GAAG,KAAK,GAAG,IAAI,CAAM,CAClE,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { ComponentType, ReactElement } from 'react';
|
|
2
|
+
export declare const isComponentType: <T extends {}>(elementOrComponent?: ReactElement<any, string | import("react").JSXElementConstructor<any>> | ComponentType<T> | null | undefined) => elementOrComponent is ComponentType<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isComponentType.js","sourceRoot":"","sources":["../../../src/utilities/isComponentType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,cAAc,EAAgB,MAAM,OAAO,CAAC;AAEpE,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,kBAA2D,EACnB,EAAE;IAC1C,OAAO,kBAAkB,KAAK,IAAI;QAChC,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC;AAC1C,CAAC,CAAC"}
|
package/index.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { setSdkInfo, SfuModels } from '@stream-io/video-client';
|
|
2
|
+
|
|
3
|
+
export * from '@stream-io/video-client';
|
|
4
|
+
export * from '@stream-io/video-react-bindings';
|
|
5
|
+
export * from '@stream-io/i18n';
|
|
6
|
+
|
|
7
|
+
export * from './src/core';
|
|
8
|
+
|
|
9
|
+
export * from './src/components';
|
|
10
|
+
export * from './src/types';
|
|
11
|
+
|
|
12
|
+
// TODO: set valid version
|
|
13
|
+
setSdkInfo({
|
|
14
|
+
type: SfuModels.SdkType.REACT,
|
|
15
|
+
major: '0',
|
|
16
|
+
minor: '0',
|
|
17
|
+
patch: '0',
|
|
18
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stream-io/video-react-sdk",
|
|
3
|
+
"packageManager": "yarn@3.2.4",
|
|
4
|
+
"main": "./dist/index.js",
|
|
5
|
+
"types": "./dist/index.d.ts",
|
|
6
|
+
"license": "See license in LICENSE",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"clean": "rimraf dist",
|
|
9
|
+
"start": "tsc --project tsconfig.json --watch",
|
|
10
|
+
"build": "tsc --project tsconfig.production.json && yarn copy-css",
|
|
11
|
+
"copy-css": "cp -R ../../node_modules/@stream-io/video-styling/dist/* dist/",
|
|
12
|
+
"generate-docs": "../../scripts/generate-docs-react.sh React @stream-io/video-react-sdk react-sdk",
|
|
13
|
+
"start:docs": "npx stream-chat-docusaurus -s"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"src",
|
|
18
|
+
"index.ts",
|
|
19
|
+
"package.json",
|
|
20
|
+
"README.md",
|
|
21
|
+
"LICENSE",
|
|
22
|
+
"CHANGELOG.md"
|
|
23
|
+
],
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@floating-ui/react": "^0.22.0",
|
|
26
|
+
"@nivo/core": "^0.80.0",
|
|
27
|
+
"@nivo/line": "^0.80.0",
|
|
28
|
+
"@stream-io/i18n": "^0.0.1-alpha.82",
|
|
29
|
+
"@stream-io/video-client": "^0.0.2-alpha.11",
|
|
30
|
+
"@stream-io/video-react-bindings": "^0.0.1-alpha.93",
|
|
31
|
+
"clsx": "^1.2.1",
|
|
32
|
+
"rxjs": "~7.8.1"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"react": "^18.0.0",
|
|
36
|
+
"react-dom": "^18.0.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@stream-io/video-styling": "^0.0.1-alpha.77",
|
|
40
|
+
"@types/prop-types": "^15.7.5",
|
|
41
|
+
"@types/rimraf": "^3.0.2",
|
|
42
|
+
"prop-types": "^15.8.1",
|
|
43
|
+
"react": "^18.2.0",
|
|
44
|
+
"react-dom": "^18.2.0",
|
|
45
|
+
"replace-in-file": "^6.3.5",
|
|
46
|
+
"rimraf": "^3.0.2",
|
|
47
|
+
"typedoc": "^0.24.7",
|
|
48
|
+
"typescript": "^4.9.5"
|
|
49
|
+
},
|
|
50
|
+
"version": "0.0.1-alpha.100"
|
|
51
|
+
}
|