You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

constants.ts 4.4KB

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