Update dependency prettier to v3 (#12095)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
renovate[bot] 2024-01-02 18:56:39 +00:00 committed by GitHub
parent 773b03e15e
commit a0c8575113
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
110 changed files with 449 additions and 313 deletions

View file

@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<title>Test Privacy policy</title> <title>Test Privacy policy</title>

View file

@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<title>Test Privacy policy</title> <title>Test Privacy policy</title>

View file

@ -34,7 +34,7 @@
"prepublishOnly": "yarn build", "prepublishOnly": "yarn build",
"i18n": "matrix-gen-i18n && yarn i18n:sort && yarn i18n:lint", "i18n": "matrix-gen-i18n && yarn i18n:sort && yarn i18n:lint",
"i18n:sort": "jq --sort-keys '.' src/i18n/strings/en_EN.json > src/i18n/strings/en_EN.json.tmp && mv src/i18n/strings/en_EN.json.tmp src/i18n/strings/en_EN.json", "i18n:sort": "jq --sort-keys '.' src/i18n/strings/en_EN.json > src/i18n/strings/en_EN.json.tmp && mv src/i18n/strings/en_EN.json.tmp src/i18n/strings/en_EN.json",
"i18n:lint": "matrix-i18n-lint && prettier --loglevel silent --write src/i18n/strings/ --ignore-path /dev/null", "i18n:lint": "matrix-i18n-lint && prettier --log-level=silent --write src/i18n/strings/ --ignore-path /dev/null",
"i18n:diff": "cp src/i18n/strings/en_EN.json src/i18n/strings/en_EN_orig.json && yarn i18n && matrix-compare-i18n-files src/i18n/strings/en_EN_orig.json src/i18n/strings/en_EN.json", "i18n:diff": "cp src/i18n/strings/en_EN.json src/i18n/strings/en_EN_orig.json && yarn i18n && matrix-compare-i18n-files src/i18n/strings/en_EN_orig.json src/i18n/strings/en_EN.json",
"make-component": "node scripts/make-react-component.js", "make-component": "node scripts/make-react-component.js",
"rethemendex": "res/css/rethemendex.sh", "rethemendex": "res/css/rethemendex.sh",
@ -47,7 +47,7 @@
"start:build": "babel src -w -s -d lib --verbose --extensions \".ts,.js\"", "start:build": "babel src -w -s -d lib --verbose --extensions \".ts,.js\"",
"lint": "yarn lint:types && yarn lint:js && yarn lint:style && yarn lint:workflows", "lint": "yarn lint:types && yarn lint:js && yarn lint:style && yarn lint:workflows",
"lint:js": "eslint --max-warnings 0 src test cypress playwright && prettier --check .", "lint:js": "eslint --max-warnings 0 src test cypress playwright && prettier --check .",
"lint:js-fix": "eslint --fix src test cypress playwright && prettier --loglevel=warn --write .", "lint:js-fix": "eslint --fix src test cypress playwright && prettier --log-level=warn --write .",
"lint:types": "tsc --noEmit --jsx react && tsc --noEmit --jsx react -p cypress && tsc --noEmit --jsx react -p playwright", "lint:types": "tsc --noEmit --jsx react && tsc --noEmit --jsx react -p cypress && tsc --noEmit --jsx react -p playwright",
"lint:style": "stylelint \"res/css/**/*.pcss\"", "lint:style": "stylelint \"res/css/**/*.pcss\"",
"test": "jest", "test": "jest",
@ -178,7 +178,6 @@
"@types/node": "^16", "@types/node": "^16",
"@types/node-fetch": "^2.6.2", "@types/node-fetch": "^2.6.2",
"@types/pako": "^2.0.0", "@types/pako": "^2.0.0",
"@types/prettier": "^2.7.0",
"@types/qrcode": "^1.3.5", "@types/qrcode": "^1.3.5",
"@types/react": "17.0.68", "@types/react": "17.0.68",
"@types/react-beautiful-dnd": "^13.0.0", "@types/react-beautiful-dnd": "^13.0.0",
@ -226,7 +225,7 @@
"mocha-junit-reporter": "^2.2.0", "mocha-junit-reporter": "^2.2.0",
"node-fetch": "2", "node-fetch": "2",
"postcss-scss": "^4.0.4", "postcss-scss": "^4.0.4",
"prettier": "2.8.8", "prettier": "3.1.1",
"raw-loader": "^4.0.2", "raw-loader": "^4.0.2",
"rimraf": "^5.0.0", "rimraf": "^5.0.0",
"stylelint": "^16.0.0", "stylelint": "^16.0.0",

View file

@ -68,7 +68,11 @@ export const test = base.extend<{
* which finds a message and then constructs a reply to it. * which finds a message and then constructs a reply to it.
*/ */
export class MessageBuilder { export class MessageBuilder {
constructor(private page: Page, private app: ElementAppPage, private helpers: Helpers) {} constructor(
private page: Page,
private app: ElementAppPage,
private helpers: Helpers,
) {}
/** /**
* Map of message content -> event. * Map of message content -> event.
@ -334,7 +338,11 @@ export abstract class BotActionSpec {
export type Message = string | MessageContentSpec | BotActionSpec; export type Message = string | MessageContentSpec | BotActionSpec;
class Helpers { class Helpers {
constructor(private page: Page, private app: ElementAppPage, private bot: Bot) {} constructor(
private page: Page,
private app: ElementAppPage,
private bot: Bot,
) {}
/** /**
* Use the supplied client to send messages or perform actions as specified by * Use the supplied client to send messages or perform actions as specified by

View file

@ -68,7 +68,11 @@ export class Bot extends Client {
public credentials?: Credentials; public credentials?: Credentials;
private handlePromise: Promise<JSHandle<ExtendedMatrixClient>>; private handlePromise: Promise<JSHandle<ExtendedMatrixClient>>;
constructor(page: Page, private homeserver: HomeserverInstance, private readonly opts: CreateBotOpts) { constructor(
page: Page,
private homeserver: HomeserverInstance,
private readonly opts: CreateBotOpts,
) {
super(page); super(page);
this.opts = Object.assign({}, defaultCreateBotOptions, opts); this.opts = Object.assign({}, defaultCreateBotOptions, opts);
} }

View file

@ -21,7 +21,10 @@ export class Network {
private isOffline = false; private isOffline = false;
private readonly setupPromise: Promise<void>; private readonly setupPromise: Promise<void>;
constructor(private page: Page, private client: Client) { constructor(
private page: Page,
private client: Client,
) {
this.setupPromise = this.setupRoute(); this.setupPromise = this.setupRoute();
} }

View file

@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<title>Test Privacy policy</title> <title>Test Privacy policy</title>

View file

@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<title>Test Privacy policy</title> <title>Test Privacy policy</title>

View file

@ -102,7 +102,10 @@ body {
* `font-feature-settings` allows us to override this behaviour and have the * `font-feature-settings` allows us to override this behaviour and have the
* correct ligatures and the proper dynamic metric spacing. * correct ligatures and the proper dynamic metric spacing.
*/ */
font-feature-settings: "kern" 1, "liga" 1, "calt" 1; font-feature-settings:
"kern" 1,
"liga" 1,
"calt" 1;
background-color: $background; background-color: $background;
color: $primary-content; color: $primary-content;

View file

@ -15,7 +15,7 @@ limitations under the License.
*/ */
.mx_PollDetailHeader { .mx_PollDetailHeader {
// override accessiblebutton style /* override accessiblebutton style */
font-size: $font-15px !important; font-size: $font-15px !important;
} }

View file

@ -60,6 +60,6 @@ limitations under the License.
} }
.mx_PollListItemEnded_voteCount { .mx_PollListItemEnded_voteCount {
// 6px to match PollOption padding /* 6px to match PollOption padding */
margin: $spacing-8 0 0 6px; margin: $spacing-8 0 0 6px;
} }

View file

@ -39,7 +39,7 @@ limitations under the License.
&:checked + span { &:checked + span {
color: $accent; color: $accent;
font-weight: var(--cpd-font-weight-semibold); font-weight: var(--cpd-font-weight-semibold);
// underline /* underline */
box-shadow: 0 1.5px 0 0 currentColor; box-shadow: 0 1.5px 0 0 currentColor;
} }
} }

View file

@ -66,8 +66,7 @@ limitations under the License.
} }
} }
// override checked radio button styling /* override checked radio button styling to show checkmark instead */
// to show checkmark instead
.mx_StyledRadioButton_checked { .mx_StyledRadioButton_checked {
input[type="radio"] + div { input[type="radio"] + div {
border-width: 2px; border-width: 2px;

View file

@ -15,6 +15,6 @@ limitations under the License.
*/ */
.mx_CurrentDeviceSection_deviceDetails { .mx_CurrentDeviceSection_deviceDetails {
// align with text of session tile /* align with text of session tile */
margin-left: 56px; margin-left: 56px;
} }

View file

@ -44,7 +44,7 @@ limitations under the License.
} }
.mx_DeviceDetailHeading_renameFormInput { .mx_DeviceDetailHeading_renameFormInput {
// override field styles /* override field styles */
margin: 0 0 $spacing-4 0 !important; margin: 0 0 $spacing-4 0 !important;
} }

View file

@ -45,13 +45,13 @@ limitations under the License.
.mx_FilteredDeviceList_headerButton { .mx_FilteredDeviceList_headerButton {
flex-shrink: 0; flex-shrink: 0;
// override inline button styling /* override inline button styling */
display: flex !important; display: flex !important;
flex-direction: row; flex-direction: row;
gap: $spacing-8; gap: $spacing-8;
} }
.mx_FilteredDeviceList_deviceDetails { .mx_FilteredDeviceList_deviceDetails {
// align with text of session tile /* align with text of session tile */
margin-left: 88px; margin-left: 88px;
} }

View file

@ -33,8 +33,7 @@ limitations under the License.
width: 100%; width: 100%;
display: grid; display: grid;
grid-gap: $spacing-8; grid-gap: $spacing-8;
// setting minwidth 0 makes columns definitely sized /* setting minwidth 0 makes columns definitely sized fixing horizontal overflow */
// fixing horizontal overflow
grid-template-columns: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr);
justify-items: flex-start; justify-items: flex-start;
margin-top: $spacing-24; margin-top: $spacing-24;

View file

@ -38,7 +38,7 @@ limitations under the License.
flex: 1; flex: 1;
min-width: 40%; min-width: 40%;
resize: none; resize: none;
// `!important` is required to bypass global input styles. /* `!important` is required to bypass global input styles. */
margin: 0 !important; margin: 0 !important;
padding: $spacing-8 9px; padding: $spacing-8 9px;
border: none !important; border: none !important;

View file

@ -28,7 +28,9 @@ limitations under the License.
top: -1px; top: -1px;
z-index: 1; z-index: 1;
will-change: width; will-change: width;
transition: width 400ms easeinsine 1s, opacity 400ms easeinsine 1s; transition:
width 400ms easeinsine 1s,
opacity 400ms easeinsine 1s;
width: 99%; width: 99%;
opacity: 1; opacity: 1;
} }

View file

@ -266,7 +266,7 @@ limitations under the License.
flex-grow: 1; flex-grow: 1;
.mx_SpaceTreeLevel { .mx_SpaceTreeLevel {
// Indent subspaces /* Indent subspaces */
padding-left: 16px; padding-left: 16px;
} }
} }
@ -416,7 +416,6 @@ limitations under the License.
font-size: $font-10px; font-size: $font-10px;
line-height: $font-12px; line-height: $font-12px;
font-weight: var(--cpd-font-weight-semibold); font-weight: var(--cpd-font-weight-semibold);
//margin-left: 8px;
} }
} }

View file

@ -36,7 +36,8 @@ limitations under the License.
filter: blur(8px); filter: blur(8px);
inset: -9px; inset: -9px;
mask: mask:
/* mask to dither resulting combined gradient */ url("$(res)/img/noise.png"), /* mask to dither resulting combined gradient */
url("$(res)/img/noise.png"),
/* gradient to apply different amounts of dithering to different parts of the gradient */ /* gradient to apply different amounts of dithering to different parts of the gradient */
linear-gradient( linear-gradient(
to bottom, to bottom,

View file

@ -67,7 +67,7 @@ limitations under the License.
.mx_AuthBody_lockIcon { .mx_AuthBody_lockIcon {
color: $secondary-content; color: $secondary-content;
height: 32px; height: 32px;
margin-bottom: -3px; // tweak to align all icons on different forgot password steps margin-bottom: -3px; /* tweak to align all icons on different forgot password steps */
} }
.mx_AuthBody_text { .mx_AuthBody_text {
@ -211,9 +211,9 @@ limitations under the License.
} }
.mx_AuthBody_emailPromptIcon--shifted { .mx_AuthBody_emailPromptIcon--shifted {
margin-bottom: -17px; // Prevent layout jump by relative positioning. margin-bottom: -17px; /* Prevent layout jump by relative positioning. */
position: relative; position: relative;
top: -17px; // This icon is higher than the other icons. Shift up to prevent icon jumping. top: -17px; /* This icon is higher than the other icons. Shift up to prevent icon jumping. */
width: 57px; width: 57px;
} }

View file

@ -30,9 +30,9 @@ limitations under the License.
.mx_DecoratedRoomAvatar_icon { .mx_DecoratedRoomAvatar_icon {
position: absolute; position: absolute;
/* the following percentage based sizings are to match the scalable svg mask for the cutout */ /* the following percentage based sizings are to match the scalable svg mask for the cutout */
bottom: 6.25%; // 2px for a 32x32 avatar bottom: 6.25%; /* 2px for a 32x32 avatar */
right: 6.25%; right: 6.25%;
width: 25%; // 8px for a 32x32 avatar width: 25%; /* 8px for a 32x32 avatar */
height: 25%; height: 25%;
border-radius: 50%; border-radius: 50%;
} }

View file

@ -18,7 +18,7 @@ limitations under the License.
.mx_IconizedContextMenu { .mx_IconizedContextMenu {
min-width: 146px; min-width: 146px;
width: max-content; width: max-content;
// override default ul styles /* override default ul styles */
margin: 0; margin: 0;
padding: 0; padding: 0;

View file

@ -38,7 +38,9 @@ limitations under the License.
} }
.mx_AddExistingToSpace_section { .mx_AddExistingToSpace_section {
margin-right: 12px; // provides space for scrollbar so that checkbox and scrollbar do not collide margin-right: 12px;
// provides space for scrollbar so that checkbox and scrollbar do not collide
&:not(:first-child) { &:not(:first-child) {
margin-top: 24px; margin-top: 24px;

View file

@ -97,7 +97,9 @@ limitations under the License.
.mx_StyledRadioButton { .mx_StyledRadioButton {
display: inline-flex; display: inline-flex;
font-size: 20px; font-size: 20px;
transition: font-size 1s, border 0.5s; transition:
font-size 1s,
border 0.5s;
border-radius: 50%; border-radius: 50%;
border: 2px solid transparent; border: 2px solid transparent;
margin-top: 12px; margin-top: 12px;

View file

@ -58,7 +58,7 @@ limitations under the License.
.mx_Dropdown_option { .mx_Dropdown_option {
height: 35px; height: 35px;
line-height: $font-35px; line-height: $font-35px;
// Overwrites the default padding for any li elements /* Overwrites the default padding for any li elements */
padding: 0 8px; padding: 0 8px;
} }

View file

@ -95,7 +95,10 @@ limitations under the License.
} }
.mx_Field label { .mx_Field label {
transition: font-size 0.25s ease-out 0.1s, color 0.25s ease-out 0.1s, transform 0.25s ease-out 0.1s, transition:
font-size 0.25s ease-out 0.1s,
color 0.25s ease-out 0.1s,
transform 0.25s ease-out 0.1s,
background-color 0.25s ease-out 0.1s; background-color 0.25s ease-out 0.1s;
background-color: transparent; background-color: transparent;
font: var(--cpd-font-body-md-regular); font: var(--cpd-font-body-md-regular);
@ -117,7 +120,10 @@ limitations under the License.
.mx_Field input:not(:placeholder-shown) + label, .mx_Field input:not(:placeholder-shown) + label,
.mx_Field textarea:focus + label, .mx_Field textarea:focus + label,
.mx_Field textarea:not(:placeholder-shown) + label { .mx_Field textarea:not(:placeholder-shown) + label {
transition: font-size 0.25s ease-out 0s, color 0.25s ease-out 0s, transform 0.25s ease-out 0s, transition:
font-size 0.25s ease-out 0s,
color 0.25s ease-out 0s,
transform 0.25s ease-out 0s,
background-color 0.25s ease-out 0s; background-color 0.25s ease-out 0s;
font-size: $font-10px; font-size: $font-10px;
transform: translateY(-13px); transform: translateY(-13px);

View file

@ -32,7 +32,7 @@ limitations under the License.
} }
.mx_GenericEventListSummary_toggle { .mx_GenericEventListSummary_toggle {
// We reuse a title cased translation /* We reuse a title cased translation */
text-transform: lowercase; text-transform: lowercase;
} }

View file

@ -25,7 +25,9 @@ limitations under the License.
color: $primary-content; color: $primary-content;
position: absolute; position: absolute;
z-index: 5001; z-index: 5001;
box-shadow: 0 24px 8px rgb(17 17 26 / 4%), 0 8px 32px rgb(17 17 26 / 4%); box-shadow:
0 24px 8px rgb(17 17 26 / 4%),
0 8px 32px rgb(17 17 26 / 4%);
} }
.mx_InteractiveTooltip.mx_InteractiveTooltip_withChevron_top { .mx_InteractiveTooltip.mx_InteractiveTooltip_withChevron_top {

View file

@ -15,7 +15,7 @@ limitations under the License.
*/ */
.mx_ReplyChain { .mx_ReplyChain {
margin: 0; // Reset default blockquote margin margin: 0; /* Reset default blockquote margin */
padding-left: 10px; padding-left: 10px;
border-left: 2px solid var(--username-color); border-left: 2px solid var(--username-color);
border-radius: 2px; border-radius: 2px;

View file

@ -24,7 +24,7 @@ limitations under the License.
appearance: none; appearance: none;
width: 100%; width: 100%;
background: none; background: none;
font-size: 1em; // set base multiplier for em units applied later font-size: 1em; /* set base multiplier for em units applied later */
--active-color: $accent; --active-color: $accent;
--selection-dot-size: 2.4em; --selection-dot-size: 2.4em;
@ -114,7 +114,7 @@ limitations under the License.
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
font-size: 1em; // set base multiplier for em units applied later font-size: 1em; /* set base multiplier for em units applied later */
text-align: center; text-align: center;
top: 3em; top: 3em;

View file

@ -158,9 +158,9 @@ limitations under the License.
.mx_BaseCard_close { .mx_BaseCard_close {
flex-shrink: 0; flex-shrink: 0;
position: relative; position: relative;
// @TODO(kerrya) background colours here are not semantic /* @TODO(kerrya) background colours here are not semantic
// these buttons to be replaced with IconButton after secondary variant is added these buttons to be replaced with IconButton after secondary variant is added
// https://github.com/vector-im/compound/issues/279 https://github.com/vector-im/compound/issues/279 */
background-color: var(--cpd-color-bg-subtle-secondary); background-color: var(--cpd-color-bg-subtle-secondary);
width: var(--BaseCard_header-button-size); width: var(--BaseCard_header-button-size);
height: var(--BaseCard_header-button-size); height: var(--BaseCard_header-button-size);

View file

@ -133,7 +133,7 @@ limitations under the License.
line-height: $font-25px; line-height: $font-25px;
flex: 1; flex: 1;
justify-content: center; justify-content: center;
// We reverse things here so for accessible technologies the name comes before the e2e shield /* We reverse things here so for accessible technologies the name comes before the e2e shield */
flex-direction: row-reverse; flex-direction: row-reverse;
span { span {

View file

@ -355,12 +355,12 @@ limitations under the License.
.mx_EventTile_e2eIcon { .mx_EventTile_e2eIcon {
flex-shrink: 0; /* keep it at full size */ flex-shrink: 0; /* keep it at full size */
// Keep height equal to text for shield alignment, additional 2px because of 1px padding on text /* Keep height equal to text for shield alignment, additional 2px because of 1px padding on text */
height: calc($font-18px + 2px); height: calc($font-18px + 2px);
} }
.mx_MPollEndBody { .mx_MPollEndBody {
// Prevent the poll end body from exceeding the tile width /* Prevent the poll end body from exceeding the tile width */
width: 100%; width: 100%;
} }
} }

View file

@ -488,7 +488,7 @@ $left-gutter: 64px;
.mx_EventTile_e2eIcon { .mx_EventTile_e2eIcon {
inset: 0 0 0 44px; inset: 0 0 0 44px;
// Keep height equal to text for alignment /* Keep height equal to text for alignment */
height: var(--EventTile_group_line-line-height); height: var(--EventTile_group_line-line-height);
margin: 1px; margin: 1px;
} }
@ -701,11 +701,11 @@ $left-gutter: 64px;
background-color: $inlinecode-background-color; background-color: $inlinecode-background-color;
border: 1px solid $inlinecode-border-color; border: 1px solid $inlinecode-border-color;
border-radius: 4px; border-radius: 4px;
// The horizontal padding is added by gfm.css .markdown-body /* The horizontal padding is added by gfm.css .markdown-body */
padding: $spacing-2 0; padding: $spacing-2 0;
// Avoid inline code blocks to be sticked when on multiple lines /* Avoid inline code blocks to be sticked when on multiple lines */
line-height: $font-22px; line-height: $font-22px;
// Avoid the border to be glued to the other words /* Avoid the border to be glued to the other words */
margin-right: $spacing-2; margin-right: $spacing-2;
} }
@ -792,7 +792,7 @@ $left-gutter: 64px;
.mx_EventTile_spoiler { .mx_EventTile_spoiler {
cursor: pointer; cursor: pointer;
// clear button styles /* clear button styles */
appearance: none; appearance: none;
background: none; background: none;
border: none; border: none;
@ -852,17 +852,17 @@ $left-gutter: 64px;
} }
&.mx_EventTile_e2eIcon_warning::after { &.mx_EventTile_e2eIcon_warning::after {
mask-image: url("$(res)/img/e2e/warning.svg"); // (!) in a shield mask-image: url("$(res)/img/e2e/warning.svg"); /* (!) in a shield */
background-color: $e2e-warning-color; // red background-color: $e2e-warning-color; /* red */
} }
&.mx_EventTile_e2eIcon_normal::after { &.mx_EventTile_e2eIcon_normal::after {
mask-image: url("$(res)/img/e2e/normal.svg"); // regular shield mask-image: url("$(res)/img/e2e/normal.svg"); /* regular shield */
background-color: $header-panel-text-primary-color; // grey background-color: $header-panel-text-primary-color; /* grey */
} }
&.mx_EventTile_e2eIcon_decryption_failure::after { &.mx_EventTile_e2eIcon_decryption_failure::after {
mask-image: url("$(res)/img/e2e/decryption-failure.svg"); // key in a circle mask-image: url("$(res)/img/e2e/decryption-failure.svg"); /* key in a circle */
background-color: $secondary-content; background-color: $secondary-content;
} }
} }

View file

@ -55,7 +55,9 @@ limitations under the License.
width: 14px; width: 14px;
height: 14px; height: 14px;
will-change: left, top; will-change: left, top;
transition: left var(--transition-short) ease-out, top var(--transition-standard) ease-out; transition:
left var(--transition-short) ease-out,
top var(--transition-standard) ease-out;
} }
} }
} }
@ -109,7 +111,7 @@ limitations under the License.
margin: 6px 8px; margin: 6px 8px;
align-self: center; align-self: center;
justify-self: center; justify-self: center;
flex-shrink: 0; // Long names should not shrink the picture flex-shrink: 0; /* Long names should not shrink the picture */
} }
.mx_ReadReceiptGroup_name { .mx_ReadReceiptGroup_name {

View file

@ -37,7 +37,9 @@ limitations under the License.
color: $secondary-content; color: $secondary-content;
transition: color ease 0.15s; transition: color ease 0.15s;
gap: 2px; gap: 2px;
max-width: 100%; // avoid overflow with wide content max-width: 100%;
// avoid overflow with wide content
&:hover { &:hover {
color: $primary-content; color: $primary-content;
@ -112,7 +114,7 @@ limitations under the License.
grid-template: grid-template:
"sender message" auto "sender message" auto
/ max-content auto; / max-content auto;
gap: 4px; // increase spacing gap: 4px; /* increase spacing */
} }
.mx_ReplyTile_sender { .mx_ReplyTile_sender {
@ -124,18 +126,18 @@ limitations under the License.
.mx_DisambiguatedProfile { .mx_DisambiguatedProfile {
font: var(--cpd-font-body-md-regular); font: var(--cpd-font-body-md-regular);
display: inline-block; // anti-zalgo, with overflow hidden display: inline-block; /* anti-zalgo, with overflow hidden */
padding: 0; padding: 0;
margin: 0; margin: 0;
// truncate long display names /* truncate long display names */
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.mx_BaseAvatar { .mx_BaseAvatar {
line-height: 14px; // To match size line-height: 14px; /* To match size */
} }
} }
} }

View file

@ -28,7 +28,7 @@ limitations under the License.
} }
.mx_RoomHeader_infoWrapper { .mx_RoomHeader_infoWrapper {
// unset button styles /* unset button styles */
background: unset; background: unset;
border: unset; border: unset;
flex: 1; flex: 1;

View file

@ -46,8 +46,8 @@ limitations under the License.
p { p {
margin-top: 0; margin-top: 0;
margin-bottom: 0; margin-bottom: 0;
// this may seem redundant, but we need to handle zero content formatting tags, which occur when we split a /* this may seem redundant, but we need to handle zero content formatting tags, which occur when we split a
// formatting tag into paragraphs formatting tag into paragraphs */
min-height: $font-22px; min-height: $font-22px;
} }

View file

@ -61,11 +61,11 @@ limitations under the License.
font: var(--cpd-font-body-sm-semibold); font: var(--cpd-font-body-sm-semibold);
} }
.mx_UserNotifSettings_gridRowError { .mx_UserNotifSettings_gridRowError {
// occupy full row /* occupy full row */
grid-column: 1/-1; grid-column: 1/-1;
justify-self: start; justify-self: start;
padding-right: 30%; padding-right: 30%;
// collapse half of the grid-gap /* collapse half of the grid-gap */
margin-top: -$spacing-4; margin-top: -$spacing-4;
} }

View file

@ -16,7 +16,6 @@ limitations under the License.
.mx_Field.mx_AppearanceUserSettingsTab_checkboxControlledField { .mx_Field.mx_AppearanceUserSettingsTab_checkboxControlledField {
width: 256px; width: 256px;
// matches checkbox box + padding /* matches checkbox box + padding to align with checkbox label */
// to align with checkbox label
margin-inline-start: calc($font-16px + 10px); margin-inline-start: calc($font-16px + 10px);
} }

View file

@ -24,7 +24,7 @@ limitations under the License.
.mx_SidebarUserSettingsTab_checkbox { .mx_SidebarUserSettingsTab_checkbox {
margin-bottom: $spacing-8; margin-bottom: $spacing-8;
// override checkbox styles˚ /* override checkbox styles */
label { label {
align-items: flex-start !important; align-items: flex-start !important;
} }

View file

@ -16,7 +16,8 @@ $inter-unicode-range: U+0000-20e2, U+20e4-23ce, U+23d0-24c1, U+24c3-259f, U+25c2
font-weight: 400; font-weight: 400;
font-display: swap; font-display: swap;
unicode-range: $inter-unicode-range; unicode-range: $inter-unicode-range;
src: url("$(res)/fonts/Inter/Inter-Regular.woff2?v=3.18") format("woff2"), src:
url("$(res)/fonts/Inter/Inter-Regular.woff2?v=3.18") format("woff2"),
url("$(res)/fonts/Inter/Inter-Regular.woff?v=3.18") format("woff"); url("$(res)/fonts/Inter/Inter-Regular.woff?v=3.18") format("woff");
} }
@font-face { @font-face {
@ -25,7 +26,8 @@ $inter-unicode-range: U+0000-20e2, U+20e4-23ce, U+23d0-24c1, U+24c3-259f, U+25c2
font-weight: 400; font-weight: 400;
font-display: swap; font-display: swap;
unicode-range: $inter-unicode-range; unicode-range: $inter-unicode-range;
src: url("$(res)/fonts/Inter/Inter-Italic.woff2?v=3.18") format("woff2"), src:
url("$(res)/fonts/Inter/Inter-Italic.woff2?v=3.18") format("woff2"),
url("$(res)/fonts/Inter/Inter-Italic.woff?v=3.18") format("woff"); url("$(res)/fonts/Inter/Inter-Italic.woff?v=3.18") format("woff");
} }
@ -35,7 +37,8 @@ $inter-unicode-range: U+0000-20e2, U+20e4-23ce, U+23d0-24c1, U+24c3-259f, U+25c2
font-weight: 500; font-weight: 500;
font-display: swap; font-display: swap;
unicode-range: $inter-unicode-range; unicode-range: $inter-unicode-range;
src: url("$(res)/fonts/Inter/Inter-Medium.woff2?v=3.18") format("woff2"), src:
url("$(res)/fonts/Inter/Inter-Medium.woff2?v=3.18") format("woff2"),
url("$(res)/fonts/Inter/Inter-Medium.woff?v=3.18") format("woff"); url("$(res)/fonts/Inter/Inter-Medium.woff?v=3.18") format("woff");
} }
@font-face { @font-face {
@ -44,7 +47,8 @@ $inter-unicode-range: U+0000-20e2, U+20e4-23ce, U+23d0-24c1, U+24c3-259f, U+25c2
font-weight: 500; font-weight: 500;
font-display: swap; font-display: swap;
unicode-range: $inter-unicode-range; unicode-range: $inter-unicode-range;
src: url("$(res)/fonts/Inter/Inter-MediumItalic.woff2?v=3.18") format("woff2"), src:
url("$(res)/fonts/Inter/Inter-MediumItalic.woff2?v=3.18") format("woff2"),
url("$(res)/fonts/Inter/Inter-MediumItalic.woff?v=3.18") format("woff"); url("$(res)/fonts/Inter/Inter-MediumItalic.woff?v=3.18") format("woff");
} }
@ -54,7 +58,8 @@ $inter-unicode-range: U+0000-20e2, U+20e4-23ce, U+23d0-24c1, U+24c3-259f, U+25c2
font-weight: 600; font-weight: 600;
font-display: swap; font-display: swap;
unicode-range: $inter-unicode-range; unicode-range: $inter-unicode-range;
src: url("$(res)/fonts/Inter/Inter-SemiBold.woff2?v=3.18") format("woff2"), src:
url("$(res)/fonts/Inter/Inter-SemiBold.woff2?v=3.18") format("woff2"),
url("$(res)/fonts/Inter/Inter-SemiBold.woff?v=3.18") format("woff"); url("$(res)/fonts/Inter/Inter-SemiBold.woff?v=3.18") format("woff");
} }
@font-face { @font-face {
@ -63,7 +68,8 @@ $inter-unicode-range: U+0000-20e2, U+20e4-23ce, U+23d0-24c1, U+24c3-259f, U+25c2
font-weight: 600; font-weight: 600;
font-display: swap; font-display: swap;
unicode-range: $inter-unicode-range; unicode-range: $inter-unicode-range;
src: url("$(res)/fonts/Inter/Inter-SemiBoldItalic.woff2?v=3.18") format("woff2"), src:
url("$(res)/fonts/Inter/Inter-SemiBoldItalic.woff2?v=3.18") format("woff2"),
url("$(res)/fonts/Inter/Inter-SemiBoldItalic.woff?v=3.18") format("woff"); url("$(res)/fonts/Inter/Inter-SemiBoldItalic.woff?v=3.18") format("woff");
} }
@ -73,7 +79,8 @@ $inter-unicode-range: U+0000-20e2, U+20e4-23ce, U+23d0-24c1, U+24c3-259f, U+25c2
font-weight: 700; font-weight: 700;
font-display: swap; font-display: swap;
unicode-range: $inter-unicode-range; unicode-range: $inter-unicode-range;
src: url("$(res)/fonts/Inter/Inter-Bold.woff2?v=3.18") format("woff2"), src:
url("$(res)/fonts/Inter/Inter-Bold.woff2?v=3.18") format("woff2"),
url("$(res)/fonts/Inter/Inter-Bold.woff?v=3.18") format("woff"); url("$(res)/fonts/Inter/Inter-Bold.woff?v=3.18") format("woff");
} }
@font-face { @font-face {
@ -82,7 +89,8 @@ $inter-unicode-range: U+0000-20e2, U+20e4-23ce, U+23d0-24c1, U+24c3-259f, U+25c2
font-weight: 700; font-weight: 700;
font-display: swap; font-display: swap;
unicode-range: $inter-unicode-range; unicode-range: $inter-unicode-range;
src: url("$(res)/fonts/Inter/Inter-BoldItalic.woff2?v=3.18") format("woff2"), src:
url("$(res)/fonts/Inter/Inter-BoldItalic.woff2?v=3.18") format("woff2"),
url("$(res)/fonts/Inter/Inter-BoldItalic.woff?v=3.18") format("woff"); url("$(res)/fonts/Inter/Inter-BoldItalic.woff?v=3.18") format("woff");
} }
@ -91,7 +99,9 @@ $inter-unicode-range: U+0000-20e2, U+20e4-23ce, U+23d0-24c1, U+24c3-259f, U+25c2
font-family: "Inconsolata"; font-family: "Inconsolata";
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
src: local("Inconsolata Regular"), local("Inconsolata-Regular"), src:
local("Inconsolata Regular"),
local("Inconsolata-Regular"),
url("$(res)/fonts/Inconsolata/QldKNThLqRwH-OJ1UHjlKGlX5qhExfHwNJU.woff2") format("woff2"); url("$(res)/fonts/Inconsolata/QldKNThLqRwH-OJ1UHjlKGlX5qhExfHwNJU.woff2") format("woff2");
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
} }
@ -101,7 +111,9 @@ $inter-unicode-range: U+0000-20e2, U+20e4-23ce, U+23d0-24c1, U+24c3-259f, U+25c2
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
font-display: swap; font-display: swap;
src: local("Inconsolata Regular"), local("Inconsolata-Regular"), src:
local("Inconsolata Regular"),
local("Inconsolata-Regular"),
url("$(res)/fonts/Inconsolata/QldKNThLqRwH-OJ1UHjlKGlZ5qhExfHw.woff2") format("woff2"); url("$(res)/fonts/Inconsolata/QldKNThLqRwH-OJ1UHjlKGlZ5qhExfHw.woff2") format("woff2");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC,
U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
@ -112,7 +124,9 @@ $inter-unicode-range: U+0000-20e2, U+20e4-23ce, U+23d0-24c1, U+24c3-259f, U+25c2
font-style: normal; font-style: normal;
font-weight: 700; font-weight: 700;
font-display: swap; font-display: swap;
src: local("Inconsolata Bold"), local("Inconsolata-Bold"), src:
local("Inconsolata Bold"),
local("Inconsolata-Bold"),
url("$(res)/fonts/Inconsolata/QldXNThLqRwH-OJ1UHjlKGHiw71n5_zaDpwm80E.woff2") format("woff2"); url("$(res)/fonts/Inconsolata/QldXNThLqRwH-OJ1UHjlKGHiw71n5_zaDpwm80E.woff2") format("woff2");
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
} }
@ -122,7 +136,9 @@ $inter-unicode-range: U+0000-20e2, U+20e4-23ce, U+23d0-24c1, U+24c3-259f, U+25c2
font-style: normal; font-style: normal;
font-weight: 700; font-weight: 700;
font-display: swap; font-display: swap;
src: local("Inconsolata Bold"), local("Inconsolata-Bold"), src:
local("Inconsolata Bold"),
local("Inconsolata-Bold"),
url("$(res)/fonts/Inconsolata/QldXNThLqRwH-OJ1UHjlKGHiw71p5_zaDpwm.woff2") format("woff2"); url("$(res)/fonts/Inconsolata/QldXNThLqRwH-OJ1UHjlKGHiw71p5_zaDpwm.woff2") format("woff2");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC,
U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;

View file

@ -23,7 +23,10 @@ import { PosthogAnalytics } from "./PosthogAnalytics";
export class DecryptionFailure { export class DecryptionFailure {
public readonly ts: number; public readonly ts: number;
public constructor(public readonly failedEventId: string, public readonly errorCode: string) { public constructor(
public readonly failedEventId: string,
public readonly errorCode: string,
) {
this.ts = Date.now(); this.ts = Date.now();
} }
} }
@ -110,7 +113,10 @@ export class DecryptionFailureTracker {
* @param {function?} errorCodeMapFn The function used to map error codes to the * @param {function?} errorCodeMapFn The function used to map error codes to the
* trackedErrorCode. If not provided, the `.code` of errors will be used. * trackedErrorCode. If not provided, the `.code` of errors will be used.
*/ */
private constructor(private readonly fn: TrackingFn, private readonly errorCodeMapFn: ErrCodeMapFn) { private constructor(
private readonly fn: TrackingFn,
private readonly errorCodeMapFn: ErrCodeMapFn,
) {
if (!fn || typeof fn !== "function") { if (!fn || typeof fn !== "function") {
throw new Error("DecryptionFailureTracker requires tracking function"); throw new Error("DecryptionFailureTracker requires tracking function");
} }

View file

@ -327,7 +327,10 @@ const topicSanitizeHtmlParams: IExtendedSanitizeOptions = {
}; };
abstract class BaseHighlighter<T extends React.ReactNode> { abstract class BaseHighlighter<T extends React.ReactNode> {
public constructor(public highlightClass: string, public highlightLink?: string) {} public constructor(
public highlightClass: string,
public highlightLink?: string,
) {}
/** /**
* Apply the highlights to a section of text * Apply the highlights to a section of text

View file

@ -34,7 +34,10 @@ export default class ScalarAuthClient {
private termsInteractionCallback?: TermsInteractionCallback; private termsInteractionCallback?: TermsInteractionCallback;
private isDefaultManager: boolean; private isDefaultManager: boolean;
public constructor(private apiUrl: string, private uiUrl: string) { public constructor(
private apiUrl: string,
private uiUrl: string,
) {
this.scalarToken = null; this.scalarToken = null;
// `undefined` to allow `startTermsFlow` to fallback to a default // `undefined` to allow `startTermsFlow` to fallback to a default
// callback if this is unset. // callback if this is unset.

View file

@ -33,7 +33,11 @@ export class Service {
* @param {string} baseUrl The Base URL of the service (ie. before '/_matrix') * @param {string} baseUrl The Base URL of the service (ie. before '/_matrix')
* @param {string} accessToken The user's access token for the service * @param {string} accessToken The user's access token for the service
*/ */
public constructor(public serviceType: SERVICE_TYPES, public baseUrl: string, public accessToken: string) {} public constructor(
public serviceType: SERVICE_TYPES,
public baseUrl: string,
public accessToken: string,
) {}
} }
export interface LocalisedPolicy { export interface LocalisedPolicy {

View file

@ -45,7 +45,10 @@ export default class UserActivity {
private lastScreenX = 0; private lastScreenX = 0;
private lastScreenY = 0; private lastScreenY = 0;
public constructor(private readonly window: Window, private readonly document: Document) { public constructor(
private readonly window: Window,
private readonly document: Document,
) {
this.activeNowTimeout = new Timer(CURRENTLY_ACTIVE_THRESHOLD_MS); this.activeNowTimeout = new Timer(CURRENTLY_ACTIVE_THRESHOLD_MS);
this.activeRecentlyTimeout = new Timer(RECENTLY_ACTIVE_THRESHOLD_MS); this.activeRecentlyTimeout = new Timer(RECENTLY_ACTIVE_THRESHOLD_MS);
} }

View file

@ -22,7 +22,11 @@ import { DEFAULT_WAVEFORM } from "./consts";
* A managed playback is a Playback instance that is guided by a PlaybackManager. * A managed playback is a Playback instance that is guided by a PlaybackManager.
*/ */
export class ManagedPlayback extends Playback { export class ManagedPlayback extends Playback {
public constructor(private manager: PlaybackManager, buf: ArrayBuffer, seedWaveform = DEFAULT_WAVEFORM) { public constructor(
private manager: PlaybackManager,
buf: ArrayBuffer,
seedWaveform = DEFAULT_WAVEFORM,
) {
super(buf, seedWaveform); super(buf, seedWaveform);
} }

View file

@ -72,7 +72,10 @@ export class Playback extends EventEmitter implements IDestroyable, PlaybackInte
* @param {number[]} seedWaveform Optional seed waveform to present until the proper waveform * @param {number[]} seedWaveform Optional seed waveform to present until the proper waveform
* can be calculated. Contains values between zero and one, inclusive. * can be calculated. Contains values between zero and one, inclusive.
*/ */
public constructor(private buf: ArrayBuffer, seedWaveform = DEFAULT_WAVEFORM) { public constructor(
private buf: ArrayBuffer,
seedWaveform = DEFAULT_WAVEFORM,
) {
super(); super();
// Capture the file size early as reading the buffer will result in a 0-length buffer left behind // Capture the file size early as reading the buffer will result in a 0-length buffer left behind
this.fileSize = this.buf.byteLength; this.fileSize = this.buf.byteLength;

View file

@ -37,7 +37,10 @@ export class VoiceMessageRecording implements IDestroyable {
private buffer = new Uint8Array(0); // use this.audioBuffer to access private buffer = new Uint8Array(0); // use this.audioBuffer to access
private playback?: Playback; private playback?: Playback;
public constructor(private matrixClient: MatrixClient, private voiceRecording: VoiceRecording) { public constructor(
private matrixClient: MatrixClient,
private voiceRecording: VoiceRecording,
) {
this.voiceRecording.onDataAvailable = this.onDataAvailable; this.voiceRecording.onDataAvailable = this.onDataAvailable;
} }

View file

@ -28,7 +28,10 @@ import { TimelineRenderingType } from "../contexts/RoomContext";
const AT_ROOM_REGEX = /@\S*/g; const AT_ROOM_REGEX = /@\S*/g;
export default class NotifProvider extends AutocompleteProvider { export default class NotifProvider extends AutocompleteProvider {
public constructor(public room: Room, renderingType?: TimelineRenderingType) { public constructor(
public room: Room,
renderingType?: TimelineRenderingType,
) {
super({ commandRegex: AT_ROOM_REGEX, renderingType }); super({ commandRegex: AT_ROOM_REGEX, renderingType });
} }

View file

@ -57,7 +57,10 @@ function matcherObject(
export default class RoomProvider extends AutocompleteProvider { export default class RoomProvider extends AutocompleteProvider {
protected matcher: QueryMatcher<ReturnType<typeof matcherObject>>; protected matcher: QueryMatcher<ReturnType<typeof matcherObject>>;
public constructor(private readonly room: Room, renderingType?: TimelineRenderingType) { public constructor(
private readonly room: Room,
renderingType?: TimelineRenderingType,
) {
super({ commandRegex: ROOM_REGEX, renderingType }); super({ commandRegex: ROOM_REGEX, renderingType });
this.matcher = new QueryMatcher<ReturnType<typeof matcherObject>>([], { this.matcher = new QueryMatcher<ReturnType<typeof matcherObject>>([], {
keys: ["displayedAlias", "matchName"], keys: ["displayedAlias", "matchName"],

View file

@ -204,7 +204,8 @@ const ThreadPanel: React.FC<IProps> = ({ roomId, onClose, permalinkCreator }) =>
useEffect(() => { useEffect(() => {
const room = mxClient.getRoom(roomId); const room = mxClient.getRoom(roomId);
room?.createThreadsTimelineSets() room
?.createThreadsTimelineSets()
.then(() => room.fetchRoomThreads()) .then(() => room.fetchRoomThreads())
.then(() => { .then(() => {
setFilterOption(ThreadFilterType.All); setFilterOption(ThreadFilterType.All);

View file

@ -362,8 +362,7 @@ export const AddExistingToSpace: React.FC<IAddExistingToSpaceProps> = ({
const defaultRendererFactory = const defaultRendererFactory =
(title: TranslationKey): Renderer => (title: TranslationKey): Renderer =>
(rooms, selectedToAdd, { scrollTop, height }, onChange) => (rooms, selectedToAdd, { scrollTop, height }, onChange) => (
(
<div className="mx_AddExistingToSpace_section"> <div className="mx_AddExistingToSpace_section">
<h3>{_t(title)}</h3> <h3>{_t(title)}</h3>
<LazyRenderList <LazyRenderList

View file

@ -252,12 +252,15 @@ const findVisibleRoomMembers = (visibleRooms: Room[], cli: MatrixClient, filterD
return Object.values( return Object.values(
visibleRooms visibleRooms
.filter((room) => !filterDMs || !DMRoomMap.shared().getUserIdForRoomId(room.roomId)) .filter((room) => !filterDMs || !DMRoomMap.shared().getUserIdForRoomId(room.roomId))
.reduce((members, room) => { .reduce(
(members, room) => {
for (const member of room.getJoinedMembers()) { for (const member of room.getJoinedMembers()) {
members[member.userId] = member; members[member.userId] = member;
} }
return members; return members;
}, {} as Record<string, RoomMember>), },
{} as Record<string, RoomMember>,
),
).filter((it) => it.userId !== cli.getUserId()); ).filter((it) => it.userId !== cli.getUserId());
}; };

View file

@ -17,7 +17,11 @@ limitations under the License.
import React from "react"; import React from "react";
class ItemRange { class ItemRange {
public constructor(public topCount: number, public renderCount: number, public bottomCount: number) {} public constructor(
public topCount: number,
public renderCount: number,
public bottomCount: number,
) {}
public contains(range: ItemRange): boolean { public contains(range: ItemRange): boolean {
// don't contain empty ranges // don't contain empty ranges

View file

@ -61,7 +61,8 @@ export default class SpellCheckLanguagesDropdown extends React.Component<
const plaf = PlatformPeg.get(); const plaf = PlatformPeg.get();
if (plaf) { if (plaf) {
const languageNames = new Intl.DisplayNames([getUserLanguage()], { type: "language", style: "short" }); const languageNames = new Intl.DisplayNames([getUserLanguage()], { type: "language", style: "short" });
plaf.getAvailableSpellCheckLanguages() plaf
.getAvailableSpellCheckLanguages()
?.then((languages) => { ?.then((languages) => {
languages.sort(function (a, b) { languages.sort(function (a, b) {
if (a < b) return -1; if (a < b) return -1;

View file

@ -366,7 +366,11 @@ export default class MPollBody extends React.Component<IBodyProps, IState> {
} }
} }
export class UserVote { export class UserVote {
public constructor(public readonly ts: number, public readonly sender: string, public readonly answers: string[]) {} public constructor(
public readonly ts: number,
public readonly sender: string,
public readonly answers: string[],
) {}
} }
function userResponseFromPollResponseEvent(event: MatrixEvent): UserVote { function userResponseFromPollResponseEvent(event: MatrixEvent): UserVote {

View file

@ -101,9 +101,8 @@ export default class CrossSigningPanel extends React.PureComponent<{}, IState> {
const masterPrivateKeyCached = crossSigningStatus.privateKeysCachedLocally.masterKey; const masterPrivateKeyCached = crossSigningStatus.privateKeysCachedLocally.masterKey;
const selfSigningPrivateKeyCached = crossSigningStatus.privateKeysCachedLocally.selfSigningKey; const selfSigningPrivateKeyCached = crossSigningStatus.privateKeysCachedLocally.selfSigningKey;
const userSigningPrivateKeyCached = crossSigningStatus.privateKeysCachedLocally.userSigningKey; const userSigningPrivateKeyCached = crossSigningStatus.privateKeysCachedLocally.userSigningKey;
const homeserverSupportsCrossSigning = await cli.doesServerSupportUnstableFeature( const homeserverSupportsCrossSigning =
"org.matrix.e2e_cross_signing", await cli.doesServerSupportUnstableFeature("org.matrix.e2e_cross_signing");
);
const crossSigningReady = await crypto.isCrossSigningReady(); const crossSigningReady = await crypto.isCrossSigningReady();
this.setState({ this.setState({

View file

@ -194,7 +194,8 @@ const SessionManagerTab: React.FC = () => {
setFilter(filter); setFilter(filter);
clearTimeout(scrollIntoViewTimeoutRef.current); clearTimeout(scrollIntoViewTimeoutRef.current);
// wait a tick for the filtered section to rerender with different height // wait a tick for the filtered section to rerender with different height
scrollIntoViewTimeoutRef.current = window.setTimeout(() => scrollIntoViewTimeoutRef.current = window.setTimeout(
() =>
filteredDeviceListRef.current?.scrollIntoView({ filteredDeviceListRef.current?.scrollIntoView({
// align element to top of scrollbox // align element to top of scrollbox
block: "start", block: "start",

View file

@ -36,7 +36,10 @@ export class Media {
private client: MatrixClient; private client: MatrixClient;
// Per above, this constructor signature can be whatever is helpful for you. // Per above, this constructor signature can be whatever is helpful for you.
public constructor(private prepared: IPreparedMedia, client?: MatrixClient) { public constructor(
private prepared: IPreparedMedia,
client?: MatrixClient,
) {
this.client = client ?? MatrixClientPeg.safeGet(); this.client = client ?? MatrixClientPeg.safeGet();
if (!this.client) { if (!this.client) {
throw new Error("No possible MatrixClient for media resolution. Please provide one or log in."); throw new Error("No possible MatrixClient for media resolution. Please provide one or log in.");

View file

@ -57,7 +57,11 @@ export default class EditorModel {
private autoCompletePartCount = 0; private autoCompletePartCount = 0;
private transformCallback: TransformCallback | null = null; private transformCallback: TransformCallback | null = null;
public constructor(parts: Part[], partCreator: PartCreator, private updateCallback: UpdateCallback | null = null) { public constructor(
parts: Part[],
partCreator: PartCreator,
private updateCallback: UpdateCallback | null = null,
) {
this._parts = parts; this._parts = parts;
this._partCreator = partCreator; this._partCreator = partCreator;
this.transformCallback = null; this.transformCallback = null;

View file

@ -18,7 +18,10 @@ import EditorModel from "./model";
import DocumentPosition from "./position"; import DocumentPosition from "./position";
export default class DocumentOffset { export default class DocumentOffset {
public constructor(public offset: number, public readonly atNodeEnd: boolean) {} public constructor(
public offset: number,
public readonly atNodeEnd: boolean,
) {}
public asPosition(model: EditorModel): DocumentPosition { public asPosition(model: EditorModel): DocumentPosition {
return model.positionForOffset(this.offset, this.atNodeEnd); return model.positionForOffset(this.offset, this.atNodeEnd);

View file

@ -254,7 +254,10 @@ export class PlainPart extends PlainBasePart implements IBasePart {
} }
export abstract class PillPart extends BasePart implements IPillPart { export abstract class PillPart extends BasePart implements IPillPart {
public constructor(public resourceId: string, label: string) { public constructor(
public resourceId: string,
label: string,
) {
super(label); super(label);
} }
@ -414,7 +417,11 @@ export class EmojiPart extends BasePart implements IBasePart {
} }
class RoomPillPart extends PillPart { class RoomPillPart extends PillPart {
public constructor(resourceId: string, label: string, private room?: Room) { public constructor(
resourceId: string,
label: string,
private room?: Room,
) {
super(resourceId, label); super(resourceId, label);
} }
@ -455,7 +462,11 @@ class AtRoomPillPart extends RoomPillPart {
} }
class UserPillPart extends PillPart { class UserPillPart extends PillPart {
public constructor(userId: string, displayName: string, private member?: RoomMember) { public constructor(
userId: string,
displayName: string,
private member?: RoomMember,
) {
super(userId, displayName); super(userId, displayName);
} }
@ -490,7 +501,10 @@ class UserPillPart extends PillPart {
} }
class PillCandidatePart extends PlainBasePart implements IPillCandidatePart { class PillCandidatePart extends PlainBasePart implements IPillCandidatePart {
public constructor(text: string, private autoCompleteCreator: IAutocompleteCreator) { public constructor(
text: string,
private autoCompleteCreator: IAutocompleteCreator,
) {
super(text); super(text);
} }

View file

@ -27,7 +27,10 @@ type Callback = (part: Part, startIdx: number, endIdx: number) => void;
export type Predicate = (index: number, offset: number, part: Part) => boolean; export type Predicate = (index: number, offset: number, part: Part) => boolean;
export default class DocumentPosition implements IPosition { export default class DocumentPosition implements IPosition {
public constructor(public readonly index: number, public readonly offset: number) {} public constructor(
public readonly index: number,
public readonly offset: number,
) {}
public compare(otherPos: DocumentPosition): number { public compare(otherPos: DocumentPosition): number {
if (this.index === otherPos.index) { if (this.index === otherPos.index) {

View file

@ -28,7 +28,11 @@ export default class Range {
private _lastStart: DocumentPosition; private _lastStart: DocumentPosition;
private _initializedEmpty: boolean; private _initializedEmpty: boolean;
public constructor(public readonly model: EditorModel, positionA: DocumentPosition, positionB = positionA) { public constructor(
public readonly model: EditorModel,
positionA: DocumentPosition,
positionB = positionA,
) {
const bIsLarger = positionA.compare(positionB) < 0; const bIsLarger = positionA.compare(positionB) < 0;
this._start = bIsLarger ? positionA : positionB; this._start = bIsLarger ? positionA : positionB;
this._end = bIsLarger ? positionB : positionA; this._end = bIsLarger ? positionB : positionA;

View file

@ -570,10 +570,13 @@ export class JitsiCall extends Call {
// Tell others that we're connected, by adding our device to room state // Tell others that we're connected, by adding our device to room state
await this.addOurDevice(); await this.addOurDevice();
// Re-add this device every so often so our video member event doesn't become stale // Re-add this device every so often so our video member event doesn't become stale
this.resendDevicesTimer = window.setInterval(async (): Promise<void> => { this.resendDevicesTimer = window.setInterval(
async (): Promise<void> => {
logger.log(`Resending video member event for ${this.roomId}`); logger.log(`Resending video member event for ${this.roomId}`);
await this.addOurDevice(); await this.addOurDevice();
}, (this.STUCK_DEVICE_TIMEOUT_MS * 3) / 4); },
(this.STUCK_DEVICE_TIMEOUT_MS * 3) / 4,
);
} else if (state === ConnectionState.Disconnected && isConnected(prevState)) { } else if (state === ConnectionState.Disconnected && isConnected(prevState)) {
this.updateParticipants(); // Local echo this.updateParticipants(); // Local echo
@ -717,7 +720,11 @@ export class ElementCall extends Call {
this.widget.url = ElementCall.generateWidgetUrl(this.client, this.roomId).toString(); this.widget.url = ElementCall.generateWidgetUrl(this.client, this.roomId).toString();
} }
private constructor(public session: MatrixRTCSession, widget: IApp, client: MatrixClient) { private constructor(
public session: MatrixRTCSession,
widget: IApp,
client: MatrixClient,
) {
super(widget, client); super(widget, client);
this.session.on(MatrixRTCSessionEvent.MembershipsChanged, this.onMembershipChanged); this.session.on(MatrixRTCSessionEvent.MembershipsChanged, this.onMembershipChanged);

View file

@ -138,7 +138,10 @@ export class IndexedDBLogStore {
private flushPromise: Promise<void> | null = null; private flushPromise: Promise<void> | null = null;
private flushAgainPromise: Promise<void> | null = null; private flushAgainPromise: Promise<void> | null = null;
public constructor(private indexedDB: IDBFactory, private logger: ConsoleLogger) { public constructor(
private indexedDB: IDBFactory,
private logger: ConsoleLogger,
) {
this.id = "instance-" + randomString(16); this.id = "instance-" + randomString(16);
} }

View file

@ -22,7 +22,10 @@ import SettingController from "./SettingController";
* When the value changes, call a setter function on the matrix client with the new value * When the value changes, call a setter function on the matrix client with the new value
*/ */
export default class PushToMatrixClientController extends SettingController { export default class PushToMatrixClientController extends SettingController {
public constructor(private setter: Function, private inverse: boolean) { public constructor(
private setter: Function,
private inverse: boolean,
) {
super(); super();
} }

View file

@ -26,7 +26,10 @@ import SettingsStore from "../SettingsStore";
* Settings using this controller are assumed to return `false` when disabled. * Settings using this controller are assumed to return `false` when disabled.
*/ */
export default class UIFeatureController extends SettingController { export default class UIFeatureController extends SettingController {
public constructor(private uiFeatureName: string, private forcedValue = false) { public constructor(
private uiFeatureName: string,
private forcedValue = false,
) {
super(); super();
} }

View file

@ -27,7 +27,10 @@ export default class DefaultSettingsHandler extends SettingsHandler {
* @param {object} defaults The default setting values, keyed by setting name. * @param {object} defaults The default setting values, keyed by setting name.
* @param {object} invertedDefaults The default inverted setting values, keyed by setting name. * @param {object} invertedDefaults The default inverted setting values, keyed by setting name.
*/ */
public constructor(private defaults: Record<string, any>, private invertedDefaults: Record<string, any>) { public constructor(
private defaults: Record<string, any>,
private invertedDefaults: Record<string, any>,
) {
super(); super();
} }

View file

@ -31,7 +31,10 @@ export default class DeviceSettingsHandler extends AbstractLocalStorageSettingsH
* @param {string[]} featureNames The names of known features. * @param {string[]} featureNames The names of known features.
* @param {WatchManager} watchers The watch manager to notify updates to * @param {WatchManager} watchers The watch manager to notify updates to
*/ */
public constructor(private featureNames: string[], public readonly watchers: WatchManager) { public constructor(
private featureNames: string[],
public readonly watchers: WatchManager,
) {
super(); super();
} }

View file

@ -35,7 +35,10 @@ export default class LocalEchoWrapper extends SettingsHandler {
* @param {SettingsHandler} handler The handler to wrap * @param {SettingsHandler} handler The handler to wrap
* @param {SettingLevel} level The level to notify updates at * @param {SettingLevel} level The level to notify updates at
*/ */
public constructor(private readonly handler: SettingsHandler, private readonly level: SettingLevel) { public constructor(
private readonly handler: SettingsHandler,
private readonly level: SettingLevel,
) {
super(); super();
} }

View file

@ -52,7 +52,10 @@ export abstract class AsyncStore<T extends Object> extends EventEmitter {
* @param {Dispatcher<ActionPayload>} dispatcher The dispatcher to rely upon. * @param {Dispatcher<ActionPayload>} dispatcher The dispatcher to rely upon.
* @param {T} initialState The initial state for the store. * @param {T} initialState The initial state for the store.
*/ */
protected constructor(private dispatcher: MatrixDispatcher, initialState: T = <T>{}) { protected constructor(
private dispatcher: MatrixDispatcher,
initialState: T = <T>{},
) {
super(); super();
this.dispatcherRef = dispatcher.register(this.onDispatch.bind(this)); this.dispatcherRef = dispatcher.register(this.onDispatch.bind(this));

View file

@ -160,7 +160,10 @@ export class RoomViewStore extends EventEmitter {
private dis?: MatrixDispatcher; private dis?: MatrixDispatcher;
private dispatchToken?: string; private dispatchToken?: string;
public constructor(dis: MatrixDispatcher, private readonly stores: SdkContextClass) { public constructor(
dis: MatrixDispatcher,
private readonly stores: SdkContextClass,
) {
super(); super();
this.resetDispatcher(dis); this.resetDispatcher(dis);
this.stores.voiceBroadcastRecordingsStore.addListener( this.stores.voiceBroadcastRecordingsStore.addListener(

View file

@ -30,7 +30,10 @@ export class EchoTransaction extends Whenable<TransactionStatus> {
public readonly startTime = new Date(); public readonly startTime = new Date();
public constructor(public readonly auditName: string, public runFn: RunFn) { public constructor(
public readonly auditName: string,
public runFn: RunFn,
) {
super(); super();
} }

View file

@ -30,7 +30,10 @@ export abstract class GenericEchoChamber<C extends EchoContext, K, V> extends Ev
private cache = new Map<K, { txn: EchoTransaction; val: V }>(); private cache = new Map<K, { txn: EchoTransaction; val: V }>();
protected matrixClient: MatrixClient | null = null; protected matrixClient: MatrixClient | null = null;
protected constructor(public readonly context: C, private lookupFn: (key: K) => V) { protected constructor(
public readonly context: C,
private lookupFn: (key: K) => V,
) {
super(); super();
} }

View file

@ -27,7 +27,10 @@ export class ListNotificationState extends NotificationState {
private rooms: Room[] = []; private rooms: Room[] = [];
private states: { [roomId: string]: RoomNotificationState } = {}; private states: { [roomId: string]: RoomNotificationState } = {};
public constructor(private byTileCount = false, private getRoomFn: FetchRoomFn) { public constructor(
private byTileCount = false,
private getRoomFn: FetchRoomFn,
) {
super(); super();
} }

View file

@ -80,7 +80,10 @@ export class SlidingRoomListStoreClass extends AsyncStoreWithClient<IState> impl
private counts: Record<TagID, number> = {}; private counts: Record<TagID, number> = {};
private stickyRoomId: Optional<string>; private stickyRoomId: Optional<string>;
public constructor(dis: MatrixDispatcher, private readonly context: SdkContextClass) { public constructor(
dis: MatrixDispatcher,
private readonly context: SdkContextClass,
) {
super(dis); super(dis);
this.setMaxListeners(20); // RoomList + LeftPanel + 8xRoomSubList + spares this.setMaxListeners(20); // RoomList + LeftPanel + 8xRoomSubList + spares
} }

View file

@ -30,7 +30,10 @@ export abstract class OrderingAlgorithm {
// set by setSortAlgorithm() in ctor // set by setSortAlgorithm() in ctor
protected sortingAlgorithm!: SortAlgorithm; protected sortingAlgorithm!: SortAlgorithm;
protected constructor(protected tagId: TagID, initialSortingAlgorithm: SortAlgorithm) { protected constructor(
protected tagId: TagID,
initialSortingAlgorithm: SortAlgorithm,
) {
// noinspection JSIgnoredPromiseFromCall // noinspection JSIgnoredPromiseFromCall
this.setSortAlgorithm(initialSortingAlgorithm); // we use the setter for validation this.setSortAlgorithm(initialSortingAlgorithm); // we use the setter for validation
} }

View file

@ -202,7 +202,8 @@ export default class DMRoomMap {
public getUniqueRoomsWithIndividuals(): { [userId: string]: Room } { public getUniqueRoomsWithIndividuals(): { [userId: string]: Room } {
if (!this.roomToUser) return {}; // No rooms means no map. if (!this.roomToUser) return {}; // No rooms means no map.
// map roomToUser to valid rooms with two participants // map roomToUser to valid rooms with two participants
return Object.keys(this.roomToUser).reduce((acc, roomId: string) => { return Object.keys(this.roomToUser).reduce(
(acc, roomId: string) => {
const userId = this.getUserIdForRoomId(roomId); const userId = this.getUserIdForRoomId(roomId);
const room = this.matrixClient.getRoom(roomId); const room = this.matrixClient.getRoom(roomId);
const hasTwoMembers = room?.getInvitedAndJoinedMemberCount() === 2; const hasTwoMembers = room?.getInvitedAndJoinedMemberCount() === 2;
@ -210,7 +211,9 @@ export default class DMRoomMap {
acc[userId] = room; acc[userId] = room;
} }
return acc; return acc;
}, {} as Record<string, Room>); },
{} as Record<string, Room>,
);
} }
/** /**

View file

@ -28,7 +28,10 @@ export class FixedRollingArray<T> {
* @param width The width of the array. * @param width The width of the array.
* @param padValue The value to seed the array with. * @param padValue The value to seed the array with.
*/ */
public constructor(private width: number, padValue: T) { public constructor(
private width: number,
padValue: T,
) {
this.samples = arraySeed(padValue, this.width); this.samples = arraySeed(padValue, this.width);
} }

View file

@ -30,7 +30,10 @@ export class MarkedExecution {
* @param {Function} onMarkCallback A function that is called when a new mark is made. Not * @param {Function} onMarkCallback A function that is called when a new mark is made. Not
* called if a mark is already flagged. * called if a mark is already flagged.
*/ */
public constructor(private fn: () => void, private onMarkCallback?: () => void) {} public constructor(
private fn: () => void,
private onMarkCallback?: () => void,
) {}
/** /**
* Resets the mark without calling the function. * Resets the mark without calling the function.

View file

@ -76,8 +76,8 @@ export async function upgradeRoom(
if (updateSpaces) { if (updateSpaces) {
parentsToRelink = Array.from(SpaceStore.instance.getKnownParents(room.roomId)) parentsToRelink = Array.from(SpaceStore.instance.getKnownParents(room.roomId))
.map((roomId) => cli.getRoom(roomId)) .map((roomId) => cli.getRoom(roomId))
.filter((parent) => .filter(
parent?.currentState.maySendStateEvent(EventType.SpaceChild, cli.getUserId()!), (parent) => parent?.currentState.maySendStateEvent(EventType.SpaceChild, cli.getUserId()!),
) as Room[]; ) as Room[];
} }

View file

@ -79,7 +79,10 @@ export class Singleflight {
} }
class SingleflightContext { class SingleflightContext {
public constructor(private instance: Object, private key: string) {} public constructor(
private instance: Object,
private key: string,
) {}
/** /**
* Forget this particular instance and key combination, discarding the result. * Forget this particular instance and key combination, discarding the result.

View file

@ -32,8 +32,19 @@ limitations under the License.
bottom: 30px; bottom: 30px;
font-size: 17px; font-size: 17px;
padding: 6px 16px; padding: 6px 16px;
font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, font-family:
roboto, noto, arial, sans-serif; -apple-system,
BlinkMacSystemFont,
avenir next,
avenir,
segoe ui,
helvetica neue,
helvetica,
Ubuntu,
roboto,
noto,
arial,
sans-serif;
font-weight: 400; font-weight: 400;
line-height: 1.43; line-height: 1.43;
border-radius: 4px; border-radius: 4px;
@ -42,8 +53,12 @@ limitations under the License.
#snackbar.mx_show { #snackbar.mx_show {
visibility: visible; visibility: visible;
-webkit-animation: mx_snackbar_fadein 0.5s, mx_snackbar_fadeout 0.5s 2.5s; -webkit-animation:
animation: mx_snackbar_fadein 0.5s, mx_snackbar_fadeout 0.5s 2.5s; mx_snackbar_fadein 0.5s,
mx_snackbar_fadeout 0.5s 2.5s;
animation:
mx_snackbar_fadein 0.5s,
mx_snackbar_fadeout 0.5s 2.5s;
} }
a.mx_reply_anchor { a.mx_reply_anchor {

View file

@ -93,7 +93,11 @@ export class RoomPermalinkCreator {
// Some of the tests done by this class are relatively expensive, so normally // Some of the tests done by this class are relatively expensive, so normally
// throttled to not happen on every update. Pass false as the shouldThrottle // throttled to not happen on every update. Pass false as the shouldThrottle
// param to disable this behaviour, eg. for tests. // param to disable this behaviour, eg. for tests.
public constructor(private room: Room | null, roomId: string | null = null, shouldThrottle = true) { public constructor(
private room: Room | null,
roomId: string | null = null,
shouldThrottle = true,
) {
this.roomId = room ? room.roomId : roomId!; this.roomId = room ? room.roomId : roomId!;
if (!this.roomId) { if (!this.roomId) {

View file

@ -63,7 +63,10 @@ export class VoiceBroadcastRecorder
// current chunk length in seconds // current chunk length in seconds
private currentChunkLength = 0; private currentChunkLength = 0;
public constructor(private voiceRecording: VoiceRecording, public readonly targetChunkLength: number) { public constructor(
private voiceRecording: VoiceRecording,
public readonly targetChunkLength: number,
) {
super(); super();
this.voiceRecording.onDataAvailable = this.onDataAvailable; this.voiceRecording.onDataAvailable = this.onDataAvailable;
} }

View file

@ -22,7 +22,10 @@ export class WidgetType {
public static readonly CUSTOM = new WidgetType("m.custom", "m.custom"); public static readonly CUSTOM = new WidgetType("m.custom", "m.custom");
public static readonly CALL = new WidgetType("m.call", "m.call"); public static readonly CALL = new WidgetType("m.call", "m.call");
public constructor(public readonly preferred: string, public readonly legacy: string) {} public constructor(
public readonly preferred: string,
public readonly legacy: string,
) {}
public matches(type: string): boolean { public matches(type: string): boolean {
return type === this.preferred || type === this.legacy; return type === this.preferred || type === this.legacy;

View file

@ -39,7 +39,7 @@ const getFakePosthog = (): PostHog =>
get_user_state: jest.fn(), get_user_state: jest.fn(),
}, },
identifyUser: jest.fn(), identifyUser: jest.fn(),
} as unknown as PostHog); }) as unknown as PostHog;
interface ITestEvent extends IPosthogEvent { interface ITestEvent extends IPosthogEvent {
eventName: "JestTestEvents"; eventName: "JestTestEvents";
@ -288,7 +288,7 @@ describe("PosthogAnalytics", () => {
id: "0000000", id: "0000000",
pseudonymousAnalyticsOptIn: true, pseudonymousAnalyticsOptIn: true,
}), }),
} as unknown as MatrixClient); }) as unknown as MatrixClient;
beforeEach(async () => { beforeEach(async () => {
SdkConfig.put({ SdkConfig.put({

View file

@ -43,7 +43,7 @@ describe("AutocompleteInput", () => {
const constructMockProvider = (data: ICompletion[]) => const constructMockProvider = (data: ICompletion[]) =>
({ ({
getCompletions: jest.fn().mockImplementation(async () => data), getCompletions: jest.fn().mockImplementation(async () => data),
} as unknown as AutocompleteProvider); }) as unknown as AutocompleteProvider;
beforeEach(() => { beforeEach(() => {
TestUtils.stubClient(); TestUtils.stubClient();

View file

@ -31,7 +31,7 @@ describe("<ContextMenu />", () => {
({ ({
windowWidth: windowSize, windowWidth: windowSize,
windowHeight: windowSize, windowHeight: windowSize,
} as unknown as UIStore), }) as unknown as UIStore,
); );
window.Element.prototype.getBoundingClientRect = jest.fn().mockReturnValue({ window.Element.prototype.getBoundingClientRect = jest.fn().mockReturnValue({
width: menuSize, width: menuSize,

View file

@ -480,7 +480,7 @@ describe("MessageContextMenu", () => {
it("shows view in room button when the event is a thread root", () => { it("shows view in room button when the event is a thread root", () => {
const eventContent = createMessageEventContent("hello"); const eventContent = createMessageEventContent("hello");
const mxEvent = new MatrixEvent({ type: EventType.RoomMessage, content: eventContent }); const mxEvent = new MatrixEvent({ type: EventType.RoomMessage, content: eventContent });
mxEvent.getThread = () => ({ rootEvent: mxEvent } as Thread); mxEvent.getThread = () => ({ rootEvent: mxEvent }) as Thread;
const props = { const props = {
rightClick: true, rightClick: true,
}; };

View file

@ -69,7 +69,7 @@ describe("<SpaceContextMenu />", () => {
client: mockClient, client: mockClient,
getMyMembership: jest.fn(), getMyMembership: jest.fn(),
...props, ...props,
} as unknown as Room); }) as unknown as Room;
const defaultProps = { const defaultProps = {
space: makeMockSpace(), space: makeMockSpace(),

View file

@ -18,7 +18,6 @@ import React from "react";
import { MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix"; import { MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix";
import { mocked, MockedObject } from "jest-mock"; import { mocked, MockedObject } from "jest-mock";
import { render } from "@testing-library/react"; import { render } from "@testing-library/react";
import * as prettier from "prettier";
import { getMockClientWithEventEmitter, mkEvent, mkMessage, mkStubRoom } from "../../../test-utils"; import { getMockClientWithEventEmitter, mkEvent, mkMessage, mkStubRoom } from "../../../test-utils";
import { MatrixClientPeg } from "../../../../src/MatrixClientPeg"; import { MatrixClientPeg } from "../../../../src/MatrixClientPeg";
@ -225,11 +224,7 @@ describe("<TextualBody />", () => {
const ev = mkRoomTextMessage(`Visit https://matrix.to/#/${room1Id}/${defaultEvent.getId()}`); const ev = mkRoomTextMessage(`Visit https://matrix.to/#/${room1Id}/${defaultEvent.getId()}`);
const { container } = getComponent({ mxEvent: ev }); const { container } = getComponent({ mxEvent: ev });
const content = container.querySelector(".mx_EventTile_body"); const content = container.querySelector(".mx_EventTile_body");
expect( expect(content.innerHTML.replace(defaultEvent.getId(), "%event_id%")).toMatchSnapshot();
prettier.format(content.innerHTML.replace(defaultEvent.getId(), "%event_id%"), {
parser: "html",
}),
).toMatchSnapshot();
}); });
it("should pillify a permalink to an unknown message in the same room with the label »Message«", () => { it("should pillify a permalink to an unknown message in the same room with the label »Message«", () => {
@ -243,11 +238,7 @@ describe("<TextualBody />", () => {
const ev = mkRoomTextMessage(`Visit https://matrix.to/#/${room2Id}/${defaultEvent.getId()}`); const ev = mkRoomTextMessage(`Visit https://matrix.to/#/${room2Id}/${defaultEvent.getId()}`);
const { container } = getComponent({ mxEvent: ev }); const { container } = getComponent({ mxEvent: ev });
const content = container.querySelector(".mx_EventTile_body"); const content = container.querySelector(".mx_EventTile_body");
expect( expect(content.innerHTML.replace(defaultEvent.getId(), "%event_id%")).toMatchSnapshot();
prettier.format(content.innerHTML.replace(defaultEvent.getId(), "%event_id%"), {
parser: "html",
}),
).toMatchSnapshot();
}); });
}); });

View file

@ -296,71 +296,9 @@ exports[`<TextualBody /> renders formatted m.text correctly pills get injected c
</span> </span>
`; `;
exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to a message in the same room with the label »Message from Member« 1`] = ` exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to a message in the same room with the label »Message from Member« 1`] = `"Visit <span><bdi><a class="mx_Pill mx_EventPill" href="https://matrix.to/#/!room1:example.com/%event_id%" data-state="closed"><span aria-label="Profile picture" aria-hidden="true" data-testid="avatar-img" data-type="round" data-color="8" class="_avatar_1o69u_17 mx_BaseAvatar" style="--cpd-avatar-size: 16px;"><img loading="lazy" alt="" src="mxc://avatar.url/image.png" crossorigin="anonymous" referrerpolicy="no-referrer" class="_image_1o69u_49" data-type="round" width="16px" height="16px"></span><span class="mx_Pill_text">Message from Member</span></a></bdi></span>"`;
"Visit
<span
><bdi
><a
class="mx_Pill mx_EventPill"
href="https://matrix.to/#/!room1:example.com/%event_id%"
data-state="closed"
><span
aria-label="Profile picture"
aria-hidden="true"
data-testid="avatar-img"
data-type="round"
data-color="8"
class="_avatar_1o69u_17 mx_BaseAvatar"
style="--cpd-avatar-size: 16px"
><img
loading="lazy"
alt=""
src="mxc://avatar.url/image.png"
crossorigin="anonymous"
referrerpolicy="no-referrer"
class="_image_1o69u_49"
data-type="round"
width="16px"
height="16px" /></span
><span class="mx_Pill_text">Message from Member</span></a
></bdi
></span
>
"
`;
exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to an event in another room with the label »Message in Room 2« 1`] = ` exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to an event in another room with the label »Message in Room 2« 1`] = `"Visit <span><bdi><a class="mx_Pill mx_EventPill" href="https://matrix.to/#/!room2:example.com/%event_id%" data-state="closed"><span aria-label="Avatar" aria-hidden="true" data-testid="avatar-img" data-type="round" data-color="4" class="_avatar_1o69u_17 mx_BaseAvatar" style="--cpd-avatar-size: 16px;"><img loading="lazy" alt="" src="mxc://avatar.url/room.png" crossorigin="anonymous" referrerpolicy="no-referrer" class="_image_1o69u_49" data-type="round" width="16px" height="16px"></span><span class="mx_Pill_text">Message in Room 2</span></a></bdi></span>"`;
"Visit
<span
><bdi
><a
class="mx_Pill mx_EventPill"
href="https://matrix.to/#/!room2:example.com/%event_id%"
data-state="closed"
><span
aria-label="Avatar"
aria-hidden="true"
data-testid="avatar-img"
data-type="round"
data-color="4"
class="_avatar_1o69u_17 mx_BaseAvatar"
style="--cpd-avatar-size: 16px"
><img
loading="lazy"
alt=""
src="mxc://avatar.url/room.png"
crossorigin="anonymous"
referrerpolicy="no-referrer"
class="_image_1o69u_49"
data-type="round"
width="16px"
height="16px" /></span
><span class="mx_Pill_text">Message in Room 2</span></a
></bdi
></span
>
"
`;
exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to an unknown message in the same room with the label »Message« 1`] = ` exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to an unknown message in the same room with the label »Message« 1`] = `
<span <span

View file

@ -72,7 +72,7 @@ describe("<PinnedMessagesCard />", () => {
getTimelineForEvent: () => ({ getTimelineForEvent: () => ({
getEvents: () => localPins, getEvents: () => localPins,
}), }),
} as unknown as EventTimelineSet); }) as unknown as EventTimelineSet;
// Return all pins over fetchRoomEvent // Return all pins over fetchRoomEvent
cli.fetchRoomEvent.mockImplementation((roomId, eventId) => { cli.fetchRoomEvent.mockImplementation((roomId, eventId) => {

View file

@ -255,7 +255,7 @@ describe("<RoomSummaryCard />", () => {
"@ernie:sesame.st": ["some-other-room-id", room.roomId], "@ernie:sesame.st": ["some-other-room-id", room.roomId],
}, },
}), }),
}[eventType]), })[eventType],
); );
getComponent(); getComponent();

Some files were not shown because too many files have changed in this diff Show more