@mrksbnc/livekit-vue 0.0.2 → 1.0.0
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/README.md +46 -30
- package/dist/background/BackgroundEffectSelect.vue.d.cts +55 -0
- package/dist/background/BackgroundEffectSelect.vue.d.mts +55 -0
- package/dist/background/index.d.cts +3 -0
- package/dist/background/index.d.mts +3 -0
- package/dist/background.cjs +2 -0
- package/dist/background.cjs.map +1 -0
- package/dist/background.js +239 -0
- package/dist/background.js.map +1 -0
- package/dist/components/chat/ChatEntry.vue.d.cts +16 -0
- package/dist/components/chat/ChatEntry.vue.d.mts +16 -0
- package/dist/components/chat/chat.utils.d.cts +3 -0
- package/dist/components/chat/chat.utils.d.mts +3 -0
- package/dist/components/chat/index.d.cts +3 -0
- package/dist/components/chat/index.d.mts +3 -0
- package/dist/components/chat/render-node.d.cts +8 -0
- package/dist/components/chat/render-node.d.mts +8 -0
- package/dist/components/context/ParticipantContextProvider.vue.d.cts +16 -0
- package/dist/components/context/ParticipantContextProvider.vue.d.mts +16 -0
- package/dist/components/context/RoomContextProvider.vue.d.cts +16 -0
- package/dist/components/context/RoomContextProvider.vue.d.mts +16 -0
- package/dist/components/context/SessionProvider.vue.d.cts +16 -0
- package/dist/components/context/SessionProvider.vue.d.mts +16 -0
- package/dist/components/context/TrackRefContextProvider.vue.d.cts +16 -0
- package/dist/components/context/TrackRefContextProvider.vue.d.mts +16 -0
- package/dist/components/context/index.d.cts +4 -0
- package/dist/components/context/index.d.mts +4 -0
- package/dist/components/controls/ChatToggle.vue.d.cts +17 -0
- package/dist/components/controls/ChatToggle.vue.d.mts +17 -0
- package/dist/components/controls/ClearPinButton.vue.d.cts +22 -0
- package/dist/components/controls/ClearPinButton.vue.d.mts +22 -0
- package/dist/components/controls/DisconnectButton.vue.d.cts +18 -0
- package/dist/components/controls/DisconnectButton.vue.d.mts +18 -0
- package/dist/components/controls/FocusToggle.vue.d.cts +19 -0
- package/dist/components/controls/FocusToggle.vue.d.mts +19 -0
- package/dist/components/controls/MediaDeviceSelect.vue.d.cts +45 -0
- package/dist/components/controls/MediaDeviceSelect.vue.d.mts +45 -0
- package/dist/components/controls/PaginationControl.vue.d.cts +18 -0
- package/dist/components/controls/PaginationControl.vue.d.mts +18 -0
- package/dist/components/controls/PaginationIndicator.vue.d.cts +8 -0
- package/dist/components/controls/PaginationIndicator.vue.d.mts +8 -0
- package/dist/components/controls/SettingsMenuToggle.vue.d.cts +16 -0
- package/dist/components/controls/SettingsMenuToggle.vue.d.mts +16 -0
- package/dist/components/controls/StartAudio.vue.d.cts +21 -0
- package/dist/components/controls/StartAudio.vue.d.mts +21 -0
- package/dist/components/controls/StartMediaButton.vue.d.cts +24 -0
- package/dist/components/controls/StartMediaButton.vue.d.mts +24 -0
- package/dist/components/controls/TrackToggle.vue.d.cts +43 -0
- package/dist/components/controls/TrackToggle.vue.d.mts +43 -0
- package/dist/components/controls/VideoQualitySelect.vue.d.cts +33 -0
- package/dist/components/controls/VideoQualitySelect.vue.d.mts +33 -0
- package/dist/components/controls/index.d.cts +24 -0
- package/dist/components/controls/index.d.mts +24 -0
- package/dist/components/icons/CameraDisabledIcon.vue.d.cts +3 -0
- package/dist/components/icons/CameraDisabledIcon.vue.d.mts +3 -0
- package/dist/components/icons/CameraIcon.vue.d.cts +3 -0
- package/dist/components/icons/CameraIcon.vue.d.mts +3 -0
- package/dist/components/icons/ChatCloseIcon.vue.d.cts +3 -0
- package/dist/components/icons/ChatCloseIcon.vue.d.mts +3 -0
- package/dist/components/icons/ChatIcon.vue.d.cts +3 -0
- package/dist/components/icons/ChatIcon.vue.d.mts +3 -0
- package/dist/components/icons/ChevronIcon.vue.d.cts +3 -0
- package/dist/components/icons/ChevronIcon.vue.d.mts +3 -0
- package/dist/components/icons/FocusToggleIcon.vue.d.cts +3 -0
- package/dist/components/icons/FocusToggleIcon.vue.d.mts +3 -0
- package/dist/components/icons/GearIcon.vue.d.cts +3 -0
- package/dist/components/icons/GearIcon.vue.d.mts +3 -0
- package/dist/components/icons/LeaveIcon.vue.d.cts +3 -0
- package/dist/components/icons/LeaveIcon.vue.d.mts +3 -0
- package/dist/components/icons/LockLockedIcon.vue.d.cts +3 -0
- package/dist/components/icons/LockLockedIcon.vue.d.mts +3 -0
- package/dist/components/icons/MicDisabledIcon.vue.d.cts +3 -0
- package/dist/components/icons/MicDisabledIcon.vue.d.mts +3 -0
- package/dist/components/icons/MicIcon.vue.d.cts +3 -0
- package/dist/components/icons/MicIcon.vue.d.mts +3 -0
- package/dist/components/icons/ParticipantPlaceholder.vue.d.cts +3 -0
- package/dist/components/icons/ParticipantPlaceholder.vue.d.mts +3 -0
- package/dist/components/icons/QualityExcellentIcon.vue.d.cts +3 -0
- package/dist/components/icons/QualityExcellentIcon.vue.d.mts +3 -0
- package/dist/components/icons/QualityGoodIcon.vue.d.cts +3 -0
- package/dist/components/icons/QualityGoodIcon.vue.d.mts +3 -0
- package/dist/components/icons/QualityPoorIcon.vue.d.cts +3 -0
- package/dist/components/icons/QualityPoorIcon.vue.d.mts +3 -0
- package/dist/components/icons/QualityUnknownIcon.vue.d.cts +3 -0
- package/dist/components/icons/QualityUnknownIcon.vue.d.mts +3 -0
- package/dist/components/icons/ScreenShareIcon.vue.d.cts +3 -0
- package/dist/components/icons/ScreenShareIcon.vue.d.mts +3 -0
- package/dist/components/icons/ScreenShareStopIcon.vue.d.cts +3 -0
- package/dist/components/icons/ScreenShareStopIcon.vue.d.mts +3 -0
- package/dist/components/icons/SpinnerIcon.vue.d.cts +3 -0
- package/dist/components/icons/SpinnerIcon.vue.d.mts +3 -0
- package/dist/components/icons/UnfocusToggleIcon.vue.d.cts +3 -0
- package/dist/components/icons/UnfocusToggleIcon.vue.d.mts +3 -0
- package/dist/components/icons/index.d.cts +21 -0
- package/dist/components/icons/index.d.mts +21 -0
- package/dist/components/icons/utils.d.cts +4 -0
- package/dist/components/icons/utils.d.mts +4 -0
- package/dist/components/index.d.cts +9 -0
- package/dist/components/index.d.mts +9 -0
- package/dist/components/layout/CarouselLayout.vue.d.cts +24 -0
- package/dist/components/layout/CarouselLayout.vue.d.mts +24 -0
- package/dist/components/layout/FocusLayout.vue.d.cts +16 -0
- package/dist/components/layout/FocusLayout.vue.d.mts +16 -0
- package/dist/components/layout/FocusLayoutContainer.vue.d.cts +14 -0
- package/dist/components/layout/FocusLayoutContainer.vue.d.mts +14 -0
- package/dist/components/layout/GridLayout.vue.d.cts +24 -0
- package/dist/components/layout/GridLayout.vue.d.mts +24 -0
- package/dist/components/layout/LayoutContextProvider.vue.d.cts +27 -0
- package/dist/components/layout/LayoutContextProvider.vue.d.mts +27 -0
- package/dist/components/layout/index.d.cts +10 -0
- package/dist/components/layout/index.d.mts +10 -0
- package/dist/components/participant/AudioTrack.vue.d.cts +17 -0
- package/dist/components/participant/AudioTrack.vue.d.mts +17 -0
- package/dist/components/participant/AudioVisualizer.vue.d.cts +10 -0
- package/dist/components/participant/AudioVisualizer.vue.d.mts +10 -0
- package/dist/components/participant/BarVisualizer.vue.d.cts +46 -0
- package/dist/components/participant/BarVisualizer.vue.d.mts +46 -0
- package/dist/components/participant/ConnectionQualityIndicator.vue.d.cts +19 -0
- package/dist/components/participant/ConnectionQualityIndicator.vue.d.mts +19 -0
- package/dist/components/participant/ParticipantAudioTile.vue.d.cts +23 -0
- package/dist/components/participant/ParticipantAudioTile.vue.d.mts +23 -0
- package/dist/components/participant/ParticipantAvatar.vue.d.cts +10 -0
- package/dist/components/participant/ParticipantAvatar.vue.d.mts +10 -0
- package/dist/components/participant/ParticipantName.vue.d.cts +17 -0
- package/dist/components/participant/ParticipantName.vue.d.mts +17 -0
- package/dist/components/participant/ParticipantTile.vue.d.cts +27 -0
- package/dist/components/participant/ParticipantTile.vue.d.mts +27 -0
- package/dist/components/participant/TrackMutedIndicator.vue.d.cts +22 -0
- package/dist/components/participant/TrackMutedIndicator.vue.d.mts +22 -0
- package/dist/components/participant/VideoTrack.vue.d.cts +17 -0
- package/dist/components/participant/VideoTrack.vue.d.mts +17 -0
- package/dist/components/participant/index.d.cts +19 -0
- package/dist/components/participant/index.d.mts +19 -0
- package/dist/components/prefabs/AudioConference.vue.d.cts +26 -0
- package/dist/components/prefabs/AudioConference.vue.d.mts +26 -0
- package/dist/components/prefabs/Chat.vue.d.cts +36 -0
- package/dist/components/prefabs/Chat.vue.d.mts +36 -0
- package/dist/components/prefabs/ControlBar.vue.d.cts +52 -0
- package/dist/components/prefabs/ControlBar.vue.d.mts +52 -0
- package/dist/components/prefabs/MediaDeviceMenu.vue.d.cts +46 -0
- package/dist/components/prefabs/MediaDeviceMenu.vue.d.mts +46 -0
- package/dist/components/prefabs/PreJoin.vue.d.cts +45 -0
- package/dist/components/prefabs/PreJoin.vue.d.mts +45 -0
- package/dist/components/prefabs/VideoConference.vue.d.cts +28 -0
- package/dist/components/prefabs/VideoConference.vue.d.mts +28 -0
- package/dist/components/prefabs/VoiceAssistantControlBar.vue.d.cts +33 -0
- package/dist/components/prefabs/VoiceAssistantControlBar.vue.d.mts +33 -0
- package/dist/components/prefabs/index.d.cts +14 -0
- package/dist/components/prefabs/index.d.mts +14 -0
- package/dist/components/room/ConnectionStateToast.vue.d.cts +8 -0
- package/dist/components/room/ConnectionStateToast.vue.d.mts +8 -0
- package/dist/components/room/ConnectionStatus.vue.d.cts +19 -0
- package/dist/components/room/ConnectionStatus.vue.d.mts +19 -0
- package/dist/components/room/LiveKitRoom.vue.d.cts +47 -0
- package/dist/components/room/LiveKitRoom.vue.d.mts +47 -0
- package/dist/components/room/ParticipantLoop.vue.d.cts +18 -0
- package/dist/components/room/ParticipantLoop.vue.d.mts +18 -0
- package/dist/components/room/RoomAudioRenderer.vue.d.cts +13 -0
- package/dist/components/room/RoomAudioRenderer.vue.d.mts +13 -0
- package/dist/components/room/RoomName.vue.d.cts +20 -0
- package/dist/components/room/RoomName.vue.d.mts +20 -0
- package/dist/components/room/Toast.vue.d.cts +14 -0
- package/dist/components/room/Toast.vue.d.mts +14 -0
- package/dist/components/room/TrackLoop.vue.d.cts +18 -0
- package/dist/components/room/TrackLoop.vue.d.mts +18 -0
- package/dist/components/room/index.d.cts +16 -0
- package/dist/components/room/index.d.mts +16 -0
- package/dist/components/style.d.cts +11 -0
- package/dist/components/style.d.mts +11 -0
- package/dist/composables/index.d.cts +66 -0
- package/dist/composables/index.d.mts +66 -0
- package/dist/composables/useAgent.d.cts +67 -0
- package/dist/composables/useAgent.d.mts +67 -0
- package/dist/composables/useAgentExpression.d.cts +20 -0
- package/dist/composables/useAgentExpression.d.mts +20 -0
- package/dist/composables/useAudioPlayback.d.cts +10 -0
- package/dist/composables/useAudioPlayback.d.mts +10 -0
- package/dist/composables/useBackgroundEffect.d.cts +43 -0
- package/dist/composables/useBackgroundEffect.d.mts +43 -0
- package/dist/composables/useBarAnimator.d.cts +11 -0
- package/dist/composables/useBarAnimator.d.mts +11 -0
- package/dist/composables/useChat.d.cts +13 -0
- package/dist/composables/useChat.d.mts +13 -0
- package/dist/composables/useChatToggle.d.cts +13 -0
- package/dist/composables/useChatToggle.d.mts +13 -0
- package/dist/composables/useClearPinButton.d.cts +14 -0
- package/dist/composables/useClearPinButton.d.mts +14 -0
- package/dist/composables/useConnectionQualityIndicator.d.cts +9 -0
- package/dist/composables/useConnectionQualityIndicator.d.mts +9 -0
- package/dist/composables/useConnectionState.d.cts +13 -0
- package/dist/composables/useConnectionState.d.mts +13 -0
- package/dist/composables/useConnectionStatus.d.cts +16 -0
- package/dist/composables/useConnectionStatus.d.mts +16 -0
- package/dist/composables/useDataChannel.d.cts +14 -0
- package/dist/composables/useDataChannel.d.mts +14 -0
- package/dist/composables/useDisconnectButton.d.cts +9 -0
- package/dist/composables/useDisconnectButton.d.mts +9 -0
- package/dist/composables/useEvents.d.cts +15 -0
- package/dist/composables/useEvents.d.mts +15 -0
- package/dist/composables/useFacingMode.d.cts +17 -0
- package/dist/composables/useFacingMode.d.mts +17 -0
- package/dist/composables/useFocusToggle.d.cts +14 -0
- package/dist/composables/useFocusToggle.d.mts +14 -0
- package/dist/composables/useGridLayout.d.cts +13 -0
- package/dist/composables/useGridLayout.d.mts +13 -0
- package/dist/composables/useIsEncrypted.d.cts +10 -0
- package/dist/composables/useIsEncrypted.d.mts +10 -0
- package/dist/composables/useIsMuted.d.cts +11 -0
- package/dist/composables/useIsMuted.d.mts +11 -0
- package/dist/composables/useIsRecording.d.cts +9 -0
- package/dist/composables/useIsRecording.d.mts +9 -0
- package/dist/composables/useIsSpeaking.d.cts +9 -0
- package/dist/composables/useIsSpeaking.d.mts +9 -0
- package/dist/composables/useKrispNoiseFilter.d.cts +16 -0
- package/dist/composables/useKrispNoiseFilter.d.mts +16 -0
- package/dist/composables/useLiveKitRoom.d.cts +15 -0
- package/dist/composables/useLiveKitRoom.d.mts +15 -0
- package/dist/composables/useLocalParticipant.d.cts +16 -0
- package/dist/composables/useLocalParticipant.d.mts +16 -0
- package/dist/composables/useLocalParticipantPermissions.d.cts +13 -0
- package/dist/composables/useLocalParticipantPermissions.d.mts +13 -0
- package/dist/composables/useMediaDeviceSelect.d.cts +16 -0
- package/dist/composables/useMediaDeviceSelect.d.mts +16 -0
- package/dist/composables/useMediaDevices.d.cts +12 -0
- package/dist/composables/useMediaDevices.d.mts +12 -0
- package/dist/composables/useMediaTrackBySourceOrName.d.cts +30 -0
- package/dist/composables/useMediaTrackBySourceOrName.d.mts +30 -0
- package/dist/composables/usePagination.d.cts +26 -0
- package/dist/composables/usePagination.d.mts +26 -0
- package/dist/composables/useParticipantAttributes.d.cts +14 -0
- package/dist/composables/useParticipantAttributes.d.mts +14 -0
- package/dist/composables/useParticipantAvatar.d.cts +17 -0
- package/dist/composables/useParticipantAvatar.d.mts +17 -0
- package/dist/composables/useParticipantInfo.d.cts +14 -0
- package/dist/composables/useParticipantInfo.d.mts +14 -0
- package/dist/composables/useParticipantPermissions.d.cts +10 -0
- package/dist/composables/useParticipantPermissions.d.mts +10 -0
- package/dist/composables/useParticipantTile.d.cts +22 -0
- package/dist/composables/useParticipantTile.d.mts +22 -0
- package/dist/composables/useParticipantTracks.d.cts +12 -0
- package/dist/composables/useParticipantTracks.d.mts +12 -0
- package/dist/composables/useParticipants.d.cts +11 -0
- package/dist/composables/useParticipants.d.mts +11 -0
- package/dist/composables/usePersistentUserChoices.d.cts +16 -0
- package/dist/composables/usePersistentUserChoices.d.mts +16 -0
- package/dist/composables/usePinnedTracks.d.cts +10 -0
- package/dist/composables/usePinnedTracks.d.mts +10 -0
- package/dist/composables/usePreviewTracks.d.cts +15 -0
- package/dist/composables/usePreviewTracks.d.mts +15 -0
- package/dist/composables/useRemoteParticipant.d.cts +14 -0
- package/dist/composables/useRemoteParticipant.d.mts +14 -0
- package/dist/composables/useRemoteParticipants.d.cts +10 -0
- package/dist/composables/useRemoteParticipants.d.mts +10 -0
- package/dist/composables/useRoomInfo.d.cts +13 -0
- package/dist/composables/useRoomInfo.d.mts +13 -0
- package/dist/composables/useRpc.d.cts +18 -0
- package/dist/composables/useRpc.d.mts +18 -0
- package/dist/composables/useSequentialRoomConnectDisconnect.d.cts +10 -0
- package/dist/composables/useSequentialRoomConnectDisconnect.d.mts +10 -0
- package/dist/composables/useSession.d.cts +83 -0
- package/dist/composables/useSession.d.mts +83 -0
- package/dist/composables/useSessionMessages.d.cts +22 -0
- package/dist/composables/useSessionMessages.d.mts +22 -0
- package/dist/composables/useSettingsToggle.d.cts +10 -0
- package/dist/composables/useSettingsToggle.d.mts +10 -0
- package/dist/composables/useSortedParticipants.d.cts +9 -0
- package/dist/composables/useSortedParticipants.d.mts +9 -0
- package/dist/composables/useSpeakingParticipants.d.cts +6 -0
- package/dist/composables/useSpeakingParticipants.d.mts +6 -0
- package/dist/composables/useStartAudio.d.cts +10 -0
- package/dist/composables/useStartAudio.d.mts +10 -0
- package/dist/composables/useStartVideo.d.cts +10 -0
- package/dist/composables/useStartVideo.d.mts +10 -0
- package/dist/composables/useSwipe.d.cts +16 -0
- package/dist/composables/useSwipe.d.mts +16 -0
- package/dist/composables/useTextStream.d.cts +27 -0
- package/dist/composables/useTextStream.d.mts +27 -0
- package/dist/composables/useToast.d.cts +9 -0
- package/dist/composables/useToast.d.mts +9 -0
- package/dist/composables/useToken.d.cts +23 -0
- package/dist/composables/useToken.d.mts +23 -0
- package/dist/composables/useTrack.d.cts +12 -0
- package/dist/composables/useTrack.d.mts +12 -0
- package/dist/composables/useTrackByName.d.cts +11 -0
- package/dist/composables/useTrackByName.d.mts +11 -0
- package/dist/composables/useTrackMutedIndicator.d.cts +9 -0
- package/dist/composables/useTrackMutedIndicator.d.mts +9 -0
- package/dist/composables/useTrackRefBySource.d.cts +9 -0
- package/dist/composables/useTrackRefBySource.d.mts +9 -0
- package/dist/composables/useTrackRefBySourceOrName.d.cts +7 -0
- package/dist/composables/useTrackRefBySourceOrName.d.mts +7 -0
- package/dist/composables/useTrackSyncTime.d.cts +13 -0
- package/dist/composables/useTrackSyncTime.d.mts +13 -0
- package/dist/composables/useTrackToggle.d.cts +28 -0
- package/dist/composables/useTrackToggle.d.mts +28 -0
- package/dist/composables/useTrackTranscription.d.cts +15 -0
- package/dist/composables/useTrackTranscription.d.mts +15 -0
- package/dist/composables/useTrackVolume.d.cts +39 -0
- package/dist/composables/useTrackVolume.d.mts +39 -0
- package/dist/composables/useTracks.d.cts +18 -0
- package/dist/composables/useTracks.d.mts +18 -0
- package/dist/composables/useTranscriptions.d.cts +12 -0
- package/dist/composables/useTranscriptions.d.mts +12 -0
- package/dist/composables/useVideoQuality.d.cts +29 -0
- package/dist/composables/useVideoQuality.d.mts +29 -0
- package/dist/composables/useVisualStableUpdate.d.cts +13 -0
- package/dist/composables/useVisualStableUpdate.d.mts +13 -0
- package/dist/composables/useVoiceAssistant.d.cts +16 -0
- package/dist/composables/useVoiceAssistant.d.mts +16 -0
- package/dist/context/connection-state.context.d.cts +18 -0
- package/dist/context/connection-state.context.d.mts +18 -0
- package/dist/context/error.d.cts +3 -0
- package/dist/context/error.d.mts +3 -0
- package/dist/context/feature.context.d.cts +8 -0
- package/dist/context/feature.context.d.mts +8 -0
- package/dist/context/index.d.cts +9 -0
- package/dist/context/index.d.mts +9 -0
- package/dist/context/layout.context.d.cts +15 -0
- package/dist/context/layout.context.d.mts +15 -0
- package/dist/context/participant.context.d.cts +8 -0
- package/dist/context/participant.context.d.mts +8 -0
- package/dist/context/pin.context.d.cts +21 -0
- package/dist/context/pin.context.d.mts +21 -0
- package/dist/context/room.context.d.cts +8 -0
- package/dist/context/room.context.d.mts +8 -0
- package/dist/context/session.context.d.cts +8 -0
- package/dist/context/session.context.d.mts +8 -0
- package/dist/context/toast.context.d.cts +17 -0
- package/dist/context/toast.context.d.mts +17 -0
- package/dist/context/track-reference.context.d.cts +8 -0
- package/dist/context/track-reference.context.d.mts +8 -0
- package/dist/context/widget.context.d.cts +21 -0
- package/dist/context/widget.context.d.mts +21 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.mts +6 -0
- package/dist/internal/emitter.d.cts +17 -0
- package/dist/internal/emitter.d.mts +17 -0
- package/dist/internal/index.d.cts +4 -0
- package/dist/internal/index.d.mts +4 -0
- package/dist/internal/observable.d.cts +3 -0
- package/dist/internal/observable.d.mts +3 -0
- package/dist/internal/permissions.d.cts +4 -0
- package/dist/internal/permissions.d.mts +4 -0
- package/dist/internal/refs.d.cts +1 -0
- package/dist/internal/refs.d.mts +1 -0
- package/dist/krisp/index.d.cts +1 -0
- package/dist/krisp/index.d.mts +1 -0
- package/dist/krisp.cjs +2 -0
- package/dist/krisp.cjs.map +1 -0
- package/dist/krisp.js +62 -0
- package/dist/krisp.js.map +1 -0
- package/dist/livekit-vue.cjs +2 -0
- package/dist/livekit-vue.cjs.map +1 -0
- package/dist/livekit-vue.js +5101 -20542
- package/dist/livekit-vue.js.map +1 -0
- package/dist/livekit-vue.umd.js +4 -0
- package/dist/livekit-vue.umd.js.map +1 -0
- package/dist/style-CDggj9VO.js +14 -0
- package/dist/style-CDggj9VO.js.map +1 -0
- package/dist/style-CkQyDSsh.cjs +2 -0
- package/dist/style-CkQyDSsh.cjs.map +1 -0
- package/dist/styles.css +2 -0
- package/dist/types/agent.types.d.cts +2 -0
- package/dist/types/agent.types.d.mts +2 -0
- package/dist/types/index.d.cts +3 -0
- package/dist/types/index.d.mts +3 -0
- package/dist/types/livekit-room.types.d.cts +19 -0
- package/dist/types/livekit-room.types.d.mts +19 -0
- package/dist/types/participant.types.d.cts +2 -0
- package/dist/types/participant.types.d.mts +2 -0
- package/dist/useLocalParticipant-ByBAgL8i.js +50 -0
- package/dist/useLocalParticipant-ByBAgL8i.js.map +1 -0
- package/dist/useLocalParticipant-Dn5NE_KM.cjs +2 -0
- package/dist/useLocalParticipant-Dn5NE_KM.cjs.map +1 -0
- package/dist/utils/media-choices.utils.d.cts +7 -0
- package/dist/utils/media-choices.utils.d.mts +7 -0
- package/dist/{src/utils/room.utils.d.ts → utils/room.utils.d.cts} +1 -1
- package/dist/utils/room.utils.d.mts +1 -0
- package/package.json +103 -66
- package/dist/favicon.ico +0 -0
- package/dist/index.css +0 -1
- package/dist/livekit-vue.umd.cjs +0 -62
- package/dist/src/assets/index.d.ts +0 -0
- package/dist/src/components/controls/TrackToggle.vue.d.ts +0 -15
- package/dist/src/components/controls/buttons.d.ts +0 -4
- package/dist/src/components/controls/index.d.ts +0 -3
- package/dist/src/components/controls/track_toggle.d.ts +0 -12
- package/dist/src/components/icons/ParticipantPlaceholderIcon.vue.d.ts +0 -2
- package/dist/src/components/icons/TrackIcon.vue.d.ts +0 -7
- package/dist/src/components/index.d.ts +0 -3
- package/dist/src/components/participant/audio_track.d.ts +0 -7
- package/dist/src/composables/index.d.ts +0 -37
- package/dist/src/composables/private/useObservableState.d.ts +0 -8
- package/dist/src/composables/useAudioPlayback.d.ts +0 -11
- package/dist/src/composables/useClearPinButton.d.ts +0 -5
- package/dist/src/composables/useConnectionQualityIndicator.d.ts +0 -10
- package/dist/src/composables/useConnectionState.d.ts +0 -3
- package/dist/src/composables/useDataChannel.d.ts +0 -15
- package/dist/src/composables/useDisconnectButton.d.ts +0 -5
- package/dist/src/composables/useFacingMode.d.ts +0 -10
- package/dist/src/composables/useFocusToggle.d.ts +0 -11
- package/dist/src/composables/useGridLayout.d.ts +0 -10
- package/dist/src/composables/useIsEncrypted.d.ts +0 -8
- package/dist/src/composables/useIsMuted.d.ts +0 -7
- package/dist/src/composables/useIsRecording.d.ts +0 -5
- package/dist/src/composables/useIsSpeaking.d.ts +0 -5
- package/dist/src/composables/useLiveKitRoom.d.ts +0 -8
- package/dist/src/composables/useLocalParticipant.d.ts +0 -16
- package/dist/src/composables/useParticipantTile.d.ts +0 -11
- package/dist/src/composables/useParticipantTracks.d.ts +0 -4
- package/dist/src/composables/useParticipants.d.ts +0 -7
- package/dist/src/composables/usePersistentUserChoices.d.ts +0 -16
- package/dist/src/composables/usePinnedTracks.d.ts +0 -4
- package/dist/src/composables/useRemoteParticipant.d.ts +0 -7
- package/dist/src/composables/useRemoteParticipants.d.ts +0 -7
- package/dist/src/composables/useRoomInfo.d.ts +0 -13
- package/dist/src/composables/useSortedParticipants.d.ts +0 -3
- package/dist/src/composables/useSpeakingParticipants.d.ts +0 -3
- package/dist/src/composables/useStartAudio.d.ts +0 -11
- package/dist/src/composables/useStartVideo.d.ts +0 -11
- package/dist/src/composables/useToken.d.ts +0 -10
- package/dist/src/composables/useTrack.d.ts +0 -3
- package/dist/src/composables/useTrackByName.d.ts +0 -3
- package/dist/src/composables/useTrackMutedIndicator.d.ts +0 -6
- package/dist/src/composables/useTrackRefBySourceOrName.d.ts +0 -4
- package/dist/src/composables/useTrackSyncTime.d.ts +0 -6
- package/dist/src/composables/useTrackToggle.d.ts +0 -21
- package/dist/src/composables/useTrackVolume.d.ts +0 -28
- package/dist/src/composables/useTracks.d.ts +0 -10
- package/dist/src/composables/useVisualStableUpdate.d.ts +0 -8
- package/dist/src/context/index.d.ts +0 -6
- package/dist/src/context/layout.context.d.ts +0 -28
- package/dist/src/context/participant.context.d.ts +0 -9
- package/dist/src/context/pin.context.d.ts +0 -26
- package/dist/src/context/room.context.d.ts +0 -9
- package/dist/src/context/track_reference.context.d.ts +0 -6
- package/dist/src/context/widget.context.d.ts +0 -7
- package/dist/src/index.d.ts +0 -3
- package/dist/src/types/livekit_room.types.d.ts +0 -68
- package/src/assets/icons/chevron-down.svg +0 -4
- package/src/assets/icons/chevron-up.svg +0 -4
- package/src/assets/icons/frown.svg +0 -7
- package/src/assets/icons/heart.svg +0 -6
- package/src/assets/icons/mic-off.svg +0 -8
- package/src/assets/icons/mic.svg +0 -7
- package/src/assets/icons/phone-hang-up.svg +0 -9
- package/src/assets/icons/share-screen-off.svg +0 -6
- package/src/assets/icons/share-screen.svg +0 -7
- package/src/assets/icons/smile.svg +0 -7
- package/src/assets/icons/thumbs-down.svg +0 -6
- package/src/assets/icons/thumbs-up.svg +0 -6
- package/src/assets/icons/video-off.svg +0 -5
- package/src/assets/icons/video.svg +0 -5
- package/src/assets/index.ts +0 -1
- package/src/assets/placeholders/participant.svg +0 -8
- package/src/components/controls/TrackToggle.vue +0 -27
- package/src/components/controls/buttons.ts +0 -5
- package/src/components/controls/index.ts +0 -3
- package/src/components/controls/track_toggle.ts +0 -13
- package/src/components/icons/ParticipantPlaceholderIcon.vue +0 -7
- package/src/components/icons/TrackIcon.vue +0 -55
- package/src/components/index.ts +0 -3
- package/src/components/participant/AudioTrack.vue +0 -17
- package/src/components/participant/audio_track.ts +0 -8
- package/src/composables/index.ts +0 -89
- package/src/composables/private/useObservableState.ts +0 -44
- package/src/composables/useAudioPlayback.ts +0 -42
- package/src/composables/useClearPinButton.ts +0 -41
- package/src/composables/useConnectionQualityIndicator.ts +0 -39
- package/src/composables/useConnectionState.ts +0 -21
- package/src/composables/useDataChannel.ts +0 -56
- package/src/composables/useDisconnectButton.ts +0 -28
- package/src/composables/useFacingMode.ts +0 -28
- package/src/composables/useFocusToggle.ts +0 -38
- package/src/composables/useGridLayout.ts +0 -44
- package/src/composables/useIsEncrypted.ts +0 -34
- package/src/composables/useIsMuted.ts +0 -56
- package/src/composables/useIsRecording.ts +0 -30
- package/src/composables/useIsSpeaking.ts +0 -23
- package/src/composables/useLiveKitRoom.ts +0 -219
- package/src/composables/useLocalParticipant.ts +0 -64
- package/src/composables/useParticipantTile.ts +0 -68
- package/src/composables/useParticipantTracks.ts +0 -36
- package/src/composables/useParticipants.ts +0 -25
- package/src/composables/usePersistentUserChoices.ts +0 -64
- package/src/composables/usePinnedTracks.ts +0 -16
- package/src/composables/useRemoteParticipant.ts +0 -42
- package/src/composables/useRemoteParticipants.ts +0 -27
- package/src/composables/useRoomInfo.ts +0 -42
- package/src/composables/useSortedParticipants.ts +0 -21
- package/src/composables/useSpeakingParticipants.ts +0 -22
- package/src/composables/useStartAudio.ts +0 -53
- package/src/composables/useStartVideo.ts +0 -53
- package/src/composables/useToken.ts +0 -40
- package/src/composables/useTrack.ts +0 -11
- package/src/composables/useTrackByName.ts +0 -11
- package/src/composables/useTrackMutedIndicator.ts +0 -34
- package/src/composables/useTrackRefBySourceOrName.ts +0 -39
- package/src/composables/useTrackSyncTime.ts +0 -32
- package/src/composables/useTrackToggle.ts +0 -113
- package/src/composables/useTrackVolume.ts +0 -268
- package/src/composables/useTracks.ts +0 -122
- package/src/composables/useVisualStableUpdate.ts +0 -57
- package/src/context/index.ts +0 -6
- package/src/context/layout.context.ts +0 -46
- package/src/context/participant.context.ts +0 -33
- package/src/context/pin.context.ts +0 -50
- package/src/context/room.context.ts +0 -31
- package/src/context/track_reference.context.ts +0 -29
- package/src/context/widget.context.ts +0 -17
- package/src/index.css +0 -1
- package/src/index.ts +0 -5
- package/src/types/livekit_room.types.ts +0 -78
- package/src/utils/room.utils.ts +0 -9
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './feature.context.mjs';
|
|
2
|
+
export * from './layout.context.mjs';
|
|
3
|
+
export * from './participant.context.mjs';
|
|
4
|
+
export * from './pin.context.mjs';
|
|
5
|
+
export * from './room.context.mjs';
|
|
6
|
+
export * from './session.context.mjs';
|
|
7
|
+
export * from './toast.context.mjs';
|
|
8
|
+
export * from './track-reference.context.mjs';
|
|
9
|
+
export * from './widget.context.mjs';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ShallowRef } from 'vue';
|
|
2
|
+
import { PinContext } from './pin.context.cjs';
|
|
3
|
+
import { WidgetContext } from './widget.context.cjs';
|
|
4
|
+
export interface LayoutContext {
|
|
5
|
+
pin: PinContext;
|
|
6
|
+
widget: WidgetContext;
|
|
7
|
+
}
|
|
8
|
+
declare const useProvideLayoutContext: (initialState?: LayoutContext | undefined) => ShallowRef<LayoutContext>, useLayoutContextRaw: () => ShallowRef<LayoutContext> | undefined;
|
|
9
|
+
export declare function useLayoutContext(): ShallowRef<LayoutContext>;
|
|
10
|
+
export { useLayoutContextRaw, useProvideLayoutContext };
|
|
11
|
+
export declare function useMaybeLayoutContext(): ShallowRef<LayoutContext> | undefined;
|
|
12
|
+
export declare function useEnsureLayoutContext(layoutContext?: LayoutContext): ShallowRef<LayoutContext>;
|
|
13
|
+
export declare function createLayoutContext(): LayoutContext;
|
|
14
|
+
export declare function useCreateLayoutContext(): LayoutContext;
|
|
15
|
+
export declare function useEnsureCreateLayoutContext(layoutContext?: LayoutContext): ShallowRef<LayoutContext>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ShallowRef } from 'vue';
|
|
2
|
+
import { PinContext } from './pin.context.mjs';
|
|
3
|
+
import { WidgetContext } from './widget.context.mjs';
|
|
4
|
+
export interface LayoutContext {
|
|
5
|
+
pin: PinContext;
|
|
6
|
+
widget: WidgetContext;
|
|
7
|
+
}
|
|
8
|
+
declare const useProvideLayoutContext: (initialState?: LayoutContext | undefined) => ShallowRef<LayoutContext>, useLayoutContextRaw: () => ShallowRef<LayoutContext> | undefined;
|
|
9
|
+
export declare function useLayoutContext(): ShallowRef<LayoutContext>;
|
|
10
|
+
export { useLayoutContextRaw, useProvideLayoutContext };
|
|
11
|
+
export declare function useMaybeLayoutContext(): ShallowRef<LayoutContext> | undefined;
|
|
12
|
+
export declare function useEnsureLayoutContext(layoutContext?: LayoutContext): ShallowRef<LayoutContext>;
|
|
13
|
+
export declare function createLayoutContext(): LayoutContext;
|
|
14
|
+
export declare function useCreateLayoutContext(): LayoutContext;
|
|
15
|
+
export declare function useEnsureCreateLayoutContext(layoutContext?: LayoutContext): ShallowRef<LayoutContext>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Participant } from 'livekit-client';
|
|
2
|
+
import { ShallowRef } from 'vue';
|
|
3
|
+
export type ParticipantContext = ShallowRef<Participant>;
|
|
4
|
+
declare const useProvideParticipantContext: (initialValue: Participant) => ParticipantContext, useParticipantContextRaw: () => ParticipantContext | undefined;
|
|
5
|
+
export { useParticipantContextRaw, useProvideParticipantContext };
|
|
6
|
+
export declare function useMaybeParticipantContext(): ParticipantContext | undefined;
|
|
7
|
+
export declare function useParticipantContext(): ParticipantContext;
|
|
8
|
+
export declare function useEnsureParticipant(participant?: Participant): ParticipantContext;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Participant } from 'livekit-client';
|
|
2
|
+
import { ShallowRef } from 'vue';
|
|
3
|
+
export type ParticipantContext = ShallowRef<Participant>;
|
|
4
|
+
declare const useProvideParticipantContext: (initialValue: Participant) => ParticipantContext, useParticipantContextRaw: () => ParticipantContext | undefined;
|
|
5
|
+
export { useParticipantContextRaw, useProvideParticipantContext };
|
|
6
|
+
export declare function useMaybeParticipantContext(): ParticipantContext | undefined;
|
|
7
|
+
export declare function useParticipantContext(): ParticipantContext;
|
|
8
|
+
export declare function useEnsureParticipant(participant?: Participant): ParticipantContext;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PinState, TrackReferenceOrPlaceholder } from '@livekit/components-core';
|
|
2
|
+
import { ShallowRef } from 'vue';
|
|
3
|
+
export interface SetPinAction {
|
|
4
|
+
readonly msg: 'set_pin';
|
|
5
|
+
readonly trackReference: TrackReferenceOrPlaceholder;
|
|
6
|
+
}
|
|
7
|
+
export interface ClearPinAction {
|
|
8
|
+
readonly msg: 'clear_pin';
|
|
9
|
+
}
|
|
10
|
+
export type PinContextAction = SetPinAction | ClearPinAction;
|
|
11
|
+
export interface PinContext {
|
|
12
|
+
readonly state: ShallowRef<PinState>;
|
|
13
|
+
readonly dispatch: (action: PinContextAction) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function pinReducer(_state: PinState, action: PinContextAction): PinState;
|
|
16
|
+
export declare function createPinContext(initialValue?: PinState): PinContext;
|
|
17
|
+
declare const useProvidePinContext: (initialValue?: PinState | undefined) => PinContext, usePinContextRaw: () => PinContext | undefined;
|
|
18
|
+
export { usePinContextRaw, useProvidePinContext };
|
|
19
|
+
export declare function usePinContext(): PinContext;
|
|
20
|
+
export declare function useMaybePinContext(): PinContext | undefined;
|
|
21
|
+
export declare function useEnsurePinContext(pinContext?: PinContext): PinContext;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PinState, TrackReferenceOrPlaceholder } from '@livekit/components-core';
|
|
2
|
+
import { ShallowRef } from 'vue';
|
|
3
|
+
export interface SetPinAction {
|
|
4
|
+
readonly msg: 'set_pin';
|
|
5
|
+
readonly trackReference: TrackReferenceOrPlaceholder;
|
|
6
|
+
}
|
|
7
|
+
export interface ClearPinAction {
|
|
8
|
+
readonly msg: 'clear_pin';
|
|
9
|
+
}
|
|
10
|
+
export type PinContextAction = SetPinAction | ClearPinAction;
|
|
11
|
+
export interface PinContext {
|
|
12
|
+
readonly state: ShallowRef<PinState>;
|
|
13
|
+
readonly dispatch: (action: PinContextAction) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function pinReducer(_state: PinState, action: PinContextAction): PinState;
|
|
16
|
+
export declare function createPinContext(initialValue?: PinState): PinContext;
|
|
17
|
+
declare const useProvidePinContext: (initialValue?: PinState | undefined) => PinContext, usePinContextRaw: () => PinContext | undefined;
|
|
18
|
+
export { usePinContextRaw, useProvidePinContext };
|
|
19
|
+
export declare function usePinContext(): PinContext;
|
|
20
|
+
export declare function useMaybePinContext(): PinContext | undefined;
|
|
21
|
+
export declare function useEnsurePinContext(pinContext?: PinContext): PinContext;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Room } from 'livekit-client';
|
|
2
|
+
import { ShallowRef } from 'vue';
|
|
3
|
+
export type RoomContext = ShallowRef<Room>;
|
|
4
|
+
declare const useProvideRoomContext: (initialValue: Room) => RoomContext, useRoomContextRaw: () => RoomContext | undefined;
|
|
5
|
+
export { useProvideRoomContext, useRoomContextRaw };
|
|
6
|
+
export declare function useMaybeRoomContext(): RoomContext | undefined;
|
|
7
|
+
export declare function useRoomContext(): RoomContext;
|
|
8
|
+
export declare function useEnsureRoomContext(room?: Room): RoomContext;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Room } from 'livekit-client';
|
|
2
|
+
import { ShallowRef } from 'vue';
|
|
3
|
+
export type RoomContext = ShallowRef<Room>;
|
|
4
|
+
declare const useProvideRoomContext: (initialValue: Room) => RoomContext, useRoomContextRaw: () => RoomContext | undefined;
|
|
5
|
+
export { useProvideRoomContext, useRoomContextRaw };
|
|
6
|
+
export declare function useMaybeRoomContext(): RoomContext | undefined;
|
|
7
|
+
export declare function useRoomContext(): RoomContext;
|
|
8
|
+
export declare function useEnsureRoomContext(room?: Room): RoomContext;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ShallowRef } from 'vue';
|
|
2
|
+
import { UseSession } from '../composables/useSession.cjs';
|
|
3
|
+
export type SessionContext = ShallowRef<UseSession>;
|
|
4
|
+
declare const useProvideSessionContext: (initialValue: UseSession) => SessionContext, useSessionContextRaw: () => SessionContext | undefined;
|
|
5
|
+
export { useProvideSessionContext, useSessionContextRaw };
|
|
6
|
+
export declare function useMaybeSessionContext(): SessionContext | undefined;
|
|
7
|
+
export declare function useSessionContext(): SessionContext;
|
|
8
|
+
export declare function useEnsureSession(session?: UseSession): SessionContext;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ShallowRef } from 'vue';
|
|
2
|
+
import { UseSession } from '../composables/useSession.mjs';
|
|
3
|
+
export type SessionContext = ShallowRef<UseSession>;
|
|
4
|
+
declare const useProvideSessionContext: (initialValue: UseSession) => SessionContext, useSessionContextRaw: () => SessionContext | undefined;
|
|
5
|
+
export { useProvideSessionContext, useSessionContextRaw };
|
|
6
|
+
export declare function useMaybeSessionContext(): SessionContext | undefined;
|
|
7
|
+
export declare function useSessionContext(): SessionContext;
|
|
8
|
+
export declare function useEnsureSession(session?: UseSession): SessionContext;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export interface ToastMessage {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly message: string;
|
|
5
|
+
readonly type: 'info' | 'success' | 'warning' | 'error';
|
|
6
|
+
readonly timeout?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ToastContext {
|
|
9
|
+
readonly messages: Ref<ToastMessage[]>;
|
|
10
|
+
readonly add: (message: Omit<ToastMessage, 'id'>) => string;
|
|
11
|
+
readonly remove: (id: string) => void;
|
|
12
|
+
readonly clear: () => void;
|
|
13
|
+
}
|
|
14
|
+
declare const useProvideToastContext: () => ToastContext, useToastContextRaw: () => ToastContext | undefined;
|
|
15
|
+
export { useProvideToastContext, useToastContextRaw };
|
|
16
|
+
export declare function useMaybeToastContext(): ToastContext | undefined;
|
|
17
|
+
export declare function useToastContext(): ToastContext;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export interface ToastMessage {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly message: string;
|
|
5
|
+
readonly type: 'info' | 'success' | 'warning' | 'error';
|
|
6
|
+
readonly timeout?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ToastContext {
|
|
9
|
+
readonly messages: Ref<ToastMessage[]>;
|
|
10
|
+
readonly add: (message: Omit<ToastMessage, 'id'>) => string;
|
|
11
|
+
readonly remove: (id: string) => void;
|
|
12
|
+
readonly clear: () => void;
|
|
13
|
+
}
|
|
14
|
+
declare const useProvideToastContext: () => ToastContext, useToastContextRaw: () => ToastContext | undefined;
|
|
15
|
+
export { useProvideToastContext, useToastContextRaw };
|
|
16
|
+
export declare function useMaybeToastContext(): ToastContext | undefined;
|
|
17
|
+
export declare function useToastContext(): ToastContext;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TrackReferenceOrPlaceholder } from '@livekit/components-core';
|
|
2
|
+
import { ShallowRef } from 'vue';
|
|
3
|
+
export type TrackRefContext = ShallowRef<TrackReferenceOrPlaceholder>;
|
|
4
|
+
declare const useProvideTrackRefContext: (ref: TrackReferenceOrPlaceholder) => TrackRefContext, useTrackRefContextRaw: () => TrackRefContext | undefined;
|
|
5
|
+
export { useProvideTrackRefContext, useTrackRefContextRaw };
|
|
6
|
+
export declare function useMaybeTrackRefContext(): TrackRefContext | undefined;
|
|
7
|
+
export declare function useTrackRefContext(): TrackRefContext;
|
|
8
|
+
export declare function useEnsureTrackRef(trackRef?: TrackReferenceOrPlaceholder): TrackRefContext;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TrackReferenceOrPlaceholder } from '@livekit/components-core';
|
|
2
|
+
import { ShallowRef } from 'vue';
|
|
3
|
+
export type TrackRefContext = ShallowRef<TrackReferenceOrPlaceholder>;
|
|
4
|
+
declare const useProvideTrackRefContext: (ref: TrackReferenceOrPlaceholder) => TrackRefContext, useTrackRefContextRaw: () => TrackRefContext | undefined;
|
|
5
|
+
export { useProvideTrackRefContext, useTrackRefContextRaw };
|
|
6
|
+
export declare function useMaybeTrackRefContext(): TrackRefContext | undefined;
|
|
7
|
+
export declare function useTrackRefContext(): TrackRefContext;
|
|
8
|
+
export declare function useEnsureTrackRef(trackRef?: TrackReferenceOrPlaceholder): TrackRefContext;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { WidgetState } from '@livekit/components-core';
|
|
2
|
+
import { ShallowRef } from 'vue';
|
|
3
|
+
export interface WidgetMessageAction {
|
|
4
|
+
readonly msg: 'show_chat' | 'hide_chat' | 'toggle_chat' | 'toggle_settings';
|
|
5
|
+
}
|
|
6
|
+
export interface UnreadMessagesAction {
|
|
7
|
+
readonly msg: 'unread_msg';
|
|
8
|
+
readonly count: number;
|
|
9
|
+
}
|
|
10
|
+
export type WidgetContextAction = WidgetMessageAction | UnreadMessagesAction;
|
|
11
|
+
export interface WidgetContext {
|
|
12
|
+
readonly state: ShallowRef<WidgetState>;
|
|
13
|
+
readonly dispatch: (action: WidgetContextAction) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function widgetReducer(state: WidgetState, action: WidgetContextAction): WidgetState;
|
|
16
|
+
export declare function createWidgetContext(initialValue?: WidgetState): WidgetContext;
|
|
17
|
+
declare const useProvideWidgetContext: (initialValue?: WidgetState | undefined) => WidgetContext;
|
|
18
|
+
export { useProvideWidgetContext };
|
|
19
|
+
export declare function useWidgetContext(): WidgetContext;
|
|
20
|
+
export declare function useMaybeWidgetContext(): WidgetContext | undefined;
|
|
21
|
+
export declare function useEnsureWidgetContext(widgetContext?: WidgetContext): WidgetContext;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { WidgetState } from '@livekit/components-core';
|
|
2
|
+
import { ShallowRef } from 'vue';
|
|
3
|
+
export interface WidgetMessageAction {
|
|
4
|
+
readonly msg: 'show_chat' | 'hide_chat' | 'toggle_chat' | 'toggle_settings';
|
|
5
|
+
}
|
|
6
|
+
export interface UnreadMessagesAction {
|
|
7
|
+
readonly msg: 'unread_msg';
|
|
8
|
+
readonly count: number;
|
|
9
|
+
}
|
|
10
|
+
export type WidgetContextAction = WidgetMessageAction | UnreadMessagesAction;
|
|
11
|
+
export interface WidgetContext {
|
|
12
|
+
readonly state: ShallowRef<WidgetState>;
|
|
13
|
+
readonly dispatch: (action: WidgetContextAction) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function widgetReducer(state: WidgetState, action: WidgetContextAction): WidgetState;
|
|
16
|
+
export declare function createWidgetContext(initialValue?: WidgetState): WidgetContext;
|
|
17
|
+
declare const useProvideWidgetContext: (initialValue?: WidgetState | undefined) => WidgetContext;
|
|
18
|
+
export { useProvideWidgetContext };
|
|
19
|
+
export declare function useWidgetContext(): WidgetContext;
|
|
20
|
+
export declare function useMaybeWidgetContext(): WidgetContext | undefined;
|
|
21
|
+
export declare function useEnsureWidgetContext(widgetContext?: WidgetContext): WidgetContext;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './components/index.cjs';
|
|
2
|
+
export * from './composables/index.cjs';
|
|
3
|
+
export * from './context/index.cjs';
|
|
4
|
+
export type * from './types/index.cjs';
|
|
5
|
+
export { isTrackReference, setLogExtension, setLogLevel } from '@livekit/components-core';
|
|
6
|
+
export type { ChatMessage, GridLayoutDefinition, LocalUserChoices, ParticipantClickEvent, ParticipantIdentifier, PinState, ReceivedAgentTranscriptionMessage, ReceivedChatMessage, ReceivedMessage, ReceivedUserTranscriptionMessage, SetMediaDeviceOptions, TextStreamData, TrackReference, TrackReferenceOrPlaceholder, WidgetState, } from '@livekit/components-core';
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './components/index.mjs';
|
|
2
|
+
export * from './composables/index.mjs';
|
|
3
|
+
export * from './context/index.mjs';
|
|
4
|
+
export type * from './types/index.mjs';
|
|
5
|
+
export { isTrackReference, setLogExtension, setLogLevel } from '@livekit/components-core';
|
|
6
|
+
export type { ChatMessage, GridLayoutDefinition, LocalUserChoices, ParticipantClickEvent, ParticipantIdentifier, PinState, ReceivedAgentTranscriptionMessage, ReceivedChatMessage, ReceivedMessage, ReceivedUserTranscriptionMessage, SetMediaDeviceOptions, TextStreamData, TrackReference, TrackReferenceOrPlaceholder, WidgetState, } from '@livekit/components-core';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type Listener = (...args: never[]) => void;
|
|
2
|
+
export type EventMap<Events> = {
|
|
3
|
+
readonly [K in keyof Events]: Listener;
|
|
4
|
+
};
|
|
5
|
+
export declare class TypedEmitter<Events extends EventMap<Events>> {
|
|
6
|
+
readonly events?: Events;
|
|
7
|
+
private readonly listeners;
|
|
8
|
+
private readonly onceListeners;
|
|
9
|
+
on<E extends keyof Events>(event: E, listener: Events[E]): this;
|
|
10
|
+
off<E extends keyof Events>(event: E, listener: Events[E]): this;
|
|
11
|
+
once<E extends keyof Events>(event: E, listener: Events[E]): this;
|
|
12
|
+
emit<E extends keyof Events>(event: E, ...args: Parameters<Events[E]>): boolean;
|
|
13
|
+
removeAllListeners(event?: keyof Events): this;
|
|
14
|
+
}
|
|
15
|
+
export declare function waitForValue<T, U extends T>(subscribe: (listener: (value: T) => void) => () => void, accept: (value: T) => value is U, abortMessage: string, signal?: AbortSignal): Promise<U>;
|
|
16
|
+
export declare function waitForValue<T>(subscribe: (listener: (value: T) => void) => () => void, accept: (value: T) => boolean, abortMessage: string, signal?: AbortSignal): Promise<T>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type Listener = (...args: never[]) => void;
|
|
2
|
+
export type EventMap<Events> = {
|
|
3
|
+
readonly [K in keyof Events]: Listener;
|
|
4
|
+
};
|
|
5
|
+
export declare class TypedEmitter<Events extends EventMap<Events>> {
|
|
6
|
+
readonly events?: Events;
|
|
7
|
+
private readonly listeners;
|
|
8
|
+
private readonly onceListeners;
|
|
9
|
+
on<E extends keyof Events>(event: E, listener: Events[E]): this;
|
|
10
|
+
off<E extends keyof Events>(event: E, listener: Events[E]): this;
|
|
11
|
+
once<E extends keyof Events>(event: E, listener: Events[E]): this;
|
|
12
|
+
emit<E extends keyof Events>(event: E, ...args: Parameters<Events[E]>): boolean;
|
|
13
|
+
removeAllListeners(event?: keyof Events): this;
|
|
14
|
+
}
|
|
15
|
+
export declare function waitForValue<T, U extends T>(subscribe: (listener: (value: T) => void) => () => void, accept: (value: T) => value is U, abortMessage: string, signal?: AbortSignal): Promise<U>;
|
|
16
|
+
export declare function waitForValue<T>(subscribe: (listener: (value: T) => void) => () => void, accept: (value: T) => boolean, abortMessage: string, signal?: AbortSignal): Promise<T>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Participant } from 'livekit-client';
|
|
2
|
+
import { ShallowRef } from 'vue';
|
|
3
|
+
import { ParticipantPermission } from '../types/participant.types.cjs';
|
|
4
|
+
export declare function usePermissionsOf(participant: () => Participant): ShallowRef<ParticipantPermission | undefined>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Participant } from 'livekit-client';
|
|
2
|
+
import { ShallowRef } from 'vue';
|
|
3
|
+
import { ParticipantPermission } from '../types/participant.types.mjs';
|
|
4
|
+
export declare function usePermissionsOf(participant: () => Participant): ShallowRef<ParticipantPermission | undefined>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isBrowser(): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isBrowser(): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useKrispNoiseFilter, type UseKrispNoiseFilter, type UseKrispNoiseFilterProps, } from '../composables/useKrispNoiseFilter.cjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useKrispNoiseFilter, type UseKrispNoiseFilter, type UseKrispNoiseFilterProps, } from '../composables/useKrispNoiseFilter.mjs';
|
package/dist/krisp.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@livekit/components-core"),t=require("livekit-client"),n=require("vue");const r=require("./useLocalParticipant-Dn5NE_KM.cjs");var i=`livekit-noise-filter`;function a(e){return e.name===i&&`setEnabled`in e}exports.useKrispNoiseFilter=function(i={}){let{microphoneTrack:o}=r.t({room:i.room}),s=(0,n.ref)(!1),c=(0,n.ref)(!1),l=(0,n.ref)(!1),u=(0,n.shallowRef)(),d=(0,n.computed)(()=>{let e=((0,n.toValue)(i.trackRef)?.publication??o.value)?.track;return e instanceof t.LocalAudioTrack?e:void 0});function f(e){l.value=e,c.value=!1}function p(t,n){c.value=!0,t.setEnabled(n).then(()=>{f(n)}).catch(n=>{e.log.error(`Krisp hook: error toggling filter`,n),f(t.isEnabled())})}function m(t,n){c.value=!0,t.setProcessor(n).then(()=>n.setEnabled(!0)).then(()=>{f(!0)}).catch(t=>{e.log.error(`Krisp hook: error enabling filter`,t),f(!1)})}function h(){let e=d.value,t=u.value;if(e===void 0||t===void 0)return;let n=e.getProcessor();n!==void 0&&a(n)?p(n,s.value):n===void 0&&s.value?m(e,t):c.value=!1}async function g(t){if(t){let{KrispNoiseFilter:t,isKrispNoiseFilterSupported:n}=await import(`@livekit/krisp-noise-filter`);if(!n()){e.log.warn(`LiveKit-Krisp noise filter is not supported in this browser`);return}u.value??=t(i.filterOptions)}s.value!==t&&(c.value=!0),s.value=t}return(0,n.watch)([s,d,u],h),{setNoiseFilterEnabled:g,isNoiseFilterEnabled:l,isNoiseFilterPending:c,processor:u}};
|
|
2
|
+
//# sourceMappingURL=krisp.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"krisp.cjs","names":["useLocalParticipant","ref","shallowRef","computed","toValue","LocalAudioTrack","log","watch","_livekit_components_core","livekit_client","vue","require_useLocalParticipant","KRISP_PROCESSOR_NAME","isKrispProcessor","processor","props","microphoneTrack","shouldEnable","isNoiseFilterPending","isNoiseFilterEnabled","microphoneAudioTrack","track","settle","enabled","toggleAttached","current","enable","error","attach","krisp","apply","setNoiseFilterEnabled","KrispNoiseFilter","isKrispNoiseFilterSupported"],"sources":["../src/composables/useKrispNoiseFilter.ts"],"sourcesContent":["import { log, type TrackReferenceOrPlaceholder } from '@livekit/components-core';\nimport type { KrispNoiseFilterProcessor, NoiseFilterOptions } from '@livekit/krisp-noise-filter';\nimport { LocalAudioTrack, type Room, type TrackProcessor } from 'livekit-client';\nimport {\n\tcomputed,\n\tref,\n\tshallowRef,\n\ttoValue,\n\twatch,\n\ttype MaybeRefOrGetter,\n\ttype Ref,\n\ttype ShallowRef,\n} from 'vue';\n\nimport { useLocalParticipant } from './useLocalParticipant';\n\nexport interface UseKrispNoiseFilterProps {\n\treadonly room?: Room;\n\treadonly trackRef?: MaybeRefOrGetter<TrackReferenceOrPlaceholder | undefined>;\n\treadonly filterOptions?: NoiseFilterOptions;\n}\n\nexport interface UseKrispNoiseFilter {\n\treadonly setNoiseFilterEnabled: (enable: boolean) => Promise<void>;\n\treadonly isNoiseFilterEnabled: Readonly<Ref<boolean>>;\n\treadonly isNoiseFilterPending: Readonly<Ref<boolean>>;\n\treadonly processor: Readonly<ShallowRef<KrispNoiseFilterProcessor | undefined>>;\n}\n\nconst KRISP_PROCESSOR_NAME = 'livekit-noise-filter';\n\nfunction isKrispProcessor(\n\tprocessor: TrackProcessor<LocalAudioTrack['kind']> | KrispNoiseFilterProcessor,\n): processor is KrispNoiseFilterProcessor {\n\treturn processor.name === KRISP_PROCESSOR_NAME && 'setEnabled' in processor;\n}\n\nexport function useKrispNoiseFilter(props: UseKrispNoiseFilterProps = {}): UseKrispNoiseFilter {\n\tconst { microphoneTrack } = useLocalParticipant({ room: props.room });\n\n\tconst shouldEnable = ref<boolean>(false);\n\tconst isNoiseFilterPending = ref<boolean>(false);\n\tconst isNoiseFilterEnabled = ref<boolean>(false);\n\tconst processor = shallowRef<KrispNoiseFilterProcessor | undefined>();\n\n\tconst microphoneAudioTrack = computed<LocalAudioTrack | undefined>(() => {\n\t\tconst publication = toValue(props.trackRef)?.publication ?? microphoneTrack.value;\n\t\tconst track = publication?.track;\n\n\t\treturn track instanceof LocalAudioTrack ? track : undefined;\n\t});\n\n\tfunction settle(enabled: boolean): void {\n\t\tisNoiseFilterEnabled.value = enabled;\n\t\tisNoiseFilterPending.value = false;\n\t}\n\n\tfunction toggleAttached(current: KrispNoiseFilterProcessor, enable: boolean): void {\n\t\tisNoiseFilterPending.value = true;\n\n\t\tcurrent\n\t\t\t.setEnabled(enable)\n\t\t\t.then(() => {\n\t\t\t\tsettle(enable);\n\t\t\t})\n\t\t\t.catch((error: unknown) => {\n\t\t\t\tlog.error('Krisp hook: error toggling filter', error);\n\t\t\t\tsettle(current.isEnabled());\n\t\t\t});\n\t}\n\n\tfunction attach(track: LocalAudioTrack, krisp: KrispNoiseFilterProcessor): void {\n\t\tisNoiseFilterPending.value = true;\n\n\t\ttrack\n\t\t\t.setProcessor(krisp)\n\t\t\t.then(() => krisp.setEnabled(true))\n\t\t\t.then(() => {\n\t\t\t\tsettle(true);\n\t\t\t})\n\t\t\t.catch((error: unknown) => {\n\t\t\t\tlog.error('Krisp hook: error enabling filter', error);\n\t\t\t\tsettle(false);\n\t\t\t});\n\t}\n\n\tfunction apply(): void {\n\t\tconst track = microphoneAudioTrack.value;\n\t\tconst krisp = processor.value;\n\n\t\tif (track === undefined || krisp === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst current = track.getProcessor();\n\n\t\tif (current !== undefined && isKrispProcessor(current)) {\n\t\t\ttoggleAttached(current, shouldEnable.value);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (current === undefined && shouldEnable.value) {\n\t\t\tattach(track, krisp);\n\n\t\t\treturn;\n\t\t}\n\n\t\tisNoiseFilterPending.value = false;\n\t}\n\n\tasync function setNoiseFilterEnabled(enable: boolean): Promise<void> {\n\t\tif (enable) {\n\t\t\tconst { KrispNoiseFilter, isKrispNoiseFilterSupported } =\n\t\t\t\tawait import('@livekit/krisp-noise-filter');\n\n\t\t\tif (!isKrispNoiseFilterSupported()) {\n\t\t\t\tlog.warn('LiveKit-Krisp noise filter is not supported in this browser');\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tprocessor.value ??= KrispNoiseFilter(props.filterOptions);\n\t\t}\n\n\t\tif (shouldEnable.value !== enable) {\n\t\t\tisNoiseFilterPending.value = true;\n\t\t}\n\n\t\tshouldEnable.value = enable;\n\t}\n\n\twatch([shouldEnable, microphoneAudioTrack, processor], apply);\n\n\tconst noiseFilter: UseKrispNoiseFilter = {\n\t\tsetNoiseFilterEnabled,\n\t\tisNoiseFilterEnabled,\n\t\tisNoiseFilterPending,\n\t\tprocessor,\n\t};\n\n\treturn noiseFilter;\n}\n"],"mappings":"A,gNA6BA,IAAMY,EAAuB,uBAE7B,SAASC,EACRC,EACyC,CACzC,OAAOA,EAAU,OAASF,GAAwB,eAAgBE,CACnE,C,4BAEA,SAAoCC,EAAkC,CAAC,EAAwB,CAC9F,GAAM,CAAEC,mBAAoBhB,EAAAA,EAAoB,CAAE,KAAMe,EAAM,IAAK,CAAC,EAE9DE,GAAA,EAAehB,EAAAA,IAAAA,CAAa,EAAK,EACjCiB,GAAA,EAAuBjB,EAAAA,IAAAA,CAAa,EAAK,EACzCkB,GAAA,EAAuBlB,EAAAA,IAAAA,CAAa,EAAK,EACzCa,GAAA,EAAYZ,EAAAA,WAAAA,CAAkD,EAE9DkB,GAAA,EAAuBjB,EAAAA,SAAAA,KAA4C,CAExE,IAAMkB,IAAA,EADcjB,EAAAA,QAAAA,CAAQW,EAAM,QAAQ,CAAC,EAAE,aAAeC,EAAgB,MAAA,EACjD,MAE3B,OAAOK,aAAiBhB,EAAAA,gBAAkBgB,EAAQ,IAAA,EACnD,CAAC,EAED,SAASC,EAAOC,EAAwB,CACvCJ,EAAqB,MAAQI,EAC7BL,EAAqB,MAAQ,EAC9B,CAEA,SAASM,EAAeC,EAAoCC,EAAuB,CAClFR,EAAqB,MAAQ,GAE7BO,EACE,WAAWC,CAAM,CAAC,CAClB,SAAW,CACXJ,EAAOI,CAAM,CACd,CAAC,CAAC,CACD,MAAOC,GAAmB,CAC1BrB,EAAAA,IAAI,MAAM,oCAAqCqB,CAAK,EACpDL,EAAOG,EAAQ,UAAU,CAAC,CAC3B,CAAC,CACH,CAEA,SAASG,EAAOP,EAAwBQ,EAAwC,CAC/EX,EAAqB,MAAQ,GAE7BG,EACE,aAAaQ,CAAK,CAAC,CACnB,SAAWA,EAAM,WAAW,EAAI,CAAC,CAAC,CAClC,SAAW,CACXP,EAAO,EAAI,CACZ,CAAC,CAAC,CACD,MAAOK,GAAmB,CAC1BrB,EAAAA,IAAI,MAAM,oCAAqCqB,CAAK,EACpDL,EAAO,EAAK,CACb,CAAC,CACH,CAEA,SAASQ,GAAc,CACtB,IAAMT,EAAQD,EAAqB,MAC7BS,EAAQf,EAAU,MAExB,GAAIO,IAAU,IAAA,IAAaQ,IAAU,IAAA,GACpC,OAGD,IAAMJ,EAAUJ,EAAM,aAAa,EAE/BI,IAAY,IAAA,IAAaZ,EAAiBY,CAAO,EACpDD,EAAeC,EAASR,EAAa,KAAK,EAKvCQ,IAAY,IAAA,IAAaR,EAAa,MACzCW,EAAOP,EAAOQ,CAAK,EAKpBX,EAAqB,MAAQ,EAC9B,CAEA,eAAea,EAAsBL,EAAgC,CACpE,GAAIA,EAAQ,CACX,GAAM,CAAEM,mBAAkBC,+BACzB,MAAM,OAAO,+BAEd,GAAI,CAACA,EAA4B,EAAG,CACnC3B,EAAAA,IAAI,KAAK,6DAA6D,EAEtE,MACD,CAEAQ,EAAU,QAAUkB,EAAiBjB,EAAM,aAAa,CACzD,CAEIE,EAAa,QAAUS,IAC1BR,EAAqB,MAAQ,IAG9BD,EAAa,MAAQS,CACtB,CAWA,OATAnB,EAAAA,EAAAA,MAAAA,CAAM,CAACU,EAAcG,EAAsBN,CAAS,EAAGgB,CAAK,EASrD,CANNC,wBACAZ,uBACAD,uBACAJ,WAGM,CACR"}
|
package/dist/krisp.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { log as e } from "@livekit/components-core";
|
|
2
|
+
import { LocalAudioTrack as t } from "livekit-client";
|
|
3
|
+
import { computed as n, ref as r, shallowRef as i, toValue as a, watch as o } from "vue";
|
|
4
|
+
import { t as s } from "./useLocalParticipant-ByBAgL8i.js";
|
|
5
|
+
// src/composables/useKrispNoiseFilter.ts
|
|
6
|
+
var c = "livekit-noise-filter";
|
|
7
|
+
function l(e) {
|
|
8
|
+
return e.name === c && "setEnabled" in e;
|
|
9
|
+
}
|
|
10
|
+
function u(c = {}) {
|
|
11
|
+
let { microphoneTrack: u } = s({ room: c.room }), d = r(!1), f = r(!1), p = r(!1), m = i(), h = n(() => {
|
|
12
|
+
let e = (a(c.trackRef)?.publication ?? u.value)?.track;
|
|
13
|
+
return e instanceof t ? e : void 0;
|
|
14
|
+
});
|
|
15
|
+
function g(e) {
|
|
16
|
+
p.value = e, f.value = !1;
|
|
17
|
+
}
|
|
18
|
+
function _(t, n) {
|
|
19
|
+
f.value = !0, t.setEnabled(n).then(() => {
|
|
20
|
+
g(n);
|
|
21
|
+
}).catch((n) => {
|
|
22
|
+
e.error("Krisp hook: error toggling filter", n), g(t.isEnabled());
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function v(t, n) {
|
|
26
|
+
f.value = !0, t.setProcessor(n).then(() => n.setEnabled(!0)).then(() => {
|
|
27
|
+
g(!0);
|
|
28
|
+
}).catch((t) => {
|
|
29
|
+
e.error("Krisp hook: error enabling filter", t), g(!1);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function y() {
|
|
33
|
+
let e = h.value, t = m.value;
|
|
34
|
+
if (e === void 0 || t === void 0) return;
|
|
35
|
+
let n = e.getProcessor();
|
|
36
|
+
n !== void 0 && l(n) ? _(n, d.value) : n === void 0 && d.value ? v(e, t) : f.value = !1;
|
|
37
|
+
}
|
|
38
|
+
async function b(t) {
|
|
39
|
+
if (t) {
|
|
40
|
+
let { KrispNoiseFilter: t, isKrispNoiseFilterSupported: n } = await import("@livekit/krisp-noise-filter");
|
|
41
|
+
if (!n()) {
|
|
42
|
+
e.warn("LiveKit-Krisp noise filter is not supported in this browser");
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
m.value ??= t(c.filterOptions);
|
|
46
|
+
}
|
|
47
|
+
d.value !== t && (f.value = !0), d.value = t;
|
|
48
|
+
}
|
|
49
|
+
return o([
|
|
50
|
+
d,
|
|
51
|
+
h,
|
|
52
|
+
m
|
|
53
|
+
], y), {
|
|
54
|
+
setNoiseFilterEnabled: b,
|
|
55
|
+
isNoiseFilterEnabled: p,
|
|
56
|
+
isNoiseFilterPending: f,
|
|
57
|
+
processor: m
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export { u as useKrispNoiseFilter };
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=krisp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"krisp.js","names":["log","LocalAudioTrack","computed","ref","shallowRef","toValue","watch","useLocalParticipant","KRISP_PROCESSOR_NAME","isKrispProcessor","processor","useKrispNoiseFilter","props","microphoneTrack","shouldEnable","isNoiseFilterPending","isNoiseFilterEnabled","microphoneAudioTrack","track","settle","enabled","toggleAttached","current","enable","error","attach","krisp","apply","setNoiseFilterEnabled","KrispNoiseFilter","isKrispNoiseFilterSupported"],"sources":["../src/composables/useKrispNoiseFilter.ts"],"sourcesContent":["import { log, type TrackReferenceOrPlaceholder } from '@livekit/components-core';\nimport type { KrispNoiseFilterProcessor, NoiseFilterOptions } from '@livekit/krisp-noise-filter';\nimport { LocalAudioTrack, type Room, type TrackProcessor } from 'livekit-client';\nimport {\n\tcomputed,\n\tref,\n\tshallowRef,\n\ttoValue,\n\twatch,\n\ttype MaybeRefOrGetter,\n\ttype Ref,\n\ttype ShallowRef,\n} from 'vue';\n\nimport { useLocalParticipant } from './useLocalParticipant';\n\nexport interface UseKrispNoiseFilterProps {\n\treadonly room?: Room;\n\treadonly trackRef?: MaybeRefOrGetter<TrackReferenceOrPlaceholder | undefined>;\n\treadonly filterOptions?: NoiseFilterOptions;\n}\n\nexport interface UseKrispNoiseFilter {\n\treadonly setNoiseFilterEnabled: (enable: boolean) => Promise<void>;\n\treadonly isNoiseFilterEnabled: Readonly<Ref<boolean>>;\n\treadonly isNoiseFilterPending: Readonly<Ref<boolean>>;\n\treadonly processor: Readonly<ShallowRef<KrispNoiseFilterProcessor | undefined>>;\n}\n\nconst KRISP_PROCESSOR_NAME = 'livekit-noise-filter';\n\nfunction isKrispProcessor(\n\tprocessor: TrackProcessor<LocalAudioTrack['kind']> | KrispNoiseFilterProcessor,\n): processor is KrispNoiseFilterProcessor {\n\treturn processor.name === KRISP_PROCESSOR_NAME && 'setEnabled' in processor;\n}\n\nexport function useKrispNoiseFilter(props: UseKrispNoiseFilterProps = {}): UseKrispNoiseFilter {\n\tconst { microphoneTrack } = useLocalParticipant({ room: props.room });\n\n\tconst shouldEnable = ref<boolean>(false);\n\tconst isNoiseFilterPending = ref<boolean>(false);\n\tconst isNoiseFilterEnabled = ref<boolean>(false);\n\tconst processor = shallowRef<KrispNoiseFilterProcessor | undefined>();\n\n\tconst microphoneAudioTrack = computed<LocalAudioTrack | undefined>(() => {\n\t\tconst publication = toValue(props.trackRef)?.publication ?? microphoneTrack.value;\n\t\tconst track = publication?.track;\n\n\t\treturn track instanceof LocalAudioTrack ? track : undefined;\n\t});\n\n\tfunction settle(enabled: boolean): void {\n\t\tisNoiseFilterEnabled.value = enabled;\n\t\tisNoiseFilterPending.value = false;\n\t}\n\n\tfunction toggleAttached(current: KrispNoiseFilterProcessor, enable: boolean): void {\n\t\tisNoiseFilterPending.value = true;\n\n\t\tcurrent\n\t\t\t.setEnabled(enable)\n\t\t\t.then(() => {\n\t\t\t\tsettle(enable);\n\t\t\t})\n\t\t\t.catch((error: unknown) => {\n\t\t\t\tlog.error('Krisp hook: error toggling filter', error);\n\t\t\t\tsettle(current.isEnabled());\n\t\t\t});\n\t}\n\n\tfunction attach(track: LocalAudioTrack, krisp: KrispNoiseFilterProcessor): void {\n\t\tisNoiseFilterPending.value = true;\n\n\t\ttrack\n\t\t\t.setProcessor(krisp)\n\t\t\t.then(() => krisp.setEnabled(true))\n\t\t\t.then(() => {\n\t\t\t\tsettle(true);\n\t\t\t})\n\t\t\t.catch((error: unknown) => {\n\t\t\t\tlog.error('Krisp hook: error enabling filter', error);\n\t\t\t\tsettle(false);\n\t\t\t});\n\t}\n\n\tfunction apply(): void {\n\t\tconst track = microphoneAudioTrack.value;\n\t\tconst krisp = processor.value;\n\n\t\tif (track === undefined || krisp === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst current = track.getProcessor();\n\n\t\tif (current !== undefined && isKrispProcessor(current)) {\n\t\t\ttoggleAttached(current, shouldEnable.value);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (current === undefined && shouldEnable.value) {\n\t\t\tattach(track, krisp);\n\n\t\t\treturn;\n\t\t}\n\n\t\tisNoiseFilterPending.value = false;\n\t}\n\n\tasync function setNoiseFilterEnabled(enable: boolean): Promise<void> {\n\t\tif (enable) {\n\t\t\tconst { KrispNoiseFilter, isKrispNoiseFilterSupported } =\n\t\t\t\tawait import('@livekit/krisp-noise-filter');\n\n\t\t\tif (!isKrispNoiseFilterSupported()) {\n\t\t\t\tlog.warn('LiveKit-Krisp noise filter is not supported in this browser');\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tprocessor.value ??= KrispNoiseFilter(props.filterOptions);\n\t\t}\n\n\t\tif (shouldEnable.value !== enable) {\n\t\t\tisNoiseFilterPending.value = true;\n\t\t}\n\n\t\tshouldEnable.value = enable;\n\t}\n\n\twatch([shouldEnable, microphoneAudioTrack, processor], apply);\n\n\tconst noiseFilter: UseKrispNoiseFilter = {\n\t\tsetNoiseFilterEnabled,\n\t\tisNoiseFilterEnabled,\n\t\tisNoiseFilterPending,\n\t\tprocessor,\n\t};\n\n\treturn noiseFilter;\n}\n"],"mappings":";;;;;AA6BA,IAAMQ,IAAuB;AAE7B,SAASC,EACRC,GACyC;CACzC,OAAOA,EAAU,SAASF,KAAwB,gBAAgBE;AACnE;AAEA,SAAgBC,EAAoBC,IAAkC,CAAC,GAAwB;CAC9F,IAAM,EAAEC,uBAAoBN,EAAoB,EAAE,MAAMK,EAAM,KAAK,CAAC,GAE9DE,IAAeX,EAAa,EAAK,GACjCY,IAAuBZ,EAAa,EAAK,GACzCa,IAAuBb,EAAa,EAAK,GACzCO,IAAYN,EAAkD,GAE9Da,IAAuBf,QAA4C;EAExE,IAAMgB,KADcb,EAAQO,EAAM,QAAQ,CAAC,EAAE,eAAeC,EAAgB,MAAA,EACjD;EAE3B,OAAOK,aAAiBjB,IAAkBiB,IAAQ,KAAA;CACnD,CAAC;CAED,SAASC,EAAOC,GAAwB;EACvCJ,EAAqB,QAAQI,GAC7BL,EAAqB,QAAQ;CAC9B;CAEA,SAASM,EAAeC,GAAoCC,GAAuB;EAClFR,EAAqB,QAAQ,IAE7BO,EACE,WAAWC,CAAM,CAAC,CAClB,WAAW;GACXJ,EAAOI,CAAM;EACd,CAAC,CAAC,CACD,OAAOC,MAAmB;GAC1BxB,EAAI,MAAM,qCAAqCwB,CAAK,GACpDL,EAAOG,EAAQ,UAAU,CAAC;EAC3B,CAAC;CACH;CAEA,SAASG,EAAOP,GAAwBQ,GAAwC;EAC/EX,EAAqB,QAAQ,IAE7BG,EACE,aAAaQ,CAAK,CAAC,CACnB,WAAWA,EAAM,WAAW,EAAI,CAAC,CAAC,CAClC,WAAW;GACXP,EAAO,EAAI;EACZ,CAAC,CAAC,CACD,OAAOK,MAAmB;GAC1BxB,EAAI,MAAM,qCAAqCwB,CAAK,GACpDL,EAAO,EAAK;EACb,CAAC;CACH;CAEA,SAASQ,IAAc;EACtB,IAAMT,IAAQD,EAAqB,OAC7BS,IAAQhB,EAAU;EAExB,IAAIQ,MAAU,KAAA,KAAaQ,MAAU,KAAA,GACpC;EAGD,IAAMJ,IAAUJ,EAAM,aAAa;EAE/BI,MAAY,KAAA,KAAab,EAAiBa,CAAO,IACpDD,EAAeC,GAASR,EAAa,KAAK,IAKvCQ,MAAY,KAAA,KAAaR,EAAa,QACzCW,EAAOP,GAAOQ,CAAK,IAKpBX,EAAqB,QAAQ;CAC9B;CAEA,eAAea,EAAsBL,GAAgC;EACpE,IAAIA,GAAQ;GACX,IAAM,EAAEM,qBAAkBC,mCACzB,MAAM,OAAO;GAEd,IAAI,CAACA,EAA4B,GAAG;IACnC9B,EAAI,KAAK,6DAA6D;IAEtE;GACD;GAEAU,EAAU,UAAUmB,EAAiBjB,EAAM,aAAa;EACzD;EAEIE,EAAa,UAAUS,MAC1BR,EAAqB,QAAQ,KAG9BD,EAAa,QAAQS;CACtB;CAWA,OATAjB,EAAM;EAACQ;EAAcG;EAAsBP;CAAS,GAAGiB,CAAK,GASrD;EANNC;EACAZ;EACAD;EACAL;CAGM;AACR"}
|