Absorb the matrix-react-sdk repository (#28192)

Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
Co-authored-by: github-merge-queue <github-merge-queue@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Florian Duros <florian.duros@ormaz.fr>
Co-authored-by: Kim Brose <kim.brose@nordeck.net>
Co-authored-by: Florian Duros <florianduros@element.io>
Co-authored-by: R Midhun Suresh <hi@midhun.dev>
Co-authored-by: dbkr <986903+dbkr@users.noreply.github.com>
Co-authored-by: ElementRobot <releases@riot.im>
Co-authored-by: dbkr <dbkr@users.noreply.github.com>
Co-authored-by: David Baker <dbkr@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Co-authored-by: David Langley <davidl@element.io>
Co-authored-by: Michael Weimann <michaelw@matrix.org>
Co-authored-by: Timshel <Timshel@users.noreply.github.com>
Co-authored-by: Sahil Silare <32628578+sahil9001@users.noreply.github.com>
Co-authored-by: Will Hunt <will@half-shot.uk>
Co-authored-by: Hubert Chathi <hubert@uhoreg.ca>
Co-authored-by: Andrew Ferrazzutti <andrewf@element.io>
Co-authored-by: Robin <robin@robin.town>
Co-authored-by: Tulir Asokan <tulir@maunium.net>
This commit is contained in:
Michael Telatynski
2024-10-16 13:31:55 +01:00
committed by GitHub
parent 2b99496025
commit c05c429803
3280 changed files with 586617 additions and 905 deletions
@@ -0,0 +1,173 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2022 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
*/
.mx_WysiwygComposer_Editor_container {
@keyframes visualbell {
from {
background-color: $visual-bell-bg-color;
}
to {
background-color: $background;
}
}
.mx_WysiwygComposer_Editor_content {
line-height: $font-22px;
white-space: pre-wrap;
word-wrap: break-word;
outline: none;
overflow-x: hidden;
/* Force caret nodes to be selected in full so that they can be */
/* navigated through in a single keypress */
.caretNode {
user-select: all;
}
// we always have a <br/> tag at the end of the html, we need it to be present at first then hide it as soon as
// we have any other elements
br:not(:only-child) {
display: none;
}
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 */
min-height: $font-22px;
}
ul,
ol {
margin-top: 0;
margin-bottom: 0;
padding-inline-start: $spacing-28;
}
/* Make list type disc to match rich text editor */
ul {
list-style-type: disc;
}
blockquote {
color: #777;
border-left: 2px solid $blockquote-bar-color;
border-radius: 2px;
padding: 0 10px;
margin-block-start: 0;
margin-block-end: 0;
margin-inline-start: 0;
margin-inline-end: 0;
}
> pre {
font-size: $font-15px;
line-height: $font-24px;
margin-top: 0;
margin-bottom: 0;
padding: $spacing-8 $spacing-12;
background-color: $inlinecode-background-color;
border: 1px solid $inlinecode-border-color;
border-radius: 2px;
}
code:not(pre *) {
font-family: $monospace-font-family !important;
background-color: $inlinecode-background-color;
border: 1px solid $inlinecode-border-color;
border-radius: 4px;
padding: $spacing-2;
&:empty {
border: unset;
padding: unset;
}
}
/* this selector represents what will become a pill
nb despite there being mx_UserPill and mx_RoomPill classes appended to these pills
in the current composer, there don't appear to be any styles associated with those classes
in this repo */
a[data-mention-type] {
/* combine mx_Pill from _Pill.pcss */
padding: $font-1px 0.4em;
line-height: $font-17px;
border-radius: $font-16px;
display: inline;
box-sizing: border-box;
max-width: 100%;
overflow: hidden;
color: var(--cpd-color-text-on-solid-primary);
background-color: $pill-bg-color;
/* ...with the overrides from _BasicMessageComposer.pcss */
user-select: all;
position: relative;
cursor: unset; /* We don't want indicate clickability */
text-overflow: ellipsis;
white-space: nowrap;
/* avatar pseudo element */
&::before {
/* After consolidation, all of the styling from _Pill.scss was being overridden,
so take what is in _BasicMessageComposer.pcss as the starting point */
display: inline-block;
content: var(--avatar-letter);
background: var(--avatar-background), $background;
width: $font-16px;
min-width: $font-16px; /* ensure the avatar is not compressed */
height: $font-16px;
line-height: $font-16px;
text-align: center;
/* Get the positioning of the avatar just right for consistency with timeline */
margin-inline-start: -0.4rem;
margin-inline-end: 0.24rem;
vertical-align: 0.12rem;
background-repeat: no-repeat;
background-size: $font-16px;
border-radius: $font-16px;
color: var(--avatar-color, $avatar-initial-color);
font-weight: bold;
font-size: $font-10-4px;
}
}
}
.mx_WysiwygComposer_Editor_content_placeholder::before {
content: var(--placeholder);
width: 0;
height: 0;
overflow: visible;
display: inline-block;
pointer-events: none;
white-space: nowrap;
color: $tertiary-content;
}
}
.mx_WysiwygComposer_AutoCompleteWrapper {
position: relative;
/* Due to the fact that editing a message now has a larger amount of grey
colour above it (due to the rich text buttons above the composer), we need
to give the autocomplete a bit more visual separation by using a border.
*/
> .mx_Autocomplete {
border: 1px solid $quinary-content;
border-radius: 8px;
}
}
@@ -0,0 +1,66 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2022 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
*/
.mx_FormattingButtons {
display: flex;
justify-content: flex-start;
gap: 8px;
.mx_FormattingButtons_Button {
--size: 28px;
cursor: pointer;
height: var(--size);
width: var(--size);
background-color: transparent;
border: none;
display: flex;
align-items: center;
justify-content: center;
border-radius: 5px;
}
.mx_FormattingButtons_Button_hover {
&:hover {
background: $panels;
.mx_FormattingButtons_Icon {
color: $secondary-content;
}
}
}
.mx_FormattingButtons_active {
background: $accent-300;
.mx_FormattingButtons_Icon {
color: $accent;
}
}
.mx_FormattingButtons_disabled {
.mx_FormattingButtons_Icon {
color: $quinary-content;
}
}
.mx_FormattingButtons_Icon {
--size: 16px;
height: var(--size);
width: var(--size);
color: $tertiary-content;
}
}
.mx_FormattingButtons_Tooltip_KeyboardShortcut {
kbd {
text-align: center;
display: inline-block;
text-transform: capitalize;
font-family: Inter, sans-serif;
}
}
@@ -0,0 +1,39 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2022 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
*/
.mx_LinkModal {
padding: $spacing-32;
max-width: 600px;
height: 341px;
box-sizing: border-box;
display: flex;
flex-direction: column;
.mx_LinkModal_content {
display: flex;
flex-direction: column;
flex: 1;
gap: $spacing-8;
margin-top: 7px;
.mx_LinkModal_Field {
flex: initial;
height: 40px;
}
.mx_LinkModal_buttons {
display: flex;
flex: 1;
align-items: flex-end;
.mx_Dialog_buttons {
display: inline-block;
}
}
}
}