@fraku/video 0.1.19 → 0.1.21

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.
@@ -1,6 +1,3 @@
1
- import { Participant } from '@zoom/videosdk';
2
1
  import { default as permissions } from '../config/permissions';
3
- import { User } from '../types/permissions';
4
2
 
5
- export declare const usePermissions: () => (permission: keyof typeof permissions) => boolean | undefined;
6
- export declare const createUser: (p: Participant, signature: string) => User;
3
+ export declare const usePermissions: () => (permission: keyof typeof permissions) => boolean;
@@ -1,6 +1,10 @@
1
+ import { MutableRefObject } from 'react';
2
+
1
3
  type PageContextType = {
2
4
  openTabs: number[];
3
5
  handleOpenCloseTab: (tabIdx: number) => void;
6
+ selfShareViewRef: MutableRefObject<HTMLVideoElement | null>;
4
7
  };
5
8
  export declare const PageContext: import('react').Context<PageContextType>;
9
+ export declare const useMainPageContext: () => PageContextType;
6
10
  export {};
@@ -12,11 +12,7 @@ export type AudioContextType = {
12
12
  speakerList: MediaDevice[];
13
13
  activeSpeakerId: string;
14
14
  switchSpeaker: (deviceId: string) => Promise<void>;
15
- startAudio: (options: {
16
- micId: string;
17
- speakerId: string;
18
- micMuted?: boolean;
19
- }) => Promise<void>;
15
+ startAudio: () => Promise<void>;
20
16
  setMicList: (mics: MediaDevice[]) => void;
21
17
  setSpeakerList: (speakers: MediaDevice[]) => void;
22
18
  setActiveMicId: (id: string) => void;
@@ -1,4 +1,7 @@
1
- import { DialogsProviderProps } from './types';
1
+ import { ReactNode } from 'react';
2
2
 
3
+ export type DialogsProviderProps = {
4
+ children?: ReactNode;
5
+ };
3
6
  declare const DialogsProvider: ({ children }: DialogsProviderProps) => import("react/jsx-runtime").JSX.Element;
4
7
  export default DialogsProvider;
@@ -1,4 +1,17 @@
1
- import { DialogsContextType } from './types';
1
+ import { SettingsTab } from '../../components/ConfigDialog/context';
2
2
 
3
+ export type NotifySeverity = 'info' | 'success' | 'error';
4
+ export type DialogsContextType = {
5
+ configDialogVisible: {
6
+ visible: boolean;
7
+ tab: SettingsTab;
8
+ };
9
+ toggleConfigDialog: ({ tab }: {
10
+ tab?: SettingsTab;
11
+ }) => void;
12
+ notify: (message: string, options?: {
13
+ severity?: NotifySeverity;
14
+ }) => void;
15
+ };
3
16
  export declare const DialogsContext: import('react').Context<DialogsContextType>;
4
17
  export declare const useDialogsContext: () => DialogsContextType;
@@ -1,9 +1,13 @@
1
1
  import { SharedState } from './types';
2
+ import { Participant } from '@zoom/videosdk';
2
3
 
3
4
  export type SharedContextType = {
4
5
  sharedState: SharedState;
5
6
  requestSharedState: () => Promise<void>;
7
+ speakerQueue: Participant[];
8
+ raisedHand: boolean;
6
9
  toggleHand: () => Promise<void>;
10
+ lowerUserHand: (userId: number) => Promise<void>;
7
11
  };
8
12
  export declare const SharedContext: import('react').Context<SharedContextType>;
9
13
  export declare const useSharedContext: () => SharedContextType;
@@ -1,3 +1 @@
1
- import { SharedAction, SharedState } from '../types';
2
-
3
- export declare const sharedStateReducer: (state: SharedState, action: SharedAction) => SharedState;
1
+ export { sharedStateReducer } from './reducer';
@@ -0,0 +1,3 @@
1
+ import { LowerUserHandAction, SharedState } from '../types';
2
+
3
+ export declare const lowerUserHandReducer: (state: SharedState, action: LowerUserHandAction) => SharedState;
@@ -0,0 +1,3 @@
1
+ import { SharedAction, SharedState } from '../types';
2
+
3
+ export declare const sharedStateReducer: (state: SharedState, action: SharedAction) => SharedState;
@@ -1,5 +1,3 @@
1
1
  import { SharedState, ToggleHandAction } from '../types';
2
2
 
3
- export declare const toggleHandReducer: (state: SharedState, action: ToggleHandAction) => {
4
- user: {};
5
- };
3
+ export declare const toggleHandReducer: (state: SharedState, action: ToggleHandAction) => SharedState;
@@ -1,7 +1,5 @@
1
1
  export type SharedState = {
2
- user: Record<string, {
3
- raiseHand: boolean;
4
- }>;
2
+ speakerQueueIds: number[];
5
3
  };
6
4
  export type RequestStateAction = {
7
5
  type: 'REQUEST-SHARED-STATE';
@@ -15,4 +13,8 @@ export type ToggleHandAction = {
15
13
  type: 'TOGGLE-HAND';
16
14
  senderId: number;
17
15
  };
18
- export type SharedAction = RequestStateAction | SendStateAction | ToggleHandAction;
16
+ export type LowerUserHandAction = {
17
+ type: 'LOWER-USER-HAND';
18
+ userId: number;
19
+ };
20
+ export type SharedAction = RequestStateAction | SendStateAction | ToggleHandAction | LowerUserHandAction;
@@ -1,10 +1,10 @@
1
1
  import { Participant } from '@zoom/videosdk';
2
- import { User } from '../../types/permissions';
3
2
 
4
3
  export type UsersContextType = {
5
4
  users: Participant[];
6
- currentUser: User | null;
5
+ currentUser: Participant | null;
7
6
  activeSpeaker: Participant | null;
7
+ screenSharingUser: Participant | null;
8
8
  };
9
9
  export declare const UsersContext: import('react').Context<UsersContextType>;
10
10
  export declare const useUsersContext: () => UsersContextType;
@@ -8,11 +8,20 @@ export type VideoContextType = {
8
8
  isBlurred: boolean;
9
9
  localVideoRef: MutableRefObject<HTMLVideoElement | null>;
10
10
  switchBlurred: (blurred: boolean) => Promise<void>;
11
- startVideo: (deviceId: string) => Promise<void>;
11
+ startVideo: () => Promise<void>;
12
12
  stopVideo: () => Promise<void>;
13
13
  switchCamera: (deviceId: string) => Promise<void>;
14
14
  attachUserVideo: (userId: number, videoElement: VideoPlayer) => Promise<void>;
15
15
  detachUserVideo: (userId: number) => Promise<void>;
16
+ attachSharedVideo: ({ userId, videoPlayer }: {
17
+ userId: number;
18
+ videoPlayer: VideoPlayer;
19
+ }) => Promise<void>;
20
+ detachSharedVideo: (userId: number) => Promise<void>;
21
+ startScreenSharing: (params: {
22
+ selfShareCanvas: HTMLVideoElement | null;
23
+ }) => Promise<void>;
24
+ finishScreenSharing: () => Promise<void>;
16
25
  };
17
26
  export declare const VideoContext: import('react').Context<VideoContextType>;
18
27
  export declare const useVideoContext: () => VideoContextType;
@@ -1,6 +1 @@
1
- import { Participant } from '@zoom/videosdk';
2
-
3
- export type Role = 'admin' | 'panelist' | 'voter';
4
- export type User = Participant & {
5
- role: Role;
6
- };
1
+ export type Role = 'admin' | 'panelist' | 'attendee';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fraku/video",
3
3
  "private": false,
4
- "version": "0.1.19",
4
+ "version": "0.1.21",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -74,6 +74,7 @@
74
74
  "@vitest/ui": "^4.0.13",
75
75
  "autoprefixer": "^10.4.21",
76
76
  "eslint": "^8.55.0",
77
+ "eslint-plugin-react": "^7.37.5",
77
78
  "eslint-plugin-react-hooks": "^4.6.0",
78
79
  "eslint-plugin-react-refresh": "^0.4.5",
79
80
  "eslint-plugin-storybook": "^10.1.2",
@@ -1,15 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { SettingsTab } from '../../components/ConfigDialog/context';
3
-
4
- export type DialogsContextType = {
5
- configDialogVisible: {
6
- visible: boolean;
7
- tab: SettingsTab;
8
- };
9
- toggleConfigDialog: ({ tab }: {
10
- tab?: SettingsTab;
11
- }) => void;
12
- };
13
- export type DialogsProviderProps = {
14
- children?: ReactNode;
15
- };