Compare commits

...

13 Commits

Author SHA1 Message Date
Saúl Ibarra Corretgé
e95f2f7341 fixup! 2022-12-02 15:58:52 +00:00
Saúl Ibarra Corretgé
c56db8af77 fixup devcontainer 2022-12-02 15:55:22 +00:00
Saúl Ibarra Corretgé
a66c770053 fix(build) use http for GitHub codespaces 2022-12-02 15:15:56 +00:00
Saúl Ibarra Corretgé
2eaa87a719 Create devcontainer.json 2022-12-02 15:50:01 +01:00
Saúl Ibarra Corretgé
a2e8a7f28f fix(toolbox) hide drawer after toggling camera
Fixes: https://github.com/jitsi/jitsi-meet/issues/12628
2022-12-02 15:31:44 +01:00
Pawel Domas
af072c3070 fix: get the current conference
state['features/base/conference'].conference is not the right way to get the current conference.
See getCurrentConference selector - it accounts for joining and other states.
2022-12-01 16:02:35 -05:00
Jaya Allamsetty
f42772ec5b chore(deps) lib-jitsi-meet@latest
https://github.com/jitsi/lib-jitsi-meet/compare/v1539.0.0+eb4873d2...v1541.0.0+9b34e0f7
2022-11-29 15:28:51 -05:00
Gabriel Borlea
2556a7ab77 fix(face-landmarks): assign empty array to facelandmarks in speakerstats if undefined 2022-11-29 19:12:43 +01:00
Charles Zablit
3cbf160f2b fix: always display transcription (#12325)
* feat: always display transcription

* fix: unused import
2022-11-29 09:50:19 -06:00
Дамян Минков
744960bb1a feat: Several module optimizations to avoid constant parsing of jids. (#12594)
* feat: Several module optimizations to avoid constant parsing of jids.

Caches the parsed values in a rotating table with limited size.
Skips constant creating of a stanza with never changing values - create it once and then just clone it.

* squash: Fixes extract_subdomain multiple values.

* squash: Fix table values when there is a nil element.

* squash: Fix skipping the roomless IQs.

* squash: Fix comments.
2022-11-28 14:18:59 -06:00
Дамян Минков
76471a0ea9 feat: Modules for implementing visitor nodes. (#12593)
* feat: Modules for implementing visitor nodes.

Still WIP, uses visitor nodes prosodies where we create the main participants and forward the visitors to watch. Used for huge conferences.

* squash: Fix comments.
2022-11-28 14:18:33 -06:00
Robert Pintilii
0ba033e07d ref(TS) Improve TS (#12612)
Remove unnecessary @ts-ignores
Remove unnecessary eslint-disable
2022-11-28 12:52:45 +02:00
Robert Pintilii
cb3fb3ada9 ref(TS) Convert some features to TS (#12611) 2022-11-28 12:52:24 +02:00
119 changed files with 734 additions and 386 deletions

View File

@@ -0,0 +1,15 @@
{
"name": "Jitsi Meet Dev Container",
"image": "mcr.microsoft.com/devcontainers/universal:2",
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "16"
}
},
"hostRequirements": {
"cpus": 4,
"memory": "8gb",
"storage": "32gb"
},
"postCreateCommand": "bash -i -c 'nvm use && npm install && cp tsconfig.web.json tsconfig.json'"
}

1
globals.d.ts vendored
View File

@@ -14,6 +14,7 @@ declare global {
registerShortcut: Function;
unregisterShortcut: Function;
openDialog: Function;
enable: Function;
}
};
const interfaceConfig: any;

10
package-lock.json generated
View File

@@ -74,7 +74,7 @@
"js-md5": "0.6.1",
"js-sha512": "0.8.0",
"jwt-decode": "2.2.0",
"lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1539.0.0+eb4873d2/lib-jitsi-meet.tgz",
"lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1541.0.0+9b34e0f7/lib-jitsi-meet.tgz",
"lodash": "4.17.21",
"moment": "2.29.4",
"moment-duration-format": "2.2.2",
@@ -13497,8 +13497,8 @@
},
"node_modules/lib-jitsi-meet": {
"version": "0.0.0",
"resolved": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1539.0.0+eb4873d2/lib-jitsi-meet.tgz",
"integrity": "sha512-hEu5nmljbOVKPHIcCpW6GTFzZpWDOAfplKTkNdvrIyNgMiIjHhUgmMzF+IGicd7KPud3z8aQ+0HFnpcxO/T6ZA==",
"resolved": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1541.0.0+9b34e0f7/lib-jitsi-meet.tgz",
"integrity": "sha512-A+QkH3v0XzLSxumHC7LHWXLmFHTqrJ/1YCbWFd/eHjDGXVyFCPeazYBpsNdGZMHfEBzG9FLdQCEOxyzBY7yIAA==",
"license": "Apache-2.0",
"dependencies": {
"@jitsi/js-utils": "2.0.0",
@@ -30510,8 +30510,8 @@
}
},
"lib-jitsi-meet": {
"version": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1539.0.0+eb4873d2/lib-jitsi-meet.tgz",
"integrity": "sha512-hEu5nmljbOVKPHIcCpW6GTFzZpWDOAfplKTkNdvrIyNgMiIjHhUgmMzF+IGicd7KPud3z8aQ+0HFnpcxO/T6ZA==",
"version": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1541.0.0+9b34e0f7/lib-jitsi-meet.tgz",
"integrity": "sha512-A+QkH3v0XzLSxumHC7LHWXLmFHTqrJ/1YCbWFd/eHjDGXVyFCPeazYBpsNdGZMHfEBzG9FLdQCEOxyzBY7yIAA==",
"requires": {
"@jitsi/js-utils": "2.0.0",
"@jitsi/logger": "2.0.0",

View File

@@ -79,7 +79,7 @@
"js-md5": "0.6.1",
"js-sha512": "0.8.0",
"jwt-decode": "2.2.0",
"lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1539.0.0+eb4873d2/lib-jitsi-meet.tgz",
"lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1541.0.0+9b34e0f7/lib-jitsi-meet.tgz",
"lodash": "4.17.21",
"moment": "2.29.4",
"moment-duration-format": "2.2.2",

View File

@@ -1,5 +1,3 @@
/* eslint-disable lines-around-comment */
import logger from '../logger';
import AbstractHandler, { IEvent } from './AbstractHandler';
@@ -103,8 +101,10 @@ export default class AmplitudeHandler extends AbstractHandler {
return {
sessionId: amplitude.getInstance().getSessionId(),
// @ts-ignore
deviceId: amplitude.getInstance().options.deviceId,
// @ts-ignore
userId: amplitude.getInstance().options.userId
};

View File

@@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import { createStartMutedConfigurationEvent } from '../../analytics/AnalyticsEvents';
import { sendAnalytics } from '../../analytics/functions';
import { appNavigate } from '../../app/actions';
@@ -111,6 +110,7 @@ function _addConferenceListeners(conference: IJitsiConference, dispatch: IStore[
JitsiConferenceEvents.CONFERENCE_LEFT,
(...args: any[]) => {
dispatch(conferenceTimestampChanged(0));
// @ts-ignore
dispatch(conferenceLeft(conference, ...args));
});

View File

@@ -71,6 +71,7 @@ export interface IJitsiConference {
muteParticipant: Function;
myLobbyUserId: Function;
myUserId: Function;
off: Function;
on: Function;
removeTrack: Function;
replaceTrack: Function;

View File

@@ -316,6 +316,7 @@ export interface IConfig {
sdkKey?: string;
tileTime?: number;
};
googleApiApplicationClientID?: string;
gravatar?: {
baseUrl?: string;
disabled?: boolean;
@@ -366,6 +367,7 @@ export interface IConfig {
localSubject?: string;
locationURL?: URL;
maxFullResolutionParticipants?: number;
microsoftApiApplicationClientID?: string;
moderatedRoomServiceUrl?: string;
mouseMoveCallbackInterval?: number;
noticeMessage?: string;

View File

@@ -1,6 +1,6 @@
/* eslint-disable lines-around-comment */
// @ts-ignore
import Bourne from '@hapi/bourne';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { jitsiLocalStorage } from '@jitsi/js-utils';
import _ from 'lodash';

View File

@@ -77,6 +77,7 @@ export interface IConfigState extends IConfig {
analysis?: {
obfuscateRoomName?: boolean;
};
disableRemoteControl?: boolean;
error?: Error;
}

View File

@@ -16,6 +16,7 @@ import { ConnectionFailedError } from './actions.any';
export interface IConnectionState {
connecting?: any;
connection?: {
addFeature: Function;
disconnect: Function;
getJid: () => string;
getLogs: () => Object;

View File

@@ -1,8 +1,8 @@
/* eslint-disable lines-around-comment */
import React, { useCallback } from 'react';
// @ts-ignore
import { Container } from '../../react/base';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { styleTypeToObject } from '../../styles';

View File

@@ -477,18 +477,19 @@ export function participantMutedUs(participant: any, track: any) {
/**
* Action to create a virtual screenshare participant.
*
* @param {(string)} sourceName - JitsiTrack instance.
* @param {(boolean)} local - JitsiTrack instance.
* @param {(string)} sourceName - The source name of the JitsiTrack instance.
* @param {(boolean)} local - Whether it's a local or remote participant.
* @param {JitsiConference} conference - The conference instance for which the participant is to be created.
* @returns {Function}
*/
export function createVirtualScreenshareParticipant(sourceName: string, local: boolean) {
export function createVirtualScreenshareParticipant(sourceName: string, local: boolean, conference: any) {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const state = getState();
const ownerId = getVirtualScreenshareParticipantOwnerId(sourceName);
const ownerName = getParticipantDisplayName(state, ownerId);
dispatch(participantJoined({
conference: state['features/base/conference'].conference,
conference,
fakeParticipant: local ? FakeParticipant.LocalScreenShare : FakeParticipant.RemoteScreenShare,
id: sourceName,
name: ownerName

View File

@@ -1,9 +1,7 @@
/* eslint-disable lines-around-comment */
// @ts-ignore
import { getGravatarURL } from '@jitsi/js-utils/avatar';
import { IReduxState, IStore } from '../../app/types';
// @ts-ignore
import { isStageFilmstripAvailable } from '../../filmstrip/functions';
import { IStateful } from '../app/types';
import { GRAVATAR_BASE_URL } from '../avatar/constants';
@@ -20,6 +18,7 @@ import {
PARTICIPANT_ROLE,
WHITEBOARD_PARTICIPANT_ICON
} from './constants';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { preloadImage } from './preloadImage';
import { FakeParticipant, IParticipant } from './types';

View File

@@ -46,7 +46,7 @@ function _updateScreenshareParticipants({ getState, dispatch }: IStore) {
if (getMultipleVideoSendingSupportFeatureFlag(state)) {
if (!localScreenShare && newLocalSceenshareSourceName) {
dispatch(createVirtualScreenshareParticipant(newLocalSceenshareSourceName, true));
dispatch(createVirtualScreenshareParticipant(newLocalSceenshareSourceName, true, conference));
}
if (localScreenShare && !newLocalSceenshareSourceName) {
@@ -68,7 +68,7 @@ function _updateScreenshareParticipants({ getState, dispatch }: IStore) {
}
if (addedScreenshareSourceNames.length) {
addedScreenshareSourceNames.forEach(id => dispatch(createVirtualScreenshareParticipant(id, false)));
addedScreenshareSourceNames.forEach(id => dispatch(
createVirtualScreenshareParticipant(id, false, conference)));
}
}

View File

@@ -10,8 +10,8 @@ import { navigate }
from '../../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
// @ts-ignore
import { screen } from '../../../../mobile/navigation/routes';
// @ts-ignore
import { SETTINGS_ENABLED, getFeatureFlag } from '../../../flags';
import { SETTINGS_ENABLED } from '../../../flags/constants';
import { getFeatureFlag } from '../../../flags/functions';
import { connect } from '../../../redux/functions';
/**

View File

@@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import _ from 'lodash';
import { AnyAction } from 'redux';

View File

@@ -1,6 +1,5 @@
/* eslint-disable lines-around-comment */
import { IReduxState, IStore } from '../../app/types';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { setPictureInPictureEnabled } from '../../mobile/picture-in-picture/functions';
import { setAudioOnly } from '../audio-only/actions';
@@ -8,7 +7,6 @@ import JitsiMeetJS from '../lib-jitsi-meet';
import { destroyLocalDesktopTrackIfExists, replaceLocalTrack } from './actions.any';
import { getLocalVideoTrack, isLocalVideoTrackDesktop } from './functions';
/* eslint-enable lines-around-comment */
export * from './actions.any';

View File

@@ -8,7 +8,6 @@ import { showNotification } from '../../notifications/actions';
import { NOTIFICATION_TIMEOUT_TYPE } from '../../notifications/constants';
// @ts-ignore
import { stopReceiver } from '../../remote-control/actions';
// @ts-ignore
import { setScreenAudioShareState, setScreenshareAudioTrack } from '../../screen-share/actions';
import { isAudioOnlySharing, isScreenVideoShared } from '../../screen-share/functions';
// @ts-ignore

View File

@@ -1,4 +1,3 @@
// @ts-ignore
import React from 'react';
import { useTranslation } from 'react-i18next';
import {

View File

@@ -1,8 +1,8 @@
/* eslint-disable lines-around-comment */
import React from 'react';
import { TouchableRipple } from 'react-native-paper';
import Icon from '../../../icons/components/Icon';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import styles from '../../../react/components/native/styles';
import { IIconButtonProps } from '../../../react/types';

View File

@@ -1,5 +1,3 @@
// @flow
import {
REFRESH_CALENDAR,
SET_CALENDAR_AUTHORIZATION,
@@ -19,8 +17,7 @@ import {
* isInteractive: boolean
* }}
*/
export function refreshCalendar(
forcePermission: boolean = false, isInteractive: boolean = true) {
export function refreshCalendar(forcePermission = false, isInteractive = true) {
return {
type: REFRESH_CALENDAR,
forcePermission,
@@ -39,7 +36,7 @@ export function refreshCalendar(
* authorization: ?string
* }}
*/
export function setCalendarAuthorization(authorization: ?string) {
export function setCalendarAuthorization(authorization?: string) {
return {
type: SET_CALENDAR_AUTHORIZATION,
authorization

View File

@@ -1,13 +1,15 @@
// @flow
// @ts-expect-error
import { generateRoomWithoutSeparator } from '@jitsi/js-utils/random';
import type { Dispatch } from 'redux';
import { getDefaultURL } from '../app/functions';
import { openDialog } from '../base/dialog';
import { IStore } from '../app/types';
import { openDialog } from '../base/dialog/actions';
import { refreshCalendar } from './actions';
import {
UpdateCalendarEventDialog
// @ts-ignore
} from './components';
import { addLinkToCalendarEntry } from './functions.native';
@@ -35,11 +37,13 @@ export function openUpdateCalendarEventDialog(eventId: string) {
* @returns {Function}
*/
export function updateCalendarEvent(eventId: string) {
return (dispatch: Dispatch<any>, getState: Function) => {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const defaultUrl = getDefaultURL(getState);
const roomName = generateRoomWithoutSeparator();
addLinkToCalendarEntry(getState(), eventId, `${defaultUrl}/${roomName}`)
// @ts-ignore
.finally(() => {
dispatch(refreshCalendar(false, false));
});

View File

@@ -1,9 +1,11 @@
// @flow
// @ts-expect-error
import { generateRoomWithoutSeparator } from '@jitsi/js-utils/random';
import type { Dispatch } from 'redux';
import { createCalendarConnectedEvent, sendAnalytics } from '../analytics';
import { createCalendarConnectedEvent } from '../analytics/AnalyticsEvents';
import { sendAnalytics } from '../analytics/functions';
import { IStore } from '../app/types';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { loadGoogleAPI } from '../google-api';
import {
@@ -14,8 +16,8 @@ import {
SET_CALENDAR_PROFILE_EMAIL,
SET_LOADING_CALENDAR_EVENTS
} from './actionTypes';
import { refreshCalendar, setCalendarEvents } from './actions';
import { _getCalendarIntegration, isCalendarEnabled } from './functions';
import { refreshCalendar, setCalendarEvents } from './actions.web';
import { _getCalendarIntegration, isCalendarEnabled } from './functions.web';
import logger from './logger';
export * from './actions.any';
@@ -26,8 +28,8 @@ export * from './actions.any';
*
* @returns {Function}
*/
export function bootstrapCalendarIntegration(): Function {
return (dispatch, getState) => {
export function bootstrapCalendarIntegration() {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const state = getState();
if (!isCalendarEnabled(state)) {
@@ -63,7 +65,7 @@ export function bootstrapCalendarIntegration(): Function {
}
return dispatch(integrationToLoad._isSignedIn())
.then(signedIn => {
.then((signedIn: boolean) => {
if (signedIn) {
dispatch(setIntegrationReady(integrationType));
dispatch(updateProfile(integrationType));
@@ -114,7 +116,7 @@ export function openUpdateCalendarEventDialog(
* msAuthState: Object
* }}
*/
export function setCalendarAPIAuthState(newState: ?Object) {
export function setCalendarAPIAuthState(newState?: Object) {
return {
type: SET_CALENDAR_AUTH_STATE,
msAuthState: newState
@@ -130,7 +132,7 @@ export function setCalendarAPIAuthState(newState: ?Object) {
* error: Object
* }}
*/
export function setCalendarError(error: ?Object) {
export function setCalendarError(error?: Object) {
return {
type: SET_CALENDAR_ERROR,
error
@@ -146,7 +148,7 @@ export function setCalendarError(error: ?Object) {
* email: string
* }}
*/
export function setCalendarProfileEmail(newEmail: ?string) {
export function setCalendarProfileEmail(newEmail?: string) {
return {
type: SET_CALENDAR_PROFILE_EMAIL,
email: newEmail
@@ -196,8 +198,8 @@ export function setIntegrationReady(integrationType: string) {
* signed into.
* @returns {Function}
*/
export function signIn(calendarType: string): Function {
return (dispatch: Dispatch<any>) => {
export function signIn(calendarType: string) {
return (dispatch: IStore['dispatch']) => {
const integration = _getCalendarIntegration(calendarType);
if (!integration) {
@@ -210,7 +212,7 @@ export function signIn(calendarType: string): Function {
.then(() => dispatch(updateProfile(calendarType)))
.then(() => dispatch(refreshCalendar()))
.then(() => sendAnalytics(createCalendarConnectedEvent()))
.catch(error => {
.catch((error: any) => {
logger.error(
'Error occurred while signing into calendar integration',
error);
@@ -228,10 +230,10 @@ export function signIn(calendarType: string): Function {
* @param {string} calendarId - The id of the calendar to use.
* @returns {Function}
*/
export function updateCalendarEvent(id: string, calendarId: string): Function {
return (dispatch: Dispatch<any>, getState: Function) => {
export function updateCalendarEvent(id: string, calendarId: string) {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const { integrationType } = getState()['features/calendar-sync'];
const { integrationType = '' } = getState()['features/calendar-sync'];
const integration = _getCalendarIntegration(integrationType);
if (!integration) {
@@ -240,7 +242,7 @@ export function updateCalendarEvent(id: string, calendarId: string): Function {
const { locationURL } = getState()['features/base/connection'];
const newRoomName = generateRoomWithoutSeparator();
let href = locationURL.href;
let href = locationURL?.href ?? '';
href.endsWith('/') || (href += '/');
@@ -275,8 +277,8 @@ export function updateCalendarEvent(id: string, calendarId: string): Function {
* should be updated.
* @returns {Function}
*/
export function updateProfile(calendarType: string): Function {
return (dispatch: Dispatch<any>) => {
export function updateProfile(calendarType: string) {
return (dispatch: IStore['dispatch']) => {
const integration = _getCalendarIntegration(calendarType);
if (!integration) {
@@ -284,7 +286,7 @@ export function updateProfile(calendarType: string): Function {
}
return dispatch(integration.getCurrentEmail())
.then(email => {
.then((email: string) => {
dispatch(setCalendarProfileEmail(email));
});
};

View File

@@ -1,8 +1,6 @@
// @flow
import md5 from 'js-md5';
import { APP_LINK_SCHEME, parseURIString } from '../base/util';
import { APP_LINK_SCHEME, parseURIString } from '../base/util/uri';
import { setCalendarEvents } from './actions';
import { MAX_LIST_LENGTH } from './constants';
@@ -16,7 +14,8 @@ const ALLDAY_EVENT_LENGTH = 23 * 60 * 60 * 1000;
* @param {Object} entry - The calendar entry.
* @returns {boolean}
*/
function _isDisplayableCalendarEntry(entry) {
function _isDisplayableCalendarEntry(entry: { allDay: boolean; attendees: Object[];
endDate: number; startDate: number; }) {
// Entries are displayable if:
// - Ends in the future (future or ongoing events)
// - Is not an all day event and there is only one attendee (these events
@@ -45,7 +44,8 @@ export function _updateCalendarEntries(events: Array<Object>) {
return;
}
// eslint-disable-next-line no-invalid-this
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-invalid-this
const { dispatch, getState } = this;
const knownDomains = getState()['features/base/known-domains'];
const entryMap = new Map();
@@ -106,7 +106,7 @@ export function _updateCalendarEntries(events: Array<Object>) {
* @param {string} negativePattern - The negative pattern.
* @returns {string}
*/
function _checkPattern(str, positivePattern, negativePattern) {
function _checkPattern(str: string, positivePattern: string, negativePattern: string) {
const positiveRegExp = new RegExp(positivePattern, 'gi');
let positiveMatch = positiveRegExp.exec(str);
@@ -129,7 +129,7 @@ function _checkPattern(str, positivePattern, negativePattern) {
* @private
* @returns {CalendarEntry}
*/
function _parseCalendarEntry(event, knownDomains) {
function _parseCalendarEntry(event: any, knownDomains: string[]) {
if (event) {
const url = _getURLFromEvent(event, knownDomains);
const startDate = Date.parse(event.startDate);
@@ -170,7 +170,8 @@ function _parseCalendarEntry(event, knownDomains) {
* @private
* @returns {string}
*/
function _getURLFromEvent(event, knownDomains) {
function _getURLFromEvent(event: { description: string; location: string; notes: string; title: string;
url: string; }, knownDomains: string[]) {
const linkTerminatorPattern = '[^\\s<>$]';
const urlRegExp
= `http(s)?://(${knownDomains.join('|')})/${linkTerminatorPattern}+`;

View File

@@ -1,15 +1,17 @@
// @flow
import { NativeModules, Platform } from 'react-native';
import RNCalendarEvents from 'react-native-calendar-events';
import type { Store } from 'redux';
import { CALENDAR_ENABLED, getFeatureFlag } from '../base/flags';
import { IReduxState, IStore } from '../app/types';
import { IStateful } from '../base/app/types';
import { CALENDAR_ENABLED } from '../base/flags/constants';
import { getFeatureFlag } from '../base/flags/functions';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { getShareInfoText } from '../invite';
import { setCalendarAuthorization } from './actions';
import { setCalendarAuthorization } from './actions.native';
import { FETCH_END_DAYS, FETCH_START_DAYS } from './constants';
import { _updateCalendarEntries } from './functions';
import { _updateCalendarEntries } from './functions.native';
import logger from './logger';
export * from './functions.any';
@@ -23,10 +25,10 @@ export * from './functions.any';
* @returns {Promise<*>}
*/
export function addLinkToCalendarEntry(
state: Object, id: string, link: string): Promise<any> {
state: IReduxState, id: string, link: string): Promise<any> {
return new Promise((resolve, reject) => {
getShareInfoText(state, link, true).then(shareInfoText => {
RNCalendarEvents.findEventById(id).then(event => {
getShareInfoText(state, link, true).then((shareInfoText: string) => {
RNCalendarEvents.findEventById(id).then((event: any) => {
const updateText
= event.description
? `${event.description}\n\n${shareInfoText}`
@@ -43,6 +45,7 @@ export function addLinkToCalendarEntry(
})
};
// @ts-ignore
RNCalendarEvents.saveEvent(event.title, updateObject)
.then(resolve, reject);
}, reject);
@@ -61,7 +64,7 @@ export function addLinkToCalendarEntry(
* @returns {boolean} If the app has enabled the calendar feature, {@code true};
* otherwise, {@code false}.
*/
export function isCalendarEnabled(stateful: Function | Object) {
export function isCalendarEnabled(stateful: IStateful) {
const flag = getFeatureFlag(stateful, CALENDAR_ENABLED);
if (typeof flag !== 'undefined') {
@@ -85,9 +88,9 @@ export function isCalendarEnabled(stateful: Function | Object) {
* @returns {void}
*/
export function _fetchCalendarEntries(
store: Store<*, *>,
store: IStore,
maybePromptForPermission: boolean,
forcePermission: ?boolean) {
forcePermission?: boolean) {
const { dispatch, getState } = store;
const promptForPermission
= (maybePromptForPermission
@@ -104,6 +107,8 @@ export function _fetchCalendarEntries(
endDate.setDate(endDate.getDate() + FETCH_END_DAYS);
RNCalendarEvents.fetchAllEvents(
// @ts-ignore
startDate.getTime(),
endDate.getTime(),
[])
@@ -126,7 +131,7 @@ export function _fetchCalendarEntries(
* @private
* @returns {Promise}
*/
function _ensureCalendarAccess(promptForPermission, dispatch) {
function _ensureCalendarAccess(promptForPermission: boolean | undefined, dispatch: IStore['dispatch']) {
return new Promise((resolve, reject) => {
RNCalendarEvents.checkPermissions()
.then(status => {

View File

@@ -1,12 +1,13 @@
// @flow
import { toState } from '../base/redux';
/* eslint-disable lines-around-comment */
import { IStore } from '../app/types';
import { IStateful } from '../base/app/types';
import { toState } from '../base/redux/functions';
import {
clearCalendarIntegration,
setCalendarError,
setLoadingCalendarEvents
} from './actions';
} from './actions.web';
export * from './functions.any';
import {
CALENDAR_TYPE,
@@ -14,10 +15,13 @@ import {
FETCH_END_DAYS,
FETCH_START_DAYS
} from './constants';
import { _updateCalendarEntries } from './functions';
import { _updateCalendarEntries } from './functions.web';
import logger from './logger';
// @ts-ignore
import { googleCalendarApi } from './web/googleCalendar';
// @ts-ignore
import { microsoftCalendarApi } from './web/microsoftCalendar';
/* eslint-enable lines-around-comment */
/**
* Determines whether the calendar feature is enabled by the web.
@@ -27,7 +31,7 @@ import { microsoftCalendarApi } from './web/microsoftCalendar';
* @returns {boolean} If the app has enabled the calendar feature, {@code true};
* otherwise, {@code false}.
*/
export function isCalendarEnabled(stateful: Function | Object) {
export function isCalendarEnabled(stateful: IStateful) {
const {
enableCalendarIntegration,
googleApiApplicationClientID,
@@ -37,26 +41,24 @@ export function isCalendarEnabled(stateful: Function | Object) {
return Boolean(enableCalendarIntegration && (googleApiApplicationClientID || microsoftApiApplicationClientID));
}
/* eslint-disable no-unused-vars */
/**
* Reads the user's calendar and updates the stored entries if need be.
*
* @param {Object} store - The redux store.
* @param {boolean} maybePromptForPermission - Flag to tell the app if it should
* @param {boolean} _maybePromptForPermission - Flag to tell the app if it should
* prompt for a calendar permission if it wasn't granted yet.
* @param {boolean|undefined} forcePermission - Whether to force to re-ask for
* @param {boolean|undefined} _forcePermission - Whether to force to re-ask for
* the permission or not.
* @private
* @returns {void}
*/
export function _fetchCalendarEntries(
store: Object,
maybePromptForPermission: boolean,
forcePermission: ?boolean) {
/* eslint-enable no-unused-vars */
store: IStore,
_maybePromptForPermission: boolean,
_forcePermission?: boolean) {
const { dispatch, getState } = store;
const { integrationType } = getState()['features/calendar-sync'];
const { integrationType = '' } = getState()['features/calendar-sync'];
const integration = _getCalendarIntegration(integrationType);
if (!integration) {
@@ -69,7 +71,7 @@ export function _fetchCalendarEntries(
dispatch(integration.load())
.then(() => dispatch(integration._isSignedIn()))
.then(signedIn => {
.then((signedIn: boolean) => {
if (signedIn) {
return Promise.resolve();
}
@@ -80,13 +82,13 @@ export function _fetchCalendarEntries(
})
.then(() => dispatch(integration.getCalendarEntries(
FETCH_START_DAYS, FETCH_END_DAYS)))
.then(events => _updateCalendarEntries.call({
.then((events: Object[]) => _updateCalendarEntries.call({
dispatch,
getState
}, events))
.then(() => {
dispatch(setCalendarError());
}, error => {
}, (error: any) => {
logger.error('Error fetching calendar.', error);
if (error.error === ERRORS.AUTH_FAILED) {

View File

@@ -1,5 +1,3 @@
// @flow
import { getLogger } from '../base/logging/functions';
export default getLogger('features/calendar-sync');

View File

@@ -1,8 +1,8 @@
// @flow
import { SET_CONFIG } from '../base/config';
import { ADD_KNOWN_DOMAINS } from '../base/known-domains';
import { MiddlewareRegistry, equals } from '../base/redux';
import { IStore } from '../app/types';
import { SET_CONFIG } from '../base/config/actionTypes';
import { ADD_KNOWN_DOMAINS } from '../base/known-domains/actionTypes';
import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
import { equals } from '../base/redux/functions';
import { APP_STATE_CHANGED } from '../mobile/background/actionTypes';
import { REFRESH_CALENDAR } from './actionTypes';
@@ -70,7 +70,7 @@ MiddlewareRegistry.register(store => next => action => {
* @private
* @returns {void}
*/
function _maybeClearAccessStatus(store, { appState }) {
function _maybeClearAccessStatus(store: IStore, { appState }: { appState: string; }) {
appState === 'background'
&& store.dispatch(setCalendarAuthorization(undefined));
}

View File

@@ -29,7 +29,11 @@ const DEFAULT_STATE = {
export interface ICalendarSyncState {
authorization?: string;
error?: Object;
events: Array<Object>;
events: Array<{
calendarId: string;
id: string;
url: string;
}>;
integrationReady: boolean;
integrationType?: string;
isLoadingEvents?: boolean;

View File

@@ -47,6 +47,7 @@ import {
} from './constants';
import { getUnreadCount } from './functions';
import { INCOMING_MSG_SOUND_FILE } from './sounds';
/* eslint-enable lines-around-comment */
/**
* Timeout for when to show the privacy notice after a private message was received.

View File

@@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import React, { useCallback } from 'react';
import { useDispatch } from 'react-redux';
@@ -9,6 +8,7 @@ import Button from '../../../../base/ui/components/native/Button';
import { BUTTON_TYPES } from '../../../../base/ui/constants.native';
import EndMeetingIcon from './EndMeetingIcon';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import styles from './styles';

View File

@@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import React, { useCallback, useState } from 'react';
import { TouchableOpacity, View } from 'react-native';
import { useDispatch, useSelector } from 'react-redux';
@@ -17,7 +16,6 @@ import { IconMic, IconMicSlash } from '../../../../base/icons/svg';
import { MEDIA_TYPE } from '../../../../base/media/constants';
import { isLocalTrackMuted } from '../../../../base/tracks/functions';
import { isAudioMuteButtonDisabled } from '../../../../toolbox/functions.any';
// @ts-ignore
import { muteLocal } from '../../../../video-menu/actions';
// @ts-ignore

View File

@@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import React, { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
@@ -6,9 +5,9 @@ import { useDispatch, useSelector } from 'react-redux';
import { IReduxState } from '../../../app/types';
import { IconArrowDown } from '../../../base/icons/svg/index';
import Label from '../../../base/label/components/web/Label';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { Tooltip } from '../../../base/tooltip';
// @ts-ignore
import { setTopPanelVisible } from '../../../filmstrip/actions.web';
const ToggleTopPanelLabel = () => {

View File

@@ -1,6 +1,5 @@
/* eslint-disable lines-around-comment */
import BaseTheme from '../../../base/ui/components/BaseTheme.native';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { INDICATOR_DISPLAY_THRESHOLD } from '../AbstractConnectionIndicator';

View File

@@ -1,5 +1,3 @@
/* eslint-disable lines-around-comment */
import { Theme } from '@mui/material';
import { withStyles } from '@mui/styles';
import clsx from 'clsx';
@@ -29,11 +27,13 @@ import AbstractConnectionIndicator, {
type State as AbstractState,
INDICATOR_DISPLAY_THRESHOLD,
mapStateToProps as _abstractMapStateToProps
// @ts-ignore
} from '../AbstractConnectionIndicator';
// @ts-ignore
import ConnectionIndicatorContent from './ConnectionIndicatorContent';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { ConnectionIndicatorIcon } from './ConnectionIndicatorIcon';
@@ -228,6 +228,7 @@ class ConnectionIndicator extends AbstractConnectionIndicator<Props, IState> {
<Popover
className = { clsx(classes.container, visibilityClass) }
content = { <ConnectionIndicatorContent
// @ts-ignore
inheritedStats = { this.state.stats }
participantId = { participantId } /> }
@@ -236,6 +237,7 @@ class ConnectionIndicator extends AbstractConnectionIndicator<Props, IState> {
onPopoverClose = { this._onHidePopover }
onPopoverOpen = { this._onShowPopover }
position = { statsPopoverPosition }
// @ts-ignore
visible = { this.state.popoverVisible }>
{ this._renderIndicator() }
@@ -259,6 +261,7 @@ class ConnectionIndicator extends AbstractConnectionIndicator<Props, IState> {
_isConnectionStatusInactive,
_isConnectionStatusInterrupted,
_connectionIndicatorInactiveDisabled
// @ts-ignore
} = this.props;
@@ -305,6 +308,7 @@ class ConnectionIndicator extends AbstractConnectionIndicator<Props, IState> {
// @ts-ignore
return this.state.showIndicator
// @ts-ignore
|| this.props.alwaysVisible
|| _isConnectionStatusInterrupted
@@ -348,6 +352,7 @@ class ConnectionIndicator extends AbstractConnectionIndicator<Props, IState> {
_videoTrack,
classes,
iconSize
// @ts-ignore
} = this.props;
@@ -399,5 +404,6 @@ export function _mapStateToProps(state: IReduxState, ownProps: Props) {
}
export default translate(connect(_mapStateToProps)(
// @ts-ignore
withStyles(styles)(ConnectionIndicator)));

View File

@@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import Tabs from '@atlaskit/tabs';
import React, { PureComponent } from 'react';
import { WithTranslation } from 'react-i18next';
@@ -8,6 +7,7 @@ import { hideDialog } from '../../base/dialog/actions';
import { translate } from '../../base/i18n/functions';
import { connect } from '../../base/redux/functions';
import Dialog from '../../base/ui/components/web/Dialog';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { obtainDesktopSources } from '../functions';

View File

@@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
@@ -11,9 +10,9 @@ import {
} from '../../../base/participants/functions';
import { updateSettings } from '../../../base/settings/actions';
import { withPixelLineHeight } from '../../../base/styles/functions.web';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { Tooltip } from '../../../base/tooltip';
// @ts-ignore
import { getIndicatorsTooltipPosition } from '../../../filmstrip/functions.web';
import { appendSuffix } from '../../functions';

View File

@@ -1,5 +1,3 @@
/* eslint-disable lines-around-comment */
import React from 'react';
import { useSelector } from 'react-redux';
import { makeStyles } from 'tss-react/mui';
@@ -12,11 +10,9 @@ import {
isWhiteboardParticipant
} from '../../../base/participants/functions';
import { withPixelLineHeight } from '../../../base/styles/functions.web';
// @ts-ignore
import { getLargeVideoParticipant } from '../../../large-video/functions';
import { isToolboxVisible } from '../../../toolbox/functions.web';
// @ts-ignore
import { isLayoutTileView } from '../../../video-layout';
import { isLayoutTileView } from '../../../video-layout/functions.web';
import DisplayNameBadge from './DisplayNameBadge';

View File

@@ -43,7 +43,7 @@ export function authorizeDropbox() {
* expireDate: number
* }}
*/
export function updateDropboxToken(token: string, rToken: string, expireDate: number) {
export function updateDropboxToken(token?: string, rToken?: string, expireDate?: number) {
return {
type: UPDATE_DROPBOX_TOKEN,
token,

View File

@@ -17,12 +17,10 @@ import { IconArrowDown, IconArrowUp } from '../../../base/icons/svg';
import { IParticipant } from '../../../base/participants/types';
import { connect } from '../../../base/redux/functions';
import { shouldHideSelfView } from '../../../base/settings/functions.web';
// @ts-ignore
import { showToolbox } from '../../../toolbox/actions.web';
import { isButtonEnabled, isToolboxVisible } from '../../../toolbox/functions.web';
// @ts-ignore
import { getCurrentLayout } from '../../../video-layout';
import { LAYOUTS } from '../../../video-layout/constants';
import { getCurrentLayout } from '../../../video-layout/functions.web';
import {
setFilmstripVisible,
setTopPanelVisible,
@@ -30,7 +28,6 @@ import {
setUserFilmstripWidth,
setUserIsResizing,
setVisibleRemoteParticipants
// @ts-ignore
} from '../../actions';
import {
ASPECT_RATIO_BREAKPOINT,
@@ -46,7 +43,6 @@ import {
getVerticalViewMaxWidth,
isStageFilmstripTopPanel,
shouldRemoteVideosBeVisible
// @ts-ignore
} from '../../functions';
// @ts-ignore

View File

@@ -6,8 +6,6 @@ import { IReduxState } from '../../../app/types';
import { IconPin } from '../../../base/icons/svg';
import { getParticipantById } from '../../../base/participants/functions';
import BaseIndicator from '../../../base/react/components/web/BaseIndicator';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { getPinnedActiveParticipants, isStageFilmstripAvailable } from '../../functions.web';
/**

View File

@@ -39,10 +39,8 @@ import { hideGif, showGif } from '../../../gifs/actions';
import { getGifDisplayMode, getGifForParticipant } from '../../../gifs/functions';
// @ts-ignore
import { PresenceLabel } from '../../../presence-status';
// @ts-ignore
import { getCurrentLayout } from '../../../video-layout';
import { LAYOUTS } from '../../../video-layout/constants';
// @ts-ignore
import { getCurrentLayout } from '../../../video-layout/functions.web';
import { togglePinStageParticipant } from '../../actions';
import {
DISPLAY_MODE_TO_CLASS_NAME,
@@ -60,7 +58,6 @@ import {
isStageFilmstripAvailable,
isVideoPlayable,
showGridInVerticalView
// @ts-ignore
} from '../../functions';
// @ts-ignore
@@ -1188,7 +1185,7 @@ function _mapStateToProps(state: IReduxState, ownProps: any): Object {
const _audioTrack = isLocal
? getLocalAudioTrack(tracks)
: getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.AUDIO, id);
const _currentLayout = getCurrentLayout(state);
const _currentLayout = getCurrentLayout(state) ?? '';
let size: any = {};
let _isMobilePortrait = false;
const {

View File

@@ -1,5 +1,3 @@
/* eslint-disable lines-around-comment */
import React from 'react';
import { useSelector } from 'react-redux';
import { makeStyles } from 'tss-react/mui';

View File

@@ -1,5 +1,3 @@
/* eslint-disable lines-around-comment */
import React from 'react';
import { useSelector } from 'react-redux';
import { makeStyles } from 'tss-react/mui';
@@ -9,11 +7,11 @@ import { isMobileBrowser } from '../../../base/environment/utils';
import { isScreenShareParticipantById } from '../../../base/participants/functions';
import ConnectionIndicator from '../../../connection-indicator/components/web/ConnectionIndicator';
import { STATS_POPOVER_POSITION, THUMBNAIL_TYPE } from '../../constants';
// @ts-ignore
import { getIndicatorsTooltipPosition } from '../../functions.web';
import PinnedIndicator from './PinnedIndicator';
import RaisedHandIndicator from './RaisedHandIndicator';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import StatusIndicators from './StatusIndicators';
import VideoMenuTriggerButton from './VideoMenuTriggerButton';

View File

@@ -4,8 +4,6 @@ import { getParticipantCountWithFake } from '../base/participants/functions';
import StateListenerRegistry from '../base/redux/StateListenerRegistry';
import { clientResized } from '../base/responsive-ui/actions';
import { shouldHideSelfView } from '../base/settings/functions.web';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { selectParticipantInLargeVideo } from '../large-video/actions.any';
import { getParticipantsPaneOpen } from '../participants-pane/functions';
import { setOverflowDrawer } from '../toolbox/actions.web';

View File

@@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import { GiphyFetch, TrendingOptions } from '@giphy/js-fetch-api';
import { Grid } from '@giphy/react-components';
import React, { useCallback, useEffect, useState } from 'react';
@@ -13,8 +12,8 @@ import Input from '../../../base/ui/components/web/Input';
import { sendMessage } from '../../../chat/actions.any';
import { SCROLL_SIZE } from '../../../filmstrip/constants';
import { toggleReactionsMenuVisibility } from '../../../reactions/actions.web';
// @ts-ignore
import { setOverflowMenuVisible } from '../../../toolbox/actions.web';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { Drawer, JitsiPortal } from '../../../toolbox/components/web';
import { showOverflowDrawer } from '../../../toolbox/functions.web';

View File

@@ -12,8 +12,7 @@ import { connect } from '../../../../base/redux/functions';
import Dialog from '../../../../base/ui/components/web/Dialog';
import { isDynamicBrandingDataLoaded } from '../../../../dynamic-branding/functions.any';
import { isVpaasMeeting } from '../../../../jaas/functions';
// @ts-ignore
import { getActiveSession } from '../../../../recording';
import { getActiveSession } from '../../../../recording/functions';
// @ts-ignore
import { updateDialInNumbers } from '../../../actions';
import {

View File

@@ -4,8 +4,6 @@ import { useStore } from 'react-redux';
import { makeStyles } from 'tss-react/mui';
import { translate } from '../../base/i18n/functions';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { setSeeWhatIsBeingShared } from '../actions.web';
const useStyles = makeStyles()(theme => {

View File

@@ -7,8 +7,6 @@ import { isLocalParticipantModerator } from '../../../base/participants/function
import { connect } from '../../../base/redux/functions';
import Switch from '../../../base/ui/components/web/Switch';
import { isInBreakoutRoom } from '../../../breakout-rooms/functions';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { toggleLobbyMode } from '../../actions';
interface IProps extends WithTranslation {

View File

@@ -1,9 +1,9 @@
/* eslint-disable lines-around-comment */
import ReducerRegistry from '../../base/redux/ReducerRegistry';
import { set } from '../../base/redux/functions';
// @ts-ignore
import CallKit from './CallKit';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import ConnectionService from './ConnectionService';
import { _SET_CALL_INTEGRATION_SUBSCRIPTIONS } from './actionTypes';

View File

@@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import { IReduxState } from '../../app/types';
import { translate } from '../../base/i18n/functions';
import {
@@ -9,9 +8,9 @@ import { connect } from '../../base/redux/functions';
import {
AbstractButton,
type AbstractButtonProps
// @ts-ignore
} from '../../base/toolbox/components';
// @ts-ignore
import { setOverflowMenuVisible } from '../../toolbox/actions';
import { toggleNoiseSuppression } from '../actions';
import { isNoiseSuppressionEnabled } from '../functions';

View File

@@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import React, { useCallback } from 'react';
import { useDispatch } from 'react-redux';

View File

@@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import React, { useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';
@@ -11,6 +10,7 @@ import ContextMenu from '../../../../../base/ui/components/web/ContextMenu';
import ContextMenuItemGroup from '../../../../../base/ui/components/web/ContextMenuItemGroup';
import { getBreakoutRooms } from '../../../../../breakout-rooms/functions';
import { showOverflowDrawer } from '../../../../../toolbox/functions.web';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import SendToRoomButton from '../../../../../video-menu/components/web/SendToRoomButton';
import { AVATAR_SIZE } from '../../../../constants';

View File

@@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import React, { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
@@ -29,14 +28,10 @@ import {
import ContextMenu from '../../../base/ui/components/web/ContextMenu';
import ContextMenuItemGroup from '../../../base/ui/components/web/ContextMenuItemGroup';
import { isInBreakoutRoom } from '../../../breakout-rooms/functions';
import {
openSettingsDialog,
shouldShowModeratorSettings
// @ts-ignore
} from '../../../settings';
import { openSettingsDialog } from '../../../settings/actions';
import { SETTINGS_TABS } from '../../../settings/constants';
// @ts-ignore
import { MuteEveryonesVideoDialog } from '../../../video-menu/components';
import { shouldShowModeratorSettings } from '../../../settings/functions.web';
import MuteEveryonesVideoDialog from '../../../video-menu/components/web/MuteEveryonesVideoDialog';
const useStyles = makeStyles()(theme => {
return {

View File

@@ -1,5 +1,3 @@
// eslint-disable-next-line lines-around-comment
import React, { useCallback, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';
@@ -12,8 +10,6 @@ import Button from '../../../base/ui/components/web/Button';
import ContextMenu from '../../../base/ui/components/web/ContextMenu';
import ContextMenuItemGroup from '../../../base/ui/components/web/ContextMenuItemGroup';
import { BUTTON_TYPES } from '../../../base/ui/constants.web';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { showLobbyChatButton } from '../../../lobby/functions';
import { ACTION_TRIGGER, MEDIA_STATE } from '../../constants';
import { useLobbyActions } from '../../hooks';

View File

@@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import React, { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
@@ -11,6 +10,7 @@ import { IconCheck, IconCloseLarge } from '../../../base/icons/svg';
import { withPixelLineHeight } from '../../../base/styles/functions.web';
import { admitMultiple } from '../../../lobby/actions.web';
import { getKnockingParticipants, getLobbyEnabled } from '../../../lobby/functions';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { Drawer, JitsiPortal } from '../../../toolbox/components/web';
import { showOverflowDrawer } from '../../../toolbox/functions.web';

View File

@@ -1,5 +1,4 @@
/* eslint-disable lines-around-comment */
import React, { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
@@ -18,8 +17,7 @@ import useContextMenu from '../../../base/ui/hooks/useContextMenu.web';
import { normalizeAccents } from '../../../base/util/strings.web';
import { getBreakoutRooms, getCurrentRoomId, isInBreakoutRoom } from '../../../breakout-rooms/functions';
import { showOverflowDrawer } from '../../../toolbox/functions.web';
// @ts-ignore
import { muteRemote } from '../../../video-menu/actions.any';
import { muteRemote } from '../../../video-menu/actions.web';
import { getSortedParticipantIds, shouldRenderInviteButton } from '../../functions';
import { useParticipantDrawer } from '../../hooks';

View File

@@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import React, { useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
@@ -14,8 +13,7 @@ import ClickableIcon from '../../../base/ui/components/web/ClickableIcon';
import { BUTTON_TYPES } from '../../../base/ui/constants.web';
import { findAncestorByClass } from '../../../base/ui/functions.web';
import { isAddBreakoutRoomButtonVisible } from '../../../breakout-rooms/functions';
// @ts-ignore
import { MuteEveryoneDialog } from '../../../video-menu/components/';
import MuteEveryoneDialog from '../../../video-menu/components/web/MuteEveryoneDialog';
import { close } from '../../actions.web';
import {
getParticipantsPaneOpen,
@@ -23,6 +21,7 @@ import {
isMuteAllVisible
} from '../../functions';
import { AddBreakoutRoomButton } from '../breakout-rooms/components/web/AddBreakoutRoomButton';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { RoomList } from '../breakout-rooms/components/web/RoomList';

View File

@@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import React from 'react';
import { Text, View } from 'react-native';
import { useSelector } from 'react-redux';

View File

@@ -1,5 +1,4 @@
/* eslint-disable lines-around-comment */
// @ts-ignore
import React from 'react';
import Button from '../../../base/ui/components/web/Button';

View File

@@ -1,5 +1,4 @@
// @flow
// @ts-expect-error
import { Transport } from '../../../modules/transport';
import {
@@ -30,7 +29,7 @@ export function suspendDetected() {
* type: string
* }}
*/
export function setTransport(transport: ?Transport) {
export function setTransport(transport?: Transport) {
return {
type: SET_TRANSPORT,
transport

View File

@@ -1,16 +1,11 @@
// @flow
import {
PostMessageTransportBackend,
Transport
} from '../../../modules/transport';
// @ts-expect-error
import { PostMessageTransportBackend, Transport } from '../../../modules/transport';
import {
CONFERENCE_JOINED,
CONFERENCE_LEFT
} from '../base/conference';
import { MiddlewareRegistry } from '../base/redux';
import { destroyLocalTracks } from '../base/tracks';
} from '../base/conference/actionTypes';
import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
import { destroyLocalTracks } from '../base/tracks/actions';
import { SUSPEND_DETECTED } from './actionTypes';
import {
@@ -18,8 +13,6 @@ import {
suspendDetected
} from './actions';
declare var APP: Object;
MiddlewareRegistry.register(store => next => action => {
const result = next(action);
const { dispatch, getState } = store;
@@ -34,7 +27,7 @@ MiddlewareRegistry.register(store => next => action => {
})
});
transport.on('event', event => {
transport.on('event', (event: { event: string; name: string; }) => {
if (event && event.name === 'power-monitor' && event.event === 'suspend') {
dispatch(suspendDetected());

View File

@@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import { v4 as uuidv4 } from 'uuid';
import { IStore } from '../app/types';
@@ -17,6 +16,7 @@ import {
getLocalVideoTrack
} from '../base/tracks/functions';
import { openURLInBrowser } from '../base/util/openURLInBrowser';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { executeDialOutRequest, executeDialOutStatusRequest, getDialInfoPageURL } from '../invite/functions';
import { showErrorNotification } from '../notifications/actions';

View File

@@ -1,5 +1,3 @@
/* eslint-disable lines-around-comment */
import React from 'react';
import { WithTranslation } from 'react-i18next';
import { makeStyles } from 'tss-react/mui';
@@ -9,6 +7,7 @@ import { Avatar } from '../../../../base/avatar';
import { translate } from '../../../../base/i18n/functions';
import Icon from '../../../../base/icons/components/Icon';
import { IconCloseLarge } from '../../../../base/icons/svg';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import Label from '../Label';

View File

@@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import { Theme } from '@mui/material';
import { ClassNameMap, withStyles } from '@mui/styles';
import clsx from 'clsx';
@@ -14,10 +13,10 @@ import { translate } from '../../../base/i18n/functions';
import { raiseHand } from '../../../base/participants/actions';
import { getLocalParticipant, hasRaisedHand } from '../../../base/participants/functions';
import GifsMenu from '../../../gifs/components/web/GifsMenu';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import GifsMenuButton from '../../../gifs/components/web/GifsMenuButton';
import { isGifEnabled, isGifsMenuOpen } from '../../../gifs/functions';
// @ts-ignore
import { dockToolbox } from '../../../toolbox/actions.web';
import { addReactionToBuffer } from '../../actions.any';
import { toggleReactionsMenuVisibility } from '../../actions.web';

View File

@@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import React, { useCallback } from 'react';
import { WithTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';
@@ -8,6 +7,7 @@ import { isMobileBrowser } from '../../../base/environment/utils';
import { translate } from '../../../base/i18n/functions';
import { IconArrowUp } from '../../../base/icons/svg';
import { connect } from '../../../base/redux/functions';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import ToolboxButtonWithIconPopup from '../../../base/toolbox/components/web/ToolboxButtonWithIconPopup';
import { toggleReactionsMenuVisibility } from '../../actions.web';

View File

@@ -14,11 +14,9 @@ import {
} from '../../../base/dialog';
// @ts-ignore
import { StyleType } from '../../../base/styles';
// @ts-ignore
import { authorizeDropbox, updateDropboxToken } from '../../../dropbox';
import { authorizeDropbox, updateDropboxToken } from '../../../dropbox/actions';
import { isVpaasMeeting } from '../../../jaas/functions';
import { RECORDING_TYPES } from '../../constants';
// @ts-ignore
import { supportsLocalRecording } from '../../functions';
/**

View File

@@ -7,8 +7,6 @@ import { getRoomName } from '../../../base/conference/functions';
import { MEDIA_TYPE } from '../../../base/media/constants';
import { getLocalTrack, getTrackState } from '../../../base/tracks/functions';
import { inIframe } from '../../../base/util/iframeUtils';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { stopLocalVideoRecording } from '../../actions.any';
interface ISelfRecording {

View File

@@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import { Theme } from '@mui/material';
import { withStyles } from '@mui/styles';
import React from 'react';
@@ -11,14 +10,15 @@ import { IconHighlight } from '../../../../base/icons/svg';
import { MEET_FEATURES } from '../../../../base/jwt/constants';
import Label from '../../../../base/label/components/web/Label';
import { connect } from '../../../../base/redux/functions';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { Tooltip } from '../../../../base/tooltip';
import BaseTheme from '../../../../base/ui/components/BaseTheme.web';
// @ts-ignore
import { maybeShowPremiumFeatureDialog } from '../../../../jaas/actions';
import AbstractHighlightButton, {
type Props as AbstractProps,
_abstractMapStateToProps
// @ts-ignore
} from '../AbstractHighlightButton';
@@ -193,6 +193,7 @@ export class HighlightButton extends AbstractHighlightButton<Props, IState> {
_visible,
classes,
t
// @ts-ignore
} = this.props;

View File

@@ -14,7 +14,6 @@ import Button from '../../../../base/ui/components/web/Button';
import Switch from '../../../../base/ui/components/web/Switch';
import { BUTTON_TYPES } from '../../../../base/ui/constants.web';
import { RECORDING_TYPES } from '../../../constants';
// @ts-ignore
import { getRecordingDurationEstimation } from '../../../functions';
import AbstractStartRecordingDialogContent, {
IProps,

View File

@@ -1,17 +1,20 @@
// @flow
// @ts-ignore
import $ from 'jquery';
import React from 'react';
import { openDialog } from '../base/dialog';
import { IStore } from '../app/types';
import { openDialog } from '../base/dialog/actions';
import { JitsiConferenceEvents } from '../base/lib-jitsi-meet';
import { pinParticipant } from '../base/participants/actions';
import {
getParticipantDisplayName,
getPinnedParticipant,
getVirtualScreenshareParticipantByOwnerId,
pinParticipant
} from '../base/participants';
import { getLocalDesktopTrack, toggleScreensharing } from '../base/tracks';
import { NOTIFICATION_TIMEOUT_TYPE, showNotification } from '../notifications';
getVirtualScreenshareParticipantByOwnerId
} from '../base/participants/functions';
import { toggleScreensharing } from '../base/tracks/actions';
import { getLocalDesktopTrack } from '../base/tracks/functions';
import { showNotification } from '../notifications/actions';
import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
import { isScreenVideoShared } from '../screen-share/functions';
import {
@@ -23,6 +26,8 @@ import {
SET_RECEIVER_TRANSPORT,
SET_REQUESTED_PARTICIPANT
} from './actionTypes';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { RemoteControlAuthorizationDialog } from './components';
import {
DISCO_REMOTE_CONTROL_FEATURE,
@@ -43,9 +48,8 @@ import logger from './logger';
/**
* Listeners.
*/
let permissionsReplyListener, receiverEndpointMessageListener, stopListener;
declare var APP: Object;
let permissionsReplyListener: Function | undefined,
receiverEndpointMessageListener: Function, stopListener: Function | undefined;
/**
* Signals that the remote control authorization dialog should be displayed.
@@ -72,7 +76,7 @@ export function openRemoteControlAuthorizationDialog(participantId: string) {
* @returns {Function}
*/
export function setRemoteControlActive(active: boolean) {
return (dispatch: Function, getState: Function) => {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const state = getState();
const { active: oldActive } = state['features/remote-control'];
const { conference } = state['features/base/conference'];
@@ -82,7 +86,7 @@ export function setRemoteControlActive(active: boolean) {
type: REMOTE_CONTROL_ACTIVE,
active
});
conference.setLocalParticipantProperty('remoteControlSessionStatus', active);
conference?.setLocalParticipantProperty('remoteControlSessionStatus', active);
}
};
}
@@ -95,7 +99,7 @@ export function setRemoteControlActive(active: boolean) {
* @returns {Function}
*/
export function requestRemoteControl(userId: string) {
return (dispatch: Function, getState: Function) => {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const state = getState();
const enabled = isRemoteControlEnabled(state);
@@ -110,11 +114,11 @@ export function requestRemoteControl(userId: string) {
const { conference } = state['features/base/conference'];
permissionsReplyListener = (participant, event) => {
permissionsReplyListener = (participant: any, event: any) => {
dispatch(processPermissionRequestReply(participant.getId(), event));
};
conference.on(JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED, permissionsReplyListener);
conference?.on(JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED, permissionsReplyListener);
dispatch({
type: SET_REQUESTED_PARTICIPANT,
@@ -140,8 +144,8 @@ export function requestRemoteControl(userId: string) {
* @param {EndpointMessage} event - The permission request event.
* @returns {Function}
*/
export function processPermissionRequestReply(participantId: string, event: Object) {
return (dispatch: Function, getState: Function) => {
export function processPermissionRequestReply(participantId: string, event: any) {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const state = getState();
const { action, name, type } = event;
const { requestedParticipant } = state['features/remote-control'].controller;
@@ -162,11 +166,11 @@ export function processPermissionRequestReply(participantId: string, event: Obje
const { conference } = state['features/base/conference'];
stopListener = (participant, stopEvent) => {
stopListener = (participant: any, stopEvent: { name: string; type: string; }) => {
dispatch(handleRemoteControlStoppedEvent(participant.getId(), stopEvent));
};
conference.on(JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED, stopListener);
conference?.on(JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED, stopListener);
dispatch(resume());
@@ -206,7 +210,9 @@ export function processPermissionRequestReply(participantId: string, event: Obje
const virtualScreenshareParticipantId = getVirtualScreenshareParticipantByOwnerId(state, participantId);
const pinnedId = pinnedParticipant?.id;
// @ts-ignore
if (virtualScreenshareParticipantId && pinnedId !== virtualScreenshareParticipantId) {
// @ts-ignore
dispatch(pinParticipant(virtualScreenshareParticipantId));
} else if (!virtualScreenshareParticipantId && pinnedId !== participantId) {
dispatch(pinParticipant(participantId));
@@ -226,7 +232,7 @@ export function processPermissionRequestReply(participantId: string, event: Obje
* @property {string} type - The function process only events with name REMOTE_CONTROL_MESSAGE_NAME.
* @returns {void}
*/
export function handleRemoteControlStoppedEvent(participantId: Object, event: Object) {
export function handleRemoteControlStoppedEvent(participantId: Object, event: { name: string; type: string; }) {
return (dispatch: Function, getState: Function) => {
const state = getState();
const { name, type } = event;
@@ -246,8 +252,8 @@ export function handleRemoteControlStoppedEvent(participantId: Object, event: Ob
* @param {boolean} notifyRemoteParty - If true a endpoint message to the controlled participant will be sent.
* @returns {void}
*/
export function stopController(notifyRemoteParty: boolean = false) {
return (dispatch: Function, getState: Function) => {
export function stopController(notifyRemoteParty = false) {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const state = getState();
const { controlled } = state['features/remote-control'].controller;
@@ -265,7 +271,7 @@ export function stopController(notifyRemoteParty: boolean = false) {
logger.log('Stopping remote control controller.');
conference.off(JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED, stopListener);
conference?.off(JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED, stopListener);
stopListener = undefined;
dispatch(pause());
@@ -289,7 +295,7 @@ export function stopController(notifyRemoteParty: boolean = false) {
* @returns {Function}
*/
export function clearRequest() {
return (dispatch: Function, getState: Function) => {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const { conference } = getState()['features/base/conference'];
dispatch({
@@ -297,7 +303,7 @@ export function clearRequest() {
requestedParticipant: undefined
});
conference.off(JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED, permissionsReplyListener);
conference?.off(JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED, permissionsReplyListener);
permissionsReplyListener = undefined;
};
}
@@ -313,7 +319,7 @@ export function clearRequest() {
* transport: Transport
* }}
*/
export function setReceiverTransport(transport: Object) {
export function setReceiverTransport(transport?: Object) {
return {
type: SET_RECEIVER_TRANSPORT,
transport
@@ -326,7 +332,7 @@ export function setReceiverTransport(transport: Object) {
* @returns {Function}
*/
export function enableReceiver() {
return (dispatch: Function, getState: Function) => {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const state = getState();
const { enabled } = state['features/remote-control'].receiver;
@@ -349,7 +355,8 @@ export function enableReceiver() {
});
connection.addFeature(DISCO_REMOTE_CONTROL_FEATURE, true);
receiverEndpointMessageListener = (participant, message) => {
receiverEndpointMessageListener = (participant: any, message: {
action: string; name: string; type: string; }) => {
dispatch(endpointMessageReceived(participant.getId(), message));
};
conference.on(JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED, receiverEndpointMessageListener);
@@ -401,7 +408,7 @@ export function disableReceiver() {
* @param {boolean} [dontNotifyRemoteParty] - If true a endpoint message to the controller participant will be sent.
* @returns {Function}
*/
export function stopReceiver(dontNotifyLocalParty: boolean = false, dontNotifyRemoteParty: boolean = false) {
export function stopReceiver(dontNotifyLocalParty = false, dontNotifyRemoteParty = false) {
return (dispatch: Function, getState: Function) => {
const state = getState();
const { receiver } = state['features/remote-control'];
@@ -450,8 +457,9 @@ export function stopReceiver(dontNotifyLocalParty: boolean = false, dontNotifyRe
* name REMOTE_CONTROL_MESSAGE_NAME.
* @returns {Function}
*/
export function endpointMessageReceived(participantId: string, message: Object) {
return (dispatch: Function, getState: Function) => {
export function endpointMessageReceived(participantId: string, message: {
action: string; name: string; type: string; }) {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const { action, name, type } = message;
if (name !== REMOTE_CONTROL_MESSAGE_NAME) {
@@ -472,7 +480,7 @@ export function endpointMessageReceived(participantId: string, message: Object)
if (type === EVENTS.stop) {
dispatch(stopReceiver(false, true));
} else { // forward the message
transport.sendEvent(message);
transport?.sendEvent(message);
}
} // else ignore
} else {
@@ -489,7 +497,7 @@ export function endpointMessageReceived(participantId: string, message: Object)
* @returns {Function}
*/
export function deny(participantId: string) {
return (dispatch: Function, getState: Function) => {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const state = getState();
const { conference } = state['features/base/conference'];
@@ -507,7 +515,7 @@ export function deny(participantId: string) {
* @returns {Function}
*/
export function sendStartRequest() {
return (dispatch: Function, getState: Function) => {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const state = getState();
const tracks = state['features/base/tracks'];
const track = getLocalDesktopTrack(tracks);
@@ -518,7 +526,7 @@ export function sendStartRequest() {
return Promise.reject(new Error('Cannot identify screen for the remote control session'));
}
return transport.sendRequest({
return transport?.sendRequest({
name: REMOTE_CONTROL_MESSAGE_NAME,
type: REQUESTS.start,
sourceId
@@ -534,7 +542,7 @@ export function sendStartRequest() {
* @returns {Function}
*/
export function grant(participantId: string) {
return (dispatch: Function, getState: Function) => {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
dispatch({
type: SET_CONTROLLER,
controller: participantId
@@ -555,7 +563,7 @@ export function grant(participantId: string) {
true,
false,
{ desktopSharingSources: [ 'screen' ] }
))
)) // @ts-ignore
.then(() => dispatch(sendStartRequest()));
}
@@ -566,7 +574,7 @@ export function grant(participantId: string) {
type: EVENTS.permissions,
action: PERMISSIONS_ACTIONS.grant
}))
.catch(error => {
.catch((error: any) => {
logger.error(error);
sendRemoteControlEndpointMessage(conference, participantId, {
@@ -591,14 +599,16 @@ export function grant(participantId: string) {
* @param {Event} event - The mouse event.
* @returns {Function}
*/
export function mouseClicked(type: string, event: Object) {
return (dispatch: Function, getState: Function) => {
export function mouseClicked(type: string, event: React.MouseEvent) {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const state = getState();
const { conference } = state['features/base/conference'];
const { controller } = state['features/remote-control'];
sendRemoteControlEndpointMessage(conference, controller.controlled, {
type,
// @ts-ignore
button: event.which
});
};
@@ -610,8 +620,8 @@ export function mouseClicked(type: string, event: Object) {
* @param {Event} event - The mouse event.
* @returns {Function}
*/
export function mouseMoved(event: Object) {
return (dispatch: Function, getState: Function) => {
export function mouseMoved(event: React.MouseEvent) {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const area = getRemoteConrolEventCaptureArea();
if (!area) {
@@ -637,8 +647,8 @@ export function mouseMoved(event: Object) {
* @param {Event} event - The mouse event.
* @returns {Function}
*/
export function mouseScrolled(event: Object) {
return (dispatch: Function, getState: Function) => {
export function mouseScrolled(event: { deltaX: number; deltaY: number; }) {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const state = getState();
const { conference } = state['features/base/conference'];
const { controller } = state['features/remote-control'];
@@ -658,8 +668,8 @@ export function mouseScrolled(event: Object) {
* @param {Event} event - The key event.
* @returns {Function}
*/
export function keyPressed(type: string, event: Object) {
return (dispatch: Function, getState: Function) => {
export function keyPressed(type: string, event: React.KeyboardEvent) {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const state = getState();
const { conference } = state['features/base/conference'];
const { controller } = state['features/remote-control'];
@@ -680,7 +690,7 @@ export function keyPressed(type: string, event: Object) {
* @returns {Function}
*/
export function resume() {
return (dispatch: Function, getState: Function) => {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const area = getRemoteConrolEventCaptureArea();
const state = getState();
const { controller } = state['features/remote-control'];
@@ -695,22 +705,22 @@ export function resume() {
// FIXME: Once the keyboard shortcuts are using react/redux.
APP.keyboardshortcut.enable(false);
area.mousemove(event => {
area.mousemove((event: React.MouseEvent) => {
dispatch(mouseMoved(event));
});
area.mousedown(event => dispatch(mouseClicked(EVENTS.mousedown, event)));
area.mouseup(event => dispatch(mouseClicked(EVENTS.mouseup, event)));
area.dblclick(event => dispatch(mouseClicked(EVENTS.mousedblclick, event)));
area.mousedown((event: React.MouseEvent) => dispatch(mouseClicked(EVENTS.mousedown, event)));
area.mouseup((event: React.MouseEvent) => dispatch(mouseClicked(EVENTS.mouseup, event)));
area.dblclick((event: React.MouseEvent) => dispatch(mouseClicked(EVENTS.mousedblclick, event)));
area.contextmenu(() => false);
area[0].onwheel = event => {
area[0].onwheel = (event: any) => {
event.preventDefault();
event.stopPropagation();
dispatch(mouseScrolled(event));
return false;
};
$(window).keydown(event => dispatch(keyPressed(EVENTS.keydown, event)));
$(window).keyup(event => dispatch(keyPressed(EVENTS.keyup, event)));
$(window).keydown((event: React.KeyboardEvent) => dispatch(keyPressed(EVENTS.keydown, event)));
$(window).keyup((event: React.KeyboardEvent) => dispatch(keyPressed(EVENTS.keyup, event)));
dispatch({
type: CAPTURE_EVENTS,
@@ -730,7 +740,7 @@ export function resume() {
* @returns {Function}
*/
export function pause() {
return (dispatch: Function, getState: Function) => {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const state = getState();
const { controller } = state['features/remote-control'];
const { controlled, isCapturingEvents } = controller;

View File

@@ -1,6 +1,9 @@
// @flow
import React from 'react';
// @ts-expect-error
import VideoLayout from '../../../modules/UI/videolayout/VideoLayout';
import { IReduxState, IStore } from '../app/types';
import { IJitsiConference } from '../base/conference/reducer';
import JitsiMeetJS from '../base/lib-jitsi-meet';
import { enableReceiver, stopReceiver } from './actions';
@@ -14,7 +17,7 @@ import logger from './logger';
* @param {*} state - The redux state.
* @returns {boolean} - True if the remote control is enabled and false otherwise.
*/
export function isRemoteControlEnabled(state: Object) {
export function isRemoteControlEnabled(state: IReduxState) {
return !state['features/base/config'].disableRemoteControl && JitsiMeetJS.isDesktopSharingEnabled();
}
@@ -27,8 +30,8 @@ export function isRemoteControlEnabled(state: Object) {
* @returns {boolean} - True if the message was sent successfully and false otherwise.
*/
export function sendRemoteControlEndpointMessage(
conference: Object,
to: ?string,
conference: IJitsiConference | undefined,
to: string | undefined,
event: Object) {
if (!to) {
logger.warn('Remote control: Skip sending remote control event. Params:', to);
@@ -37,7 +40,7 @@ export function sendRemoteControlEndpointMessage(
}
try {
conference.sendEndpointMessage(to, {
conference?.sendEndpointMessage(to, {
name: REMOTE_CONTROL_MESSAGE_NAME,
...event
});
@@ -59,7 +62,7 @@ export function sendRemoteControlEndpointMessage(
* @param {Store} store - The redux store.
* @returns {void}
*/
export function onRemoteControlAPIEvent(event: Object, { getState, dispatch }: Object) {
export function onRemoteControlAPIEvent(event: { type: string; }, { getState, dispatch }: IStore) {
switch (event.type) {
case EVENTS.supported:
logger.log('Remote Control supported.');
@@ -93,7 +96,7 @@ export function getRemoteConrolEventCaptureArea() {
* @param {KeyboardEvent} event - The event.
* @returns {KEYS} The key that is pressed or undefined.
*/
export function getKey(event: Object) {
export function getKey(event: React.KeyboardEvent) {
return keyboardEventToKey(event);
}
@@ -103,7 +106,7 @@ export function getKey(event: Object) {
* @param {KeyboardEvent} event - The event.
* @returns {Array} With possible values: "shift", "control", "alt", "command".
*/
export function getModifiers(event: Object) {
export function getModifiers(event: React.KeyboardEvent) {
const modifiers = [];
if (event.shiftKey) {

View File

@@ -1,3 +1,5 @@
import React from 'react';
/**
* Enumerates the supported keys.
* NOTE: The maps represents physical keys on the keyboard, not chars.
@@ -145,6 +147,7 @@ const keyCodeToKey = {
* Generate codes for digit keys (0-9).
*/
for (let i = 0; i < 10; i++) {
// @ts-ignore
keyCodeToKey[i + 48] = `${i}`;
}
@@ -154,7 +157,7 @@ for (let i = 0; i < 10; i++) {
for (let i = 0; i < 26; i++) {
const keyCode = i + 65;
keyCodeToKey[keyCode] = String.fromCharCode(keyCode).toLowerCase();
keyCodeToKey[keyCode as keyof typeof keyCodeToKey] = String.fromCharCode(keyCode).toLowerCase();
}
/**
@@ -163,6 +166,6 @@ for (let i = 0; i < 26; i++) {
* @param {KeyboardEvent} event - The event.
* @returns {KEYS} - The key on the keyboard.
*/
export function keyboardEventToKey(event) {
return keyCodeToKey[event.which];
export function keyboardEventToKey(event: React.KeyboardEvent) {
return keyCodeToKey[event.which as keyof typeof keyCodeToKey];
}

View File

@@ -1,5 +1,3 @@
// @flow
import { getLogger } from '../base/logging/functions';
export default getLogger('features/remote-control');

View File

@@ -1,10 +1,10 @@
// @flow
// @ts-expect-error
import { PostMessageTransportBackend, Transport } from '@jitsi/js-utils/transport';
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../base/app';
import { CONFERENCE_JOINED } from '../base/conference';
import { PARTICIPANT_LEFT } from '../base/participants';
import { MiddlewareRegistry } from '../base/redux';
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../base/app/actionTypes';
import { CONFERENCE_JOINED } from '../base/conference/actionTypes';
import { PARTICIPANT_LEFT } from '../base/participants/actionTypes';
import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
import {
clearRequest, setReceiverTransport, setRemoteControlActive, stopController, stopReceiver
@@ -51,7 +51,7 @@ MiddlewareRegistry.register(store => next => async action => {
if (transport) {
// We expect here that even if we receive the supported event earlier
// it will be cached and we'll receive it.
transport.on('event', event => {
transport.on('event', (event: { name: string; type: string; }) => {
if (event.name === REMOTE_CONTROL_MESSAGE_NAME) {
onRemoteControlAPIEvent(event, store);

View File

@@ -34,7 +34,12 @@ export interface IRemoteControlState {
receiver: {
controller?: string;
enabled: boolean;
transport?: Object;
transport?: {
dispose: Function;
on: Function;
sendEvent: Function;
sendRequest: Function;
};
};
}

View File

@@ -1,12 +1,10 @@
// @flow
import {
getParticipantById,
getVirtualScreenshareParticipantByOwnerId,
getVirtualScreenshareParticipantOwnerId,
isScreenShareParticipant
} from '../base/participants';
import { StateListenerRegistry } from '../base/redux';
} from '../base/participants/functions';
import StateListenerRegistry from '../base/redux/StateListenerRegistry';
import { pause, resume } from './actions';
@@ -15,7 +13,7 @@ import { pause, resume } from './actions';
*/
StateListenerRegistry.register(
/* selector */ state => {
const { participantId } = state['features/large-video'];
const { participantId = '' } = state['features/large-video'];
const { controller } = state['features/remote-control'];
const { controlled } = controller;

View File

@@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import Spinner from '@atlaskit/spinner';
import React, { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
@@ -102,6 +101,7 @@ const useStyles = makeStyles()(theme => {
border: '1px solid',
borderColor: theme.palette.ui05,
backgroundColor: theme.palette.field01,
// @ts-ignore
color: theme.palette.field02,
borderRadius: theme.shape.borderRadius,
@@ -151,6 +151,7 @@ function SalesforceLinkDialog() {
const renderSpinner = () => (
<div className = { classes.spinner }>
<Spinner
// @ts-ignore
isCompleting = { false }
size = 'medium' />

View File

@@ -1,9 +1,9 @@
/* eslint-disable lines-around-comment */
import React from 'react';
import { WithTranslation } from 'react-i18next';
// @ts-ignore
import { AbstractDialogTab } from '../../../base/dialog';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import type { Props as AbstractDialogTabProps } from '../../../base/dialog';
import { translate } from '../../../base/i18n/functions';

View File

@@ -13,7 +13,6 @@ import type { Props as AbstractDialogTabProps } from '../../../base/dialog';
import { translate } from '../../../base/i18n/functions';
import Button from '../../../base/ui/components/web/Button';
import Input from '../../../base/ui/components/web/Input';
// @ts-ignore
import { openLogoutDialog } from '../../actions';
/**

View File

@@ -23,7 +23,6 @@ import {
submitMoreTab,
submitProfileTab,
submitSoundsTab
// @ts-ignore
} from '../../actions';
import { SETTINGS_TABS } from '../../constants';
import {
@@ -31,7 +30,6 @@ import {
getMoreTabProps,
getProfileTabProps,
getSoundsTabProps
// @ts-ignore
} from '../../functions';
// @ts-ignore

View File

@@ -1,9 +1,9 @@
/* eslint-disable lines-around-comment */
import React from 'react';
import { WithTranslation } from 'react-i18next';
// @ts-ignore
import { AbstractDialogTab } from '../../../base/dialog';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import type { Props as AbstractDialogTabProps } from '../../../base/dialog';
import { translate } from '../../../base/i18n/functions';

View File

@@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import { IReduxState } from '../app/types';
import { IStateful } from '../base/app/types';
import { isNameReadOnly } from '../base/config/functions';
@@ -12,10 +11,8 @@ import {
import { toState } from '../base/redux/functions';
import { getHideSelfView } from '../base/settings/functions';
import { parseStandardURIString } from '../base/util/uri';
// @ts-ignore
import { isStageFilmstripEnabled } from '../filmstrip/functions';
// @ts-ignore
import { isFollowMeActive } from '../follow-me';
import { isFollowMeActive } from '../follow-me/functions';
import { getParticipantsPaneConfig } from '../participants-pane/functions';
import { isReactionsEnabled } from '../reactions/functions.any';

View File

@@ -2,8 +2,6 @@ import { Component } from 'react';
import { WithTranslation } from 'react-i18next';
import { IStore } from '../../app/types';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { extractYoutubeIdOrURL } from '../functions';
/**

View File

@@ -30,7 +30,8 @@ const abstractSpeakerStatsList = (speakerStatsItem: Function): Function[] => {
(state: IReduxState) => state['features/base/config']) || {};
const { faceLandmarks: faceLandmarksConfig } = useSelector((state: IReduxState) =>
state['features/base/config']) || {};
const { faceLandmarks } = useSelector((state: IReduxState) => state['features/face-landmarks']) || {};
const { faceLandmarks } = useSelector((state: IReduxState) => state['features/face-landmarks'])
|| { faceLandmarks: [] };
const reloadInterval = useRef<number>();
/**

View File

@@ -1,9 +1,9 @@
/* eslint-disable lines-around-comment */
import React from 'react';
import { makeStyles } from 'tss-react/mui';
import { withPixelLineHeight } from '../../../base/styles/functions.web';
import { MOBILE_BREAKPOINT } from '../../constants';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import abstractSpeakerStatsList from '../AbstractSpeakerStatsList';

View File

@@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import i18next from 'i18next';
import React, { useCallback, useEffect, useState } from 'react';
import { WithTranslation } from 'react-i18next';
@@ -6,15 +5,14 @@ import { useDispatch } from 'react-redux';
import { makeStyles } from 'tss-react/mui';
import { IReduxState } from '../../app/types';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { TRANSLATION_LANGUAGES, TRANSLATION_LANGUAGES_HEAD } from '../../base/i18n';
import { translate, translateToHTML } from '../../base/i18n/functions';
import { connect } from '../../base/redux/functions';
import Dialog from '../../base/ui/components/web/Dialog';
// @ts-ignore
import { openSettingsDialog } from '../../settings/actions';
import { SETTINGS_TABS } from '../../settings/constants';
// @ts-ignore
import { setRequestingSubtitles, toggleLanguageSelectorDialog, updateTranslationLanguage } from '../actions';
import LanguageList from './LanguageList.web';
@@ -62,6 +60,7 @@ const LanguageSelectorDialog = ({
const [ language, setLanguage ] = useState(off);
const languagesHead = _translationLanguagesHead.map((lang: string) => `translation-languages:${lang}`);
// The off and the head languages are always on the top of the list. But once you are selecting
// a language from the translationLanguages, that language is moved under the fixedItems list,
// until a new languages is selected. FixedItems keep their positions.

View File

@@ -1,4 +1,3 @@
import i18next from 'i18next';
import { AnyAction } from 'redux';
import { IStore } from '../app/types';
@@ -117,7 +116,7 @@ function _endpointMessageReceived({ dispatch, getState }: IStore, next: Function
newTranscriptMessage));
} else if (json.type === JSON_TYPE_TRANSCRIPTION_RESULT
&& i18next.language === translationLanguage) {
&& json.language.slice(0, 2) === translationLanguage) {
// Displays interim and final results without any translation if
// translations are disabled.

View File

@@ -1,7 +1,7 @@
/* eslint-disable lines-around-comment */
// @ts-ignore
import { translate } from '../../../base/i18n';
import { IconCloseLarge, IconHangup } from '../../../base/icons/svg';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';

View File

@@ -6,6 +6,7 @@ import { MEDIA_TYPE } from '../../../base/media';
import { connect } from '../../../base/redux';
import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
import { isLocalTrackMuted, isToggleCameraEnabled, toggleCamera } from '../../../base/tracks';
import { setOverflowMenuVisible } from '../../actions.web';
/**
* The type of the React {@code Component} props of {@link ToggleCameraButton}.
@@ -45,6 +46,7 @@ class ToggleCameraButton extends AbstractButton<Props, any> {
const { dispatch } = this.props;
dispatch(toggleCamera());
dispatch(setOverflowMenuVisible(false));
}
/**

View File

@@ -6,7 +6,6 @@ import { batch } from 'react-redux';
// @ts-expect-error
import keyboardShortcut from '../../../../../modules/keyboardshortcut/keyboardshortcut';
// @ts-ignore
import { isSpeakerStatsDisabled } from '../../../../features/speaker-stats/functions';
import { ACTION_SHORTCUT_TRIGGERED, createShortcutEvent, createToolbarEvent } from '../../../analytics/AnalyticsEvents';
import { sendAnalytics } from '../../../analytics/functions';
@@ -65,7 +64,6 @@ import {
RecordButton
// @ts-ignore
} from '../../../recording';
// @ts-ignore
import { isSalesforceEnabled } from '../../../salesforce/functions';
import {
startScreenShareFlow
@@ -107,7 +105,6 @@ import {
setOverflowMenuVisible,
setToolbarHovered,
showToolbox
// @ts-ignore
} from '../../actions';
import { NOTIFY_CLICK_MODE, NOT_APPLICABLE, THRESHOLDS } from '../../constants';
import { isDesktopShareButtonDisabled, isToolboxVisible } from '../../functions';

View File

@@ -4,8 +4,6 @@ import { getFeatureFlag } from '../base/flags/functions';
import { pinParticipant } from '../base/participants/actions';
import { getParticipantCount, getPinnedParticipant } from '../base/participants/functions';
import { FakeParticipant } from '../base/participants/types';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { isStageFilmstripAvailable } from '../filmstrip/functions';
import { isVideoPlaying } from '../shared-video/functions';
import { VIDEO_QUALITY_LEVELS } from '../video-quality/constants';

View File

@@ -8,8 +8,6 @@ import {
getNumberOfPartipantsForTileView,
getThumbnailMinHeight,
getTileDefaultAspectRatio
// @ts-ignore
} from '../filmstrip/functions.web';
export * from './functions.any';

View File

@@ -8,8 +8,6 @@ import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
import StateListenerRegistry from '../base/redux/StateListenerRegistry';
import { TRACK_REMOVED } from '../base/tracks/actionTypes';
import { SET_DOCUMENT_EDITING_STATUS } from '../etherpad/actionTypes';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { isStageFilmstripEnabled } from '../filmstrip/functions';
import { isFollowMeActive } from '../follow-me/functions';

View File

@@ -2,8 +2,6 @@ import { setVideoMuted } from '../base/media/actions';
import { MEDIA_TYPE, VIDEO_MUTISM_AUTHORITY } from '../base/media/constants';
import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
import { CLIENT_RESIZED } from '../base/responsive-ui/actionTypes';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { setLargeVideoDimensions } from '../large-video/actions.any';
import { SET_CAR_MODE } from './actionTypes';

View File

@@ -5,8 +5,6 @@ import { requestDisableAudioModeration, requestEnableAudioModeration } from '../
import { isEnabledFromState, isSupported } from '../../av-moderation/functions';
import { MEDIA_TYPE } from '../../base/media/constants';
import { getLocalParticipant, getParticipantDisplayName } from '../../base/participants/functions';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { muteAllParticipants } from '../actions';
import AbstractMuteRemoteParticipantDialog, {

View File

@@ -5,8 +5,6 @@ import { requestDisableVideoModeration, requestEnableVideoModeration } from '../
import { isEnabledFromState, isSupported } from '../../av-moderation/functions';
import { MEDIA_TYPE } from '../../base/media/constants';
import { getLocalParticipant, getParticipantDisplayName } from '../../base/participants/functions';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { muteAllParticipants } from '../actions';
import AbstractMuteRemoteParticipantsVideoDialog, {

View File

@@ -1,8 +1,6 @@
import { Component } from 'react';
import { MEDIA_TYPE } from '../../base/media/constants';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { muteRemote } from '../actions';
/**

View File

@@ -4,8 +4,6 @@ import { IReduxState } from '../../app/types';
import { rejectParticipantVideo } from '../../av-moderation/actions';
import { isEnabledFromState } from '../../av-moderation/functions';
import { MEDIA_TYPE } from '../../base/media/constants';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { muteRemote } from '../actions';
/**

Some files were not shown because too many files have changed in this diff Show More