diff --git a/src/ActiveRoomObserver.ts b/src/ActiveRoomObserver.ts index 4638509cc9..4da0a6eac3 100644 --- a/src/ActiveRoomObserver.ts +++ b/src/ActiveRoomObserver.ts @@ -15,10 +15,10 @@ limitations under the License. */ import { EventSubscription } from 'fbemitter'; -import RoomViewStore from './stores/RoomViewStore'; - import { logger } from "matrix-js-sdk/src/logger"; +import RoomViewStore from './stores/RoomViewStore'; + type Listener = (isActive: boolean) => void; /** diff --git a/src/AddThreepid.ts b/src/AddThreepid.ts index b1c7abc68b..ab4c04c725 100644 --- a/src/AddThreepid.ts +++ b/src/AddThreepid.ts @@ -16,12 +16,13 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { IRequestMsisdnTokenResponse, IRequestTokenResponse } from "matrix-js-sdk/src"; + import { MatrixClientPeg } from './MatrixClientPeg'; import Modal from './Modal'; import { _t } from './languageHandler'; import IdentityAuthClient from './IdentityAuthClient'; import { SSOAuthEntry } from "./components/views/auth/InteractiveAuthEntryComponents"; -import { IRequestMsisdnTokenResponse, IRequestTokenResponse } from "matrix-js-sdk/src"; import InteractiveAuthDialog from "./components/views/dialogs/InteractiveAuthDialog"; function getIdServerDomain(): string { diff --git a/src/Analytics.tsx b/src/Analytics.tsx index 3ff7b2a767..0998050002 100644 --- a/src/Analytics.tsx +++ b/src/Analytics.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; import { getCurrentLanguage, _t, _td, IVariables } from './languageHandler'; import PlatformPeg from './PlatformPeg'; @@ -23,8 +24,6 @@ import SdkConfig from './SdkConfig'; import Modal from './Modal'; import * as sdk from './index'; -import { logger } from "matrix-js-sdk/src/logger"; - const hashRegex = /#\/(groups?|room|user|settings|register|login|forgot_password|home|directory)/; const hashVarRegex = /#\/(group|room|user)\/.*$/; diff --git a/src/AsyncWrapper.tsx b/src/AsyncWrapper.tsx index aea0f42ac4..166e4f21e3 100644 --- a/src/AsyncWrapper.tsx +++ b/src/AsyncWrapper.tsx @@ -15,13 +15,12 @@ limitations under the License. */ import React, { ComponentType } from "react"; +import { logger } from "matrix-js-sdk/src/logger"; import * as sdk from './index'; import { _t } from './languageHandler'; import { IDialogProps } from "./components/views/dialogs/IDialogProps"; -import { logger } from "matrix-js-sdk/src/logger"; - type AsyncImport = { default: T }; interface IProps extends IDialogProps { diff --git a/src/BasePlatform.ts b/src/BasePlatform.ts index f3b26ec510..13ee135b3b 100644 --- a/src/BasePlatform.ts +++ b/src/BasePlatform.ts @@ -19,6 +19,8 @@ limitations under the License. import { MatrixClient } from "matrix-js-sdk/src/client"; import { encodeUnpaddedBase64 } from "matrix-js-sdk/src/crypto/olmlib"; +import { logger } from "matrix-js-sdk/src/logger"; + import dis from './dispatcher/dispatcher'; import BaseEventIndexManager from './indexing/BaseEventIndexManager'; import { ActionPayload } from "./dispatcher/payloads"; @@ -28,8 +30,6 @@ import { hideToast as hideUpdateToast } from "./toasts/UpdateToast"; import { MatrixClientPeg } from "./MatrixClientPeg"; import { idbLoad, idbSave, idbDelete } from "./utils/StorageManager"; -import { logger } from "matrix-js-sdk/src/logger"; - export const SSO_HOMESERVER_URL_KEY = "mx_sso_hs_url"; export const SSO_ID_SERVER_URL_KEY = "mx_sso_is_url"; export const SSO_IDP_ID_KEY = "mx_sso_idp_id"; diff --git a/src/CallHandler.tsx b/src/CallHandler.tsx index 69b00927a9..9c583544b0 100644 --- a/src/CallHandler.tsx +++ b/src/CallHandler.tsx @@ -55,6 +55,13 @@ limitations under the License. */ import React from 'react'; +import { base32 } from "rfc4648"; +import { MatrixCall, CallErrorCode, CallState, CallEvent, CallParty, CallType, CallError } from "matrix-js-sdk/src/webrtc/call"; +import { logger } from 'matrix-js-sdk/src/logger'; +import { randomUppercaseString, randomLowercaseString } from "matrix-js-sdk/src/randomstring"; +import EventEmitter from 'events'; +import { RuleId, TweakName, Tweaks } from "matrix-js-sdk/src/@types/PushRules"; +import { PushProcessor } from 'matrix-js-sdk/src/pushprocessor'; import { MatrixClientPeg } from './MatrixClientPeg'; import Modal from './Modal'; @@ -66,32 +73,22 @@ import { Jitsi } from "./widgets/Jitsi"; import { WidgetType } from "./widgets/WidgetType"; import { SettingLevel } from "./settings/SettingLevel"; import { ActionPayload } from "./dispatcher/payloads"; -import { base32 } from "rfc4648"; - import QuestionDialog from "./components/views/dialogs/QuestionDialog"; import ErrorDialog from "./components/views/dialogs/ErrorDialog"; import WidgetStore from "./stores/WidgetStore"; import { WidgetMessagingStore } from "./stores/widgets/WidgetMessagingStore"; import { ElementWidgetActions } from "./stores/widgets/ElementWidgetActions"; -import { MatrixCall, CallErrorCode, CallState, CallEvent, CallParty, CallType } from "matrix-js-sdk/src/webrtc/call"; import Analytics from './Analytics'; import CountlyAnalytics from "./CountlyAnalytics"; import { UIFeature } from "./settings/UIFeature"; -import { CallError } from "matrix-js-sdk/src/webrtc/call"; -import { logger } from 'matrix-js-sdk/src/logger'; import { Action } from './dispatcher/actions'; import VoipUserMapper from './VoipUserMapper'; import { addManagedHybridWidget, isManagedHybridWidgetEnabled } from './widgets/ManagedHybrid'; -import { randomUppercaseString, randomLowercaseString } from "matrix-js-sdk/src/randomstring"; -import EventEmitter from 'events'; import SdkConfig from './SdkConfig'; import { ensureDMExists, findDMForUser } from './createRoom'; -import { RuleId, TweakName, Tweaks } from "matrix-js-sdk/src/@types/PushRules"; -import { PushProcessor } from 'matrix-js-sdk/src/pushprocessor'; import { WidgetLayoutStore, Container } from './stores/widgets/WidgetLayoutStore'; -import { getIncomingCallToastKey } from './toasts/IncomingCallToast'; +import IncomingCallToast, { getIncomingCallToastKey } from './toasts/IncomingCallToast'; import ToastStore from './stores/ToastStore'; -import IncomingCallToast from "./toasts/IncomingCallToast"; export const PROTOCOL_PSTN = 'm.protocol.pstn'; export const PROTOCOL_PSTN_PREFIXED = 'im.vector.protocol.pstn'; diff --git a/src/ContentMessages.tsx b/src/ContentMessages.tsx index 9831a9b41d..abb2ca106d 100644 --- a/src/ContentMessages.tsx +++ b/src/ContentMessages.tsx @@ -18,14 +18,16 @@ limitations under the License. import React from "react"; import { MatrixClient } from "matrix-js-sdk/src/client"; +import encrypt from "browser-encrypt-attachment"; +import extractPngChunks from "png-chunks-extract"; +import { IAbortablePromise, IImageInfo } from "matrix-js-sdk/src/@types/partials"; +import { logger } from "matrix-js-sdk/src/logger"; import dis from './dispatcher/dispatcher'; import * as sdk from './index'; import { _t } from './languageHandler'; import Modal from './Modal'; import RoomViewStore from './stores/RoomViewStore'; -import encrypt from "browser-encrypt-attachment"; -import extractPngChunks from "png-chunks-extract"; import Spinner from "./components/views/elements/Spinner"; import { Action } from "./dispatcher/actions"; import CountlyAnalytics from "./CountlyAnalytics"; @@ -37,13 +39,10 @@ import { UploadStartedPayload, } from "./dispatcher/payloads/UploadPayload"; import { IUpload } from "./models/IUpload"; -import { IAbortablePromise, IImageInfo } from "matrix-js-sdk/src/@types/partials"; import { BlurhashEncoder } from "./BlurhashEncoder"; import SettingsStore from "./settings/SettingsStore"; import { decorateStartSendingTime, sendRoundTripMetric } from "./sendTimePerformanceMetrics"; -import { logger } from "matrix-js-sdk/src/logger"; - const MAX_WIDTH = 800; const MAX_HEIGHT = 600; diff --git a/src/CountlyAnalytics.ts b/src/CountlyAnalytics.ts index d99ec3d78a..da0021c2cf 100644 --- a/src/CountlyAnalytics.ts +++ b/src/CountlyAnalytics.ts @@ -17,6 +17,7 @@ limitations under the License. import { randomString } from "matrix-js-sdk/src/randomstring"; import { IContent } from "matrix-js-sdk/src/models/event"; import { sleep } from "matrix-js-sdk/src/utils"; +import { logger } from "matrix-js-sdk/src/logger"; import { getCurrentLanguage } from './languageHandler'; import PlatformPeg from './PlatformPeg'; @@ -25,8 +26,6 @@ import { MatrixClientPeg } from "./MatrixClientPeg"; import RoomViewStore from "./stores/RoomViewStore"; import { Action } from "./dispatcher/actions"; -import { logger } from "matrix-js-sdk/src/logger"; - const INACTIVITY_TIME = 20; // seconds const HEARTBEAT_INTERVAL = 5_000; // ms const SESSION_UPDATE_INTERVAL = 60; // seconds diff --git a/src/DeviceListener.ts b/src/DeviceListener.ts index f218e6c6a7..71b7f622fd 100644 --- a/src/DeviceListener.ts +++ b/src/DeviceListener.ts @@ -14,6 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from './MatrixClientPeg'; import dis from "./dispatcher/dispatcher"; import { @@ -32,11 +35,8 @@ import { import { isSecretStorageBeingAccessed, accessSecretStorage } from "./SecurityManager"; import { isSecureBackupRequired } from './utils/WellKnownUtils'; import { isLoggedIn } from './components/structures/MatrixChat'; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { ActionPayload } from "./dispatcher/payloads"; -import { logger } from "matrix-js-sdk/src/logger"; - const KEY_BACKUP_POLL_INTERVAL = 5 * 60 * 1000; export default class DeviceListener { diff --git a/src/GroupAddressPicker.js b/src/GroupAddressPicker.js index ea1813876c..6430090819 100644 --- a/src/GroupAddressPicker.js +++ b/src/GroupAddressPicker.js @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import Modal from './Modal'; import * as sdk from './'; import MultiInviter from './utils/MultiInviter'; diff --git a/src/IdentityAuthClient.tsx b/src/IdentityAuthClient.tsx index ae55c20438..66f9ad4dda 100644 --- a/src/IdentityAuthClient.tsx +++ b/src/IdentityAuthClient.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from "react"; import { SERVICE_TYPES } from 'matrix-js-sdk/src/service-types'; import { createClient, MatrixClient } from 'matrix-js-sdk/src/matrix'; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from './MatrixClientPeg'; import Modal from './Modal'; @@ -27,8 +28,6 @@ import { doesIdentityServerHaveTerms, useDefaultIdentityServer, } from './utils/IdentityServerUtils'; - -import { logger } from "matrix-js-sdk/src/logger"; import QuestionDialog from "./components/views/dialogs/QuestionDialog"; import { abbreviateUrl } from "./utils/UrlUtils"; diff --git a/src/Lifecycle.ts b/src/Lifecycle.ts index d351c46180..f984d20f71 100644 --- a/src/Lifecycle.ts +++ b/src/Lifecycle.ts @@ -22,6 +22,7 @@ import { InvalidStoreError } from "matrix-js-sdk/src/errors"; import { MatrixClient } from "matrix-js-sdk/src/client"; import { decryptAES, encryptAES, IEncryptedPayload } from "matrix-js-sdk/src/crypto/aes"; import { QueryDict } from 'matrix-js-sdk/src/utils'; +import { logger } from "matrix-js-sdk/src/logger"; import { IMatrixClientCreds, MatrixClientPeg } from './MatrixClientPeg'; import SecurityCustomisations from "./customisations/Security"; @@ -58,8 +59,6 @@ import LazyLoadingDisabledDialog from "./components/views/dialogs/LazyLoadingDis import SessionRestoreErrorDialog from "./components/views/dialogs/SessionRestoreErrorDialog"; import StorageEvictedDialog from "./components/views/dialogs/StorageEvictedDialog"; -import { logger } from "matrix-js-sdk/src/logger"; - const HOMESERVER_URL_KEY = "mx_hs_url"; const ID_SERVER_URL_KEY = "mx_is_url"; diff --git a/src/Livestream.ts b/src/Livestream.ts index 2389132762..b136fbeaea 100644 --- a/src/Livestream.ts +++ b/src/Livestream.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { ClientWidgetApi } from "matrix-widget-api"; + import { MatrixClientPeg } from "./MatrixClientPeg"; import SdkConfig from "./SdkConfig"; import { ElementWidgetActions } from "./stores/widgets/ElementWidgetActions"; diff --git a/src/Login.ts b/src/Login.ts index bb1ab2ef36..f7b188c64a 100644 --- a/src/Login.ts +++ b/src/Login.ts @@ -18,11 +18,11 @@ limitations under the License. // @ts-ignore - XXX: tsc doesn't like this: our js-sdk imports are complex so this isn't surprising import { createClient } from "matrix-js-sdk/src/matrix"; import { MatrixClient } from "matrix-js-sdk/src/client"; +import { logger } from "matrix-js-sdk/src/logger"; + import { IMatrixClientCreds } from "./MatrixClientPeg"; import SecurityCustomisations from "./customisations/Security"; -import { logger } from "matrix-js-sdk/src/logger"; - interface ILoginOptions { defaultDeviceDisplayName?: string; } diff --git a/src/MatrixClientPeg.ts b/src/MatrixClientPeg.ts index 978939e707..4f3d320ffd 100644 --- a/src/MatrixClientPeg.ts +++ b/src/MatrixClientPeg.ts @@ -23,21 +23,21 @@ import { MemoryStore } from 'matrix-js-sdk/src/store/memory'; import * as utils from 'matrix-js-sdk/src/utils'; import { EventTimeline } from 'matrix-js-sdk/src/models/event-timeline'; import { EventTimelineSet } from 'matrix-js-sdk/src/models/event-timeline-set'; +import { verificationMethods } from 'matrix-js-sdk/src/crypto'; +import { SHOW_QR_CODE_METHOD } from "matrix-js-sdk/src/crypto/verification/QRCode"; +import { logger } from "matrix-js-sdk/src/logger"; + import * as sdk from './index'; import createMatrixClient from './utils/createMatrixClient'; import SettingsStore from './settings/SettingsStore'; import MatrixActionCreators from './actions/MatrixActionCreators'; import Modal from './Modal'; -import { verificationMethods } from 'matrix-js-sdk/src/crypto'; import MatrixClientBackedSettingsHandler from "./settings/handlers/MatrixClientBackedSettingsHandler"; import * as StorageManager from './utils/StorageManager'; import IdentityAuthClient from './IdentityAuthClient'; import { crossSigningCallbacks, tryToUnlockSecretStorageWithDehydrationKey } from './SecurityManager'; -import { SHOW_QR_CODE_METHOD } from "matrix-js-sdk/src/crypto/verification/QRCode"; import SecurityCustomisations from "./customisations/Security"; -import { logger } from "matrix-js-sdk/src/logger"; - export interface IMatrixClientCreds { homeserverUrl: string; identityServerUrl: string; diff --git a/src/MediaDeviceHandler.ts b/src/MediaDeviceHandler.ts index 9123d45bc3..ddf1977bf0 100644 --- a/src/MediaDeviceHandler.ts +++ b/src/MediaDeviceHandler.ts @@ -15,13 +15,13 @@ See the License for the specific language governing permissions and limitations under the License. */ +import EventEmitter from 'events'; +import { logger } from "matrix-js-sdk/src/logger"; + import SettingsStore from "./settings/SettingsStore"; import { SettingLevel } from "./settings/SettingLevel"; -import EventEmitter from 'events'; import { MatrixClientPeg } from "./MatrixClientPeg"; -import { logger } from "matrix-js-sdk/src/logger"; - // XXX: MediaDeviceKind is a union type, so we make our own enum export enum MediaDeviceKindEnum { AudioOutput = "audiooutput", diff --git a/src/Notifier.ts b/src/Notifier.ts index 1acd028b08..1ca8b4e710 100644 --- a/src/Notifier.ts +++ b/src/Notifier.ts @@ -19,6 +19,7 @@ limitations under the License. import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { Room } from "matrix-js-sdk/src/models/room"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from './MatrixClientPeg'; import SdkConfig from './SdkConfig'; @@ -38,8 +39,6 @@ import UserActivity from "./UserActivity"; import { mediaFromMxc } from "./customisations/Media"; import ErrorDialog from "./components/views/dialogs/ErrorDialog"; -import { logger } from "matrix-js-sdk/src/logger"; - /* * Dispatches: * { diff --git a/src/PasswordReset.ts b/src/PasswordReset.ts index 76f54de245..7b0b6f9f84 100644 --- a/src/PasswordReset.ts +++ b/src/PasswordReset.ts @@ -16,6 +16,7 @@ limitations under the License. */ import { createClient, IRequestTokenResponse, MatrixClient } from 'matrix-js-sdk/src/matrix'; + import { _t } from './languageHandler'; /** diff --git a/src/PosthogAnalytics.ts b/src/PosthogAnalytics.ts index bdc0814b5d..6c31ad04b5 100644 --- a/src/PosthogAnalytics.ts +++ b/src/PosthogAnalytics.ts @@ -15,13 +15,13 @@ limitations under the License. */ import posthog, { PostHog } from 'posthog-js'; +import { MatrixClient } from "matrix-js-sdk/src/client"; +import { logger } from "matrix-js-sdk/src/logger"; + import PlatformPeg from './PlatformPeg'; import SdkConfig from './SdkConfig'; import SettingsStore from './settings/SettingsStore'; import { MatrixClientPeg } from "./MatrixClientPeg"; -import { MatrixClient } from "matrix-js-sdk/src/client"; - -import { logger } from "matrix-js-sdk/src/logger"; /* Posthog analytics tracking. * diff --git a/src/Presence.ts b/src/Presence.ts index e58ed61901..4e4cd810ac 100644 --- a/src/Presence.ts +++ b/src/Presence.ts @@ -16,13 +16,13 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from "./MatrixClientPeg"; import dis from "./dispatcher/dispatcher"; import Timer from './utils/Timer'; import { ActionPayload } from "./dispatcher/payloads"; -import { logger } from "matrix-js-sdk/src/logger"; - // Time in ms after that a user is considered as unavailable/away const UNAVAILABLE_TIME_MS = 3 * 60 * 1000; // 3 mins diff --git a/src/Registration.tsx b/src/Registration.tsx index 90e81c0d45..a90c5c069d 100644 --- a/src/Registration.tsx +++ b/src/Registration.tsx @@ -21,6 +21,7 @@ limitations under the License. */ import React from "react"; + import dis from './dispatcher/dispatcher'; import Modal from './Modal'; import { _t } from './languageHandler'; diff --git a/src/Resend.ts b/src/Resend.ts index 0b5c279165..241fb7f89b 100644 --- a/src/Resend.ts +++ b/src/Resend.ts @@ -16,12 +16,11 @@ limitations under the License. import { MatrixEvent, EventStatus } from 'matrix-js-sdk/src/models/event'; import { Room } from 'matrix-js-sdk/src/models/room'; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from './MatrixClientPeg'; import dis from './dispatcher/dispatcher'; -import { logger } from "matrix-js-sdk/src/logger"; - export default class Resend { static resendUnsentEvents(room: Room): Promise { return Promise.all(room.getPendingEvents().filter(function(ev: MatrixEvent) { diff --git a/src/RoomInvite.tsx b/src/RoomInvite.tsx index 305cf47b27..17058d2bc8 100644 --- a/src/RoomInvite.tsx +++ b/src/RoomInvite.tsx @@ -18,6 +18,7 @@ import React from "react"; import { Room } from "matrix-js-sdk/src/models/room"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { User } from "matrix-js-sdk/src/models/user"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from './MatrixClientPeg'; import MultiInviter, { CompletionStates } from './utils/MultiInviter'; @@ -30,8 +31,6 @@ import BaseAvatar from "./components/views/avatars/BaseAvatar"; import { mediaFromMxc } from "./customisations/Media"; import ErrorDialog from "./components/views/dialogs/ErrorDialog"; -import { logger } from "matrix-js-sdk/src/logger"; - export interface IInviteResult { states: CompletionStates; inviter: MultiInviter; diff --git a/src/RoomNotifs.ts b/src/RoomNotifs.ts index 5abee9a6ad..62804dd950 100644 --- a/src/RoomNotifs.ts +++ b/src/RoomNotifs.ts @@ -15,11 +15,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { MatrixClientPeg } from './MatrixClientPeg'; import { PushProcessor } from 'matrix-js-sdk/src/pushprocessor'; import { NotificationCountType, Room } from "matrix-js-sdk/src/models/room"; import { IAnnotatedPushRule, PushRuleKind } from "matrix-js-sdk/src/@types/PushRules"; +import { MatrixClientPeg } from './MatrixClientPeg'; + export enum RoomNotifState { AllMessagesLoud = 'all_messages_loud', AllMessages = 'all_messages', diff --git a/src/ScalarAuthClient.ts b/src/ScalarAuthClient.ts index e791633c8e..9d71bf5b05 100644 --- a/src/ScalarAuthClient.ts +++ b/src/ScalarAuthClient.ts @@ -15,17 +15,16 @@ limitations under the License. */ import url from 'url'; +import request from "browser-request"; +import { SERVICE_TYPES } from "matrix-js-sdk/src/service-types"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { logger } from "matrix-js-sdk/src/logger"; + import SettingsStore from "./settings/SettingsStore"; import { Service, startTermsFlow, TermsInteractionCallback, TermsNotSignedError } from './Terms'; import { MatrixClientPeg } from "./MatrixClientPeg"; -import request from "browser-request"; - import SdkConfig from "./SdkConfig"; import { WidgetType } from "./widgets/WidgetType"; -import { SERVICE_TYPES } from "matrix-js-sdk/src/service-types"; -import { Room } from "matrix-js-sdk/src/models/room"; - -import { logger } from "matrix-js-sdk/src/logger"; // The version of the integration manager API we're intending to work with const imApiVersion = "1.1"; diff --git a/src/ScalarMessaging.ts b/src/ScalarMessaging.ts index 3d390ea095..563a2c331b 100644 --- a/src/ScalarMessaging.ts +++ b/src/ScalarMessaging.ts @@ -235,8 +235,10 @@ Example: } */ -import { MatrixClientPeg } from './MatrixClientPeg'; import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; +import { logger } from "matrix-js-sdk/src/logger"; + +import { MatrixClientPeg } from './MatrixClientPeg'; import dis from './dispatcher/dispatcher'; import WidgetUtils from './utils/WidgetUtils'; import RoomViewStore from './stores/RoomViewStore'; @@ -245,8 +247,6 @@ import { IntegrationManagers } from "./integrations/IntegrationManagers"; import { WidgetType } from "./widgets/WidgetType"; import { objectClone } from "./utils/objects"; -import { logger } from "matrix-js-sdk/src/logger"; - enum Action { CloseScalar = "close_scalar", GetWidgets = "get_widgets", diff --git a/src/Searching.ts b/src/Searching.ts index 37f85efa77..007aca4a51 100644 --- a/src/Searching.ts +++ b/src/Searching.ts @@ -24,11 +24,11 @@ import { } from "matrix-js-sdk/src/@types/search"; import { IRoomEventFilter } from "matrix-js-sdk/src/filter"; import { EventType } from "matrix-js-sdk/src/@types/event"; +import { SearchResult } from "matrix-js-sdk/src/models/search-result"; import { ISearchArgs } from "./indexing/BaseEventIndexManager"; import EventIndexPeg from "./indexing/EventIndexPeg"; import { MatrixClientPeg } from "./MatrixClientPeg"; -import { SearchResult } from "matrix-js-sdk/src/models/search-result"; const SEARCH_LIMIT = 10; diff --git a/src/SecurityManager.ts b/src/SecurityManager.ts index a184e6e9cb..83115bcbf8 100644 --- a/src/SecurityManager.ts +++ b/src/SecurityManager.ts @@ -17,21 +17,21 @@ limitations under the License. import { ICryptoCallbacks } from 'matrix-js-sdk/src/matrix'; import { ISecretStorageKeyInfo } from 'matrix-js-sdk/src/crypto/api'; import { MatrixClient } from 'matrix-js-sdk/src/client'; +import { deriveKey } from 'matrix-js-sdk/src/crypto/key_passphrase'; +import { decodeRecoveryKey } from 'matrix-js-sdk/src/crypto/recoverykey'; +import { encodeBase64 } from "matrix-js-sdk/src/crypto/olmlib"; +import { DeviceTrustLevel } from 'matrix-js-sdk/src/crypto/CrossSigning'; +import { logger } from "matrix-js-sdk/src/logger"; + import Modal from './Modal'; import * as sdk from './index'; import { MatrixClientPeg } from './MatrixClientPeg'; -import { deriveKey } from 'matrix-js-sdk/src/crypto/key_passphrase'; -import { decodeRecoveryKey } from 'matrix-js-sdk/src/crypto/recoverykey'; import { _t } from './languageHandler'; -import { encodeBase64 } from "matrix-js-sdk/src/crypto/olmlib"; import { isSecureBackupRequired } from './utils/WellKnownUtils'; import AccessSecretStorageDialog from './components/views/dialogs/security/AccessSecretStorageDialog'; import RestoreKeyBackupDialog from './components/views/dialogs/security/RestoreKeyBackupDialog'; import SettingsStore from "./settings/SettingsStore"; import SecurityCustomisations from "./customisations/Security"; -import { DeviceTrustLevel } from 'matrix-js-sdk/src/crypto/CrossSigning'; - -import { logger } from "matrix-js-sdk/src/logger"; // This stores the secret storage private keys in memory for the JS SDK. This is // only meant to act as a cache to avoid prompting the user multiple times diff --git a/src/SendHistoryManager.ts b/src/SendHistoryManager.ts index 9a593adbee..69383d85d5 100644 --- a/src/SendHistoryManager.ts +++ b/src/SendHistoryManager.ts @@ -16,12 +16,11 @@ limitations under the License. import { clamp } from "lodash"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { logger } from "matrix-js-sdk/src/logger"; import { SerializedPart } from "./editor/parts"; import EditorModel from "./editor/model"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IHistoryItem { parts: SerializedPart[]; replyEventId?: string; diff --git a/src/SlashCommands.tsx b/src/SlashCommands.tsx index 4ffab08780..b97f5bde06 100644 --- a/src/SlashCommands.tsx +++ b/src/SlashCommands.tsx @@ -19,8 +19,10 @@ limitations under the License. import * as React from 'react'; import { User } from "matrix-js-sdk/src/models/user"; - import * as ContentHelpers from 'matrix-js-sdk/src/content-helpers'; +import { parseFragment as parseHtml, Element as ChildElement } from "parse5"; +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from './MatrixClientPeg'; import dis from './dispatcher/dispatcher'; import { _t, _td } from './languageHandler'; @@ -36,7 +38,6 @@ import { getDefaultIdentityServerUrl, useDefaultIdentityServer } from './utils/I import { isPermalinkHost, parsePermalink } from "./utils/permalinks/Permalinks"; import { WidgetType } from "./widgets/WidgetType"; import { Jitsi } from "./widgets/Jitsi"; -import { parseFragment as parseHtml, Element as ChildElement } from "parse5"; import BugReportDialog from "./components/views/dialogs/BugReportDialog"; import { ensureDMExists } from "./createRoom"; import { ViewUserPayload } from "./dispatcher/payloads/ViewUserPayload"; @@ -54,8 +55,6 @@ import DevtoolsDialog from './components/views/dialogs/DevtoolsDialog'; import RoomUpgradeWarningDialog from "./components/views/dialogs/RoomUpgradeWarningDialog"; import InfoDialog from "./components/views/dialogs/InfoDialog"; import SlashCommandHelpDialog from "./components/views/dialogs/SlashCommandHelpDialog"; - -import { logger } from "matrix-js-sdk/src/logger"; import { shouldShowComponent } from "./customisations/helpers/UIComponents"; // XXX: workaround for https://github.com/microsoft/TypeScript/issues/31816 diff --git a/src/Terms.ts b/src/Terms.ts index 86d006c832..325a132daa 100644 --- a/src/Terms.ts +++ b/src/Terms.ts @@ -16,13 +16,12 @@ limitations under the License. import classNames from 'classnames'; import { SERVICE_TYPES } from 'matrix-js-sdk/src/service-types'; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from './MatrixClientPeg'; import * as sdk from '.'; import Modal from './Modal'; -import { logger } from "matrix-js-sdk/src/logger"; - export class TermsNotSignedError extends Error {} /** diff --git a/src/TextForEvent.tsx b/src/TextForEvent.tsx index 82c094ef48..13348b2992 100644 --- a/src/TextForEvent.tsx +++ b/src/TextForEvent.tsx @@ -14,6 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ import React from 'react'; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { logger } from "matrix-js-sdk/src/logger"; +import { removeDirectionOverrideChars } from 'matrix-js-sdk/src/utils'; + import { _t } from './languageHandler'; import * as Roles from './Roles'; import { isValid3pidInvite } from "./RoomInvite"; @@ -24,12 +28,8 @@ import { RightPanelPhases } from './stores/RightPanelStorePhases'; import { Action } from './dispatcher/actions'; import defaultDispatcher from './dispatcher/dispatcher'; import { SetRightPanelPhasePayload } from './dispatcher/payloads/SetRightPanelPhasePayload'; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { MatrixClientPeg } from "./MatrixClientPeg"; -import { logger } from "matrix-js-sdk/src/logger"; -import { removeDirectionOverrideChars } from 'matrix-js-sdk/src/utils'; - // These functions are frequently used just to check whether an event has // any text to display at all. For this reason they return deferred values // to avoid the expense of looking up translations when they're not needed. diff --git a/src/VoipUserMapper.ts b/src/VoipUserMapper.ts index e2e590548e..c8fbf51d9d 100644 --- a/src/VoipUserMapper.ts +++ b/src/VoipUserMapper.ts @@ -14,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { Room } from 'matrix-js-sdk/src/models/room'; +import { logger } from "matrix-js-sdk/src/logger"; + import { ensureVirtualRoomExists, findDMForUser } from './createRoom'; import { MatrixClientPeg } from "./MatrixClientPeg"; import DMRoomMap from "./utils/DMRoomMap"; import CallHandler, { VIRTUAL_ROOM_EVENT_TYPE } from './CallHandler'; -import { Room } from 'matrix-js-sdk/src/models/room'; - -import { logger } from "matrix-js-sdk/src/logger"; // Functions for mapping virtual users & rooms. Currently the only lookup // is sip virtual: there could be others in the future. diff --git a/src/actions/GroupActions.ts b/src/actions/GroupActions.ts index 81470d1221..44776f0a25 100644 --- a/src/actions/GroupActions.ts +++ b/src/actions/GroupActions.ts @@ -15,9 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixClient } from "matrix-js-sdk/src/client"; + import { asyncAction } from './actionCreators'; import { AsyncActionPayload } from "../dispatcher/payloads"; -import { MatrixClient } from "matrix-js-sdk/src/client"; export default class GroupActions { /** diff --git a/src/actions/RoomListActions.ts b/src/actions/RoomListActions.ts index d248197f7f..7860e1b2ee 100644 --- a/src/actions/RoomListActions.ts +++ b/src/actions/RoomListActions.ts @@ -15,20 +15,20 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixClient } from "matrix-js-sdk/src/client"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { logger } from "matrix-js-sdk/src/logger"; + import { asyncAction } from './actionCreators'; import Modal from '../Modal'; import * as Rooms from '../Rooms'; import { _t } from '../languageHandler'; -import { MatrixClient } from "matrix-js-sdk/src/client"; -import { Room } from "matrix-js-sdk/src/models/room"; import { AsyncActionPayload } from "../dispatcher/payloads"; import RoomListStore from "../stores/room-list/RoomListStore"; import { SortAlgorithm } from "../stores/room-list/algorithms/models"; import { DefaultTagID } from "../stores/room-list/models"; import ErrorDialog from '../components/views/dialogs/ErrorDialog'; -import { logger } from "matrix-js-sdk/src/logger"; - export default class RoomListActions { /** * Creates an action thunk that will do an asynchronous request to diff --git a/src/actions/TagOrderActions.ts b/src/actions/TagOrderActions.ts index dc538134a1..4ae600472e 100644 --- a/src/actions/TagOrderActions.ts +++ b/src/actions/TagOrderActions.ts @@ -15,11 +15,12 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixClient } from "matrix-js-sdk/src/client"; + import Analytics from '../Analytics'; import { asyncAction } from './actionCreators'; import GroupFilterOrderStore from '../stores/GroupFilterOrderStore'; import { AsyncActionPayload } from "../dispatcher/payloads"; -import { MatrixClient } from "matrix-js-sdk/src/client"; export default class TagOrderActions { /** diff --git a/src/async-components/views/dialogs/eventindex/DisableEventIndexDialog.tsx b/src/async-components/views/dialogs/eventindex/DisableEventIndexDialog.tsx index 4d8f5e5663..ccbd6e66b7 100644 --- a/src/async-components/views/dialogs/eventindex/DisableEventIndexDialog.tsx +++ b/src/async-components/views/dialogs/eventindex/DisableEventIndexDialog.tsx @@ -21,11 +21,11 @@ import Spinner from "../../../../components/views/elements/Spinner"; import DialogButtons from "../../../../components/views/elements/DialogButtons"; import dis from "../../../../dispatcher/dispatcher"; import { _t } from '../../../../languageHandler'; - import SettingsStore from "../../../../settings/SettingsStore"; import EventIndexPeg from "../../../../indexing/EventIndexPeg"; import { Action } from "../../../../dispatcher/actions"; import { SettingLevel } from "../../../../settings/SettingLevel"; + interface IProps { onFinished: (success: boolean) => void; } diff --git a/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx b/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx index ac7875b920..c5e0fecacc 100644 --- a/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx +++ b/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx @@ -15,10 +15,10 @@ limitations under the License. */ import React from 'react'; + import { _t } from '../../../../languageHandler'; import SdkConfig from '../../../../SdkConfig'; import SettingsStore from "../../../../settings/SettingsStore"; - import Modal from '../../../../Modal'; import { formatBytes, formatCountLong } from "../../../../utils/FormattingUtils"; import EventIndexPeg from "../../../../indexing/EventIndexPeg"; diff --git a/src/async-components/views/dialogs/security/CreateKeyBackupDialog.js b/src/async-components/views/dialogs/security/CreateKeyBackupDialog.js index 8527f78895..9d449e8b80 100644 --- a/src/async-components/views/dialogs/security/CreateKeyBackupDialog.js +++ b/src/async-components/views/dialogs/security/CreateKeyBackupDialog.js @@ -17,17 +17,17 @@ limitations under the License. import React, { createRef } from 'react'; import FileSaver from 'file-saver'; +import PropTypes from 'prop-types'; +import { logger } from "matrix-js-sdk/src/logger"; + import * as sdk from '../../../../index'; import { MatrixClientPeg } from '../../../../MatrixClientPeg'; -import PropTypes from 'prop-types'; import { _t, _td } from '../../../../languageHandler'; import { accessSecretStorage } from '../../../../SecurityManager'; import AccessibleButton from "../../../../components/views/elements/AccessibleButton"; import { copyNode } from "../../../../utils/strings"; import PassphraseField from "../../../../components/views/auth/PassphraseField"; -import { logger } from "matrix-js-sdk/src/logger"; - const PHASE_PASSPHRASE = 0; const PHASE_PASSPHRASE_CONFIRM = 1; const PHASE_SHOWKEY = 2; diff --git a/src/async-components/views/dialogs/security/CreateSecretStorageDialog.js b/src/async-components/views/dialogs/security/CreateSecretStorageDialog.js index 7a21b7075b..a760e62454 100644 --- a/src/async-components/views/dialogs/security/CreateSecretStorageDialog.js +++ b/src/async-components/views/dialogs/security/CreateSecretStorageDialog.js @@ -17,9 +17,11 @@ limitations under the License. import React, { createRef } from 'react'; import PropTypes from 'prop-types'; +import FileSaver from 'file-saver'; +import { logger } from "matrix-js-sdk/src/logger"; + import * as sdk from '../../../../index'; import { MatrixClientPeg } from '../../../../MatrixClientPeg'; -import FileSaver from 'file-saver'; import { _t, _td } from '../../../../languageHandler'; import Modal from '../../../../Modal'; import { promptForBackupPassphrase } from '../../../../SecurityManager'; @@ -34,8 +36,6 @@ import RestoreKeyBackupDialog from "../../../../components/views/dialogs/securit import { getSecureBackupSetupMethods, isSecureBackupRequired } from '../../../../utils/WellKnownUtils'; import SecurityCustomisations from "../../../../customisations/Security"; -import { logger } from "matrix-js-sdk/src/logger"; - const PHASE_LOADING = 0; const PHASE_LOADERROR = 1; const PHASE_CHOOSE_KEY_PASSPHRASE = 2; diff --git a/src/async-components/views/dialogs/security/ExportE2eKeysDialog.js b/src/async-components/views/dialogs/security/ExportE2eKeysDialog.js index c21e17a7a1..c80f935a80 100644 --- a/src/async-components/views/dialogs/security/ExportE2eKeysDialog.js +++ b/src/async-components/views/dialogs/security/ExportE2eKeysDialog.js @@ -17,14 +17,13 @@ limitations under the License. import FileSaver from 'file-saver'; import React, { createRef } from 'react'; import PropTypes from 'prop-types'; -import { _t } from '../../../../languageHandler'; - import { MatrixClient } from 'matrix-js-sdk/src/client'; +import { logger } from "matrix-js-sdk/src/logger"; + +import { _t } from '../../../../languageHandler'; import * as MegolmExportEncryption from '../../../../utils/MegolmExportEncryption'; import * as sdk from '../../../../index'; -import { logger } from "matrix-js-sdk/src/logger"; - const PHASE_EDIT = 1; const PHASE_EXPORTING = 2; diff --git a/src/async-components/views/dialogs/security/ImportE2eKeysDialog.js b/src/async-components/views/dialogs/security/ImportE2eKeysDialog.js index 51d2861396..41b7e4e9e0 100644 --- a/src/async-components/views/dialogs/security/ImportE2eKeysDialog.js +++ b/src/async-components/views/dialogs/security/ImportE2eKeysDialog.js @@ -16,14 +16,13 @@ limitations under the License. import React, { createRef } from 'react'; import PropTypes from 'prop-types'; - import { MatrixClient } from 'matrix-js-sdk/src/client'; +import { logger } from "matrix-js-sdk/src/logger"; + import * as MegolmExportEncryption from '../../../../utils/MegolmExportEncryption'; import * as sdk from '../../../../index'; import { _t } from '../../../../languageHandler'; -import { logger } from "matrix-js-sdk/src/logger"; - function readFileAsArrayBuffer(file) { return new Promise((resolve, reject) => { const reader = new FileReader(); diff --git a/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.js b/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.js index 263d25c98c..632e4f93bd 100644 --- a/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.js +++ b/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.js @@ -17,6 +17,7 @@ limitations under the License. import React from "react"; import PropTypes from "prop-types"; + import * as sdk from "../../../../index"; import { MatrixClientPeg } from '../../../../MatrixClientPeg'; import dis from "../../../../dispatcher/dispatcher"; diff --git a/src/async-components/views/dialogs/security/RecoveryMethodRemovedDialog.js b/src/async-components/views/dialogs/security/RecoveryMethodRemovedDialog.js index f586c9430a..3dddec5f45 100644 --- a/src/async-components/views/dialogs/security/RecoveryMethodRemovedDialog.js +++ b/src/async-components/views/dialogs/security/RecoveryMethodRemovedDialog.js @@ -17,6 +17,7 @@ limitations under the License. import React from "react"; import PropTypes from "prop-types"; + import * as sdk from "../../../../index"; import dis from "../../../../dispatcher/dispatcher"; import { _t } from "../../../../languageHandler"; diff --git a/src/audio/Playback.ts b/src/audio/Playback.ts index f3baa71a1e..633eb0ef78 100644 --- a/src/audio/Playback.ts +++ b/src/audio/Playback.ts @@ -15,16 +15,16 @@ limitations under the License. */ import EventEmitter from "events"; +import { SimpleObservable } from "matrix-widget-api"; +import { logger } from "matrix-js-sdk/src/logger"; + import { UPDATE_EVENT } from "../stores/AsyncStore"; import { arrayFastResample, arrayRescale, arraySeed, arraySmoothingResample } from "../utils/arrays"; -import { SimpleObservable } from "matrix-widget-api"; import { IDestroyable } from "../utils/IDestroyable"; import { PlaybackClock } from "./PlaybackClock"; import { createAudioContext, decodeOgg } from "./compat"; import { clamp } from "../utils/numbers"; -import { logger } from "matrix-js-sdk/src/logger"; - export enum PlaybackState { Decoding = "decoding", Stopped = "stopped", // no progress on timeline diff --git a/src/audio/PlaybackClock.ts b/src/audio/PlaybackClock.ts index 5716d6ac2f..f38be9d134 100644 --- a/src/audio/PlaybackClock.ts +++ b/src/audio/PlaybackClock.ts @@ -15,9 +15,10 @@ limitations under the License. */ import { SimpleObservable } from "matrix-widget-api"; -import { IDestroyable } from "../utils/IDestroyable"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { IDestroyable } from "../utils/IDestroyable"; + /** * Tracks accurate human-perceptible time for an audio clip, as informed * by managed playback. This clock is tightly coupled with the operation diff --git a/src/audio/PlaybackQueue.ts b/src/audio/PlaybackQueue.ts index a1a86f6613..3b1b001bb9 100644 --- a/src/audio/PlaybackQueue.ts +++ b/src/audio/PlaybackQueue.ts @@ -17,6 +17,9 @@ limitations under the License. import { MatrixClient } from "matrix-js-sdk/src/client"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { Room } from "matrix-js-sdk/src/models/room"; +import { EventType } from "matrix-js-sdk/src/@types/event"; +import { logger } from "matrix-js-sdk/src/logger"; + import { Playback, PlaybackState } from "./Playback"; import { UPDATE_EVENT } from "../stores/AsyncStore"; import { MatrixClientPeg } from "../MatrixClientPeg"; @@ -24,9 +27,6 @@ import { arrayFastClone } from "../utils/arrays"; import { PlaybackManager } from "./PlaybackManager"; import { isVoiceMessage } from "../utils/EventUtils"; import RoomViewStore from "../stores/RoomViewStore"; -import { EventType } from "matrix-js-sdk/src/@types/event"; - -import { logger } from "matrix-js-sdk/src/logger"; /** * Audio playback queue management for a given room. This keeps track of where the user diff --git a/src/audio/VoiceRecording.ts b/src/audio/VoiceRecording.ts index 3ff02be774..1c6c8b40d2 100644 --- a/src/audio/VoiceRecording.ts +++ b/src/audio/VoiceRecording.ts @@ -17,23 +17,23 @@ limitations under the License. import * as Recorder from 'opus-recorder'; import encoderPath from 'opus-recorder/dist/encoderWorker.min.js'; import { MatrixClient } from "matrix-js-sdk/src/client"; -import MediaDeviceHandler from "../MediaDeviceHandler"; import { SimpleObservable } from "matrix-widget-api"; import EventEmitter from "events"; +import { IEncryptedFile } from "matrix-js-sdk/src/@types/event"; +import { logger } from "matrix-js-sdk/src/logger"; + +import MediaDeviceHandler from "../MediaDeviceHandler"; import { IDestroyable } from "../utils/IDestroyable"; import { Singleflight } from "../utils/Singleflight"; import { PayloadEvent, WORKLET_NAME } from "./consts"; import { UPDATE_EVENT } from "../stores/AsyncStore"; import { Playback } from "./Playback"; import { createAudioContext } from "./compat"; -import { IEncryptedFile } from "matrix-js-sdk/src/@types/event"; import { uploadFile } from "../ContentMessages"; import { FixedRollingArray } from "../utils/FixedRollingArray"; import { clamp } from "../utils/numbers"; import mxRecorderWorkletPath from "./RecorderWorklet"; -import { logger } from "matrix-js-sdk/src/logger"; - const CHANNELS = 1; // stereo isn't important export const SAMPLE_RATE = 48000; // 48khz is what WebRTC uses. 12khz is where we lose quality. const BITRATE = 24000; // 24kbps is pretty high quality for our use case in opus. diff --git a/src/audio/compat.ts b/src/audio/compat.ts index 37cbf4bb7b..3cab9564f7 100644 --- a/src/audio/compat.ts +++ b/src/audio/compat.ts @@ -14,15 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { SAMPLE_RATE } from "./VoiceRecording"; - // @ts-ignore - we know that this is not a module. We're looking for a path. import decoderWasmPath from 'opus-recorder/dist/decoderWorker.min.wasm'; import wavEncoderPath from 'opus-recorder/dist/waveWorker.min.js'; import decoderPath from 'opus-recorder/dist/decoderWorker.min.js'; - import { logger } from "matrix-js-sdk/src/logger"; +import { SAMPLE_RATE } from "./VoiceRecording"; + export function createAudioContext(opts?: AudioContextOptions): AudioContext { if (window.AudioContext) { return new AudioContext(opts); diff --git a/src/autocomplete/AutocompleteProvider.tsx b/src/autocomplete/AutocompleteProvider.tsx index 2d82a9f591..5ae3e985c6 100644 --- a/src/autocomplete/AutocompleteProvider.tsx +++ b/src/autocomplete/AutocompleteProvider.tsx @@ -17,6 +17,7 @@ limitations under the License. */ import React from 'react'; + import type { ICompletion, ISelectionRange } from './Autocompleter'; export interface ICommand { diff --git a/src/autocomplete/CommandProvider.tsx b/src/autocomplete/CommandProvider.tsx index 143b7e4cdc..49241e4354 100644 --- a/src/autocomplete/CommandProvider.tsx +++ b/src/autocomplete/CommandProvider.tsx @@ -18,6 +18,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from '../languageHandler'; import AutocompleteProvider from './AutocompleteProvider'; import QueryMatcher from './QueryMatcher'; diff --git a/src/autocomplete/CommunityProvider.tsx b/src/autocomplete/CommunityProvider.tsx index 4b42f4c64e..f17c801304 100644 --- a/src/autocomplete/CommunityProvider.tsx +++ b/src/autocomplete/CommunityProvider.tsx @@ -17,12 +17,13 @@ limitations under the License. import React from 'react'; import Group from "matrix-js-sdk/src/models/group"; +import { sortBy } from "lodash"; + import { _t } from '../languageHandler'; import AutocompleteProvider from './AutocompleteProvider'; import { MatrixClientPeg } from '../MatrixClientPeg'; import QueryMatcher from './QueryMatcher'; import { PillCompletion } from './Components'; -import { sortBy } from "lodash"; import { makeGroupPermalink } from "../utils/permalinks/Permalinks"; import { ICompletion, ISelectionRange } from "./Autocompleter"; import FlairStore from "../stores/FlairStore"; diff --git a/src/autocomplete/EmojiProvider.tsx b/src/autocomplete/EmojiProvider.tsx index 326651e037..3beddc3311 100644 --- a/src/autocomplete/EmojiProvider.tsx +++ b/src/autocomplete/EmojiProvider.tsx @@ -18,17 +18,17 @@ limitations under the License. */ import React from 'react'; +import { uniq, sortBy } from 'lodash'; +import EMOTICON_REGEX from 'emojibase-regex/emoticon'; + import { _t } from '../languageHandler'; import AutocompleteProvider from './AutocompleteProvider'; import QueryMatcher from './QueryMatcher'; import { PillCompletion } from './Components'; import { ICompletion, ISelectionRange } from './Autocompleter'; -import { uniq, sortBy } from 'lodash'; import SettingsStore from "../settings/SettingsStore"; import { EMOJI, IEmoji } from '../emoji'; -import EMOTICON_REGEX from 'emojibase-regex/emoticon'; - const LIMIT = 20; // Match for ascii-style ";-)" emoticons or ":wink:" shortcodes provided by emojibase diff --git a/src/autocomplete/UserProvider.tsx b/src/autocomplete/UserProvider.tsx index 48854657de..9f5cd1163d 100644 --- a/src/autocomplete/UserProvider.tsx +++ b/src/autocomplete/UserProvider.tsx @@ -18,18 +18,18 @@ limitations under the License. */ import React from 'react'; -import { _t } from '../languageHandler'; -import AutocompleteProvider from './AutocompleteProvider'; -import { PillCompletion } from './Components'; -import QueryMatcher from './QueryMatcher'; import { sortBy } from 'lodash'; -import { MatrixClientPeg } from '../MatrixClientPeg'; - import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { Room } from "matrix-js-sdk/src/models/room"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { RoomState } from "matrix-js-sdk/src/models/room-state"; import { EventTimeline } from "matrix-js-sdk/src/models/event-timeline"; + +import { MatrixClientPeg } from '../MatrixClientPeg'; +import QueryMatcher from './QueryMatcher'; +import { PillCompletion } from './Components'; +import AutocompleteProvider from './AutocompleteProvider'; +import { _t } from '../languageHandler'; import { makeUserPermalink } from "../utils/permalinks/Permalinks"; import { ICompletion, ISelectionRange } from "./Autocompleter"; import MemberAvatar from '../components/views/avatars/MemberAvatar'; diff --git a/src/boundThreepids.ts b/src/boundThreepids.ts index 94ff36ad4f..a703d10fd7 100644 --- a/src/boundThreepids.ts +++ b/src/boundThreepids.ts @@ -16,6 +16,7 @@ limitations under the License. import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; import { MatrixClient } from "matrix-js-sdk/src/client"; + import IdentityAuthClient from './IdentityAuthClient'; export async function getThreepidsWithBindStatus( diff --git a/src/components/structures/CallEventGrouper.ts b/src/components/structures/CallEventGrouper.ts index 84e004d1de..7a73126eb0 100644 --- a/src/components/structures/CallEventGrouper.ts +++ b/src/components/structures/CallEventGrouper.ts @@ -17,8 +17,9 @@ limitations under the License. import { EventType } from "matrix-js-sdk/src/@types/event"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { CallEvent, CallState, CallType, MatrixCall } from "matrix-js-sdk/src/webrtc/call"; -import CallHandler, { CallHandlerEvent } from '../../CallHandler'; import { EventEmitter } from 'events'; + +import CallHandler, { CallHandlerEvent } from '../../CallHandler'; import { MatrixClientPeg } from "../../MatrixClientPeg"; import defaultDispatcher from "../../dispatcher/dispatcher"; diff --git a/src/components/structures/CustomRoomTagPanel.js b/src/components/structures/CustomRoomTagPanel.js index 5e31048207..365b30bb0e 100644 --- a/src/components/structures/CustomRoomTagPanel.js +++ b/src/components/structures/CustomRoomTagPanel.js @@ -15,11 +15,12 @@ limitations under the License. */ import React from 'react'; +import classNames from 'classnames'; + import CustomRoomTagStore from '../../stores/CustomRoomTagStore'; import AutoHideScrollbar from './AutoHideScrollbar'; import * as sdk from '../../index'; import dis from '../../dispatcher/dispatcher'; -import classNames from 'classnames'; import * as FormattingUtils from '../../utils/FormattingUtils'; import { replaceableComponent } from "../../utils/replaceableComponent"; diff --git a/src/components/structures/EmbeddedPage.tsx b/src/components/structures/EmbeddedPage.tsx index 40aea55c70..b29a1a43d6 100644 --- a/src/components/structures/EmbeddedPage.tsx +++ b/src/components/structures/EmbeddedPage.tsx @@ -18,17 +18,17 @@ limitations under the License. import React from 'react'; import request from 'browser-request'; -import { _t } from '../../languageHandler'; import sanitizeHtml from 'sanitize-html'; +import classnames from 'classnames'; +import { logger } from "matrix-js-sdk/src/logger"; + +import { _t } from '../../languageHandler'; import dis from '../../dispatcher/dispatcher'; import { MatrixClientPeg } from '../../MatrixClientPeg'; -import classnames from 'classnames'; import MatrixClientContext from "../../contexts/MatrixClientContext"; import AutoHideScrollbar from "./AutoHideScrollbar"; import { ActionPayload } from "../../dispatcher/payloads"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { // URL to request embedded page content from url?: string; diff --git a/src/components/structures/FilePanel.tsx b/src/components/structures/FilePanel.tsx index c57c2f7ecf..093db3ff63 100644 --- a/src/components/structures/FilePanel.tsx +++ b/src/components/structures/FilePanel.tsx @@ -16,13 +16,13 @@ limitations under the License. */ import React from 'react'; - import { Filter } from 'matrix-js-sdk/src/filter'; import { EventTimelineSet } from "matrix-js-sdk/src/models/event-timeline-set"; import { Direction } from "matrix-js-sdk/src/models/event-timeline"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { Room } from 'matrix-js-sdk/src/models/room'; import { TimelineWindow } from 'matrix-js-sdk/src/timeline-window'; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from '../../MatrixClientPeg'; import EventIndexPeg from "../../indexing/EventIndexPeg"; @@ -31,7 +31,6 @@ import BaseCard from "../views/right_panel/BaseCard"; import { RightPanelPhases } from "../../stores/RightPanelStorePhases"; import DesktopBuildsNotice, { WarningKind } from "../views/elements/DesktopBuildsNotice"; import { replaceableComponent } from "../../utils/replaceableComponent"; - import ResizeNotifier from '../../utils/ResizeNotifier'; import TimelinePanel from "./TimelinePanel"; import Spinner from "../views/elements/Spinner"; @@ -39,8 +38,6 @@ import { TileShape } from '../views/rooms/EventTile'; import { Layout } from "../../settings/Layout"; import RoomContext, { TimelineRenderingType } from '../../contexts/RoomContext'; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { roomId: string; onClose: () => void; diff --git a/src/components/structures/GenericErrorPage.tsx b/src/components/structures/GenericErrorPage.tsx index d124c7111a..25892f46df 100644 --- a/src/components/structures/GenericErrorPage.tsx +++ b/src/components/structures/GenericErrorPage.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../utils/replaceableComponent"; interface IProps { diff --git a/src/components/structures/GroupFilterPanel.tsx b/src/components/structures/GroupFilterPanel.tsx index b6d05efa87..10bf40c4b0 100644 --- a/src/components/structures/GroupFilterPanel.tsx +++ b/src/components/structures/GroupFilterPanel.tsx @@ -15,17 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { EventSubscription } from "fbemitter"; import React from 'react'; +import classNames from 'classnames'; + +import type { EventSubscription } from "fbemitter"; import GroupFilterOrderStore from '../../stores/GroupFilterOrderStore'; - import GroupActions from '../../actions/GroupActions'; - import * as sdk from '../../index'; import dis from '../../dispatcher/dispatcher'; import { _t } from '../../languageHandler'; - -import classNames from 'classnames'; import MatrixClientContext from "../../contexts/MatrixClientContext"; import AutoHideScrollbar from "./AutoHideScrollbar"; import SettingsStore from "../../settings/SettingsStore"; diff --git a/src/components/structures/GroupView.js b/src/components/structures/GroupView.js index 298fa0a4b6..ede74f9343 100644 --- a/src/components/structures/GroupView.js +++ b/src/components/structures/GroupView.js @@ -18,6 +18,11 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; +import classnames from 'classnames'; +import { Group } from "matrix-js-sdk/src/models/group"; +import { sleep } from "matrix-js-sdk/src/utils"; +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from '../../MatrixClientPeg'; import * as sdk from '../../index'; import dis from '../../dispatcher/dispatcher'; @@ -29,14 +34,10 @@ import GroupHeaderButtons from '../views/right_panel/GroupHeaderButtons'; import MainSplit from './MainSplit'; import RightPanel from './RightPanel'; import Modal from '../../Modal'; -import classnames from 'classnames'; - import GroupStore from '../../stores/GroupStore'; import FlairStore from '../../stores/FlairStore'; import { showGroupAddRoomDialog } from '../../GroupAddressPicker'; import { makeGroupPermalink, makeUserPermalink } from "../../utils/permalinks/Permalinks"; -import { Group } from "matrix-js-sdk/src/models/group"; -import { sleep } from "matrix-js-sdk/src/utils"; import RightPanelStore from "../../stores/RightPanelStore"; import AutoHideScrollbar from "./AutoHideScrollbar"; import { mediaFromMxc } from "../../customisations/Media"; @@ -45,8 +46,6 @@ import { createSpaceFromCommunity } from "../../utils/space"; import { Action } from "../../dispatcher/actions"; import { RightPanelPhases } from "../../stores/RightPanelStorePhases"; -import { logger } from "matrix-js-sdk/src/logger"; - const LONG_DESC_PLACEHOLDER = _td( `

HTML for your community's page

diff --git a/src/components/structures/HostSignupAction.tsx b/src/components/structures/HostSignupAction.tsx index 41dc8a6da8..99881f27c4 100644 --- a/src/components/structures/HostSignupAction.tsx +++ b/src/components/structures/HostSignupAction.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { IconizedContextMenuOption, IconizedContextMenuOptionList, diff --git a/src/components/structures/IndicatorScrollbar.tsx b/src/components/structures/IndicatorScrollbar.tsx index 85de659481..b45932242e 100644 --- a/src/components/structures/IndicatorScrollbar.tsx +++ b/src/components/structures/IndicatorScrollbar.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { createRef } from "react"; + import AutoHideScrollbar from "./AutoHideScrollbar"; import { replaceableComponent } from "../../utils/replaceableComponent"; diff --git a/src/components/structures/InteractiveAuth.tsx b/src/components/structures/InteractiveAuth.tsx index 36489ac4a0..0c8c2a807a 100644 --- a/src/components/structures/InteractiveAuth.tsx +++ b/src/components/structures/InteractiveAuth.tsx @@ -24,13 +24,12 @@ import { } from "matrix-js-sdk/src/interactive-auth"; import { MatrixClient } from "matrix-js-sdk/src/client"; import React, { createRef } from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; import getEntryComponentForLoginType, { IStageComponent } from '../views/auth/InteractiveAuthEntryComponents'; import Spinner from "../views/elements/Spinner"; import { replaceableComponent } from "../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - export const ERROR_USER_CANCELLED = new Error("User cancelled auth session"); interface IProps { diff --git a/src/components/structures/LoggedInView.tsx b/src/components/structures/LoggedInView.tsx index 566e14e633..f0aa7576a1 100644 --- a/src/components/structures/LoggedInView.tsx +++ b/src/components/structures/LoggedInView.tsx @@ -17,6 +17,8 @@ limitations under the License. import * as React from 'react'; import { MatrixClient } from 'matrix-js-sdk/src/client'; import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; +import { MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; +import classNames from 'classnames'; import { Key } from '../../Keyboard'; import PageTypes from '../../PageTypes'; @@ -25,7 +27,6 @@ import { fixupColorFonts } from '../../utils/FontManager'; import dis from '../../dispatcher/dispatcher'; import { IMatrixClientCreds } from '../../MatrixClientPeg'; import SettingsStore from "../../settings/SettingsStore"; - import ResizeHandle from '../views/elements/ResizeHandle'; import { Resizer, CollapseDistributor } from '../../resizer'; import MatrixClientContext from "../../contexts/MatrixClientContext"; @@ -54,7 +55,6 @@ import { IOpts } from "../../createRoom"; import SpacePanel from "../views/spaces/SpacePanel"; import { replaceableComponent } from "../../utils/replaceableComponent"; import CallHandler from '../../CallHandler'; -import { MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; import AudioFeedArrayForCall from '../views/voip/AudioFeedArrayForCall'; import { OwnProfileStore } from '../../stores/OwnProfileStore'; import { UPDATE_EVENT } from "../../stores/AsyncStore"; @@ -65,7 +65,6 @@ import UserView from "./UserView"; import GroupView from "./GroupView"; import BackdropPanel from "./BackdropPanel"; import SpaceStore from "../../stores/SpaceStore"; -import classNames from 'classnames'; import GroupFilterPanel from './GroupFilterPanel'; import CustomRoomTagPanel from './CustomRoomTagPanel'; import { mediaFromMxc } from "../../customisations/Media"; diff --git a/src/components/structures/MainSplit.tsx b/src/components/structures/MainSplit.tsx index af7645767d..bc138a4316 100644 --- a/src/components/structures/MainSplit.tsx +++ b/src/components/structures/MainSplit.tsx @@ -17,9 +17,10 @@ limitations under the License. import React from 'react'; import { NumberSize, Resizable } from 're-resizable'; +import { Direction } from "re-resizable/lib/resizer"; + import { replaceableComponent } from "../../utils/replaceableComponent"; import ResizeNotifier from "../../utils/ResizeNotifier"; -import { Direction } from "re-resizable/lib/resizer"; interface IProps { resizeNotifier: ResizeNotifier; diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 0c68f2013c..866245042f 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -34,7 +34,6 @@ import PlatformPeg from "../../PlatformPeg"; import SdkConfig from "../../SdkConfig"; import dis from "../../dispatcher/dispatcher"; import Notifier from '../../Notifier'; - import Modal from "../../Modal"; import { showRoomInviteDialog, showStartChatInviteDialog } from '../../RoomInvite'; import * as Rooms from '../../Rooms'; @@ -43,7 +42,6 @@ import * as Lifecycle from '../../Lifecycle'; // LifecycleStore is not used but does listen to and dispatch actions import '../../stores/LifecycleStore'; import PageType from '../../PageTypes'; - import createRoom, { IOpts } from "../../createRoom"; import { _t, _td, getCurrentLanguage } from '../../languageHandler'; import SettingsStore from "../../settings/SettingsStore"; @@ -101,7 +99,6 @@ import Registration from './auth/Registration'; import Login from "./auth/Login"; import ErrorBoundary from '../views/elements/ErrorBoundary'; import VerificationRequestToast from '../views/toasts/VerificationRequestToast'; - import PerformanceMonitor, { PerformanceEntryNames } from "../../performance"; import UIStore, { UI_EVENTS } from "../../stores/UIStore"; import SoftLogout from './auth/SoftLogout'; @@ -111,6 +108,7 @@ import { PosthogAnalytics } from '../../PosthogAnalytics'; import { initSentry } from "../../sentry"; import { logger } from "matrix-js-sdk/src/logger"; + import { showSpaceInvite } from "../../utils/space"; /** constants for MatrixChat.state.view */ diff --git a/src/components/structures/MessagePanel.tsx b/src/components/structures/MessagePanel.tsx index 4660423678..c787ce2a7e 100644 --- a/src/components/structures/MessagePanel.tsx +++ b/src/components/structures/MessagePanel.tsx @@ -21,6 +21,7 @@ import { EventType } from 'matrix-js-sdk/src/@types/event'; import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; import { Relations } from "matrix-js-sdk/src/models/relations"; import { RoomMember } from 'matrix-js-sdk/src/models/room-member'; +import { logger } from 'matrix-js-sdk/src/logger'; import shouldHideEvent from '../../shouldHideEvent'; import { wantsDateSeparator } from '../../DateUtils'; @@ -48,7 +49,6 @@ import Spinner from "../views/elements/Spinner"; import TileErrorBoundary from '../views/messages/TileErrorBoundary'; import { RoomPermalinkCreator } from "../../utils/permalinks/Permalinks"; import EditorStateTransfer from "../../utils/EditorStateTransfer"; -import { logger } from 'matrix-js-sdk/src/logger'; import { Action } from '../../dispatcher/actions'; const CONTINUATION_MAX_INTERVAL = 5 * 60 * 1000; // 5 minutes diff --git a/src/components/structures/MyGroups.js b/src/components/structures/MyGroups.js index 2239325f1b..e64022ab54 100644 --- a/src/components/structures/MyGroups.js +++ b/src/components/structures/MyGroups.js @@ -17,6 +17,7 @@ limitations under the License. */ import React from 'react'; + import * as sdk from '../../index'; import { _t } from '../../languageHandler'; import SdkConfig from '../../SdkConfig'; diff --git a/src/components/structures/NonUrgentToastContainer.tsx b/src/components/structures/NonUrgentToastContainer.tsx index 6e914c40fb..7872c2596c 100644 --- a/src/components/structures/NonUrgentToastContainer.tsx +++ b/src/components/structures/NonUrgentToastContainer.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import * as React from "react"; + import { ComponentClass } from "../../@types/common"; import NonUrgentToastStore from "../../stores/NonUrgentToastStore"; import { UPDATE_EVENT } from "../../stores/AsyncStore"; diff --git a/src/components/structures/NotificationPanel.tsx b/src/components/structures/NotificationPanel.tsx index 52046c1855..f097a9ec95 100644 --- a/src/components/structures/NotificationPanel.tsx +++ b/src/components/structures/NotificationPanel.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from '../../languageHandler'; import { MatrixClientPeg } from "../../MatrixClientPeg"; @@ -26,8 +27,6 @@ import { TileShape } from "../views/rooms/EventTile"; import { Layout } from "../../settings/Layout"; import RoomContext, { TimelineRenderingType } from "../../contexts/RoomContext"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { onClose(): void; } diff --git a/src/components/structures/RightPanel.tsx b/src/components/structures/RightPanel.tsx index 144f17ad1f..1ff8ab3382 100644 --- a/src/components/structures/RightPanel.tsx +++ b/src/components/structures/RightPanel.tsx @@ -21,6 +21,7 @@ import { RoomState } from "matrix-js-sdk/src/models/room-state"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { throttle } from 'lodash'; import dis from '../../dispatcher/dispatcher'; import GroupStore from '../../stores/GroupStore'; @@ -49,7 +50,6 @@ import ThreadPanel from "./ThreadPanel"; import NotificationPanel from "./NotificationPanel"; import ResizeNotifier from "../../utils/ResizeNotifier"; import PinnedMessagesCard from "../views/right_panel/PinnedMessagesCard"; -import { throttle } from 'lodash'; import SpaceStore from "../../stores/SpaceStore"; import { RoomPermalinkCreator } from '../../utils/permalinks/Permalinks'; import { E2EStatus } from '../../utils/ShieldUtils'; diff --git a/src/components/structures/RoomDirectory.tsx b/src/components/structures/RoomDirectory.tsx index 56e6b2dfb8..12c759f6bd 100644 --- a/src/components/structures/RoomDirectory.tsx +++ b/src/components/structures/RoomDirectory.tsx @@ -19,6 +19,7 @@ import React from "react"; import { IFieldType, IInstance, IProtocol, IPublicRoomsChunkRoom } from "matrix-js-sdk/src/client"; import { Visibility } from "matrix-js-sdk/src/@types/partials"; import { IRoomDirectoryOptions } from "matrix-js-sdk/src/@types/requests"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from "../../MatrixClientPeg"; import dis from "../../dispatcher/dispatcher"; @@ -48,8 +49,6 @@ import Spinner from "../views/elements/Spinner"; import { ActionPayload } from "../../dispatcher/payloads"; import { getDisplayAliasForAliasSet } from "../../Rooms"; -import { logger } from "matrix-js-sdk/src/logger"; - const MAX_NAME_LENGTH = 80; const MAX_TOPIC_LENGTH = 800; diff --git a/src/components/structures/RoomStatusBar.tsx b/src/components/structures/RoomStatusBar.tsx index 82f68bc435..76835d7c29 100644 --- a/src/components/structures/RoomStatusBar.tsx +++ b/src/components/structures/RoomStatusBar.tsx @@ -15,20 +15,21 @@ limitations under the License. */ import React from 'react'; +import { EventStatus, MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { SyncState } from "matrix-js-sdk/src/sync.api"; +import { ISyncStateData } from "matrix-js-sdk/src/sync"; +import { Room } from "matrix-js-sdk/src/models/room"; + import { _t, _td } from '../../languageHandler'; import Resend from '../../Resend'; import dis from '../../dispatcher/dispatcher'; import { messageForResourceLimitError } from '../../utils/ErrorUtils'; import { Action } from "../../dispatcher/actions"; import { replaceableComponent } from "../../utils/replaceableComponent"; -import { EventStatus, MatrixEvent } from "matrix-js-sdk/src/models/event"; import NotificationBadge from "../views/rooms/NotificationBadge"; import { StaticNotificationState } from "../../stores/notifications/StaticNotificationState"; import AccessibleButton from "../views/elements/AccessibleButton"; import InlineSpinner from "../views/elements/InlineSpinner"; -import { SyncState } from "matrix-js-sdk/src/sync.api"; -import { ISyncStateData } from "matrix-js-sdk/src/sync"; -import { Room } from "matrix-js-sdk/src/models/room"; import MatrixClientContext from "../../contexts/MatrixClientContext"; const STATUS_BAR_HIDDEN = 0; diff --git a/src/components/structures/RoomView.tsx b/src/components/structures/RoomView.tsx index 6338ce0c60..47d730adc0 100644 --- a/src/components/structures/RoomView.tsx +++ b/src/components/structures/RoomView.tsx @@ -27,6 +27,10 @@ import { IRecommendedVersion, NotificationCountType, Room } from "matrix-js-sdk/ import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { EventSubscription } from "fbemitter"; import { ISearchResults } from 'matrix-js-sdk/src/@types/search'; +import { CallState, MatrixCall } from "matrix-js-sdk/src/webrtc/call"; +import { throttle } from "lodash"; +import { logger } from "matrix-js-sdk/src/logger"; +import { EventTimeline } from 'matrix-js-sdk/src/models/event-timeline'; import shouldHideEvent from '../../shouldHideEvent'; import { _t } from '../../languageHandler'; @@ -66,7 +70,6 @@ import { IOOBData, IThreepidInvite } from "../../stores/ThreepidInviteStore"; import EffectsOverlay from "../views/elements/EffectsOverlay"; import { containsEmoji } from '../../effects/utils'; import { CHAT_EFFECTS } from '../../effects'; -import { CallState, MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import WidgetStore from "../../stores/WidgetStore"; import { UPDATE_EVENT } from "../../stores/AsyncStore"; import Notifier from "../../Notifier"; @@ -79,7 +82,6 @@ import SpaceRoomView from "./SpaceRoomView"; import { IOpts } from "../../createRoom"; import { replaceableComponent } from "../../utils/replaceableComponent"; import EditorStateTransfer from "../../utils/EditorStateTransfer"; -import { throttle } from "lodash"; import ErrorDialog from '../views/dialogs/ErrorDialog'; import SearchResultTile from '../views/rooms/SearchResultTile'; import Spinner from "../views/elements/Spinner"; @@ -89,9 +91,6 @@ import MessageComposer from '../views/rooms/MessageComposer'; import JumpToBottomButton from "../views/rooms/JumpToBottomButton"; import TopUnreadMessagesBar from "../views/rooms/TopUnreadMessagesBar"; import SpaceStore from "../../stores/SpaceStore"; - -import { logger } from "matrix-js-sdk/src/logger"; -import { EventTimeline } from 'matrix-js-sdk/src/models/event-timeline'; import { dispatchShowThreadEvent } from '../../dispatcher/dispatch-actions/threads'; import { fetchInitialEvent } from "../../utils/EventUtils"; diff --git a/src/components/structures/ScrollPanel.tsx b/src/components/structures/ScrollPanel.tsx index 1699b535d9..2b3c0b7f33 100644 --- a/src/components/structures/ScrollPanel.tsx +++ b/src/components/structures/ScrollPanel.tsx @@ -15,14 +15,14 @@ limitations under the License. */ import React, { createRef, CSSProperties, ReactNode, SyntheticEvent, KeyboardEvent } from "react"; +import { logger } from "matrix-js-sdk/src/logger"; + import Timer from '../../utils/Timer'; import AutoHideScrollbar from "./AutoHideScrollbar"; import { replaceableComponent } from "../../utils/replaceableComponent"; import { getKeyBindingsManager, RoomAction } from "../../KeyBindingsManager"; import ResizeNotifier from "../../utils/ResizeNotifier"; -import { logger } from "matrix-js-sdk/src/logger"; - const DEBUG_SCROLL = false; // The amount of extra scroll distance to allow prior to unfilling. diff --git a/src/components/structures/SearchBox.tsx b/src/components/structures/SearchBox.tsx index 82fe689022..f86c91f31f 100644 --- a/src/components/structures/SearchBox.tsx +++ b/src/components/structures/SearchBox.tsx @@ -16,11 +16,12 @@ limitations under the License. */ import React, { createRef } from 'react'; +import { throttle } from 'lodash'; +import classNames from 'classnames'; + import { Key } from '../../Keyboard'; import dis from '../../dispatcher/dispatcher'; -import { throttle } from 'lodash'; import AccessibleButton from '../../components/views/elements/AccessibleButton'; -import classNames from 'classnames'; import { replaceableComponent } from "../../utils/replaceableComponent"; interface IProps { diff --git a/src/components/structures/SpaceRoomView.tsx b/src/components/structures/SpaceRoomView.tsx index 4a43f0380d..0a820d7fc9 100644 --- a/src/components/structures/SpaceRoomView.tsx +++ b/src/components/structures/SpaceRoomView.tsx @@ -19,6 +19,7 @@ import { EventType } from "matrix-js-sdk/src/@types/event"; import { JoinRule, Preset } from "matrix-js-sdk/src/@types/partials"; import { Room } from "matrix-js-sdk/src/models/room"; import { EventSubscription } from "fbemitter"; +import { logger } from "matrix-js-sdk/src/logger"; import MatrixClientContext from "../../contexts/MatrixClientContext"; import RoomAvatar from "../views/avatars/RoomAvatar"; @@ -81,8 +82,6 @@ import Spinner from "../views/elements/Spinner"; import GroupAvatar from "../views/avatars/GroupAvatar"; import { useDispatcher } from "../../hooks/useDispatcher"; import { useRoomState } from "../../hooks/useRoomState"; - -import { logger } from "matrix-js-sdk/src/logger"; import { shouldShowComponent } from "../../customisations/helpers/UIComponents"; import { UIComponent } from "../../settings/UIFeature"; diff --git a/src/components/structures/TabbedView.tsx b/src/components/structures/TabbedView.tsx index efa1143443..8287189c2c 100644 --- a/src/components/structures/TabbedView.tsx +++ b/src/components/structures/TabbedView.tsx @@ -17,14 +17,14 @@ limitations under the License. */ import * as React from "react"; +import classNames from "classnames"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from '../../languageHandler'; import AutoHideScrollbar from './AutoHideScrollbar'; import { replaceableComponent } from "../../utils/replaceableComponent"; -import classNames from "classnames"; import AccessibleButton from "../views/elements/AccessibleButton"; -import { logger } from "matrix-js-sdk/src/logger"; - /** * Represents a tab for the TabbedView. */ diff --git a/src/components/structures/ThreadPanel.tsx b/src/components/structures/ThreadPanel.tsx index c3db17e193..71c6fa1e33 100644 --- a/src/components/structures/ThreadPanel.tsx +++ b/src/components/structures/ThreadPanel.tsx @@ -21,7 +21,6 @@ import { Room } from 'matrix-js-sdk/src/models/room'; import BaseCard from "../views/right_panel/BaseCard"; import { RightPanelPhases } from "../../stores/RightPanelStorePhases"; - import ResizeNotifier from '../../utils/ResizeNotifier'; import MatrixClientContext from '../../contexts/MatrixClientContext'; import { _t } from '../../languageHandler'; diff --git a/src/components/structures/ThreadView.tsx b/src/components/structures/ThreadView.tsx index c7a4342449..b43c74146c 100644 --- a/src/components/structures/ThreadView.tsx +++ b/src/components/structures/ThreadView.tsx @@ -22,7 +22,6 @@ import { RelationType } from 'matrix-js-sdk/src/@types/event'; import BaseCard from "../views/right_panel/BaseCard"; import { RightPanelPhases } from "../../stores/RightPanelStorePhases"; import { replaceableComponent } from "../../utils/replaceableComponent"; - import ResizeNotifier from '../../utils/ResizeNotifier'; import { TileShape } from '../views/rooms/EventTile'; import MessageComposer from '../views/rooms/MessageComposer'; diff --git a/src/components/structures/TimelinePanel.tsx b/src/components/structures/TimelinePanel.tsx index 495d3c438f..56a9017328 100644 --- a/src/components/structures/TimelinePanel.tsx +++ b/src/components/structures/TimelinePanel.tsx @@ -23,6 +23,8 @@ import { Direction, EventTimeline } from "matrix-js-sdk/src/models/event-timelin import { TimelineWindow } from "matrix-js-sdk/src/timeline-window"; import { EventType, RelationType } from 'matrix-js-sdk/src/@types/event'; import { SyncState } from 'matrix-js-sdk/src/sync.api'; +import { debounce } from 'lodash'; +import { logger } from "matrix-js-sdk/src/logger"; import SettingsStore from "../../settings/SettingsStore"; import { Layout } from "../../settings/Layout"; @@ -47,9 +49,6 @@ import { RoomPermalinkCreator } from "../../utils/permalinks/Permalinks"; import Spinner from "../views/elements/Spinner"; import EditorStateTransfer from '../../utils/EditorStateTransfer'; import ErrorDialog from '../views/dialogs/ErrorDialog'; -import { debounce } from 'lodash'; - -import { logger } from "matrix-js-sdk/src/logger"; const PAGINATE_SIZE = 20; const INITIAL_SIZE = 20; diff --git a/src/components/structures/ToastContainer.tsx b/src/components/structures/ToastContainer.tsx index 0b0e871975..0b71fa9dc9 100644 --- a/src/components/structures/ToastContainer.tsx +++ b/src/components/structures/ToastContainer.tsx @@ -15,8 +15,9 @@ limitations under the License. */ import * as React from "react"; -import ToastStore, { IToast } from "../../stores/ToastStore"; import classNames from "classnames"; + +import ToastStore, { IToast } from "../../stores/ToastStore"; import { replaceableComponent } from "../../utils/replaceableComponent"; interface IState { diff --git a/src/components/structures/UploadBar.tsx b/src/components/structures/UploadBar.tsx index 6ee53da5d1..3fa3f1ce9f 100644 --- a/src/components/structures/UploadBar.tsx +++ b/src/components/structures/UploadBar.tsx @@ -16,9 +16,10 @@ limitations under the License. import React from 'react'; import { Room } from "matrix-js-sdk/src/models/room"; +import filesize from "filesize"; + import ContentMessages from '../../ContentMessages'; import dis from "../../dispatcher/dispatcher"; -import filesize from "filesize"; import { _t } from '../../languageHandler'; import { ActionPayload } from "../../dispatcher/payloads"; import { Action } from "../../dispatcher/actions"; diff --git a/src/components/structures/UserMenu.tsx b/src/components/structures/UserMenu.tsx index 646fc32b59..a0760b6d8c 100644 --- a/src/components/structures/UserMenu.tsx +++ b/src/components/structures/UserMenu.tsx @@ -18,6 +18,7 @@ import React, { createRef } from "react"; import { Room } from "matrix-js-sdk/src/models/room"; import classNames from "classnames"; import * as fbEmitter from "fbemitter"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from "../../MatrixClientPeg"; import defaultDispatcher from "../../dispatcher/dispatcher"; @@ -59,7 +60,7 @@ import RoomName from "../views/elements/RoomName"; import { replaceableComponent } from "../../utils/replaceableComponent"; import InlineSpinner from "../views/elements/InlineSpinner"; import TooltipButton from "../views/elements/TooltipButton"; -import { logger } from "matrix-js-sdk/src/logger"; + interface IProps { isMinimized: boolean; } diff --git a/src/components/structures/UserView.tsx b/src/components/structures/UserView.tsx index 32168e8449..04e97bc057 100644 --- a/src/components/structures/UserView.tsx +++ b/src/components/structures/UserView.tsx @@ -16,13 +16,14 @@ limitations under the License. */ import React from "react"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { RoomMember } from "matrix-js-sdk/src/models/room-member"; + import { MatrixClientPeg } from "../../MatrixClientPeg"; import Modal from '../../Modal'; import { _t } from '../../languageHandler'; import HomePage from "./HomePage"; import { replaceableComponent } from "../../utils/replaceableComponent"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; -import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import ErrorDialog from "../views/dialogs/ErrorDialog"; import MainSplit from "./MainSplit"; import RightPanel from "./RightPanel"; diff --git a/src/components/structures/ViewSource.tsx b/src/components/structures/ViewSource.tsx index 20bbece755..7cc3b0dbcd 100644 --- a/src/components/structures/ViewSource.tsx +++ b/src/components/structures/ViewSource.tsx @@ -17,6 +17,8 @@ limitations under the License. */ import React from "react"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import SyntaxHighlight from "../views/elements/SyntaxHighlight"; import { _t } from "../../languageHandler"; import MatrixClientContext from "../../contexts/MatrixClientContext"; @@ -24,7 +26,6 @@ import { SendCustomEvent } from "../views/dialogs/DevtoolsDialog"; import { canEditContent } from "../../utils/EventUtils"; import { MatrixClientPeg } from '../../MatrixClientPeg'; import { replaceableComponent } from "../../utils/replaceableComponent"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { IDialogProps } from "../views/dialogs/IDialogProps"; import BaseDialog from "../views/dialogs/BaseDialog"; diff --git a/src/components/structures/auth/CompleteSecurity.tsx b/src/components/structures/auth/CompleteSecurity.tsx index 1e46f0e657..2c2912086d 100644 --- a/src/components/structures/auth/CompleteSecurity.tsx +++ b/src/components/structures/auth/CompleteSecurity.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from '../../../languageHandler'; import * as sdk from '../../../index'; import { SetupEncryptionStore, Phase } from '../../../stores/SetupEncryptionStore'; diff --git a/src/components/structures/auth/E2eSetup.tsx b/src/components/structures/auth/E2eSetup.tsx index 93cb92664f..96d6a0dc0b 100644 --- a/src/components/structures/auth/E2eSetup.tsx +++ b/src/components/structures/auth/E2eSetup.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import AuthPage from '../../views/auth/AuthPage'; import CompleteSecurityBody from '../../views/auth/CompleteSecurityBody'; import CreateCrossSigningDialog from '../../views/dialogs/security/CreateCrossSigningDialog'; diff --git a/src/components/structures/auth/ForgotPassword.tsx b/src/components/structures/auth/ForgotPassword.tsx index 4c65fac983..b5c5912406 100644 --- a/src/components/structures/auth/ForgotPassword.tsx +++ b/src/components/structures/auth/ForgotPassword.tsx @@ -17,12 +17,14 @@ limitations under the License. */ import React from 'react'; +import classNames from 'classnames'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t, _td } from '../../../languageHandler'; import * as sdk from '../../../index'; import Modal from "../../../Modal"; import PasswordReset from "../../../PasswordReset"; import AutoDiscoveryUtils, { ValidatedServerConfig } from "../../../utils/AutoDiscoveryUtils"; -import classNames from 'classnames'; import AuthPage from "../../views/auth/AuthPage"; import CountlyAnalytics from "../../../CountlyAnalytics"; import ServerPicker from "../../views/elements/ServerPicker"; @@ -33,8 +35,6 @@ import withValidation, { IValidationResult } from "../../views/elements/Validati import * as Email from "../../../email"; import InlineSpinner from '../../views/elements/InlineSpinner'; -import { logger } from "matrix-js-sdk/src/logger"; - enum Phase { // Show the forgot password inputs Forgot = 1, diff --git a/src/components/structures/auth/Login.tsx b/src/components/structures/auth/Login.tsx index 403c013e64..4b849e1d03 100644 --- a/src/components/structures/auth/Login.tsx +++ b/src/components/structures/auth/Login.tsx @@ -16,13 +16,14 @@ limitations under the License. import React, { ReactNode } from 'react'; import { MatrixError } from "matrix-js-sdk/src/http-api"; +import classNames from "classnames"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t, _td } from '../../../languageHandler'; import Login, { ISSOFlow, LoginFlow } from '../../../Login'; import SdkConfig from '../../../SdkConfig'; import { messageForResourceLimitError } from '../../../utils/ErrorUtils'; import AutoDiscoveryUtils, { ValidatedServerConfig } from "../../../utils/AutoDiscoveryUtils"; -import classNames from "classnames"; import AuthPage from "../../views/auth/AuthPage"; import PlatformPeg from '../../../PlatformPeg'; import SettingsStore from "../../../settings/SettingsStore"; @@ -38,8 +39,6 @@ import { replaceableComponent } from "../../../utils/replaceableComponent"; import AuthBody from "../../views/auth/AuthBody"; import AuthHeader from "../../views/auth/AuthHeader"; -import { logger } from "matrix-js-sdk/src/logger"; - // These are used in several places, and come from the js-sdk's autodiscovery // stuff. We define them here so that they'll be picked up by i18n. _td("Invalid homeserver discovery response"); diff --git a/src/components/structures/auth/Registration.tsx b/src/components/structures/auth/Registration.tsx index ab1956dd6a..7a3084aa68 100644 --- a/src/components/structures/auth/Registration.tsx +++ b/src/components/structures/auth/Registration.tsx @@ -17,11 +17,12 @@ limitations under the License. import { createClient } from 'matrix-js-sdk/src/matrix'; import React, { ReactNode } from 'react'; import { MatrixClient } from "matrix-js-sdk/src/client"; +import classNames from "classnames"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t, _td } from '../../../languageHandler'; import { messageForResourceLimitError } from '../../../utils/ErrorUtils'; import AutoDiscoveryUtils, { ValidatedServerConfig } from "../../../utils/AutoDiscoveryUtils"; -import classNames from "classnames"; import * as Lifecycle from '../../../Lifecycle'; import { IMatrixClientCreds, MatrixClientPeg } from "../../../MatrixClientPeg"; import AuthPage from "../../views/auth/AuthPage"; @@ -37,8 +38,6 @@ import AuthHeader from "../../views/auth/AuthHeader"; import InteractiveAuth from "../InteractiveAuth"; import Spinner from "../../views/elements/Spinner"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { serverConfig: ValidatedServerConfig; defaultDeviceDisplayName: string; diff --git a/src/components/structures/auth/SetupEncryptionBody.tsx b/src/components/structures/auth/SetupEncryptionBody.tsx index e2b1aebcfd..c51bbf253b 100644 --- a/src/components/structures/auth/SetupEncryptionBody.tsx +++ b/src/components/structures/auth/SetupEncryptionBody.tsx @@ -15,20 +15,20 @@ limitations under the License. */ import React from 'react'; +import { ISecretStorageKeyInfo } from 'matrix-js-sdk/src/crypto/api'; +import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup"; +import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import Modal from '../../../Modal'; import VerificationRequestDialog from '../../views/dialogs/VerificationRequestDialog'; import { SetupEncryptionStore, Phase } from '../../../stores/SetupEncryptionStore'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { ISecretStorageKeyInfo } from 'matrix-js-sdk/src/crypto/api'; import EncryptionPanel from "../../views/right_panel/EncryptionPanel"; import AccessibleButton from '../../views/elements/AccessibleButton'; import Spinner from '../../views/elements/Spinner'; -import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup"; -import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; - -import { logger } from "matrix-js-sdk/src/logger"; function keyHasPassphrase(keyInfo: ISecretStorageKeyInfo): boolean { return Boolean( diff --git a/src/components/structures/auth/SoftLogout.tsx b/src/components/structures/auth/SoftLogout.tsx index db93d30c27..dd922a48e9 100644 --- a/src/components/structures/auth/SoftLogout.tsx +++ b/src/components/structures/auth/SoftLogout.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from '../../../languageHandler'; import dis from '../../../dispatcher/dispatcher'; import * as Lifecycle from '../../../Lifecycle'; @@ -32,8 +34,6 @@ import Spinner from "../../views/elements/Spinner"; import AuthHeader from "../../views/auth/AuthHeader"; import AuthBody from "../../views/auth/AuthBody"; -import { logger } from "matrix-js-sdk/src/logger"; - const LOGIN_VIEW = { LOADING: 1, PASSWORD: 2, diff --git a/src/components/views/audio_messages/AudioPlayer.tsx b/src/components/views/audio_messages/AudioPlayer.tsx index b83f89fe5b..64ef971567 100644 --- a/src/components/views/audio_messages/AudioPlayer.tsx +++ b/src/components/views/audio_messages/AudioPlayer.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { createRef, ReactNode, RefObject } from "react"; + import PlayPauseButton from "./PlayPauseButton"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { formatBytes } from "../../../utils/FormattingUtils"; diff --git a/src/components/views/audio_messages/AudioPlayerBase.tsx b/src/components/views/audio_messages/AudioPlayerBase.tsx index 5158e87827..f645c53387 100644 --- a/src/components/views/audio_messages/AudioPlayerBase.tsx +++ b/src/components/views/audio_messages/AudioPlayerBase.tsx @@ -14,15 +14,15 @@ See the License for the specific language governing permissions and limitations under the License. */ +import React, { ReactNode } from "react"; +import { logger } from "matrix-js-sdk/src/logger"; + import { Playback, PlaybackState } from "../../../audio/Playback"; import { TileShape } from "../rooms/EventTile"; -import React, { ReactNode } from "react"; import { UPDATE_EVENT } from "../../../stores/AsyncStore"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { _t } from "../../../languageHandler"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { // Playback instance to render. Cannot change during component lifecycle: create // an all-new component instead. diff --git a/src/components/views/audio_messages/Clock.tsx b/src/components/views/audio_messages/Clock.tsx index 69244cc5ad..488a5a293b 100644 --- a/src/components/views/audio_messages/Clock.tsx +++ b/src/components/views/audio_messages/Clock.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { formatSeconds } from "../../../DateUtils"; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/audio_messages/DurationClock.tsx b/src/components/views/audio_messages/DurationClock.tsx index 15bc6c98a4..e0c180123a 100644 --- a/src/components/views/audio_messages/DurationClock.tsx +++ b/src/components/views/audio_messages/DurationClock.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import Clock from "./Clock"; import { Playback } from "../../../audio/Playback"; diff --git a/src/components/views/audio_messages/LiveRecordingClock.tsx b/src/components/views/audio_messages/LiveRecordingClock.tsx index e7330efc1d..b9b582a03b 100644 --- a/src/components/views/audio_messages/LiveRecordingClock.tsx +++ b/src/components/views/audio_messages/LiveRecordingClock.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { IRecordingUpdate, VoiceRecording } from "../../../audio/VoiceRecording"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import Clock from "./Clock"; diff --git a/src/components/views/audio_messages/LiveRecordingWaveform.tsx b/src/components/views/audio_messages/LiveRecordingWaveform.tsx index 73e18626fe..13ba7b9f96 100644 --- a/src/components/views/audio_messages/LiveRecordingWaveform.tsx +++ b/src/components/views/audio_messages/LiveRecordingWaveform.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { IRecordingUpdate, RECORDING_PLAYBACK_SAMPLES, VoiceRecording } from "../../../audio/VoiceRecording"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { arrayFastResample, arraySeed } from "../../../utils/arrays"; diff --git a/src/components/views/audio_messages/PlayPauseButton.tsx b/src/components/views/audio_messages/PlayPauseButton.tsx index de2822cc39..050a1e4eb3 100644 --- a/src/components/views/audio_messages/PlayPauseButton.tsx +++ b/src/components/views/audio_messages/PlayPauseButton.tsx @@ -15,11 +15,12 @@ limitations under the License. */ import React, { ReactNode } from "react"; +import classNames from "classnames"; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; import { _t } from "../../../languageHandler"; import { Playback, PlaybackState } from "../../../audio/Playback"; -import classNames from "classnames"; // omitted props are handled by render function interface IProps extends Omit, "title" | "onClick" | "disabled"> { diff --git a/src/components/views/audio_messages/PlaybackClock.tsx b/src/components/views/audio_messages/PlaybackClock.tsx index affb025d86..48946eb21f 100644 --- a/src/components/views/audio_messages/PlaybackClock.tsx +++ b/src/components/views/audio_messages/PlaybackClock.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import Clock from "./Clock"; import { Playback, PlaybackState } from "../../../audio/Playback"; diff --git a/src/components/views/audio_messages/PlaybackWaveform.tsx b/src/components/views/audio_messages/PlaybackWaveform.tsx index 96fd3f5ae2..70bf0ebeef 100644 --- a/src/components/views/audio_messages/PlaybackWaveform.tsx +++ b/src/components/views/audio_messages/PlaybackWaveform.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import { arraySeed, arrayTrimFill } from "../../../utils/arrays"; import Waveform from "./Waveform"; diff --git a/src/components/views/audio_messages/RecordingPlayback.tsx b/src/components/views/audio_messages/RecordingPlayback.tsx index e3f612c9b6..04c61affd9 100644 --- a/src/components/views/audio_messages/RecordingPlayback.tsx +++ b/src/components/views/audio_messages/RecordingPlayback.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { ReactNode } from "react"; + import PlayPauseButton from "./PlayPauseButton"; import PlaybackClock from "./PlaybackClock"; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/audio_messages/SeekBar.tsx b/src/components/views/audio_messages/SeekBar.tsx index f0c03bb032..817f3e0452 100644 --- a/src/components/views/audio_messages/SeekBar.tsx +++ b/src/components/views/audio_messages/SeekBar.tsx @@ -14,8 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { Playback, PlaybackState } from "../../../audio/Playback"; import React, { ChangeEvent, CSSProperties, ReactNode } from "react"; + +import { Playback, PlaybackState } from "../../../audio/Playback"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { MarkedExecution } from "../../../utils/MarkedExecution"; import { percentageOf } from "../../../utils/numbers"; diff --git a/src/components/views/audio_messages/Waveform.tsx b/src/components/views/audio_messages/Waveform.tsx index 4e44abdf46..dedd95c7e1 100644 --- a/src/components/views/audio_messages/Waveform.tsx +++ b/src/components/views/audio_messages/Waveform.tsx @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React from "react"; -import { replaceableComponent } from "../../../utils/replaceableComponent"; +import React, { CSSProperties } from "react"; import classNames from "classnames"; -import { CSSProperties } from "react"; + +import { replaceableComponent } from "../../../utils/replaceableComponent"; interface WaveformCSSProperties extends CSSProperties { '--barHeight': number; diff --git a/src/components/views/auth/AuthBody.tsx b/src/components/views/auth/AuthBody.tsx index 3543a573d7..22bb919141 100644 --- a/src/components/views/auth/AuthBody.tsx +++ b/src/components/views/auth/AuthBody.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; @replaceableComponent("views.auth.AuthBody") diff --git a/src/components/views/auth/AuthFooter.tsx b/src/components/views/auth/AuthFooter.tsx index 00bced8c39..d936e346e6 100644 --- a/src/components/views/auth/AuthFooter.tsx +++ b/src/components/views/auth/AuthFooter.tsx @@ -16,8 +16,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { _t } from '../../../languageHandler'; import React from 'react'; + +import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; @replaceableComponent("views.auth.AuthFooter") diff --git a/src/components/views/auth/AuthHeader.tsx b/src/components/views/auth/AuthHeader.tsx index cab7da1468..27768c9e6e 100644 --- a/src/components/views/auth/AuthHeader.tsx +++ b/src/components/views/auth/AuthHeader.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import AuthHeaderLogo from "./AuthHeaderLogo"; import LanguageSelector from "./LanguageSelector"; diff --git a/src/components/views/auth/AuthHeaderLogo.tsx b/src/components/views/auth/AuthHeaderLogo.tsx index b6724793a5..29e5737238 100644 --- a/src/components/views/auth/AuthHeaderLogo.tsx +++ b/src/components/views/auth/AuthHeaderLogo.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; @replaceableComponent("views.auth.AuthHeaderLogo") diff --git a/src/components/views/auth/AuthPage.tsx b/src/components/views/auth/AuthPage.tsx index c402d5b699..d13c8dd6ae 100644 --- a/src/components/views/auth/AuthPage.tsx +++ b/src/components/views/auth/AuthPage.tsx @@ -17,6 +17,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import AuthFooter from "./AuthFooter"; diff --git a/src/components/views/auth/CaptchaForm.tsx b/src/components/views/auth/CaptchaForm.tsx index 846efcc9ca..5801d627bc 100644 --- a/src/components/views/auth/CaptchaForm.tsx +++ b/src/components/views/auth/CaptchaForm.tsx @@ -15,12 +15,12 @@ limitations under the License. */ import React, { createRef } from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from '../../../languageHandler'; import CountlyAnalytics from "../../../CountlyAnalytics"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - const DIV_ID = 'mx_recaptcha'; interface ICaptchaFormProps { diff --git a/src/components/views/auth/CompleteSecurityBody.tsx b/src/components/views/auth/CompleteSecurityBody.tsx index 8f6affb64e..349016add5 100644 --- a/src/components/views/auth/CompleteSecurityBody.tsx +++ b/src/components/views/auth/CompleteSecurityBody.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; @replaceableComponent("views.auth.CompleteSecurityBody") diff --git a/src/components/views/auth/InteractiveAuthEntryComponents.tsx b/src/components/views/auth/InteractiveAuthEntryComponents.tsx index e6ded475d8..c0396ff186 100644 --- a/src/components/views/auth/InteractiveAuthEntryComponents.tsx +++ b/src/components/views/auth/InteractiveAuthEntryComponents.tsx @@ -18,6 +18,7 @@ import React, { ChangeEvent, createRef, FormEvent, MouseEvent } from 'react'; import classNames from 'classnames'; import { MatrixClient } from "matrix-js-sdk/src/client"; import { AuthType, IAuthDict, IInputs, IStageStatus } from 'matrix-js-sdk/src/interactive-auth'; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from '../../../languageHandler'; import SettingsStore from "../../../settings/SettingsStore"; @@ -29,8 +30,6 @@ import { LocalisedPolicy, Policies } from '../../../Terms'; import Field from '../elements/Field'; import CaptchaForm from "./CaptchaForm"; -import { logger } from "matrix-js-sdk/src/logger"; - /* This file contains a collection of components which are used by the * InteractiveAuth to prompt the user to enter the information needed * for an auth stage. (The intention is that they could also be used for other diff --git a/src/components/views/auth/LanguageSelector.tsx b/src/components/views/auth/LanguageSelector.tsx index c26b4797f3..cd88652e43 100644 --- a/src/components/views/auth/LanguageSelector.tsx +++ b/src/components/views/auth/LanguageSelector.tsx @@ -14,11 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ +import React from 'react'; + import SdkConfig from "../../../SdkConfig"; import { getCurrentLanguage } from "../../../languageHandler"; import SettingsStore from "../../../settings/SettingsStore"; import PlatformPeg from "../../../PlatformPeg"; -import React from 'react'; import { SettingLevel } from "../../../settings/SettingLevel"; import LanguageDropdown from "../elements/LanguageDropdown"; diff --git a/src/components/views/auth/RegistrationForm.tsx b/src/components/views/auth/RegistrationForm.tsx index c66d6b80fd..19963d15d4 100644 --- a/src/components/views/auth/RegistrationForm.tsx +++ b/src/components/views/auth/RegistrationForm.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; import * as Email from '../../../email'; import { looksValid as phoneNumberLooksValid } from '../../../phonenumber'; @@ -32,8 +33,6 @@ import RegistrationEmailPromptDialog from '../dialogs/RegistrationEmailPromptDia import { replaceableComponent } from "../../../utils/replaceableComponent"; import CountryDropdown from "./CountryDropdown"; -import { logger } from "matrix-js-sdk/src/logger"; - enum RegistrationField { Email = "field_email", PhoneNumber = "field_phone_number", diff --git a/src/components/views/avatars/MemberAvatar.tsx b/src/components/views/avatars/MemberAvatar.tsx index 48b2575cd2..9ecaf8030b 100644 --- a/src/components/views/avatars/MemberAvatar.tsx +++ b/src/components/views/avatars/MemberAvatar.tsx @@ -18,6 +18,7 @@ limitations under the License. import React from 'react'; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { ResizeMethod } from 'matrix-js-sdk/src/@types/partials'; +import { logger } from "matrix-js-sdk/src/logger"; import dis from "../../../dispatcher/dispatcher"; import { Action } from "../../../dispatcher/actions"; @@ -25,8 +26,6 @@ import BaseAvatar from "./BaseAvatar"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { mediaFromMxc } from "../../../customisations/Media"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps extends Omit, "name" | "idName" | "url"> { member: RoomMember; fallbackUserId?: string; diff --git a/src/components/views/avatars/MemberStatusMessageAvatar.tsx b/src/components/views/avatars/MemberStatusMessageAvatar.tsx index 8c703b3b32..35645f3fd7 100644 --- a/src/components/views/avatars/MemberStatusMessageAvatar.tsx +++ b/src/components/views/avatars/MemberStatusMessageAvatar.tsx @@ -15,16 +15,17 @@ limitations under the License. */ import React, { createRef } from 'react'; +import classNames from 'classnames'; +import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { ResizeMethod } from "matrix-js-sdk/src/@types/partials"; + import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from "../../../languageHandler"; import MemberAvatar from '../avatars/MemberAvatar'; -import classNames from 'classnames'; import StatusMessageContextMenu from "../context_menus/StatusMessageContextMenu"; import SettingsStore from "../../../settings/SettingsStore"; import { ChevronFace, ContextMenu, ContextMenuButton } from "../../structures/ContextMenu"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { RoomMember } from "matrix-js-sdk/src/models/room-member"; -import { ResizeMethod } from "matrix-js-sdk/src/@types/partials"; interface IProps { member: RoomMember; diff --git a/src/components/views/context_menus/CallContextMenu.tsx b/src/components/views/context_menus/CallContextMenu.tsx index a61cdeedd3..6fa71594e1 100644 --- a/src/components/views/context_menus/CallContextMenu.tsx +++ b/src/components/views/context_menus/CallContextMenu.tsx @@ -16,9 +16,10 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; +import { MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; + import { _t } from '../../../languageHandler'; import { ContextMenu, IProps as IContextMenuProps, MenuItem } from '../../structures/ContextMenu'; -import { MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; import CallHandler from '../../../CallHandler'; import InviteDialog, { KIND_CALL_TRANSFER } from '../dialogs/InviteDialog'; import Modal from '../../../Modal'; diff --git a/src/components/views/context_menus/DialpadContextMenu.tsx b/src/components/views/context_menus/DialpadContextMenu.tsx index 01c7c6c1d8..86d714bb43 100644 --- a/src/components/views/context_menus/DialpadContextMenu.tsx +++ b/src/components/views/context_menus/DialpadContextMenu.tsx @@ -16,9 +16,10 @@ limitations under the License. import * as React from "react"; import { createRef } from "react"; +import { MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; + import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; import { ContextMenu, IProps as IContextMenuProps } from '../../structures/ContextMenu'; -import { MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; import Field from "../elements/Field"; import DialPad from '../voip/DialPad'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/context_menus/GenericElementContextMenu.tsx b/src/components/views/context_menus/GenericElementContextMenu.tsx index a0a8c89b37..d5ebfca26e 100644 --- a/src/components/views/context_menus/GenericElementContextMenu.tsx +++ b/src/components/views/context_menus/GenericElementContextMenu.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; interface IProps { diff --git a/src/components/views/context_menus/GenericTextContextMenu.tsx b/src/components/views/context_menus/GenericTextContextMenu.tsx index 3ca158dd02..a8edf6af3c 100644 --- a/src/components/views/context_menus/GenericTextContextMenu.tsx +++ b/src/components/views/context_menus/GenericTextContextMenu.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; interface IProps { diff --git a/src/components/views/context_menus/GroupInviteTileContextMenu.js b/src/components/views/context_menus/GroupInviteTileContextMenu.js index ed5a45d432..e0717e2494 100644 --- a/src/components/views/context_menus/GroupInviteTileContextMenu.js +++ b/src/components/views/context_menus/GroupInviteTileContextMenu.js @@ -17,16 +17,16 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; +import { Group } from 'matrix-js-sdk/src/models/group'; +import { logger } from "matrix-js-sdk/src/logger"; + import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; import Modal from '../../../Modal'; -import { Group } from 'matrix-js-sdk/src/models/group'; import GroupStore from "../../../stores/GroupStore"; import { MenuItem } from "../../structures/ContextMenu"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - @replaceableComponent("views.context_menus.GroupInviteTileContextMenu") export default class GroupInviteTileContextMenu extends React.Component { static propTypes = { diff --git a/src/components/views/context_menus/StatusMessageContextMenu.tsx b/src/components/views/context_menus/StatusMessageContextMenu.tsx index 954dc3f5c0..5a4abcded4 100644 --- a/src/components/views/context_menus/StatusMessageContextMenu.tsx +++ b/src/components/views/context_menus/StatusMessageContextMenu.tsx @@ -15,11 +15,12 @@ limitations under the License. */ import React, { ChangeEvent } from 'react'; +import { User } from "matrix-js-sdk/src/models/user"; + import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import AccessibleButton, { ButtonEvent } from '../elements/AccessibleButton'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { User } from "matrix-js-sdk/src/models/user"; import Spinner from "../elements/Spinner"; interface IProps { diff --git a/src/components/views/context_menus/TagTileContextMenu.js b/src/components/views/context_menus/TagTileContextMenu.js index 0c3c48a07f..d7b21756f6 100644 --- a/src/components/views/context_menus/TagTileContextMenu.js +++ b/src/components/views/context_menus/TagTileContextMenu.js @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; + import { _t } from '../../../languageHandler'; import dis from '../../../dispatcher/dispatcher'; import TagOrderActions from '../../../actions/TagOrderActions'; diff --git a/src/components/views/context_menus/WidgetContextMenu.tsx b/src/components/views/context_menus/WidgetContextMenu.tsx index b980024dc6..4a704e38e1 100644 --- a/src/components/views/context_menus/WidgetContextMenu.tsx +++ b/src/components/views/context_menus/WidgetContextMenu.tsx @@ -16,6 +16,7 @@ limitations under the License. import React, { useContext } from "react"; import { MatrixCapabilities } from "matrix-widget-api"; +import { logger } from "matrix-js-sdk/src/logger"; import IconizedContextMenu, { IconizedContextMenuOption, IconizedContextMenuOptionList } from "./IconizedContextMenu"; import { ChevronFace } from "../../structures/ContextMenu"; @@ -34,8 +35,6 @@ import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { Container, WidgetLayoutStore } from "../../../stores/widgets/WidgetLayoutStore"; import { getConfigLivestreamUrl, startJitsiAudioLivestream } from "../../../Livestream"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps extends React.ComponentProps { app: IApp; userWidget?: boolean; diff --git a/src/components/views/dialogs/AddExistingToSpaceDialog.tsx b/src/components/views/dialogs/AddExistingToSpaceDialog.tsx index 337941ce5f..3eaa0f0555 100644 --- a/src/components/views/dialogs/AddExistingToSpaceDialog.tsx +++ b/src/components/views/dialogs/AddExistingToSpaceDialog.tsx @@ -19,6 +19,7 @@ import classNames from "classnames"; import { Room } from "matrix-js-sdk/src/models/room"; import { sleep } from "matrix-js-sdk/src/utils"; import { EventType } from "matrix-js-sdk/src/@types/event"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from '../../../languageHandler'; import BaseDialog from "./BaseDialog"; @@ -41,8 +42,6 @@ import TruncatedList from "../elements/TruncatedList"; import EntityTile from "../rooms/EntityTile"; import BaseAvatar from "../avatars/BaseAvatar"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { space: Room; onCreateRoomClick(): void; diff --git a/src/components/views/dialogs/AddressPickerDialog.tsx b/src/components/views/dialogs/AddressPickerDialog.tsx index 9484859509..e5bb579d65 100644 --- a/src/components/views/dialogs/AddressPickerDialog.tsx +++ b/src/components/views/dialogs/AddressPickerDialog.tsx @@ -19,6 +19,7 @@ limitations under the License. import React, { createRef } from 'react'; import { sleep } from "matrix-js-sdk/src/utils"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t, _td } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; @@ -37,8 +38,6 @@ import AddressTile from '../elements/AddressTile'; import BaseDialog from "./BaseDialog"; import DialogButtons from "../elements/DialogButtons"; -import { logger } from "matrix-js-sdk/src/logger"; - const TRUNCATE_QUERY_LIST = 40; const QUERY_USER_DIRECTORY_DEBOUNCE_MS = 200; diff --git a/src/components/views/dialogs/AskInviteAnywayDialog.tsx b/src/components/views/dialogs/AskInviteAnywayDialog.tsx index 3ae82f1026..1815a43d57 100644 --- a/src/components/views/dialogs/AskInviteAnywayDialog.tsx +++ b/src/components/views/dialogs/AskInviteAnywayDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from '../../../languageHandler'; import SettingsStore from "../../../settings/SettingsStore"; import { SettingLevel } from "../../../settings/SettingLevel"; diff --git a/src/components/views/dialogs/BaseDialog.tsx b/src/components/views/dialogs/BaseDialog.tsx index 0af494f53e..15c9114ca2 100644 --- a/src/components/views/dialogs/BaseDialog.tsx +++ b/src/components/views/dialogs/BaseDialog.tsx @@ -19,6 +19,7 @@ limitations under the License. import React from 'react'; import FocusLock from 'react-focus-lock'; import classNames from 'classnames'; +import { MatrixClient } from "matrix-js-sdk/src/client"; import { Key } from '../../../Keyboard'; import AccessibleButton, { ButtonEvent } from '../elements/AccessibleButton'; @@ -26,7 +27,6 @@ import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from "../../../languageHandler"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { MatrixClient } from "matrix-js-sdk/src/client"; import { IDialogProps } from "./IDialogProps"; interface IProps extends IDialogProps { diff --git a/src/components/views/dialogs/BugReportDialog.tsx b/src/components/views/dialogs/BugReportDialog.tsx index 38566cdf04..3ba5b2e46e 100644 --- a/src/components/views/dialogs/BugReportDialog.tsx +++ b/src/components/views/dialogs/BugReportDialog.tsx @@ -18,6 +18,7 @@ limitations under the License. */ import React from 'react'; + import SdkConfig from '../../../SdkConfig'; import Modal from '../../../Modal'; import { _t } from '../../../languageHandler'; diff --git a/src/components/views/dialogs/ChangelogDialog.tsx b/src/components/views/dialogs/ChangelogDialog.tsx index de9e454401..f759f04300 100644 --- a/src/components/views/dialogs/ChangelogDialog.tsx +++ b/src/components/views/dialogs/ChangelogDialog.tsx @@ -17,6 +17,7 @@ Copyright 2019 Michael Telatynski <7t3chguy@gmail.com> import React from 'react'; import request from 'browser-request'; + import { _t } from '../../../languageHandler'; import QuestionDialog from "./QuestionDialog"; import Spinner from "../elements/Spinner"; diff --git a/src/components/views/dialogs/CommunityPrototypeInviteDialog.tsx b/src/components/views/dialogs/CommunityPrototypeInviteDialog.tsx index d5a54aaa23..90588178ce 100644 --- a/src/components/views/dialogs/CommunityPrototypeInviteDialog.tsx +++ b/src/components/views/dialogs/CommunityPrototypeInviteDialog.tsx @@ -15,6 +15,9 @@ limitations under the License. */ import React, { ChangeEvent, FormEvent } from 'react'; +import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { logger } from "matrix-js-sdk/src/logger"; + import BaseDialog from "./BaseDialog"; import { _t } from "../../../languageHandler"; import { IDialogProps } from "./IDialogProps"; @@ -23,7 +26,6 @@ import AccessibleButton from "../elements/AccessibleButton"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { arrayFastClone } from "../../../utils/arrays"; import SdkConfig from "../../../SdkConfig"; -import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import InviteDialog from "./InviteDialog"; import BaseAvatar from "../avatars/BaseAvatar"; import { inviteMultipleToRoom, showAnyInviteErrors } from "../../../RoomInvite"; @@ -33,8 +35,6 @@ import ErrorDialog from "./ErrorDialog"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { mediaFromMxc } from "../../../customisations/Media"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps extends IDialogProps { roomId: string; communityName: string; diff --git a/src/components/views/dialogs/ConfirmAndWaitRedactDialog.tsx b/src/components/views/dialogs/ConfirmAndWaitRedactDialog.tsx index d21fde329c..fbf603c44d 100644 --- a/src/components/views/dialogs/ConfirmAndWaitRedactDialog.tsx +++ b/src/components/views/dialogs/ConfirmAndWaitRedactDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import ConfirmRedactDialog from './ConfirmRedactDialog'; diff --git a/src/components/views/dialogs/ConfirmRedactDialog.tsx b/src/components/views/dialogs/ConfirmRedactDialog.tsx index 74b3320fdf..6839c0f7bd 100644 --- a/src/components/views/dialogs/ConfirmRedactDialog.tsx +++ b/src/components/views/dialogs/ConfirmRedactDialog.tsx @@ -16,6 +16,7 @@ limitations under the License. import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; import React from 'react'; + import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import Modal from '../../../Modal'; diff --git a/src/components/views/dialogs/ConfirmSpaceUserActionDialog.tsx b/src/components/views/dialogs/ConfirmSpaceUserActionDialog.tsx index 1c5dd3fafa..3d340909df 100644 --- a/src/components/views/dialogs/ConfirmSpaceUserActionDialog.tsx +++ b/src/components/views/dialogs/ConfirmSpaceUserActionDialog.tsx @@ -15,10 +15,10 @@ limitations under the License. */ import React, { ComponentProps, useMemo, useState } from 'react'; +import { Room } from "matrix-js-sdk/src/models/room"; import ConfirmUserActionDialog from "./ConfirmUserActionDialog"; import SpaceStore from "../../../stores/SpaceStore"; -import { Room } from "matrix-js-sdk/src/models/room"; import SpaceChildrenPicker from "../spaces/SpaceChildrenPicker"; type BaseProps = ComponentProps; diff --git a/src/components/views/dialogs/ConfirmWipeDeviceDialog.tsx b/src/components/views/dialogs/ConfirmWipeDeviceDialog.tsx index 2577d5456d..33e26ff7a7 100644 --- a/src/components/views/dialogs/ConfirmWipeDeviceDialog.tsx +++ b/src/components/views/dialogs/ConfirmWipeDeviceDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from "../../../languageHandler"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import BaseDialog from "./BaseDialog"; diff --git a/src/components/views/dialogs/CreateCommunityPrototypeDialog.tsx b/src/components/views/dialogs/CreateCommunityPrototypeDialog.tsx index ed48778b1d..4f19294136 100644 --- a/src/components/views/dialogs/CreateCommunityPrototypeDialog.tsx +++ b/src/components/views/dialogs/CreateCommunityPrototypeDialog.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React, { ChangeEvent } from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import BaseDialog from "./BaseDialog"; import { _t } from "../../../languageHandler"; import { IDialogProps } from "./IDialogProps"; @@ -27,8 +29,6 @@ import { showCommunityRoomInviteDialog } from "../../../RoomInvite"; import GroupStore from "../../../stores/GroupStore"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps extends IDialogProps { } diff --git a/src/components/views/dialogs/CreateGroupDialog.tsx b/src/components/views/dialogs/CreateGroupDialog.tsx index b1ea75d367..6b1dd7cf54 100644 --- a/src/components/views/dialogs/CreateGroupDialog.tsx +++ b/src/components/views/dialogs/CreateGroupDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import dis from '../../../dispatcher/dispatcher'; import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; diff --git a/src/components/views/dialogs/CreateSpaceFromCommunityDialog.tsx b/src/components/views/dialogs/CreateSpaceFromCommunityDialog.tsx index b19c8d6496..3cdc00777a 100644 --- a/src/components/views/dialogs/CreateSpaceFromCommunityDialog.tsx +++ b/src/components/views/dialogs/CreateSpaceFromCommunityDialog.tsx @@ -18,6 +18,7 @@ import React, { useEffect, useRef, useState } from "react"; import { JoinRule } from "matrix-js-sdk/src/@types/partials"; import { EventType } from "matrix-js-sdk/src/@types/event"; import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from '../../../languageHandler'; import BaseDialog from "./BaseDialog"; @@ -42,8 +43,6 @@ import TagOrderActions from "../../../actions/TagOrderActions"; import { inviteUsersToRoom } from "../../../RoomInvite"; import ProgressBar from "../elements/ProgressBar"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { matrixClient: MatrixClient; groupId: string; diff --git a/src/components/views/dialogs/CreateSubspaceDialog.tsx b/src/components/views/dialogs/CreateSubspaceDialog.tsx index 44ffd2afdd..ceebe86da8 100644 --- a/src/components/views/dialogs/CreateSubspaceDialog.tsx +++ b/src/components/views/dialogs/CreateSubspaceDialog.tsx @@ -17,6 +17,7 @@ limitations under the License. import React, { useRef, useState } from "react"; import { Room } from "matrix-js-sdk/src/models/room"; import { JoinRule } from "matrix-js-sdk/src/@types/partials"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from '../../../languageHandler'; import BaseDialog from "./BaseDialog"; @@ -30,8 +31,6 @@ import { createSpace, SpaceCreateForm } from "../spaces/SpaceCreateMenu"; import { SubspaceSelector } from "./AddExistingToSpaceDialog"; import JoinRuleDropdown from "../elements/JoinRuleDropdown"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { space: Room; onAddExistingSpaceClick(): void; diff --git a/src/components/views/dialogs/CryptoStoreTooNewDialog.tsx b/src/components/views/dialogs/CryptoStoreTooNewDialog.tsx index 3bb78233ea..e8d267414a 100644 --- a/src/components/views/dialogs/CryptoStoreTooNewDialog.tsx +++ b/src/components/views/dialogs/CryptoStoreTooNewDialog.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; + import dis from '../../../dispatcher/dispatcher'; import { _t } from '../../../languageHandler'; import SdkConfig from '../../../SdkConfig'; diff --git a/src/components/views/dialogs/DeactivateAccountDialog.tsx b/src/components/views/dialogs/DeactivateAccountDialog.tsx index 35556aacd9..d564639e9f 100644 --- a/src/components/views/dialogs/DeactivateAccountDialog.tsx +++ b/src/components/views/dialogs/DeactivateAccountDialog.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import { AuthType, IAuthData } from 'matrix-js-sdk/src/interactive-auth'; +import { logger } from "matrix-js-sdk/src/logger"; import Analytics from '../../../Analytics'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; @@ -28,8 +29,6 @@ import StyledCheckbox from "../elements/StyledCheckbox"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import BaseDialog from "./BaseDialog"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { onFinished: (success: boolean) => void; } diff --git a/src/components/views/dialogs/DevtoolsDialog.tsx b/src/components/views/dialogs/DevtoolsDialog.tsx index 377911d095..120b9c7ea5 100644 --- a/src/components/views/dialogs/DevtoolsDialog.tsx +++ b/src/components/views/dialogs/DevtoolsDialog.tsx @@ -16,12 +16,6 @@ limitations under the License. */ import React, { useState, useEffect, ChangeEvent, MouseEvent } from 'react'; -import SyntaxHighlight from '../elements/SyntaxHighlight'; -import { _t } from '../../../languageHandler'; -import Field from "../elements/Field"; -import MatrixClientContext from "../../../contexts/MatrixClientContext"; -import { useEventEmitter } from "../../../hooks/useEventEmitter"; - import { PHASE_UNSENT, PHASE_REQUESTED, @@ -31,6 +25,15 @@ import { PHASE_CANCELLED, VerificationRequest, } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { logger } from "matrix-js-sdk/src/logger"; + +import SyntaxHighlight from '../elements/SyntaxHighlight'; +import { _t } from '../../../languageHandler'; +import Field from "../elements/Field"; +import MatrixClientContext from "../../../contexts/MatrixClientContext"; +import { useEventEmitter } from "../../../hooks/useEventEmitter"; import WidgetStore, { IApp } from "../../../stores/WidgetStore"; import { UPDATE_EVENT } from "../../../stores/AsyncStore"; import { SETTINGS } from "../../../settings/Settings"; @@ -38,14 +41,10 @@ import SettingsStore, { LEVEL_ORDER } from "../../../settings/SettingsStore"; import Modal from "../../../Modal"; import ErrorDialog from "./ErrorDialog"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { Room } from "matrix-js-sdk/src/models/room"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { SettingLevel } from '../../../settings/SettingLevel'; import BaseDialog from "./BaseDialog"; import TruncatedList from "../elements/TruncatedList"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IGenericEditorProps { onBack: () => void; } diff --git a/src/components/views/dialogs/EditCommunityPrototypeDialog.tsx b/src/components/views/dialogs/EditCommunityPrototypeDialog.tsx index 7463c82cfb..6f13de78ee 100644 --- a/src/components/views/dialogs/EditCommunityPrototypeDialog.tsx +++ b/src/components/views/dialogs/EditCommunityPrototypeDialog.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React, { ChangeEvent } from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import BaseDialog from "./BaseDialog"; import { _t } from "../../../languageHandler"; import { IDialogProps } from "./IDialogProps"; @@ -26,8 +28,6 @@ import FlairStore from "../../../stores/FlairStore"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { mediaFromMxc } from "../../../customisations/Media"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps extends IDialogProps { communityId: string; } diff --git a/src/components/views/dialogs/ErrorDialog.tsx b/src/components/views/dialogs/ErrorDialog.tsx index 56cd76237f..e19d93f918 100644 --- a/src/components/views/dialogs/ErrorDialog.tsx +++ b/src/components/views/dialogs/ErrorDialog.tsx @@ -26,6 +26,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import BaseDialog from "./BaseDialog"; diff --git a/src/components/views/dialogs/ExportDialog.tsx b/src/components/views/dialogs/ExportDialog.tsx index 246f74bb58..e3d2b437cf 100644 --- a/src/components/views/dialogs/ExportDialog.tsx +++ b/src/components/views/dialogs/ExportDialog.tsx @@ -16,6 +16,8 @@ limitations under the License. import React, { useRef, useState } from "react"; import { Room } from "matrix-js-sdk/src"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../languageHandler"; import { IDialogProps } from "./IDialogProps"; import BaseDialog from "./BaseDialog"; @@ -38,8 +40,6 @@ import Exporter from "../../../utils/exportUtils/Exporter"; import Spinner from "../elements/Spinner"; import InfoDialog from "./InfoDialog"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps extends IDialogProps { room: Room; } diff --git a/src/components/views/dialogs/FeedbackDialog.tsx b/src/components/views/dialogs/FeedbackDialog.tsx index e7089283e4..5e7ea1f66c 100644 --- a/src/components/views/dialogs/FeedbackDialog.tsx +++ b/src/components/views/dialogs/FeedbackDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { useState } from 'react'; + import QuestionDialog from './QuestionDialog'; import { _t } from '../../../languageHandler'; import Field from "../elements/Field"; diff --git a/src/components/views/dialogs/HostSignupDialog.tsx b/src/components/views/dialogs/HostSignupDialog.tsx index 1228495747..bce358cf46 100644 --- a/src/components/views/dialogs/HostSignupDialog.tsx +++ b/src/components/views/dialogs/HostSignupDialog.tsx @@ -15,12 +15,14 @@ limitations under the License. */ import React from "react"; +import classNames from "classnames"; +import { logger } from "matrix-js-sdk/src/logger"; + import AccessibleButton from "../elements/AccessibleButton"; import Modal from "../../../Modal"; import PersistedElement from "../elements/PersistedElement"; import QuestionDialog from './QuestionDialog'; import SdkConfig from "../../../SdkConfig"; -import classNames from "classnames"; import { _t } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { HostSignupStore } from "../../../stores/HostSignupStore"; @@ -33,8 +35,6 @@ import { } from "./HostSignupDialogTypes"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - const HOST_SIGNUP_KEY = "host_signup"; interface IProps {} diff --git a/src/components/views/dialogs/IncomingSasDialog.tsx b/src/components/views/dialogs/IncomingSasDialog.tsx index da766f495c..f57ebc9476 100644 --- a/src/components/views/dialogs/IncomingSasDialog.tsx +++ b/src/components/views/dialogs/IncomingSasDialog.tsx @@ -15,6 +15,10 @@ limitations under the License. */ import React from 'react'; +import { IGeneratedSas, ISasEvent } from "matrix-js-sdk/src/crypto/verification/SAS"; +import { VerificationBase } from "matrix-js-sdk/src/crypto/verification/Base"; +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; @@ -27,10 +31,6 @@ import VerificationShowSas from "../verification/VerificationShowSas"; import BaseDialog from "./BaseDialog"; import DialogButtons from "../elements/DialogButtons"; import { IDialogProps } from "./IDialogProps"; -import { IGeneratedSas, ISasEvent } from "matrix-js-sdk/src/crypto/verification/SAS"; -import { VerificationBase } from "matrix-js-sdk/src/crypto/verification/Base"; - -import { logger } from "matrix-js-sdk/src/logger"; const PHASE_START = 0; const PHASE_SHOW_SAS = 1; diff --git a/src/components/views/dialogs/IntegrationsDisabledDialog.tsx b/src/components/views/dialogs/IntegrationsDisabledDialog.tsx index 7da4bb84b9..d5c08211da 100644 --- a/src/components/views/dialogs/IntegrationsDisabledDialog.tsx +++ b/src/components/views/dialogs/IntegrationsDisabledDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from "../../../languageHandler"; import dis from '../../../dispatcher/dispatcher'; import { Action } from "../../../dispatcher/actions"; diff --git a/src/components/views/dialogs/IntegrationsImpossibleDialog.tsx b/src/components/views/dialogs/IntegrationsImpossibleDialog.tsx index 52e3a2fbb8..53c58bba88 100644 --- a/src/components/views/dialogs/IntegrationsImpossibleDialog.tsx +++ b/src/components/views/dialogs/IntegrationsImpossibleDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from "../../../languageHandler"; import SdkConfig from "../../../SdkConfig"; import * as sdk from "../../../index"; diff --git a/src/components/views/dialogs/InteractiveAuthDialog.tsx b/src/components/views/dialogs/InteractiveAuthDialog.tsx index 2ea97f91c3..c6a7d414bf 100644 --- a/src/components/views/dialogs/InteractiveAuthDialog.tsx +++ b/src/components/views/dialogs/InteractiveAuthDialog.tsx @@ -17,16 +17,15 @@ limitations under the License. */ import React from 'react'; +import { MatrixClient } from "matrix-js-sdk/src/client"; +import { IAuthData } from "matrix-js-sdk/src/interactive-auth"; import { _t } from '../../../languageHandler'; - import AccessibleButton from '../elements/AccessibleButton'; import InteractiveAuth, { ERROR_USER_CANCELLED } from "../../structures/InteractiveAuth"; import { SSOAuthEntry } from "../auth/InteractiveAuthEntryComponents"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { MatrixClient } from "matrix-js-sdk/src/client"; import BaseDialog from "./BaseDialog"; -import { IAuthData } from "matrix-js-sdk/src/interactive-auth"; import { IDialogProps } from "./IDialogProps"; interface IDialogAesthetics { diff --git a/src/components/views/dialogs/InviteDialog.tsx b/src/components/views/dialogs/InviteDialog.tsx index fe3968673c..6a7c097032 100644 --- a/src/components/views/dialogs/InviteDialog.tsx +++ b/src/components/views/dialogs/InviteDialog.tsx @@ -16,12 +16,16 @@ limitations under the License. import React, { createRef } from 'react'; import classNames from 'classnames'; +import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; +import { IInvite3PID } from "matrix-js-sdk/src/@types/requests"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t, _td } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { makeRoomPermalink, makeUserPermalink } from "../../../utils/permalinks/Permalinks"; import DMRoomMap from "../../../utils/DMRoomMap"; -import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import SdkConfig from "../../../SdkConfig"; import * as Email from "../../../email"; import { getDefaultIdentityServerUrl, useDefaultIdentityServer } from "../../../utils/IdentityServerUtils"; @@ -49,17 +53,13 @@ import { CommunityPrototypeStore } from "../../../stores/CommunityPrototypeStore import SettingsStore from "../../../settings/SettingsStore"; import { UIFeature } from "../../../settings/UIFeature"; import CountlyAnalytics from "../../../CountlyAnalytics"; -import { Room } from "matrix-js-sdk/src/models/room"; -import { MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { mediaFromMxc } from "../../../customisations/Media"; import { getAddressType } from "../../../UserAddress"; import BaseAvatar from '../avatars/BaseAvatar'; import AccessibleButton, { ButtonEvent } from '../elements/AccessibleButton'; -import { compare } from '../../../utils/strings'; -import { IInvite3PID } from "matrix-js-sdk/src/@types/requests"; +import { compare, copyPlaintext, selectText } from '../../../utils/strings'; import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; -import { copyPlaintext, selectText } from "../../../utils/strings"; import * as ContextMenu from "../../structures/ContextMenu"; import { toRightOf } from "../../structures/ContextMenu"; import GenericTextContextMenu from "../context_menus/GenericTextContextMenu"; @@ -73,8 +73,6 @@ import BaseDialog from "./BaseDialog"; import DialPadBackspaceButton from "../elements/DialPadBackspaceButton"; import SpaceStore from "../../../stores/SpaceStore"; -import { logger } from "matrix-js-sdk/src/logger"; - // we have a number of types defined from the Matrix spec which can't reasonably be altered here. /* eslint-disable camelcase */ diff --git a/src/components/views/dialogs/KeySignatureUploadFailedDialog.tsx b/src/components/views/dialogs/KeySignatureUploadFailedDialog.tsx index 28e4d1ca80..381c96dc66 100644 --- a/src/components/views/dialogs/KeySignatureUploadFailedDialog.tsx +++ b/src/components/views/dialogs/KeySignatureUploadFailedDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { useState, useCallback, useRef } from 'react'; + import { _t } from '../../../languageHandler'; import SdkConfig from '../../../SdkConfig'; import BaseDialog from "./BaseDialog"; diff --git a/src/components/views/dialogs/LazyLoadingDisabledDialog.tsx b/src/components/views/dialogs/LazyLoadingDisabledDialog.tsx index ec30123436..0efad31cd2 100644 --- a/src/components/views/dialogs/LazyLoadingDisabledDialog.tsx +++ b/src/components/views/dialogs/LazyLoadingDisabledDialog.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; + import QuestionDialog from './QuestionDialog'; import { _t } from '../../../languageHandler'; import SdkConfig from '../../../SdkConfig'; diff --git a/src/components/views/dialogs/LazyLoadingResyncDialog.tsx b/src/components/views/dialogs/LazyLoadingResyncDialog.tsx index e6a505511c..b4e99ada32 100644 --- a/src/components/views/dialogs/LazyLoadingResyncDialog.tsx +++ b/src/components/views/dialogs/LazyLoadingResyncDialog.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; + import QuestionDialog from './QuestionDialog'; import { _t } from '../../../languageHandler'; import SdkConfig from '../../../SdkConfig'; diff --git a/src/components/views/dialogs/LogoutDialog.tsx b/src/components/views/dialogs/LogoutDialog.tsx index 5ac3141269..af70d51488 100644 --- a/src/components/views/dialogs/LogoutDialog.tsx +++ b/src/components/views/dialogs/LogoutDialog.tsx @@ -17,6 +17,8 @@ limitations under the License. import React from 'react'; import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup"; +import { logger } from "matrix-js-sdk/src/logger"; + import Modal from '../../../Modal'; import * as sdk from '../../../index'; import dis from '../../../dispatcher/dispatcher'; @@ -25,8 +27,6 @@ import { MatrixClientPeg } from '../../../MatrixClientPeg'; import RestoreKeyBackupDialog from './security/RestoreKeyBackupDialog'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { onFinished: (success: boolean) => void; } diff --git a/src/components/views/dialogs/ManualDeviceKeyVerificationDialog.tsx b/src/components/views/dialogs/ManualDeviceKeyVerificationDialog.tsx index 88419d26b8..6b94eb9c7a 100644 --- a/src/components/views/dialogs/ManualDeviceKeyVerificationDialog.tsx +++ b/src/components/views/dialogs/ManualDeviceKeyVerificationDialog.tsx @@ -19,12 +19,13 @@ limitations under the License. */ import React from 'react'; +import { DeviceInfo } from "matrix-js-sdk/src/crypto/deviceinfo"; + import { MatrixClientPeg } from '../../../MatrixClientPeg'; import * as FormattingUtils from '../../../utils/FormattingUtils'; import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import QuestionDialog from "./QuestionDialog"; -import { DeviceInfo } from "matrix-js-sdk/src/crypto/deviceinfo"; import { IDialogProps } from "./IDialogProps"; interface IProps extends IDialogProps { diff --git a/src/components/views/dialogs/MessageEditHistoryDialog.tsx b/src/components/views/dialogs/MessageEditHistoryDialog.tsx index f5a990e409..a7fb36fc05 100644 --- a/src/components/views/dialogs/MessageEditHistoryDialog.tsx +++ b/src/components/views/dialogs/MessageEditHistoryDialog.tsx @@ -15,22 +15,22 @@ limitations under the License. */ import React from 'react'; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { EventType, RelationType } from "matrix-js-sdk/src/@types/event"; +import { defer } from "matrix-js-sdk/src/utils"; +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { _t } from '../../../languageHandler'; import { wantsDateSeparator } from '../../../DateUtils'; import SettingsStore from '../../../settings/SettingsStore'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import BaseDialog from "./BaseDialog"; import ScrollPanel from "../../structures/ScrollPanel"; import Spinner from "../elements/Spinner"; import EditHistoryMessage from "../messages/EditHistoryMessage"; import DateSeparator from "../messages/DateSeparator"; import { IDialogProps } from "./IDialogProps"; -import { EventType, RelationType } from "matrix-js-sdk/src/@types/event"; -import { defer } from "matrix-js-sdk/src/utils"; - -import { logger } from "matrix-js-sdk/src/logger"; interface IProps extends IDialogProps { mxEvent: MatrixEvent; diff --git a/src/components/views/dialogs/ModalWidgetDialog.tsx b/src/components/views/dialogs/ModalWidgetDialog.tsx index 1bf7eb7307..1b44753478 100644 --- a/src/components/views/dialogs/ModalWidgetDialog.tsx +++ b/src/components/views/dialogs/ModalWidgetDialog.tsx @@ -15,9 +15,6 @@ limitations under the License. */ import * as React from 'react'; -import BaseDialog from './BaseDialog'; -import { _t, getUserLanguage } from '../../../languageHandler'; -import AccessibleButton from "../elements/AccessibleButton"; import { ClientWidgetApi, IModalWidgetCloseRequest, @@ -33,6 +30,10 @@ import { WidgetApiFromWidgetAction, WidgetKind, } from "matrix-widget-api"; + +import BaseDialog from './BaseDialog'; +import { _t, getUserLanguage } from '../../../languageHandler'; +import AccessibleButton from "../elements/AccessibleButton"; import { StopGapWidgetDriver } from "../../../stores/widgets/StopGapWidgetDriver"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { OwnProfileStore } from "../../../stores/OwnProfileStore"; diff --git a/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx b/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx index 804a1aec35..ac83134f22 100644 --- a/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx +++ b/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx @@ -15,10 +15,10 @@ limitations under the License. */ import * as React from "react"; +import { useRef, useState } from "react"; import { _t } from '../../../languageHandler'; import { IDialogProps } from "./IDialogProps"; -import { useRef, useState } from "react"; import Field from "../elements/Field"; import CountlyAnalytics from "../../../CountlyAnalytics"; import withValidation from "../elements/Validation"; diff --git a/src/components/views/dialogs/ReportEventDialog.tsx b/src/components/views/dialogs/ReportEventDialog.tsx index 25675ee7d2..29745bf7cd 100644 --- a/src/components/views/dialogs/ReportEventDialog.tsx +++ b/src/components/views/dialogs/ReportEventDialog.tsx @@ -15,10 +15,11 @@ limitations under the License. */ import React from 'react'; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { _t } from '../../../languageHandler'; import { ensureDMExists } from "../../../createRoom"; import { IDialogProps } from "./IDialogProps"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import SdkConfig from '../../../SdkConfig'; import Markdown from '../../../Markdown'; diff --git a/src/components/views/dialogs/RoomSettingsDialog.tsx b/src/components/views/dialogs/RoomSettingsDialog.tsx index b0c6fc4050..41832b95a3 100644 --- a/src/components/views/dialogs/RoomSettingsDialog.tsx +++ b/src/components/views/dialogs/RoomSettingsDialog.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; + import TabbedView, { Tab } from "../../structures/TabbedView"; import { _t, _td } from "../../../languageHandler"; import AdvancedRoomSettingsTab from "../settings/tabs/room/AdvancedRoomSettingsTab"; diff --git a/src/components/views/dialogs/ServerOfflineDialog.tsx b/src/components/views/dialogs/ServerOfflineDialog.tsx index ff24a1bad8..6cf07f6bd6 100644 --- a/src/components/views/dialogs/ServerOfflineDialog.tsx +++ b/src/components/views/dialogs/ServerOfflineDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import * as React from 'react'; + import BaseDialog from './BaseDialog'; import { _t } from '../../../languageHandler'; import { EchoStore } from "../../../stores/local-echo/EchoStore"; diff --git a/src/components/views/dialogs/ServerPickerDialog.tsx b/src/components/views/dialogs/ServerPickerDialog.tsx index 4c355c6c0e..f06a4ca82a 100644 --- a/src/components/views/dialogs/ServerPickerDialog.tsx +++ b/src/components/views/dialogs/ServerPickerDialog.tsx @@ -16,6 +16,7 @@ limitations under the License. import React, { createRef } from "react"; import { AutoDiscovery } from "matrix-js-sdk/src/autodiscovery"; +import { logger } from "matrix-js-sdk/src/logger"; import AutoDiscoveryUtils, { ValidatedServerConfig } from "../../../utils/AutoDiscoveryUtils"; import BaseDialog from './BaseDialog'; @@ -28,8 +29,6 @@ import TextWithTooltip from "../elements/TextWithTooltip"; import withValidation, { IFieldState } from "../elements/Validation"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { title?: string; serverConfig: ValidatedServerConfig; diff --git a/src/components/views/dialogs/SeshatResetDialog.tsx b/src/components/views/dialogs/SeshatResetDialog.tsx index b89002c30f..1c048dd9fa 100644 --- a/src/components/views/dialogs/SeshatResetDialog.tsx +++ b/src/components/views/dialogs/SeshatResetDialog.tsx @@ -15,12 +15,11 @@ limitations under the License. */ import React from 'react'; + import { _t } from "../../../languageHandler"; import { replaceableComponent } from "../../../utils/replaceableComponent"; - import BaseDialog from "./BaseDialog"; import DialogButtons from "../elements/DialogButtons"; - import { IDialogProps } from "./IDialogProps"; @replaceableComponent("views.dialogs.SeshatResetDialog") diff --git a/src/components/views/dialogs/SessionRestoreErrorDialog.tsx b/src/components/views/dialogs/SessionRestoreErrorDialog.tsx index b36dbf548e..56cd75bfb4 100644 --- a/src/components/views/dialogs/SessionRestoreErrorDialog.tsx +++ b/src/components/views/dialogs/SessionRestoreErrorDialog.tsx @@ -17,6 +17,7 @@ limitations under the License. */ import React from 'react'; + import SdkConfig from '../../../SdkConfig'; import Modal from '../../../Modal'; import { _t } from '../../../languageHandler'; diff --git a/src/components/views/dialogs/SetEmailDialog.tsx b/src/components/views/dialogs/SetEmailDialog.tsx index fda1e200cb..6e5f0cf050 100644 --- a/src/components/views/dialogs/SetEmailDialog.tsx +++ b/src/components/views/dialogs/SetEmailDialog.tsx @@ -16,6 +16,8 @@ limitations under the License. */ import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import * as Email from '../../../email'; import AddThreepid from '../../../AddThreepid'; import { _t } from '../../../languageHandler'; @@ -28,8 +30,6 @@ import BaseDialog from "./BaseDialog"; import EditableText from "../elements/EditableText"; import { IDialogProps } from "./IDialogProps"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps extends IDialogProps { title: string; } diff --git a/src/components/views/dialogs/ShareDialog.tsx b/src/components/views/dialogs/ShareDialog.tsx index 80c0543c4e..d4db217309 100644 --- a/src/components/views/dialogs/ShareDialog.tsx +++ b/src/components/views/dialogs/ShareDialog.tsx @@ -22,6 +22,7 @@ import { User } from "matrix-js-sdk/src/models/user"; import { Group } from "matrix-js-sdk/src/models/group"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { _t } from '../../../languageHandler'; import QRCode from "../elements/QRCode"; import { RoomPermalinkCreator, makeGroupPermalink, makeUserPermalink } from "../../../utils/permalinks/Permalinks"; diff --git a/src/components/views/dialogs/SlashCommandHelpDialog.tsx b/src/components/views/dialogs/SlashCommandHelpDialog.tsx index ccb157f025..166bd27332 100644 --- a/src/components/views/dialogs/SlashCommandHelpDialog.tsx +++ b/src/components/views/dialogs/SlashCommandHelpDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from "../../../languageHandler"; import { CommandCategories, Commands } from "../../../SlashCommands"; import { IDialogProps } from "./IDialogProps"; diff --git a/src/components/views/dialogs/StorageEvictedDialog.tsx b/src/components/views/dialogs/StorageEvictedDialog.tsx index bdbbf815e6..8a41224d57 100644 --- a/src/components/views/dialogs/StorageEvictedDialog.tsx +++ b/src/components/views/dialogs/StorageEvictedDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import SdkConfig from '../../../SdkConfig'; import Modal from '../../../Modal'; import { _t } from '../../../languageHandler'; diff --git a/src/components/views/dialogs/TabbedIntegrationManagerDialog.tsx b/src/components/views/dialogs/TabbedIntegrationManagerDialog.tsx index dab1a1f222..7ab425a5f6 100644 --- a/src/components/views/dialogs/TabbedIntegrationManagerDialog.tsx +++ b/src/components/views/dialogs/TabbedIntegrationManagerDialog.tsx @@ -15,10 +15,12 @@ limitations under the License. */ import React from 'react'; -import { IntegrationManagers } from "../../../integrations/IntegrationManagers"; import { Room } from "matrix-js-sdk/src/models/room"; -import { dialogTermsInteractionCallback, TermsNotSignedError } from "../../../Terms"; import classNames from 'classnames'; +import { logger } from "matrix-js-sdk/src/logger"; + +import { IntegrationManagers } from "../../../integrations/IntegrationManagers"; +import { dialogTermsInteractionCallback, TermsNotSignedError } from "../../../Terms"; import * as ScalarMessaging from "../../../ScalarMessaging"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { IntegrationManagerInstance } from "../../../integrations/IntegrationManagerInstance"; @@ -27,8 +29,6 @@ import AccessibleButton from "../elements/AccessibleButton"; import IntegrationManager from "../settings/IntegrationManager"; import { IDialogProps } from "./IDialogProps"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps extends IDialogProps { /** * Optional room where the integration manager should be open to diff --git a/src/components/views/dialogs/TermsDialog.tsx b/src/components/views/dialogs/TermsDialog.tsx index 6aba597aad..f2f713a75f 100644 --- a/src/components/views/dialogs/TermsDialog.tsx +++ b/src/components/views/dialogs/TermsDialog.tsx @@ -16,10 +16,10 @@ limitations under the License. import url from 'url'; import React from 'react'; -import { _t, pickBestLanguage } from '../../../languageHandler'; - -import { replaceableComponent } from "../../../utils/replaceableComponent"; import { SERVICE_TYPES } from "matrix-js-sdk/src/service-types"; + +import { _t, pickBestLanguage } from '../../../languageHandler'; +import { replaceableComponent } from "../../../utils/replaceableComponent"; import DialogButtons from "../elements/DialogButtons"; import BaseDialog from "./BaseDialog"; diff --git a/src/components/views/dialogs/TextInputDialog.tsx b/src/components/views/dialogs/TextInputDialog.tsx index 7a5887f053..2667c131b9 100644 --- a/src/components/views/dialogs/TextInputDialog.tsx +++ b/src/components/views/dialogs/TextInputDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { ChangeEvent, createRef } from 'react'; + import Field from "../elements/Field"; import { _t, _td } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/dialogs/UploadConfirmDialog.tsx b/src/components/views/dialogs/UploadConfirmDialog.tsx index 508bb95e43..fef55766c7 100644 --- a/src/components/views/dialogs/UploadConfirmDialog.tsx +++ b/src/components/views/dialogs/UploadConfirmDialog.tsx @@ -16,8 +16,9 @@ limitations under the License. */ import React from 'react'; -import { _t } from '../../../languageHandler'; import filesize from "filesize"; + +import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { getBlobSafeMimeType } from '../../../utils/blobs'; import BaseDialog from "./BaseDialog"; diff --git a/src/components/views/dialogs/UploadFailureDialog.tsx b/src/components/views/dialogs/UploadFailureDialog.tsx index bb8d14e161..8226a82170 100644 --- a/src/components/views/dialogs/UploadFailureDialog.tsx +++ b/src/components/views/dialogs/UploadFailureDialog.tsx @@ -15,8 +15,8 @@ limitations under the License. */ import filesize from 'filesize'; - import React from 'react'; + import { _t } from '../../../languageHandler'; import ContentMessages from '../../../ContentMessages'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/dialogs/UserSettingsDialog.tsx b/src/components/views/dialogs/UserSettingsDialog.tsx index a848bf2773..6853581e5c 100644 --- a/src/components/views/dialogs/UserSettingsDialog.tsx +++ b/src/components/views/dialogs/UserSettingsDialog.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; + import TabbedView, { Tab } from "../../structures/TabbedView"; import { _t, _td } from "../../../languageHandler"; import GeneralUserSettingsTab from "../settings/tabs/user/GeneralUserSettingsTab"; diff --git a/src/components/views/dialogs/VerificationRequestDialog.tsx b/src/components/views/dialogs/VerificationRequestDialog.tsx index 65b7f71dbd..5387a675c1 100644 --- a/src/components/views/dialogs/VerificationRequestDialog.tsx +++ b/src/components/views/dialogs/VerificationRequestDialog.tsx @@ -15,13 +15,14 @@ limitations under the License. */ import React from 'react'; +import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { User } from 'matrix-js-sdk/src/models/user'; + import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; import BaseDialog from "./BaseDialog"; import EncryptionPanel from "../right_panel/EncryptionPanel"; -import { User } from 'matrix-js-sdk/src/models/user'; interface IProps { verificationRequest: VerificationRequest; diff --git a/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx b/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx index 366adb887c..b794592b2f 100644 --- a/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx +++ b/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx @@ -15,9 +15,6 @@ limitations under the License. */ import React from 'react'; -import BaseDialog from "./BaseDialog"; -import { _t } from "../../../languageHandler"; -import { IDialogProps } from "./IDialogProps"; import { Capability, isTimelineCapability, @@ -25,13 +22,17 @@ import { WidgetEventCapability, WidgetKind, } from "matrix-widget-api"; +import { lexicographicCompare } from "matrix-js-sdk/src/utils"; + +import BaseDialog from "./BaseDialog"; +import { _t } from "../../../languageHandler"; +import { IDialogProps } from "./IDialogProps"; import { objectShallowClone } from "../../../utils/objects"; import StyledCheckbox from "../elements/StyledCheckbox"; import DialogButtons from "../elements/DialogButtons"; import LabelledToggleSwitch from "../elements/LabelledToggleSwitch"; import { CapabilityText } from "../../../widgets/CapabilityText"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { lexicographicCompare } from "matrix-js-sdk/src/utils"; interface IProps extends IDialogProps { requestedCapabilities: Set; diff --git a/src/components/views/dialogs/WidgetOpenIDPermissionsDialog.tsx b/src/components/views/dialogs/WidgetOpenIDPermissionsDialog.tsx index 81861c7f4d..4faf4e5237 100644 --- a/src/components/views/dialogs/WidgetOpenIDPermissionsDialog.tsx +++ b/src/components/views/dialogs/WidgetOpenIDPermissionsDialog.tsx @@ -16,17 +16,17 @@ limitations under the License. */ import React from 'react'; +import { Widget, WidgetKind } from "matrix-widget-api"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../languageHandler"; import LabelledToggleSwitch from "../elements/LabelledToggleSwitch"; -import { Widget, WidgetKind } from "matrix-widget-api"; import { OIDCState, WidgetPermissionStore } from "../../../stores/widgets/WidgetPermissionStore"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { IDialogProps } from "./IDialogProps"; import BaseDialog from "./BaseDialog"; import DialogButtons from "../elements/DialogButtons"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps extends IDialogProps { widget: Widget; widgetKind: WidgetKind; diff --git a/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx b/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx index 13603bb3c1..a9fea93fd0 100644 --- a/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx +++ b/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx @@ -18,6 +18,7 @@ import { debounce } from "lodash"; import classNames from 'classnames'; import React, { ChangeEvent, FormEvent } from 'react'; import { ISecretStorageKeyInfo } from "matrix-js-sdk/src/crypto/api"; +import { logger } from "matrix-js-sdk/src/logger"; import * as sdk from '../../../../index'; import { MatrixClientPeg } from '../../../../MatrixClientPeg'; @@ -28,8 +29,6 @@ import { IDialogProps } from "../IDialogProps"; import { accessSecretStorage } from "../../../../SecurityManager"; import Modal from "../../../../Modal"; -import { logger } from "matrix-js-sdk/src/logger"; - // Maximum acceptable size of a key file. It's 59 characters including the spaces we encode, // so this should be plenty and allow for people putting extra whitespace in the file because // maybe that's a thing people would do? diff --git a/src/components/views/dialogs/security/ConfirmDestroyCrossSigningDialog.tsx b/src/components/views/dialogs/security/ConfirmDestroyCrossSigningDialog.tsx index 392598ca36..3496d00fea 100644 --- a/src/components/views/dialogs/security/ConfirmDestroyCrossSigningDialog.tsx +++ b/src/components/views/dialogs/security/ConfirmDestroyCrossSigningDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from "../../../../languageHandler"; import { replaceableComponent } from "../../../../utils/replaceableComponent"; import BaseDialog from "../BaseDialog"; diff --git a/src/components/views/dialogs/security/CreateCrossSigningDialog.tsx b/src/components/views/dialogs/security/CreateCrossSigningDialog.tsx index 1c2857114d..f60f8a9c19 100644 --- a/src/components/views/dialogs/security/CreateCrossSigningDialog.tsx +++ b/src/components/views/dialogs/security/CreateCrossSigningDialog.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import { CrossSigningKeys } from 'matrix-js-sdk/src/client'; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from '../../../../MatrixClientPeg'; import { _t } from '../../../../languageHandler'; @@ -28,8 +29,6 @@ import Spinner from '../../elements/Spinner'; import InteractiveAuthDialog from '../InteractiveAuthDialog'; import { replaceableComponent } from "../../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { accountPassword?: string; tokenLogin?: boolean; diff --git a/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx b/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx index b651da5121..3db78f6877 100644 --- a/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx +++ b/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx @@ -16,15 +16,16 @@ limitations under the License. */ import React from 'react'; -import { MatrixClientPeg } from '../../../../MatrixClientPeg'; import { MatrixClient } from 'matrix-js-sdk/src/client'; -import { _t } from '../../../../languageHandler'; -import { accessSecretStorage } from '../../../../SecurityManager'; import { IKeyBackupInfo, IKeyBackupRestoreResult } from "matrix-js-sdk/src/crypto/keybackup"; import { ISecretStorageKeyInfo } from "matrix-js-sdk/src/crypto/api"; +import { logger } from "matrix-js-sdk/src/logger"; + +import { MatrixClientPeg } from '../../../../MatrixClientPeg'; +import { _t } from '../../../../languageHandler'; +import { accessSecretStorage } from '../../../../SecurityManager'; import * as sdk from '../../../../index'; import { IDialogProps } from "../IDialogProps"; -import { logger } from "matrix-js-sdk/src/logger"; enum RestoreType { Passphrase = "passphrase", diff --git a/src/components/views/dialogs/security/SetupEncryptionDialog.tsx b/src/components/views/dialogs/security/SetupEncryptionDialog.tsx index 0323769536..00be976576 100644 --- a/src/components/views/dialogs/security/SetupEncryptionDialog.tsx +++ b/src/components/views/dialogs/security/SetupEncryptionDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import SetupEncryptionBody from '../../../structures/auth/SetupEncryptionBody'; import BaseDialog from '../BaseDialog'; import { _t } from '../../../../languageHandler'; diff --git a/src/components/views/elements/AccessibleButton.tsx b/src/components/views/elements/AccessibleButton.tsx index 75b6890112..ae11098e73 100644 --- a/src/components/views/elements/AccessibleButton.tsx +++ b/src/components/views/elements/AccessibleButton.tsx @@ -15,9 +15,9 @@ */ import React, { ReactHTML } from 'react'; +import classnames from 'classnames'; import { Key } from '../../../Keyboard'; -import classnames from 'classnames'; export type ButtonEvent = React.MouseEvent | React.KeyboardEvent | React.FormEvent; diff --git a/src/components/views/elements/ActionButton.tsx b/src/components/views/elements/ActionButton.tsx index 390e84be77..a684b999a5 100644 --- a/src/components/views/elements/ActionButton.tsx +++ b/src/components/views/elements/ActionButton.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import AccessibleButton from './AccessibleButton'; import dis from '../../../dispatcher/dispatcher'; import Analytics from '../../../Analytics'; diff --git a/src/components/views/elements/AddressSelector.tsx b/src/components/views/elements/AddressSelector.tsx index eae82142da..f1203fbee5 100644 --- a/src/components/views/elements/AddressSelector.tsx +++ b/src/components/views/elements/AddressSelector.tsx @@ -17,6 +17,7 @@ limitations under the License. import React, { createRef } from 'react'; import classNames from 'classnames'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import { IUserAddress } from '../../../UserAddress'; import AddressTile from './AddressTile'; diff --git a/src/components/views/elements/AddressTile.tsx b/src/components/views/elements/AddressTile.tsx index 52c0d84ac2..79995f3aba 100644 --- a/src/components/views/elements/AddressTile.tsx +++ b/src/components/views/elements/AddressTile.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import classNames from 'classnames'; + import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { mediaFromMxc } from "../../../customisations/Media"; diff --git a/src/components/views/elements/AppPermission.tsx b/src/components/views/elements/AppPermission.tsx index c0543eb363..11bbd6204d 100644 --- a/src/components/views/elements/AppPermission.tsx +++ b/src/components/views/elements/AppPermission.tsx @@ -18,12 +18,13 @@ limitations under the License. import React from 'react'; import url from 'url'; +import { RoomMember } from 'matrix-js-sdk/src/models/room-member'; + import { _t } from '../../../languageHandler'; import SdkConfig from '../../../SdkConfig'; import WidgetUtils from "../../../utils/WidgetUtils"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { RoomMember } from 'matrix-js-sdk/src/models/room-member'; import MemberAvatar from '../avatars/MemberAvatar'; import BaseAvatar from '../avatars/BaseAvatar'; import AccessibleButton from './AccessibleButton'; diff --git a/src/components/views/elements/AppTile.tsx b/src/components/views/elements/AppTile.tsx index 5f7c0543c4..e45a292e3d 100644 --- a/src/components/views/elements/AppTile.tsx +++ b/src/components/views/elements/AppTile.tsx @@ -19,6 +19,11 @@ limitations under the License. import url from 'url'; import React, { createRef } from 'react'; +import classNames from 'classnames'; +import { MatrixCapabilities } from "matrix-widget-api"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from '../../../MatrixClientPeg'; import AccessibleButton from './AccessibleButton'; import { _t } from '../../../languageHandler'; @@ -27,18 +32,15 @@ import AppWarning from './AppWarning'; import Spinner from './Spinner'; import dis from '../../../dispatcher/dispatcher'; import ActiveWidgetStore from '../../../stores/ActiveWidgetStore'; -import classNames from 'classnames'; import SettingsStore from "../../../settings/SettingsStore"; import { aboveLeftOf, ContextMenuButton } from "../../structures/ContextMenu"; import PersistedElement, { getPersistKey } from "./PersistedElement"; import { WidgetType } from "../../../widgets/WidgetType"; import { StopGapWidget } from "../../../stores/widgets/StopGapWidget"; import { ElementWidgetActions } from "../../../stores/widgets/ElementWidgetActions"; -import { MatrixCapabilities } from "matrix-widget-api"; import RoomWidgetContextMenu from "../context_menus/WidgetContextMenu"; import WidgetAvatar from "../avatars/WidgetAvatar"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { Room } from "matrix-js-sdk/src/models/room"; import { IApp } from "../../../stores/WidgetStore"; interface IProps { @@ -86,8 +88,6 @@ interface IState { widgetPageTitle: string; } -import { logger } from "matrix-js-sdk/src/logger"; - @replaceableComponent("views.elements.AppTile") export default class AppTile extends React.Component { public static defaultProps: Partial = { diff --git a/src/components/views/elements/DNDTagTile.js b/src/components/views/elements/DNDTagTile.js index 97bae82e61..5b87a36769 100644 --- a/src/components/views/elements/DNDTagTile.js +++ b/src/components/views/elements/DNDTagTile.js @@ -15,9 +15,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import TagTile from './TagTile'; - import React from 'react'; + +import TagTile from './TagTile'; import { ContextMenu, toRightOf, useContextMenu } from "../../structures/ContextMenu"; import * as sdk from '../../../index'; diff --git a/src/components/views/elements/DesktopBuildsNotice.tsx b/src/components/views/elements/DesktopBuildsNotice.tsx index 5938bc6dfe..e06db603ec 100644 --- a/src/components/views/elements/DesktopBuildsNotice.tsx +++ b/src/components/views/elements/DesktopBuildsNotice.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React from "react"; +import { logger } from "matrix-js-sdk/src/logger"; + import EventIndexPeg from "../../../indexing/EventIndexPeg"; import { _t } from "../../../languageHandler"; import SdkConfig from "../../../SdkConfig"; @@ -22,8 +24,6 @@ import dis from "../../../dispatcher/dispatcher"; import { Action } from "../../../dispatcher/actions"; import { UserTab } from "../dialogs/UserSettingsDialog"; -import { logger } from "matrix-js-sdk/src/logger"; - export enum WarningKind { Files, Search, diff --git a/src/components/views/elements/DesktopCapturerSourcePicker.tsx b/src/components/views/elements/DesktopCapturerSourcePicker.tsx index 034fc3d49c..6c5dbca659 100644 --- a/src/components/views/elements/DesktopCapturerSourcePicker.tsx +++ b/src/components/views/elements/DesktopCapturerSourcePicker.tsx @@ -15,10 +15,11 @@ limitations under the License. */ import React from 'react'; +import classNames from 'classnames'; + import { _t } from '../../../languageHandler'; import BaseDialog from "..//dialogs/BaseDialog"; import DialogButtons from "./DialogButtons"; -import classNames from 'classnames'; import AccessibleButton from './AccessibleButton'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import TabbedView, { Tab, TabLocation } from '../../structures/TabbedView'; diff --git a/src/components/views/elements/DialPadBackspaceButton.tsx b/src/components/views/elements/DialPadBackspaceButton.tsx index d64ced8239..ce9dbffe7e 100644 --- a/src/components/views/elements/DialPadBackspaceButton.tsx +++ b/src/components/views/elements/DialPadBackspaceButton.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import * as React from "react"; + import AccessibleButton, { ButtonEvent } from "./AccessibleButton"; interface IProps { diff --git a/src/components/views/elements/DialogButtons.tsx b/src/components/views/elements/DialogButtons.tsx index 0dff64c0b4..210e768aa7 100644 --- a/src/components/views/elements/DialogButtons.tsx +++ b/src/components/views/elements/DialogButtons.tsx @@ -17,6 +17,7 @@ limitations under the License. */ import React from "react"; + import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/elements/DirectorySearchBox.tsx b/src/components/views/elements/DirectorySearchBox.tsx index 07407af622..015065f45e 100644 --- a/src/components/views/elements/DirectorySearchBox.tsx +++ b/src/components/views/elements/DirectorySearchBox.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { ChangeEvent, createRef } from 'react'; + import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import AccessibleButton from "./AccessibleButton"; diff --git a/src/components/views/elements/Draggable.tsx b/src/components/views/elements/Draggable.tsx index 03dccadcb9..e9e24a57e4 100644 --- a/src/components/views/elements/Draggable.tsx +++ b/src/components/views/elements/Draggable.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; interface IProps { diff --git a/src/components/views/elements/EditableText.tsx b/src/components/views/elements/EditableText.tsx index b3ff8ee245..122292a8f5 100644 --- a/src/components/views/elements/EditableText.tsx +++ b/src/components/views/elements/EditableText.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React, { createRef } from 'react'; + import { Key } from "../../../Keyboard"; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/elements/EditableTextContainer.tsx b/src/components/views/elements/EditableTextContainer.tsx index b4689b90db..ede1e8a655 100644 --- a/src/components/views/elements/EditableTextContainer.tsx +++ b/src/components/views/elements/EditableTextContainer.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import Spinner from "./Spinner"; import EditableText from "./EditableText"; diff --git a/src/components/views/elements/EffectsOverlay.tsx b/src/components/views/elements/EffectsOverlay.tsx index 3e90d9e3a5..5115d130cd 100644 --- a/src/components/views/elements/EffectsOverlay.tsx +++ b/src/components/views/elements/EffectsOverlay.tsx @@ -15,13 +15,13 @@ limitations under the License. */ import React, { FunctionComponent, useEffect, useRef } from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import dis from '../../../dispatcher/dispatcher'; import ICanvasEffect from '../../../effects/ICanvasEffect'; import { CHAT_EFFECTS } from '../../../effects'; import UIStore, { UI_EVENTS } from "../../../stores/UIStore"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { roomWidth: number; } diff --git a/src/components/views/elements/ErrorBoundary.tsx b/src/components/views/elements/ErrorBoundary.tsx index 7e8686a35c..a984ea7d73 100644 --- a/src/components/views/elements/ErrorBoundary.tsx +++ b/src/components/views/elements/ErrorBoundary.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { ErrorInfo } from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; @@ -25,8 +26,6 @@ import { replaceableComponent } from "../../../utils/replaceableComponent"; import BugReportDialog from '../dialogs/BugReportDialog'; import AccessibleButton from './AccessibleButton'; -import { logger } from "matrix-js-sdk/src/logger"; - interface IState { error: Error; } diff --git a/src/components/views/elements/Field.tsx b/src/components/views/elements/Field.tsx index 476b0f73c7..7672244ba5 100644 --- a/src/components/views/elements/Field.tsx +++ b/src/components/views/elements/Field.tsx @@ -16,8 +16,9 @@ limitations under the License. import React, { InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes } from 'react'; import classNames from 'classnames'; -import * as sdk from '../../../index'; import { debounce } from "lodash"; + +import * as sdk from '../../../index'; import { IFieldState, IValidationResult } from "./Validation"; // Invoke validation from user input (when typing, etc.) at most once every N ms. diff --git a/src/components/views/elements/Flair.js b/src/components/views/elements/Flair.js index 280cac503e..0029f73ff0 100644 --- a/src/components/views/elements/Flair.js +++ b/src/components/views/elements/Flair.js @@ -16,14 +16,14 @@ import React from 'react'; import PropTypes from 'prop-types'; +import { logger } from "matrix-js-sdk/src/logger"; + import FlairStore from '../../../stores/FlairStore'; import dis from '../../../dispatcher/dispatcher'; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { mediaFromMxc } from "../../../customisations/Media"; -import { logger } from "matrix-js-sdk/src/logger"; - class FlairAvatar extends React.Component { constructor() { super(); diff --git a/src/components/views/elements/IRCTimelineProfileResizer.tsx b/src/components/views/elements/IRCTimelineProfileResizer.tsx index 13e8ae2ae2..13b0022e72 100644 --- a/src/components/views/elements/IRCTimelineProfileResizer.tsx +++ b/src/components/views/elements/IRCTimelineProfileResizer.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import SettingsStore from "../../../settings/SettingsStore"; import Draggable, { ILocationState } from './Draggable'; import { SettingLevel } from "../../../settings/SettingLevel"; diff --git a/src/components/views/elements/ImageView.tsx b/src/components/views/elements/ImageView.tsx index 44ff6644d7..78806703cc 100644 --- a/src/components/views/elements/ImageView.tsx +++ b/src/components/views/elements/ImageView.tsx @@ -17,10 +17,12 @@ limitations under the License. */ import React, { createRef } from 'react'; +import FocusLock from "react-focus-lock"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { _t } from '../../../languageHandler'; import AccessibleTooltipButton from "./AccessibleTooltipButton"; import { Key } from "../../../Keyboard"; -import FocusLock from "react-focus-lock"; import MemberAvatar from "../avatars/MemberAvatar"; import { ContextMenuTooltipButton } from "../../../accessibility/context_menu/ContextMenuTooltipButton"; import MessageContextMenu from "../context_menus/MessageContextMenu"; @@ -31,7 +33,6 @@ import { formatFullDate } from "../../../DateUtils"; import dis from '../../../dispatcher/dispatcher'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { normalizeWheelEvent } from "../../../utils/Mouse"; import { IDialogProps } from '../dialogs/IDialogProps'; import UIStore from '../../../stores/UIStore'; diff --git a/src/components/views/elements/InlineSpinner.tsx b/src/components/views/elements/InlineSpinner.tsx index e2cda2f28d..3a404430db 100644 --- a/src/components/views/elements/InlineSpinner.tsx +++ b/src/components/views/elements/InlineSpinner.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { _t } from "../../../languageHandler"; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/elements/InviteReason.tsx b/src/components/views/elements/InviteReason.tsx index 865a5be747..13a62d463c 100644 --- a/src/components/views/elements/InviteReason.tsx +++ b/src/components/views/elements/InviteReason.tsx @@ -16,6 +16,7 @@ limitations under the License. import classNames from "classnames"; import React from "react"; + import { sanitizedHtmlNode } from "../../../HtmlUtils"; import { _t } from "../../../languageHandler"; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/elements/LazyRenderList.tsx b/src/components/views/elements/LazyRenderList.tsx index 54c76f27a7..6a1920bec9 100644 --- a/src/components/views/elements/LazyRenderList.tsx +++ b/src/components/views/elements/LazyRenderList.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { replaceableComponent } from "../../../utils/replaceableComponent"; class ItemRange { diff --git a/src/components/views/elements/MemberEventListSummary.tsx b/src/components/views/elements/MemberEventListSummary.tsx index 4eb0177fef..7d47c085bc 100644 --- a/src/components/views/elements/MemberEventListSummary.tsx +++ b/src/components/views/elements/MemberEventListSummary.tsx @@ -19,6 +19,7 @@ limitations under the License. import React, { ComponentProps } from 'react'; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { EventType } from 'matrix-js-sdk/src/@types/event'; import { _t } from '../../../languageHandler'; import { formatCommaSeparatedList } from '../../../utils/FormattingUtils'; @@ -30,7 +31,6 @@ import { RightPanelPhases } from '../../../stores/RightPanelStorePhases'; import { Action } from '../../../dispatcher/actions'; import { SetRightPanelPhasePayload } from '../../../dispatcher/payloads/SetRightPanelPhasePayload'; import { jsxJoin } from '../../../utils/ReactUtils'; -import { EventType } from 'matrix-js-sdk/src/@types/event'; import { Layout } from '../../../settings/Layout'; const onPinnedMessagesClick = (): void => { diff --git a/src/components/views/elements/PersistedElement.tsx b/src/components/views/elements/PersistedElement.tsx index d013091803..cd07864e22 100644 --- a/src/components/views/elements/PersistedElement.tsx +++ b/src/components/views/elements/PersistedElement.tsx @@ -17,11 +17,11 @@ limitations under the License. import React from 'react'; import ReactDOM from 'react-dom'; import { throttle } from "lodash"; +import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; import dis from '../../../dispatcher/dispatcher'; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; -import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { ActionPayload } from "../../../dispatcher/payloads"; diff --git a/src/components/views/elements/PersistentApp.tsx b/src/components/views/elements/PersistentApp.tsx index d80a00584c..80e57b537b 100644 --- a/src/components/views/elements/PersistentApp.tsx +++ b/src/components/views/elements/PersistentApp.tsx @@ -16,14 +16,15 @@ limitations under the License. */ import React from 'react'; +import { EventSubscription } from 'fbemitter'; +import { Room } from "matrix-js-sdk/src/models/room"; + import RoomViewStore from '../../../stores/RoomViewStore'; import ActiveWidgetStore, { ActiveWidgetStoreEvent } from '../../../stores/ActiveWidgetStore'; import WidgetUtils from '../../../utils/WidgetUtils'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { EventSubscription } from 'fbemitter'; import AppTile from "./AppTile"; -import { Room } from "matrix-js-sdk/src/models/room"; interface IProps { // none diff --git a/src/components/views/elements/Pill.js b/src/components/views/elements/Pill.js index 4a2b39f891..2e99a0c57f 100644 --- a/src/components/views/elements/Pill.js +++ b/src/components/views/elements/Pill.js @@ -14,12 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ import React from 'react'; -import * as sdk from '../../../index'; -import dis from '../../../dispatcher/dispatcher'; import classNames from 'classnames'; import { Room } from 'matrix-js-sdk/src/models/room'; import { RoomMember } from 'matrix-js-sdk/src/models/room-member'; import PropTypes from 'prop-types'; +import { logger } from "matrix-js-sdk/src/logger"; + +import * as sdk from '../../../index'; +import dis from '../../../dispatcher/dispatcher'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import FlairStore from "../../../stores/FlairStore"; import { getPrimaryPermalinkEntity, parseAppLocalLink } from "../../../utils/permalinks/Permalinks"; @@ -29,8 +31,6 @@ import { mediaFromMxc } from "../../../customisations/Media"; import Tooltip from './Tooltip'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - @replaceableComponent("views.elements.Pill") class Pill extends React.Component { static roomNotifPos(text) { diff --git a/src/components/views/elements/PowerSelector.tsx b/src/components/views/elements/PowerSelector.tsx index a99812028e..1c3af65b45 100644 --- a/src/components/views/elements/PowerSelector.tsx +++ b/src/components/views/elements/PowerSelector.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import * as Roles from '../../../Roles'; import { _t } from '../../../languageHandler'; import Field from "./Field"; diff --git a/src/components/views/elements/ReplyChain.tsx b/src/components/views/elements/ReplyChain.tsx index 50efdc92fb..57997ed797 100644 --- a/src/components/views/elements/ReplyChain.tsx +++ b/src/components/views/elements/ReplyChain.tsx @@ -17,25 +17,25 @@ limitations under the License. import React from 'react'; import classNames from 'classnames'; +import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; +import escapeHtml from "escape-html"; +import sanitizeHtml from "sanitize-html"; +import { Room } from 'matrix-js-sdk/src/models/room'; +import { RelationType } from 'matrix-js-sdk/src/@types/event'; import { _t } from '../../../languageHandler'; import dis from '../../../dispatcher/dispatcher'; -import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; import { makeUserPermalink, RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; import SettingsStore from "../../../settings/SettingsStore"; import { Layout } from "../../../settings/Layout"; -import escapeHtml from "escape-html"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { getUserNameColorClass } from "../../../utils/FormattingUtils"; import { Action } from "../../../dispatcher/actions"; -import sanitizeHtml from "sanitize-html"; import { PERMITTED_URL_SCHEMES } from "../../../HtmlUtils"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import Spinner from './Spinner'; import ReplyTile from "../rooms/ReplyTile"; import Pill from './Pill'; -import { Room } from 'matrix-js-sdk/src/models/room'; -import { RelationType } from 'matrix-js-sdk/src/@types/event'; /** * This number is based on the previous behavior - if we have message of height diff --git a/src/components/views/elements/SettingsFlag.tsx b/src/components/views/elements/SettingsFlag.tsx index 0847db801e..35d8070df7 100644 --- a/src/components/views/elements/SettingsFlag.tsx +++ b/src/components/views/elements/SettingsFlag.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from "react"; + import SettingsStore from "../../../settings/SettingsStore"; import { _t } from '../../../languageHandler'; import ToggleSwitch from "./ToggleSwitch"; diff --git a/src/components/views/elements/Slider.tsx b/src/components/views/elements/Slider.tsx index a201659e3c..a4c3147a73 100644 --- a/src/components/views/elements/Slider.tsx +++ b/src/components/views/elements/Slider.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import * as React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; interface IProps { diff --git a/src/components/views/elements/Spinner.tsx b/src/components/views/elements/Spinner.tsx index ee43a5bf0e..ac3ba51fdd 100644 --- a/src/components/views/elements/Spinner.tsx +++ b/src/components/views/elements/Spinner.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { _t } from "../../../languageHandler"; interface IProps { diff --git a/src/components/views/elements/Spoiler.tsx b/src/components/views/elements/Spoiler.tsx index 4779a7d90e..4613f8914b 100644 --- a/src/components/views/elements/Spoiler.tsx +++ b/src/components/views/elements/Spoiler.tsx @@ -15,6 +15,7 @@ */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; interface IProps { diff --git a/src/components/views/elements/StyledCheckbox.tsx b/src/components/views/elements/StyledCheckbox.tsx index b609f7159e..4a64c5734f 100644 --- a/src/components/views/elements/StyledCheckbox.tsx +++ b/src/components/views/elements/StyledCheckbox.tsx @@ -16,6 +16,7 @@ limitations under the License. import React from "react"; import { randomString } from "matrix-js-sdk/src/randomstring"; + import { replaceableComponent } from "../../../utils/replaceableComponent"; interface IProps extends React.InputHTMLAttributes { diff --git a/src/components/views/elements/StyledRadioButton.tsx b/src/components/views/elements/StyledRadioButton.tsx index 1b68274f39..faa1ab8471 100644 --- a/src/components/views/elements/StyledRadioButton.tsx +++ b/src/components/views/elements/StyledRadioButton.tsx @@ -16,6 +16,7 @@ limitations under the License. import React from 'react'; import classnames from 'classnames'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; interface IProps extends React.InputHTMLAttributes { diff --git a/src/components/views/elements/SyntaxHighlight.tsx b/src/components/views/elements/SyntaxHighlight.tsx index 36920af27a..96ad1f2c02 100644 --- a/src/components/views/elements/SyntaxHighlight.tsx +++ b/src/components/views/elements/SyntaxHighlight.tsx @@ -16,6 +16,7 @@ limitations under the License. import React from 'react'; import highlight from 'highlight.js'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; interface IProps { diff --git a/src/components/views/elements/TagComposer.tsx b/src/components/views/elements/TagComposer.tsx index 03f501f02c..9937020fff 100644 --- a/src/components/views/elements/TagComposer.tsx +++ b/src/components/views/elements/TagComposer.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { ChangeEvent, FormEvent } from "react"; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import Field from "./Field"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/elements/TagTile.js b/src/components/views/elements/TagTile.js index 1205a2050f..d8e85c2696 100644 --- a/src/components/views/elements/TagTile.js +++ b/src/components/views/elements/TagTile.js @@ -19,11 +19,12 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; +import { logger } from "matrix-js-sdk/src/logger"; + import * as sdk from '../../../index'; import dis from '../../../dispatcher/dispatcher'; import { isOnlyCtrlOrCmdIgnoreShiftKeyEvent } from '../../../Keyboard'; import * as FormattingUtils from '../../../utils/FormattingUtils'; - import FlairStore from '../../../stores/FlairStore'; import GroupStore from '../../../stores/GroupStore'; import GroupFilterOrderStore from '../../../stores/GroupFilterOrderStore'; @@ -33,8 +34,6 @@ import SettingsStore from "../../../settings/SettingsStore"; import { mediaFromMxc } from "../../../customisations/Media"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - // A class for a child of GroupFilterPanel (possibly wrapped in a DNDTagTile) that represents // a thing to click on for the user to filter the visible rooms in the RoomList to: // - Rooms that are part of the group diff --git a/src/components/views/elements/TextWithTooltip.tsx b/src/components/views/elements/TextWithTooltip.tsx index b7c2477158..cb0bb440d5 100644 --- a/src/components/views/elements/TextWithTooltip.tsx +++ b/src/components/views/elements/TextWithTooltip.tsx @@ -15,6 +15,7 @@ */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import Tooltip from "./Tooltip"; diff --git a/src/components/views/elements/ToggleSwitch.tsx b/src/components/views/elements/ToggleSwitch.tsx index c439ef4f85..154a89a73f 100644 --- a/src/components/views/elements/ToggleSwitch.tsx +++ b/src/components/views/elements/ToggleSwitch.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from "react"; import classNames from "classnames"; + import AccessibleButton from "./AccessibleButton"; interface IProps { diff --git a/src/components/views/elements/Tooltip.tsx b/src/components/views/elements/Tooltip.tsx index c335684c05..c078107d54 100644 --- a/src/components/views/elements/Tooltip.tsx +++ b/src/components/views/elements/Tooltip.tsx @@ -20,6 +20,7 @@ limitations under the License. import React, { Component, CSSProperties } from 'react'; import ReactDOM from 'react-dom'; import classNames from 'classnames'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import UIStore from "../../../stores/UIStore"; diff --git a/src/components/views/elements/TooltipButton.tsx b/src/components/views/elements/TooltipButton.tsx index 26e46c7da8..2a7b6458d0 100644 --- a/src/components/views/elements/TooltipButton.tsx +++ b/src/components/views/elements/TooltipButton.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import Tooltip from './Tooltip'; diff --git a/src/components/views/elements/TruncatedList.tsx b/src/components/views/elements/TruncatedList.tsx index 403df4111e..31c5391b07 100644 --- a/src/components/views/elements/TruncatedList.tsx +++ b/src/components/views/elements/TruncatedList.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/elements/UserTagTile.tsx b/src/components/views/elements/UserTagTile.tsx index 4414ff31fd..6bd0d4daa8 100644 --- a/src/components/views/elements/UserTagTile.tsx +++ b/src/components/views/elements/UserTagTile.tsx @@ -15,11 +15,12 @@ limitations under the License. */ import React from "react"; -import defaultDispatcher from "../../../dispatcher/dispatcher"; import * as fbEmitter from "fbemitter"; +import classNames from "classnames"; + +import defaultDispatcher from "../../../dispatcher/dispatcher"; import GroupFilterOrderStore from "../../../stores/GroupFilterOrderStore"; import AccessibleTooltipButton from "./AccessibleTooltipButton"; -import classNames from "classnames"; import { _t } from "../../../languageHandler"; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/elements/crypto/VerificationQRCode.tsx b/src/components/views/elements/crypto/VerificationQRCode.tsx index be9ede59b1..a5efb1b6ce 100644 --- a/src/components/views/elements/crypto/VerificationQRCode.tsx +++ b/src/components/views/elements/crypto/VerificationQRCode.tsx @@ -15,9 +15,10 @@ limitations under the License. */ import React from "react"; +import { QRCodeData } from "matrix-js-sdk/src/crypto/verification/QRCode"; + import { replaceableComponent } from "../../../../utils/replaceableComponent"; import QRCode from "../QRCode"; -import { QRCodeData } from "matrix-js-sdk/src/crypto/verification/QRCode"; interface IProps { qrCodeData: QRCodeData; diff --git a/src/components/views/groups/GroupInviteTile.js b/src/components/views/groups/GroupInviteTile.js index 0ec0084162..1ed66de2d5 100644 --- a/src/components/views/groups/GroupInviteTile.js +++ b/src/components/views/groups/GroupInviteTile.js @@ -18,10 +18,11 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; +import classNames from 'classnames'; + import * as sdk from '../../../index'; import dis from '../../../dispatcher/dispatcher'; import { _t } from '../../../languageHandler'; -import classNames from 'classnames'; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { ContextMenu, ContextMenuButton, toRightOf } from "../../structures/ContextMenu"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; diff --git a/src/components/views/groups/GroupMemberList.js b/src/components/views/groups/GroupMemberList.js index 3204f82e82..404145a241 100644 --- a/src/components/views/groups/GroupMemberList.js +++ b/src/components/views/groups/GroupMemberList.js @@ -16,11 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. */ import React from 'react'; +import PropTypes from 'prop-types'; + import { _t } from '../../../languageHandler'; import * as sdk from '../../../index'; import dis from '../../../dispatcher/dispatcher'; import GroupStore from '../../../stores/GroupStore'; -import PropTypes from 'prop-types'; import { showGroupInviteDialog } from '../../../GroupAddressPicker'; import AccessibleButton from '../elements/AccessibleButton'; import { RightPanelPhases } from "../../../stores/RightPanelStorePhases"; diff --git a/src/components/views/groups/GroupMemberTile.js b/src/components/views/groups/GroupMemberTile.js index 301f57be23..ec4da5a53f 100644 --- a/src/components/views/groups/GroupMemberTile.js +++ b/src/components/views/groups/GroupMemberTile.js @@ -18,6 +18,7 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; + import * as sdk from '../../../index'; import dis from '../../../dispatcher/dispatcher'; import { GroupMemberType } from '../../../groups'; diff --git a/src/components/views/groups/GroupPublicityToggle.js b/src/components/views/groups/GroupPublicityToggle.js index 4e17a9caa1..e2b0eb8687 100644 --- a/src/components/views/groups/GroupPublicityToggle.js +++ b/src/components/views/groups/GroupPublicityToggle.js @@ -16,6 +16,7 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; + import * as sdk from '../../../index'; import GroupStore from '../../../stores/GroupStore'; import ToggleSwitch from "../elements/ToggleSwitch"; diff --git a/src/components/views/groups/GroupRoomInfo.js b/src/components/views/groups/GroupRoomInfo.js index b59144a716..36678e35a4 100644 --- a/src/components/views/groups/GroupRoomInfo.js +++ b/src/components/views/groups/GroupRoomInfo.js @@ -17,6 +17,8 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; +import { logger } from "matrix-js-sdk/src/logger"; + import dis from '../../../dispatcher/dispatcher'; import Modal from '../../../Modal'; import * as sdk from '../../../index'; @@ -27,8 +29,6 @@ import AutoHideScrollbar from "../../structures/AutoHideScrollbar"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { mediaFromMxc } from "../../../customisations/Media"; -import { logger } from "matrix-js-sdk/src/logger"; - @replaceableComponent("views.groups.GroupRoomInfo") export default class GroupRoomInfo extends React.Component { static contextType = MatrixClientContext; diff --git a/src/components/views/groups/GroupRoomList.js b/src/components/views/groups/GroupRoomList.js index e3dbdddb4f..7b2c01186b 100644 --- a/src/components/views/groups/GroupRoomList.js +++ b/src/components/views/groups/GroupRoomList.js @@ -14,10 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ import React from 'react'; +import PropTypes from 'prop-types'; + import { _t } from '../../../languageHandler'; import * as sdk from '../../../index'; import GroupStore from '../../../stores/GroupStore'; -import PropTypes from 'prop-types'; import { showGroupAddRoomDialog } from '../../../GroupAddressPicker'; import AccessibleButton from '../elements/AccessibleButton'; import AutoHideScrollbar from "../../structures/AutoHideScrollbar"; diff --git a/src/components/views/groups/GroupRoomTile.js b/src/components/views/groups/GroupRoomTile.js index 7bbfaa93a8..75e16142df 100644 --- a/src/components/views/groups/GroupRoomTile.js +++ b/src/components/views/groups/GroupRoomTile.js @@ -16,6 +16,7 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; + import * as sdk from '../../../index'; import dis from '../../../dispatcher/dispatcher'; import { GroupRoomType } from '../../../groups'; diff --git a/src/components/views/groups/GroupTile.js b/src/components/views/groups/GroupTile.js index cf1a5b91ce..fbdab54563 100644 --- a/src/components/views/groups/GroupTile.js +++ b/src/components/views/groups/GroupTile.js @@ -16,6 +16,8 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; +import { logger } from "matrix-js-sdk/src/logger"; + import * as sdk from '../../../index'; import dis from '../../../dispatcher/dispatcher'; import FlairStore from '../../../stores/FlairStore'; @@ -26,8 +28,6 @@ import { _t } from "../../../languageHandler"; import TagOrderActions from "../../../actions/TagOrderActions"; import GroupFilterOrderStore from "../../../stores/GroupFilterOrderStore"; -import { logger } from "matrix-js-sdk/src/logger"; - @replaceableComponent("views.groups.GroupTile") class GroupTile extends React.Component { static propTypes = { diff --git a/src/components/views/groups/GroupUserSettings.js b/src/components/views/groups/GroupUserSettings.js index 85fd15e238..9a0bd6a5e0 100644 --- a/src/components/views/groups/GroupUserSettings.js +++ b/src/components/views/groups/GroupUserSettings.js @@ -15,13 +15,13 @@ limitations under the License. */ import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - @replaceableComponent("views.groups.GroupUserSettings") export default class GroupUserSettings extends React.Component { static contextType = MatrixClientContext; diff --git a/src/components/views/host_signup/HostSignupContainer.tsx b/src/components/views/host_signup/HostSignupContainer.tsx index 1b9f0c1e45..c000eb168f 100644 --- a/src/components/views/host_signup/HostSignupContainer.tsx +++ b/src/components/views/host_signup/HostSignupContainer.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { useState } from 'react'; + import HostSignupDialog from "../dialogs/HostSignupDialog"; import { HostSignupStore } from "../../../stores/HostSignupStore"; import { useEventEmitter } from "../../../hooks/useEventEmitter"; diff --git a/src/components/views/messages/CallEvent.tsx b/src/components/views/messages/CallEvent.tsx index 5f514b8390..d6df8c354e 100644 --- a/src/components/views/messages/CallEvent.tsx +++ b/src/components/views/messages/CallEvent.tsx @@ -15,15 +15,15 @@ limitations under the License. */ import React, { createRef } from 'react'; - import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { CallErrorCode, CallState } from 'matrix-js-sdk/src/webrtc/call'; +import classNames from 'classnames'; + import { _t } from '../../../languageHandler'; import MemberAvatar from '../avatars/MemberAvatar'; import CallEventGrouper, { CallEventGrouperEvent, CustomCallState } from '../../structures/CallEventGrouper'; import AccessibleButton from '../elements/AccessibleButton'; -import { CallErrorCode, CallState } from 'matrix-js-sdk/src/webrtc/call'; import InfoTooltip, { InfoTooltipKind } from '../elements/InfoTooltip'; -import classNames from 'classnames'; import AccessibleTooltipButton from '../elements/AccessibleTooltipButton'; import { formatCallTime } from "../../../DateUtils"; import Clock from "../audio_messages/Clock"; diff --git a/src/components/views/messages/DownloadActionButton.tsx b/src/components/views/messages/DownloadActionButton.tsx index 35fd5c49be..86bed15384 100644 --- a/src/components/views/messages/DownloadActionButton.tsx +++ b/src/components/views/messages/DownloadActionButton.tsx @@ -15,11 +15,12 @@ limitations under the License. */ import { MatrixEvent } from "matrix-js-sdk/src"; -import { MediaEventHelper } from "../../../utils/MediaEventHelper"; import React from "react"; +import classNames from "classnames"; + +import { MediaEventHelper } from "../../../utils/MediaEventHelper"; import { RovingAccessibleTooltipButton } from "../../../accessibility/RovingTabIndex"; import Spinner from "../elements/Spinner"; -import classNames from "classnames"; import { _t, _td } from "../../../languageHandler"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { FileDownloader } from "../../../utils/FileDownloader"; diff --git a/src/components/views/messages/EditHistoryMessage.tsx b/src/components/views/messages/EditHistoryMessage.tsx index 1abed87b76..01c133efb1 100644 --- a/src/components/views/messages/EditHistoryMessage.tsx +++ b/src/components/views/messages/EditHistoryMessage.tsx @@ -15,15 +15,16 @@ limitations under the License. */ import React, { createRef } from 'react'; +import { EventStatus, MatrixEvent } from 'matrix-js-sdk/src/models/event'; +import classNames from 'classnames'; + import * as HtmlUtils from '../../../HtmlUtils'; import { editBodyDiffToHtml } from '../../../utils/MessageDiffUtils'; import { formatTime } from '../../../DateUtils'; -import { EventStatus, MatrixEvent } from 'matrix-js-sdk/src/models/event'; import { pillifyLinks, unmountPills } from '../../../utils/pillify'; import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import Modal from '../../../Modal'; -import classNames from 'classnames'; import RedactedBody from "./RedactedBody"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import AccessibleButton from "../elements/AccessibleButton"; diff --git a/src/components/views/messages/IBodyProps.ts b/src/components/views/messages/IBodyProps.ts index daa05c3b1a..846753c0d2 100644 --- a/src/components/views/messages/IBodyProps.ts +++ b/src/components/views/messages/IBodyProps.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { MatrixEvent } from "matrix-js-sdk/src"; + import { TileShape } from "../rooms/EventTile"; import { MediaEventHelper } from "../../../utils/MediaEventHelper"; import EditorStateTransfer from "../../../utils/EditorStateTransfer"; diff --git a/src/components/views/messages/MAudioBody.tsx b/src/components/views/messages/MAudioBody.tsx index 61604f55bd..d3bc2fb107 100644 --- a/src/components/views/messages/MAudioBody.tsx +++ b/src/components/views/messages/MAudioBody.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React from "react"; +import { logger } from "matrix-js-sdk/src/logger"; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import { Playback } from "../../../audio/Playback"; import InlineSpinner from '../elements/InlineSpinner'; @@ -27,8 +29,6 @@ import { PlaybackManager } from "../../../audio/PlaybackManager"; import { isVoiceMessage } from "../../../utils/EventUtils"; import { PlaybackQueue } from "../../../audio/PlaybackQueue"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IState { error?: Error; playback?: Playback; diff --git a/src/components/views/messages/MFileBody.tsx b/src/components/views/messages/MFileBody.tsx index f193b7c324..891a48d8b0 100644 --- a/src/components/views/messages/MFileBody.tsx +++ b/src/components/views/messages/MFileBody.tsx @@ -16,6 +16,8 @@ limitations under the License. import React, { createRef } from 'react'; import filesize from 'filesize'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from '../../../languageHandler'; import Modal from '../../../Modal'; import AccessibleButton from "../elements/AccessibleButton"; @@ -29,8 +31,6 @@ import { IBodyProps } from "./IBodyProps"; import { FileDownloader } from "../../../utils/FileDownloader"; import TextWithTooltip from "../elements/TextWithTooltip"; -import { logger } from "matrix-js-sdk/src/logger"; - export let DOWNLOAD_ICON_URL; // cached copy of the download.svg asset for the sandboxed iframe later on async function cacheDownloadIcon() { diff --git a/src/components/views/messages/MImageBody.tsx b/src/components/views/messages/MImageBody.tsx index 85821129a1..9a06a9db8f 100644 --- a/src/components/views/messages/MImageBody.tsx +++ b/src/components/views/messages/MImageBody.tsx @@ -17,6 +17,10 @@ limitations under the License. import React, { ComponentProps, createRef } from 'react'; import { Blurhash } from "react-blurhash"; +import { SyncState } from 'matrix-js-sdk/src/sync.api'; +import classNames from 'classnames'; +import { CSSTransition, SwitchTransition } from 'react-transition-group'; +import { logger } from "matrix-js-sdk/src/logger"; import MFileBody from './MFileBody'; import Modal from '../../../Modal'; @@ -29,12 +33,7 @@ import { Media, mediaFromContent } from "../../../customisations/Media"; import { BLURHASH_FIELD } from "../../../ContentMessages"; import { IMediaEventContent } from '../../../customisations/models/IMediaEventContent'; import ImageView from '../elements/ImageView'; -import { SyncState } from 'matrix-js-sdk/src/sync.api'; import { IBodyProps } from "./IBodyProps"; -import classNames from 'classnames'; -import { CSSTransition, SwitchTransition } from 'react-transition-group'; - -import { logger } from "matrix-js-sdk/src/logger"; interface IState { decryptedUrl?: string; diff --git a/src/components/views/messages/MImageReplyBody.tsx b/src/components/views/messages/MImageReplyBody.tsx index 8d92920226..dead57bab2 100644 --- a/src/components/views/messages/MImageReplyBody.tsx +++ b/src/components/views/messages/MImageReplyBody.tsx @@ -15,11 +15,12 @@ limitations under the License. */ import React from "react"; +import { EventType } from "matrix-js-sdk/src/@types/event"; + import MImageBody from "./MImageBody"; import { presentableTextForFile } from "../../../utils/FileUtils"; import { IMediaEventContent } from "../../../customisations/models/IMediaEventContent"; import SenderProfile from "./SenderProfile"; -import { EventType } from "matrix-js-sdk/src/@types/event"; import { _t } from "../../../languageHandler"; const FORCED_IMAGE_HEIGHT = 44; diff --git a/src/components/views/messages/MJitsiWidgetEvent.tsx b/src/components/views/messages/MJitsiWidgetEvent.tsx index aaf659d6d9..5b7134c216 100644 --- a/src/components/views/messages/MJitsiWidgetEvent.tsx +++ b/src/components/views/messages/MJitsiWidgetEvent.tsx @@ -16,6 +16,7 @@ limitations under the License. import React from 'react'; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { _t } from "../../../languageHandler"; import WidgetStore from "../../../stores/WidgetStore"; import EventTileBubble from "./EventTileBubble"; diff --git a/src/components/views/messages/MKeyVerificationConclusion.tsx b/src/components/views/messages/MKeyVerificationConclusion.tsx index 1ce39e1157..a73c0f0c90 100644 --- a/src/components/views/messages/MKeyVerificationConclusion.tsx +++ b/src/components/views/messages/MKeyVerificationConclusion.tsx @@ -16,14 +16,15 @@ limitations under the License. import React from 'react'; import classNames from 'classnames'; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { EventType } from "matrix-js-sdk/src/@types/event"; + import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from '../../../languageHandler'; import { getNameForEventRoom, userLabelForEventRoom } from '../../../utils/KeyVerificationStateObserver'; import EventTileBubble from "./EventTileBubble"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; -import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; -import { EventType } from "matrix-js-sdk/src/@types/event"; interface IProps { /* the MatrixEvent to show */ diff --git a/src/components/views/messages/MKeyVerificationRequest.tsx b/src/components/views/messages/MKeyVerificationRequest.tsx index e1b91f63d7..4737bb2dec 100644 --- a/src/components/views/messages/MKeyVerificationRequest.tsx +++ b/src/components/views/messages/MKeyVerificationRequest.tsx @@ -16,6 +16,8 @@ limitations under the License. import React from 'react'; import { MatrixEvent } from 'matrix-js-sdk/src'; +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from '../../../languageHandler'; import { getNameForEventRoom, userLabelForEventRoom } @@ -27,8 +29,6 @@ import EventTileBubble from "./EventTileBubble"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import AccessibleButton from '../elements/AccessibleButton'; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { mxEvent: MatrixEvent; } diff --git a/src/components/views/messages/MStickerBody.tsx b/src/components/views/messages/MStickerBody.tsx index 365426245d..ad318b1dd5 100644 --- a/src/components/views/messages/MStickerBody.tsx +++ b/src/components/views/messages/MStickerBody.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import MImageBody from './MImageBody'; import * as sdk from '../../../index'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/messages/MVideoBody.tsx b/src/components/views/messages/MVideoBody.tsx index b2e587e51a..cc4039ef88 100644 --- a/src/components/views/messages/MVideoBody.tsx +++ b/src/components/views/messages/MVideoBody.tsx @@ -16,6 +16,7 @@ limitations under the License. import React from 'react'; import { decode } from "blurhash"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from '../../../languageHandler'; import SettingsStore from "../../../settings/SettingsStore"; @@ -27,8 +28,6 @@ import { IMediaEventContent } from "../../../customisations/models/IMediaEventCo import { IBodyProps } from "./IBodyProps"; import MFileBody from "./MFileBody"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IState { decryptedUrl?: string; decryptedThumbnailUrl?: string; diff --git a/src/components/views/messages/MVoiceMessageBody.tsx b/src/components/views/messages/MVoiceMessageBody.tsx index 55b608cf2d..5a8a633855 100644 --- a/src/components/views/messages/MVoiceMessageBody.tsx +++ b/src/components/views/messages/MVoiceMessageBody.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import InlineSpinner from '../elements/InlineSpinner'; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/messages/MVoiceOrAudioBody.tsx b/src/components/views/messages/MVoiceOrAudioBody.tsx index b4dce5d1aa..cec042a7ff 100644 --- a/src/components/views/messages/MVoiceOrAudioBody.tsx +++ b/src/components/views/messages/MVoiceOrAudioBody.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import MAudioBody from "./MAudioBody"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import MVoiceMessageBody from "./MVoiceMessageBody"; diff --git a/src/components/views/messages/MessageActionBar.tsx b/src/components/views/messages/MessageActionBar.tsx index 56ae08453c..a3f37114b0 100644 --- a/src/components/views/messages/MessageActionBar.tsx +++ b/src/components/views/messages/MessageActionBar.tsx @@ -18,8 +18,9 @@ limitations under the License. import React, { useEffect } from 'react'; import { EventStatus, MatrixEvent } from 'matrix-js-sdk/src/models/event'; -import type { Relations } from 'matrix-js-sdk/src/models/relations'; +import classNames from 'classnames'; +import type { Relations } from 'matrix-js-sdk/src/models/relations'; import { _t } from '../../../languageHandler'; import * as sdk from '../../../index'; import dis from '../../../dispatcher/dispatcher'; @@ -31,14 +32,11 @@ import RoomContext, { TimelineRenderingType } from "../../../contexts/RoomContex import Toolbar from "../../../accessibility/Toolbar"; import { RovingAccessibleTooltipButton, useRovingTabIndex } from "../../../accessibility/RovingTabIndex"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { canCancel } from "../context_menus/MessageContextMenu"; +import MessageContextMenu, { canCancel } from "../context_menus/MessageContextMenu"; import Resend from "../../../Resend"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { MediaEventHelper } from "../../../utils/MediaEventHelper"; import DownloadActionButton from "./DownloadActionButton"; -import MessageContextMenu from "../context_menus/MessageContextMenu"; -import classNames from 'classnames'; - import SettingsStore from '../../../settings/SettingsStore'; import { RoomPermalinkCreator } from '../../../utils/permalinks/Permalinks'; import ReplyChain from '../elements/ReplyChain'; diff --git a/src/components/views/messages/MessageEvent.tsx b/src/components/views/messages/MessageEvent.tsx index b72e40d194..9d5bb7df61 100644 --- a/src/components/views/messages/MessageEvent.tsx +++ b/src/components/views/messages/MessageEvent.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React, { createRef } from 'react'; +import { EventType, MsgType } from "matrix-js-sdk/src/@types/event"; + import * as sdk from '../../../index'; import SettingsStore from "../../../settings/SettingsStore"; import { Mjolnir } from "../../../mjolnir/Mjolnir"; @@ -25,7 +27,6 @@ import { IMediaBody } from "./IMediaBody"; import { IOperableEventTile } from "../context_menus/MessageContextMenu"; import { MediaEventHelper } from "../../../utils/MediaEventHelper"; import { ReactAnyComponent } from "../../../@types/common"; -import { EventType, MsgType } from "matrix-js-sdk/src/@types/event"; import { IBodyProps } from "./IBodyProps"; // onMessageAllowed is handled internally diff --git a/src/components/views/messages/MessageTimestamp.tsx b/src/components/views/messages/MessageTimestamp.tsx index a657032c86..fa60f0663e 100644 --- a/src/components/views/messages/MessageTimestamp.tsx +++ b/src/components/views/messages/MessageTimestamp.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; + import { formatFullDate, formatTime, formatFullTime } from '../../../DateUtils'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/messages/MjolnirBody.tsx b/src/components/views/messages/MjolnirBody.tsx index 7e922a5715..00cbcf461f 100644 --- a/src/components/views/messages/MjolnirBody.tsx +++ b/src/components/views/messages/MjolnirBody.tsx @@ -15,9 +15,10 @@ limitations under the License. */ import React from 'react'; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; interface IProps { mxEvent: MatrixEvent; diff --git a/src/components/views/messages/RedactedBody.tsx b/src/components/views/messages/RedactedBody.tsx index 9af4ebf1cb..f128405df4 100644 --- a/src/components/views/messages/RedactedBody.tsx +++ b/src/components/views/messages/RedactedBody.tsx @@ -17,6 +17,7 @@ limitations under the License. import React, { useContext } from "react"; import { MatrixClient } from "matrix-js-sdk/src/client"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { _t } from "../../../languageHandler"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { formatFullDate } from "../../../DateUtils"; diff --git a/src/components/views/messages/RoomAvatarEvent.tsx b/src/components/views/messages/RoomAvatarEvent.tsx index 12a8c88913..9cb91c7c44 100644 --- a/src/components/views/messages/RoomAvatarEvent.tsx +++ b/src/components/views/messages/RoomAvatarEvent.tsx @@ -18,6 +18,7 @@ limitations under the License. import React from 'react'; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from '../../../languageHandler'; import Modal from '../../../Modal'; diff --git a/src/components/views/messages/RoomCreate.tsx b/src/components/views/messages/RoomCreate.tsx index c846ba5632..844d1f5c98 100644 --- a/src/components/views/messages/RoomCreate.tsx +++ b/src/components/views/messages/RoomCreate.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import dis from '../../../dispatcher/dispatcher'; import { RoomPermalinkCreator } from '../../../utils/permalinks/Permalinks'; @@ -23,7 +24,6 @@ import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import EventTileBubble from "./EventTileBubble"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; interface IProps { /* the MatrixEvent to show */ diff --git a/src/components/views/messages/ViewSourceEvent.tsx b/src/components/views/messages/ViewSourceEvent.tsx index 488f8de5df..e1de5137d9 100644 --- a/src/components/views/messages/ViewSourceEvent.tsx +++ b/src/components/views/messages/ViewSourceEvent.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import { MatrixEvent } from 'matrix-js-sdk/src'; import classNames from 'classnames'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; diff --git a/src/components/views/right_panel/EncryptionInfo.tsx b/src/components/views/right_panel/EncryptionInfo.tsx index c9a4b3b84c..868369d708 100644 --- a/src/components/views/right_panel/EncryptionInfo.tsx +++ b/src/components/views/right_panel/EncryptionInfo.tsx @@ -15,10 +15,10 @@ limitations under the License. */ import React from "react"; - -import { _t } from "../../../languageHandler"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { User } from "matrix-js-sdk/src/models/user"; + +import { _t } from "../../../languageHandler"; import AccessibleButton from "../elements/AccessibleButton"; import Spinner from "../elements/Spinner"; diff --git a/src/components/views/right_panel/EncryptionPanel.tsx b/src/components/views/right_panel/EncryptionPanel.tsx index 8beb089b38..d26cbbce4d 100644 --- a/src/components/views/right_panel/EncryptionPanel.tsx +++ b/src/components/views/right_panel/EncryptionPanel.tsx @@ -15,10 +15,9 @@ limitations under the License. */ import React, { useCallback, useEffect, useState } from "react"; -import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { VerificationRequest, PHASE_REQUESTED, PHASE_UNSENT } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { User } from "matrix-js-sdk/src/models/user"; -import { PHASE_REQUESTED, PHASE_UNSENT } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; import EncryptionInfo from "./EncryptionInfo"; import VerificationPanel from "./VerificationPanel"; diff --git a/src/components/views/right_panel/GroupHeaderButtons.tsx b/src/components/views/right_panel/GroupHeaderButtons.tsx index 132a76e891..6ecbcb9769 100644 --- a/src/components/views/right_panel/GroupHeaderButtons.tsx +++ b/src/components/views/right_panel/GroupHeaderButtons.tsx @@ -19,6 +19,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from '../../../languageHandler'; import HeaderButton from './HeaderButton'; import HeaderButtons, { HeaderKind } from './HeaderButtons'; diff --git a/src/components/views/right_panel/HeaderButton.tsx b/src/components/views/right_panel/HeaderButton.tsx index 1625db3f55..138e418a99 100644 --- a/src/components/views/right_panel/HeaderButton.tsx +++ b/src/components/views/right_panel/HeaderButton.tsx @@ -20,6 +20,7 @@ limitations under the License. import React from 'react'; import classNames from 'classnames'; + import Analytics from '../../../Analytics'; import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/right_panel/HeaderButtons.tsx b/src/components/views/right_panel/HeaderButtons.tsx index 8d000a29fc..862f25238d 100644 --- a/src/components/views/right_panel/HeaderButtons.tsx +++ b/src/components/views/right_panel/HeaderButtons.tsx @@ -19,6 +19,7 @@ limitations under the License. */ import React from 'react'; + import dis from '../../../dispatcher/dispatcher'; import RightPanelStore from "../../../stores/RightPanelStore"; import { RightPanelPhases } from "../../../stores/RightPanelStorePhases"; diff --git a/src/components/views/right_panel/PinnedMessagesCard.tsx b/src/components/views/right_panel/PinnedMessagesCard.tsx index bb6ddb0f74..bf77cdf644 100644 --- a/src/components/views/right_panel/PinnedMessagesCard.tsx +++ b/src/components/views/right_panel/PinnedMessagesCard.tsx @@ -18,6 +18,7 @@ import React, { useCallback, useContext, useEffect, useState } from "react"; import { Room } from "matrix-js-sdk/src/models/room"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { EventType } from 'matrix-js-sdk/src/@types/event'; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../languageHandler"; import BaseCard from "./BaseCard"; @@ -29,8 +30,6 @@ import { useAsyncMemo } from "../../../hooks/useAsyncMemo"; import PinnedEventTile from "../rooms/PinnedEventTile"; import { useRoomState } from "../../../hooks/useRoomState"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { room: Room; onClose(): void; diff --git a/src/components/views/right_panel/UserInfo.tsx b/src/components/views/right_panel/UserInfo.tsx index 195cf03af4..003db101b8 100644 --- a/src/components/views/right_panel/UserInfo.tsx +++ b/src/components/views/right_panel/UserInfo.tsx @@ -26,6 +26,8 @@ import { Room } from 'matrix-js-sdk/src/models/room'; import { EventTimeline } from 'matrix-js-sdk/src/models/event-timeline'; import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { EventType } from "matrix-js-sdk/src/@types/event"; +import { logger } from "matrix-js-sdk/src/logger"; import dis from '../../../dispatcher/dispatcher'; import Modal from '../../../Modal'; @@ -62,7 +64,6 @@ import ErrorDialog from "../dialogs/ErrorDialog"; import QuestionDialog from "../dialogs/QuestionDialog"; import ConfirmUserActionDialog from "../dialogs/ConfirmUserActionDialog"; import InfoDialog from "../dialogs/InfoDialog"; -import { EventType } from "matrix-js-sdk/src/@types/event"; import { SetRightPanelPhasePayload } from "../../../dispatcher/payloads/SetRightPanelPhasePayload"; import RoomAvatar from "../avatars/RoomAvatar"; import RoomName from "../elements/RoomName"; @@ -72,8 +73,6 @@ import { ComposerInsertPayload } from "../../../dispatcher/payloads/ComposerInse import SpaceStore from "../../../stores/SpaceStore"; import ConfirmSpaceUserActionDialog from "../dialogs/ConfirmSpaceUserActionDialog"; import { bulkSpaceBehaviour } from "../../../utils/space"; - -import { logger } from "matrix-js-sdk/src/logger"; import { shouldShowComponent } from "../../../customisations/helpers/UIComponents"; import { UIComponent } from "../../../settings/UIFeature"; diff --git a/src/components/views/right_panel/VerificationPanel.tsx b/src/components/views/right_panel/VerificationPanel.tsx index 881dac33d4..2addb27c03 100644 --- a/src/components/views/right_panel/VerificationPanel.tsx +++ b/src/components/views/right_panel/VerificationPanel.tsx @@ -15,28 +15,24 @@ limitations under the License. */ import React from "react"; - -import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { verificationMethods } from 'matrix-js-sdk/src/crypto'; -import { SCAN_QR_CODE_METHOD } from "matrix-js-sdk/src/crypto/verification/QRCode"; -import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { SCAN_QR_CODE_METHOD, ReciprocateQRCode } from "matrix-js-sdk/src/crypto/verification/QRCode"; +import { VerificationRequest, Phase } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { User } from "matrix-js-sdk/src/models/user"; -import { ReciprocateQRCode } from "matrix-js-sdk/src/crypto/verification/QRCode"; import { SAS } from "matrix-js-sdk/src/crypto/verification/SAS"; +import { logger } from "matrix-js-sdk/src/logger"; +import { MatrixClientPeg } from "../../../MatrixClientPeg"; import VerificationQRCode from "../elements/crypto/VerificationQRCode"; import { _t } from "../../../languageHandler"; import SdkConfig from "../../../SdkConfig"; import E2EIcon, { E2EState } from "../rooms/E2EIcon"; -import { Phase } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; import Spinner from "../elements/Spinner"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import AccessibleButton from "../elements/AccessibleButton"; import VerificationShowSas from "../verification/VerificationShowSas"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { layout: string; request: VerificationRequest; diff --git a/src/components/views/room_settings/AliasSettings.tsx b/src/components/views/room_settings/AliasSettings.tsx index 4666ca9ef7..71ad9cd9f3 100644 --- a/src/components/views/room_settings/AliasSettings.tsx +++ b/src/components/views/room_settings/AliasSettings.tsx @@ -16,6 +16,7 @@ limitations under the License. import React, { ChangeEvent, createRef } from "react"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { logger } from "matrix-js-sdk/src/logger"; import EditableItemList from "../elements/EditableItemList"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; @@ -29,8 +30,6 @@ import RoomPublishSetting from "./RoomPublishSetting"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import RoomAliasField from "../elements/RoomAliasField"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IEditableAliasesListProps { domain?: string; } diff --git a/src/components/views/room_settings/RelatedGroupSettings.js b/src/components/views/room_settings/RelatedGroupSettings.js index f815cd77cc..737147f664 100644 --- a/src/components/views/room_settings/RelatedGroupSettings.js +++ b/src/components/views/room_settings/RelatedGroupSettings.js @@ -17,6 +17,8 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; +import { logger } from "matrix-js-sdk/src/logger"; + import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; import Modal from '../../../Modal'; @@ -24,8 +26,6 @@ import ErrorDialog from "../dialogs/ErrorDialog"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - const GROUP_ID_REGEX = /\+\S+:\S+/; @replaceableComponent("views.room_settings.RelatedGroupSettings") diff --git a/src/components/views/room_settings/RoomProfileSettings.tsx b/src/components/views/room_settings/RoomProfileSettings.tsx index 8cc7a620f8..92bb5e0647 100644 --- a/src/components/views/room_settings/RoomProfileSettings.tsx +++ b/src/components/views/room_settings/RoomProfileSettings.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { createRef } from 'react'; + import { _t } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import Field from "../elements/Field"; diff --git a/src/components/views/room_settings/UrlPreviewSettings.tsx b/src/components/views/room_settings/UrlPreviewSettings.tsx index bb639b691a..37e4d4981a 100644 --- a/src/components/views/room_settings/UrlPreviewSettings.tsx +++ b/src/components/views/room_settings/UrlPreviewSettings.tsx @@ -18,6 +18,8 @@ limitations under the License. */ import React from 'react'; +import { Room } from "matrix-js-sdk/src/models/room"; + import { _t, _td } from '../../../languageHandler'; import SettingsStore from "../../../settings/SettingsStore"; import dis from "../../../dispatcher/dispatcher"; @@ -25,7 +27,6 @@ import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { Action } from "../../../dispatcher/actions"; import { SettingLevel } from "../../../settings/SettingLevel"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { Room } from "matrix-js-sdk/src/models/room"; import SettingsFlag from "../elements/SettingsFlag"; interface IProps { diff --git a/src/components/views/rooms/AppsDrawer.tsx b/src/components/views/rooms/AppsDrawer.tsx index 4c6b8db02e..3b50309bca 100644 --- a/src/components/views/rooms/AppsDrawer.tsx +++ b/src/components/views/rooms/AppsDrawer.tsx @@ -18,6 +18,7 @@ limitations under the License. import React from 'react'; import classNames from 'classnames'; import { Resizable } from "re-resizable"; +import { Room } from "matrix-js-sdk/src/models/room"; import AppTile from '../elements/AppTile'; import dis from '../../../dispatcher/dispatcher'; @@ -34,7 +35,6 @@ import { clamp, percentageOf, percentageWithin } from "../../../utils/numbers"; import { useStateCallback } from "../../../hooks/useStateCallback"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import UIStore from "../../../stores/UIStore"; -import { Room } from "matrix-js-sdk/src/models/room"; import { IApp } from "../../../stores/WidgetStore"; import { ActionPayload } from "../../../dispatcher/payloads"; diff --git a/src/components/views/rooms/Autocomplete.tsx b/src/components/views/rooms/Autocomplete.tsx index 34909baef1..fb76d30e51 100644 --- a/src/components/views/rooms/Autocomplete.tsx +++ b/src/components/views/rooms/Autocomplete.tsx @@ -18,11 +18,10 @@ limitations under the License. import React, { createRef, KeyboardEvent } from 'react'; import classNames from 'classnames'; import { flatMap } from "lodash"; -import { ICompletion, ISelectionRange, IProviderCompletions } from '../../../autocomplete/Autocompleter'; import { Room } from 'matrix-js-sdk/src/models/room'; +import Autocompleter, { ICompletion, ISelectionRange, IProviderCompletions } from '../../../autocomplete/Autocompleter'; import SettingsStore from "../../../settings/SettingsStore"; -import Autocompleter from '../../../autocomplete/Autocompleter'; import { replaceableComponent } from "../../../utils/replaceableComponent"; const MAX_PROVIDER_MATCHES = 20; diff --git a/src/components/views/rooms/AuxPanel.tsx b/src/components/views/rooms/AuxPanel.tsx index 7afa29624a..b4d954a04b 100644 --- a/src/components/views/rooms/AuxPanel.tsx +++ b/src/components/views/rooms/AuxPanel.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import { lexicographicCompare } from 'matrix-js-sdk/src/utils'; import { Room } from 'matrix-js-sdk/src/models/room'; +import { throttle } from 'lodash'; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import AppsDrawer from './AppsDrawer'; @@ -27,7 +28,6 @@ import ResizeNotifier from "../../../utils/ResizeNotifier"; import CallViewForRoom from '../voip/CallViewForRoom'; import { objectHasDiff } from "../../../utils/objects"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { throttle } from 'lodash'; interface IProps { // js-sdk room object diff --git a/src/components/views/rooms/BasicMessageComposer.tsx b/src/components/views/rooms/BasicMessageComposer.tsx index 4d13fab190..57880ed173 100644 --- a/src/components/views/rooms/BasicMessageComposer.tsx +++ b/src/components/views/rooms/BasicMessageComposer.tsx @@ -19,6 +19,7 @@ import React, { createRef, ClipboardEvent } from 'react'; import { Room } from 'matrix-js-sdk/src/models/room'; import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; import EMOTICON_REGEX from 'emojibase-regex/emoticon'; +import { logger } from "matrix-js-sdk/src/logger"; import EditorModel from '../../../editor/model'; import HistoryManager from '../../../editor/history'; @@ -49,8 +50,6 @@ import { ICompletion } from "../../../autocomplete/Autocompleter"; import { AutocompleteAction, getKeyBindingsManager, MessageComposerAction } from '../../../KeyBindingsManager'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - // matches emoticons which follow the start of a line or whitespace const REGEX_EMOTICON_WHITESPACE = new RegExp('(?:^|\\s)(' + EMOTICON_REGEX.source + ')\\s|:^$'); export const REGEX_EMOTICON = new RegExp('(?:^|\\s)(' + EMOTICON_REGEX.source + ')$'); diff --git a/src/components/views/rooms/EditMessageComposer.tsx b/src/components/views/rooms/EditMessageComposer.tsx index 1e0a367772..6a4a259ae5 100644 --- a/src/components/views/rooms/EditMessageComposer.tsx +++ b/src/components/views/rooms/EditMessageComposer.tsx @@ -17,6 +17,9 @@ limitations under the License. import React, { createRef, KeyboardEvent } from 'react'; import classNames from 'classnames'; import { EventStatus, IContent, MatrixEvent } from 'matrix-js-sdk/src/models/event'; +import { MsgType } from 'matrix-js-sdk/src/@types/event'; +import { Room } from 'matrix-js-sdk/src/models/room'; +import { logger } from "matrix-js-sdk/src/logger"; import { _t, _td } from '../../../languageHandler'; import dis from '../../../dispatcher/dispatcher'; @@ -35,16 +38,12 @@ import { getKeyBindingsManager, MessageComposerAction } from '../../../KeyBindin import { replaceableComponent } from "../../../utils/replaceableComponent"; import SendHistoryManager from '../../../SendHistoryManager'; import Modal from '../../../Modal'; -import { MsgType } from 'matrix-js-sdk/src/@types/event'; -import { Room } from 'matrix-js-sdk/src/models/room'; import ErrorDialog from "../dialogs/ErrorDialog"; import QuestionDialog from "../dialogs/QuestionDialog"; import { ActionPayload } from "../../../dispatcher/payloads"; import AccessibleButton from '../elements/AccessibleButton'; import { createRedactEventDialog } from '../dialogs/ConfirmRedactDialog'; import SettingsStore from "../../../settings/SettingsStore"; - -import { logger } from "matrix-js-sdk/src/logger"; import { withMatrixClientHOC, MatrixClientProps } from '../../../contexts/MatrixClientContext'; import RoomContext from '../../../contexts/RoomContext'; diff --git a/src/components/views/rooms/EntityTile.tsx b/src/components/views/rooms/EntityTile.tsx index d7dd4b1092..1cf91289f6 100644 --- a/src/components/views/rooms/EntityTile.tsx +++ b/src/components/views/rooms/EntityTile.tsx @@ -17,9 +17,10 @@ limitations under the License. */ import React from 'react'; +import classNames from "classnames"; + import AccessibleButton from '../elements/AccessibleButton'; import { _td } from '../../../languageHandler'; -import classNames from "classnames"; import E2EIcon, { E2EState } from './E2EIcon'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import BaseAvatar from '../avatars/BaseAvatar'; diff --git a/src/components/views/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx index 26b25699c0..772c736e48 100644 --- a/src/components/views/rooms/EventTile.tsx +++ b/src/components/views/rooms/EventTile.tsx @@ -22,6 +22,7 @@ import { EventStatus, MatrixEvent } from "matrix-js-sdk/src/models/event"; import { Relations } from "matrix-js-sdk/src/models/relations"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { Thread, ThreadEvent } from 'matrix-js-sdk/src/models/thread'; +import { logger } from "matrix-js-sdk/src/logger"; import ReplyChain from "../elements/ReplyChain"; import { _t } from '../../../languageHandler'; @@ -61,8 +62,6 @@ import MKeyVerificationConclusion from "../messages/MKeyVerificationConclusion"; import { dispatchShowThreadEvent } from '../../../dispatcher/dispatch-actions/threads'; import { MessagePreviewStore } from '../../../stores/room-list/MessagePreviewStore'; -import { logger } from "matrix-js-sdk/src/logger"; - const eventTileTypes = { [EventType.RoomMessage]: 'messages.MessageEvent', [EventType.Sticker]: 'messages.MessageEvent', diff --git a/src/components/views/rooms/ExtraTile.tsx b/src/components/views/rooms/ExtraTile.tsx index e74dde3a0f..7828229c80 100644 --- a/src/components/views/rooms/ExtraTile.tsx +++ b/src/components/views/rooms/ExtraTile.tsx @@ -16,6 +16,7 @@ limitations under the License. import React from "react"; import classNames from "classnames"; + import { RovingAccessibleButton, RovingAccessibleTooltipButton, diff --git a/src/components/views/rooms/JumpToBottomButton.tsx b/src/components/views/rooms/JumpToBottomButton.tsx index 0b680d093d..b847b9f6b7 100644 --- a/src/components/views/rooms/JumpToBottomButton.tsx +++ b/src/components/views/rooms/JumpToBottomButton.tsx @@ -15,9 +15,10 @@ limitations under the License. */ import React from "react"; +import classNames from 'classnames'; + import { _t } from '../../../languageHandler'; import AccessibleButton from '../elements/AccessibleButton'; -import classNames from 'classnames'; interface IProps { numUnreadMessages: number; diff --git a/src/components/views/rooms/LinkPreviewGroup.tsx b/src/components/views/rooms/LinkPreviewGroup.tsx index fa9b601d5e..93757a0140 100644 --- a/src/components/views/rooms/LinkPreviewGroup.tsx +++ b/src/components/views/rooms/LinkPreviewGroup.tsx @@ -17,6 +17,7 @@ limitations under the License. import React, { useContext, useEffect } from "react"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { IPreviewUrlResponse, MatrixClient } from "matrix-js-sdk/src/client"; +import { logger } from "matrix-js-sdk/src/logger"; import { useStateToggle } from "../../../hooks/useStateToggle"; import LinkPreviewWidget from "./LinkPreviewWidget"; @@ -25,8 +26,6 @@ import { _t } from "../../../languageHandler"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { useAsyncMemo } from "../../../hooks/useAsyncMemo"; -import { logger } from "matrix-js-sdk/src/logger"; - const INITIAL_NUM_PREVIEWS = 2; interface IProps { diff --git a/src/components/views/rooms/MemberList.tsx b/src/components/views/rooms/MemberList.tsx index bf5411b0da..dffe820f30 100644 --- a/src/components/views/rooms/MemberList.tsx +++ b/src/components/views/rooms/MemberList.tsx @@ -18,6 +18,15 @@ limitations under the License. */ import React from 'react'; +import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; +import { Room } from 'matrix-js-sdk/src/models/room'; +import { RoomMember } from 'matrix-js-sdk/src/models/room-member'; +import { RoomState } from 'matrix-js-sdk/src/models/room-state'; +import { User } from "matrix-js-sdk/src/models/user"; +import { throttle } from 'lodash'; +import { JoinRule } from "matrix-js-sdk/src/@types/partials"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from '../../../languageHandler'; import SdkConfig from '../../../SdkConfig'; import dis from '../../../dispatcher/dispatcher'; @@ -30,11 +39,6 @@ import RoomAvatar from "../avatars/RoomAvatar"; import RoomName from "../elements/RoomName"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import SettingsStore from "../../../settings/SettingsStore"; -import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; -import { Room } from 'matrix-js-sdk/src/models/room'; -import { RoomMember } from 'matrix-js-sdk/src/models/room-member'; -import { RoomState } from 'matrix-js-sdk/src/models/room-state'; -import { User } from "matrix-js-sdk/src/models/user"; import TruncatedList from '../elements/TruncatedList'; import Spinner from "../elements/Spinner"; import SearchBox from "../../structures/SearchBox"; @@ -42,13 +46,9 @@ import AccessibleButton from '../elements/AccessibleButton'; import EntityTile from "./EntityTile"; import MemberTile from "./MemberTile"; import BaseAvatar from '../avatars/BaseAvatar'; -import { throttle } from 'lodash'; import SpaceStore from "../../../stores/SpaceStore"; import { shouldShowComponent } from "../../../customisations/helpers/UIComponents"; import { UIComponent } from "../../../settings/UIFeature"; -import { JoinRule } from "matrix-js-sdk/src/@types/partials"; - -import { logger } from "matrix-js-sdk/src/logger"; const getSearchQueryLSKey = (roomId: string) => `mx_MemberList_searchQuarry_${roomId}`; diff --git a/src/components/views/rooms/MemberTile.tsx b/src/components/views/rooms/MemberTile.tsx index ce571f78ad..0df5daad96 100644 --- a/src/components/views/rooms/MemberTile.tsx +++ b/src/components/views/rooms/MemberTile.tsx @@ -15,17 +15,18 @@ See the License for the specific language governing permissions and limitations under the License. */ -import SettingsStore from "../../../settings/SettingsStore"; import React from 'react'; +import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { EventType } from "matrix-js-sdk/src/@types/event"; +import { DeviceInfo } from "matrix-js-sdk/src/crypto/deviceinfo"; + +import SettingsStore from "../../../settings/SettingsStore"; import dis from "../../../dispatcher/dispatcher"; import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { Action } from "../../../dispatcher/actions"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { RoomMember } from "matrix-js-sdk/src/models/room-member"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; -import { EventType } from "matrix-js-sdk/src/@types/event"; -import { DeviceInfo } from "matrix-js-sdk/src/crypto/deviceinfo"; import EntityTile, { PowerStatus } from "./EntityTile"; import MemberAvatar from "./../avatars/MemberAvatar"; diff --git a/src/components/views/rooms/MessageComposer.tsx b/src/components/views/rooms/MessageComposer.tsx index 79f613b996..57fc2dfa38 100644 --- a/src/components/views/rooms/MessageComposer.tsx +++ b/src/components/views/rooms/MessageComposer.tsx @@ -15,11 +15,13 @@ limitations under the License. */ import React, { createRef } from 'react'; import classNames from 'classnames'; -import { _t } from '../../../languageHandler'; -import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { MatrixEvent, IEventRelation } from "matrix-js-sdk/src/models/event"; import { Room } from "matrix-js-sdk/src/models/room"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { RelationType } from 'matrix-js-sdk/src/@types/event'; + +import { _t } from '../../../languageHandler'; +import { MatrixClientPeg } from '../../../MatrixClientPeg'; import dis from '../../../dispatcher/dispatcher'; import { ActionPayload } from "../../../dispatcher/payloads"; import Stickerpicker from './Stickerpicker'; @@ -54,7 +56,6 @@ import MemberStatusMessageAvatar from "../avatars/MemberStatusMessageAvatar"; import UIStore, { UI_EVENTS } from '../../../stores/UIStore'; import Modal from "../../../Modal"; import InfoDialog from "../dialogs/InfoDialog"; -import { RelationType } from 'matrix-js-sdk/src/@types/event'; import RoomContext from '../../../contexts/RoomContext'; let instanceCount = 0; diff --git a/src/components/views/rooms/NotificationBadge.tsx b/src/components/views/rooms/NotificationBadge.tsx index a97d51fc90..4f05cd01ef 100644 --- a/src/components/views/rooms/NotificationBadge.tsx +++ b/src/components/views/rooms/NotificationBadge.tsx @@ -16,6 +16,7 @@ limitations under the License. import React, { MouseEvent } from "react"; import classNames from "classnames"; + import { formatCount } from "../../../utils/FormattingUtils"; import SettingsStore from "../../../settings/SettingsStore"; import AccessibleButton from "../elements/AccessibleButton"; diff --git a/src/components/views/rooms/ReadReceiptMarker.tsx b/src/components/views/rooms/ReadReceiptMarker.tsx index f2ce7e3967..1b477d9988 100644 --- a/src/components/views/rooms/ReadReceiptMarker.tsx +++ b/src/components/views/rooms/ReadReceiptMarker.tsx @@ -17,17 +17,15 @@ limitations under the License. import React, { createRef, RefObject } from 'react'; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from '../../../languageHandler'; import { formatDate } from '../../../DateUtils'; import NodeAnimator from "../../../NodeAnimator"; import { toPx } from "../../../utils/units"; import { replaceableComponent } from "../../../utils/replaceableComponent"; - import MemberAvatar from '../avatars/MemberAvatar'; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { // the RoomMember to show the RR for member?: RoomMember; diff --git a/src/components/views/rooms/ReplyPreview.tsx b/src/components/views/rooms/ReplyPreview.tsx index a1dfddfe19..1786e5061a 100644 --- a/src/components/views/rooms/ReplyPreview.tsx +++ b/src/components/views/rooms/ReplyPreview.tsx @@ -15,12 +15,13 @@ limitations under the License. */ import React from 'react'; +import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; + import dis from '../../../dispatcher/dispatcher'; import { _t } from '../../../languageHandler'; import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import ReplyTile from './ReplyTile'; -import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; import RoomContext, { TimelineRenderingType } from '../../../contexts/RoomContext'; function cancelQuoting(context: TimelineRenderingType) { diff --git a/src/components/views/rooms/ReplyTile.tsx b/src/components/views/rooms/ReplyTile.tsx index b869979d58..146591b16b 100644 --- a/src/components/views/rooms/ReplyTile.tsx +++ b/src/components/views/rooms/ReplyTile.tsx @@ -16,21 +16,21 @@ limitations under the License. import React, { createRef } from 'react'; import classNames from 'classnames'; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { EventType, MsgType } from 'matrix-js-sdk/src/@types/event'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from '../../../languageHandler'; import dis from '../../../dispatcher/dispatcher'; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { RoomPermalinkCreator } from '../../../utils/permalinks/Permalinks'; import SenderProfile from "../messages/SenderProfile"; import MImageReplyBody from "../messages/MImageReplyBody"; import * as sdk from '../../../index'; -import { EventType, MsgType } from 'matrix-js-sdk/src/@types/event'; import { replaceableComponent } from '../../../utils/replaceableComponent'; import { getEventDisplayInfo, isVoiceMessage } from '../../../utils/EventUtils'; import MFileBody from "../messages/MFileBody"; import MVoiceMessageBody from "../messages/MVoiceMessageBody"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { mxEvent: MatrixEvent; permalinkCreator?: RoomPermalinkCreator; diff --git a/src/components/views/rooms/RoomBreadcrumbs.tsx b/src/components/views/rooms/RoomBreadcrumbs.tsx index a20c409a53..e99876d845 100644 --- a/src/components/views/rooms/RoomBreadcrumbs.tsx +++ b/src/components/views/rooms/RoomBreadcrumbs.tsx @@ -15,14 +15,15 @@ limitations under the License. */ import React from "react"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { CSSTransition } from "react-transition-group"; + import { BreadcrumbsStore } from "../../../stores/BreadcrumbsStore"; import DecoratedRoomAvatar from "../avatars/DecoratedRoomAvatar"; import { _t } from "../../../languageHandler"; -import { Room } from "matrix-js-sdk/src/models/room"; import defaultDispatcher from "../../../dispatcher/dispatcher"; import Analytics from "../../../Analytics"; import { UPDATE_EVENT } from "../../../stores/AsyncStore"; -import { CSSTransition } from "react-transition-group"; import { RovingAccessibleTooltipButton } from "../../../accessibility/RovingTabIndex"; import Toolbar from "../../../accessibility/Toolbar"; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/rooms/RoomDetailList.tsx b/src/components/views/rooms/RoomDetailList.tsx index 869ab9e8f3..6095082834 100644 --- a/src/components/views/rooms/RoomDetailList.tsx +++ b/src/components/views/rooms/RoomDetailList.tsx @@ -17,9 +17,9 @@ limitations under the License. import React from 'react'; import { Room } from 'matrix-js-sdk/src'; import classNames from 'classnames'; + import dis from '../../../dispatcher/dispatcher'; import { _t } from '../../../languageHandler'; - import { replaceableComponent } from "../../../utils/replaceableComponent"; import RoomDetailRow from "./RoomDetailRow"; diff --git a/src/components/views/rooms/RoomDetailRow.js b/src/components/views/rooms/RoomDetailRow.js index f4be44b1af..99ba410431 100644 --- a/src/components/views/rooms/RoomDetailRow.js +++ b/src/components/views/rooms/RoomDetailRow.js @@ -14,11 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import * as sdk from '../../../index'; import React, { createRef } from 'react'; +import PropTypes from 'prop-types'; + +import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; import { linkifyElement } from '../../../HtmlUtils'; -import PropTypes from 'prop-types'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { mediaFromMxc } from "../../../customisations/Media"; import { getDisplayAliasForAliasSet } from '../../../Rooms'; diff --git a/src/components/views/rooms/RoomHeader.tsx b/src/components/views/rooms/RoomHeader.tsx index a1cd079ccb..5b70a034c5 100644 --- a/src/components/views/rooms/RoomHeader.tsx +++ b/src/components/views/rooms/RoomHeader.tsx @@ -17,9 +17,11 @@ limitations under the License. import React from 'react'; import classNames from 'classnames'; +import { throttle } from 'lodash'; +import { MatrixEvent, Room, RoomState } from 'matrix-js-sdk/src'; + import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; - import SettingsStore from "../../../settings/SettingsStore"; import RoomHeaderButtons from '../right_panel/RoomHeaderButtons'; import E2EIcon from './E2EIcon'; @@ -31,8 +33,6 @@ import { PlaceCallType } from "../../../CallHandler"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import Modal from '../../../Modal'; import InfoDialog from "../dialogs/InfoDialog"; -import { throttle } from 'lodash'; -import { MatrixEvent, Room, RoomState } from 'matrix-js-sdk/src'; import { E2EStatus } from '../../../utils/ShieldUtils'; import { IOOBData } from '../../../stores/ThreepidInviteStore'; import { SearchScope } from './SearchBar'; diff --git a/src/components/views/rooms/RoomList.tsx b/src/components/views/rooms/RoomList.tsx index 90250f2d77..8dfa75e269 100644 --- a/src/components/views/rooms/RoomList.tsx +++ b/src/components/views/rooms/RoomList.tsx @@ -19,6 +19,7 @@ import { Dispatcher } from "flux"; import { Room } from "matrix-js-sdk/src/models/room"; import * as fbEmitter from "fbemitter"; import { EventType } from "matrix-js-sdk/src/@types/event"; +import { JoinRule } from "matrix-js-sdk/src/@types/partials"; import { _t, _td } from "../../../languageHandler"; import { RovingTabIndexProvider } from "../../../accessibility/RovingTabIndex"; @@ -51,7 +52,6 @@ import RoomAvatar from "../avatars/RoomAvatar"; import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; import { shouldShowComponent } from "../../../customisations/helpers/UIComponents"; import { UIComponent } from "../../../settings/UIFeature"; -import { JoinRule } from "matrix-js-sdk/src/@types/partials"; interface IProps { onKeyDown: (ev: React.KeyboardEvent) => void; diff --git a/src/components/views/rooms/RoomPreviewBar.tsx b/src/components/views/rooms/RoomPreviewBar.tsx index 82437a5c14..89ca084ccd 100644 --- a/src/components/views/rooms/RoomPreviewBar.tsx +++ b/src/components/views/rooms/RoomPreviewBar.tsx @@ -20,11 +20,11 @@ import { MatrixError } from "matrix-js-sdk/src/http-api"; import { EventType, RoomType } from "matrix-js-sdk/src/@types/event"; import { IJoinRuleEventContent, JoinRule } from "matrix-js-sdk/src/@types/partials"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import classNames from 'classnames'; import * as sdk from '../../../index'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import dis from '../../../dispatcher/dispatcher'; -import classNames from 'classnames'; import { _t } from '../../../languageHandler'; import SdkConfig from "../../../SdkConfig"; import IdentityAuthClient from '../../../IdentityAuthClient'; diff --git a/src/components/views/rooms/RoomSublist.tsx b/src/components/views/rooms/RoomSublist.tsx index 0d2ef25951..76d954c00b 100644 --- a/src/components/views/rooms/RoomSublist.tsx +++ b/src/components/views/rooms/RoomSublist.tsx @@ -21,6 +21,9 @@ import { createRef, ReactComponentElement } from "react"; import { normalize } from "matrix-js-sdk/src/utils"; import { Room } from "matrix-js-sdk/src/models/room"; import classNames from 'classnames'; +import { Enable, Resizable } from "re-resizable"; +import { Direction } from "re-resizable/lib/resizer"; + import { RovingAccessibleButton, RovingTabIndexWrapper } from "../../../accessibility/RovingTabIndex"; import { _t } from "../../../languageHandler"; import AccessibleButton from "../../views/elements/AccessibleButton"; @@ -42,8 +45,6 @@ import NotificationBadge from "./NotificationBadge"; import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; import { Key } from "../../../Keyboard"; import { ActionPayload } from "../../../dispatcher/payloads"; -import { Enable, Resizable } from "re-resizable"; -import { Direction } from "re-resizable/lib/resizer"; import { polyfillTouchEvent } from "../../../@types/polyfill"; import ResizeNotifier from "../../../utils/ResizeNotifier"; import { RoomNotificationStateStore } from "../../../stores/notifications/RoomNotificationStateStore"; diff --git a/src/components/views/rooms/RoomTile.tsx b/src/components/views/rooms/RoomTile.tsx index eb13d7e96e..5f8c214a69 100644 --- a/src/components/views/rooms/RoomTile.tsx +++ b/src/components/views/rooms/RoomTile.tsx @@ -18,6 +18,8 @@ limitations under the License. import React, { createRef } from "react"; import { Room } from "matrix-js-sdk/src/models/room"; import classNames from "classnames"; +import { logger } from "matrix-js-sdk/src/logger"; + import { RovingTabIndexWrapper } from "../../../accessibility/RovingTabIndex"; import AccessibleButton, { ButtonEvent } from "../../views/elements/AccessibleButton"; import dis from '../../../dispatcher/dispatcher'; @@ -50,8 +52,6 @@ import IconizedContextMenu, { import { CommunityPrototypeStore, IRoomProfile } from "../../../stores/CommunityPrototypeStore"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { room: Room; showMessagePreview: boolean; diff --git a/src/components/views/rooms/RoomUpgradeWarningBar.tsx b/src/components/views/rooms/RoomUpgradeWarningBar.tsx index eb334ab825..1b368fcb44 100644 --- a/src/components/views/rooms/RoomUpgradeWarningBar.tsx +++ b/src/components/views/rooms/RoomUpgradeWarningBar.tsx @@ -20,7 +20,6 @@ import { Room } from 'matrix-js-sdk/src/models/room'; import { RoomState } from 'matrix-js-sdk/src/models/room-state'; import Modal from '../../../Modal'; - import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/rooms/SearchBar.tsx b/src/components/views/rooms/SearchBar.tsx index 81d0402050..c8b03b99d6 100644 --- a/src/components/views/rooms/SearchBar.tsx +++ b/src/components/views/rooms/SearchBar.tsx @@ -16,8 +16,9 @@ limitations under the License. */ import React, { createRef, RefObject } from 'react'; -import AccessibleButton from "../elements/AccessibleButton"; import classNames from "classnames"; + +import AccessibleButton from "../elements/AccessibleButton"; import { _t } from '../../../languageHandler'; import { Key } from "../../../Keyboard"; import DesktopBuildsNotice, { WarningKind } from "../elements/DesktopBuildsNotice"; diff --git a/src/components/views/rooms/SearchResultTile.tsx b/src/components/views/rooms/SearchResultTile.tsx index c033855eb5..376c3166a9 100644 --- a/src/components/views/rooms/SearchResultTile.tsx +++ b/src/components/views/rooms/SearchResultTile.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from "react"; import { SearchResult } from "matrix-js-sdk/src/models/search-result"; + import RoomContext from "../../../contexts/RoomContext"; import SettingsStore from "../../../settings/SettingsStore"; import { UIFeature } from "../../../settings/UIFeature"; diff --git a/src/components/views/rooms/SendMessageComposer.tsx b/src/components/views/rooms/SendMessageComposer.tsx index c32a31f249..d855e902cb 100644 --- a/src/components/views/rooms/SendMessageComposer.tsx +++ b/src/components/views/rooms/SendMessageComposer.tsx @@ -20,6 +20,7 @@ import { IContent, MatrixEvent, IEventRelation } from 'matrix-js-sdk/src/models/ import { DebouncedFunc, throttle } from 'lodash'; import { EventType, RelationType } from "matrix-js-sdk/src/@types/event"; import { logger } from "matrix-js-sdk/src/logger"; +import { Room } from 'matrix-js-sdk/src/models/room'; import dis from '../../../dispatcher/dispatcher'; import EditorModel from '../../../editor/model'; @@ -51,7 +52,6 @@ import { getKeyBindingsManager, MessageComposerAction } from '../../../KeyBindin import { replaceableComponent } from "../../../utils/replaceableComponent"; import SettingsStore from '../../../settings/SettingsStore'; import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; -import { Room } from 'matrix-js-sdk/src/models/room'; import ErrorDialog from "../dialogs/ErrorDialog"; import QuestionDialog from "../dialogs/QuestionDialog"; import { ActionPayload } from "../../../dispatcher/payloads"; diff --git a/src/components/views/rooms/SimpleRoomHeader.tsx b/src/components/views/rooms/SimpleRoomHeader.tsx index d6effaceb4..5c83f1df14 100644 --- a/src/components/views/rooms/SimpleRoomHeader.tsx +++ b/src/components/views/rooms/SimpleRoomHeader.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; interface IProps { diff --git a/src/components/views/rooms/Stickerpicker.tsx b/src/components/views/rooms/Stickerpicker.tsx index 1f59d3a71e..137dc16f0f 100644 --- a/src/components/views/rooms/Stickerpicker.tsx +++ b/src/components/views/rooms/Stickerpicker.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React from 'react'; import { Room } from 'matrix-js-sdk/src/models/room'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t, _td } from '../../../languageHandler'; import AppTile from '../elements/AppTile'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; @@ -34,8 +36,6 @@ import ScalarAuthClient from '../../../ScalarAuthClient'; import GenericElementContextMenu from "../context_menus/GenericElementContextMenu"; import { IApp } from "../../../stores/WidgetStore"; -import { logger } from "matrix-js-sdk/src/logger"; - // This should be below the dialog level (4000), but above the rest of the UI (1000-2000). // We sit in a context menu, so this should be given to the context menu. const STICKERPICKER_Z_INDEX = 3500; diff --git a/src/components/views/rooms/ThirdPartyMemberInfo.tsx b/src/components/views/rooms/ThirdPartyMemberInfo.tsx index c29c558655..9a8533007b 100644 --- a/src/components/views/rooms/ThirdPartyMemberInfo.tsx +++ b/src/components/views/rooms/ThirdPartyMemberInfo.tsx @@ -15,9 +15,11 @@ limitations under the License. */ import React from 'react'; -import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { Room } from "matrix-js-sdk/src/models/room"; +import { logger } from "matrix-js-sdk/src/logger"; + +import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { _t } from "../../../languageHandler"; import dis from "../../../dispatcher/dispatcher"; import Modal from "../../../Modal"; @@ -29,8 +31,6 @@ import ErrorDialog from '../dialogs/ErrorDialog'; import AccessibleButton from '../elements/AccessibleButton'; import SpaceStore from "../../../stores/SpaceStore"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { event: MatrixEvent; } diff --git a/src/components/views/rooms/TopUnreadMessagesBar.tsx b/src/components/views/rooms/TopUnreadMessagesBar.tsx index 14f9a27f2d..a9cb451783 100644 --- a/src/components/views/rooms/TopUnreadMessagesBar.tsx +++ b/src/components/views/rooms/TopUnreadMessagesBar.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from '../../../languageHandler'; import AccessibleButton from '../elements/AccessibleButton'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/rooms/VoiceRecordComposerTile.tsx b/src/components/views/rooms/VoiceRecordComposerTile.tsx index e50672ed4a..18a49dd4c7 100644 --- a/src/components/views/rooms/VoiceRecordComposerTile.tsx +++ b/src/components/views/rooms/VoiceRecordComposerTile.tsx @@ -14,11 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ +import React, { ReactNode } from "react"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { MsgType } from "matrix-js-sdk/src/@types/event"; +import { logger } from "matrix-js-sdk/src/logger"; + import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; import { _t } from "../../../languageHandler"; -import React, { ReactNode } from "react"; import { IUpload, RecordingState, VoiceRecording } from "../../../audio/VoiceRecording"; -import { Room } from "matrix-js-sdk/src/models/room"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import LiveRecordingWaveform from "../audio_messages/LiveRecordingWaveform"; import { replaceableComponent } from "../../../utils/replaceableComponent"; @@ -26,7 +29,6 @@ import LiveRecordingClock from "../audio_messages/LiveRecordingClock"; import { VoiceRecordingStore } from "../../../stores/VoiceRecordingStore"; import { UPDATE_EVENT } from "../../../stores/AsyncStore"; import RecordingPlayback from "../audio_messages/RecordingPlayback"; -import { MsgType } from "matrix-js-sdk/src/@types/event"; import Modal from "../../../Modal"; import ErrorDialog from "../dialogs/ErrorDialog"; import MediaDeviceHandler, { MediaDeviceKindEnum } from "../../../MediaDeviceHandler"; @@ -36,8 +38,6 @@ import { NotificationColor } from "../../../stores/notifications/NotificationCol import InlineSpinner from "../elements/InlineSpinner"; import { PlaybackManager } from "../../../audio/PlaybackManager"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { room: Room; } diff --git a/src/components/views/settings/AvatarSetting.tsx b/src/components/views/settings/AvatarSetting.tsx index 806d0adb73..480d41d303 100644 --- a/src/components/views/settings/AvatarSetting.tsx +++ b/src/components/views/settings/AvatarSetting.tsx @@ -15,9 +15,10 @@ limitations under the License. */ import React, { useState } from "react"; +import classNames from "classnames"; + import { _t } from "../../../languageHandler"; import AccessibleButton from "../elements/AccessibleButton"; -import classNames from "classnames"; interface IProps { avatarUrl?: string; diff --git a/src/components/views/settings/BridgeTile.tsx b/src/components/views/settings/BridgeTile.tsx index d8beeddfc5..5fa06e3ff3 100644 --- a/src/components/views/settings/BridgeTile.tsx +++ b/src/components/views/settings/BridgeTile.tsx @@ -16,19 +16,19 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../languageHandler"; import Pill from "../elements/Pill"; import { makeUserPermalink } from "../../../utils/permalinks/Permalinks"; import BaseAvatar from "../avatars/BaseAvatar"; import SettingsStore from "../../../settings/SettingsStore"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; -import { Room } from "matrix-js-sdk/src/models/room"; import { isUrlPermitted } from '../../../HtmlUtils'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { mediaFromMxc } from "../../../customisations/Media"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { ev: MatrixEvent; room: Room; diff --git a/src/components/views/settings/ChangeAvatar.tsx b/src/components/views/settings/ChangeAvatar.tsx index 36178540f7..e46a6d912c 100644 --- a/src/components/views/settings/ChangeAvatar.tsx +++ b/src/components/views/settings/ChangeAvatar.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; import { Room } from 'matrix-js-sdk/src/models/room'; + import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { _t } from '../../../languageHandler'; import Spinner from '../elements/Spinner'; diff --git a/src/components/views/settings/ChangeDisplayName.tsx b/src/components/views/settings/ChangeDisplayName.tsx index 9f0f813ec6..3e1ff0cb7d 100644 --- a/src/components/views/settings/ChangeDisplayName.tsx +++ b/src/components/views/settings/ChangeDisplayName.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/settings/ChangePassword.tsx b/src/components/views/settings/ChangePassword.tsx index 4bde294aa4..09f70a8924 100644 --- a/src/components/views/settings/ChangePassword.tsx +++ b/src/components/views/settings/ChangePassword.tsx @@ -15,8 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Field from "../elements/Field"; import React from 'react'; +import { MatrixClient } from "matrix-js-sdk/src/client"; + +import Field from "../elements/Field"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import AccessibleButton from '../elements/AccessibleButton'; import Spinner from '../elements/Spinner'; @@ -27,7 +29,6 @@ import PassphraseField from "../auth/PassphraseField"; import CountlyAnalytics from "../../../CountlyAnalytics"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { PASSWORD_MIN_SCORE } from '../auth/RegistrationForm'; -import { MatrixClient } from "matrix-js-sdk/src/client"; import SetEmailDialog from "../dialogs/SetEmailDialog"; import QuestionDialog from "../dialogs/QuestionDialog"; diff --git a/src/components/views/settings/CrossSigningPanel.tsx b/src/components/views/settings/CrossSigningPanel.tsx index bb46e84d70..3457e9962c 100644 --- a/src/components/views/settings/CrossSigningPanel.tsx +++ b/src/components/views/settings/CrossSigningPanel.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React from 'react'; +import { MatrixEvent } from 'matrix-js-sdk/src'; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from '../../../languageHandler'; @@ -24,12 +26,9 @@ import Spinner from '../elements/Spinner'; import InteractiveAuthDialog from '../dialogs/InteractiveAuthDialog'; import ConfirmDestroyCrossSigningDialog from '../dialogs/security/ConfirmDestroyCrossSigningDialog'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { MatrixEvent } from 'matrix-js-sdk/src'; import SetupEncryptionDialog from '../dialogs/security/SetupEncryptionDialog'; import { accessSecretStorage } from '../../../SecurityManager'; -import { logger } from "matrix-js-sdk/src/logger"; - interface IState { error?: Error; crossSigningPublicKeysOnDevice?: boolean; diff --git a/src/components/views/settings/DevicesPanel.tsx b/src/components/views/settings/DevicesPanel.tsx index c2dc924694..fded9d3254 100644 --- a/src/components/views/settings/DevicesPanel.tsx +++ b/src/components/views/settings/DevicesPanel.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import classNames from 'classnames'; import { IMyDevice } from "matrix-js-sdk/src/client"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from '../../../languageHandler'; @@ -28,8 +29,6 @@ import DevicesPanelEntry from "./DevicesPanelEntry"; import Spinner from "../elements/Spinner"; import AccessibleButton from "../elements/AccessibleButton"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { className?: string; } diff --git a/src/components/views/settings/DevicesPanelEntry.tsx b/src/components/views/settings/DevicesPanelEntry.tsx index 6d73e1fe86..74a6bc4261 100644 --- a/src/components/views/settings/DevicesPanelEntry.tsx +++ b/src/components/views/settings/DevicesPanelEntry.tsx @@ -16,6 +16,7 @@ limitations under the License. import React from 'react'; import { IMyDevice } from 'matrix-js-sdk/src/client'; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; @@ -24,8 +25,6 @@ import StyledCheckbox from '../elements/StyledCheckbox'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import EditableTextContainer from "../elements/EditableTextContainer"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { device?: IMyDevice; onDeviceToggled?: (device: IMyDevice) => void; diff --git a/src/components/views/settings/FontScalingPanel.tsx b/src/components/views/settings/FontScalingPanel.tsx index aabfc1c9a4..dcb213c549 100644 --- a/src/components/views/settings/FontScalingPanel.tsx +++ b/src/components/views/settings/FontScalingPanel.tsx @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import React, { ChangeEvent } from 'react'; + import EventTilePreview from '../elements/EventTilePreview'; import Field from '../elements/Field'; -import React, { ChangeEvent } from 'react'; import SettingsFlag from '../elements/SettingsFlag'; import SettingsStore from "../../../settings/SettingsStore"; import Slider from "../elements/Slider"; diff --git a/src/components/views/settings/IntegrationManager.tsx b/src/components/views/settings/IntegrationManager.tsx index 0b880c019f..f30b3f2961 100644 --- a/src/components/views/settings/IntegrationManager.tsx +++ b/src/components/views/settings/IntegrationManager.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from '../../../languageHandler'; import dis from '../../../dispatcher/dispatcher'; import { Key } from "../../../Keyboard"; diff --git a/src/components/views/settings/LayoutSwitcher.tsx b/src/components/views/settings/LayoutSwitcher.tsx index ad8abd0033..8adbfb6aae 100644 --- a/src/components/views/settings/LayoutSwitcher.tsx +++ b/src/components/views/settings/LayoutSwitcher.tsx @@ -18,6 +18,7 @@ limitations under the License. import React from "react"; import classNames from "classnames"; + import SettingsStore from "../../../settings/SettingsStore"; import EventTilePreview from "../elements/EventTilePreview"; import StyledRadioButton from "../elements/StyledRadioButton"; diff --git a/src/components/views/settings/Notifications.tsx b/src/components/views/settings/Notifications.tsx index 133e9dda77..7340c1f637 100644 --- a/src/components/views/settings/Notifications.tsx +++ b/src/components/views/settings/Notifications.tsx @@ -15,9 +15,12 @@ limitations under the License. */ import React from "react"; +import { IAnnotatedPushRule, IPusher, PushRuleAction, PushRuleKind, RuleId } from "matrix-js-sdk/src/@types/PushRules"; +import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; +import { logger } from "matrix-js-sdk/src/logger"; + import Spinner from "../elements/Spinner"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; -import { IAnnotatedPushRule, IPusher, PushRuleAction, PushRuleKind, RuleId } from "matrix-js-sdk/src/@types/PushRules"; import { ContentRules, IContentRules, @@ -26,7 +29,6 @@ import { VectorState, } from "../../../notifications"; import { _t, TranslatedString } from "../../../languageHandler"; -import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; import LabelledToggleSwitch from "../elements/LabelledToggleSwitch"; import SettingsStore from "../../../settings/SettingsStore"; import StyledRadioButton from "../elements/StyledRadioButton"; @@ -39,8 +41,6 @@ import TagComposer from "../elements/TagComposer"; import { objectClone } from "../../../utils/objects"; import { arrayDiff } from "../../../utils/arrays"; -import { logger } from "matrix-js-sdk/src/logger"; - // TODO: this "view" component still has far too much application logic in it, // which should be factored out to other files. diff --git a/src/components/views/settings/ProfileSettings.tsx b/src/components/views/settings/ProfileSettings.tsx index c675de9433..3185783ef0 100644 --- a/src/components/views/settings/ProfileSettings.tsx +++ b/src/components/views/settings/ProfileSettings.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React, { createRef } from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import Field from "../elements/Field"; @@ -27,8 +29,6 @@ import { mediaFromMxc } from "../../../customisations/Media"; import AccessibleButton from '../elements/AccessibleButton'; import AvatarSetting from './AvatarSetting'; -import { logger } from "matrix-js-sdk/src/logger"; - interface IState { userId?: string; originalDisplayName?: string; diff --git a/src/components/views/settings/SecureBackupPanel.tsx b/src/components/views/settings/SecureBackupPanel.tsx index d69cf250a6..f0c39cf10f 100644 --- a/src/components/views/settings/SecureBackupPanel.tsx +++ b/src/components/views/settings/SecureBackupPanel.tsx @@ -16,6 +16,9 @@ limitations under the License. */ import React from 'react'; +import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup"; +import { TrustInfo } from "matrix-js-sdk/src/crypto/backup"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from '../../../languageHandler'; @@ -27,8 +30,6 @@ import QuestionDialog from '../dialogs/QuestionDialog'; import RestoreKeyBackupDialog from '../dialogs/security/RestoreKeyBackupDialog'; import { accessSecretStorage } from '../../../SecurityManager'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup"; -import { TrustInfo } from "matrix-js-sdk/src/crypto/backup"; interface IState { loading: boolean; @@ -43,8 +44,6 @@ interface IState { sessionsRemaining: number; } -import { logger } from "matrix-js-sdk/src/logger"; - @replaceableComponent("views.settings.SecureBackupPanel") export default class SecureBackupPanel extends React.PureComponent<{}, IState> { private unmounted = false; diff --git a/src/components/views/settings/SetIdServer.tsx b/src/components/views/settings/SetIdServer.tsx index 3eb6041a8f..d38e908332 100644 --- a/src/components/views/settings/SetIdServer.tsx +++ b/src/components/views/settings/SetIdServer.tsx @@ -16,6 +16,8 @@ limitations under the License. import url from 'url'; import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import Modal from '../../../Modal'; @@ -32,8 +34,6 @@ import AccessibleButton from '../elements/AccessibleButton'; import Field from '../elements/Field'; import QuestionDialog from "../dialogs/QuestionDialog"; -import { logger } from "matrix-js-sdk/src/logger"; - // We'll wait up to this long when checking for 3PID bindings on the IS. const REACHABILITY_TIMEOUT = 10000; // ms diff --git a/src/components/views/settings/SetIntegrationManager.tsx b/src/components/views/settings/SetIntegrationManager.tsx index dc33a9e20e..100afea9a6 100644 --- a/src/components/views/settings/SetIntegrationManager.tsx +++ b/src/components/views/settings/SetIntegrationManager.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../languageHandler"; import { IntegrationManagers } from "../../../integrations/IntegrationManagers"; import { IntegrationManagerInstance } from "../../../integrations/IntegrationManagerInstance"; @@ -23,8 +25,6 @@ import { SettingLevel } from "../../../settings/SettingLevel"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import ToggleSwitch from "../elements/ToggleSwitch"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { } diff --git a/src/components/views/settings/SpellCheckSettings.tsx b/src/components/views/settings/SpellCheckSettings.tsx index c653b272c8..2864be34fc 100644 --- a/src/components/views/settings/SpellCheckSettings.tsx +++ b/src/components/views/settings/SpellCheckSettings.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import SpellCheckLanguagesDropdown from "../../../components/views/elements/SpellCheckLanguagesDropdown"; import AccessibleButton from "../../../components/views/elements/AccessibleButton"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/settings/ThemeChoicePanel.tsx b/src/components/views/settings/ThemeChoicePanel.tsx index caa07bd0ad..d71b6b66ad 100644 --- a/src/components/views/settings/ThemeChoicePanel.tsx +++ b/src/components/views/settings/ThemeChoicePanel.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../languageHandler"; import SettingsStore from "../../../settings/SettingsStore"; import { enumerateThemes } from "../../../theme"; @@ -30,8 +32,6 @@ import { SettingLevel } from "../../../settings/SettingLevel"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { compare } from "../../../utils/strings"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { } diff --git a/src/components/views/settings/account/EmailAddresses.tsx b/src/components/views/settings/account/EmailAddresses.tsx index 039d20f3e8..ba725c5225 100644 --- a/src/components/views/settings/account/EmailAddresses.tsx +++ b/src/components/views/settings/account/EmailAddresses.tsx @@ -16,6 +16,9 @@ limitations under the License. */ import React from 'react'; +import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../../languageHandler"; import { MatrixClientPeg } from "../../../../MatrixClientPeg"; import Field from "../../elements/Field"; @@ -25,9 +28,6 @@ import AddThreepid from "../../../../AddThreepid"; import Modal from '../../../../Modal'; import { replaceableComponent } from "../../../../utils/replaceableComponent"; import ErrorDialog from "../../dialogs/ErrorDialog"; -import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; - -import { logger } from "matrix-js-sdk/src/logger"; /* TODO: Improve the UX for everything in here. diff --git a/src/components/views/settings/account/PhoneNumbers.tsx b/src/components/views/settings/account/PhoneNumbers.tsx index 4a380980d8..770bdb889d 100644 --- a/src/components/views/settings/account/PhoneNumbers.tsx +++ b/src/components/views/settings/account/PhoneNumbers.tsx @@ -16,6 +16,9 @@ limitations under the License. */ import React from 'react'; +import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../../languageHandler"; import { MatrixClientPeg } from "../../../../MatrixClientPeg"; import Field from "../../elements/Field"; @@ -24,12 +27,9 @@ import AddThreepid from "../../../../AddThreepid"; import CountryDropdown from "../../auth/CountryDropdown"; import Modal from '../../../../Modal'; import { replaceableComponent } from "../../../../utils/replaceableComponent"; -import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; import ErrorDialog from "../../dialogs/ErrorDialog"; import { PhoneNumberCountryDefinition } from "../../../../phonenumber"; -import { logger } from "matrix-js-sdk/src/logger"; - /* TODO: Improve the UX for everything in here. This is a copy/paste of EmailAddresses, mostly. diff --git a/src/components/views/settings/discovery/EmailAddresses.tsx b/src/components/views/settings/discovery/EmailAddresses.tsx index 48ccc13d72..316e20202e 100644 --- a/src/components/views/settings/discovery/EmailAddresses.tsx +++ b/src/components/views/settings/discovery/EmailAddresses.tsx @@ -16,18 +16,17 @@ limitations under the License. */ import React from 'react'; +import { IThreepid } from "matrix-js-sdk/src/@types/threepids"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../../languageHandler"; import { MatrixClientPeg } from "../../../../MatrixClientPeg"; import Modal from '../../../../Modal'; import AddThreepid from '../../../../AddThreepid'; import { replaceableComponent } from "../../../../utils/replaceableComponent"; -import { IThreepid } from "matrix-js-sdk/src/@types/threepids"; import ErrorDialog from "../../dialogs/ErrorDialog"; import AccessibleButton from "../../elements/AccessibleButton"; -import { logger } from "matrix-js-sdk/src/logger"; - /* TODO: Improve the UX for everything in here. It's very much placeholder, but it gets the job done. The old way of handling diff --git a/src/components/views/settings/discovery/PhoneNumbers.tsx b/src/components/views/settings/discovery/PhoneNumbers.tsx index 65ab1af28d..13bef06e4b 100644 --- a/src/components/views/settings/discovery/PhoneNumbers.tsx +++ b/src/components/views/settings/discovery/PhoneNumbers.tsx @@ -16,19 +16,18 @@ limitations under the License. */ import React from 'react'; +import { IThreepid } from "matrix-js-sdk/src/@types/threepids"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../../languageHandler"; import { MatrixClientPeg } from "../../../../MatrixClientPeg"; import Modal from '../../../../Modal'; import AddThreepid from '../../../../AddThreepid'; import { replaceableComponent } from "../../../../utils/replaceableComponent"; -import { IThreepid } from "matrix-js-sdk/src/@types/threepids"; import ErrorDialog from "../../dialogs/ErrorDialog"; import Field from "../../elements/Field"; import AccessibleButton from "../../elements/AccessibleButton"; -import { logger } from "matrix-js-sdk/src/logger"; - /* TODO: Improve the UX for everything in here. This is a copy/paste of EmailAddresses, mostly. diff --git a/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx index 1cfe023ba9..619e36df71 100644 --- a/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { ContextType } from 'react'; + import { _t } from "../../../../../languageHandler"; import RoomProfileSettings from "../../../room_settings/RoomProfileSettings"; import AccessibleButton from "../../../elements/AccessibleButton"; diff --git a/src/components/views/settings/tabs/room/NotificationSettingsTab.tsx b/src/components/views/settings/tabs/room/NotificationSettingsTab.tsx index bdc419a01a..81cfd940c9 100644 --- a/src/components/views/settings/tabs/room/NotificationSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/NotificationSettingsTab.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React, { createRef } from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../../../languageHandler"; import { MatrixClientPeg } from "../../../../../MatrixClientPeg"; import AccessibleButton from "../../../elements/AccessibleButton"; @@ -23,8 +25,6 @@ import SettingsStore from '../../../../../settings/SettingsStore'; import { SettingLevel } from "../../../../../settings/SettingLevel"; import { replaceableComponent } from "../../../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { roomId: string; } diff --git a/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx index 637215682e..a8c2ff4da5 100644 --- a/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx @@ -15,21 +15,21 @@ limitations under the License. */ import React from 'react'; +import { EventType } from "matrix-js-sdk/src/@types/event"; +import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { RoomState } from "matrix-js-sdk/src/models/room-state"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t, _td } from "../../../../../languageHandler"; import { MatrixClientPeg } from "../../../../../MatrixClientPeg"; import AccessibleButton from "../../../elements/AccessibleButton"; import Modal from "../../../../../Modal"; import { replaceableComponent } from "../../../../../utils/replaceableComponent"; -import { EventType } from "matrix-js-sdk/src/@types/event"; -import { RoomMember } from "matrix-js-sdk/src/models/room-member"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; -import { RoomState } from "matrix-js-sdk/src/models/room-state"; import { compare } from "../../../../../utils/strings"; import ErrorDialog from '../../../dialogs/ErrorDialog'; import PowerSelector from "../../../elements/PowerSelector"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IEventShowOpts { isState?: boolean; hideForSpace?: boolean; diff --git a/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx index 0242ace0a6..fad85ddfb7 100644 --- a/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx @@ -18,6 +18,7 @@ import React from 'react'; import { GuestAccess, HistoryVisibility, JoinRule, RestrictedAllowType } from "matrix-js-sdk/src/@types/partials"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { EventType } from 'matrix-js-sdk/src/@types/event'; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../../../languageHandler"; import { MatrixClientPeg } from "../../../../../MatrixClientPeg"; @@ -36,8 +37,6 @@ import CreateRoomDialog from '../../../dialogs/CreateRoomDialog'; import JoinRuleSettings from "../../JoinRuleSettings"; import ErrorDialog from "../../../dialogs/ErrorDialog"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { roomId: string; closeSettingsFn: () => void; diff --git a/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx b/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx index ed0092989b..a9a4932d3f 100644 --- a/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from "../../../../../languageHandler"; import SdkConfig from "../../../../../SdkConfig"; import { MatrixClientPeg } from '../../../../../MatrixClientPeg'; @@ -28,7 +29,6 @@ import { UIFeature } from "../../../../../settings/UIFeature"; import { Layout } from "../../../../../settings/Layout"; import { replaceableComponent } from "../../../../../utils/replaceableComponent"; import LayoutSwitcher from "../../LayoutSwitcher"; - import FontScalingPanel from '../../FontScalingPanel'; import ThemeChoicePanel from '../../ThemeChoicePanel'; diff --git a/src/components/views/settings/tabs/user/FlairUserSettingsTab.js b/src/components/views/settings/tabs/user/FlairUserSettingsTab.js index 180cb5df2c..919851e9fb 100644 --- a/src/components/views/settings/tabs/user/FlairUserSettingsTab.js +++ b/src/components/views/settings/tabs/user/FlairUserSettingsTab.js @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from "../../../../../languageHandler"; import GroupUserSettings from "../../../groups/GroupUserSettings"; import { replaceableComponent } from "../../../../../utils/replaceableComponent"; diff --git a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx index b29c6ed87f..d37f2f4c4a 100644 --- a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx @@ -17,6 +17,10 @@ limitations under the License. */ import React from 'react'; +import { SERVICE_TYPES } from "matrix-js-sdk/src/service-types"; +import { IThreepid } from "matrix-js-sdk/src/@types/threepids"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../../../languageHandler"; import ProfileSettings from "../../ProfileSettings"; import * as languageHandler from "../../../../../languageHandler"; @@ -30,7 +34,6 @@ import { MatrixClientPeg } from "../../../../../MatrixClientPeg"; import Modal from "../../../../../Modal"; import dis from "../../../../../dispatcher/dispatcher"; import { Policies, Service, startTermsFlow } from "../../../../../Terms"; -import { SERVICE_TYPES } from "matrix-js-sdk/src/service-types"; import IdentityAuthClient from "../../../../../IdentityAuthClient"; import { abbreviateUrl } from "../../../../../utils/UrlUtils"; import { getThreepidsWithBindStatus } from '../../../../../boundThreepids'; @@ -38,7 +41,6 @@ import Spinner from "../../../elements/Spinner"; import { SettingLevel } from "../../../../../settings/SettingLevel"; import { UIFeature } from "../../../../../settings/UIFeature"; import { replaceableComponent } from "../../../../../utils/replaceableComponent"; -import { IThreepid } from "matrix-js-sdk/src/@types/threepids"; import { ActionPayload } from "../../../../../dispatcher/payloads"; import ErrorDialog from "../../../dialogs/ErrorDialog"; import AccountPhoneNumbers from "../../account/PhoneNumbers"; @@ -50,8 +52,6 @@ import InlineTermsAgreement from "../../../terms/InlineTermsAgreement"; import SetIdServer from "../../SetIdServer"; import SetIntegrationManager from "../../SetIntegrationManager"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { closeSettingsFn: () => void; } diff --git a/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx b/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx index d1a515439b..cffd7c18d4 100644 --- a/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import AccessibleButton, { ButtonEvent } from "../../../elements/AccessibleButton"; import { _t, getCurrentLanguage } from "../../../../../languageHandler"; import { MatrixClientPeg } from "../../../../../MatrixClientPeg"; @@ -32,8 +34,6 @@ import { toRightOf } from "../../../../structures/ContextMenu"; import BugReportDialog from '../../../dialogs/BugReportDialog'; import GenericTextContextMenu from "../../../context_menus/GenericTextContextMenu"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { closeSettingsFn: () => void; } diff --git a/src/components/views/settings/tabs/user/LabsUserSettingsTab.tsx b/src/components/views/settings/tabs/user/LabsUserSettingsTab.tsx index d05a11483c..c9f6e66530 100644 --- a/src/components/views/settings/tabs/user/LabsUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/LabsUserSettingsTab.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from "../../../../../languageHandler"; import SettingsStore from "../../../../../settings/SettingsStore"; import LabelledToggleSwitch from "../../../elements/LabelledToggleSwitch"; diff --git a/src/components/views/settings/tabs/user/MjolnirUserSettingsTab.tsx b/src/components/views/settings/tabs/user/MjolnirUserSettingsTab.tsx index a05e2b6ee5..88000892e4 100644 --- a/src/components/views/settings/tabs/user/MjolnirUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/MjolnirUserSettingsTab.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../../../languageHandler"; import SdkConfig from "../../../../../SdkConfig"; import { Mjolnir } from "../../../../../mjolnir/Mjolnir"; @@ -28,8 +30,6 @@ import QuestionDialog from "../../../dialogs/QuestionDialog"; import AccessibleButton from "../../../elements/AccessibleButton"; import Field from "../../../elements/Field"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IState { busy: boolean; newPersonalRule: string; diff --git a/src/components/views/settings/tabs/user/NotificationUserSettingsTab.tsx b/src/components/views/settings/tabs/user/NotificationUserSettingsTab.tsx index 5717813ae1..429472c7f5 100644 --- a/src/components/views/settings/tabs/user/NotificationUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/NotificationUserSettingsTab.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from "../../../../../languageHandler"; import { replaceableComponent } from "../../../../../utils/replaceableComponent"; import Notifications from "../../Notifications"; diff --git a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx index b9753d9c86..cf184fda4f 100644 --- a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx @@ -17,6 +17,8 @@ limitations under the License. import React from 'react'; import { sleep } from "matrix-js-sdk/src/utils"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../../../languageHandler"; import SdkConfig from "../../../../../SdkConfig"; @@ -34,7 +36,6 @@ import CountlyAnalytics from "../../../../../CountlyAnalytics"; import { replaceableComponent } from "../../../../../utils/replaceableComponent"; import { PosthogAnalytics } from "../../../../../PosthogAnalytics"; import { ActionPayload } from "../../../../../dispatcher/payloads"; -import { Room } from "matrix-js-sdk/src/models/room"; import CryptographyPanel from "../../CryptographyPanel"; import DevicesPanel from "../../DevicesPanel"; import SettingsFlag from "../../../elements/SettingsFlag"; @@ -42,8 +43,6 @@ import CrossSigningPanel from "../../CrossSigningPanel"; import EventIndexPanel from "../../EventIndexPanel"; import InlineSpinner from "../../../elements/InlineSpinner"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IIgnoredUserProps { userId: string; onUnignored: (userId: string) => void; diff --git a/src/components/views/settings/tabs/user/VoiceUserSettingsTab.tsx b/src/components/views/settings/tabs/user/VoiceUserSettingsTab.tsx index 1e196aa362..b187e300a2 100644 --- a/src/components/views/settings/tabs/user/VoiceUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/VoiceUserSettingsTab.tsx @@ -16,6 +16,8 @@ limitations under the License. */ import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../../../languageHandler"; import SdkConfig from "../../../../../SdkConfig"; import MediaDeviceHandler, { IMediaDevices, MediaDeviceKindEnum } from "../../../../../MediaDeviceHandler"; @@ -28,8 +30,6 @@ import { replaceableComponent } from "../../../../../utils/replaceableComponent" import SettingsFlag from '../../../elements/SettingsFlag'; import ErrorDialog from '../../../dialogs/ErrorDialog'; -import { logger } from "matrix-js-sdk/src/logger"; - const getDefaultDevice = (devices: Array>) => { // Note we're looking for a device with deviceId 'default' but adding a device // with deviceId == the empty string: this is because Chrome gives us a device diff --git a/src/components/views/spaces/SpaceCreateMenu.tsx b/src/components/views/spaces/SpaceCreateMenu.tsx index 5ec44e970b..bd0cf7a762 100644 --- a/src/components/views/spaces/SpaceCreateMenu.tsx +++ b/src/components/views/spaces/SpaceCreateMenu.tsx @@ -19,6 +19,7 @@ import classNames from "classnames"; import { RoomType } from "matrix-js-sdk/src/@types/event"; import { ICreateRoomOpts } from "matrix-js-sdk/src/@types/requests"; import { HistoryVisibility, Preset } from "matrix-js-sdk/src/@types/partials"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../languageHandler"; import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; @@ -39,8 +40,6 @@ import { Action } from "../../../dispatcher/actions"; import { UserTab } from "../dialogs/UserSettingsDialog"; import { Key } from "../../../Keyboard"; -import { logger } from "matrix-js-sdk/src/logger"; - export const createSpace = async ( name: string, isPublic: boolean, diff --git a/src/components/views/spaces/SpaceSettingsGeneralTab.tsx b/src/components/views/spaces/SpaceSettingsGeneralTab.tsx index 865df03f66..4752c0f6db 100644 --- a/src/components/views/spaces/SpaceSettingsGeneralTab.tsx +++ b/src/components/views/spaces/SpaceSettingsGeneralTab.tsx @@ -18,6 +18,7 @@ import React, { useState } from "react"; import { Room } from "matrix-js-sdk/src/models/room"; import { MatrixClient } from "matrix-js-sdk/src/client"; import { EventType } from "matrix-js-sdk/src/@types/event"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../languageHandler"; import AccessibleButton from "../elements/AccessibleButton"; @@ -27,8 +28,6 @@ import { IDialogProps } from "../dialogs/IDialogProps"; import { getTopic } from "../elements/RoomTopic"; import { leaveSpace } from "../../../utils/space"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps extends IDialogProps { matrixClient: MatrixClient; space: Room; diff --git a/src/components/views/spaces/SpaceTreeLevel.tsx b/src/components/views/spaces/SpaceTreeLevel.tsx index ba2af3b857..c2c4e9804c 100644 --- a/src/components/views/spaces/SpaceTreeLevel.tsx +++ b/src/components/views/spaces/SpaceTreeLevel.tsx @@ -24,6 +24,7 @@ import React, { } from "react"; import classNames from "classnames"; import { Room } from "matrix-js-sdk/src/models/room"; +import { DraggableProvidedDragHandleProps } from "react-beautiful-dnd"; import RoomAvatar from "../avatars/RoomAvatar"; import SpaceStore from "../../../stores/SpaceStore"; @@ -40,7 +41,6 @@ import { getKeyBindingsManager, RoomListAction } from "../../../KeyBindingsManag import { NotificationState } from "../../../stores/notifications/NotificationState"; import SpaceContextMenu from "../context_menus/SpaceContextMenu"; import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; -import { DraggableProvidedDragHandleProps } from "react-beautiful-dnd"; import { useRovingTabIndex } from "../../../accessibility/RovingTabIndex"; interface IButtonProps extends Omit, "title"> { diff --git a/src/components/views/terms/InlineTermsAgreement.tsx b/src/components/views/terms/InlineTermsAgreement.tsx index 80ccf49ee9..f6743044a3 100644 --- a/src/components/views/terms/InlineTermsAgreement.tsx +++ b/src/components/views/terms/InlineTermsAgreement.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { _t, pickBestLanguage } from "../../../languageHandler"; import * as sdk from "../../.."; import { objectClone } from "../../../utils/objects"; diff --git a/src/components/views/toasts/GenericToast.tsx b/src/components/views/toasts/GenericToast.tsx index 4738e38c0d..92eec4fada 100644 --- a/src/components/views/toasts/GenericToast.tsx +++ b/src/components/views/toasts/GenericToast.tsx @@ -15,8 +15,8 @@ limitations under the License. */ import React, { ReactNode } from "react"; -import AccessibleButton from "../elements/AccessibleButton"; +import AccessibleButton from "../elements/AccessibleButton"; import { XOR } from "../../../@types/common"; export interface IProps { diff --git a/src/components/views/toasts/NonUrgentEchoFailureToast.tsx b/src/components/views/toasts/NonUrgentEchoFailureToast.tsx index 9d69922678..91407a4fa5 100644 --- a/src/components/views/toasts/NonUrgentEchoFailureToast.tsx +++ b/src/components/views/toasts/NonUrgentEchoFailureToast.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { _t } from "../../../languageHandler"; import AccessibleButton from "../elements/AccessibleButton"; import Modal from "../../../Modal"; diff --git a/src/components/views/toasts/VerificationRequestToast.tsx b/src/components/views/toasts/VerificationRequestToast.tsx index c1f1050bc9..71f4e7dc74 100644 --- a/src/components/views/toasts/VerificationRequestToast.tsx +++ b/src/components/views/toasts/VerificationRequestToast.tsx @@ -15,6 +15,9 @@ limitations under the License. */ import React from "react"; +import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { DeviceInfo } from "matrix-js-sdk/src/crypto/deviceinfo"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; @@ -25,14 +28,10 @@ import dis from "../../../dispatcher/dispatcher"; import ToastStore from "../../../stores/ToastStore"; import Modal from "../../../Modal"; import GenericToast from "./GenericToast"; -import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; -import { DeviceInfo } from "matrix-js-sdk/src/crypto/deviceinfo"; import { Action } from "../../../dispatcher/actions"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import VerificationRequestDialog from "../dialogs/VerificationRequestDialog"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { toastKey: string; request: VerificationRequest; diff --git a/src/components/views/verification/VerificationCancelled.tsx b/src/components/views/verification/VerificationCancelled.tsx index c8c068f5eb..2a2fa0426f 100644 --- a/src/components/views/verification/VerificationCancelled.tsx +++ b/src/components/views/verification/VerificationCancelled.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/verification/VerificationComplete.tsx b/src/components/views/verification/VerificationComplete.tsx index 99cbab8d73..731ffc54fd 100644 --- a/src/components/views/verification/VerificationComplete.tsx +++ b/src/components/views/verification/VerificationComplete.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/verification/VerificationShowSas.tsx b/src/components/views/verification/VerificationShowSas.tsx index fde79ea91e..7965a12cef 100644 --- a/src/components/views/verification/VerificationShowSas.tsx +++ b/src/components/views/verification/VerificationShowSas.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import { IGeneratedSas } from "matrix-js-sdk/src/crypto/verification/SAS"; import { DeviceInfo } from "matrix-js-sdk/src//crypto/deviceinfo"; + import { _t, _td } from '../../../languageHandler'; import { PendingActionSpinner } from "../right_panel/EncryptionInfo"; import AccessibleButton from "../elements/AccessibleButton"; diff --git a/src/components/views/voip/AudioFeed.tsx b/src/components/views/voip/AudioFeed.tsx index 751ae6b96e..944ea3ad00 100644 --- a/src/components/views/voip/AudioFeed.tsx +++ b/src/components/views/voip/AudioFeed.tsx @@ -17,6 +17,7 @@ limitations under the License. import React, { createRef } from 'react'; import { CallFeed, CallFeedEvent } from 'matrix-js-sdk/src/webrtc/callFeed'; import { logger } from 'matrix-js-sdk/src/logger'; + import MediaDeviceHandler, { MediaDeviceHandlerEvent } from "../../../MediaDeviceHandler"; interface IProps { diff --git a/src/components/views/voip/AudioFeedArrayForCall.tsx b/src/components/views/voip/AudioFeedArrayForCall.tsx index a7dd0283ff..baf68cd01a 100644 --- a/src/components/views/voip/AudioFeedArrayForCall.tsx +++ b/src/components/views/voip/AudioFeedArrayForCall.tsx @@ -15,10 +15,11 @@ limitations under the License. */ import React from "react"; -import AudioFeed from "./AudioFeed"; import { CallEvent, MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import { CallFeed } from "matrix-js-sdk/src/webrtc/callFeed"; +import AudioFeed from "./AudioFeed"; + interface IProps { call: MatrixCall; } diff --git a/src/components/views/voip/CallContainer.tsx b/src/components/views/voip/CallContainer.tsx index 41046b9952..1bf3625f5a 100644 --- a/src/components/views/voip/CallContainer.tsx +++ b/src/components/views/voip/CallContainer.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; + import CallPreview from './CallPreview'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/voip/CallPreview.tsx b/src/components/views/voip/CallPreview.tsx index 266c34083e..5cd1363ed9 100644 --- a/src/components/views/voip/CallPreview.tsx +++ b/src/components/views/voip/CallPreview.tsx @@ -16,6 +16,9 @@ limitations under the License. */ import React from 'react'; +import { CallEvent, CallState, MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; +import { EventSubscription } from 'fbemitter'; +import { logger } from "matrix-js-sdk/src/logger"; import CallView from "./CallView"; import RoomViewStore from '../../../stores/RoomViewStore'; @@ -24,14 +27,10 @@ import dis from '../../../dispatcher/dispatcher'; import { ActionPayload } from '../../../dispatcher/payloads'; import PersistentApp from "../elements/PersistentApp"; import SettingsStore from "../../../settings/SettingsStore"; -import { CallEvent, CallState, MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { EventSubscription } from 'fbemitter'; import PictureInPictureDragger from './PictureInPictureDragger'; -import { logger } from "matrix-js-sdk/src/logger"; - const SHOW_CALL_IN_STATES = [ CallState.Connected, CallState.InviteSent, diff --git a/src/components/views/voip/CallView.tsx b/src/components/views/voip/CallView.tsx index 11206602c7..261260f429 100644 --- a/src/components/views/voip/CallView.tsx +++ b/src/components/views/voip/CallView.tsx @@ -17,22 +17,23 @@ limitations under the License. */ import React, { createRef, CSSProperties } from 'react'; +import { CallEvent, CallState, CallType, MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; +import classNames from 'classnames'; +import { CallFeed } from 'matrix-js-sdk/src/webrtc/callFeed'; +import { SDPStreamMetadataPurpose } from 'matrix-js-sdk/src/webrtc/callEventTypes'; + import dis from '../../../dispatcher/dispatcher'; import CallHandler from '../../../CallHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t, _td } from '../../../languageHandler'; import VideoFeed from './VideoFeed'; import RoomAvatar from "../avatars/RoomAvatar"; -import { CallEvent, CallState, CallType, MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; -import classNames from 'classnames'; import AccessibleButton from '../elements/AccessibleButton'; import { isOnlyCtrlOrCmdKeyEvent, Key } from '../../../Keyboard'; import { avatarUrlForMember } from '../../../Avatar'; -import { CallFeed } from 'matrix-js-sdk/src/webrtc/callFeed'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import DesktopCapturerSourcePicker from "../elements/DesktopCapturerSourcePicker"; import Modal from '../../../Modal'; -import { SDPStreamMetadataPurpose } from 'matrix-js-sdk/src/webrtc/callEventTypes'; import CallViewSidebar from './CallViewSidebar'; import CallViewHeader from './CallView/CallViewHeader'; import CallViewButtons from "./CallView/CallViewButtons"; diff --git a/src/components/views/voip/CallView/CallViewButtons.tsx b/src/components/views/voip/CallView/CallViewButtons.tsx index 466311f421..4afded51ac 100644 --- a/src/components/views/voip/CallView/CallViewButtons.tsx +++ b/src/components/views/voip/CallView/CallViewButtons.tsx @@ -18,10 +18,11 @@ limitations under the License. import React, { createRef } from "react"; import classNames from "classnames"; +import { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; + import AccessibleTooltipButton from "../../elements/AccessibleTooltipButton"; import CallContextMenu from "../../context_menus/CallContextMenu"; import DialpadContextMenu from "../../context_menus/DialpadContextMenu"; -import { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import { Alignment } from "../../elements/Tooltip"; import { alwaysAboveLeftOf, diff --git a/src/components/views/voip/CallView/CallViewHeader.tsx b/src/components/views/voip/CallView/CallViewHeader.tsx index d9a49e5010..87e14e9c6b 100644 --- a/src/components/views/voip/CallView/CallViewHeader.tsx +++ b/src/components/views/voip/CallView/CallViewHeader.tsx @@ -17,11 +17,12 @@ limitations under the License. import { CallType } from 'matrix-js-sdk/src/webrtc/call'; import { Room } from 'matrix-js-sdk/src/models/room'; import React from 'react'; +import classNames from 'classnames'; + import { _t, _td } from '../../../../languageHandler'; import RoomAvatar from '../../avatars/RoomAvatar'; import AccessibleButton from '../../elements/AccessibleButton'; import dis from '../../../../dispatcher/dispatcher'; -import classNames from 'classnames'; import AccessibleTooltipButton from '../../elements/AccessibleTooltipButton'; const callTypeTranslationByType: Record = { diff --git a/src/components/views/voip/CallViewForRoom.tsx b/src/components/views/voip/CallViewForRoom.tsx index b0a6f17095..e1b4eee879 100644 --- a/src/components/views/voip/CallViewForRoom.tsx +++ b/src/components/views/voip/CallViewForRoom.tsx @@ -16,10 +16,11 @@ limitations under the License. import { CallState, MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; import React from 'react'; +import { Resizable } from "re-resizable"; + import CallHandler, { CallHandlerEvent } from '../../../CallHandler'; import CallView from './CallView'; import dis from '../../../dispatcher/dispatcher'; -import { Resizable } from "re-resizable"; import ResizeNotifier from "../../../utils/ResizeNotifier"; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/voip/CallViewSidebar.tsx b/src/components/views/voip/CallViewSidebar.tsx index a0cb25b3df..e1c74b0d15 100644 --- a/src/components/views/voip/CallViewSidebar.tsx +++ b/src/components/views/voip/CallViewSidebar.tsx @@ -17,9 +17,10 @@ limitations under the License. import React from "react"; import { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import { CallFeed } from "matrix-js-sdk/src/webrtc/callFeed"; -import VideoFeed from "./VideoFeed"; import classNames from "classnames"; +import VideoFeed from "./VideoFeed"; + interface IProps { feeds: Array; call: MatrixCall; diff --git a/src/components/views/voip/DialPad.tsx b/src/components/views/voip/DialPad.tsx index 46584e0870..6b8f013297 100644 --- a/src/components/views/voip/DialPad.tsx +++ b/src/components/views/voip/DialPad.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import * as React from "react"; + import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/voip/DialPadModal.tsx b/src/components/views/voip/DialPadModal.tsx index 4d69260565..cbef7bbf60 100644 --- a/src/components/views/voip/DialPadModal.tsx +++ b/src/components/views/voip/DialPadModal.tsx @@ -16,6 +16,7 @@ limitations under the License. import * as React from "react"; import { createRef } from "react"; + import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; import Field from "../elements/Field"; import DialPad from './DialPad'; diff --git a/src/components/views/voip/PictureInPictureDragger.tsx b/src/components/views/voip/PictureInPictureDragger.tsx index 23a09b20d8..117927d11e 100644 --- a/src/components/views/voip/PictureInPictureDragger.tsx +++ b/src/components/views/voip/PictureInPictureDragger.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { createRef } from 'react'; + import UIStore from '../../../stores/UIStore'; import { lerp } from '../../../utils/AnimationUtils'; import { MarkedExecution } from '../../../utils/MarkedExecution'; diff --git a/src/components/views/voip/VideoFeed.tsx b/src/components/views/voip/VideoFeed.tsx index 13461c3591..71c5629537 100644 --- a/src/components/views/voip/VideoFeed.tsx +++ b/src/components/views/voip/VideoFeed.tsx @@ -17,12 +17,13 @@ limitations under the License. import classnames from 'classnames'; import { MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; import React from 'react'; -import SettingsStore from "../../../settings/SettingsStore"; import { CallFeed, CallFeedEvent } from 'matrix-js-sdk/src/webrtc/callFeed'; import { logger } from 'matrix-js-sdk/src/logger'; +import { SDPStreamMetadataPurpose } from 'matrix-js-sdk/src/webrtc/callEventTypes'; + +import SettingsStore from "../../../settings/SettingsStore"; import MemberAvatar from "../avatars/MemberAvatar"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { SDPStreamMetadataPurpose } from 'matrix-js-sdk/src/webrtc/callEventTypes'; interface IProps { call: MatrixCall; diff --git a/src/createRoom.ts b/src/createRoom.ts index 6394cb6849..7841c8bd5f 100644 --- a/src/createRoom.ts +++ b/src/createRoom.ts @@ -27,6 +27,7 @@ import { RestrictedAllowType, Visibility, } from "matrix-js-sdk/src/@types/partials"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from './MatrixClientPeg'; import Modal from './Modal'; @@ -46,8 +47,6 @@ import { Action } from "./dispatcher/actions"; import ErrorDialog from "./components/views/dialogs/ErrorDialog"; import Spinner from "./components/views/elements/Spinner"; -import { logger } from "matrix-js-sdk/src/logger"; - // we define a number of interfaces which take their names from the js-sdk /* eslint-disable camelcase */ diff --git a/src/customisations/Security.ts b/src/customisations/Security.ts index 9083274aa5..d298964dc1 100644 --- a/src/customisations/Security.ts +++ b/src/customisations/Security.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { ISecretStorageKeyInfo } from 'matrix-js-sdk/src/crypto/api'; + import { IMatrixClientCreds } from "../MatrixClientPeg"; import { Kind as SetupEncryptionKind } from "../toasts/SetupEncryptionToast"; -import { ISecretStorageKeyInfo } from 'matrix-js-sdk/src/crypto/api'; /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ function examineLoginResponse( diff --git a/src/dispatcher/dispatch-actions/threads.ts b/src/dispatcher/dispatch-actions/threads.ts index 31d5ba5bf7..288916eb42 100644 --- a/src/dispatcher/dispatch-actions/threads.ts +++ b/src/dispatcher/dispatch-actions/threads.ts @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { RightPanelPhases } from "../../stores/RightPanelStorePhases"; import { Action } from "../actions"; import dis from '../dispatcher'; diff --git a/src/dispatcher/dispatcher.ts b/src/dispatcher/dispatcher.ts index 4d8df1ecaa..15e2f8f9bc 100644 --- a/src/dispatcher/dispatcher.ts +++ b/src/dispatcher/dispatcher.ts @@ -17,6 +17,7 @@ limitations under the License. */ import { Dispatcher } from "flux"; + import { Action } from "./actions"; import { ActionPayload, AsyncActionPayload } from "./payloads"; diff --git a/src/dispatcher/payloads/AfterRightPanelPhaseChangePayload.ts b/src/dispatcher/payloads/AfterRightPanelPhaseChangePayload.ts index cfd4a2d3cc..b45b8bdebe 100644 --- a/src/dispatcher/payloads/AfterRightPanelPhaseChangePayload.ts +++ b/src/dispatcher/payloads/AfterRightPanelPhaseChangePayload.ts @@ -14,11 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; + import { RightPanelPhases } from "../../stores/RightPanelStorePhases"; import { SetRightPanelPhaseRefireParams } from "./SetRightPanelPhasePayload"; import { ActionPayload } from "../payloads"; import { Action } from "../actions"; -import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; interface AfterRightPanelPhaseChangeAction extends ActionPayload { action: Action.AfterRightPanelPhaseChange; diff --git a/src/dispatcher/payloads/SetRightPanelPhasePayload.ts b/src/dispatcher/payloads/SetRightPanelPhasePayload.ts index ea997e4ed1..54a00e0279 100644 --- a/src/dispatcher/payloads/SetRightPanelPhasePayload.ts +++ b/src/dispatcher/payloads/SetRightPanelPhasePayload.ts @@ -18,6 +18,7 @@ import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/reque import { Room } from "matrix-js-sdk/src/models/room"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { User } from "matrix-js-sdk/src/models/user"; + import { RightPanelPhases } from "../../stores/RightPanelStorePhases"; import { ActionPayload } from "../payloads"; import { Action } from "../actions"; diff --git a/src/dispatcher/payloads/TransferCallPayload.ts b/src/dispatcher/payloads/TransferCallPayload.ts index 38431bb0d6..7a05d212ce 100644 --- a/src/dispatcher/payloads/TransferCallPayload.ts +++ b/src/dispatcher/payloads/TransferCallPayload.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; + import { ActionPayload } from "../payloads"; import { Action } from "../actions"; -import { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; export interface TransferCallPayload extends ActionPayload { action: Action.TransferCallToMatrixID | Action.TransferCallToPhoneNumber; diff --git a/src/dispatcher/payloads/ViewUserPayload.ts b/src/dispatcher/payloads/ViewUserPayload.ts index c4d73aea6a..20df21beb4 100644 --- a/src/dispatcher/payloads/ViewUserPayload.ts +++ b/src/dispatcher/payloads/ViewUserPayload.ts @@ -16,6 +16,7 @@ limitations under the License. import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { User } from "matrix-js-sdk/src/models/user"; + import { ActionPayload } from "../payloads"; import { Action } from "../actions"; diff --git a/src/editor/serialize.ts b/src/editor/serialize.ts index 9822046a0d..ed77c733bd 100644 --- a/src/editor/serialize.ts +++ b/src/editor/serialize.ts @@ -15,13 +15,14 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { AllHtmlEntities } from 'html-entities'; +import cheerio from 'cheerio'; + import Markdown from '../Markdown'; import { makeGenericPermalink } from "../utils/permalinks/Permalinks"; import EditorModel from "./model"; -import { AllHtmlEntities } from 'html-entities'; import SettingsStore from '../settings/SettingsStore'; import SdkConfig from '../SdkConfig'; -import cheerio from 'cheerio'; import { Type } from './parts'; export function mdSerialize(model: EditorModel): string { diff --git a/src/emojipicker/recent.ts b/src/emojipicker/recent.ts index 84fbf34616..026f9f85fa 100644 --- a/src/emojipicker/recent.ts +++ b/src/emojipicker/recent.ts @@ -15,8 +15,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import SettingsStore from "../settings/SettingsStore"; import { orderBy } from "lodash"; + +import SettingsStore from "../settings/SettingsStore"; import { SettingLevel } from "../settings/SettingLevel"; interface ILegacyFormat { diff --git a/src/hooks/useDispatcher.ts b/src/hooks/useDispatcher.ts index a8b36db2fd..13ee96227a 100644 --- a/src/hooks/useDispatcher.ts +++ b/src/hooks/useDispatcher.ts @@ -15,9 +15,9 @@ limitations under the License. */ import { useEffect, useRef } from "react"; +import { Dispatcher } from "flux"; import { ActionPayload } from "../dispatcher/payloads"; -import { Dispatcher } from "flux"; // Hook to simplify listening to flux dispatches export const useDispatcher = (dispatcher: Dispatcher, handler: (payload: ActionPayload) => void) => { diff --git a/src/hooks/useEventEmitter.ts b/src/hooks/useEventEmitter.ts index 693eebc0e3..92de5ae3f4 100644 --- a/src/hooks/useEventEmitter.ts +++ b/src/hooks/useEventEmitter.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { useRef, useEffect, useState, useCallback } from "react"; + import type { EventEmitter } from "events"; type Handler = (...args: any[]) => void; diff --git a/src/hooks/useRoomMembers.ts b/src/hooks/useRoomMembers.ts index bd52913a86..be770c09af 100644 --- a/src/hooks/useRoomMembers.ts +++ b/src/hooks/useRoomMembers.ts @@ -17,9 +17,9 @@ limitations under the License. import { useState } from "react"; import { Room } from "matrix-js-sdk/src/models/room"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { throttle } from "lodash"; import { useEventEmitter } from "./useEventEmitter"; -import { throttle } from "lodash"; // Hook to simplify watching Matrix Room joined members export const useRoomMembers = (room: Room, throttleWait = 250) => { diff --git a/src/hooks/useSettings.ts b/src/hooks/useSettings.ts index e21c2cbfa8..ab0c7284ef 100644 --- a/src/hooks/useSettings.ts +++ b/src/hooks/useSettings.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { useEffect, useState } from "react"; + import SettingsStore from '../settings/SettingsStore'; // Hook to fetch the value of a setting and dynamically update when it changes diff --git a/src/index.ts b/src/index.ts index 2c88265438..f78f25914b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -17,6 +17,10 @@ limitations under the License. import Skinner, { ISkinObject } from './Skinner'; +// Import the js-sdk so the proper `request` object can be set. This does some +// magic with the browser injection to make all subsequent imports work fine. +import "matrix-js-sdk"; + export function loadSkin(skinObject: ISkinObject): void { Skinner.load(skinObject); } @@ -29,7 +33,3 @@ export function getComponent(componentName: string): any { return Skinner.getComponent(componentName); } -// Import the js-sdk so the proper `request` object can be set. This does some -// magic with the browser injection to make all subsequent imports work fine. -import "matrix-js-sdk"; - diff --git a/src/indexing/EventIndex.ts b/src/indexing/EventIndex.ts index ad715e09cc..ebee683467 100644 --- a/src/indexing/EventIndex.ts +++ b/src/indexing/EventIndex.ts @@ -24,6 +24,7 @@ import { RoomState } from 'matrix-js-sdk/src/models/room-state'; import { TimelineIndex, TimelineWindow } from 'matrix-js-sdk/src/timeline-window'; import { sleep } from "matrix-js-sdk/src/utils"; import { IResultRoomEvents } from "matrix-js-sdk/src/@types/search"; +import { logger } from "matrix-js-sdk/src/logger"; import PlatformPeg from "../PlatformPeg"; import { MatrixClientPeg } from "../MatrixClientPeg"; @@ -31,8 +32,6 @@ import SettingsStore from "../settings/SettingsStore"; import { SettingLevel } from "../settings/SettingLevel"; import { ICrawlerCheckpoint, ILoadArgs, ISearchArgs } from "./BaseEventIndexManager"; -import { logger } from "matrix-js-sdk/src/logger"; - // The time in ms that the crawler will wait loop iterations if there // have not been any checkpoints to consume in the last iteration. const CRAWLER_IDLE_TIME = 5000; diff --git a/src/indexing/EventIndexPeg.ts b/src/indexing/EventIndexPeg.ts index acfdc6525f..94948258a0 100644 --- a/src/indexing/EventIndexPeg.ts +++ b/src/indexing/EventIndexPeg.ts @@ -19,14 +19,14 @@ limitations under the License. * platform supports event indexing. */ +import { logger } from "matrix-js-sdk/src/logger"; + import PlatformPeg from "../PlatformPeg"; import EventIndex from "../indexing/EventIndex"; import { MatrixClientPeg } from "../MatrixClientPeg"; import SettingsStore from '../settings/SettingsStore'; import { SettingLevel } from "../settings/SettingLevel"; -import { logger } from "matrix-js-sdk/src/logger"; - const INDEX_VERSION = 1; export class EventIndexPeg { diff --git a/src/integrations/IntegrationManagerInstance.ts b/src/integrations/IntegrationManagerInstance.ts index 51376ae290..440720b749 100644 --- a/src/integrations/IntegrationManagerInstance.ts +++ b/src/integrations/IntegrationManagerInstance.ts @@ -14,18 +14,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { Room } from "matrix-js-sdk/src/models/room"; +import url from 'url'; +import { logger } from "matrix-js-sdk/src/logger"; +import type { Room } from "matrix-js-sdk/src/models/room"; import ScalarAuthClient from "../ScalarAuthClient"; import { dialogTermsInteractionCallback, TermsNotSignedError } from "../Terms"; import Modal from '../Modal'; -import url from 'url'; import SettingsStore from "../settings/SettingsStore"; import IntegrationManager from "../components/views/settings/IntegrationManager"; import { IntegrationManagers } from "./IntegrationManagers"; -import { logger } from "matrix-js-sdk/src/logger"; - export enum Kind { Account = "account", Config = "config", diff --git a/src/integrations/IntegrationManagers.ts b/src/integrations/IntegrationManagers.ts index 051b19279d..1ac39ff86d 100644 --- a/src/integrations/IntegrationManagers.ts +++ b/src/integrations/IntegrationManagers.ts @@ -14,10 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ +import url from 'url'; +import { logger } from "matrix-js-sdk/src/logger"; + import type { MatrixClient } from "matrix-js-sdk/src/client"; import type { MatrixEvent } from "matrix-js-sdk/src/models/event"; import type { Room } from "matrix-js-sdk/src/models/room"; - import SdkConfig from '../SdkConfig'; import Modal from '../Modal'; import { IntegrationManagerInstance, Kind } from "./IntegrationManagerInstance"; @@ -27,11 +29,8 @@ import IntegrationsDisabledDialog from "../components/views/dialogs/Integrations import WidgetUtils from "../utils/WidgetUtils"; import { MatrixClientPeg } from "../MatrixClientPeg"; import SettingsStore from "../settings/SettingsStore"; -import url from 'url'; import { compare } from "../utils/strings"; -import { logger } from "matrix-js-sdk/src/logger"; - const KIND_PREFERENCE = [ // Ordered: first is most preferred, last is least preferred. Kind.Account, diff --git a/src/languageHandler.tsx b/src/languageHandler.tsx index 63804b2a2c..15539eced4 100644 --- a/src/languageHandler.tsx +++ b/src/languageHandler.tsx @@ -20,16 +20,16 @@ limitations under the License. import request from 'browser-request'; import counterpart from 'counterpart'; import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; import SettingsStore from "./settings/SettingsStore"; import PlatformPeg from "./PlatformPeg"; // @ts-ignore - $webapp is a webpack resolve alias pointing to the output directory, see webpack config -import webpackLangJsonUrl from "$webapp/i18n/languages.json"; import { SettingLevel } from "./settings/SettingLevel"; import { retry } from "./utils/promise"; -import { logger } from "matrix-js-sdk/src/logger"; +import webpackLangJsonUrl from "$webapp/i18n/languages.json"; const i18nFolder = 'i18n/'; diff --git a/src/mjolnir/Mjolnir.ts b/src/mjolnir/Mjolnir.ts index c1f17e1a4f..7da37fbc10 100644 --- a/src/mjolnir/Mjolnir.ts +++ b/src/mjolnir/Mjolnir.ts @@ -15,17 +15,17 @@ limitations under the License. */ import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { Preset } from "matrix-js-sdk/src/@types/partials"; +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from "../MatrixClientPeg"; import { ALL_RULE_TYPES, BanList } from "./BanList"; import SettingsStore from "../settings/SettingsStore"; import { _t } from "../languageHandler"; import dis from "../dispatcher/dispatcher"; import { SettingLevel } from "../settings/SettingLevel"; -import { Preset } from "matrix-js-sdk/src/@types/partials"; import { ActionPayload } from "../dispatcher/payloads"; -import { logger } from "matrix-js-sdk/src/logger"; - // TODO: Move this and related files to the js-sdk or something once finalized. export class Mjolnir { diff --git a/src/notifications/ContentRules.ts b/src/notifications/ContentRules.ts index 2b45065568..244657b620 100644 --- a/src/notifications/ContentRules.ts +++ b/src/notifications/ContentRules.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { PushRuleVectorState, VectorState } from "./PushRuleVectorState"; import { IAnnotatedPushRule, IPushRules, PushRuleKind } from "matrix-js-sdk/src/@types/PushRules"; +import { PushRuleVectorState, VectorState } from "./PushRuleVectorState"; + export interface IContentRules { vectorState: VectorState; rules: IAnnotatedPushRule[]; diff --git a/src/notifications/PushRuleVectorState.ts b/src/notifications/PushRuleVectorState.ts index 34f7dcf786..23b3594310 100644 --- a/src/notifications/PushRuleVectorState.ts +++ b/src/notifications/PushRuleVectorState.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { IPushRule } from "matrix-js-sdk/src/@types/PushRules"; + import { StandardActions } from "./StandardActions"; import { NotificationUtils } from "./NotificationUtils"; -import { IPushRule } from "matrix-js-sdk/src/@types/PushRules"; export enum VectorState { /** The push rule is disabled */ diff --git a/src/notifications/VectorPushRulesDefinitions.ts b/src/notifications/VectorPushRulesDefinitions.ts index 772a7a62ab..4a5bcc4e59 100644 --- a/src/notifications/VectorPushRulesDefinitions.ts +++ b/src/notifications/VectorPushRulesDefinitions.ts @@ -14,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { PushRuleAction, PushRuleKind } from "matrix-js-sdk/src/@types/PushRules"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _td } from '../languageHandler'; import { StandardActions } from "./StandardActions"; import { PushRuleVectorState, VectorState } from "./PushRuleVectorState"; import { NotificationUtils } from "./NotificationUtils"; -import { PushRuleAction, PushRuleKind } from "matrix-js-sdk/src/@types/PushRules"; - -import { logger } from "matrix-js-sdk/src/logger"; type StateToActionsMap = { [state in VectorState]?: PushRuleAction[]; diff --git a/src/performance/index.ts b/src/performance/index.ts index d2330dfb75..ad523f0c64 100644 --- a/src/performance/index.ts +++ b/src/performance/index.ts @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { PerformanceEntryNames } from "./entry-names"; - import { logger } from "matrix-js-sdk/src/logger"; +import { PerformanceEntryNames } from "./entry-names"; + interface GetEntriesOptions { name?: string; type?: string; diff --git a/src/rageshake/submit-rageshake.ts b/src/rageshake/submit-rageshake.ts index 11f19a1ad2..b87b026581 100644 --- a/src/rageshake/submit-rageshake.ts +++ b/src/rageshake/submit-rageshake.ts @@ -17,19 +17,16 @@ limitations under the License. */ import pako from 'pako'; +import Tar from "tar-js"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from '../MatrixClientPeg'; import PlatformPeg from '../PlatformPeg'; import { _t } from '../languageHandler'; -import Tar from "tar-js"; - import * as rageshake from './rageshake'; - import SettingsStore from "../settings/SettingsStore"; import SdkConfig from "../SdkConfig"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IOpts { label?: string; userText?: string; diff --git a/src/sentry.ts b/src/sentry.ts index cfb0da324a..005f853f24 100644 --- a/src/sentry.ts +++ b/src/sentry.ts @@ -15,10 +15,11 @@ limitations under the License. */ import * as Sentry from "@sentry/browser"; +import { MatrixClient } from "matrix-js-sdk/src/client"; + import SdkConfig from "./SdkConfig"; import { MatrixClientPeg } from "./MatrixClientPeg"; import SettingsStore from "./settings/SettingsStore"; -import { MatrixClient } from "matrix-js-sdk/src/client"; /* eslint-disable camelcase */ diff --git a/src/settings/SettingsStore.ts b/src/settings/SettingsStore.ts index 1222ca9231..40d41b4f9f 100644 --- a/src/settings/SettingsStore.ts +++ b/src/settings/SettingsStore.ts @@ -15,6 +15,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { logger } from "matrix-js-sdk/src/logger"; + import DeviceSettingsHandler from "./handlers/DeviceSettingsHandler"; import RoomDeviceSettingsHandler from "./handlers/RoomDeviceSettingsHandler"; import DefaultSettingsHandler from "./handlers/DefaultSettingsHandler"; @@ -32,8 +34,6 @@ import SettingsHandler from "./handlers/SettingsHandler"; import { SettingUpdatedPayload } from "../dispatcher/payloads/SettingUpdatedPayload"; import { Action } from "../dispatcher/actions"; -import { logger } from "matrix-js-sdk/src/logger"; - const defaultWatchManager = new WatchManager(); // Convert the settings to easier to manage objects for the handlers diff --git a/src/settings/controllers/NotificationControllers.ts b/src/settings/controllers/NotificationControllers.ts index a7114325ae..15e5b85733 100644 --- a/src/settings/controllers/NotificationControllers.ts +++ b/src/settings/controllers/NotificationControllers.ts @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { PushProcessor } from "matrix-js-sdk/src/pushprocessor"; +import { PushRuleActionName } from "matrix-js-sdk/src/@types/PushRules"; +import { logger } from "matrix-js-sdk/src/logger"; + import SettingController from "./SettingController"; import { MatrixClientPeg } from '../../MatrixClientPeg'; import { SettingLevel } from "../SettingLevel"; // XXX: This feels wrong. -import { PushProcessor } from "matrix-js-sdk/src/pushprocessor"; -import { PushRuleActionName } from "matrix-js-sdk/src/@types/PushRules"; - -import { logger } from "matrix-js-sdk/src/logger"; // .m.rule.master being enabled means all events match that push rule // default action on this rule is dont_notify, but it could be something else diff --git a/src/settings/handlers/AccountSettingsHandler.ts b/src/settings/handlers/AccountSettingsHandler.ts index 9ae3176fb8..1f3de86c16 100644 --- a/src/settings/handlers/AccountSettingsHandler.ts +++ b/src/settings/handlers/AccountSettingsHandler.ts @@ -15,13 +15,14 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixClient } from "matrix-js-sdk/src/client"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { MatrixClientPeg } from '../../MatrixClientPeg'; import MatrixClientBackedSettingsHandler from "./MatrixClientBackedSettingsHandler"; import { objectClone, objectKeyChanges } from "../../utils/objects"; import { SettingLevel } from "../SettingLevel"; import { WatchManager } from "../WatchManager"; -import { MatrixClient } from "matrix-js-sdk/src/client"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; const BREADCRUMBS_LEGACY_EVENT_TYPE = "im.vector.riot.breadcrumb_rooms"; const BREADCRUMBS_EVENT_TYPE = "im.vector.setting.breadcrumbs"; diff --git a/src/settings/handlers/ConfigSettingsHandler.ts b/src/settings/handlers/ConfigSettingsHandler.ts index ceed3e856a..0120b94b13 100644 --- a/src/settings/handlers/ConfigSettingsHandler.ts +++ b/src/settings/handlers/ConfigSettingsHandler.ts @@ -15,9 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; + import SettingsHandler from "./SettingsHandler"; import SdkConfig from "../../SdkConfig"; -import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; /** * Gets and sets settings at the "config" level. This handler does not make use of the diff --git a/src/settings/handlers/MatrixClientBackedSettingsHandler.ts b/src/settings/handlers/MatrixClientBackedSettingsHandler.ts index a475787f33..cd0631b4d8 100644 --- a/src/settings/handlers/MatrixClientBackedSettingsHandler.ts +++ b/src/settings/handlers/MatrixClientBackedSettingsHandler.ts @@ -14,11 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import SettingsHandler from "./SettingsHandler"; import { MatrixClient } from "matrix-js-sdk/src/client"; - import { logger } from "matrix-js-sdk/src/logger"; +import SettingsHandler from "./SettingsHandler"; + // Dev note: This whole class exists in the event someone logs out and back in - we want // to make sure the right MatrixClient is listening for changes. diff --git a/src/settings/handlers/RoomAccountSettingsHandler.ts b/src/settings/handlers/RoomAccountSettingsHandler.ts index a5ebfae621..05596ae1a4 100644 --- a/src/settings/handlers/RoomAccountSettingsHandler.ts +++ b/src/settings/handlers/RoomAccountSettingsHandler.ts @@ -15,14 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixClient } from "matrix-js-sdk/src/client"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { Room } from "matrix-js-sdk/src/models/room"; + import { MatrixClientPeg } from '../../MatrixClientPeg'; import MatrixClientBackedSettingsHandler from "./MatrixClientBackedSettingsHandler"; import { objectClone, objectKeyChanges } from "../../utils/objects"; import { SettingLevel } from "../SettingLevel"; import { WatchManager } from "../WatchManager"; -import { MatrixClient } from "matrix-js-sdk/src/client"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; -import { Room } from "matrix-js-sdk/src/models/room"; const ALLOWED_WIDGETS_EVENT_TYPE = "im.vector.setting.allowed_widgets"; diff --git a/src/settings/handlers/RoomSettingsHandler.ts b/src/settings/handlers/RoomSettingsHandler.ts index 974f94062c..13eab3c0c2 100644 --- a/src/settings/handlers/RoomSettingsHandler.ts +++ b/src/settings/handlers/RoomSettingsHandler.ts @@ -15,14 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixClient } from "matrix-js-sdk/src/client"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { RoomState } from "matrix-js-sdk/src/models/room-state"; + import { MatrixClientPeg } from '../../MatrixClientPeg'; import MatrixClientBackedSettingsHandler from "./MatrixClientBackedSettingsHandler"; import { objectClone, objectKeyChanges } from "../../utils/objects"; import { SettingLevel } from "../SettingLevel"; import { WatchManager } from "../WatchManager"; -import { MatrixClient } from "matrix-js-sdk/src/client"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; -import { RoomState } from "matrix-js-sdk/src/models/room-state"; /** * Gets and sets settings at the "room" level. diff --git a/src/settings/watchers/ThemeWatcher.ts b/src/settings/watchers/ThemeWatcher.ts index e555267706..b5e598f667 100644 --- a/src/settings/watchers/ThemeWatcher.ts +++ b/src/settings/watchers/ThemeWatcher.ts @@ -15,6 +15,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { logger } from "matrix-js-sdk/src/logger"; + import SettingsStore from '../SettingsStore'; import dis from '../../dispatcher/dispatcher'; import { Action } from '../../dispatcher/actions'; @@ -23,8 +25,6 @@ import { setTheme } from "../../theme"; import { ActionPayload } from '../../dispatcher/payloads'; import { SettingLevel } from "../SettingLevel"; -import { logger } from "matrix-js-sdk/src/logger"; - export default class ThemeWatcher { private themeWatchRef: string; private systemThemeWatchRef: string; diff --git a/src/stores/AsyncStore.ts b/src/stores/AsyncStore.ts index 1f310f003c..2f375f6292 100644 --- a/src/stores/AsyncStore.ts +++ b/src/stores/AsyncStore.ts @@ -17,6 +17,7 @@ limitations under the License. import { EventEmitter } from 'events'; import AwaitLock from 'await-lock'; import { Dispatcher } from "flux"; + import { ActionPayload } from "../dispatcher/payloads"; /** diff --git a/src/stores/AsyncStoreWithClient.ts b/src/stores/AsyncStoreWithClient.ts index 7ed9bbd249..6a2bc46b86 100644 --- a/src/stores/AsyncStoreWithClient.ts +++ b/src/stores/AsyncStoreWithClient.ts @@ -15,9 +15,10 @@ limitations under the License. */ import { MatrixClient } from "matrix-js-sdk/src/client"; +import { Dispatcher } from "flux"; + import { AsyncStore } from "./AsyncStore"; import { ActionPayload } from "../dispatcher/payloads"; -import { Dispatcher } from "flux"; import { ReadyWatchingStore } from "./ReadyWatchingStore"; export abstract class AsyncStoreWithClient extends AsyncStore { diff --git a/src/stores/BreadcrumbsStore.ts b/src/stores/BreadcrumbsStore.ts index 8a85ca354f..57f81ce499 100644 --- a/src/stores/BreadcrumbsStore.ts +++ b/src/stores/BreadcrumbsStore.ts @@ -14,13 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -import SettingsStore from "../settings/SettingsStore"; import { Room } from "matrix-js-sdk/src/models/room"; +import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; + +import SettingsStore from "../settings/SettingsStore"; import { ActionPayload } from "../dispatcher/payloads"; import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; import defaultDispatcher from "../dispatcher/dispatcher"; import { arrayHasDiff } from "../utils/arrays"; -import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; import { SettingLevel } from "../settings/SettingLevel"; import SpaceStore from "./SpaceStore"; import { Action } from "../dispatcher/actions"; diff --git a/src/stores/CommunityPrototypeStore.ts b/src/stores/CommunityPrototypeStore.ts index 6c5ab22c5f..be76279eb8 100644 --- a/src/stores/CommunityPrototypeStore.ts +++ b/src/stores/CommunityPrototypeStore.ts @@ -14,21 +14,21 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { Room } from "matrix-js-sdk/src/models/room"; +import * as utils from "matrix-js-sdk/src/utils"; +import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; +import { logger } from "matrix-js-sdk/src/logger"; + import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; import defaultDispatcher from "../dispatcher/dispatcher"; import { ActionPayload } from "../dispatcher/payloads"; -import { Room } from "matrix-js-sdk/src/models/room"; import { EffectiveMembership, getEffectiveMembership } from "../utils/membership"; import SettingsStore from "../settings/SettingsStore"; -import * as utils from "matrix-js-sdk/src/utils"; import { UPDATE_EVENT } from "./AsyncStore"; import FlairStore from "./FlairStore"; import GroupFilterOrderStore from "./GroupFilterOrderStore"; import GroupStore from "./GroupStore"; import dis from "../dispatcher/dispatcher"; -import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; - -import { logger } from "matrix-js-sdk/src/logger"; interface IState { // nothing of value - we use account data diff --git a/src/stores/CustomRoomTagStore.js b/src/stores/CustomRoomTagStore.js index 899018cf24..da8a89f6c6 100644 --- a/src/stores/CustomRoomTagStore.js +++ b/src/stores/CustomRoomTagStore.js @@ -15,9 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import dis from '../dispatcher/dispatcher'; import EventEmitter from 'events'; import { throttle } from "lodash"; + +import dis from '../dispatcher/dispatcher'; import SettingsStore from "../settings/SettingsStore"; import RoomListStore, { LISTS_UPDATE_EVENT } from "./room-list/RoomListStore"; import { RoomNotificationStateStore } from "./notifications/RoomNotificationStateStore"; diff --git a/src/stores/FlairStore.js b/src/stores/FlairStore.js index 971efd6cf6..edea649814 100644 --- a/src/stores/FlairStore.js +++ b/src/stores/FlairStore.js @@ -15,7 +15,6 @@ limitations under the License. */ import EventEmitter from 'events'; - import { logger } from "matrix-js-sdk/src/logger"; const BULK_REQUEST_DEBOUNCE_MS = 200; diff --git a/src/stores/GroupFilterOrderStore.js b/src/stores/GroupFilterOrderStore.js index 821fbefc4f..6369617bac 100644 --- a/src/stores/GroupFilterOrderStore.js +++ b/src/stores/GroupFilterOrderStore.js @@ -15,6 +15,7 @@ limitations under the License. */ import { Store } from 'flux/utils'; import { EventType } from "matrix-js-sdk/src/@types/event"; + import dis from '../dispatcher/dispatcher'; import GroupStore from './GroupStore'; import Analytics from '../Analytics'; diff --git a/src/stores/GroupStore.js b/src/stores/GroupStore.js index 0934cd9f90..f51a94bd1a 100644 --- a/src/stores/GroupStore.js +++ b/src/stores/GroupStore.js @@ -15,13 +15,13 @@ limitations under the License. */ import EventEmitter from 'events'; +import { logger } from "matrix-js-sdk/src/logger"; + import { groupMemberFromApiObject, groupRoomFromApiObject } from '../groups'; import FlairStore from './FlairStore'; import { MatrixClientPeg } from '../MatrixClientPeg'; import dis from '../dispatcher/dispatcher'; -import { logger } from "matrix-js-sdk/src/logger"; - export function parseMembersResponse(response) { return response.chunk.map((apiMember) => groupMemberFromApiObject(apiMember)); } diff --git a/src/stores/ModalWidgetStore.ts b/src/stores/ModalWidgetStore.ts index abbf87d827..5bfb0a51a5 100644 --- a/src/stores/ModalWidgetStore.ts +++ b/src/stores/ModalWidgetStore.ts @@ -14,15 +14,15 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { IModalWidgetOpenRequestData, IModalWidgetReturnData, Widget } from "matrix-widget-api"; +import { logger } from "matrix-js-sdk/src/logger"; + import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; import defaultDispatcher from "../dispatcher/dispatcher"; import { ActionPayload } from "../dispatcher/payloads"; import Modal, { IHandle, IModal } from "../Modal"; import ModalWidgetDialog from "../components/views/dialogs/ModalWidgetDialog"; import { WidgetMessagingStore } from "./widgets/WidgetMessagingStore"; -import { IModalWidgetOpenRequestData, IModalWidgetReturnData, Widget } from "matrix-widget-api"; - -import { logger } from "matrix-js-sdk/src/logger"; interface IState { modal?: IModal; diff --git a/src/stores/NonUrgentToastStore.ts b/src/stores/NonUrgentToastStore.ts index 72f896749c..9ff15a6a8c 100644 --- a/src/stores/NonUrgentToastStore.ts +++ b/src/stores/NonUrgentToastStore.ts @@ -15,6 +15,7 @@ limitations under the License. */ import EventEmitter from "events"; + import { ComponentClass } from "../@types/common"; import { UPDATE_EVENT } from "./AsyncStore"; diff --git a/src/stores/OwnProfileStore.ts b/src/stores/OwnProfileStore.ts index fb2dd527cb..db703bcb9f 100644 --- a/src/stores/OwnProfileStore.ts +++ b/src/stores/OwnProfileStore.ts @@ -14,12 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { ActionPayload } from "../dispatcher/payloads"; -import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; -import defaultDispatcher from "../dispatcher/dispatcher"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { User } from "matrix-js-sdk/src/models/user"; import { throttle } from "lodash"; + +import { ActionPayload } from "../dispatcher/payloads"; +import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; +import defaultDispatcher from "../dispatcher/dispatcher"; import { MatrixClientPeg } from "../MatrixClientPeg"; import { _t } from "../languageHandler"; import { mediaFromMxc } from "../customisations/Media"; diff --git a/src/stores/ReadyWatchingStore.ts b/src/stores/ReadyWatchingStore.ts index 4bb577c784..b8b9e4a04f 100644 --- a/src/stores/ReadyWatchingStore.ts +++ b/src/stores/ReadyWatchingStore.ts @@ -15,11 +15,12 @@ */ import { MatrixClient } from "matrix-js-sdk/src/client"; +import { Dispatcher } from "flux"; +import { EventEmitter } from "events"; + import { MatrixClientPeg } from "../MatrixClientPeg"; import { ActionPayload } from "../dispatcher/payloads"; -import { Dispatcher } from "flux"; import { IDestroyable } from "../utils/IDestroyable"; -import { EventEmitter } from "events"; export abstract class ReadyWatchingStore extends EventEmitter implements IDestroyable { protected matrixClient: MatrixClient; diff --git a/src/stores/RightPanelStore.ts b/src/stores/RightPanelStore.ts index f9e0a578eb..5e7fe42e6f 100644 --- a/src/stores/RightPanelStore.ts +++ b/src/stores/RightPanelStore.ts @@ -14,17 +14,17 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { Store } from 'flux/utils'; +import { logger } from "matrix-js-sdk/src/logger"; + import dis from '../dispatcher/dispatcher'; import { pendingVerificationRequestForUser } from '../verification'; -import { Store } from 'flux/utils'; import SettingsStore from "../settings/SettingsStore"; import { RightPanelPhases, RIGHT_PANEL_PHASES_NO_ARGS } from "./RightPanelStorePhases"; import { ActionPayload } from "../dispatcher/payloads"; import { Action } from '../dispatcher/actions'; import { SettingLevel } from "../settings/SettingLevel"; -import { logger } from "matrix-js-sdk/src/logger"; - interface RightPanelStoreState { // Whether or not to show the right panel at all. We split out rooms and groups // because they're different flows for the user to follow. diff --git a/src/stores/RoomViewStore.tsx b/src/stores/RoomViewStore.tsx index 1a44b4fb32..d13e1af92f 100644 --- a/src/stores/RoomViewStore.tsx +++ b/src/stores/RoomViewStore.tsx @@ -19,6 +19,7 @@ limitations under the License. import React from "react"; import { Store } from 'flux/utils'; import { MatrixError } from "matrix-js-sdk/src/http-api"; +import { logger } from "matrix-js-sdk/src/logger"; import dis from '../dispatcher/dispatcher'; import { MatrixClientPeg } from '../MatrixClientPeg'; @@ -30,8 +31,6 @@ import { ActionPayload } from "../dispatcher/payloads"; import { Action } from "../dispatcher/actions"; import { retry } from "../utils/promise"; import CountlyAnalytics from "../CountlyAnalytics"; - -import { logger } from "matrix-js-sdk/src/logger"; import { TimelineRenderingType } from "../contexts/RoomContext"; const NUM_JOIN_RETRY = 5; diff --git a/src/stores/SetupEncryptionStore.ts b/src/stores/SetupEncryptionStore.ts index eefe98c7a2..cfd69d3365 100644 --- a/src/stores/SetupEncryptionStore.ts +++ b/src/stores/SetupEncryptionStore.ts @@ -15,10 +15,10 @@ limitations under the License. */ import EventEmitter from 'events'; -import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { VerificationRequest, PHASE_DONE as VERIF_PHASE_DONE } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup"; import { ISecretStorageKeyInfo } from "matrix-js-sdk/src/crypto/api"; -import { PHASE_DONE as VERIF_PHASE_DONE } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from '../MatrixClientPeg'; import { accessSecretStorage, AccessCancelledError } from '../SecurityManager'; @@ -26,8 +26,6 @@ import Modal from '../Modal'; import InteractiveAuthDialog from '../components/views/dialogs/InteractiveAuthDialog'; import { _t } from '../languageHandler'; -import { logger } from "matrix-js-sdk/src/logger"; - export enum Phase { Loading = 0, Intro = 1, diff --git a/src/stores/SpaceStore.ts b/src/stores/SpaceStore.ts index 4ba1081325..55e9b0f446 100644 --- a/src/stores/SpaceStore.ts +++ b/src/stores/SpaceStore.ts @@ -20,6 +20,7 @@ import { Room } from "matrix-js-sdk/src/models/room"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { IHierarchyRoom } from "matrix-js-sdk/src/@types/spaces"; import { IRoomCapability } from "matrix-js-sdk/src/client"; +import { logger } from "matrix-js-sdk/src/logger"; import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; import defaultDispatcher from "../dispatcher/dispatcher"; @@ -41,8 +42,6 @@ import { reorderLexicographically } from "../utils/stringOrderField"; import { TAG_ORDER } from "../components/views/rooms/RoomList"; import { SettingUpdatedPayload } from "../dispatcher/payloads/SettingUpdatedPayload"; -import { logger } from "matrix-js-sdk/src/logger"; - type SpaceKey = string | symbol; interface IState {} diff --git a/src/stores/ToastStore.ts b/src/stores/ToastStore.ts index 5e51de3e26..1d3e5dd050 100644 --- a/src/stores/ToastStore.ts +++ b/src/stores/ToastStore.ts @@ -16,6 +16,7 @@ limitations under the License. import EventEmitter from "events"; import React from "react"; + import { ComponentClass } from "../@types/common"; export interface IToast { diff --git a/src/stores/UIStore.ts b/src/stores/UIStore.ts index b89af2f7c0..99446da49a 100644 --- a/src/stores/UIStore.ts +++ b/src/stores/UIStore.ts @@ -14,13 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -import EventEmitter from "events"; +import EventEmitter from "events"; // eslint-disable-line @typescript-eslint/no-var-requires +import ResizeObserverEntry from 'resize-observer-polyfill/src/ResizeObserverEntry'; + // XXX: resize-observer-polyfill has types that now conflict with typescript's // own DOM types: https://github.com/que-etc/resize-observer-polyfill/issues/80 // Using require here rather than import is a horrenous workaround. We should // be able to remove the polyfill once Safari 14 is released. -const ResizeObserverPolyfill = require('resize-observer-polyfill'); // eslint-disable-line @typescript-eslint/no-var-requires -import ResizeObserverEntry from 'resize-observer-polyfill/src/ResizeObserverEntry'; +const ResizeObserverPolyfill = require('resize-observer-polyfill'); export enum UI_EVENTS { Resize = "resize" diff --git a/src/stores/WidgetEchoStore.ts b/src/stores/WidgetEchoStore.ts index d3ef9df023..34b9b4aa47 100644 --- a/src/stores/WidgetEchoStore.ts +++ b/src/stores/WidgetEchoStore.ts @@ -17,6 +17,7 @@ limitations under the License. import EventEmitter from 'events'; import { IWidget } from 'matrix-widget-api'; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { WidgetType } from "../widgets/WidgetType"; /** diff --git a/src/stores/WidgetStore.ts b/src/stores/WidgetStore.ts index ebe761aa80..c1f6cea52c 100644 --- a/src/stores/WidgetStore.ts +++ b/src/stores/WidgetStore.ts @@ -17,6 +17,7 @@ limitations under the License. import { Room } from "matrix-js-sdk/src/models/room"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { IWidget } from "matrix-widget-api"; +import { logger } from "matrix-js-sdk/src/logger"; import { ActionPayload } from "../dispatcher/payloads"; import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; @@ -28,8 +29,6 @@ import { WidgetType } from "../widgets/WidgetType"; import { UPDATE_EVENT } from "./AsyncStore"; import { MatrixClientPeg } from "../MatrixClientPeg"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IState {} export interface IApp extends IWidget { diff --git a/src/stores/local-echo/EchoChamber.ts b/src/stores/local-echo/EchoChamber.ts index f61e521728..7248aa78f6 100644 --- a/src/stores/local-echo/EchoChamber.ts +++ b/src/stores/local-echo/EchoChamber.ts @@ -14,8 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { RoomEchoChamber } from "./RoomEchoChamber"; import { Room } from "matrix-js-sdk/src/models/room"; + +import { RoomEchoChamber } from "./RoomEchoChamber"; import { EchoStore } from "./EchoStore"; /** diff --git a/src/stores/local-echo/EchoStore.ts b/src/stores/local-echo/EchoStore.ts index 9c038c5a4f..b52a73ab7f 100644 --- a/src/stores/local-echo/EchoStore.ts +++ b/src/stores/local-echo/EchoStore.ts @@ -14,8 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { GenericEchoChamber } from "./GenericEchoChamber"; import { Room } from "matrix-js-sdk/src/models/room"; + +import { GenericEchoChamber } from "./GenericEchoChamber"; import { RoomEchoChamber } from "./RoomEchoChamber"; import { RoomEchoContext } from "./RoomEchoContext"; import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; diff --git a/src/stores/local-echo/GenericEchoChamber.ts b/src/stores/local-echo/GenericEchoChamber.ts index 6148098fbe..0f07a74355 100644 --- a/src/stores/local-echo/GenericEchoChamber.ts +++ b/src/stores/local-echo/GenericEchoChamber.ts @@ -14,11 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { EchoContext } from "./EchoContext"; -import { EchoTransaction, RunFn, TransactionStatus } from "./EchoTransaction"; import { MatrixClient } from "matrix-js-sdk/src/client"; import { EventEmitter } from "events"; +import { EchoContext } from "./EchoContext"; +import { EchoTransaction, RunFn, TransactionStatus } from "./EchoTransaction"; + export async function implicitlyReverted() { // do nothing :D } diff --git a/src/stores/local-echo/RoomEchoChamber.ts b/src/stores/local-echo/RoomEchoChamber.ts index fb40e23a85..bd54dbc9ae 100644 --- a/src/stores/local-echo/RoomEchoChamber.ts +++ b/src/stores/local-echo/RoomEchoChamber.ts @@ -14,11 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { GenericEchoChamber, implicitlyReverted, PROPERTY_UPDATED } from "./GenericEchoChamber"; import { getRoomNotifsState, RoomNotifState, setRoomNotifsState } from "../../RoomNotifs"; import { RoomEchoContext } from "./RoomEchoContext"; import { _t } from "../../languageHandler"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; export enum CachedRoomKey { NotificationVolume, diff --git a/src/stores/local-echo/RoomEchoContext.ts b/src/stores/local-echo/RoomEchoContext.ts index 4105f728c3..23090c4588 100644 --- a/src/stores/local-echo/RoomEchoContext.ts +++ b/src/stores/local-echo/RoomEchoContext.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { EchoContext } from "./EchoContext"; import { Room } from "matrix-js-sdk/src/models/room"; +import { EchoContext } from "./EchoContext"; + export class RoomEchoContext extends EchoContext { constructor(public readonly room: Room) { super(); diff --git a/src/stores/notifications/ListNotificationState.ts b/src/stores/notifications/ListNotificationState.ts index 97ba2bd80b..51d4912add 100644 --- a/src/stores/notifications/ListNotificationState.ts +++ b/src/stores/notifications/ListNotificationState.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { Room } from "matrix-js-sdk/src/models/room"; + import { NotificationColor } from "./NotificationColor"; import { TagID } from "../room-list/models"; -import { Room } from "matrix-js-sdk/src/models/room"; import { arrayDiff } from "../../utils/arrays"; import { RoomNotificationState } from "./RoomNotificationState"; import { NOTIFICATION_STATE_UPDATE, NotificationState } from "./NotificationState"; diff --git a/src/stores/notifications/NotificationState.ts b/src/stores/notifications/NotificationState.ts index 00dbb7856f..d216610b33 100644 --- a/src/stores/notifications/NotificationState.ts +++ b/src/stores/notifications/NotificationState.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { EventEmitter } from "events"; + import { NotificationColor } from "./NotificationColor"; import { IDestroyable } from "../../utils/IDestroyable"; diff --git a/src/stores/notifications/RoomNotificationState.ts b/src/stores/notifications/RoomNotificationState.ts index 3ad0080183..b4a0b19cb4 100644 --- a/src/stores/notifications/RoomNotificationState.ts +++ b/src/stores/notifications/RoomNotificationState.ts @@ -14,13 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { NotificationCountType, Room } from "matrix-js-sdk/src/models/room"; + import { NotificationColor } from "./NotificationColor"; import { IDestroyable } from "../../utils/IDestroyable"; import { MatrixClientPeg } from "../../MatrixClientPeg"; import { EffectiveMembership, getEffectiveMembership } from "../../utils/membership"; import { readReceiptChangeIsFor } from "../../utils/read-receipts"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; -import { NotificationCountType, Room } from "matrix-js-sdk/src/models/room"; import * as RoomNotifs from '../../RoomNotifs'; import * as Unread from '../../Unread'; import { NotificationState } from "./NotificationState"; diff --git a/src/stores/notifications/RoomNotificationStateStore.ts b/src/stores/notifications/RoomNotificationStateStore.ts index 7253b46ddd..330e159085 100644 --- a/src/stores/notifications/RoomNotificationStateStore.ts +++ b/src/stores/notifications/RoomNotificationStateStore.ts @@ -14,12 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { Room } from "matrix-js-sdk/src/models/room"; + import { ActionPayload } from "../../dispatcher/payloads"; import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; import defaultDispatcher from "../../dispatcher/dispatcher"; import { DefaultTagID, TagID } from "../room-list/models"; import { FetchRoomFn, ListNotificationState } from "./ListNotificationState"; -import { Room } from "matrix-js-sdk/src/models/room"; import { RoomNotificationState } from "./RoomNotificationState"; import { SummarizedNotificationState } from "./SummarizedNotificationState"; import { VisibilityProvider } from "../room-list/filters/VisibilityProvider"; diff --git a/src/stores/room-list/MessagePreviewStore.ts b/src/stores/room-list/MessagePreviewStore.ts index 8fcbb5b94f..aa8bf97953 100644 --- a/src/stores/room-list/MessagePreviewStore.ts +++ b/src/stores/room-list/MessagePreviewStore.ts @@ -15,19 +15,20 @@ limitations under the License. */ import { Room } from "matrix-js-sdk/src/models/room"; +import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { ActionPayload } from "../../dispatcher/payloads"; import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; import defaultDispatcher from "../../dispatcher/dispatcher"; import { MessageEventPreview } from "./previews/MessageEventPreview"; import { TagID } from "./models"; -import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; import { CallInviteEventPreview } from "./previews/CallInviteEventPreview"; import { CallAnswerEventPreview } from "./previews/CallAnswerEventPreview"; import { CallHangupEvent } from "./previews/CallHangupEvent"; import { StickerEventPreview } from "./previews/StickerEventPreview"; import { ReactionEventPreview } from "./previews/ReactionEventPreview"; import { UPDATE_EVENT } from "../AsyncStore"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; // Emitted event for when a room's preview has changed. First argument will the room for which // the change happened. diff --git a/src/stores/room-list/RoomListLayoutStore.ts b/src/stores/room-list/RoomListLayoutStore.ts index d5b31fed93..fce230779e 100644 --- a/src/stores/room-list/RoomListLayoutStore.ts +++ b/src/stores/room-list/RoomListLayoutStore.ts @@ -14,14 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { logger } from "matrix-js-sdk/src/logger"; + import { TagID } from "./models"; import { ListLayout } from "./ListLayout"; import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; import defaultDispatcher from "../../dispatcher/dispatcher"; import { ActionPayload } from "../../dispatcher/payloads"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IState {} export default class RoomListLayoutStore extends AsyncStoreWithClient { diff --git a/src/stores/room-list/RoomListStore.ts b/src/stores/room-list/RoomListStore.ts index c4b1f012b1..de22c4575e 100644 --- a/src/stores/room-list/RoomListStore.ts +++ b/src/stores/room-list/RoomListStore.ts @@ -15,9 +15,12 @@ limitations under the License. */ import { MatrixClient } from "matrix-js-sdk/src/client"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; +import { logger } from "matrix-js-sdk/src/logger"; + import SettingsStore from "../../settings/SettingsStore"; import { DefaultTagID, isCustomTag, OrderedDefaultTagIDs, RoomUpdateCause, TagID } from "./models"; -import { Room } from "matrix-js-sdk/src/models/room"; import { IListOrderingMap, ITagMap, ITagSortingMap, ListAlgorithm, SortAlgorithm } from "./algorithms/models"; import { ActionPayload } from "../../dispatcher/payloads"; import defaultDispatcher from "../../dispatcher/dispatcher"; @@ -27,7 +30,6 @@ import { TagWatcher } from "./TagWatcher"; import RoomViewStore from "../RoomViewStore"; import { Algorithm, LIST_UPDATED_EVENT } from "./algorithms/Algorithm"; import { EffectiveMembership, getEffectiveMembership } from "../../utils/membership"; -import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; import RoomListLayoutStore from "./RoomListLayoutStore"; import { MarkedExecution } from "../../utils/MarkedExecution"; import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; @@ -39,8 +41,6 @@ import SpaceStore from "../SpaceStore"; import { Action } from "../../dispatcher/actions"; import { SettingUpdatedPayload } from "../../dispatcher/payloads/SettingUpdatedPayload"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IState { tagsEnabled?: boolean; } diff --git a/src/stores/room-list/TagWatcher.ts b/src/stores/room-list/TagWatcher.ts index 09f6ec13cd..a0bcf76bf6 100644 --- a/src/stores/room-list/TagWatcher.ts +++ b/src/stores/room-list/TagWatcher.ts @@ -14,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { logger } from "matrix-js-sdk/src/logger"; + import { RoomListStoreClass } from "./RoomListStore"; import GroupFilterOrderStore from "../GroupFilterOrderStore"; import { CommunityFilterCondition } from "./filters/CommunityFilterCondition"; import { arrayDiff, arrayHasDiff } from "../../utils/arrays"; -import { logger } from "matrix-js-sdk/src/logger"; - /** * Watches for changes in groups to manage filters on the provided RoomListStore */ diff --git a/src/stores/room-list/algorithms/Algorithm.ts b/src/stores/room-list/algorithms/Algorithm.ts index 5e98ef37ff..11d3330b3e 100644 --- a/src/stores/room-list/algorithms/Algorithm.ts +++ b/src/stores/room-list/algorithms/Algorithm.ts @@ -17,6 +17,7 @@ limitations under the License. import { Room } from "matrix-js-sdk/src/models/room"; import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; import { EventEmitter } from "events"; +import { logger } from "matrix-js-sdk/src/logger"; import DMRoomMap from "../../../utils/DMRoomMap"; import { arrayDiff, arrayHasDiff } from "../../../utils/arrays"; @@ -36,8 +37,6 @@ import { getListAlgorithmInstance } from "./list-ordering"; import { VisibilityProvider } from "../filters/VisibilityProvider"; import SpaceStore from "../../SpaceStore"; -import { logger } from "matrix-js-sdk/src/logger"; - /** * Fired when the Algorithm has determined a list has been updated. */ diff --git a/src/stores/room-list/algorithms/list-ordering/ImportanceAlgorithm.ts b/src/stores/room-list/algorithms/list-ordering/ImportanceAlgorithm.ts index ef1f4629be..1f9a030faf 100644 --- a/src/stores/room-list/algorithms/list-ordering/ImportanceAlgorithm.ts +++ b/src/stores/room-list/algorithms/list-ordering/ImportanceAlgorithm.ts @@ -16,6 +16,8 @@ limitations under the License. */ import { Room } from "matrix-js-sdk/src/models/room"; +import { logger } from "matrix-js-sdk/src/logger"; + import { RoomUpdateCause, TagID } from "../../models"; import { SortAlgorithm } from "../models"; import { sortRoomsWithAlgorithm } from "../tag-sorting"; @@ -23,8 +25,6 @@ import { OrderingAlgorithm } from "./OrderingAlgorithm"; import { NotificationColor } from "../../../notifications/NotificationColor"; import { RoomNotificationStateStore } from "../../../notifications/RoomNotificationStateStore"; -import { logger } from "matrix-js-sdk/src/logger"; - interface ICategorizedRoomMap { // @ts-ignore - TS wants this to be a string, but we know better [category: NotificationColor]: Room[]; diff --git a/src/stores/room-list/algorithms/list-ordering/NaturalAlgorithm.ts b/src/stores/room-list/algorithms/list-ordering/NaturalAlgorithm.ts index 726987e734..3d333efa17 100644 --- a/src/stores/room-list/algorithms/list-ordering/NaturalAlgorithm.ts +++ b/src/stores/room-list/algorithms/list-ordering/NaturalAlgorithm.ts @@ -14,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { Room } from "matrix-js-sdk/src/models/room"; +import { logger } from "matrix-js-sdk/src/logger"; + import { SortAlgorithm } from "../models"; import { sortRoomsWithAlgorithm } from "../tag-sorting"; import { OrderingAlgorithm } from "./OrderingAlgorithm"; import { RoomUpdateCause, TagID } from "../../models"; -import { Room } from "matrix-js-sdk/src/models/room"; - -import { logger } from "matrix-js-sdk/src/logger"; /** * Uses the natural tag sorting algorithm order to determine tag ordering. No diff --git a/src/stores/room-list/algorithms/list-ordering/OrderingAlgorithm.ts b/src/stores/room-list/algorithms/list-ordering/OrderingAlgorithm.ts index 3afcd4f9d5..63e6a96d20 100644 --- a/src/stores/room-list/algorithms/list-ordering/OrderingAlgorithm.ts +++ b/src/stores/room-list/algorithms/list-ordering/OrderingAlgorithm.ts @@ -15,11 +15,11 @@ limitations under the License. */ import { Room } from "matrix-js-sdk/src/models/room"; +import { logger } from "matrix-js-sdk/src/logger"; + import { RoomUpdateCause, TagID } from "../../models"; import { SortAlgorithm } from "../models"; -import { logger } from "matrix-js-sdk/src/logger"; - /** * Represents a list ordering algorithm. Subclasses should populate the * `cachedOrderedRooms` field. diff --git a/src/stores/room-list/algorithms/models.ts b/src/stores/room-list/algorithms/models.ts index 943d833b67..41152ac9ba 100644 --- a/src/stores/room-list/algorithms/models.ts +++ b/src/stores/room-list/algorithms/models.ts @@ -14,8 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { TagID } from "../models"; import { Room } from "matrix-js-sdk/src/models/room"; + +import { TagID } from "../models"; import { OrderingAlgorithm } from "./list-ordering/OrderingAlgorithm"; export enum SortAlgorithm { diff --git a/src/stores/room-list/algorithms/tag-sorting/AlphabeticAlgorithm.ts b/src/stores/room-list/algorithms/tag-sorting/AlphabeticAlgorithm.ts index 45f6eaf843..8bf7061cbc 100644 --- a/src/stores/room-list/algorithms/tag-sorting/AlphabeticAlgorithm.ts +++ b/src/stores/room-list/algorithms/tag-sorting/AlphabeticAlgorithm.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { Room } from "matrix-js-sdk/src/models/room"; + import { TagID } from "../../models"; import { IAlgorithm } from "./IAlgorithm"; import { compare } from "../../../../utils/strings"; diff --git a/src/stores/room-list/algorithms/tag-sorting/IAlgorithm.ts b/src/stores/room-list/algorithms/tag-sorting/IAlgorithm.ts index 588bbbffc9..46b18a04f4 100644 --- a/src/stores/room-list/algorithms/tag-sorting/IAlgorithm.ts +++ b/src/stores/room-list/algorithms/tag-sorting/IAlgorithm.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { Room } from "matrix-js-sdk/src/models/room"; + import { TagID } from "../../models"; /** diff --git a/src/stores/room-list/algorithms/tag-sorting/ManualAlgorithm.ts b/src/stores/room-list/algorithms/tag-sorting/ManualAlgorithm.ts index 9be8ba5262..116ff327c4 100644 --- a/src/stores/room-list/algorithms/tag-sorting/ManualAlgorithm.ts +++ b/src/stores/room-list/algorithms/tag-sorting/ManualAlgorithm.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { Room } from "matrix-js-sdk/src/models/room"; + import { TagID } from "../../models"; import { IAlgorithm } from "./IAlgorithm"; diff --git a/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts b/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts index 0da2c69eb8..af937e92af 100644 --- a/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts +++ b/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts @@ -15,13 +15,14 @@ limitations under the License. */ import { Room } from "matrix-js-sdk/src/models/room"; +import { EventType } from "matrix-js-sdk/src/@types/event"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { TagID } from "../../models"; import { IAlgorithm } from "./IAlgorithm"; import { MatrixClientPeg } from "../../../../MatrixClientPeg"; import * as Unread from "../../../../Unread"; import { EffectiveMembership, getEffectiveMembership } from "../../../../utils/membership"; -import { EventType } from "matrix-js-sdk/src/@types/event"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; export function shouldCauseReorder(event: MatrixEvent): boolean { const type = event.getType(); diff --git a/src/stores/room-list/algorithms/tag-sorting/index.ts b/src/stores/room-list/algorithms/tag-sorting/index.ts index 368c76f111..fcd620d60f 100644 --- a/src/stores/room-list/algorithms/tag-sorting/index.ts +++ b/src/stores/room-list/algorithms/tag-sorting/index.ts @@ -14,11 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { Room } from "matrix-js-sdk/src/models/room"; + import { SortAlgorithm } from "../models"; import { ManualAlgorithm } from "./ManualAlgorithm"; import { IAlgorithm } from "./IAlgorithm"; import { TagID } from "../../models"; -import { Room } from "matrix-js-sdk/src/models/room"; import { RecentAlgorithm } from "./RecentAlgorithm"; import { AlphabeticAlgorithm } from "./AlphabeticAlgorithm"; diff --git a/src/stores/room-list/filters/CommunityFilterCondition.ts b/src/stores/room-list/filters/CommunityFilterCondition.ts index a66bc01bce..a1b3da5be2 100644 --- a/src/stores/room-list/filters/CommunityFilterCondition.ts +++ b/src/stores/room-list/filters/CommunityFilterCondition.ts @@ -15,9 +15,10 @@ limitations under the License. */ import { Room } from "matrix-js-sdk/src/models/room"; -import { FILTER_CHANGED, FilterKind, IFilterCondition } from "./IFilterCondition"; import { Group } from "matrix-js-sdk/src/models/group"; import { EventEmitter } from "events"; + +import { FILTER_CHANGED, FilterKind, IFilterCondition } from "./IFilterCondition"; import GroupStore from "../../GroupStore"; import { IDestroyable } from "../../../utils/IDestroyable"; import DMRoomMap from "../../../utils/DMRoomMap"; diff --git a/src/stores/room-list/filters/NameFilterCondition.ts b/src/stores/room-list/filters/NameFilterCondition.ts index e21d5ab718..c2dd40f4c2 100644 --- a/src/stores/room-list/filters/NameFilterCondition.ts +++ b/src/stores/room-list/filters/NameFilterCondition.ts @@ -15,11 +15,12 @@ limitations under the License. */ import { Room } from "matrix-js-sdk/src/models/room"; -import { FILTER_CHANGED, FilterKind, IFilterCondition } from "./IFilterCondition"; import { EventEmitter } from "events"; import { normalize } from "matrix-js-sdk/src/utils"; import { throttle } from "lodash"; +import { FILTER_CHANGED, FilterKind, IFilterCondition } from "./IFilterCondition"; + /** * A filter condition for the room list which reveals rooms of a particular * name, or associated name (like a room alias). diff --git a/src/stores/room-list/filters/VisibilityProvider.ts b/src/stores/room-list/filters/VisibilityProvider.ts index f63b622053..d1a8c9db9c 100644 --- a/src/stores/room-list/filters/VisibilityProvider.ts +++ b/src/stores/room-list/filters/VisibilityProvider.ts @@ -15,6 +15,7 @@ */ import { Room } from "matrix-js-sdk/src/models/room"; + import CallHandler from "../../../CallHandler"; import { RoomListCustomisations } from "../../../customisations/RoomList"; import VoipUserMapper from "../../../VoipUserMapper"; diff --git a/src/stores/room-list/previews/CallAnswerEventPreview.ts b/src/stores/room-list/previews/CallAnswerEventPreview.ts index 7193154890..638b0eb2a6 100644 --- a/src/stores/room-list/previews/CallAnswerEventPreview.ts +++ b/src/stores/room-list/previews/CallAnswerEventPreview.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { IPreview } from "./IPreview"; import { TagID } from "../models"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils"; import { _t } from "../../../languageHandler"; diff --git a/src/stores/room-list/previews/CallHangupEvent.ts b/src/stores/room-list/previews/CallHangupEvent.ts index 54d4d70fb0..6cbd0ae1a2 100644 --- a/src/stores/room-list/previews/CallHangupEvent.ts +++ b/src/stores/room-list/previews/CallHangupEvent.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { IPreview } from "./IPreview"; import { TagID } from "../models"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils"; import { _t } from "../../../languageHandler"; diff --git a/src/stores/room-list/previews/CallInviteEventPreview.ts b/src/stores/room-list/previews/CallInviteEventPreview.ts index 3e6a89aa6d..4ad109b14c 100644 --- a/src/stores/room-list/previews/CallInviteEventPreview.ts +++ b/src/stores/room-list/previews/CallInviteEventPreview.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { IPreview } from "./IPreview"; import { TagID } from "../models"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils"; import { _t } from "../../../languageHandler"; diff --git a/src/stores/room-list/previews/IPreview.ts b/src/stores/room-list/previews/IPreview.ts index fe69637543..6049d9f8a2 100644 --- a/src/stores/room-list/previews/IPreview.ts +++ b/src/stores/room-list/previews/IPreview.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { TagID } from "../models"; /** diff --git a/src/stores/room-list/previews/MessageEventPreview.ts b/src/stores/room-list/previews/MessageEventPreview.ts index b8e3119ad4..51a3099892 100644 --- a/src/stores/room-list/previews/MessageEventPreview.ts +++ b/src/stores/room-list/previews/MessageEventPreview.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { IPreview } from "./IPreview"; import { TagID } from "../models"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { _t, sanitizeForTranslation } from "../../../languageHandler"; import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils"; import ReplyChain from "../../../components/views/elements/ReplyChain"; diff --git a/src/stores/room-list/previews/ReactionEventPreview.ts b/src/stores/room-list/previews/ReactionEventPreview.ts index 4e2c175055..6a9ae21afc 100644 --- a/src/stores/room-list/previews/ReactionEventPreview.ts +++ b/src/stores/room-list/previews/ReactionEventPreview.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { IPreview } from "./IPreview"; import { TagID } from "../models"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils"; import { _t } from "../../../languageHandler"; import SettingsStore from "../../../settings/SettingsStore"; diff --git a/src/stores/room-list/previews/StickerEventPreview.ts b/src/stores/room-list/previews/StickerEventPreview.ts index 6ad43ef3e1..9e8cfd34d3 100644 --- a/src/stores/room-list/previews/StickerEventPreview.ts +++ b/src/stores/room-list/previews/StickerEventPreview.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { IPreview } from "./IPreview"; import { TagID } from "../models"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils"; import { _t } from "../../../languageHandler"; diff --git a/src/stores/room-list/previews/utils.ts b/src/stores/room-list/previews/utils.ts index ebbecd7bbd..440b9433ba 100644 --- a/src/stores/room-list/previews/utils.ts +++ b/src/stores/room-list/previews/utils.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { DefaultTagID, TagID } from "../models"; diff --git a/src/stores/widgets/StopGapWidget.ts b/src/stores/widgets/StopGapWidget.ts index 1293fe0548..b39e79d36e 100644 --- a/src/stores/widgets/StopGapWidget.ts +++ b/src/stores/widgets/StopGapWidget.ts @@ -32,8 +32,11 @@ import { IWidgetApiErrorResponseData, WidgetKind, } from "matrix-widget-api"; -import { StopGapWidgetDriver } from "./StopGapWidgetDriver"; import { EventEmitter } from "events"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { logger } from "matrix-js-sdk/src/logger"; + +import { StopGapWidgetDriver } from "./StopGapWidgetDriver"; import { WidgetMessagingStore } from "./WidgetMessagingStore"; import RoomViewStore from "../RoomViewStore"; import { MatrixClientPeg } from "../../MatrixClientPeg"; @@ -51,14 +54,11 @@ import ThemeWatcher from "../../settings/watchers/ThemeWatcher"; import { getCustomTheme } from "../../theme"; import CountlyAnalytics from "../../CountlyAnalytics"; import { ElementWidgetCapabilities } from "./ElementWidgetCapabilities"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { ELEMENT_CLIENT_ID } from "../../identifiers"; import { getUserLanguage } from "../../languageHandler"; import { WidgetVariableCustomisations } from "../../customisations/WidgetVariables"; import { arrayFastClone } from "../../utils/arrays"; -import { logger } from "matrix-js-sdk/src/logger"; - // TODO: Destroy all of this code interface IAppTileProps { diff --git a/src/stores/widgets/StopGapWidgetDriver.ts b/src/stores/widgets/StopGapWidgetDriver.ts index e8f550b92c..f8e720ac19 100644 --- a/src/stores/widgets/StopGapWidgetDriver.ts +++ b/src/stores/widgets/StopGapWidgetDriver.ts @@ -29,6 +29,11 @@ import { WidgetEventCapability, WidgetKind, } from "matrix-widget-api"; +import { EventType } from "matrix-js-sdk/src/@types/event"; +import { IEvent, MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { logger } from "matrix-js-sdk/src/logger"; + import { iterableDiff, iterableUnion } from "../../utils/iterables"; import { MatrixClientPeg } from "../../MatrixClientPeg"; import ActiveRoomObserver from "../../ActiveRoomObserver"; @@ -38,15 +43,10 @@ import WidgetCapabilitiesPromptDialog from "../../components/views/dialogs/Widge import { WidgetPermissionCustomisations } from "../../customisations/WidgetPermissions"; import { OIDCState, WidgetPermissionStore } from "./WidgetPermissionStore"; import { WidgetType } from "../../widgets/WidgetType"; -import { EventType } from "matrix-js-sdk/src/@types/event"; import { CHAT_EFFECTS } from "../../effects"; import { containsEmoji } from "../../effects/utils"; import dis from "../../dispatcher/dispatcher"; import { tryTransformPermalinkToLocalHref } from "../../utils/permalinks/Permalinks"; -import { IEvent, MatrixEvent } from "matrix-js-sdk/src/models/event"; -import { Room } from "matrix-js-sdk/src/models/room"; - -import { logger } from "matrix-js-sdk/src/logger"; // TODO: Purge this from the universe diff --git a/src/stores/widgets/WidgetLayoutStore.ts b/src/stores/widgets/WidgetLayoutStore.ts index 5d427a0f1a..fcb0eec28d 100644 --- a/src/stores/widgets/WidgetLayoutStore.ts +++ b/src/stores/widgets/WidgetLayoutStore.ts @@ -14,14 +14,15 @@ * limitations under the License. */ -import SettingsStore from "../../settings/SettingsStore"; import { Room } from "matrix-js-sdk/src/models/room"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + +import SettingsStore from "../../settings/SettingsStore"; import WidgetStore, { IApp } from "../WidgetStore"; import { WidgetType } from "../../widgets/WidgetType"; import { clamp, defaultNumber, sum } from "../../utils/numbers"; import defaultDispatcher from "../../dispatcher/dispatcher"; import { ReadyWatchingStore } from "../ReadyWatchingStore"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { SettingLevel } from "../../settings/SettingLevel"; import { arrayFastClone } from "../../utils/arrays"; import { UPDATE_EVENT } from "../AsyncStore"; diff --git a/src/stores/widgets/WidgetMessagingStore.ts b/src/stores/widgets/WidgetMessagingStore.ts index 83d3ac7df8..824132b5c3 100644 --- a/src/stores/widgets/WidgetMessagingStore.ts +++ b/src/stores/widgets/WidgetMessagingStore.ts @@ -15,6 +15,7 @@ */ import { ClientWidgetApi, Widget } from "matrix-widget-api"; + import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; import defaultDispatcher from "../../dispatcher/dispatcher"; import { ActionPayload } from "../../dispatcher/payloads"; diff --git a/src/stores/widgets/WidgetPermissionStore.ts b/src/stores/widgets/WidgetPermissionStore.ts index 41e8bc6652..246492333c 100644 --- a/src/stores/widgets/WidgetPermissionStore.ts +++ b/src/stores/widgets/WidgetPermissionStore.ts @@ -14,8 +14,9 @@ * limitations under the License. */ -import SettingsStore from "../../settings/SettingsStore"; import { Widget, WidgetKind } from "matrix-widget-api"; + +import SettingsStore from "../../settings/SettingsStore"; import { MatrixClientPeg } from "../../MatrixClientPeg"; import { SettingLevel } from "../../settings/SettingLevel"; diff --git a/src/theme.ts b/src/theme.ts index aaebe3746d..effd0a7b05 100644 --- a/src/theme.ts +++ b/src/theme.ts @@ -16,7 +16,6 @@ limitations under the License. */ import { _t } from "./languageHandler"; - import SettingsStore from "./settings/SettingsStore"; import ThemeWatcher from "./settings/watchers/ThemeWatcher"; diff --git a/src/toasts/IncomingCallToast.tsx b/src/toasts/IncomingCallToast.tsx index fbe4e66d50..220addffbc 100644 --- a/src/toasts/IncomingCallToast.tsx +++ b/src/toasts/IncomingCallToast.tsx @@ -20,6 +20,7 @@ limitations under the License. import React from 'react'; import { CallType, MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; import classNames from 'classnames'; + import { replaceableComponent } from '../utils/replaceableComponent'; import CallHandler, { CallHandlerEvent } from '../CallHandler'; import dis from '../dispatcher/dispatcher'; diff --git a/src/utils/AutoDiscoveryUtils.tsx b/src/utils/AutoDiscoveryUtils.tsx index ae804381cf..8860a5104f 100644 --- a/src/utils/AutoDiscoveryUtils.tsx +++ b/src/utils/AutoDiscoveryUtils.tsx @@ -16,12 +16,12 @@ limitations under the License. import React, { ReactNode } from 'react'; import { AutoDiscovery } from "matrix-js-sdk/src/autodiscovery"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t, _td, newTranslatableError } from "../languageHandler"; import { makeType } from "./TypeUtils"; import SdkConfig from '../SdkConfig'; -import { logger } from "matrix-js-sdk/src/logger"; - const LIVELINESS_DISCOVERY_ERRORS: string[] = [ AutoDiscovery.ERROR_INVALID_HOMESERVER, AutoDiscovery.ERROR_INVALID_IDENTITY_SERVER, diff --git a/src/utils/DMRoomMap.ts b/src/utils/DMRoomMap.ts index 089279cdcc..0cec18816c 100644 --- a/src/utils/DMRoomMap.ts +++ b/src/utils/DMRoomMap.ts @@ -17,11 +17,10 @@ limitations under the License. import { uniq } from "lodash"; import { Room } from "matrix-js-sdk/src/models/room"; import { MatrixClient } from "matrix-js-sdk/src/client"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from '../MatrixClientPeg'; -import { logger } from "matrix-js-sdk/src/logger"; - /** * Class that takes a Matrix Client and flips the m.direct map * so the operation of mapping a room ID to which user it's a DM diff --git a/src/utils/DecryptFile.ts b/src/utils/DecryptFile.ts index 891439ffe1..d7ac3d4f56 100644 --- a/src/utils/DecryptFile.ts +++ b/src/utils/DecryptFile.ts @@ -16,6 +16,7 @@ limitations under the License. // Pull in the encryption lib so that we can decrypt attachments. import encrypt from 'browser-encrypt-attachment'; + import { mediaFromContent } from "../customisations/Media"; import { IEncryptedFile, IMediaEventInfo } from "../customisations/models/IMediaEventContent"; import { getBlobSafeMimeType } from "./blobs"; diff --git a/src/utils/DirectoryUtils.ts b/src/utils/DirectoryUtils.ts index 255ae0e3fd..89e719f320 100644 --- a/src/utils/DirectoryUtils.ts +++ b/src/utils/DirectoryUtils.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { IInstance } from "matrix-js-sdk/src/client"; + import { Protocols } from "../components/views/directory/NetworkDropdown"; // Find a protocol 'instance' with a given instance_id diff --git a/src/utils/EventUtils.ts b/src/utils/EventUtils.ts index 894dcb3955..96b37bd6a8 100644 --- a/src/utils/EventUtils.ts +++ b/src/utils/EventUtils.ts @@ -15,15 +15,15 @@ limitations under the License. */ import { MatrixEvent, EventStatus } from 'matrix-js-sdk/src/models/event'; +import { EventType } from "matrix-js-sdk/src/@types/event"; +import { MatrixClient } from 'matrix-js-sdk/src/client'; +import { Thread } from 'matrix-js-sdk/src/models/thread'; +import { logger } from 'matrix-js-sdk/src/logger'; import { MatrixClientPeg } from '../MatrixClientPeg'; import shouldHideEvent from "../shouldHideEvent"; import { getHandlerTile, haveTileForEvent } from "../components/views/rooms/EventTile"; import SettingsStore from "../settings/SettingsStore"; -import { EventType } from "matrix-js-sdk/src/@types/event"; -import { MatrixClient } from 'matrix-js-sdk/src/client'; -import { Thread } from 'matrix-js-sdk/src/models/thread'; -import { logger } from 'matrix-js-sdk/src/logger'; /** * Returns whether an event should allow actions like reply, reactions, edit, etc. diff --git a/src/utils/FileUtils.ts b/src/utils/FileUtils.ts index c83f2ed417..21d2928073 100644 --- a/src/utils/FileUtils.ts +++ b/src/utils/FileUtils.ts @@ -16,6 +16,7 @@ limitations under the License. */ import filesize from 'filesize'; + import { IMediaEventContent } from '../customisations/models/IMediaEventContent'; import { _t } from '../languageHandler'; diff --git a/src/utils/IdentityServerUtils.ts b/src/utils/IdentityServerUtils.ts index ef432f71df..e760dd5b45 100644 --- a/src/utils/IdentityServerUtils.ts +++ b/src/utils/IdentityServerUtils.ts @@ -15,12 +15,11 @@ limitations under the License. */ import { SERVICE_TYPES } from 'matrix-js-sdk/src/service-types'; +import { logger } from "matrix-js-sdk/src/logger"; import SdkConfig from '../SdkConfig'; import { MatrixClientPeg } from '../MatrixClientPeg'; -import { logger } from "matrix-js-sdk/src/logger"; - export function getDefaultIdentityServerUrl(): string { return SdkConfig.get()['validated_server_config']['isUrl']; } diff --git a/src/utils/MediaEventHelper.ts b/src/utils/MediaEventHelper.ts index 1494edddc1..24680668d9 100644 --- a/src/utils/MediaEventHelper.ts +++ b/src/utils/MediaEventHelper.ts @@ -15,14 +15,14 @@ limitations under the License. */ import { MatrixEvent } from "matrix-js-sdk/src"; +import { EventType, MsgType } from "matrix-js-sdk/src/@types/event"; +import { logger } from "matrix-js-sdk/src/logger"; + import { LazyValue } from "./LazyValue"; import { Media, mediaFromContent } from "../customisations/Media"; import { decryptFile } from "./DecryptFile"; import { IMediaEventContent } from "../customisations/models/IMediaEventContent"; import { IDestroyable } from "./IDestroyable"; -import { EventType, MsgType } from "matrix-js-sdk/src/@types/event"; - -import { logger } from "matrix-js-sdk/src/logger"; // TODO: We should consider caching the blobs. https://github.com/vector-im/element-web/issues/17192 diff --git a/src/utils/MegolmExportEncryption.ts b/src/utils/MegolmExportEncryption.ts index 47c395bfb7..b88b21132a 100644 --- a/src/utils/MegolmExportEncryption.ts +++ b/src/utils/MegolmExportEncryption.ts @@ -15,11 +15,11 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from '../languageHandler'; import SdkConfig from '../SdkConfig'; -import { logger } from "matrix-js-sdk/src/logger"; - const subtleCrypto = window.crypto.subtle || window.crypto.webkitSubtle; /** diff --git a/src/utils/MessageDiffUtils.tsx b/src/utils/MessageDiffUtils.tsx index 6a2244521e..580cd0792d 100644 --- a/src/utils/MessageDiffUtils.tsx +++ b/src/utils/MessageDiffUtils.tsx @@ -19,11 +19,10 @@ import classNames from 'classnames'; import { diff_match_patch as DiffMatchPatch } from 'diff-match-patch'; import { DiffDOM, IDiff } from "diff-dom"; import { IContent } from "matrix-js-sdk/src/models/event"; +import { logger } from "matrix-js-sdk/src/logger"; import { bodyToHtml, checkBlockNode, IOptsReturnString } from "../HtmlUtils"; -import { logger } from "matrix-js-sdk/src/logger"; - const decodeEntities = (function() { let textarea = null; return function(str: string): string { diff --git a/src/utils/MultiInviter.ts b/src/utils/MultiInviter.ts index f7f36370f9..8606937ec0 100644 --- a/src/utils/MultiInviter.ts +++ b/src/utils/MultiInviter.ts @@ -16,6 +16,7 @@ limitations under the License. import { MatrixError } from "matrix-js-sdk/src/http-api"; import { defer, IDeferred } from "matrix-js-sdk/src/utils"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from '../MatrixClientPeg'; import { AddressType, getAddressType } from '../UserAddress'; @@ -25,8 +26,6 @@ import Modal from "../Modal"; import SettingsStore from "../settings/SettingsStore"; import AskInviteAnywayDialog from "../components/views/dialogs/AskInviteAnywayDialog"; -import { logger } from "matrix-js-sdk/src/logger"; - export enum InviteState { Invited = "invited", Error = "error", diff --git a/src/utils/RoomUpgrade.ts b/src/utils/RoomUpgrade.ts index f2ac4aea4e..1e863d9c84 100644 --- a/src/utils/RoomUpgrade.ts +++ b/src/utils/RoomUpgrade.ts @@ -16,6 +16,7 @@ limitations under the License. import { Room } from "matrix-js-sdk/src/models/room"; import { EventType } from "matrix-js-sdk/src/@types/event"; +import { logger } from "matrix-js-sdk/src/logger"; import { inviteUsersToRoom } from "../RoomInvite"; import Modal, { IHandle } from "../Modal"; @@ -24,8 +25,6 @@ import ErrorDialog from "../components/views/dialogs/ErrorDialog"; import SpaceStore from "../stores/SpaceStore"; import Spinner from "../components/views/elements/Spinner"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProgress { roomUpgraded: boolean; roomSynced?: boolean; diff --git a/src/utils/StorageManager.ts b/src/utils/StorageManager.ts index b4f0c8906d..7d9ce885f7 100644 --- a/src/utils/StorageManager.ts +++ b/src/utils/StorageManager.ts @@ -15,12 +15,12 @@ limitations under the License. */ import { LocalStorageCryptoStore } from 'matrix-js-sdk/src/crypto/store/localStorage-crypto-store'; -import Analytics from '../Analytics'; import { IndexedDBStore } from "matrix-js-sdk/src/store/indexeddb"; import { IndexedDBCryptoStore } from "matrix-js-sdk/src/crypto/store/indexeddb-crypto-store"; - import { logger } from "matrix-js-sdk/src/logger"; +import Analytics from '../Analytics'; + const localStorage = window.localStorage; // just *accessing* indexedDB throws an exception in firefox with diff --git a/src/utils/Whenable.ts b/src/utils/Whenable.ts index 70173b3004..70bd45eb09 100644 --- a/src/utils/Whenable.ts +++ b/src/utils/Whenable.ts @@ -14,11 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { logger } from "matrix-js-sdk/src/logger"; + import { IDestroyable } from "./IDestroyable"; import { arrayFastClone } from "./arrays"; -import { logger } from "matrix-js-sdk/src/logger"; - export type WhenFn = (w: Whenable) => void; /** diff --git a/src/utils/WidgetUtils.ts b/src/utils/WidgetUtils.ts index 106ae4bfda..5f6d321b5a 100644 --- a/src/utils/WidgetUtils.ts +++ b/src/utils/WidgetUtils.ts @@ -19,6 +19,7 @@ import * as url from "url"; import { Capability, IWidget, IWidgetData, MatrixCapabilities } from "matrix-widget-api"; import { Room } from "matrix-js-sdk/src/models/room"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from '../MatrixClientPeg'; import SdkConfig from "../SdkConfig"; @@ -31,8 +32,6 @@ import { objectClone } from "./objects"; import { _t } from "../languageHandler"; import { IApp } from "../stores/WidgetStore"; -import { logger } from "matrix-js-sdk/src/logger"; - // How long we wait for the state event echo to come back from the server // before waitFor[Room/User]Widget rejects its promise const WIDGET_WAIT_TIME = 20000; diff --git a/src/utils/createMatrixClient.ts b/src/utils/createMatrixClient.ts index 0cce729e65..3fed5363d7 100644 --- a/src/utils/createMatrixClient.ts +++ b/src/utils/createMatrixClient.ts @@ -15,12 +15,13 @@ limitations under the License. */ // @ts-ignore - `.ts` is needed here to make TS happy -import IndexedDBWorker from "../workers/indexeddb.worker.ts"; import { createClient, ICreateClientOpts } from "matrix-js-sdk/src/matrix"; import { IndexedDBCryptoStore } from "matrix-js-sdk/src/crypto/store/indexeddb-crypto-store"; import { WebStorageSessionStore } from "matrix-js-sdk/src/store/session/webstorage"; import { IndexedDBStore } from "matrix-js-sdk/src/store/indexeddb"; +import IndexedDBWorker from "../workers/indexeddb.worker.ts"; + const localStorage = window.localStorage; // just *accessing* indexedDB throws an exception in firefox with diff --git a/src/utils/exportUtils/Exporter.ts b/src/utils/exportUtils/Exporter.ts index b23c1153e0..99432c26b4 100644 --- a/src/utils/exportUtils/Exporter.ts +++ b/src/utils/exportUtils/Exporter.ts @@ -16,21 +16,21 @@ limitations under the License. import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { Room } from "matrix-js-sdk/src/models/room"; +import { MatrixClient } from "matrix-js-sdk/src/client"; +import { Direction } from "matrix-js-sdk/src/models/event-timeline"; +import { saveAs } from "file-saver"; +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from "../../MatrixClientPeg"; import { IExportOptions, ExportType } from "./exportUtils"; import { decryptFile } from "../DecryptFile"; import { mediaFromContent } from "../../customisations/Media"; import { formatFullDateNoDay } from "../../DateUtils"; import { isVoiceMessage } from "../EventUtils"; -import { MatrixClient } from "matrix-js-sdk/src/client"; -import { Direction } from "matrix-js-sdk/src/models/event-timeline"; import { IMediaEventContent } from "../../customisations/models/IMediaEventContent"; -import { saveAs } from "file-saver"; import { _t } from "../../languageHandler"; import SdkConfig from "../../SdkConfig"; -import { logger } from "matrix-js-sdk/src/logger"; - type BlobFile = { name: string; blob: Blob; diff --git a/src/utils/exportUtils/HtmlExport.tsx b/src/utils/exportUtils/HtmlExport.tsx index f7d3bb5e09..383b9679fb 100644 --- a/src/utils/exportUtils/HtmlExport.tsx +++ b/src/utils/exportUtils/HtmlExport.tsx @@ -16,29 +16,29 @@ limitations under the License. import React from "react"; import ReactDOM from "react-dom"; -import Exporter from "./Exporter"; -import { mediaFromMxc } from "../../customisations/Media"; import { Room } from "matrix-js-sdk/src/models/room"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { renderToStaticMarkup } from "react-dom/server"; +import { EventType, MsgType } from "matrix-js-sdk/src/@types/event"; +import { logger } from "matrix-js-sdk/src/logger"; + +import Exporter from "./Exporter"; +import { mediaFromMxc } from "../../customisations/Media"; import { Layout } from "../../settings/Layout"; import { shouldFormContinuation } from "../../components/structures/MessagePanel"; import { formatFullDateNoDayNoTime, wantsDateSeparator } from "../../DateUtils"; import { RoomPermalinkCreator } from "../permalinks/Permalinks"; import { _t } from "../../languageHandler"; -import { EventType, MsgType } from "matrix-js-sdk/src/@types/event"; import * as Avatar from "../../Avatar"; import EventTile, { haveTileForEvent } from "../../components/views/rooms/EventTile"; import DateSeparator from "../../components/views/messages/DateSeparator"; import BaseAvatar from "../../components/views/avatars/BaseAvatar"; -import exportJS from "!!raw-loader!./exportJS"; -import { ExportType } from "./exportUtils"; -import { IExportOptions } from "./exportUtils"; +import { ExportType, IExportOptions } from "./exportUtils"; import MatrixClientContext from "../../contexts/MatrixClientContext"; import getExportCSS from "./exportCSS"; import { textForEvent } from "../../TextForEvent"; -import { logger } from "matrix-js-sdk/src/logger"; +import exportJS from "!!raw-loader!./exportJS"; export default class HTMLExporter extends Exporter { protected avatars: Map; diff --git a/src/utils/exportUtils/JSONExport.ts b/src/utils/exportUtils/JSONExport.ts index 6061f33cf6..96e2545827 100644 --- a/src/utils/exportUtils/JSONExport.ts +++ b/src/utils/exportUtils/JSONExport.ts @@ -14,16 +14,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Exporter from "./Exporter"; import { Room } from "matrix-js-sdk/src/models/room"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { EventType } from "matrix-js-sdk/src/@types/event"; +import { logger } from "matrix-js-sdk/src/logger"; + +import Exporter from "./Exporter"; import { formatFullDateNoDay, formatFullDateNoDayNoTime } from "../../DateUtils"; import { haveTileForEvent } from "../../components/views/rooms/EventTile"; -import { ExportType } from "./exportUtils"; -import { IExportOptions } from "./exportUtils"; -import { EventType } from "matrix-js-sdk/src/@types/event"; - -import { logger } from "matrix-js-sdk/src/logger"; +import { ExportType, IExportOptions } from "./exportUtils"; export default class JSONExporter extends Exporter { protected totalSize = 0; diff --git a/src/utils/exportUtils/PlainTextExport.ts b/src/utils/exportUtils/PlainTextExport.ts index e3201314f9..9eb4eca7b8 100644 --- a/src/utils/exportUtils/PlainTextExport.ts +++ b/src/utils/exportUtils/PlainTextExport.ts @@ -14,18 +14,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Exporter from "./Exporter"; import { Room } from "matrix-js-sdk/src/models/room"; import { IContent, MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { logger } from "matrix-js-sdk/src/logger"; + +import Exporter from "./Exporter"; import { formatFullDateNoDay } from "../../DateUtils"; import { _t } from "../../languageHandler"; import { haveTileForEvent } from "../../components/views/rooms/EventTile"; -import { ExportType } from "./exportUtils"; -import { IExportOptions } from "./exportUtils"; +import { ExportType, IExportOptions } from "./exportUtils"; import { textForEvent } from "../../TextForEvent"; -import { logger } from "matrix-js-sdk/src/logger"; - export default class PlainTextExporter extends Exporter { protected totalSize: number; protected mediaOmitText: string; diff --git a/src/utils/membership.ts b/src/utils/membership.ts index 1a120e08b3..cf590865c1 100644 --- a/src/utils/membership.ts +++ b/src/utils/membership.ts @@ -16,12 +16,12 @@ limitations under the License. import { Room } from "matrix-js-sdk/src/models/room"; import { sleep } from "matrix-js-sdk/src/utils"; +import React from "react"; import { MatrixClientPeg } from "../MatrixClientPeg"; import { _t } from "../languageHandler"; import Modal from "../Modal"; import ErrorDialog from "../components/views/dialogs/ErrorDialog"; -import React from "react"; import dis from "../dispatcher/dispatcher"; import RoomViewStore from "../stores/RoomViewStore"; diff --git a/src/utils/permalinks/Permalinks.ts b/src/utils/permalinks/Permalinks.ts index 4c05f42a0d..68a0437ca8 100644 --- a/src/utils/permalinks/Permalinks.ts +++ b/src/utils/permalinks/Permalinks.ts @@ -20,6 +20,7 @@ import { Room } from "matrix-js-sdk/src/models/room"; import { EventType } from "matrix-js-sdk/src/@types/event"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from "../../MatrixClientPeg"; import SpecPermalinkConstructor, { baseUrl as matrixtoBaseUrl } from "./SpecPermalinkConstructor"; @@ -28,8 +29,6 @@ import ElementPermalinkConstructor from "./ElementPermalinkConstructor"; import matrixLinkify from "../../linkify-matrix"; import SdkConfig from "../../SdkConfig"; -import { logger } from "matrix-js-sdk/src/logger"; - // The maximum number of servers to pick when working out which servers // to add to permalinks. The servers are appended as ?via=example.org const MAX_SERVER_CANDIDATES = 3; diff --git a/src/utils/replaceableComponent.ts b/src/utils/replaceableComponent.ts index f8dd5f8ac6..3f085adbf0 100644 --- a/src/utils/replaceableComponent.ts +++ b/src/utils/replaceableComponent.ts @@ -15,6 +15,7 @@ limitations under the License. */ import * as React from 'react'; + import * as sdk from '../index'; /** diff --git a/src/verification.ts b/src/verification.ts index dfee6608ea..e17e0e4e09 100644 --- a/src/verification.ts +++ b/src/verification.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { User } from "matrix-js-sdk/src/models/user"; +import { verificationMethods as VerificationMethods } from 'matrix-js-sdk/src/crypto'; import { MatrixClientPeg } from './MatrixClientPeg'; import dis from "./dispatcher/dispatcher"; @@ -22,7 +23,6 @@ import Modal from './Modal'; import { RightPanelPhases } from "./stores/RightPanelStorePhases"; import { findDMForUser } from './createRoom'; import { accessSecretStorage } from './SecurityManager'; -import { verificationMethods as VerificationMethods } from 'matrix-js-sdk/src/crypto'; import { Action } from './dispatcher/actions'; import UntrustedDeviceDialog from "./components/views/dialogs/UntrustedDeviceDialog"; import { IDevice } from "./components/views/right_panel/UserInfo"; diff --git a/src/widgets/CapabilityText.tsx b/src/widgets/CapabilityText.tsx index 8c13a4b2fc..f9c8c9427f 100644 --- a/src/widgets/CapabilityText.tsx +++ b/src/widgets/CapabilityText.tsx @@ -24,10 +24,11 @@ import { WidgetEventCapability, WidgetKind, } from "matrix-widget-api"; -import { _t, _td, TranslatedString } from "../languageHandler"; import { EventType, MsgType } from "matrix-js-sdk/src/@types/event"; -import { ElementWidgetCapabilities } from "../stores/widgets/ElementWidgetCapabilities"; import React from "react"; + +import { _t, _td, TranslatedString } from "../languageHandler"; +import { ElementWidgetCapabilities } from "../stores/widgets/ElementWidgetCapabilities"; import { MatrixClientPeg } from "../MatrixClientPeg"; import TextWithTooltip from "../components/views/elements/TextWithTooltip"; diff --git a/src/widgets/Jitsi.ts b/src/widgets/Jitsi.ts index cd31e57d7c..f82dbef7f1 100644 --- a/src/widgets/Jitsi.ts +++ b/src/widgets/Jitsi.ts @@ -14,11 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { logger } from "matrix-js-sdk/src/logger"; + import SdkConfig from "../SdkConfig"; import { MatrixClientPeg } from "../MatrixClientPeg"; -import { logger } from "matrix-js-sdk/src/logger"; - const JITSI_WK_PROPERTY = "im.vector.riot.jitsi"; export interface JitsiWidgetData { diff --git a/src/widgets/ManagedHybrid.ts b/src/widgets/ManagedHybrid.ts index f623becbd8..86c035182a 100644 --- a/src/widgets/ManagedHybrid.ts +++ b/src/widgets/ManagedHybrid.ts @@ -15,6 +15,8 @@ limitations under the License. */ import { IWidget } from "matrix-widget-api"; +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from "../MatrixClientPeg"; import { getCallBehaviourWellKnown } from "../utils/WellKnownUtils"; import WidgetUtils from "../utils/WidgetUtils"; @@ -23,8 +25,6 @@ import WidgetEchoStore from "../stores/WidgetEchoStore"; import WidgetStore from "../stores/WidgetStore"; import SdkConfig from "../SdkConfig"; -import { logger } from "matrix-js-sdk/src/logger"; - /* eslint-disable camelcase */ interface IManagedHybridWidgetData { widget_id: string; diff --git a/test/CallHandler-test.ts b/test/CallHandler-test.ts index 1a4560ad4a..92357b67b3 100644 --- a/test/CallHandler-test.ts +++ b/test/CallHandler-test.ts @@ -16,13 +16,14 @@ limitations under the License. import './skinned-sdk'; +import { CallEvent, CallState } from 'matrix-js-sdk/src/webrtc/call'; +import EventEmitter from 'events'; + import CallHandler, { PlaceCallType, CallHandlerEvent } from '../src/CallHandler'; import { stubClient, mkStubRoom } from './test-utils'; import { MatrixClientPeg } from '../src/MatrixClientPeg'; import dis from '../src/dispatcher/dispatcher'; -import { CallEvent, CallState } from 'matrix-js-sdk/src/webrtc/call'; import DMRoomMap from '../src/utils/DMRoomMap'; -import EventEmitter from 'events'; import SdkConfig from '../src/SdkConfig'; import { ActionPayload } from '../src/dispatcher/payloads'; import { Action } from '../src/dispatcher/actions'; diff --git a/test/DecryptionFailureTracker-test.js b/test/DecryptionFailureTracker-test.js index bc751ba44e..8b3a162f1d 100644 --- a/test/DecryptionFailureTracker-test.js +++ b/test/DecryptionFailureTracker-test.js @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { DecryptionFailure, DecryptionFailureTracker } from '../src/DecryptionFailureTracker'; - import { MatrixEvent } from 'matrix-js-sdk'; +import { DecryptionFailure, DecryptionFailureTracker } from '../src/DecryptionFailureTracker'; + class MockDecryptionError extends Error { constructor(code) { super(); diff --git a/test/PosthogAnalytics-test.ts b/test/PosthogAnalytics-test.ts index 65af8b51f3..f24312a7ce 100644 --- a/test/PosthogAnalytics-test.ts +++ b/test/PosthogAnalytics-test.ts @@ -22,7 +22,6 @@ import { IRoomEvent, PosthogAnalytics, } from '../src/PosthogAnalytics'; - import SdkConfig from '../src/SdkConfig'; class FakePosthog { diff --git a/test/TextForEvent-test.ts b/test/TextForEvent-test.ts index b8a459af67..90702395a6 100644 --- a/test/TextForEvent-test.ts +++ b/test/TextForEvent-test.ts @@ -1,10 +1,11 @@ import './skinned-sdk'; -import { textForEvent } from "../src/TextForEvent"; import { MatrixEvent } from "matrix-js-sdk"; +import renderer from 'react-test-renderer'; + +import { textForEvent } from "../src/TextForEvent"; import SettingsStore from "../src/settings/SettingsStore"; import { SettingLevel } from "../src/settings/SettingLevel"; -import renderer from 'react-test-renderer'; function mockPinnedEvent( pinnedMessageIds?: string[], diff --git a/test/UserActivity-test.js b/test/UserActivity-test.js index 2c622b2638..c0ebc1e7bf 100644 --- a/test/UserActivity-test.js +++ b/test/UserActivity-test.js @@ -16,6 +16,7 @@ limitations under the License. import FakeTimers from '@sinonjs/fake-timers'; import EventEmitter from 'events'; + import UserActivity from '../src/UserActivity'; class FakeDomEventEmitter extends EventEmitter { diff --git a/test/components/structures/CallEventGrouper-test.ts b/test/components/structures/CallEventGrouper-test.ts index 5719d92902..0eef27851d 100644 --- a/test/components/structures/CallEventGrouper-test.ts +++ b/test/components/structures/CallEventGrouper-test.ts @@ -15,13 +15,14 @@ limitations under the License. */ import "../../skinned-sdk"; -import { stubClient } from '../../test-utils'; -import { MatrixClientPeg } from '../../../src/MatrixClientPeg'; import { MatrixClient } from 'matrix-js-sdk'; import { EventType } from "matrix-js-sdk/src/@types/event"; -import CallEventGrouper, { CustomCallState } from "../../../src/components/structures/CallEventGrouper"; import { CallState } from "matrix-js-sdk/src/webrtc/call"; +import { stubClient } from '../../test-utils'; +import { MatrixClientPeg } from '../../../src/MatrixClientPeg'; +import CallEventGrouper, { CustomCallState } from "../../../src/components/structures/CallEventGrouper"; + const MY_USER_ID = "@me:here"; const THEIR_USER_ID = "@they:here"; diff --git a/test/components/structures/GroupView-test.js b/test/components/structures/GroupView-test.js index 2ff1257d32..2fbea5ce7c 100644 --- a/test/components/structures/GroupView-test.js +++ b/test/components/structures/GroupView-test.js @@ -17,13 +17,13 @@ limitations under the License. import React from 'react'; import ReactDOM from 'react-dom'; import ReactTestUtils from 'react-dom/test-utils'; - import MockHttpBackend from 'matrix-mock-request'; -import { MatrixClientPeg } from '../../../src/MatrixClientPeg'; -import sdk from '../../skinned-sdk'; import Matrix from 'matrix-js-sdk'; +import { MatrixClientPeg } from '../../../src/MatrixClientPeg'; +import sdk from '../../skinned-sdk'; import * as TestUtils from '../../test-utils'; + const { waitForUpdate } = TestUtils; const GroupView = sdk.getComponent('structures.GroupView'); diff --git a/test/components/structures/MessagePanel-test.js b/test/components/structures/MessagePanel-test.js index ab585f4c5f..f17c657d7b 100644 --- a/test/components/structures/MessagePanel-test.js +++ b/test/components/structures/MessagePanel-test.js @@ -15,29 +15,27 @@ See the License for the specific language governing permissions and limitations under the License. */ -import SettingsStore from "../../../src/settings/SettingsStore"; - import React from 'react'; import ReactDOM from "react-dom"; -const TestUtils = require('react-dom/test-utils'); -const expect = require('expect'); import { EventEmitter } from "events"; - -import sdk from '../../skinned-sdk'; - -const MessagePanel = sdk.getComponent('structures.MessagePanel'); -import { MatrixClientPeg } from '../../../src/MatrixClientPeg'; import Matrix from 'matrix-js-sdk'; - -const TestUtilsMatrix = require('../../test-utils'); import FakeTimers from '@sinonjs/fake-timers'; - import { mount } from "enzyme"; +import { MatrixClientPeg } from '../../../src/MatrixClientPeg'; +import sdk from '../../skinned-sdk'; +import SettingsStore from "../../../src/settings/SettingsStore"; import MatrixClientContext from "../../../src/contexts/MatrixClientContext"; import RoomContext from "../../../src/contexts/RoomContext"; import DMRoomMap from "../../../src/utils/DMRoomMap"; +const TestUtils = require('react-dom/test-utils'); +const expect = require('expect'); + +const MessagePanel = sdk.getComponent('structures.MessagePanel'); + +const TestUtilsMatrix = require('../../test-utils'); + let client; const room = new Matrix.Room("!roomId:server_name"); diff --git a/test/components/structures/auth/Login-test.js b/test/components/structures/auth/Login-test.js index 9def0c8d95..e1c0aa899e 100644 --- a/test/components/structures/auth/Login-test.js +++ b/test/components/structures/auth/Login-test.js @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import ReactDOM from 'react-dom'; import ReactTestUtils from 'react-dom/test-utils'; + import sdk from '../../../skinned-sdk'; import SdkConfig from '../../../../src/SdkConfig'; import { mkServerConfig } from "../../../test-utils"; diff --git a/test/components/structures/auth/Registration-test.js b/test/components/structures/auth/Registration-test.js index e09304962f..37f90ee77d 100644 --- a/test/components/structures/auth/Registration-test.js +++ b/test/components/structures/auth/Registration-test.js @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import ReactDOM from 'react-dom'; import ReactTestUtils from 'react-dom/test-utils'; + import sdk from '../../../skinned-sdk'; import SdkConfig from '../../../../src/SdkConfig'; import { mkServerConfig } from "../../../test-utils"; diff --git a/test/components/views/dialogs/AccessSecretStorageDialog-test.js b/test/components/views/dialogs/AccessSecretStorageDialog-test.js index 8c16e7f104..17f56c72db 100644 --- a/test/components/views/dialogs/AccessSecretStorageDialog-test.js +++ b/test/components/views/dialogs/AccessSecretStorageDialog-test.js @@ -16,6 +16,7 @@ limitations under the License. import React from 'react'; import TestRenderer from 'react-test-renderer'; + import sdk from '../../../skinned-sdk'; import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; import { stubClient } from '../../../test-utils'; diff --git a/test/components/views/dialogs/InteractiveAuthDialog-test.js b/test/components/views/dialogs/InteractiveAuthDialog-test.js index dcf89afb4d..86c803be2c 100644 --- a/test/components/views/dialogs/InteractiveAuthDialog-test.js +++ b/test/components/views/dialogs/InteractiveAuthDialog-test.js @@ -22,7 +22,6 @@ import { sleep } from "matrix-js-sdk/src/utils"; import sdk from '../../../skinned-sdk'; import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; - import * as TestUtilsMatrix from '../../../test-utils'; const InteractiveAuthDialog = sdk.getComponent( diff --git a/test/components/views/elements/MemberEventListSummary-test.js b/test/components/views/elements/MemberEventListSummary-test.js index dcb895f09e..834e5a67a9 100644 --- a/test/components/views/elements/MemberEventListSummary-test.js +++ b/test/components/views/elements/MemberEventListSummary-test.js @@ -1,6 +1,7 @@ import React from 'react'; import ReactTestUtils from 'react-dom/test-utils'; import ShallowRenderer from "react-test-renderer/shallow"; + import sdk from '../../../skinned-sdk'; import * as testUtils from '../../../test-utils'; diff --git a/test/components/views/groups/GroupMemberList-test.js b/test/components/views/groups/GroupMemberList-test.js index 7e01540d38..1afee21cdf 100644 --- a/test/components/views/groups/GroupMemberList-test.js +++ b/test/components/views/groups/GroupMemberList-test.js @@ -17,13 +17,13 @@ limitations under the License. import React from "react"; import ReactDOM from "react-dom"; import ReactTestUtils from "react-dom/test-utils"; - import MockHttpBackend from "matrix-mock-request"; -import { MatrixClientPeg } from "../../../../src/MatrixClientPeg"; -import sdk from "../../../skinned-sdk"; import Matrix from "matrix-js-sdk"; +import { MatrixClientPeg } from "../../../../src/MatrixClientPeg"; +import sdk from "../../../skinned-sdk"; import * as TestUtils from "../../../test-utils"; + const { waitForUpdate } = TestUtils; const GroupMemberList = sdk.getComponent("views.groups.GroupMemberList"); diff --git a/test/components/views/messages/MKeyVerificationConclusion-test.js b/test/components/views/messages/MKeyVerificationConclusion-test.js index 45e122295b..b06e242f4e 100644 --- a/test/components/views/messages/MKeyVerificationConclusion-test.js +++ b/test/components/views/messages/MKeyVerificationConclusion-test.js @@ -2,10 +2,10 @@ import '../../../skinned-sdk'; // Must be first for skinning to work import React from 'react'; import TestRenderer from 'react-test-renderer'; import { EventEmitter } from 'events'; -import * as TestUtils from '../../../test-utils'; - -import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; import { MatrixEvent } from 'matrix-js-sdk'; + +import * as TestUtils from '../../../test-utils'; +import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; import MKeyVerificationConclusion from '../../../../src/components/views/messages/MKeyVerificationConclusion'; const trustworthy = () => ({ isCrossSigningVerified: () => true }); diff --git a/test/components/views/rooms/MemberList-test.tsx b/test/components/views/rooms/MemberList-test.tsx index f720bc7a6d..7a1e73f0e9 100644 --- a/test/components/views/rooms/MemberList-test.tsx +++ b/test/components/views/rooms/MemberList-test.tsx @@ -19,12 +19,12 @@ import "../../../skinned-sdk"; import React from 'react'; import ReactTestUtils from 'react-dom/test-utils'; import ReactDOM from 'react-dom'; - -import * as TestUtils from '../../../test-utils'; -import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; import { Room } from 'matrix-js-sdk/src/models/room'; import { RoomMember } from 'matrix-js-sdk/src/models/room-member'; import { User } from "matrix-js-sdk/src/models/user"; + +import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; +import * as TestUtils from '../../../test-utils'; import { compare } from "../../../../src/utils/strings"; import MemberList from "../../../../src/components/views/rooms/MemberList"; import MemberTile from '../../../../src/components/views/rooms/MemberTile'; diff --git a/test/components/views/rooms/RoomHeader-test.tsx b/test/components/views/rooms/RoomHeader-test.tsx index 859107416e..83af58aa4c 100644 --- a/test/components/views/rooms/RoomHeader-test.tsx +++ b/test/components/views/rooms/RoomHeader-test.tsx @@ -3,14 +3,12 @@ import ReactDOM from 'react-dom'; import "../../../skinned-sdk"; +import { Room, PendingEventOrdering, MatrixEvent, MatrixClient } from 'matrix-js-sdk'; + import * as TestUtils from '../../../test-utils'; - import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; - import DMRoomMap from '../../../../src/utils/DMRoomMap'; import RoomHeader from '../../../../src/components/views/rooms/RoomHeader'; - -import { Room, PendingEventOrdering, MatrixEvent, MatrixClient } from 'matrix-js-sdk'; import { SearchScope } from '../../../../src/components/views/rooms/SearchBar'; import { E2EStatus } from '../../../../src/utils/ShieldUtils'; import { PlaceCallType } from '../../../../src/CallHandler'; diff --git a/test/components/views/rooms/RoomList-test.js b/test/components/views/rooms/RoomList-test.js index 760aee69a8..a99b20e3dd 100644 --- a/test/components/views/rooms/RoomList-test.js +++ b/test/components/views/rooms/RoomList-test.js @@ -1,16 +1,13 @@ import React from 'react'; import ReactTestUtils from 'react-dom/test-utils'; import ReactDOM from 'react-dom'; +import { MatrixClient, Room, RoomMember } from 'matrix-js-sdk'; import * as TestUtils from '../../../test-utils'; - import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; import sdk from '../../../skinned-sdk'; - import dis from '../../../../src/dispatcher/dispatcher'; import DMRoomMap from '../../../../src/utils/DMRoomMap'; - -import { MatrixClient, Room, RoomMember } from 'matrix-js-sdk'; import { DefaultTagID } from "../../../../src/stores/room-list/models"; import RoomListStore, { RoomListStoreClass } from "../../../../src/stores/room-list/RoomListStore"; import RoomListLayoutStore from "../../../../src/stores/room-list/RoomListLayoutStore"; diff --git a/test/components/views/rooms/RoomSettings-test.js b/test/components/views/rooms/RoomSettings-test.js index cd70b81cd7..f05262d102 100644 --- a/test/components/views/rooms/RoomSettings-test.js +++ b/test/components/views/rooms/RoomSettings-test.js @@ -1,6 +1,7 @@ // TODO: Rewrite room settings tests for dialog support import React from 'react'; import ReactDOM from 'react-dom'; + import * as testUtils from '../../../test-utils'; import sdk from '../../../skinned-sdk'; import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; diff --git a/test/components/views/settings/CryptographyPanel-test.tsx b/test/components/views/settings/CryptographyPanel-test.tsx index 56056b53ec..f4936b81f2 100644 --- a/test/components/views/settings/CryptographyPanel-test.tsx +++ b/test/components/views/settings/CryptographyPanel-test.tsx @@ -1,11 +1,11 @@ import '../../../skinned-sdk'; -import * as TestUtils from '../../../test-utils'; -import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; import React, { ReactElement } from 'react'; import ReactDOM from 'react-dom'; - import { MatrixClient } from 'matrix-js-sdk'; + +import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; +import * as TestUtils from '../../../test-utils'; import CryptographyPanel from '../../../../src/components/views/settings/CryptographyPanel'; describe('CryptographyPanel', () => { diff --git a/test/createRoom-test.js b/test/createRoom-test.js index 11cb7edf5d..85fe945a1d 100644 --- a/test/createRoom-test.js +++ b/test/createRoom-test.js @@ -1,7 +1,8 @@ import './skinned-sdk'; // Must be first for skinning to work -import { waitForMember, canEncryptToAllUsers } from '../src/createRoom'; import { EventEmitter } from 'events'; +import { waitForMember, canEncryptToAllUsers } from '../src/createRoom'; + /* Shorter timeout, we've got tests to run */ const timeout = 30; diff --git a/test/end-to-end-tests/src/rest/creator.js b/test/end-to-end-tests/src/rest/creator.js index f01a325a71..3dc50b4599 100644 --- a/test/end-to-end-tests/src/rest/creator.js +++ b/test/end-to-end-tests/src/rest/creator.js @@ -17,6 +17,7 @@ limitations under the License. const { exec } = require('child_process'); const request = require('request-promise-native'); + const RestSession = require('./session'); const RestMultiSession = require('./multi'); diff --git a/test/end-to-end-tests/src/rest/session.js b/test/end-to-end-tests/src/rest/session.js index 3c04592d02..fc1a0e2852 100644 --- a/test/end-to-end-tests/src/rest/session.js +++ b/test/end-to-end-tests/src/rest/session.js @@ -15,6 +15,7 @@ limitations under the License. */ const request = require('request-promise-native'); + const Logger = require('../logger'); const RestRoom = require('./room'); const { approveConsent } = require('./consent'); diff --git a/test/end-to-end-tests/src/scenarios/e2e-encryption.js b/test/end-to-end-tests/src/scenarios/e2e-encryption.js index 23234b85ce..ce25344109 100644 --- a/test/end-to-end-tests/src/scenarios/e2e-encryption.js +++ b/test/end-to-end-tests/src/scenarios/e2e-encryption.js @@ -15,6 +15,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +const assert = require('assert'); + const sendMessage = require('../usecases/send-message'); const acceptInvite = require('../usecases/accept-invite'); const { receiveMessage } = require('../usecases/timeline'); @@ -22,7 +24,6 @@ const { createDm } = require('../usecases/create-room'); const { checkRoomSettings } = require('../usecases/room-settings'); const { startSasVerification, acceptSasVerification } = require('../usecases/verify'); const { setupSecureBackup } = require('../usecases/security'); -const assert = require('assert'); const { measureStart, measureStop } = require('../util'); module.exports = async function e2eEncryptionScenarios(alice, bob) { diff --git a/test/end-to-end-tests/src/scenarios/lazy-loading.js b/test/end-to-end-tests/src/scenarios/lazy-loading.js index 406f7b24a3..aa3d5aba72 100644 --- a/test/end-to-end-tests/src/scenarios/lazy-loading.js +++ b/test/end-to-end-tests/src/scenarios/lazy-loading.js @@ -15,6 +15,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +const assert = require('assert'); + const { delay } = require('../util'); const join = require('../usecases/join'); const sendMessage = require('../usecases/send-message'); @@ -25,7 +27,6 @@ const { const { createRoom } = require('../usecases/create-room'); const { getMembersInMemberlist } = require('../usecases/memberlist'); const { changeRoomSettings } = require('../usecases/room-settings'); -const assert = require('assert'); module.exports = async function lazyLoadingScenarios(alice, bob, charlies) { console.log(" creating a room for lazy loading member scenarios:"); diff --git a/test/end-to-end-tests/src/session.js b/test/end-to-end-tests/src/session.js index f5d20fde28..7a2863ac2a 100644 --- a/test/end-to-end-tests/src/session.js +++ b/test/end-to-end-tests/src/session.js @@ -16,6 +16,7 @@ limitations under the License. */ const puppeteer = require('puppeteer'); + const Logger = require('./logger'); const LogBuffer = require('./logbuffer'); const { delay } = require('./util'); diff --git a/test/end-to-end-tests/src/usecases/memberlist.js b/test/end-to-end-tests/src/usecases/memberlist.js index 26c0c39755..e56b4f3fff 100644 --- a/test/end-to-end-tests/src/usecases/memberlist.js +++ b/test/end-to-end-tests/src/usecases/memberlist.js @@ -16,6 +16,7 @@ limitations under the License. */ const assert = require('assert'); + const { openRoomSummaryCard } = require("./rightpanel"); async function openMemberInfo(session, name) { diff --git a/test/end-to-end-tests/src/usecases/room-settings.js b/test/end-to-end-tests/src/usecases/room-settings.js index 83d6fd79a8..e0b18e99d1 100644 --- a/test/end-to-end-tests/src/usecases/room-settings.js +++ b/test/end-to-end-tests/src/usecases/room-settings.js @@ -16,6 +16,7 @@ limitations under the License. */ const assert = require('assert'); + const { openRoomSummaryCard } = require("./rightpanel"); const { acceptDialog } = require('./dialog'); diff --git a/test/end-to-end-tests/src/usecases/verify.js b/test/end-to-end-tests/src/usecases/verify.js index a1f600833d..f45292a02d 100644 --- a/test/end-to-end-tests/src/usecases/verify.js +++ b/test/end-to-end-tests/src/usecases/verify.js @@ -16,6 +16,7 @@ limitations under the License. */ const assert = require('assert'); + const { openMemberInfo } = require("./memberlist"); async function startVerification(session, name) { diff --git a/test/end-to-end-tests/start.js b/test/end-to-end-tests/start.js index f65d6137f4..1388e84577 100644 --- a/test/end-to-end-tests/start.js +++ b/test/end-to-end-tests/start.js @@ -14,12 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ +const fs = require("fs"); +const program = require('commander'); + const ElementSession = require('./src/session'); const scenario = require('./src/scenario'); const RestSessionCreator = require('./src/rest/creator'); -const fs = require("fs"); -const program = require('commander'); program .option('--no-logs', "don't output logs, document html on error", false) .option('--app-url [url]', "url to test", "http://localhost:5000") diff --git a/test/i18n-test/languageHandler-test.js b/test/i18n-test/languageHandler-test.js index b9bc955269..70b2fd169d 100644 --- a/test/i18n-test/languageHandler-test.js +++ b/test/i18n-test/languageHandler-test.js @@ -1,6 +1,7 @@ +import * as languageHandler from '../../src/languageHandler'; + const React = require('react'); const expect = require('expect'); -import * as languageHandler from '../../src/languageHandler'; const testUtils = require('../test-utils'); diff --git a/test/setupTests.js b/test/setupTests.js index e719f715c9..15f878eced 100644 --- a/test/setupTests.js +++ b/test/setupTests.js @@ -1,8 +1,9 @@ -import * as languageHandler from "../src/languageHandler"; import { TextEncoder, TextDecoder } from 'util'; import Adapter from "@wojtekmaj/enzyme-adapter-react-17"; import { configure } from "enzyme"; +import * as languageHandler from "../src/languageHandler"; + languageHandler.setLanguage('en'); languageHandler.setMissingEntryGenerator(key => key.split("|", 2)[1]); diff --git a/test/stores/RoomViewStore-test.js b/test/stores/RoomViewStore-test.js index cb5d7d21f0..1a34bc7267 100644 --- a/test/stores/RoomViewStore-test.js +++ b/test/stores/RoomViewStore-test.js @@ -1,7 +1,5 @@ import RoomViewStore from '../../src/stores/RoomViewStore'; - import { MatrixClientPeg as peg } from '../../src/MatrixClientPeg'; - import * as testUtils from '../test-utils'; const dispatch = testUtils.getDispatchForStore(RoomViewStore); diff --git a/test/test-utils.js b/test/test-utils.js index d43a08ab3a..d818877c89 100644 --- a/test/test-utils.js +++ b/test/test-utils.js @@ -1,11 +1,12 @@ import React from 'react'; +import ShallowRenderer from 'react-test-renderer/shallow'; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { MatrixClientPeg as peg } from '../src/MatrixClientPeg'; import dis from '../src/dispatcher/dispatcher'; import { makeType } from "../src/utils/TypeUtils"; import { ValidatedServerConfig } from "../src/utils/AutoDiscoveryUtils"; -import ShallowRenderer from 'react-test-renderer/shallow'; import MatrixClientContext from "../src/contexts/MatrixClientContext"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; export function getRenderer() { // Old: ReactTestUtils.createRenderer(); diff --git a/test/utils/export-test.tsx b/test/utils/export-test.tsx index 66436da9c5..90d44c08e3 100644 --- a/test/utils/export-test.tsx +++ b/test/utils/export-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import { IContent, MatrixClient, MatrixEvent, Room } from "matrix-js-sdk"; + import { MatrixClientPeg } from "../../src/MatrixClientPeg"; import { IExportOptions, ExportType, ExportFormat } from "../../src/utils/exportUtils/exportUtils"; import '../skinned-sdk'; @@ -22,6 +23,7 @@ import PlainTextExporter from "../../src/utils/exportUtils/PlainTextExport"; import HTMLExporter from "../../src/utils/exportUtils/HtmlExport"; import * as TestUtilsMatrix from '../test-utils'; import { stubClient } from '../test-utils'; + import { renderToString } from "react-dom/server"; let client: MatrixClient; diff --git a/test/utils/test-utils.ts b/test/utils/test-utils.ts index 8bc602fe35..f1464f922c 100644 --- a/test/utils/test-utils.ts +++ b/test/utils/test-utils.ts @@ -17,11 +17,11 @@ limitations under the License. import { MatrixClient } from "matrix-js-sdk/src/client"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { EventType } from "matrix-js-sdk/src/@types/event"; +import { EventEmitter } from "events"; import { AsyncStoreWithClient } from "../../src/stores/AsyncStoreWithClient"; import { mkEvent, mkStubRoom } from "../test-utils"; import { EnhancedMap } from "../../src/utils/maps"; -import { EventEmitter } from "events"; // These methods make some use of some private methods on the AsyncStoreWithClient to simplify getting into a consistent // ready state without needing to wire up a dispatcher and pretend to be a js-sdk client.