mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-15 20:54:59 +08:00
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:
parent
773b03e15e
commit
a0c8575113
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Test Privacy policy</title>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Test Privacy policy</title>
|
||||
|
@ -34,7 +34,7 @@
|
||||
"prepublishOnly": "yarn build",
|
||||
"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: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",
|
||||
"make-component": "node scripts/make-react-component.js",
|
||||
"rethemendex": "res/css/rethemendex.sh",
|
||||
@ -47,7 +47,7 @@
|
||||
"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: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:style": "stylelint \"res/css/**/*.pcss\"",
|
||||
"test": "jest",
|
||||
@ -178,7 +178,6 @@
|
||||
"@types/node": "^16",
|
||||
"@types/node-fetch": "^2.6.2",
|
||||
"@types/pako": "^2.0.0",
|
||||
"@types/prettier": "^2.7.0",
|
||||
"@types/qrcode": "^1.3.5",
|
||||
"@types/react": "17.0.68",
|
||||
"@types/react-beautiful-dnd": "^13.0.0",
|
||||
@ -226,7 +225,7 @@
|
||||
"mocha-junit-reporter": "^2.2.0",
|
||||
"node-fetch": "2",
|
||||
"postcss-scss": "^4.0.4",
|
||||
"prettier": "2.8.8",
|
||||
"prettier": "3.1.1",
|
||||
"raw-loader": "^4.0.2",
|
||||
"rimraf": "^5.0.0",
|
||||
"stylelint": "^16.0.0",
|
||||
|
@ -68,7 +68,11 @@ export const test = base.extend<{
|
||||
* which finds a message and then constructs a reply to it.
|
||||
*/
|
||||
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.
|
||||
@ -334,7 +338,11 @@ export abstract class BotActionSpec {
|
||||
export type Message = string | MessageContentSpec | BotActionSpec;
|
||||
|
||||
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
|
||||
|
@ -68,7 +68,11 @@ export class Bot extends Client {
|
||||
public credentials?: Credentials;
|
||||
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);
|
||||
this.opts = Object.assign({}, defaultCreateBotOptions, opts);
|
||||
}
|
||||
|
@ -21,7 +21,10 @@ export class Network {
|
||||
private isOffline = false;
|
||||
private readonly setupPromise: Promise<void>;
|
||||
|
||||
constructor(private page: Page, private client: Client) {
|
||||
constructor(
|
||||
private page: Page,
|
||||
private client: Client,
|
||||
) {
|
||||
this.setupPromise = this.setupRoute();
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Test Privacy policy</title>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Test Privacy policy</title>
|
||||
|
@ -102,7 +102,10 @@ body {
|
||||
* `font-feature-settings` allows us to override this behaviour and have the
|
||||
* 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;
|
||||
color: $primary-content;
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
.mx_PollDetailHeader {
|
||||
// override accessiblebutton style
|
||||
/* override accessiblebutton style */
|
||||
font-size: $font-15px !important;
|
||||
}
|
||||
|
||||
|
@ -60,6 +60,6 @@ limitations under the License.
|
||||
}
|
||||
|
||||
.mx_PollListItemEnded_voteCount {
|
||||
// 6px to match PollOption padding
|
||||
/* 6px to match PollOption padding */
|
||||
margin: $spacing-8 0 0 6px;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ limitations under the License.
|
||||
&:checked + span {
|
||||
color: $accent;
|
||||
font-weight: var(--cpd-font-weight-semibold);
|
||||
// underline
|
||||
/* underline */
|
||||
box-shadow: 0 1.5px 0 0 currentColor;
|
||||
}
|
||||
}
|
||||
|
@ -66,8 +66,7 @@ limitations under the License.
|
||||
}
|
||||
}
|
||||
|
||||
// override checked radio button styling
|
||||
// to show checkmark instead
|
||||
/* override checked radio button styling to show checkmark instead */
|
||||
.mx_StyledRadioButton_checked {
|
||||
input[type="radio"] + div {
|
||||
border-width: 2px;
|
||||
|
@ -15,6 +15,6 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
.mx_CurrentDeviceSection_deviceDetails {
|
||||
// align with text of session tile
|
||||
/* align with text of session tile */
|
||||
margin-left: 56px;
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ limitations under the License.
|
||||
}
|
||||
|
||||
.mx_DeviceDetailHeading_renameFormInput {
|
||||
// override field styles
|
||||
/* override field styles */
|
||||
margin: 0 0 $spacing-4 0 !important;
|
||||
}
|
||||
|
||||
|
@ -45,13 +45,13 @@ limitations under the License.
|
||||
|
||||
.mx_FilteredDeviceList_headerButton {
|
||||
flex-shrink: 0;
|
||||
// override inline button styling
|
||||
/* override inline button styling */
|
||||
display: flex !important;
|
||||
flex-direction: row;
|
||||
gap: $spacing-8;
|
||||
}
|
||||
|
||||
.mx_FilteredDeviceList_deviceDetails {
|
||||
// align with text of session tile
|
||||
/* align with text of session tile */
|
||||
margin-left: 88px;
|
||||
}
|
||||
|
@ -33,8 +33,7 @@ limitations under the License.
|
||||
width: 100%;
|
||||
display: grid;
|
||||
grid-gap: $spacing-8;
|
||||
// setting minwidth 0 makes columns definitely sized
|
||||
// fixing horizontal overflow
|
||||
/* setting minwidth 0 makes columns definitely sized fixing horizontal overflow */
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
justify-items: flex-start;
|
||||
margin-top: $spacing-24;
|
||||
|
@ -38,7 +38,7 @@ limitations under the License.
|
||||
flex: 1;
|
||||
min-width: 40%;
|
||||
resize: none;
|
||||
// `!important` is required to bypass global input styles.
|
||||
/* `!important` is required to bypass global input styles. */
|
||||
margin: 0 !important;
|
||||
padding: $spacing-8 9px;
|
||||
border: none !important;
|
||||
|
@ -28,7 +28,9 @@ limitations under the License.
|
||||
top: -1px;
|
||||
z-index: 1;
|
||||
will-change: width;
|
||||
transition: width 400ms easeinsine 1s, opacity 400ms easeinsine 1s;
|
||||
transition:
|
||||
width 400ms easeinsine 1s,
|
||||
opacity 400ms easeinsine 1s;
|
||||
width: 99%;
|
||||
opacity: 1;
|
||||
}
|
||||
|
@ -266,7 +266,7 @@ limitations under the License.
|
||||
flex-grow: 1;
|
||||
|
||||
.mx_SpaceTreeLevel {
|
||||
// Indent subspaces
|
||||
/* Indent subspaces */
|
||||
padding-left: 16px;
|
||||
}
|
||||
}
|
||||
@ -416,7 +416,6 @@ limitations under the License.
|
||||
font-size: $font-10px;
|
||||
line-height: $font-12px;
|
||||
font-weight: var(--cpd-font-weight-semibold);
|
||||
//margin-left: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,8 @@ limitations under the License.
|
||||
filter: blur(8px);
|
||||
inset: -9px;
|
||||
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 */
|
||||
linear-gradient(
|
||||
to bottom,
|
||||
|
@ -67,7 +67,7 @@ limitations under the License.
|
||||
.mx_AuthBody_lockIcon {
|
||||
color: $secondary-content;
|
||||
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 {
|
||||
@ -211,9 +211,9 @@ limitations under the License.
|
||||
}
|
||||
|
||||
.mx_AuthBody_emailPromptIcon--shifted {
|
||||
margin-bottom: -17px; // Prevent layout jump by relative positioning.
|
||||
margin-bottom: -17px; /* Prevent layout jump by relative positioning. */
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -30,9 +30,9 @@ limitations under the License.
|
||||
.mx_DecoratedRoomAvatar_icon {
|
||||
position: absolute;
|
||||
/* 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%;
|
||||
width: 25%; // 8px for a 32x32 avatar
|
||||
width: 25%; /* 8px for a 32x32 avatar */
|
||||
height: 25%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ limitations under the License.
|
||||
.mx_IconizedContextMenu {
|
||||
min-width: 146px;
|
||||
width: max-content;
|
||||
// override default ul styles
|
||||
/* override default ul styles */
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
|
@ -38,7 +38,9 @@ limitations under the License.
|
||||
}
|
||||
|
||||
.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) {
|
||||
margin-top: 24px;
|
||||
|
@ -97,7 +97,9 @@ limitations under the License.
|
||||
.mx_StyledRadioButton {
|
||||
display: inline-flex;
|
||||
font-size: 20px;
|
||||
transition: font-size 1s, border 0.5s;
|
||||
transition:
|
||||
font-size 1s,
|
||||
border 0.5s;
|
||||
border-radius: 50%;
|
||||
border: 2px solid transparent;
|
||||
margin-top: 12px;
|
||||
|
@ -58,7 +58,7 @@ limitations under the License.
|
||||
.mx_Dropdown_option {
|
||||
height: 35px;
|
||||
line-height: $font-35px;
|
||||
// Overwrites the default padding for any li elements
|
||||
/* Overwrites the default padding for any li elements */
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,10 @@ limitations under the License.
|
||||
}
|
||||
|
||||
.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: transparent;
|
||||
font: var(--cpd-font-body-md-regular);
|
||||
@ -117,7 +120,10 @@ limitations under the License.
|
||||
.mx_Field input:not(:placeholder-shown) + label,
|
||||
.mx_Field textarea:focus + 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;
|
||||
font-size: $font-10px;
|
||||
transform: translateY(-13px);
|
||||
|
@ -32,7 +32,7 @@ limitations under the License.
|
||||
}
|
||||
|
||||
.mx_GenericEventListSummary_toggle {
|
||||
// We reuse a title cased translation
|
||||
/* We reuse a title cased translation */
|
||||
text-transform: lowercase;
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,9 @@ limitations under the License.
|
||||
color: $primary-content;
|
||||
position: absolute;
|
||||
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 {
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
.mx_ReplyChain {
|
||||
margin: 0; // Reset default blockquote margin
|
||||
margin: 0; /* Reset default blockquote margin */
|
||||
padding-left: 10px;
|
||||
border-left: 2px solid var(--username-color);
|
||||
border-radius: 2px;
|
||||
|
@ -24,7 +24,7 @@ limitations under the License.
|
||||
appearance: none;
|
||||
width: 100%;
|
||||
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;
|
||||
--selection-dot-size: 2.4em;
|
||||
@ -114,7 +114,7 @@ limitations under the License.
|
||||
left: 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;
|
||||
top: 3em;
|
||||
|
||||
|
@ -158,9 +158,9 @@ limitations under the License.
|
||||
.mx_BaseCard_close {
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
// @TODO(kerrya) background colours here are not semantic
|
||||
// these buttons to be replaced with IconButton after secondary variant is added
|
||||
// https://github.com/vector-im/compound/issues/279
|
||||
/* @TODO(kerrya) background colours here are not semantic
|
||||
these buttons to be replaced with IconButton after secondary variant is added
|
||||
https://github.com/vector-im/compound/issues/279 */
|
||||
background-color: var(--cpd-color-bg-subtle-secondary);
|
||||
width: var(--BaseCard_header-button-size);
|
||||
height: var(--BaseCard_header-button-size);
|
||||
|
@ -133,7 +133,7 @@ limitations under the License.
|
||||
line-height: $font-25px;
|
||||
flex: 1;
|
||||
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;
|
||||
|
||||
span {
|
||||
|
@ -355,12 +355,12 @@ limitations under the License.
|
||||
.mx_EventTile_e2eIcon {
|
||||
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);
|
||||
}
|
||||
|
||||
.mx_MPollEndBody {
|
||||
// Prevent the poll end body from exceeding the tile width
|
||||
/* Prevent the poll end body from exceeding the tile width */
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
@ -488,7 +488,7 @@ $left-gutter: 64px;
|
||||
.mx_EventTile_e2eIcon {
|
||||
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);
|
||||
margin: 1px;
|
||||
}
|
||||
@ -701,11 +701,11 @@ $left-gutter: 64px;
|
||||
background-color: $inlinecode-background-color;
|
||||
border: 1px solid $inlinecode-border-color;
|
||||
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;
|
||||
// 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;
|
||||
// Avoid the border to be glued to the other words
|
||||
/* Avoid the border to be glued to the other words */
|
||||
margin-right: $spacing-2;
|
||||
}
|
||||
|
||||
@ -792,7 +792,7 @@ $left-gutter: 64px;
|
||||
.mx_EventTile_spoiler {
|
||||
cursor: pointer;
|
||||
|
||||
// clear button styles
|
||||
/* clear button styles */
|
||||
appearance: none;
|
||||
background: none;
|
||||
border: none;
|
||||
@ -852,17 +852,17 @@ $left-gutter: 64px;
|
||||
}
|
||||
|
||||
&.mx_EventTile_e2eIcon_warning::after {
|
||||
mask-image: url("$(res)/img/e2e/warning.svg"); // (!) in a shield
|
||||
background-color: $e2e-warning-color; // red
|
||||
mask-image: url("$(res)/img/e2e/warning.svg"); /* (!) in a shield */
|
||||
background-color: $e2e-warning-color; /* red */
|
||||
}
|
||||
|
||||
&.mx_EventTile_e2eIcon_normal::after {
|
||||
mask-image: url("$(res)/img/e2e/normal.svg"); // regular shield
|
||||
background-color: $header-panel-text-primary-color; // grey
|
||||
mask-image: url("$(res)/img/e2e/normal.svg"); /* regular shield */
|
||||
background-color: $header-panel-text-primary-color; /* grey */
|
||||
}
|
||||
|
||||
&.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;
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,9 @@ limitations under the License.
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
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;
|
||||
align-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 {
|
||||
|
@ -37,7 +37,9 @@ limitations under the License.
|
||||
color: $secondary-content;
|
||||
transition: color ease 0.15s;
|
||||
gap: 2px;
|
||||
max-width: 100%; // avoid overflow with wide content
|
||||
max-width: 100%;
|
||||
|
||||
// avoid overflow with wide content
|
||||
|
||||
&:hover {
|
||||
color: $primary-content;
|
||||
@ -112,7 +114,7 @@ limitations under the License.
|
||||
grid-template:
|
||||
"sender message" auto
|
||||
/ max-content auto;
|
||||
gap: 4px; // increase spacing
|
||||
gap: 4px; /* increase spacing */
|
||||
}
|
||||
|
||||
.mx_ReplyTile_sender {
|
||||
@ -124,18 +126,18 @@ limitations under the License.
|
||||
.mx_DisambiguatedProfile {
|
||||
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;
|
||||
margin: 0;
|
||||
|
||||
// truncate long display names
|
||||
/* truncate long display names */
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.mx_BaseAvatar {
|
||||
line-height: 14px; // To match size
|
||||
line-height: 14px; /* To match size */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ limitations under the License.
|
||||
}
|
||||
|
||||
.mx_RoomHeader_infoWrapper {
|
||||
// unset button styles
|
||||
/* unset button styles */
|
||||
background: unset;
|
||||
border: unset;
|
||||
flex: 1;
|
||||
|
@ -46,8 +46,8 @@ limitations under the License.
|
||||
p {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
// this may seem redundant, but we need to handle zero content formatting tags, which occur when we split a
|
||||
// formatting tag into paragraphs
|
||||
/* this may seem redundant, but we need to handle zero content formatting tags, which occur when we split a
|
||||
formatting tag into paragraphs */
|
||||
min-height: $font-22px;
|
||||
}
|
||||
|
||||
|
@ -61,11 +61,11 @@ limitations under the License.
|
||||
font: var(--cpd-font-body-sm-semibold);
|
||||
}
|
||||
.mx_UserNotifSettings_gridRowError {
|
||||
// occupy full row
|
||||
/* occupy full row */
|
||||
grid-column: 1/-1;
|
||||
justify-self: start;
|
||||
padding-right: 30%;
|
||||
// collapse half of the grid-gap
|
||||
/* collapse half of the grid-gap */
|
||||
margin-top: -$spacing-4;
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,6 @@ limitations under the License.
|
||||
|
||||
.mx_Field.mx_AppearanceUserSettingsTab_checkboxControlledField {
|
||||
width: 256px;
|
||||
// matches checkbox box + padding
|
||||
// to align with checkbox label
|
||||
/* matches checkbox box + padding to align with checkbox label */
|
||||
margin-inline-start: calc($font-16px + 10px);
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ limitations under the License.
|
||||
|
||||
.mx_SidebarUserSettingsTab_checkbox {
|
||||
margin-bottom: $spacing-8;
|
||||
// override checkbox styles˚
|
||||
/* override checkbox styles */
|
||||
label {
|
||||
align-items: flex-start !important;
|
||||
}
|
||||
|
@ -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-display: swap;
|
||||
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");
|
||||
}
|
||||
@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-display: swap;
|
||||
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");
|
||||
}
|
||||
|
||||
@ -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-display: swap;
|
||||
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");
|
||||
}
|
||||
@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-display: swap;
|
||||
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");
|
||||
}
|
||||
|
||||
@ -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-display: swap;
|
||||
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");
|
||||
}
|
||||
@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-display: swap;
|
||||
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");
|
||||
}
|
||||
|
||||
@ -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-display: swap;
|
||||
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");
|
||||
}
|
||||
@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-display: swap;
|
||||
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");
|
||||
}
|
||||
|
||||
@ -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-style: normal;
|
||||
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");
|
||||
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-weight: 400;
|
||||
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");
|
||||
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;
|
||||
@ -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-weight: 700;
|
||||
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");
|
||||
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-weight: 700;
|
||||
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");
|
||||
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;
|
||||
|
@ -29,8 +29,8 @@ export type RecursivePartial<T> = {
|
||||
[P in keyof T]?: T[P] extends (infer U)[]
|
||||
? RecursivePartial<U>[]
|
||||
: T[P] extends object
|
||||
? RecursivePartial<T[P]>
|
||||
: T[P];
|
||||
? RecursivePartial<T[P]>
|
||||
: T[P];
|
||||
};
|
||||
|
||||
export type KeysStartingWith<Input extends object, Str extends string> = {
|
||||
@ -51,10 +51,10 @@ export type Defaultize<P, D> = P extends any
|
||||
export type DeepReadonly<T> = T extends (infer R)[]
|
||||
? DeepReadonlyArray<R>
|
||||
: T extends Function
|
||||
? T
|
||||
: T extends object
|
||||
? DeepReadonlyObject<T>
|
||||
: T;
|
||||
? T
|
||||
: T extends object
|
||||
? DeepReadonlyObject<T>
|
||||
: T;
|
||||
|
||||
interface DeepReadonlyArray<T> extends ReadonlyArray<DeepReadonly<T>> {}
|
||||
|
||||
|
@ -23,7 +23,10 @@ import { PosthogAnalytics } from "./PosthogAnalytics";
|
||||
export class DecryptionFailure {
|
||||
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();
|
||||
}
|
||||
}
|
||||
@ -110,7 +113,10 @@ export class DecryptionFailureTracker {
|
||||
* @param {function?} errorCodeMapFn The function used to map error codes to the
|
||||
* 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") {
|
||||
throw new Error("DecryptionFailureTracker requires tracking function");
|
||||
}
|
||||
|
@ -327,7 +327,10 @@ const topicSanitizeHtmlParams: IExtendedSanitizeOptions = {
|
||||
};
|
||||
|
||||
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
|
||||
|
@ -34,7 +34,10 @@ export default class ScalarAuthClient {
|
||||
private termsInteractionCallback?: TermsInteractionCallback;
|
||||
private isDefaultManager: boolean;
|
||||
|
||||
public constructor(private apiUrl: string, private uiUrl: string) {
|
||||
public constructor(
|
||||
private apiUrl: string,
|
||||
private uiUrl: string,
|
||||
) {
|
||||
this.scalarToken = null;
|
||||
// `undefined` to allow `startTermsFlow` to fallback to a default
|
||||
// callback if this is unset.
|
||||
|
@ -33,7 +33,11 @@ export class Service {
|
||||
* @param {string} baseUrl The Base URL of the service (ie. before '/_matrix')
|
||||
* @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 {
|
||||
|
@ -45,7 +45,10 @@ export default class UserActivity {
|
||||
private lastScreenX = 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.activeRecentlyTimeout = new Timer(RECENTLY_ACTIVE_THRESHOLD_MS);
|
||||
}
|
||||
|
@ -22,7 +22,11 @@ import { DEFAULT_WAVEFORM } from "./consts";
|
||||
* A managed playback is a Playback instance that is guided by a PlaybackManager.
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,10 @@ export class Playback extends EventEmitter implements IDestroyable, PlaybackInte
|
||||
* @param {number[]} seedWaveform Optional seed waveform to present until the proper waveform
|
||||
* 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();
|
||||
// Capture the file size early as reading the buffer will result in a 0-length buffer left behind
|
||||
this.fileSize = this.buf.byteLength;
|
||||
|
@ -37,7 +37,10 @@ export class VoiceMessageRecording implements IDestroyable {
|
||||
private buffer = new Uint8Array(0); // use this.audioBuffer to access
|
||||
private playback?: Playback;
|
||||
|
||||
public constructor(private matrixClient: MatrixClient, private voiceRecording: VoiceRecording) {
|
||||
public constructor(
|
||||
private matrixClient: MatrixClient,
|
||||
private voiceRecording: VoiceRecording,
|
||||
) {
|
||||
this.voiceRecording.onDataAvailable = this.onDataAvailable;
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,10 @@ import { TimelineRenderingType } from "../contexts/RoomContext";
|
||||
const AT_ROOM_REGEX = /@\S*/g;
|
||||
|
||||
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 });
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,10 @@ function matcherObject(
|
||||
export default class RoomProvider extends AutocompleteProvider {
|
||||
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 });
|
||||
this.matcher = new QueryMatcher<ReturnType<typeof matcherObject>>([], {
|
||||
keys: ["displayedAlias", "matchName"],
|
||||
|
@ -204,7 +204,8 @@ const ThreadPanel: React.FC<IProps> = ({ roomId, onClose, permalinkCreator }) =>
|
||||
|
||||
useEffect(() => {
|
||||
const room = mxClient.getRoom(roomId);
|
||||
room?.createThreadsTimelineSets()
|
||||
room
|
||||
?.createThreadsTimelineSets()
|
||||
.then(() => room.fetchRoomThreads())
|
||||
.then(() => {
|
||||
setFilterOption(ThreadFilterType.All);
|
||||
|
@ -362,32 +362,31 @@ export const AddExistingToSpace: React.FC<IAddExistingToSpaceProps> = ({
|
||||
|
||||
const defaultRendererFactory =
|
||||
(title: TranslationKey): Renderer =>
|
||||
(rooms, selectedToAdd, { scrollTop, height }, onChange) =>
|
||||
(
|
||||
<div className="mx_AddExistingToSpace_section">
|
||||
<h3>{_t(title)}</h3>
|
||||
<LazyRenderList
|
||||
itemHeight={ROW_HEIGHT}
|
||||
items={rooms}
|
||||
scrollTop={scrollTop}
|
||||
height={height}
|
||||
renderItem={(room) => (
|
||||
<Entry
|
||||
key={room.roomId}
|
||||
room={room}
|
||||
checked={selectedToAdd.has(room)}
|
||||
onChange={
|
||||
onChange
|
||||
? (checked: boolean) => {
|
||||
onChange(checked, room);
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
(rooms, selectedToAdd, { scrollTop, height }, onChange) => (
|
||||
<div className="mx_AddExistingToSpace_section">
|
||||
<h3>{_t(title)}</h3>
|
||||
<LazyRenderList
|
||||
itemHeight={ROW_HEIGHT}
|
||||
items={rooms}
|
||||
scrollTop={scrollTop}
|
||||
height={height}
|
||||
renderItem={(room) => (
|
||||
<Entry
|
||||
key={room.roomId}
|
||||
room={room}
|
||||
checked={selectedToAdd.has(room)}
|
||||
onChange={
|
||||
onChange
|
||||
? (checked: boolean) => {
|
||||
onChange(checked, room);
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
export const defaultRoomsRenderer = defaultRendererFactory(_td("common|rooms"));
|
||||
export const defaultSpacesRenderer = defaultRendererFactory(_td("common|spaces"));
|
||||
|
@ -252,12 +252,15 @@ const findVisibleRoomMembers = (visibleRooms: Room[], cli: MatrixClient, filterD
|
||||
return Object.values(
|
||||
visibleRooms
|
||||
.filter((room) => !filterDMs || !DMRoomMap.shared().getUserIdForRoomId(room.roomId))
|
||||
.reduce((members, room) => {
|
||||
for (const member of room.getJoinedMembers()) {
|
||||
members[member.userId] = member;
|
||||
}
|
||||
return members;
|
||||
}, {} as Record<string, RoomMember>),
|
||||
.reduce(
|
||||
(members, room) => {
|
||||
for (const member of room.getJoinedMembers()) {
|
||||
members[member.userId] = member;
|
||||
}
|
||||
return members;
|
||||
},
|
||||
{} as Record<string, RoomMember>,
|
||||
),
|
||||
).filter((it) => it.userId !== cli.getUserId());
|
||||
};
|
||||
|
||||
|
@ -17,7 +17,11 @@ limitations under the License.
|
||||
import React from "react";
|
||||
|
||||
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 {
|
||||
// don't contain empty ranges
|
||||
|
@ -61,7 +61,8 @@ export default class SpellCheckLanguagesDropdown extends React.Component<
|
||||
const plaf = PlatformPeg.get();
|
||||
if (plaf) {
|
||||
const languageNames = new Intl.DisplayNames([getUserLanguage()], { type: "language", style: "short" });
|
||||
plaf.getAvailableSpellCheckLanguages()
|
||||
plaf
|
||||
.getAvailableSpellCheckLanguages()
|
||||
?.then((languages) => {
|
||||
languages.sort(function (a, b) {
|
||||
if (a < b) return -1;
|
||||
|
@ -366,7 +366,11 @@ export default class MPollBody extends React.Component<IBodyProps, IState> {
|
||||
}
|
||||
}
|
||||
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 {
|
||||
|
@ -650,8 +650,8 @@ export const RoomKickButton = ({
|
||||
? _t("user_info|disinvite_button_space")
|
||||
: _t("user_info|kick_button_space")
|
||||
: member.membership === "invite"
|
||||
? _t("user_info|disinvite_button_room")
|
||||
: _t("user_info|kick_button_room"),
|
||||
? _t("user_info|disinvite_button_room")
|
||||
: _t("user_info|kick_button_room"),
|
||||
title:
|
||||
member.membership === "invite"
|
||||
? _t("user_info|disinvite_button_room_name", { roomName: room.name })
|
||||
@ -721,8 +721,8 @@ export const RoomKickButton = ({
|
||||
? _t("user_info|disinvite_button_space")
|
||||
: _t("user_info|kick_button_space")
|
||||
: member.membership === "invite"
|
||||
? _t("user_info|disinvite_button_room")
|
||||
: _t("user_info|kick_button_room");
|
||||
? _t("user_info|disinvite_button_room")
|
||||
: _t("user_info|kick_button_room");
|
||||
|
||||
return (
|
||||
<AccessibleButton
|
||||
@ -782,8 +782,8 @@ export const BanToggleButton = ({
|
||||
? _t("user_info|unban_button_space")
|
||||
: _t("user_info|ban_button_space")
|
||||
: isBanned
|
||||
? _t("user_info|unban_button_room")
|
||||
: _t("user_info|ban_button_room"),
|
||||
? _t("user_info|unban_button_room")
|
||||
: _t("user_info|ban_button_room"),
|
||||
title: isBanned
|
||||
? _t("user_info|unban_room_confirm_title", { roomName: room.name })
|
||||
: _t("user_info|ban_room_confirm_title", { roomName: room.name }),
|
||||
|
@ -101,9 +101,8 @@ export default class CrossSigningPanel extends React.PureComponent<{}, IState> {
|
||||
const masterPrivateKeyCached = crossSigningStatus.privateKeysCachedLocally.masterKey;
|
||||
const selfSigningPrivateKeyCached = crossSigningStatus.privateKeysCachedLocally.selfSigningKey;
|
||||
const userSigningPrivateKeyCached = crossSigningStatus.privateKeysCachedLocally.userSigningKey;
|
||||
const homeserverSupportsCrossSigning = await cli.doesServerSupportUnstableFeature(
|
||||
"org.matrix.e2e_cross_signing",
|
||||
);
|
||||
const homeserverSupportsCrossSigning =
|
||||
await cli.doesServerSupportUnstableFeature("org.matrix.e2e_cross_signing");
|
||||
const crossSigningReady = await crypto.isCrossSigningReady();
|
||||
|
||||
this.setState({
|
||||
|
@ -194,13 +194,14 @@ const SessionManagerTab: React.FC = () => {
|
||||
setFilter(filter);
|
||||
clearTimeout(scrollIntoViewTimeoutRef.current);
|
||||
// wait a tick for the filtered section to rerender with different height
|
||||
scrollIntoViewTimeoutRef.current = window.setTimeout(() =>
|
||||
filteredDeviceListRef.current?.scrollIntoView({
|
||||
// align element to top of scrollbox
|
||||
block: "start",
|
||||
inline: "nearest",
|
||||
behavior: "smooth",
|
||||
}),
|
||||
scrollIntoViewTimeoutRef.current = window.setTimeout(
|
||||
() =>
|
||||
filteredDeviceListRef.current?.scrollIntoView({
|
||||
// align element to top of scrollbox
|
||||
block: "start",
|
||||
inline: "nearest",
|
||||
behavior: "smooth",
|
||||
}),
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -36,7 +36,10 @@ export class Media {
|
||||
private client: MatrixClient;
|
||||
|
||||
// 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();
|
||||
if (!this.client) {
|
||||
throw new Error("No possible MatrixClient for media resolution. Please provide one or log in.");
|
||||
|
@ -57,7 +57,11 @@ export default class EditorModel {
|
||||
private autoCompletePartCount = 0;
|
||||
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._partCreator = partCreator;
|
||||
this.transformCallback = null;
|
||||
|
@ -18,7 +18,10 @@ import EditorModel from "./model";
|
||||
import DocumentPosition from "./position";
|
||||
|
||||
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 {
|
||||
return model.positionForOffset(this.offset, this.atNodeEnd);
|
||||
|
@ -254,7 +254,10 @@ export class PlainPart extends PlainBasePart implements IBasePart {
|
||||
}
|
||||
|
||||
export abstract class PillPart extends BasePart implements IPillPart {
|
||||
public constructor(public resourceId: string, label: string) {
|
||||
public constructor(
|
||||
public resourceId: string,
|
||||
label: string,
|
||||
) {
|
||||
super(label);
|
||||
}
|
||||
|
||||
@ -414,7 +417,11 @@ export class EmojiPart extends BasePart implements IBasePart {
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@ -455,7 +462,11 @@ class AtRoomPillPart extends RoomPillPart {
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@ -490,7 +501,10 @@ class UserPillPart extends PillPart {
|
||||
}
|
||||
|
||||
class PillCandidatePart extends PlainBasePart implements IPillCandidatePart {
|
||||
public constructor(text: string, private autoCompleteCreator: IAutocompleteCreator) {
|
||||
public constructor(
|
||||
text: string,
|
||||
private autoCompleteCreator: IAutocompleteCreator,
|
||||
) {
|
||||
super(text);
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,10 @@ type Callback = (part: Part, startIdx: number, endIdx: number) => void;
|
||||
export type Predicate = (index: number, offset: number, part: Part) => boolean;
|
||||
|
||||
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 {
|
||||
if (this.index === otherPos.index) {
|
||||
|
@ -28,7 +28,11 @@ export default class Range {
|
||||
private _lastStart: DocumentPosition;
|
||||
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;
|
||||
this._start = bIsLarger ? positionA : positionB;
|
||||
this._end = bIsLarger ? positionB : positionA;
|
||||
|
@ -570,10 +570,13 @@ export class JitsiCall extends Call {
|
||||
// Tell others that we're connected, by adding our device to room state
|
||||
await this.addOurDevice();
|
||||
// Re-add this device every so often so our video member event doesn't become stale
|
||||
this.resendDevicesTimer = window.setInterval(async (): Promise<void> => {
|
||||
logger.log(`Resending video member event for ${this.roomId}`);
|
||||
await this.addOurDevice();
|
||||
}, (this.STUCK_DEVICE_TIMEOUT_MS * 3) / 4);
|
||||
this.resendDevicesTimer = window.setInterval(
|
||||
async (): Promise<void> => {
|
||||
logger.log(`Resending video member event for ${this.roomId}`);
|
||||
await this.addOurDevice();
|
||||
},
|
||||
(this.STUCK_DEVICE_TIMEOUT_MS * 3) / 4,
|
||||
);
|
||||
} else if (state === ConnectionState.Disconnected && isConnected(prevState)) {
|
||||
this.updateParticipants(); // Local echo
|
||||
|
||||
@ -717,7 +720,11 @@ export class ElementCall extends Call {
|
||||
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);
|
||||
|
||||
this.session.on(MatrixRTCSessionEvent.MembershipsChanged, this.onMembershipChanged);
|
||||
|
@ -138,7 +138,10 @@ export class IndexedDBLogStore {
|
||||
private flushPromise: 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);
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,10 @@ import SettingController from "./SettingController";
|
||||
* When the value changes, call a setter function on the matrix client with the new value
|
||||
*/
|
||||
export default class PushToMatrixClientController extends SettingController {
|
||||
public constructor(private setter: Function, private inverse: boolean) {
|
||||
public constructor(
|
||||
private setter: Function,
|
||||
private inverse: boolean,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,10 @@ import SettingsStore from "../SettingsStore";
|
||||
* Settings using this controller are assumed to return `false` when disabled.
|
||||
*/
|
||||
export default class UIFeatureController extends SettingController {
|
||||
public constructor(private uiFeatureName: string, private forcedValue = false) {
|
||||
public constructor(
|
||||
private uiFeatureName: string,
|
||||
private forcedValue = false,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,10 @@ export default class DefaultSettingsHandler extends SettingsHandler {
|
||||
* @param {object} defaults The default 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();
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,10 @@ export default class DeviceSettingsHandler extends AbstractLocalStorageSettingsH
|
||||
* @param {string[]} featureNames The names of known features.
|
||||
* @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();
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,10 @@ export default class LocalEchoWrapper extends SettingsHandler {
|
||||
* @param {SettingsHandler} handler The handler to wrap
|
||||
* @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();
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,10 @@ export abstract class AsyncStore<T extends Object> extends EventEmitter {
|
||||
* @param {Dispatcher<ActionPayload>} dispatcher The dispatcher to rely upon.
|
||||
* @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();
|
||||
|
||||
this.dispatcherRef = dispatcher.register(this.onDispatch.bind(this));
|
||||
|
@ -160,7 +160,10 @@ export class RoomViewStore extends EventEmitter {
|
||||
private dis?: MatrixDispatcher;
|
||||
private dispatchToken?: string;
|
||||
|
||||
public constructor(dis: MatrixDispatcher, private readonly stores: SdkContextClass) {
|
||||
public constructor(
|
||||
dis: MatrixDispatcher,
|
||||
private readonly stores: SdkContextClass,
|
||||
) {
|
||||
super();
|
||||
this.resetDispatcher(dis);
|
||||
this.stores.voiceBroadcastRecordingsStore.addListener(
|
||||
@ -319,14 +322,14 @@ export class RoomViewStore extends EventEmitter {
|
||||
numMembers > 1000
|
||||
? "MoreThanAThousand"
|
||||
: numMembers > 100
|
||||
? "OneHundredAndOneToAThousand"
|
||||
: numMembers > 10
|
||||
? "ElevenToOneHundred"
|
||||
: numMembers > 2
|
||||
? "ThreeToTen"
|
||||
: numMembers > 1
|
||||
? "Two"
|
||||
: "One";
|
||||
? "OneHundredAndOneToAThousand"
|
||||
: numMembers > 10
|
||||
? "ElevenToOneHundred"
|
||||
: numMembers > 2
|
||||
? "ThreeToTen"
|
||||
: numMembers > 1
|
||||
? "Two"
|
||||
: "One";
|
||||
|
||||
this.stores.posthogAnalytics.trackEvent<JoinedRoomEvent>({
|
||||
eventName: "JoinedRoom",
|
||||
|
@ -30,7 +30,10 @@ export class EchoTransaction extends Whenable<TransactionStatus> {
|
||||
|
||||
public readonly startTime = new Date();
|
||||
|
||||
public constructor(public readonly auditName: string, public runFn: RunFn) {
|
||||
public constructor(
|
||||
public readonly auditName: string,
|
||||
public runFn: RunFn,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,10 @@ export abstract class GenericEchoChamber<C extends EchoContext, K, V> extends Ev
|
||||
private cache = new Map<K, { txn: EchoTransaction; val: V }>();
|
||||
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();
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,10 @@ export class ListNotificationState extends NotificationState {
|
||||
private rooms: Room[] = [];
|
||||
private states: { [roomId: string]: RoomNotificationState } = {};
|
||||
|
||||
public constructor(private byTileCount = false, private getRoomFn: FetchRoomFn) {
|
||||
public constructor(
|
||||
private byTileCount = false,
|
||||
private getRoomFn: FetchRoomFn,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,10 @@ export class SlidingRoomListStoreClass extends AsyncStoreWithClient<IState> impl
|
||||
private counts: Record<TagID, number> = {};
|
||||
private stickyRoomId: Optional<string>;
|
||||
|
||||
public constructor(dis: MatrixDispatcher, private readonly context: SdkContextClass) {
|
||||
public constructor(
|
||||
dis: MatrixDispatcher,
|
||||
private readonly context: SdkContextClass,
|
||||
) {
|
||||
super(dis);
|
||||
this.setMaxListeners(20); // RoomList + LeftPanel + 8xRoomSubList + spares
|
||||
}
|
||||
|
@ -30,7 +30,10 @@ export abstract class OrderingAlgorithm {
|
||||
// set by setSortAlgorithm() in ctor
|
||||
protected sortingAlgorithm!: SortAlgorithm;
|
||||
|
||||
protected constructor(protected tagId: TagID, initialSortingAlgorithm: SortAlgorithm) {
|
||||
protected constructor(
|
||||
protected tagId: TagID,
|
||||
initialSortingAlgorithm: SortAlgorithm,
|
||||
) {
|
||||
// noinspection JSIgnoredPromiseFromCall
|
||||
this.setSortAlgorithm(initialSortingAlgorithm); // we use the setter for validation
|
||||
}
|
||||
|
@ -202,15 +202,18 @@ export default class DMRoomMap {
|
||||
public getUniqueRoomsWithIndividuals(): { [userId: string]: Room } {
|
||||
if (!this.roomToUser) return {}; // No rooms means no map.
|
||||
// map roomToUser to valid rooms with two participants
|
||||
return Object.keys(this.roomToUser).reduce((acc, roomId: string) => {
|
||||
const userId = this.getUserIdForRoomId(roomId);
|
||||
const room = this.matrixClient.getRoom(roomId);
|
||||
const hasTwoMembers = room?.getInvitedAndJoinedMemberCount() === 2;
|
||||
if (userId && room && hasTwoMembers) {
|
||||
acc[userId] = room;
|
||||
}
|
||||
return acc;
|
||||
}, {} as Record<string, Room>);
|
||||
return Object.keys(this.roomToUser).reduce(
|
||||
(acc, roomId: string) => {
|
||||
const userId = this.getUserIdForRoomId(roomId);
|
||||
const room = this.matrixClient.getRoom(roomId);
|
||||
const hasTwoMembers = room?.getInvitedAndJoinedMemberCount() === 2;
|
||||
if (userId && room && hasTwoMembers) {
|
||||
acc[userId] = room;
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{} as Record<string, Room>,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -28,7 +28,10 @@ export class FixedRollingArray<T> {
|
||||
* @param width The width of the array.
|
||||
* @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);
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,10 @@ export class MarkedExecution {
|
||||
* @param {Function} onMarkCallback A function that is called when a new mark is made. Not
|
||||
* 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.
|
||||
|
@ -76,8 +76,8 @@ export async function upgradeRoom(
|
||||
if (updateSpaces) {
|
||||
parentsToRelink = Array.from(SpaceStore.instance.getKnownParents(room.roomId))
|
||||
.map((roomId) => cli.getRoom(roomId))
|
||||
.filter((parent) =>
|
||||
parent?.currentState.maySendStateEvent(EventType.SpaceChild, cli.getUserId()!),
|
||||
.filter(
|
||||
(parent) => parent?.currentState.maySendStateEvent(EventType.SpaceChild, cli.getUserId()!),
|
||||
) as Room[];
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,10 @@ export class Singleflight {
|
||||
}
|
||||
|
||||
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.
|
||||
|
@ -32,8 +32,19 @@ limitations under the License.
|
||||
bottom: 30px;
|
||||
font-size: 17px;
|
||||
padding: 6px 16px;
|
||||
font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu,
|
||||
roboto, noto, arial, sans-serif;
|
||||
font-family:
|
||||
-apple-system,
|
||||
BlinkMacSystemFont,
|
||||
avenir next,
|
||||
avenir,
|
||||
segoe ui,
|
||||
helvetica neue,
|
||||
helvetica,
|
||||
Ubuntu,
|
||||
roboto,
|
||||
noto,
|
||||
arial,
|
||||
sans-serif;
|
||||
font-weight: 400;
|
||||
line-height: 1.43;
|
||||
border-radius: 4px;
|
||||
@ -42,8 +53,12 @@ limitations under the License.
|
||||
|
||||
#snackbar.mx_show {
|
||||
visibility: visible;
|
||||
-webkit-animation: 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;
|
||||
-webkit-animation:
|
||||
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 {
|
||||
|
@ -93,7 +93,11 @@ export class RoomPermalinkCreator {
|
||||
// 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
|
||||
// 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!;
|
||||
|
||||
if (!this.roomId) {
|
||||
|
@ -63,7 +63,10 @@ export class VoiceBroadcastRecorder
|
||||
// current chunk length in seconds
|
||||
private currentChunkLength = 0;
|
||||
|
||||
public constructor(private voiceRecording: VoiceRecording, public readonly targetChunkLength: number) {
|
||||
public constructor(
|
||||
private voiceRecording: VoiceRecording,
|
||||
public readonly targetChunkLength: number,
|
||||
) {
|
||||
super();
|
||||
this.voiceRecording.onDataAvailable = this.onDataAvailable;
|
||||
}
|
||||
|
@ -22,7 +22,10 @@ export class WidgetType {
|
||||
public static readonly CUSTOM = new WidgetType("m.custom", "m.custom");
|
||||
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 {
|
||||
return type === this.preferred || type === this.legacy;
|
||||
|
@ -39,7 +39,7 @@ const getFakePosthog = (): PostHog =>
|
||||
get_user_state: jest.fn(),
|
||||
},
|
||||
identifyUser: jest.fn(),
|
||||
} as unknown as PostHog);
|
||||
}) as unknown as PostHog;
|
||||
|
||||
interface ITestEvent extends IPosthogEvent {
|
||||
eventName: "JestTestEvents";
|
||||
@ -288,7 +288,7 @@ describe("PosthogAnalytics", () => {
|
||||
id: "0000000",
|
||||
pseudonymousAnalyticsOptIn: true,
|
||||
}),
|
||||
} as unknown as MatrixClient);
|
||||
}) as unknown as MatrixClient;
|
||||
|
||||
beforeEach(async () => {
|
||||
SdkConfig.put({
|
||||
|
@ -43,7 +43,7 @@ describe("AutocompleteInput", () => {
|
||||
const constructMockProvider = (data: ICompletion[]) =>
|
||||
({
|
||||
getCompletions: jest.fn().mockImplementation(async () => data),
|
||||
} as unknown as AutocompleteProvider);
|
||||
}) as unknown as AutocompleteProvider;
|
||||
|
||||
beforeEach(() => {
|
||||
TestUtils.stubClient();
|
||||
|
@ -31,7 +31,7 @@ describe("<ContextMenu />", () => {
|
||||
({
|
||||
windowWidth: windowSize,
|
||||
windowHeight: windowSize,
|
||||
} as unknown as UIStore),
|
||||
}) as unknown as UIStore,
|
||||
);
|
||||
window.Element.prototype.getBoundingClientRect = jest.fn().mockReturnValue({
|
||||
width: menuSize,
|
||||
|
@ -480,7 +480,7 @@ describe("MessageContextMenu", () => {
|
||||
it("shows view in room button when the event is a thread root", () => {
|
||||
const eventContent = createMessageEventContent("hello");
|
||||
const mxEvent = new MatrixEvent({ type: EventType.RoomMessage, content: eventContent });
|
||||
mxEvent.getThread = () => ({ rootEvent: mxEvent } as Thread);
|
||||
mxEvent.getThread = () => ({ rootEvent: mxEvent }) as Thread;
|
||||
const props = {
|
||||
rightClick: true,
|
||||
};
|
||||
|
@ -69,7 +69,7 @@ describe("<SpaceContextMenu />", () => {
|
||||
client: mockClient,
|
||||
getMyMembership: jest.fn(),
|
||||
...props,
|
||||
} as unknown as Room);
|
||||
}) as unknown as Room;
|
||||
|
||||
const defaultProps = {
|
||||
space: makeMockSpace(),
|
||||
|
@ -18,7 +18,6 @@ import React from "react";
|
||||
import { MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix";
|
||||
import { mocked, MockedObject } from "jest-mock";
|
||||
import { render } from "@testing-library/react";
|
||||
import * as prettier from "prettier";
|
||||
|
||||
import { getMockClientWithEventEmitter, mkEvent, mkMessage, mkStubRoom } from "../../../test-utils";
|
||||
import { MatrixClientPeg } from "../../../../src/MatrixClientPeg";
|
||||
@ -225,11 +224,7 @@ describe("<TextualBody />", () => {
|
||||
const ev = mkRoomTextMessage(`Visit https://matrix.to/#/${room1Id}/${defaultEvent.getId()}`);
|
||||
const { container } = getComponent({ mxEvent: ev });
|
||||
const content = container.querySelector(".mx_EventTile_body");
|
||||
expect(
|
||||
prettier.format(content.innerHTML.replace(defaultEvent.getId(), "%event_id%"), {
|
||||
parser: "html",
|
||||
}),
|
||||
).toMatchSnapshot();
|
||||
expect(content.innerHTML.replace(defaultEvent.getId(), "%event_id%")).toMatchSnapshot();
|
||||
});
|
||||
|
||||
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 { container } = getComponent({ mxEvent: ev });
|
||||
const content = container.querySelector(".mx_EventTile_body");
|
||||
expect(
|
||||
prettier.format(content.innerHTML.replace(defaultEvent.getId(), "%event_id%"), {
|
||||
parser: "html",
|
||||
}),
|
||||
).toMatchSnapshot();
|
||||
expect(content.innerHTML.replace(defaultEvent.getId(), "%event_id%")).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -296,71 +296,9 @@ exports[`<TextualBody /> renders formatted m.text correctly pills get injected c
|
||||
</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`] = `
|
||||
"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 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>"`;
|
||||
|
||||
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
|
||||
>
|
||||
"
|
||||
`;
|
||||
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>"`;
|
||||
|
||||
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
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user