2021-08-23 09:57:56 +00:00
|
|
|
import {
|
|
|
|
CLAP_SOUND_FILES,
|
|
|
|
LAUGH_SOUND_FILES,
|
|
|
|
LIKE_SOUND_FILES,
|
|
|
|
BOO_SOUND_FILES,
|
|
|
|
SURPRISE_SOUND_FILES,
|
|
|
|
SILENCE_SOUND_FILES
|
|
|
|
} from './sounds';
|
|
|
|
|
2021-12-13 13:51:05 +00:00
|
|
|
/**
|
|
|
|
* Reactions menu height on mobile web (px).
|
|
|
|
*/
|
|
|
|
export const REACTIONS_MENU_HEIGHT = 144;
|
|
|
|
|
2021-08-31 11:00:27 +00:00
|
|
|
/**
|
2021-11-04 21:10:43 +00:00
|
|
|
* The payload name for the datachannel/endpoint reaction event.
|
2021-08-31 11:00:27 +00:00
|
|
|
*/
|
|
|
|
export const ENDPOINT_REACTION_NAME = 'endpoint-reaction';
|
|
|
|
|
2021-11-10 11:19:40 +00:00
|
|
|
/**
|
|
|
|
* The (name of the) command which transports the state (represented by
|
|
|
|
* {State} for the local state at the time of this writing) of a {MuteReactions}
|
|
|
|
* (instance) between moderator and participants.
|
|
|
|
*/
|
|
|
|
export const MUTE_REACTIONS_COMMAND = 'mute-reactions';
|
|
|
|
|
2021-10-04 08:37:02 +00:00
|
|
|
/**
|
|
|
|
* The prefix for all reaction sound IDs. Also the ID used in config to disable reaction sounds.
|
|
|
|
*/
|
|
|
|
export const REACTION_SOUND = 'REACTION_SOUND';
|
|
|
|
|
2021-08-23 09:57:56 +00:00
|
|
|
/**
|
|
|
|
* The audio ID prefix of the audio element for which the {@link playAudio} action is
|
|
|
|
* triggered when a new laugh reaction is received.
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
*/
|
2021-10-04 08:37:02 +00:00
|
|
|
export const LAUGH_SOUND_ID = `${REACTION_SOUND}_LAUGH_`;
|
2021-08-23 09:57:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The audio ID prefix of the audio element for which the {@link playAudio} action is
|
|
|
|
* triggered when a new clap reaction is received.
|
|
|
|
*
|
|
|
|
* @type {string}
|
|
|
|
*/
|
2021-10-04 08:37:02 +00:00
|
|
|
export const CLAP_SOUND_ID = `${REACTION_SOUND}_CLAP_`;
|
2021-08-23 09:57:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The audio ID prefix of the audio element for which the {@link playAudio} action is
|
|
|
|
* triggered when a new like reaction is received.
|
|
|
|
*
|
|
|
|
* @type {string}
|
|
|
|
*/
|
2021-10-04 08:37:02 +00:00
|
|
|
export const LIKE_SOUND_ID = `${REACTION_SOUND}_LIKE_`;
|
2021-08-23 09:57:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The audio ID prefix of the audio element for which the {@link playAudio} action is
|
|
|
|
* triggered when a new boo reaction is received.
|
|
|
|
*
|
|
|
|
* @type {string}
|
|
|
|
*/
|
2021-10-04 08:37:02 +00:00
|
|
|
export const BOO_SOUND_ID = `${REACTION_SOUND}_BOO_`;
|
2021-08-23 09:57:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The audio ID prefix of the audio element for which the {@link playAudio} action is
|
|
|
|
* triggered when a new surprised reaction is received.
|
|
|
|
*
|
|
|
|
* @type {string}
|
|
|
|
*/
|
2021-10-04 08:37:02 +00:00
|
|
|
export const SURPRISE_SOUND_ID = `${REACTION_SOUND}_SURPRISE_`;
|
2021-08-23 09:57:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The audio ID prefix of the audio element for which the {@link playAudio} action is
|
|
|
|
* triggered when a new silence reaction is received.
|
|
|
|
*
|
|
|
|
* @type {string}
|
|
|
|
*/
|
2021-10-04 08:37:02 +00:00
|
|
|
export const SILENCE_SOUND_ID = `${REACTION_SOUND}_SILENCE_`;
|
2021-08-23 09:57:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The audio ID of the audio element for which the {@link playAudio} action is
|
|
|
|
* triggered when a new raise hand event is received.
|
|
|
|
*
|
|
|
|
* @type {string}
|
|
|
|
*/
|
2021-09-09 14:18:26 +00:00
|
|
|
export const RAISE_HAND_SOUND_ID = 'RAISE_HAND_SOUND';
|
2021-08-23 09:57:56 +00:00
|
|
|
|
2022-06-08 07:44:47 +00:00
|
|
|
export interface ReactionEmojiProps {
|
2021-08-23 09:57:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Reaction to be displayed.
|
|
|
|
*/
|
|
|
|
reaction: string,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Id of the reaction.
|
|
|
|
*/
|
2022-06-08 07:44:47 +00:00
|
|
|
uid: string
|
2021-08-23 09:57:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const SOUNDS_THRESHOLDS = [ 1, 4, 10 ];
|
|
|
|
|
2022-06-08 07:44:47 +00:00
|
|
|
interface IReactions {
|
|
|
|
[key: string]: {
|
|
|
|
emoji: string;
|
2022-07-20 08:47:01 +00:00
|
|
|
message: string;
|
2022-06-08 07:44:47 +00:00
|
|
|
shortcutChar: string;
|
|
|
|
soundFiles: string[];
|
2022-07-20 08:47:01 +00:00
|
|
|
soundId: string;
|
2022-06-08 07:44:47 +00:00
|
|
|
}
|
|
|
|
}
|
2021-08-23 09:57:56 +00:00
|
|
|
|
2022-06-08 07:44:47 +00:00
|
|
|
export const REACTIONS: IReactions = {
|
2021-07-13 06:50:08 +00:00
|
|
|
like: {
|
|
|
|
message: ':thumbs_up:',
|
|
|
|
emoji: '👍',
|
2021-08-23 09:57:56 +00:00
|
|
|
shortcutChar: 'T',
|
|
|
|
soundId: LIKE_SOUND_ID,
|
|
|
|
soundFiles: LIKE_SOUND_FILES
|
2021-07-13 06:50:08 +00:00
|
|
|
},
|
2021-07-15 07:26:27 +00:00
|
|
|
clap: {
|
|
|
|
message: ':clap:',
|
|
|
|
emoji: '👏',
|
2021-08-23 09:57:56 +00:00
|
|
|
shortcutChar: 'C',
|
|
|
|
soundId: CLAP_SOUND_ID,
|
|
|
|
soundFiles: CLAP_SOUND_FILES
|
2021-07-13 06:50:08 +00:00
|
|
|
},
|
2021-07-20 11:31:49 +00:00
|
|
|
laugh: {
|
2021-07-15 07:26:27 +00:00
|
|
|
message: ':grinning_face:',
|
|
|
|
emoji: '😀',
|
2021-08-23 09:57:56 +00:00
|
|
|
shortcutChar: 'L',
|
|
|
|
soundId: LAUGH_SOUND_ID,
|
|
|
|
soundFiles: LAUGH_SOUND_FILES
|
2021-07-13 06:50:08 +00:00
|
|
|
},
|
|
|
|
surprised: {
|
|
|
|
message: ':face_with_open_mouth:',
|
|
|
|
emoji: '😮',
|
2021-08-23 09:57:56 +00:00
|
|
|
shortcutChar: 'O',
|
|
|
|
soundId: SURPRISE_SOUND_ID,
|
|
|
|
soundFiles: SURPRISE_SOUND_FILES
|
2021-07-13 06:50:08 +00:00
|
|
|
},
|
2021-07-15 07:26:27 +00:00
|
|
|
boo: {
|
|
|
|
message: ':slightly_frowning_face:',
|
|
|
|
emoji: '🙁',
|
2021-08-23 09:57:56 +00:00
|
|
|
shortcutChar: 'B',
|
|
|
|
soundId: BOO_SOUND_ID,
|
|
|
|
soundFiles: BOO_SOUND_FILES
|
2021-07-15 07:26:27 +00:00
|
|
|
},
|
2021-08-23 09:57:56 +00:00
|
|
|
silence: {
|
|
|
|
message: ':face_without_mouth:',
|
|
|
|
emoji: '😶',
|
|
|
|
shortcutChar: 'S',
|
|
|
|
soundId: SILENCE_SOUND_ID,
|
|
|
|
soundFiles: SILENCE_SOUND_FILES
|
2021-07-13 06:50:08 +00:00
|
|
|
}
|
|
|
|
};
|
2022-06-08 07:44:47 +00:00
|
|
|
|
|
|
|
export type ReactionThreshold = {
|
|
|
|
reaction: string,
|
|
|
|
threshold: number
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MuteCommandAttributes {
|
|
|
|
startReactionsMuted?: string;
|
|
|
|
}
|