From 860c0596e182e37d4777a867c63eac267af6faa3 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Fri, 22 Oct 2021 17:21:46 -0500 Subject: [PATCH 01/12] Add rule to group imports by external and internal Signed-off-by: Aaron Raimist --- .eslintrc.js | 16 +++++-- package.json | 1 + yarn.lock | 131 +++++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 137 insertions(+), 11 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 9d68942228..94e19c8eea 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,5 +1,5 @@ module.exports = { - plugins: ["matrix-org"], + plugins: ["matrix-org", "import"], extends: [ "plugin:matrix-org/babel", "plugin:matrix-org/react", @@ -36,6 +36,16 @@ module.exports = { "Use Media helper instead to centralise access for customisation.", ), ], + + "import/order": [ + "error", { + "groups": [["builtin", "external"], ["internal", "parent", "sibling", "index", "object", "type"]], + "newlines-between": "always", + }, + ], + "import/first": "error", + "import/newline-after-import": "error", + "import/no-duplicates": "error", }, overrides: [{ files: [ @@ -66,8 +76,8 @@ module.exports = { settings: { react: { version: "detect", - } - } + }, + }, }; function buildRestrictedPropertiesOptions(properties, message) { diff --git a/package.json b/package.json index d305b6f889..02eb6f4c05 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,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/yarn.lock b/yarn.lock index 7603c3448e..89100f7c79 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1308,7 +1308,6 @@ "@matrix-org/olm@https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.3.tgz": version "3.2.3" - uid cc332fdd25c08ef0e40f4d33fc3f822a0f98b6f4 resolved "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.3.tgz#cc332fdd25c08ef0e40f4d33fc3f822a0f98b6f4" "@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3": @@ -1728,6 +1727,11 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= + "@types/linkifyjs@^2.1.3": version "2.1.4" resolved "https://registry.yarnpkg.com/@types/linkifyjs/-/linkifyjs-2.1.4.tgz#6b14e35d8d211f2666f602dcabcdc6859617516f" @@ -2151,7 +2155,7 @@ arr-union@^3.1.0: resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= -array-includes@^3.1.3: +array-includes@^3.1.3, array-includes@^3.1.4: version "3.1.4" resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.4.tgz#f5b493162c760f3539631f005ba2bb46acb45ba9" integrity sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw== @@ -2183,7 +2187,7 @@ array.prototype.filter@^1.0.0: es-array-method-boxes-properly "^1.0.0" is-string "^1.0.7" -array.prototype.flat@^1.2.3: +array.prototype.flat@^1.2.3, array.prototype.flat@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz#07e0975d84bbc7c48cd1879d609e682598d33e13" integrity sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg== @@ -3070,13 +3074,20 @@ debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: dependencies: ms "2.1.2" -debug@^2.2.0, debug@^2.3.3: +debug@^2.2.0, debug@^2.3.3, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" +debug@^3.2.7: + version "3.2.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== + dependencies: + ms "^2.1.1" + decamelize-keys@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" @@ -3541,6 +3552,42 @@ eslint-config-google@^0.14.0: resolved "https://registry.yarnpkg.com/eslint-config-google/-/eslint-config-google-0.14.0.tgz#4f5f8759ba6e11b424294a219dbfa18c508bcc1a" integrity sha512-WsbX4WbjuMvTdeVL6+J3rK1RGhCTqjsFjX7UMSMgZiyxxaNLkoJENbrGExzERFeoTpGw3F3FypTiWAP9ZXzkEw== +eslint-import-resolver-node@^0.3.6: + version "0.3.6" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz#4048b958395da89668252001dbd9eca6b83bacbd" + integrity sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw== + dependencies: + debug "^3.2.7" + resolve "^1.20.0" + +eslint-module-utils@^2.7.0: + version "2.7.1" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.1.tgz#b435001c9f8dd4ab7f6d0efcae4b9696d4c24b7c" + integrity sha512-fjoetBXQZq2tSTWZ9yWVl2KuFrTZZH3V+9iD1V1RfpDgxzJR+mPd/KZmMiA8gbPqdBzpNiEHOuT7IYEWxrH0zQ== + dependencies: + debug "^3.2.7" + find-up "^2.1.0" + pkg-dir "^2.0.0" + +eslint-plugin-import@^2.25.2: + version "2.25.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.25.2.tgz#b3b9160efddb702fc1636659e71ba1d10adbe9e9" + integrity sha512-qCwQr9TYfoBHOFcVGKY9C9unq05uOxxdklmBXLVvcwo68y5Hta6/GzCZEMx2zQiu0woKNEER0LE7ZgaOfBU14g== + dependencies: + array-includes "^3.1.4" + array.prototype.flat "^1.2.5" + debug "^2.6.9" + doctrine "^2.1.0" + eslint-import-resolver-node "^0.3.6" + eslint-module-utils "^2.7.0" + has "^1.0.3" + is-core-module "^2.7.0" + is-glob "^4.0.3" + minimatch "^3.0.4" + object.values "^1.1.5" + resolve "^1.20.0" + tsconfig-paths "^3.11.0" + "eslint-plugin-matrix-org@github:matrix-org/eslint-plugin-matrix-org#2306b3d4da4eba908b256014b979f1d3d43d2945": version "0.3.5" resolved "https://codeload.github.com/matrix-org/eslint-plugin-matrix-org/tar.gz/2306b3d4da4eba908b256014b979f1d3d43d2945" @@ -3974,6 +4021,13 @@ find-cache-dir@^2.0.0: make-dir "^2.0.0" pkg-dir "^3.0.0" +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= + dependencies: + locate-path "^2.0.0" + find-up@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" @@ -4655,7 +4709,7 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" -is-core-module@^2.2.0, is-core-module@^2.5.0: +is-core-module@^2.2.0, is-core-module@^2.5.0, is-core-module@^2.7.0: version "2.8.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.0.tgz#0321336c3d0925e497fd97f5d95cb114a5ccd548" integrity sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw== @@ -4784,7 +4838,7 @@ is-generator-function@^1.0.10: dependencies: has-tostringtag "^1.0.0" -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== @@ -5597,6 +5651,13 @@ json-stringify-safe@~5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= +json5@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + dependencies: + minimist "^1.2.0" + json5@^2.1.2: version "2.2.0" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" @@ -5725,6 +5786,14 @@ loader-utils@^2.0.0: emojis-list "^3.0.0" json5 "^2.1.2" +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + locate-path@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" @@ -6102,6 +6171,11 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== +ms@^2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + nanoid@^3.1.28: version "3.1.30" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.30.tgz#63f93cc548d2a113dc5dfbc63bfa09e2b9b64362" @@ -6371,7 +6445,7 @@ object.pick@^1.3.0: dependencies: isobject "^3.0.1" -object.values@^1.1.0, object.values@^1.1.1, object.values@^1.1.4: +object.values@^1.1.0, object.values@^1.1.1, object.values@^1.1.4, object.values@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.5.tgz#959f63e3ce9ef108720333082131e4a459b716ac" integrity sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg== @@ -6433,6 +6507,13 @@ p-finally@^1.0.0: resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + p-limit@^2.0.0, p-limit@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" @@ -6440,6 +6521,13 @@ p-limit@^2.0.0, p-limit@^2.2.0: dependencies: p-try "^2.0.0" +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + dependencies: + p-limit "^1.1.0" + p-locate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" @@ -6462,6 +6550,11 @@ p-retry@^4.5.0: "@types/retry" "^0.12.0" retry "^0.13.1" +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + p-try@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" @@ -6608,6 +6701,13 @@ pirates@^4.0.0, pirates@^4.0.1: dependencies: node-modules-regexp "^1.0.0" +pkg-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= + dependencies: + find-up "^2.1.0" + pkg-dir@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" @@ -7268,7 +7368,7 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.10.0, resolve@^1.14.2, resolve@^1.18.1: +resolve@^1.10.0, resolve@^1.14.2, resolve@^1.18.1, resolve@^1.20.0: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== @@ -7800,6 +7900,11 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + strip-bom@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" @@ -8103,6 +8208,16 @@ trough@^1.0.0: resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.5.tgz#b8b639cefad7d0bb2abd37d433ff8293efa5f406" integrity sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA== +tsconfig-paths@^3.11.0: + version "3.11.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz#954c1fe973da6339c78e06b03ce2e48810b65f36" + integrity sha512-7ecdYDnIdmv639mmDwslG6KQg1Z9STTz1j7Gcz0xa+nshh/gKDAHcPxRbWOsA3SPp0tXP2leTcY9Kw+NAkfZzA== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.1" + minimist "^1.2.0" + strip-bom "^3.0.0" + tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" From bdc56be8632bdd354ca48a4d06ef72b0937d1aac Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Fri, 22 Oct 2021 17:23:32 -0500 Subject: [PATCH 02/12] Auto fix Signed-off-by: Aaron Raimist --- src/ActiveRoomObserver.ts | 4 ++-- src/AddThreepid.ts | 3 ++- src/Analytics.tsx | 3 +-- src/AsyncWrapper.tsx | 3 +-- src/BasePlatform.ts | 4 ++-- src/CallHandler.tsx | 19 +++++++--------- src/ContentMessages.tsx | 9 ++++---- src/CountlyAnalytics.ts | 3 +-- src/DeviceListener.ts | 6 ++--- src/GroupAddressPicker.js | 1 + src/IdentityAuthClient.tsx | 3 +-- src/Lifecycle.ts | 3 +-- src/Livestream.ts | 1 + src/Login.ts | 4 ++-- src/MatrixClientPeg.ts | 8 +++---- src/MediaDeviceHandler.ts | 6 ++--- src/Notifier.ts | 3 +-- src/PasswordReset.ts | 1 + src/PosthogAnalytics.ts | 6 ++--- src/Presence.ts | 4 ++-- src/Registration.tsx | 1 + src/Resend.ts | 3 +-- src/RoomInvite.tsx | 3 +-- src/RoomNotifs.ts | 3 ++- src/ScalarAuthClient.ts | 11 +++++----- src/ScalarMessaging.ts | 6 ++--- src/Searching.ts | 2 +- src/SecurityManager.ts | 12 +++++----- src/SendHistoryManager.ts | 3 +-- src/SlashCommands.tsx | 7 +++--- src/Terms.ts | 3 +-- src/TextForEvent.tsx | 8 +++---- src/VoipUserMapper.ts | 6 ++--- src/actions/GroupActions.ts | 3 ++- src/actions/RoomListActions.ts | 8 +++---- src/actions/TagOrderActions.ts | 3 ++- .../eventindex/DisableEventIndexDialog.tsx | 2 +- .../eventindex/ManageEventIndexDialog.tsx | 2 +- .../dialogs/security/CreateKeyBackupDialog.js | 6 ++--- .../security/CreateSecretStorageDialog.js | 6 ++--- .../dialogs/security/ExportE2eKeysDialog.js | 7 +++--- .../dialogs/security/ImportE2eKeysDialog.js | 5 ++--- .../security/NewRecoveryMethodDialog.js | 1 + .../security/RecoveryMethodRemovedDialog.js | 1 + src/audio/Playback.ts | 6 ++--- src/audio/PlaybackClock.ts | 3 ++- src/audio/PlaybackQueue.ts | 6 ++--- src/audio/VoiceRecording.ts | 8 +++---- src/audio/compat.ts | 5 ++--- src/autocomplete/AutocompleteProvider.tsx | 1 + src/autocomplete/CommandProvider.tsx | 1 + src/autocomplete/CommunityProvider.tsx | 3 ++- src/autocomplete/EmojiProvider.tsx | 6 ++--- src/autocomplete/UserProvider.tsx | 12 +++++----- src/boundThreepids.ts | 1 + src/components/structures/CallEventGrouper.ts | 3 ++- .../structures/CustomRoomTagPanel.js | 3 ++- src/components/structures/EmbeddedPage.tsx | 8 +++---- src/components/structures/FilePanel.tsx | 5 +---- .../structures/GenericErrorPage.tsx | 1 + .../structures/GroupFilterPanel.tsx | 8 +++---- src/components/structures/GroupView.js | 11 +++++----- .../structures/HostSignupAction.tsx | 1 + .../structures/IndicatorScrollbar.tsx | 1 + src/components/structures/InteractiveAuth.tsx | 3 +-- src/components/structures/LoggedInView.tsx | 5 ++--- src/components/structures/MainSplit.tsx | 3 ++- src/components/structures/MatrixChat.tsx | 4 +--- src/components/structures/MessagePanel.tsx | 2 +- src/components/structures/MyGroups.js | 1 + .../structures/NonUrgentToastContainer.tsx | 1 + .../structures/NotificationPanel.tsx | 3 +-- src/components/structures/RightPanel.tsx | 2 +- src/components/structures/RoomDirectory.tsx | 3 +-- src/components/structures/RoomStatusBar.tsx | 9 ++++---- src/components/structures/RoomView.tsx | 9 ++++---- src/components/structures/ScrollPanel.tsx | 4 ++-- src/components/structures/SearchBox.tsx | 5 +++-- src/components/structures/SpaceRoomView.tsx | 3 +-- src/components/structures/TabbedView.tsx | 6 ++--- src/components/structures/ThreadPanel.tsx | 1 - src/components/structures/ThreadView.tsx | 1 - src/components/structures/TimelinePanel.tsx | 5 ++--- src/components/structures/ToastContainer.tsx | 3 ++- src/components/structures/UploadBar.tsx | 3 ++- src/components/structures/UserMenu.tsx | 3 ++- src/components/structures/UserView.tsx | 5 +++-- src/components/structures/ViewSource.tsx | 3 ++- .../structures/auth/CompleteSecurity.tsx | 1 + src/components/structures/auth/E2eSetup.tsx | 1 + .../structures/auth/ForgotPassword.tsx | 6 ++--- src/components/structures/auth/Login.tsx | 5 ++--- .../structures/auth/Registration.tsx | 5 ++--- .../structures/auth/SetupEncryptionBody.tsx | 10 ++++----- src/components/structures/auth/SoftLogout.tsx | 4 ++-- .../views/audio_messages/AudioPlayer.tsx | 1 + .../views/audio_messages/AudioPlayerBase.tsx | 6 ++--- src/components/views/audio_messages/Clock.tsx | 1 + .../views/audio_messages/DurationClock.tsx | 1 + .../audio_messages/LiveRecordingClock.tsx | 1 + .../audio_messages/LiveRecordingWaveform.tsx | 1 + .../views/audio_messages/PlayPauseButton.tsx | 3 ++- .../views/audio_messages/PlaybackClock.tsx | 1 + .../views/audio_messages/PlaybackWaveform.tsx | 1 + .../audio_messages/RecordingPlayback.tsx | 1 + .../views/audio_messages/SeekBar.tsx | 3 ++- .../views/audio_messages/Waveform.tsx | 6 ++--- src/components/views/auth/AuthBody.tsx | 1 + src/components/views/auth/AuthFooter.tsx | 3 ++- src/components/views/auth/AuthHeader.tsx | 1 + src/components/views/auth/AuthHeaderLogo.tsx | 1 + src/components/views/auth/AuthPage.tsx | 1 + src/components/views/auth/CaptchaForm.tsx | 4 ++-- .../views/auth/CompleteSecurityBody.tsx | 1 + .../auth/InteractiveAuthEntryComponents.tsx | 3 +-- .../views/auth/LanguageSelector.tsx | 3 ++- .../views/auth/RegistrationForm.tsx | 3 +-- src/components/views/avatars/MemberAvatar.tsx | 3 +-- .../avatars/MemberStatusMessageAvatar.tsx | 7 +++--- .../views/context_menus/CallContextMenu.tsx | 3 ++- .../context_menus/DialpadContextMenu.tsx | 3 ++- .../GenericElementContextMenu.tsx | 1 + .../context_menus/GenericTextContextMenu.tsx | 1 + .../GroupInviteTileContextMenu.js | 6 ++--- .../StatusMessageContextMenu.tsx | 3 ++- .../views/context_menus/TagTileContextMenu.js | 1 + .../views/context_menus/WidgetContextMenu.tsx | 3 +-- .../dialogs/AddExistingToSpaceDialog.tsx | 3 +-- .../views/dialogs/AddressPickerDialog.tsx | 3 +-- .../views/dialogs/AskInviteAnywayDialog.tsx | 1 + src/components/views/dialogs/BaseDialog.tsx | 2 +- .../views/dialogs/BugReportDialog.tsx | 1 + .../views/dialogs/ChangelogDialog.tsx | 1 + .../CommunityPrototypeInviteDialog.tsx | 6 ++--- .../dialogs/ConfirmAndWaitRedactDialog.tsx | 1 + .../views/dialogs/ConfirmRedactDialog.tsx | 1 + .../dialogs/ConfirmSpaceUserActionDialog.tsx | 2 +- .../views/dialogs/ConfirmWipeDeviceDialog.tsx | 1 + .../CreateCommunityPrototypeDialog.tsx | 4 ++-- .../views/dialogs/CreateGroupDialog.tsx | 1 + .../CreateSpaceFromCommunityDialog.tsx | 3 +-- .../views/dialogs/CreateSubspaceDialog.tsx | 3 +-- .../views/dialogs/CryptoStoreTooNewDialog.tsx | 1 + .../views/dialogs/DeactivateAccountDialog.tsx | 3 +-- .../views/dialogs/DevtoolsDialog.tsx | 19 ++++++++-------- .../dialogs/EditCommunityPrototypeDialog.tsx | 4 ++-- src/components/views/dialogs/ErrorDialog.tsx | 1 + src/components/views/dialogs/ExportDialog.tsx | 4 ++-- .../views/dialogs/FeedbackDialog.tsx | 1 + .../views/dialogs/HostSignupDialog.tsx | 6 ++--- .../views/dialogs/IncomingSasDialog.tsx | 8 +++---- .../dialogs/IntegrationsDisabledDialog.tsx | 1 + .../dialogs/IntegrationsImpossibleDialog.tsx | 1 + .../views/dialogs/InteractiveAuthDialog.tsx | 5 ++--- src/components/views/dialogs/InviteDialog.tsx | 14 +++++------- .../KeySignatureUploadFailedDialog.tsx | 1 + .../dialogs/LazyLoadingDisabledDialog.tsx | 1 + .../views/dialogs/LazyLoadingResyncDialog.tsx | 1 + src/components/views/dialogs/LogoutDialog.tsx | 4 ++-- .../ManualDeviceKeyVerificationDialog.tsx | 3 ++- .../dialogs/MessageEditHistoryDialog.tsx | 10 ++++----- .../views/dialogs/ModalWidgetDialog.tsx | 7 +++--- .../dialogs/RegistrationEmailPromptDialog.tsx | 2 +- .../views/dialogs/ReportEventDialog.tsx | 3 ++- .../views/dialogs/RoomSettingsDialog.tsx | 1 + .../views/dialogs/ServerOfflineDialog.tsx | 1 + .../views/dialogs/ServerPickerDialog.tsx | 3 +-- .../views/dialogs/SeshatResetDialog.tsx | 3 +-- .../dialogs/SessionRestoreErrorDialog.tsx | 1 + .../views/dialogs/SetEmailDialog.tsx | 4 ++-- src/components/views/dialogs/ShareDialog.tsx | 1 + .../views/dialogs/SlashCommandHelpDialog.tsx | 1 + .../views/dialogs/StorageEvictedDialog.tsx | 1 + .../TabbedIntegrationManagerDialog.tsx | 8 +++---- src/components/views/dialogs/TermsDialog.tsx | 6 ++--- .../views/dialogs/TextInputDialog.tsx | 1 + .../views/dialogs/UploadConfirmDialog.tsx | 3 ++- .../views/dialogs/UploadFailureDialog.tsx | 2 +- .../views/dialogs/UserSettingsDialog.tsx | 1 + .../dialogs/VerificationRequestDialog.tsx | 5 +++-- .../WidgetCapabilitiesPromptDialog.tsx | 9 ++++---- .../dialogs/WidgetOpenIDPermissionsDialog.tsx | 6 ++--- .../security/AccessSecretStorageDialog.tsx | 3 +-- .../ConfirmDestroyCrossSigningDialog.tsx | 1 + .../security/CreateCrossSigningDialog.tsx | 3 +-- .../security/RestoreKeyBackupDialog.tsx | 9 ++++---- .../security/SetupEncryptionDialog.tsx | 1 + .../views/elements/AccessibleButton.tsx | 2 +- .../views/elements/ActionButton.tsx | 1 + .../views/elements/AddressSelector.tsx | 1 + src/components/views/elements/AddressTile.tsx | 1 + .../views/elements/AppPermission.tsx | 3 ++- src/components/views/elements/AppTile.tsx | 10 ++++----- src/components/views/elements/DNDTagTile.js | 4 ++-- .../views/elements/DesktopBuildsNotice.tsx | 4 ++-- .../elements/DesktopCapturerSourcePicker.tsx | 3 ++- .../views/elements/DialPadBackspaceButton.tsx | 1 + .../views/elements/DialogButtons.tsx | 1 + .../views/elements/DirectorySearchBox.tsx | 1 + src/components/views/elements/Draggable.tsx | 1 + .../views/elements/EditableText.tsx | 1 + .../views/elements/EditableTextContainer.tsx | 1 + .../views/elements/EffectsOverlay.tsx | 4 ++-- .../views/elements/ErrorBoundary.tsx | 3 +-- src/components/views/elements/Field.tsx | 3 ++- src/components/views/elements/Flair.js | 4 ++-- .../elements/IRCTimelineProfileResizer.tsx | 1 + src/components/views/elements/ImageView.tsx | 5 +++-- .../views/elements/InlineSpinner.tsx | 1 + .../views/elements/InviteReason.tsx | 1 + .../views/elements/LazyRenderList.tsx | 1 + .../views/elements/MemberEventListSummary.tsx | 2 +- .../views/elements/PersistedElement.tsx | 2 +- .../views/elements/PersistentApp.tsx | 5 +++-- src/components/views/elements/Pill.js | 8 +++---- .../views/elements/PowerSelector.tsx | 1 + src/components/views/elements/ReplyChain.tsx | 10 ++++----- .../views/elements/SettingsFlag.tsx | 1 + src/components/views/elements/Slider.tsx | 1 + src/components/views/elements/Spinner.tsx | 1 + src/components/views/elements/Spoiler.tsx | 1 + .../views/elements/StyledCheckbox.tsx | 1 + .../views/elements/StyledRadioButton.tsx | 1 + .../views/elements/SyntaxHighlight.tsx | 1 + src/components/views/elements/TagComposer.tsx | 1 + src/components/views/elements/TagTile.js | 5 ++--- .../views/elements/TextWithTooltip.tsx | 1 + .../views/elements/ToggleSwitch.tsx | 1 + src/components/views/elements/Tooltip.tsx | 1 + .../views/elements/TooltipButton.tsx | 1 + .../views/elements/TruncatedList.tsx | 1 + src/components/views/elements/UserTagTile.tsx | 5 +++-- .../elements/crypto/VerificationQRCode.tsx | 3 ++- .../views/groups/GroupInviteTile.js | 3 ++- .../views/groups/GroupMemberList.js | 3 ++- .../views/groups/GroupMemberTile.js | 1 + .../views/groups/GroupPublicityToggle.js | 1 + src/components/views/groups/GroupRoomInfo.js | 4 ++-- src/components/views/groups/GroupRoomList.js | 3 ++- src/components/views/groups/GroupRoomTile.js | 1 + src/components/views/groups/GroupTile.js | 4 ++-- .../views/groups/GroupUserSettings.js | 4 ++-- .../views/host_signup/HostSignupContainer.tsx | 1 + src/components/views/messages/CallEvent.tsx | 6 ++--- .../views/messages/DownloadActionButton.tsx | 5 +++-- .../views/messages/EditHistoryMessage.tsx | 5 +++-- src/components/views/messages/IBodyProps.ts | 1 + src/components/views/messages/MAudioBody.tsx | 4 ++-- src/components/views/messages/MFileBody.tsx | 4 ++-- src/components/views/messages/MImageBody.tsx | 9 ++++---- .../views/messages/MImageReplyBody.tsx | 3 ++- .../views/messages/MJitsiWidgetEvent.tsx | 1 + .../messages/MKeyVerificationConclusion.tsx | 7 +++--- .../messages/MKeyVerificationRequest.tsx | 4 ++-- .../views/messages/MStickerBody.tsx | 1 + src/components/views/messages/MVideoBody.tsx | 3 +-- .../views/messages/MVoiceMessageBody.tsx | 1 + .../views/messages/MVoiceOrAudioBody.tsx | 1 + .../views/messages/MessageActionBar.tsx | 8 +++---- .../views/messages/MessageEvent.tsx | 3 ++- .../views/messages/MessageTimestamp.tsx | 1 + src/components/views/messages/MjolnirBody.tsx | 3 ++- .../views/messages/RedactedBody.tsx | 1 + .../views/messages/RoomAvatarEvent.tsx | 1 + src/components/views/messages/RoomCreate.tsx | 2 +- .../views/messages/ViewSourceEvent.tsx | 1 + .../views/right_panel/EncryptionInfo.tsx | 4 ++-- .../views/right_panel/EncryptionPanel.tsx | 3 +-- .../views/right_panel/GroupHeaderButtons.tsx | 1 + .../views/right_panel/HeaderButton.tsx | 1 + .../views/right_panel/HeaderButtons.tsx | 1 + .../views/right_panel/PinnedMessagesCard.tsx | 3 +-- src/components/views/right_panel/UserInfo.tsx | 5 ++--- .../views/right_panel/VerificationPanel.tsx | 12 ++++------ .../views/room_settings/AliasSettings.tsx | 3 +-- .../room_settings/RelatedGroupSettings.js | 4 ++-- .../room_settings/RoomProfileSettings.tsx | 1 + .../room_settings/UrlPreviewSettings.tsx | 3 ++- src/components/views/rooms/AppsDrawer.tsx | 2 +- src/components/views/rooms/Autocomplete.tsx | 3 +-- src/components/views/rooms/AuxPanel.tsx | 2 +- .../views/rooms/BasicMessageComposer.tsx | 3 +-- .../views/rooms/EditMessageComposer.tsx | 7 +++--- src/components/views/rooms/EntityTile.tsx | 3 ++- src/components/views/rooms/EventTile.tsx | 3 +-- src/components/views/rooms/ExtraTile.tsx | 1 + .../views/rooms/JumpToBottomButton.tsx | 3 ++- .../views/rooms/LinkPreviewGroup.tsx | 3 +-- src/components/views/rooms/MemberList.tsx | 18 +++++++-------- src/components/views/rooms/MemberTile.tsx | 11 +++++----- .../views/rooms/MessageComposer.tsx | 7 +++--- .../views/rooms/NotificationBadge.tsx | 1 + .../views/rooms/ReadReceiptMarker.tsx | 4 +--- src/components/views/rooms/ReplyPreview.tsx | 3 ++- src/components/views/rooms/ReplyTile.tsx | 8 +++---- .../views/rooms/RoomBreadcrumbs.tsx | 5 +++-- src/components/views/rooms/RoomDetailList.tsx | 2 +- src/components/views/rooms/RoomDetailRow.js | 5 +++-- src/components/views/rooms/RoomHeader.tsx | 6 ++--- src/components/views/rooms/RoomList.tsx | 2 +- src/components/views/rooms/RoomPreviewBar.tsx | 2 +- src/components/views/rooms/RoomSublist.tsx | 5 +++-- src/components/views/rooms/RoomTile.tsx | 4 ++-- .../views/rooms/RoomUpgradeWarningBar.tsx | 1 - src/components/views/rooms/SearchBar.tsx | 3 ++- .../views/rooms/SearchResultTile.tsx | 1 + .../views/rooms/SendMessageComposer.tsx | 2 +- .../views/rooms/SimpleRoomHeader.tsx | 1 + src/components/views/rooms/Stickerpicker.tsx | 4 ++-- .../views/rooms/ThirdPartyMemberInfo.tsx | 6 ++--- .../views/rooms/TopUnreadMessagesBar.tsx | 1 + .../views/rooms/VoiceRecordComposerTile.tsx | 10 ++++----- .../views/settings/AvatarSetting.tsx | 3 ++- src/components/views/settings/BridgeTile.tsx | 8 +++---- .../views/settings/ChangeAvatar.tsx | 1 + .../views/settings/ChangeDisplayName.tsx | 1 + .../views/settings/ChangePassword.tsx | 5 +++-- .../views/settings/CrossSigningPanel.tsx | 5 ++--- .../views/settings/DevicesPanel.tsx | 3 +-- .../views/settings/DevicesPanelEntry.tsx | 3 +-- .../views/settings/FontScalingPanel.tsx | 3 ++- .../views/settings/IntegrationManager.tsx | 1 + .../views/settings/LayoutSwitcher.tsx | 1 + .../views/settings/Notifications.tsx | 8 +++---- .../views/settings/ProfileSettings.tsx | 4 ++-- .../views/settings/SecureBackupPanel.tsx | 7 +++--- src/components/views/settings/SetIdServer.tsx | 4 ++-- .../views/settings/SetIntegrationManager.tsx | 4 ++-- .../views/settings/SpellCheckSettings.tsx | 1 + .../views/settings/ThemeChoicePanel.tsx | 4 ++-- .../views/settings/account/EmailAddresses.tsx | 6 ++--- .../views/settings/account/PhoneNumbers.tsx | 6 ++--- .../settings/discovery/EmailAddresses.tsx | 5 ++--- .../views/settings/discovery/PhoneNumbers.tsx | 5 ++--- .../tabs/room/GeneralRoomSettingsTab.tsx | 1 + .../tabs/room/NotificationSettingsTab.tsx | 4 ++-- .../tabs/room/RolesRoomSettingsTab.tsx | 12 +++++----- .../tabs/room/SecurityRoomSettingsTab.tsx | 3 +-- .../tabs/user/AppearanceUserSettingsTab.tsx | 2 +- .../tabs/user/FlairUserSettingsTab.js | 1 + .../tabs/user/GeneralUserSettingsTab.tsx | 8 +++---- .../tabs/user/HelpUserSettingsTab.tsx | 4 ++-- .../tabs/user/LabsUserSettingsTab.tsx | 1 + .../tabs/user/MjolnirUserSettingsTab.tsx | 4 ++-- .../tabs/user/NotificationUserSettingsTab.tsx | 1 + .../tabs/user/SecurityUserSettingsTab.tsx | 5 ++--- .../tabs/user/VoiceUserSettingsTab.tsx | 4 ++-- .../views/spaces/SpaceCreateMenu.tsx | 3 +-- .../views/spaces/SpaceSettingsGeneralTab.tsx | 3 +-- .../views/spaces/SpaceTreeLevel.tsx | 2 +- .../views/terms/InlineTermsAgreement.tsx | 1 + src/components/views/toasts/GenericToast.tsx | 2 +- .../toasts/NonUrgentEchoFailureToast.tsx | 1 + .../views/toasts/VerificationRequestToast.tsx | 7 +++--- .../verification/VerificationCancelled.tsx | 1 + .../verification/VerificationComplete.tsx | 1 + .../verification/VerificationShowSas.tsx | 1 + src/components/views/voip/AudioFeed.tsx | 1 + .../views/voip/AudioFeedArrayForCall.tsx | 3 ++- src/components/views/voip/CallContainer.tsx | 1 + src/components/views/voip/CallPreview.tsx | 7 +++--- src/components/views/voip/CallView.tsx | 9 ++++---- .../views/voip/CallView/CallViewButtons.tsx | 3 ++- .../views/voip/CallView/CallViewHeader.tsx | 3 ++- src/components/views/voip/CallViewForRoom.tsx | 3 ++- src/components/views/voip/CallViewSidebar.tsx | 3 ++- src/components/views/voip/DialPad.tsx | 1 + src/components/views/voip/DialPadModal.tsx | 1 + .../views/voip/PictureInPictureDragger.tsx | 1 + src/components/views/voip/VideoFeed.tsx | 5 +++-- src/createRoom.ts | 3 +-- src/customisations/Security.ts | 3 ++- src/dispatcher/dispatch-actions/threads.ts | 1 + src/dispatcher/dispatcher.ts | 1 + .../AfterRightPanelPhaseChangePayload.ts | 3 ++- .../payloads/SetRightPanelPhasePayload.ts | 1 + .../payloads/TransferCallPayload.ts | 3 ++- src/dispatcher/payloads/ViewUserPayload.ts | 1 + src/editor/serialize.ts | 5 +++-- src/emojipicker/recent.ts | 3 ++- src/hooks/useDispatcher.ts | 2 +- src/hooks/useEventEmitter.ts | 1 + src/hooks/useRoomMembers.ts | 2 +- src/hooks/useSettings.ts | 1 + src/index.ts | 8 +++---- src/indexing/EventIndex.ts | 3 +-- src/indexing/EventIndexPeg.ts | 4 ++-- .../IntegrationManagerInstance.ts | 7 +++--- src/integrations/IntegrationManagers.ts | 7 +++--- src/languageHandler.tsx | 4 ++-- src/mjolnir/Mjolnir.ts | 6 ++--- src/notifications/ContentRules.ts | 3 ++- src/notifications/PushRuleVectorState.ts | 3 ++- .../VectorPushRulesDefinitions.ts | 6 ++--- src/performance/index.ts | 4 ++-- src/rageshake/submit-rageshake.ts | 7 ++---- src/sentry.ts | 3 ++- src/settings/SettingsStore.ts | 4 ++-- .../controllers/NotificationControllers.ts | 8 +++---- .../handlers/AccountSettingsHandler.ts | 5 +++-- .../handlers/ConfigSettingsHandler.ts | 3 ++- .../MatrixClientBackedSettingsHandler.ts | 4 ++-- .../handlers/RoomAccountSettingsHandler.ts | 7 +++--- src/settings/handlers/RoomSettingsHandler.ts | 7 +++--- src/settings/watchers/ThemeWatcher.ts | 4 ++-- src/stores/AsyncStore.ts | 1 + src/stores/AsyncStoreWithClient.ts | 3 ++- src/stores/BreadcrumbsStore.ts | 5 +++-- src/stores/CommunityPrototypeStore.ts | 10 ++++----- src/stores/CustomRoomTagStore.js | 3 ++- src/stores/FlairStore.js | 1 - src/stores/GroupFilterOrderStore.js | 1 + src/stores/GroupStore.js | 4 ++-- src/stores/ModalWidgetStore.ts | 6 ++--- src/stores/NonUrgentToastStore.ts | 1 + src/stores/OwnProfileStore.ts | 7 +++--- src/stores/ReadyWatchingStore.ts | 5 +++-- src/stores/RightPanelStore.ts | 6 ++--- src/stores/RoomViewStore.tsx | 3 +-- src/stores/SetupEncryptionStore.ts | 6 ++--- src/stores/SpaceStore.ts | 3 +-- src/stores/ToastStore.ts | 1 + src/stores/UIStore.ts | 7 +++--- src/stores/WidgetEchoStore.ts | 1 + src/stores/WidgetStore.ts | 3 +-- src/stores/local-echo/EchoChamber.ts | 3 ++- src/stores/local-echo/EchoStore.ts | 3 ++- src/stores/local-echo/GenericEchoChamber.ts | 5 +++-- src/stores/local-echo/RoomEchoChamber.ts | 3 ++- src/stores/local-echo/RoomEchoContext.ts | 3 ++- .../notifications/ListNotificationState.ts | 3 ++- src/stores/notifications/NotificationState.ts | 1 + .../notifications/RoomNotificationState.ts | 5 +++-- .../RoomNotificationStateStore.ts | 3 ++- src/stores/room-list/MessagePreviewStore.ts | 5 +++-- src/stores/room-list/RoomListLayoutStore.ts | 4 ++-- src/stores/room-list/RoomListStore.ts | 8 +++---- src/stores/room-list/TagWatcher.ts | 4 ++-- src/stores/room-list/algorithms/Algorithm.ts | 3 +-- .../list-ordering/ImportanceAlgorithm.ts | 4 ++-- .../list-ordering/NaturalAlgorithm.ts | 6 ++--- .../list-ordering/OrderingAlgorithm.ts | 4 ++-- src/stores/room-list/algorithms/models.ts | 3 ++- .../tag-sorting/AlphabeticAlgorithm.ts | 1 + .../algorithms/tag-sorting/IAlgorithm.ts | 1 + .../algorithms/tag-sorting/ManualAlgorithm.ts | 1 + .../algorithms/tag-sorting/RecentAlgorithm.ts | 5 +++-- .../room-list/algorithms/tag-sorting/index.ts | 3 ++- .../filters/CommunityFilterCondition.ts | 3 ++- .../room-list/filters/NameFilterCondition.ts | 3 ++- .../room-list/filters/VisibilityProvider.ts | 1 + .../previews/CallAnswerEventPreview.ts | 3 ++- .../room-list/previews/CallHangupEvent.ts | 3 ++- .../previews/CallInviteEventPreview.ts | 3 ++- src/stores/room-list/previews/IPreview.ts | 1 + .../room-list/previews/MessageEventPreview.ts | 3 ++- .../previews/ReactionEventPreview.ts | 3 ++- .../room-list/previews/StickerEventPreview.ts | 3 ++- src/stores/room-list/previews/utils.ts | 1 + src/stores/widgets/StopGapWidget.ts | 8 +++---- src/stores/widgets/StopGapWidgetDriver.ts | 10 ++++----- src/stores/widgets/WidgetLayoutStore.ts | 5 +++-- src/stores/widgets/WidgetMessagingStore.ts | 1 + src/stores/widgets/WidgetPermissionStore.ts | 3 ++- src/theme.ts | 1 - src/toasts/IncomingCallToast.tsx | 1 + src/utils/AutoDiscoveryUtils.tsx | 4 ++-- src/utils/DMRoomMap.ts | 3 +-- src/utils/DecryptFile.ts | 1 + src/utils/DirectoryUtils.ts | 1 + src/utils/EventUtils.ts | 8 +++---- src/utils/FileUtils.ts | 1 + src/utils/IdentityServerUtils.ts | 3 +-- src/utils/MediaEventHelper.ts | 6 ++--- src/utils/MegolmExportEncryption.ts | 4 ++-- src/utils/MessageDiffUtils.tsx | 3 +-- src/utils/MultiInviter.ts | 3 +-- src/utils/RoomUpgrade.ts | 3 +-- src/utils/StorageManager.ts | 4 ++-- src/utils/Whenable.ts | 4 ++-- src/utils/WidgetUtils.ts | 3 +-- src/utils/createMatrixClient.ts | 3 ++- src/utils/exportUtils/Exporter.ts | 10 ++++----- src/utils/exportUtils/HtmlExport.tsx | 14 ++++++------ src/utils/exportUtils/JSONExport.ts | 11 +++++----- src/utils/exportUtils/PlainTextExport.ts | 9 ++++---- src/utils/membership.ts | 2 +- src/utils/permalinks/Permalinks.ts | 3 +-- src/utils/replaceableComponent.ts | 1 + src/verification.ts | 2 +- src/widgets/CapabilityText.tsx | 5 +++-- src/widgets/Jitsi.ts | 4 ++-- src/widgets/ManagedHybrid.ts | 4 ++-- test/CallHandler-test.ts | 5 +++-- test/DecryptionFailureTracker-test.js | 4 ++-- test/PosthogAnalytics-test.ts | 1 - test/TextForEvent-test.ts | 5 +++-- test/UserActivity-test.js | 1 + .../structures/CallEventGrouper-test.ts | 7 +++--- test/components/structures/GroupView-test.js | 6 ++--- .../structures/MessagePanel-test.js | 22 +++++++++---------- test/components/structures/auth/Login-test.js | 1 + .../structures/auth/Registration-test.js | 1 + .../dialogs/AccessSecretStorageDialog-test.js | 1 + .../dialogs/InteractiveAuthDialog-test.js | 1 - .../elements/MemberEventListSummary-test.js | 1 + .../views/groups/GroupMemberList-test.js | 6 ++--- .../MKeyVerificationConclusion-test.js | 6 ++--- .../views/rooms/MemberList-test.tsx | 6 ++--- .../views/rooms/RoomHeader-test.tsx | 6 ++--- test/components/views/rooms/RoomList-test.js | 5 +---- .../views/rooms/RoomSettings-test.js | 1 + .../views/settings/CryptographyPanel-test.tsx | 6 ++--- test/createRoom-test.js | 3 ++- test/end-to-end-tests/src/rest/creator.js | 1 + test/end-to-end-tests/src/rest/session.js | 1 + .../src/scenarios/e2e-encryption.js | 3 ++- .../src/scenarios/lazy-loading.js | 3 ++- test/end-to-end-tests/src/session.js | 1 + .../src/usecases/memberlist.js | 1 + .../src/usecases/room-settings.js | 1 + test/end-to-end-tests/src/usecases/verify.js | 1 + test/end-to-end-tests/start.js | 5 +++-- test/i18n-test/languageHandler-test.js | 3 ++- test/setupTests.js | 3 ++- test/stores/RoomViewStore-test.js | 2 -- test/test-utils.js | 5 +++-- test/utils/export-test.tsx | 2 ++ test/utils/test-utils.ts | 2 +- 529 files changed, 1028 insertions(+), 870 deletions(-) diff --git a/src/ActiveRoomObserver.ts b/src/ActiveRoomObserver.ts index 4638509cc9..4da0a6eac3 100644 --- a/src/ActiveRoomObserver.ts +++ b/src/ActiveRoomObserver.ts @@ -15,10 +15,10 @@ limitations under the License. */ import { EventSubscription } from 'fbemitter'; -import RoomViewStore from './stores/RoomViewStore'; - import { logger } from "matrix-js-sdk/src/logger"; +import RoomViewStore from './stores/RoomViewStore'; + type Listener = (isActive: boolean) => void; /** diff --git a/src/AddThreepid.ts b/src/AddThreepid.ts index b1c7abc68b..ab4c04c725 100644 --- a/src/AddThreepid.ts +++ b/src/AddThreepid.ts @@ -16,12 +16,13 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { IRequestMsisdnTokenResponse, IRequestTokenResponse } from "matrix-js-sdk/src"; + import { MatrixClientPeg } from './MatrixClientPeg'; import Modal from './Modal'; import { _t } from './languageHandler'; import IdentityAuthClient from './IdentityAuthClient'; import { SSOAuthEntry } from "./components/views/auth/InteractiveAuthEntryComponents"; -import { IRequestMsisdnTokenResponse, IRequestTokenResponse } from "matrix-js-sdk/src"; import InteractiveAuthDialog from "./components/views/dialogs/InteractiveAuthDialog"; function getIdServerDomain(): string { diff --git a/src/Analytics.tsx b/src/Analytics.tsx index 3ff7b2a767..0998050002 100644 --- a/src/Analytics.tsx +++ b/src/Analytics.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; import { getCurrentLanguage, _t, _td, IVariables } from './languageHandler'; import PlatformPeg from './PlatformPeg'; @@ -23,8 +24,6 @@ import SdkConfig from './SdkConfig'; import Modal from './Modal'; import * as sdk from './index'; -import { logger } from "matrix-js-sdk/src/logger"; - const hashRegex = /#\/(groups?|room|user|settings|register|login|forgot_password|home|directory)/; const hashVarRegex = /#\/(group|room|user)\/.*$/; diff --git a/src/AsyncWrapper.tsx b/src/AsyncWrapper.tsx index aea0f42ac4..166e4f21e3 100644 --- a/src/AsyncWrapper.tsx +++ b/src/AsyncWrapper.tsx @@ -15,13 +15,12 @@ limitations under the License. */ import React, { ComponentType } from "react"; +import { logger } from "matrix-js-sdk/src/logger"; import * as sdk from './index'; import { _t } from './languageHandler'; import { IDialogProps } from "./components/views/dialogs/IDialogProps"; -import { logger } from "matrix-js-sdk/src/logger"; - type AsyncImport = { default: T }; interface IProps extends IDialogProps { diff --git a/src/BasePlatform.ts b/src/BasePlatform.ts index f3b26ec510..13ee135b3b 100644 --- a/src/BasePlatform.ts +++ b/src/BasePlatform.ts @@ -19,6 +19,8 @@ limitations under the License. import { MatrixClient } from "matrix-js-sdk/src/client"; import { encodeUnpaddedBase64 } from "matrix-js-sdk/src/crypto/olmlib"; +import { logger } from "matrix-js-sdk/src/logger"; + import dis from './dispatcher/dispatcher'; import BaseEventIndexManager from './indexing/BaseEventIndexManager'; import { ActionPayload } from "./dispatcher/payloads"; @@ -28,8 +30,6 @@ import { hideToast as hideUpdateToast } from "./toasts/UpdateToast"; import { MatrixClientPeg } from "./MatrixClientPeg"; import { idbLoad, idbSave, idbDelete } from "./utils/StorageManager"; -import { logger } from "matrix-js-sdk/src/logger"; - export const SSO_HOMESERVER_URL_KEY = "mx_sso_hs_url"; export const SSO_ID_SERVER_URL_KEY = "mx_sso_is_url"; export const SSO_IDP_ID_KEY = "mx_sso_idp_id"; diff --git a/src/CallHandler.tsx b/src/CallHandler.tsx index 69b00927a9..9c583544b0 100644 --- a/src/CallHandler.tsx +++ b/src/CallHandler.tsx @@ -55,6 +55,13 @@ limitations under the License. */ import React from 'react'; +import { base32 } from "rfc4648"; +import { MatrixCall, CallErrorCode, CallState, CallEvent, CallParty, CallType, CallError } from "matrix-js-sdk/src/webrtc/call"; +import { logger } from 'matrix-js-sdk/src/logger'; +import { randomUppercaseString, randomLowercaseString } from "matrix-js-sdk/src/randomstring"; +import EventEmitter from 'events'; +import { RuleId, TweakName, Tweaks } from "matrix-js-sdk/src/@types/PushRules"; +import { PushProcessor } from 'matrix-js-sdk/src/pushprocessor'; import { MatrixClientPeg } from './MatrixClientPeg'; import Modal from './Modal'; @@ -66,32 +73,22 @@ import { Jitsi } from "./widgets/Jitsi"; import { WidgetType } from "./widgets/WidgetType"; import { SettingLevel } from "./settings/SettingLevel"; import { ActionPayload } from "./dispatcher/payloads"; -import { base32 } from "rfc4648"; - import QuestionDialog from "./components/views/dialogs/QuestionDialog"; import ErrorDialog from "./components/views/dialogs/ErrorDialog"; import WidgetStore from "./stores/WidgetStore"; import { WidgetMessagingStore } from "./stores/widgets/WidgetMessagingStore"; import { ElementWidgetActions } from "./stores/widgets/ElementWidgetActions"; -import { MatrixCall, CallErrorCode, CallState, CallEvent, CallParty, CallType } from "matrix-js-sdk/src/webrtc/call"; import Analytics from './Analytics'; import CountlyAnalytics from "./CountlyAnalytics"; import { UIFeature } from "./settings/UIFeature"; -import { CallError } from "matrix-js-sdk/src/webrtc/call"; -import { logger } from 'matrix-js-sdk/src/logger'; import { Action } from './dispatcher/actions'; import VoipUserMapper from './VoipUserMapper'; import { addManagedHybridWidget, isManagedHybridWidgetEnabled } from './widgets/ManagedHybrid'; -import { randomUppercaseString, randomLowercaseString } from "matrix-js-sdk/src/randomstring"; -import EventEmitter from 'events'; import SdkConfig from './SdkConfig'; import { ensureDMExists, findDMForUser } from './createRoom'; -import { RuleId, TweakName, Tweaks } from "matrix-js-sdk/src/@types/PushRules"; -import { PushProcessor } from 'matrix-js-sdk/src/pushprocessor'; import { WidgetLayoutStore, Container } from './stores/widgets/WidgetLayoutStore'; -import { getIncomingCallToastKey } from './toasts/IncomingCallToast'; +import IncomingCallToast, { getIncomingCallToastKey } from './toasts/IncomingCallToast'; import ToastStore from './stores/ToastStore'; -import IncomingCallToast from "./toasts/IncomingCallToast"; export const PROTOCOL_PSTN = 'm.protocol.pstn'; export const PROTOCOL_PSTN_PREFIXED = 'im.vector.protocol.pstn'; diff --git a/src/ContentMessages.tsx b/src/ContentMessages.tsx index 9831a9b41d..abb2ca106d 100644 --- a/src/ContentMessages.tsx +++ b/src/ContentMessages.tsx @@ -18,14 +18,16 @@ limitations under the License. import React from "react"; import { MatrixClient } from "matrix-js-sdk/src/client"; +import encrypt from "browser-encrypt-attachment"; +import extractPngChunks from "png-chunks-extract"; +import { IAbortablePromise, IImageInfo } from "matrix-js-sdk/src/@types/partials"; +import { logger } from "matrix-js-sdk/src/logger"; import dis from './dispatcher/dispatcher'; import * as sdk from './index'; import { _t } from './languageHandler'; import Modal from './Modal'; import RoomViewStore from './stores/RoomViewStore'; -import encrypt from "browser-encrypt-attachment"; -import extractPngChunks from "png-chunks-extract"; import Spinner from "./components/views/elements/Spinner"; import { Action } from "./dispatcher/actions"; import CountlyAnalytics from "./CountlyAnalytics"; @@ -37,13 +39,10 @@ import { UploadStartedPayload, } from "./dispatcher/payloads/UploadPayload"; import { IUpload } from "./models/IUpload"; -import { IAbortablePromise, IImageInfo } from "matrix-js-sdk/src/@types/partials"; import { BlurhashEncoder } from "./BlurhashEncoder"; import SettingsStore from "./settings/SettingsStore"; import { decorateStartSendingTime, sendRoundTripMetric } from "./sendTimePerformanceMetrics"; -import { logger } from "matrix-js-sdk/src/logger"; - const MAX_WIDTH = 800; const MAX_HEIGHT = 600; diff --git a/src/CountlyAnalytics.ts b/src/CountlyAnalytics.ts index d99ec3d78a..da0021c2cf 100644 --- a/src/CountlyAnalytics.ts +++ b/src/CountlyAnalytics.ts @@ -17,6 +17,7 @@ limitations under the License. import { randomString } from "matrix-js-sdk/src/randomstring"; import { IContent } from "matrix-js-sdk/src/models/event"; import { sleep } from "matrix-js-sdk/src/utils"; +import { logger } from "matrix-js-sdk/src/logger"; import { getCurrentLanguage } from './languageHandler'; import PlatformPeg from './PlatformPeg'; @@ -25,8 +26,6 @@ import { MatrixClientPeg } from "./MatrixClientPeg"; import RoomViewStore from "./stores/RoomViewStore"; import { Action } from "./dispatcher/actions"; -import { logger } from "matrix-js-sdk/src/logger"; - const INACTIVITY_TIME = 20; // seconds const HEARTBEAT_INTERVAL = 5_000; // ms const SESSION_UPDATE_INTERVAL = 60; // seconds diff --git a/src/DeviceListener.ts b/src/DeviceListener.ts index f218e6c6a7..71b7f622fd 100644 --- a/src/DeviceListener.ts +++ b/src/DeviceListener.ts @@ -14,6 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from './MatrixClientPeg'; import dis from "./dispatcher/dispatcher"; import { @@ -32,11 +35,8 @@ import { import { isSecretStorageBeingAccessed, accessSecretStorage } from "./SecurityManager"; import { isSecureBackupRequired } from './utils/WellKnownUtils'; import { isLoggedIn } from './components/structures/MatrixChat'; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { ActionPayload } from "./dispatcher/payloads"; -import { logger } from "matrix-js-sdk/src/logger"; - const KEY_BACKUP_POLL_INTERVAL = 5 * 60 * 1000; export default class DeviceListener { diff --git a/src/GroupAddressPicker.js b/src/GroupAddressPicker.js index ea1813876c..6430090819 100644 --- a/src/GroupAddressPicker.js +++ b/src/GroupAddressPicker.js @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import Modal from './Modal'; import * as sdk from './'; import MultiInviter from './utils/MultiInviter'; diff --git a/src/IdentityAuthClient.tsx b/src/IdentityAuthClient.tsx index ae55c20438..66f9ad4dda 100644 --- a/src/IdentityAuthClient.tsx +++ b/src/IdentityAuthClient.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from "react"; import { SERVICE_TYPES } from 'matrix-js-sdk/src/service-types'; import { createClient, MatrixClient } from 'matrix-js-sdk/src/matrix'; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from './MatrixClientPeg'; import Modal from './Modal'; @@ -27,8 +28,6 @@ import { doesIdentityServerHaveTerms, useDefaultIdentityServer, } from './utils/IdentityServerUtils'; - -import { logger } from "matrix-js-sdk/src/logger"; import QuestionDialog from "./components/views/dialogs/QuestionDialog"; import { abbreviateUrl } from "./utils/UrlUtils"; diff --git a/src/Lifecycle.ts b/src/Lifecycle.ts index d351c46180..f984d20f71 100644 --- a/src/Lifecycle.ts +++ b/src/Lifecycle.ts @@ -22,6 +22,7 @@ import { InvalidStoreError } from "matrix-js-sdk/src/errors"; import { MatrixClient } from "matrix-js-sdk/src/client"; import { decryptAES, encryptAES, IEncryptedPayload } from "matrix-js-sdk/src/crypto/aes"; import { QueryDict } from 'matrix-js-sdk/src/utils'; +import { logger } from "matrix-js-sdk/src/logger"; import { IMatrixClientCreds, MatrixClientPeg } from './MatrixClientPeg'; import SecurityCustomisations from "./customisations/Security"; @@ -58,8 +59,6 @@ import LazyLoadingDisabledDialog from "./components/views/dialogs/LazyLoadingDis import SessionRestoreErrorDialog from "./components/views/dialogs/SessionRestoreErrorDialog"; import StorageEvictedDialog from "./components/views/dialogs/StorageEvictedDialog"; -import { logger } from "matrix-js-sdk/src/logger"; - const HOMESERVER_URL_KEY = "mx_hs_url"; const ID_SERVER_URL_KEY = "mx_is_url"; diff --git a/src/Livestream.ts b/src/Livestream.ts index 2389132762..b136fbeaea 100644 --- a/src/Livestream.ts +++ b/src/Livestream.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { ClientWidgetApi } from "matrix-widget-api"; + import { MatrixClientPeg } from "./MatrixClientPeg"; import SdkConfig from "./SdkConfig"; import { ElementWidgetActions } from "./stores/widgets/ElementWidgetActions"; diff --git a/src/Login.ts b/src/Login.ts index bb1ab2ef36..f7b188c64a 100644 --- a/src/Login.ts +++ b/src/Login.ts @@ -18,11 +18,11 @@ limitations under the License. // @ts-ignore - XXX: tsc doesn't like this: our js-sdk imports are complex so this isn't surprising import { createClient } from "matrix-js-sdk/src/matrix"; import { MatrixClient } from "matrix-js-sdk/src/client"; +import { logger } from "matrix-js-sdk/src/logger"; + import { IMatrixClientCreds } from "./MatrixClientPeg"; import SecurityCustomisations from "./customisations/Security"; -import { logger } from "matrix-js-sdk/src/logger"; - interface ILoginOptions { defaultDeviceDisplayName?: string; } diff --git a/src/MatrixClientPeg.ts b/src/MatrixClientPeg.ts index 978939e707..4f3d320ffd 100644 --- a/src/MatrixClientPeg.ts +++ b/src/MatrixClientPeg.ts @@ -23,21 +23,21 @@ import { MemoryStore } from 'matrix-js-sdk/src/store/memory'; import * as utils from 'matrix-js-sdk/src/utils'; import { EventTimeline } from 'matrix-js-sdk/src/models/event-timeline'; import { EventTimelineSet } from 'matrix-js-sdk/src/models/event-timeline-set'; +import { verificationMethods } from 'matrix-js-sdk/src/crypto'; +import { SHOW_QR_CODE_METHOD } from "matrix-js-sdk/src/crypto/verification/QRCode"; +import { logger } from "matrix-js-sdk/src/logger"; + import * as sdk from './index'; import createMatrixClient from './utils/createMatrixClient'; import SettingsStore from './settings/SettingsStore'; import MatrixActionCreators from './actions/MatrixActionCreators'; import Modal from './Modal'; -import { verificationMethods } from 'matrix-js-sdk/src/crypto'; import MatrixClientBackedSettingsHandler from "./settings/handlers/MatrixClientBackedSettingsHandler"; import * as StorageManager from './utils/StorageManager'; import IdentityAuthClient from './IdentityAuthClient'; import { crossSigningCallbacks, tryToUnlockSecretStorageWithDehydrationKey } from './SecurityManager'; -import { SHOW_QR_CODE_METHOD } from "matrix-js-sdk/src/crypto/verification/QRCode"; import SecurityCustomisations from "./customisations/Security"; -import { logger } from "matrix-js-sdk/src/logger"; - export interface IMatrixClientCreds { homeserverUrl: string; identityServerUrl: string; diff --git a/src/MediaDeviceHandler.ts b/src/MediaDeviceHandler.ts index 9123d45bc3..ddf1977bf0 100644 --- a/src/MediaDeviceHandler.ts +++ b/src/MediaDeviceHandler.ts @@ -15,13 +15,13 @@ See the License for the specific language governing permissions and limitations under the License. */ +import EventEmitter from 'events'; +import { logger } from "matrix-js-sdk/src/logger"; + import SettingsStore from "./settings/SettingsStore"; import { SettingLevel } from "./settings/SettingLevel"; -import EventEmitter from 'events'; import { MatrixClientPeg } from "./MatrixClientPeg"; -import { logger } from "matrix-js-sdk/src/logger"; - // XXX: MediaDeviceKind is a union type, so we make our own enum export enum MediaDeviceKindEnum { AudioOutput = "audiooutput", diff --git a/src/Notifier.ts b/src/Notifier.ts index 1acd028b08..1ca8b4e710 100644 --- a/src/Notifier.ts +++ b/src/Notifier.ts @@ -19,6 +19,7 @@ limitations under the License. import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { Room } from "matrix-js-sdk/src/models/room"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from './MatrixClientPeg'; import SdkConfig from './SdkConfig'; @@ -38,8 +39,6 @@ import UserActivity from "./UserActivity"; import { mediaFromMxc } from "./customisations/Media"; import ErrorDialog from "./components/views/dialogs/ErrorDialog"; -import { logger } from "matrix-js-sdk/src/logger"; - /* * Dispatches: * { diff --git a/src/PasswordReset.ts b/src/PasswordReset.ts index 76f54de245..7b0b6f9f84 100644 --- a/src/PasswordReset.ts +++ b/src/PasswordReset.ts @@ -16,6 +16,7 @@ limitations under the License. */ import { createClient, IRequestTokenResponse, MatrixClient } from 'matrix-js-sdk/src/matrix'; + import { _t } from './languageHandler'; /** diff --git a/src/PosthogAnalytics.ts b/src/PosthogAnalytics.ts index bdc0814b5d..6c31ad04b5 100644 --- a/src/PosthogAnalytics.ts +++ b/src/PosthogAnalytics.ts @@ -15,13 +15,13 @@ limitations under the License. */ import posthog, { PostHog } from 'posthog-js'; +import { MatrixClient } from "matrix-js-sdk/src/client"; +import { logger } from "matrix-js-sdk/src/logger"; + import PlatformPeg from './PlatformPeg'; import SdkConfig from './SdkConfig'; import SettingsStore from './settings/SettingsStore'; import { MatrixClientPeg } from "./MatrixClientPeg"; -import { MatrixClient } from "matrix-js-sdk/src/client"; - -import { logger } from "matrix-js-sdk/src/logger"; /* Posthog analytics tracking. * diff --git a/src/Presence.ts b/src/Presence.ts index e58ed61901..4e4cd810ac 100644 --- a/src/Presence.ts +++ b/src/Presence.ts @@ -16,13 +16,13 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from "./MatrixClientPeg"; import dis from "./dispatcher/dispatcher"; import Timer from './utils/Timer'; import { ActionPayload } from "./dispatcher/payloads"; -import { logger } from "matrix-js-sdk/src/logger"; - // Time in ms after that a user is considered as unavailable/away const UNAVAILABLE_TIME_MS = 3 * 60 * 1000; // 3 mins diff --git a/src/Registration.tsx b/src/Registration.tsx index 90e81c0d45..a90c5c069d 100644 --- a/src/Registration.tsx +++ b/src/Registration.tsx @@ -21,6 +21,7 @@ limitations under the License. */ import React from "react"; + import dis from './dispatcher/dispatcher'; import Modal from './Modal'; import { _t } from './languageHandler'; diff --git a/src/Resend.ts b/src/Resend.ts index 0b5c279165..241fb7f89b 100644 --- a/src/Resend.ts +++ b/src/Resend.ts @@ -16,12 +16,11 @@ limitations under the License. import { MatrixEvent, EventStatus } from 'matrix-js-sdk/src/models/event'; import { Room } from 'matrix-js-sdk/src/models/room'; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from './MatrixClientPeg'; import dis from './dispatcher/dispatcher'; -import { logger } from "matrix-js-sdk/src/logger"; - export default class Resend { static resendUnsentEvents(room: Room): Promise { return Promise.all(room.getPendingEvents().filter(function(ev: MatrixEvent) { diff --git a/src/RoomInvite.tsx b/src/RoomInvite.tsx index 305cf47b27..17058d2bc8 100644 --- a/src/RoomInvite.tsx +++ b/src/RoomInvite.tsx @@ -18,6 +18,7 @@ import React from "react"; import { Room } from "matrix-js-sdk/src/models/room"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { User } from "matrix-js-sdk/src/models/user"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from './MatrixClientPeg'; import MultiInviter, { CompletionStates } from './utils/MultiInviter'; @@ -30,8 +31,6 @@ import BaseAvatar from "./components/views/avatars/BaseAvatar"; import { mediaFromMxc } from "./customisations/Media"; import ErrorDialog from "./components/views/dialogs/ErrorDialog"; -import { logger } from "matrix-js-sdk/src/logger"; - export interface IInviteResult { states: CompletionStates; inviter: MultiInviter; diff --git a/src/RoomNotifs.ts b/src/RoomNotifs.ts index 5abee9a6ad..62804dd950 100644 --- a/src/RoomNotifs.ts +++ b/src/RoomNotifs.ts @@ -15,11 +15,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { MatrixClientPeg } from './MatrixClientPeg'; import { PushProcessor } from 'matrix-js-sdk/src/pushprocessor'; import { NotificationCountType, Room } from "matrix-js-sdk/src/models/room"; import { IAnnotatedPushRule, PushRuleKind } from "matrix-js-sdk/src/@types/PushRules"; +import { MatrixClientPeg } from './MatrixClientPeg'; + export enum RoomNotifState { AllMessagesLoud = 'all_messages_loud', AllMessages = 'all_messages', diff --git a/src/ScalarAuthClient.ts b/src/ScalarAuthClient.ts index e791633c8e..9d71bf5b05 100644 --- a/src/ScalarAuthClient.ts +++ b/src/ScalarAuthClient.ts @@ -15,17 +15,16 @@ limitations under the License. */ import url from 'url'; +import request from "browser-request"; +import { SERVICE_TYPES } from "matrix-js-sdk/src/service-types"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { logger } from "matrix-js-sdk/src/logger"; + import SettingsStore from "./settings/SettingsStore"; import { Service, startTermsFlow, TermsInteractionCallback, TermsNotSignedError } from './Terms'; import { MatrixClientPeg } from "./MatrixClientPeg"; -import request from "browser-request"; - import SdkConfig from "./SdkConfig"; import { WidgetType } from "./widgets/WidgetType"; -import { SERVICE_TYPES } from "matrix-js-sdk/src/service-types"; -import { Room } from "matrix-js-sdk/src/models/room"; - -import { logger } from "matrix-js-sdk/src/logger"; // The version of the integration manager API we're intending to work with const imApiVersion = "1.1"; diff --git a/src/ScalarMessaging.ts b/src/ScalarMessaging.ts index 3d390ea095..563a2c331b 100644 --- a/src/ScalarMessaging.ts +++ b/src/ScalarMessaging.ts @@ -235,8 +235,10 @@ Example: } */ -import { MatrixClientPeg } from './MatrixClientPeg'; import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; +import { logger } from "matrix-js-sdk/src/logger"; + +import { MatrixClientPeg } from './MatrixClientPeg'; import dis from './dispatcher/dispatcher'; import WidgetUtils from './utils/WidgetUtils'; import RoomViewStore from './stores/RoomViewStore'; @@ -245,8 +247,6 @@ import { IntegrationManagers } from "./integrations/IntegrationManagers"; import { WidgetType } from "./widgets/WidgetType"; import { objectClone } from "./utils/objects"; -import { logger } from "matrix-js-sdk/src/logger"; - enum Action { CloseScalar = "close_scalar", GetWidgets = "get_widgets", diff --git a/src/Searching.ts b/src/Searching.ts index 37f85efa77..007aca4a51 100644 --- a/src/Searching.ts +++ b/src/Searching.ts @@ -24,11 +24,11 @@ import { } from "matrix-js-sdk/src/@types/search"; import { IRoomEventFilter } from "matrix-js-sdk/src/filter"; import { EventType } from "matrix-js-sdk/src/@types/event"; +import { SearchResult } from "matrix-js-sdk/src/models/search-result"; import { ISearchArgs } from "./indexing/BaseEventIndexManager"; import EventIndexPeg from "./indexing/EventIndexPeg"; import { MatrixClientPeg } from "./MatrixClientPeg"; -import { SearchResult } from "matrix-js-sdk/src/models/search-result"; const SEARCH_LIMIT = 10; diff --git a/src/SecurityManager.ts b/src/SecurityManager.ts index a184e6e9cb..83115bcbf8 100644 --- a/src/SecurityManager.ts +++ b/src/SecurityManager.ts @@ -17,21 +17,21 @@ limitations under the License. import { ICryptoCallbacks } from 'matrix-js-sdk/src/matrix'; import { ISecretStorageKeyInfo } from 'matrix-js-sdk/src/crypto/api'; import { MatrixClient } from 'matrix-js-sdk/src/client'; +import { deriveKey } from 'matrix-js-sdk/src/crypto/key_passphrase'; +import { decodeRecoveryKey } from 'matrix-js-sdk/src/crypto/recoverykey'; +import { encodeBase64 } from "matrix-js-sdk/src/crypto/olmlib"; +import { DeviceTrustLevel } from 'matrix-js-sdk/src/crypto/CrossSigning'; +import { logger } from "matrix-js-sdk/src/logger"; + import Modal from './Modal'; import * as sdk from './index'; import { MatrixClientPeg } from './MatrixClientPeg'; -import { deriveKey } from 'matrix-js-sdk/src/crypto/key_passphrase'; -import { decodeRecoveryKey } from 'matrix-js-sdk/src/crypto/recoverykey'; import { _t } from './languageHandler'; -import { encodeBase64 } from "matrix-js-sdk/src/crypto/olmlib"; import { isSecureBackupRequired } from './utils/WellKnownUtils'; import AccessSecretStorageDialog from './components/views/dialogs/security/AccessSecretStorageDialog'; import RestoreKeyBackupDialog from './components/views/dialogs/security/RestoreKeyBackupDialog'; import SettingsStore from "./settings/SettingsStore"; import SecurityCustomisations from "./customisations/Security"; -import { DeviceTrustLevel } from 'matrix-js-sdk/src/crypto/CrossSigning'; - -import { logger } from "matrix-js-sdk/src/logger"; // This stores the secret storage private keys in memory for the JS SDK. This is // only meant to act as a cache to avoid prompting the user multiple times diff --git a/src/SendHistoryManager.ts b/src/SendHistoryManager.ts index 9a593adbee..69383d85d5 100644 --- a/src/SendHistoryManager.ts +++ b/src/SendHistoryManager.ts @@ -16,12 +16,11 @@ limitations under the License. import { clamp } from "lodash"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { logger } from "matrix-js-sdk/src/logger"; import { SerializedPart } from "./editor/parts"; import EditorModel from "./editor/model"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IHistoryItem { parts: SerializedPart[]; replyEventId?: string; diff --git a/src/SlashCommands.tsx b/src/SlashCommands.tsx index 4ffab08780..b97f5bde06 100644 --- a/src/SlashCommands.tsx +++ b/src/SlashCommands.tsx @@ -19,8 +19,10 @@ limitations under the License. import * as React from 'react'; import { User } from "matrix-js-sdk/src/models/user"; - import * as ContentHelpers from 'matrix-js-sdk/src/content-helpers'; +import { parseFragment as parseHtml, Element as ChildElement } from "parse5"; +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from './MatrixClientPeg'; import dis from './dispatcher/dispatcher'; import { _t, _td } from './languageHandler'; @@ -36,7 +38,6 @@ import { getDefaultIdentityServerUrl, useDefaultIdentityServer } from './utils/I import { isPermalinkHost, parsePermalink } from "./utils/permalinks/Permalinks"; import { WidgetType } from "./widgets/WidgetType"; import { Jitsi } from "./widgets/Jitsi"; -import { parseFragment as parseHtml, Element as ChildElement } from "parse5"; import BugReportDialog from "./components/views/dialogs/BugReportDialog"; import { ensureDMExists } from "./createRoom"; import { ViewUserPayload } from "./dispatcher/payloads/ViewUserPayload"; @@ -54,8 +55,6 @@ import DevtoolsDialog from './components/views/dialogs/DevtoolsDialog'; import RoomUpgradeWarningDialog from "./components/views/dialogs/RoomUpgradeWarningDialog"; import InfoDialog from "./components/views/dialogs/InfoDialog"; import SlashCommandHelpDialog from "./components/views/dialogs/SlashCommandHelpDialog"; - -import { logger } from "matrix-js-sdk/src/logger"; import { shouldShowComponent } from "./customisations/helpers/UIComponents"; // XXX: workaround for https://github.com/microsoft/TypeScript/issues/31816 diff --git a/src/Terms.ts b/src/Terms.ts index 86d006c832..325a132daa 100644 --- a/src/Terms.ts +++ b/src/Terms.ts @@ -16,13 +16,12 @@ limitations under the License. import classNames from 'classnames'; import { SERVICE_TYPES } from 'matrix-js-sdk/src/service-types'; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from './MatrixClientPeg'; import * as sdk from '.'; import Modal from './Modal'; -import { logger } from "matrix-js-sdk/src/logger"; - export class TermsNotSignedError extends Error {} /** diff --git a/src/TextForEvent.tsx b/src/TextForEvent.tsx index 82c094ef48..13348b2992 100644 --- a/src/TextForEvent.tsx +++ b/src/TextForEvent.tsx @@ -14,6 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ import React from 'react'; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { logger } from "matrix-js-sdk/src/logger"; +import { removeDirectionOverrideChars } from 'matrix-js-sdk/src/utils'; + import { _t } from './languageHandler'; import * as Roles from './Roles'; import { isValid3pidInvite } from "./RoomInvite"; @@ -24,12 +28,8 @@ import { RightPanelPhases } from './stores/RightPanelStorePhases'; import { Action } from './dispatcher/actions'; import defaultDispatcher from './dispatcher/dispatcher'; import { SetRightPanelPhasePayload } from './dispatcher/payloads/SetRightPanelPhasePayload'; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { MatrixClientPeg } from "./MatrixClientPeg"; -import { logger } from "matrix-js-sdk/src/logger"; -import { removeDirectionOverrideChars } from 'matrix-js-sdk/src/utils'; - // These functions are frequently used just to check whether an event has // any text to display at all. For this reason they return deferred values // to avoid the expense of looking up translations when they're not needed. diff --git a/src/VoipUserMapper.ts b/src/VoipUserMapper.ts index e2e590548e..c8fbf51d9d 100644 --- a/src/VoipUserMapper.ts +++ b/src/VoipUserMapper.ts @@ -14,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { Room } from 'matrix-js-sdk/src/models/room'; +import { logger } from "matrix-js-sdk/src/logger"; + import { ensureVirtualRoomExists, findDMForUser } from './createRoom'; import { MatrixClientPeg } from "./MatrixClientPeg"; import DMRoomMap from "./utils/DMRoomMap"; import CallHandler, { VIRTUAL_ROOM_EVENT_TYPE } from './CallHandler'; -import { Room } from 'matrix-js-sdk/src/models/room'; - -import { logger } from "matrix-js-sdk/src/logger"; // Functions for mapping virtual users & rooms. Currently the only lookup // is sip virtual: there could be others in the future. diff --git a/src/actions/GroupActions.ts b/src/actions/GroupActions.ts index 81470d1221..44776f0a25 100644 --- a/src/actions/GroupActions.ts +++ b/src/actions/GroupActions.ts @@ -15,9 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixClient } from "matrix-js-sdk/src/client"; + import { asyncAction } from './actionCreators'; import { AsyncActionPayload } from "../dispatcher/payloads"; -import { MatrixClient } from "matrix-js-sdk/src/client"; export default class GroupActions { /** diff --git a/src/actions/RoomListActions.ts b/src/actions/RoomListActions.ts index d248197f7f..7860e1b2ee 100644 --- a/src/actions/RoomListActions.ts +++ b/src/actions/RoomListActions.ts @@ -15,20 +15,20 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixClient } from "matrix-js-sdk/src/client"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { logger } from "matrix-js-sdk/src/logger"; + import { asyncAction } from './actionCreators'; import Modal from '../Modal'; import * as Rooms from '../Rooms'; import { _t } from '../languageHandler'; -import { MatrixClient } from "matrix-js-sdk/src/client"; -import { Room } from "matrix-js-sdk/src/models/room"; import { AsyncActionPayload } from "../dispatcher/payloads"; import RoomListStore from "../stores/room-list/RoomListStore"; import { SortAlgorithm } from "../stores/room-list/algorithms/models"; import { DefaultTagID } from "../stores/room-list/models"; import ErrorDialog from '../components/views/dialogs/ErrorDialog'; -import { logger } from "matrix-js-sdk/src/logger"; - export default class RoomListActions { /** * Creates an action thunk that will do an asynchronous request to diff --git a/src/actions/TagOrderActions.ts b/src/actions/TagOrderActions.ts index dc538134a1..4ae600472e 100644 --- a/src/actions/TagOrderActions.ts +++ b/src/actions/TagOrderActions.ts @@ -15,11 +15,12 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixClient } from "matrix-js-sdk/src/client"; + import Analytics from '../Analytics'; import { asyncAction } from './actionCreators'; import GroupFilterOrderStore from '../stores/GroupFilterOrderStore'; import { AsyncActionPayload } from "../dispatcher/payloads"; -import { MatrixClient } from "matrix-js-sdk/src/client"; export default class TagOrderActions { /** diff --git a/src/async-components/views/dialogs/eventindex/DisableEventIndexDialog.tsx b/src/async-components/views/dialogs/eventindex/DisableEventIndexDialog.tsx index 4d8f5e5663..ccbd6e66b7 100644 --- a/src/async-components/views/dialogs/eventindex/DisableEventIndexDialog.tsx +++ b/src/async-components/views/dialogs/eventindex/DisableEventIndexDialog.tsx @@ -21,11 +21,11 @@ import Spinner from "../../../../components/views/elements/Spinner"; import DialogButtons from "../../../../components/views/elements/DialogButtons"; import dis from "../../../../dispatcher/dispatcher"; import { _t } from '../../../../languageHandler'; - import SettingsStore from "../../../../settings/SettingsStore"; import EventIndexPeg from "../../../../indexing/EventIndexPeg"; import { Action } from "../../../../dispatcher/actions"; import { SettingLevel } from "../../../../settings/SettingLevel"; + interface IProps { onFinished: (success: boolean) => void; } diff --git a/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx b/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx index ac7875b920..c5e0fecacc 100644 --- a/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx +++ b/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx @@ -15,10 +15,10 @@ limitations under the License. */ import React from 'react'; + import { _t } from '../../../../languageHandler'; import SdkConfig from '../../../../SdkConfig'; import SettingsStore from "../../../../settings/SettingsStore"; - import Modal from '../../../../Modal'; import { formatBytes, formatCountLong } from "../../../../utils/FormattingUtils"; import EventIndexPeg from "../../../../indexing/EventIndexPeg"; diff --git a/src/async-components/views/dialogs/security/CreateKeyBackupDialog.js b/src/async-components/views/dialogs/security/CreateKeyBackupDialog.js index 8527f78895..9d449e8b80 100644 --- a/src/async-components/views/dialogs/security/CreateKeyBackupDialog.js +++ b/src/async-components/views/dialogs/security/CreateKeyBackupDialog.js @@ -17,17 +17,17 @@ limitations under the License. import React, { createRef } from 'react'; import FileSaver from 'file-saver'; +import PropTypes from 'prop-types'; +import { logger } from "matrix-js-sdk/src/logger"; + import * as sdk from '../../../../index'; import { MatrixClientPeg } from '../../../../MatrixClientPeg'; -import PropTypes from 'prop-types'; import { _t, _td } from '../../../../languageHandler'; import { accessSecretStorage } from '../../../../SecurityManager'; import AccessibleButton from "../../../../components/views/elements/AccessibleButton"; import { copyNode } from "../../../../utils/strings"; import PassphraseField from "../../../../components/views/auth/PassphraseField"; -import { logger } from "matrix-js-sdk/src/logger"; - const PHASE_PASSPHRASE = 0; const PHASE_PASSPHRASE_CONFIRM = 1; const PHASE_SHOWKEY = 2; diff --git a/src/async-components/views/dialogs/security/CreateSecretStorageDialog.js b/src/async-components/views/dialogs/security/CreateSecretStorageDialog.js index 7a21b7075b..a760e62454 100644 --- a/src/async-components/views/dialogs/security/CreateSecretStorageDialog.js +++ b/src/async-components/views/dialogs/security/CreateSecretStorageDialog.js @@ -17,9 +17,11 @@ limitations under the License. import React, { createRef } from 'react'; import PropTypes from 'prop-types'; +import FileSaver from 'file-saver'; +import { logger } from "matrix-js-sdk/src/logger"; + import * as sdk from '../../../../index'; import { MatrixClientPeg } from '../../../../MatrixClientPeg'; -import FileSaver from 'file-saver'; import { _t, _td } from '../../../../languageHandler'; import Modal from '../../../../Modal'; import { promptForBackupPassphrase } from '../../../../SecurityManager'; @@ -34,8 +36,6 @@ import RestoreKeyBackupDialog from "../../../../components/views/dialogs/securit import { getSecureBackupSetupMethods, isSecureBackupRequired } from '../../../../utils/WellKnownUtils'; import SecurityCustomisations from "../../../../customisations/Security"; -import { logger } from "matrix-js-sdk/src/logger"; - const PHASE_LOADING = 0; const PHASE_LOADERROR = 1; const PHASE_CHOOSE_KEY_PASSPHRASE = 2; diff --git a/src/async-components/views/dialogs/security/ExportE2eKeysDialog.js b/src/async-components/views/dialogs/security/ExportE2eKeysDialog.js index c21e17a7a1..c80f935a80 100644 --- a/src/async-components/views/dialogs/security/ExportE2eKeysDialog.js +++ b/src/async-components/views/dialogs/security/ExportE2eKeysDialog.js @@ -17,14 +17,13 @@ limitations under the License. import FileSaver from 'file-saver'; import React, { createRef } from 'react'; import PropTypes from 'prop-types'; -import { _t } from '../../../../languageHandler'; - import { MatrixClient } from 'matrix-js-sdk/src/client'; +import { logger } from "matrix-js-sdk/src/logger"; + +import { _t } from '../../../../languageHandler'; import * as MegolmExportEncryption from '../../../../utils/MegolmExportEncryption'; import * as sdk from '../../../../index'; -import { logger } from "matrix-js-sdk/src/logger"; - const PHASE_EDIT = 1; const PHASE_EXPORTING = 2; diff --git a/src/async-components/views/dialogs/security/ImportE2eKeysDialog.js b/src/async-components/views/dialogs/security/ImportE2eKeysDialog.js index 51d2861396..41b7e4e9e0 100644 --- a/src/async-components/views/dialogs/security/ImportE2eKeysDialog.js +++ b/src/async-components/views/dialogs/security/ImportE2eKeysDialog.js @@ -16,14 +16,13 @@ limitations under the License. import React, { createRef } from 'react'; import PropTypes from 'prop-types'; - import { MatrixClient } from 'matrix-js-sdk/src/client'; +import { logger } from "matrix-js-sdk/src/logger"; + import * as MegolmExportEncryption from '../../../../utils/MegolmExportEncryption'; import * as sdk from '../../../../index'; import { _t } from '../../../../languageHandler'; -import { logger } from "matrix-js-sdk/src/logger"; - function readFileAsArrayBuffer(file) { return new Promise((resolve, reject) => { const reader = new FileReader(); diff --git a/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.js b/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.js index 263d25c98c..632e4f93bd 100644 --- a/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.js +++ b/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.js @@ -17,6 +17,7 @@ limitations under the License. import React from "react"; import PropTypes from "prop-types"; + import * as sdk from "../../../../index"; import { MatrixClientPeg } from '../../../../MatrixClientPeg'; import dis from "../../../../dispatcher/dispatcher"; diff --git a/src/async-components/views/dialogs/security/RecoveryMethodRemovedDialog.js b/src/async-components/views/dialogs/security/RecoveryMethodRemovedDialog.js index f586c9430a..3dddec5f45 100644 --- a/src/async-components/views/dialogs/security/RecoveryMethodRemovedDialog.js +++ b/src/async-components/views/dialogs/security/RecoveryMethodRemovedDialog.js @@ -17,6 +17,7 @@ limitations under the License. import React from "react"; import PropTypes from "prop-types"; + import * as sdk from "../../../../index"; import dis from "../../../../dispatcher/dispatcher"; import { _t } from "../../../../languageHandler"; diff --git a/src/audio/Playback.ts b/src/audio/Playback.ts index f3baa71a1e..633eb0ef78 100644 --- a/src/audio/Playback.ts +++ b/src/audio/Playback.ts @@ -15,16 +15,16 @@ limitations under the License. */ import EventEmitter from "events"; +import { SimpleObservable } from "matrix-widget-api"; +import { logger } from "matrix-js-sdk/src/logger"; + import { UPDATE_EVENT } from "../stores/AsyncStore"; import { arrayFastResample, arrayRescale, arraySeed, arraySmoothingResample } from "../utils/arrays"; -import { SimpleObservable } from "matrix-widget-api"; import { IDestroyable } from "../utils/IDestroyable"; import { PlaybackClock } from "./PlaybackClock"; import { createAudioContext, decodeOgg } from "./compat"; import { clamp } from "../utils/numbers"; -import { logger } from "matrix-js-sdk/src/logger"; - export enum PlaybackState { Decoding = "decoding", Stopped = "stopped", // no progress on timeline diff --git a/src/audio/PlaybackClock.ts b/src/audio/PlaybackClock.ts index 5716d6ac2f..f38be9d134 100644 --- a/src/audio/PlaybackClock.ts +++ b/src/audio/PlaybackClock.ts @@ -15,9 +15,10 @@ limitations under the License. */ import { SimpleObservable } from "matrix-widget-api"; -import { IDestroyable } from "../utils/IDestroyable"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { IDestroyable } from "../utils/IDestroyable"; + /** * Tracks accurate human-perceptible time for an audio clip, as informed * by managed playback. This clock is tightly coupled with the operation diff --git a/src/audio/PlaybackQueue.ts b/src/audio/PlaybackQueue.ts index a1a86f6613..3b1b001bb9 100644 --- a/src/audio/PlaybackQueue.ts +++ b/src/audio/PlaybackQueue.ts @@ -17,6 +17,9 @@ limitations under the License. import { MatrixClient } from "matrix-js-sdk/src/client"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { Room } from "matrix-js-sdk/src/models/room"; +import { EventType } from "matrix-js-sdk/src/@types/event"; +import { logger } from "matrix-js-sdk/src/logger"; + import { Playback, PlaybackState } from "./Playback"; import { UPDATE_EVENT } from "../stores/AsyncStore"; import { MatrixClientPeg } from "../MatrixClientPeg"; @@ -24,9 +27,6 @@ import { arrayFastClone } from "../utils/arrays"; import { PlaybackManager } from "./PlaybackManager"; import { isVoiceMessage } from "../utils/EventUtils"; import RoomViewStore from "../stores/RoomViewStore"; -import { EventType } from "matrix-js-sdk/src/@types/event"; - -import { logger } from "matrix-js-sdk/src/logger"; /** * Audio playback queue management for a given room. This keeps track of where the user diff --git a/src/audio/VoiceRecording.ts b/src/audio/VoiceRecording.ts index 3ff02be774..1c6c8b40d2 100644 --- a/src/audio/VoiceRecording.ts +++ b/src/audio/VoiceRecording.ts @@ -17,23 +17,23 @@ limitations under the License. import * as Recorder from 'opus-recorder'; import encoderPath from 'opus-recorder/dist/encoderWorker.min.js'; import { MatrixClient } from "matrix-js-sdk/src/client"; -import MediaDeviceHandler from "../MediaDeviceHandler"; import { SimpleObservable } from "matrix-widget-api"; import EventEmitter from "events"; +import { IEncryptedFile } from "matrix-js-sdk/src/@types/event"; +import { logger } from "matrix-js-sdk/src/logger"; + +import MediaDeviceHandler from "../MediaDeviceHandler"; import { IDestroyable } from "../utils/IDestroyable"; import { Singleflight } from "../utils/Singleflight"; import { PayloadEvent, WORKLET_NAME } from "./consts"; import { UPDATE_EVENT } from "../stores/AsyncStore"; import { Playback } from "./Playback"; import { createAudioContext } from "./compat"; -import { IEncryptedFile } from "matrix-js-sdk/src/@types/event"; import { uploadFile } from "../ContentMessages"; import { FixedRollingArray } from "../utils/FixedRollingArray"; import { clamp } from "../utils/numbers"; import mxRecorderWorkletPath from "./RecorderWorklet"; -import { logger } from "matrix-js-sdk/src/logger"; - const CHANNELS = 1; // stereo isn't important export const SAMPLE_RATE = 48000; // 48khz is what WebRTC uses. 12khz is where we lose quality. const BITRATE = 24000; // 24kbps is pretty high quality for our use case in opus. diff --git a/src/audio/compat.ts b/src/audio/compat.ts index 37cbf4bb7b..3cab9564f7 100644 --- a/src/audio/compat.ts +++ b/src/audio/compat.ts @@ -14,15 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { SAMPLE_RATE } from "./VoiceRecording"; - // @ts-ignore - we know that this is not a module. We're looking for a path. import decoderWasmPath from 'opus-recorder/dist/decoderWorker.min.wasm'; import wavEncoderPath from 'opus-recorder/dist/waveWorker.min.js'; import decoderPath from 'opus-recorder/dist/decoderWorker.min.js'; - import { logger } from "matrix-js-sdk/src/logger"; +import { SAMPLE_RATE } from "./VoiceRecording"; + export function createAudioContext(opts?: AudioContextOptions): AudioContext { if (window.AudioContext) { return new AudioContext(opts); diff --git a/src/autocomplete/AutocompleteProvider.tsx b/src/autocomplete/AutocompleteProvider.tsx index 2d82a9f591..5ae3e985c6 100644 --- a/src/autocomplete/AutocompleteProvider.tsx +++ b/src/autocomplete/AutocompleteProvider.tsx @@ -17,6 +17,7 @@ limitations under the License. */ import React from 'react'; + import type { ICompletion, ISelectionRange } from './Autocompleter'; export interface ICommand { diff --git a/src/autocomplete/CommandProvider.tsx b/src/autocomplete/CommandProvider.tsx index 143b7e4cdc..49241e4354 100644 --- a/src/autocomplete/CommandProvider.tsx +++ b/src/autocomplete/CommandProvider.tsx @@ -18,6 +18,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from '../languageHandler'; import AutocompleteProvider from './AutocompleteProvider'; import QueryMatcher from './QueryMatcher'; diff --git a/src/autocomplete/CommunityProvider.tsx b/src/autocomplete/CommunityProvider.tsx index 4b42f4c64e..f17c801304 100644 --- a/src/autocomplete/CommunityProvider.tsx +++ b/src/autocomplete/CommunityProvider.tsx @@ -17,12 +17,13 @@ limitations under the License. import React from 'react'; import Group from "matrix-js-sdk/src/models/group"; +import { sortBy } from "lodash"; + import { _t } from '../languageHandler'; import AutocompleteProvider from './AutocompleteProvider'; import { MatrixClientPeg } from '../MatrixClientPeg'; import QueryMatcher from './QueryMatcher'; import { PillCompletion } from './Components'; -import { sortBy } from "lodash"; import { makeGroupPermalink } from "../utils/permalinks/Permalinks"; import { ICompletion, ISelectionRange } from "./Autocompleter"; import FlairStore from "../stores/FlairStore"; diff --git a/src/autocomplete/EmojiProvider.tsx b/src/autocomplete/EmojiProvider.tsx index 326651e037..3beddc3311 100644 --- a/src/autocomplete/EmojiProvider.tsx +++ b/src/autocomplete/EmojiProvider.tsx @@ -18,17 +18,17 @@ limitations under the License. */ import React from 'react'; +import { uniq, sortBy } from 'lodash'; +import EMOTICON_REGEX from 'emojibase-regex/emoticon'; + import { _t } from '../languageHandler'; import AutocompleteProvider from './AutocompleteProvider'; import QueryMatcher from './QueryMatcher'; import { PillCompletion } from './Components'; import { ICompletion, ISelectionRange } from './Autocompleter'; -import { uniq, sortBy } from 'lodash'; import SettingsStore from "../settings/SettingsStore"; import { EMOJI, IEmoji } from '../emoji'; -import EMOTICON_REGEX from 'emojibase-regex/emoticon'; - const LIMIT = 20; // Match for ascii-style ";-)" emoticons or ":wink:" shortcodes provided by emojibase diff --git a/src/autocomplete/UserProvider.tsx b/src/autocomplete/UserProvider.tsx index 48854657de..9f5cd1163d 100644 --- a/src/autocomplete/UserProvider.tsx +++ b/src/autocomplete/UserProvider.tsx @@ -18,18 +18,18 @@ limitations under the License. */ import React from 'react'; -import { _t } from '../languageHandler'; -import AutocompleteProvider from './AutocompleteProvider'; -import { PillCompletion } from './Components'; -import QueryMatcher from './QueryMatcher'; import { sortBy } from 'lodash'; -import { MatrixClientPeg } from '../MatrixClientPeg'; - import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { Room } from "matrix-js-sdk/src/models/room"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { RoomState } from "matrix-js-sdk/src/models/room-state"; import { EventTimeline } from "matrix-js-sdk/src/models/event-timeline"; + +import { MatrixClientPeg } from '../MatrixClientPeg'; +import QueryMatcher from './QueryMatcher'; +import { PillCompletion } from './Components'; +import AutocompleteProvider from './AutocompleteProvider'; +import { _t } from '../languageHandler'; import { makeUserPermalink } from "../utils/permalinks/Permalinks"; import { ICompletion, ISelectionRange } from "./Autocompleter"; import MemberAvatar from '../components/views/avatars/MemberAvatar'; diff --git a/src/boundThreepids.ts b/src/boundThreepids.ts index 94ff36ad4f..a703d10fd7 100644 --- a/src/boundThreepids.ts +++ b/src/boundThreepids.ts @@ -16,6 +16,7 @@ limitations under the License. import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; import { MatrixClient } from "matrix-js-sdk/src/client"; + import IdentityAuthClient from './IdentityAuthClient'; export async function getThreepidsWithBindStatus( diff --git a/src/components/structures/CallEventGrouper.ts b/src/components/structures/CallEventGrouper.ts index 84e004d1de..7a73126eb0 100644 --- a/src/components/structures/CallEventGrouper.ts +++ b/src/components/structures/CallEventGrouper.ts @@ -17,8 +17,9 @@ limitations under the License. import { EventType } from "matrix-js-sdk/src/@types/event"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { CallEvent, CallState, CallType, MatrixCall } from "matrix-js-sdk/src/webrtc/call"; -import CallHandler, { CallHandlerEvent } from '../../CallHandler'; import { EventEmitter } from 'events'; + +import CallHandler, { CallHandlerEvent } from '../../CallHandler'; import { MatrixClientPeg } from "../../MatrixClientPeg"; import defaultDispatcher from "../../dispatcher/dispatcher"; diff --git a/src/components/structures/CustomRoomTagPanel.js b/src/components/structures/CustomRoomTagPanel.js index 5e31048207..365b30bb0e 100644 --- a/src/components/structures/CustomRoomTagPanel.js +++ b/src/components/structures/CustomRoomTagPanel.js @@ -15,11 +15,12 @@ limitations under the License. */ import React from 'react'; +import classNames from 'classnames'; + import CustomRoomTagStore from '../../stores/CustomRoomTagStore'; import AutoHideScrollbar from './AutoHideScrollbar'; import * as sdk from '../../index'; import dis from '../../dispatcher/dispatcher'; -import classNames from 'classnames'; import * as FormattingUtils from '../../utils/FormattingUtils'; import { replaceableComponent } from "../../utils/replaceableComponent"; diff --git a/src/components/structures/EmbeddedPage.tsx b/src/components/structures/EmbeddedPage.tsx index 40aea55c70..b29a1a43d6 100644 --- a/src/components/structures/EmbeddedPage.tsx +++ b/src/components/structures/EmbeddedPage.tsx @@ -18,17 +18,17 @@ limitations under the License. import React from 'react'; import request from 'browser-request'; -import { _t } from '../../languageHandler'; import sanitizeHtml from 'sanitize-html'; +import classnames from 'classnames'; +import { logger } from "matrix-js-sdk/src/logger"; + +import { _t } from '../../languageHandler'; import dis from '../../dispatcher/dispatcher'; import { MatrixClientPeg } from '../../MatrixClientPeg'; -import classnames from 'classnames'; import MatrixClientContext from "../../contexts/MatrixClientContext"; import AutoHideScrollbar from "./AutoHideScrollbar"; import { ActionPayload } from "../../dispatcher/payloads"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { // URL to request embedded page content from url?: string; diff --git a/src/components/structures/FilePanel.tsx b/src/components/structures/FilePanel.tsx index c57c2f7ecf..093db3ff63 100644 --- a/src/components/structures/FilePanel.tsx +++ b/src/components/structures/FilePanel.tsx @@ -16,13 +16,13 @@ limitations under the License. */ import React from 'react'; - import { Filter } from 'matrix-js-sdk/src/filter'; import { EventTimelineSet } from "matrix-js-sdk/src/models/event-timeline-set"; import { Direction } from "matrix-js-sdk/src/models/event-timeline"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { Room } from 'matrix-js-sdk/src/models/room'; import { TimelineWindow } from 'matrix-js-sdk/src/timeline-window'; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from '../../MatrixClientPeg'; import EventIndexPeg from "../../indexing/EventIndexPeg"; @@ -31,7 +31,6 @@ import BaseCard from "../views/right_panel/BaseCard"; import { RightPanelPhases } from "../../stores/RightPanelStorePhases"; import DesktopBuildsNotice, { WarningKind } from "../views/elements/DesktopBuildsNotice"; import { replaceableComponent } from "../../utils/replaceableComponent"; - import ResizeNotifier from '../../utils/ResizeNotifier'; import TimelinePanel from "./TimelinePanel"; import Spinner from "../views/elements/Spinner"; @@ -39,8 +38,6 @@ import { TileShape } from '../views/rooms/EventTile'; import { Layout } from "../../settings/Layout"; import RoomContext, { TimelineRenderingType } from '../../contexts/RoomContext'; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { roomId: string; onClose: () => void; diff --git a/src/components/structures/GenericErrorPage.tsx b/src/components/structures/GenericErrorPage.tsx index d124c7111a..25892f46df 100644 --- a/src/components/structures/GenericErrorPage.tsx +++ b/src/components/structures/GenericErrorPage.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../utils/replaceableComponent"; interface IProps { diff --git a/src/components/structures/GroupFilterPanel.tsx b/src/components/structures/GroupFilterPanel.tsx index b6d05efa87..10bf40c4b0 100644 --- a/src/components/structures/GroupFilterPanel.tsx +++ b/src/components/structures/GroupFilterPanel.tsx @@ -15,17 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { EventSubscription } from "fbemitter"; import React from 'react'; +import classNames from 'classnames'; + +import type { EventSubscription } from "fbemitter"; import GroupFilterOrderStore from '../../stores/GroupFilterOrderStore'; - import GroupActions from '../../actions/GroupActions'; - import * as sdk from '../../index'; import dis from '../../dispatcher/dispatcher'; import { _t } from '../../languageHandler'; - -import classNames from 'classnames'; import MatrixClientContext from "../../contexts/MatrixClientContext"; import AutoHideScrollbar from "./AutoHideScrollbar"; import SettingsStore from "../../settings/SettingsStore"; diff --git a/src/components/structures/GroupView.js b/src/components/structures/GroupView.js index 298fa0a4b6..ede74f9343 100644 --- a/src/components/structures/GroupView.js +++ b/src/components/structures/GroupView.js @@ -18,6 +18,11 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; +import classnames from 'classnames'; +import { Group } from "matrix-js-sdk/src/models/group"; +import { sleep } from "matrix-js-sdk/src/utils"; +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from '../../MatrixClientPeg'; import * as sdk from '../../index'; import dis from '../../dispatcher/dispatcher'; @@ -29,14 +34,10 @@ import GroupHeaderButtons from '../views/right_panel/GroupHeaderButtons'; import MainSplit from './MainSplit'; import RightPanel from './RightPanel'; import Modal from '../../Modal'; -import classnames from 'classnames'; - import GroupStore from '../../stores/GroupStore'; import FlairStore from '../../stores/FlairStore'; import { showGroupAddRoomDialog } from '../../GroupAddressPicker'; import { makeGroupPermalink, makeUserPermalink } from "../../utils/permalinks/Permalinks"; -import { Group } from "matrix-js-sdk/src/models/group"; -import { sleep } from "matrix-js-sdk/src/utils"; import RightPanelStore from "../../stores/RightPanelStore"; import AutoHideScrollbar from "./AutoHideScrollbar"; import { mediaFromMxc } from "../../customisations/Media"; @@ -45,8 +46,6 @@ import { createSpaceFromCommunity } from "../../utils/space"; import { Action } from "../../dispatcher/actions"; import { RightPanelPhases } from "../../stores/RightPanelStorePhases"; -import { logger } from "matrix-js-sdk/src/logger"; - const LONG_DESC_PLACEHOLDER = _td( `

HTML for your community's page

diff --git a/src/components/structures/HostSignupAction.tsx b/src/components/structures/HostSignupAction.tsx index 41dc8a6da8..99881f27c4 100644 --- a/src/components/structures/HostSignupAction.tsx +++ b/src/components/structures/HostSignupAction.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { IconizedContextMenuOption, IconizedContextMenuOptionList, diff --git a/src/components/structures/IndicatorScrollbar.tsx b/src/components/structures/IndicatorScrollbar.tsx index 85de659481..b45932242e 100644 --- a/src/components/structures/IndicatorScrollbar.tsx +++ b/src/components/structures/IndicatorScrollbar.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { createRef } from "react"; + import AutoHideScrollbar from "./AutoHideScrollbar"; import { replaceableComponent } from "../../utils/replaceableComponent"; diff --git a/src/components/structures/InteractiveAuth.tsx b/src/components/structures/InteractiveAuth.tsx index 36489ac4a0..0c8c2a807a 100644 --- a/src/components/structures/InteractiveAuth.tsx +++ b/src/components/structures/InteractiveAuth.tsx @@ -24,13 +24,12 @@ import { } from "matrix-js-sdk/src/interactive-auth"; import { MatrixClient } from "matrix-js-sdk/src/client"; import React, { createRef } from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; import getEntryComponentForLoginType, { IStageComponent } from '../views/auth/InteractiveAuthEntryComponents'; import Spinner from "../views/elements/Spinner"; import { replaceableComponent } from "../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - export const ERROR_USER_CANCELLED = new Error("User cancelled auth session"); interface IProps { diff --git a/src/components/structures/LoggedInView.tsx b/src/components/structures/LoggedInView.tsx index 566e14e633..f0aa7576a1 100644 --- a/src/components/structures/LoggedInView.tsx +++ b/src/components/structures/LoggedInView.tsx @@ -17,6 +17,8 @@ limitations under the License. import * as React from 'react'; import { MatrixClient } from 'matrix-js-sdk/src/client'; import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; +import { MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; +import classNames from 'classnames'; import { Key } from '../../Keyboard'; import PageTypes from '../../PageTypes'; @@ -25,7 +27,6 @@ import { fixupColorFonts } from '../../utils/FontManager'; import dis from '../../dispatcher/dispatcher'; import { IMatrixClientCreds } from '../../MatrixClientPeg'; import SettingsStore from "../../settings/SettingsStore"; - import ResizeHandle from '../views/elements/ResizeHandle'; import { Resizer, CollapseDistributor } from '../../resizer'; import MatrixClientContext from "../../contexts/MatrixClientContext"; @@ -54,7 +55,6 @@ import { IOpts } from "../../createRoom"; import SpacePanel from "../views/spaces/SpacePanel"; import { replaceableComponent } from "../../utils/replaceableComponent"; import CallHandler from '../../CallHandler'; -import { MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; import AudioFeedArrayForCall from '../views/voip/AudioFeedArrayForCall'; import { OwnProfileStore } from '../../stores/OwnProfileStore'; import { UPDATE_EVENT } from "../../stores/AsyncStore"; @@ -65,7 +65,6 @@ import UserView from "./UserView"; import GroupView from "./GroupView"; import BackdropPanel from "./BackdropPanel"; import SpaceStore from "../../stores/SpaceStore"; -import classNames from 'classnames'; import GroupFilterPanel from './GroupFilterPanel'; import CustomRoomTagPanel from './CustomRoomTagPanel'; import { mediaFromMxc } from "../../customisations/Media"; diff --git a/src/components/structures/MainSplit.tsx b/src/components/structures/MainSplit.tsx index af7645767d..bc138a4316 100644 --- a/src/components/structures/MainSplit.tsx +++ b/src/components/structures/MainSplit.tsx @@ -17,9 +17,10 @@ limitations under the License. import React from 'react'; import { NumberSize, Resizable } from 're-resizable'; +import { Direction } from "re-resizable/lib/resizer"; + import { replaceableComponent } from "../../utils/replaceableComponent"; import ResizeNotifier from "../../utils/ResizeNotifier"; -import { Direction } from "re-resizable/lib/resizer"; interface IProps { resizeNotifier: ResizeNotifier; diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 0c68f2013c..866245042f 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -34,7 +34,6 @@ import PlatformPeg from "../../PlatformPeg"; import SdkConfig from "../../SdkConfig"; import dis from "../../dispatcher/dispatcher"; import Notifier from '../../Notifier'; - import Modal from "../../Modal"; import { showRoomInviteDialog, showStartChatInviteDialog } from '../../RoomInvite'; import * as Rooms from '../../Rooms'; @@ -43,7 +42,6 @@ import * as Lifecycle from '../../Lifecycle'; // LifecycleStore is not used but does listen to and dispatch actions import '../../stores/LifecycleStore'; import PageType from '../../PageTypes'; - import createRoom, { IOpts } from "../../createRoom"; import { _t, _td, getCurrentLanguage } from '../../languageHandler'; import SettingsStore from "../../settings/SettingsStore"; @@ -101,7 +99,6 @@ import Registration from './auth/Registration'; import Login from "./auth/Login"; import ErrorBoundary from '../views/elements/ErrorBoundary'; import VerificationRequestToast from '../views/toasts/VerificationRequestToast'; - import PerformanceMonitor, { PerformanceEntryNames } from "../../performance"; import UIStore, { UI_EVENTS } from "../../stores/UIStore"; import SoftLogout from './auth/SoftLogout'; @@ -111,6 +108,7 @@ import { PosthogAnalytics } from '../../PosthogAnalytics'; import { initSentry } from "../../sentry"; import { logger } from "matrix-js-sdk/src/logger"; + import { showSpaceInvite } from "../../utils/space"; /** constants for MatrixChat.state.view */ diff --git a/src/components/structures/MessagePanel.tsx b/src/components/structures/MessagePanel.tsx index 4660423678..c787ce2a7e 100644 --- a/src/components/structures/MessagePanel.tsx +++ b/src/components/structures/MessagePanel.tsx @@ -21,6 +21,7 @@ import { EventType } from 'matrix-js-sdk/src/@types/event'; import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; import { Relations } from "matrix-js-sdk/src/models/relations"; import { RoomMember } from 'matrix-js-sdk/src/models/room-member'; +import { logger } from 'matrix-js-sdk/src/logger'; import shouldHideEvent from '../../shouldHideEvent'; import { wantsDateSeparator } from '../../DateUtils'; @@ -48,7 +49,6 @@ import Spinner from "../views/elements/Spinner"; import TileErrorBoundary from '../views/messages/TileErrorBoundary'; import { RoomPermalinkCreator } from "../../utils/permalinks/Permalinks"; import EditorStateTransfer from "../../utils/EditorStateTransfer"; -import { logger } from 'matrix-js-sdk/src/logger'; import { Action } from '../../dispatcher/actions'; const CONTINUATION_MAX_INTERVAL = 5 * 60 * 1000; // 5 minutes diff --git a/src/components/structures/MyGroups.js b/src/components/structures/MyGroups.js index 2239325f1b..e64022ab54 100644 --- a/src/components/structures/MyGroups.js +++ b/src/components/structures/MyGroups.js @@ -17,6 +17,7 @@ limitations under the License. */ import React from 'react'; + import * as sdk from '../../index'; import { _t } from '../../languageHandler'; import SdkConfig from '../../SdkConfig'; diff --git a/src/components/structures/NonUrgentToastContainer.tsx b/src/components/structures/NonUrgentToastContainer.tsx index 6e914c40fb..7872c2596c 100644 --- a/src/components/structures/NonUrgentToastContainer.tsx +++ b/src/components/structures/NonUrgentToastContainer.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import * as React from "react"; + import { ComponentClass } from "../../@types/common"; import NonUrgentToastStore from "../../stores/NonUrgentToastStore"; import { UPDATE_EVENT } from "../../stores/AsyncStore"; diff --git a/src/components/structures/NotificationPanel.tsx b/src/components/structures/NotificationPanel.tsx index 52046c1855..f097a9ec95 100644 --- a/src/components/structures/NotificationPanel.tsx +++ b/src/components/structures/NotificationPanel.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from '../../languageHandler'; import { MatrixClientPeg } from "../../MatrixClientPeg"; @@ -26,8 +27,6 @@ import { TileShape } from "../views/rooms/EventTile"; import { Layout } from "../../settings/Layout"; import RoomContext, { TimelineRenderingType } from "../../contexts/RoomContext"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { onClose(): void; } diff --git a/src/components/structures/RightPanel.tsx b/src/components/structures/RightPanel.tsx index 144f17ad1f..1ff8ab3382 100644 --- a/src/components/structures/RightPanel.tsx +++ b/src/components/structures/RightPanel.tsx @@ -21,6 +21,7 @@ import { RoomState } from "matrix-js-sdk/src/models/room-state"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { throttle } from 'lodash'; import dis from '../../dispatcher/dispatcher'; import GroupStore from '../../stores/GroupStore'; @@ -49,7 +50,6 @@ import ThreadPanel from "./ThreadPanel"; import NotificationPanel from "./NotificationPanel"; import ResizeNotifier from "../../utils/ResizeNotifier"; import PinnedMessagesCard from "../views/right_panel/PinnedMessagesCard"; -import { throttle } from 'lodash'; import SpaceStore from "../../stores/SpaceStore"; import { RoomPermalinkCreator } from '../../utils/permalinks/Permalinks'; import { E2EStatus } from '../../utils/ShieldUtils'; diff --git a/src/components/structures/RoomDirectory.tsx b/src/components/structures/RoomDirectory.tsx index 56e6b2dfb8..12c759f6bd 100644 --- a/src/components/structures/RoomDirectory.tsx +++ b/src/components/structures/RoomDirectory.tsx @@ -19,6 +19,7 @@ import React from "react"; import { IFieldType, IInstance, IProtocol, IPublicRoomsChunkRoom } from "matrix-js-sdk/src/client"; import { Visibility } from "matrix-js-sdk/src/@types/partials"; import { IRoomDirectoryOptions } from "matrix-js-sdk/src/@types/requests"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from "../../MatrixClientPeg"; import dis from "../../dispatcher/dispatcher"; @@ -48,8 +49,6 @@ import Spinner from "../views/elements/Spinner"; import { ActionPayload } from "../../dispatcher/payloads"; import { getDisplayAliasForAliasSet } from "../../Rooms"; -import { logger } from "matrix-js-sdk/src/logger"; - const MAX_NAME_LENGTH = 80; const MAX_TOPIC_LENGTH = 800; diff --git a/src/components/structures/RoomStatusBar.tsx b/src/components/structures/RoomStatusBar.tsx index 82f68bc435..76835d7c29 100644 --- a/src/components/structures/RoomStatusBar.tsx +++ b/src/components/structures/RoomStatusBar.tsx @@ -15,20 +15,21 @@ limitations under the License. */ import React from 'react'; +import { EventStatus, MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { SyncState } from "matrix-js-sdk/src/sync.api"; +import { ISyncStateData } from "matrix-js-sdk/src/sync"; +import { Room } from "matrix-js-sdk/src/models/room"; + import { _t, _td } from '../../languageHandler'; import Resend from '../../Resend'; import dis from '../../dispatcher/dispatcher'; import { messageForResourceLimitError } from '../../utils/ErrorUtils'; import { Action } from "../../dispatcher/actions"; import { replaceableComponent } from "../../utils/replaceableComponent"; -import { EventStatus, MatrixEvent } from "matrix-js-sdk/src/models/event"; import NotificationBadge from "../views/rooms/NotificationBadge"; import { StaticNotificationState } from "../../stores/notifications/StaticNotificationState"; import AccessibleButton from "../views/elements/AccessibleButton"; import InlineSpinner from "../views/elements/InlineSpinner"; -import { SyncState } from "matrix-js-sdk/src/sync.api"; -import { ISyncStateData } from "matrix-js-sdk/src/sync"; -import { Room } from "matrix-js-sdk/src/models/room"; import MatrixClientContext from "../../contexts/MatrixClientContext"; const STATUS_BAR_HIDDEN = 0; diff --git a/src/components/structures/RoomView.tsx b/src/components/structures/RoomView.tsx index 6338ce0c60..47d730adc0 100644 --- a/src/components/structures/RoomView.tsx +++ b/src/components/structures/RoomView.tsx @@ -27,6 +27,10 @@ import { IRecommendedVersion, NotificationCountType, Room } from "matrix-js-sdk/ import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { EventSubscription } from "fbemitter"; import { ISearchResults } from 'matrix-js-sdk/src/@types/search'; +import { CallState, MatrixCall } from "matrix-js-sdk/src/webrtc/call"; +import { throttle } from "lodash"; +import { logger } from "matrix-js-sdk/src/logger"; +import { EventTimeline } from 'matrix-js-sdk/src/models/event-timeline'; import shouldHideEvent from '../../shouldHideEvent'; import { _t } from '../../languageHandler'; @@ -66,7 +70,6 @@ import { IOOBData, IThreepidInvite } from "../../stores/ThreepidInviteStore"; import EffectsOverlay from "../views/elements/EffectsOverlay"; import { containsEmoji } from '../../effects/utils'; import { CHAT_EFFECTS } from '../../effects'; -import { CallState, MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import WidgetStore from "../../stores/WidgetStore"; import { UPDATE_EVENT } from "../../stores/AsyncStore"; import Notifier from "../../Notifier"; @@ -79,7 +82,6 @@ import SpaceRoomView from "./SpaceRoomView"; import { IOpts } from "../../createRoom"; import { replaceableComponent } from "../../utils/replaceableComponent"; import EditorStateTransfer from "../../utils/EditorStateTransfer"; -import { throttle } from "lodash"; import ErrorDialog from '../views/dialogs/ErrorDialog'; import SearchResultTile from '../views/rooms/SearchResultTile'; import Spinner from "../views/elements/Spinner"; @@ -89,9 +91,6 @@ import MessageComposer from '../views/rooms/MessageComposer'; import JumpToBottomButton from "../views/rooms/JumpToBottomButton"; import TopUnreadMessagesBar from "../views/rooms/TopUnreadMessagesBar"; import SpaceStore from "../../stores/SpaceStore"; - -import { logger } from "matrix-js-sdk/src/logger"; -import { EventTimeline } from 'matrix-js-sdk/src/models/event-timeline'; import { dispatchShowThreadEvent } from '../../dispatcher/dispatch-actions/threads'; import { fetchInitialEvent } from "../../utils/EventUtils"; diff --git a/src/components/structures/ScrollPanel.tsx b/src/components/structures/ScrollPanel.tsx index 1699b535d9..2b3c0b7f33 100644 --- a/src/components/structures/ScrollPanel.tsx +++ b/src/components/structures/ScrollPanel.tsx @@ -15,14 +15,14 @@ limitations under the License. */ import React, { createRef, CSSProperties, ReactNode, SyntheticEvent, KeyboardEvent } from "react"; +import { logger } from "matrix-js-sdk/src/logger"; + import Timer from '../../utils/Timer'; import AutoHideScrollbar from "./AutoHideScrollbar"; import { replaceableComponent } from "../../utils/replaceableComponent"; import { getKeyBindingsManager, RoomAction } from "../../KeyBindingsManager"; import ResizeNotifier from "../../utils/ResizeNotifier"; -import { logger } from "matrix-js-sdk/src/logger"; - const DEBUG_SCROLL = false; // The amount of extra scroll distance to allow prior to unfilling. diff --git a/src/components/structures/SearchBox.tsx b/src/components/structures/SearchBox.tsx index 82fe689022..f86c91f31f 100644 --- a/src/components/structures/SearchBox.tsx +++ b/src/components/structures/SearchBox.tsx @@ -16,11 +16,12 @@ limitations under the License. */ import React, { createRef } from 'react'; +import { throttle } from 'lodash'; +import classNames from 'classnames'; + import { Key } from '../../Keyboard'; import dis from '../../dispatcher/dispatcher'; -import { throttle } from 'lodash'; import AccessibleButton from '../../components/views/elements/AccessibleButton'; -import classNames from 'classnames'; import { replaceableComponent } from "../../utils/replaceableComponent"; interface IProps { diff --git a/src/components/structures/SpaceRoomView.tsx b/src/components/structures/SpaceRoomView.tsx index 4a43f0380d..0a820d7fc9 100644 --- a/src/components/structures/SpaceRoomView.tsx +++ b/src/components/structures/SpaceRoomView.tsx @@ -19,6 +19,7 @@ import { EventType } from "matrix-js-sdk/src/@types/event"; import { JoinRule, Preset } from "matrix-js-sdk/src/@types/partials"; import { Room } from "matrix-js-sdk/src/models/room"; import { EventSubscription } from "fbemitter"; +import { logger } from "matrix-js-sdk/src/logger"; import MatrixClientContext from "../../contexts/MatrixClientContext"; import RoomAvatar from "../views/avatars/RoomAvatar"; @@ -81,8 +82,6 @@ import Spinner from "../views/elements/Spinner"; import GroupAvatar from "../views/avatars/GroupAvatar"; import { useDispatcher } from "../../hooks/useDispatcher"; import { useRoomState } from "../../hooks/useRoomState"; - -import { logger } from "matrix-js-sdk/src/logger"; import { shouldShowComponent } from "../../customisations/helpers/UIComponents"; import { UIComponent } from "../../settings/UIFeature"; diff --git a/src/components/structures/TabbedView.tsx b/src/components/structures/TabbedView.tsx index efa1143443..8287189c2c 100644 --- a/src/components/structures/TabbedView.tsx +++ b/src/components/structures/TabbedView.tsx @@ -17,14 +17,14 @@ limitations under the License. */ import * as React from "react"; +import classNames from "classnames"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from '../../languageHandler'; import AutoHideScrollbar from './AutoHideScrollbar'; import { replaceableComponent } from "../../utils/replaceableComponent"; -import classNames from "classnames"; import AccessibleButton from "../views/elements/AccessibleButton"; -import { logger } from "matrix-js-sdk/src/logger"; - /** * Represents a tab for the TabbedView. */ diff --git a/src/components/structures/ThreadPanel.tsx b/src/components/structures/ThreadPanel.tsx index c3db17e193..71c6fa1e33 100644 --- a/src/components/structures/ThreadPanel.tsx +++ b/src/components/structures/ThreadPanel.tsx @@ -21,7 +21,6 @@ import { Room } from 'matrix-js-sdk/src/models/room'; import BaseCard from "../views/right_panel/BaseCard"; import { RightPanelPhases } from "../../stores/RightPanelStorePhases"; - import ResizeNotifier from '../../utils/ResizeNotifier'; import MatrixClientContext from '../../contexts/MatrixClientContext'; import { _t } from '../../languageHandler'; diff --git a/src/components/structures/ThreadView.tsx b/src/components/structures/ThreadView.tsx index c7a4342449..b43c74146c 100644 --- a/src/components/structures/ThreadView.tsx +++ b/src/components/structures/ThreadView.tsx @@ -22,7 +22,6 @@ import { RelationType } from 'matrix-js-sdk/src/@types/event'; import BaseCard from "../views/right_panel/BaseCard"; import { RightPanelPhases } from "../../stores/RightPanelStorePhases"; import { replaceableComponent } from "../../utils/replaceableComponent"; - import ResizeNotifier from '../../utils/ResizeNotifier'; import { TileShape } from '../views/rooms/EventTile'; import MessageComposer from '../views/rooms/MessageComposer'; diff --git a/src/components/structures/TimelinePanel.tsx b/src/components/structures/TimelinePanel.tsx index 495d3c438f..56a9017328 100644 --- a/src/components/structures/TimelinePanel.tsx +++ b/src/components/structures/TimelinePanel.tsx @@ -23,6 +23,8 @@ import { Direction, EventTimeline } from "matrix-js-sdk/src/models/event-timelin import { TimelineWindow } from "matrix-js-sdk/src/timeline-window"; import { EventType, RelationType } from 'matrix-js-sdk/src/@types/event'; import { SyncState } from 'matrix-js-sdk/src/sync.api'; +import { debounce } from 'lodash'; +import { logger } from "matrix-js-sdk/src/logger"; import SettingsStore from "../../settings/SettingsStore"; import { Layout } from "../../settings/Layout"; @@ -47,9 +49,6 @@ import { RoomPermalinkCreator } from "../../utils/permalinks/Permalinks"; import Spinner from "../views/elements/Spinner"; import EditorStateTransfer from '../../utils/EditorStateTransfer'; import ErrorDialog from '../views/dialogs/ErrorDialog'; -import { debounce } from 'lodash'; - -import { logger } from "matrix-js-sdk/src/logger"; const PAGINATE_SIZE = 20; const INITIAL_SIZE = 20; diff --git a/src/components/structures/ToastContainer.tsx b/src/components/structures/ToastContainer.tsx index 0b0e871975..0b71fa9dc9 100644 --- a/src/components/structures/ToastContainer.tsx +++ b/src/components/structures/ToastContainer.tsx @@ -15,8 +15,9 @@ limitations under the License. */ import * as React from "react"; -import ToastStore, { IToast } from "../../stores/ToastStore"; import classNames from "classnames"; + +import ToastStore, { IToast } from "../../stores/ToastStore"; import { replaceableComponent } from "../../utils/replaceableComponent"; interface IState { diff --git a/src/components/structures/UploadBar.tsx b/src/components/structures/UploadBar.tsx index 6ee53da5d1..3fa3f1ce9f 100644 --- a/src/components/structures/UploadBar.tsx +++ b/src/components/structures/UploadBar.tsx @@ -16,9 +16,10 @@ limitations under the License. import React from 'react'; import { Room } from "matrix-js-sdk/src/models/room"; +import filesize from "filesize"; + import ContentMessages from '../../ContentMessages'; import dis from "../../dispatcher/dispatcher"; -import filesize from "filesize"; import { _t } from '../../languageHandler'; import { ActionPayload } from "../../dispatcher/payloads"; import { Action } from "../../dispatcher/actions"; diff --git a/src/components/structures/UserMenu.tsx b/src/components/structures/UserMenu.tsx index 646fc32b59..a0760b6d8c 100644 --- a/src/components/structures/UserMenu.tsx +++ b/src/components/structures/UserMenu.tsx @@ -18,6 +18,7 @@ import React, { createRef } from "react"; import { Room } from "matrix-js-sdk/src/models/room"; import classNames from "classnames"; import * as fbEmitter from "fbemitter"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from "../../MatrixClientPeg"; import defaultDispatcher from "../../dispatcher/dispatcher"; @@ -59,7 +60,7 @@ import RoomName from "../views/elements/RoomName"; import { replaceableComponent } from "../../utils/replaceableComponent"; import InlineSpinner from "../views/elements/InlineSpinner"; import TooltipButton from "../views/elements/TooltipButton"; -import { logger } from "matrix-js-sdk/src/logger"; + interface IProps { isMinimized: boolean; } diff --git a/src/components/structures/UserView.tsx b/src/components/structures/UserView.tsx index 32168e8449..04e97bc057 100644 --- a/src/components/structures/UserView.tsx +++ b/src/components/structures/UserView.tsx @@ -16,13 +16,14 @@ limitations under the License. */ import React from "react"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { RoomMember } from "matrix-js-sdk/src/models/room-member"; + import { MatrixClientPeg } from "../../MatrixClientPeg"; import Modal from '../../Modal'; import { _t } from '../../languageHandler'; import HomePage from "./HomePage"; import { replaceableComponent } from "../../utils/replaceableComponent"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; -import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import ErrorDialog from "../views/dialogs/ErrorDialog"; import MainSplit from "./MainSplit"; import RightPanel from "./RightPanel"; diff --git a/src/components/structures/ViewSource.tsx b/src/components/structures/ViewSource.tsx index 20bbece755..7cc3b0dbcd 100644 --- a/src/components/structures/ViewSource.tsx +++ b/src/components/structures/ViewSource.tsx @@ -17,6 +17,8 @@ limitations under the License. */ import React from "react"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import SyntaxHighlight from "../views/elements/SyntaxHighlight"; import { _t } from "../../languageHandler"; import MatrixClientContext from "../../contexts/MatrixClientContext"; @@ -24,7 +26,6 @@ import { SendCustomEvent } from "../views/dialogs/DevtoolsDialog"; import { canEditContent } from "../../utils/EventUtils"; import { MatrixClientPeg } from '../../MatrixClientPeg'; import { replaceableComponent } from "../../utils/replaceableComponent"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { IDialogProps } from "../views/dialogs/IDialogProps"; import BaseDialog from "../views/dialogs/BaseDialog"; diff --git a/src/components/structures/auth/CompleteSecurity.tsx b/src/components/structures/auth/CompleteSecurity.tsx index 1e46f0e657..2c2912086d 100644 --- a/src/components/structures/auth/CompleteSecurity.tsx +++ b/src/components/structures/auth/CompleteSecurity.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from '../../../languageHandler'; import * as sdk from '../../../index'; import { SetupEncryptionStore, Phase } from '../../../stores/SetupEncryptionStore'; diff --git a/src/components/structures/auth/E2eSetup.tsx b/src/components/structures/auth/E2eSetup.tsx index 93cb92664f..96d6a0dc0b 100644 --- a/src/components/structures/auth/E2eSetup.tsx +++ b/src/components/structures/auth/E2eSetup.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import AuthPage from '../../views/auth/AuthPage'; import CompleteSecurityBody from '../../views/auth/CompleteSecurityBody'; import CreateCrossSigningDialog from '../../views/dialogs/security/CreateCrossSigningDialog'; diff --git a/src/components/structures/auth/ForgotPassword.tsx b/src/components/structures/auth/ForgotPassword.tsx index 4c65fac983..b5c5912406 100644 --- a/src/components/structures/auth/ForgotPassword.tsx +++ b/src/components/structures/auth/ForgotPassword.tsx @@ -17,12 +17,14 @@ limitations under the License. */ import React from 'react'; +import classNames from 'classnames'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t, _td } from '../../../languageHandler'; import * as sdk from '../../../index'; import Modal from "../../../Modal"; import PasswordReset from "../../../PasswordReset"; import AutoDiscoveryUtils, { ValidatedServerConfig } from "../../../utils/AutoDiscoveryUtils"; -import classNames from 'classnames'; import AuthPage from "../../views/auth/AuthPage"; import CountlyAnalytics from "../../../CountlyAnalytics"; import ServerPicker from "../../views/elements/ServerPicker"; @@ -33,8 +35,6 @@ import withValidation, { IValidationResult } from "../../views/elements/Validati import * as Email from "../../../email"; import InlineSpinner from '../../views/elements/InlineSpinner'; -import { logger } from "matrix-js-sdk/src/logger"; - enum Phase { // Show the forgot password inputs Forgot = 1, diff --git a/src/components/structures/auth/Login.tsx b/src/components/structures/auth/Login.tsx index 403c013e64..4b849e1d03 100644 --- a/src/components/structures/auth/Login.tsx +++ b/src/components/structures/auth/Login.tsx @@ -16,13 +16,14 @@ limitations under the License. import React, { ReactNode } from 'react'; import { MatrixError } from "matrix-js-sdk/src/http-api"; +import classNames from "classnames"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t, _td } from '../../../languageHandler'; import Login, { ISSOFlow, LoginFlow } from '../../../Login'; import SdkConfig from '../../../SdkConfig'; import { messageForResourceLimitError } from '../../../utils/ErrorUtils'; import AutoDiscoveryUtils, { ValidatedServerConfig } from "../../../utils/AutoDiscoveryUtils"; -import classNames from "classnames"; import AuthPage from "../../views/auth/AuthPage"; import PlatformPeg from '../../../PlatformPeg'; import SettingsStore from "../../../settings/SettingsStore"; @@ -38,8 +39,6 @@ import { replaceableComponent } from "../../../utils/replaceableComponent"; import AuthBody from "../../views/auth/AuthBody"; import AuthHeader from "../../views/auth/AuthHeader"; -import { logger } from "matrix-js-sdk/src/logger"; - // These are used in several places, and come from the js-sdk's autodiscovery // stuff. We define them here so that they'll be picked up by i18n. _td("Invalid homeserver discovery response"); diff --git a/src/components/structures/auth/Registration.tsx b/src/components/structures/auth/Registration.tsx index ab1956dd6a..7a3084aa68 100644 --- a/src/components/structures/auth/Registration.tsx +++ b/src/components/structures/auth/Registration.tsx @@ -17,11 +17,12 @@ limitations under the License. import { createClient } from 'matrix-js-sdk/src/matrix'; import React, { ReactNode } from 'react'; import { MatrixClient } from "matrix-js-sdk/src/client"; +import classNames from "classnames"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t, _td } from '../../../languageHandler'; import { messageForResourceLimitError } from '../../../utils/ErrorUtils'; import AutoDiscoveryUtils, { ValidatedServerConfig } from "../../../utils/AutoDiscoveryUtils"; -import classNames from "classnames"; import * as Lifecycle from '../../../Lifecycle'; import { IMatrixClientCreds, MatrixClientPeg } from "../../../MatrixClientPeg"; import AuthPage from "../../views/auth/AuthPage"; @@ -37,8 +38,6 @@ import AuthHeader from "../../views/auth/AuthHeader"; import InteractiveAuth from "../InteractiveAuth"; import Spinner from "../../views/elements/Spinner"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { serverConfig: ValidatedServerConfig; defaultDeviceDisplayName: string; diff --git a/src/components/structures/auth/SetupEncryptionBody.tsx b/src/components/structures/auth/SetupEncryptionBody.tsx index e2b1aebcfd..c51bbf253b 100644 --- a/src/components/structures/auth/SetupEncryptionBody.tsx +++ b/src/components/structures/auth/SetupEncryptionBody.tsx @@ -15,20 +15,20 @@ limitations under the License. */ import React from 'react'; +import { ISecretStorageKeyInfo } from 'matrix-js-sdk/src/crypto/api'; +import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup"; +import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import Modal from '../../../Modal'; import VerificationRequestDialog from '../../views/dialogs/VerificationRequestDialog'; import { SetupEncryptionStore, Phase } from '../../../stores/SetupEncryptionStore'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { ISecretStorageKeyInfo } from 'matrix-js-sdk/src/crypto/api'; import EncryptionPanel from "../../views/right_panel/EncryptionPanel"; import AccessibleButton from '../../views/elements/AccessibleButton'; import Spinner from '../../views/elements/Spinner'; -import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup"; -import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; - -import { logger } from "matrix-js-sdk/src/logger"; function keyHasPassphrase(keyInfo: ISecretStorageKeyInfo): boolean { return Boolean( diff --git a/src/components/structures/auth/SoftLogout.tsx b/src/components/structures/auth/SoftLogout.tsx index db93d30c27..dd922a48e9 100644 --- a/src/components/structures/auth/SoftLogout.tsx +++ b/src/components/structures/auth/SoftLogout.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from '../../../languageHandler'; import dis from '../../../dispatcher/dispatcher'; import * as Lifecycle from '../../../Lifecycle'; @@ -32,8 +34,6 @@ import Spinner from "../../views/elements/Spinner"; import AuthHeader from "../../views/auth/AuthHeader"; import AuthBody from "../../views/auth/AuthBody"; -import { logger } from "matrix-js-sdk/src/logger"; - const LOGIN_VIEW = { LOADING: 1, PASSWORD: 2, diff --git a/src/components/views/audio_messages/AudioPlayer.tsx b/src/components/views/audio_messages/AudioPlayer.tsx index b83f89fe5b..64ef971567 100644 --- a/src/components/views/audio_messages/AudioPlayer.tsx +++ b/src/components/views/audio_messages/AudioPlayer.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { createRef, ReactNode, RefObject } from "react"; + import PlayPauseButton from "./PlayPauseButton"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { formatBytes } from "../../../utils/FormattingUtils"; diff --git a/src/components/views/audio_messages/AudioPlayerBase.tsx b/src/components/views/audio_messages/AudioPlayerBase.tsx index 5158e87827..f645c53387 100644 --- a/src/components/views/audio_messages/AudioPlayerBase.tsx +++ b/src/components/views/audio_messages/AudioPlayerBase.tsx @@ -14,15 +14,15 @@ See the License for the specific language governing permissions and limitations under the License. */ +import React, { ReactNode } from "react"; +import { logger } from "matrix-js-sdk/src/logger"; + import { Playback, PlaybackState } from "../../../audio/Playback"; import { TileShape } from "../rooms/EventTile"; -import React, { ReactNode } from "react"; import { UPDATE_EVENT } from "../../../stores/AsyncStore"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { _t } from "../../../languageHandler"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { // Playback instance to render. Cannot change during component lifecycle: create // an all-new component instead. diff --git a/src/components/views/audio_messages/Clock.tsx b/src/components/views/audio_messages/Clock.tsx index 69244cc5ad..488a5a293b 100644 --- a/src/components/views/audio_messages/Clock.tsx +++ b/src/components/views/audio_messages/Clock.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { formatSeconds } from "../../../DateUtils"; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/audio_messages/DurationClock.tsx b/src/components/views/audio_messages/DurationClock.tsx index 15bc6c98a4..e0c180123a 100644 --- a/src/components/views/audio_messages/DurationClock.tsx +++ b/src/components/views/audio_messages/DurationClock.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import Clock from "./Clock"; import { Playback } from "../../../audio/Playback"; diff --git a/src/components/views/audio_messages/LiveRecordingClock.tsx b/src/components/views/audio_messages/LiveRecordingClock.tsx index e7330efc1d..b9b582a03b 100644 --- a/src/components/views/audio_messages/LiveRecordingClock.tsx +++ b/src/components/views/audio_messages/LiveRecordingClock.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { IRecordingUpdate, VoiceRecording } from "../../../audio/VoiceRecording"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import Clock from "./Clock"; diff --git a/src/components/views/audio_messages/LiveRecordingWaveform.tsx b/src/components/views/audio_messages/LiveRecordingWaveform.tsx index 73e18626fe..13ba7b9f96 100644 --- a/src/components/views/audio_messages/LiveRecordingWaveform.tsx +++ b/src/components/views/audio_messages/LiveRecordingWaveform.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { IRecordingUpdate, RECORDING_PLAYBACK_SAMPLES, VoiceRecording } from "../../../audio/VoiceRecording"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { arrayFastResample, arraySeed } from "../../../utils/arrays"; diff --git a/src/components/views/audio_messages/PlayPauseButton.tsx b/src/components/views/audio_messages/PlayPauseButton.tsx index de2822cc39..050a1e4eb3 100644 --- a/src/components/views/audio_messages/PlayPauseButton.tsx +++ b/src/components/views/audio_messages/PlayPauseButton.tsx @@ -15,11 +15,12 @@ limitations under the License. */ import React, { ReactNode } from "react"; +import classNames from "classnames"; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; import { _t } from "../../../languageHandler"; import { Playback, PlaybackState } from "../../../audio/Playback"; -import classNames from "classnames"; // omitted props are handled by render function interface IProps extends Omit, "title" | "onClick" | "disabled"> { diff --git a/src/components/views/audio_messages/PlaybackClock.tsx b/src/components/views/audio_messages/PlaybackClock.tsx index affb025d86..48946eb21f 100644 --- a/src/components/views/audio_messages/PlaybackClock.tsx +++ b/src/components/views/audio_messages/PlaybackClock.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import Clock from "./Clock"; import { Playback, PlaybackState } from "../../../audio/Playback"; diff --git a/src/components/views/audio_messages/PlaybackWaveform.tsx b/src/components/views/audio_messages/PlaybackWaveform.tsx index 96fd3f5ae2..70bf0ebeef 100644 --- a/src/components/views/audio_messages/PlaybackWaveform.tsx +++ b/src/components/views/audio_messages/PlaybackWaveform.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import { arraySeed, arrayTrimFill } from "../../../utils/arrays"; import Waveform from "./Waveform"; diff --git a/src/components/views/audio_messages/RecordingPlayback.tsx b/src/components/views/audio_messages/RecordingPlayback.tsx index e3f612c9b6..04c61affd9 100644 --- a/src/components/views/audio_messages/RecordingPlayback.tsx +++ b/src/components/views/audio_messages/RecordingPlayback.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { ReactNode } from "react"; + import PlayPauseButton from "./PlayPauseButton"; import PlaybackClock from "./PlaybackClock"; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/audio_messages/SeekBar.tsx b/src/components/views/audio_messages/SeekBar.tsx index f0c03bb032..817f3e0452 100644 --- a/src/components/views/audio_messages/SeekBar.tsx +++ b/src/components/views/audio_messages/SeekBar.tsx @@ -14,8 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { Playback, PlaybackState } from "../../../audio/Playback"; import React, { ChangeEvent, CSSProperties, ReactNode } from "react"; + +import { Playback, PlaybackState } from "../../../audio/Playback"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { MarkedExecution } from "../../../utils/MarkedExecution"; import { percentageOf } from "../../../utils/numbers"; diff --git a/src/components/views/audio_messages/Waveform.tsx b/src/components/views/audio_messages/Waveform.tsx index 4e44abdf46..dedd95c7e1 100644 --- a/src/components/views/audio_messages/Waveform.tsx +++ b/src/components/views/audio_messages/Waveform.tsx @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React from "react"; -import { replaceableComponent } from "../../../utils/replaceableComponent"; +import React, { CSSProperties } from "react"; import classNames from "classnames"; -import { CSSProperties } from "react"; + +import { replaceableComponent } from "../../../utils/replaceableComponent"; interface WaveformCSSProperties extends CSSProperties { '--barHeight': number; diff --git a/src/components/views/auth/AuthBody.tsx b/src/components/views/auth/AuthBody.tsx index 3543a573d7..22bb919141 100644 --- a/src/components/views/auth/AuthBody.tsx +++ b/src/components/views/auth/AuthBody.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; @replaceableComponent("views.auth.AuthBody") diff --git a/src/components/views/auth/AuthFooter.tsx b/src/components/views/auth/AuthFooter.tsx index 00bced8c39..d936e346e6 100644 --- a/src/components/views/auth/AuthFooter.tsx +++ b/src/components/views/auth/AuthFooter.tsx @@ -16,8 +16,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { _t } from '../../../languageHandler'; import React from 'react'; + +import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; @replaceableComponent("views.auth.AuthFooter") diff --git a/src/components/views/auth/AuthHeader.tsx b/src/components/views/auth/AuthHeader.tsx index cab7da1468..27768c9e6e 100644 --- a/src/components/views/auth/AuthHeader.tsx +++ b/src/components/views/auth/AuthHeader.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import AuthHeaderLogo from "./AuthHeaderLogo"; import LanguageSelector from "./LanguageSelector"; diff --git a/src/components/views/auth/AuthHeaderLogo.tsx b/src/components/views/auth/AuthHeaderLogo.tsx index b6724793a5..29e5737238 100644 --- a/src/components/views/auth/AuthHeaderLogo.tsx +++ b/src/components/views/auth/AuthHeaderLogo.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; @replaceableComponent("views.auth.AuthHeaderLogo") diff --git a/src/components/views/auth/AuthPage.tsx b/src/components/views/auth/AuthPage.tsx index c402d5b699..d13c8dd6ae 100644 --- a/src/components/views/auth/AuthPage.tsx +++ b/src/components/views/auth/AuthPage.tsx @@ -17,6 +17,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import AuthFooter from "./AuthFooter"; diff --git a/src/components/views/auth/CaptchaForm.tsx b/src/components/views/auth/CaptchaForm.tsx index 846efcc9ca..5801d627bc 100644 --- a/src/components/views/auth/CaptchaForm.tsx +++ b/src/components/views/auth/CaptchaForm.tsx @@ -15,12 +15,12 @@ limitations under the License. */ import React, { createRef } from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from '../../../languageHandler'; import CountlyAnalytics from "../../../CountlyAnalytics"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - const DIV_ID = 'mx_recaptcha'; interface ICaptchaFormProps { diff --git a/src/components/views/auth/CompleteSecurityBody.tsx b/src/components/views/auth/CompleteSecurityBody.tsx index 8f6affb64e..349016add5 100644 --- a/src/components/views/auth/CompleteSecurityBody.tsx +++ b/src/components/views/auth/CompleteSecurityBody.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; @replaceableComponent("views.auth.CompleteSecurityBody") diff --git a/src/components/views/auth/InteractiveAuthEntryComponents.tsx b/src/components/views/auth/InteractiveAuthEntryComponents.tsx index e6ded475d8..c0396ff186 100644 --- a/src/components/views/auth/InteractiveAuthEntryComponents.tsx +++ b/src/components/views/auth/InteractiveAuthEntryComponents.tsx @@ -18,6 +18,7 @@ import React, { ChangeEvent, createRef, FormEvent, MouseEvent } from 'react'; import classNames from 'classnames'; import { MatrixClient } from "matrix-js-sdk/src/client"; import { AuthType, IAuthDict, IInputs, IStageStatus } from 'matrix-js-sdk/src/interactive-auth'; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from '../../../languageHandler'; import SettingsStore from "../../../settings/SettingsStore"; @@ -29,8 +30,6 @@ import { LocalisedPolicy, Policies } from '../../../Terms'; import Field from '../elements/Field'; import CaptchaForm from "./CaptchaForm"; -import { logger } from "matrix-js-sdk/src/logger"; - /* This file contains a collection of components which are used by the * InteractiveAuth to prompt the user to enter the information needed * for an auth stage. (The intention is that they could also be used for other diff --git a/src/components/views/auth/LanguageSelector.tsx b/src/components/views/auth/LanguageSelector.tsx index c26b4797f3..cd88652e43 100644 --- a/src/components/views/auth/LanguageSelector.tsx +++ b/src/components/views/auth/LanguageSelector.tsx @@ -14,11 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ +import React from 'react'; + import SdkConfig from "../../../SdkConfig"; import { getCurrentLanguage } from "../../../languageHandler"; import SettingsStore from "../../../settings/SettingsStore"; import PlatformPeg from "../../../PlatformPeg"; -import React from 'react'; import { SettingLevel } from "../../../settings/SettingLevel"; import LanguageDropdown from "../elements/LanguageDropdown"; diff --git a/src/components/views/auth/RegistrationForm.tsx b/src/components/views/auth/RegistrationForm.tsx index c66d6b80fd..19963d15d4 100644 --- a/src/components/views/auth/RegistrationForm.tsx +++ b/src/components/views/auth/RegistrationForm.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; import * as Email from '../../../email'; import { looksValid as phoneNumberLooksValid } from '../../../phonenumber'; @@ -32,8 +33,6 @@ import RegistrationEmailPromptDialog from '../dialogs/RegistrationEmailPromptDia import { replaceableComponent } from "../../../utils/replaceableComponent"; import CountryDropdown from "./CountryDropdown"; -import { logger } from "matrix-js-sdk/src/logger"; - enum RegistrationField { Email = "field_email", PhoneNumber = "field_phone_number", diff --git a/src/components/views/avatars/MemberAvatar.tsx b/src/components/views/avatars/MemberAvatar.tsx index 48b2575cd2..9ecaf8030b 100644 --- a/src/components/views/avatars/MemberAvatar.tsx +++ b/src/components/views/avatars/MemberAvatar.tsx @@ -18,6 +18,7 @@ limitations under the License. import React from 'react'; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { ResizeMethod } from 'matrix-js-sdk/src/@types/partials'; +import { logger } from "matrix-js-sdk/src/logger"; import dis from "../../../dispatcher/dispatcher"; import { Action } from "../../../dispatcher/actions"; @@ -25,8 +26,6 @@ import BaseAvatar from "./BaseAvatar"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { mediaFromMxc } from "../../../customisations/Media"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps extends Omit, "name" | "idName" | "url"> { member: RoomMember; fallbackUserId?: string; diff --git a/src/components/views/avatars/MemberStatusMessageAvatar.tsx b/src/components/views/avatars/MemberStatusMessageAvatar.tsx index 8c703b3b32..35645f3fd7 100644 --- a/src/components/views/avatars/MemberStatusMessageAvatar.tsx +++ b/src/components/views/avatars/MemberStatusMessageAvatar.tsx @@ -15,16 +15,17 @@ limitations under the License. */ import React, { createRef } from 'react'; +import classNames from 'classnames'; +import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { ResizeMethod } from "matrix-js-sdk/src/@types/partials"; + import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from "../../../languageHandler"; import MemberAvatar from '../avatars/MemberAvatar'; -import classNames from 'classnames'; import StatusMessageContextMenu from "../context_menus/StatusMessageContextMenu"; import SettingsStore from "../../../settings/SettingsStore"; import { ChevronFace, ContextMenu, ContextMenuButton } from "../../structures/ContextMenu"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { RoomMember } from "matrix-js-sdk/src/models/room-member"; -import { ResizeMethod } from "matrix-js-sdk/src/@types/partials"; interface IProps { member: RoomMember; diff --git a/src/components/views/context_menus/CallContextMenu.tsx b/src/components/views/context_menus/CallContextMenu.tsx index a61cdeedd3..6fa71594e1 100644 --- a/src/components/views/context_menus/CallContextMenu.tsx +++ b/src/components/views/context_menus/CallContextMenu.tsx @@ -16,9 +16,10 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; +import { MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; + import { _t } from '../../../languageHandler'; import { ContextMenu, IProps as IContextMenuProps, MenuItem } from '../../structures/ContextMenu'; -import { MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; import CallHandler from '../../../CallHandler'; import InviteDialog, { KIND_CALL_TRANSFER } from '../dialogs/InviteDialog'; import Modal from '../../../Modal'; diff --git a/src/components/views/context_menus/DialpadContextMenu.tsx b/src/components/views/context_menus/DialpadContextMenu.tsx index 01c7c6c1d8..86d714bb43 100644 --- a/src/components/views/context_menus/DialpadContextMenu.tsx +++ b/src/components/views/context_menus/DialpadContextMenu.tsx @@ -16,9 +16,10 @@ limitations under the License. import * as React from "react"; import { createRef } from "react"; +import { MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; + import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; import { ContextMenu, IProps as IContextMenuProps } from '../../structures/ContextMenu'; -import { MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; import Field from "../elements/Field"; import DialPad from '../voip/DialPad'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/context_menus/GenericElementContextMenu.tsx b/src/components/views/context_menus/GenericElementContextMenu.tsx index a0a8c89b37..d5ebfca26e 100644 --- a/src/components/views/context_menus/GenericElementContextMenu.tsx +++ b/src/components/views/context_menus/GenericElementContextMenu.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; interface IProps { diff --git a/src/components/views/context_menus/GenericTextContextMenu.tsx b/src/components/views/context_menus/GenericTextContextMenu.tsx index 3ca158dd02..a8edf6af3c 100644 --- a/src/components/views/context_menus/GenericTextContextMenu.tsx +++ b/src/components/views/context_menus/GenericTextContextMenu.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; interface IProps { diff --git a/src/components/views/context_menus/GroupInviteTileContextMenu.js b/src/components/views/context_menus/GroupInviteTileContextMenu.js index ed5a45d432..e0717e2494 100644 --- a/src/components/views/context_menus/GroupInviteTileContextMenu.js +++ b/src/components/views/context_menus/GroupInviteTileContextMenu.js @@ -17,16 +17,16 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; +import { Group } from 'matrix-js-sdk/src/models/group'; +import { logger } from "matrix-js-sdk/src/logger"; + import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; import Modal from '../../../Modal'; -import { Group } from 'matrix-js-sdk/src/models/group'; import GroupStore from "../../../stores/GroupStore"; import { MenuItem } from "../../structures/ContextMenu"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - @replaceableComponent("views.context_menus.GroupInviteTileContextMenu") export default class GroupInviteTileContextMenu extends React.Component { static propTypes = { diff --git a/src/components/views/context_menus/StatusMessageContextMenu.tsx b/src/components/views/context_menus/StatusMessageContextMenu.tsx index 954dc3f5c0..5a4abcded4 100644 --- a/src/components/views/context_menus/StatusMessageContextMenu.tsx +++ b/src/components/views/context_menus/StatusMessageContextMenu.tsx @@ -15,11 +15,12 @@ limitations under the License. */ import React, { ChangeEvent } from 'react'; +import { User } from "matrix-js-sdk/src/models/user"; + import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import AccessibleButton, { ButtonEvent } from '../elements/AccessibleButton'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { User } from "matrix-js-sdk/src/models/user"; import Spinner from "../elements/Spinner"; interface IProps { diff --git a/src/components/views/context_menus/TagTileContextMenu.js b/src/components/views/context_menus/TagTileContextMenu.js index 0c3c48a07f..d7b21756f6 100644 --- a/src/components/views/context_menus/TagTileContextMenu.js +++ b/src/components/views/context_menus/TagTileContextMenu.js @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; + import { _t } from '../../../languageHandler'; import dis from '../../../dispatcher/dispatcher'; import TagOrderActions from '../../../actions/TagOrderActions'; diff --git a/src/components/views/context_menus/WidgetContextMenu.tsx b/src/components/views/context_menus/WidgetContextMenu.tsx index b980024dc6..4a704e38e1 100644 --- a/src/components/views/context_menus/WidgetContextMenu.tsx +++ b/src/components/views/context_menus/WidgetContextMenu.tsx @@ -16,6 +16,7 @@ limitations under the License. import React, { useContext } from "react"; import { MatrixCapabilities } from "matrix-widget-api"; +import { logger } from "matrix-js-sdk/src/logger"; import IconizedContextMenu, { IconizedContextMenuOption, IconizedContextMenuOptionList } from "./IconizedContextMenu"; import { ChevronFace } from "../../structures/ContextMenu"; @@ -34,8 +35,6 @@ import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { Container, WidgetLayoutStore } from "../../../stores/widgets/WidgetLayoutStore"; import { getConfigLivestreamUrl, startJitsiAudioLivestream } from "../../../Livestream"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps extends React.ComponentProps { app: IApp; userWidget?: boolean; diff --git a/src/components/views/dialogs/AddExistingToSpaceDialog.tsx b/src/components/views/dialogs/AddExistingToSpaceDialog.tsx index 337941ce5f..3eaa0f0555 100644 --- a/src/components/views/dialogs/AddExistingToSpaceDialog.tsx +++ b/src/components/views/dialogs/AddExistingToSpaceDialog.tsx @@ -19,6 +19,7 @@ import classNames from "classnames"; import { Room } from "matrix-js-sdk/src/models/room"; import { sleep } from "matrix-js-sdk/src/utils"; import { EventType } from "matrix-js-sdk/src/@types/event"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from '../../../languageHandler'; import BaseDialog from "./BaseDialog"; @@ -41,8 +42,6 @@ import TruncatedList from "../elements/TruncatedList"; import EntityTile from "../rooms/EntityTile"; import BaseAvatar from "../avatars/BaseAvatar"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { space: Room; onCreateRoomClick(): void; diff --git a/src/components/views/dialogs/AddressPickerDialog.tsx b/src/components/views/dialogs/AddressPickerDialog.tsx index 9484859509..e5bb579d65 100644 --- a/src/components/views/dialogs/AddressPickerDialog.tsx +++ b/src/components/views/dialogs/AddressPickerDialog.tsx @@ -19,6 +19,7 @@ limitations under the License. import React, { createRef } from 'react'; import { sleep } from "matrix-js-sdk/src/utils"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t, _td } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; @@ -37,8 +38,6 @@ import AddressTile from '../elements/AddressTile'; import BaseDialog from "./BaseDialog"; import DialogButtons from "../elements/DialogButtons"; -import { logger } from "matrix-js-sdk/src/logger"; - const TRUNCATE_QUERY_LIST = 40; const QUERY_USER_DIRECTORY_DEBOUNCE_MS = 200; diff --git a/src/components/views/dialogs/AskInviteAnywayDialog.tsx b/src/components/views/dialogs/AskInviteAnywayDialog.tsx index 3ae82f1026..1815a43d57 100644 --- a/src/components/views/dialogs/AskInviteAnywayDialog.tsx +++ b/src/components/views/dialogs/AskInviteAnywayDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from '../../../languageHandler'; import SettingsStore from "../../../settings/SettingsStore"; import { SettingLevel } from "../../../settings/SettingLevel"; diff --git a/src/components/views/dialogs/BaseDialog.tsx b/src/components/views/dialogs/BaseDialog.tsx index 0af494f53e..15c9114ca2 100644 --- a/src/components/views/dialogs/BaseDialog.tsx +++ b/src/components/views/dialogs/BaseDialog.tsx @@ -19,6 +19,7 @@ limitations under the License. import React from 'react'; import FocusLock from 'react-focus-lock'; import classNames from 'classnames'; +import { MatrixClient } from "matrix-js-sdk/src/client"; import { Key } from '../../../Keyboard'; import AccessibleButton, { ButtonEvent } from '../elements/AccessibleButton'; @@ -26,7 +27,6 @@ import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from "../../../languageHandler"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { MatrixClient } from "matrix-js-sdk/src/client"; import { IDialogProps } from "./IDialogProps"; interface IProps extends IDialogProps { diff --git a/src/components/views/dialogs/BugReportDialog.tsx b/src/components/views/dialogs/BugReportDialog.tsx index 38566cdf04..3ba5b2e46e 100644 --- a/src/components/views/dialogs/BugReportDialog.tsx +++ b/src/components/views/dialogs/BugReportDialog.tsx @@ -18,6 +18,7 @@ limitations under the License. */ import React from 'react'; + import SdkConfig from '../../../SdkConfig'; import Modal from '../../../Modal'; import { _t } from '../../../languageHandler'; diff --git a/src/components/views/dialogs/ChangelogDialog.tsx b/src/components/views/dialogs/ChangelogDialog.tsx index de9e454401..f759f04300 100644 --- a/src/components/views/dialogs/ChangelogDialog.tsx +++ b/src/components/views/dialogs/ChangelogDialog.tsx @@ -17,6 +17,7 @@ Copyright 2019 Michael Telatynski <7t3chguy@gmail.com> import React from 'react'; import request from 'browser-request'; + import { _t } from '../../../languageHandler'; import QuestionDialog from "./QuestionDialog"; import Spinner from "../elements/Spinner"; diff --git a/src/components/views/dialogs/CommunityPrototypeInviteDialog.tsx b/src/components/views/dialogs/CommunityPrototypeInviteDialog.tsx index d5a54aaa23..90588178ce 100644 --- a/src/components/views/dialogs/CommunityPrototypeInviteDialog.tsx +++ b/src/components/views/dialogs/CommunityPrototypeInviteDialog.tsx @@ -15,6 +15,9 @@ limitations under the License. */ import React, { ChangeEvent, FormEvent } from 'react'; +import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { logger } from "matrix-js-sdk/src/logger"; + import BaseDialog from "./BaseDialog"; import { _t } from "../../../languageHandler"; import { IDialogProps } from "./IDialogProps"; @@ -23,7 +26,6 @@ import AccessibleButton from "../elements/AccessibleButton"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { arrayFastClone } from "../../../utils/arrays"; import SdkConfig from "../../../SdkConfig"; -import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import InviteDialog from "./InviteDialog"; import BaseAvatar from "../avatars/BaseAvatar"; import { inviteMultipleToRoom, showAnyInviteErrors } from "../../../RoomInvite"; @@ -33,8 +35,6 @@ import ErrorDialog from "./ErrorDialog"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { mediaFromMxc } from "../../../customisations/Media"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps extends IDialogProps { roomId: string; communityName: string; diff --git a/src/components/views/dialogs/ConfirmAndWaitRedactDialog.tsx b/src/components/views/dialogs/ConfirmAndWaitRedactDialog.tsx index d21fde329c..fbf603c44d 100644 --- a/src/components/views/dialogs/ConfirmAndWaitRedactDialog.tsx +++ b/src/components/views/dialogs/ConfirmAndWaitRedactDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import ConfirmRedactDialog from './ConfirmRedactDialog'; diff --git a/src/components/views/dialogs/ConfirmRedactDialog.tsx b/src/components/views/dialogs/ConfirmRedactDialog.tsx index 74b3320fdf..6839c0f7bd 100644 --- a/src/components/views/dialogs/ConfirmRedactDialog.tsx +++ b/src/components/views/dialogs/ConfirmRedactDialog.tsx @@ -16,6 +16,7 @@ limitations under the License. import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; import React from 'react'; + import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import Modal from '../../../Modal'; diff --git a/src/components/views/dialogs/ConfirmSpaceUserActionDialog.tsx b/src/components/views/dialogs/ConfirmSpaceUserActionDialog.tsx index 1c5dd3fafa..3d340909df 100644 --- a/src/components/views/dialogs/ConfirmSpaceUserActionDialog.tsx +++ b/src/components/views/dialogs/ConfirmSpaceUserActionDialog.tsx @@ -15,10 +15,10 @@ limitations under the License. */ import React, { ComponentProps, useMemo, useState } from 'react'; +import { Room } from "matrix-js-sdk/src/models/room"; import ConfirmUserActionDialog from "./ConfirmUserActionDialog"; import SpaceStore from "../../../stores/SpaceStore"; -import { Room } from "matrix-js-sdk/src/models/room"; import SpaceChildrenPicker from "../spaces/SpaceChildrenPicker"; type BaseProps = ComponentProps; diff --git a/src/components/views/dialogs/ConfirmWipeDeviceDialog.tsx b/src/components/views/dialogs/ConfirmWipeDeviceDialog.tsx index 2577d5456d..33e26ff7a7 100644 --- a/src/components/views/dialogs/ConfirmWipeDeviceDialog.tsx +++ b/src/components/views/dialogs/ConfirmWipeDeviceDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from "../../../languageHandler"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import BaseDialog from "./BaseDialog"; diff --git a/src/components/views/dialogs/CreateCommunityPrototypeDialog.tsx b/src/components/views/dialogs/CreateCommunityPrototypeDialog.tsx index ed48778b1d..4f19294136 100644 --- a/src/components/views/dialogs/CreateCommunityPrototypeDialog.tsx +++ b/src/components/views/dialogs/CreateCommunityPrototypeDialog.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React, { ChangeEvent } from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import BaseDialog from "./BaseDialog"; import { _t } from "../../../languageHandler"; import { IDialogProps } from "./IDialogProps"; @@ -27,8 +29,6 @@ import { showCommunityRoomInviteDialog } from "../../../RoomInvite"; import GroupStore from "../../../stores/GroupStore"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps extends IDialogProps { } diff --git a/src/components/views/dialogs/CreateGroupDialog.tsx b/src/components/views/dialogs/CreateGroupDialog.tsx index b1ea75d367..6b1dd7cf54 100644 --- a/src/components/views/dialogs/CreateGroupDialog.tsx +++ b/src/components/views/dialogs/CreateGroupDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import dis from '../../../dispatcher/dispatcher'; import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; diff --git a/src/components/views/dialogs/CreateSpaceFromCommunityDialog.tsx b/src/components/views/dialogs/CreateSpaceFromCommunityDialog.tsx index b19c8d6496..3cdc00777a 100644 --- a/src/components/views/dialogs/CreateSpaceFromCommunityDialog.tsx +++ b/src/components/views/dialogs/CreateSpaceFromCommunityDialog.tsx @@ -18,6 +18,7 @@ import React, { useEffect, useRef, useState } from "react"; import { JoinRule } from "matrix-js-sdk/src/@types/partials"; import { EventType } from "matrix-js-sdk/src/@types/event"; import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from '../../../languageHandler'; import BaseDialog from "./BaseDialog"; @@ -42,8 +43,6 @@ import TagOrderActions from "../../../actions/TagOrderActions"; import { inviteUsersToRoom } from "../../../RoomInvite"; import ProgressBar from "../elements/ProgressBar"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { matrixClient: MatrixClient; groupId: string; diff --git a/src/components/views/dialogs/CreateSubspaceDialog.tsx b/src/components/views/dialogs/CreateSubspaceDialog.tsx index 44ffd2afdd..ceebe86da8 100644 --- a/src/components/views/dialogs/CreateSubspaceDialog.tsx +++ b/src/components/views/dialogs/CreateSubspaceDialog.tsx @@ -17,6 +17,7 @@ limitations under the License. import React, { useRef, useState } from "react"; import { Room } from "matrix-js-sdk/src/models/room"; import { JoinRule } from "matrix-js-sdk/src/@types/partials"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from '../../../languageHandler'; import BaseDialog from "./BaseDialog"; @@ -30,8 +31,6 @@ import { createSpace, SpaceCreateForm } from "../spaces/SpaceCreateMenu"; import { SubspaceSelector } from "./AddExistingToSpaceDialog"; import JoinRuleDropdown from "../elements/JoinRuleDropdown"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { space: Room; onAddExistingSpaceClick(): void; diff --git a/src/components/views/dialogs/CryptoStoreTooNewDialog.tsx b/src/components/views/dialogs/CryptoStoreTooNewDialog.tsx index 3bb78233ea..e8d267414a 100644 --- a/src/components/views/dialogs/CryptoStoreTooNewDialog.tsx +++ b/src/components/views/dialogs/CryptoStoreTooNewDialog.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; + import dis from '../../../dispatcher/dispatcher'; import { _t } from '../../../languageHandler'; import SdkConfig from '../../../SdkConfig'; diff --git a/src/components/views/dialogs/DeactivateAccountDialog.tsx b/src/components/views/dialogs/DeactivateAccountDialog.tsx index 35556aacd9..d564639e9f 100644 --- a/src/components/views/dialogs/DeactivateAccountDialog.tsx +++ b/src/components/views/dialogs/DeactivateAccountDialog.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import { AuthType, IAuthData } from 'matrix-js-sdk/src/interactive-auth'; +import { logger } from "matrix-js-sdk/src/logger"; import Analytics from '../../../Analytics'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; @@ -28,8 +29,6 @@ import StyledCheckbox from "../elements/StyledCheckbox"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import BaseDialog from "./BaseDialog"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { onFinished: (success: boolean) => void; } diff --git a/src/components/views/dialogs/DevtoolsDialog.tsx b/src/components/views/dialogs/DevtoolsDialog.tsx index 377911d095..120b9c7ea5 100644 --- a/src/components/views/dialogs/DevtoolsDialog.tsx +++ b/src/components/views/dialogs/DevtoolsDialog.tsx @@ -16,12 +16,6 @@ limitations under the License. */ import React, { useState, useEffect, ChangeEvent, MouseEvent } from 'react'; -import SyntaxHighlight from '../elements/SyntaxHighlight'; -import { _t } from '../../../languageHandler'; -import Field from "../elements/Field"; -import MatrixClientContext from "../../../contexts/MatrixClientContext"; -import { useEventEmitter } from "../../../hooks/useEventEmitter"; - import { PHASE_UNSENT, PHASE_REQUESTED, @@ -31,6 +25,15 @@ import { PHASE_CANCELLED, VerificationRequest, } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { logger } from "matrix-js-sdk/src/logger"; + +import SyntaxHighlight from '../elements/SyntaxHighlight'; +import { _t } from '../../../languageHandler'; +import Field from "../elements/Field"; +import MatrixClientContext from "../../../contexts/MatrixClientContext"; +import { useEventEmitter } from "../../../hooks/useEventEmitter"; import WidgetStore, { IApp } from "../../../stores/WidgetStore"; import { UPDATE_EVENT } from "../../../stores/AsyncStore"; import { SETTINGS } from "../../../settings/Settings"; @@ -38,14 +41,10 @@ import SettingsStore, { LEVEL_ORDER } from "../../../settings/SettingsStore"; import Modal from "../../../Modal"; import ErrorDialog from "./ErrorDialog"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { Room } from "matrix-js-sdk/src/models/room"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { SettingLevel } from '../../../settings/SettingLevel'; import BaseDialog from "./BaseDialog"; import TruncatedList from "../elements/TruncatedList"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IGenericEditorProps { onBack: () => void; } diff --git a/src/components/views/dialogs/EditCommunityPrototypeDialog.tsx b/src/components/views/dialogs/EditCommunityPrototypeDialog.tsx index 7463c82cfb..6f13de78ee 100644 --- a/src/components/views/dialogs/EditCommunityPrototypeDialog.tsx +++ b/src/components/views/dialogs/EditCommunityPrototypeDialog.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React, { ChangeEvent } from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import BaseDialog from "./BaseDialog"; import { _t } from "../../../languageHandler"; import { IDialogProps } from "./IDialogProps"; @@ -26,8 +28,6 @@ import FlairStore from "../../../stores/FlairStore"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { mediaFromMxc } from "../../../customisations/Media"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps extends IDialogProps { communityId: string; } diff --git a/src/components/views/dialogs/ErrorDialog.tsx b/src/components/views/dialogs/ErrorDialog.tsx index 56cd76237f..e19d93f918 100644 --- a/src/components/views/dialogs/ErrorDialog.tsx +++ b/src/components/views/dialogs/ErrorDialog.tsx @@ -26,6 +26,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import BaseDialog from "./BaseDialog"; diff --git a/src/components/views/dialogs/ExportDialog.tsx b/src/components/views/dialogs/ExportDialog.tsx index 246f74bb58..e3d2b437cf 100644 --- a/src/components/views/dialogs/ExportDialog.tsx +++ b/src/components/views/dialogs/ExportDialog.tsx @@ -16,6 +16,8 @@ limitations under the License. import React, { useRef, useState } from "react"; import { Room } from "matrix-js-sdk/src"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../languageHandler"; import { IDialogProps } from "./IDialogProps"; import BaseDialog from "./BaseDialog"; @@ -38,8 +40,6 @@ import Exporter from "../../../utils/exportUtils/Exporter"; import Spinner from "../elements/Spinner"; import InfoDialog from "./InfoDialog"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps extends IDialogProps { room: Room; } diff --git a/src/components/views/dialogs/FeedbackDialog.tsx b/src/components/views/dialogs/FeedbackDialog.tsx index e7089283e4..5e7ea1f66c 100644 --- a/src/components/views/dialogs/FeedbackDialog.tsx +++ b/src/components/views/dialogs/FeedbackDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { useState } from 'react'; + import QuestionDialog from './QuestionDialog'; import { _t } from '../../../languageHandler'; import Field from "../elements/Field"; diff --git a/src/components/views/dialogs/HostSignupDialog.tsx b/src/components/views/dialogs/HostSignupDialog.tsx index 1228495747..bce358cf46 100644 --- a/src/components/views/dialogs/HostSignupDialog.tsx +++ b/src/components/views/dialogs/HostSignupDialog.tsx @@ -15,12 +15,14 @@ limitations under the License. */ import React from "react"; +import classNames from "classnames"; +import { logger } from "matrix-js-sdk/src/logger"; + import AccessibleButton from "../elements/AccessibleButton"; import Modal from "../../../Modal"; import PersistedElement from "../elements/PersistedElement"; import QuestionDialog from './QuestionDialog'; import SdkConfig from "../../../SdkConfig"; -import classNames from "classnames"; import { _t } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { HostSignupStore } from "../../../stores/HostSignupStore"; @@ -33,8 +35,6 @@ import { } from "./HostSignupDialogTypes"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - const HOST_SIGNUP_KEY = "host_signup"; interface IProps {} diff --git a/src/components/views/dialogs/IncomingSasDialog.tsx b/src/components/views/dialogs/IncomingSasDialog.tsx index da766f495c..f57ebc9476 100644 --- a/src/components/views/dialogs/IncomingSasDialog.tsx +++ b/src/components/views/dialogs/IncomingSasDialog.tsx @@ -15,6 +15,10 @@ limitations under the License. */ import React from 'react'; +import { IGeneratedSas, ISasEvent } from "matrix-js-sdk/src/crypto/verification/SAS"; +import { VerificationBase } from "matrix-js-sdk/src/crypto/verification/Base"; +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; @@ -27,10 +31,6 @@ import VerificationShowSas from "../verification/VerificationShowSas"; import BaseDialog from "./BaseDialog"; import DialogButtons from "../elements/DialogButtons"; import { IDialogProps } from "./IDialogProps"; -import { IGeneratedSas, ISasEvent } from "matrix-js-sdk/src/crypto/verification/SAS"; -import { VerificationBase } from "matrix-js-sdk/src/crypto/verification/Base"; - -import { logger } from "matrix-js-sdk/src/logger"; const PHASE_START = 0; const PHASE_SHOW_SAS = 1; diff --git a/src/components/views/dialogs/IntegrationsDisabledDialog.tsx b/src/components/views/dialogs/IntegrationsDisabledDialog.tsx index 7da4bb84b9..d5c08211da 100644 --- a/src/components/views/dialogs/IntegrationsDisabledDialog.tsx +++ b/src/components/views/dialogs/IntegrationsDisabledDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from "../../../languageHandler"; import dis from '../../../dispatcher/dispatcher'; import { Action } from "../../../dispatcher/actions"; diff --git a/src/components/views/dialogs/IntegrationsImpossibleDialog.tsx b/src/components/views/dialogs/IntegrationsImpossibleDialog.tsx index 52e3a2fbb8..53c58bba88 100644 --- a/src/components/views/dialogs/IntegrationsImpossibleDialog.tsx +++ b/src/components/views/dialogs/IntegrationsImpossibleDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from "../../../languageHandler"; import SdkConfig from "../../../SdkConfig"; import * as sdk from "../../../index"; diff --git a/src/components/views/dialogs/InteractiveAuthDialog.tsx b/src/components/views/dialogs/InteractiveAuthDialog.tsx index 2ea97f91c3..c6a7d414bf 100644 --- a/src/components/views/dialogs/InteractiveAuthDialog.tsx +++ b/src/components/views/dialogs/InteractiveAuthDialog.tsx @@ -17,16 +17,15 @@ limitations under the License. */ import React from 'react'; +import { MatrixClient } from "matrix-js-sdk/src/client"; +import { IAuthData } from "matrix-js-sdk/src/interactive-auth"; import { _t } from '../../../languageHandler'; - import AccessibleButton from '../elements/AccessibleButton'; import InteractiveAuth, { ERROR_USER_CANCELLED } from "../../structures/InteractiveAuth"; import { SSOAuthEntry } from "../auth/InteractiveAuthEntryComponents"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { MatrixClient } from "matrix-js-sdk/src/client"; import BaseDialog from "./BaseDialog"; -import { IAuthData } from "matrix-js-sdk/src/interactive-auth"; import { IDialogProps } from "./IDialogProps"; interface IDialogAesthetics { diff --git a/src/components/views/dialogs/InviteDialog.tsx b/src/components/views/dialogs/InviteDialog.tsx index fe3968673c..6a7c097032 100644 --- a/src/components/views/dialogs/InviteDialog.tsx +++ b/src/components/views/dialogs/InviteDialog.tsx @@ -16,12 +16,16 @@ limitations under the License. import React, { createRef } from 'react'; import classNames from 'classnames'; +import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; +import { IInvite3PID } from "matrix-js-sdk/src/@types/requests"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t, _td } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { makeRoomPermalink, makeUserPermalink } from "../../../utils/permalinks/Permalinks"; import DMRoomMap from "../../../utils/DMRoomMap"; -import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import SdkConfig from "../../../SdkConfig"; import * as Email from "../../../email"; import { getDefaultIdentityServerUrl, useDefaultIdentityServer } from "../../../utils/IdentityServerUtils"; @@ -49,17 +53,13 @@ import { CommunityPrototypeStore } from "../../../stores/CommunityPrototypeStore import SettingsStore from "../../../settings/SettingsStore"; import { UIFeature } from "../../../settings/UIFeature"; import CountlyAnalytics from "../../../CountlyAnalytics"; -import { Room } from "matrix-js-sdk/src/models/room"; -import { MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { mediaFromMxc } from "../../../customisations/Media"; import { getAddressType } from "../../../UserAddress"; import BaseAvatar from '../avatars/BaseAvatar'; import AccessibleButton, { ButtonEvent } from '../elements/AccessibleButton'; -import { compare } from '../../../utils/strings'; -import { IInvite3PID } from "matrix-js-sdk/src/@types/requests"; +import { compare, copyPlaintext, selectText } from '../../../utils/strings'; import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; -import { copyPlaintext, selectText } from "../../../utils/strings"; import * as ContextMenu from "../../structures/ContextMenu"; import { toRightOf } from "../../structures/ContextMenu"; import GenericTextContextMenu from "../context_menus/GenericTextContextMenu"; @@ -73,8 +73,6 @@ import BaseDialog from "./BaseDialog"; import DialPadBackspaceButton from "../elements/DialPadBackspaceButton"; import SpaceStore from "../../../stores/SpaceStore"; -import { logger } from "matrix-js-sdk/src/logger"; - // we have a number of types defined from the Matrix spec which can't reasonably be altered here. /* eslint-disable camelcase */ diff --git a/src/components/views/dialogs/KeySignatureUploadFailedDialog.tsx b/src/components/views/dialogs/KeySignatureUploadFailedDialog.tsx index 28e4d1ca80..381c96dc66 100644 --- a/src/components/views/dialogs/KeySignatureUploadFailedDialog.tsx +++ b/src/components/views/dialogs/KeySignatureUploadFailedDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { useState, useCallback, useRef } from 'react'; + import { _t } from '../../../languageHandler'; import SdkConfig from '../../../SdkConfig'; import BaseDialog from "./BaseDialog"; diff --git a/src/components/views/dialogs/LazyLoadingDisabledDialog.tsx b/src/components/views/dialogs/LazyLoadingDisabledDialog.tsx index ec30123436..0efad31cd2 100644 --- a/src/components/views/dialogs/LazyLoadingDisabledDialog.tsx +++ b/src/components/views/dialogs/LazyLoadingDisabledDialog.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; + import QuestionDialog from './QuestionDialog'; import { _t } from '../../../languageHandler'; import SdkConfig from '../../../SdkConfig'; diff --git a/src/components/views/dialogs/LazyLoadingResyncDialog.tsx b/src/components/views/dialogs/LazyLoadingResyncDialog.tsx index e6a505511c..b4e99ada32 100644 --- a/src/components/views/dialogs/LazyLoadingResyncDialog.tsx +++ b/src/components/views/dialogs/LazyLoadingResyncDialog.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; + import QuestionDialog from './QuestionDialog'; import { _t } from '../../../languageHandler'; import SdkConfig from '../../../SdkConfig'; diff --git a/src/components/views/dialogs/LogoutDialog.tsx b/src/components/views/dialogs/LogoutDialog.tsx index 5ac3141269..af70d51488 100644 --- a/src/components/views/dialogs/LogoutDialog.tsx +++ b/src/components/views/dialogs/LogoutDialog.tsx @@ -17,6 +17,8 @@ limitations under the License. import React from 'react'; import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup"; +import { logger } from "matrix-js-sdk/src/logger"; + import Modal from '../../../Modal'; import * as sdk from '../../../index'; import dis from '../../../dispatcher/dispatcher'; @@ -25,8 +27,6 @@ import { MatrixClientPeg } from '../../../MatrixClientPeg'; import RestoreKeyBackupDialog from './security/RestoreKeyBackupDialog'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { onFinished: (success: boolean) => void; } diff --git a/src/components/views/dialogs/ManualDeviceKeyVerificationDialog.tsx b/src/components/views/dialogs/ManualDeviceKeyVerificationDialog.tsx index 88419d26b8..6b94eb9c7a 100644 --- a/src/components/views/dialogs/ManualDeviceKeyVerificationDialog.tsx +++ b/src/components/views/dialogs/ManualDeviceKeyVerificationDialog.tsx @@ -19,12 +19,13 @@ limitations under the License. */ import React from 'react'; +import { DeviceInfo } from "matrix-js-sdk/src/crypto/deviceinfo"; + import { MatrixClientPeg } from '../../../MatrixClientPeg'; import * as FormattingUtils from '../../../utils/FormattingUtils'; import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import QuestionDialog from "./QuestionDialog"; -import { DeviceInfo } from "matrix-js-sdk/src/crypto/deviceinfo"; import { IDialogProps } from "./IDialogProps"; interface IProps extends IDialogProps { diff --git a/src/components/views/dialogs/MessageEditHistoryDialog.tsx b/src/components/views/dialogs/MessageEditHistoryDialog.tsx index f5a990e409..a7fb36fc05 100644 --- a/src/components/views/dialogs/MessageEditHistoryDialog.tsx +++ b/src/components/views/dialogs/MessageEditHistoryDialog.tsx @@ -15,22 +15,22 @@ limitations under the License. */ import React from 'react'; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { EventType, RelationType } from "matrix-js-sdk/src/@types/event"; +import { defer } from "matrix-js-sdk/src/utils"; +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { _t } from '../../../languageHandler'; import { wantsDateSeparator } from '../../../DateUtils'; import SettingsStore from '../../../settings/SettingsStore'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import BaseDialog from "./BaseDialog"; import ScrollPanel from "../../structures/ScrollPanel"; import Spinner from "../elements/Spinner"; import EditHistoryMessage from "../messages/EditHistoryMessage"; import DateSeparator from "../messages/DateSeparator"; import { IDialogProps } from "./IDialogProps"; -import { EventType, RelationType } from "matrix-js-sdk/src/@types/event"; -import { defer } from "matrix-js-sdk/src/utils"; - -import { logger } from "matrix-js-sdk/src/logger"; interface IProps extends IDialogProps { mxEvent: MatrixEvent; diff --git a/src/components/views/dialogs/ModalWidgetDialog.tsx b/src/components/views/dialogs/ModalWidgetDialog.tsx index 1bf7eb7307..1b44753478 100644 --- a/src/components/views/dialogs/ModalWidgetDialog.tsx +++ b/src/components/views/dialogs/ModalWidgetDialog.tsx @@ -15,9 +15,6 @@ limitations under the License. */ import * as React from 'react'; -import BaseDialog from './BaseDialog'; -import { _t, getUserLanguage } from '../../../languageHandler'; -import AccessibleButton from "../elements/AccessibleButton"; import { ClientWidgetApi, IModalWidgetCloseRequest, @@ -33,6 +30,10 @@ import { WidgetApiFromWidgetAction, WidgetKind, } from "matrix-widget-api"; + +import BaseDialog from './BaseDialog'; +import { _t, getUserLanguage } from '../../../languageHandler'; +import AccessibleButton from "../elements/AccessibleButton"; import { StopGapWidgetDriver } from "../../../stores/widgets/StopGapWidgetDriver"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { OwnProfileStore } from "../../../stores/OwnProfileStore"; diff --git a/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx b/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx index 804a1aec35..ac83134f22 100644 --- a/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx +++ b/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx @@ -15,10 +15,10 @@ limitations under the License. */ import * as React from "react"; +import { useRef, useState } from "react"; import { _t } from '../../../languageHandler'; import { IDialogProps } from "./IDialogProps"; -import { useRef, useState } from "react"; import Field from "../elements/Field"; import CountlyAnalytics from "../../../CountlyAnalytics"; import withValidation from "../elements/Validation"; diff --git a/src/components/views/dialogs/ReportEventDialog.tsx b/src/components/views/dialogs/ReportEventDialog.tsx index 25675ee7d2..29745bf7cd 100644 --- a/src/components/views/dialogs/ReportEventDialog.tsx +++ b/src/components/views/dialogs/ReportEventDialog.tsx @@ -15,10 +15,11 @@ limitations under the License. */ import React from 'react'; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { _t } from '../../../languageHandler'; import { ensureDMExists } from "../../../createRoom"; import { IDialogProps } from "./IDialogProps"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import SdkConfig from '../../../SdkConfig'; import Markdown from '../../../Markdown'; diff --git a/src/components/views/dialogs/RoomSettingsDialog.tsx b/src/components/views/dialogs/RoomSettingsDialog.tsx index b0c6fc4050..41832b95a3 100644 --- a/src/components/views/dialogs/RoomSettingsDialog.tsx +++ b/src/components/views/dialogs/RoomSettingsDialog.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; + import TabbedView, { Tab } from "../../structures/TabbedView"; import { _t, _td } from "../../../languageHandler"; import AdvancedRoomSettingsTab from "../settings/tabs/room/AdvancedRoomSettingsTab"; diff --git a/src/components/views/dialogs/ServerOfflineDialog.tsx b/src/components/views/dialogs/ServerOfflineDialog.tsx index ff24a1bad8..6cf07f6bd6 100644 --- a/src/components/views/dialogs/ServerOfflineDialog.tsx +++ b/src/components/views/dialogs/ServerOfflineDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import * as React from 'react'; + import BaseDialog from './BaseDialog'; import { _t } from '../../../languageHandler'; import { EchoStore } from "../../../stores/local-echo/EchoStore"; diff --git a/src/components/views/dialogs/ServerPickerDialog.tsx b/src/components/views/dialogs/ServerPickerDialog.tsx index 4c355c6c0e..f06a4ca82a 100644 --- a/src/components/views/dialogs/ServerPickerDialog.tsx +++ b/src/components/views/dialogs/ServerPickerDialog.tsx @@ -16,6 +16,7 @@ limitations under the License. import React, { createRef } from "react"; import { AutoDiscovery } from "matrix-js-sdk/src/autodiscovery"; +import { logger } from "matrix-js-sdk/src/logger"; import AutoDiscoveryUtils, { ValidatedServerConfig } from "../../../utils/AutoDiscoveryUtils"; import BaseDialog from './BaseDialog'; @@ -28,8 +29,6 @@ import TextWithTooltip from "../elements/TextWithTooltip"; import withValidation, { IFieldState } from "../elements/Validation"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { title?: string; serverConfig: ValidatedServerConfig; diff --git a/src/components/views/dialogs/SeshatResetDialog.tsx b/src/components/views/dialogs/SeshatResetDialog.tsx index b89002c30f..1c048dd9fa 100644 --- a/src/components/views/dialogs/SeshatResetDialog.tsx +++ b/src/components/views/dialogs/SeshatResetDialog.tsx @@ -15,12 +15,11 @@ limitations under the License. */ import React from 'react'; + import { _t } from "../../../languageHandler"; import { replaceableComponent } from "../../../utils/replaceableComponent"; - import BaseDialog from "./BaseDialog"; import DialogButtons from "../elements/DialogButtons"; - import { IDialogProps } from "./IDialogProps"; @replaceableComponent("views.dialogs.SeshatResetDialog") diff --git a/src/components/views/dialogs/SessionRestoreErrorDialog.tsx b/src/components/views/dialogs/SessionRestoreErrorDialog.tsx index b36dbf548e..56cd75bfb4 100644 --- a/src/components/views/dialogs/SessionRestoreErrorDialog.tsx +++ b/src/components/views/dialogs/SessionRestoreErrorDialog.tsx @@ -17,6 +17,7 @@ limitations under the License. */ import React from 'react'; + import SdkConfig from '../../../SdkConfig'; import Modal from '../../../Modal'; import { _t } from '../../../languageHandler'; diff --git a/src/components/views/dialogs/SetEmailDialog.tsx b/src/components/views/dialogs/SetEmailDialog.tsx index fda1e200cb..6e5f0cf050 100644 --- a/src/components/views/dialogs/SetEmailDialog.tsx +++ b/src/components/views/dialogs/SetEmailDialog.tsx @@ -16,6 +16,8 @@ limitations under the License. */ import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import * as Email from '../../../email'; import AddThreepid from '../../../AddThreepid'; import { _t } from '../../../languageHandler'; @@ -28,8 +30,6 @@ import BaseDialog from "./BaseDialog"; import EditableText from "../elements/EditableText"; import { IDialogProps } from "./IDialogProps"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps extends IDialogProps { title: string; } diff --git a/src/components/views/dialogs/ShareDialog.tsx b/src/components/views/dialogs/ShareDialog.tsx index 80c0543c4e..d4db217309 100644 --- a/src/components/views/dialogs/ShareDialog.tsx +++ b/src/components/views/dialogs/ShareDialog.tsx @@ -22,6 +22,7 @@ import { User } from "matrix-js-sdk/src/models/user"; import { Group } from "matrix-js-sdk/src/models/group"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { _t } from '../../../languageHandler'; import QRCode from "../elements/QRCode"; import { RoomPermalinkCreator, makeGroupPermalink, makeUserPermalink } from "../../../utils/permalinks/Permalinks"; diff --git a/src/components/views/dialogs/SlashCommandHelpDialog.tsx b/src/components/views/dialogs/SlashCommandHelpDialog.tsx index ccb157f025..166bd27332 100644 --- a/src/components/views/dialogs/SlashCommandHelpDialog.tsx +++ b/src/components/views/dialogs/SlashCommandHelpDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from "../../../languageHandler"; import { CommandCategories, Commands } from "../../../SlashCommands"; import { IDialogProps } from "./IDialogProps"; diff --git a/src/components/views/dialogs/StorageEvictedDialog.tsx b/src/components/views/dialogs/StorageEvictedDialog.tsx index bdbbf815e6..8a41224d57 100644 --- a/src/components/views/dialogs/StorageEvictedDialog.tsx +++ b/src/components/views/dialogs/StorageEvictedDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import SdkConfig from '../../../SdkConfig'; import Modal from '../../../Modal'; import { _t } from '../../../languageHandler'; diff --git a/src/components/views/dialogs/TabbedIntegrationManagerDialog.tsx b/src/components/views/dialogs/TabbedIntegrationManagerDialog.tsx index dab1a1f222..7ab425a5f6 100644 --- a/src/components/views/dialogs/TabbedIntegrationManagerDialog.tsx +++ b/src/components/views/dialogs/TabbedIntegrationManagerDialog.tsx @@ -15,10 +15,12 @@ limitations under the License. */ import React from 'react'; -import { IntegrationManagers } from "../../../integrations/IntegrationManagers"; import { Room } from "matrix-js-sdk/src/models/room"; -import { dialogTermsInteractionCallback, TermsNotSignedError } from "../../../Terms"; import classNames from 'classnames'; +import { logger } from "matrix-js-sdk/src/logger"; + +import { IntegrationManagers } from "../../../integrations/IntegrationManagers"; +import { dialogTermsInteractionCallback, TermsNotSignedError } from "../../../Terms"; import * as ScalarMessaging from "../../../ScalarMessaging"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { IntegrationManagerInstance } from "../../../integrations/IntegrationManagerInstance"; @@ -27,8 +29,6 @@ import AccessibleButton from "../elements/AccessibleButton"; import IntegrationManager from "../settings/IntegrationManager"; import { IDialogProps } from "./IDialogProps"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps extends IDialogProps { /** * Optional room where the integration manager should be open to diff --git a/src/components/views/dialogs/TermsDialog.tsx b/src/components/views/dialogs/TermsDialog.tsx index 6aba597aad..f2f713a75f 100644 --- a/src/components/views/dialogs/TermsDialog.tsx +++ b/src/components/views/dialogs/TermsDialog.tsx @@ -16,10 +16,10 @@ limitations under the License. import url from 'url'; import React from 'react'; -import { _t, pickBestLanguage } from '../../../languageHandler'; - -import { replaceableComponent } from "../../../utils/replaceableComponent"; import { SERVICE_TYPES } from "matrix-js-sdk/src/service-types"; + +import { _t, pickBestLanguage } from '../../../languageHandler'; +import { replaceableComponent } from "../../../utils/replaceableComponent"; import DialogButtons from "../elements/DialogButtons"; import BaseDialog from "./BaseDialog"; diff --git a/src/components/views/dialogs/TextInputDialog.tsx b/src/components/views/dialogs/TextInputDialog.tsx index 7a5887f053..2667c131b9 100644 --- a/src/components/views/dialogs/TextInputDialog.tsx +++ b/src/components/views/dialogs/TextInputDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { ChangeEvent, createRef } from 'react'; + import Field from "../elements/Field"; import { _t, _td } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/dialogs/UploadConfirmDialog.tsx b/src/components/views/dialogs/UploadConfirmDialog.tsx index 508bb95e43..fef55766c7 100644 --- a/src/components/views/dialogs/UploadConfirmDialog.tsx +++ b/src/components/views/dialogs/UploadConfirmDialog.tsx @@ -16,8 +16,9 @@ limitations under the License. */ import React from 'react'; -import { _t } from '../../../languageHandler'; import filesize from "filesize"; + +import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { getBlobSafeMimeType } from '../../../utils/blobs'; import BaseDialog from "./BaseDialog"; diff --git a/src/components/views/dialogs/UploadFailureDialog.tsx b/src/components/views/dialogs/UploadFailureDialog.tsx index bb8d14e161..8226a82170 100644 --- a/src/components/views/dialogs/UploadFailureDialog.tsx +++ b/src/components/views/dialogs/UploadFailureDialog.tsx @@ -15,8 +15,8 @@ limitations under the License. */ import filesize from 'filesize'; - import React from 'react'; + import { _t } from '../../../languageHandler'; import ContentMessages from '../../../ContentMessages'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/dialogs/UserSettingsDialog.tsx b/src/components/views/dialogs/UserSettingsDialog.tsx index a848bf2773..6853581e5c 100644 --- a/src/components/views/dialogs/UserSettingsDialog.tsx +++ b/src/components/views/dialogs/UserSettingsDialog.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; + import TabbedView, { Tab } from "../../structures/TabbedView"; import { _t, _td } from "../../../languageHandler"; import GeneralUserSettingsTab from "../settings/tabs/user/GeneralUserSettingsTab"; diff --git a/src/components/views/dialogs/VerificationRequestDialog.tsx b/src/components/views/dialogs/VerificationRequestDialog.tsx index 65b7f71dbd..5387a675c1 100644 --- a/src/components/views/dialogs/VerificationRequestDialog.tsx +++ b/src/components/views/dialogs/VerificationRequestDialog.tsx @@ -15,13 +15,14 @@ limitations under the License. */ import React from 'react'; +import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { User } from 'matrix-js-sdk/src/models/user'; + import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; import BaseDialog from "./BaseDialog"; import EncryptionPanel from "../right_panel/EncryptionPanel"; -import { User } from 'matrix-js-sdk/src/models/user'; interface IProps { verificationRequest: VerificationRequest; diff --git a/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx b/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx index 366adb887c..b794592b2f 100644 --- a/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx +++ b/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx @@ -15,9 +15,6 @@ limitations under the License. */ import React from 'react'; -import BaseDialog from "./BaseDialog"; -import { _t } from "../../../languageHandler"; -import { IDialogProps } from "./IDialogProps"; import { Capability, isTimelineCapability, @@ -25,13 +22,17 @@ import { WidgetEventCapability, WidgetKind, } from "matrix-widget-api"; +import { lexicographicCompare } from "matrix-js-sdk/src/utils"; + +import BaseDialog from "./BaseDialog"; +import { _t } from "../../../languageHandler"; +import { IDialogProps } from "./IDialogProps"; import { objectShallowClone } from "../../../utils/objects"; import StyledCheckbox from "../elements/StyledCheckbox"; import DialogButtons from "../elements/DialogButtons"; import LabelledToggleSwitch from "../elements/LabelledToggleSwitch"; import { CapabilityText } from "../../../widgets/CapabilityText"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { lexicographicCompare } from "matrix-js-sdk/src/utils"; interface IProps extends IDialogProps { requestedCapabilities: Set; diff --git a/src/components/views/dialogs/WidgetOpenIDPermissionsDialog.tsx b/src/components/views/dialogs/WidgetOpenIDPermissionsDialog.tsx index 81861c7f4d..4faf4e5237 100644 --- a/src/components/views/dialogs/WidgetOpenIDPermissionsDialog.tsx +++ b/src/components/views/dialogs/WidgetOpenIDPermissionsDialog.tsx @@ -16,17 +16,17 @@ limitations under the License. */ import React from 'react'; +import { Widget, WidgetKind } from "matrix-widget-api"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../languageHandler"; import LabelledToggleSwitch from "../elements/LabelledToggleSwitch"; -import { Widget, WidgetKind } from "matrix-widget-api"; import { OIDCState, WidgetPermissionStore } from "../../../stores/widgets/WidgetPermissionStore"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { IDialogProps } from "./IDialogProps"; import BaseDialog from "./BaseDialog"; import DialogButtons from "../elements/DialogButtons"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps extends IDialogProps { widget: Widget; widgetKind: WidgetKind; diff --git a/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx b/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx index 13603bb3c1..a9fea93fd0 100644 --- a/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx +++ b/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx @@ -18,6 +18,7 @@ import { debounce } from "lodash"; import classNames from 'classnames'; import React, { ChangeEvent, FormEvent } from 'react'; import { ISecretStorageKeyInfo } from "matrix-js-sdk/src/crypto/api"; +import { logger } from "matrix-js-sdk/src/logger"; import * as sdk from '../../../../index'; import { MatrixClientPeg } from '../../../../MatrixClientPeg'; @@ -28,8 +29,6 @@ import { IDialogProps } from "../IDialogProps"; import { accessSecretStorage } from "../../../../SecurityManager"; import Modal from "../../../../Modal"; -import { logger } from "matrix-js-sdk/src/logger"; - // Maximum acceptable size of a key file. It's 59 characters including the spaces we encode, // so this should be plenty and allow for people putting extra whitespace in the file because // maybe that's a thing people would do? diff --git a/src/components/views/dialogs/security/ConfirmDestroyCrossSigningDialog.tsx b/src/components/views/dialogs/security/ConfirmDestroyCrossSigningDialog.tsx index 392598ca36..3496d00fea 100644 --- a/src/components/views/dialogs/security/ConfirmDestroyCrossSigningDialog.tsx +++ b/src/components/views/dialogs/security/ConfirmDestroyCrossSigningDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from "../../../../languageHandler"; import { replaceableComponent } from "../../../../utils/replaceableComponent"; import BaseDialog from "../BaseDialog"; diff --git a/src/components/views/dialogs/security/CreateCrossSigningDialog.tsx b/src/components/views/dialogs/security/CreateCrossSigningDialog.tsx index 1c2857114d..f60f8a9c19 100644 --- a/src/components/views/dialogs/security/CreateCrossSigningDialog.tsx +++ b/src/components/views/dialogs/security/CreateCrossSigningDialog.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import { CrossSigningKeys } from 'matrix-js-sdk/src/client'; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from '../../../../MatrixClientPeg'; import { _t } from '../../../../languageHandler'; @@ -28,8 +29,6 @@ import Spinner from '../../elements/Spinner'; import InteractiveAuthDialog from '../InteractiveAuthDialog'; import { replaceableComponent } from "../../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { accountPassword?: string; tokenLogin?: boolean; diff --git a/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx b/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx index b651da5121..3db78f6877 100644 --- a/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx +++ b/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx @@ -16,15 +16,16 @@ limitations under the License. */ import React from 'react'; -import { MatrixClientPeg } from '../../../../MatrixClientPeg'; import { MatrixClient } from 'matrix-js-sdk/src/client'; -import { _t } from '../../../../languageHandler'; -import { accessSecretStorage } from '../../../../SecurityManager'; import { IKeyBackupInfo, IKeyBackupRestoreResult } from "matrix-js-sdk/src/crypto/keybackup"; import { ISecretStorageKeyInfo } from "matrix-js-sdk/src/crypto/api"; +import { logger } from "matrix-js-sdk/src/logger"; + +import { MatrixClientPeg } from '../../../../MatrixClientPeg'; +import { _t } from '../../../../languageHandler'; +import { accessSecretStorage } from '../../../../SecurityManager'; import * as sdk from '../../../../index'; import { IDialogProps } from "../IDialogProps"; -import { logger } from "matrix-js-sdk/src/logger"; enum RestoreType { Passphrase = "passphrase", diff --git a/src/components/views/dialogs/security/SetupEncryptionDialog.tsx b/src/components/views/dialogs/security/SetupEncryptionDialog.tsx index 0323769536..00be976576 100644 --- a/src/components/views/dialogs/security/SetupEncryptionDialog.tsx +++ b/src/components/views/dialogs/security/SetupEncryptionDialog.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import SetupEncryptionBody from '../../../structures/auth/SetupEncryptionBody'; import BaseDialog from '../BaseDialog'; import { _t } from '../../../../languageHandler'; diff --git a/src/components/views/elements/AccessibleButton.tsx b/src/components/views/elements/AccessibleButton.tsx index 75b6890112..ae11098e73 100644 --- a/src/components/views/elements/AccessibleButton.tsx +++ b/src/components/views/elements/AccessibleButton.tsx @@ -15,9 +15,9 @@ */ import React, { ReactHTML } from 'react'; +import classnames from 'classnames'; import { Key } from '../../../Keyboard'; -import classnames from 'classnames'; export type ButtonEvent = React.MouseEvent | React.KeyboardEvent | React.FormEvent; diff --git a/src/components/views/elements/ActionButton.tsx b/src/components/views/elements/ActionButton.tsx index 390e84be77..a684b999a5 100644 --- a/src/components/views/elements/ActionButton.tsx +++ b/src/components/views/elements/ActionButton.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import AccessibleButton from './AccessibleButton'; import dis from '../../../dispatcher/dispatcher'; import Analytics from '../../../Analytics'; diff --git a/src/components/views/elements/AddressSelector.tsx b/src/components/views/elements/AddressSelector.tsx index eae82142da..f1203fbee5 100644 --- a/src/components/views/elements/AddressSelector.tsx +++ b/src/components/views/elements/AddressSelector.tsx @@ -17,6 +17,7 @@ limitations under the License. import React, { createRef } from 'react'; import classNames from 'classnames'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import { IUserAddress } from '../../../UserAddress'; import AddressTile from './AddressTile'; diff --git a/src/components/views/elements/AddressTile.tsx b/src/components/views/elements/AddressTile.tsx index 52c0d84ac2..79995f3aba 100644 --- a/src/components/views/elements/AddressTile.tsx +++ b/src/components/views/elements/AddressTile.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import classNames from 'classnames'; + import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { mediaFromMxc } from "../../../customisations/Media"; diff --git a/src/components/views/elements/AppPermission.tsx b/src/components/views/elements/AppPermission.tsx index c0543eb363..11bbd6204d 100644 --- a/src/components/views/elements/AppPermission.tsx +++ b/src/components/views/elements/AppPermission.tsx @@ -18,12 +18,13 @@ limitations under the License. import React from 'react'; import url from 'url'; +import { RoomMember } from 'matrix-js-sdk/src/models/room-member'; + import { _t } from '../../../languageHandler'; import SdkConfig from '../../../SdkConfig'; import WidgetUtils from "../../../utils/WidgetUtils"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { RoomMember } from 'matrix-js-sdk/src/models/room-member'; import MemberAvatar from '../avatars/MemberAvatar'; import BaseAvatar from '../avatars/BaseAvatar'; import AccessibleButton from './AccessibleButton'; diff --git a/src/components/views/elements/AppTile.tsx b/src/components/views/elements/AppTile.tsx index 5f7c0543c4..e45a292e3d 100644 --- a/src/components/views/elements/AppTile.tsx +++ b/src/components/views/elements/AppTile.tsx @@ -19,6 +19,11 @@ limitations under the License. import url from 'url'; import React, { createRef } from 'react'; +import classNames from 'classnames'; +import { MatrixCapabilities } from "matrix-widget-api"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from '../../../MatrixClientPeg'; import AccessibleButton from './AccessibleButton'; import { _t } from '../../../languageHandler'; @@ -27,18 +32,15 @@ import AppWarning from './AppWarning'; import Spinner from './Spinner'; import dis from '../../../dispatcher/dispatcher'; import ActiveWidgetStore from '../../../stores/ActiveWidgetStore'; -import classNames from 'classnames'; import SettingsStore from "../../../settings/SettingsStore"; import { aboveLeftOf, ContextMenuButton } from "../../structures/ContextMenu"; import PersistedElement, { getPersistKey } from "./PersistedElement"; import { WidgetType } from "../../../widgets/WidgetType"; import { StopGapWidget } from "../../../stores/widgets/StopGapWidget"; import { ElementWidgetActions } from "../../../stores/widgets/ElementWidgetActions"; -import { MatrixCapabilities } from "matrix-widget-api"; import RoomWidgetContextMenu from "../context_menus/WidgetContextMenu"; import WidgetAvatar from "../avatars/WidgetAvatar"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { Room } from "matrix-js-sdk/src/models/room"; import { IApp } from "../../../stores/WidgetStore"; interface IProps { @@ -86,8 +88,6 @@ interface IState { widgetPageTitle: string; } -import { logger } from "matrix-js-sdk/src/logger"; - @replaceableComponent("views.elements.AppTile") export default class AppTile extends React.Component { public static defaultProps: Partial = { diff --git a/src/components/views/elements/DNDTagTile.js b/src/components/views/elements/DNDTagTile.js index 97bae82e61..5b87a36769 100644 --- a/src/components/views/elements/DNDTagTile.js +++ b/src/components/views/elements/DNDTagTile.js @@ -15,9 +15,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import TagTile from './TagTile'; - import React from 'react'; + +import TagTile from './TagTile'; import { ContextMenu, toRightOf, useContextMenu } from "../../structures/ContextMenu"; import * as sdk from '../../../index'; diff --git a/src/components/views/elements/DesktopBuildsNotice.tsx b/src/components/views/elements/DesktopBuildsNotice.tsx index 5938bc6dfe..e06db603ec 100644 --- a/src/components/views/elements/DesktopBuildsNotice.tsx +++ b/src/components/views/elements/DesktopBuildsNotice.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React from "react"; +import { logger } from "matrix-js-sdk/src/logger"; + import EventIndexPeg from "../../../indexing/EventIndexPeg"; import { _t } from "../../../languageHandler"; import SdkConfig from "../../../SdkConfig"; @@ -22,8 +24,6 @@ import dis from "../../../dispatcher/dispatcher"; import { Action } from "../../../dispatcher/actions"; import { UserTab } from "../dialogs/UserSettingsDialog"; -import { logger } from "matrix-js-sdk/src/logger"; - export enum WarningKind { Files, Search, diff --git a/src/components/views/elements/DesktopCapturerSourcePicker.tsx b/src/components/views/elements/DesktopCapturerSourcePicker.tsx index 034fc3d49c..6c5dbca659 100644 --- a/src/components/views/elements/DesktopCapturerSourcePicker.tsx +++ b/src/components/views/elements/DesktopCapturerSourcePicker.tsx @@ -15,10 +15,11 @@ limitations under the License. */ import React from 'react'; +import classNames from 'classnames'; + import { _t } from '../../../languageHandler'; import BaseDialog from "..//dialogs/BaseDialog"; import DialogButtons from "./DialogButtons"; -import classNames from 'classnames'; import AccessibleButton from './AccessibleButton'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import TabbedView, { Tab, TabLocation } from '../../structures/TabbedView'; diff --git a/src/components/views/elements/DialPadBackspaceButton.tsx b/src/components/views/elements/DialPadBackspaceButton.tsx index d64ced8239..ce9dbffe7e 100644 --- a/src/components/views/elements/DialPadBackspaceButton.tsx +++ b/src/components/views/elements/DialPadBackspaceButton.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import * as React from "react"; + import AccessibleButton, { ButtonEvent } from "./AccessibleButton"; interface IProps { diff --git a/src/components/views/elements/DialogButtons.tsx b/src/components/views/elements/DialogButtons.tsx index 0dff64c0b4..210e768aa7 100644 --- a/src/components/views/elements/DialogButtons.tsx +++ b/src/components/views/elements/DialogButtons.tsx @@ -17,6 +17,7 @@ limitations under the License. */ import React from "react"; + import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/elements/DirectorySearchBox.tsx b/src/components/views/elements/DirectorySearchBox.tsx index 07407af622..015065f45e 100644 --- a/src/components/views/elements/DirectorySearchBox.tsx +++ b/src/components/views/elements/DirectorySearchBox.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { ChangeEvent, createRef } from 'react'; + import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import AccessibleButton from "./AccessibleButton"; diff --git a/src/components/views/elements/Draggable.tsx b/src/components/views/elements/Draggable.tsx index 03dccadcb9..e9e24a57e4 100644 --- a/src/components/views/elements/Draggable.tsx +++ b/src/components/views/elements/Draggable.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; interface IProps { diff --git a/src/components/views/elements/EditableText.tsx b/src/components/views/elements/EditableText.tsx index b3ff8ee245..122292a8f5 100644 --- a/src/components/views/elements/EditableText.tsx +++ b/src/components/views/elements/EditableText.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React, { createRef } from 'react'; + import { Key } from "../../../Keyboard"; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/elements/EditableTextContainer.tsx b/src/components/views/elements/EditableTextContainer.tsx index b4689b90db..ede1e8a655 100644 --- a/src/components/views/elements/EditableTextContainer.tsx +++ b/src/components/views/elements/EditableTextContainer.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import Spinner from "./Spinner"; import EditableText from "./EditableText"; diff --git a/src/components/views/elements/EffectsOverlay.tsx b/src/components/views/elements/EffectsOverlay.tsx index 3e90d9e3a5..5115d130cd 100644 --- a/src/components/views/elements/EffectsOverlay.tsx +++ b/src/components/views/elements/EffectsOverlay.tsx @@ -15,13 +15,13 @@ limitations under the License. */ import React, { FunctionComponent, useEffect, useRef } from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import dis from '../../../dispatcher/dispatcher'; import ICanvasEffect from '../../../effects/ICanvasEffect'; import { CHAT_EFFECTS } from '../../../effects'; import UIStore, { UI_EVENTS } from "../../../stores/UIStore"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { roomWidth: number; } diff --git a/src/components/views/elements/ErrorBoundary.tsx b/src/components/views/elements/ErrorBoundary.tsx index 7e8686a35c..a984ea7d73 100644 --- a/src/components/views/elements/ErrorBoundary.tsx +++ b/src/components/views/elements/ErrorBoundary.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { ErrorInfo } from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; @@ -25,8 +26,6 @@ import { replaceableComponent } from "../../../utils/replaceableComponent"; import BugReportDialog from '../dialogs/BugReportDialog'; import AccessibleButton from './AccessibleButton'; -import { logger } from "matrix-js-sdk/src/logger"; - interface IState { error: Error; } diff --git a/src/components/views/elements/Field.tsx b/src/components/views/elements/Field.tsx index 476b0f73c7..7672244ba5 100644 --- a/src/components/views/elements/Field.tsx +++ b/src/components/views/elements/Field.tsx @@ -16,8 +16,9 @@ limitations under the License. import React, { InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes } from 'react'; import classNames from 'classnames'; -import * as sdk from '../../../index'; import { debounce } from "lodash"; + +import * as sdk from '../../../index'; import { IFieldState, IValidationResult } from "./Validation"; // Invoke validation from user input (when typing, etc.) at most once every N ms. diff --git a/src/components/views/elements/Flair.js b/src/components/views/elements/Flair.js index 280cac503e..0029f73ff0 100644 --- a/src/components/views/elements/Flair.js +++ b/src/components/views/elements/Flair.js @@ -16,14 +16,14 @@ import React from 'react'; import PropTypes from 'prop-types'; +import { logger } from "matrix-js-sdk/src/logger"; + import FlairStore from '../../../stores/FlairStore'; import dis from '../../../dispatcher/dispatcher'; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { mediaFromMxc } from "../../../customisations/Media"; -import { logger } from "matrix-js-sdk/src/logger"; - class FlairAvatar extends React.Component { constructor() { super(); diff --git a/src/components/views/elements/IRCTimelineProfileResizer.tsx b/src/components/views/elements/IRCTimelineProfileResizer.tsx index 13e8ae2ae2..13b0022e72 100644 --- a/src/components/views/elements/IRCTimelineProfileResizer.tsx +++ b/src/components/views/elements/IRCTimelineProfileResizer.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import SettingsStore from "../../../settings/SettingsStore"; import Draggable, { ILocationState } from './Draggable'; import { SettingLevel } from "../../../settings/SettingLevel"; diff --git a/src/components/views/elements/ImageView.tsx b/src/components/views/elements/ImageView.tsx index 44ff6644d7..78806703cc 100644 --- a/src/components/views/elements/ImageView.tsx +++ b/src/components/views/elements/ImageView.tsx @@ -17,10 +17,12 @@ limitations under the License. */ import React, { createRef } from 'react'; +import FocusLock from "react-focus-lock"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { _t } from '../../../languageHandler'; import AccessibleTooltipButton from "./AccessibleTooltipButton"; import { Key } from "../../../Keyboard"; -import FocusLock from "react-focus-lock"; import MemberAvatar from "../avatars/MemberAvatar"; import { ContextMenuTooltipButton } from "../../../accessibility/context_menu/ContextMenuTooltipButton"; import MessageContextMenu from "../context_menus/MessageContextMenu"; @@ -31,7 +33,6 @@ import { formatFullDate } from "../../../DateUtils"; import dis from '../../../dispatcher/dispatcher'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { normalizeWheelEvent } from "../../../utils/Mouse"; import { IDialogProps } from '../dialogs/IDialogProps'; import UIStore from '../../../stores/UIStore'; diff --git a/src/components/views/elements/InlineSpinner.tsx b/src/components/views/elements/InlineSpinner.tsx index e2cda2f28d..3a404430db 100644 --- a/src/components/views/elements/InlineSpinner.tsx +++ b/src/components/views/elements/InlineSpinner.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { _t } from "../../../languageHandler"; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/elements/InviteReason.tsx b/src/components/views/elements/InviteReason.tsx index 865a5be747..13a62d463c 100644 --- a/src/components/views/elements/InviteReason.tsx +++ b/src/components/views/elements/InviteReason.tsx @@ -16,6 +16,7 @@ limitations under the License. import classNames from "classnames"; import React from "react"; + import { sanitizedHtmlNode } from "../../../HtmlUtils"; import { _t } from "../../../languageHandler"; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/elements/LazyRenderList.tsx b/src/components/views/elements/LazyRenderList.tsx index 54c76f27a7..6a1920bec9 100644 --- a/src/components/views/elements/LazyRenderList.tsx +++ b/src/components/views/elements/LazyRenderList.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { replaceableComponent } from "../../../utils/replaceableComponent"; class ItemRange { diff --git a/src/components/views/elements/MemberEventListSummary.tsx b/src/components/views/elements/MemberEventListSummary.tsx index 4eb0177fef..7d47c085bc 100644 --- a/src/components/views/elements/MemberEventListSummary.tsx +++ b/src/components/views/elements/MemberEventListSummary.tsx @@ -19,6 +19,7 @@ limitations under the License. import React, { ComponentProps } from 'react'; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { EventType } from 'matrix-js-sdk/src/@types/event'; import { _t } from '../../../languageHandler'; import { formatCommaSeparatedList } from '../../../utils/FormattingUtils'; @@ -30,7 +31,6 @@ import { RightPanelPhases } from '../../../stores/RightPanelStorePhases'; import { Action } from '../../../dispatcher/actions'; import { SetRightPanelPhasePayload } from '../../../dispatcher/payloads/SetRightPanelPhasePayload'; import { jsxJoin } from '../../../utils/ReactUtils'; -import { EventType } from 'matrix-js-sdk/src/@types/event'; import { Layout } from '../../../settings/Layout'; const onPinnedMessagesClick = (): void => { diff --git a/src/components/views/elements/PersistedElement.tsx b/src/components/views/elements/PersistedElement.tsx index d013091803..cd07864e22 100644 --- a/src/components/views/elements/PersistedElement.tsx +++ b/src/components/views/elements/PersistedElement.tsx @@ -17,11 +17,11 @@ limitations under the License. import React from 'react'; import ReactDOM from 'react-dom'; import { throttle } from "lodash"; +import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; import dis from '../../../dispatcher/dispatcher'; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; -import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { ActionPayload } from "../../../dispatcher/payloads"; diff --git a/src/components/views/elements/PersistentApp.tsx b/src/components/views/elements/PersistentApp.tsx index d80a00584c..80e57b537b 100644 --- a/src/components/views/elements/PersistentApp.tsx +++ b/src/components/views/elements/PersistentApp.tsx @@ -16,14 +16,15 @@ limitations under the License. */ import React from 'react'; +import { EventSubscription } from 'fbemitter'; +import { Room } from "matrix-js-sdk/src/models/room"; + import RoomViewStore from '../../../stores/RoomViewStore'; import ActiveWidgetStore, { ActiveWidgetStoreEvent } from '../../../stores/ActiveWidgetStore'; import WidgetUtils from '../../../utils/WidgetUtils'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { EventSubscription } from 'fbemitter'; import AppTile from "./AppTile"; -import { Room } from "matrix-js-sdk/src/models/room"; interface IProps { // none diff --git a/src/components/views/elements/Pill.js b/src/components/views/elements/Pill.js index 4a2b39f891..2e99a0c57f 100644 --- a/src/components/views/elements/Pill.js +++ b/src/components/views/elements/Pill.js @@ -14,12 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ import React from 'react'; -import * as sdk from '../../../index'; -import dis from '../../../dispatcher/dispatcher'; import classNames from 'classnames'; import { Room } from 'matrix-js-sdk/src/models/room'; import { RoomMember } from 'matrix-js-sdk/src/models/room-member'; import PropTypes from 'prop-types'; +import { logger } from "matrix-js-sdk/src/logger"; + +import * as sdk from '../../../index'; +import dis from '../../../dispatcher/dispatcher'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import FlairStore from "../../../stores/FlairStore"; import { getPrimaryPermalinkEntity, parseAppLocalLink } from "../../../utils/permalinks/Permalinks"; @@ -29,8 +31,6 @@ import { mediaFromMxc } from "../../../customisations/Media"; import Tooltip from './Tooltip'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - @replaceableComponent("views.elements.Pill") class Pill extends React.Component { static roomNotifPos(text) { diff --git a/src/components/views/elements/PowerSelector.tsx b/src/components/views/elements/PowerSelector.tsx index a99812028e..1c3af65b45 100644 --- a/src/components/views/elements/PowerSelector.tsx +++ b/src/components/views/elements/PowerSelector.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import * as Roles from '../../../Roles'; import { _t } from '../../../languageHandler'; import Field from "./Field"; diff --git a/src/components/views/elements/ReplyChain.tsx b/src/components/views/elements/ReplyChain.tsx index 50efdc92fb..57997ed797 100644 --- a/src/components/views/elements/ReplyChain.tsx +++ b/src/components/views/elements/ReplyChain.tsx @@ -17,25 +17,25 @@ limitations under the License. import React from 'react'; import classNames from 'classnames'; +import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; +import escapeHtml from "escape-html"; +import sanitizeHtml from "sanitize-html"; +import { Room } from 'matrix-js-sdk/src/models/room'; +import { RelationType } from 'matrix-js-sdk/src/@types/event'; import { _t } from '../../../languageHandler'; import dis from '../../../dispatcher/dispatcher'; -import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; import { makeUserPermalink, RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; import SettingsStore from "../../../settings/SettingsStore"; import { Layout } from "../../../settings/Layout"; -import escapeHtml from "escape-html"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { getUserNameColorClass } from "../../../utils/FormattingUtils"; import { Action } from "../../../dispatcher/actions"; -import sanitizeHtml from "sanitize-html"; import { PERMITTED_URL_SCHEMES } from "../../../HtmlUtils"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import Spinner from './Spinner'; import ReplyTile from "../rooms/ReplyTile"; import Pill from './Pill'; -import { Room } from 'matrix-js-sdk/src/models/room'; -import { RelationType } from 'matrix-js-sdk/src/@types/event'; /** * This number is based on the previous behavior - if we have message of height diff --git a/src/components/views/elements/SettingsFlag.tsx b/src/components/views/elements/SettingsFlag.tsx index 0847db801e..35d8070df7 100644 --- a/src/components/views/elements/SettingsFlag.tsx +++ b/src/components/views/elements/SettingsFlag.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from "react"; + import SettingsStore from "../../../settings/SettingsStore"; import { _t } from '../../../languageHandler'; import ToggleSwitch from "./ToggleSwitch"; diff --git a/src/components/views/elements/Slider.tsx b/src/components/views/elements/Slider.tsx index a201659e3c..a4c3147a73 100644 --- a/src/components/views/elements/Slider.tsx +++ b/src/components/views/elements/Slider.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import * as React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; interface IProps { diff --git a/src/components/views/elements/Spinner.tsx b/src/components/views/elements/Spinner.tsx index ee43a5bf0e..ac3ba51fdd 100644 --- a/src/components/views/elements/Spinner.tsx +++ b/src/components/views/elements/Spinner.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { _t } from "../../../languageHandler"; interface IProps { diff --git a/src/components/views/elements/Spoiler.tsx b/src/components/views/elements/Spoiler.tsx index 4779a7d90e..4613f8914b 100644 --- a/src/components/views/elements/Spoiler.tsx +++ b/src/components/views/elements/Spoiler.tsx @@ -15,6 +15,7 @@ */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; interface IProps { diff --git a/src/components/views/elements/StyledCheckbox.tsx b/src/components/views/elements/StyledCheckbox.tsx index b609f7159e..4a64c5734f 100644 --- a/src/components/views/elements/StyledCheckbox.tsx +++ b/src/components/views/elements/StyledCheckbox.tsx @@ -16,6 +16,7 @@ limitations under the License. import React from "react"; import { randomString } from "matrix-js-sdk/src/randomstring"; + import { replaceableComponent } from "../../../utils/replaceableComponent"; interface IProps extends React.InputHTMLAttributes { diff --git a/src/components/views/elements/StyledRadioButton.tsx b/src/components/views/elements/StyledRadioButton.tsx index 1b68274f39..faa1ab8471 100644 --- a/src/components/views/elements/StyledRadioButton.tsx +++ b/src/components/views/elements/StyledRadioButton.tsx @@ -16,6 +16,7 @@ limitations under the License. import React from 'react'; import classnames from 'classnames'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; interface IProps extends React.InputHTMLAttributes { diff --git a/src/components/views/elements/SyntaxHighlight.tsx b/src/components/views/elements/SyntaxHighlight.tsx index 36920af27a..96ad1f2c02 100644 --- a/src/components/views/elements/SyntaxHighlight.tsx +++ b/src/components/views/elements/SyntaxHighlight.tsx @@ -16,6 +16,7 @@ limitations under the License. import React from 'react'; import highlight from 'highlight.js'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; interface IProps { diff --git a/src/components/views/elements/TagComposer.tsx b/src/components/views/elements/TagComposer.tsx index 03f501f02c..9937020fff 100644 --- a/src/components/views/elements/TagComposer.tsx +++ b/src/components/views/elements/TagComposer.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { ChangeEvent, FormEvent } from "react"; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import Field from "./Field"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/elements/TagTile.js b/src/components/views/elements/TagTile.js index 1205a2050f..d8e85c2696 100644 --- a/src/components/views/elements/TagTile.js +++ b/src/components/views/elements/TagTile.js @@ -19,11 +19,12 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; +import { logger } from "matrix-js-sdk/src/logger"; + import * as sdk from '../../../index'; import dis from '../../../dispatcher/dispatcher'; import { isOnlyCtrlOrCmdIgnoreShiftKeyEvent } from '../../../Keyboard'; import * as FormattingUtils from '../../../utils/FormattingUtils'; - import FlairStore from '../../../stores/FlairStore'; import GroupStore from '../../../stores/GroupStore'; import GroupFilterOrderStore from '../../../stores/GroupFilterOrderStore'; @@ -33,8 +34,6 @@ import SettingsStore from "../../../settings/SettingsStore"; import { mediaFromMxc } from "../../../customisations/Media"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - // A class for a child of GroupFilterPanel (possibly wrapped in a DNDTagTile) that represents // a thing to click on for the user to filter the visible rooms in the RoomList to: // - Rooms that are part of the group diff --git a/src/components/views/elements/TextWithTooltip.tsx b/src/components/views/elements/TextWithTooltip.tsx index b7c2477158..cb0bb440d5 100644 --- a/src/components/views/elements/TextWithTooltip.tsx +++ b/src/components/views/elements/TextWithTooltip.tsx @@ -15,6 +15,7 @@ */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import Tooltip from "./Tooltip"; diff --git a/src/components/views/elements/ToggleSwitch.tsx b/src/components/views/elements/ToggleSwitch.tsx index c439ef4f85..154a89a73f 100644 --- a/src/components/views/elements/ToggleSwitch.tsx +++ b/src/components/views/elements/ToggleSwitch.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from "react"; import classNames from "classnames"; + import AccessibleButton from "./AccessibleButton"; interface IProps { diff --git a/src/components/views/elements/Tooltip.tsx b/src/components/views/elements/Tooltip.tsx index c335684c05..c078107d54 100644 --- a/src/components/views/elements/Tooltip.tsx +++ b/src/components/views/elements/Tooltip.tsx @@ -20,6 +20,7 @@ limitations under the License. import React, { Component, CSSProperties } from 'react'; import ReactDOM from 'react-dom'; import classNames from 'classnames'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import UIStore from "../../../stores/UIStore"; diff --git a/src/components/views/elements/TooltipButton.tsx b/src/components/views/elements/TooltipButton.tsx index 26e46c7da8..2a7b6458d0 100644 --- a/src/components/views/elements/TooltipButton.tsx +++ b/src/components/views/elements/TooltipButton.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import Tooltip from './Tooltip'; diff --git a/src/components/views/elements/TruncatedList.tsx b/src/components/views/elements/TruncatedList.tsx index 403df4111e..31c5391b07 100644 --- a/src/components/views/elements/TruncatedList.tsx +++ b/src/components/views/elements/TruncatedList.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/elements/UserTagTile.tsx b/src/components/views/elements/UserTagTile.tsx index 4414ff31fd..6bd0d4daa8 100644 --- a/src/components/views/elements/UserTagTile.tsx +++ b/src/components/views/elements/UserTagTile.tsx @@ -15,11 +15,12 @@ limitations under the License. */ import React from "react"; -import defaultDispatcher from "../../../dispatcher/dispatcher"; import * as fbEmitter from "fbemitter"; +import classNames from "classnames"; + +import defaultDispatcher from "../../../dispatcher/dispatcher"; import GroupFilterOrderStore from "../../../stores/GroupFilterOrderStore"; import AccessibleTooltipButton from "./AccessibleTooltipButton"; -import classNames from "classnames"; import { _t } from "../../../languageHandler"; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/elements/crypto/VerificationQRCode.tsx b/src/components/views/elements/crypto/VerificationQRCode.tsx index be9ede59b1..a5efb1b6ce 100644 --- a/src/components/views/elements/crypto/VerificationQRCode.tsx +++ b/src/components/views/elements/crypto/VerificationQRCode.tsx @@ -15,9 +15,10 @@ limitations under the License. */ import React from "react"; +import { QRCodeData } from "matrix-js-sdk/src/crypto/verification/QRCode"; + import { replaceableComponent } from "../../../../utils/replaceableComponent"; import QRCode from "../QRCode"; -import { QRCodeData } from "matrix-js-sdk/src/crypto/verification/QRCode"; interface IProps { qrCodeData: QRCodeData; diff --git a/src/components/views/groups/GroupInviteTile.js b/src/components/views/groups/GroupInviteTile.js index 0ec0084162..1ed66de2d5 100644 --- a/src/components/views/groups/GroupInviteTile.js +++ b/src/components/views/groups/GroupInviteTile.js @@ -18,10 +18,11 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; +import classNames from 'classnames'; + import * as sdk from '../../../index'; import dis from '../../../dispatcher/dispatcher'; import { _t } from '../../../languageHandler'; -import classNames from 'classnames'; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { ContextMenu, ContextMenuButton, toRightOf } from "../../structures/ContextMenu"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; diff --git a/src/components/views/groups/GroupMemberList.js b/src/components/views/groups/GroupMemberList.js index 3204f82e82..404145a241 100644 --- a/src/components/views/groups/GroupMemberList.js +++ b/src/components/views/groups/GroupMemberList.js @@ -16,11 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. */ import React from 'react'; +import PropTypes from 'prop-types'; + import { _t } from '../../../languageHandler'; import * as sdk from '../../../index'; import dis from '../../../dispatcher/dispatcher'; import GroupStore from '../../../stores/GroupStore'; -import PropTypes from 'prop-types'; import { showGroupInviteDialog } from '../../../GroupAddressPicker'; import AccessibleButton from '../elements/AccessibleButton'; import { RightPanelPhases } from "../../../stores/RightPanelStorePhases"; diff --git a/src/components/views/groups/GroupMemberTile.js b/src/components/views/groups/GroupMemberTile.js index 301f57be23..ec4da5a53f 100644 --- a/src/components/views/groups/GroupMemberTile.js +++ b/src/components/views/groups/GroupMemberTile.js @@ -18,6 +18,7 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; + import * as sdk from '../../../index'; import dis from '../../../dispatcher/dispatcher'; import { GroupMemberType } from '../../../groups'; diff --git a/src/components/views/groups/GroupPublicityToggle.js b/src/components/views/groups/GroupPublicityToggle.js index 4e17a9caa1..e2b0eb8687 100644 --- a/src/components/views/groups/GroupPublicityToggle.js +++ b/src/components/views/groups/GroupPublicityToggle.js @@ -16,6 +16,7 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; + import * as sdk from '../../../index'; import GroupStore from '../../../stores/GroupStore'; import ToggleSwitch from "../elements/ToggleSwitch"; diff --git a/src/components/views/groups/GroupRoomInfo.js b/src/components/views/groups/GroupRoomInfo.js index b59144a716..36678e35a4 100644 --- a/src/components/views/groups/GroupRoomInfo.js +++ b/src/components/views/groups/GroupRoomInfo.js @@ -17,6 +17,8 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; +import { logger } from "matrix-js-sdk/src/logger"; + import dis from '../../../dispatcher/dispatcher'; import Modal from '../../../Modal'; import * as sdk from '../../../index'; @@ -27,8 +29,6 @@ import AutoHideScrollbar from "../../structures/AutoHideScrollbar"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { mediaFromMxc } from "../../../customisations/Media"; -import { logger } from "matrix-js-sdk/src/logger"; - @replaceableComponent("views.groups.GroupRoomInfo") export default class GroupRoomInfo extends React.Component { static contextType = MatrixClientContext; diff --git a/src/components/views/groups/GroupRoomList.js b/src/components/views/groups/GroupRoomList.js index e3dbdddb4f..7b2c01186b 100644 --- a/src/components/views/groups/GroupRoomList.js +++ b/src/components/views/groups/GroupRoomList.js @@ -14,10 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ import React from 'react'; +import PropTypes from 'prop-types'; + import { _t } from '../../../languageHandler'; import * as sdk from '../../../index'; import GroupStore from '../../../stores/GroupStore'; -import PropTypes from 'prop-types'; import { showGroupAddRoomDialog } from '../../../GroupAddressPicker'; import AccessibleButton from '../elements/AccessibleButton'; import AutoHideScrollbar from "../../structures/AutoHideScrollbar"; diff --git a/src/components/views/groups/GroupRoomTile.js b/src/components/views/groups/GroupRoomTile.js index 7bbfaa93a8..75e16142df 100644 --- a/src/components/views/groups/GroupRoomTile.js +++ b/src/components/views/groups/GroupRoomTile.js @@ -16,6 +16,7 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; + import * as sdk from '../../../index'; import dis from '../../../dispatcher/dispatcher'; import { GroupRoomType } from '../../../groups'; diff --git a/src/components/views/groups/GroupTile.js b/src/components/views/groups/GroupTile.js index cf1a5b91ce..fbdab54563 100644 --- a/src/components/views/groups/GroupTile.js +++ b/src/components/views/groups/GroupTile.js @@ -16,6 +16,8 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; +import { logger } from "matrix-js-sdk/src/logger"; + import * as sdk from '../../../index'; import dis from '../../../dispatcher/dispatcher'; import FlairStore from '../../../stores/FlairStore'; @@ -26,8 +28,6 @@ import { _t } from "../../../languageHandler"; import TagOrderActions from "../../../actions/TagOrderActions"; import GroupFilterOrderStore from "../../../stores/GroupFilterOrderStore"; -import { logger } from "matrix-js-sdk/src/logger"; - @replaceableComponent("views.groups.GroupTile") class GroupTile extends React.Component { static propTypes = { diff --git a/src/components/views/groups/GroupUserSettings.js b/src/components/views/groups/GroupUserSettings.js index 85fd15e238..9a0bd6a5e0 100644 --- a/src/components/views/groups/GroupUserSettings.js +++ b/src/components/views/groups/GroupUserSettings.js @@ -15,13 +15,13 @@ limitations under the License. */ import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - @replaceableComponent("views.groups.GroupUserSettings") export default class GroupUserSettings extends React.Component { static contextType = MatrixClientContext; diff --git a/src/components/views/host_signup/HostSignupContainer.tsx b/src/components/views/host_signup/HostSignupContainer.tsx index 1b9f0c1e45..c000eb168f 100644 --- a/src/components/views/host_signup/HostSignupContainer.tsx +++ b/src/components/views/host_signup/HostSignupContainer.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { useState } from 'react'; + import HostSignupDialog from "../dialogs/HostSignupDialog"; import { HostSignupStore } from "../../../stores/HostSignupStore"; import { useEventEmitter } from "../../../hooks/useEventEmitter"; diff --git a/src/components/views/messages/CallEvent.tsx b/src/components/views/messages/CallEvent.tsx index 5f514b8390..d6df8c354e 100644 --- a/src/components/views/messages/CallEvent.tsx +++ b/src/components/views/messages/CallEvent.tsx @@ -15,15 +15,15 @@ limitations under the License. */ import React, { createRef } from 'react'; - import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { CallErrorCode, CallState } from 'matrix-js-sdk/src/webrtc/call'; +import classNames from 'classnames'; + import { _t } from '../../../languageHandler'; import MemberAvatar from '../avatars/MemberAvatar'; import CallEventGrouper, { CallEventGrouperEvent, CustomCallState } from '../../structures/CallEventGrouper'; import AccessibleButton from '../elements/AccessibleButton'; -import { CallErrorCode, CallState } from 'matrix-js-sdk/src/webrtc/call'; import InfoTooltip, { InfoTooltipKind } from '../elements/InfoTooltip'; -import classNames from 'classnames'; import AccessibleTooltipButton from '../elements/AccessibleTooltipButton'; import { formatCallTime } from "../../../DateUtils"; import Clock from "../audio_messages/Clock"; diff --git a/src/components/views/messages/DownloadActionButton.tsx b/src/components/views/messages/DownloadActionButton.tsx index 35fd5c49be..86bed15384 100644 --- a/src/components/views/messages/DownloadActionButton.tsx +++ b/src/components/views/messages/DownloadActionButton.tsx @@ -15,11 +15,12 @@ limitations under the License. */ import { MatrixEvent } from "matrix-js-sdk/src"; -import { MediaEventHelper } from "../../../utils/MediaEventHelper"; import React from "react"; +import classNames from "classnames"; + +import { MediaEventHelper } from "../../../utils/MediaEventHelper"; import { RovingAccessibleTooltipButton } from "../../../accessibility/RovingTabIndex"; import Spinner from "../elements/Spinner"; -import classNames from "classnames"; import { _t, _td } from "../../../languageHandler"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { FileDownloader } from "../../../utils/FileDownloader"; diff --git a/src/components/views/messages/EditHistoryMessage.tsx b/src/components/views/messages/EditHistoryMessage.tsx index 1abed87b76..01c133efb1 100644 --- a/src/components/views/messages/EditHistoryMessage.tsx +++ b/src/components/views/messages/EditHistoryMessage.tsx @@ -15,15 +15,16 @@ limitations under the License. */ import React, { createRef } from 'react'; +import { EventStatus, MatrixEvent } from 'matrix-js-sdk/src/models/event'; +import classNames from 'classnames'; + import * as HtmlUtils from '../../../HtmlUtils'; import { editBodyDiffToHtml } from '../../../utils/MessageDiffUtils'; import { formatTime } from '../../../DateUtils'; -import { EventStatus, MatrixEvent } from 'matrix-js-sdk/src/models/event'; import { pillifyLinks, unmountPills } from '../../../utils/pillify'; import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import Modal from '../../../Modal'; -import classNames from 'classnames'; import RedactedBody from "./RedactedBody"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import AccessibleButton from "../elements/AccessibleButton"; diff --git a/src/components/views/messages/IBodyProps.ts b/src/components/views/messages/IBodyProps.ts index daa05c3b1a..846753c0d2 100644 --- a/src/components/views/messages/IBodyProps.ts +++ b/src/components/views/messages/IBodyProps.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { MatrixEvent } from "matrix-js-sdk/src"; + import { TileShape } from "../rooms/EventTile"; import { MediaEventHelper } from "../../../utils/MediaEventHelper"; import EditorStateTransfer from "../../../utils/EditorStateTransfer"; diff --git a/src/components/views/messages/MAudioBody.tsx b/src/components/views/messages/MAudioBody.tsx index 61604f55bd..d3bc2fb107 100644 --- a/src/components/views/messages/MAudioBody.tsx +++ b/src/components/views/messages/MAudioBody.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React from "react"; +import { logger } from "matrix-js-sdk/src/logger"; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import { Playback } from "../../../audio/Playback"; import InlineSpinner from '../elements/InlineSpinner'; @@ -27,8 +29,6 @@ import { PlaybackManager } from "../../../audio/PlaybackManager"; import { isVoiceMessage } from "../../../utils/EventUtils"; import { PlaybackQueue } from "../../../audio/PlaybackQueue"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IState { error?: Error; playback?: Playback; diff --git a/src/components/views/messages/MFileBody.tsx b/src/components/views/messages/MFileBody.tsx index f193b7c324..891a48d8b0 100644 --- a/src/components/views/messages/MFileBody.tsx +++ b/src/components/views/messages/MFileBody.tsx @@ -16,6 +16,8 @@ limitations under the License. import React, { createRef } from 'react'; import filesize from 'filesize'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from '../../../languageHandler'; import Modal from '../../../Modal'; import AccessibleButton from "../elements/AccessibleButton"; @@ -29,8 +31,6 @@ import { IBodyProps } from "./IBodyProps"; import { FileDownloader } from "../../../utils/FileDownloader"; import TextWithTooltip from "../elements/TextWithTooltip"; -import { logger } from "matrix-js-sdk/src/logger"; - export let DOWNLOAD_ICON_URL; // cached copy of the download.svg asset for the sandboxed iframe later on async function cacheDownloadIcon() { diff --git a/src/components/views/messages/MImageBody.tsx b/src/components/views/messages/MImageBody.tsx index 85821129a1..9a06a9db8f 100644 --- a/src/components/views/messages/MImageBody.tsx +++ b/src/components/views/messages/MImageBody.tsx @@ -17,6 +17,10 @@ limitations under the License. import React, { ComponentProps, createRef } from 'react'; import { Blurhash } from "react-blurhash"; +import { SyncState } from 'matrix-js-sdk/src/sync.api'; +import classNames from 'classnames'; +import { CSSTransition, SwitchTransition } from 'react-transition-group'; +import { logger } from "matrix-js-sdk/src/logger"; import MFileBody from './MFileBody'; import Modal from '../../../Modal'; @@ -29,12 +33,7 @@ import { Media, mediaFromContent } from "../../../customisations/Media"; import { BLURHASH_FIELD } from "../../../ContentMessages"; import { IMediaEventContent } from '../../../customisations/models/IMediaEventContent'; import ImageView from '../elements/ImageView'; -import { SyncState } from 'matrix-js-sdk/src/sync.api'; import { IBodyProps } from "./IBodyProps"; -import classNames from 'classnames'; -import { CSSTransition, SwitchTransition } from 'react-transition-group'; - -import { logger } from "matrix-js-sdk/src/logger"; interface IState { decryptedUrl?: string; diff --git a/src/components/views/messages/MImageReplyBody.tsx b/src/components/views/messages/MImageReplyBody.tsx index 8d92920226..dead57bab2 100644 --- a/src/components/views/messages/MImageReplyBody.tsx +++ b/src/components/views/messages/MImageReplyBody.tsx @@ -15,11 +15,12 @@ limitations under the License. */ import React from "react"; +import { EventType } from "matrix-js-sdk/src/@types/event"; + import MImageBody from "./MImageBody"; import { presentableTextForFile } from "../../../utils/FileUtils"; import { IMediaEventContent } from "../../../customisations/models/IMediaEventContent"; import SenderProfile from "./SenderProfile"; -import { EventType } from "matrix-js-sdk/src/@types/event"; import { _t } from "../../../languageHandler"; const FORCED_IMAGE_HEIGHT = 44; diff --git a/src/components/views/messages/MJitsiWidgetEvent.tsx b/src/components/views/messages/MJitsiWidgetEvent.tsx index aaf659d6d9..5b7134c216 100644 --- a/src/components/views/messages/MJitsiWidgetEvent.tsx +++ b/src/components/views/messages/MJitsiWidgetEvent.tsx @@ -16,6 +16,7 @@ limitations under the License. import React from 'react'; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { _t } from "../../../languageHandler"; import WidgetStore from "../../../stores/WidgetStore"; import EventTileBubble from "./EventTileBubble"; diff --git a/src/components/views/messages/MKeyVerificationConclusion.tsx b/src/components/views/messages/MKeyVerificationConclusion.tsx index 1ce39e1157..a73c0f0c90 100644 --- a/src/components/views/messages/MKeyVerificationConclusion.tsx +++ b/src/components/views/messages/MKeyVerificationConclusion.tsx @@ -16,14 +16,15 @@ limitations under the License. import React from 'react'; import classNames from 'classnames'; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { EventType } from "matrix-js-sdk/src/@types/event"; + import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from '../../../languageHandler'; import { getNameForEventRoom, userLabelForEventRoom } from '../../../utils/KeyVerificationStateObserver'; import EventTileBubble from "./EventTileBubble"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; -import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; -import { EventType } from "matrix-js-sdk/src/@types/event"; interface IProps { /* the MatrixEvent to show */ diff --git a/src/components/views/messages/MKeyVerificationRequest.tsx b/src/components/views/messages/MKeyVerificationRequest.tsx index e1b91f63d7..4737bb2dec 100644 --- a/src/components/views/messages/MKeyVerificationRequest.tsx +++ b/src/components/views/messages/MKeyVerificationRequest.tsx @@ -16,6 +16,8 @@ limitations under the License. import React from 'react'; import { MatrixEvent } from 'matrix-js-sdk/src'; +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from '../../../languageHandler'; import { getNameForEventRoom, userLabelForEventRoom } @@ -27,8 +29,6 @@ import EventTileBubble from "./EventTileBubble"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import AccessibleButton from '../elements/AccessibleButton'; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { mxEvent: MatrixEvent; } diff --git a/src/components/views/messages/MStickerBody.tsx b/src/components/views/messages/MStickerBody.tsx index 365426245d..ad318b1dd5 100644 --- a/src/components/views/messages/MStickerBody.tsx +++ b/src/components/views/messages/MStickerBody.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import MImageBody from './MImageBody'; import * as sdk from '../../../index'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/messages/MVideoBody.tsx b/src/components/views/messages/MVideoBody.tsx index b2e587e51a..cc4039ef88 100644 --- a/src/components/views/messages/MVideoBody.tsx +++ b/src/components/views/messages/MVideoBody.tsx @@ -16,6 +16,7 @@ limitations under the License. import React from 'react'; import { decode } from "blurhash"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from '../../../languageHandler'; import SettingsStore from "../../../settings/SettingsStore"; @@ -27,8 +28,6 @@ import { IMediaEventContent } from "../../../customisations/models/IMediaEventCo import { IBodyProps } from "./IBodyProps"; import MFileBody from "./MFileBody"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IState { decryptedUrl?: string; decryptedThumbnailUrl?: string; diff --git a/src/components/views/messages/MVoiceMessageBody.tsx b/src/components/views/messages/MVoiceMessageBody.tsx index 55b608cf2d..5a8a633855 100644 --- a/src/components/views/messages/MVoiceMessageBody.tsx +++ b/src/components/views/messages/MVoiceMessageBody.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import InlineSpinner from '../elements/InlineSpinner'; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/messages/MVoiceOrAudioBody.tsx b/src/components/views/messages/MVoiceOrAudioBody.tsx index b4dce5d1aa..cec042a7ff 100644 --- a/src/components/views/messages/MVoiceOrAudioBody.tsx +++ b/src/components/views/messages/MVoiceOrAudioBody.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import MAudioBody from "./MAudioBody"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import MVoiceMessageBody from "./MVoiceMessageBody"; diff --git a/src/components/views/messages/MessageActionBar.tsx b/src/components/views/messages/MessageActionBar.tsx index 56ae08453c..a3f37114b0 100644 --- a/src/components/views/messages/MessageActionBar.tsx +++ b/src/components/views/messages/MessageActionBar.tsx @@ -18,8 +18,9 @@ limitations under the License. import React, { useEffect } from 'react'; import { EventStatus, MatrixEvent } from 'matrix-js-sdk/src/models/event'; -import type { Relations } from 'matrix-js-sdk/src/models/relations'; +import classNames from 'classnames'; +import type { Relations } from 'matrix-js-sdk/src/models/relations'; import { _t } from '../../../languageHandler'; import * as sdk from '../../../index'; import dis from '../../../dispatcher/dispatcher'; @@ -31,14 +32,11 @@ import RoomContext, { TimelineRenderingType } from "../../../contexts/RoomContex import Toolbar from "../../../accessibility/Toolbar"; import { RovingAccessibleTooltipButton, useRovingTabIndex } from "../../../accessibility/RovingTabIndex"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { canCancel } from "../context_menus/MessageContextMenu"; +import MessageContextMenu, { canCancel } from "../context_menus/MessageContextMenu"; import Resend from "../../../Resend"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { MediaEventHelper } from "../../../utils/MediaEventHelper"; import DownloadActionButton from "./DownloadActionButton"; -import MessageContextMenu from "../context_menus/MessageContextMenu"; -import classNames from 'classnames'; - import SettingsStore from '../../../settings/SettingsStore'; import { RoomPermalinkCreator } from '../../../utils/permalinks/Permalinks'; import ReplyChain from '../elements/ReplyChain'; diff --git a/src/components/views/messages/MessageEvent.tsx b/src/components/views/messages/MessageEvent.tsx index b72e40d194..9d5bb7df61 100644 --- a/src/components/views/messages/MessageEvent.tsx +++ b/src/components/views/messages/MessageEvent.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React, { createRef } from 'react'; +import { EventType, MsgType } from "matrix-js-sdk/src/@types/event"; + import * as sdk from '../../../index'; import SettingsStore from "../../../settings/SettingsStore"; import { Mjolnir } from "../../../mjolnir/Mjolnir"; @@ -25,7 +27,6 @@ import { IMediaBody } from "./IMediaBody"; import { IOperableEventTile } from "../context_menus/MessageContextMenu"; import { MediaEventHelper } from "../../../utils/MediaEventHelper"; import { ReactAnyComponent } from "../../../@types/common"; -import { EventType, MsgType } from "matrix-js-sdk/src/@types/event"; import { IBodyProps } from "./IBodyProps"; // onMessageAllowed is handled internally diff --git a/src/components/views/messages/MessageTimestamp.tsx b/src/components/views/messages/MessageTimestamp.tsx index a657032c86..fa60f0663e 100644 --- a/src/components/views/messages/MessageTimestamp.tsx +++ b/src/components/views/messages/MessageTimestamp.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; + import { formatFullDate, formatTime, formatFullTime } from '../../../DateUtils'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/messages/MjolnirBody.tsx b/src/components/views/messages/MjolnirBody.tsx index 7e922a5715..00cbcf461f 100644 --- a/src/components/views/messages/MjolnirBody.tsx +++ b/src/components/views/messages/MjolnirBody.tsx @@ -15,9 +15,10 @@ limitations under the License. */ import React from 'react'; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; interface IProps { mxEvent: MatrixEvent; diff --git a/src/components/views/messages/RedactedBody.tsx b/src/components/views/messages/RedactedBody.tsx index 9af4ebf1cb..f128405df4 100644 --- a/src/components/views/messages/RedactedBody.tsx +++ b/src/components/views/messages/RedactedBody.tsx @@ -17,6 +17,7 @@ limitations under the License. import React, { useContext } from "react"; import { MatrixClient } from "matrix-js-sdk/src/client"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { _t } from "../../../languageHandler"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { formatFullDate } from "../../../DateUtils"; diff --git a/src/components/views/messages/RoomAvatarEvent.tsx b/src/components/views/messages/RoomAvatarEvent.tsx index 12a8c88913..9cb91c7c44 100644 --- a/src/components/views/messages/RoomAvatarEvent.tsx +++ b/src/components/views/messages/RoomAvatarEvent.tsx @@ -18,6 +18,7 @@ limitations under the License. import React from 'react'; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from '../../../languageHandler'; import Modal from '../../../Modal'; diff --git a/src/components/views/messages/RoomCreate.tsx b/src/components/views/messages/RoomCreate.tsx index c846ba5632..844d1f5c98 100644 --- a/src/components/views/messages/RoomCreate.tsx +++ b/src/components/views/messages/RoomCreate.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import dis from '../../../dispatcher/dispatcher'; import { RoomPermalinkCreator } from '../../../utils/permalinks/Permalinks'; @@ -23,7 +24,6 @@ import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import EventTileBubble from "./EventTileBubble"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; interface IProps { /* the MatrixEvent to show */ diff --git a/src/components/views/messages/ViewSourceEvent.tsx b/src/components/views/messages/ViewSourceEvent.tsx index 488f8de5df..e1de5137d9 100644 --- a/src/components/views/messages/ViewSourceEvent.tsx +++ b/src/components/views/messages/ViewSourceEvent.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import { MatrixEvent } from 'matrix-js-sdk/src'; import classNames from 'classnames'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; diff --git a/src/components/views/right_panel/EncryptionInfo.tsx b/src/components/views/right_panel/EncryptionInfo.tsx index c9a4b3b84c..868369d708 100644 --- a/src/components/views/right_panel/EncryptionInfo.tsx +++ b/src/components/views/right_panel/EncryptionInfo.tsx @@ -15,10 +15,10 @@ limitations under the License. */ import React from "react"; - -import { _t } from "../../../languageHandler"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { User } from "matrix-js-sdk/src/models/user"; + +import { _t } from "../../../languageHandler"; import AccessibleButton from "../elements/AccessibleButton"; import Spinner from "../elements/Spinner"; diff --git a/src/components/views/right_panel/EncryptionPanel.tsx b/src/components/views/right_panel/EncryptionPanel.tsx index 8beb089b38..d26cbbce4d 100644 --- a/src/components/views/right_panel/EncryptionPanel.tsx +++ b/src/components/views/right_panel/EncryptionPanel.tsx @@ -15,10 +15,9 @@ limitations under the License. */ import React, { useCallback, useEffect, useState } from "react"; -import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { VerificationRequest, PHASE_REQUESTED, PHASE_UNSENT } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { User } from "matrix-js-sdk/src/models/user"; -import { PHASE_REQUESTED, PHASE_UNSENT } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; import EncryptionInfo from "./EncryptionInfo"; import VerificationPanel from "./VerificationPanel"; diff --git a/src/components/views/right_panel/GroupHeaderButtons.tsx b/src/components/views/right_panel/GroupHeaderButtons.tsx index 132a76e891..6ecbcb9769 100644 --- a/src/components/views/right_panel/GroupHeaderButtons.tsx +++ b/src/components/views/right_panel/GroupHeaderButtons.tsx @@ -19,6 +19,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from '../../../languageHandler'; import HeaderButton from './HeaderButton'; import HeaderButtons, { HeaderKind } from './HeaderButtons'; diff --git a/src/components/views/right_panel/HeaderButton.tsx b/src/components/views/right_panel/HeaderButton.tsx index 1625db3f55..138e418a99 100644 --- a/src/components/views/right_panel/HeaderButton.tsx +++ b/src/components/views/right_panel/HeaderButton.tsx @@ -20,6 +20,7 @@ limitations under the License. import React from 'react'; import classNames from 'classnames'; + import Analytics from '../../../Analytics'; import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/right_panel/HeaderButtons.tsx b/src/components/views/right_panel/HeaderButtons.tsx index 8d000a29fc..862f25238d 100644 --- a/src/components/views/right_panel/HeaderButtons.tsx +++ b/src/components/views/right_panel/HeaderButtons.tsx @@ -19,6 +19,7 @@ limitations under the License. */ import React from 'react'; + import dis from '../../../dispatcher/dispatcher'; import RightPanelStore from "../../../stores/RightPanelStore"; import { RightPanelPhases } from "../../../stores/RightPanelStorePhases"; diff --git a/src/components/views/right_panel/PinnedMessagesCard.tsx b/src/components/views/right_panel/PinnedMessagesCard.tsx index bb6ddb0f74..bf77cdf644 100644 --- a/src/components/views/right_panel/PinnedMessagesCard.tsx +++ b/src/components/views/right_panel/PinnedMessagesCard.tsx @@ -18,6 +18,7 @@ import React, { useCallback, useContext, useEffect, useState } from "react"; import { Room } from "matrix-js-sdk/src/models/room"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { EventType } from 'matrix-js-sdk/src/@types/event'; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../languageHandler"; import BaseCard from "./BaseCard"; @@ -29,8 +30,6 @@ import { useAsyncMemo } from "../../../hooks/useAsyncMemo"; import PinnedEventTile from "../rooms/PinnedEventTile"; import { useRoomState } from "../../../hooks/useRoomState"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { room: Room; onClose(): void; diff --git a/src/components/views/right_panel/UserInfo.tsx b/src/components/views/right_panel/UserInfo.tsx index 195cf03af4..003db101b8 100644 --- a/src/components/views/right_panel/UserInfo.tsx +++ b/src/components/views/right_panel/UserInfo.tsx @@ -26,6 +26,8 @@ import { Room } from 'matrix-js-sdk/src/models/room'; import { EventTimeline } from 'matrix-js-sdk/src/models/event-timeline'; import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { EventType } from "matrix-js-sdk/src/@types/event"; +import { logger } from "matrix-js-sdk/src/logger"; import dis from '../../../dispatcher/dispatcher'; import Modal from '../../../Modal'; @@ -62,7 +64,6 @@ import ErrorDialog from "../dialogs/ErrorDialog"; import QuestionDialog from "../dialogs/QuestionDialog"; import ConfirmUserActionDialog from "../dialogs/ConfirmUserActionDialog"; import InfoDialog from "../dialogs/InfoDialog"; -import { EventType } from "matrix-js-sdk/src/@types/event"; import { SetRightPanelPhasePayload } from "../../../dispatcher/payloads/SetRightPanelPhasePayload"; import RoomAvatar from "../avatars/RoomAvatar"; import RoomName from "../elements/RoomName"; @@ -72,8 +73,6 @@ import { ComposerInsertPayload } from "../../../dispatcher/payloads/ComposerInse import SpaceStore from "../../../stores/SpaceStore"; import ConfirmSpaceUserActionDialog from "../dialogs/ConfirmSpaceUserActionDialog"; import { bulkSpaceBehaviour } from "../../../utils/space"; - -import { logger } from "matrix-js-sdk/src/logger"; import { shouldShowComponent } from "../../../customisations/helpers/UIComponents"; import { UIComponent } from "../../../settings/UIFeature"; diff --git a/src/components/views/right_panel/VerificationPanel.tsx b/src/components/views/right_panel/VerificationPanel.tsx index 881dac33d4..2addb27c03 100644 --- a/src/components/views/right_panel/VerificationPanel.tsx +++ b/src/components/views/right_panel/VerificationPanel.tsx @@ -15,28 +15,24 @@ limitations under the License. */ import React from "react"; - -import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { verificationMethods } from 'matrix-js-sdk/src/crypto'; -import { SCAN_QR_CODE_METHOD } from "matrix-js-sdk/src/crypto/verification/QRCode"; -import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { SCAN_QR_CODE_METHOD, ReciprocateQRCode } from "matrix-js-sdk/src/crypto/verification/QRCode"; +import { VerificationRequest, Phase } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { User } from "matrix-js-sdk/src/models/user"; -import { ReciprocateQRCode } from "matrix-js-sdk/src/crypto/verification/QRCode"; import { SAS } from "matrix-js-sdk/src/crypto/verification/SAS"; +import { logger } from "matrix-js-sdk/src/logger"; +import { MatrixClientPeg } from "../../../MatrixClientPeg"; import VerificationQRCode from "../elements/crypto/VerificationQRCode"; import { _t } from "../../../languageHandler"; import SdkConfig from "../../../SdkConfig"; import E2EIcon, { E2EState } from "../rooms/E2EIcon"; -import { Phase } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; import Spinner from "../elements/Spinner"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import AccessibleButton from "../elements/AccessibleButton"; import VerificationShowSas from "../verification/VerificationShowSas"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { layout: string; request: VerificationRequest; diff --git a/src/components/views/room_settings/AliasSettings.tsx b/src/components/views/room_settings/AliasSettings.tsx index 4666ca9ef7..71ad9cd9f3 100644 --- a/src/components/views/room_settings/AliasSettings.tsx +++ b/src/components/views/room_settings/AliasSettings.tsx @@ -16,6 +16,7 @@ limitations under the License. import React, { ChangeEvent, createRef } from "react"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { logger } from "matrix-js-sdk/src/logger"; import EditableItemList from "../elements/EditableItemList"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; @@ -29,8 +30,6 @@ import RoomPublishSetting from "./RoomPublishSetting"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import RoomAliasField from "../elements/RoomAliasField"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IEditableAliasesListProps { domain?: string; } diff --git a/src/components/views/room_settings/RelatedGroupSettings.js b/src/components/views/room_settings/RelatedGroupSettings.js index f815cd77cc..737147f664 100644 --- a/src/components/views/room_settings/RelatedGroupSettings.js +++ b/src/components/views/room_settings/RelatedGroupSettings.js @@ -17,6 +17,8 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; +import { logger } from "matrix-js-sdk/src/logger"; + import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; import Modal from '../../../Modal'; @@ -24,8 +26,6 @@ import ErrorDialog from "../dialogs/ErrorDialog"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - const GROUP_ID_REGEX = /\+\S+:\S+/; @replaceableComponent("views.room_settings.RelatedGroupSettings") diff --git a/src/components/views/room_settings/RoomProfileSettings.tsx b/src/components/views/room_settings/RoomProfileSettings.tsx index 8cc7a620f8..92bb5e0647 100644 --- a/src/components/views/room_settings/RoomProfileSettings.tsx +++ b/src/components/views/room_settings/RoomProfileSettings.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { createRef } from 'react'; + import { _t } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import Field from "../elements/Field"; diff --git a/src/components/views/room_settings/UrlPreviewSettings.tsx b/src/components/views/room_settings/UrlPreviewSettings.tsx index bb639b691a..37e4d4981a 100644 --- a/src/components/views/room_settings/UrlPreviewSettings.tsx +++ b/src/components/views/room_settings/UrlPreviewSettings.tsx @@ -18,6 +18,8 @@ limitations under the License. */ import React from 'react'; +import { Room } from "matrix-js-sdk/src/models/room"; + import { _t, _td } from '../../../languageHandler'; import SettingsStore from "../../../settings/SettingsStore"; import dis from "../../../dispatcher/dispatcher"; @@ -25,7 +27,6 @@ import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { Action } from "../../../dispatcher/actions"; import { SettingLevel } from "../../../settings/SettingLevel"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { Room } from "matrix-js-sdk/src/models/room"; import SettingsFlag from "../elements/SettingsFlag"; interface IProps { diff --git a/src/components/views/rooms/AppsDrawer.tsx b/src/components/views/rooms/AppsDrawer.tsx index 4c6b8db02e..3b50309bca 100644 --- a/src/components/views/rooms/AppsDrawer.tsx +++ b/src/components/views/rooms/AppsDrawer.tsx @@ -18,6 +18,7 @@ limitations under the License. import React from 'react'; import classNames from 'classnames'; import { Resizable } from "re-resizable"; +import { Room } from "matrix-js-sdk/src/models/room"; import AppTile from '../elements/AppTile'; import dis from '../../../dispatcher/dispatcher'; @@ -34,7 +35,6 @@ import { clamp, percentageOf, percentageWithin } from "../../../utils/numbers"; import { useStateCallback } from "../../../hooks/useStateCallback"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import UIStore from "../../../stores/UIStore"; -import { Room } from "matrix-js-sdk/src/models/room"; import { IApp } from "../../../stores/WidgetStore"; import { ActionPayload } from "../../../dispatcher/payloads"; diff --git a/src/components/views/rooms/Autocomplete.tsx b/src/components/views/rooms/Autocomplete.tsx index 34909baef1..fb76d30e51 100644 --- a/src/components/views/rooms/Autocomplete.tsx +++ b/src/components/views/rooms/Autocomplete.tsx @@ -18,11 +18,10 @@ limitations under the License. import React, { createRef, KeyboardEvent } from 'react'; import classNames from 'classnames'; import { flatMap } from "lodash"; -import { ICompletion, ISelectionRange, IProviderCompletions } from '../../../autocomplete/Autocompleter'; import { Room } from 'matrix-js-sdk/src/models/room'; +import Autocompleter, { ICompletion, ISelectionRange, IProviderCompletions } from '../../../autocomplete/Autocompleter'; import SettingsStore from "../../../settings/SettingsStore"; -import Autocompleter from '../../../autocomplete/Autocompleter'; import { replaceableComponent } from "../../../utils/replaceableComponent"; const MAX_PROVIDER_MATCHES = 20; diff --git a/src/components/views/rooms/AuxPanel.tsx b/src/components/views/rooms/AuxPanel.tsx index 7afa29624a..b4d954a04b 100644 --- a/src/components/views/rooms/AuxPanel.tsx +++ b/src/components/views/rooms/AuxPanel.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import { lexicographicCompare } from 'matrix-js-sdk/src/utils'; import { Room } from 'matrix-js-sdk/src/models/room'; +import { throttle } from 'lodash'; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import AppsDrawer from './AppsDrawer'; @@ -27,7 +28,6 @@ import ResizeNotifier from "../../../utils/ResizeNotifier"; import CallViewForRoom from '../voip/CallViewForRoom'; import { objectHasDiff } from "../../../utils/objects"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { throttle } from 'lodash'; interface IProps { // js-sdk room object diff --git a/src/components/views/rooms/BasicMessageComposer.tsx b/src/components/views/rooms/BasicMessageComposer.tsx index 4d13fab190..57880ed173 100644 --- a/src/components/views/rooms/BasicMessageComposer.tsx +++ b/src/components/views/rooms/BasicMessageComposer.tsx @@ -19,6 +19,7 @@ import React, { createRef, ClipboardEvent } from 'react'; import { Room } from 'matrix-js-sdk/src/models/room'; import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; import EMOTICON_REGEX from 'emojibase-regex/emoticon'; +import { logger } from "matrix-js-sdk/src/logger"; import EditorModel from '../../../editor/model'; import HistoryManager from '../../../editor/history'; @@ -49,8 +50,6 @@ import { ICompletion } from "../../../autocomplete/Autocompleter"; import { AutocompleteAction, getKeyBindingsManager, MessageComposerAction } from '../../../KeyBindingsManager'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - // matches emoticons which follow the start of a line or whitespace const REGEX_EMOTICON_WHITESPACE = new RegExp('(?:^|\\s)(' + EMOTICON_REGEX.source + ')\\s|:^$'); export const REGEX_EMOTICON = new RegExp('(?:^|\\s)(' + EMOTICON_REGEX.source + ')$'); diff --git a/src/components/views/rooms/EditMessageComposer.tsx b/src/components/views/rooms/EditMessageComposer.tsx index 1e0a367772..6a4a259ae5 100644 --- a/src/components/views/rooms/EditMessageComposer.tsx +++ b/src/components/views/rooms/EditMessageComposer.tsx @@ -17,6 +17,9 @@ limitations under the License. import React, { createRef, KeyboardEvent } from 'react'; import classNames from 'classnames'; import { EventStatus, IContent, MatrixEvent } from 'matrix-js-sdk/src/models/event'; +import { MsgType } from 'matrix-js-sdk/src/@types/event'; +import { Room } from 'matrix-js-sdk/src/models/room'; +import { logger } from "matrix-js-sdk/src/logger"; import { _t, _td } from '../../../languageHandler'; import dis from '../../../dispatcher/dispatcher'; @@ -35,16 +38,12 @@ import { getKeyBindingsManager, MessageComposerAction } from '../../../KeyBindin import { replaceableComponent } from "../../../utils/replaceableComponent"; import SendHistoryManager from '../../../SendHistoryManager'; import Modal from '../../../Modal'; -import { MsgType } from 'matrix-js-sdk/src/@types/event'; -import { Room } from 'matrix-js-sdk/src/models/room'; import ErrorDialog from "../dialogs/ErrorDialog"; import QuestionDialog from "../dialogs/QuestionDialog"; import { ActionPayload } from "../../../dispatcher/payloads"; import AccessibleButton from '../elements/AccessibleButton'; import { createRedactEventDialog } from '../dialogs/ConfirmRedactDialog'; import SettingsStore from "../../../settings/SettingsStore"; - -import { logger } from "matrix-js-sdk/src/logger"; import { withMatrixClientHOC, MatrixClientProps } from '../../../contexts/MatrixClientContext'; import RoomContext from '../../../contexts/RoomContext'; diff --git a/src/components/views/rooms/EntityTile.tsx b/src/components/views/rooms/EntityTile.tsx index d7dd4b1092..1cf91289f6 100644 --- a/src/components/views/rooms/EntityTile.tsx +++ b/src/components/views/rooms/EntityTile.tsx @@ -17,9 +17,10 @@ limitations under the License. */ import React from 'react'; +import classNames from "classnames"; + import AccessibleButton from '../elements/AccessibleButton'; import { _td } from '../../../languageHandler'; -import classNames from "classnames"; import E2EIcon, { E2EState } from './E2EIcon'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import BaseAvatar from '../avatars/BaseAvatar'; diff --git a/src/components/views/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx index 26b25699c0..772c736e48 100644 --- a/src/components/views/rooms/EventTile.tsx +++ b/src/components/views/rooms/EventTile.tsx @@ -22,6 +22,7 @@ import { EventStatus, MatrixEvent } from "matrix-js-sdk/src/models/event"; import { Relations } from "matrix-js-sdk/src/models/relations"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { Thread, ThreadEvent } from 'matrix-js-sdk/src/models/thread'; +import { logger } from "matrix-js-sdk/src/logger"; import ReplyChain from "../elements/ReplyChain"; import { _t } from '../../../languageHandler'; @@ -61,8 +62,6 @@ import MKeyVerificationConclusion from "../messages/MKeyVerificationConclusion"; import { dispatchShowThreadEvent } from '../../../dispatcher/dispatch-actions/threads'; import { MessagePreviewStore } from '../../../stores/room-list/MessagePreviewStore'; -import { logger } from "matrix-js-sdk/src/logger"; - const eventTileTypes = { [EventType.RoomMessage]: 'messages.MessageEvent', [EventType.Sticker]: 'messages.MessageEvent', diff --git a/src/components/views/rooms/ExtraTile.tsx b/src/components/views/rooms/ExtraTile.tsx index e74dde3a0f..7828229c80 100644 --- a/src/components/views/rooms/ExtraTile.tsx +++ b/src/components/views/rooms/ExtraTile.tsx @@ -16,6 +16,7 @@ limitations under the License. import React from "react"; import classNames from "classnames"; + import { RovingAccessibleButton, RovingAccessibleTooltipButton, diff --git a/src/components/views/rooms/JumpToBottomButton.tsx b/src/components/views/rooms/JumpToBottomButton.tsx index 0b680d093d..b847b9f6b7 100644 --- a/src/components/views/rooms/JumpToBottomButton.tsx +++ b/src/components/views/rooms/JumpToBottomButton.tsx @@ -15,9 +15,10 @@ limitations under the License. */ import React from "react"; +import classNames from 'classnames'; + import { _t } from '../../../languageHandler'; import AccessibleButton from '../elements/AccessibleButton'; -import classNames from 'classnames'; interface IProps { numUnreadMessages: number; diff --git a/src/components/views/rooms/LinkPreviewGroup.tsx b/src/components/views/rooms/LinkPreviewGroup.tsx index fa9b601d5e..93757a0140 100644 --- a/src/components/views/rooms/LinkPreviewGroup.tsx +++ b/src/components/views/rooms/LinkPreviewGroup.tsx @@ -17,6 +17,7 @@ limitations under the License. import React, { useContext, useEffect } from "react"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { IPreviewUrlResponse, MatrixClient } from "matrix-js-sdk/src/client"; +import { logger } from "matrix-js-sdk/src/logger"; import { useStateToggle } from "../../../hooks/useStateToggle"; import LinkPreviewWidget from "./LinkPreviewWidget"; @@ -25,8 +26,6 @@ import { _t } from "../../../languageHandler"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { useAsyncMemo } from "../../../hooks/useAsyncMemo"; -import { logger } from "matrix-js-sdk/src/logger"; - const INITIAL_NUM_PREVIEWS = 2; interface IProps { diff --git a/src/components/views/rooms/MemberList.tsx b/src/components/views/rooms/MemberList.tsx index bf5411b0da..dffe820f30 100644 --- a/src/components/views/rooms/MemberList.tsx +++ b/src/components/views/rooms/MemberList.tsx @@ -18,6 +18,15 @@ limitations under the License. */ import React from 'react'; +import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; +import { Room } from 'matrix-js-sdk/src/models/room'; +import { RoomMember } from 'matrix-js-sdk/src/models/room-member'; +import { RoomState } from 'matrix-js-sdk/src/models/room-state'; +import { User } from "matrix-js-sdk/src/models/user"; +import { throttle } from 'lodash'; +import { JoinRule } from "matrix-js-sdk/src/@types/partials"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from '../../../languageHandler'; import SdkConfig from '../../../SdkConfig'; import dis from '../../../dispatcher/dispatcher'; @@ -30,11 +39,6 @@ import RoomAvatar from "../avatars/RoomAvatar"; import RoomName from "../elements/RoomName"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import SettingsStore from "../../../settings/SettingsStore"; -import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; -import { Room } from 'matrix-js-sdk/src/models/room'; -import { RoomMember } from 'matrix-js-sdk/src/models/room-member'; -import { RoomState } from 'matrix-js-sdk/src/models/room-state'; -import { User } from "matrix-js-sdk/src/models/user"; import TruncatedList from '../elements/TruncatedList'; import Spinner from "../elements/Spinner"; import SearchBox from "../../structures/SearchBox"; @@ -42,13 +46,9 @@ import AccessibleButton from '../elements/AccessibleButton'; import EntityTile from "./EntityTile"; import MemberTile from "./MemberTile"; import BaseAvatar from '../avatars/BaseAvatar'; -import { throttle } from 'lodash'; import SpaceStore from "../../../stores/SpaceStore"; import { shouldShowComponent } from "../../../customisations/helpers/UIComponents"; import { UIComponent } from "../../../settings/UIFeature"; -import { JoinRule } from "matrix-js-sdk/src/@types/partials"; - -import { logger } from "matrix-js-sdk/src/logger"; const getSearchQueryLSKey = (roomId: string) => `mx_MemberList_searchQuarry_${roomId}`; diff --git a/src/components/views/rooms/MemberTile.tsx b/src/components/views/rooms/MemberTile.tsx index ce571f78ad..0df5daad96 100644 --- a/src/components/views/rooms/MemberTile.tsx +++ b/src/components/views/rooms/MemberTile.tsx @@ -15,17 +15,18 @@ See the License for the specific language governing permissions and limitations under the License. */ -import SettingsStore from "../../../settings/SettingsStore"; import React from 'react'; +import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { EventType } from "matrix-js-sdk/src/@types/event"; +import { DeviceInfo } from "matrix-js-sdk/src/crypto/deviceinfo"; + +import SettingsStore from "../../../settings/SettingsStore"; import dis from "../../../dispatcher/dispatcher"; import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { Action } from "../../../dispatcher/actions"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { RoomMember } from "matrix-js-sdk/src/models/room-member"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; -import { EventType } from "matrix-js-sdk/src/@types/event"; -import { DeviceInfo } from "matrix-js-sdk/src/crypto/deviceinfo"; import EntityTile, { PowerStatus } from "./EntityTile"; import MemberAvatar from "./../avatars/MemberAvatar"; diff --git a/src/components/views/rooms/MessageComposer.tsx b/src/components/views/rooms/MessageComposer.tsx index 79f613b996..57fc2dfa38 100644 --- a/src/components/views/rooms/MessageComposer.tsx +++ b/src/components/views/rooms/MessageComposer.tsx @@ -15,11 +15,13 @@ limitations under the License. */ import React, { createRef } from 'react'; import classNames from 'classnames'; -import { _t } from '../../../languageHandler'; -import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { MatrixEvent, IEventRelation } from "matrix-js-sdk/src/models/event"; import { Room } from "matrix-js-sdk/src/models/room"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { RelationType } from 'matrix-js-sdk/src/@types/event'; + +import { _t } from '../../../languageHandler'; +import { MatrixClientPeg } from '../../../MatrixClientPeg'; import dis from '../../../dispatcher/dispatcher'; import { ActionPayload } from "../../../dispatcher/payloads"; import Stickerpicker from './Stickerpicker'; @@ -54,7 +56,6 @@ import MemberStatusMessageAvatar from "../avatars/MemberStatusMessageAvatar"; import UIStore, { UI_EVENTS } from '../../../stores/UIStore'; import Modal from "../../../Modal"; import InfoDialog from "../dialogs/InfoDialog"; -import { RelationType } from 'matrix-js-sdk/src/@types/event'; import RoomContext from '../../../contexts/RoomContext'; let instanceCount = 0; diff --git a/src/components/views/rooms/NotificationBadge.tsx b/src/components/views/rooms/NotificationBadge.tsx index a97d51fc90..4f05cd01ef 100644 --- a/src/components/views/rooms/NotificationBadge.tsx +++ b/src/components/views/rooms/NotificationBadge.tsx @@ -16,6 +16,7 @@ limitations under the License. import React, { MouseEvent } from "react"; import classNames from "classnames"; + import { formatCount } from "../../../utils/FormattingUtils"; import SettingsStore from "../../../settings/SettingsStore"; import AccessibleButton from "../elements/AccessibleButton"; diff --git a/src/components/views/rooms/ReadReceiptMarker.tsx b/src/components/views/rooms/ReadReceiptMarker.tsx index f2ce7e3967..1b477d9988 100644 --- a/src/components/views/rooms/ReadReceiptMarker.tsx +++ b/src/components/views/rooms/ReadReceiptMarker.tsx @@ -17,17 +17,15 @@ limitations under the License. import React, { createRef, RefObject } from 'react'; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from '../../../languageHandler'; import { formatDate } from '../../../DateUtils'; import NodeAnimator from "../../../NodeAnimator"; import { toPx } from "../../../utils/units"; import { replaceableComponent } from "../../../utils/replaceableComponent"; - import MemberAvatar from '../avatars/MemberAvatar'; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { // the RoomMember to show the RR for member?: RoomMember; diff --git a/src/components/views/rooms/ReplyPreview.tsx b/src/components/views/rooms/ReplyPreview.tsx index a1dfddfe19..1786e5061a 100644 --- a/src/components/views/rooms/ReplyPreview.tsx +++ b/src/components/views/rooms/ReplyPreview.tsx @@ -15,12 +15,13 @@ limitations under the License. */ import React from 'react'; +import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; + import dis from '../../../dispatcher/dispatcher'; import { _t } from '../../../languageHandler'; import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import ReplyTile from './ReplyTile'; -import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; import RoomContext, { TimelineRenderingType } from '../../../contexts/RoomContext'; function cancelQuoting(context: TimelineRenderingType) { diff --git a/src/components/views/rooms/ReplyTile.tsx b/src/components/views/rooms/ReplyTile.tsx index b869979d58..146591b16b 100644 --- a/src/components/views/rooms/ReplyTile.tsx +++ b/src/components/views/rooms/ReplyTile.tsx @@ -16,21 +16,21 @@ limitations under the License. import React, { createRef } from 'react'; import classNames from 'classnames'; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { EventType, MsgType } from 'matrix-js-sdk/src/@types/event'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from '../../../languageHandler'; import dis from '../../../dispatcher/dispatcher'; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { RoomPermalinkCreator } from '../../../utils/permalinks/Permalinks'; import SenderProfile from "../messages/SenderProfile"; import MImageReplyBody from "../messages/MImageReplyBody"; import * as sdk from '../../../index'; -import { EventType, MsgType } from 'matrix-js-sdk/src/@types/event'; import { replaceableComponent } from '../../../utils/replaceableComponent'; import { getEventDisplayInfo, isVoiceMessage } from '../../../utils/EventUtils'; import MFileBody from "../messages/MFileBody"; import MVoiceMessageBody from "../messages/MVoiceMessageBody"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { mxEvent: MatrixEvent; permalinkCreator?: RoomPermalinkCreator; diff --git a/src/components/views/rooms/RoomBreadcrumbs.tsx b/src/components/views/rooms/RoomBreadcrumbs.tsx index a20c409a53..e99876d845 100644 --- a/src/components/views/rooms/RoomBreadcrumbs.tsx +++ b/src/components/views/rooms/RoomBreadcrumbs.tsx @@ -15,14 +15,15 @@ limitations under the License. */ import React from "react"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { CSSTransition } from "react-transition-group"; + import { BreadcrumbsStore } from "../../../stores/BreadcrumbsStore"; import DecoratedRoomAvatar from "../avatars/DecoratedRoomAvatar"; import { _t } from "../../../languageHandler"; -import { Room } from "matrix-js-sdk/src/models/room"; import defaultDispatcher from "../../../dispatcher/dispatcher"; import Analytics from "../../../Analytics"; import { UPDATE_EVENT } from "../../../stores/AsyncStore"; -import { CSSTransition } from "react-transition-group"; import { RovingAccessibleTooltipButton } from "../../../accessibility/RovingTabIndex"; import Toolbar from "../../../accessibility/Toolbar"; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/rooms/RoomDetailList.tsx b/src/components/views/rooms/RoomDetailList.tsx index 869ab9e8f3..6095082834 100644 --- a/src/components/views/rooms/RoomDetailList.tsx +++ b/src/components/views/rooms/RoomDetailList.tsx @@ -17,9 +17,9 @@ limitations under the License. import React from 'react'; import { Room } from 'matrix-js-sdk/src'; import classNames from 'classnames'; + import dis from '../../../dispatcher/dispatcher'; import { _t } from '../../../languageHandler'; - import { replaceableComponent } from "../../../utils/replaceableComponent"; import RoomDetailRow from "./RoomDetailRow"; diff --git a/src/components/views/rooms/RoomDetailRow.js b/src/components/views/rooms/RoomDetailRow.js index f4be44b1af..99ba410431 100644 --- a/src/components/views/rooms/RoomDetailRow.js +++ b/src/components/views/rooms/RoomDetailRow.js @@ -14,11 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import * as sdk from '../../../index'; import React, { createRef } from 'react'; +import PropTypes from 'prop-types'; + +import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; import { linkifyElement } from '../../../HtmlUtils'; -import PropTypes from 'prop-types'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { mediaFromMxc } from "../../../customisations/Media"; import { getDisplayAliasForAliasSet } from '../../../Rooms'; diff --git a/src/components/views/rooms/RoomHeader.tsx b/src/components/views/rooms/RoomHeader.tsx index a1cd079ccb..5b70a034c5 100644 --- a/src/components/views/rooms/RoomHeader.tsx +++ b/src/components/views/rooms/RoomHeader.tsx @@ -17,9 +17,11 @@ limitations under the License. import React from 'react'; import classNames from 'classnames'; +import { throttle } from 'lodash'; +import { MatrixEvent, Room, RoomState } from 'matrix-js-sdk/src'; + import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; - import SettingsStore from "../../../settings/SettingsStore"; import RoomHeaderButtons from '../right_panel/RoomHeaderButtons'; import E2EIcon from './E2EIcon'; @@ -31,8 +33,6 @@ import { PlaceCallType } from "../../../CallHandler"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import Modal from '../../../Modal'; import InfoDialog from "../dialogs/InfoDialog"; -import { throttle } from 'lodash'; -import { MatrixEvent, Room, RoomState } from 'matrix-js-sdk/src'; import { E2EStatus } from '../../../utils/ShieldUtils'; import { IOOBData } from '../../../stores/ThreepidInviteStore'; import { SearchScope } from './SearchBar'; diff --git a/src/components/views/rooms/RoomList.tsx b/src/components/views/rooms/RoomList.tsx index 90250f2d77..8dfa75e269 100644 --- a/src/components/views/rooms/RoomList.tsx +++ b/src/components/views/rooms/RoomList.tsx @@ -19,6 +19,7 @@ import { Dispatcher } from "flux"; import { Room } from "matrix-js-sdk/src/models/room"; import * as fbEmitter from "fbemitter"; import { EventType } from "matrix-js-sdk/src/@types/event"; +import { JoinRule } from "matrix-js-sdk/src/@types/partials"; import { _t, _td } from "../../../languageHandler"; import { RovingTabIndexProvider } from "../../../accessibility/RovingTabIndex"; @@ -51,7 +52,6 @@ import RoomAvatar from "../avatars/RoomAvatar"; import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; import { shouldShowComponent } from "../../../customisations/helpers/UIComponents"; import { UIComponent } from "../../../settings/UIFeature"; -import { JoinRule } from "matrix-js-sdk/src/@types/partials"; interface IProps { onKeyDown: (ev: React.KeyboardEvent) => void; diff --git a/src/components/views/rooms/RoomPreviewBar.tsx b/src/components/views/rooms/RoomPreviewBar.tsx index 82437a5c14..89ca084ccd 100644 --- a/src/components/views/rooms/RoomPreviewBar.tsx +++ b/src/components/views/rooms/RoomPreviewBar.tsx @@ -20,11 +20,11 @@ import { MatrixError } from "matrix-js-sdk/src/http-api"; import { EventType, RoomType } from "matrix-js-sdk/src/@types/event"; import { IJoinRuleEventContent, JoinRule } from "matrix-js-sdk/src/@types/partials"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import classNames from 'classnames'; import * as sdk from '../../../index'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import dis from '../../../dispatcher/dispatcher'; -import classNames from 'classnames'; import { _t } from '../../../languageHandler'; import SdkConfig from "../../../SdkConfig"; import IdentityAuthClient from '../../../IdentityAuthClient'; diff --git a/src/components/views/rooms/RoomSublist.tsx b/src/components/views/rooms/RoomSublist.tsx index 0d2ef25951..76d954c00b 100644 --- a/src/components/views/rooms/RoomSublist.tsx +++ b/src/components/views/rooms/RoomSublist.tsx @@ -21,6 +21,9 @@ import { createRef, ReactComponentElement } from "react"; import { normalize } from "matrix-js-sdk/src/utils"; import { Room } from "matrix-js-sdk/src/models/room"; import classNames from 'classnames'; +import { Enable, Resizable } from "re-resizable"; +import { Direction } from "re-resizable/lib/resizer"; + import { RovingAccessibleButton, RovingTabIndexWrapper } from "../../../accessibility/RovingTabIndex"; import { _t } from "../../../languageHandler"; import AccessibleButton from "../../views/elements/AccessibleButton"; @@ -42,8 +45,6 @@ import NotificationBadge from "./NotificationBadge"; import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; import { Key } from "../../../Keyboard"; import { ActionPayload } from "../../../dispatcher/payloads"; -import { Enable, Resizable } from "re-resizable"; -import { Direction } from "re-resizable/lib/resizer"; import { polyfillTouchEvent } from "../../../@types/polyfill"; import ResizeNotifier from "../../../utils/ResizeNotifier"; import { RoomNotificationStateStore } from "../../../stores/notifications/RoomNotificationStateStore"; diff --git a/src/components/views/rooms/RoomTile.tsx b/src/components/views/rooms/RoomTile.tsx index eb13d7e96e..5f8c214a69 100644 --- a/src/components/views/rooms/RoomTile.tsx +++ b/src/components/views/rooms/RoomTile.tsx @@ -18,6 +18,8 @@ limitations under the License. import React, { createRef } from "react"; import { Room } from "matrix-js-sdk/src/models/room"; import classNames from "classnames"; +import { logger } from "matrix-js-sdk/src/logger"; + import { RovingTabIndexWrapper } from "../../../accessibility/RovingTabIndex"; import AccessibleButton, { ButtonEvent } from "../../views/elements/AccessibleButton"; import dis from '../../../dispatcher/dispatcher'; @@ -50,8 +52,6 @@ import IconizedContextMenu, { import { CommunityPrototypeStore, IRoomProfile } from "../../../stores/CommunityPrototypeStore"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { room: Room; showMessagePreview: boolean; diff --git a/src/components/views/rooms/RoomUpgradeWarningBar.tsx b/src/components/views/rooms/RoomUpgradeWarningBar.tsx index eb334ab825..1b368fcb44 100644 --- a/src/components/views/rooms/RoomUpgradeWarningBar.tsx +++ b/src/components/views/rooms/RoomUpgradeWarningBar.tsx @@ -20,7 +20,6 @@ import { Room } from 'matrix-js-sdk/src/models/room'; import { RoomState } from 'matrix-js-sdk/src/models/room-state'; import Modal from '../../../Modal'; - import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/rooms/SearchBar.tsx b/src/components/views/rooms/SearchBar.tsx index 81d0402050..c8b03b99d6 100644 --- a/src/components/views/rooms/SearchBar.tsx +++ b/src/components/views/rooms/SearchBar.tsx @@ -16,8 +16,9 @@ limitations under the License. */ import React, { createRef, RefObject } from 'react'; -import AccessibleButton from "../elements/AccessibleButton"; import classNames from "classnames"; + +import AccessibleButton from "../elements/AccessibleButton"; import { _t } from '../../../languageHandler'; import { Key } from "../../../Keyboard"; import DesktopBuildsNotice, { WarningKind } from "../elements/DesktopBuildsNotice"; diff --git a/src/components/views/rooms/SearchResultTile.tsx b/src/components/views/rooms/SearchResultTile.tsx index c033855eb5..376c3166a9 100644 --- a/src/components/views/rooms/SearchResultTile.tsx +++ b/src/components/views/rooms/SearchResultTile.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from "react"; import { SearchResult } from "matrix-js-sdk/src/models/search-result"; + import RoomContext from "../../../contexts/RoomContext"; import SettingsStore from "../../../settings/SettingsStore"; import { UIFeature } from "../../../settings/UIFeature"; diff --git a/src/components/views/rooms/SendMessageComposer.tsx b/src/components/views/rooms/SendMessageComposer.tsx index c32a31f249..d855e902cb 100644 --- a/src/components/views/rooms/SendMessageComposer.tsx +++ b/src/components/views/rooms/SendMessageComposer.tsx @@ -20,6 +20,7 @@ import { IContent, MatrixEvent, IEventRelation } from 'matrix-js-sdk/src/models/ import { DebouncedFunc, throttle } from 'lodash'; import { EventType, RelationType } from "matrix-js-sdk/src/@types/event"; import { logger } from "matrix-js-sdk/src/logger"; +import { Room } from 'matrix-js-sdk/src/models/room'; import dis from '../../../dispatcher/dispatcher'; import EditorModel from '../../../editor/model'; @@ -51,7 +52,6 @@ import { getKeyBindingsManager, MessageComposerAction } from '../../../KeyBindin import { replaceableComponent } from "../../../utils/replaceableComponent"; import SettingsStore from '../../../settings/SettingsStore'; import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; -import { Room } from 'matrix-js-sdk/src/models/room'; import ErrorDialog from "../dialogs/ErrorDialog"; import QuestionDialog from "../dialogs/QuestionDialog"; import { ActionPayload } from "../../../dispatcher/payloads"; diff --git a/src/components/views/rooms/SimpleRoomHeader.tsx b/src/components/views/rooms/SimpleRoomHeader.tsx index d6effaceb4..5c83f1df14 100644 --- a/src/components/views/rooms/SimpleRoomHeader.tsx +++ b/src/components/views/rooms/SimpleRoomHeader.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { replaceableComponent } from "../../../utils/replaceableComponent"; interface IProps { diff --git a/src/components/views/rooms/Stickerpicker.tsx b/src/components/views/rooms/Stickerpicker.tsx index 1f59d3a71e..137dc16f0f 100644 --- a/src/components/views/rooms/Stickerpicker.tsx +++ b/src/components/views/rooms/Stickerpicker.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React from 'react'; import { Room } from 'matrix-js-sdk/src/models/room'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t, _td } from '../../../languageHandler'; import AppTile from '../elements/AppTile'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; @@ -34,8 +36,6 @@ import ScalarAuthClient from '../../../ScalarAuthClient'; import GenericElementContextMenu from "../context_menus/GenericElementContextMenu"; import { IApp } from "../../../stores/WidgetStore"; -import { logger } from "matrix-js-sdk/src/logger"; - // This should be below the dialog level (4000), but above the rest of the UI (1000-2000). // We sit in a context menu, so this should be given to the context menu. const STICKERPICKER_Z_INDEX = 3500; diff --git a/src/components/views/rooms/ThirdPartyMemberInfo.tsx b/src/components/views/rooms/ThirdPartyMemberInfo.tsx index c29c558655..9a8533007b 100644 --- a/src/components/views/rooms/ThirdPartyMemberInfo.tsx +++ b/src/components/views/rooms/ThirdPartyMemberInfo.tsx @@ -15,9 +15,11 @@ limitations under the License. */ import React from 'react'; -import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { Room } from "matrix-js-sdk/src/models/room"; +import { logger } from "matrix-js-sdk/src/logger"; + +import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { _t } from "../../../languageHandler"; import dis from "../../../dispatcher/dispatcher"; import Modal from "../../../Modal"; @@ -29,8 +31,6 @@ import ErrorDialog from '../dialogs/ErrorDialog'; import AccessibleButton from '../elements/AccessibleButton'; import SpaceStore from "../../../stores/SpaceStore"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { event: MatrixEvent; } diff --git a/src/components/views/rooms/TopUnreadMessagesBar.tsx b/src/components/views/rooms/TopUnreadMessagesBar.tsx index 14f9a27f2d..a9cb451783 100644 --- a/src/components/views/rooms/TopUnreadMessagesBar.tsx +++ b/src/components/views/rooms/TopUnreadMessagesBar.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from '../../../languageHandler'; import AccessibleButton from '../elements/AccessibleButton'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/rooms/VoiceRecordComposerTile.tsx b/src/components/views/rooms/VoiceRecordComposerTile.tsx index e50672ed4a..18a49dd4c7 100644 --- a/src/components/views/rooms/VoiceRecordComposerTile.tsx +++ b/src/components/views/rooms/VoiceRecordComposerTile.tsx @@ -14,11 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ +import React, { ReactNode } from "react"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { MsgType } from "matrix-js-sdk/src/@types/event"; +import { logger } from "matrix-js-sdk/src/logger"; + import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; import { _t } from "../../../languageHandler"; -import React, { ReactNode } from "react"; import { IUpload, RecordingState, VoiceRecording } from "../../../audio/VoiceRecording"; -import { Room } from "matrix-js-sdk/src/models/room"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import LiveRecordingWaveform from "../audio_messages/LiveRecordingWaveform"; import { replaceableComponent } from "../../../utils/replaceableComponent"; @@ -26,7 +29,6 @@ import LiveRecordingClock from "../audio_messages/LiveRecordingClock"; import { VoiceRecordingStore } from "../../../stores/VoiceRecordingStore"; import { UPDATE_EVENT } from "../../../stores/AsyncStore"; import RecordingPlayback from "../audio_messages/RecordingPlayback"; -import { MsgType } from "matrix-js-sdk/src/@types/event"; import Modal from "../../../Modal"; import ErrorDialog from "../dialogs/ErrorDialog"; import MediaDeviceHandler, { MediaDeviceKindEnum } from "../../../MediaDeviceHandler"; @@ -36,8 +38,6 @@ import { NotificationColor } from "../../../stores/notifications/NotificationCol import InlineSpinner from "../elements/InlineSpinner"; import { PlaybackManager } from "../../../audio/PlaybackManager"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { room: Room; } diff --git a/src/components/views/settings/AvatarSetting.tsx b/src/components/views/settings/AvatarSetting.tsx index 806d0adb73..480d41d303 100644 --- a/src/components/views/settings/AvatarSetting.tsx +++ b/src/components/views/settings/AvatarSetting.tsx @@ -15,9 +15,10 @@ limitations under the License. */ import React, { useState } from "react"; +import classNames from "classnames"; + import { _t } from "../../../languageHandler"; import AccessibleButton from "../elements/AccessibleButton"; -import classNames from "classnames"; interface IProps { avatarUrl?: string; diff --git a/src/components/views/settings/BridgeTile.tsx b/src/components/views/settings/BridgeTile.tsx index d8beeddfc5..5fa06e3ff3 100644 --- a/src/components/views/settings/BridgeTile.tsx +++ b/src/components/views/settings/BridgeTile.tsx @@ -16,19 +16,19 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../languageHandler"; import Pill from "../elements/Pill"; import { makeUserPermalink } from "../../../utils/permalinks/Permalinks"; import BaseAvatar from "../avatars/BaseAvatar"; import SettingsStore from "../../../settings/SettingsStore"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; -import { Room } from "matrix-js-sdk/src/models/room"; import { isUrlPermitted } from '../../../HtmlUtils'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { mediaFromMxc } from "../../../customisations/Media"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { ev: MatrixEvent; room: Room; diff --git a/src/components/views/settings/ChangeAvatar.tsx b/src/components/views/settings/ChangeAvatar.tsx index 36178540f7..e46a6d912c 100644 --- a/src/components/views/settings/ChangeAvatar.tsx +++ b/src/components/views/settings/ChangeAvatar.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; import { Room } from 'matrix-js-sdk/src/models/room'; + import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { _t } from '../../../languageHandler'; import Spinner from '../elements/Spinner'; diff --git a/src/components/views/settings/ChangeDisplayName.tsx b/src/components/views/settings/ChangeDisplayName.tsx index 9f0f813ec6..3e1ff0cb7d 100644 --- a/src/components/views/settings/ChangeDisplayName.tsx +++ b/src/components/views/settings/ChangeDisplayName.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/settings/ChangePassword.tsx b/src/components/views/settings/ChangePassword.tsx index 4bde294aa4..09f70a8924 100644 --- a/src/components/views/settings/ChangePassword.tsx +++ b/src/components/views/settings/ChangePassword.tsx @@ -15,8 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Field from "../elements/Field"; import React from 'react'; +import { MatrixClient } from "matrix-js-sdk/src/client"; + +import Field from "../elements/Field"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import AccessibleButton from '../elements/AccessibleButton'; import Spinner from '../elements/Spinner'; @@ -27,7 +29,6 @@ import PassphraseField from "../auth/PassphraseField"; import CountlyAnalytics from "../../../CountlyAnalytics"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { PASSWORD_MIN_SCORE } from '../auth/RegistrationForm'; -import { MatrixClient } from "matrix-js-sdk/src/client"; import SetEmailDialog from "../dialogs/SetEmailDialog"; import QuestionDialog from "../dialogs/QuestionDialog"; diff --git a/src/components/views/settings/CrossSigningPanel.tsx b/src/components/views/settings/CrossSigningPanel.tsx index bb46e84d70..3457e9962c 100644 --- a/src/components/views/settings/CrossSigningPanel.tsx +++ b/src/components/views/settings/CrossSigningPanel.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React from 'react'; +import { MatrixEvent } from 'matrix-js-sdk/src'; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from '../../../languageHandler'; @@ -24,12 +26,9 @@ import Spinner from '../elements/Spinner'; import InteractiveAuthDialog from '../dialogs/InteractiveAuthDialog'; import ConfirmDestroyCrossSigningDialog from '../dialogs/security/ConfirmDestroyCrossSigningDialog'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { MatrixEvent } from 'matrix-js-sdk/src'; import SetupEncryptionDialog from '../dialogs/security/SetupEncryptionDialog'; import { accessSecretStorage } from '../../../SecurityManager'; -import { logger } from "matrix-js-sdk/src/logger"; - interface IState { error?: Error; crossSigningPublicKeysOnDevice?: boolean; diff --git a/src/components/views/settings/DevicesPanel.tsx b/src/components/views/settings/DevicesPanel.tsx index c2dc924694..fded9d3254 100644 --- a/src/components/views/settings/DevicesPanel.tsx +++ b/src/components/views/settings/DevicesPanel.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import classNames from 'classnames'; import { IMyDevice } from "matrix-js-sdk/src/client"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from '../../../languageHandler'; @@ -28,8 +29,6 @@ import DevicesPanelEntry from "./DevicesPanelEntry"; import Spinner from "../elements/Spinner"; import AccessibleButton from "../elements/AccessibleButton"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { className?: string; } diff --git a/src/components/views/settings/DevicesPanelEntry.tsx b/src/components/views/settings/DevicesPanelEntry.tsx index 6d73e1fe86..74a6bc4261 100644 --- a/src/components/views/settings/DevicesPanelEntry.tsx +++ b/src/components/views/settings/DevicesPanelEntry.tsx @@ -16,6 +16,7 @@ limitations under the License. import React from 'react'; import { IMyDevice } from 'matrix-js-sdk/src/client'; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; @@ -24,8 +25,6 @@ import StyledCheckbox from '../elements/StyledCheckbox'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import EditableTextContainer from "../elements/EditableTextContainer"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { device?: IMyDevice; onDeviceToggled?: (device: IMyDevice) => void; diff --git a/src/components/views/settings/FontScalingPanel.tsx b/src/components/views/settings/FontScalingPanel.tsx index aabfc1c9a4..dcb213c549 100644 --- a/src/components/views/settings/FontScalingPanel.tsx +++ b/src/components/views/settings/FontScalingPanel.tsx @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import React, { ChangeEvent } from 'react'; + import EventTilePreview from '../elements/EventTilePreview'; import Field from '../elements/Field'; -import React, { ChangeEvent } from 'react'; import SettingsFlag from '../elements/SettingsFlag'; import SettingsStore from "../../../settings/SettingsStore"; import Slider from "../elements/Slider"; diff --git a/src/components/views/settings/IntegrationManager.tsx b/src/components/views/settings/IntegrationManager.tsx index 0b880c019f..f30b3f2961 100644 --- a/src/components/views/settings/IntegrationManager.tsx +++ b/src/components/views/settings/IntegrationManager.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from '../../../languageHandler'; import dis from '../../../dispatcher/dispatcher'; import { Key } from "../../../Keyboard"; diff --git a/src/components/views/settings/LayoutSwitcher.tsx b/src/components/views/settings/LayoutSwitcher.tsx index ad8abd0033..8adbfb6aae 100644 --- a/src/components/views/settings/LayoutSwitcher.tsx +++ b/src/components/views/settings/LayoutSwitcher.tsx @@ -18,6 +18,7 @@ limitations under the License. import React from "react"; import classNames from "classnames"; + import SettingsStore from "../../../settings/SettingsStore"; import EventTilePreview from "../elements/EventTilePreview"; import StyledRadioButton from "../elements/StyledRadioButton"; diff --git a/src/components/views/settings/Notifications.tsx b/src/components/views/settings/Notifications.tsx index 133e9dda77..7340c1f637 100644 --- a/src/components/views/settings/Notifications.tsx +++ b/src/components/views/settings/Notifications.tsx @@ -15,9 +15,12 @@ limitations under the License. */ import React from "react"; +import { IAnnotatedPushRule, IPusher, PushRuleAction, PushRuleKind, RuleId } from "matrix-js-sdk/src/@types/PushRules"; +import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; +import { logger } from "matrix-js-sdk/src/logger"; + import Spinner from "../elements/Spinner"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; -import { IAnnotatedPushRule, IPusher, PushRuleAction, PushRuleKind, RuleId } from "matrix-js-sdk/src/@types/PushRules"; import { ContentRules, IContentRules, @@ -26,7 +29,6 @@ import { VectorState, } from "../../../notifications"; import { _t, TranslatedString } from "../../../languageHandler"; -import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; import LabelledToggleSwitch from "../elements/LabelledToggleSwitch"; import SettingsStore from "../../../settings/SettingsStore"; import StyledRadioButton from "../elements/StyledRadioButton"; @@ -39,8 +41,6 @@ import TagComposer from "../elements/TagComposer"; import { objectClone } from "../../../utils/objects"; import { arrayDiff } from "../../../utils/arrays"; -import { logger } from "matrix-js-sdk/src/logger"; - // TODO: this "view" component still has far too much application logic in it, // which should be factored out to other files. diff --git a/src/components/views/settings/ProfileSettings.tsx b/src/components/views/settings/ProfileSettings.tsx index c675de9433..3185783ef0 100644 --- a/src/components/views/settings/ProfileSettings.tsx +++ b/src/components/views/settings/ProfileSettings.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React, { createRef } from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import Field from "../elements/Field"; @@ -27,8 +29,6 @@ import { mediaFromMxc } from "../../../customisations/Media"; import AccessibleButton from '../elements/AccessibleButton'; import AvatarSetting from './AvatarSetting'; -import { logger } from "matrix-js-sdk/src/logger"; - interface IState { userId?: string; originalDisplayName?: string; diff --git a/src/components/views/settings/SecureBackupPanel.tsx b/src/components/views/settings/SecureBackupPanel.tsx index d69cf250a6..f0c39cf10f 100644 --- a/src/components/views/settings/SecureBackupPanel.tsx +++ b/src/components/views/settings/SecureBackupPanel.tsx @@ -16,6 +16,9 @@ limitations under the License. */ import React from 'react'; +import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup"; +import { TrustInfo } from "matrix-js-sdk/src/crypto/backup"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from '../../../languageHandler'; @@ -27,8 +30,6 @@ import QuestionDialog from '../dialogs/QuestionDialog'; import RestoreKeyBackupDialog from '../dialogs/security/RestoreKeyBackupDialog'; import { accessSecretStorage } from '../../../SecurityManager'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup"; -import { TrustInfo } from "matrix-js-sdk/src/crypto/backup"; interface IState { loading: boolean; @@ -43,8 +44,6 @@ interface IState { sessionsRemaining: number; } -import { logger } from "matrix-js-sdk/src/logger"; - @replaceableComponent("views.settings.SecureBackupPanel") export default class SecureBackupPanel extends React.PureComponent<{}, IState> { private unmounted = false; diff --git a/src/components/views/settings/SetIdServer.tsx b/src/components/views/settings/SetIdServer.tsx index 3eb6041a8f..d38e908332 100644 --- a/src/components/views/settings/SetIdServer.tsx +++ b/src/components/views/settings/SetIdServer.tsx @@ -16,6 +16,8 @@ limitations under the License. import url from 'url'; import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import Modal from '../../../Modal'; @@ -32,8 +34,6 @@ import AccessibleButton from '../elements/AccessibleButton'; import Field from '../elements/Field'; import QuestionDialog from "../dialogs/QuestionDialog"; -import { logger } from "matrix-js-sdk/src/logger"; - // We'll wait up to this long when checking for 3PID bindings on the IS. const REACHABILITY_TIMEOUT = 10000; // ms diff --git a/src/components/views/settings/SetIntegrationManager.tsx b/src/components/views/settings/SetIntegrationManager.tsx index dc33a9e20e..100afea9a6 100644 --- a/src/components/views/settings/SetIntegrationManager.tsx +++ b/src/components/views/settings/SetIntegrationManager.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../languageHandler"; import { IntegrationManagers } from "../../../integrations/IntegrationManagers"; import { IntegrationManagerInstance } from "../../../integrations/IntegrationManagerInstance"; @@ -23,8 +25,6 @@ import { SettingLevel } from "../../../settings/SettingLevel"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import ToggleSwitch from "../elements/ToggleSwitch"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { } diff --git a/src/components/views/settings/SpellCheckSettings.tsx b/src/components/views/settings/SpellCheckSettings.tsx index c653b272c8..2864be34fc 100644 --- a/src/components/views/settings/SpellCheckSettings.tsx +++ b/src/components/views/settings/SpellCheckSettings.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import SpellCheckLanguagesDropdown from "../../../components/views/elements/SpellCheckLanguagesDropdown"; import AccessibleButton from "../../../components/views/elements/AccessibleButton"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/settings/ThemeChoicePanel.tsx b/src/components/views/settings/ThemeChoicePanel.tsx index caa07bd0ad..d71b6b66ad 100644 --- a/src/components/views/settings/ThemeChoicePanel.tsx +++ b/src/components/views/settings/ThemeChoicePanel.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../languageHandler"; import SettingsStore from "../../../settings/SettingsStore"; import { enumerateThemes } from "../../../theme"; @@ -30,8 +32,6 @@ import { SettingLevel } from "../../../settings/SettingLevel"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { compare } from "../../../utils/strings"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { } diff --git a/src/components/views/settings/account/EmailAddresses.tsx b/src/components/views/settings/account/EmailAddresses.tsx index 039d20f3e8..ba725c5225 100644 --- a/src/components/views/settings/account/EmailAddresses.tsx +++ b/src/components/views/settings/account/EmailAddresses.tsx @@ -16,6 +16,9 @@ limitations under the License. */ import React from 'react'; +import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../../languageHandler"; import { MatrixClientPeg } from "../../../../MatrixClientPeg"; import Field from "../../elements/Field"; @@ -25,9 +28,6 @@ import AddThreepid from "../../../../AddThreepid"; import Modal from '../../../../Modal'; import { replaceableComponent } from "../../../../utils/replaceableComponent"; import ErrorDialog from "../../dialogs/ErrorDialog"; -import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; - -import { logger } from "matrix-js-sdk/src/logger"; /* TODO: Improve the UX for everything in here. diff --git a/src/components/views/settings/account/PhoneNumbers.tsx b/src/components/views/settings/account/PhoneNumbers.tsx index 4a380980d8..770bdb889d 100644 --- a/src/components/views/settings/account/PhoneNumbers.tsx +++ b/src/components/views/settings/account/PhoneNumbers.tsx @@ -16,6 +16,9 @@ limitations under the License. */ import React from 'react'; +import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../../languageHandler"; import { MatrixClientPeg } from "../../../../MatrixClientPeg"; import Field from "../../elements/Field"; @@ -24,12 +27,9 @@ import AddThreepid from "../../../../AddThreepid"; import CountryDropdown from "../../auth/CountryDropdown"; import Modal from '../../../../Modal'; import { replaceableComponent } from "../../../../utils/replaceableComponent"; -import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; import ErrorDialog from "../../dialogs/ErrorDialog"; import { PhoneNumberCountryDefinition } from "../../../../phonenumber"; -import { logger } from "matrix-js-sdk/src/logger"; - /* TODO: Improve the UX for everything in here. This is a copy/paste of EmailAddresses, mostly. diff --git a/src/components/views/settings/discovery/EmailAddresses.tsx b/src/components/views/settings/discovery/EmailAddresses.tsx index 48ccc13d72..316e20202e 100644 --- a/src/components/views/settings/discovery/EmailAddresses.tsx +++ b/src/components/views/settings/discovery/EmailAddresses.tsx @@ -16,18 +16,17 @@ limitations under the License. */ import React from 'react'; +import { IThreepid } from "matrix-js-sdk/src/@types/threepids"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../../languageHandler"; import { MatrixClientPeg } from "../../../../MatrixClientPeg"; import Modal from '../../../../Modal'; import AddThreepid from '../../../../AddThreepid'; import { replaceableComponent } from "../../../../utils/replaceableComponent"; -import { IThreepid } from "matrix-js-sdk/src/@types/threepids"; import ErrorDialog from "../../dialogs/ErrorDialog"; import AccessibleButton from "../../elements/AccessibleButton"; -import { logger } from "matrix-js-sdk/src/logger"; - /* TODO: Improve the UX for everything in here. It's very much placeholder, but it gets the job done. The old way of handling diff --git a/src/components/views/settings/discovery/PhoneNumbers.tsx b/src/components/views/settings/discovery/PhoneNumbers.tsx index 65ab1af28d..13bef06e4b 100644 --- a/src/components/views/settings/discovery/PhoneNumbers.tsx +++ b/src/components/views/settings/discovery/PhoneNumbers.tsx @@ -16,19 +16,18 @@ limitations under the License. */ import React from 'react'; +import { IThreepid } from "matrix-js-sdk/src/@types/threepids"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../../languageHandler"; import { MatrixClientPeg } from "../../../../MatrixClientPeg"; import Modal from '../../../../Modal'; import AddThreepid from '../../../../AddThreepid'; import { replaceableComponent } from "../../../../utils/replaceableComponent"; -import { IThreepid } from "matrix-js-sdk/src/@types/threepids"; import ErrorDialog from "../../dialogs/ErrorDialog"; import Field from "../../elements/Field"; import AccessibleButton from "../../elements/AccessibleButton"; -import { logger } from "matrix-js-sdk/src/logger"; - /* TODO: Improve the UX for everything in here. This is a copy/paste of EmailAddresses, mostly. diff --git a/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx index 1cfe023ba9..619e36df71 100644 --- a/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { ContextType } from 'react'; + import { _t } from "../../../../../languageHandler"; import RoomProfileSettings from "../../../room_settings/RoomProfileSettings"; import AccessibleButton from "../../../elements/AccessibleButton"; diff --git a/src/components/views/settings/tabs/room/NotificationSettingsTab.tsx b/src/components/views/settings/tabs/room/NotificationSettingsTab.tsx index bdc419a01a..81cfd940c9 100644 --- a/src/components/views/settings/tabs/room/NotificationSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/NotificationSettingsTab.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React, { createRef } from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../../../languageHandler"; import { MatrixClientPeg } from "../../../../../MatrixClientPeg"; import AccessibleButton from "../../../elements/AccessibleButton"; @@ -23,8 +25,6 @@ import SettingsStore from '../../../../../settings/SettingsStore'; import { SettingLevel } from "../../../../../settings/SettingLevel"; import { replaceableComponent } from "../../../../../utils/replaceableComponent"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { roomId: string; } diff --git a/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx index 637215682e..a8c2ff4da5 100644 --- a/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx @@ -15,21 +15,21 @@ limitations under the License. */ import React from 'react'; +import { EventType } from "matrix-js-sdk/src/@types/event"; +import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { RoomState } from "matrix-js-sdk/src/models/room-state"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t, _td } from "../../../../../languageHandler"; import { MatrixClientPeg } from "../../../../../MatrixClientPeg"; import AccessibleButton from "../../../elements/AccessibleButton"; import Modal from "../../../../../Modal"; import { replaceableComponent } from "../../../../../utils/replaceableComponent"; -import { EventType } from "matrix-js-sdk/src/@types/event"; -import { RoomMember } from "matrix-js-sdk/src/models/room-member"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; -import { RoomState } from "matrix-js-sdk/src/models/room-state"; import { compare } from "../../../../../utils/strings"; import ErrorDialog from '../../../dialogs/ErrorDialog'; import PowerSelector from "../../../elements/PowerSelector"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IEventShowOpts { isState?: boolean; hideForSpace?: boolean; diff --git a/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx index 0242ace0a6..fad85ddfb7 100644 --- a/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx @@ -18,6 +18,7 @@ import React from 'react'; import { GuestAccess, HistoryVisibility, JoinRule, RestrictedAllowType } from "matrix-js-sdk/src/@types/partials"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { EventType } from 'matrix-js-sdk/src/@types/event'; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../../../languageHandler"; import { MatrixClientPeg } from "../../../../../MatrixClientPeg"; @@ -36,8 +37,6 @@ import CreateRoomDialog from '../../../dialogs/CreateRoomDialog'; import JoinRuleSettings from "../../JoinRuleSettings"; import ErrorDialog from "../../../dialogs/ErrorDialog"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { roomId: string; closeSettingsFn: () => void; diff --git a/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx b/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx index ed0092989b..a9a4932d3f 100644 --- a/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from "../../../../../languageHandler"; import SdkConfig from "../../../../../SdkConfig"; import { MatrixClientPeg } from '../../../../../MatrixClientPeg'; @@ -28,7 +29,6 @@ import { UIFeature } from "../../../../../settings/UIFeature"; import { Layout } from "../../../../../settings/Layout"; import { replaceableComponent } from "../../../../../utils/replaceableComponent"; import LayoutSwitcher from "../../LayoutSwitcher"; - import FontScalingPanel from '../../FontScalingPanel'; import ThemeChoicePanel from '../../ThemeChoicePanel'; diff --git a/src/components/views/settings/tabs/user/FlairUserSettingsTab.js b/src/components/views/settings/tabs/user/FlairUserSettingsTab.js index 180cb5df2c..919851e9fb 100644 --- a/src/components/views/settings/tabs/user/FlairUserSettingsTab.js +++ b/src/components/views/settings/tabs/user/FlairUserSettingsTab.js @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from "../../../../../languageHandler"; import GroupUserSettings from "../../../groups/GroupUserSettings"; import { replaceableComponent } from "../../../../../utils/replaceableComponent"; diff --git a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx index b29c6ed87f..d37f2f4c4a 100644 --- a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx @@ -17,6 +17,10 @@ limitations under the License. */ import React from 'react'; +import { SERVICE_TYPES } from "matrix-js-sdk/src/service-types"; +import { IThreepid } from "matrix-js-sdk/src/@types/threepids"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../../../languageHandler"; import ProfileSettings from "../../ProfileSettings"; import * as languageHandler from "../../../../../languageHandler"; @@ -30,7 +34,6 @@ import { MatrixClientPeg } from "../../../../../MatrixClientPeg"; import Modal from "../../../../../Modal"; import dis from "../../../../../dispatcher/dispatcher"; import { Policies, Service, startTermsFlow } from "../../../../../Terms"; -import { SERVICE_TYPES } from "matrix-js-sdk/src/service-types"; import IdentityAuthClient from "../../../../../IdentityAuthClient"; import { abbreviateUrl } from "../../../../../utils/UrlUtils"; import { getThreepidsWithBindStatus } from '../../../../../boundThreepids'; @@ -38,7 +41,6 @@ import Spinner from "../../../elements/Spinner"; import { SettingLevel } from "../../../../../settings/SettingLevel"; import { UIFeature } from "../../../../../settings/UIFeature"; import { replaceableComponent } from "../../../../../utils/replaceableComponent"; -import { IThreepid } from "matrix-js-sdk/src/@types/threepids"; import { ActionPayload } from "../../../../../dispatcher/payloads"; import ErrorDialog from "../../../dialogs/ErrorDialog"; import AccountPhoneNumbers from "../../account/PhoneNumbers"; @@ -50,8 +52,6 @@ import InlineTermsAgreement from "../../../terms/InlineTermsAgreement"; import SetIdServer from "../../SetIdServer"; import SetIntegrationManager from "../../SetIntegrationManager"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { closeSettingsFn: () => void; } diff --git a/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx b/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx index d1a515439b..cffd7c18d4 100644 --- a/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import AccessibleButton, { ButtonEvent } from "../../../elements/AccessibleButton"; import { _t, getCurrentLanguage } from "../../../../../languageHandler"; import { MatrixClientPeg } from "../../../../../MatrixClientPeg"; @@ -32,8 +34,6 @@ import { toRightOf } from "../../../../structures/ContextMenu"; import BugReportDialog from '../../../dialogs/BugReportDialog'; import GenericTextContextMenu from "../../../context_menus/GenericTextContextMenu"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { closeSettingsFn: () => void; } diff --git a/src/components/views/settings/tabs/user/LabsUserSettingsTab.tsx b/src/components/views/settings/tabs/user/LabsUserSettingsTab.tsx index d05a11483c..c9f6e66530 100644 --- a/src/components/views/settings/tabs/user/LabsUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/LabsUserSettingsTab.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from "../../../../../languageHandler"; import SettingsStore from "../../../../../settings/SettingsStore"; import LabelledToggleSwitch from "../../../elements/LabelledToggleSwitch"; diff --git a/src/components/views/settings/tabs/user/MjolnirUserSettingsTab.tsx b/src/components/views/settings/tabs/user/MjolnirUserSettingsTab.tsx index a05e2b6ee5..88000892e4 100644 --- a/src/components/views/settings/tabs/user/MjolnirUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/MjolnirUserSettingsTab.tsx @@ -15,6 +15,8 @@ limitations under the License. */ import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../../../languageHandler"; import SdkConfig from "../../../../../SdkConfig"; import { Mjolnir } from "../../../../../mjolnir/Mjolnir"; @@ -28,8 +30,6 @@ import QuestionDialog from "../../../dialogs/QuestionDialog"; import AccessibleButton from "../../../elements/AccessibleButton"; import Field from "../../../elements/Field"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IState { busy: boolean; newPersonalRule: string; diff --git a/src/components/views/settings/tabs/user/NotificationUserSettingsTab.tsx b/src/components/views/settings/tabs/user/NotificationUserSettingsTab.tsx index 5717813ae1..429472c7f5 100644 --- a/src/components/views/settings/tabs/user/NotificationUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/NotificationUserSettingsTab.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import { _t } from "../../../../../languageHandler"; import { replaceableComponent } from "../../../../../utils/replaceableComponent"; import Notifications from "../../Notifications"; diff --git a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx index b9753d9c86..cf184fda4f 100644 --- a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx @@ -17,6 +17,8 @@ limitations under the License. import React from 'react'; import { sleep } from "matrix-js-sdk/src/utils"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../../../languageHandler"; import SdkConfig from "../../../../../SdkConfig"; @@ -34,7 +36,6 @@ import CountlyAnalytics from "../../../../../CountlyAnalytics"; import { replaceableComponent } from "../../../../../utils/replaceableComponent"; import { PosthogAnalytics } from "../../../../../PosthogAnalytics"; import { ActionPayload } from "../../../../../dispatcher/payloads"; -import { Room } from "matrix-js-sdk/src/models/room"; import CryptographyPanel from "../../CryptographyPanel"; import DevicesPanel from "../../DevicesPanel"; import SettingsFlag from "../../../elements/SettingsFlag"; @@ -42,8 +43,6 @@ import CrossSigningPanel from "../../CrossSigningPanel"; import EventIndexPanel from "../../EventIndexPanel"; import InlineSpinner from "../../../elements/InlineSpinner"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IIgnoredUserProps { userId: string; onUnignored: (userId: string) => void; diff --git a/src/components/views/settings/tabs/user/VoiceUserSettingsTab.tsx b/src/components/views/settings/tabs/user/VoiceUserSettingsTab.tsx index 1e196aa362..b187e300a2 100644 --- a/src/components/views/settings/tabs/user/VoiceUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/VoiceUserSettingsTab.tsx @@ -16,6 +16,8 @@ limitations under the License. */ import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from "../../../../../languageHandler"; import SdkConfig from "../../../../../SdkConfig"; import MediaDeviceHandler, { IMediaDevices, MediaDeviceKindEnum } from "../../../../../MediaDeviceHandler"; @@ -28,8 +30,6 @@ import { replaceableComponent } from "../../../../../utils/replaceableComponent" import SettingsFlag from '../../../elements/SettingsFlag'; import ErrorDialog from '../../../dialogs/ErrorDialog'; -import { logger } from "matrix-js-sdk/src/logger"; - const getDefaultDevice = (devices: Array>) => { // Note we're looking for a device with deviceId 'default' but adding a device // with deviceId == the empty string: this is because Chrome gives us a device diff --git a/src/components/views/spaces/SpaceCreateMenu.tsx b/src/components/views/spaces/SpaceCreateMenu.tsx index 5ec44e970b..bd0cf7a762 100644 --- a/src/components/views/spaces/SpaceCreateMenu.tsx +++ b/src/components/views/spaces/SpaceCreateMenu.tsx @@ -19,6 +19,7 @@ import classNames from "classnames"; import { RoomType } from "matrix-js-sdk/src/@types/event"; import { ICreateRoomOpts } from "matrix-js-sdk/src/@types/requests"; import { HistoryVisibility, Preset } from "matrix-js-sdk/src/@types/partials"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../languageHandler"; import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; @@ -39,8 +40,6 @@ import { Action } from "../../../dispatcher/actions"; import { UserTab } from "../dialogs/UserSettingsDialog"; import { Key } from "../../../Keyboard"; -import { logger } from "matrix-js-sdk/src/logger"; - export const createSpace = async ( name: string, isPublic: boolean, diff --git a/src/components/views/spaces/SpaceSettingsGeneralTab.tsx b/src/components/views/spaces/SpaceSettingsGeneralTab.tsx index 865df03f66..4752c0f6db 100644 --- a/src/components/views/spaces/SpaceSettingsGeneralTab.tsx +++ b/src/components/views/spaces/SpaceSettingsGeneralTab.tsx @@ -18,6 +18,7 @@ import React, { useState } from "react"; import { Room } from "matrix-js-sdk/src/models/room"; import { MatrixClient } from "matrix-js-sdk/src/client"; import { EventType } from "matrix-js-sdk/src/@types/event"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../languageHandler"; import AccessibleButton from "../elements/AccessibleButton"; @@ -27,8 +28,6 @@ import { IDialogProps } from "../dialogs/IDialogProps"; import { getTopic } from "../elements/RoomTopic"; import { leaveSpace } from "../../../utils/space"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps extends IDialogProps { matrixClient: MatrixClient; space: Room; diff --git a/src/components/views/spaces/SpaceTreeLevel.tsx b/src/components/views/spaces/SpaceTreeLevel.tsx index ba2af3b857..c2c4e9804c 100644 --- a/src/components/views/spaces/SpaceTreeLevel.tsx +++ b/src/components/views/spaces/SpaceTreeLevel.tsx @@ -24,6 +24,7 @@ import React, { } from "react"; import classNames from "classnames"; import { Room } from "matrix-js-sdk/src/models/room"; +import { DraggableProvidedDragHandleProps } from "react-beautiful-dnd"; import RoomAvatar from "../avatars/RoomAvatar"; import SpaceStore from "../../../stores/SpaceStore"; @@ -40,7 +41,6 @@ import { getKeyBindingsManager, RoomListAction } from "../../../KeyBindingsManag import { NotificationState } from "../../../stores/notifications/NotificationState"; import SpaceContextMenu from "../context_menus/SpaceContextMenu"; import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; -import { DraggableProvidedDragHandleProps } from "react-beautiful-dnd"; import { useRovingTabIndex } from "../../../accessibility/RovingTabIndex"; interface IButtonProps extends Omit, "title"> { diff --git a/src/components/views/terms/InlineTermsAgreement.tsx b/src/components/views/terms/InlineTermsAgreement.tsx index 80ccf49ee9..f6743044a3 100644 --- a/src/components/views/terms/InlineTermsAgreement.tsx +++ b/src/components/views/terms/InlineTermsAgreement.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { _t, pickBestLanguage } from "../../../languageHandler"; import * as sdk from "../../.."; import { objectClone } from "../../../utils/objects"; diff --git a/src/components/views/toasts/GenericToast.tsx b/src/components/views/toasts/GenericToast.tsx index 4738e38c0d..92eec4fada 100644 --- a/src/components/views/toasts/GenericToast.tsx +++ b/src/components/views/toasts/GenericToast.tsx @@ -15,8 +15,8 @@ limitations under the License. */ import React, { ReactNode } from "react"; -import AccessibleButton from "../elements/AccessibleButton"; +import AccessibleButton from "../elements/AccessibleButton"; import { XOR } from "../../../@types/common"; export interface IProps { diff --git a/src/components/views/toasts/NonUrgentEchoFailureToast.tsx b/src/components/views/toasts/NonUrgentEchoFailureToast.tsx index 9d69922678..91407a4fa5 100644 --- a/src/components/views/toasts/NonUrgentEchoFailureToast.tsx +++ b/src/components/views/toasts/NonUrgentEchoFailureToast.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from "react"; + import { _t } from "../../../languageHandler"; import AccessibleButton from "../elements/AccessibleButton"; import Modal from "../../../Modal"; diff --git a/src/components/views/toasts/VerificationRequestToast.tsx b/src/components/views/toasts/VerificationRequestToast.tsx index c1f1050bc9..71f4e7dc74 100644 --- a/src/components/views/toasts/VerificationRequestToast.tsx +++ b/src/components/views/toasts/VerificationRequestToast.tsx @@ -15,6 +15,9 @@ limitations under the License. */ import React from "react"; +import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { DeviceInfo } from "matrix-js-sdk/src/crypto/deviceinfo"; +import { logger } from "matrix-js-sdk/src/logger"; import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; @@ -25,14 +28,10 @@ import dis from "../../../dispatcher/dispatcher"; import ToastStore from "../../../stores/ToastStore"; import Modal from "../../../Modal"; import GenericToast from "./GenericToast"; -import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; -import { DeviceInfo } from "matrix-js-sdk/src/crypto/deviceinfo"; import { Action } from "../../../dispatcher/actions"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import VerificationRequestDialog from "../dialogs/VerificationRequestDialog"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProps { toastKey: string; request: VerificationRequest; diff --git a/src/components/views/verification/VerificationCancelled.tsx b/src/components/views/verification/VerificationCancelled.tsx index c8c068f5eb..2a2fa0426f 100644 --- a/src/components/views/verification/VerificationCancelled.tsx +++ b/src/components/views/verification/VerificationCancelled.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/verification/VerificationComplete.tsx b/src/components/views/verification/VerificationComplete.tsx index 99cbab8d73..731ffc54fd 100644 --- a/src/components/views/verification/VerificationComplete.tsx +++ b/src/components/views/verification/VerificationComplete.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; + import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/verification/VerificationShowSas.tsx b/src/components/views/verification/VerificationShowSas.tsx index fde79ea91e..7965a12cef 100644 --- a/src/components/views/verification/VerificationShowSas.tsx +++ b/src/components/views/verification/VerificationShowSas.tsx @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import { IGeneratedSas } from "matrix-js-sdk/src/crypto/verification/SAS"; import { DeviceInfo } from "matrix-js-sdk/src//crypto/deviceinfo"; + import { _t, _td } from '../../../languageHandler'; import { PendingActionSpinner } from "../right_panel/EncryptionInfo"; import AccessibleButton from "../elements/AccessibleButton"; diff --git a/src/components/views/voip/AudioFeed.tsx b/src/components/views/voip/AudioFeed.tsx index 751ae6b96e..944ea3ad00 100644 --- a/src/components/views/voip/AudioFeed.tsx +++ b/src/components/views/voip/AudioFeed.tsx @@ -17,6 +17,7 @@ limitations under the License. import React, { createRef } from 'react'; import { CallFeed, CallFeedEvent } from 'matrix-js-sdk/src/webrtc/callFeed'; import { logger } from 'matrix-js-sdk/src/logger'; + import MediaDeviceHandler, { MediaDeviceHandlerEvent } from "../../../MediaDeviceHandler"; interface IProps { diff --git a/src/components/views/voip/AudioFeedArrayForCall.tsx b/src/components/views/voip/AudioFeedArrayForCall.tsx index a7dd0283ff..baf68cd01a 100644 --- a/src/components/views/voip/AudioFeedArrayForCall.tsx +++ b/src/components/views/voip/AudioFeedArrayForCall.tsx @@ -15,10 +15,11 @@ limitations under the License. */ import React from "react"; -import AudioFeed from "./AudioFeed"; import { CallEvent, MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import { CallFeed } from "matrix-js-sdk/src/webrtc/callFeed"; +import AudioFeed from "./AudioFeed"; + interface IProps { call: MatrixCall; } diff --git a/src/components/views/voip/CallContainer.tsx b/src/components/views/voip/CallContainer.tsx index 41046b9952..1bf3625f5a 100644 --- a/src/components/views/voip/CallContainer.tsx +++ b/src/components/views/voip/CallContainer.tsx @@ -16,6 +16,7 @@ limitations under the License. */ import React from 'react'; + import CallPreview from './CallPreview'; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/voip/CallPreview.tsx b/src/components/views/voip/CallPreview.tsx index 266c34083e..5cd1363ed9 100644 --- a/src/components/views/voip/CallPreview.tsx +++ b/src/components/views/voip/CallPreview.tsx @@ -16,6 +16,9 @@ limitations under the License. */ import React from 'react'; +import { CallEvent, CallState, MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; +import { EventSubscription } from 'fbemitter'; +import { logger } from "matrix-js-sdk/src/logger"; import CallView from "./CallView"; import RoomViewStore from '../../../stores/RoomViewStore'; @@ -24,14 +27,10 @@ import dis from '../../../dispatcher/dispatcher'; import { ActionPayload } from '../../../dispatcher/payloads'; import PersistentApp from "../elements/PersistentApp"; import SettingsStore from "../../../settings/SettingsStore"; -import { CallEvent, CallState, MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { EventSubscription } from 'fbemitter'; import PictureInPictureDragger from './PictureInPictureDragger'; -import { logger } from "matrix-js-sdk/src/logger"; - const SHOW_CALL_IN_STATES = [ CallState.Connected, CallState.InviteSent, diff --git a/src/components/views/voip/CallView.tsx b/src/components/views/voip/CallView.tsx index 11206602c7..261260f429 100644 --- a/src/components/views/voip/CallView.tsx +++ b/src/components/views/voip/CallView.tsx @@ -17,22 +17,23 @@ limitations under the License. */ import React, { createRef, CSSProperties } from 'react'; +import { CallEvent, CallState, CallType, MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; +import classNames from 'classnames'; +import { CallFeed } from 'matrix-js-sdk/src/webrtc/callFeed'; +import { SDPStreamMetadataPurpose } from 'matrix-js-sdk/src/webrtc/callEventTypes'; + import dis from '../../../dispatcher/dispatcher'; import CallHandler from '../../../CallHandler'; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t, _td } from '../../../languageHandler'; import VideoFeed from './VideoFeed'; import RoomAvatar from "../avatars/RoomAvatar"; -import { CallEvent, CallState, CallType, MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; -import classNames from 'classnames'; import AccessibleButton from '../elements/AccessibleButton'; import { isOnlyCtrlOrCmdKeyEvent, Key } from '../../../Keyboard'; import { avatarUrlForMember } from '../../../Avatar'; -import { CallFeed } from 'matrix-js-sdk/src/webrtc/callFeed'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import DesktopCapturerSourcePicker from "../elements/DesktopCapturerSourcePicker"; import Modal from '../../../Modal'; -import { SDPStreamMetadataPurpose } from 'matrix-js-sdk/src/webrtc/callEventTypes'; import CallViewSidebar from './CallViewSidebar'; import CallViewHeader from './CallView/CallViewHeader'; import CallViewButtons from "./CallView/CallViewButtons"; diff --git a/src/components/views/voip/CallView/CallViewButtons.tsx b/src/components/views/voip/CallView/CallViewButtons.tsx index 466311f421..4afded51ac 100644 --- a/src/components/views/voip/CallView/CallViewButtons.tsx +++ b/src/components/views/voip/CallView/CallViewButtons.tsx @@ -18,10 +18,11 @@ limitations under the License. import React, { createRef } from "react"; import classNames from "classnames"; +import { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; + import AccessibleTooltipButton from "../../elements/AccessibleTooltipButton"; import CallContextMenu from "../../context_menus/CallContextMenu"; import DialpadContextMenu from "../../context_menus/DialpadContextMenu"; -import { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import { Alignment } from "../../elements/Tooltip"; import { alwaysAboveLeftOf, diff --git a/src/components/views/voip/CallView/CallViewHeader.tsx b/src/components/views/voip/CallView/CallViewHeader.tsx index d9a49e5010..87e14e9c6b 100644 --- a/src/components/views/voip/CallView/CallViewHeader.tsx +++ b/src/components/views/voip/CallView/CallViewHeader.tsx @@ -17,11 +17,12 @@ limitations under the License. import { CallType } from 'matrix-js-sdk/src/webrtc/call'; import { Room } from 'matrix-js-sdk/src/models/room'; import React from 'react'; +import classNames from 'classnames'; + import { _t, _td } from '../../../../languageHandler'; import RoomAvatar from '../../avatars/RoomAvatar'; import AccessibleButton from '../../elements/AccessibleButton'; import dis from '../../../../dispatcher/dispatcher'; -import classNames from 'classnames'; import AccessibleTooltipButton from '../../elements/AccessibleTooltipButton'; const callTypeTranslationByType: Record = { diff --git a/src/components/views/voip/CallViewForRoom.tsx b/src/components/views/voip/CallViewForRoom.tsx index b0a6f17095..e1b4eee879 100644 --- a/src/components/views/voip/CallViewForRoom.tsx +++ b/src/components/views/voip/CallViewForRoom.tsx @@ -16,10 +16,11 @@ limitations under the License. import { CallState, MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; import React from 'react'; +import { Resizable } from "re-resizable"; + import CallHandler, { CallHandlerEvent } from '../../../CallHandler'; import CallView from './CallView'; import dis from '../../../dispatcher/dispatcher'; -import { Resizable } from "re-resizable"; import ResizeNotifier from "../../../utils/ResizeNotifier"; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/voip/CallViewSidebar.tsx b/src/components/views/voip/CallViewSidebar.tsx index a0cb25b3df..e1c74b0d15 100644 --- a/src/components/views/voip/CallViewSidebar.tsx +++ b/src/components/views/voip/CallViewSidebar.tsx @@ -17,9 +17,10 @@ limitations under the License. import React from "react"; import { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import { CallFeed } from "matrix-js-sdk/src/webrtc/callFeed"; -import VideoFeed from "./VideoFeed"; import classNames from "classnames"; +import VideoFeed from "./VideoFeed"; + interface IProps { feeds: Array; call: MatrixCall; diff --git a/src/components/views/voip/DialPad.tsx b/src/components/views/voip/DialPad.tsx index 46584e0870..6b8f013297 100644 --- a/src/components/views/voip/DialPad.tsx +++ b/src/components/views/voip/DialPad.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import * as React from "react"; + import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; import { replaceableComponent } from "../../../utils/replaceableComponent"; diff --git a/src/components/views/voip/DialPadModal.tsx b/src/components/views/voip/DialPadModal.tsx index 4d69260565..cbef7bbf60 100644 --- a/src/components/views/voip/DialPadModal.tsx +++ b/src/components/views/voip/DialPadModal.tsx @@ -16,6 +16,7 @@ limitations under the License. import * as React from "react"; import { createRef } from "react"; + import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; import Field from "../elements/Field"; import DialPad from './DialPad'; diff --git a/src/components/views/voip/PictureInPictureDragger.tsx b/src/components/views/voip/PictureInPictureDragger.tsx index 23a09b20d8..117927d11e 100644 --- a/src/components/views/voip/PictureInPictureDragger.tsx +++ b/src/components/views/voip/PictureInPictureDragger.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { createRef } from 'react'; + import UIStore from '../../../stores/UIStore'; import { lerp } from '../../../utils/AnimationUtils'; import { MarkedExecution } from '../../../utils/MarkedExecution'; diff --git a/src/components/views/voip/VideoFeed.tsx b/src/components/views/voip/VideoFeed.tsx index 13461c3591..71c5629537 100644 --- a/src/components/views/voip/VideoFeed.tsx +++ b/src/components/views/voip/VideoFeed.tsx @@ -17,12 +17,13 @@ limitations under the License. import classnames from 'classnames'; import { MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; import React from 'react'; -import SettingsStore from "../../../settings/SettingsStore"; import { CallFeed, CallFeedEvent } from 'matrix-js-sdk/src/webrtc/callFeed'; import { logger } from 'matrix-js-sdk/src/logger'; +import { SDPStreamMetadataPurpose } from 'matrix-js-sdk/src/webrtc/callEventTypes'; + +import SettingsStore from "../../../settings/SettingsStore"; import MemberAvatar from "../avatars/MemberAvatar"; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import { SDPStreamMetadataPurpose } from 'matrix-js-sdk/src/webrtc/callEventTypes'; interface IProps { call: MatrixCall; diff --git a/src/createRoom.ts b/src/createRoom.ts index 6394cb6849..7841c8bd5f 100644 --- a/src/createRoom.ts +++ b/src/createRoom.ts @@ -27,6 +27,7 @@ import { RestrictedAllowType, Visibility, } from "matrix-js-sdk/src/@types/partials"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from './MatrixClientPeg'; import Modal from './Modal'; @@ -46,8 +47,6 @@ import { Action } from "./dispatcher/actions"; import ErrorDialog from "./components/views/dialogs/ErrorDialog"; import Spinner from "./components/views/elements/Spinner"; -import { logger } from "matrix-js-sdk/src/logger"; - // we define a number of interfaces which take their names from the js-sdk /* eslint-disable camelcase */ diff --git a/src/customisations/Security.ts b/src/customisations/Security.ts index 9083274aa5..d298964dc1 100644 --- a/src/customisations/Security.ts +++ b/src/customisations/Security.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { ISecretStorageKeyInfo } from 'matrix-js-sdk/src/crypto/api'; + import { IMatrixClientCreds } from "../MatrixClientPeg"; import { Kind as SetupEncryptionKind } from "../toasts/SetupEncryptionToast"; -import { ISecretStorageKeyInfo } from 'matrix-js-sdk/src/crypto/api'; /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ function examineLoginResponse( diff --git a/src/dispatcher/dispatch-actions/threads.ts b/src/dispatcher/dispatch-actions/threads.ts index 31d5ba5bf7..288916eb42 100644 --- a/src/dispatcher/dispatch-actions/threads.ts +++ b/src/dispatcher/dispatch-actions/threads.ts @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { RightPanelPhases } from "../../stores/RightPanelStorePhases"; import { Action } from "../actions"; import dis from '../dispatcher'; diff --git a/src/dispatcher/dispatcher.ts b/src/dispatcher/dispatcher.ts index 4d8df1ecaa..15e2f8f9bc 100644 --- a/src/dispatcher/dispatcher.ts +++ b/src/dispatcher/dispatcher.ts @@ -17,6 +17,7 @@ limitations under the License. */ import { Dispatcher } from "flux"; + import { Action } from "./actions"; import { ActionPayload, AsyncActionPayload } from "./payloads"; diff --git a/src/dispatcher/payloads/AfterRightPanelPhaseChangePayload.ts b/src/dispatcher/payloads/AfterRightPanelPhaseChangePayload.ts index cfd4a2d3cc..b45b8bdebe 100644 --- a/src/dispatcher/payloads/AfterRightPanelPhaseChangePayload.ts +++ b/src/dispatcher/payloads/AfterRightPanelPhaseChangePayload.ts @@ -14,11 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; + import { RightPanelPhases } from "../../stores/RightPanelStorePhases"; import { SetRightPanelPhaseRefireParams } from "./SetRightPanelPhasePayload"; import { ActionPayload } from "../payloads"; import { Action } from "../actions"; -import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; interface AfterRightPanelPhaseChangeAction extends ActionPayload { action: Action.AfterRightPanelPhaseChange; diff --git a/src/dispatcher/payloads/SetRightPanelPhasePayload.ts b/src/dispatcher/payloads/SetRightPanelPhasePayload.ts index ea997e4ed1..54a00e0279 100644 --- a/src/dispatcher/payloads/SetRightPanelPhasePayload.ts +++ b/src/dispatcher/payloads/SetRightPanelPhasePayload.ts @@ -18,6 +18,7 @@ import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/reque import { Room } from "matrix-js-sdk/src/models/room"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { User } from "matrix-js-sdk/src/models/user"; + import { RightPanelPhases } from "../../stores/RightPanelStorePhases"; import { ActionPayload } from "../payloads"; import { Action } from "../actions"; diff --git a/src/dispatcher/payloads/TransferCallPayload.ts b/src/dispatcher/payloads/TransferCallPayload.ts index 38431bb0d6..7a05d212ce 100644 --- a/src/dispatcher/payloads/TransferCallPayload.ts +++ b/src/dispatcher/payloads/TransferCallPayload.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; + import { ActionPayload } from "../payloads"; import { Action } from "../actions"; -import { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; export interface TransferCallPayload extends ActionPayload { action: Action.TransferCallToMatrixID | Action.TransferCallToPhoneNumber; diff --git a/src/dispatcher/payloads/ViewUserPayload.ts b/src/dispatcher/payloads/ViewUserPayload.ts index c4d73aea6a..20df21beb4 100644 --- a/src/dispatcher/payloads/ViewUserPayload.ts +++ b/src/dispatcher/payloads/ViewUserPayload.ts @@ -16,6 +16,7 @@ limitations under the License. import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { User } from "matrix-js-sdk/src/models/user"; + import { ActionPayload } from "../payloads"; import { Action } from "../actions"; diff --git a/src/editor/serialize.ts b/src/editor/serialize.ts index 9822046a0d..ed77c733bd 100644 --- a/src/editor/serialize.ts +++ b/src/editor/serialize.ts @@ -15,13 +15,14 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { AllHtmlEntities } from 'html-entities'; +import cheerio from 'cheerio'; + import Markdown from '../Markdown'; import { makeGenericPermalink } from "../utils/permalinks/Permalinks"; import EditorModel from "./model"; -import { AllHtmlEntities } from 'html-entities'; import SettingsStore from '../settings/SettingsStore'; import SdkConfig from '../SdkConfig'; -import cheerio from 'cheerio'; import { Type } from './parts'; export function mdSerialize(model: EditorModel): string { diff --git a/src/emojipicker/recent.ts b/src/emojipicker/recent.ts index 84fbf34616..026f9f85fa 100644 --- a/src/emojipicker/recent.ts +++ b/src/emojipicker/recent.ts @@ -15,8 +15,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import SettingsStore from "../settings/SettingsStore"; import { orderBy } from "lodash"; + +import SettingsStore from "../settings/SettingsStore"; import { SettingLevel } from "../settings/SettingLevel"; interface ILegacyFormat { diff --git a/src/hooks/useDispatcher.ts b/src/hooks/useDispatcher.ts index a8b36db2fd..13ee96227a 100644 --- a/src/hooks/useDispatcher.ts +++ b/src/hooks/useDispatcher.ts @@ -15,9 +15,9 @@ limitations under the License. */ import { useEffect, useRef } from "react"; +import { Dispatcher } from "flux"; import { ActionPayload } from "../dispatcher/payloads"; -import { Dispatcher } from "flux"; // Hook to simplify listening to flux dispatches export const useDispatcher = (dispatcher: Dispatcher, handler: (payload: ActionPayload) => void) => { diff --git a/src/hooks/useEventEmitter.ts b/src/hooks/useEventEmitter.ts index 693eebc0e3..92de5ae3f4 100644 --- a/src/hooks/useEventEmitter.ts +++ b/src/hooks/useEventEmitter.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { useRef, useEffect, useState, useCallback } from "react"; + import type { EventEmitter } from "events"; type Handler = (...args: any[]) => void; diff --git a/src/hooks/useRoomMembers.ts b/src/hooks/useRoomMembers.ts index bd52913a86..be770c09af 100644 --- a/src/hooks/useRoomMembers.ts +++ b/src/hooks/useRoomMembers.ts @@ -17,9 +17,9 @@ limitations under the License. import { useState } from "react"; import { Room } from "matrix-js-sdk/src/models/room"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { throttle } from "lodash"; import { useEventEmitter } from "./useEventEmitter"; -import { throttle } from "lodash"; // Hook to simplify watching Matrix Room joined members export const useRoomMembers = (room: Room, throttleWait = 250) => { diff --git a/src/hooks/useSettings.ts b/src/hooks/useSettings.ts index e21c2cbfa8..ab0c7284ef 100644 --- a/src/hooks/useSettings.ts +++ b/src/hooks/useSettings.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { useEffect, useState } from "react"; + import SettingsStore from '../settings/SettingsStore'; // Hook to fetch the value of a setting and dynamically update when it changes diff --git a/src/index.ts b/src/index.ts index 2c88265438..f78f25914b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -17,6 +17,10 @@ limitations under the License. import Skinner, { ISkinObject } from './Skinner'; +// Import the js-sdk so the proper `request` object can be set. This does some +// magic with the browser injection to make all subsequent imports work fine. +import "matrix-js-sdk"; + export function loadSkin(skinObject: ISkinObject): void { Skinner.load(skinObject); } @@ -29,7 +33,3 @@ export function getComponent(componentName: string): any { return Skinner.getComponent(componentName); } -// Import the js-sdk so the proper `request` object can be set. This does some -// magic with the browser injection to make all subsequent imports work fine. -import "matrix-js-sdk"; - diff --git a/src/indexing/EventIndex.ts b/src/indexing/EventIndex.ts index ad715e09cc..ebee683467 100644 --- a/src/indexing/EventIndex.ts +++ b/src/indexing/EventIndex.ts @@ -24,6 +24,7 @@ import { RoomState } from 'matrix-js-sdk/src/models/room-state'; import { TimelineIndex, TimelineWindow } from 'matrix-js-sdk/src/timeline-window'; import { sleep } from "matrix-js-sdk/src/utils"; import { IResultRoomEvents } from "matrix-js-sdk/src/@types/search"; +import { logger } from "matrix-js-sdk/src/logger"; import PlatformPeg from "../PlatformPeg"; import { MatrixClientPeg } from "../MatrixClientPeg"; @@ -31,8 +32,6 @@ import SettingsStore from "../settings/SettingsStore"; import { SettingLevel } from "../settings/SettingLevel"; import { ICrawlerCheckpoint, ILoadArgs, ISearchArgs } from "./BaseEventIndexManager"; -import { logger } from "matrix-js-sdk/src/logger"; - // The time in ms that the crawler will wait loop iterations if there // have not been any checkpoints to consume in the last iteration. const CRAWLER_IDLE_TIME = 5000; diff --git a/src/indexing/EventIndexPeg.ts b/src/indexing/EventIndexPeg.ts index acfdc6525f..94948258a0 100644 --- a/src/indexing/EventIndexPeg.ts +++ b/src/indexing/EventIndexPeg.ts @@ -19,14 +19,14 @@ limitations under the License. * platform supports event indexing. */ +import { logger } from "matrix-js-sdk/src/logger"; + import PlatformPeg from "../PlatformPeg"; import EventIndex from "../indexing/EventIndex"; import { MatrixClientPeg } from "../MatrixClientPeg"; import SettingsStore from '../settings/SettingsStore'; import { SettingLevel } from "../settings/SettingLevel"; -import { logger } from "matrix-js-sdk/src/logger"; - const INDEX_VERSION = 1; export class EventIndexPeg { diff --git a/src/integrations/IntegrationManagerInstance.ts b/src/integrations/IntegrationManagerInstance.ts index 51376ae290..440720b749 100644 --- a/src/integrations/IntegrationManagerInstance.ts +++ b/src/integrations/IntegrationManagerInstance.ts @@ -14,18 +14,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -import type { Room } from "matrix-js-sdk/src/models/room"; +import url from 'url'; +import { logger } from "matrix-js-sdk/src/logger"; +import type { Room } from "matrix-js-sdk/src/models/room"; import ScalarAuthClient from "../ScalarAuthClient"; import { dialogTermsInteractionCallback, TermsNotSignedError } from "../Terms"; import Modal from '../Modal'; -import url from 'url'; import SettingsStore from "../settings/SettingsStore"; import IntegrationManager from "../components/views/settings/IntegrationManager"; import { IntegrationManagers } from "./IntegrationManagers"; -import { logger } from "matrix-js-sdk/src/logger"; - export enum Kind { Account = "account", Config = "config", diff --git a/src/integrations/IntegrationManagers.ts b/src/integrations/IntegrationManagers.ts index 051b19279d..1ac39ff86d 100644 --- a/src/integrations/IntegrationManagers.ts +++ b/src/integrations/IntegrationManagers.ts @@ -14,10 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ +import url from 'url'; +import { logger } from "matrix-js-sdk/src/logger"; + import type { MatrixClient } from "matrix-js-sdk/src/client"; import type { MatrixEvent } from "matrix-js-sdk/src/models/event"; import type { Room } from "matrix-js-sdk/src/models/room"; - import SdkConfig from '../SdkConfig'; import Modal from '../Modal'; import { IntegrationManagerInstance, Kind } from "./IntegrationManagerInstance"; @@ -27,11 +29,8 @@ import IntegrationsDisabledDialog from "../components/views/dialogs/Integrations import WidgetUtils from "../utils/WidgetUtils"; import { MatrixClientPeg } from "../MatrixClientPeg"; import SettingsStore from "../settings/SettingsStore"; -import url from 'url'; import { compare } from "../utils/strings"; -import { logger } from "matrix-js-sdk/src/logger"; - const KIND_PREFERENCE = [ // Ordered: first is most preferred, last is least preferred. Kind.Account, diff --git a/src/languageHandler.tsx b/src/languageHandler.tsx index 63804b2a2c..15539eced4 100644 --- a/src/languageHandler.tsx +++ b/src/languageHandler.tsx @@ -20,16 +20,16 @@ limitations under the License. import request from 'browser-request'; import counterpart from 'counterpart'; import React from 'react'; +import { logger } from "matrix-js-sdk/src/logger"; import SettingsStore from "./settings/SettingsStore"; import PlatformPeg from "./PlatformPeg"; // @ts-ignore - $webapp is a webpack resolve alias pointing to the output directory, see webpack config -import webpackLangJsonUrl from "$webapp/i18n/languages.json"; import { SettingLevel } from "./settings/SettingLevel"; import { retry } from "./utils/promise"; -import { logger } from "matrix-js-sdk/src/logger"; +import webpackLangJsonUrl from "$webapp/i18n/languages.json"; const i18nFolder = 'i18n/'; diff --git a/src/mjolnir/Mjolnir.ts b/src/mjolnir/Mjolnir.ts index c1f17e1a4f..7da37fbc10 100644 --- a/src/mjolnir/Mjolnir.ts +++ b/src/mjolnir/Mjolnir.ts @@ -15,17 +15,17 @@ limitations under the License. */ import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { Preset } from "matrix-js-sdk/src/@types/partials"; +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from "../MatrixClientPeg"; import { ALL_RULE_TYPES, BanList } from "./BanList"; import SettingsStore from "../settings/SettingsStore"; import { _t } from "../languageHandler"; import dis from "../dispatcher/dispatcher"; import { SettingLevel } from "../settings/SettingLevel"; -import { Preset } from "matrix-js-sdk/src/@types/partials"; import { ActionPayload } from "../dispatcher/payloads"; -import { logger } from "matrix-js-sdk/src/logger"; - // TODO: Move this and related files to the js-sdk or something once finalized. export class Mjolnir { diff --git a/src/notifications/ContentRules.ts b/src/notifications/ContentRules.ts index 2b45065568..244657b620 100644 --- a/src/notifications/ContentRules.ts +++ b/src/notifications/ContentRules.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { PushRuleVectorState, VectorState } from "./PushRuleVectorState"; import { IAnnotatedPushRule, IPushRules, PushRuleKind } from "matrix-js-sdk/src/@types/PushRules"; +import { PushRuleVectorState, VectorState } from "./PushRuleVectorState"; + export interface IContentRules { vectorState: VectorState; rules: IAnnotatedPushRule[]; diff --git a/src/notifications/PushRuleVectorState.ts b/src/notifications/PushRuleVectorState.ts index 34f7dcf786..23b3594310 100644 --- a/src/notifications/PushRuleVectorState.ts +++ b/src/notifications/PushRuleVectorState.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { IPushRule } from "matrix-js-sdk/src/@types/PushRules"; + import { StandardActions } from "./StandardActions"; import { NotificationUtils } from "./NotificationUtils"; -import { IPushRule } from "matrix-js-sdk/src/@types/PushRules"; export enum VectorState { /** The push rule is disabled */ diff --git a/src/notifications/VectorPushRulesDefinitions.ts b/src/notifications/VectorPushRulesDefinitions.ts index 772a7a62ab..4a5bcc4e59 100644 --- a/src/notifications/VectorPushRulesDefinitions.ts +++ b/src/notifications/VectorPushRulesDefinitions.ts @@ -14,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { PushRuleAction, PushRuleKind } from "matrix-js-sdk/src/@types/PushRules"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _td } from '../languageHandler'; import { StandardActions } from "./StandardActions"; import { PushRuleVectorState, VectorState } from "./PushRuleVectorState"; import { NotificationUtils } from "./NotificationUtils"; -import { PushRuleAction, PushRuleKind } from "matrix-js-sdk/src/@types/PushRules"; - -import { logger } from "matrix-js-sdk/src/logger"; type StateToActionsMap = { [state in VectorState]?: PushRuleAction[]; diff --git a/src/performance/index.ts b/src/performance/index.ts index d2330dfb75..ad523f0c64 100644 --- a/src/performance/index.ts +++ b/src/performance/index.ts @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { PerformanceEntryNames } from "./entry-names"; - import { logger } from "matrix-js-sdk/src/logger"; +import { PerformanceEntryNames } from "./entry-names"; + interface GetEntriesOptions { name?: string; type?: string; diff --git a/src/rageshake/submit-rageshake.ts b/src/rageshake/submit-rageshake.ts index 11f19a1ad2..b87b026581 100644 --- a/src/rageshake/submit-rageshake.ts +++ b/src/rageshake/submit-rageshake.ts @@ -17,19 +17,16 @@ limitations under the License. */ import pako from 'pako'; +import Tar from "tar-js"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from '../MatrixClientPeg'; import PlatformPeg from '../PlatformPeg'; import { _t } from '../languageHandler'; -import Tar from "tar-js"; - import * as rageshake from './rageshake'; - import SettingsStore from "../settings/SettingsStore"; import SdkConfig from "../SdkConfig"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IOpts { label?: string; userText?: string; diff --git a/src/sentry.ts b/src/sentry.ts index cfb0da324a..005f853f24 100644 --- a/src/sentry.ts +++ b/src/sentry.ts @@ -15,10 +15,11 @@ limitations under the License. */ import * as Sentry from "@sentry/browser"; +import { MatrixClient } from "matrix-js-sdk/src/client"; + import SdkConfig from "./SdkConfig"; import { MatrixClientPeg } from "./MatrixClientPeg"; import SettingsStore from "./settings/SettingsStore"; -import { MatrixClient } from "matrix-js-sdk/src/client"; /* eslint-disable camelcase */ diff --git a/src/settings/SettingsStore.ts b/src/settings/SettingsStore.ts index 1222ca9231..40d41b4f9f 100644 --- a/src/settings/SettingsStore.ts +++ b/src/settings/SettingsStore.ts @@ -15,6 +15,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { logger } from "matrix-js-sdk/src/logger"; + import DeviceSettingsHandler from "./handlers/DeviceSettingsHandler"; import RoomDeviceSettingsHandler from "./handlers/RoomDeviceSettingsHandler"; import DefaultSettingsHandler from "./handlers/DefaultSettingsHandler"; @@ -32,8 +34,6 @@ import SettingsHandler from "./handlers/SettingsHandler"; import { SettingUpdatedPayload } from "../dispatcher/payloads/SettingUpdatedPayload"; import { Action } from "../dispatcher/actions"; -import { logger } from "matrix-js-sdk/src/logger"; - const defaultWatchManager = new WatchManager(); // Convert the settings to easier to manage objects for the handlers diff --git a/src/settings/controllers/NotificationControllers.ts b/src/settings/controllers/NotificationControllers.ts index a7114325ae..15e5b85733 100644 --- a/src/settings/controllers/NotificationControllers.ts +++ b/src/settings/controllers/NotificationControllers.ts @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { PushProcessor } from "matrix-js-sdk/src/pushprocessor"; +import { PushRuleActionName } from "matrix-js-sdk/src/@types/PushRules"; +import { logger } from "matrix-js-sdk/src/logger"; + import SettingController from "./SettingController"; import { MatrixClientPeg } from '../../MatrixClientPeg'; import { SettingLevel } from "../SettingLevel"; // XXX: This feels wrong. -import { PushProcessor } from "matrix-js-sdk/src/pushprocessor"; -import { PushRuleActionName } from "matrix-js-sdk/src/@types/PushRules"; - -import { logger } from "matrix-js-sdk/src/logger"; // .m.rule.master being enabled means all events match that push rule // default action on this rule is dont_notify, but it could be something else diff --git a/src/settings/handlers/AccountSettingsHandler.ts b/src/settings/handlers/AccountSettingsHandler.ts index 9ae3176fb8..1f3de86c16 100644 --- a/src/settings/handlers/AccountSettingsHandler.ts +++ b/src/settings/handlers/AccountSettingsHandler.ts @@ -15,13 +15,14 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixClient } from "matrix-js-sdk/src/client"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { MatrixClientPeg } from '../../MatrixClientPeg'; import MatrixClientBackedSettingsHandler from "./MatrixClientBackedSettingsHandler"; import { objectClone, objectKeyChanges } from "../../utils/objects"; import { SettingLevel } from "../SettingLevel"; import { WatchManager } from "../WatchManager"; -import { MatrixClient } from "matrix-js-sdk/src/client"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; const BREADCRUMBS_LEGACY_EVENT_TYPE = "im.vector.riot.breadcrumb_rooms"; const BREADCRUMBS_EVENT_TYPE = "im.vector.setting.breadcrumbs"; diff --git a/src/settings/handlers/ConfigSettingsHandler.ts b/src/settings/handlers/ConfigSettingsHandler.ts index ceed3e856a..0120b94b13 100644 --- a/src/settings/handlers/ConfigSettingsHandler.ts +++ b/src/settings/handlers/ConfigSettingsHandler.ts @@ -15,9 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; + import SettingsHandler from "./SettingsHandler"; import SdkConfig from "../../SdkConfig"; -import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; /** * Gets and sets settings at the "config" level. This handler does not make use of the diff --git a/src/settings/handlers/MatrixClientBackedSettingsHandler.ts b/src/settings/handlers/MatrixClientBackedSettingsHandler.ts index a475787f33..cd0631b4d8 100644 --- a/src/settings/handlers/MatrixClientBackedSettingsHandler.ts +++ b/src/settings/handlers/MatrixClientBackedSettingsHandler.ts @@ -14,11 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import SettingsHandler from "./SettingsHandler"; import { MatrixClient } from "matrix-js-sdk/src/client"; - import { logger } from "matrix-js-sdk/src/logger"; +import SettingsHandler from "./SettingsHandler"; + // Dev note: This whole class exists in the event someone logs out and back in - we want // to make sure the right MatrixClient is listening for changes. diff --git a/src/settings/handlers/RoomAccountSettingsHandler.ts b/src/settings/handlers/RoomAccountSettingsHandler.ts index a5ebfae621..05596ae1a4 100644 --- a/src/settings/handlers/RoomAccountSettingsHandler.ts +++ b/src/settings/handlers/RoomAccountSettingsHandler.ts @@ -15,14 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixClient } from "matrix-js-sdk/src/client"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { Room } from "matrix-js-sdk/src/models/room"; + import { MatrixClientPeg } from '../../MatrixClientPeg'; import MatrixClientBackedSettingsHandler from "./MatrixClientBackedSettingsHandler"; import { objectClone, objectKeyChanges } from "../../utils/objects"; import { SettingLevel } from "../SettingLevel"; import { WatchManager } from "../WatchManager"; -import { MatrixClient } from "matrix-js-sdk/src/client"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; -import { Room } from "matrix-js-sdk/src/models/room"; const ALLOWED_WIDGETS_EVENT_TYPE = "im.vector.setting.allowed_widgets"; diff --git a/src/settings/handlers/RoomSettingsHandler.ts b/src/settings/handlers/RoomSettingsHandler.ts index 974f94062c..13eab3c0c2 100644 --- a/src/settings/handlers/RoomSettingsHandler.ts +++ b/src/settings/handlers/RoomSettingsHandler.ts @@ -15,14 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixClient } from "matrix-js-sdk/src/client"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { RoomState } from "matrix-js-sdk/src/models/room-state"; + import { MatrixClientPeg } from '../../MatrixClientPeg'; import MatrixClientBackedSettingsHandler from "./MatrixClientBackedSettingsHandler"; import { objectClone, objectKeyChanges } from "../../utils/objects"; import { SettingLevel } from "../SettingLevel"; import { WatchManager } from "../WatchManager"; -import { MatrixClient } from "matrix-js-sdk/src/client"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; -import { RoomState } from "matrix-js-sdk/src/models/room-state"; /** * Gets and sets settings at the "room" level. diff --git a/src/settings/watchers/ThemeWatcher.ts b/src/settings/watchers/ThemeWatcher.ts index e555267706..b5e598f667 100644 --- a/src/settings/watchers/ThemeWatcher.ts +++ b/src/settings/watchers/ThemeWatcher.ts @@ -15,6 +15,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { logger } from "matrix-js-sdk/src/logger"; + import SettingsStore from '../SettingsStore'; import dis from '../../dispatcher/dispatcher'; import { Action } from '../../dispatcher/actions'; @@ -23,8 +25,6 @@ import { setTheme } from "../../theme"; import { ActionPayload } from '../../dispatcher/payloads'; import { SettingLevel } from "../SettingLevel"; -import { logger } from "matrix-js-sdk/src/logger"; - export default class ThemeWatcher { private themeWatchRef: string; private systemThemeWatchRef: string; diff --git a/src/stores/AsyncStore.ts b/src/stores/AsyncStore.ts index 1f310f003c..2f375f6292 100644 --- a/src/stores/AsyncStore.ts +++ b/src/stores/AsyncStore.ts @@ -17,6 +17,7 @@ limitations under the License. import { EventEmitter } from 'events'; import AwaitLock from 'await-lock'; import { Dispatcher } from "flux"; + import { ActionPayload } from "../dispatcher/payloads"; /** diff --git a/src/stores/AsyncStoreWithClient.ts b/src/stores/AsyncStoreWithClient.ts index 7ed9bbd249..6a2bc46b86 100644 --- a/src/stores/AsyncStoreWithClient.ts +++ b/src/stores/AsyncStoreWithClient.ts @@ -15,9 +15,10 @@ limitations under the License. */ import { MatrixClient } from "matrix-js-sdk/src/client"; +import { Dispatcher } from "flux"; + import { AsyncStore } from "./AsyncStore"; import { ActionPayload } from "../dispatcher/payloads"; -import { Dispatcher } from "flux"; import { ReadyWatchingStore } from "./ReadyWatchingStore"; export abstract class AsyncStoreWithClient extends AsyncStore { diff --git a/src/stores/BreadcrumbsStore.ts b/src/stores/BreadcrumbsStore.ts index 8a85ca354f..57f81ce499 100644 --- a/src/stores/BreadcrumbsStore.ts +++ b/src/stores/BreadcrumbsStore.ts @@ -14,13 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -import SettingsStore from "../settings/SettingsStore"; import { Room } from "matrix-js-sdk/src/models/room"; +import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; + +import SettingsStore from "../settings/SettingsStore"; import { ActionPayload } from "../dispatcher/payloads"; import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; import defaultDispatcher from "../dispatcher/dispatcher"; import { arrayHasDiff } from "../utils/arrays"; -import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; import { SettingLevel } from "../settings/SettingLevel"; import SpaceStore from "./SpaceStore"; import { Action } from "../dispatcher/actions"; diff --git a/src/stores/CommunityPrototypeStore.ts b/src/stores/CommunityPrototypeStore.ts index 6c5ab22c5f..be76279eb8 100644 --- a/src/stores/CommunityPrototypeStore.ts +++ b/src/stores/CommunityPrototypeStore.ts @@ -14,21 +14,21 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { Room } from "matrix-js-sdk/src/models/room"; +import * as utils from "matrix-js-sdk/src/utils"; +import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; +import { logger } from "matrix-js-sdk/src/logger"; + import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; import defaultDispatcher from "../dispatcher/dispatcher"; import { ActionPayload } from "../dispatcher/payloads"; -import { Room } from "matrix-js-sdk/src/models/room"; import { EffectiveMembership, getEffectiveMembership } from "../utils/membership"; import SettingsStore from "../settings/SettingsStore"; -import * as utils from "matrix-js-sdk/src/utils"; import { UPDATE_EVENT } from "./AsyncStore"; import FlairStore from "./FlairStore"; import GroupFilterOrderStore from "./GroupFilterOrderStore"; import GroupStore from "./GroupStore"; import dis from "../dispatcher/dispatcher"; -import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; - -import { logger } from "matrix-js-sdk/src/logger"; interface IState { // nothing of value - we use account data diff --git a/src/stores/CustomRoomTagStore.js b/src/stores/CustomRoomTagStore.js index 899018cf24..da8a89f6c6 100644 --- a/src/stores/CustomRoomTagStore.js +++ b/src/stores/CustomRoomTagStore.js @@ -15,9 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import dis from '../dispatcher/dispatcher'; import EventEmitter from 'events'; import { throttle } from "lodash"; + +import dis from '../dispatcher/dispatcher'; import SettingsStore from "../settings/SettingsStore"; import RoomListStore, { LISTS_UPDATE_EVENT } from "./room-list/RoomListStore"; import { RoomNotificationStateStore } from "./notifications/RoomNotificationStateStore"; diff --git a/src/stores/FlairStore.js b/src/stores/FlairStore.js index 971efd6cf6..edea649814 100644 --- a/src/stores/FlairStore.js +++ b/src/stores/FlairStore.js @@ -15,7 +15,6 @@ limitations under the License. */ import EventEmitter from 'events'; - import { logger } from "matrix-js-sdk/src/logger"; const BULK_REQUEST_DEBOUNCE_MS = 200; diff --git a/src/stores/GroupFilterOrderStore.js b/src/stores/GroupFilterOrderStore.js index 821fbefc4f..6369617bac 100644 --- a/src/stores/GroupFilterOrderStore.js +++ b/src/stores/GroupFilterOrderStore.js @@ -15,6 +15,7 @@ limitations under the License. */ import { Store } from 'flux/utils'; import { EventType } from "matrix-js-sdk/src/@types/event"; + import dis from '../dispatcher/dispatcher'; import GroupStore from './GroupStore'; import Analytics from '../Analytics'; diff --git a/src/stores/GroupStore.js b/src/stores/GroupStore.js index 0934cd9f90..f51a94bd1a 100644 --- a/src/stores/GroupStore.js +++ b/src/stores/GroupStore.js @@ -15,13 +15,13 @@ limitations under the License. */ import EventEmitter from 'events'; +import { logger } from "matrix-js-sdk/src/logger"; + import { groupMemberFromApiObject, groupRoomFromApiObject } from '../groups'; import FlairStore from './FlairStore'; import { MatrixClientPeg } from '../MatrixClientPeg'; import dis from '../dispatcher/dispatcher'; -import { logger } from "matrix-js-sdk/src/logger"; - export function parseMembersResponse(response) { return response.chunk.map((apiMember) => groupMemberFromApiObject(apiMember)); } diff --git a/src/stores/ModalWidgetStore.ts b/src/stores/ModalWidgetStore.ts index abbf87d827..5bfb0a51a5 100644 --- a/src/stores/ModalWidgetStore.ts +++ b/src/stores/ModalWidgetStore.ts @@ -14,15 +14,15 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { IModalWidgetOpenRequestData, IModalWidgetReturnData, Widget } from "matrix-widget-api"; +import { logger } from "matrix-js-sdk/src/logger"; + import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; import defaultDispatcher from "../dispatcher/dispatcher"; import { ActionPayload } from "../dispatcher/payloads"; import Modal, { IHandle, IModal } from "../Modal"; import ModalWidgetDialog from "../components/views/dialogs/ModalWidgetDialog"; import { WidgetMessagingStore } from "./widgets/WidgetMessagingStore"; -import { IModalWidgetOpenRequestData, IModalWidgetReturnData, Widget } from "matrix-widget-api"; - -import { logger } from "matrix-js-sdk/src/logger"; interface IState { modal?: IModal; diff --git a/src/stores/NonUrgentToastStore.ts b/src/stores/NonUrgentToastStore.ts index 72f896749c..9ff15a6a8c 100644 --- a/src/stores/NonUrgentToastStore.ts +++ b/src/stores/NonUrgentToastStore.ts @@ -15,6 +15,7 @@ limitations under the License. */ import EventEmitter from "events"; + import { ComponentClass } from "../@types/common"; import { UPDATE_EVENT } from "./AsyncStore"; diff --git a/src/stores/OwnProfileStore.ts b/src/stores/OwnProfileStore.ts index fb2dd527cb..db703bcb9f 100644 --- a/src/stores/OwnProfileStore.ts +++ b/src/stores/OwnProfileStore.ts @@ -14,12 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { ActionPayload } from "../dispatcher/payloads"; -import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; -import defaultDispatcher from "../dispatcher/dispatcher"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { User } from "matrix-js-sdk/src/models/user"; import { throttle } from "lodash"; + +import { ActionPayload } from "../dispatcher/payloads"; +import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; +import defaultDispatcher from "../dispatcher/dispatcher"; import { MatrixClientPeg } from "../MatrixClientPeg"; import { _t } from "../languageHandler"; import { mediaFromMxc } from "../customisations/Media"; diff --git a/src/stores/ReadyWatchingStore.ts b/src/stores/ReadyWatchingStore.ts index 4bb577c784..b8b9e4a04f 100644 --- a/src/stores/ReadyWatchingStore.ts +++ b/src/stores/ReadyWatchingStore.ts @@ -15,11 +15,12 @@ */ import { MatrixClient } from "matrix-js-sdk/src/client"; +import { Dispatcher } from "flux"; +import { EventEmitter } from "events"; + import { MatrixClientPeg } from "../MatrixClientPeg"; import { ActionPayload } from "../dispatcher/payloads"; -import { Dispatcher } from "flux"; import { IDestroyable } from "../utils/IDestroyable"; -import { EventEmitter } from "events"; export abstract class ReadyWatchingStore extends EventEmitter implements IDestroyable { protected matrixClient: MatrixClient; diff --git a/src/stores/RightPanelStore.ts b/src/stores/RightPanelStore.ts index f9e0a578eb..5e7fe42e6f 100644 --- a/src/stores/RightPanelStore.ts +++ b/src/stores/RightPanelStore.ts @@ -14,17 +14,17 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { Store } from 'flux/utils'; +import { logger } from "matrix-js-sdk/src/logger"; + import dis from '../dispatcher/dispatcher'; import { pendingVerificationRequestForUser } from '../verification'; -import { Store } from 'flux/utils'; import SettingsStore from "../settings/SettingsStore"; import { RightPanelPhases, RIGHT_PANEL_PHASES_NO_ARGS } from "./RightPanelStorePhases"; import { ActionPayload } from "../dispatcher/payloads"; import { Action } from '../dispatcher/actions'; import { SettingLevel } from "../settings/SettingLevel"; -import { logger } from "matrix-js-sdk/src/logger"; - interface RightPanelStoreState { // Whether or not to show the right panel at all. We split out rooms and groups // because they're different flows for the user to follow. diff --git a/src/stores/RoomViewStore.tsx b/src/stores/RoomViewStore.tsx index 1a44b4fb32..d13e1af92f 100644 --- a/src/stores/RoomViewStore.tsx +++ b/src/stores/RoomViewStore.tsx @@ -19,6 +19,7 @@ limitations under the License. import React from "react"; import { Store } from 'flux/utils'; import { MatrixError } from "matrix-js-sdk/src/http-api"; +import { logger } from "matrix-js-sdk/src/logger"; import dis from '../dispatcher/dispatcher'; import { MatrixClientPeg } from '../MatrixClientPeg'; @@ -30,8 +31,6 @@ import { ActionPayload } from "../dispatcher/payloads"; import { Action } from "../dispatcher/actions"; import { retry } from "../utils/promise"; import CountlyAnalytics from "../CountlyAnalytics"; - -import { logger } from "matrix-js-sdk/src/logger"; import { TimelineRenderingType } from "../contexts/RoomContext"; const NUM_JOIN_RETRY = 5; diff --git a/src/stores/SetupEncryptionStore.ts b/src/stores/SetupEncryptionStore.ts index eefe98c7a2..cfd69d3365 100644 --- a/src/stores/SetupEncryptionStore.ts +++ b/src/stores/SetupEncryptionStore.ts @@ -15,10 +15,10 @@ limitations under the License. */ import EventEmitter from 'events'; -import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { VerificationRequest, PHASE_DONE as VERIF_PHASE_DONE } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup"; import { ISecretStorageKeyInfo } from "matrix-js-sdk/src/crypto/api"; -import { PHASE_DONE as VERIF_PHASE_DONE } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from '../MatrixClientPeg'; import { accessSecretStorage, AccessCancelledError } from '../SecurityManager'; @@ -26,8 +26,6 @@ import Modal from '../Modal'; import InteractiveAuthDialog from '../components/views/dialogs/InteractiveAuthDialog'; import { _t } from '../languageHandler'; -import { logger } from "matrix-js-sdk/src/logger"; - export enum Phase { Loading = 0, Intro = 1, diff --git a/src/stores/SpaceStore.ts b/src/stores/SpaceStore.ts index 4ba1081325..55e9b0f446 100644 --- a/src/stores/SpaceStore.ts +++ b/src/stores/SpaceStore.ts @@ -20,6 +20,7 @@ import { Room } from "matrix-js-sdk/src/models/room"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { IHierarchyRoom } from "matrix-js-sdk/src/@types/spaces"; import { IRoomCapability } from "matrix-js-sdk/src/client"; +import { logger } from "matrix-js-sdk/src/logger"; import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; import defaultDispatcher from "../dispatcher/dispatcher"; @@ -41,8 +42,6 @@ import { reorderLexicographically } from "../utils/stringOrderField"; import { TAG_ORDER } from "../components/views/rooms/RoomList"; import { SettingUpdatedPayload } from "../dispatcher/payloads/SettingUpdatedPayload"; -import { logger } from "matrix-js-sdk/src/logger"; - type SpaceKey = string | symbol; interface IState {} diff --git a/src/stores/ToastStore.ts b/src/stores/ToastStore.ts index 5e51de3e26..1d3e5dd050 100644 --- a/src/stores/ToastStore.ts +++ b/src/stores/ToastStore.ts @@ -16,6 +16,7 @@ limitations under the License. import EventEmitter from "events"; import React from "react"; + import { ComponentClass } from "../@types/common"; export interface IToast { diff --git a/src/stores/UIStore.ts b/src/stores/UIStore.ts index b89af2f7c0..99446da49a 100644 --- a/src/stores/UIStore.ts +++ b/src/stores/UIStore.ts @@ -14,13 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -import EventEmitter from "events"; +import EventEmitter from "events"; // eslint-disable-line @typescript-eslint/no-var-requires +import ResizeObserverEntry from 'resize-observer-polyfill/src/ResizeObserverEntry'; + // XXX: resize-observer-polyfill has types that now conflict with typescript's // own DOM types: https://github.com/que-etc/resize-observer-polyfill/issues/80 // Using require here rather than import is a horrenous workaround. We should // be able to remove the polyfill once Safari 14 is released. -const ResizeObserverPolyfill = require('resize-observer-polyfill'); // eslint-disable-line @typescript-eslint/no-var-requires -import ResizeObserverEntry from 'resize-observer-polyfill/src/ResizeObserverEntry'; +const ResizeObserverPolyfill = require('resize-observer-polyfill'); export enum UI_EVENTS { Resize = "resize" diff --git a/src/stores/WidgetEchoStore.ts b/src/stores/WidgetEchoStore.ts index d3ef9df023..34b9b4aa47 100644 --- a/src/stores/WidgetEchoStore.ts +++ b/src/stores/WidgetEchoStore.ts @@ -17,6 +17,7 @@ limitations under the License. import EventEmitter from 'events'; import { IWidget } from 'matrix-widget-api'; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { WidgetType } from "../widgets/WidgetType"; /** diff --git a/src/stores/WidgetStore.ts b/src/stores/WidgetStore.ts index ebe761aa80..c1f6cea52c 100644 --- a/src/stores/WidgetStore.ts +++ b/src/stores/WidgetStore.ts @@ -17,6 +17,7 @@ limitations under the License. import { Room } from "matrix-js-sdk/src/models/room"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { IWidget } from "matrix-widget-api"; +import { logger } from "matrix-js-sdk/src/logger"; import { ActionPayload } from "../dispatcher/payloads"; import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; @@ -28,8 +29,6 @@ import { WidgetType } from "../widgets/WidgetType"; import { UPDATE_EVENT } from "./AsyncStore"; import { MatrixClientPeg } from "../MatrixClientPeg"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IState {} export interface IApp extends IWidget { diff --git a/src/stores/local-echo/EchoChamber.ts b/src/stores/local-echo/EchoChamber.ts index f61e521728..7248aa78f6 100644 --- a/src/stores/local-echo/EchoChamber.ts +++ b/src/stores/local-echo/EchoChamber.ts @@ -14,8 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { RoomEchoChamber } from "./RoomEchoChamber"; import { Room } from "matrix-js-sdk/src/models/room"; + +import { RoomEchoChamber } from "./RoomEchoChamber"; import { EchoStore } from "./EchoStore"; /** diff --git a/src/stores/local-echo/EchoStore.ts b/src/stores/local-echo/EchoStore.ts index 9c038c5a4f..b52a73ab7f 100644 --- a/src/stores/local-echo/EchoStore.ts +++ b/src/stores/local-echo/EchoStore.ts @@ -14,8 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { GenericEchoChamber } from "./GenericEchoChamber"; import { Room } from "matrix-js-sdk/src/models/room"; + +import { GenericEchoChamber } from "./GenericEchoChamber"; import { RoomEchoChamber } from "./RoomEchoChamber"; import { RoomEchoContext } from "./RoomEchoContext"; import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; diff --git a/src/stores/local-echo/GenericEchoChamber.ts b/src/stores/local-echo/GenericEchoChamber.ts index 6148098fbe..0f07a74355 100644 --- a/src/stores/local-echo/GenericEchoChamber.ts +++ b/src/stores/local-echo/GenericEchoChamber.ts @@ -14,11 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { EchoContext } from "./EchoContext"; -import { EchoTransaction, RunFn, TransactionStatus } from "./EchoTransaction"; import { MatrixClient } from "matrix-js-sdk/src/client"; import { EventEmitter } from "events"; +import { EchoContext } from "./EchoContext"; +import { EchoTransaction, RunFn, TransactionStatus } from "./EchoTransaction"; + export async function implicitlyReverted() { // do nothing :D } diff --git a/src/stores/local-echo/RoomEchoChamber.ts b/src/stores/local-echo/RoomEchoChamber.ts index fb40e23a85..bd54dbc9ae 100644 --- a/src/stores/local-echo/RoomEchoChamber.ts +++ b/src/stores/local-echo/RoomEchoChamber.ts @@ -14,11 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { GenericEchoChamber, implicitlyReverted, PROPERTY_UPDATED } from "./GenericEchoChamber"; import { getRoomNotifsState, RoomNotifState, setRoomNotifsState } from "../../RoomNotifs"; import { RoomEchoContext } from "./RoomEchoContext"; import { _t } from "../../languageHandler"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; export enum CachedRoomKey { NotificationVolume, diff --git a/src/stores/local-echo/RoomEchoContext.ts b/src/stores/local-echo/RoomEchoContext.ts index 4105f728c3..23090c4588 100644 --- a/src/stores/local-echo/RoomEchoContext.ts +++ b/src/stores/local-echo/RoomEchoContext.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { EchoContext } from "./EchoContext"; import { Room } from "matrix-js-sdk/src/models/room"; +import { EchoContext } from "./EchoContext"; + export class RoomEchoContext extends EchoContext { constructor(public readonly room: Room) { super(); diff --git a/src/stores/notifications/ListNotificationState.ts b/src/stores/notifications/ListNotificationState.ts index 97ba2bd80b..51d4912add 100644 --- a/src/stores/notifications/ListNotificationState.ts +++ b/src/stores/notifications/ListNotificationState.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { Room } from "matrix-js-sdk/src/models/room"; + import { NotificationColor } from "./NotificationColor"; import { TagID } from "../room-list/models"; -import { Room } from "matrix-js-sdk/src/models/room"; import { arrayDiff } from "../../utils/arrays"; import { RoomNotificationState } from "./RoomNotificationState"; import { NOTIFICATION_STATE_UPDATE, NotificationState } from "./NotificationState"; diff --git a/src/stores/notifications/NotificationState.ts b/src/stores/notifications/NotificationState.ts index 00dbb7856f..d216610b33 100644 --- a/src/stores/notifications/NotificationState.ts +++ b/src/stores/notifications/NotificationState.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { EventEmitter } from "events"; + import { NotificationColor } from "./NotificationColor"; import { IDestroyable } from "../../utils/IDestroyable"; diff --git a/src/stores/notifications/RoomNotificationState.ts b/src/stores/notifications/RoomNotificationState.ts index 3ad0080183..b4a0b19cb4 100644 --- a/src/stores/notifications/RoomNotificationState.ts +++ b/src/stores/notifications/RoomNotificationState.ts @@ -14,13 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { NotificationCountType, Room } from "matrix-js-sdk/src/models/room"; + import { NotificationColor } from "./NotificationColor"; import { IDestroyable } from "../../utils/IDestroyable"; import { MatrixClientPeg } from "../../MatrixClientPeg"; import { EffectiveMembership, getEffectiveMembership } from "../../utils/membership"; import { readReceiptChangeIsFor } from "../../utils/read-receipts"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; -import { NotificationCountType, Room } from "matrix-js-sdk/src/models/room"; import * as RoomNotifs from '../../RoomNotifs'; import * as Unread from '../../Unread'; import { NotificationState } from "./NotificationState"; diff --git a/src/stores/notifications/RoomNotificationStateStore.ts b/src/stores/notifications/RoomNotificationStateStore.ts index 7253b46ddd..330e159085 100644 --- a/src/stores/notifications/RoomNotificationStateStore.ts +++ b/src/stores/notifications/RoomNotificationStateStore.ts @@ -14,12 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { Room } from "matrix-js-sdk/src/models/room"; + import { ActionPayload } from "../../dispatcher/payloads"; import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; import defaultDispatcher from "../../dispatcher/dispatcher"; import { DefaultTagID, TagID } from "../room-list/models"; import { FetchRoomFn, ListNotificationState } from "./ListNotificationState"; -import { Room } from "matrix-js-sdk/src/models/room"; import { RoomNotificationState } from "./RoomNotificationState"; import { SummarizedNotificationState } from "./SummarizedNotificationState"; import { VisibilityProvider } from "../room-list/filters/VisibilityProvider"; diff --git a/src/stores/room-list/MessagePreviewStore.ts b/src/stores/room-list/MessagePreviewStore.ts index 8fcbb5b94f..aa8bf97953 100644 --- a/src/stores/room-list/MessagePreviewStore.ts +++ b/src/stores/room-list/MessagePreviewStore.ts @@ -15,19 +15,20 @@ limitations under the License. */ import { Room } from "matrix-js-sdk/src/models/room"; +import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { ActionPayload } from "../../dispatcher/payloads"; import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; import defaultDispatcher from "../../dispatcher/dispatcher"; import { MessageEventPreview } from "./previews/MessageEventPreview"; import { TagID } from "./models"; -import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; import { CallInviteEventPreview } from "./previews/CallInviteEventPreview"; import { CallAnswerEventPreview } from "./previews/CallAnswerEventPreview"; import { CallHangupEvent } from "./previews/CallHangupEvent"; import { StickerEventPreview } from "./previews/StickerEventPreview"; import { ReactionEventPreview } from "./previews/ReactionEventPreview"; import { UPDATE_EVENT } from "../AsyncStore"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; // Emitted event for when a room's preview has changed. First argument will the room for which // the change happened. diff --git a/src/stores/room-list/RoomListLayoutStore.ts b/src/stores/room-list/RoomListLayoutStore.ts index d5b31fed93..fce230779e 100644 --- a/src/stores/room-list/RoomListLayoutStore.ts +++ b/src/stores/room-list/RoomListLayoutStore.ts @@ -14,14 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { logger } from "matrix-js-sdk/src/logger"; + import { TagID } from "./models"; import { ListLayout } from "./ListLayout"; import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; import defaultDispatcher from "../../dispatcher/dispatcher"; import { ActionPayload } from "../../dispatcher/payloads"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IState {} export default class RoomListLayoutStore extends AsyncStoreWithClient { diff --git a/src/stores/room-list/RoomListStore.ts b/src/stores/room-list/RoomListStore.ts index c4b1f012b1..de22c4575e 100644 --- a/src/stores/room-list/RoomListStore.ts +++ b/src/stores/room-list/RoomListStore.ts @@ -15,9 +15,12 @@ limitations under the License. */ import { MatrixClient } from "matrix-js-sdk/src/client"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; +import { logger } from "matrix-js-sdk/src/logger"; + import SettingsStore from "../../settings/SettingsStore"; import { DefaultTagID, isCustomTag, OrderedDefaultTagIDs, RoomUpdateCause, TagID } from "./models"; -import { Room } from "matrix-js-sdk/src/models/room"; import { IListOrderingMap, ITagMap, ITagSortingMap, ListAlgorithm, SortAlgorithm } from "./algorithms/models"; import { ActionPayload } from "../../dispatcher/payloads"; import defaultDispatcher from "../../dispatcher/dispatcher"; @@ -27,7 +30,6 @@ import { TagWatcher } from "./TagWatcher"; import RoomViewStore from "../RoomViewStore"; import { Algorithm, LIST_UPDATED_EVENT } from "./algorithms/Algorithm"; import { EffectiveMembership, getEffectiveMembership } from "../../utils/membership"; -import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; import RoomListLayoutStore from "./RoomListLayoutStore"; import { MarkedExecution } from "../../utils/MarkedExecution"; import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; @@ -39,8 +41,6 @@ import SpaceStore from "../SpaceStore"; import { Action } from "../../dispatcher/actions"; import { SettingUpdatedPayload } from "../../dispatcher/payloads/SettingUpdatedPayload"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IState { tagsEnabled?: boolean; } diff --git a/src/stores/room-list/TagWatcher.ts b/src/stores/room-list/TagWatcher.ts index 09f6ec13cd..a0bcf76bf6 100644 --- a/src/stores/room-list/TagWatcher.ts +++ b/src/stores/room-list/TagWatcher.ts @@ -14,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { logger } from "matrix-js-sdk/src/logger"; + import { RoomListStoreClass } from "./RoomListStore"; import GroupFilterOrderStore from "../GroupFilterOrderStore"; import { CommunityFilterCondition } from "./filters/CommunityFilterCondition"; import { arrayDiff, arrayHasDiff } from "../../utils/arrays"; -import { logger } from "matrix-js-sdk/src/logger"; - /** * Watches for changes in groups to manage filters on the provided RoomListStore */ diff --git a/src/stores/room-list/algorithms/Algorithm.ts b/src/stores/room-list/algorithms/Algorithm.ts index 5e98ef37ff..11d3330b3e 100644 --- a/src/stores/room-list/algorithms/Algorithm.ts +++ b/src/stores/room-list/algorithms/Algorithm.ts @@ -17,6 +17,7 @@ limitations under the License. import { Room } from "matrix-js-sdk/src/models/room"; import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; import { EventEmitter } from "events"; +import { logger } from "matrix-js-sdk/src/logger"; import DMRoomMap from "../../../utils/DMRoomMap"; import { arrayDiff, arrayHasDiff } from "../../../utils/arrays"; @@ -36,8 +37,6 @@ import { getListAlgorithmInstance } from "./list-ordering"; import { VisibilityProvider } from "../filters/VisibilityProvider"; import SpaceStore from "../../SpaceStore"; -import { logger } from "matrix-js-sdk/src/logger"; - /** * Fired when the Algorithm has determined a list has been updated. */ diff --git a/src/stores/room-list/algorithms/list-ordering/ImportanceAlgorithm.ts b/src/stores/room-list/algorithms/list-ordering/ImportanceAlgorithm.ts index ef1f4629be..1f9a030faf 100644 --- a/src/stores/room-list/algorithms/list-ordering/ImportanceAlgorithm.ts +++ b/src/stores/room-list/algorithms/list-ordering/ImportanceAlgorithm.ts @@ -16,6 +16,8 @@ limitations under the License. */ import { Room } from "matrix-js-sdk/src/models/room"; +import { logger } from "matrix-js-sdk/src/logger"; + import { RoomUpdateCause, TagID } from "../../models"; import { SortAlgorithm } from "../models"; import { sortRoomsWithAlgorithm } from "../tag-sorting"; @@ -23,8 +25,6 @@ import { OrderingAlgorithm } from "./OrderingAlgorithm"; import { NotificationColor } from "../../../notifications/NotificationColor"; import { RoomNotificationStateStore } from "../../../notifications/RoomNotificationStateStore"; -import { logger } from "matrix-js-sdk/src/logger"; - interface ICategorizedRoomMap { // @ts-ignore - TS wants this to be a string, but we know better [category: NotificationColor]: Room[]; diff --git a/src/stores/room-list/algorithms/list-ordering/NaturalAlgorithm.ts b/src/stores/room-list/algorithms/list-ordering/NaturalAlgorithm.ts index 726987e734..3d333efa17 100644 --- a/src/stores/room-list/algorithms/list-ordering/NaturalAlgorithm.ts +++ b/src/stores/room-list/algorithms/list-ordering/NaturalAlgorithm.ts @@ -14,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { Room } from "matrix-js-sdk/src/models/room"; +import { logger } from "matrix-js-sdk/src/logger"; + import { SortAlgorithm } from "../models"; import { sortRoomsWithAlgorithm } from "../tag-sorting"; import { OrderingAlgorithm } from "./OrderingAlgorithm"; import { RoomUpdateCause, TagID } from "../../models"; -import { Room } from "matrix-js-sdk/src/models/room"; - -import { logger } from "matrix-js-sdk/src/logger"; /** * Uses the natural tag sorting algorithm order to determine tag ordering. No diff --git a/src/stores/room-list/algorithms/list-ordering/OrderingAlgorithm.ts b/src/stores/room-list/algorithms/list-ordering/OrderingAlgorithm.ts index 3afcd4f9d5..63e6a96d20 100644 --- a/src/stores/room-list/algorithms/list-ordering/OrderingAlgorithm.ts +++ b/src/stores/room-list/algorithms/list-ordering/OrderingAlgorithm.ts @@ -15,11 +15,11 @@ limitations under the License. */ import { Room } from "matrix-js-sdk/src/models/room"; +import { logger } from "matrix-js-sdk/src/logger"; + import { RoomUpdateCause, TagID } from "../../models"; import { SortAlgorithm } from "../models"; -import { logger } from "matrix-js-sdk/src/logger"; - /** * Represents a list ordering algorithm. Subclasses should populate the * `cachedOrderedRooms` field. diff --git a/src/stores/room-list/algorithms/models.ts b/src/stores/room-list/algorithms/models.ts index 943d833b67..41152ac9ba 100644 --- a/src/stores/room-list/algorithms/models.ts +++ b/src/stores/room-list/algorithms/models.ts @@ -14,8 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { TagID } from "../models"; import { Room } from "matrix-js-sdk/src/models/room"; + +import { TagID } from "../models"; import { OrderingAlgorithm } from "./list-ordering/OrderingAlgorithm"; export enum SortAlgorithm { diff --git a/src/stores/room-list/algorithms/tag-sorting/AlphabeticAlgorithm.ts b/src/stores/room-list/algorithms/tag-sorting/AlphabeticAlgorithm.ts index 45f6eaf843..8bf7061cbc 100644 --- a/src/stores/room-list/algorithms/tag-sorting/AlphabeticAlgorithm.ts +++ b/src/stores/room-list/algorithms/tag-sorting/AlphabeticAlgorithm.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { Room } from "matrix-js-sdk/src/models/room"; + import { TagID } from "../../models"; import { IAlgorithm } from "./IAlgorithm"; import { compare } from "../../../../utils/strings"; diff --git a/src/stores/room-list/algorithms/tag-sorting/IAlgorithm.ts b/src/stores/room-list/algorithms/tag-sorting/IAlgorithm.ts index 588bbbffc9..46b18a04f4 100644 --- a/src/stores/room-list/algorithms/tag-sorting/IAlgorithm.ts +++ b/src/stores/room-list/algorithms/tag-sorting/IAlgorithm.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { Room } from "matrix-js-sdk/src/models/room"; + import { TagID } from "../../models"; /** diff --git a/src/stores/room-list/algorithms/tag-sorting/ManualAlgorithm.ts b/src/stores/room-list/algorithms/tag-sorting/ManualAlgorithm.ts index 9be8ba5262..116ff327c4 100644 --- a/src/stores/room-list/algorithms/tag-sorting/ManualAlgorithm.ts +++ b/src/stores/room-list/algorithms/tag-sorting/ManualAlgorithm.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { Room } from "matrix-js-sdk/src/models/room"; + import { TagID } from "../../models"; import { IAlgorithm } from "./IAlgorithm"; diff --git a/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts b/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts index 0da2c69eb8..af937e92af 100644 --- a/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts +++ b/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts @@ -15,13 +15,14 @@ limitations under the License. */ import { Room } from "matrix-js-sdk/src/models/room"; +import { EventType } from "matrix-js-sdk/src/@types/event"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { TagID } from "../../models"; import { IAlgorithm } from "./IAlgorithm"; import { MatrixClientPeg } from "../../../../MatrixClientPeg"; import * as Unread from "../../../../Unread"; import { EffectiveMembership, getEffectiveMembership } from "../../../../utils/membership"; -import { EventType } from "matrix-js-sdk/src/@types/event"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; export function shouldCauseReorder(event: MatrixEvent): boolean { const type = event.getType(); diff --git a/src/stores/room-list/algorithms/tag-sorting/index.ts b/src/stores/room-list/algorithms/tag-sorting/index.ts index 368c76f111..fcd620d60f 100644 --- a/src/stores/room-list/algorithms/tag-sorting/index.ts +++ b/src/stores/room-list/algorithms/tag-sorting/index.ts @@ -14,11 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { Room } from "matrix-js-sdk/src/models/room"; + import { SortAlgorithm } from "../models"; import { ManualAlgorithm } from "./ManualAlgorithm"; import { IAlgorithm } from "./IAlgorithm"; import { TagID } from "../../models"; -import { Room } from "matrix-js-sdk/src/models/room"; import { RecentAlgorithm } from "./RecentAlgorithm"; import { AlphabeticAlgorithm } from "./AlphabeticAlgorithm"; diff --git a/src/stores/room-list/filters/CommunityFilterCondition.ts b/src/stores/room-list/filters/CommunityFilterCondition.ts index a66bc01bce..a1b3da5be2 100644 --- a/src/stores/room-list/filters/CommunityFilterCondition.ts +++ b/src/stores/room-list/filters/CommunityFilterCondition.ts @@ -15,9 +15,10 @@ limitations under the License. */ import { Room } from "matrix-js-sdk/src/models/room"; -import { FILTER_CHANGED, FilterKind, IFilterCondition } from "./IFilterCondition"; import { Group } from "matrix-js-sdk/src/models/group"; import { EventEmitter } from "events"; + +import { FILTER_CHANGED, FilterKind, IFilterCondition } from "./IFilterCondition"; import GroupStore from "../../GroupStore"; import { IDestroyable } from "../../../utils/IDestroyable"; import DMRoomMap from "../../../utils/DMRoomMap"; diff --git a/src/stores/room-list/filters/NameFilterCondition.ts b/src/stores/room-list/filters/NameFilterCondition.ts index e21d5ab718..c2dd40f4c2 100644 --- a/src/stores/room-list/filters/NameFilterCondition.ts +++ b/src/stores/room-list/filters/NameFilterCondition.ts @@ -15,11 +15,12 @@ limitations under the License. */ import { Room } from "matrix-js-sdk/src/models/room"; -import { FILTER_CHANGED, FilterKind, IFilterCondition } from "./IFilterCondition"; import { EventEmitter } from "events"; import { normalize } from "matrix-js-sdk/src/utils"; import { throttle } from "lodash"; +import { FILTER_CHANGED, FilterKind, IFilterCondition } from "./IFilterCondition"; + /** * A filter condition for the room list which reveals rooms of a particular * name, or associated name (like a room alias). diff --git a/src/stores/room-list/filters/VisibilityProvider.ts b/src/stores/room-list/filters/VisibilityProvider.ts index f63b622053..d1a8c9db9c 100644 --- a/src/stores/room-list/filters/VisibilityProvider.ts +++ b/src/stores/room-list/filters/VisibilityProvider.ts @@ -15,6 +15,7 @@ */ import { Room } from "matrix-js-sdk/src/models/room"; + import CallHandler from "../../../CallHandler"; import { RoomListCustomisations } from "../../../customisations/RoomList"; import VoipUserMapper from "../../../VoipUserMapper"; diff --git a/src/stores/room-list/previews/CallAnswerEventPreview.ts b/src/stores/room-list/previews/CallAnswerEventPreview.ts index 7193154890..638b0eb2a6 100644 --- a/src/stores/room-list/previews/CallAnswerEventPreview.ts +++ b/src/stores/room-list/previews/CallAnswerEventPreview.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { IPreview } from "./IPreview"; import { TagID } from "../models"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils"; import { _t } from "../../../languageHandler"; diff --git a/src/stores/room-list/previews/CallHangupEvent.ts b/src/stores/room-list/previews/CallHangupEvent.ts index 54d4d70fb0..6cbd0ae1a2 100644 --- a/src/stores/room-list/previews/CallHangupEvent.ts +++ b/src/stores/room-list/previews/CallHangupEvent.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { IPreview } from "./IPreview"; import { TagID } from "../models"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils"; import { _t } from "../../../languageHandler"; diff --git a/src/stores/room-list/previews/CallInviteEventPreview.ts b/src/stores/room-list/previews/CallInviteEventPreview.ts index 3e6a89aa6d..4ad109b14c 100644 --- a/src/stores/room-list/previews/CallInviteEventPreview.ts +++ b/src/stores/room-list/previews/CallInviteEventPreview.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { IPreview } from "./IPreview"; import { TagID } from "../models"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils"; import { _t } from "../../../languageHandler"; diff --git a/src/stores/room-list/previews/IPreview.ts b/src/stores/room-list/previews/IPreview.ts index fe69637543..6049d9f8a2 100644 --- a/src/stores/room-list/previews/IPreview.ts +++ b/src/stores/room-list/previews/IPreview.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { TagID } from "../models"; /** diff --git a/src/stores/room-list/previews/MessageEventPreview.ts b/src/stores/room-list/previews/MessageEventPreview.ts index b8e3119ad4..51a3099892 100644 --- a/src/stores/room-list/previews/MessageEventPreview.ts +++ b/src/stores/room-list/previews/MessageEventPreview.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { IPreview } from "./IPreview"; import { TagID } from "../models"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { _t, sanitizeForTranslation } from "../../../languageHandler"; import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils"; import ReplyChain from "../../../components/views/elements/ReplyChain"; diff --git a/src/stores/room-list/previews/ReactionEventPreview.ts b/src/stores/room-list/previews/ReactionEventPreview.ts index 4e2c175055..6a9ae21afc 100644 --- a/src/stores/room-list/previews/ReactionEventPreview.ts +++ b/src/stores/room-list/previews/ReactionEventPreview.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { IPreview } from "./IPreview"; import { TagID } from "../models"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils"; import { _t } from "../../../languageHandler"; import SettingsStore from "../../../settings/SettingsStore"; diff --git a/src/stores/room-list/previews/StickerEventPreview.ts b/src/stores/room-list/previews/StickerEventPreview.ts index 6ad43ef3e1..9e8cfd34d3 100644 --- a/src/stores/room-list/previews/StickerEventPreview.ts +++ b/src/stores/room-list/previews/StickerEventPreview.ts @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { IPreview } from "./IPreview"; import { TagID } from "../models"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils"; import { _t } from "../../../languageHandler"; diff --git a/src/stores/room-list/previews/utils.ts b/src/stores/room-list/previews/utils.ts index ebbecd7bbd..440b9433ba 100644 --- a/src/stores/room-list/previews/utils.ts +++ b/src/stores/room-list/previews/utils.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { DefaultTagID, TagID } from "../models"; diff --git a/src/stores/widgets/StopGapWidget.ts b/src/stores/widgets/StopGapWidget.ts index 1293fe0548..b39e79d36e 100644 --- a/src/stores/widgets/StopGapWidget.ts +++ b/src/stores/widgets/StopGapWidget.ts @@ -32,8 +32,11 @@ import { IWidgetApiErrorResponseData, WidgetKind, } from "matrix-widget-api"; -import { StopGapWidgetDriver } from "./StopGapWidgetDriver"; import { EventEmitter } from "events"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { logger } from "matrix-js-sdk/src/logger"; + +import { StopGapWidgetDriver } from "./StopGapWidgetDriver"; import { WidgetMessagingStore } from "./WidgetMessagingStore"; import RoomViewStore from "../RoomViewStore"; import { MatrixClientPeg } from "../../MatrixClientPeg"; @@ -51,14 +54,11 @@ import ThemeWatcher from "../../settings/watchers/ThemeWatcher"; import { getCustomTheme } from "../../theme"; import CountlyAnalytics from "../../CountlyAnalytics"; import { ElementWidgetCapabilities } from "./ElementWidgetCapabilities"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { ELEMENT_CLIENT_ID } from "../../identifiers"; import { getUserLanguage } from "../../languageHandler"; import { WidgetVariableCustomisations } from "../../customisations/WidgetVariables"; import { arrayFastClone } from "../../utils/arrays"; -import { logger } from "matrix-js-sdk/src/logger"; - // TODO: Destroy all of this code interface IAppTileProps { diff --git a/src/stores/widgets/StopGapWidgetDriver.ts b/src/stores/widgets/StopGapWidgetDriver.ts index e8f550b92c..f8e720ac19 100644 --- a/src/stores/widgets/StopGapWidgetDriver.ts +++ b/src/stores/widgets/StopGapWidgetDriver.ts @@ -29,6 +29,11 @@ import { WidgetEventCapability, WidgetKind, } from "matrix-widget-api"; +import { EventType } from "matrix-js-sdk/src/@types/event"; +import { IEvent, MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { logger } from "matrix-js-sdk/src/logger"; + import { iterableDiff, iterableUnion } from "../../utils/iterables"; import { MatrixClientPeg } from "../../MatrixClientPeg"; import ActiveRoomObserver from "../../ActiveRoomObserver"; @@ -38,15 +43,10 @@ import WidgetCapabilitiesPromptDialog from "../../components/views/dialogs/Widge import { WidgetPermissionCustomisations } from "../../customisations/WidgetPermissions"; import { OIDCState, WidgetPermissionStore } from "./WidgetPermissionStore"; import { WidgetType } from "../../widgets/WidgetType"; -import { EventType } from "matrix-js-sdk/src/@types/event"; import { CHAT_EFFECTS } from "../../effects"; import { containsEmoji } from "../../effects/utils"; import dis from "../../dispatcher/dispatcher"; import { tryTransformPermalinkToLocalHref } from "../../utils/permalinks/Permalinks"; -import { IEvent, MatrixEvent } from "matrix-js-sdk/src/models/event"; -import { Room } from "matrix-js-sdk/src/models/room"; - -import { logger } from "matrix-js-sdk/src/logger"; // TODO: Purge this from the universe diff --git a/src/stores/widgets/WidgetLayoutStore.ts b/src/stores/widgets/WidgetLayoutStore.ts index 5d427a0f1a..fcb0eec28d 100644 --- a/src/stores/widgets/WidgetLayoutStore.ts +++ b/src/stores/widgets/WidgetLayoutStore.ts @@ -14,14 +14,15 @@ * limitations under the License. */ -import SettingsStore from "../../settings/SettingsStore"; import { Room } from "matrix-js-sdk/src/models/room"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + +import SettingsStore from "../../settings/SettingsStore"; import WidgetStore, { IApp } from "../WidgetStore"; import { WidgetType } from "../../widgets/WidgetType"; import { clamp, defaultNumber, sum } from "../../utils/numbers"; import defaultDispatcher from "../../dispatcher/dispatcher"; import { ReadyWatchingStore } from "../ReadyWatchingStore"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { SettingLevel } from "../../settings/SettingLevel"; import { arrayFastClone } from "../../utils/arrays"; import { UPDATE_EVENT } from "../AsyncStore"; diff --git a/src/stores/widgets/WidgetMessagingStore.ts b/src/stores/widgets/WidgetMessagingStore.ts index 83d3ac7df8..824132b5c3 100644 --- a/src/stores/widgets/WidgetMessagingStore.ts +++ b/src/stores/widgets/WidgetMessagingStore.ts @@ -15,6 +15,7 @@ */ import { ClientWidgetApi, Widget } from "matrix-widget-api"; + import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; import defaultDispatcher from "../../dispatcher/dispatcher"; import { ActionPayload } from "../../dispatcher/payloads"; diff --git a/src/stores/widgets/WidgetPermissionStore.ts b/src/stores/widgets/WidgetPermissionStore.ts index 41e8bc6652..246492333c 100644 --- a/src/stores/widgets/WidgetPermissionStore.ts +++ b/src/stores/widgets/WidgetPermissionStore.ts @@ -14,8 +14,9 @@ * limitations under the License. */ -import SettingsStore from "../../settings/SettingsStore"; import { Widget, WidgetKind } from "matrix-widget-api"; + +import SettingsStore from "../../settings/SettingsStore"; import { MatrixClientPeg } from "../../MatrixClientPeg"; import { SettingLevel } from "../../settings/SettingLevel"; diff --git a/src/theme.ts b/src/theme.ts index aaebe3746d..effd0a7b05 100644 --- a/src/theme.ts +++ b/src/theme.ts @@ -16,7 +16,6 @@ limitations under the License. */ import { _t } from "./languageHandler"; - import SettingsStore from "./settings/SettingsStore"; import ThemeWatcher from "./settings/watchers/ThemeWatcher"; diff --git a/src/toasts/IncomingCallToast.tsx b/src/toasts/IncomingCallToast.tsx index fbe4e66d50..220addffbc 100644 --- a/src/toasts/IncomingCallToast.tsx +++ b/src/toasts/IncomingCallToast.tsx @@ -20,6 +20,7 @@ limitations under the License. import React from 'react'; import { CallType, MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; import classNames from 'classnames'; + import { replaceableComponent } from '../utils/replaceableComponent'; import CallHandler, { CallHandlerEvent } from '../CallHandler'; import dis from '../dispatcher/dispatcher'; diff --git a/src/utils/AutoDiscoveryUtils.tsx b/src/utils/AutoDiscoveryUtils.tsx index ae804381cf..8860a5104f 100644 --- a/src/utils/AutoDiscoveryUtils.tsx +++ b/src/utils/AutoDiscoveryUtils.tsx @@ -16,12 +16,12 @@ limitations under the License. import React, { ReactNode } from 'react'; import { AutoDiscovery } from "matrix-js-sdk/src/autodiscovery"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t, _td, newTranslatableError } from "../languageHandler"; import { makeType } from "./TypeUtils"; import SdkConfig from '../SdkConfig'; -import { logger } from "matrix-js-sdk/src/logger"; - const LIVELINESS_DISCOVERY_ERRORS: string[] = [ AutoDiscovery.ERROR_INVALID_HOMESERVER, AutoDiscovery.ERROR_INVALID_IDENTITY_SERVER, diff --git a/src/utils/DMRoomMap.ts b/src/utils/DMRoomMap.ts index 089279cdcc..0cec18816c 100644 --- a/src/utils/DMRoomMap.ts +++ b/src/utils/DMRoomMap.ts @@ -17,11 +17,10 @@ limitations under the License. import { uniq } from "lodash"; import { Room } from "matrix-js-sdk/src/models/room"; import { MatrixClient } from "matrix-js-sdk/src/client"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from '../MatrixClientPeg'; -import { logger } from "matrix-js-sdk/src/logger"; - /** * Class that takes a Matrix Client and flips the m.direct map * so the operation of mapping a room ID to which user it's a DM diff --git a/src/utils/DecryptFile.ts b/src/utils/DecryptFile.ts index 891439ffe1..d7ac3d4f56 100644 --- a/src/utils/DecryptFile.ts +++ b/src/utils/DecryptFile.ts @@ -16,6 +16,7 @@ limitations under the License. // Pull in the encryption lib so that we can decrypt attachments. import encrypt from 'browser-encrypt-attachment'; + import { mediaFromContent } from "../customisations/Media"; import { IEncryptedFile, IMediaEventInfo } from "../customisations/models/IMediaEventContent"; import { getBlobSafeMimeType } from "./blobs"; diff --git a/src/utils/DirectoryUtils.ts b/src/utils/DirectoryUtils.ts index 255ae0e3fd..89e719f320 100644 --- a/src/utils/DirectoryUtils.ts +++ b/src/utils/DirectoryUtils.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { IInstance } from "matrix-js-sdk/src/client"; + import { Protocols } from "../components/views/directory/NetworkDropdown"; // Find a protocol 'instance' with a given instance_id diff --git a/src/utils/EventUtils.ts b/src/utils/EventUtils.ts index 894dcb3955..96b37bd6a8 100644 --- a/src/utils/EventUtils.ts +++ b/src/utils/EventUtils.ts @@ -15,15 +15,15 @@ limitations under the License. */ import { MatrixEvent, EventStatus } from 'matrix-js-sdk/src/models/event'; +import { EventType } from "matrix-js-sdk/src/@types/event"; +import { MatrixClient } from 'matrix-js-sdk/src/client'; +import { Thread } from 'matrix-js-sdk/src/models/thread'; +import { logger } from 'matrix-js-sdk/src/logger'; import { MatrixClientPeg } from '../MatrixClientPeg'; import shouldHideEvent from "../shouldHideEvent"; import { getHandlerTile, haveTileForEvent } from "../components/views/rooms/EventTile"; import SettingsStore from "../settings/SettingsStore"; -import { EventType } from "matrix-js-sdk/src/@types/event"; -import { MatrixClient } from 'matrix-js-sdk/src/client'; -import { Thread } from 'matrix-js-sdk/src/models/thread'; -import { logger } from 'matrix-js-sdk/src/logger'; /** * Returns whether an event should allow actions like reply, reactions, edit, etc. diff --git a/src/utils/FileUtils.ts b/src/utils/FileUtils.ts index c83f2ed417..21d2928073 100644 --- a/src/utils/FileUtils.ts +++ b/src/utils/FileUtils.ts @@ -16,6 +16,7 @@ limitations under the License. */ import filesize from 'filesize'; + import { IMediaEventContent } from '../customisations/models/IMediaEventContent'; import { _t } from '../languageHandler'; diff --git a/src/utils/IdentityServerUtils.ts b/src/utils/IdentityServerUtils.ts index ef432f71df..e760dd5b45 100644 --- a/src/utils/IdentityServerUtils.ts +++ b/src/utils/IdentityServerUtils.ts @@ -15,12 +15,11 @@ limitations under the License. */ import { SERVICE_TYPES } from 'matrix-js-sdk/src/service-types'; +import { logger } from "matrix-js-sdk/src/logger"; import SdkConfig from '../SdkConfig'; import { MatrixClientPeg } from '../MatrixClientPeg'; -import { logger } from "matrix-js-sdk/src/logger"; - export function getDefaultIdentityServerUrl(): string { return SdkConfig.get()['validated_server_config']['isUrl']; } diff --git a/src/utils/MediaEventHelper.ts b/src/utils/MediaEventHelper.ts index 1494edddc1..24680668d9 100644 --- a/src/utils/MediaEventHelper.ts +++ b/src/utils/MediaEventHelper.ts @@ -15,14 +15,14 @@ limitations under the License. */ import { MatrixEvent } from "matrix-js-sdk/src"; +import { EventType, MsgType } from "matrix-js-sdk/src/@types/event"; +import { logger } from "matrix-js-sdk/src/logger"; + import { LazyValue } from "./LazyValue"; import { Media, mediaFromContent } from "../customisations/Media"; import { decryptFile } from "./DecryptFile"; import { IMediaEventContent } from "../customisations/models/IMediaEventContent"; import { IDestroyable } from "./IDestroyable"; -import { EventType, MsgType } from "matrix-js-sdk/src/@types/event"; - -import { logger } from "matrix-js-sdk/src/logger"; // TODO: We should consider caching the blobs. https://github.com/vector-im/element-web/issues/17192 diff --git a/src/utils/MegolmExportEncryption.ts b/src/utils/MegolmExportEncryption.ts index 47c395bfb7..b88b21132a 100644 --- a/src/utils/MegolmExportEncryption.ts +++ b/src/utils/MegolmExportEncryption.ts @@ -15,11 +15,11 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { logger } from "matrix-js-sdk/src/logger"; + import { _t } from '../languageHandler'; import SdkConfig from '../SdkConfig'; -import { logger } from "matrix-js-sdk/src/logger"; - const subtleCrypto = window.crypto.subtle || window.crypto.webkitSubtle; /** diff --git a/src/utils/MessageDiffUtils.tsx b/src/utils/MessageDiffUtils.tsx index 6a2244521e..580cd0792d 100644 --- a/src/utils/MessageDiffUtils.tsx +++ b/src/utils/MessageDiffUtils.tsx @@ -19,11 +19,10 @@ import classNames from 'classnames'; import { diff_match_patch as DiffMatchPatch } from 'diff-match-patch'; import { DiffDOM, IDiff } from "diff-dom"; import { IContent } from "matrix-js-sdk/src/models/event"; +import { logger } from "matrix-js-sdk/src/logger"; import { bodyToHtml, checkBlockNode, IOptsReturnString } from "../HtmlUtils"; -import { logger } from "matrix-js-sdk/src/logger"; - const decodeEntities = (function() { let textarea = null; return function(str: string): string { diff --git a/src/utils/MultiInviter.ts b/src/utils/MultiInviter.ts index f7f36370f9..8606937ec0 100644 --- a/src/utils/MultiInviter.ts +++ b/src/utils/MultiInviter.ts @@ -16,6 +16,7 @@ limitations under the License. import { MatrixError } from "matrix-js-sdk/src/http-api"; import { defer, IDeferred } from "matrix-js-sdk/src/utils"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from '../MatrixClientPeg'; import { AddressType, getAddressType } from '../UserAddress'; @@ -25,8 +26,6 @@ import Modal from "../Modal"; import SettingsStore from "../settings/SettingsStore"; import AskInviteAnywayDialog from "../components/views/dialogs/AskInviteAnywayDialog"; -import { logger } from "matrix-js-sdk/src/logger"; - export enum InviteState { Invited = "invited", Error = "error", diff --git a/src/utils/RoomUpgrade.ts b/src/utils/RoomUpgrade.ts index f2ac4aea4e..1e863d9c84 100644 --- a/src/utils/RoomUpgrade.ts +++ b/src/utils/RoomUpgrade.ts @@ -16,6 +16,7 @@ limitations under the License. import { Room } from "matrix-js-sdk/src/models/room"; import { EventType } from "matrix-js-sdk/src/@types/event"; +import { logger } from "matrix-js-sdk/src/logger"; import { inviteUsersToRoom } from "../RoomInvite"; import Modal, { IHandle } from "../Modal"; @@ -24,8 +25,6 @@ import ErrorDialog from "../components/views/dialogs/ErrorDialog"; import SpaceStore from "../stores/SpaceStore"; import Spinner from "../components/views/elements/Spinner"; -import { logger } from "matrix-js-sdk/src/logger"; - interface IProgress { roomUpgraded: boolean; roomSynced?: boolean; diff --git a/src/utils/StorageManager.ts b/src/utils/StorageManager.ts index b4f0c8906d..7d9ce885f7 100644 --- a/src/utils/StorageManager.ts +++ b/src/utils/StorageManager.ts @@ -15,12 +15,12 @@ limitations under the License. */ import { LocalStorageCryptoStore } from 'matrix-js-sdk/src/crypto/store/localStorage-crypto-store'; -import Analytics from '../Analytics'; import { IndexedDBStore } from "matrix-js-sdk/src/store/indexeddb"; import { IndexedDBCryptoStore } from "matrix-js-sdk/src/crypto/store/indexeddb-crypto-store"; - import { logger } from "matrix-js-sdk/src/logger"; +import Analytics from '../Analytics'; + const localStorage = window.localStorage; // just *accessing* indexedDB throws an exception in firefox with diff --git a/src/utils/Whenable.ts b/src/utils/Whenable.ts index 70173b3004..70bd45eb09 100644 --- a/src/utils/Whenable.ts +++ b/src/utils/Whenable.ts @@ -14,11 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { logger } from "matrix-js-sdk/src/logger"; + import { IDestroyable } from "./IDestroyable"; import { arrayFastClone } from "./arrays"; -import { logger } from "matrix-js-sdk/src/logger"; - export type WhenFn = (w: Whenable) => void; /** diff --git a/src/utils/WidgetUtils.ts b/src/utils/WidgetUtils.ts index 106ae4bfda..5f6d321b5a 100644 --- a/src/utils/WidgetUtils.ts +++ b/src/utils/WidgetUtils.ts @@ -19,6 +19,7 @@ import * as url from "url"; import { Capability, IWidget, IWidgetData, MatrixCapabilities } from "matrix-widget-api"; import { Room } from "matrix-js-sdk/src/models/room"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from '../MatrixClientPeg'; import SdkConfig from "../SdkConfig"; @@ -31,8 +32,6 @@ import { objectClone } from "./objects"; import { _t } from "../languageHandler"; import { IApp } from "../stores/WidgetStore"; -import { logger } from "matrix-js-sdk/src/logger"; - // How long we wait for the state event echo to come back from the server // before waitFor[Room/User]Widget rejects its promise const WIDGET_WAIT_TIME = 20000; diff --git a/src/utils/createMatrixClient.ts b/src/utils/createMatrixClient.ts index 0cce729e65..3fed5363d7 100644 --- a/src/utils/createMatrixClient.ts +++ b/src/utils/createMatrixClient.ts @@ -15,12 +15,13 @@ limitations under the License. */ // @ts-ignore - `.ts` is needed here to make TS happy -import IndexedDBWorker from "../workers/indexeddb.worker.ts"; import { createClient, ICreateClientOpts } from "matrix-js-sdk/src/matrix"; import { IndexedDBCryptoStore } from "matrix-js-sdk/src/crypto/store/indexeddb-crypto-store"; import { WebStorageSessionStore } from "matrix-js-sdk/src/store/session/webstorage"; import { IndexedDBStore } from "matrix-js-sdk/src/store/indexeddb"; +import IndexedDBWorker from "../workers/indexeddb.worker.ts"; + const localStorage = window.localStorage; // just *accessing* indexedDB throws an exception in firefox with diff --git a/src/utils/exportUtils/Exporter.ts b/src/utils/exportUtils/Exporter.ts index b23c1153e0..99432c26b4 100644 --- a/src/utils/exportUtils/Exporter.ts +++ b/src/utils/exportUtils/Exporter.ts @@ -16,21 +16,21 @@ limitations under the License. import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { Room } from "matrix-js-sdk/src/models/room"; +import { MatrixClient } from "matrix-js-sdk/src/client"; +import { Direction } from "matrix-js-sdk/src/models/event-timeline"; +import { saveAs } from "file-saver"; +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from "../../MatrixClientPeg"; import { IExportOptions, ExportType } from "./exportUtils"; import { decryptFile } from "../DecryptFile"; import { mediaFromContent } from "../../customisations/Media"; import { formatFullDateNoDay } from "../../DateUtils"; import { isVoiceMessage } from "../EventUtils"; -import { MatrixClient } from "matrix-js-sdk/src/client"; -import { Direction } from "matrix-js-sdk/src/models/event-timeline"; import { IMediaEventContent } from "../../customisations/models/IMediaEventContent"; -import { saveAs } from "file-saver"; import { _t } from "../../languageHandler"; import SdkConfig from "../../SdkConfig"; -import { logger } from "matrix-js-sdk/src/logger"; - type BlobFile = { name: string; blob: Blob; diff --git a/src/utils/exportUtils/HtmlExport.tsx b/src/utils/exportUtils/HtmlExport.tsx index f7d3bb5e09..383b9679fb 100644 --- a/src/utils/exportUtils/HtmlExport.tsx +++ b/src/utils/exportUtils/HtmlExport.tsx @@ -16,29 +16,29 @@ limitations under the License. import React from "react"; import ReactDOM from "react-dom"; -import Exporter from "./Exporter"; -import { mediaFromMxc } from "../../customisations/Media"; import { Room } from "matrix-js-sdk/src/models/room"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { renderToStaticMarkup } from "react-dom/server"; +import { EventType, MsgType } from "matrix-js-sdk/src/@types/event"; +import { logger } from "matrix-js-sdk/src/logger"; + +import Exporter from "./Exporter"; +import { mediaFromMxc } from "../../customisations/Media"; import { Layout } from "../../settings/Layout"; import { shouldFormContinuation } from "../../components/structures/MessagePanel"; import { formatFullDateNoDayNoTime, wantsDateSeparator } from "../../DateUtils"; import { RoomPermalinkCreator } from "../permalinks/Permalinks"; import { _t } from "../../languageHandler"; -import { EventType, MsgType } from "matrix-js-sdk/src/@types/event"; import * as Avatar from "../../Avatar"; import EventTile, { haveTileForEvent } from "../../components/views/rooms/EventTile"; import DateSeparator from "../../components/views/messages/DateSeparator"; import BaseAvatar from "../../components/views/avatars/BaseAvatar"; -import exportJS from "!!raw-loader!./exportJS"; -import { ExportType } from "./exportUtils"; -import { IExportOptions } from "./exportUtils"; +import { ExportType, IExportOptions } from "./exportUtils"; import MatrixClientContext from "../../contexts/MatrixClientContext"; import getExportCSS from "./exportCSS"; import { textForEvent } from "../../TextForEvent"; -import { logger } from "matrix-js-sdk/src/logger"; +import exportJS from "!!raw-loader!./exportJS"; export default class HTMLExporter extends Exporter { protected avatars: Map; diff --git a/src/utils/exportUtils/JSONExport.ts b/src/utils/exportUtils/JSONExport.ts index 6061f33cf6..96e2545827 100644 --- a/src/utils/exportUtils/JSONExport.ts +++ b/src/utils/exportUtils/JSONExport.ts @@ -14,16 +14,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Exporter from "./Exporter"; import { Room } from "matrix-js-sdk/src/models/room"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { EventType } from "matrix-js-sdk/src/@types/event"; +import { logger } from "matrix-js-sdk/src/logger"; + +import Exporter from "./Exporter"; import { formatFullDateNoDay, formatFullDateNoDayNoTime } from "../../DateUtils"; import { haveTileForEvent } from "../../components/views/rooms/EventTile"; -import { ExportType } from "./exportUtils"; -import { IExportOptions } from "./exportUtils"; -import { EventType } from "matrix-js-sdk/src/@types/event"; - -import { logger } from "matrix-js-sdk/src/logger"; +import { ExportType, IExportOptions } from "./exportUtils"; export default class JSONExporter extends Exporter { protected totalSize = 0; diff --git a/src/utils/exportUtils/PlainTextExport.ts b/src/utils/exportUtils/PlainTextExport.ts index e3201314f9..9eb4eca7b8 100644 --- a/src/utils/exportUtils/PlainTextExport.ts +++ b/src/utils/exportUtils/PlainTextExport.ts @@ -14,18 +14,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Exporter from "./Exporter"; import { Room } from "matrix-js-sdk/src/models/room"; import { IContent, MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { logger } from "matrix-js-sdk/src/logger"; + +import Exporter from "./Exporter"; import { formatFullDateNoDay } from "../../DateUtils"; import { _t } from "../../languageHandler"; import { haveTileForEvent } from "../../components/views/rooms/EventTile"; -import { ExportType } from "./exportUtils"; -import { IExportOptions } from "./exportUtils"; +import { ExportType, IExportOptions } from "./exportUtils"; import { textForEvent } from "../../TextForEvent"; -import { logger } from "matrix-js-sdk/src/logger"; - export default class PlainTextExporter extends Exporter { protected totalSize: number; protected mediaOmitText: string; diff --git a/src/utils/membership.ts b/src/utils/membership.ts index 1a120e08b3..cf590865c1 100644 --- a/src/utils/membership.ts +++ b/src/utils/membership.ts @@ -16,12 +16,12 @@ limitations under the License. import { Room } from "matrix-js-sdk/src/models/room"; import { sleep } from "matrix-js-sdk/src/utils"; +import React from "react"; import { MatrixClientPeg } from "../MatrixClientPeg"; import { _t } from "../languageHandler"; import Modal from "../Modal"; import ErrorDialog from "../components/views/dialogs/ErrorDialog"; -import React from "react"; import dis from "../dispatcher/dispatcher"; import RoomViewStore from "../stores/RoomViewStore"; diff --git a/src/utils/permalinks/Permalinks.ts b/src/utils/permalinks/Permalinks.ts index 4c05f42a0d..68a0437ca8 100644 --- a/src/utils/permalinks/Permalinks.ts +++ b/src/utils/permalinks/Permalinks.ts @@ -20,6 +20,7 @@ import { Room } from "matrix-js-sdk/src/models/room"; import { EventType } from "matrix-js-sdk/src/@types/event"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from "../../MatrixClientPeg"; import SpecPermalinkConstructor, { baseUrl as matrixtoBaseUrl } from "./SpecPermalinkConstructor"; @@ -28,8 +29,6 @@ import ElementPermalinkConstructor from "./ElementPermalinkConstructor"; import matrixLinkify from "../../linkify-matrix"; import SdkConfig from "../../SdkConfig"; -import { logger } from "matrix-js-sdk/src/logger"; - // The maximum number of servers to pick when working out which servers // to add to permalinks. The servers are appended as ?via=example.org const MAX_SERVER_CANDIDATES = 3; diff --git a/src/utils/replaceableComponent.ts b/src/utils/replaceableComponent.ts index f8dd5f8ac6..3f085adbf0 100644 --- a/src/utils/replaceableComponent.ts +++ b/src/utils/replaceableComponent.ts @@ -15,6 +15,7 @@ limitations under the License. */ import * as React from 'react'; + import * as sdk from '../index'; /** diff --git a/src/verification.ts b/src/verification.ts index dfee6608ea..e17e0e4e09 100644 --- a/src/verification.ts +++ b/src/verification.ts @@ -15,6 +15,7 @@ limitations under the License. */ import { User } from "matrix-js-sdk/src/models/user"; +import { verificationMethods as VerificationMethods } from 'matrix-js-sdk/src/crypto'; import { MatrixClientPeg } from './MatrixClientPeg'; import dis from "./dispatcher/dispatcher"; @@ -22,7 +23,6 @@ import Modal from './Modal'; import { RightPanelPhases } from "./stores/RightPanelStorePhases"; import { findDMForUser } from './createRoom'; import { accessSecretStorage } from './SecurityManager'; -import { verificationMethods as VerificationMethods } from 'matrix-js-sdk/src/crypto'; import { Action } from './dispatcher/actions'; import UntrustedDeviceDialog from "./components/views/dialogs/UntrustedDeviceDialog"; import { IDevice } from "./components/views/right_panel/UserInfo"; diff --git a/src/widgets/CapabilityText.tsx b/src/widgets/CapabilityText.tsx index 8c13a4b2fc..f9c8c9427f 100644 --- a/src/widgets/CapabilityText.tsx +++ b/src/widgets/CapabilityText.tsx @@ -24,10 +24,11 @@ import { WidgetEventCapability, WidgetKind, } from "matrix-widget-api"; -import { _t, _td, TranslatedString } from "../languageHandler"; import { EventType, MsgType } from "matrix-js-sdk/src/@types/event"; -import { ElementWidgetCapabilities } from "../stores/widgets/ElementWidgetCapabilities"; import React from "react"; + +import { _t, _td, TranslatedString } from "../languageHandler"; +import { ElementWidgetCapabilities } from "../stores/widgets/ElementWidgetCapabilities"; import { MatrixClientPeg } from "../MatrixClientPeg"; import TextWithTooltip from "../components/views/elements/TextWithTooltip"; diff --git a/src/widgets/Jitsi.ts b/src/widgets/Jitsi.ts index cd31e57d7c..f82dbef7f1 100644 --- a/src/widgets/Jitsi.ts +++ b/src/widgets/Jitsi.ts @@ -14,11 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { logger } from "matrix-js-sdk/src/logger"; + import SdkConfig from "../SdkConfig"; import { MatrixClientPeg } from "../MatrixClientPeg"; -import { logger } from "matrix-js-sdk/src/logger"; - const JITSI_WK_PROPERTY = "im.vector.riot.jitsi"; export interface JitsiWidgetData { diff --git a/src/widgets/ManagedHybrid.ts b/src/widgets/ManagedHybrid.ts index f623becbd8..86c035182a 100644 --- a/src/widgets/ManagedHybrid.ts +++ b/src/widgets/ManagedHybrid.ts @@ -15,6 +15,8 @@ limitations under the License. */ import { IWidget } from "matrix-widget-api"; +import { logger } from "matrix-js-sdk/src/logger"; + import { MatrixClientPeg } from "../MatrixClientPeg"; import { getCallBehaviourWellKnown } from "../utils/WellKnownUtils"; import WidgetUtils from "../utils/WidgetUtils"; @@ -23,8 +25,6 @@ import WidgetEchoStore from "../stores/WidgetEchoStore"; import WidgetStore from "../stores/WidgetStore"; import SdkConfig from "../SdkConfig"; -import { logger } from "matrix-js-sdk/src/logger"; - /* eslint-disable camelcase */ interface IManagedHybridWidgetData { widget_id: string; diff --git a/test/CallHandler-test.ts b/test/CallHandler-test.ts index 1a4560ad4a..92357b67b3 100644 --- a/test/CallHandler-test.ts +++ b/test/CallHandler-test.ts @@ -16,13 +16,14 @@ limitations under the License. import './skinned-sdk'; +import { CallEvent, CallState } from 'matrix-js-sdk/src/webrtc/call'; +import EventEmitter from 'events'; + import CallHandler, { PlaceCallType, CallHandlerEvent } from '../src/CallHandler'; import { stubClient, mkStubRoom } from './test-utils'; import { MatrixClientPeg } from '../src/MatrixClientPeg'; import dis from '../src/dispatcher/dispatcher'; -import { CallEvent, CallState } from 'matrix-js-sdk/src/webrtc/call'; import DMRoomMap from '../src/utils/DMRoomMap'; -import EventEmitter from 'events'; import SdkConfig from '../src/SdkConfig'; import { ActionPayload } from '../src/dispatcher/payloads'; import { Action } from '../src/dispatcher/actions'; diff --git a/test/DecryptionFailureTracker-test.js b/test/DecryptionFailureTracker-test.js index bc751ba44e..8b3a162f1d 100644 --- a/test/DecryptionFailureTracker-test.js +++ b/test/DecryptionFailureTracker-test.js @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { DecryptionFailure, DecryptionFailureTracker } from '../src/DecryptionFailureTracker'; - import { MatrixEvent } from 'matrix-js-sdk'; +import { DecryptionFailure, DecryptionFailureTracker } from '../src/DecryptionFailureTracker'; + class MockDecryptionError extends Error { constructor(code) { super(); diff --git a/test/PosthogAnalytics-test.ts b/test/PosthogAnalytics-test.ts index 65af8b51f3..f24312a7ce 100644 --- a/test/PosthogAnalytics-test.ts +++ b/test/PosthogAnalytics-test.ts @@ -22,7 +22,6 @@ import { IRoomEvent, PosthogAnalytics, } from '../src/PosthogAnalytics'; - import SdkConfig from '../src/SdkConfig'; class FakePosthog { diff --git a/test/TextForEvent-test.ts b/test/TextForEvent-test.ts index b8a459af67..90702395a6 100644 --- a/test/TextForEvent-test.ts +++ b/test/TextForEvent-test.ts @@ -1,10 +1,11 @@ import './skinned-sdk'; -import { textForEvent } from "../src/TextForEvent"; import { MatrixEvent } from "matrix-js-sdk"; +import renderer from 'react-test-renderer'; + +import { textForEvent } from "../src/TextForEvent"; import SettingsStore from "../src/settings/SettingsStore"; import { SettingLevel } from "../src/settings/SettingLevel"; -import renderer from 'react-test-renderer'; function mockPinnedEvent( pinnedMessageIds?: string[], diff --git a/test/UserActivity-test.js b/test/UserActivity-test.js index 2c622b2638..c0ebc1e7bf 100644 --- a/test/UserActivity-test.js +++ b/test/UserActivity-test.js @@ -16,6 +16,7 @@ limitations under the License. import FakeTimers from '@sinonjs/fake-timers'; import EventEmitter from 'events'; + import UserActivity from '../src/UserActivity'; class FakeDomEventEmitter extends EventEmitter { diff --git a/test/components/structures/CallEventGrouper-test.ts b/test/components/structures/CallEventGrouper-test.ts index 5719d92902..0eef27851d 100644 --- a/test/components/structures/CallEventGrouper-test.ts +++ b/test/components/structures/CallEventGrouper-test.ts @@ -15,13 +15,14 @@ limitations under the License. */ import "../../skinned-sdk"; -import { stubClient } from '../../test-utils'; -import { MatrixClientPeg } from '../../../src/MatrixClientPeg'; import { MatrixClient } from 'matrix-js-sdk'; import { EventType } from "matrix-js-sdk/src/@types/event"; -import CallEventGrouper, { CustomCallState } from "../../../src/components/structures/CallEventGrouper"; import { CallState } from "matrix-js-sdk/src/webrtc/call"; +import { stubClient } from '../../test-utils'; +import { MatrixClientPeg } from '../../../src/MatrixClientPeg'; +import CallEventGrouper, { CustomCallState } from "../../../src/components/structures/CallEventGrouper"; + const MY_USER_ID = "@me:here"; const THEIR_USER_ID = "@they:here"; diff --git a/test/components/structures/GroupView-test.js b/test/components/structures/GroupView-test.js index 2ff1257d32..2fbea5ce7c 100644 --- a/test/components/structures/GroupView-test.js +++ b/test/components/structures/GroupView-test.js @@ -17,13 +17,13 @@ limitations under the License. import React from 'react'; import ReactDOM from 'react-dom'; import ReactTestUtils from 'react-dom/test-utils'; - import MockHttpBackend from 'matrix-mock-request'; -import { MatrixClientPeg } from '../../../src/MatrixClientPeg'; -import sdk from '../../skinned-sdk'; import Matrix from 'matrix-js-sdk'; +import { MatrixClientPeg } from '../../../src/MatrixClientPeg'; +import sdk from '../../skinned-sdk'; import * as TestUtils from '../../test-utils'; + const { waitForUpdate } = TestUtils; const GroupView = sdk.getComponent('structures.GroupView'); diff --git a/test/components/structures/MessagePanel-test.js b/test/components/structures/MessagePanel-test.js index ab585f4c5f..f17c657d7b 100644 --- a/test/components/structures/MessagePanel-test.js +++ b/test/components/structures/MessagePanel-test.js @@ -15,29 +15,27 @@ See the License for the specific language governing permissions and limitations under the License. */ -import SettingsStore from "../../../src/settings/SettingsStore"; - import React from 'react'; import ReactDOM from "react-dom"; -const TestUtils = require('react-dom/test-utils'); -const expect = require('expect'); import { EventEmitter } from "events"; - -import sdk from '../../skinned-sdk'; - -const MessagePanel = sdk.getComponent('structures.MessagePanel'); -import { MatrixClientPeg } from '../../../src/MatrixClientPeg'; import Matrix from 'matrix-js-sdk'; - -const TestUtilsMatrix = require('../../test-utils'); import FakeTimers from '@sinonjs/fake-timers'; - import { mount } from "enzyme"; +import { MatrixClientPeg } from '../../../src/MatrixClientPeg'; +import sdk from '../../skinned-sdk'; +import SettingsStore from "../../../src/settings/SettingsStore"; import MatrixClientContext from "../../../src/contexts/MatrixClientContext"; import RoomContext from "../../../src/contexts/RoomContext"; import DMRoomMap from "../../../src/utils/DMRoomMap"; +const TestUtils = require('react-dom/test-utils'); +const expect = require('expect'); + +const MessagePanel = sdk.getComponent('structures.MessagePanel'); + +const TestUtilsMatrix = require('../../test-utils'); + let client; const room = new Matrix.Room("!roomId:server_name"); diff --git a/test/components/structures/auth/Login-test.js b/test/components/structures/auth/Login-test.js index 9def0c8d95..e1c0aa899e 100644 --- a/test/components/structures/auth/Login-test.js +++ b/test/components/structures/auth/Login-test.js @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import ReactDOM from 'react-dom'; import ReactTestUtils from 'react-dom/test-utils'; + import sdk from '../../../skinned-sdk'; import SdkConfig from '../../../../src/SdkConfig'; import { mkServerConfig } from "../../../test-utils"; diff --git a/test/components/structures/auth/Registration-test.js b/test/components/structures/auth/Registration-test.js index e09304962f..37f90ee77d 100644 --- a/test/components/structures/auth/Registration-test.js +++ b/test/components/structures/auth/Registration-test.js @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import ReactDOM from 'react-dom'; import ReactTestUtils from 'react-dom/test-utils'; + import sdk from '../../../skinned-sdk'; import SdkConfig from '../../../../src/SdkConfig'; import { mkServerConfig } from "../../../test-utils"; diff --git a/test/components/views/dialogs/AccessSecretStorageDialog-test.js b/test/components/views/dialogs/AccessSecretStorageDialog-test.js index 8c16e7f104..17f56c72db 100644 --- a/test/components/views/dialogs/AccessSecretStorageDialog-test.js +++ b/test/components/views/dialogs/AccessSecretStorageDialog-test.js @@ -16,6 +16,7 @@ limitations under the License. import React from 'react'; import TestRenderer from 'react-test-renderer'; + import sdk from '../../../skinned-sdk'; import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; import { stubClient } from '../../../test-utils'; diff --git a/test/components/views/dialogs/InteractiveAuthDialog-test.js b/test/components/views/dialogs/InteractiveAuthDialog-test.js index dcf89afb4d..86c803be2c 100644 --- a/test/components/views/dialogs/InteractiveAuthDialog-test.js +++ b/test/components/views/dialogs/InteractiveAuthDialog-test.js @@ -22,7 +22,6 @@ import { sleep } from "matrix-js-sdk/src/utils"; import sdk from '../../../skinned-sdk'; import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; - import * as TestUtilsMatrix from '../../../test-utils'; const InteractiveAuthDialog = sdk.getComponent( diff --git a/test/components/views/elements/MemberEventListSummary-test.js b/test/components/views/elements/MemberEventListSummary-test.js index dcb895f09e..834e5a67a9 100644 --- a/test/components/views/elements/MemberEventListSummary-test.js +++ b/test/components/views/elements/MemberEventListSummary-test.js @@ -1,6 +1,7 @@ import React from 'react'; import ReactTestUtils from 'react-dom/test-utils'; import ShallowRenderer from "react-test-renderer/shallow"; + import sdk from '../../../skinned-sdk'; import * as testUtils from '../../../test-utils'; diff --git a/test/components/views/groups/GroupMemberList-test.js b/test/components/views/groups/GroupMemberList-test.js index 7e01540d38..1afee21cdf 100644 --- a/test/components/views/groups/GroupMemberList-test.js +++ b/test/components/views/groups/GroupMemberList-test.js @@ -17,13 +17,13 @@ limitations under the License. import React from "react"; import ReactDOM from "react-dom"; import ReactTestUtils from "react-dom/test-utils"; - import MockHttpBackend from "matrix-mock-request"; -import { MatrixClientPeg } from "../../../../src/MatrixClientPeg"; -import sdk from "../../../skinned-sdk"; import Matrix from "matrix-js-sdk"; +import { MatrixClientPeg } from "../../../../src/MatrixClientPeg"; +import sdk from "../../../skinned-sdk"; import * as TestUtils from "../../../test-utils"; + const { waitForUpdate } = TestUtils; const GroupMemberList = sdk.getComponent("views.groups.GroupMemberList"); diff --git a/test/components/views/messages/MKeyVerificationConclusion-test.js b/test/components/views/messages/MKeyVerificationConclusion-test.js index 45e122295b..b06e242f4e 100644 --- a/test/components/views/messages/MKeyVerificationConclusion-test.js +++ b/test/components/views/messages/MKeyVerificationConclusion-test.js @@ -2,10 +2,10 @@ import '../../../skinned-sdk'; // Must be first for skinning to work import React from 'react'; import TestRenderer from 'react-test-renderer'; import { EventEmitter } from 'events'; -import * as TestUtils from '../../../test-utils'; - -import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; import { MatrixEvent } from 'matrix-js-sdk'; + +import * as TestUtils from '../../../test-utils'; +import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; import MKeyVerificationConclusion from '../../../../src/components/views/messages/MKeyVerificationConclusion'; const trustworthy = () => ({ isCrossSigningVerified: () => true }); diff --git a/test/components/views/rooms/MemberList-test.tsx b/test/components/views/rooms/MemberList-test.tsx index f720bc7a6d..7a1e73f0e9 100644 --- a/test/components/views/rooms/MemberList-test.tsx +++ b/test/components/views/rooms/MemberList-test.tsx @@ -19,12 +19,12 @@ import "../../../skinned-sdk"; import React from 'react'; import ReactTestUtils from 'react-dom/test-utils'; import ReactDOM from 'react-dom'; - -import * as TestUtils from '../../../test-utils'; -import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; import { Room } from 'matrix-js-sdk/src/models/room'; import { RoomMember } from 'matrix-js-sdk/src/models/room-member'; import { User } from "matrix-js-sdk/src/models/user"; + +import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; +import * as TestUtils from '../../../test-utils'; import { compare } from "../../../../src/utils/strings"; import MemberList from "../../../../src/components/views/rooms/MemberList"; import MemberTile from '../../../../src/components/views/rooms/MemberTile'; diff --git a/test/components/views/rooms/RoomHeader-test.tsx b/test/components/views/rooms/RoomHeader-test.tsx index 859107416e..83af58aa4c 100644 --- a/test/components/views/rooms/RoomHeader-test.tsx +++ b/test/components/views/rooms/RoomHeader-test.tsx @@ -3,14 +3,12 @@ import ReactDOM from 'react-dom'; import "../../../skinned-sdk"; +import { Room, PendingEventOrdering, MatrixEvent, MatrixClient } from 'matrix-js-sdk'; + import * as TestUtils from '../../../test-utils'; - import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; - import DMRoomMap from '../../../../src/utils/DMRoomMap'; import RoomHeader from '../../../../src/components/views/rooms/RoomHeader'; - -import { Room, PendingEventOrdering, MatrixEvent, MatrixClient } from 'matrix-js-sdk'; import { SearchScope } from '../../../../src/components/views/rooms/SearchBar'; import { E2EStatus } from '../../../../src/utils/ShieldUtils'; import { PlaceCallType } from '../../../../src/CallHandler'; diff --git a/test/components/views/rooms/RoomList-test.js b/test/components/views/rooms/RoomList-test.js index 760aee69a8..a99b20e3dd 100644 --- a/test/components/views/rooms/RoomList-test.js +++ b/test/components/views/rooms/RoomList-test.js @@ -1,16 +1,13 @@ import React from 'react'; import ReactTestUtils from 'react-dom/test-utils'; import ReactDOM from 'react-dom'; +import { MatrixClient, Room, RoomMember } from 'matrix-js-sdk'; import * as TestUtils from '../../../test-utils'; - import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; import sdk from '../../../skinned-sdk'; - import dis from '../../../../src/dispatcher/dispatcher'; import DMRoomMap from '../../../../src/utils/DMRoomMap'; - -import { MatrixClient, Room, RoomMember } from 'matrix-js-sdk'; import { DefaultTagID } from "../../../../src/stores/room-list/models"; import RoomListStore, { RoomListStoreClass } from "../../../../src/stores/room-list/RoomListStore"; import RoomListLayoutStore from "../../../../src/stores/room-list/RoomListLayoutStore"; diff --git a/test/components/views/rooms/RoomSettings-test.js b/test/components/views/rooms/RoomSettings-test.js index cd70b81cd7..f05262d102 100644 --- a/test/components/views/rooms/RoomSettings-test.js +++ b/test/components/views/rooms/RoomSettings-test.js @@ -1,6 +1,7 @@ // TODO: Rewrite room settings tests for dialog support import React from 'react'; import ReactDOM from 'react-dom'; + import * as testUtils from '../../../test-utils'; import sdk from '../../../skinned-sdk'; import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; diff --git a/test/components/views/settings/CryptographyPanel-test.tsx b/test/components/views/settings/CryptographyPanel-test.tsx index 56056b53ec..f4936b81f2 100644 --- a/test/components/views/settings/CryptographyPanel-test.tsx +++ b/test/components/views/settings/CryptographyPanel-test.tsx @@ -1,11 +1,11 @@ import '../../../skinned-sdk'; -import * as TestUtils from '../../../test-utils'; -import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; import React, { ReactElement } from 'react'; import ReactDOM from 'react-dom'; - import { MatrixClient } from 'matrix-js-sdk'; + +import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; +import * as TestUtils from '../../../test-utils'; import CryptographyPanel from '../../../../src/components/views/settings/CryptographyPanel'; describe('CryptographyPanel', () => { diff --git a/test/createRoom-test.js b/test/createRoom-test.js index 11cb7edf5d..85fe945a1d 100644 --- a/test/createRoom-test.js +++ b/test/createRoom-test.js @@ -1,7 +1,8 @@ import './skinned-sdk'; // Must be first for skinning to work -import { waitForMember, canEncryptToAllUsers } from '../src/createRoom'; import { EventEmitter } from 'events'; +import { waitForMember, canEncryptToAllUsers } from '../src/createRoom'; + /* Shorter timeout, we've got tests to run */ const timeout = 30; diff --git a/test/end-to-end-tests/src/rest/creator.js b/test/end-to-end-tests/src/rest/creator.js index f01a325a71..3dc50b4599 100644 --- a/test/end-to-end-tests/src/rest/creator.js +++ b/test/end-to-end-tests/src/rest/creator.js @@ -17,6 +17,7 @@ limitations under the License. const { exec } = require('child_process'); const request = require('request-promise-native'); + const RestSession = require('./session'); const RestMultiSession = require('./multi'); diff --git a/test/end-to-end-tests/src/rest/session.js b/test/end-to-end-tests/src/rest/session.js index 3c04592d02..fc1a0e2852 100644 --- a/test/end-to-end-tests/src/rest/session.js +++ b/test/end-to-end-tests/src/rest/session.js @@ -15,6 +15,7 @@ limitations under the License. */ const request = require('request-promise-native'); + const Logger = require('../logger'); const RestRoom = require('./room'); const { approveConsent } = require('./consent'); diff --git a/test/end-to-end-tests/src/scenarios/e2e-encryption.js b/test/end-to-end-tests/src/scenarios/e2e-encryption.js index 23234b85ce..ce25344109 100644 --- a/test/end-to-end-tests/src/scenarios/e2e-encryption.js +++ b/test/end-to-end-tests/src/scenarios/e2e-encryption.js @@ -15,6 +15,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +const assert = require('assert'); + const sendMessage = require('../usecases/send-message'); const acceptInvite = require('../usecases/accept-invite'); const { receiveMessage } = require('../usecases/timeline'); @@ -22,7 +24,6 @@ const { createDm } = require('../usecases/create-room'); const { checkRoomSettings } = require('../usecases/room-settings'); const { startSasVerification, acceptSasVerification } = require('../usecases/verify'); const { setupSecureBackup } = require('../usecases/security'); -const assert = require('assert'); const { measureStart, measureStop } = require('../util'); module.exports = async function e2eEncryptionScenarios(alice, bob) { diff --git a/test/end-to-end-tests/src/scenarios/lazy-loading.js b/test/end-to-end-tests/src/scenarios/lazy-loading.js index 406f7b24a3..aa3d5aba72 100644 --- a/test/end-to-end-tests/src/scenarios/lazy-loading.js +++ b/test/end-to-end-tests/src/scenarios/lazy-loading.js @@ -15,6 +15,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +const assert = require('assert'); + const { delay } = require('../util'); const join = require('../usecases/join'); const sendMessage = require('../usecases/send-message'); @@ -25,7 +27,6 @@ const { const { createRoom } = require('../usecases/create-room'); const { getMembersInMemberlist } = require('../usecases/memberlist'); const { changeRoomSettings } = require('../usecases/room-settings'); -const assert = require('assert'); module.exports = async function lazyLoadingScenarios(alice, bob, charlies) { console.log(" creating a room for lazy loading member scenarios:"); diff --git a/test/end-to-end-tests/src/session.js b/test/end-to-end-tests/src/session.js index f5d20fde28..7a2863ac2a 100644 --- a/test/end-to-end-tests/src/session.js +++ b/test/end-to-end-tests/src/session.js @@ -16,6 +16,7 @@ limitations under the License. */ const puppeteer = require('puppeteer'); + const Logger = require('./logger'); const LogBuffer = require('./logbuffer'); const { delay } = require('./util'); diff --git a/test/end-to-end-tests/src/usecases/memberlist.js b/test/end-to-end-tests/src/usecases/memberlist.js index 26c0c39755..e56b4f3fff 100644 --- a/test/end-to-end-tests/src/usecases/memberlist.js +++ b/test/end-to-end-tests/src/usecases/memberlist.js @@ -16,6 +16,7 @@ limitations under the License. */ const assert = require('assert'); + const { openRoomSummaryCard } = require("./rightpanel"); async function openMemberInfo(session, name) { diff --git a/test/end-to-end-tests/src/usecases/room-settings.js b/test/end-to-end-tests/src/usecases/room-settings.js index 83d6fd79a8..e0b18e99d1 100644 --- a/test/end-to-end-tests/src/usecases/room-settings.js +++ b/test/end-to-end-tests/src/usecases/room-settings.js @@ -16,6 +16,7 @@ limitations under the License. */ const assert = require('assert'); + const { openRoomSummaryCard } = require("./rightpanel"); const { acceptDialog } = require('./dialog'); diff --git a/test/end-to-end-tests/src/usecases/verify.js b/test/end-to-end-tests/src/usecases/verify.js index a1f600833d..f45292a02d 100644 --- a/test/end-to-end-tests/src/usecases/verify.js +++ b/test/end-to-end-tests/src/usecases/verify.js @@ -16,6 +16,7 @@ limitations under the License. */ const assert = require('assert'); + const { openMemberInfo } = require("./memberlist"); async function startVerification(session, name) { diff --git a/test/end-to-end-tests/start.js b/test/end-to-end-tests/start.js index f65d6137f4..1388e84577 100644 --- a/test/end-to-end-tests/start.js +++ b/test/end-to-end-tests/start.js @@ -14,12 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ +const fs = require("fs"); +const program = require('commander'); + const ElementSession = require('./src/session'); const scenario = require('./src/scenario'); const RestSessionCreator = require('./src/rest/creator'); -const fs = require("fs"); -const program = require('commander'); program .option('--no-logs', "don't output logs, document html on error", false) .option('--app-url [url]', "url to test", "http://localhost:5000") diff --git a/test/i18n-test/languageHandler-test.js b/test/i18n-test/languageHandler-test.js index b9bc955269..70b2fd169d 100644 --- a/test/i18n-test/languageHandler-test.js +++ b/test/i18n-test/languageHandler-test.js @@ -1,6 +1,7 @@ +import * as languageHandler from '../../src/languageHandler'; + const React = require('react'); const expect = require('expect'); -import * as languageHandler from '../../src/languageHandler'; const testUtils = require('../test-utils'); diff --git a/test/setupTests.js b/test/setupTests.js index e719f715c9..15f878eced 100644 --- a/test/setupTests.js +++ b/test/setupTests.js @@ -1,8 +1,9 @@ -import * as languageHandler from "../src/languageHandler"; import { TextEncoder, TextDecoder } from 'util'; import Adapter from "@wojtekmaj/enzyme-adapter-react-17"; import { configure } from "enzyme"; +import * as languageHandler from "../src/languageHandler"; + languageHandler.setLanguage('en'); languageHandler.setMissingEntryGenerator(key => key.split("|", 2)[1]); diff --git a/test/stores/RoomViewStore-test.js b/test/stores/RoomViewStore-test.js index cb5d7d21f0..1a34bc7267 100644 --- a/test/stores/RoomViewStore-test.js +++ b/test/stores/RoomViewStore-test.js @@ -1,7 +1,5 @@ import RoomViewStore from '../../src/stores/RoomViewStore'; - import { MatrixClientPeg as peg } from '../../src/MatrixClientPeg'; - import * as testUtils from '../test-utils'; const dispatch = testUtils.getDispatchForStore(RoomViewStore); diff --git a/test/test-utils.js b/test/test-utils.js index d43a08ab3a..d818877c89 100644 --- a/test/test-utils.js +++ b/test/test-utils.js @@ -1,11 +1,12 @@ import React from 'react'; +import ShallowRenderer from 'react-test-renderer/shallow'; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; + import { MatrixClientPeg as peg } from '../src/MatrixClientPeg'; import dis from '../src/dispatcher/dispatcher'; import { makeType } from "../src/utils/TypeUtils"; import { ValidatedServerConfig } from "../src/utils/AutoDiscoveryUtils"; -import ShallowRenderer from 'react-test-renderer/shallow'; import MatrixClientContext from "../src/contexts/MatrixClientContext"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; export function getRenderer() { // Old: ReactTestUtils.createRenderer(); diff --git a/test/utils/export-test.tsx b/test/utils/export-test.tsx index 66436da9c5..90d44c08e3 100644 --- a/test/utils/export-test.tsx +++ b/test/utils/export-test.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import { IContent, MatrixClient, MatrixEvent, Room } from "matrix-js-sdk"; + import { MatrixClientPeg } from "../../src/MatrixClientPeg"; import { IExportOptions, ExportType, ExportFormat } from "../../src/utils/exportUtils/exportUtils"; import '../skinned-sdk'; @@ -22,6 +23,7 @@ import PlainTextExporter from "../../src/utils/exportUtils/PlainTextExport"; import HTMLExporter from "../../src/utils/exportUtils/HtmlExport"; import * as TestUtilsMatrix from '../test-utils'; import { stubClient } from '../test-utils'; + import { renderToString } from "react-dom/server"; let client: MatrixClient; diff --git a/test/utils/test-utils.ts b/test/utils/test-utils.ts index 8bc602fe35..f1464f922c 100644 --- a/test/utils/test-utils.ts +++ b/test/utils/test-utils.ts @@ -17,11 +17,11 @@ limitations under the License. import { MatrixClient } from "matrix-js-sdk/src/client"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { EventType } from "matrix-js-sdk/src/@types/event"; +import { EventEmitter } from "events"; import { AsyncStoreWithClient } from "../../src/stores/AsyncStoreWithClient"; import { mkEvent, mkStubRoom } from "../test-utils"; import { EnhancedMap } from "../../src/utils/maps"; -import { EventEmitter } from "events"; // These methods make some use of some private methods on the AsyncStoreWithClient to simplify getting into a consistent // ready state without needing to wire up a dispatcher and pretend to be a js-sdk client. From 027b3660bb391d84e142c8681fce0cd13d40d260 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Fri, 22 Oct 2021 17:49:09 -0500 Subject: [PATCH 03/12] Manual fixes Signed-off-by: Aaron Raimist --- .eslintrc.js | 2 -- src/CallHandler.tsx | 10 +++++++++- src/components/structures/MatrixChat.tsx | 4 +--- src/components/views/right_panel/EncryptionPanel.tsx | 6 +++++- src/languageHandler.tsx | 1 - src/stores/SetupEncryptionStore.ts | 5 ++++- src/stores/UIStore.ts | 2 +- test/components/views/rooms/RoomHeader-test.tsx | 4 +--- test/utils/export-test.tsx | 3 +-- 9 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 94e19c8eea..20c8269e5e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -44,8 +44,6 @@ module.exports = { }, ], "import/first": "error", - "import/newline-after-import": "error", - "import/no-duplicates": "error", }, overrides: [{ files: [ diff --git a/src/CallHandler.tsx b/src/CallHandler.tsx index 9c583544b0..316b76d594 100644 --- a/src/CallHandler.tsx +++ b/src/CallHandler.tsx @@ -56,7 +56,15 @@ limitations under the License. import React from 'react'; import { base32 } from "rfc4648"; -import { MatrixCall, CallErrorCode, CallState, CallEvent, CallParty, CallType, CallError } from "matrix-js-sdk/src/webrtc/call"; +import { + MatrixCall, + CallErrorCode, + CallState, + CallEvent, + CallParty, + CallType, + CallError, +} from "matrix-js-sdk/src/webrtc/call"; import { logger } from 'matrix-js-sdk/src/logger'; import { randomUppercaseString, randomLowercaseString } from "matrix-js-sdk/src/randomstring"; import EventEmitter from 'events'; diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 866245042f..2a0d068dcc 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -20,6 +20,7 @@ import { InvalidStoreError } from "matrix-js-sdk/src/errors"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { sleep, 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'; @@ -106,9 +107,6 @@ import { makeRoomPermalink } from "../../utils/permalinks/Permalinks"; import { copyPlaintext } from "../../utils/strings"; import { PosthogAnalytics } from '../../PosthogAnalytics'; import { initSentry } from "../../sentry"; - -import { logger } from "matrix-js-sdk/src/logger"; - import { showSpaceInvite } from "../../utils/space"; /** constants for MatrixChat.state.view */ diff --git a/src/components/views/right_panel/EncryptionPanel.tsx b/src/components/views/right_panel/EncryptionPanel.tsx index d26cbbce4d..12b7cbf598 100644 --- a/src/components/views/right_panel/EncryptionPanel.tsx +++ b/src/components/views/right_panel/EncryptionPanel.tsx @@ -15,7 +15,11 @@ limitations under the License. */ import React, { useCallback, useEffect, useState } from "react"; -import { VerificationRequest, PHASE_REQUESTED, PHASE_UNSENT } 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"; diff --git a/src/languageHandler.tsx b/src/languageHandler.tsx index 15539eced4..5b3878866b 100644 --- a/src/languageHandler.tsx +++ b/src/languageHandler.tsx @@ -24,7 +24,6 @@ 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 { SettingLevel } from "./settings/SettingLevel"; import { retry } from "./utils/promise"; diff --git a/src/stores/SetupEncryptionStore.ts b/src/stores/SetupEncryptionStore.ts index cfd69d3365..5af39356e7 100644 --- a/src/stores/SetupEncryptionStore.ts +++ b/src/stores/SetupEncryptionStore.ts @@ -15,7 +15,10 @@ limitations under the License. */ import EventEmitter from 'events'; -import { VerificationRequest, PHASE_DONE as VERIF_PHASE_DONE } 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 { logger } from "matrix-js-sdk/src/logger"; diff --git a/src/stores/UIStore.ts b/src/stores/UIStore.ts index 99446da49a..7b40ba44f7 100644 --- a/src/stores/UIStore.ts +++ b/src/stores/UIStore.ts @@ -21,7 +21,7 @@ import ResizeObserverEntry from 'resize-observer-polyfill/src/ResizeObserverEntr // 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'); +const ResizeObserverPolyfill = require('resize-observer-polyfill'); // eslint-disable-line @typescript-eslint/no-var-requires export enum UI_EVENTS { Resize = "resize" diff --git a/test/components/views/rooms/RoomHeader-test.tsx b/test/components/views/rooms/RoomHeader-test.tsx index 83af58aa4c..33983df7e4 100644 --- a/test/components/views/rooms/RoomHeader-test.tsx +++ b/test/components/views/rooms/RoomHeader-test.tsx @@ -1,10 +1,8 @@ import React from 'react'; import ReactDOM from 'react-dom'; - -import "../../../skinned-sdk"; - 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'; diff --git a/test/utils/export-test.tsx b/test/utils/export-test.tsx index 90d44c08e3..1ce463fdbd 100644 --- a/test/utils/export-test.tsx +++ b/test/utils/export-test.tsx @@ -14,6 +14,7 @@ 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"; @@ -24,8 +25,6 @@ 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; const MY_USER_ID = "@me:here"; From b90a712919ed435e1001a8ddc7e1cb2e95edee64 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Fri, 22 Oct 2021 18:11:56 -0500 Subject: [PATCH 04/12] lint Signed-off-by: Aaron Raimist --- src/languageHandler.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languageHandler.tsx b/src/languageHandler.tsx index 5b3878866b..d5d20e5181 100644 --- a/src/languageHandler.tsx +++ b/src/languageHandler.tsx @@ -24,10 +24,10 @@ 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 { SettingLevel } from "./settings/SettingLevel"; import { retry } from "./utils/promise"; +// @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/'; From 77dbb846739f9864e0d88063dbe2531cf9948ee2 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Wed, 27 Oct 2021 21:46:22 -0500 Subject: [PATCH 05/12] Remove import rules from .eslintrc.js Signed-off-by: Aaron Raimist --- .eslintrc.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 20c8269e5e..4658fb9792 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,5 +1,5 @@ module.exports = { - plugins: ["matrix-org", "import"], + plugins: ["matrix-org"], extends: [ "plugin:matrix-org/babel", "plugin:matrix-org/react", @@ -36,14 +36,6 @@ module.exports = { "Use Media helper instead to centralise access for customisation.", ), ], - - "import/order": [ - "error", { - "groups": [["builtin", "external"], ["internal", "parent", "sibling", "index", "object", "type"]], - "newlines-between": "always", - }, - ], - "import/first": "error", }, overrides: [{ files: [ From f738ad51bd4a63934a87ddfda9788d5e55a5e226 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Wed, 27 Oct 2021 21:53:09 -0500 Subject: [PATCH 06/12] Autofix Signed-off-by: Aaron Raimist --- src/SecurityManager.ts | 7 +++---- src/TextForEvent.tsx | 6 +++--- .../dialogs/security/CreateKeyBackupDialog.tsx | 5 +++-- .../dialogs/security/CreateSecretStorageDialog.tsx | 14 +++++++------- .../views/dialogs/security/ExportE2eKeysDialog.tsx | 6 +++--- .../views/dialogs/security/ImportE2eKeysDialog.tsx | 4 ++-- .../dialogs/security/NewRecoveryMethodDialog.tsx | 3 ++- .../security/RecoveryMethodRemovedDialog.tsx | 1 + src/components/structures/auth/ForgotPassword.tsx | 5 +++-- src/components/views/auth/EmailField.tsx | 1 + src/components/views/rooms/EventTile.tsx | 3 +-- src/components/views/settings/ChangePassword.tsx | 5 +++-- .../views/settings/SecureBackupPanel.tsx | 7 +++---- src/utils/RoomUpgrade.ts | 5 ++--- 14 files changed, 37 insertions(+), 35 deletions(-) diff --git a/src/SecurityManager.ts b/src/SecurityManager.ts index 5914c8799e..0c3f6f776c 100644 --- a/src/SecurityManager.ts +++ b/src/SecurityManager.ts @@ -22,6 +22,9 @@ 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 { 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'; @@ -32,10 +35,6 @@ import AccessSecretStorageDialog from './components/views/dialogs/security/Acces 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"; // This stores the secret storage private keys in memory for the JS SDK. This is // only meant to act as a cache to avoid prompting the user multiple times diff --git a/src/TextForEvent.tsx b/src/TextForEvent.tsx index 63ecaed642..1586100dee 100644 --- a/src/TextForEvent.tsx +++ b/src/TextForEvent.tsx @@ -18,6 +18,9 @@ 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 { 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 { _t } from './languageHandler'; import * as Roles from './Roles'; @@ -29,9 +32,6 @@ 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"; 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 145d3bcede..d521a0ec12 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"; +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"; 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/components/structures/auth/ForgotPassword.tsx b/src/components/structures/auth/ForgotPassword.tsx index 66ade9e6ed..08604d7fca 100644 --- a/src/components/structures/auth/ForgotPassword.tsx +++ b/src/components/structures/auth/ForgotPassword.tsx @@ -17,12 +17,14 @@ limitations under the License. */ import React from 'react'; +import classNames from 'classnames'; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t, _td } from '../../../languageHandler'; import * as sdk from '../../../index'; import Modal from "../../../Modal"; import PasswordReset from "../../../PasswordReset"; import AutoDiscoveryUtils, { ValidatedServerConfig } from "../../../utils/AutoDiscoveryUtils"; -import classNames from 'classnames'; import AuthPage from "../../views/auth/AuthPage"; import CountlyAnalytics from "../../../CountlyAnalytics"; import ServerPicker from "../../views/elements/ServerPicker"; @@ -32,7 +34,6 @@ import { replaceableComponent } from "../../../utils/replaceableComponent"; import { PASSWORD_MIN_SCORE } from '../../views/auth/RegistrationForm'; import { IValidationResult } from "../../views/elements/Validation"; import InlineSpinner from '../../views/elements/InlineSpinner'; -import { logger } from "matrix-js-sdk/src/logger"; enum Phase { // Show the forgot password inputs 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/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx index 8f9915132e..012870ee99 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"; const eventTileTypes = { diff --git a/src/components/views/settings/ChangePassword.tsx b/src/components/views/settings/ChangePassword.tsx index f009d1121e..64c1fde193 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/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/utils/RoomUpgrade.ts b/src/utils/RoomUpgrade.ts index b9ea93d7fc..a064cfc338 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/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; From d867ee1a5000448f7f136691d422bdd6824f1747 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Wed, 27 Oct 2021 22:02:59 -0500 Subject: [PATCH 07/12] Fix merge error Signed-off-by: Aaron Raimist --- src/SecurityManager.ts | 2 -- src/TextForEvent.tsx | 1 - 2 files changed, 3 deletions(-) diff --git a/src/SecurityManager.ts b/src/SecurityManager.ts index 0c3f6f776c..e5f6acfba4 100644 --- a/src/SecurityManager.ts +++ b/src/SecurityManager.ts @@ -22,8 +22,6 @@ 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 { DeviceTrustLevel } from 'matrix-js-sdk/src/crypto/CrossSigning'; -import { logger } from "matrix-js-sdk/src/logger"; import { ComponentType } from "react"; import Modal from './Modal'; diff --git a/src/TextForEvent.tsx b/src/TextForEvent.tsx index 1586100dee..a8cff409a8 100644 --- a/src/TextForEvent.tsx +++ b/src/TextForEvent.tsx @@ -18,7 +18,6 @@ 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 { 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"; From 2112089146cb54fd1886eabc561f8b036a741955 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Thu, 28 Oct 2021 19:41:42 -0500 Subject: [PATCH 08/12] Move comments back to correct location Signed-off-by: Aaron Raimist --- src/settings/controllers/NotificationControllers.ts | 5 ++--- src/utils/createMatrixClient.ts | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/settings/controllers/NotificationControllers.ts b/src/settings/controllers/NotificationControllers.ts index 15e5b85733..520748ea35 100644 --- a/src/settings/controllers/NotificationControllers.ts +++ b/src/settings/controllers/NotificationControllers.ts @@ -15,16 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. */ +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"; -// XXX: This feels wrong. - // .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 export function isPushNotifyDisabled(): boolean { diff --git a/src/utils/createMatrixClient.ts b/src/utils/createMatrixClient.ts index 3fed5363d7..a57b2e8c4c 100644 --- a/src/utils/createMatrixClient.ts +++ b/src/utils/createMatrixClient.ts @@ -13,14 +13,12 @@ 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 { createClient, ICreateClientOpts } from "matrix-js-sdk/src/matrix"; import { IndexedDBCryptoStore } from "matrix-js-sdk/src/crypto/store/indexeddb-crypto-store"; import { WebStorageSessionStore } from "matrix-js-sdk/src/store/session/webstorage"; import { IndexedDBStore } from "matrix-js-sdk/src/store/indexeddb"; -import IndexedDBWorker from "../workers/indexeddb.worker.ts"; +import IndexedDBWorker from "../workers/indexeddb.worker.ts"; // @ts-ignore - `.ts` is needed here to make TS happy const localStorage = window.localStorage; From d9e94737f2f544d4039d8f08d36f3b6544259d01 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Thu, 28 Oct 2021 19:49:38 -0500 Subject: [PATCH 09/12] Fix merge conflict Signed-off-by: Aaron Raimist --- src/ContentMessages.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/ContentMessages.tsx b/src/ContentMessages.tsx index b85c0462b5..ac1d8dee18 100644 --- a/src/ContentMessages.tsx +++ b/src/ContentMessages.tsx @@ -18,17 +18,19 @@ 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 } from "matrix-js-sdk/src/@types/event"; +import { IAbortablePromise, IImageInfo } from "matrix-js-sdk/src/@types/partials"; +import { logger } from "matrix-js-sdk/src/logger"; +import encrypt from "browser-encrypt-attachment"; +import extractPngChunks from "png-chunks-extract"; +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,13 +42,10 @@ import { UploadStartedPayload, } from "./dispatcher/payloads/UploadPayload"; import { IUpload } from "./models/IUpload"; -import { IAbortablePromise, IImageInfo } from "matrix-js-sdk/src/@types/partials"; import { BlurhashEncoder } from "./BlurhashEncoder"; import SettingsStore from "./settings/SettingsStore"; import { decorateStartSendingTime, sendRoundTripMetric } from "./sendTimePerformanceMetrics"; -import { logger } from "matrix-js-sdk/src/logger"; - const MAX_WIDTH = 800; const MAX_HEIGHT = 600; From 2e8a93834b8e156d27bacf8e098c147764cabd2f Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Thu, 9 Dec 2021 09:10:23 +0000 Subject: [PATCH 10/12] Auto fix Signed-off-by: Aaron Raimist --- src/CallHandler.tsx | 19 +++++++++---------- src/ContentMessages.tsx | 13 ++++++------- src/HtmlUtils.tsx | 2 +- src/Lifecycle.ts | 1 - src/Markdown.ts | 1 + src/Notifier.ts | 5 ++--- src/PosthogAnalytics.ts | 6 +++--- src/SecurityManager.ts | 14 +++++++------- src/SlashCommands.tsx | 7 +++---- .../security/CreateSecretStorageDialog.tsx | 14 +++++++------- src/autocomplete/AutocompleteProvider.tsx | 1 + src/autocomplete/CommandProvider.tsx | 2 +- src/autocomplete/CommunityProvider.tsx | 2 +- src/autocomplete/EmojiProvider.tsx | 8 ++++---- src/autocomplete/QueryMatcher.ts | 1 + .../structures/GroupFilterPanel.tsx | 8 +++----- .../structures/IndicatorScrollbar.tsx | 1 + src/components/structures/LoggedInView.tsx | 5 ++--- src/components/structures/MatrixChat.tsx | 6 +----- src/components/structures/RightPanel.tsx | 2 +- src/components/structures/RoomDirectory.tsx | 3 +-- src/components/structures/RoomView.tsx | 4 ++-- src/components/structures/UploadBar.tsx | 2 +- .../structures/auth/ForgotPassword.tsx | 5 +++-- .../views/auth/PassphraseConfirmField.tsx | 1 + .../views/auth/RegistrationForm.tsx | 3 +-- .../views/context_menus/CallContextMenu.tsx | 3 ++- .../context_menus/DialpadContextMenu.tsx | 3 ++- .../context_menus/MessageContextMenu.tsx | 2 +- .../context_menus/ThreadListContextMenu.tsx | 1 + .../dialogs/AnalyticsLearnMoreDialog.tsx | 3 ++- .../dialogs/ConfirmSpaceUserActionDialog.tsx | 2 +- .../views/dialogs/FeedbackDialog.tsx | 1 + src/components/views/dialogs/LogoutDialog.tsx | 4 ++-- .../views/dialogs/ScrollableBaseModal.tsx | 3 ++- src/components/views/elements/AppTile.tsx | 11 ++++++----- src/components/views/elements/DNDTagTile.js | 4 ++-- .../views/elements/MemberEventListSummary.tsx | 2 +- .../views/elements/PollCreateDialog.tsx | 5 +++-- src/components/views/elements/ReplyChain.tsx | 10 +++++----- .../views/elements/StyledCheckbox.tsx | 2 +- .../views/location/LocationPicker.tsx | 3 +-- src/components/views/messages/IBodyProps.ts | 3 ++- src/components/views/messages/MImageBody.tsx | 9 ++++----- .../views/messages/MLocationBody.tsx | 3 ++- src/components/views/messages/MPollBody.tsx | 7 ++++--- src/components/views/messages/MVideoBody.tsx | 3 +-- .../views/messages/MessageActionBar.tsx | 2 +- .../views/messages/MessageEvent.tsx | 2 +- .../views/messages/MessageTimestamp.tsx | 1 + .../views/right_panel/TimelineCard.tsx | 1 - src/components/views/rooms/MemberList.tsx | 15 ++++++++------- .../views/rooms/MessageComposer.tsx | 11 ++++++----- src/components/views/rooms/ReplyTile.tsx | 8 ++++---- src/components/views/rooms/RoomHeader.tsx | 8 ++++---- src/components/views/rooms/RoomSublist.tsx | 2 +- .../views/settings/CrossSigningPanel.tsx | 5 ++--- .../views/settings/DevicesPanel.tsx | 2 +- .../views/settings/ImageSizePanel.tsx | 1 + .../tabs/room/NotificationSettingsTab.tsx | 4 ++-- .../tabs/room/RolesRoomSettingsTab.tsx | 12 ++++++------ .../tabs/user/SecurityUserSettingsTab.tsx | 5 ++--- .../views/spaces/QuickSettingsButton.tsx | 2 +- .../verification/VerificationCancelled.tsx | 1 + .../verification/VerificationComplete.tsx | 1 + src/components/views/voip/CallPreview.tsx | 7 +++---- .../views/voip/CallView/CallViewHeader.tsx | 3 ++- src/components/views/voip/CallViewForRoom.tsx | 3 ++- src/linkify-matrix.ts | 1 + src/stores/CommunityPrototypeStore.ts | 10 +++++----- src/stores/local-echo/RoomEchoChamber.ts | 5 +++-- src/stores/notifications/NotificationState.ts | 3 ++- .../notifications/ThreadNotificationState.ts | 7 ++++--- .../ThreadsRoomNotificationState.ts | 5 +++-- src/stores/widgets/StopGapWidgetDriver.ts | 10 +++++----- src/utils/EventUtils.ts | 8 ++++---- src/utils/exportUtils/HtmlExport.tsx | 11 ++++++----- src/utils/membership.ts | 2 +- src/utils/permalinks/Permalinks.ts | 3 +-- test/CallHandler-test.ts | 5 +++-- .../structures/auth/Registration-test.js | 3 +-- .../views/elements/PollCreateDialog-test.tsx | 3 ++- .../views/messages/MPollBody-test.tsx | 7 +++---- test/end-to-end-tests/src/rest/creator.ts | 1 + test/end-to-end-tests/src/rest/room.ts | 1 + test/end-to-end-tests/src/rest/session.ts | 1 + .../src/scenarios/e2e-encryption.ts | 4 ++-- .../src/scenarios/lazy-loading.ts | 3 ++- test/end-to-end-tests/src/scenarios/spaces.ts | 3 +-- test/end-to-end-tests/src/session.ts | 1 + .../src/usecases/create-room.ts | 3 ++- test/end-to-end-tests/src/usecases/dialog.ts | 1 + .../src/usecases/memberlist.ts | 3 ++- .../src/usecases/room-settings.ts | 3 ++- .../src/usecases/send-message.ts | 1 + .../end-to-end-tests/src/usecases/settings.ts | 1 + test/end-to-end-tests/src/usecases/signup.ts | 1 + .../end-to-end-tests/src/usecases/timeline.ts | 3 ++- test/end-to-end-tests/src/usecases/toasts.ts | 1 + test/end-to-end-tests/src/usecases/verify.ts | 1 + test/end-to-end-tests/start.ts | 5 +++-- test/stores/RoomViewStore-test.js | 2 -- test/stores/WidgetLayoutStore-test.ts | 3 ++- 103 files changed, 232 insertions(+), 209 deletions(-) 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 a5a34c0099..e3239c5f66 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/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/Lifecycle.ts b/src/Lifecycle.ts index cff3c2c379..2f1c948839 100644 --- a/src/Lifecycle.ts +++ b/src/Lifecycle.ts @@ -58,7 +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 { setSentryUser } from "./sentry"; const HOMESERVER_URL_KEY = "mx_hs_url"; 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/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/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/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/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/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/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 17d17d6e57..23b31407a8 100644 --- a/src/autocomplete/CommandProvider.tsx +++ b/src/autocomplete/CommandProvider.tsx @@ -18,6 +18,7 @@ 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'; @@ -25,7 +26,6 @@ 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 1fcf27d8e5..b3a4079f94 100644 --- a/src/autocomplete/CommunityProvider.tsx +++ b/src/autocomplete/CommunityProvider.tsx @@ -18,6 +18,7 @@ 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'; @@ -29,7 +30,6 @@ 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/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/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/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/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/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/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/UploadBar.tsx b/src/components/structures/UploadBar.tsx index 55537be25f..b488870840 100644 --- a/src/components/structures/UploadBar.tsx +++ b/src/components/structures/UploadBar.tsx @@ -17,6 +17,7 @@ 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"; @@ -28,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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/StyledCheckbox.tsx b/src/components/views/elements/StyledCheckbox.tsx index de68494041..868791151b 100644 --- a/src/components/views/elements/StyledCheckbox.tsx +++ b/src/components/views/elements/StyledCheckbox.tsx @@ -16,9 +16,9 @@ limitations under the License. import React from "react"; import { randomString } from "matrix-js-sdk/src/randomstring"; +import classnames from 'classnames'; import { replaceableComponent } from "../../../utils/replaceableComponent"; -import classnames from 'classnames'; export enum CheckboxStyle { Solid = "solid", 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/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/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/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/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/MessageActionBar.tsx b/src/components/views/messages/MessageActionBar.tsx index ba75749f35..abaf78797e 100644 --- a/src/components/views/messages/MessageActionBar.tsx +++ b/src/components/views/messages/MessageActionBar.tsx @@ -19,6 +19,7 @@ limitations under the License. import React, { ReactElement, useEffect } from 'react'; import { EventStatus, MatrixEvent } from 'matrix-js-sdk/src/models/event'; 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'; @@ -40,7 +41,6 @@ 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 ac87595251..2cd23779d3 100644 --- a/src/components/views/messages/MessageEvent.tsx +++ b/src/components/views/messages/MessageEvent.tsx @@ -16,6 +16,7 @@ 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"; @@ -29,7 +30,6 @@ import { MediaEventHelper } from "../../../utils/MediaEventHelper"; import { ReactAnyComponent } from "../../../@types/common"; 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/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/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/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/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/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/RoomSublist.tsx b/src/components/views/rooms/RoomSublist.tsx index b420d0b40a..2aad0c5c44 100644 --- a/src/components/views/rooms/RoomSublist.tsx +++ b/src/components/views/rooms/RoomSublist.tsx @@ -23,6 +23,7 @@ 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"; @@ -55,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/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 95fae13fa8..0b19d5605e 100644 --- a/src/components/views/settings/DevicesPanel.tsx +++ b/src/components/views/settings/DevicesPanel.tsx @@ -18,6 +18,7 @@ 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'; @@ -28,7 +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"; interface IProps { className?: string; 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/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 7a2b6f0d08..5bb510ce87 100644 --- a/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx @@ -15,20 +15,20 @@ limitations under the License. */ import React from 'react'; +import { EventType } from "matrix-js-sdk/src/@types/event"; +import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; +import { RoomState } from "matrix-js-sdk/src/models/room-state"; +import { logger } from "matrix-js-sdk/src/logger"; + import { _t, _td } from "../../../../../languageHandler"; import { MatrixClientPeg } from "../../../../../MatrixClientPeg"; import AccessibleButton from "../../../elements/AccessibleButton"; import Modal from "../../../../../Modal"; import { replaceableComponent } from "../../../../../utils/replaceableComponent"; -import { EventType } from "matrix-js-sdk/src/@types/event"; -import { RoomMember } from "matrix-js-sdk/src/models/room-member"; -import { MatrixEvent } from "matrix-js-sdk/src/models/event"; -import { RoomState } from "matrix-js-sdk/src/models/room-state"; import { compare } from "../../../../../utils/strings"; import ErrorDialog from '../../../dialogs/ErrorDialog'; import PowerSelector from "../../../elements/PowerSelector"; - -import { logger } from "matrix-js-sdk/src/logger"; import SettingsStore from "../../../../../settings/SettingsStore"; interface IEventShowOpts { 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/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/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/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/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/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/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/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/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/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/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/utils/EventUtils.ts b/src/utils/EventUtils.ts index 7ad323ea1d..5d6486b0bf 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/exportUtils/HtmlExport.tsx b/src/utils/exportUtils/HtmlExport.tsx index 7c8265fd32..8b147a0a92 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/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/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/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/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/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/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/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 From 5b293dd6dfd86970ecd6c066830c7af01288f86e Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Thu, 9 Dec 2021 09:21:12 +0000 Subject: [PATCH 11/12] Remove files created by merge Signed-off-by: Aaron Raimist --- .../payloads/TransferCallPayload.ts | 34 ----- test/end-to-end-tests/src/rest/session.js | 127 ------------------ 2 files changed, 161 deletions(-) delete mode 100644 src/dispatcher/payloads/TransferCallPayload.ts delete mode 100644 test/end-to-end-tests/src/rest/session.js diff --git a/src/dispatcher/payloads/TransferCallPayload.ts b/src/dispatcher/payloads/TransferCallPayload.ts deleted file mode 100644 index 7a05d212ce..0000000000 --- a/src/dispatcher/payloads/TransferCallPayload.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright 2021 The Matrix.org Foundation C.I.C. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -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. -*/ - -import { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; - -import { ActionPayload } from "../payloads"; -import { Action } from "../actions"; - -export interface TransferCallPayload extends ActionPayload { - action: Action.TransferCallToMatrixID | Action.TransferCallToPhoneNumber; - // The call to transfer - call: MatrixCall; - // Where to transfer the call. A Matrix ID if action == TransferCallToMatrixID - // and a phone number if action == TransferCallToPhoneNumber - destination: string; - // If true, puts the current call on hold and dials the transfer target, giving - // the user a button to complete the transfer when ready. - // If false, ends the call immediately and sends the user to the transfer - // destination - consultFirst: boolean; -} diff --git a/test/end-to-end-tests/src/rest/session.js b/test/end-to-end-tests/src/rest/session.js deleted file mode 100644 index fc1a0e2852..0000000000 --- a/test/end-to-end-tests/src/rest/session.js +++ /dev/null @@ -1,127 +0,0 @@ -/* -Copyright 2018 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -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. -*/ - -const request = require('request-promise-native'); - -const Logger = require('../logger'); -const RestRoom = require('./room'); -const { approveConsent } = require('./consent'); - -module.exports = class RestSession { - constructor(credentials) { - this.log = new Logger(credentials.userId); - this._credentials = credentials; - this._displayName = null; - this._rooms = {}; - } - - userId() { - return this._credentials.userId; - } - - userName() { - return this._credentials.userId.split(":")[0].substr(1); - } - - displayName() { - return this._displayName; - } - - async setDisplayName(displayName) { - this.log.step(`sets their display name to ${displayName}`); - this._displayName = displayName; - await this._put(`/profile/${this._credentials.userId}/displayname`, { - displayname: displayName, - }); - this.log.done(); - } - - async join(roomIdOrAlias) { - this.log.step(`joins ${roomIdOrAlias}`); - const roomId = (await this._post(`/join/${encodeURIComponent(roomIdOrAlias)}`)).room_id; - this.log.done(); - const room = new RestRoom(this, roomId, this.log); - this._rooms[roomId] = room; - this._rooms[roomIdOrAlias] = room; - return room; - } - - room(roomIdOrAlias) { - if (this._rooms.hasOwnProperty(roomIdOrAlias)) { - return this._rooms[roomIdOrAlias]; - } else { - throw new Error(`${this._credentials.userId} is not in ${roomIdOrAlias}`); - } - } - - async createRoom(name, options) { - this.log.step(`creates room ${name}`); - const body = { - name, - }; - if (options.invite) { - body.invite = options.invite; - } - if (options.public) { - body.visibility = "public"; - } else { - body.visibility = "private"; - } - if (options.dm) { - body.is_direct = true; - } - if (options.topic) { - body.topic = options.topic; - } - - const roomId = (await this._post(`/createRoom`, body)).room_id; - this.log.done(); - return new RestRoom(this, roomId, this.log); - } - - _post(csApiPath, body) { - return this._request("POST", csApiPath, body); - } - - _put(csApiPath, body) { - return this._request("PUT", csApiPath, body); - } - - async _request(method, csApiPath, body) { - try { - const responseBody = await request({ - url: `${this._credentials.hsUrl}/_matrix/client/r0${csApiPath}`, - method, - headers: { - "Authorization": `Bearer ${this._credentials.accessToken}`, - }, - json: true, - body, - }); - return responseBody; - } catch (err) { - const responseBody = err.response.body; - if (responseBody.errcode === 'M_CONSENT_NOT_GIVEN') { - await approveConsent(responseBody.consent_uri); - return this._request(method, csApiPath, body); - } else if (responseBody && responseBody.error) { - throw new Error(`${method} ${csApiPath}: ${responseBody.error}`); - } else { - throw new Error(`${method} ${csApiPath}: ${err.response.statusCode}`); - } - } - } -}; From 42003ac2294b365a4b2dedd0323766fbe4a29fdc Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Thu, 9 Dec 2021 09:59:24 +0000 Subject: [PATCH 12/12] Move comment Signed-off-by: Aaron Raimist --- src/utils/createMatrixClient.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/createMatrixClient.ts b/src/utils/createMatrixClient.ts index a57b2e8c4c..867c912470 100644 --- a/src/utils/createMatrixClient.ts +++ b/src/utils/createMatrixClient.ts @@ -18,7 +18,8 @@ import { IndexedDBCryptoStore } from "matrix-js-sdk/src/crypto/store/indexeddb-c import { WebStorageSessionStore } from "matrix-js-sdk/src/store/session/webstorage"; import { IndexedDBStore } from "matrix-js-sdk/src/store/indexeddb"; -import IndexedDBWorker from "../workers/indexeddb.worker.ts"; // @ts-ignore - `.ts` is needed here to make TS happy +// @ts-ignore - `.ts` is needed here to make TS happy +import IndexedDBWorker from "../workers/indexeddb.worker.ts"; const localStorage = window.localStorage;