Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit c62c019

Browse files
committed
Merge branch 'develop' into patch-1
2 parents 0dc5200 + 9bcb687 commit c62c019

File tree

526 files changed

+28464
-14316
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

526 files changed

+28464
-14316
lines changed

.eslintignore.errorfiles

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,15 @@
11
# autogenerated file: run scripts/generate-eslint-error-ignore-file to update.
22

3+
src/Markdown.js
4+
src/Velociraptor.js
35
src/components/structures/RoomDirectory.js
4-
src/components/structures/RoomStatusBar.js
5-
src/components/structures/RoomView.js
6-
src/components/structures/ScrollPanel.js
7-
src/components/structures/SearchBox.js
8-
src/components/structures/UploadBar.js
9-
src/components/views/avatars/MemberAvatar.js
10-
src/components/views/create_room/RoomAlias.js
11-
src/components/views/dialogs/SetPasswordDialog.js
12-
src/components/views/elements/AddressSelector.js
13-
src/components/views/elements/DirectorySearchBox.js
14-
src/components/views/elements/MemberEventListSummary.js
15-
src/components/views/elements/UserSelector.js
16-
src/components/views/globals/NewVersionBar.js
17-
src/components/views/messages/MFileBody.js
18-
src/components/views/messages/TextualBody.js
19-
src/components/views/room_settings/ColorSettings.js
20-
src/components/views/rooms/Autocomplete.js
21-
src/components/views/rooms/AuxPanel.js
22-
src/components/views/rooms/LinkPreviewWidget.js
23-
src/components/views/rooms/MemberInfo.js
246
src/components/views/rooms/MemberList.js
25-
src/components/views/rooms/RoomList.js
26-
src/components/views/rooms/RoomPreviewBar.js
27-
src/components/views/rooms/SearchResultTile.js
28-
src/components/views/settings/ChangeAvatar.js
29-
src/components/views/settings/ChangePassword.js
30-
src/components/views/settings/DevicesPanel.js
31-
src/components/views/settings/Notifications.js
32-
src/HtmlUtils.js
33-
src/ImageUtils.js
34-
src/Markdown.js
35-
src/notifications/ContentRules.js
36-
src/notifications/PushRuleVectorState.js
37-
src/PlatformPeg.js
38-
src/rageshake/rageshake.js
397
src/ratelimitedfunc.js
40-
src/Rooms.js
41-
src/Unread.js
42-
src/utils/DecryptFile.js
43-
src/utils/DirectoryUtils.js
448
src/utils/DMRoomMap.js
45-
src/utils/FormattingUtils.js
469
src/utils/MultiInviter.js
47-
src/utils/Receipt.js
48-
src/Velociraptor.js
4910
test/components/structures/MessagePanel-test.js
5011
test/components/views/dialogs/InteractiveAuthDialog-test.js
5112
test/mock-clock.js
52-
test/notifications/ContentRules-test.js
53-
test/notifications/PushRuleVectorState-test.js
5413
src/component-index.js
5514
test/end-to-end-tests/node_modules/
5615
test/end-to-end-tests/riot/

CHANGELOG.md

Lines changed: 504 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ are currently filed against vector-im/element-web rather than this project).
1818

1919
Translation Status
2020
==================
21-
[![Translation status](https://translate.riot.im/widgets/element-web/-/multi-auto.svg)](https://translate.riot.im/engage/element-web/?utm_source=widget)
21+
[![Translation status](https://translate.element.io/widgets/element-web/-/multi-auto.svg)](https://translate.element.io/engage/element-web/?utm_source=widget)
2222

2323
Developer Guide
2424
===============
@@ -160,8 +160,8 @@ yarn link matrix-js-sdk
160160
yarn install
161161
```
162162

163-
See the [help for `yarn link`](https://yarnpkg.com/docs/cli/link) for more
164-
details about this.
163+
See the [help for `yarn link`](https://classic.yarnpkg.com/docs/cli/link) for
164+
more details about this.
165165

166166
Running tests
167167
=============

__mocks__/browser-request.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
const en = require("../src/i18n/strings/en_EN");
2+
const de = require("../src/i18n/strings/de_DE");
23

4+
// Mock the browser-request for the languageHandler tests to return
5+
// Fake languages.json containing references to en_EN and de_DE
6+
// en_EN.json
7+
// de_DE.json
38
module.exports = jest.fn((opts, cb) => {
49
const url = opts.url || opts.uri;
510
if (url && url.endsWith("languages.json")) {
@@ -8,9 +13,15 @@ module.exports = jest.fn((opts, cb) => {
813
"fileName": "en_EN.json",
914
"label": "English",
1015
},
16+
"de": {
17+
"fileName": "de_DE.json",
18+
"label": "German",
19+
},
1120
}));
1221
} else if (url && url.endsWith("en_EN.json")) {
1322
cb(undefined, {status: 200}, JSON.stringify(en));
23+
} else if (url && url.endsWith("de_DE.json")) {
24+
cb(undefined, {status: 200}, JSON.stringify(de));
1425
} else {
1526
cb(true, {status: 404}, "");
1627
}

__test-utils__/environment.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const BaseEnvironment = require("jest-environment-jsdom-sixteen");
2+
3+
class Environment extends BaseEnvironment {
4+
constructor(config, options) {
5+
super(Object.assign({}, config, {
6+
globals: Object.assign({}, config.globals, {
7+
// Explicitly specify the correct globals to workaround Jest bug
8+
// https://github.com/facebook/jest/issues/7780
9+
Uint32Array: Uint32Array,
10+
Uint8Array: Uint8Array,
11+
ArrayBuffer: ArrayBuffer,
12+
}),
13+
}), options);
14+
}
15+
}
16+
17+
module.exports = Environment;

docs/settings.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,18 @@ Call `SettingsStore.getValue()` as you would for any other setting.
120120

121121
Call `SettingsStore.setValue("feature_name", null, SettingLevel.DEVICE, true)`.
122122

123+
### A note on UI features
124+
125+
UI features are a different concept to plain features. Instead of being representative of unstable or
126+
unpredicatable behaviour, they are logical chunks of UI which can be disabled by deployments for ease
127+
of understanding with users. They are simply represented as boring settings with a convention of being
128+
named as `UIFeature.$location` where `$location` is a rough descriptor of what is toggled, such as
129+
`URLPreviews` or `Communities`.
130+
131+
UI features also tend to have their own setting controller (see below) to manipulate settings which might
132+
be affected by the UI feature being disabled. For example, if URL previews are disabled as a UI feature
133+
then the URL preview options will use the `UIFeatureController` to ensure they remain disabled while the
134+
UI feature is disabled.
123135

124136
## Setting controllers
125137

@@ -226,4 +238,3 @@ In practice, handlers which rely on remote changes (account data, room events, e
226238
generalized `WatchManager` - a class specifically designed to deduplicate the logic of managing watchers. The handlers
227239
which are localized to the local client (device) generally just trigger the `WatchManager` when they manipulate the
228240
setting themselves as there's nothing to really 'watch'.
229-

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "matrix-react-sdk",
3-
"version": "3.3.0",
3+
"version": "3.8.0",
44
"description": "SDK for matrix.org using React",
55
"author": "matrix.org",
66
"repository": {
@@ -61,7 +61,6 @@
6161
"classnames": "^2.2.6",
6262
"commonmark": "^0.29.1",
6363
"counterpart": "^0.18.6",
64-
"create-react-class": "^15.6.3",
6564
"diff-dom": "^4.1.6",
6665
"diff-match-patch": "^1.0.5",
6766
"emojibase-data": "^5.0.1",
@@ -80,6 +79,7 @@
8079
"linkifyjs": "^2.1.9",
8180
"lodash": "^4.17.19",
8281
"matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop",
82+
"matrix-widget-api": "^0.1.0-beta.8",
8383
"minimist": "^1.2.5",
8484
"pako": "^1.0.11",
8585
"parse5": "^5.1.1",
@@ -95,7 +95,8 @@
9595
"react-focus-lock": "^2.4.1",
9696
"react-transition-group": "^4.4.1",
9797
"resize-observer-polyfill": "^1.5.1",
98-
"sanitize-html": "^1.27.1",
98+
"rfc4648": "^1.4.0",
99+
"sanitize-html": "github:apostrophecms/sanitize-html#3c7f93f2058f696f5359e3e58d464161647226db",
99100
"tar-js": "^0.3.0",
100101
"text-encoding-utf-8": "^1.0.2",
101102
"url": "^0.11.0",
@@ -120,7 +121,7 @@
120121
"@babel/preset-typescript": "^7.10.4",
121122
"@babel/register": "^7.10.5",
122123
"@babel/traverse": "^7.11.0",
123-
"@peculiar/webcrypto": "^1.1.2",
124+
"@peculiar/webcrypto": "^1.1.3",
124125
"@types/classnames": "^2.2.10",
125126
"@types/counterpart": "^0.18.1",
126127
"@types/flux": "^3.1.9",
@@ -149,23 +150,23 @@
149150
"eslint-plugin-flowtype": "^2.50.3",
150151
"eslint-plugin-react": "^7.20.3",
151152
"eslint-plugin-react-hooks": "^2.5.1",
152-
"file-loader": "^3.0.1",
153153
"glob": "^5.0.15",
154-
"jest": "^24.9.0",
155-
"jest-canvas-mock": "^2.2.0",
154+
"jest": "^26.5.2",
155+
"jest-canvas-mock": "^2.3.0",
156+
"jest-environment-jsdom-sixteen": "^1.0.3",
156157
"lolex": "^5.1.2",
157158
"matrix-mock-request": "^1.2.3",
158159
"matrix-react-test-utils": "^0.2.2",
159160
"react-test-renderer": "^16.13.1",
160161
"rimraf": "^2.7.1",
161-
"source-map-loader": "^0.2.4",
162162
"stylelint": "^9.10.1",
163163
"stylelint-config-standard": "^18.3.0",
164164
"stylelint-scss": "^3.18.0",
165165
"typescript": "^3.9.7",
166166
"walk": "^2.3.14"
167167
},
168168
"jest": {
169+
"testEnvironment": "./__test-utils__/environment.js",
169170
"testMatch": [
170171
"<rootDir>/test/**/*-test.js"
171172
],

release.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ set -e
99

1010
cd `dirname $0`
1111

12+
# This link seems to get eaten by the release process, so ensure it exists.
13+
yarn link matrix-js-sdk
14+
1215
for i in matrix-js-sdk
1316
do
1417
echo "Checking version of $i..."
@@ -29,9 +32,7 @@ do
2932
echo "Upgrading $i to $latestver..."
3033
yarn add -E $i@$latestver
3134
git add -u
32-
# The `-e` flag opens the editor and gives you a chance to check
33-
# the upgrade for correctness.
34-
git commit -m "Upgrade $i to $latestver" -e
35+
git commit -m "Upgrade $i to $latestver"
3536
fi
3637
fi
3738
done

res/css/_common.scss

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ limitations under the License.
1717
*/
1818

1919
@import "./_font-sizes.scss";
20+
@import "./_font-weights.scss";
21+
22+
$hover-transition: 0.08s cubic-bezier(.46, .03, .52, .96); // quadratic
2023

2124
:root {
2225
font-size: 10px;
@@ -206,12 +209,6 @@ input[type=text]:focus, input[type=password]:focus, textarea:focus {
206209
border: 0;
207210
}
208211

209-
/* applied to side-panels and messagepanel when in RoomSettings */
210-
.mx_fadable {
211-
opacity: 1;
212-
transition: opacity 0.2s ease-in-out;
213-
}
214-
215212
// These are magic constants which are excluded from tinting, to let themes
216213
// (which only have CSS, unlike skins) tell the app what their non-tinted
217214
// colourscheme is by inspecting the stylesheet DOM.
@@ -260,7 +257,7 @@ input[type=text]:focus, input[type=password]:focus, textarea:focus {
260257
font-weight: 300;
261258
font-size: $font-15px;
262259
position: relative;
263-
padding: 25px 30px 30px 30px;
260+
padding: 24px;
264261
max-height: 80%;
265262
box-shadow: 2px 15px 30px 0 $dialog-shadow-color;
266263
border-radius: 8px;
@@ -327,6 +324,7 @@ input[type=text]:focus, input[type=password]:focus, textarea:focus {
327324

328325
.mx_Dialog_title {
329326
font-size: $font-22px;
327+
font-weight: $font-semi-bold;
330328
line-height: $font-36px;
331329
color: $dialog-title-fg-color;
332330
}
@@ -352,8 +350,8 @@ input[type=text]:focus, input[type=password]:focus, textarea:focus {
352350
background-color: $dialog-close-fg-color;
353351
cursor: pointer;
354352
position: absolute;
355-
top: 4px;
356-
right: 0px;
353+
top: 10px;
354+
right: 0;
357355
}
358356

359357
.mx_Dialog_content {

0 commit comments

Comments
 (0)