Browse Source

Reply fixes

master
morethanwords 3 years ago
parent
commit
79aa7b6f62
  1. 2
      src/components/chat/replyContainer.ts
  2. 8
      src/lib/appManagers/appMessagesManager.ts
  3. 4
      src/lib/langPack.ts
  4. 43
      src/scss/partials/_chat.scss
  5. 17
      src/scss/partials/_chatPinned.scss
  6. 1
      tweb-design

2
src/components/chat/replyContainer.ts

@ -9,6 +9,7 @@ import { getMiddleware } from "../../helpers/middleware";
import { limitSymbols } from "../../helpers/string"; import { limitSymbols } from "../../helpers/string";
import appImManager, { CHAT_ANIMATION_GROUP } from "../../lib/appManagers/appImManager"; import appImManager, { CHAT_ANIMATION_GROUP } from "../../lib/appManagers/appImManager";
import appMessagesManager from "../../lib/appManagers/appMessagesManager"; import appMessagesManager from "../../lib/appManagers/appMessagesManager";
import appPhotosManager from "../../lib/appManagers/appPhotosManager";
import { RichTextProcessor } from "../../lib/richtextprocessor"; import { RichTextProcessor } from "../../lib/richtextprocessor";
import DivAndCaption from "../divAndCaption"; import DivAndCaption from "../divAndCaption";
import { wrapPhoto, wrapSticker } from "../wrappers"; import { wrapPhoto, wrapSticker } from "../wrappers";
@ -80,6 +81,7 @@ export function wrapReplyDivAndCaption(options: {
container: mediaEl, container: mediaEl,
boxWidth: MEDIA_SIZE, boxWidth: MEDIA_SIZE,
boxHeight: MEDIA_SIZE, boxHeight: MEDIA_SIZE,
size: appPhotosManager.choosePhotoSize(photo, MEDIA_SIZE, MEDIA_SIZE),
middleware, middleware,
lazyLoadQueue, lazyLoadQueue,
noBlur: true, noBlur: true,

8
src/lib/appManagers/appMessagesManager.ts

@ -2574,8 +2574,8 @@ export class AppMessagesManager {
addPart(undefined, plain ? prefix + media.game.title : RichTextProcessor.wrapEmojiText(prefix + media.game.title)); addPart(undefined, plain ? prefix + media.game.title : RichTextProcessor.wrapEmojiText(prefix + media.game.title));
break; break;
} }
case 'messageMediaDocument': case 'messageMediaDocument': {
let document = media.document; const document = media.document;
if(document.type === 'video') { if(document.type === 'video') {
addPart('AttachVideo', undefined, message.message); addPart('AttachVideo', undefined, message.message);
@ -2586,13 +2586,15 @@ export class AppMessagesManager {
} else if(document.type === 'round') { } else if(document.type === 'round') {
addPart('AttachRound', undefined, message.message); addPart('AttachRound', undefined, message.message);
} else if(document.type === 'sticker') { } else if(document.type === 'sticker') {
addPart(undefined, ((plain ? document.stickerEmojiRaw : document.stickerEmoji) || '') + 'Sticker'); addPart(undefined, ((plain ? document.stickerEmojiRaw : document.stickerEmoji) || ''));
addPart('AttachSticker');
text = ''; text = '';
} else { } else {
addPart(undefined, plain ? document.file_name : RichTextProcessor.wrapEmojiText(document.file_name), message.message); addPart(undefined, plain ? document.file_name : RichTextProcessor.wrapEmojiText(document.file_name), message.message);
} }
break; break;
}
default: default:
//messageText += media._; //messageText += media._;

4
src/lib/langPack.ts

@ -418,8 +418,8 @@ export {i18n_};
const _i18n = I18n._i18n; const _i18n = I18n._i18n;
export {_i18n}; export {_i18n};
export function join(elements: HTMLElement[], useLast = true) { export function join(elements: (Node | string)[], useLast = true) {
const arr: HTMLElement[] = elements.slice(0, 1); const arr = elements.slice(0, 1);
for(let i = 1; i < elements.length; ++i) { for(let i = 1; i < elements.length; ++i) {
const isLast = (elements.length - 1) === i; const isLast = (elements.length - 1) === i;
const delimiterKey: LangPackKey = isLast && useLast ? 'WordDelimiterLast' : 'WordDelimiter'; const delimiterKey: LangPackKey = isLast && useLast ? 'WordDelimiterLast' : 'WordDelimiter';

43
src/scss/partials/_chat.scss

@ -5,7 +5,7 @@
*/ */
$btn-send-margin: .5rem; $btn-send-margin: .5rem;
$chat-helper-size: 39px; $chat-helper-size: 36px;
/* #bubble-contextmenu > div { /* #bubble-contextmenu > div {
padding: 0 5.25 0 1rem; padding: 0 5.25 0 1rem;
@ -136,7 +136,7 @@ $chat-helper-size: 39px;
} }
@media only screen and (max-height: 30rem) { @media only screen and (max-height: 30rem) {
max-height: unquote('max(39px, calc(100vh - 10rem))'); max-height: unquote('max(36px, calc(100vh - 10rem))');
} }
@include respond-to(handhelds) { @include respond-to(handhelds) {
@ -861,9 +861,9 @@ $chat-helper-size: 39px;
align-items: center; align-items: center;
width: 100%; width: 100%;
position: relative; position: relative;
z-index: 2; // z-index: 2;
background-color: inherit; background-color: inherit;
border-radius: 12px; border-radius: .75rem;
padding: var(--padding); padding: var(--padding);
} }
@ -879,16 +879,22 @@ $chat-helper-size: 39px;
height: 0; height: 0;
width: calc(100% - var(--padding-horizontal) * 2); width: calc(100% - var(--padding-horizontal) * 2);
padding: 0; padding: 0;
margin-top: .3125rem;//var(--padding-vertical); margin-top: .5625rem;//var(--padding-vertical);
margin-bottom: -.3125rem; margin-bottom: -.5625rem;
transition: height var(--layer-transition);
//height: calc(#{$chat-helper-size} + .3125rem); //height: calc(#{$chat-helper-size} + .3125rem);
align-items: flex-start; align-items: center;
user-select: none; user-select: none;
z-index: 2; z-index: 2;
opacity: 0;
pointer-events: none;
@include animation-level(0) { @include animation-level(2) {
transition: none; transition: height var(--layer-transition), opacity var(--layer-transition);
}
@include respond-to(esg-bottom-new) {
margin-top: .3125rem;
margin-bottom: -.3125rem;
} }
/* @include respond-to(handhelds) { /* @include respond-to(handhelds) {
@ -902,7 +908,9 @@ $chat-helper-size: 39px;
} */ } */
.chat.is-helper-active & { .chat.is-helper-active & {
height: 39px; pointer-events: unset;
height: #{$chat-helper-size};
opacity: 1;
} }
/* &.active { /* &.active {
@ -911,13 +919,18 @@ $chat-helper-size: 39px;
.reply { .reply {
width: 100%; width: 100%;
margin-left: .5rem; margin: 0 .625rem;
min-height: 35px; // min-height: 35px;
&-title {
margin-top: -1px;
margin-bottom: 1px;
}
} }
span.emoji { /* span.emoji {
font-size: .8rem; font-size: .8rem;
} } */
} }
.new-message-wrapper { .new-message-wrapper {

17
src/scss/partials/_chatPinned.scss

@ -128,7 +128,7 @@
overflow: hidden; overflow: hidden;
box-sizing: border-box; box-sizing: border-box;
margin-right: 1rem; margin-right: 1rem;
max-height: 35px; // max-height: 35px;
position: relative; position: relative;
user-select: none; user-select: none;
/* padding: .25rem; */ /* padding: .25rem; */
@ -145,9 +145,6 @@
overflow: hidden; overflow: hidden;
pointer-events: none; pointer-events: none;
position: relative; position: relative;
display: flex;
flex-direction: column;
justify-content: space-between;
margin-left: .5rem; margin-left: .5rem;
} }
@ -169,7 +166,7 @@
overflow: hidden; overflow: hidden;
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: .125rem;
&.is-round { &.is-round {
border-radius: 50%; border-radius: 50%;
@ -224,13 +221,17 @@
background: var(--primary-color); background: var(--primary-color);
} }
&-content { /* &-content {
height: 2rem; height: 2rem;
} } */
&-media { &-media {
border-radius: .25rem; border-radius: .25rem;
} }
&-cancel {
margin-bottom: 0 !important;
}
} }
.pinned-container { .pinned-container {
@ -299,7 +300,7 @@
overflow: hidden; overflow: hidden;
align-items: center; align-items: center;
padding: .25rem; padding: .25rem;
border-radius: 4px; border-radius: .25rem;
/* html.no-touch &:hover { /* html.no-touch &:hover {
background-color: var(--light-secondary-text-color); background-color: var(--light-secondary-text-color);

1
tweb-design

@ -0,0 +1 @@
Subproject commit d7664548de0373baa27e006bbe1f62467f566277
Loading…
Cancel
Save