2021-07-13 06:50:08 +00:00
|
|
|
// @flow
|
|
|
|
|
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-08-31 11:00:27 +00:00
|
|
|
/**
|
|
|
|
* The payload name for the datachannel/endpoint reaction event
|
|
|
|
*/
|
|
|
|
export const ENDPOINT_REACTION_NAME = 'endpoint-reaction';
|
|
|
|
|
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
|
|
|
|
|
|
|
export type ReactionEmojiProps = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reaction to be displayed.
|
|
|
|
*/
|
|
|
|
reaction: string,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Id of the reaction.
|
|
|
|
*/
|
|
|
|
uid: number
|
|
|
|
}
|
|
|
|
|
|
|
|
export const SOUNDS_THRESHOLDS = [ 1, 4, 10 ];
|
|
|
|
|
|
|
|
|
2021-07-13 06:50:08 +00:00
|
|
|
export const REACTIONS = {
|
|
|
|
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
|
|
|
}
|
|
|
|
};
|