diff --git a/.eslintrc.js b/.eslintrc.js index 9d68942228..4658fb9792 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -66,8 +66,8 @@ module.exports = { settings: { react: { version: "detect", - } - } + }, + }, }; function buildRestrictedPropertiesOptions(properties, message) { diff --git a/package.json b/package.json index 689c4f59f7..71b91b5840 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,7 @@ "emojibase-data": "^6.2.0", "emojibase-regex": "^5.1.3", "escape-html": "^1.0.3", + "eslint-plugin-import": "^2.25.2", "file-saver": "^2.0.5", "filesize": "6.1.0", "flux": "2.1.1", 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 10d3ce9538..09cb78d980 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/CallHandler.tsx b/src/CallHandler.tsx index f6cd54e474..e7d6e99129 100644 --- a/src/CallHandler.tsx +++ b/src/CallHandler.tsx @@ -18,6 +18,15 @@ limitations under the License. */ import React from 'react'; +import { base32 } from "rfc4648"; +import { MatrixCall, CallErrorCode, CallState, CallEvent, CallParty, CallType } from "matrix-js-sdk/src/webrtc/call"; +import { 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 { SyncState } from "matrix-js-sdk/src/sync.api"; import { MatrixClientPeg } from './MatrixClientPeg'; import Modal from './Modal'; @@ -28,33 +37,23 @@ import SettingsStore from './settings/SettingsStore'; import { Jitsi } from "./widgets/Jitsi"; import { WidgetType } from "./widgets/WidgetType"; import { SettingLevel } from "./settings/SettingLevel"; -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 ToastStore from './stores/ToastStore'; import IncomingCallToast from "./toasts/IncomingCallToast"; -import { SyncState } from "matrix-js-sdk/src/sync.api"; 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 61d21e047a..02cc987735 100644 --- a/src/ContentMessages.tsx +++ b/src/ContentMessages.tsx @@ -18,17 +18,20 @@ limitations under the License. import React from "react"; import { MatrixClient } from "matrix-js-sdk/src/client"; -import { IEncryptedFile, IMediaEventInfo } from "./customisations/models/IMediaEventContent"; import { IUploadOpts } from "matrix-js-sdk/src/@types/requests"; import { MsgType, RelationType } from "matrix-js-sdk/src/@types/event"; +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 { IEventRelation } from "matrix-js-sdk/src"; +import { IEncryptedFile, IMediaEventInfo } from "./customisations/models/IMediaEventContent"; 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"; @@ -40,14 +43,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"; -import { IEventRelation } from "matrix-js-sdk/src"; - 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/HtmlUtils.tsx b/src/HtmlUtils.tsx index 9dad17f6ac..f6c045714a 100644 --- a/src/HtmlUtils.tsx +++ b/src/HtmlUtils.tsx @@ -20,13 +20,13 @@ limitations under the License. import React, { ReactNode } from 'react'; import sanitizeHtml from 'sanitize-html'; import cheerio from 'cheerio'; -import { _linkifyElement, _linkifyString } from './linkify-matrix'; import classNames from 'classnames'; import EMOJIBASE_REGEX from 'emojibase-regex'; import katex from 'katex'; import { AllHtmlEntities } from 'html-entities'; import { IContent } from 'matrix-js-sdk/src/models/event'; +import { _linkifyElement, _linkifyString } from './linkify-matrix'; import { IExtendedSanitizeOptions } from './@types/sanitize-html'; import SettingsStore from './settings/SettingsStore'; import { tryTransformPermalinkToLocalHref } from "./utils/permalinks/Permalinks"; 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 9fd32d51e5..2f1c948839 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"; @@ -57,8 +58,6 @@ import LazyLoadingResyncDialog from "./components/views/dialogs/LazyLoadingResyn import LazyLoadingDisabledDialog from "./components/views/dialogs/LazyLoadingDisabledDialog"; import SessionRestoreErrorDialog from "./components/views/dialogs/SessionRestoreErrorDialog"; import StorageEvictedDialog from "./components/views/dialogs/StorageEvictedDialog"; - -import { logger } from "matrix-js-sdk/src/logger"; import { setSentryUser } from "./sentry"; const HOMESERVER_URL_KEY = "mx_hs_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/Markdown.ts b/src/Markdown.ts index b3e5363eb0..a086e9516e 100644 --- a/src/Markdown.ts +++ b/src/Markdown.ts @@ -18,6 +18,7 @@ limitations under the License. import * as commonmark from 'commonmark'; import { escape } from "lodash"; import { logger } from 'matrix-js-sdk/src/logger'; + import { linkify } from './linkify-matrix'; const ALLOWED_HTML_TAGS = ['sub', 'sup', 'del', 'u']; diff --git a/src/MatrixClientPeg.ts b/src/MatrixClientPeg.ts index c6da0ed831..42a54e3ca1 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 3f5c7fe0a6..2fc2ee3643 100644 --- a/src/Notifier.ts +++ b/src/Notifier.ts @@ -19,6 +19,8 @@ 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 { MsgType } from "matrix-js-sdk/src/@types/event"; import { MatrixClientPeg } from './MatrixClientPeg'; import SdkConfig from './SdkConfig'; @@ -38,9 +40,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"; -import { MsgType } from "matrix-js-sdk/src/@types/event"; - /* * 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 45d2cd692f..6243a17b55 100644 --- a/src/PosthogAnalytics.ts +++ b/src/PosthogAnalytics.ts @@ -15,12 +15,12 @@ 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 { MatrixClientPeg } from "./MatrixClientPeg"; -import { MatrixClient } from "matrix-js-sdk/src/client"; - -import { logger } from "matrix-js-sdk/src/logger"; import SettingsStore from "./settings/SettingsStore"; /* 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 50d75ea91e..d23703e581 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 { ConditionKind, IPushRule, PushRuleActionName, 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 b110aef031..e887bf02c3 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 26649ba416..0383b50fc4 100644 --- a/src/SecurityManager.ts +++ b/src/SecurityManager.ts @@ -17,22 +17,22 @@ 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 { ComponentType } from "react"; + 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"; -import { ComponentType } from "react"; import QuestionDialog from "./components/views/dialogs/QuestionDialog"; // This stores the secret storage private keys in memory for the JS SDK. This is 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 baa84f28f5..f7435ddda8 100644 --- a/src/SlashCommands.tsx +++ b/src/SlashCommands.tsx @@ -20,8 +20,10 @@ limitations under the License. import * as React from 'react'; import { User } from "matrix-js-sdk/src/models/user"; import { EventType } from "matrix-js-sdk/src/@types/event"; - 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'; @@ -37,7 +39,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"; @@ -55,8 +56,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"; import { TimelineRenderingType } from './contexts/RoomContext'; import RoomViewStore from "./stores/RoomViewStore"; diff --git a/src/Terms.ts b/src/Terms.ts index 218ad8ab6f..4b1480f536 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 112e6d6227..639bec8a3d 100644 --- a/src/TextForEvent.tsx +++ b/src/TextForEvent.tsx @@ -15,6 +15,12 @@ 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 { GuestAccess, HistoryVisibility, JoinRule } from "matrix-js-sdk/src/@types/partials"; +import { EventType, MsgType } from "matrix-js-sdk/src/@types/event"; + import { _t } from './languageHandler'; import * as Roles from './Roles'; import { isValid3pidInvite } from "./RoomInvite"; @@ -25,15 +31,9 @@ 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 { GuestAccess, HistoryVisibility, JoinRule } from "matrix-js-sdk/src/@types/partials"; -import { EventType, MsgType } from "matrix-js-sdk/src/@types/event"; import { MatrixClientPeg } from "./MatrixClientPeg"; import { ROOM_SECURITY_TAB } from "./components/views/dialogs/RoomSettingsDialog"; -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 00b9a1167a..6a9170e468 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.tsx b/src/async-components/views/dialogs/security/CreateKeyBackupDialog.tsx index c0aff7c8b9..560eaadab1 100644 --- a/src/async-components/views/dialogs/security/CreateKeyBackupDialog.tsx +++ b/src/async-components/views/dialogs/security/CreateKeyBackupDialog.tsx @@ -17,6 +17,9 @@ limitations under the License. import React, { createRef } from 'react'; import FileSaver from 'file-saver'; +import { IPreparedKeyBackupVersion } from "matrix-js-sdk/src/crypto/backup"; +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from '../../../../MatrixClientPeg'; import { _t, _td } from '../../../../languageHandler'; import { accessSecretStorage } from '../../../../SecurityManager'; @@ -29,8 +32,6 @@ import Spinner from "../../../../components/views/elements/Spinner"; import BaseDialog from "../../../../components/views/dialogs/BaseDialog"; import DialogButtons from "../../../../components/views/elements/DialogButtons"; import { IValidationResult } from "../../../../components/views/elements/Validation"; -import { IPreparedKeyBackupVersion } from "matrix-js-sdk/src/crypto/backup"; -import { logger } from "matrix-js-sdk/src/logger"; enum Phase { Passphrase = "passphrase", diff --git a/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx b/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx index 245cf84718..3d2115a8f3 100644 --- a/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx +++ b/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx @@ -16,8 +16,14 @@ limitations under the License. */ import React, { createRef } from 'react'; -import { MatrixClientPeg } from '../../../../MatrixClientPeg'; import FileSaver from 'file-saver'; +import { logger } from "matrix-js-sdk/src/logger"; +import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup"; +import { TrustInfo } from "matrix-js-sdk/src/crypto/backup"; +import { CrossSigningKeys } from "matrix-js-sdk/src"; +import { IRecoveryKey } from "matrix-js-sdk/src/crypto/api"; + +import { MatrixClientPeg } from '../../../../MatrixClientPeg'; import { _t, _td } from '../../../../languageHandler'; import Modal from '../../../../Modal'; import { promptForBackupPassphrase } from '../../../../SecurityManager'; @@ -35,17 +41,11 @@ import { SecureBackupSetupMethod, } from '../../../../utils/WellKnownUtils'; import SecurityCustomisations from "../../../../customisations/Security"; - -import { logger } from "matrix-js-sdk/src/logger"; -import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup"; import { IDialogProps } from "../../../../components/views/dialogs/IDialogProps"; import Field from "../../../../components/views/elements/Field"; import BaseDialog from "../../../../components/views/dialogs/BaseDialog"; import Spinner from "../../../../components/views/elements/Spinner"; -import { TrustInfo } from "matrix-js-sdk/src/crypto/backup"; -import { CrossSigningKeys } from "matrix-js-sdk/src"; import InteractiveAuthDialog from "../../../../components/views/dialogs/InteractiveAuthDialog"; -import { IRecoveryKey } from "matrix-js-sdk/src/crypto/api"; import { IValidationResult } from "../../../../components/views/elements/Validation"; // I made a mistake while converting this and it has to be fixed! diff --git a/src/async-components/views/dialogs/security/ExportE2eKeysDialog.tsx b/src/async-components/views/dialogs/security/ExportE2eKeysDialog.tsx index 2ba78da90e..2f2bc36ec1 100644 --- a/src/async-components/views/dialogs/security/ExportE2eKeysDialog.tsx +++ b/src/async-components/views/dialogs/security/ExportE2eKeysDialog.tsx @@ -16,13 +16,13 @@ limitations under the License. import FileSaver from 'file-saver'; import React, { createRef } from 'react'; -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 { IDialogProps } from "../../../../components/views/dialogs/IDialogProps"; import BaseDialog from "../../../../components/views/dialogs/BaseDialog"; -import { logger } from "matrix-js-sdk/src/logger"; enum Phase { Edit = "edit", diff --git a/src/async-components/views/dialogs/security/ImportE2eKeysDialog.tsx b/src/async-components/views/dialogs/security/ImportE2eKeysDialog.tsx index fccc730812..65bbe0a70e 100644 --- a/src/async-components/views/dialogs/security/ImportE2eKeysDialog.tsx +++ b/src/async-components/views/dialogs/security/ImportE2eKeysDialog.tsx @@ -15,13 +15,13 @@ limitations under the License. */ import React, { createRef } from 'react'; - import { MatrixClient } from 'matrix-js-sdk/src/client'; +import { logger } from "matrix-js-sdk/src/logger"; + import * as MegolmExportEncryption from '../../../../utils/MegolmExportEncryption'; import { _t } from '../../../../languageHandler'; import { IDialogProps } from "../../../../components/views/dialogs/IDialogProps"; import BaseDialog from "../../../../components/views/dialogs/BaseDialog"; -import { logger } from "matrix-js-sdk/src/logger"; function readFileAsArrayBuffer(file: File): Promise { return new Promise((resolve, reject) => { diff --git a/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx b/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx index 105d12f3d7..ff21dba7ca 100644 --- a/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx +++ b/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx @@ -16,6 +16,8 @@ limitations under the License. */ import React from "react"; +import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup"; + import { MatrixClientPeg } from '../../../../MatrixClientPeg'; import dis from "../../../../dispatcher/dispatcher"; import { _t } from "../../../../languageHandler"; @@ -25,7 +27,6 @@ import { Action } from "../../../../dispatcher/actions"; import { IDialogProps } from "../../../../components/views/dialogs/IDialogProps"; import DialogButtons from "../../../../components/views/elements/DialogButtons"; import BaseDialog from "../../../../components/views/dialogs/BaseDialog"; -import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup"; interface IProps extends IDialogProps { newVersionInfo: IKeyBackupInfo; diff --git a/src/async-components/views/dialogs/security/RecoveryMethodRemovedDialog.tsx b/src/async-components/views/dialogs/security/RecoveryMethodRemovedDialog.tsx index 8ed6eb233e..a47e7636b3 100644 --- a/src/async-components/views/dialogs/security/RecoveryMethodRemovedDialog.tsx +++ b/src/async-components/views/dialogs/security/RecoveryMethodRemovedDialog.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React, { ComponentType } from "react"; + import dis from "../../../../dispatcher/dispatcher"; import { _t } from "../../../../languageHandler"; import Modal from "../../../../Modal"; 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 14ade84bf3..f8c3fe973d 100644 --- a/src/autocomplete/AutocompleteProvider.tsx +++ b/src/autocomplete/AutocompleteProvider.tsx @@ -17,6 +17,7 @@ limitations under the License. */ import React from 'react'; + import { TimelineRenderingType } from '../contexts/RoomContext'; import type { ICompletion, ISelectionRange } from './Autocompleter'; diff --git a/src/autocomplete/CommandProvider.tsx b/src/autocomplete/CommandProvider.tsx index 13daadbcf6..23b31407a8 100644 --- a/src/autocomplete/CommandProvider.tsx +++ b/src/autocomplete/CommandProvider.tsx @@ -18,13 +18,14 @@ limitations under the License. */ import React from 'react'; +import { Room } from 'matrix-js-sdk/src/models/room'; + import { _t } from '../languageHandler'; import AutocompleteProvider from './AutocompleteProvider'; import QueryMatcher from './QueryMatcher'; import { TextualCompletion } from './Components'; import { ICompletion, ISelectionRange } from "./Autocompleter"; import { Command, Commands, CommandMap } from '../SlashCommands'; -import { Room } from 'matrix-js-sdk/src/models/room'; import { TimelineRenderingType } from '../contexts/RoomContext'; const COMMAND_RE = /(^\/\w*)(?: .*)?/g; diff --git a/src/autocomplete/CommunityProvider.tsx b/src/autocomplete/CommunityProvider.tsx index 3e967063ab..b3a4079f94 100644 --- a/src/autocomplete/CommunityProvider.tsx +++ b/src/autocomplete/CommunityProvider.tsx @@ -17,18 +17,19 @@ limitations under the License. import React from 'react'; import Group from "matrix-js-sdk/src/models/group"; +import { sortBy } from "lodash"; +import { Room } from 'matrix-js-sdk/src/models/room'; + 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"; import { mediaFromMxc } from "../customisations/Media"; import BaseAvatar from '../components/views/avatars/BaseAvatar'; -import { Room } from 'matrix-js-sdk/src/models/room'; import { TimelineRenderingType } from '../contexts/RoomContext'; const COMMUNITY_REGEX = /\B\+\S*/g; diff --git a/src/autocomplete/EmojiProvider.tsx b/src/autocomplete/EmojiProvider.tsx index c43eba0bf1..960b0f9475 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 { Room } from 'matrix-js-sdk/src/models/room'; + 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'; -import { Room } from 'matrix-js-sdk/src/models/room'; import { TimelineRenderingType } from '../contexts/RoomContext'; const LIMIT = 20; diff --git a/src/autocomplete/QueryMatcher.ts b/src/autocomplete/QueryMatcher.ts index bdfd94790b..737b0d80ce 100644 --- a/src/autocomplete/QueryMatcher.ts +++ b/src/autocomplete/QueryMatcher.ts @@ -18,6 +18,7 @@ limitations under the License. import { at, uniq } from 'lodash'; import { removeHiddenChars } from "matrix-js-sdk/src/utils"; + import { TimelineRenderingType } from '../contexts/RoomContext'; interface IOptions { diff --git a/src/autocomplete/UserProvider.tsx b/src/autocomplete/UserProvider.tsx index e4b285df84..f83f534d84 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 f2729f9f29..cf5109c634 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"; export enum CallEventGrouperEvent { 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 9a354e4d21..9a64b1180c 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/enums/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 be69b78d3a..8db78f030c 100644 --- a/src/components/structures/GroupFilterPanel.tsx +++ b/src/components/structures/GroupFilterPanel.tsx @@ -15,16 +15,14 @@ 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 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 c6aea695c9..da32b4f8ae 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 f687d9e067..26c6879b04 100644 --- a/src/components/structures/IndicatorScrollbar.tsx +++ b/src/components/structures/IndicatorScrollbar.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { ComponentProps, 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 9ba642c8a4..70c0346c49 100644 --- a/src/components/structures/LoggedInView.tsx +++ b/src/components/structures/LoggedInView.tsx @@ -17,6 +17,8 @@ limitations under the License. import React, { ClipboardEvent } 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 { CollapseDistributor, Resizer } from '../../resizer'; import MatrixClientContext from "../../contexts/MatrixClientContext"; @@ -51,7 +52,6 @@ import { IOpts } from "../../createRoom"; import SpacePanel from "../views/spaces/SpacePanel"; import { replaceableComponent } from "../../utils/replaceableComponent"; import CallHandler, { CallHandlerEvent } 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"; @@ -62,7 +62,6 @@ import UserView from "./UserView"; import GroupView from "./GroupView"; import BackdropPanel from "./BackdropPanel"; import SpaceStore from "../../stores/spaces/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 f4b1542949..7cf6964c1f 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 8912837f0c..bfdbacef7a 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -21,6 +21,7 @@ import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { Error as ErrorEvent } from "matrix-analytics-events/types/typescript/Error"; import { Screen as ScreenEvent } from "matrix-analytics-events/types/typescript/Screen"; import { defer, IDeferred, QueryDict } from "matrix-js-sdk/src/utils"; +import { logger } from "matrix-js-sdk/src/logger"; // focus-visible is a Polyfill for the :focus-visible CSS pseudo-attribute used by _AccessibleButton.scss import 'focus-visible'; @@ -35,7 +36,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 +43,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"; @@ -100,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'; @@ -109,8 +107,6 @@ import { copyPlaintext } from "../../utils/strings"; import { PosthogAnalytics } from '../../PosthogAnalytics'; import { initSentry } from "../../sentry"; import CallHandler from "../../CallHandler"; - -import { logger } from "matrix-js-sdk/src/logger"; import { showSpaceInvite } from "../../utils/space"; import GenericToast from "../views/toasts/GenericToast"; import InfoDialog from "../views/dialogs/InfoDialog"; diff --git a/src/components/structures/MessagePanel.tsx b/src/components/structures/MessagePanel.tsx index 60a0829e2d..7db09c6720 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 f56d7469f1..f28804db38 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/enums/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 63084e589c..5431b848ba 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/spaces/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 2f82e81ae0..a60ee5f805 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"; @@ -47,8 +48,6 @@ import ScrollPanel from "./ScrollPanel"; import Spinner from "../views/elements/Spinner"; import { ActionPayload } from "../../dispatcher/payloads"; import { getDisplayAliasForAliasSet } from "../../Rooms"; - -import { logger } from "matrix-js-sdk/src/logger"; import { Action } from "../../dispatcher/actions"; const MAX_NAME_LENGTH = 80; 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 5f3f3413a0..979893cc3d 100644 --- a/src/components/structures/RoomView.tsx +++ b/src/components/structures/RoomView.tsx @@ -31,6 +31,8 @@ import { logger } from "matrix-js-sdk/src/logger"; import { EventTimeline } from 'matrix-js-sdk/src/models/event-timeline'; import { EventType } from 'matrix-js-sdk/src/@types/event'; import { RoomState } from 'matrix-js-sdk/src/models/room-state'; +import { CallState, CallType, MatrixCall } from "matrix-js-sdk/src/webrtc/call"; +import { throttle } from "lodash"; import shouldHideEvent from '../../shouldHideEvent'; import { _t } from '../../languageHandler'; @@ -70,7 +72,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, CallType, MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import WidgetStore from "../../stores/WidgetStore"; import { UPDATE_EVENT } from "../../stores/AsyncStore"; import Notifier from "../../Notifier"; @@ -83,7 +84,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"; diff --git a/src/components/structures/ScrollPanel.tsx b/src/components/structures/ScrollPanel.tsx index 103796122f..3ebe93be04 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 2101d4dfd5..697ab4e48b 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"; import { Action } from '../../dispatcher/actions'; diff --git a/src/components/structures/SpaceRoomView.tsx b/src/components/structures/SpaceRoomView.tsx index d15552e688..7427e956f0 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"; @@ -82,8 +83,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/ThreadView.tsx b/src/components/structures/ThreadView.tsx index 46e10e8d95..f7179525ef 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 b4ff882702..ea0492e1fc 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/enums/Layout"; @@ -48,9 +50,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 d3ca6142bb..b488870840 100644 --- a/src/components/structures/UploadBar.tsx +++ b/src/components/structures/UploadBar.tsx @@ -16,9 +16,11 @@ limitations under the License. import React from 'react'; import { Room } from "matrix-js-sdk/src/models/room"; +import filesize from "filesize"; +import { IEventRelation } from 'matrix-js-sdk/src'; + 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"; @@ -27,7 +29,6 @@ import AccessibleButton from "../views/elements/AccessibleButton"; import { IUpload } from "../../models/IUpload"; import { replaceableComponent } from "../../utils/replaceableComponent"; import MatrixClientContext from "../../contexts/MatrixClientContext"; -import { IEventRelation } from 'matrix-js-sdk/src'; interface IProps { room: Room; 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 826a170a3b..91f378dc60 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 { SetupEncryptionStore, Phase } from '../../../stores/SetupEncryptionStore'; import SetupEncryptionBody from "./SetupEncryptionBody"; 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 257f8559f1..dee6f2dec6 100644 --- a/src/components/structures/auth/ForgotPassword.tsx +++ b/src/components/structures/auth/ForgotPassword.tsx @@ -17,11 +17,13 @@ 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 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"; @@ -30,7 +32,6 @@ import PassphraseField from '../../views/auth/PassphraseField'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { PASSWORD_MIN_SCORE } from '../../views/auth/RegistrationForm'; import InlineSpinner from '../../views/elements/InlineSpinner'; -import { logger } from "matrix-js-sdk/src/logger"; import Spinner from "../../views/elements/Spinner"; import QuestionDialog from "../../views/dialogs/QuestionDialog"; import ErrorDialog from "../../views/dialogs/ErrorDialog"; 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 e91700243e..44f40a37d9 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 19e530aaaa..8836d785e6 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 5e03aca912..86e6711359 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/EmailField.tsx b/src/components/views/auth/EmailField.tsx index 3ff1700030..f274f1fdfa 100644 --- a/src/components/views/auth/EmailField.tsx +++ b/src/components/views/auth/EmailField.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { PureComponent, RefCallback, RefObject } from "react"; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import Field, { IInputProps } from "../elements/Field"; import { _t, _td } from "../../../languageHandler"; 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/PassphraseConfirmField.tsx b/src/components/views/auth/PassphraseConfirmField.tsx index 74ce711470..3a2b6f89b7 100644 --- a/src/components/views/auth/PassphraseConfirmField.tsx +++ b/src/components/views/auth/PassphraseConfirmField.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { PureComponent, RefCallback, RefObject } from "react"; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import Field, { IInputProps } from "../elements/Field"; import withValidation, { IFieldState, IValidationResult } from "../elements/Validation"; diff --git a/src/components/views/auth/RegistrationForm.tsx b/src/components/views/auth/RegistrationForm.tsx index 81084a48a3..0b41f06400 100644 --- a/src/components/views/auth/RegistrationForm.tsx +++ b/src/components/views/auth/RegistrationForm.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import { MatrixClient } from 'matrix-js-sdk/src/client'; +import { logger } from "matrix-js-sdk/src/logger"; import * as Email from '../../../email'; import { looksValid as phoneNumberLooksValid } from '../../../phonenumber'; @@ -33,8 +34,6 @@ import Field from '../elements/Field'; import RegistrationEmailPromptDialog from '../dialogs/RegistrationEmailPromptDialog'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import CountryDropdown from "./CountryDropdown"; - -import { logger } from "matrix-js-sdk/src/logger"; import PassphraseConfirmField from "./PassphraseConfirmField"; enum RegistrationField { 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 new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/src/components/views/avatars/MemberStatusMessageAvatar.tsx @@ -0,0 +1 @@ + diff --git a/src/components/views/context_menus/CallContextMenu.tsx b/src/components/views/context_menus/CallContextMenu.tsx index 7fcf1fa50c..931bddf335 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 cb1b877e66..70a5aae2e8 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/MessageContextMenu.tsx b/src/components/views/context_menus/MessageContextMenu.tsx index dc33120a76..84c61a716d 100644 --- a/src/components/views/context_menus/MessageContextMenu.tsx +++ b/src/components/views/context_menus/MessageContextMenu.tsx @@ -18,6 +18,7 @@ limitations under the License. import React from 'react'; import { EventStatus, MatrixEvent } from 'matrix-js-sdk/src/models/event'; import { EventType, RelationType } from "matrix-js-sdk/src/@types/event"; +import { Relations } from 'matrix-js-sdk/src/models/relations'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import dis from '../../../dispatcher/dispatcher'; @@ -43,7 +44,6 @@ import { ComposerInsertPayload } from "../../../dispatcher/payloads/ComposerInse import { WidgetLayoutStore } from '../../../stores/widgets/WidgetLayoutStore'; import { POLL_START_EVENT_TYPE } from '../../../polls/consts'; import EndPollDialog from '../dialogs/EndPollDialog'; -import { Relations } from 'matrix-js-sdk/src/models/relations'; import { isPollEnded } from '../messages/MPollBody'; export function canCancel(eventStatus: EventStatus): boolean { diff --git a/src/components/views/context_menus/StatusMessageContextMenu.tsx b/src/components/views/context_menus/StatusMessageContextMenu.tsx new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/src/components/views/context_menus/StatusMessageContextMenu.tsx @@ -0,0 +1 @@ + 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/ThreadListContextMenu.tsx b/src/components/views/context_menus/ThreadListContextMenu.tsx index b97b1b80bb..f9aa7a4b9f 100644 --- a/src/components/views/context_menus/ThreadListContextMenu.tsx +++ b/src/components/views/context_menus/ThreadListContextMenu.tsx @@ -16,6 +16,7 @@ limitations under the License. import React, { useCallback, useEffect, useState } from "react"; import { MatrixEvent } from "matrix-js-sdk/src"; + import { ButtonEvent } from "../elements/AccessibleButton"; import dis from '../../../dispatcher/dispatcher'; import { Action } from "../../../dispatcher/actions"; 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 7e2c7be0c3..298018798b 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/AnalyticsLearnMoreDialog.tsx b/src/components/views/dialogs/AnalyticsLearnMoreDialog.tsx index 6c60c46175..04573252b5 100644 --- a/src/components/views/dialogs/AnalyticsLearnMoreDialog.tsx +++ b/src/components/views/dialogs/AnalyticsLearnMoreDialog.tsx @@ -14,10 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ +import React from "react"; + import BaseDialog from "./BaseDialog"; import { _t } from "../../../languageHandler"; import DialogButtons from "../elements/DialogButtons"; -import React from "react"; import Modal from "../../../Modal"; import SdkConfig from "../../../SdkConfig"; 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 2c3d570eae..02ad94302c 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/spaces/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 b67254838e..45b72aac5b 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"; @@ -28,8 +30,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 f7417ce7db..363f48fd09 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 c128808a3e..a44d16dd40 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 4914b26210..a25b328fd3 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, { useEffect, useRef, 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 71183cc963..b749c7483b 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 9b372c2b38..fa23ca4245 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 cf783ef259..0e7db93c53 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 { replaceableComponent } from "../../../utils/replaceableComponent"; 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 2c68370921..13e48db702 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 DialPadBackspaceButton from "../elements/DialPadBackspaceButton"; import SpaceStore from "../../../stores/spaces/SpaceStore"; import CallHandler from "../../../CallHandler"; -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 f18e72bd7f..11868f3820 100644 --- a/src/components/views/dialogs/LogoutDialog.tsx +++ b/src/components/views/dialogs/LogoutDialog.tsx @@ -17,14 +17,14 @@ limitations under the License. import React, { ComponentType } from 'react'; import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup"; +import { logger } from "matrix-js-sdk/src/logger"; + import Modal from '../../../Modal'; import dis from '../../../dispatcher/dispatcher'; import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import RestoreKeyBackupDialog from './security/RestoreKeyBackupDialog'; import { replaceableComponent } from "../../../utils/replaceableComponent"; - -import { logger } from "matrix-js-sdk/src/logger"; import QuestionDialog from "./QuestionDialog"; import BaseDialog from "./BaseDialog"; import Spinner from "../elements/Spinner"; 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 e27672f998..615c204a06 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, _td } from '../../../languageHandler'; import { IDialogProps } from "./IDialogProps"; -import { useRef, useState } from "react"; import Field from "../elements/Field"; import CountlyAnalytics from "../../../CountlyAnalytics"; import BaseDialog from "./BaseDialog"; 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 be4d935477..67dc4e07d5 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/ScrollableBaseModal.tsx b/src/components/views/dialogs/ScrollableBaseModal.tsx index 82cd392c4f..294229219b 100644 --- a/src/components/views/dialogs/ScrollableBaseModal.tsx +++ b/src/components/views/dialogs/ScrollableBaseModal.tsx @@ -16,11 +16,12 @@ limitations under the License. import React, { FormEvent } from "react"; import { MatrixClient } from "matrix-js-sdk/src/client"; +import FocusLock from "react-focus-lock"; + import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { Key } from "../../../Keyboard"; import { IDialogProps } from "./IDialogProps"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; -import FocusLock from "react-focus-lock"; import { _t } from "../../../languageHandler"; import AccessibleButton from "../elements/AccessibleButton"; 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 585e49ccdd..4b05e2c02f 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 d8f2b93af0..ad0c8e939a 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 c198c876bd..0919163095 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 a2699e9982..4cf08ca24e 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 178aca8ca9..9b1484918f 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 be710d7260..a8e2308976 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,21 +32,19 @@ 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 CallHandler from '../../../CallHandler'; -import { Room } from "matrix-js-sdk/src/models/room"; import { IApp } from "../../../stores/WidgetStore"; import { WidgetLayoutStore, Container } from "../../../stores/widgets/WidgetLayoutStore"; + interface IProps { app: IApp; // If room is not specified then it is an account level widget @@ -89,8 +92,6 @@ interface IState { requiresClient: boolean; } -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 ed74246cb2..e35e9ca906 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 78f96ddd73..057969437e 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 512cc91503..85f397834f 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 03b3f9e33c..ff58479d00 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"; @@ -32,7 +34,6 @@ import dis from '../../../dispatcher/dispatcher'; import { Action } from '../../../dispatcher/actions'; 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 13dcb114f9..be39ceb6e5 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/enums/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/PollCreateDialog.tsx b/src/components/views/elements/PollCreateDialog.tsx index d015347d66..4e1e76d23f 100644 --- a/src/components/views/elements/PollCreateDialog.tsx +++ b/src/components/views/elements/PollCreateDialog.tsx @@ -14,13 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ +import React, { ChangeEvent, createRef } from "react"; +import { Room } from "matrix-js-sdk/src/models/room"; + import ScrollableBaseModal, { IScrollableBaseState } from "../dialogs/ScrollableBaseModal"; import { IDialogProps } from "../dialogs/IDialogProps"; import QuestionDialog from "../dialogs/QuestionDialog"; -import React, { ChangeEvent, createRef } from "react"; import Modal from '../../../Modal'; import { _t } from "../../../languageHandler"; -import { Room } from "matrix-js-sdk/src/models/room"; import { arrayFastClone, arraySeed } from "../../../utils/arrays"; import Field from "./Field"; import AccessibleButton from "./AccessibleButton"; 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 64a8ff6701..07b3db5929 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/enums/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 b93ee774d7..c2d27f8ab7 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 05272f515d..868791151b 100644 --- a/src/components/views/elements/StyledCheckbox.tsx +++ b/src/components/views/elements/StyledCheckbox.tsx @@ -16,9 +16,10 @@ limitations under the License. import React from "react"; import { randomString } from "matrix-js-sdk/src/randomstring"; -import { replaceableComponent } from "../../../utils/replaceableComponent"; import classnames from 'classnames'; +import { replaceableComponent } from "../../../utils/replaceableComponent"; + export enum CheckboxStyle { Solid = "solid", Outline = "outline", diff --git a/src/components/views/elements/StyledRadioButton.tsx b/src/components/views/elements/StyledRadioButton.tsx index 2d114fd962..5fc763f9e0 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/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 199e107ca5..5e6df02666 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 6989423258..e6b3f6c520 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 TooltipTarget from './TooltipTarget'; 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 dc18db5c54..3139187709 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/location/LocationPicker.tsx b/src/components/views/location/LocationPicker.tsx index c3a18876da..b5ed928dd3 100644 --- a/src/components/views/location/LocationPicker.tsx +++ b/src/components/views/location/LocationPicker.tsx @@ -16,16 +16,15 @@ limitations under the License. import React from 'react'; import maplibregl from 'maplibre-gl'; +import { logger } from "matrix-js-sdk/src/logger"; import SdkConfig from '../../../SdkConfig'; import Field from "../elements/Field"; import DialogButtons from "../elements/DialogButtons"; import Dropdown from "../elements/Dropdown"; import LocationShareType from "./LocationShareType"; - import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; interface IDropdownProps { value: LocationShareType; 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 9b077e6e50..4e424fcc3e 100644 --- a/src/components/views/messages/IBodyProps.ts +++ b/src/components/views/messages/IBodyProps.ts @@ -15,11 +15,12 @@ limitations under the License. */ import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { Relations } from "matrix-js-sdk/src/models/relations"; + import { TileShape } from "../rooms/EventTile"; import { MediaEventHelper } from "../../../utils/MediaEventHelper"; import EditorStateTransfer from "../../../utils/EditorStateTransfer"; import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; -import { Relations } from "matrix-js-sdk/src/models/relations"; export interface IBodyProps { mxEvent: MatrixEvent; 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 bff6654d19..e05aee6a25 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"; import { TileShape } from '../rooms/EventTile'; import { ImageSize, suggestedSize as suggestedImageSize } from "../../../settings/enums/ImageSize"; 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/MLocationBody.tsx b/src/components/views/messages/MLocationBody.tsx index 49ff063f40..28a122e60f 100644 --- a/src/components/views/messages/MLocationBody.tsx +++ b/src/components/views/messages/MLocationBody.tsx @@ -16,10 +16,11 @@ limitations under the License. import React from 'react'; import maplibregl from 'maplibre-gl'; +import { logger } from "matrix-js-sdk/src/logger"; + import SdkConfig from '../../../SdkConfig'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { IBodyProps } from "./IBodyProps"; -import { logger } from "matrix-js-sdk/src/logger"; import { _t } from '../../../languageHandler'; interface IState { diff --git a/src/components/views/messages/MPollBody.tsx b/src/components/views/messages/MPollBody.tsx index 0ef9ac1b6f..55c4b672bd 100644 --- a/src/components/views/messages/MPollBody.tsx +++ b/src/components/views/messages/MPollBody.tsx @@ -16,6 +16,10 @@ limitations under the License. import React from 'react'; import classNames from 'classnames'; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { Relations } from 'matrix-js-sdk/src/models/relations'; +import { MatrixClient } from 'matrix-js-sdk/src/matrix'; + import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import Modal from '../../../Modal'; @@ -31,11 +35,8 @@ import { TEXT_NODE_TYPE, } from '../../../polls/consts'; import StyledRadioButton from '../elements/StyledRadioButton'; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; -import { Relations } from 'matrix-js-sdk/src/models/relations'; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import ErrorDialog from '../dialogs/ErrorDialog'; -import { MatrixClient } from 'matrix-js-sdk/src/matrix'; interface IState { selected?: string; // Which option was clicked by the local user diff --git a/src/components/views/messages/MStickerBody.tsx b/src/components/views/messages/MStickerBody.tsx index 5d6ae3b3ab..8496001f2c 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 { replaceableComponent } from "../../../utils/replaceableComponent"; import { BLURHASH_FIELD } from "../../../ContentMessages"; diff --git a/src/components/views/messages/MVideoBody.tsx b/src/components/views/messages/MVideoBody.tsx index e0ee24c9cd..202829a619 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"; @@ -26,8 +27,6 @@ import { BLURHASH_FIELD } from "../../../ContentMessages"; import { IMediaEventContent } from "../../../customisations/models/IMediaEventContent"; import { IBodyProps } from "./IBodyProps"; import MFileBody from "./MFileBody"; - -import { logger } from "matrix-js-sdk/src/logger"; import { ImageSize, suggestedSize as suggestedVideoSize } from "../../../settings/enums/ImageSize"; interface IState { 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 44105bb35c..abaf78797e 100644 --- a/src/components/views/messages/MessageActionBar.tsx +++ b/src/components/views/messages/MessageActionBar.tsx @@ -18,8 +18,10 @@ limitations under the License. import React, { ReactElement, 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 { MsgType } from 'matrix-js-sdk/src/@types/event'; +import type { Relations } from 'matrix-js-sdk/src/models/relations'; import { _t } from '../../../languageHandler'; import dis from '../../../dispatcher/dispatcher'; import { Action } from '../../../dispatcher/actions'; @@ -29,20 +31,16 @@ 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'; import { dispatchShowThreadEvent } from '../../../dispatcher/dispatch-actions/threads'; import ReactionPicker from "../emojipicker/ReactionPicker"; -import { MsgType } from 'matrix-js-sdk/src/@types/event'; interface IOptionsButtonProps { mxEvent: MatrixEvent; diff --git a/src/components/views/messages/MessageEvent.tsx b/src/components/views/messages/MessageEvent.tsx index 2896eafe8e..2cd23779d3 100644 --- a/src/components/views/messages/MessageEvent.tsx +++ b/src/components/views/messages/MessageEvent.tsx @@ -15,6 +15,9 @@ limitations under the License. */ import React, { createRef } from 'react'; +import { EventType, MsgType } from "matrix-js-sdk/src/@types/event"; +import { Relations } from 'matrix-js-sdk/src/models/relations'; + import * as sdk from '../../../index'; import SettingsStore from "../../../settings/SettingsStore"; import { Mjolnir } from "../../../mjolnir/Mjolnir"; @@ -25,10 +28,8 @@ 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"; import { POLL_START_EVENT_TYPE } from '../../../polls/consts'; -import { Relations } from 'matrix-js-sdk/src/models/relations'; // onMessageAllowed is handled internally interface IProps extends Omit { diff --git a/src/components/views/messages/MessageTimestamp.tsx b/src/components/views/messages/MessageTimestamp.tsx index b1bc5413fe..cbf37f47f6 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, formatRelativeTime } 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 49743ad9c8..455c1bcc71 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 { Action } from '../../../dispatcher/actions'; @@ -24,7 +25,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 293516bf17..a4bac8a2ba 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 12d0cca258..c0bc34157b 100644 --- a/src/components/views/right_panel/EncryptionPanel.tsx +++ b/src/components/views/right_panel/EncryptionPanel.tsx @@ -15,10 +15,13 @@ 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 72e7f5282d..44c6b2c922 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/TimelineCard.tsx b/src/components/views/right_panel/TimelineCard.tsx index 5bc875b8c6..d3f4851051 100644 --- a/src/components/views/right_panel/TimelineCard.tsx +++ b/src/components/views/right_panel/TimelineCard.tsx @@ -20,7 +20,6 @@ import { EventTimelineSet, IEventRelation, MatrixEvent, Room } from 'matrix-js-s import { Thread } from 'matrix-js-sdk/src/models/thread'; import BaseCard from "./BaseCard"; - import ResizeNotifier from '../../../utils/ResizeNotifier'; import MessageComposer from '../rooms/MessageComposer'; import { RoomPermalinkCreator } from '../../../utils/permalinks/Permalinks'; diff --git a/src/components/views/right_panel/UserInfo.tsx b/src/components/views/right_panel/UserInfo.tsx index 8c7b29777e..dcf900d806 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/spaces/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"; import { TimelineRenderingType } from "../../../contexts/RoomContext"; diff --git a/src/components/views/right_panel/VerificationPanel.tsx b/src/components/views/right_panel/VerificationPanel.tsx index bed6814437..913345405a 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 bf847824d5..f2de4d58ec 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"; @@ -30,8 +31,6 @@ import { replaceableComponent } from "../../../utils/replaceableComponent"; import RoomAliasField from "../elements/RoomAliasField"; import SettingsFieldset from "../settings/SettingsFieldset"; -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 f60a41ad89..eb0c6ded1a 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 2ce6680184..db45009a8d 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"; import SettingsFieldset from '../settings/SettingsFieldset'; diff --git a/src/components/views/rooms/AppsDrawer.tsx b/src/components/views/rooms/AppsDrawer.tsx index 0e48e1420a..01696d22d3 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'; @@ -33,7 +34,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"; import Spinner from "../elements/Spinner"; diff --git a/src/components/views/rooms/Autocomplete.tsx b/src/components/views/rooms/Autocomplete.tsx index 0991a230ab..d8d65ca113 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"; import RoomContext from '../../../contexts/RoomContext'; diff --git a/src/components/views/rooms/AuxPanel.tsx b/src/components/views/rooms/AuxPanel.tsx index 56d3ba459d..fe80e784f4 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 d703d62aa0..f9015efdef 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'; @@ -50,8 +51,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 9b0b4868dc..f216a549fe 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'; import { ComposerType } from "../../../dispatcher/payloads/ComposerInsertPayload"; 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 d7049cddc3..8128e5975b 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'; @@ -60,8 +61,6 @@ import SettingsStore from "../../../settings/SettingsStore"; 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"; import { TimelineRenderingType } from "../../../contexts/RoomContext"; import { MediaEventHelper } from "../../../utils/MediaEventHelper"; import Toolbar from '../../../accessibility/Toolbar'; 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 224bb03ff6..21ce299e13 100644 --- a/src/components/views/rooms/MemberList.tsx +++ b/src/components/views/rooms/MemberList.tsx @@ -18,6 +18,14 @@ 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 { _t } from '../../../languageHandler'; import SdkConfig from '../../../SdkConfig'; import dis from '../../../dispatcher/dispatcher'; @@ -30,11 +38,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,11 +45,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/spaces/SpaceStore"; import { shouldShowComponent } from "../../../customisations/helpers/UIComponents"; import { UIComponent } from "../../../settings/UIFeature"; -import { JoinRule } from "matrix-js-sdk/src/@types/partials"; const INITIAL_LOAD_NUM_MEMBERS = 30; const INITIAL_LOAD_NUM_INVITED = 5; 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 d64bef9d2d..7af913763b 100644 --- a/src/components/views/rooms/MessageComposer.tsx +++ b/src/components/views/rooms/MessageComposer.tsx @@ -15,11 +15,15 @@ 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 { MsgType } from "matrix-js-sdk/src/@types/event"; +import { logger } from "matrix-js-sdk/src/logger"; + +import { _t } from '../../../languageHandler'; +import { MatrixClientPeg } from '../../../MatrixClientPeg'; import dis from '../../../dispatcher/dispatcher'; import { ActionPayload } from "../../../dispatcher/payloads"; import Stickerpicker from './Stickerpicker'; @@ -51,13 +55,10 @@ import EmojiPicker from '../emojipicker/EmojiPicker'; import LocationPicker from '../location/LocationPicker'; import UIStore, { UI_EVENTS } from '../../../stores/UIStore'; import Modal from "../../../Modal"; -import { RelationType } from 'matrix-js-sdk/src/@types/event'; import RoomContext from '../../../contexts/RoomContext'; import { POLL_START_EVENT_TYPE } from "../../../polls/consts"; import ErrorDialog from "../dialogs/ErrorDialog"; import PollCreateDialog from "../elements/PollCreateDialog"; -import { MsgType } from "matrix-js-sdk/src/@types/event"; -import { logger } from "matrix-js-sdk/src/logger"; import LocationShareType from "../location/LocationShareType"; import { SettingUpdatedPayload } from "../../../dispatcher/payloads/SettingUpdatedPayload"; diff --git a/src/components/views/rooms/NotificationBadge.tsx b/src/components/views/rooms/NotificationBadge.tsx index c80f70f644..09a35125d2 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 6e9b393937..fa8e428b37 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 176df6c0a6..ed4a902d66 100644 --- a/src/components/views/rooms/ReplyTile.tsx +++ b/src/components/views/rooms/ReplyTile.tsx @@ -16,22 +16,22 @@ 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 { Action } from '../../../dispatcher/actions'; -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 8a2dda4efa..03899fdb07 100644 --- a/src/components/views/rooms/RoomDetailList.tsx +++ b/src/components/views/rooms/RoomDetailList.tsx @@ -17,10 +17,10 @@ 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 { Action } from '../../../dispatcher/actions'; 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 4d5dfcd930..09ab7767d7 100644 --- a/src/components/views/rooms/RoomHeader.tsx +++ b/src/components/views/rooms/RoomHeader.tsx @@ -17,9 +17,12 @@ 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 { CallType } from "matrix-js-sdk/src/webrtc/call"; + import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; - import SettingsStore from "../../../settings/SettingsStore"; import RoomHeaderButtons from '../right_panel/RoomHeaderButtons'; import E2EIcon from './E2EIcon'; @@ -28,12 +31,9 @@ import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; import RoomTopic from "../elements/RoomTopic"; import RoomName from "../elements/RoomName"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -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'; -import { CallType } from "matrix-js-sdk/src/webrtc/call"; import { ContextMenuTooltipButton } from '../../structures/ContextMenu'; import RoomContextMenu from "../context_menus/RoomContextMenu"; import { contextMenuBelow } from './RoomTile'; diff --git a/src/components/views/rooms/RoomPreviewBar.tsx b/src/components/views/rooms/RoomPreviewBar.tsx index 4e3c7df0af..79351a8b92 100644 --- a/src/components/views/rooms/RoomPreviewBar.tsx +++ b/src/components/views/rooms/RoomPreviewBar.tsx @@ -20,10 +20,10 @@ 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 { 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 263795fb71..2aad0c5c44 100644 --- a/src/components/views/rooms/RoomSublist.tsx +++ b/src/components/views/rooms/RoomSublist.tsx @@ -21,6 +21,10 @@ import { ComponentType, 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 { Dispatcher } from "flux"; + import { RovingAccessibleButton, RovingTabIndexWrapper } from "../../../accessibility/RovingTabIndex"; import { _t } from "../../../languageHandler"; import AccessibleButton from "../../views/elements/AccessibleButton"; @@ -42,8 +46,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"; @@ -54,7 +56,6 @@ import ExtraTile from "./ExtraTile"; import { ListNotificationState } from "../../../stores/notifications/ListNotificationState"; import { getKeyBindingsManager, RoomListAction } from "../../../KeyBindingsManager"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { Dispatcher } from "flux"; const SHOW_N_BUTTON_HEIGHT = 28; // As defined by CSS const RESIZE_HANDLE_HEIGHT = 4; // As defined by CSS diff --git a/src/components/views/rooms/RoomTile.tsx b/src/components/views/rooms/RoomTile.tsx index 8d989ee209..d6916f5034 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'; @@ -51,8 +53,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 b9fdc1111c..0add18e917 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 { replaceableComponent } from "../../../utils/replaceableComponent"; import RoomUpgradeDialog from '../dialogs/RoomUpgradeDialog'; 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 5f1c2c0d3c..54bc69cd24 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 ef87691a6d..507f549311 100644 --- a/src/components/views/rooms/Stickerpicker.tsx +++ b/src/components/views/rooms/Stickerpicker.tsx @@ -16,6 +16,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'; @@ -35,8 +37,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 ef1902fcf3..04878a2a6a 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/spaces/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 b47ba5a790..a701b716e7 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, { ComponentType } 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 a01e3c4101..350a99f6d8 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'; @@ -23,11 +25,8 @@ 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"; import AccessibleButton from "../elements/AccessibleButton"; interface IState { diff --git a/src/components/views/settings/DevicesPanel.tsx b/src/components/views/settings/DevicesPanel.tsx index 957583ab9c..0b19d5605e 100644 --- a/src/components/views/settings/DevicesPanel.tsx +++ b/src/components/views/settings/DevicesPanel.tsx @@ -17,6 +17,8 @@ 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 { CrossSigningInfo } from "matrix-js-sdk/src/crypto/CrossSigning"; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from '../../../languageHandler'; @@ -27,9 +29,6 @@ import InteractiveAuthDialog from "../dialogs/InteractiveAuthDialog"; import DevicesPanelEntry from "./DevicesPanelEntry"; import Spinner from "../elements/Spinner"; import AccessibleButton from "../elements/AccessibleButton"; -import { CrossSigningInfo } from "matrix-js-sdk/src/crypto/CrossSigning"; - -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 f61e698f41..dccfc70598 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'; @@ -31,8 +32,6 @@ import SetupEncryptionDialog from '../dialogs/security/SetupEncryptionDialog'; import VerificationRequestDialog from '../../views/dialogs/VerificationRequestDialog'; import LogoutDialog from '../dialogs/LogoutDialog'; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { device: IMyDevice; isOwnDevice: boolean; diff --git a/src/components/views/settings/FontScalingPanel.tsx b/src/components/views/settings/FontScalingPanel.tsx index ab701731d2..a9950dfcd9 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/ImageSizePanel.tsx b/src/components/views/settings/ImageSizePanel.tsx index bacdd6144d..de9d7d5954 100644 --- a/src/components/views/settings/ImageSizePanel.tsx +++ b/src/components/views/settings/ImageSizePanel.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import SettingsStore from "../../../settings/SettingsStore"; import StyledRadioButton from "../elements/StyledRadioButton"; import { _t } from "../../../languageHandler"; 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 22fcc734a1..bd739bd5bf 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 7cf6b90533..6386961ec7 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,9 +29,7 @@ import { mediaFromMxc } from "../../../customisations/Media"; import AccessibleButton from '../elements/AccessibleButton'; import AvatarSetting from './AvatarSetting'; -import { logger } from "matrix-js-sdk/src/logger"; import ExternalLink from '../elements/ExternalLink'; - interface IState { userId?: string; originalDisplayName?: string; diff --git a/src/components/views/settings/SecureBackupPanel.tsx b/src/components/views/settings/SecureBackupPanel.tsx index d44a7a78b1..014bb0ffa7 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, { ComponentType } 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 2655fc78c5..3c6d42e594 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 { findHighContrastTheme, findNonHighContrastTheme, getOrderedThemes, isHighContrastTheme } from "../../../theme"; @@ -29,8 +31,6 @@ import StyledRadioGroup from "../elements/StyledRadioGroup"; import { SettingLevel } from "../../../settings/SettingLevel"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -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 81526e597a..df3272a1fb 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 6f1d8301b0..cf732bc052 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"; @@ -22,8 +24,6 @@ import Notifier from "../../../../../Notifier"; import SettingsStore from '../../../../../settings/SettingsStore'; import { SettingLevel } from "../../../../../settings/SettingLevel"; import { replaceableComponent } from "../../../../../utils/replaceableComponent"; - -import { logger } from "matrix-js-sdk/src/logger"; import { RoomEchoChamber } from "../../../../../stores/local-echo/RoomEchoChamber"; import { EchoChamber } from '../../../../../stores/local-echo/EchoChamber'; import MatrixClientContext from "../../../../../contexts/MatrixClientContext"; diff --git a/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx index 93b8a35bd4..87ef5ea253 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 SettingsFieldset from '../../SettingsFieldset'; - -import { logger } from "matrix-js-sdk/src/logger"; import SettingsStore from "../../../../../settings/SettingsStore"; interface IEventShowOpts { diff --git a/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx index 32321ded9e..faa6d0eb6e 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"; @@ -37,8 +38,6 @@ import JoinRuleSettings from "../../JoinRuleSettings"; import ErrorDialog from "../../../dialogs/ErrorDialog"; import SettingsFieldset from '../../SettingsFieldset'; -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 37007fbad7..8249f2f615 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/enums/Layout"; import { replaceableComponent } from "../../../../../utils/replaceableComponent"; import LayoutSwitcher from "../../LayoutSwitcher"; - import FontScalingPanel from '../../FontScalingPanel'; import ThemeChoicePanel from '../../ThemeChoicePanel'; import ImageSizePanel from "../../ImageSizePanel"; 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/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 21977b36dc..f37e2f336f 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 { MatrixClientPeg } from "../../../../../MatrixClientPeg"; @@ -32,7 +34,6 @@ import E2eAdvancedPanel, { isE2eAdvancedPanelPossible } from "../../E2eAdvancedP import CountlyAnalytics from "../../../../../CountlyAnalytics"; import { replaceableComponent } from "../../../../../utils/replaceableComponent"; 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"; @@ -40,8 +41,6 @@ import CrossSigningPanel from "../../CrossSigningPanel"; import EventIndexPanel from "../../EventIndexPanel"; import InlineSpinner from "../../../elements/InlineSpinner"; import { PosthogAnalytics } from "../../../../../PosthogAnalytics"; - -import { logger } from "matrix-js-sdk/src/logger"; import { showDialog as showAnalyticsLearnMoreDialog } from "../../../dialogs/AnalyticsLearnMoreDialog"; interface IIgnoredUserProps { 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/QuickSettingsButton.tsx b/src/components/views/spaces/QuickSettingsButton.tsx index 2b7595f9a5..4e99c1ab09 100644 --- a/src/components/views/spaces/QuickSettingsButton.tsx +++ b/src/components/views/spaces/QuickSettingsButton.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { useMemo } from "react"; +import classNames from "classnames"; import { _t } from "../../../languageHandler"; import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; @@ -34,7 +35,6 @@ import SettingsStore from "../../../settings/SettingsStore"; import { SettingLevel } from "../../../settings/SettingLevel"; import dis from "../../../dispatcher/dispatcher"; import { RecheckThemePayload } from "../../../dispatcher/payloads/RecheckThemePayload"; -import classNames from "classnames"; const QuickSettingsButton = ({ isPanelCollapsed = false }) => { const orderedThemes = useMemo(getOrderedThemes, []); diff --git a/src/components/views/spaces/SpaceCreateMenu.tsx b/src/components/views/spaces/SpaceCreateMenu.tsx index 3b71096190..5203bd2c90 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 6d98b27719..e8d090644a 100644 --- a/src/components/views/spaces/SpaceTreeLevel.tsx +++ b/src/components/views/spaces/SpaceTreeLevel.tsx @@ -23,6 +23,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/spaces/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" | "onClick"> { diff --git a/src/components/views/terms/InlineTermsAgreement.tsx b/src/components/views/terms/InlineTermsAgreement.tsx index 3276e85731..a7ba47aa7c 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 { objectClone } from "../../../utils/objects"; import StyledCheckbox from "../elements/StyledCheckbox"; 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 94507662b2..a890728549 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 01909efdfa..2a08dfaa68 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 { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import DialogButtons from "../elements/DialogButtons"; diff --git a/src/components/views/verification/VerificationComplete.tsx b/src/components/views/verification/VerificationComplete.tsx index 93d0aac341..88bdd70d22 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 { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import DialogButtons from "../elements/DialogButtons"; diff --git a/src/components/views/verification/VerificationShowSas.tsx b/src/components/views/verification/VerificationShowSas.tsx index 72ab3f2086..32c676e1eb 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 963edd469b..a14506d9fb 100644 --- a/src/components/views/voip/CallPreview.tsx +++ b/src/components/views/voip/CallPreview.tsx @@ -16,21 +16,20 @@ 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'; import CallHandler, { CallHandlerEvent } from '../../../CallHandler'; 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 dis from '../../../dispatcher/dispatcher'; import { Action } from "../../../dispatcher/actions"; - -import { logger } from "matrix-js-sdk/src/logger"; import { WidgetLayoutStore } from '../../../stores/widgets/WidgetLayoutStore'; const SHOW_CALL_IN_STATES = [ diff --git a/src/components/views/voip/CallView.tsx b/src/components/views/voip/CallView.tsx index 54dfa01890..2851c2d04e 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 0b65fc232e..04b0ec4884 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 6b5829a48f..2596535aa6 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 dis from '../../../../dispatcher/dispatcher'; import { Action } from '../../../../dispatcher/actions'; -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 99b577f4ad..e02a85a9fb 100644 --- a/src/components/views/voip/CallViewForRoom.tsx +++ b/src/components/views/voip/CallViewForRoom.tsx @@ -16,9 +16,10 @@ 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 { 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 7eaf56196a..6432ccf5e1 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 ceb0fc3315..126f60fdc0 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 9386529ab5..532a863272 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 2c55c131fb..83a5622e91 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/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..d5d20e5181 100644 --- a/src/languageHandler.tsx +++ b/src/languageHandler.tsx @@ -20,16 +20,15 @@ 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"; +// @ts-ignore - $webapp is a webpack resolve alias pointing to the output directory, see webpack config +import webpackLangJsonUrl from "$webapp/i18n/languages.json"; const i18nFolder = 'i18n/'; diff --git a/src/linkify-matrix.ts b/src/linkify-matrix.ts index 33402889e5..668b062f59 100644 --- a/src/linkify-matrix.ts +++ b/src/linkify-matrix.ts @@ -19,6 +19,7 @@ import * as linkifyjs from 'linkifyjs'; import linkifyElement from 'linkifyjs/element'; import linkifyString from 'linkifyjs/string'; import { RoomMember } from 'matrix-js-sdk/src/models/room-member'; + import { baseUrl } from "./utils/permalinks/SpecPermalinkConstructor"; import { parsePermalink, 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 726b756c76..58adbf8726 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 db90d9c3fa..4fdcd95635 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 9cabb27b94..9d3151f68a 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..520748ea35 100644 --- a/src/settings/controllers/NotificationControllers.ts +++ b/src/settings/controllers/NotificationControllers.ts @@ -15,15 +15,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -import SettingController from "./SettingController"; -import { MatrixClientPeg } from '../../MatrixClientPeg'; -import { SettingLevel } from "../SettingLevel"; - +import { logger } from "matrix-js-sdk/src/logger"; // 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"; +import SettingController from "./SettingController"; +import { MatrixClientPeg } from '../../MatrixClientPeg'; +import { SettingLevel } from "../SettingLevel"; // .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 dca7102535..cf6653dc0c 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 d8f25b5075..a8994d6f74 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 { findHighContrastTheme, 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/CommunityPrototypeStore.ts b/src/stores/CommunityPrototypeStore.ts index 65f091b422..04f7eb29c4 100644 --- a/src/stores/CommunityPrototypeStore.ts +++ b/src/stores/CommunityPrototypeStore.ts @@ -14,22 +14,22 @@ 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 { Action } from "../dispatcher/actions"; -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 f546654951..42c5a91f16 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 { Action } from '../dispatcher/actions'; import GroupStore from './GroupStore'; 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 401eada16c..b494586d9a 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 58b9c6d764..f54f98fdb2 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..5af39356e7 100644 --- a/src/stores/SetupEncryptionStore.ts +++ b/src/stores/SetupEncryptionStore.ts @@ -15,10 +15,13 @@ 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 +29,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/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..7b40ba44f7 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'; 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 a9a0a60976..f1e1fd6a4d 100644 --- a/src/stores/local-echo/RoomEchoChamber.ts +++ b/src/stores/local-echo/RoomEchoChamber.ts @@ -14,12 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { EventType } from "matrix-js-sdk/src/@types/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"; -import { EventType } from "matrix-js-sdk/src/@types/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 eab246399a..4e12fbbf26 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 { NotificationState, NotificationStateEvents } from "./NotificationState"; diff --git a/src/stores/notifications/NotificationState.ts b/src/stores/notifications/NotificationState.ts index 744eb81151..52ce0f7439 100644 --- a/src/stores/notifications/NotificationState.ts +++ b/src/stores/notifications/NotificationState.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { TypedEventEmitter } from "matrix-js-sdk/src/models/typed-event-emitter"; + import { NotificationColor } from "./NotificationColor"; import { IDestroyable } from "../../utils/IDestroyable"; -import { TypedEventEmitter } from "matrix-js-sdk/src/models/typed-event-emitter"; export interface INotificationStateSnapshotParams { symbol: string | null; 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 c38675ec94..a15efd87ab 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/notifications/ThreadNotificationState.ts b/src/stores/notifications/ThreadNotificationState.ts index 1ad988cedf..c8c74a07e7 100644 --- a/src/stores/notifications/ThreadNotificationState.ts +++ b/src/stores/notifications/ThreadNotificationState.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 { Thread, ThreadEvent } from "matrix-js-sdk/src/models/thread"; +import { Room } from "matrix-js-sdk/src/models/room"; + import { NotificationColor } from "./NotificationColor"; import { IDestroyable } from "../../utils/IDestroyable"; import { MatrixClientPeg } from "../../MatrixClientPeg"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { NotificationState } from "./NotificationState"; -import { Thread, ThreadEvent } from "matrix-js-sdk/src/models/thread"; -import { Room } from "matrix-js-sdk/src/models/room"; export class ThreadNotificationState extends NotificationState implements IDestroyable { protected _symbol = null; diff --git a/src/stores/notifications/ThreadsRoomNotificationState.ts b/src/stores/notifications/ThreadsRoomNotificationState.ts index 4caa405343..eef8ff3991 100644 --- a/src/stores/notifications/ThreadsRoomNotificationState.ts +++ b/src/stores/notifications/ThreadsRoomNotificationState.ts @@ -14,10 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { IDestroyable } from "../../utils/IDestroyable"; import { Room } from "matrix-js-sdk/src/models/room"; -import { NotificationState, NotificationStateEvents } from "./NotificationState"; import { Thread, ThreadEvent } from "matrix-js-sdk/src/models/thread"; + +import { IDestroyable } from "../../utils/IDestroyable"; +import { NotificationState, NotificationStateEvents } from "./NotificationState"; import { ThreadNotificationState } from "./ThreadNotificationState"; import { NotificationColor } from "./NotificationColor"; 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 9fbfcb32e2..4c3e6d3f11 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 "../spaces/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 c812edee48..0c17452c0c 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 "../../spaces/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 21dff9d319..c851121c00 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 ad82ba1ea6..c1c11a5c6f 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 0d26cea144..38c6dc08e4 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"; @@ -52,14 +55,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 dca8d73318..83b7dfb827 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, RelationType } from "matrix-js-sdk/src/@types/event"; +import { IContent, 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, RelationType } 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 { IContent, 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 SettingsStore from "../../settings/SettingsStore"; // TODO: Purge this from the universe diff --git a/src/stores/widgets/WidgetLayoutStore.ts b/src/stores/widgets/WidgetLayoutStore.ts index 823dd450d2..ba98d48feb 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 e344d58fed..ca846cae5b 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"; import { compare } from "./utils/strings"; diff --git a/src/toasts/IncomingCallToast.tsx b/src/toasts/IncomingCallToast.tsx index 4a31ccbb85..555a14653e 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 { MatrixClientPeg } from '../MatrixClientPeg'; 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 e85ccde228..a2773ab044 100644 --- a/src/utils/EventUtils.ts +++ b/src/utils/EventUtils.ts @@ -15,15 +15,15 @@ limitations under the License. */ import { EventStatus, MatrixEvent } from 'matrix-js-sdk/src/models/event'; +import { EventType, MsgType, RelationType } 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, MsgType, RelationType } 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 { POLL_START_EVENT_TYPE } from '../polls/consts'; /** 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 902c5d00ca..e8189b0c0f 100644 --- a/src/utils/RoomUpgrade.ts +++ b/src/utils/RoomUpgrade.ts @@ -16,6 +16,8 @@ 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 { MatrixClient } from "matrix-js-sdk/src/client"; import { inviteUsersToRoom } from "../RoomInvite"; import Modal, { IHandle } from "../Modal"; @@ -24,9 +26,6 @@ import ErrorDialog from "../components/views/dialogs/ErrorDialog"; import SpaceStore from "../stores/spaces/SpaceStore"; import Spinner from "../components/views/elements/Spinner"; -import { logger } from "matrix-js-sdk/src/logger"; -import { MatrixClient } from "matrix-js-sdk/src/client"; - 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..867c912470 100644 --- a/src/utils/createMatrixClient.ts +++ b/src/utils/createMatrixClient.ts @@ -13,14 +13,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and 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"; +// @ts-ignore - `.ts` is needed here to make TS happy +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 7861e5ce9a..336304ceab 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 4b70ce7e62..a39bced5d6 100644 --- a/src/utils/exportUtils/HtmlExport.tsx +++ b/src/utils/exportUtils/HtmlExport.tsx @@ -16,29 +16,30 @@ 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/enums/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 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 2b31737dde..d09624dc62 100644 --- a/src/utils/membership.ts +++ b/src/utils/membership.ts @@ -17,12 +17,12 @@ limitations under the License. import { Room } from "matrix-js-sdk/src/models/room"; import { sleep } from "matrix-js-sdk/src/utils"; import { EventStatus } from "matrix-js-sdk/src/models/event"; +import React from "react"; import { MatrixClientPeg } from "../MatrixClientPeg"; import { _t } from "../languageHandler"; import Modal, { IHandle } from "../Modal"; import ErrorDialog from "../components/views/dialogs/ErrorDialog"; -import React from "react"; import dis from "../dispatcher/dispatcher"; import RoomViewStore from "../stores/RoomViewStore"; import Spinner from "../components/views/elements/Spinner"; diff --git a/src/utils/permalinks/Permalinks.ts b/src/utils/permalinks/Permalinks.ts index 7627f30ed6..3a9200259f 100644 --- a/src/utils/permalinks/Permalinks.ts +++ b/src/utils/permalinks/Permalinks.ts @@ -20,14 +20,13 @@ 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"; import PermalinkConstructor, { PermalinkParts } from "./PermalinkConstructor"; import ElementPermalinkConstructor from "./ElementPermalinkConstructor"; import SdkConfig from "../../SdkConfig"; - -import { logger } from "matrix-js-sdk/src/logger"; import { ELEMENT_URL_PATTERN } from "../../linkify-matrix"; // The maximum number of servers to pick when working out which servers 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 006fbbdc58..5bf54490e4 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 57f592cca8..6aaf8cbe1b 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, CallType } from 'matrix-js-sdk/src/webrtc/call'; +import EventEmitter from 'events'; + import CallHandler, { CallHandlerEvent } from '../src/CallHandler'; import { stubClient, mkStubRoom } from './test-utils'; import { MatrixClientPeg } from '../src/MatrixClientPeg'; import dis from '../src/dispatcher/dispatcher'; -import { CallEvent, CallState, CallType } 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 4f0e4d2f09..f8369672de 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 336d9c5401..5e2b69db92 100644 --- a/test/PosthogAnalytics-test.ts +++ b/test/PosthogAnalytics-test.ts @@ -20,7 +20,6 @@ import { IEvent, 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 422d76456e..2f2a00cca1 100644 --- a/test/components/structures/auth/Registration-test.js +++ b/test/components/structures/auth/Registration-test.js @@ -14,13 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import sdk from '../../../skinned-sdk'; - import React from 'react'; import ReactDOM from 'react-dom'; import ReactTestUtils from 'react-dom/test-utils'; import { createClient } from 'matrix-js-sdk/src/matrix'; +import sdk from '../../../skinned-sdk'; import SdkConfig from '../../../../src/SdkConfig'; import { createTestClient, 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/elements/PollCreateDialog-test.tsx b/test/components/views/elements/PollCreateDialog-test.tsx index ba530b6f9d..38233a7e31 100644 --- a/test/components/views/elements/PollCreateDialog-test.tsx +++ b/test/components/views/elements/PollCreateDialog-test.tsx @@ -18,9 +18,10 @@ limitations under the License. import '../../../skinned-sdk'; import React from "react"; import { mount, ReactWrapper } from "enzyme"; +import { Room } from "matrix-js-sdk/src/models/room"; + import * as TestUtils from "../../../test-utils"; import { MatrixClientPeg } from "../../../../src/MatrixClientPeg"; -import { Room } from "matrix-js-sdk/src/models/room"; import _PollCreateDialog from "../../../../src/components/views/elements/PollCreateDialog"; const PollCreateDialog = TestUtils.wrapInMatrixClientContext(_PollCreateDialog); 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/messages/MPollBody-test.tsx b/test/components/views/messages/MPollBody-test.tsx index 4a5d80a905..d57137c566 100644 --- a/test/components/views/messages/MPollBody-test.tsx +++ b/test/components/views/messages/MPollBody-test.tsx @@ -16,13 +16,12 @@ limitations under the License. import React from "react"; import { mount, ReactWrapper } from "enzyme"; - -import sdk from "../../../skinned-sdk"; -import * as TestUtils from "../../../test-utils"; - import { Callback, IContent, MatrixClient, MatrixEvent, Room } from "matrix-js-sdk"; import { ISendEventResponse } from "matrix-js-sdk/src/@types/requests"; import { Relations } from "matrix-js-sdk/src/models/relations"; + +import * as TestUtils from "../../../test-utils"; +import sdk from "../../../skinned-sdk"; import { IPollAnswer, IPollContent, 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 c827becca4..e126642bb7 100644 --- a/test/components/views/rooms/RoomHeader-test.tsx +++ b/test/components/views/rooms/RoomHeader-test.tsx @@ -1,16 +1,12 @@ import React from 'react'; import ReactDOM from 'react-dom'; +import { Room, PendingEventOrdering, MatrixEvent, MatrixClient } from 'matrix-js-sdk'; import "../../../skinned-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.ts b/test/end-to-end-tests/src/rest/creator.ts index 9b68face62..b88501e48d 100644 --- a/test/end-to-end-tests/src/rest/creator.ts +++ b/test/end-to-end-tests/src/rest/creator.ts @@ -17,6 +17,7 @@ limitations under the License. import { exec } from 'child_process'; import request = require('request-promise-native'); + import { RestSession } from './session'; import { RestMultiSession } from './multi'; diff --git a/test/end-to-end-tests/src/rest/room.ts b/test/end-to-end-tests/src/rest/room.ts index 95a349e39f..da5f91a607 100644 --- a/test/end-to-end-tests/src/rest/room.ts +++ b/test/end-to-end-tests/src/rest/room.ts @@ -16,6 +16,7 @@ limitations under the License. */ import uuidv4 = require('uuid/v4'); + import { RestSession } from "./session"; import { Logger } from "../logger"; diff --git a/test/end-to-end-tests/src/rest/session.ts b/test/end-to-end-tests/src/rest/session.ts index 5b5dd387ef..ef9268aecf 100644 --- a/test/end-to-end-tests/src/rest/session.ts +++ b/test/end-to-end-tests/src/rest/session.ts @@ -15,6 +15,7 @@ limitations under the License. */ import request = require('request-promise-native'); + import { Logger } from '../logger'; import { RestRoom } from './room'; import { approveConsent } from './consent'; diff --git a/test/end-to-end-tests/src/scenarios/e2e-encryption.ts b/test/end-to-end-tests/src/scenarios/e2e-encryption.ts index 9d77ecc59d..17aa4bcc2f 100644 --- a/test/end-to-end-tests/src/scenarios/e2e-encryption.ts +++ b/test/end-to-end-tests/src/scenarios/e2e-encryption.ts @@ -15,8 +15,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { ElementSession } from "../session"; +import { strict as assert } from 'assert'; +import { ElementSession } from "../session"; import { sendMessage } from '../usecases/send-message'; import { acceptInvite } from '../usecases/accept-invite'; import { receiveMessage } from '../usecases/timeline'; @@ -24,7 +25,6 @@ import { createDm } from '../usecases/create-room'; import { checkRoomSettings } from '../usecases/room-settings'; import { startSasVerification, acceptSasVerification } from '../usecases/verify'; import { setupSecureBackup } from '../usecases/security'; -import { strict as assert } from 'assert'; import { measureStart, measureStop } from '../util'; export async function e2eEncryptionScenarios(alice: ElementSession, bob: ElementSession) { diff --git a/test/end-to-end-tests/src/scenarios/lazy-loading.ts b/test/end-to-end-tests/src/scenarios/lazy-loading.ts index e0bae4d77f..3cbfdafdab 100644 --- a/test/end-to-end-tests/src/scenarios/lazy-loading.ts +++ b/test/end-to-end-tests/src/scenarios/lazy-loading.ts @@ -15,6 +15,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { strict as assert } from 'assert'; + import { delay } from '../util'; import { join } from '../usecases/join'; import { sendMessage } from '../usecases/send-message'; @@ -25,7 +27,6 @@ import { import { createRoom } from '../usecases/create-room'; import { getMembersInMemberlist } from '../usecases/memberlist'; import { changeRoomSettings } from '../usecases/room-settings'; -import { strict as assert } from 'assert'; import { RestMultiSession } from "../rest/multi"; import { ElementSession } from "../session"; diff --git a/test/end-to-end-tests/src/scenarios/spaces.ts b/test/end-to-end-tests/src/scenarios/spaces.ts index ed8358d088..909d58afe2 100644 --- a/test/end-to-end-tests/src/scenarios/spaces.ts +++ b/test/end-to-end-tests/src/scenarios/spaces.ts @@ -1,5 +1,3 @@ -import { ElementSession } from "../session"; - /* Copyright 2021 The Matrix.org Foundation C.I.C. @@ -17,6 +15,7 @@ limitations under the License. */ import { createSpace, inviteSpace } from "../usecases/create-space"; +import { ElementSession } from "../session"; export async function spacesScenarios(alice: ElementSession, bob: ElementSession): Promise { console.log(" creating a space for spaces scenarios:"); diff --git a/test/end-to-end-tests/src/session.ts b/test/end-to-end-tests/src/session.ts index 80a85f6d5f..84f9b66e56 100644 --- a/test/end-to-end-tests/src/session.ts +++ b/test/end-to-end-tests/src/session.ts @@ -16,6 +16,7 @@ limitations under the License. */ import * as puppeteer from 'puppeteer'; + import { Logger } from './logger'; import { LogBuffer } from './logbuffer'; import { delay } from './util'; diff --git a/test/end-to-end-tests/src/usecases/create-room.ts b/test/end-to-end-tests/src/usecases/create-room.ts index b3e2cecf21..8736e785ba 100644 --- a/test/end-to-end-tests/src/usecases/create-room.ts +++ b/test/end-to-end-tests/src/usecases/create-room.ts @@ -15,9 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import * as puppeteer from "puppeteer"; + import { measureStart, measureStop } from '../util'; import { ElementSession } from "../session"; -import * as puppeteer from "puppeteer"; export async function openRoomDirectory(session: ElementSession): Promise { const roomDirectoryButton = await session.query('.mx_LeftPanel_exploreButton'); diff --git a/test/end-to-end-tests/src/usecases/dialog.ts b/test/end-to-end-tests/src/usecases/dialog.ts index e88617bdf5..aee6620ff9 100644 --- a/test/end-to-end-tests/src/usecases/dialog.ts +++ b/test/end-to-end-tests/src/usecases/dialog.ts @@ -16,6 +16,7 @@ limitations under the License. */ import { strict as assert } from 'assert'; + import { ElementSession } from "../session"; export async function assertDialog(session: ElementSession, expectedTitle: string): Promise { diff --git a/test/end-to-end-tests/src/usecases/memberlist.ts b/test/end-to-end-tests/src/usecases/memberlist.ts index 6ac8ea2c6a..2aa61313a3 100644 --- a/test/end-to-end-tests/src/usecases/memberlist.ts +++ b/test/end-to-end-tests/src/usecases/memberlist.ts @@ -16,9 +16,10 @@ limitations under the License. */ import { strict as assert } from 'assert'; +import { ElementHandle } from "puppeteer"; + import { openRoomSummaryCard } from "./rightpanel"; import { ElementSession } from "../session"; -import { ElementHandle } from "puppeteer"; export async function openMemberInfo(session: ElementSession, name: String): Promise { const membersAndNames = await getMembersInMemberlist(session); diff --git a/test/end-to-end-tests/src/usecases/room-settings.ts b/test/end-to-end-tests/src/usecases/room-settings.ts index 8e70627a87..e036c78e1a 100644 --- a/test/end-to-end-tests/src/usecases/room-settings.ts +++ b/test/end-to-end-tests/src/usecases/room-settings.ts @@ -16,10 +16,11 @@ limitations under the License. */ import { strict as assert } from 'assert'; +import { ElementHandle } from "puppeteer"; + import { openRoomSummaryCard } from "./rightpanel"; import { acceptDialog } from './dialog'; import { ElementSession } from "../session"; -import { ElementHandle } from "puppeteer"; export async function setSettingsToggle(session: ElementSession, toggle: ElementHandle, enabled): Promise { const className = await session.getElementProperty(toggle, "className"); diff --git a/test/end-to-end-tests/src/usecases/send-message.ts b/test/end-to-end-tests/src/usecases/send-message.ts index ab1dc96d71..cbbc836a3b 100644 --- a/test/end-to-end-tests/src/usecases/send-message.ts +++ b/test/end-to-end-tests/src/usecases/send-message.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { strict as assert } from 'assert'; + import { ElementSession } from "../session"; export async function sendMessage(session: ElementSession, message: string): Promise { diff --git a/test/end-to-end-tests/src/usecases/settings.ts b/test/end-to-end-tests/src/usecases/settings.ts index a8e2bfee45..f0a3fdc35d 100644 --- a/test/end-to-end-tests/src/usecases/settings.ts +++ b/test/end-to-end-tests/src/usecases/settings.ts @@ -16,6 +16,7 @@ limitations under the License. */ import { strict as assert } from 'assert'; + import { ElementSession } from "../session"; export async function openSettings(session: ElementSession, section: string): Promise { diff --git a/test/end-to-end-tests/src/usecases/signup.ts b/test/end-to-end-tests/src/usecases/signup.ts index 24282fc60e..55301c3108 100644 --- a/test/end-to-end-tests/src/usecases/signup.ts +++ b/test/end-to-end-tests/src/usecases/signup.ts @@ -16,6 +16,7 @@ limitations under the License. */ import { strict as assert } from 'assert'; + import { ElementSession } from "../session"; export async function signup(session: ElementSession, username: string, password: string, diff --git a/test/end-to-end-tests/src/usecases/timeline.ts b/test/end-to-end-tests/src/usecases/timeline.ts index 7906eb3c88..e0b3710b42 100644 --- a/test/end-to-end-tests/src/usecases/timeline.ts +++ b/test/end-to-end-tests/src/usecases/timeline.ts @@ -16,9 +16,10 @@ limitations under the License. */ import { strict as assert } from 'assert'; -import { ElementSession } from "../session"; import { ElementHandle } from "puppeteer"; +import { ElementSession } from "../session"; + export async function scrollToTimelineTop(session: ElementSession): Promise { session.log.step(`scrolls to the top of the timeline`); await session.page.evaluate(() => { diff --git a/test/end-to-end-tests/src/usecases/toasts.ts b/test/end-to-end-tests/src/usecases/toasts.ts index c90f9ef16c..6923471c98 100644 --- a/test/end-to-end-tests/src/usecases/toasts.ts +++ b/test/end-to-end-tests/src/usecases/toasts.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { strict as assert } from 'assert'; + import { ElementSession } from "../session"; export async function assertNoToasts(session: ElementSession): Promise { diff --git a/test/end-to-end-tests/src/usecases/verify.ts b/test/end-to-end-tests/src/usecases/verify.ts index b0a2e0588d..84cd342e6e 100644 --- a/test/end-to-end-tests/src/usecases/verify.ts +++ b/test/end-to-end-tests/src/usecases/verify.ts @@ -16,6 +16,7 @@ limitations under the License. */ import { strict as assert } from 'assert'; + import { openMemberInfo } from "./memberlist"; import { ElementSession } from "../session"; diff --git a/test/end-to-end-tests/start.ts b/test/end-to-end-tests/start.ts index 77013939e6..5e6b9b6066 100644 --- a/test/end-to-end-tests/start.ts +++ b/test/end-to-end-tests/start.ts @@ -14,12 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ +import * as fs from "fs"; +import program = require('commander'); + import { ElementSession } from './src/session'; import { scenario } from './src/scenario'; import { RestSessionCreator } from './src/rest/creator'; -import * as fs from "fs"; -import 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 0b92c0c854..aa1afb9492 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 a00ac39e87..684d757c6d 100644 --- a/test/stores/RoomViewStore-test.js +++ b/test/stores/RoomViewStore-test.js @@ -1,8 +1,6 @@ import RoomViewStore from '../../src/stores/RoomViewStore'; import { Action } from '../../src/dispatcher/actions'; - import { MatrixClientPeg as peg } from '../../src/MatrixClientPeg'; - import * as testUtils from '../test-utils'; const dispatch = testUtils.getDispatchForStore(RoomViewStore); diff --git a/test/stores/WidgetLayoutStore-test.ts b/test/stores/WidgetLayoutStore-test.ts index 61399862ab..038a489f72 100644 --- a/test/stores/WidgetLayoutStore-test.ts +++ b/test/stores/WidgetLayoutStore-test.ts @@ -15,9 +15,10 @@ limitations under the License. */ import "../skinned-sdk"; // Must be first for skinning to work +import { Room } from "matrix-js-sdk"; + import WidgetStore, { IApp } from "../../src/stores/WidgetStore"; import { Container, WidgetLayoutStore } from "../../src/stores/widgets/WidgetLayoutStore"; -import { Room } from "matrix-js-sdk"; import { stubClient } from "../test-utils"; // setup test env values diff --git a/test/test-utils.js b/test/test-utils.js index 9efa8b6098..d34385c7de 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..1ce463fdbd 100644 --- a/test/utils/export-test.tsx +++ b/test/utils/export-test.tsx @@ -14,7 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { renderToString } from "react-dom/server"; 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,7 +24,6 @@ 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.