From 46f6b22e83647da0445ed7d380eef4e564b81dd6 Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Wed, 11 Oct 2023 18:13:18 +0200 Subject: [PATCH] add message text rtl support provided for: Quote component, system messages, user messages (markdown), NewMessage input Signed-off-by: Maksim Sukharev --- .../MessagesGroup/Message/Message.vue | 50 +++++++++++-------- src/components/NewMessage/NewMessage.vue | 1 + src/components/Quote.vue | 3 +- 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/src/components/MessagesList/MessagesGroup/Message/Message.vue b/src/components/MessagesList/MessagesGroup/Message/Message.vue index d9e2cb3ae38e..cdbef8df3b45 100644 --- a/src/components/MessagesList/MessagesGroup/Message/Message.vue +++ b/src/components/MessagesList/MessagesGroup/Message/Message.vue @@ -54,6 +54,7 @@ the main body of the message as well as a quote. @@ -61,6 +62,7 @@ the main body of the message as well as a quote.
@@ -992,6 +996,10 @@ export default { display: flex; border-radius: var(--border-radius-large); align-items: center; + :deep(.rich-text--wrapper) { + flex-grow: 1; + text-align: start; + } } &--quote { @@ -1120,17 +1128,18 @@ export default { } .message-body__main__text--markdown { - position: relative; + position: relative; - .message-copy-code { - position: absolute; - top: 0; - right: 4px; - margin-top: 4px; - background-color: var(--color-background-dark); - } + .message-copy-code { + position: absolute; + top: 0; + right: 4px; + margin-top: 4px; + background-color: var(--color-background-dark); + } :deep(.rich-text--wrapper) { + text-align: start; // Overwrite core styles, otherwise h4 is lesser than default font-size h4 { font-size: 100%; @@ -1140,6 +1149,12 @@ export default { font-style: italic; } + ul, + ol { + padding-left: 0; + padding-inline-start: 15px; + } + pre { padding: 4px; margin: 2px 0; @@ -1162,20 +1177,15 @@ export default { } blockquote { - position: relative; + padding-left: 0; + padding-inline-start: 13px; border-left: none; - - &::before { - content: ' '; - position: absolute; - top: 0; - left: 0; - height: 100%; - width: 4px; - border-radius: 2px; - background-color: var(--color-border); - } + border-inline-start: 4px solid var(--color-border); } } } + +:deep(.rich-text--component) { + direction: ltr; +} diff --git a/src/components/NewMessage/NewMessage.vue b/src/components/NewMessage/NewMessage.vue index c87dc20561ef..dad62babc322 100644 --- a/src/components/NewMessage/NewMessage.vue +++ b/src/components/NewMessage/NewMessage.vue @@ -91,6 +91,7 @@ :menu-container="containerElement" :placeholder="placeholderText" :aria-label="placeholderText" + dir="auto" @shortkey="focusInput" @keydown.esc="handleInputEsc" @tribute-active-true.native="isTributePickerActive = true" diff --git a/src/components/Quote.vue b/src/components/Quote.vue index f2cc1820b351..e16ed39890fc 100644 --- a/src/components/Quote.vue +++ b/src/components/Quote.vue @@ -49,7 +49,7 @@ components.
-

{{ shortenedQuoteMessage }}

+

{{ shortenedQuoteMessage }}

@@ -313,6 +313,7 @@ export default { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; + text-align: start; } } }