@fraku/video 0.1.88 → 0.1.89

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,6 @@
1
1
  import { CommandChannelAction } from '../../shared';
2
2
 
3
- type SupportedChatFallbackActionType = 'TOGGLE-HAND' | 'LOWER-USER-HAND' | 'TOGGLE-TURN-QUEUE' | 'TOGGLE-CHAT' | 'CHANGE-SESSION-STATUS' | 'REQUEST-HOST-ROLE' | 'GRANT-PARTICIPATION' | 'REVOKE-PARTICIPATION' | 'REVOKE-VIDEO-PARTICIPATION' | 'INVITE-TO-PARTICIPATE';
3
+ type SupportedChatFallbackActionType = 'TOGGLE-HAND' | 'LOWER-USER-HAND' | 'TOGGLE-TURN-QUEUE' | 'TOGGLE-CHAT' | 'CHANGE-SESSION-STATUS' | 'REQUEST-HOST-ROLE' | 'GRANT-PARTICIPATION' | 'REVOKE-PARTICIPATION' | 'REVOKE-VIDEO-PARTICIPATION' | 'INVITE-TO-PARTICIPATE' | 'PIN-FOR-EVERYONE' | 'UNPIN-FOR-EVERYONE';
4
4
  export type SupportedChatFallbackAction = Extract<CommandChannelAction, {
5
5
  type: SupportedChatFallbackActionType;
6
6
  }>;
@@ -1,24 +1,16 @@
1
1
  import { Participant } from '@zoom/videosdk';
2
- import { SharedState } from '../../shared';
2
+ import { CHAT_STATE_DEFAULT, REQUEST_HOST_ROLE_STATE_DEFAULT, TURN_QUEUE_STATE_DEFAULT, SharedState } from '../../shared';
3
3
  import { ParticipationPermissions } from '../../shared/participation/types';
4
4
  import { SessionStatus } from '../VideoPluginProvider/context';
5
5
  import { CommandChannelStatus } from './useCommandChannelController';
6
6
 
7
- export declare const CHAT_STATE_DEFAULT: {
8
- active: boolean;
9
- timestamp: number;
10
- };
11
- export declare const TURN_QUEUE_STATE_DEFAULT: {
12
- active: boolean;
13
- timestamp: number;
14
- };
15
- export declare const REQUEST_HOST_ROLE_STATE_DEFAULT: {
16
- userId: null;
17
- timestamp: number;
18
- };
7
+ export { CHAT_STATE_DEFAULT, REQUEST_HOST_ROLE_STATE_DEFAULT, TURN_QUEUE_STATE_DEFAULT };
19
8
  export type SharedContextType = {
20
9
  sharedState: SharedState;
21
10
  requestSharedState: () => Promise<void>;
11
+ pinnedUserId: number | null;
12
+ pinForEveryone: (userId: number) => Promise<void>;
13
+ unpinForEveryone: () => Promise<void>;
22
14
  speakerQueue: Participant[];
23
15
  raisedHand: boolean;
24
16
  toggleHand: () => Promise<void>;
@@ -0,0 +1,16 @@
1
+ import { SharedState } from './types';
2
+
3
+ export declare const CHAT_STATE_DEFAULT: {
4
+ active: boolean;
5
+ timestamp: number;
6
+ };
7
+ export declare const TURN_QUEUE_STATE_DEFAULT: {
8
+ active: boolean;
9
+ timestamp: number;
10
+ };
11
+ export declare const REQUEST_HOST_ROLE_STATE_DEFAULT: {
12
+ userId: null;
13
+ timestamp: number;
14
+ };
15
+ export declare const SHARED_STATE_DEFAULT: SharedState;
16
+ export declare const normalizeSharedState: (state: SharedState) => SharedState;
@@ -1,2 +1,3 @@
1
1
  export { default } from './reducer';
2
+ export { CHAT_STATE_DEFAULT, REQUEST_HOST_ROLE_STATE_DEFAULT, SHARED_STATE_DEFAULT, TURN_QUEUE_STATE_DEFAULT, normalizeSharedState } from './defaultState';
2
3
  export type { SharedState, CommandChannelAction, SharedReducerAction } from './types';
@@ -0,0 +1,2 @@
1
+ export { default, initialPinState } from './reducer';
2
+ export type { PinAction, PinForEveryoneAction, PinState, UnpinForEveryoneAction } from './types';
@@ -0,0 +1,5 @@
1
+ import { PinAction, PinState } from './types';
2
+
3
+ export declare const initialPinState: PinState;
4
+ declare const pinReducer: (state: PinState, action: PinAction) => PinState;
5
+ export default pinReducer;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ export type PinForEveryoneAction = {
2
+ type: 'PIN-FOR-EVERYONE';
3
+ payload: {
4
+ userId: number;
5
+ };
6
+ timestamp: number;
7
+ };
8
+ export type UnpinForEveryoneAction = {
9
+ type: 'UNPIN-FOR-EVERYONE';
10
+ timestamp: number;
11
+ };
12
+ export type PinAction = PinForEveryoneAction | UnpinForEveryoneAction;
13
+ export type PinState = {
14
+ pinnedUserId: number | null;
15
+ lastActionTimestamp: number;
16
+ };
@@ -1,6 +1,7 @@
1
1
  import { SessionStatus } from '../providers/VideoPluginProvider/context';
2
2
  import { ChatAction, ChatState } from './chat';
3
3
  import { GrantParticipationAction, InviteToParticipateAction, ParticipationPermissions, RevokeParticipationAction, RevokeVideoParticipationAction } from './participation/types';
4
+ import { PinAction, PinState } from './pin';
4
5
  import { RequestHostRoleAction } from './request-host-role';
5
6
  import { SessionAction } from './session-info';
6
7
  import { SpeakerTurnAction, SpeakerTurnState } from './speaker-turn';
@@ -18,6 +19,7 @@ export type SharedState = {
18
19
  timestamp: number;
19
20
  };
20
21
  participationPermissions: ParticipationPermissions;
22
+ pinState: PinState;
21
23
  };
22
24
  export type AlertUserAction = {
23
25
  type: 'ALERT-USER';
@@ -36,6 +38,10 @@ export type ResetSharedStateAction = {
36
38
  type: 'RESET-SHARED-STATE';
37
39
  state: SharedState;
38
40
  };
41
+ export type ClearPinnedUserAction = {
42
+ type: 'CLEAR-PINNED-USER';
43
+ userId: number;
44
+ };
39
45
  export type RequestStateRecoveryAction = {
40
46
  type: 'REQUEST-STATE-RECOVERY';
41
47
  requesterUserId: number;
@@ -48,5 +54,5 @@ export type SendStateRecoveryAction = {
48
54
  responderUserId: number;
49
55
  responderRole: 'host' | 'manager' | 'attendee';
50
56
  };
51
- export type CommandChannelAction = AlertUserAction | RequestStateAction | SendStateAction | RequestStateRecoveryAction | SendStateRecoveryAction | SpeakerTurnAction | ChatAction | SessionAction | RequestHostRoleAction | GrantParticipationAction | RevokeParticipationAction | RevokeVideoParticipationAction | InviteToParticipateAction;
52
- export type SharedReducerAction = CommandChannelAction | ResetSharedStateAction;
57
+ export type CommandChannelAction = AlertUserAction | RequestStateAction | SendStateAction | RequestStateRecoveryAction | SendStateRecoveryAction | SpeakerTurnAction | ChatAction | SessionAction | RequestHostRoleAction | GrantParticipationAction | RevokeParticipationAction | RevokeVideoParticipationAction | InviteToParticipateAction | PinAction;
58
+ export type SharedReducerAction = CommandChannelAction | ResetSharedStateAction | ClearPinnedUserAction;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fraku/video",
3
3
  "private": false,
4
- "version": "0.1.88",
4
+ "version": "0.1.89",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",