@fraku/video 0.1.8 → 0.1.10
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/dist/config/permissions.d.ts +2 -0
- package/dist/hooks/async.d.ts +64 -0
- package/dist/hooks/async.test.d.ts +1 -0
- package/dist/index.cjs +354 -238
- package/dist/index.css +1 -1
- package/dist/index.js +25471 -26737
- package/dist/pages/MainSessionPage/Chat/ChatFooter.d.ts +11 -0
- package/dist/pages/MainSessionPage/Chat/MessageCard.d.ts +8 -0
- package/dist/pages/MainSessionPage/Chat/MessageHeader.d.ts +8 -0
- package/dist/pages/MainSessionPage/Chat/SenderInfo.d.ts +6 -0
- package/dist/pages/MainSessionPage/Chat/tests/ChatFooter.test.d.ts +1 -0
- package/dist/pages/MainSessionPage/UserList.d.ts +8 -0
- package/dist/pages/MainSessionPage/UserVideo.d.ts +8 -0
- package/dist/providers/AudioProvider/AudioProvider.d.ts +4 -0
- package/dist/providers/AudioProvider/context.d.ts +27 -0
- package/dist/providers/AudioProvider/index.d.ts +2 -0
- package/dist/providers/AudioProvider/types.d.ts +5 -0
- package/dist/providers/ChatProvider/ChatProvider.d.ts +4 -0
- package/dist/providers/ChatProvider/context.d.ts +13 -0
- package/dist/providers/ChatProvider/index.d.ts +2 -0
- package/dist/providers/ChatProvider/types.d.ts +7 -0
- package/dist/providers/DialogsProvider/context.d.ts +1 -0
- package/dist/providers/DialogsProvider/index.d.ts +1 -1
- package/dist/providers/SessionProvider/SessionProvider.d.ts +4 -0
- package/dist/providers/SessionProvider/context.d.ts +11 -0
- package/dist/providers/SessionProvider/index.d.ts +2 -0
- package/dist/providers/SessionProvider/types.d.ts +7 -0
- package/dist/providers/UsersProvider/UsersProvider.d.ts +4 -0
- package/dist/providers/UsersProvider/context.d.ts +10 -0
- package/dist/providers/UsersProvider/index.d.ts +2 -0
- package/dist/providers/UsersProvider/types.d.ts +5 -0
- package/dist/providers/VideoPluginProvider/VideoPluginProvider.d.ts +4 -0
- package/dist/providers/VideoPluginProvider/context.d.ts +4 -0
- package/dist/providers/VideoPluginProvider/index.d.ts +2 -0
- package/dist/providers/VideoPluginProvider/types.d.ts +13 -0
- package/dist/providers/VideoProvider/VideoProvider.d.ts +4 -0
- package/dist/providers/VideoProvider/context.d.ts +16 -0
- package/dist/providers/VideoProvider/index.d.ts +2 -0
- package/dist/providers/VideoProvider/types.d.ts +5 -0
- package/dist/providers/VotingProvider/VotingProvider.d.ts +4 -0
- package/dist/providers/VotingProvider/context.d.ts +6 -0
- package/dist/providers/VotingProvider/index.d.ts +2 -0
- package/dist/providers/VotingProvider/types.d.ts +8 -0
- package/dist/test/setup.d.ts +1 -0
- package/package.json +13 -6
- package/dist/hooks/useAsyncHandler.d.ts +0 -5
- package/dist/pages/MainSessionPage/ParticipantList.d.ts +0 -8
- package/dist/pages/MainSessionPage/ParticipantVideo.d.ts +0 -8
- package/dist/providers/MediaProvider/MediaProvider.d.ts +0 -4
- package/dist/providers/MediaProvider/context.d.ts +0 -3
- package/dist/providers/MediaProvider/index.d.ts +0 -2
- package/dist/providers/MediaProvider/types.d.ts +0 -38
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ChatUserItem } from '@zoom/videosdk';
|
|
2
|
+
|
|
3
|
+
type ChatFooterProps = {
|
|
4
|
+
receivers: ChatUserItem[];
|
|
5
|
+
sendMessage: ({ text, receiverId }: {
|
|
6
|
+
text: string;
|
|
7
|
+
receiverId: number;
|
|
8
|
+
}) => void;
|
|
9
|
+
};
|
|
10
|
+
declare const ChatFooter: ({ receivers, sendMessage }: ChatFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default ChatFooter;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChatMessage } from '@zoom/videosdk';
|
|
2
|
+
|
|
3
|
+
export type MessageCardProps = {
|
|
4
|
+
chatMessage: ChatMessage;
|
|
5
|
+
currentUserId: number;
|
|
6
|
+
};
|
|
7
|
+
declare const MessageCard: ({ chatMessage, currentUserId }: MessageCardProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export default MessageCard;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type MessageHeaderProps = {
|
|
2
|
+
isCurrentUserSender: boolean;
|
|
3
|
+
isPrivate: boolean;
|
|
4
|
+
receiverName: string;
|
|
5
|
+
isPrivateToCurrentUser: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const MessageHeader: ({ isCurrentUserSender, isPrivate, receiverName, isPrivateToCurrentUser }: MessageHeaderProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export default MessageHeader;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Participant } from '@zoom/videosdk';
|
|
2
|
+
|
|
3
|
+
type ParticipantVideoProps = {
|
|
4
|
+
user: Participant;
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const ParticipantVideo: ({ user, className }: ParticipantVideoProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default ParticipantVideo;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { MediaDevice } from '@zoom/videosdk';
|
|
2
|
+
|
|
3
|
+
export type AudioContextType = {
|
|
4
|
+
micList: MediaDevice[];
|
|
5
|
+
activeMicId: string;
|
|
6
|
+
micMuted: boolean;
|
|
7
|
+
muteMic: () => Promise<void>;
|
|
8
|
+
muteUserMic: (userId: number) => Promise<void>;
|
|
9
|
+
unmuteMic: () => Promise<void>;
|
|
10
|
+
unmuteUserMic: (userId: number) => Promise<void>;
|
|
11
|
+
switchMic: (deviceId: string) => Promise<void>;
|
|
12
|
+
speakerList: MediaDevice[];
|
|
13
|
+
activeSpeakerId: string;
|
|
14
|
+
switchSpeaker: (deviceId: string) => Promise<void>;
|
|
15
|
+
startAudio: (options: {
|
|
16
|
+
micId: string;
|
|
17
|
+
speakerId: string;
|
|
18
|
+
micMuted?: boolean;
|
|
19
|
+
}) => Promise<void>;
|
|
20
|
+
setMicList: (mics: MediaDevice[]) => void;
|
|
21
|
+
setSpeakerList: (speakers: MediaDevice[]) => void;
|
|
22
|
+
setActiveMicId: (id: string) => void;
|
|
23
|
+
setActiveSpeakerId: (id: string) => void;
|
|
24
|
+
setMicMuted: (muted: boolean) => void;
|
|
25
|
+
};
|
|
26
|
+
export declare const AudioContext: import('react').Context<AudioContextType | null>;
|
|
27
|
+
export declare const useAudioContext: () => AudioContextType;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ChatMessage, ChatUserItem } from '@zoom/videosdk';
|
|
2
|
+
|
|
3
|
+
export type ChatContextType = {
|
|
4
|
+
messages: ChatMessage[];
|
|
5
|
+
receivers: ChatUserItem[];
|
|
6
|
+
sendMessage: ({ text, receiverId }: {
|
|
7
|
+
text: string;
|
|
8
|
+
receiverId: number;
|
|
9
|
+
}) => Promise<void>;
|
|
10
|
+
updateReceiversAndChatHistory: () => void;
|
|
11
|
+
};
|
|
12
|
+
export declare const ChatContext: import('react').Context<ChatContextType | null>;
|
|
13
|
+
export declare const useChatContext: () => ChatContextType;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from './DialogsProvider';
|
|
2
|
-
export { DialogsContext } from './context';
|
|
2
|
+
export { DialogsContext, useDialogsContext } from './context';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as ZoomVideo } from '@zoom/videosdk';
|
|
2
|
+
|
|
3
|
+
export type SessionContextType = {
|
|
4
|
+
zmClient: ReturnType<typeof ZoomVideo.createClient>;
|
|
5
|
+
sessionStarted: boolean;
|
|
6
|
+
signature: string;
|
|
7
|
+
joinSession: () => Promise<void>;
|
|
8
|
+
leaveSession: () => Promise<void>;
|
|
9
|
+
};
|
|
10
|
+
export declare const SessionContext: import('react').Context<SessionContextType | null>;
|
|
11
|
+
export declare const useSessionContext: () => SessionContextType;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Participant } from '@zoom/videosdk';
|
|
2
|
+
import { User } from '../../types/permissions';
|
|
3
|
+
|
|
4
|
+
export type UsersContextType = {
|
|
5
|
+
users: Participant[];
|
|
6
|
+
currentUser: User | null;
|
|
7
|
+
activeSpeaker: Participant | null;
|
|
8
|
+
};
|
|
9
|
+
export declare const UsersContext: import('react').Context<UsersContextType | null>;
|
|
10
|
+
export declare const useUsersContext: () => UsersContextType;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ChatMessage } from '@zoom/videosdk';
|
|
3
|
+
import { Credentials } from '../../types';
|
|
4
|
+
|
|
5
|
+
export type VideoPluginContextType = {};
|
|
6
|
+
export type VideoPluginProviderProps = {
|
|
7
|
+
credentials: Credentials;
|
|
8
|
+
messages?: ChatMessage[];
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
onInitVotingPreSession?: () => Promise<void>;
|
|
11
|
+
onInitVotingSession?: () => Promise<void>;
|
|
12
|
+
onCloseVotingSession?: () => Promise<void>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MediaDevice, VideoPlayer } from '@zoom/videosdk';
|
|
2
|
+
|
|
3
|
+
export type VideoContextType = {
|
|
4
|
+
cameraList: MediaDevice[];
|
|
5
|
+
activeCameraId: string;
|
|
6
|
+
videoStarted: boolean;
|
|
7
|
+
startVideo: (deviceId: string) => Promise<void>;
|
|
8
|
+
stopVideo: () => Promise<void>;
|
|
9
|
+
switchCamera: (deviceId: string) => Promise<void>;
|
|
10
|
+
attachUserVideo: (userId: number, videoElement: VideoPlayer) => Promise<void>;
|
|
11
|
+
detachUserVideo: (userId: number) => Promise<void>;
|
|
12
|
+
setCameraList: (cameras: MediaDevice[]) => void;
|
|
13
|
+
setActiveCameraId: (id: string) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare const VideoContext: import('react').Context<VideoContextType | null>;
|
|
16
|
+
export declare const useVideoContext: () => VideoContextType;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fraku/video",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.10",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "tsc && vite build",
|
|
26
|
-
"build:css": "tailwindcss -c ./tailwind.config.js -i ./
|
|
26
|
+
"build:css": "tailwindcss -c ./tailwind.config.js -i ./src/index.css -o ./dist/index.css --minify",
|
|
27
27
|
"watch:css": "tailwindcss -c ./tailwind.config.js -o ./dist/index.css --watch",
|
|
28
28
|
"lint": "npm run lint:ts && npm run lint:js",
|
|
29
29
|
"lint:ts": "tsc --noEmit",
|
|
@@ -31,16 +31,18 @@
|
|
|
31
31
|
"preview": "vite preview",
|
|
32
32
|
"prepublishOnly": "npm run build",
|
|
33
33
|
"storybook": "storybook dev -p 6006 --no-open",
|
|
34
|
-
"test": "
|
|
34
|
+
"test": "vitest",
|
|
35
|
+
"test:ui": "vitest --ui",
|
|
36
|
+
"test:coverage": "vitest --coverage",
|
|
35
37
|
"build:ci": "tsc && vite build",
|
|
36
|
-
"build:css:ci": "tailwindcss -c ./tailwind.config.js -i ./
|
|
38
|
+
"build:css:ci": "tailwindcss -c ./tailwind.config.js -i ./src/index.css -o ./dist/index.css --minify"
|
|
37
39
|
},
|
|
38
40
|
"peerDependencies": {
|
|
39
41
|
"react": "^18.2.0",
|
|
40
42
|
"react-dom": "^18.2.0"
|
|
41
43
|
},
|
|
42
44
|
"dependencies": {
|
|
43
|
-
"@zoom/videosdk": "^2.
|
|
45
|
+
"@zoom/videosdk": "^2.3.0",
|
|
44
46
|
"classnames": "^2.5.1",
|
|
45
47
|
"clsx": "^2.1.1",
|
|
46
48
|
"jsrsasign": "^11.1.0",
|
|
@@ -53,6 +55,8 @@
|
|
|
53
55
|
"devDependencies": {
|
|
54
56
|
"@storybook/react-vite": "^9.1.13",
|
|
55
57
|
"@tailwindcss/container-queries": "^0.1.1",
|
|
58
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
59
|
+
"@testing-library/react": "^16.3.0",
|
|
56
60
|
"@types/jsrsasign": "^10.5.15",
|
|
57
61
|
"@types/node": "^24.8.1",
|
|
58
62
|
"@types/react": "^18.2.43",
|
|
@@ -61,11 +65,13 @@
|
|
|
61
65
|
"@typescript-eslint/eslint-plugin": "^6.14.0",
|
|
62
66
|
"@typescript-eslint/parser": "^6.14.0",
|
|
63
67
|
"@vitejs/plugin-react": "^4.3.4",
|
|
68
|
+
"@vitest/ui": "^4.0.13",
|
|
64
69
|
"autoprefixer": "^10.4.21",
|
|
65
70
|
"eslint": "^8.55.0",
|
|
66
71
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
67
72
|
"eslint-plugin-react-refresh": "^0.4.5",
|
|
68
73
|
"eslint-plugin-storybook": "^9.1.13",
|
|
74
|
+
"jsdom": "^27.2.0",
|
|
69
75
|
"postcss": "^8.5.6",
|
|
70
76
|
"react": "^18.2.0",
|
|
71
77
|
"react-dom": "^18.2.0",
|
|
@@ -74,7 +80,8 @@
|
|
|
74
80
|
"typescript": "^5.2.2",
|
|
75
81
|
"vite": "^6.0.7",
|
|
76
82
|
"vite-plugin-dts": "^3.6.4",
|
|
77
|
-
"vite-plugin-static-copy": "^3.1.4"
|
|
83
|
+
"vite-plugin-static-copy": "^3.1.4",
|
|
84
|
+
"vitest": "^4.0.13"
|
|
78
85
|
},
|
|
79
86
|
"keywords": [
|
|
80
87
|
"react",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Participant } from '@zoom/videosdk';
|
|
2
|
-
|
|
3
|
-
type ParticipantsPanelProps = {
|
|
4
|
-
items: Participant[];
|
|
5
|
-
columnHeader: string;
|
|
6
|
-
};
|
|
7
|
-
declare const ParticipantList: ({ items, columnHeader }: ParticipantsPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export default ParticipantList;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Participant } from '@zoom/videosdk';
|
|
2
|
-
|
|
3
|
-
type ParticipantVideoProps = {
|
|
4
|
-
participant: Participant;
|
|
5
|
-
className?: string;
|
|
6
|
-
};
|
|
7
|
-
declare const ParticipantVideo: ({ participant, className }: ParticipantVideoProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export default ParticipantVideo;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { ChatMessage, MediaDevice, Participant, VideoPlayer } from '@zoom/videosdk';
|
|
3
|
-
import { Credentials } from '../../types';
|
|
4
|
-
import { User } from '../../types/permissions';
|
|
5
|
-
|
|
6
|
-
export type MediaContextType = {
|
|
7
|
-
sessionStarted: boolean;
|
|
8
|
-
videoStarted: boolean;
|
|
9
|
-
activeCameraId: string;
|
|
10
|
-
activeMicId: string;
|
|
11
|
-
activeSpeakerId: string;
|
|
12
|
-
cameraList: MediaDevice[];
|
|
13
|
-
speakerList: MediaDevice[];
|
|
14
|
-
micList: MediaDevice[];
|
|
15
|
-
joinSession: () => Promise<void>;
|
|
16
|
-
leaveSession: () => Promise<void>;
|
|
17
|
-
attachUserVideo: (userId: number, videoElement: VideoPlayer) => Promise<void>;
|
|
18
|
-
detachUserVideo: (userId: number) => Promise<void>;
|
|
19
|
-
startVideo: (deviceId: string) => Promise<void>;
|
|
20
|
-
stopVideo: () => Promise<void>;
|
|
21
|
-
switchCamera: (deviceId: string) => Promise<void>;
|
|
22
|
-
switchMicrophone: (deviceId: string) => Promise<void>;
|
|
23
|
-
switchSpeaker: (deviceId: string) => Promise<void>;
|
|
24
|
-
participants: Participant[];
|
|
25
|
-
currentUser: User | null;
|
|
26
|
-
activeSpeaker: Participant | null;
|
|
27
|
-
messages: ChatMessage[];
|
|
28
|
-
votingStarted: boolean;
|
|
29
|
-
initVotingSession?: () => Promise<void>;
|
|
30
|
-
};
|
|
31
|
-
export type MediaProviderProps = {
|
|
32
|
-
credentials: Credentials;
|
|
33
|
-
messages?: ChatMessage[];
|
|
34
|
-
children: ReactNode;
|
|
35
|
-
onInitVotingPreSession?: () => Promise<void>;
|
|
36
|
-
onInitVotingSession?: () => Promise<void>;
|
|
37
|
-
onCloseVotingSession?: () => Promise<void>;
|
|
38
|
-
};
|