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

Commit a7da141

Browse files
Merge branch 'develop' into estellecomment/remove-add-space-button
2 parents b84ac56 + dc6ceb1 commit a7da141

File tree

426 files changed

+3591
-2718
lines changed

Some content is hidden

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

426 files changed

+3591
-2718
lines changed

.stylelintrc.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module.exports = {
22
"extends": "stylelint-config-standard",
3+
customSyntax: require('postcss-scss'),
34
"plugins": [
45
"stylelint-scss",
56
],
@@ -27,6 +28,25 @@ module.exports = {
2728
// rather than a CI thing. Shorthand selectors are harder to detect when searching for a
2829
// class name. This regex is trying to *allow* anything except `&words`, such as `&::before`,
2930
// `&.mx_Class`, etc.
30-
"selector-nested-pattern": "^((&[ :.\\\[,])|([^&]))"
31-
}
31+
"selector-nested-pattern": "^((&[ :.\\\[,])|([^&]))",
32+
"declaration-colon-space-after": "always-single-line",
33+
// Disable some defaults
34+
"selector-class-pattern": null,
35+
"custom-property-pattern": null,
36+
"selector-id-pattern": null,
37+
"keyframes-name-pattern": null,
38+
"string-quotes": null,
39+
"alpha-value-notation": null,
40+
"color-function-notation": null,
41+
"selector-not-notation": null,
42+
"import-notation": null,
43+
"value-keyword-case": null,
44+
"declaration-block-no-redundant-longhand-properties": null,
45+
"shorthand-property-no-redundant-values": null,
46+
"property-no-vendor-prefix": null,
47+
"value-no-vendor-prefix": null,
48+
"selector-no-vendor-prefix": null,
49+
"media-feature-name-no-vendor-prefix": null,
50+
"number-max-precision": null,
51+
},
3252
}

cypress/e2e/1-register/register.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ describe("Registration", () => {
6565
cy.startMeasuring("from-submit-to-home");
6666
cy.get(".mx_InteractiveAuthEntryComponents_termsSubmit").click();
6767

68+
cy.get(".mx_UseCaseSelection_skip .mx_AccessibleButton").click();
69+
6870
cy.url().should('contain', '/#/home');
6971
cy.stopMeasuring("from-submit-to-home");
7072

cypress/e2e/12-spotlight/spotlight.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ describe("Spotlight", () => {
357357
cy.spotlightSearch().clear().type("b");
358358
// our debouncing logic only starts the search after a short timeout,
359359
// so we wait a few milliseconds.
360-
cy.wait(300);
360+
cy.wait(1000);
361361
cy.get(".mx_Spinner").should("not.exist").then(() => {
362362
cy.spotlightResults().should("have.length", 2).then(() => {
363363
cy.spotlightResults().eq(0)

cypress/e2e/14-timeline/timeline.spec.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import type { EventType } from "matrix-js-sdk/src/@types/event";
2323
import type { MatrixClient } from "matrix-js-sdk/src/client";
2424
import { SynapseInstance } from "../../plugins/synapsedocker";
2525
import { SettingLevel } from "../../../src/settings/SettingLevel";
26+
import { Layout } from "../../../src/settings/enums/Layout";
2627
import Chainable = Cypress.Chainable;
2728

2829
// The avatar size used in the timeline
@@ -141,5 +142,52 @@ describe("Timeline", () => {
141142
expectAvatar(e, newAvatarUrl);
142143
});
143144
});
145+
146+
it("should create and configure a room on IRC layout", () => {
147+
cy.visit("/#/room/" + roomId);
148+
cy.setSettingValue("layout", null, SettingLevel.DEVICE, Layout.IRC);
149+
cy.contains(".mx_RoomView_body .mx_GenericEventListSummary[data-layout=irc] " +
150+
".mx_GenericEventListSummary_summary", "created and configured the room.");
151+
cy.percySnapshot("Configured room on IRC layout");
152+
});
153+
154+
it("should click top left of view source event toggle", () => {
155+
sendEvent(roomId);
156+
cy.visit("/#/room/" + roomId);
157+
cy.setSettingValue("showHiddenEventsInTimeline", null, SettingLevel.DEVICE, true);
158+
cy.contains(".mx_RoomView_body .mx_GenericEventListSummary " +
159+
".mx_GenericEventListSummary_summary", "created and configured the room.");
160+
161+
// Edit message
162+
cy.get(".mx_RoomView_body .mx_EventTile").contains(".mx_EventTile_line", "Message").within(() => {
163+
cy.get('[aria-label="Edit"]').click({ force: true }); // Cypress has no ability to hover
164+
cy.get(".mx_BasicMessageComposer_input").type("Edit{enter}");
165+
});
166+
cy.get(".mx_RoomView_body .mx_EventTile").contains(".mx_EventTile[data-scroll-tokens]", "MessageEdit");
167+
168+
// Click top left of the event toggle, which should not be covered by MessageActionBar's safe area
169+
cy.get(".mx_EventTile .mx_ViewSourceEvent").realHover()
170+
.get(".mx_EventTile .mx_ViewSourceEvent .mx_ViewSourceEvent_toggle").click('topLeft', { force: false });
171+
172+
// Make sure the expand toggle worked
173+
cy.get(".mx_EventTile .mx_ViewSourceEvent_expanded .mx_ViewSourceEvent_toggle").should("be.visible");
174+
});
175+
176+
it("should click 'collapse' link button on the first hovered info event line on bubble layout", () => {
177+
cy.visit("/#/room/" + roomId);
178+
cy.setSettingValue("layout", null, SettingLevel.DEVICE, Layout.Bubble);
179+
cy.contains(".mx_RoomView_body .mx_GenericEventListSummary[data-layout=bubble] " +
180+
".mx_GenericEventListSummary_summary", "created and configured the room.");
181+
182+
// Click "expand" link button
183+
cy.get(".mx_GenericEventListSummary_toggle[aria-expanded=false]").click();
184+
185+
// Click "collapse" link button on the first hovered info event line
186+
cy.get(".mx_GenericEventListSummary_unstyledList .mx_EventTile_info:first-of-type").realHover()
187+
.get(".mx_GenericEventListSummary_toggle[aria-expanded=true]").click({ force: false });
188+
189+
// Make sure "collapse" link button worked
190+
cy.get(".mx_GenericEventListSummary_toggle[aria-expanded=false]");
191+
});
144192
});
145193
});

docs/icons.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const MyComponent = () => {
2222
Icon components are svg elements and can be styled as usual.
2323

2424
```
25-
// _MyComponents.scss
25+
// _MyComponents.pcss
2626
.mx_MyComponent-icon {
2727
height: 20px;
2828
width: 20px;
@@ -41,4 +41,4 @@ const MyComponent = () => {
4141
<FavoriteIcon className="mx_MyComponent-icon" role="img" aria-hidden="false">
4242
</>;
4343
}
44-
```
44+
```

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"CONTRIBUTING.rst",
2121
"LICENSE",
2222
"README.md",
23-
"package.json"
23+
"package.json",
24+
".stylelintrc.js"
2425
],
2526
"main": "./src/index.ts",
2627
"matrix_src_main": "./src/index.ts",
@@ -47,7 +48,7 @@
4748
"lint:js": "eslint --max-warnings 0 src test cypress",
4849
"lint:js-fix": "eslint --fix src test cypress",
4950
"lint:types": "tsc --noEmit --jsx react && tsc --noEmit --jsx react -p cypress",
50-
"lint:style": "stylelint \"res/css/**/*.scss\"",
51+
"lint:style": "stylelint \"res/css/**/*.pcss\"",
5152
"test": "jest",
5253
"test:cypress": "cypress run",
5354
"test:cypress:open": "cypress open",
@@ -56,7 +57,7 @@
5657
},
5758
"dependencies": {
5859
"@babel/runtime": "^7.12.5",
59-
"@matrix-org/analytics-events": "^0.1.1",
60+
"@matrix-org/analytics-events": "^0.1.2",
6061
"@matrix-org/react-sdk-module-api": "^0.0.3",
6162
"@sentry/browser": "^6.11.0",
6263
"@sentry/tracing": "^6.11.0",
@@ -193,14 +194,15 @@
193194
"matrix-mock-request": "^2.0.0",
194195
"matrix-react-test-utils": "^0.2.3",
195196
"matrix-web-i18n": "^1.3.0",
197+
"postcss-scss": "^4.0.4",
196198
"raw-loader": "^4.0.2",
197199
"react-test-renderer": "^17.0.2",
198200
"rimraf": "^3.0.2",
199201
"rrweb-snapshot": "1.1.7",
200-
"stylelint": "^13.9.0",
201-
"stylelint-config-standard": "^20.0.0",
202-
"stylelint-scss": "^3.18.0",
203-
"typescript": "4.5.3",
202+
"stylelint": "^14.9.1",
203+
"stylelint-config-standard": "^26.0.0",
204+
"stylelint-scss": "^4.2.0",
205+
"typescript": "^4.7.4",
204206
"walk": "^2.3.14"
205207
},
206208
"resolutions": {
File renamed without changes.

res/css/_common.scss renamed to res/css/_common.pcss

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ See the License for the specific language governing permissions and
1717
limitations under the License.
1818
*/
1919

20-
@import "./_font-sizes.scss";
21-
@import "./_font-weights.scss";
22-
@import "./_animations.scss";
23-
@import "./_spacing.scss";
20+
@import "./_font-sizes.pcss";
21+
@import "./_font-weights.pcss";
22+
@import "./_animations.pcss";
23+
@import "./_spacing.pcss";
2424
@import url("maplibre-gl/dist/maplibre-gl.css");
2525

2626
$hover-transition: 0.08s cubic-bezier(.46, .03, .52, .96); // quadratic
@@ -112,35 +112,35 @@ a:visited {
112112
color: $accent-alt;
113113
}
114114

115-
input[type=text],
116-
input[type=search],
117-
input[type=password] {
115+
input[type="text"],
116+
input[type="search"],
117+
input[type="password"] {
118118
font-family: inherit;
119119
padding: 9px;
120120
font-size: $font-14px;
121121
font-weight: 600;
122122
min-width: 0;
123123
}
124124

125-
input[type=text].mx_textinput_icon,
126-
input[type=search].mx_textinput_icon {
125+
input[type="text"].mx_textinput_icon,
126+
input[type="search"].mx_textinput_icon {
127127
padding-left: 36px;
128128
background-repeat: no-repeat;
129129
background-position: 10px center;
130130
}
131131

132132
// FIXME THEME - Tint by CSS rather than referencing a duplicate asset
133-
input[type=text].mx_textinput_icon.mx_textinput_search,
134-
input[type=search].mx_textinput_icon.mx_textinput_search {
133+
input[type="text"].mx_textinput_icon.mx_textinput_search,
134+
input[type="search"].mx_textinput_icon.mx_textinput_search {
135135
background-image: url('$(res)/img/feather-customised/search-input.svg');
136136
}
137137

138138
// dont search UI as not all browsers support it,
139139
// we implement it ourselves where needed instead
140-
input[type=search]::-webkit-search-decoration,
141-
input[type=search]::-webkit-search-cancel-button,
142-
input[type=search]::-webkit-search-results-button,
143-
input[type=search]::-webkit-search-results-decoration {
140+
input[type="search"]::-webkit-search-decoration,
141+
input[type="search"]::-webkit-search-cancel-button,
142+
input[type="search"]::-webkit-search-results-button,
143+
input[type="search"]::-webkit-search-results-decoration {
144144
display: none;
145145
}
146146

@@ -150,7 +150,7 @@ textarea::placeholder {
150150
opacity: initial;
151151
}
152152

153-
input[type=text], input[type=password], textarea {
153+
input[type="text"], input[type="password"], textarea {
154154
background-color: transparent;
155155
color: $primary-content;
156156
}
@@ -160,7 +160,7 @@ textarea {
160160
color: $primary-content;
161161
}
162162

163-
input[type=text]:focus, input[type=password]:focus, textarea:focus {
163+
input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
164164
outline: none;
165165
box-shadow: none;
166166
}
@@ -194,15 +194,15 @@ legend {
194194
// appear to be part of the input
195195

196196
.mx_Dialog, .mx_MatrixChat_wrapper {
197-
.mx_textinput > input[type=text],
198-
.mx_textinput > input[type=search] {
197+
.mx_textinput > input[type="text"],
198+
.mx_textinput > input[type="search"] {
199199
border: none;
200200
flex: 1;
201201
color: $primary-content;
202202
}
203203

204-
:not(.mx_textinput):not(.mx_Field):not(.mx_no_textinput) > input[type=text],
205-
:not(.mx_textinput):not(.mx_Field):not(.mx_no_textinput) > input[type=search],
204+
:not(.mx_textinput):not(.mx_Field):not(.mx_no_textinput) > input[type="text"],
205+
:not(.mx_textinput):not(.mx_Field):not(.mx_no_textinput) > input[type="search"],
206206
.mx_textinput {
207207
display: block;
208208
box-sizing: border-box;
@@ -219,8 +219,8 @@ legend {
219219
align-items: center;
220220
}
221221

222-
:not(.mx_textinput):not(.mx_Field):not(.mx_no_textinput) > input[type=text]::placeholder,
223-
:not(.mx_textinput):not(.mx_Field):not(.mx_no_textinput) > input[type=search]::placeholder,
222+
:not(.mx_textinput):not(.mx_Field):not(.mx_no_textinput) > input[type="text"]::placeholder,
223+
:not(.mx_textinput):not(.mx_Field):not(.mx_no_textinput) > input[type="search"]::placeholder,
224224
.mx_textinput input::placeholder {
225225
color: rgba($input-darker-fg-color, .75);
226226
}
@@ -230,8 +230,8 @@ legend {
230230
.dark-panel {
231231
background-color: $dark-panel-bg-color;
232232

233-
:not(.mx_textinput):not(.mx_Field):not(.mx_no_textinput) > input[type=text],
234-
:not(.mx_textinput):not(.mx_Field):not(.mx_no_textinput) > input[type=search],
233+
:not(.mx_textinput):not(.mx_Field):not(.mx_no_textinput) > input[type="text"],
234+
:not(.mx_textinput):not(.mx_Field):not(.mx_no_textinput) > input[type="search"],
235235
.mx_textinput {
236236
color: $input-darker-fg-color;
237237
background-color: $background;
@@ -240,8 +240,8 @@ legend {
240240
}
241241

242242
.light-panel {
243-
:not(.mx_textinput):not(.mx_Field):not(.mx_no_textinput) > input[type=text],
244-
:not(.mx_textinput):not(.mx_Field):not(.mx_no_textinput) > input[type=search],
243+
:not(.mx_textinput):not(.mx_Field):not(.mx_no_textinput) > input[type="text"],
244+
:not(.mx_textinput):not(.mx_Field):not(.mx_no_textinput) > input[type="search"],
245245
.mx_textinput {
246246
color: $input-darker-fg-color;
247247
background-color: $input-lighter-bg-color;
@@ -517,7 +517,7 @@ legend {
517517
* Elements that should not be styled like a dialog button are mentioned in a :not() pseudo-class.
518518
* For the widest browser support, we use multiple :not pseudo-classes instead of :not(.a, .b).
519519
*/
520-
.mx_Dialog button:not(.mx_Dialog_nonDialogButton):not([class|=maplibregl]):not(.mx_AccessibleButton),
520+
.mx_Dialog button:not(.mx_Dialog_nonDialogButton):not([class|="maplibregl"]):not(.mx_AccessibleButton),
521521
.mx_Dialog input[type="submit"],
522522
.mx_Dialog_buttons button:not(.mx_Dialog_nonDialogButton):not(.mx_AccessibleButton),
523523
.mx_Dialog_buttons input[type="submit"] {
@@ -534,25 +534,25 @@ legend {
534534
font-family: inherit;
535535
}
536536

537-
.mx_Dialog button:not(.mx_Dialog_nonDialogButton):not([class|=maplibregl]):not(.mx_AccessibleButton):last-child {
537+
.mx_Dialog button:not(.mx_Dialog_nonDialogButton):not([class|="maplibregl"]):not(.mx_AccessibleButton):last-child {
538538
margin-right: 0px;
539539
}
540540

541-
.mx_Dialog button:not(.mx_Dialog_nonDialogButton):not([class|=maplibregl]):not(.mx_AccessibleButton):hover,
541+
.mx_Dialog button:not(.mx_Dialog_nonDialogButton):not([class|="maplibregl"]):not(.mx_AccessibleButton):hover,
542542
.mx_Dialog input[type="submit"]:hover,
543543
.mx_Dialog_buttons button:not(.mx_Dialog_nonDialogButton):not(.mx_AccessibleButton):hover,
544544
.mx_Dialog_buttons input[type="submit"]:hover {
545545
@mixin mx_DialogButton_hover;
546546
}
547547

548-
.mx_Dialog button:not(.mx_Dialog_nonDialogButton):not([class|=maplibregl]):not(.mx_AccessibleButton):focus,
548+
.mx_Dialog button:not(.mx_Dialog_nonDialogButton):not([class|="maplibregl"]):not(.mx_AccessibleButton):focus,
549549
.mx_Dialog input[type="submit"]:focus,
550550
.mx_Dialog_buttons button:not(.mx_Dialog_nonDialogButton):not(.mx_AccessibleButton):focus,
551551
.mx_Dialog_buttons input[type="submit"]:focus {
552552
filter: brightness($focus-brightness);
553553
}
554554

555-
.mx_Dialog button.mx_Dialog_primary:not(.mx_Dialog_nonDialogButton):not([class|=maplibregl]),
555+
.mx_Dialog button.mx_Dialog_primary:not(.mx_Dialog_nonDialogButton):not([class|="maplibregl"]),
556556
.mx_Dialog input[type="submit"].mx_Dialog_primary,
557557
.mx_Dialog_buttons button.mx_Dialog_primary:not(.mx_Dialog_nonDialogButton):not(.mx_AccessibleButton),
558558
.mx_Dialog_buttons input[type="submit"].mx_Dialog_primary {
@@ -561,7 +561,7 @@ legend {
561561
min-width: 156px;
562562
}
563563

564-
.mx_Dialog button.danger:not(.mx_Dialog_nonDialogButton):not([class|=maplibregl]),
564+
.mx_Dialog button.danger:not(.mx_Dialog_nonDialogButton):not([class|="maplibregl"]),
565565
.mx_Dialog input[type="submit"].danger,
566566
.mx_Dialog_buttons button.danger:not(.mx_Dialog_nonDialogButton):not(.mx_AccessibleButton),
567567
.mx_Dialog_buttons input[type="submit"].danger {
@@ -570,13 +570,13 @@ legend {
570570
color: $accent-fg-color;
571571
}
572572

573-
.mx_Dialog button.warning:not(.mx_Dialog_nonDialogButton):not([class|=maplibregl]),
573+
.mx_Dialog button.warning:not(.mx_Dialog_nonDialogButton):not([class|="maplibregl"]),
574574
.mx_Dialog input[type="submit"].warning {
575575
border: solid 1px $alert;
576576
color: $alert;
577577
}
578578

579-
.mx_Dialog button:not(.mx_Dialog_nonDialogButton):not([class|=maplibregl]):not(.mx_AccessibleButton):disabled,
579+
.mx_Dialog button:not(.mx_Dialog_nonDialogButton):not([class|="maplibregl"]):not(.mx_AccessibleButton):disabled,
580580
.mx_Dialog input[type="submit"]:disabled,
581581
.mx_Dialog_buttons button:not(.mx_Dialog_nonDialogButton):not(.mx_AccessibleButton):disabled,
582582
.mx_Dialog_buttons input[type="submit"]:disabled {

0 commit comments

Comments
 (0)