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

Commit 2477258

Browse files
committed
Merge branch 'develop' into show-invite-reasons
2 parents f0333b5 + 7c4437a commit 2477258

File tree

540 files changed

+19076
-3859
lines changed

Some content is hidden

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

540 files changed

+19076
-3859
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ package-lock.json
1313
/src/component-index.js
1414

1515
.DS_Store
16+
*.tmp

CHANGELOG.md

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

babel.config.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ module.exports = {
33
"presets": [
44
["@babel/preset-env", {
55
"targets": [
6-
"last 2 Chrome versions", "last 2 Firefox versions", "last 2 Safari versions"
6+
"last 2 Chrome versions",
7+
"last 2 Firefox versions",
8+
"last 2 Safari versions",
9+
"last 2 Edge versions",
710
],
811
}],
912
"@babel/preset-typescript",
1013
"@babel/preset-flow",
11-
"@babel/preset-react"
14+
"@babel/preset-react",
1215
],
1316
"plugins": [
1417
["@babel/plugin-proposal-decorators", {legacy: true}],
@@ -18,6 +21,6 @@ module.exports = {
1821
"@babel/plugin-proposal-object-rest-spread",
1922
"@babel/plugin-transform-flow-comments",
2023
"@babel/plugin-syntax-dynamic-import",
21-
"@babel/plugin-transform-runtime"
22-
]
24+
"@babel/plugin-transform-runtime",
25+
],
2326
};

docs/ciderEditor.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ caret nodes (more on that later).
2121
For these reasons it doesn't use `innerText`, `textContent` or anything similar.
2222
The model addresses any content in the editor within as an offset within this string.
2323
The caret position is thus also converted from a position in the DOM tree
24-
to an offset in the content string. This happens in `getCaretOffsetAndText` in `dom.js`.
24+
to an offset in the content string. This happens in `getCaretOffsetAndText` in `dom.ts`.
2525

2626
Once the content string and caret offset is calculated, it is passed to the `update()`
2727
method of the model. The model first calculates the same content string of its current parts,
2828
basically just concatenating their text. It then looks for differences between
2929
the current and the new content string. The diffing algorithm is very basic,
3030
and assumes there is only one change around the caret offset,
31-
so this should be very inexpensive. See `diff.js` for details.
31+
so this should be very inexpensive. See `diff.ts` for details.
3232

3333
The result of the diffing is the strings that were added and/or removed from
3434
the current content. These differences are then applied to the parts,
@@ -51,7 +51,7 @@ which relate poorly to text input or changes, and don't need the `beforeinput` e
5151
which isn't broadly supported yet.
5252

5353
Once the parts of the model are updated, the DOM of the editor is then reconciled
54-
with the new model state, see `renderModel` in `render.js` for this.
54+
with the new model state, see `renderModel` in `render.ts` for this.
5555
If the model didn't reject the input and didn't make any additional changes,
5656
this won't make any changes to the DOM at all, and should thus be fairly efficient.
5757

docs/media-handling.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Media handling
2+
3+
Surely media should be as easy as just putting a URL into an `img` and calling it good, right?
4+
Not quite. Matrix uses something called a Matrix Content URI (better known as MXC URI) to identify
5+
content, which is then converted to a regular HTTPS URL on the homeserver. However, sometimes that
6+
URL can change depending on deployment considerations.
7+
8+
The react-sdk features a [customisation endpoint](https://github.com/vector-im/element-web/blob/develop/docs/customisations.md)
9+
for media handling where all conversions from MXC URI to HTTPS URL happen. This is to ensure that
10+
those obscure deployments can route all their media to the right place.
11+
12+
For development, there are currently two functions available: `mediaFromMxc` and `mediaFromContent`.
13+
The `mediaFromMxc` function should be self-explanatory. `mediaFromContent` takes an event content as
14+
a parameter and will automatically parse out the source media and thumbnail. Both functions return
15+
a `Media` object with a number of options on it, such as getting various common HTTPS URLs for the
16+
media.
17+
18+
**It is extremely important that all media calls are put through this customisation endpoint.** So
19+
much so it's a lint rule to avoid accidental use of the wrong functions.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "matrix-react-sdk",
3-
"version": "3.14.0",
3+
"version": "3.17.0",
44
"description": "SDK for matrix.org using React",
55
"author": "matrix.org",
66
"repository": {
@@ -83,6 +83,7 @@
8383
"matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop",
8484
"matrix-widget-api": "^0.1.0-beta.13",
8585
"minimist": "^1.2.5",
86+
"opus-recorder": "^8.0.3",
8687
"pako": "^2.0.3",
8788
"parse5": "^6.0.1",
8889
"png-chunks-extract": "^1.0.0",
@@ -101,7 +102,7 @@
101102
"tar-js": "^0.3.0",
102103
"text-encoding-utf-8": "^1.0.2",
103104
"url": "^0.11.0",
104-
"velocity-animate": "^1.5.2",
105+
"velocity-animate": "^2.0.6",
105106
"what-input": "^5.2.10",
106107
"zxcvbn": "^4.4.2"
107108
},
@@ -157,6 +158,7 @@
157158
"jest": "^26.6.3",
158159
"jest-canvas-mock": "^2.3.0",
159160
"jest-environment-jsdom-sixteen": "^1.0.3",
161+
"jest-fetch-mock": "^3.0.3",
160162
"matrix-mock-request": "^1.2.3",
161163
"matrix-react-test-utils": "^0.2.2",
162164
"olm": "https://packages.matrix.org/npm/olm/olm-3.2.1.tgz",

res/css/_common.scss

Lines changed: 8 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ input[type=text]:focus, input[type=password]:focus, textarea:focus {
395395
border: 1px solid $accent-color;
396396
color: $accent-color;
397397
background-color: $button-secondary-bg-color;
398+
font-family: inherit;
398399
}
399400

400401
.mx_Dialog button:last-child {
@@ -489,54 +490,6 @@ input[type=text]:focus, input[type=password]:focus, textarea:focus {
489490
margin-top: 69px;
490491
}
491492

492-
.mx_Beta {
493-
color: red;
494-
margin-right: 10px;
495-
position: relative;
496-
top: -3px;
497-
background-color: white;
498-
padding: 0 4px;
499-
border-radius: 3px;
500-
border: 1px solid darkred;
501-
cursor: help;
502-
transition-duration: 200ms;
503-
font-size: smaller;
504-
filter: opacity(0.5);
505-
}
506-
507-
.mx_Beta:hover {
508-
color: white;
509-
border: 1px solid gray;
510-
background-color: darkred;
511-
}
512-
513-
.mx_TintableSvgButton {
514-
position: relative;
515-
display: flex;
516-
flex-direction: row;
517-
justify-content: center;
518-
align-content: center;
519-
}
520-
521-
.mx_TintableSvgButton object {
522-
margin: 0;
523-
padding: 0;
524-
width: 100%;
525-
height: 100%;
526-
max-width: 100%;
527-
max-height: 100%;
528-
}
529-
530-
.mx_TintableSvgButton span {
531-
position: absolute;
532-
top: 0;
533-
right: 0;
534-
bottom: 0;
535-
left: 0;
536-
opacity: 0;
537-
cursor: pointer;
538-
}
539-
540493
// username colors
541494
// used by SenderProfile & RoomPreviewBar
542495
.mx_Username_color1 {
@@ -606,6 +559,13 @@ input[type=text]:focus, input[type=password]:focus, textarea:focus {
606559
}
607560
}
608561

562+
@define-mixin ProgressBarBgColour $colour {
563+
background-color: $colour;
564+
&::-webkit-progress-bar {
565+
background-color: $colour;
566+
}
567+
}
568+
609569
@define-mixin ProgressBarBorderRadius $radius {
610570
border-radius: $radius;
611571
&::-moz-progress-bar {

res/css/_components.scss

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
@import "./structures/_RoomView.scss";
2828
@import "./structures/_ScrollPanel.scss";
2929
@import "./structures/_SearchBox.scss";
30+
@import "./structures/_SpacePanel.scss";
31+
@import "./structures/_SpaceRoomDirectory.scss";
32+
@import "./structures/_SpaceRoomView.scss";
3033
@import "./structures/_TabbedView.scss";
3134
@import "./structures/_ToastContainer.scss";
3235
@import "./structures/_UploadBar.scss";
@@ -56,6 +59,7 @@
5659
@import "./views/context_menus/_MessageContextMenu.scss";
5760
@import "./views/context_menus/_StatusMessageContextMenu.scss";
5861
@import "./views/context_menus/_TagTileContextMenu.scss";
62+
@import "./views/dialogs/_AddExistingToSpaceDialog.scss";
5963
@import "./views/dialogs/_AddressPickerDialog.scss";
6064
@import "./views/dialogs/_Analytics.scss";
6165
@import "./views/dialogs/_BugReportDialog.scss";
@@ -89,6 +93,7 @@
8993
@import "./views/dialogs/_SettingsDialog.scss";
9094
@import "./views/dialogs/_ShareDialog.scss";
9195
@import "./views/dialogs/_SlashCommandHelpDialog.scss";
96+
@import "./views/dialogs/_SpaceSettingsDialog.scss";
9297
@import "./views/dialogs/_TabbedIntegrationManagerDialog.scss";
9398
@import "./views/dialogs/_TermsDialog.scss";
9499
@import "./views/dialogs/_UploadConfirmDialog.scss";
@@ -106,12 +111,13 @@
106111
@import "./views/elements/_AddressSelector.scss";
107112
@import "./views/elements/_AddressTile.scss";
108113
@import "./views/elements/_DesktopBuildsNotice.scss";
109-
@import "./views/elements/_DirectorySearchBox.scss";
110114
@import "./views/elements/_DesktopCapturerSourcePicker.scss";
115+
@import "./views/elements/_DirectorySearchBox.scss";
111116
@import "./views/elements/_Dropdown.scss";
112117
@import "./views/elements/_EditableItemList.scss";
113118
@import "./views/elements/_ErrorBoundary.scss";
114119
@import "./views/elements/_EventListSummary.scss";
120+
@import "./views/elements/_FacePile.scss";
115121
@import "./views/elements/_Field.scss";
116122
@import "./views/elements/_FormButton.scss";
117123
@import "./views/elements/_ImageView.scss";
@@ -206,6 +212,7 @@
206212
@import "./views/rooms/_SendMessageComposer.scss";
207213
@import "./views/rooms/_Stickers.scss";
208214
@import "./views/rooms/_TopUnreadMessagesBar.scss";
215+
@import "./views/rooms/_VoiceRecordComposerTile.scss";
209216
@import "./views/rooms/_WhoIsTypingTile.scss";
210217
@import "./views/settings/_AvatarSetting.scss";
211218
@import "./views/settings/_CrossSigningPanel.scss";
@@ -219,6 +226,7 @@
219226
@import "./views/settings/_SecureBackupPanel.scss";
220227
@import "./views/settings/_SetIdServer.scss";
221228
@import "./views/settings/_SetIntegrationManager.scss";
229+
@import "./views/settings/_SpellCheckLanguages.scss";
222230
@import "./views/settings/_UpdateCheckButton.scss";
223231
@import "./views/settings/tabs/_SettingsTab.scss";
224232
@import "./views/settings/tabs/room/_GeneralRoomSettingsTab.scss";
@@ -232,10 +240,14 @@
232240
@import "./views/settings/tabs/user/_PreferencesUserSettingsTab.scss";
233241
@import "./views/settings/tabs/user/_SecurityUserSettingsTab.scss";
234242
@import "./views/settings/tabs/user/_VoiceUserSettingsTab.scss";
243+
@import "./views/spaces/_SpaceBasicSettings.scss";
244+
@import "./views/spaces/_SpaceCreateMenu.scss";
245+
@import "./views/spaces/_SpacePublicShare.scss";
235246
@import "./views/terms/_InlineTermsAgreement.scss";
236247
@import "./views/toasts/_AnalyticsToast.scss";
237248
@import "./views/toasts/_NonUrgentEchoFailureToast.scss";
238249
@import "./views/verification/_VerificationShowSas.scss";
250+
@import "./views/voice_messages/_Waveform.scss";
239251
@import "./views/voip/_CallContainer.scss";
240252
@import "./views/voip/_CallView.scss";
241253
@import "./views/voip/_DialPad.scss";

res/css/structures/_LeftPanel.scss

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ limitations under the License.
1515
*/
1616

1717
$groupFilterPanelWidth: 56px; // only applies in this file, used for calculations
18+
$roomListCollapsedWidth: 68px;
1819

1920
.mx_LeftPanel {
2021
background-color: $roomlist-bg-color;
21-
min-width: 260px;
22+
// TODO decrease this once Spaces launches as it'll no longer need to include the 56px Community Panel
23+
min-width: 206px;
2224
max-width: 50%;
2325

2426
// Create a row-based flexbox for the GroupFilterPanel and the room list
@@ -37,18 +39,12 @@ $groupFilterPanelWidth: 56px; // only applies in this file, used for calculation
3739
// GroupFilterPanel handles its own CSS
3840
}
3941

40-
&:not(.mx_LeftPanel_hasGroupFilterPanel) {
41-
.mx_LeftPanel_roomListContainer {
42-
width: 100%;
43-
}
44-
}
45-
4642
// Note: The 'room list' in this context is actually everything that isn't the tag
4743
// panel, such as the menu options, breadcrumbs, filtering, etc
4844
.mx_LeftPanel_roomListContainer {
49-
width: calc(100% - $groupFilterPanelWidth);
5045
background-color: $roomlist-bg-color;
51-
46+
flex: 1 0 0;
47+
min-width: 0;
5248
// Create another flexbox (this time a column) for the room list components
5349
display: flex;
5450
flex-direction: column;
@@ -134,6 +130,10 @@ $groupFilterPanelWidth: 56px; // only applies in this file, used for calculation
134130
mask-repeat: no-repeat;
135131
background: $secondary-fg-color;
136132
}
133+
134+
&.mx_LeftPanel_exploreButton_space::before {
135+
mask-image: url('$(res)/img/element-icons/roomlist/browse.svg');
136+
}
137137
}
138138
}
139139

@@ -168,17 +168,10 @@ $groupFilterPanelWidth: 56px; // only applies in this file, used for calculation
168168
// These styles override the defaults for the minimized (66px) layout
169169
&.mx_LeftPanel_minimized {
170170
min-width: unset;
171-
172-
// We have to forcefully set the width to override the resizer's style attribute.
173-
&.mx_LeftPanel_hasGroupFilterPanel {
174-
width: calc(68px + $groupFilterPanelWidth) !important;
175-
}
176-
&:not(.mx_LeftPanel_hasGroupFilterPanel) {
177-
width: 68px !important;
178-
}
171+
width: unset !important;
179172

180173
.mx_LeftPanel_roomListContainer {
181-
width: 68px;
174+
width: $roomListCollapsedWidth;
182175

183176
.mx_LeftPanel_userHeader {
184177
flex-direction: row;

res/css/structures/_MainSplit.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ limitations under the License.
1818
display: flex;
1919
flex-direction: row;
2020
min-width: 0;
21+
min-height: 0;
2122
height: 100%;
2223
}
2324

0 commit comments

Comments
 (0)