Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461
  1. // @flow
  2. import { withStyles } from '@material-ui/core/styles';
  3. import React, { Component } from 'react';
  4. import { batch } from 'react-redux';
  5. import keyboardShortcut from '../../../../../modules/keyboardshortcut/keyboardshortcut';
  6. import {
  7. ACTION_SHORTCUT_TRIGGERED,
  8. createShortcutEvent,
  9. createToolbarEvent,
  10. sendAnalytics
  11. } from '../../../analytics';
  12. import { ContextMenu, ContextMenuItemGroup } from '../../../base/components';
  13. import { getToolbarButtons } from '../../../base/config';
  14. import { isToolbarButtonEnabled } from '../../../base/config/functions.web';
  15. import { openDialog, toggleDialog } from '../../../base/dialog';
  16. import { isIosMobileBrowser, isMobileBrowser } from '../../../base/environment/utils';
  17. import { translate } from '../../../base/i18n';
  18. import JitsiMeetJS from '../../../base/lib-jitsi-meet';
  19. import {
  20. getLocalParticipant,
  21. hasRaisedHand,
  22. haveParticipantWithScreenSharingFeature,
  23. raiseHand
  24. } from '../../../base/participants';
  25. import { connect } from '../../../base/redux';
  26. import { getLocalVideoTrack } from '../../../base/tracks';
  27. import { toggleChat } from '../../../chat';
  28. import { ChatButton } from '../../../chat/components';
  29. import { EmbedMeetingButton } from '../../../embed-meeting';
  30. import { SharedDocumentButton } from '../../../etherpad';
  31. import { FeedbackButton } from '../../../feedback';
  32. import { setGifMenuVisibility } from '../../../gifs/actions';
  33. import { isGifEnabled } from '../../../gifs/functions';
  34. import { InviteButton } from '../../../invite/components/add-people-dialog';
  35. import { isVpaasMeeting } from '../../../jaas/functions';
  36. import { KeyboardShortcutsButton } from '../../../keyboard-shortcuts';
  37. import {
  38. close as closeParticipantsPane,
  39. open as openParticipantsPane
  40. } from '../../../participants-pane/actions';
  41. import { ParticipantsPaneButton } from '../../../participants-pane/components/web';
  42. import { getParticipantsPaneOpen } from '../../../participants-pane/functions';
  43. import { addReactionToBuffer } from '../../../reactions/actions.any';
  44. import { toggleReactionsMenuVisibility } from '../../../reactions/actions.web';
  45. import { ReactionsMenuButton } from '../../../reactions/components';
  46. import { REACTIONS } from '../../../reactions/constants';
  47. import { isReactionsEnabled } from '../../../reactions/functions.any';
  48. import {
  49. LiveStreamButton,
  50. RecordButton
  51. } from '../../../recording';
  52. import { isSalesforceEnabled } from '../../../salesforce/functions';
  53. import {
  54. isScreenAudioSupported,
  55. isScreenVideoShared,
  56. ShareAudioButton,
  57. startScreenShareFlow
  58. } from '../../../screen-share/';
  59. import SecurityDialogButton from '../../../security/components/security-dialog/web/SecurityDialogButton';
  60. import { SettingsButton } from '../../../settings';
  61. import { SharedVideoButton } from '../../../shared-video/components';
  62. import { SpeakerStatsButton } from '../../../speaker-stats/components/web';
  63. import {
  64. ClosedCaptionButton
  65. } from '../../../subtitles';
  66. import {
  67. TileViewButton,
  68. shouldDisplayTileView,
  69. toggleTileView
  70. } from '../../../video-layout';
  71. import { VideoQualityDialog, VideoQualityButton } from '../../../video-quality/components';
  72. import { VideoBackgroundButton, toggleBackgroundEffect } from '../../../virtual-background';
  73. import { VIRTUAL_BACKGROUND_TYPE } from '../../../virtual-background/constants';
  74. import {
  75. setFullScreen,
  76. setOverflowMenuVisible,
  77. setToolbarHovered,
  78. showToolbox
  79. } from '../../actions';
  80. import { THRESHOLDS, NOT_APPLICABLE, NOTIFY_CLICK_MODE } from '../../constants';
  81. import { isDesktopShareButtonDisabled, isToolboxVisible } from '../../functions';
  82. import DownloadButton from '../DownloadButton';
  83. import HangupButton from '../HangupButton';
  84. import HelpButton from '../HelpButton';
  85. import AudioSettingsButton from './AudioSettingsButton';
  86. import DockIframeButton from './DockIframeButton';
  87. import FullscreenButton from './FullscreenButton';
  88. import LinkToSalesforceButton from './LinkToSalesforceButton';
  89. import OverflowMenuButton from './OverflowMenuButton';
  90. import ProfileButton from './ProfileButton';
  91. import Separator from './Separator';
  92. import ShareDesktopButton from './ShareDesktopButton';
  93. import ToggleCameraButton from './ToggleCameraButton';
  94. import UndockIframeButton from './UndockIframeButton';
  95. import VideoSettingsButton from './VideoSettingsButton';
  96. /**
  97. * The type of the React {@code Component} props of {@link Toolbox}.
  98. */
  99. type Props = {
  100. /**
  101. * String showing if the virtual background type is desktop-share.
  102. */
  103. _backgroundType: String,
  104. /**
  105. * Toolbar buttons which have their click exposed through the API.
  106. */
  107. _buttonsWithNotifyClick: Array<string | Object>,
  108. /**
  109. * Whether or not the chat feature is currently displayed.
  110. */
  111. _chatOpen: boolean,
  112. /**
  113. * The width of the client.
  114. */
  115. _clientWidth: number,
  116. /**
  117. * The {@code JitsiConference} for the current conference.
  118. */
  119. _conference: Object,
  120. /**
  121. * Whether or not screensharing button is disabled.
  122. */
  123. _desktopSharingButtonDisabled: boolean,
  124. /**
  125. * The tooltip key to use when screensharing is disabled. Or undefined
  126. * if non to be shown and the button to be hidden.
  127. */
  128. _desktopSharingDisabledTooltipKey: boolean,
  129. /**
  130. * Whether or not screensharing is initialized.
  131. */
  132. _desktopSharingEnabled: boolean,
  133. /**
  134. * Whether or not a dialog is displayed.
  135. */
  136. _dialog: boolean,
  137. /**
  138. * Whether or not the toolbox is disabled. It is for recorders.
  139. */
  140. _disabled: boolean,
  141. /**
  142. * Whether or not call feedback can be sent.
  143. */
  144. _feedbackConfigured: boolean,
  145. /**
  146. * Whether or not the app is currently in full screen.
  147. */
  148. _fullScreen: boolean,
  149. /**
  150. * Whether or not the GIFs feature is enabled.
  151. */
  152. _gifsEnabled: boolean,
  153. /**
  154. * Whether the app has Salesforce integration.
  155. */
  156. _hasSalesforce: boolean,
  157. /**
  158. * Whether or not the app is running in an ios mobile browser.
  159. */
  160. _isIosMobile: boolean,
  161. /**
  162. * Whether or not the app is running in mobile browser.
  163. */
  164. _isMobile: boolean,
  165. /**
  166. * Whether or not the profile is disabled.
  167. */
  168. _isProfileDisabled: boolean,
  169. /**
  170. * Whether or not the current meeting belongs to a JaaS user.
  171. */
  172. _isVpaasMeeting: boolean,
  173. /**
  174. * The ID of the local participant.
  175. */
  176. _localParticipantID: String,
  177. /**
  178. * The JitsiLocalTrack to display.
  179. */
  180. _localVideo: Object,
  181. /**
  182. *Whether or not the overflow menu is displayed in a drawer drawer.
  183. */
  184. _overflowDrawer: boolean,
  185. /**
  186. * Whether or not the overflow menu is visible.
  187. */
  188. _overflowMenuVisible: boolean,
  189. /**
  190. * Whether or not the participants pane is open.
  191. */
  192. _participantsPaneOpen: boolean,
  193. /**
  194. * Whether or not the local participant's hand is raised.
  195. */
  196. _raisedHand: boolean,
  197. /**
  198. * Whether or not reactions feature is enabled.
  199. */
  200. _reactionsEnabled: boolean,
  201. /**
  202. * Whether or not the local participant is screenSharing.
  203. */
  204. _screenSharing: boolean,
  205. /**
  206. * Whether or not the local participant is sharing a YouTube video.
  207. */
  208. _sharingVideo: boolean,
  209. /**
  210. * Whether or not the tile view is enabled.
  211. */
  212. _tileViewEnabled: boolean,
  213. /**
  214. * The enabled buttons.
  215. */
  216. _toolbarButtons: Array<string>,
  217. /**
  218. * Flag showing whether toolbar is visible.
  219. */
  220. _visible: boolean,
  221. /**
  222. * Returns the selected virtual source object.
  223. */
  224. _virtualSource: Object,
  225. /**
  226. * An object containing the CSS classes.
  227. */
  228. classes: Object,
  229. /**
  230. * Invoked to active other features of the app.
  231. */
  232. dispatch: Function,
  233. /**
  234. * Invoked to obtain translated strings.
  235. */
  236. t: Function,
  237. /**
  238. * Explicitly passed array with the buttons which this Toolbox should display.
  239. */
  240. toolbarButtons: Array<string>,
  241. };
  242. declare var APP: Object;
  243. const styles = () => {
  244. return {
  245. contextMenu: {
  246. position: 'relative',
  247. right: 'auto',
  248. maxHeight: 'inherit',
  249. margin: 0
  250. }
  251. };
  252. };
  253. /**
  254. * Implements the conference toolbox on React/Web.
  255. *
  256. * @augments Component
  257. */
  258. class Toolbox extends Component<Props> {
  259. /**
  260. * Initializes a new {@code Toolbox} instance.
  261. *
  262. * @param {Props} props - The read-only React {@code Component} props with
  263. * which the new instance is to be initialized.
  264. */
  265. constructor(props: Props) {
  266. super(props);
  267. // Bind event handlers so they are only bound once per instance.
  268. this._onMouseOut = this._onMouseOut.bind(this);
  269. this._onMouseOver = this._onMouseOver.bind(this);
  270. this._onSetOverflowVisible = this._onSetOverflowVisible.bind(this);
  271. this._onTabIn = this._onTabIn.bind(this);
  272. this._onShortcutToggleChat = this._onShortcutToggleChat.bind(this);
  273. this._onShortcutToggleFullScreen = this._onShortcutToggleFullScreen.bind(this);
  274. this._onShortcutToggleParticipantsPane = this._onShortcutToggleParticipantsPane.bind(this);
  275. this._onShortcutToggleRaiseHand = this._onShortcutToggleRaiseHand.bind(this);
  276. this._onShortcutToggleScreenshare = this._onShortcutToggleScreenshare.bind(this);
  277. this._onShortcutToggleVideoQuality = this._onShortcutToggleVideoQuality.bind(this);
  278. this._onToolbarToggleParticipantsPane = this._onToolbarToggleParticipantsPane.bind(this);
  279. this._onToolbarOpenVideoQuality = this._onToolbarOpenVideoQuality.bind(this);
  280. this._onToolbarToggleChat = this._onToolbarToggleChat.bind(this);
  281. this._onToolbarToggleFullScreen = this._onToolbarToggleFullScreen.bind(this);
  282. this._onToolbarToggleRaiseHand = this._onToolbarToggleRaiseHand.bind(this);
  283. this._onToolbarToggleScreenshare = this._onToolbarToggleScreenshare.bind(this);
  284. this._onShortcutToggleTileView = this._onShortcutToggleTileView.bind(this);
  285. this._onEscKey = this._onEscKey.bind(this);
  286. }
  287. /**
  288. * Sets keyboard shortcuts for to trigger ToolbarButtons actions.
  289. *
  290. * @inheritdoc
  291. * @returns {void}
  292. */
  293. componentDidMount() {
  294. const { _toolbarButtons, t, dispatch, _reactionsEnabled, _gifsEnabled } = this.props;
  295. const KEYBOARD_SHORTCUTS = [
  296. isToolbarButtonEnabled('videoquality', _toolbarButtons) && {
  297. character: 'A',
  298. exec: this._onShortcutToggleVideoQuality,
  299. helpDescription: 'toolbar.callQuality'
  300. },
  301. isToolbarButtonEnabled('chat', _toolbarButtons) && {
  302. character: 'C',
  303. exec: this._onShortcutToggleChat,
  304. helpDescription: 'keyboardShortcuts.toggleChat'
  305. },
  306. isToolbarButtonEnabled('desktop', _toolbarButtons) && {
  307. character: 'D',
  308. exec: this._onShortcutToggleScreenshare,
  309. helpDescription: 'keyboardShortcuts.toggleScreensharing'
  310. },
  311. isToolbarButtonEnabled('participants-pane', _toolbarButtons) && {
  312. character: 'P',
  313. exec: this._onShortcutToggleParticipantsPane,
  314. helpDescription: 'keyboardShortcuts.toggleParticipantsPane'
  315. },
  316. isToolbarButtonEnabled('raisehand', _toolbarButtons) && {
  317. character: 'R',
  318. exec: this._onShortcutToggleRaiseHand,
  319. helpDescription: 'keyboardShortcuts.raiseHand'
  320. },
  321. isToolbarButtonEnabled('fullscreen', _toolbarButtons) && {
  322. character: 'S',
  323. exec: this._onShortcutToggleFullScreen,
  324. helpDescription: 'keyboardShortcuts.fullScreen'
  325. },
  326. isToolbarButtonEnabled('tileview', _toolbarButtons) && {
  327. character: 'W',
  328. exec: this._onShortcutToggleTileView,
  329. helpDescription: 'toolbar.tileViewToggle'
  330. }
  331. ];
  332. KEYBOARD_SHORTCUTS.forEach(shortcut => {
  333. if (typeof shortcut === 'object') {
  334. APP.keyboardshortcut.registerShortcut(
  335. shortcut.character,
  336. null,
  337. shortcut.exec,
  338. shortcut.helpDescription);
  339. }
  340. });
  341. if (_reactionsEnabled) {
  342. const REACTION_SHORTCUTS = Object.keys(REACTIONS).map(key => {
  343. const onShortcutSendReaction = () => {
  344. dispatch(addReactionToBuffer(key));
  345. sendAnalytics(createShortcutEvent(
  346. `reaction.${key}`
  347. ));
  348. };
  349. return {
  350. character: REACTIONS[key].shortcutChar,
  351. exec: onShortcutSendReaction,
  352. helpDescription: t(`toolbar.reaction${key.charAt(0).toUpperCase()}${key.slice(1)}`),
  353. altKey: true
  354. };
  355. });
  356. REACTION_SHORTCUTS.forEach(shortcut => {
  357. APP.keyboardshortcut.registerShortcut(
  358. shortcut.character,
  359. null,
  360. shortcut.exec,
  361. shortcut.helpDescription,
  362. shortcut.altKey);
  363. });
  364. if (_gifsEnabled) {
  365. const onGifShortcut = () => {
  366. batch(() => {
  367. dispatch(toggleReactionsMenuVisibility());
  368. dispatch(setGifMenuVisibility(true));
  369. });
  370. };
  371. APP.keyboardshortcut.registerShortcut(
  372. 'G',
  373. null,
  374. onGifShortcut,
  375. t('keyboardShortcuts.giphyMenu')
  376. );
  377. }
  378. }
  379. }
  380. /**
  381. * Update the visibility of the {@code OverflowMenuButton}.
  382. *
  383. * @inheritdoc
  384. */
  385. componentDidUpdate(prevProps) {
  386. const { _dialog, dispatch } = this.props;
  387. if (prevProps._overflowMenuVisible
  388. && !prevProps._dialog
  389. && _dialog) {
  390. this._onSetOverflowVisible(false);
  391. dispatch(setToolbarHovered(false));
  392. }
  393. }
  394. /**
  395. * Removes keyboard shortcuts registered by this component.
  396. *
  397. * @inheritdoc
  398. * @returns {void}
  399. */
  400. componentWillUnmount() {
  401. [ 'A', 'C', 'D', 'R', 'S' ].forEach(letter =>
  402. APP.keyboardshortcut.unregisterShortcut(letter));
  403. if (this.props._reactionsEnabled) {
  404. Object.keys(REACTIONS).map(key => REACTIONS[key].shortcutChar)
  405. .forEach(letter =>
  406. APP.keyboardshortcut.unregisterShortcut(letter, true));
  407. }
  408. }
  409. /**
  410. * Implements React's {@link Component#render()}.
  411. *
  412. * @inheritdoc
  413. * @returns {ReactElement}
  414. */
  415. render() {
  416. if (this.props._disabled) {
  417. return null;
  418. }
  419. const { _chatOpen, _visible, _toolbarButtons } = this.props;
  420. const rootClassNames = `new-toolbox ${_visible ? 'visible' : ''} ${
  421. _toolbarButtons.length ? '' : 'no-buttons'} ${_chatOpen ? 'shift-right' : ''}`;
  422. return (
  423. <div
  424. className = { rootClassNames }
  425. id = 'new-toolbox'>
  426. { this._renderToolboxContent() }
  427. </div>
  428. );
  429. }
  430. _onEscKey: (KeyboardEvent) => void;
  431. /**
  432. * Key handler for overflow menu.
  433. *
  434. * @param {KeyboardEvent} e - Esc key click to close the popup.
  435. * @returns {void}
  436. */
  437. _onEscKey(e) {
  438. if (e.key === 'Escape') {
  439. e.stopPropagation();
  440. this._closeOverflowMenuIfOpen();
  441. }
  442. }
  443. /**
  444. * Closes the overflow menu if opened.
  445. *
  446. * @private
  447. * @returns {void}
  448. */
  449. _closeOverflowMenuIfOpen() {
  450. const { dispatch, _overflowMenuVisible } = this.props;
  451. _overflowMenuVisible && dispatch(setOverflowMenuVisible(false));
  452. }
  453. /**
  454. * Dispatches an action to open the video quality dialog.
  455. *
  456. * @private
  457. * @returns {void}
  458. */
  459. _doOpenVideoQuality() {
  460. this.props.dispatch(openDialog(VideoQualityDialog));
  461. }
  462. /**
  463. * Dispatches an action to toggle the display of chat.
  464. *
  465. * @private
  466. * @returns {void}
  467. */
  468. _doToggleChat() {
  469. this.props.dispatch(toggleChat());
  470. }
  471. /**
  472. * Dispatches an action to toggle screensharing.
  473. *
  474. * @private
  475. * @returns {void}
  476. */
  477. _doToggleFullScreen() {
  478. const fullScreen = !this.props._fullScreen;
  479. this.props.dispatch(setFullScreen(fullScreen));
  480. }
  481. /**
  482. * Dispatches an action to toggle the local participant's raised hand state.
  483. *
  484. * @private
  485. * @returns {void}
  486. */
  487. _doToggleRaiseHand() {
  488. const { _raisedHand } = this.props;
  489. this.props.dispatch(raiseHand(!_raisedHand));
  490. }
  491. /**
  492. * Dispatches an action to toggle screensharing.
  493. *
  494. * @private
  495. * @param {boolean} enabled - The state to toggle screen sharing to.
  496. * @param {boolean} audioOnly - Only share system audio.
  497. * @returns {void}
  498. */
  499. _doToggleScreenshare() {
  500. const {
  501. _backgroundType,
  502. _desktopSharingButtonDisabled,
  503. _desktopSharingEnabled,
  504. _localVideo,
  505. _screenSharing,
  506. _virtualSource,
  507. dispatch
  508. } = this.props;
  509. if (_backgroundType === VIRTUAL_BACKGROUND_TYPE.DESKTOP_SHARE) {
  510. const noneOptions = {
  511. enabled: false,
  512. backgroundType: VIRTUAL_BACKGROUND_TYPE.NONE,
  513. selectedThumbnail: VIRTUAL_BACKGROUND_TYPE.NONE,
  514. backgroundEffectEnabled: false
  515. };
  516. _virtualSource.dispose();
  517. dispatch(toggleBackgroundEffect(noneOptions, _localVideo));
  518. return;
  519. }
  520. if (_desktopSharingEnabled && !_desktopSharingButtonDisabled) {
  521. dispatch(startScreenShareFlow(!_screenSharing));
  522. }
  523. }
  524. /**
  525. * Dispatches an action to toggle the video quality dialog.
  526. *
  527. * @private
  528. * @returns {void}
  529. */
  530. _doToggleVideoQuality() {
  531. this.props.dispatch(toggleDialog(VideoQualityDialog));
  532. }
  533. /**
  534. * Dispaches an action to toggle tile view.
  535. *
  536. * @private
  537. * @returns {void}
  538. */
  539. _doToggleTileView() {
  540. this.props.dispatch(toggleTileView());
  541. }
  542. /**
  543. * Returns all buttons that could be rendered.
  544. *
  545. * @param {Object} state - The redux state.
  546. * @returns {Object} The button maps mainMenuButtons and overflowMenuButtons.
  547. */
  548. _getAllButtons() {
  549. const {
  550. _feedbackConfigured,
  551. _isIosMobile,
  552. _isMobile,
  553. _hasSalesforce,
  554. _screenSharing
  555. } = this.props;
  556. const microphone = {
  557. key: 'microphone',
  558. Content: AudioSettingsButton,
  559. group: 0
  560. };
  561. const camera = {
  562. key: 'camera',
  563. Content: VideoSettingsButton,
  564. group: 0
  565. };
  566. const profile = this._isProfileVisible() && {
  567. key: 'profile',
  568. Content: ProfileButton,
  569. group: 1
  570. };
  571. const chat = {
  572. key: 'chat',
  573. Content: ChatButton,
  574. handleClick: this._onToolbarToggleChat,
  575. group: 2
  576. };
  577. const desktop = this._showDesktopSharingButton() && {
  578. key: 'desktop',
  579. Content: ShareDesktopButton,
  580. handleClick: this._onToolbarToggleScreenshare,
  581. group: 2
  582. };
  583. const raisehand = {
  584. key: 'raisehand',
  585. Content: ReactionsMenuButton,
  586. handleClick: this._onToolbarToggleRaiseHand,
  587. group: 2
  588. };
  589. const participants = {
  590. key: 'participants-pane',
  591. Content: ParticipantsPaneButton,
  592. handleClick: this._onToolbarToggleParticipantsPane,
  593. group: 2
  594. };
  595. const invite = {
  596. key: 'invite',
  597. Content: InviteButton,
  598. group: 2
  599. };
  600. const tileview = {
  601. key: 'tileview',
  602. Content: TileViewButton,
  603. group: 2
  604. };
  605. const toggleCamera = {
  606. key: 'toggle-camera',
  607. Content: ToggleCameraButton,
  608. group: 2
  609. };
  610. const videoQuality = {
  611. key: 'videoquality',
  612. Content: VideoQualityButton,
  613. handleClick: this._onToolbarOpenVideoQuality,
  614. group: 2
  615. };
  616. const fullscreen = !_isIosMobile && {
  617. key: 'fullscreen',
  618. Content: FullscreenButton,
  619. handleClick: this._onToolbarToggleFullScreen,
  620. group: 2
  621. };
  622. const security = {
  623. key: 'security',
  624. alias: 'info',
  625. Content: SecurityDialogButton,
  626. group: 2
  627. };
  628. const cc = {
  629. key: 'closedcaptions',
  630. Content: ClosedCaptionButton,
  631. group: 2
  632. };
  633. const recording = {
  634. key: 'recording',
  635. Content: RecordButton,
  636. group: 2
  637. };
  638. const livestreaming = {
  639. key: 'livestreaming',
  640. Content: LiveStreamButton,
  641. group: 2
  642. };
  643. const linkToSalesforce = _hasSalesforce && {
  644. key: 'linktosalesforce',
  645. Content: LinkToSalesforceButton,
  646. group: 2
  647. };
  648. const shareVideo = {
  649. key: 'sharedvideo',
  650. Content: SharedVideoButton,
  651. group: 3
  652. };
  653. const shareAudio = this._showAudioSharingButton() && {
  654. key: 'shareaudio',
  655. Content: ShareAudioButton,
  656. group: 3
  657. };
  658. const etherpad = {
  659. key: 'etherpad',
  660. Content: SharedDocumentButton,
  661. group: 3
  662. };
  663. const virtualBackground = !_screenSharing && {
  664. key: 'select-background',
  665. Content: VideoBackgroundButton,
  666. group: 3
  667. };
  668. const dockIframe = {
  669. key: 'dock-iframe',
  670. Content: DockIframeButton,
  671. group: 3
  672. };
  673. const undockIframe = {
  674. key: 'undock-iframe',
  675. Content: UndockIframeButton,
  676. group: 3
  677. };
  678. const speakerStats = {
  679. key: 'stats',
  680. Content: SpeakerStatsButton,
  681. group: 3
  682. };
  683. const settings = {
  684. key: 'settings',
  685. Content: SettingsButton,
  686. group: 4
  687. };
  688. const shortcuts = !_isMobile && keyboardShortcut.getEnabled() && {
  689. key: 'shortcuts',
  690. Content: KeyboardShortcutsButton,
  691. group: 4
  692. };
  693. const embed = this._isEmbedMeetingVisible() && {
  694. key: 'embedmeeting',
  695. Content: EmbedMeetingButton,
  696. group: 4
  697. };
  698. const feedback = _feedbackConfigured && {
  699. key: 'feedback',
  700. Content: FeedbackButton,
  701. group: 4
  702. };
  703. const download = {
  704. key: 'download',
  705. Content: DownloadButton,
  706. group: 4
  707. };
  708. const help = {
  709. key: 'help',
  710. Content: HelpButton,
  711. group: 4
  712. };
  713. return {
  714. microphone,
  715. camera,
  716. profile,
  717. desktop,
  718. chat,
  719. raisehand,
  720. participants,
  721. invite,
  722. tileview,
  723. toggleCamera,
  724. videoQuality,
  725. fullscreen,
  726. security,
  727. cc,
  728. recording,
  729. livestreaming,
  730. linkToSalesforce,
  731. shareVideo,
  732. shareAudio,
  733. etherpad,
  734. virtualBackground,
  735. dockIframe,
  736. undockIframe,
  737. speakerStats,
  738. settings,
  739. shortcuts,
  740. embed,
  741. feedback,
  742. download,
  743. help
  744. };
  745. }
  746. /**
  747. * Returns the notify mode of the given toolbox button.
  748. *
  749. * @param {string} btnName - The toolbar button's name.
  750. * @returns {string|undefined} - The button's notify mode.
  751. */
  752. _getButtonNotifyMode(btnName) {
  753. const notify = this.props._buttonsWithNotifyClick?.find(
  754. (btn: string | Object) =>
  755. (typeof btn === 'string' && btn === btnName)
  756. || (typeof btn === 'object' && btn.key === btnName)
  757. );
  758. if (notify) {
  759. return typeof notify === 'string' || notify.preventExecution
  760. ? NOTIFY_CLICK_MODE.PREVENT_AND_NOTIFY
  761. : NOTIFY_CLICK_MODE.ONLY_NOTIFY;
  762. }
  763. }
  764. /**
  765. * Sets the notify click mode for the buttons.
  766. *
  767. * @param {Object} buttons - The list of toolbar buttons.
  768. * @returns {void}
  769. */
  770. _setButtonsNotifyClickMode(buttons) {
  771. if (typeof APP === 'undefined' || !this.props._buttonsWithNotifyClick?.length) {
  772. return;
  773. }
  774. Object.values(buttons).forEach((button: any) => {
  775. if (typeof button === 'object') {
  776. button.notifyMode = this._getButtonNotifyMode(button.key);
  777. }
  778. });
  779. }
  780. /**
  781. * Returns all buttons that need to be rendered.
  782. *
  783. * @param {Object} state - The redux state.
  784. * @returns {Object} The visible buttons arrays .
  785. */
  786. _getVisibleButtons() {
  787. const {
  788. _clientWidth,
  789. _toolbarButtons
  790. } = this.props;
  791. const buttons = this._getAllButtons();
  792. this._setButtonsNotifyClickMode(buttons);
  793. const isHangupVisible = isToolbarButtonEnabled('hangup', _toolbarButtons);
  794. const { order } = THRESHOLDS.find(({ width }) => _clientWidth > width)
  795. || THRESHOLDS[THRESHOLDS.length - 1];
  796. let sliceIndex = order.length + 2;
  797. const keys = Object.keys(buttons);
  798. const filtered = [
  799. ...order.map(key => buttons[key]),
  800. ...Object.values(buttons).filter((button, index) => !order.includes(keys[index]))
  801. ].filter(Boolean).filter(({ key, alias = NOT_APPLICABLE }) =>
  802. isToolbarButtonEnabled(key, _toolbarButtons) || isToolbarButtonEnabled(alias, _toolbarButtons));
  803. if (isHangupVisible) {
  804. sliceIndex -= 1;
  805. }
  806. // This implies that the overflow button will be displayed, so save some space for it.
  807. if (sliceIndex < filtered.length) {
  808. sliceIndex -= 1;
  809. }
  810. return {
  811. mainMenuButtons: filtered.slice(0, sliceIndex),
  812. overflowMenuButtons: filtered.slice(sliceIndex)
  813. };
  814. }
  815. _onMouseOut: () => void;
  816. /**
  817. * Dispatches an action signaling the toolbar is not being hovered.
  818. *
  819. * @private
  820. * @returns {void}
  821. */
  822. _onMouseOut() {
  823. const { _overflowMenuVisible, dispatch } = this.props;
  824. !_overflowMenuVisible && dispatch(setToolbarHovered(false));
  825. }
  826. _onMouseOver: () => void;
  827. /**
  828. * Dispatches an action signaling the toolbar is being hovered.
  829. *
  830. * @private
  831. * @returns {void}
  832. */
  833. _onMouseOver() {
  834. this.props.dispatch(setToolbarHovered(true));
  835. }
  836. _onSetOverflowVisible: (boolean) => void;
  837. /**
  838. * Sets the visibility of the overflow menu.
  839. *
  840. * @param {boolean} visible - Whether or not the overflow menu should be
  841. * displayed.
  842. * @private
  843. * @returns {void}
  844. */
  845. _onSetOverflowVisible(visible) {
  846. this.props.dispatch(setOverflowMenuVisible(visible));
  847. this.props.dispatch(setToolbarHovered(visible));
  848. }
  849. _onShortcutToggleChat: () => void;
  850. /**
  851. * Creates an analytics keyboard shortcut event and dispatches an action for
  852. * toggling the display of chat.
  853. *
  854. * @private
  855. * @returns {void}
  856. */
  857. _onShortcutToggleChat() {
  858. sendAnalytics(createShortcutEvent(
  859. 'toggle.chat',
  860. {
  861. enable: !this.props._chatOpen
  862. }));
  863. // Checks if there was any text selected by the user.
  864. // Used for when we press simultaneously keys for copying
  865. // text messages from the chat board
  866. if (window.getSelection().toString() !== '') {
  867. return false;
  868. }
  869. this._doToggleChat();
  870. }
  871. _onShortcutToggleParticipantsPane: () => void;
  872. /**
  873. * Creates an analytics keyboard shortcut event and dispatches an action for
  874. * toggling the display of the participants pane.
  875. *
  876. * @private
  877. * @returns {void}
  878. */
  879. _onShortcutToggleParticipantsPane() {
  880. sendAnalytics(createShortcutEvent(
  881. 'toggle.participants-pane',
  882. {
  883. enable: !this.props._participantsPaneOpen
  884. }));
  885. this._onToolbarToggleParticipantsPane();
  886. }
  887. _onShortcutToggleVideoQuality: () => void;
  888. /**
  889. * Creates an analytics keyboard shortcut event and dispatches an action for
  890. * toggling the display of Video Quality.
  891. *
  892. * @private
  893. * @returns {void}
  894. */
  895. _onShortcutToggleVideoQuality() {
  896. sendAnalytics(createShortcutEvent('video.quality'));
  897. this._doToggleVideoQuality();
  898. }
  899. _onShortcutToggleTileView: () => void;
  900. /**
  901. * Dispatches an action for toggling the tile view.
  902. *
  903. * @private
  904. * @returns {void}
  905. */
  906. _onShortcutToggleTileView() {
  907. sendAnalytics(createShortcutEvent(
  908. 'toggle.tileview',
  909. {
  910. enable: !this.props._tileViewEnabled
  911. }));
  912. this._doToggleTileView();
  913. }
  914. _onShortcutToggleFullScreen: () => void;
  915. /**
  916. * Creates an analytics keyboard shortcut event and dispatches an action for
  917. * toggling full screen mode.
  918. *
  919. * @private
  920. * @returns {void}
  921. */
  922. _onShortcutToggleFullScreen() {
  923. sendAnalytics(createShortcutEvent(
  924. 'toggle.fullscreen',
  925. {
  926. enable: !this.props._fullScreen
  927. }));
  928. this._doToggleFullScreen();
  929. }
  930. _onShortcutToggleRaiseHand: () => void;
  931. /**
  932. * Creates an analytics keyboard shortcut event and dispatches an action for
  933. * toggling raise hand.
  934. *
  935. * @private
  936. * @returns {void}
  937. */
  938. _onShortcutToggleRaiseHand() {
  939. sendAnalytics(createShortcutEvent(
  940. 'toggle.raise.hand',
  941. ACTION_SHORTCUT_TRIGGERED,
  942. { enable: !this.props._raisedHand }));
  943. this._doToggleRaiseHand();
  944. }
  945. _onShortcutToggleScreenshare: () => void;
  946. /**
  947. * Creates an analytics keyboard shortcut event and dispatches an action for
  948. * toggling screensharing.
  949. *
  950. * @private
  951. * @returns {void}
  952. */
  953. _onShortcutToggleScreenshare() {
  954. // Ignore the shortcut if the button is disabled.
  955. if (this.props._desktopSharingButtonDisabled) {
  956. return;
  957. }
  958. sendAnalytics(createShortcutEvent(
  959. 'toggle.screen.sharing',
  960. ACTION_SHORTCUT_TRIGGERED,
  961. {
  962. enable: !this.props._screenSharing
  963. }));
  964. this._doToggleScreenshare();
  965. }
  966. _onTabIn: () => void;
  967. /**
  968. * Toggle the toolbar visibility when tabbing into it.
  969. *
  970. * @returns {void}
  971. */
  972. _onTabIn() {
  973. if (!this.props._visible) {
  974. this.props.dispatch(showToolbox());
  975. }
  976. }
  977. _onToolbarToggleParticipantsPane: () => void;
  978. /**
  979. * Dispatches an action for toggling the participants pane.
  980. *
  981. * @private
  982. * @returns {void}
  983. */
  984. _onToolbarToggleParticipantsPane() {
  985. const { dispatch, _participantsPaneOpen } = this.props;
  986. if (_participantsPaneOpen) {
  987. dispatch(closeParticipantsPane());
  988. } else {
  989. dispatch(openParticipantsPane());
  990. }
  991. }
  992. _onToolbarOpenVideoQuality: () => void;
  993. /**
  994. * Creates an analytics toolbar event and dispatches an action for toggling
  995. * open the video quality dialog.
  996. *
  997. * @private
  998. * @returns {void}
  999. */
  1000. _onToolbarOpenVideoQuality() {
  1001. sendAnalytics(createToolbarEvent('video.quality'));
  1002. this._doOpenVideoQuality();
  1003. }
  1004. _onToolbarToggleChat: () => void;
  1005. /**
  1006. * Creates an analytics toolbar event and dispatches an action for toggling
  1007. * the display of chat.
  1008. *
  1009. * @private
  1010. * @returns {void}
  1011. */
  1012. _onToolbarToggleChat() {
  1013. sendAnalytics(createToolbarEvent(
  1014. 'toggle.chat',
  1015. {
  1016. enable: !this.props._chatOpen
  1017. }));
  1018. this._closeOverflowMenuIfOpen();
  1019. this._doToggleChat();
  1020. }
  1021. _onToolbarToggleFullScreen: () => void;
  1022. /**
  1023. * Creates an analytics toolbar event and dispatches an action for toggling
  1024. * full screen mode.
  1025. *
  1026. * @private
  1027. * @returns {void}
  1028. */
  1029. _onToolbarToggleFullScreen() {
  1030. sendAnalytics(createToolbarEvent(
  1031. 'toggle.fullscreen',
  1032. {
  1033. enable: !this.props._fullScreen
  1034. }));
  1035. this._closeOverflowMenuIfOpen();
  1036. this._doToggleFullScreen();
  1037. }
  1038. _onToolbarToggleRaiseHand: () => void;
  1039. /**
  1040. * Creates an analytics toolbar event and dispatches an action for toggling
  1041. * raise hand.
  1042. *
  1043. * @private
  1044. * @returns {void}
  1045. */
  1046. _onToolbarToggleRaiseHand() {
  1047. sendAnalytics(createToolbarEvent(
  1048. 'raise.hand',
  1049. { enable: !this.props._raisedHand }));
  1050. this._doToggleRaiseHand();
  1051. }
  1052. _onToolbarToggleScreenshare: () => void;
  1053. /**
  1054. * Creates an analytics toolbar event and dispatches an action for toggling
  1055. * screensharing.
  1056. *
  1057. * @private
  1058. * @returns {void}
  1059. */
  1060. _onToolbarToggleScreenshare() {
  1061. sendAnalytics(createToolbarEvent(
  1062. 'toggle.screen.sharing',
  1063. ACTION_SHORTCUT_TRIGGERED,
  1064. { enable: !this.props._screenSharing }));
  1065. this._closeOverflowMenuIfOpen();
  1066. this._doToggleScreenshare();
  1067. }
  1068. /**
  1069. * Returns true if the audio sharing button should be visible and
  1070. * false otherwise.
  1071. *
  1072. * @returns {boolean}
  1073. */
  1074. _showAudioSharingButton() {
  1075. const {
  1076. _desktopSharingEnabled
  1077. } = this.props;
  1078. return _desktopSharingEnabled && isScreenAudioSupported();
  1079. }
  1080. /**
  1081. * Returns true if the desktop sharing button should be visible and
  1082. * false otherwise.
  1083. *
  1084. * @returns {boolean}
  1085. */
  1086. _showDesktopSharingButton() {
  1087. const {
  1088. _desktopSharingEnabled,
  1089. _desktopSharingDisabledTooltipKey
  1090. } = this.props;
  1091. return _desktopSharingEnabled || _desktopSharingDisabledTooltipKey;
  1092. }
  1093. /**
  1094. * Returns true if the embed meeting button is visible and false otherwise.
  1095. *
  1096. * @returns {boolean}
  1097. */
  1098. _isEmbedMeetingVisible() {
  1099. return !this.props._isVpaasMeeting
  1100. && !this.props._isMobile;
  1101. }
  1102. /**
  1103. * Returns true if the profile button is visible and false otherwise.
  1104. *
  1105. * @returns {boolean}
  1106. */
  1107. _isProfileVisible() {
  1108. return !this.props._isProfileDisabled;
  1109. }
  1110. /**
  1111. * Renders the toolbox content.
  1112. *
  1113. * @returns {ReactElement}
  1114. */
  1115. _renderToolboxContent() {
  1116. const {
  1117. _isMobile,
  1118. _overflowDrawer,
  1119. _overflowMenuVisible,
  1120. _reactionsEnabled,
  1121. _toolbarButtons,
  1122. classes,
  1123. t
  1124. } = this.props;
  1125. const toolbarAccLabel = 'toolbar.accessibilityLabel.moreActionsMenu';
  1126. const containerClassName = `toolbox-content${_isMobile ? ' toolbox-content-mobile' : ''}`;
  1127. const { mainMenuButtons, overflowMenuButtons } = this._getVisibleButtons();
  1128. return (
  1129. <div className = { containerClassName }>
  1130. <div
  1131. className = 'toolbox-content-wrapper'
  1132. onFocus = { this._onTabIn }
  1133. { ...(_isMobile ? {} : {
  1134. onMouseOut: this._onMouseOut,
  1135. onMouseOver: this._onMouseOver
  1136. }) }>
  1137. <div className = 'toolbox-content-items'>
  1138. {mainMenuButtons.map(({ Content, key, ...rest }) => Content !== Separator && (
  1139. <Content
  1140. { ...rest }
  1141. buttonKey = { key }
  1142. key = { key } />))}
  1143. {Boolean(overflowMenuButtons.length) && (
  1144. <OverflowMenuButton
  1145. ariaControls = 'overflow-menu'
  1146. isOpen = { _overflowMenuVisible }
  1147. key = 'overflow-menu'
  1148. onVisibilityChange = { this._onSetOverflowVisible }
  1149. showMobileReactions = {
  1150. _reactionsEnabled && overflowMenuButtons.find(({ key }) => key === 'raisehand')
  1151. }>
  1152. <ContextMenu
  1153. accessibilityLabel = { t(toolbarAccLabel) }
  1154. className = { classes.contextMenu }
  1155. hidden = { false }
  1156. inDrawer = { _overflowDrawer }
  1157. onKeyDown = { this._onEscKey }>
  1158. {overflowMenuButtons.reduce((acc, val) => {
  1159. if (acc.length) {
  1160. const prev = acc[acc.length - 1];
  1161. const group = prev[prev.length - 1].group;
  1162. if (group === val.group) {
  1163. prev.push(val);
  1164. } else {
  1165. acc.push([ val ]);
  1166. }
  1167. } else {
  1168. acc.push([ val ]);
  1169. }
  1170. return acc;
  1171. }, []).map(buttonGroup => (
  1172. <ContextMenuItemGroup key = { `group-${buttonGroup[0].group}` }>
  1173. {buttonGroup.map(({ key, Content, ...rest }) => (
  1174. key !== 'raisehand' || !_reactionsEnabled)
  1175. && <Content
  1176. { ...rest }
  1177. buttonKey = { key }
  1178. contextMenu = { true }
  1179. key = { key }
  1180. showLabel = { true } />)}
  1181. </ContextMenuItemGroup>))}
  1182. </ContextMenu>
  1183. </OverflowMenuButton>
  1184. )}
  1185. <HangupButton
  1186. buttonKey = 'hangup'
  1187. customClass = 'hangup-button'
  1188. key = 'hangup-button'
  1189. notifyMode = { this._getButtonNotifyMode('hangup') }
  1190. visible = { isToolbarButtonEnabled('hangup', _toolbarButtons) } />
  1191. </div>
  1192. </div>
  1193. </div>
  1194. );
  1195. }
  1196. }
  1197. /**
  1198. * Maps (parts of) the redux state to {@link Toolbox}'s React {@code Component}
  1199. * props.
  1200. *
  1201. * @param {Object} state - The redux store/state.
  1202. * @param {Object} ownProps - The props explicitly passed.
  1203. * @private
  1204. * @returns {{}}
  1205. */
  1206. function _mapStateToProps(state, ownProps) {
  1207. const { conference } = state['features/base/conference'];
  1208. let desktopSharingEnabled = JitsiMeetJS.isDesktopSharingEnabled();
  1209. const {
  1210. buttonsWithNotifyClick,
  1211. callStatsID,
  1212. disableProfile,
  1213. enableFeaturesBasedOnToken,
  1214. iAmRecorder,
  1215. iAmSipGateway
  1216. } = state['features/base/config'];
  1217. const {
  1218. fullScreen,
  1219. overflowMenuVisible,
  1220. overflowDrawer
  1221. } = state['features/toolbox'];
  1222. const localParticipant = getLocalParticipant(state);
  1223. const localVideo = getLocalVideoTrack(state['features/base/tracks']);
  1224. const { clientWidth } = state['features/base/responsive-ui'];
  1225. let desktopSharingDisabledTooltipKey;
  1226. if (enableFeaturesBasedOnToken) {
  1227. if (desktopSharingEnabled) {
  1228. // we enable desktop sharing if any participant already have this
  1229. // feature enabled and if the user supports it.
  1230. desktopSharingEnabled = haveParticipantWithScreenSharingFeature(state);
  1231. desktopSharingDisabledTooltipKey = 'dialog.shareYourScreenDisabled';
  1232. }
  1233. }
  1234. const toolbarButtons = ownProps.toolbarButtons || getToolbarButtons(state);
  1235. return {
  1236. _backgroundType: state['features/virtual-background'].backgroundType,
  1237. _buttonsWithNotifyClick: buttonsWithNotifyClick,
  1238. _chatOpen: state['features/chat'].isOpen,
  1239. _clientWidth: clientWidth,
  1240. _conference: conference,
  1241. _desktopSharingEnabled: desktopSharingEnabled,
  1242. _desktopSharingButtonDisabled: isDesktopShareButtonDisabled(state),
  1243. _desktopSharingDisabledTooltipKey: desktopSharingDisabledTooltipKey,
  1244. _dialog: Boolean(state['features/base/dialog'].component),
  1245. _disabled: Boolean(iAmRecorder || iAmSipGateway),
  1246. _feedbackConfigured: Boolean(callStatsID),
  1247. _fullScreen: fullScreen,
  1248. _gifsEnabled: isGifEnabled(state),
  1249. _isProfileDisabled: Boolean(disableProfile),
  1250. _isIosMobile: isIosMobileBrowser(),
  1251. _isMobile: isMobileBrowser(),
  1252. _isVpaasMeeting: isVpaasMeeting(state),
  1253. _hasSalesforce: isSalesforceEnabled(state),
  1254. _localParticipantID: localParticipant?.id,
  1255. _localVideo: localVideo,
  1256. _overflowMenuVisible: overflowMenuVisible,
  1257. _overflowDrawer: overflowDrawer,
  1258. _participantsPaneOpen: getParticipantsPaneOpen(state),
  1259. _raisedHand: hasRaisedHand(localParticipant),
  1260. _reactionsEnabled: isReactionsEnabled(state),
  1261. _screenSharing: isScreenVideoShared(state),
  1262. _tileViewEnabled: shouldDisplayTileView(state),
  1263. _toolbarButtons: toolbarButtons,
  1264. _virtualSource: state['features/virtual-background'].virtualSource,
  1265. _visible: isToolboxVisible(state)
  1266. };
  1267. }
  1268. export default translate(connect(_mapStateToProps)(withStyles(styles)(Toolbox)));