"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-7316/react/features/reactions/constants.ts" (5 Jun 2023, 4488 Bytes) of package /linux/misc/jitsi-meet-7316.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TypeScript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 import {
    2     BOO_SOUND_FILES,
    3     CLAP_SOUND_FILES,
    4     LAUGH_SOUND_FILES,
    5     LIKE_SOUND_FILES,
    6     SILENCE_SOUND_FILES,
    7     SURPRISE_SOUND_FILES
    8 } from './sounds';
    9 
   10 /**
   11  * The height of the raise hand row in the reactions menu.
   12  */
   13 export const RAISE_HAND_ROW_HEIGHT = 54;
   14 
   15 /**
   16  * The height of the gifs menu when displayed as part of the overflow menu.
   17  */
   18 export const GIFS_MENU_HEIGHT_IN_OVERFLOW_MENU = 200;
   19 
   20 /**
   21  * Reactions menu height when displayed as part of drawer.
   22  */
   23 export const REACTIONS_MENU_HEIGHT_DRAWER = 144;
   24 
   25 /**
   26  * Reactions menu height when displayed as part of overflow menu.
   27  */
   28 export const REACTIONS_MENU_HEIGHT_IN_OVERFLOW_MENU = 106;
   29 
   30 /**
   31  * The payload name for the datachannel/endpoint reaction event.
   32  */
   33 export const ENDPOINT_REACTION_NAME = 'endpoint-reaction';
   34 
   35 /**
   36  * The (name of the) command which transports the state (represented by
   37  * {State} for the local state at the time of this writing) of a {MuteReactions}
   38  * (instance) between moderator and participants.
   39  */
   40 export const MUTE_REACTIONS_COMMAND = 'mute-reactions';
   41 
   42 /**
   43  * The prefix for all reaction sound IDs. Also the ID used in config to disable reaction sounds.
   44  */
   45 export const REACTION_SOUND = 'REACTION_SOUND';
   46 
   47 /**
   48  * The audio ID prefix of the audio element for which the {@link playAudio} action is
   49  * triggered when a new laugh reaction is received.
   50  *
   51  * @type { string }
   52  */
   53 export const LAUGH_SOUND_ID = `${REACTION_SOUND}_LAUGH_`;
   54 
   55 /**
   56  * The audio ID prefix of the audio element for which the {@link playAudio} action is
   57  * triggered when a new clap reaction is received.
   58  *
   59  * @type {string}
   60  */
   61 export const CLAP_SOUND_ID = `${REACTION_SOUND}_CLAP_`;
   62 
   63 /**
   64  * The audio ID prefix of the audio element for which the {@link playAudio} action is
   65  * triggered when a new like reaction is received.
   66  *
   67  * @type {string}
   68  */
   69 export const LIKE_SOUND_ID = `${REACTION_SOUND}_LIKE_`;
   70 
   71 /**
   72  * The audio ID prefix of the audio element for which the {@link playAudio} action is
   73  * triggered when a new boo reaction is received.
   74  *
   75  * @type {string}
   76  */
   77 export const BOO_SOUND_ID = `${REACTION_SOUND}_BOO_`;
   78 
   79 /**
   80  * The audio ID prefix of the audio element for which the {@link playAudio} action is
   81  * triggered when a new surprised reaction is received.
   82  *
   83  * @type {string}
   84  */
   85 export const SURPRISE_SOUND_ID = `${REACTION_SOUND}_SURPRISE_`;
   86 
   87 /**
   88  * The audio ID prefix of the audio element for which the {@link playAudio} action is
   89  * triggered when a new silence reaction is received.
   90  *
   91  * @type {string}
   92  */
   93 export const SILENCE_SOUND_ID = `${REACTION_SOUND}_SILENCE_`;
   94 
   95 /**
   96  * The audio ID of the audio element for which the {@link playAudio} action is
   97  * triggered when a new raise hand event is received.
   98  *
   99  * @type {string}
  100  */
  101 export const RAISE_HAND_SOUND_ID = 'RAISE_HAND_SOUND';
  102 
  103 export interface IReactionEmojiProps {
  104 
  105     /**
  106      * Reaction to be displayed.
  107      */
  108     reaction: string;
  109 
  110     /**
  111      * Id of the reaction.
  112      */
  113     uid: string;
  114 }
  115 
  116 export const SOUNDS_THRESHOLDS = [ 1, 4, 10 ];
  117 
  118 interface IReactions {
  119     [key: string]: {
  120         emoji: string;
  121         message: string;
  122         shortcutChar: string;
  123         soundFiles: string[];
  124         soundId: string;
  125     };
  126 }
  127 
  128 export const REACTIONS: IReactions = {
  129     like: {
  130         message: ':thumbs_up:',
  131         emoji: '👍',
  132         shortcutChar: 'T',
  133         soundId: LIKE_SOUND_ID,
  134         soundFiles: LIKE_SOUND_FILES
  135     },
  136     clap: {
  137         message: ':clap:',
  138         emoji: '👏',
  139         shortcutChar: 'C',
  140         soundId: CLAP_SOUND_ID,
  141         soundFiles: CLAP_SOUND_FILES
  142     },
  143     laugh: {
  144         message: ':grinning_face:',
  145         emoji: '😀',
  146         shortcutChar: 'L',
  147         soundId: LAUGH_SOUND_ID,
  148         soundFiles: LAUGH_SOUND_FILES
  149     },
  150     surprised: {
  151         message: ':face_with_open_mouth:',
  152         emoji: '😮',
  153         shortcutChar: 'O',
  154         soundId: SURPRISE_SOUND_ID,
  155         soundFiles: SURPRISE_SOUND_FILES
  156     },
  157     boo: {
  158         message: ':slightly_frowning_face:',
  159         emoji: '🙁',
  160         shortcutChar: 'B',
  161         soundId: BOO_SOUND_ID,
  162         soundFiles: BOO_SOUND_FILES
  163     },
  164     silence: {
  165         message: ':face_without_mouth:',
  166         emoji: '😶',
  167         shortcutChar: 'S',
  168         soundId: SILENCE_SOUND_ID,
  169         soundFiles: SILENCE_SOUND_FILES
  170     }
  171 };
  172 
  173 export type ReactionThreshold = {
  174     reaction: string;
  175     threshold: number;
  176 };
  177 
  178 export interface IMuteCommandAttributes {
  179     startReactionsMuted?: string;
  180 }