@uzum-tech/ui 1.12.12 → 1.12.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2591 -2638
- package/dist/index.prod.js +3 -3
- package/es/chat/src/ChatListItems.js +14 -16
- package/es/chat/src/ChatMessages.d.ts +0 -1
- package/es/chat/src/ChatMessages.js +16 -38
- package/es/chat/src/ChatParts/MainArea.js +15 -3
- package/es/chat/src/styles/index.cssr.js +15 -33
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/chat/src/ChatListItems.js +14 -16
- package/lib/chat/src/ChatMessages.d.ts +0 -1
- package/lib/chat/src/ChatMessages.js +16 -38
- package/lib/chat/src/ChatParts/MainArea.js +15 -3
- package/lib/chat/src/styles/index.cssr.js +15 -33
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -10,6 +10,7 @@ import { chatLight } from '../styles';
|
|
|
10
10
|
import { useConfig, useTheme, useThemeClass, useLocale } from '../../_mixins';
|
|
11
11
|
import { CheckmarkDoneSharp, MdTime, PersonOutline, Refresh } from '../../_internal/icons';
|
|
12
12
|
import { UFlex } from '../../flex';
|
|
13
|
+
import { UText } from '../../typography';
|
|
13
14
|
const statusIconMapper = {
|
|
14
15
|
[MessageStatus.READ]: CheckmarkDoneSharp,
|
|
15
16
|
[MessageStatus.PENDING]: MdTime,
|
|
@@ -127,24 +128,21 @@ export default defineComponent({
|
|
|
127
128
|
: '?';
|
|
128
129
|
}
|
|
129
130
|
})),
|
|
130
|
-
header: () => (h(
|
|
131
|
-
|
|
131
|
+
header: () => (h(UText, { class: `${mergedClsPrefixRef.value}-chat-sidebar__item-title`, variant: "body-l-medium" }, {
|
|
132
|
+
default: () => typeof item.title === 'function' ? item.title() : item.title
|
|
133
|
+
})),
|
|
134
|
+
description: () => (h(UText, { class: [
|
|
132
135
|
`${mergedClsPrefixRef.value}-chat-sidebar__item-subtitle`,
|
|
133
136
|
isTyping && 'typing'
|
|
134
|
-
],
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
: typeof item.subtitle === 'string'
|
|
144
|
-
? item.subtitle
|
|
145
|
-
: typeof item.subtitle === 'function'
|
|
146
|
-
? item.subtitle()
|
|
147
|
-
: item.subtitle)),
|
|
137
|
+
], variant: "body-m-medium" }, {
|
|
138
|
+
default: () => isTyping
|
|
139
|
+
? mergedTypingTextRef.value
|
|
140
|
+
: typeof item.subtitle === 'string'
|
|
141
|
+
? item.subtitle
|
|
142
|
+
: typeof item.subtitle === 'function'
|
|
143
|
+
? item.subtitle()
|
|
144
|
+
: item.subtitle
|
|
145
|
+
})),
|
|
148
146
|
suffix: () => {
|
|
149
147
|
const displayUnreadCount = item.unreadCount || 0;
|
|
150
148
|
const hasUnreadIncoming = displayUnreadCount > 0;
|
|
@@ -6205,7 +6205,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6205
6205
|
}>;
|
|
6206
6206
|
renderMessage: (message: ChatMessageData) => JSX.Element;
|
|
6207
6207
|
renderMarkMessage: (message: ChatMessageData) => JSX.Element;
|
|
6208
|
-
renderTypingIndicator: () => JSX.Element;
|
|
6209
6208
|
renderSkeletonMessage: (isOwn: boolean, index: number) => JSX.Element;
|
|
6210
6209
|
renderDateSeparator: (date: string) => JSX.Element;
|
|
6211
6210
|
renderUnreadNotification: () => JSX.Element;
|
|
@@ -95,7 +95,6 @@ export default defineComponent({
|
|
|
95
95
|
};
|
|
96
96
|
});
|
|
97
97
|
const themeClassHandle = useThemeClass('chat-messages', computed(() => ''), cssVarsRef, props);
|
|
98
|
-
const mergedTypingTextRef = computed(() => { var _a; return (_a = props.typingText) !== null && _a !== void 0 ? _a : localeRef.value.typingText; });
|
|
99
98
|
const mergedRetryTextRef = computed(() => { var _a; return (_a = props.retryText) !== null && _a !== void 0 ? _a : localeRef.value.retryText; });
|
|
100
99
|
const mergedUnreadNotificationTextRef = computed(() => { var _a; return (_a = props.unreadNotificationText) !== null && _a !== void 0 ? _a : localeRef.value.unreadNotificationText; });
|
|
101
100
|
const unreadMessagesCount = computed(() => {
|
|
@@ -260,23 +259,6 @@ export default defineComponent({
|
|
|
260
259
|
], theme: themeRef.value.peers.StatusIcon, themeOverrides: themeRef.value.peerOverrides.StatusIcon }))))))))));
|
|
261
260
|
return messageContent;
|
|
262
261
|
};
|
|
263
|
-
const renderTypingIndicator = () => {
|
|
264
|
-
return (h("div", { class: [
|
|
265
|
-
`${mergedClsPrefixRef.value}-chat-main__message`,
|
|
266
|
-
`${mergedClsPrefixRef.value}-chat-main__message--other`
|
|
267
|
-
] },
|
|
268
|
-
h("div", { class: `${mergedClsPrefixRef.value}-chat-main__message-wrapper` },
|
|
269
|
-
h("div", { class: [
|
|
270
|
-
`${mergedClsPrefixRef.value}-chat-main__message-bubble`,
|
|
271
|
-
`${mergedClsPrefixRef.value}-chat-main__message-bubble--other`,
|
|
272
|
-
`${mergedClsPrefixRef.value}-chat-main__message-bubble--typing`
|
|
273
|
-
] }),
|
|
274
|
-
h("div", { class: [
|
|
275
|
-
`${mergedClsPrefixRef.value}-chat-main__message-meta`,
|
|
276
|
-
`${mergedClsPrefixRef.value}-chat-main__message-meta--other`
|
|
277
|
-
] },
|
|
278
|
-
h("span", { class: `${mergedClsPrefixRef.value}-chat-main__message-time` }, mergedTypingTextRef.value)))));
|
|
279
|
-
};
|
|
280
262
|
const renderSkeletonMessage = (isOwn, index) => {
|
|
281
263
|
return (h("div", { key: `skeleton-${index}`, class: [
|
|
282
264
|
`${mergedClsPrefixRef.value}-chat-main__message`,
|
|
@@ -306,7 +288,6 @@ export default defineComponent({
|
|
|
306
288
|
mergedTheme: themeRef,
|
|
307
289
|
renderMessage,
|
|
308
290
|
renderMarkMessage,
|
|
309
|
-
renderTypingIndicator,
|
|
310
291
|
renderSkeletonMessage,
|
|
311
292
|
renderDateSeparator,
|
|
312
293
|
renderUnreadNotification,
|
|
@@ -320,9 +301,9 @@ export default defineComponent({
|
|
|
320
301
|
};
|
|
321
302
|
},
|
|
322
303
|
render() {
|
|
323
|
-
var _a, _b
|
|
304
|
+
var _a, _b;
|
|
324
305
|
(_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
325
|
-
const { mergedClsPrefixRef, renderMessage, renderMarkMessage,
|
|
306
|
+
const { mergedClsPrefixRef, renderMessage, renderMarkMessage, renderSkeletonMessage, renderDateSeparator, renderUnreadNotification } = this;
|
|
326
307
|
if (this.loading) {
|
|
327
308
|
return (h("div", { class: [`${mergedClsPrefixRef}-chat`, this.themeClass], style: this.cssVars },
|
|
328
309
|
h("div", { class: `${mergedClsPrefixRef}-chat-main`, style: {
|
|
@@ -383,7 +364,6 @@ export default defineComponent({
|
|
|
383
364
|
id: 'unread-notification'
|
|
384
365
|
});
|
|
385
366
|
}
|
|
386
|
-
const isTyping = this.selectedChatId && ((_c = this.typingChatIds) === null || _c === void 0 ? void 0 : _c.includes(this.selectedChatId));
|
|
387
367
|
return (h("div", { class: [`${mergedClsPrefixRef}-chat`, this.themeClass], style: this.cssVars },
|
|
388
368
|
h("div", { class: `${mergedClsPrefixRef}-chat-main`, style: {
|
|
389
369
|
border: 'none',
|
|
@@ -398,21 +378,19 @@ export default defineComponent({
|
|
|
398
378
|
event.preventDefault();
|
|
399
379
|
this.contextMenuShow = false;
|
|
400
380
|
}
|
|
401
|
-
} },
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
}),
|
|
416
|
-
isTyping && renderTypingIndicator()))));
|
|
381
|
+
} }, messagesWithDates.map((item) => {
|
|
382
|
+
var _a;
|
|
383
|
+
if (item.type === 'date-separator') {
|
|
384
|
+
return renderDateSeparator((_a = item.date) !== null && _a !== void 0 ? _a : '');
|
|
385
|
+
}
|
|
386
|
+
if (item.type === 'unread-notification') {
|
|
387
|
+
return renderUnreadNotification();
|
|
388
|
+
}
|
|
389
|
+
const message = item;
|
|
390
|
+
if (message.type === ChatMessageType.MARK) {
|
|
391
|
+
return renderMarkMessage(message);
|
|
392
|
+
}
|
|
393
|
+
return renderMessage(message);
|
|
394
|
+
})))));
|
|
417
395
|
}
|
|
418
396
|
});
|
|
@@ -44,6 +44,11 @@ export default defineComponent({
|
|
|
44
44
|
return 0;
|
|
45
45
|
return messagesRef.value.filter((msg) => !msg.isOwn && msg.status === MessageStatus.UNREAD).length;
|
|
46
46
|
});
|
|
47
|
+
const isTyping = computed(() => {
|
|
48
|
+
if (!selectedChatRef.value || !typingChatIdsRef.value)
|
|
49
|
+
return false;
|
|
50
|
+
return typingChatIdsRef.value.includes(selectedChatRef.value.id);
|
|
51
|
+
});
|
|
47
52
|
const showNotificationManually = ref(false);
|
|
48
53
|
const hasUnreadMessages = ref(false);
|
|
49
54
|
const unreadCountOnOpen = ref(0);
|
|
@@ -183,9 +188,16 @@ export default defineComponent({
|
|
|
183
188
|
const keyId = toKeyString(chat === null || chat === void 0 ? void 0 : chat.id);
|
|
184
189
|
const keyTitle = toKeyString(chat === null || chat === void 0 ? void 0 : chat.title);
|
|
185
190
|
return (h(Fragment, null,
|
|
186
|
-
h(
|
|
187
|
-
|
|
188
|
-
|
|
191
|
+
h(UFlex, { vertical: true, size: [0, 0], justify: 'flex-start"' },
|
|
192
|
+
h(UText, { key: `${keyId}-${keyTitle}`, variant: "heading-s-bold", class: `${mergedClsPrefixRef.value}-chat-main__header-title`, theme: mergedThemeRef.value.peers.Typography, themeOverrides: mergedThemeRef.value.peerOverrides.Typography }, {
|
|
193
|
+
default: () => { var _a, _b; return (_b = (_a = selectedChatRef.value) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : ''; }
|
|
194
|
+
}),
|
|
195
|
+
isTyping.value && (h(UText, { class: [
|
|
196
|
+
`${mergedClsPrefixRef.value}-chat-main__header-subtitle`,
|
|
197
|
+
'typing'
|
|
198
|
+
], variant: "body-m-medium" }, {
|
|
199
|
+
default: () => { var _a; return (_a = typingTextRef.value) !== null && _a !== void 0 ? _a : ''; }
|
|
200
|
+
}))),
|
|
189
201
|
h(UFlex, { align: "center", size: "small", class: `${mergedClsPrefixRef.value}-chat-main__header-actions` }, {
|
|
190
202
|
default: () => resolveSlot(slots.headerActions, () => {
|
|
191
203
|
const shareButtonProps = Object.assign(Object.assign({}, headerButtonPropsRef.value), headerShareButtonPropsRef.value);
|
|
@@ -72,53 +72,28 @@ export default cB('chat', `
|
|
|
72
72
|
background-color: var(--u-sidebar-item-background-color-selected);
|
|
73
73
|
`, [c('&:hover', `
|
|
74
74
|
background-color: var(--u-sidebar-item-background-color-selected);
|
|
75
|
-
`)]),
|
|
76
|
-
.u-list-item__description {
|
|
77
|
-
color: var(--u-color-primary) !important;
|
|
78
|
-
font-style: italic;
|
|
79
|
-
}
|
|
80
|
-
`), c('&:hover', `
|
|
75
|
+
`)]), c('&:hover', `
|
|
81
76
|
background-color: var(--u-sidebar-item-background-color-hover);
|
|
82
77
|
`, [cM('selected', `
|
|
83
78
|
background-color: var(--u-sidebar-item-background-color-selected);
|
|
84
79
|
`)])]), cE('item-title', `
|
|
85
|
-
font-weight: 500;
|
|
86
|
-
font-size: 14px;
|
|
87
|
-
line-height: 20px;
|
|
88
80
|
color: var(--u-sidebar-item-text-color);
|
|
89
81
|
overflow: hidden;
|
|
90
82
|
text-overflow: ellipsis;
|
|
91
83
|
white-space: nowrap;
|
|
84
|
+
margin-bottom: 0;
|
|
92
85
|
`), cE('item-subtitle', `
|
|
93
|
-
|
|
94
|
-
line-height: 16px;
|
|
86
|
+
display: block;
|
|
95
87
|
color: var(--u-sidebar-item-subtitle-color);
|
|
96
88
|
overflow: hidden;
|
|
97
89
|
text-overflow: ellipsis;
|
|
98
90
|
white-space: nowrap;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
`)]), cE('item-main', `
|
|
91
|
+
minWidth: 0;
|
|
92
|
+
maxWidth: 100%;
|
|
93
|
+
`), cE('item-main', `
|
|
103
94
|
flex: 1;
|
|
104
95
|
min-width: 0;
|
|
105
96
|
margin-right: 12px;
|
|
106
|
-
`), cE('item-title', `
|
|
107
|
-
font-weight: 500;
|
|
108
|
-
font-size: 14px;
|
|
109
|
-
line-height: 20px;
|
|
110
|
-
color: var(--u-text-color-base);
|
|
111
|
-
margin-bottom: 2px;
|
|
112
|
-
overflow: hidden;
|
|
113
|
-
text-overflow: ellipsis;
|
|
114
|
-
white-space: nowrap;
|
|
115
|
-
`), cE('item-subtitle', `
|
|
116
|
-
font-size: 12px;
|
|
117
|
-
line-height: 16px;
|
|
118
|
-
color: var(--u-text-color-disabled);
|
|
119
|
-
overflow: hidden;
|
|
120
|
-
text-overflow: ellipsis;
|
|
121
|
-
white-space: nowrap;
|
|
122
97
|
`), cE('item-indicators', `
|
|
123
98
|
display: flex;
|
|
124
99
|
flex-direction: column;
|
|
@@ -157,10 +132,9 @@ export default cB('chat', `
|
|
|
157
132
|
`, [cE('header', `
|
|
158
133
|
border-bottom: 1px solid var(--u-border-color);
|
|
159
134
|
width: 100%;
|
|
160
|
-
padding: 24px 20px
|
|
135
|
+
padding: 24px 20px 10px 24px;
|
|
161
136
|
flex-shrink: 0;
|
|
162
137
|
`), cE('header-title', `
|
|
163
|
-
margin-top: 9px;
|
|
164
138
|
color: var(--u-header-title-color);
|
|
165
139
|
flex: 1;
|
|
166
140
|
min-width: 0;
|
|
@@ -169,6 +143,14 @@ export default cB('chat', `
|
|
|
169
143
|
white-space: nowrap;
|
|
170
144
|
display: block;
|
|
171
145
|
margin-right: 16px;
|
|
146
|
+
`), cE('header-subtitle', `
|
|
147
|
+
display: block;
|
|
148
|
+
color: var(--u-sidebar-item-subtitle-color);
|
|
149
|
+
overflow: hidden;
|
|
150
|
+
text-overflow: ellipsis;
|
|
151
|
+
white-space: nowrap;
|
|
152
|
+
minWidth: 0;
|
|
153
|
+
maxWidth: 100%;
|
|
172
154
|
`), cE('header-actions', `
|
|
173
155
|
padding: 4px;
|
|
174
156
|
flex-shrink: 0;
|
package/es/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.12.
|
|
1
|
+
declare const _default: "1.12.13";
|
|
2
2
|
export default _default;
|
package/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.12.
|
|
1
|
+
export default '1.12.13';
|
|
@@ -16,6 +16,7 @@ const styles_1 = require("../styles");
|
|
|
16
16
|
const _mixins_1 = require("../../_mixins");
|
|
17
17
|
const icons_1 = require("../../_internal/icons");
|
|
18
18
|
const flex_1 = require("../../flex");
|
|
19
|
+
const typography_1 = require("../../typography");
|
|
19
20
|
const statusIconMapper = {
|
|
20
21
|
[interface_1.MessageStatus.READ]: icons_1.CheckmarkDoneSharp,
|
|
21
22
|
[interface_1.MessageStatus.PENDING]: icons_1.MdTime,
|
|
@@ -133,24 +134,21 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
133
134
|
: '?';
|
|
134
135
|
}
|
|
135
136
|
})),
|
|
136
|
-
header: () => ((0, vue_1.h)(
|
|
137
|
-
|
|
137
|
+
header: () => ((0, vue_1.h)(typography_1.UText, { class: `${mergedClsPrefixRef.value}-chat-sidebar__item-title`, variant: "body-l-medium" }, {
|
|
138
|
+
default: () => typeof item.title === 'function' ? item.title() : item.title
|
|
139
|
+
})),
|
|
140
|
+
description: () => ((0, vue_1.h)(typography_1.UText, { class: [
|
|
138
141
|
`${mergedClsPrefixRef.value}-chat-sidebar__item-subtitle`,
|
|
139
142
|
isTyping && 'typing'
|
|
140
|
-
],
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
: typeof item.subtitle === 'string'
|
|
150
|
-
? item.subtitle
|
|
151
|
-
: typeof item.subtitle === 'function'
|
|
152
|
-
? item.subtitle()
|
|
153
|
-
: item.subtitle)),
|
|
143
|
+
], variant: "body-m-medium" }, {
|
|
144
|
+
default: () => isTyping
|
|
145
|
+
? mergedTypingTextRef.value
|
|
146
|
+
: typeof item.subtitle === 'string'
|
|
147
|
+
? item.subtitle
|
|
148
|
+
: typeof item.subtitle === 'function'
|
|
149
|
+
? item.subtitle()
|
|
150
|
+
: item.subtitle
|
|
151
|
+
})),
|
|
154
152
|
suffix: () => {
|
|
155
153
|
const displayUnreadCount = item.unreadCount || 0;
|
|
156
154
|
const hasUnreadIncoming = displayUnreadCount > 0;
|
|
@@ -6205,7 +6205,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6205
6205
|
}>;
|
|
6206
6206
|
renderMessage: (message: ChatMessageData) => JSX.Element;
|
|
6207
6207
|
renderMarkMessage: (message: ChatMessageData) => JSX.Element;
|
|
6208
|
-
renderTypingIndicator: () => JSX.Element;
|
|
6209
6208
|
renderSkeletonMessage: (isOwn: boolean, index: number) => JSX.Element;
|
|
6210
6209
|
renderDateSeparator: (date: string) => JSX.Element;
|
|
6211
6210
|
renderUnreadNotification: () => JSX.Element;
|
|
@@ -101,7 +101,6 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
101
101
|
};
|
|
102
102
|
});
|
|
103
103
|
const themeClassHandle = (0, _mixins_1.useThemeClass)('chat-messages', (0, vue_1.computed)(() => ''), cssVarsRef, props);
|
|
104
|
-
const mergedTypingTextRef = (0, vue_1.computed)(() => { var _a; return (_a = props.typingText) !== null && _a !== void 0 ? _a : localeRef.value.typingText; });
|
|
105
104
|
const mergedRetryTextRef = (0, vue_1.computed)(() => { var _a; return (_a = props.retryText) !== null && _a !== void 0 ? _a : localeRef.value.retryText; });
|
|
106
105
|
const mergedUnreadNotificationTextRef = (0, vue_1.computed)(() => { var _a; return (_a = props.unreadNotificationText) !== null && _a !== void 0 ? _a : localeRef.value.unreadNotificationText; });
|
|
107
106
|
const unreadMessagesCount = (0, vue_1.computed)(() => {
|
|
@@ -266,23 +265,6 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
266
265
|
], theme: themeRef.value.peers.StatusIcon, themeOverrides: themeRef.value.peerOverrides.StatusIcon }))))))))));
|
|
267
266
|
return messageContent;
|
|
268
267
|
};
|
|
269
|
-
const renderTypingIndicator = () => {
|
|
270
|
-
return ((0, vue_1.h)("div", { class: [
|
|
271
|
-
`${mergedClsPrefixRef.value}-chat-main__message`,
|
|
272
|
-
`${mergedClsPrefixRef.value}-chat-main__message--other`
|
|
273
|
-
] },
|
|
274
|
-
(0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-chat-main__message-wrapper` },
|
|
275
|
-
(0, vue_1.h)("div", { class: [
|
|
276
|
-
`${mergedClsPrefixRef.value}-chat-main__message-bubble`,
|
|
277
|
-
`${mergedClsPrefixRef.value}-chat-main__message-bubble--other`,
|
|
278
|
-
`${mergedClsPrefixRef.value}-chat-main__message-bubble--typing`
|
|
279
|
-
] }),
|
|
280
|
-
(0, vue_1.h)("div", { class: [
|
|
281
|
-
`${mergedClsPrefixRef.value}-chat-main__message-meta`,
|
|
282
|
-
`${mergedClsPrefixRef.value}-chat-main__message-meta--other`
|
|
283
|
-
] },
|
|
284
|
-
(0, vue_1.h)("span", { class: `${mergedClsPrefixRef.value}-chat-main__message-time` }, mergedTypingTextRef.value)))));
|
|
285
|
-
};
|
|
286
268
|
const renderSkeletonMessage = (isOwn, index) => {
|
|
287
269
|
return ((0, vue_1.h)("div", { key: `skeleton-${index}`, class: [
|
|
288
270
|
`${mergedClsPrefixRef.value}-chat-main__message`,
|
|
@@ -312,7 +294,6 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
312
294
|
mergedTheme: themeRef,
|
|
313
295
|
renderMessage,
|
|
314
296
|
renderMarkMessage,
|
|
315
|
-
renderTypingIndicator,
|
|
316
297
|
renderSkeletonMessage,
|
|
317
298
|
renderDateSeparator,
|
|
318
299
|
renderUnreadNotification,
|
|
@@ -326,9 +307,9 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
326
307
|
};
|
|
327
308
|
},
|
|
328
309
|
render() {
|
|
329
|
-
var _a, _b
|
|
310
|
+
var _a, _b;
|
|
330
311
|
(_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
331
|
-
const { mergedClsPrefixRef, renderMessage, renderMarkMessage,
|
|
312
|
+
const { mergedClsPrefixRef, renderMessage, renderMarkMessage, renderSkeletonMessage, renderDateSeparator, renderUnreadNotification } = this;
|
|
332
313
|
if (this.loading) {
|
|
333
314
|
return ((0, vue_1.h)("div", { class: [`${mergedClsPrefixRef}-chat`, this.themeClass], style: this.cssVars },
|
|
334
315
|
(0, vue_1.h)("div", { class: `${mergedClsPrefixRef}-chat-main`, style: {
|
|
@@ -389,7 +370,6 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
389
370
|
id: 'unread-notification'
|
|
390
371
|
});
|
|
391
372
|
}
|
|
392
|
-
const isTyping = this.selectedChatId && ((_c = this.typingChatIds) === null || _c === void 0 ? void 0 : _c.includes(this.selectedChatId));
|
|
393
373
|
return ((0, vue_1.h)("div", { class: [`${mergedClsPrefixRef}-chat`, this.themeClass], style: this.cssVars },
|
|
394
374
|
(0, vue_1.h)("div", { class: `${mergedClsPrefixRef}-chat-main`, style: {
|
|
395
375
|
border: 'none',
|
|
@@ -404,21 +384,19 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
404
384
|
event.preventDefault();
|
|
405
385
|
this.contextMenuShow = false;
|
|
406
386
|
}
|
|
407
|
-
} },
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
}),
|
|
422
|
-
isTyping && renderTypingIndicator()))));
|
|
387
|
+
} }, messagesWithDates.map((item) => {
|
|
388
|
+
var _a;
|
|
389
|
+
if (item.type === 'date-separator') {
|
|
390
|
+
return renderDateSeparator((_a = item.date) !== null && _a !== void 0 ? _a : '');
|
|
391
|
+
}
|
|
392
|
+
if (item.type === 'unread-notification') {
|
|
393
|
+
return renderUnreadNotification();
|
|
394
|
+
}
|
|
395
|
+
const message = item;
|
|
396
|
+
if (message.type === interface_1.ChatMessageType.MARK) {
|
|
397
|
+
return renderMarkMessage(message);
|
|
398
|
+
}
|
|
399
|
+
return renderMessage(message);
|
|
400
|
+
})))));
|
|
423
401
|
}
|
|
424
402
|
});
|
|
@@ -49,6 +49,11 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
49
49
|
return 0;
|
|
50
50
|
return messagesRef.value.filter((msg) => !msg.isOwn && msg.status === interface_1.MessageStatus.UNREAD).length;
|
|
51
51
|
});
|
|
52
|
+
const isTyping = (0, vue_1.computed)(() => {
|
|
53
|
+
if (!selectedChatRef.value || !typingChatIdsRef.value)
|
|
54
|
+
return false;
|
|
55
|
+
return typingChatIdsRef.value.includes(selectedChatRef.value.id);
|
|
56
|
+
});
|
|
52
57
|
const showNotificationManually = (0, vue_1.ref)(false);
|
|
53
58
|
const hasUnreadMessages = (0, vue_1.ref)(false);
|
|
54
59
|
const unreadCountOnOpen = (0, vue_1.ref)(0);
|
|
@@ -188,9 +193,16 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
188
193
|
const keyId = toKeyString(chat === null || chat === void 0 ? void 0 : chat.id);
|
|
189
194
|
const keyTitle = toKeyString(chat === null || chat === void 0 ? void 0 : chat.title);
|
|
190
195
|
return ((0, vue_1.h)(vue_1.Fragment, null,
|
|
191
|
-
(0, vue_1.h)(
|
|
192
|
-
|
|
193
|
-
|
|
196
|
+
(0, vue_1.h)(flex_1.UFlex, { vertical: true, size: [0, 0], justify: 'flex-start"' },
|
|
197
|
+
(0, vue_1.h)(typography_1.UText, { key: `${keyId}-${keyTitle}`, variant: "heading-s-bold", class: `${mergedClsPrefixRef.value}-chat-main__header-title`, theme: mergedThemeRef.value.peers.Typography, themeOverrides: mergedThemeRef.value.peerOverrides.Typography }, {
|
|
198
|
+
default: () => { var _a, _b; return (_b = (_a = selectedChatRef.value) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : ''; }
|
|
199
|
+
}),
|
|
200
|
+
isTyping.value && ((0, vue_1.h)(typography_1.UText, { class: [
|
|
201
|
+
`${mergedClsPrefixRef.value}-chat-main__header-subtitle`,
|
|
202
|
+
'typing'
|
|
203
|
+
], variant: "body-m-medium" }, {
|
|
204
|
+
default: () => { var _a; return (_a = typingTextRef.value) !== null && _a !== void 0 ? _a : ''; }
|
|
205
|
+
}))),
|
|
194
206
|
(0, vue_1.h)(flex_1.UFlex, { align: "center", size: "small", class: `${mergedClsPrefixRef.value}-chat-main__header-actions` }, {
|
|
195
207
|
default: () => (0, _utils_1.resolveSlot)(slots.headerActions, () => {
|
|
196
208
|
const shareButtonProps = Object.assign(Object.assign({}, headerButtonPropsRef.value), headerShareButtonPropsRef.value);
|
|
@@ -77,53 +77,28 @@ exports.default = (0, cssr_1.cB)('chat', `
|
|
|
77
77
|
background-color: var(--u-sidebar-item-background-color-selected);
|
|
78
78
|
`, [(0, cssr_1.c)('&:hover', `
|
|
79
79
|
background-color: var(--u-sidebar-item-background-color-selected);
|
|
80
|
-
`)]), (0, cssr_1.
|
|
81
|
-
.u-list-item__description {
|
|
82
|
-
color: var(--u-color-primary) !important;
|
|
83
|
-
font-style: italic;
|
|
84
|
-
}
|
|
85
|
-
`), (0, cssr_1.c)('&:hover', `
|
|
80
|
+
`)]), (0, cssr_1.c)('&:hover', `
|
|
86
81
|
background-color: var(--u-sidebar-item-background-color-hover);
|
|
87
82
|
`, [(0, cssr_1.cM)('selected', `
|
|
88
83
|
background-color: var(--u-sidebar-item-background-color-selected);
|
|
89
84
|
`)])]), (0, cssr_1.cE)('item-title', `
|
|
90
|
-
font-weight: 500;
|
|
91
|
-
font-size: 14px;
|
|
92
|
-
line-height: 20px;
|
|
93
85
|
color: var(--u-sidebar-item-text-color);
|
|
94
86
|
overflow: hidden;
|
|
95
87
|
text-overflow: ellipsis;
|
|
96
88
|
white-space: nowrap;
|
|
89
|
+
margin-bottom: 0;
|
|
97
90
|
`), (0, cssr_1.cE)('item-subtitle', `
|
|
98
|
-
|
|
99
|
-
line-height: 16px;
|
|
91
|
+
display: block;
|
|
100
92
|
color: var(--u-sidebar-item-subtitle-color);
|
|
101
93
|
overflow: hidden;
|
|
102
94
|
text-overflow: ellipsis;
|
|
103
95
|
white-space: nowrap;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
`)]), (0, cssr_1.cE)('item-main', `
|
|
96
|
+
minWidth: 0;
|
|
97
|
+
maxWidth: 100%;
|
|
98
|
+
`), (0, cssr_1.cE)('item-main', `
|
|
108
99
|
flex: 1;
|
|
109
100
|
min-width: 0;
|
|
110
101
|
margin-right: 12px;
|
|
111
|
-
`), (0, cssr_1.cE)('item-title', `
|
|
112
|
-
font-weight: 500;
|
|
113
|
-
font-size: 14px;
|
|
114
|
-
line-height: 20px;
|
|
115
|
-
color: var(--u-text-color-base);
|
|
116
|
-
margin-bottom: 2px;
|
|
117
|
-
overflow: hidden;
|
|
118
|
-
text-overflow: ellipsis;
|
|
119
|
-
white-space: nowrap;
|
|
120
|
-
`), (0, cssr_1.cE)('item-subtitle', `
|
|
121
|
-
font-size: 12px;
|
|
122
|
-
line-height: 16px;
|
|
123
|
-
color: var(--u-text-color-disabled);
|
|
124
|
-
overflow: hidden;
|
|
125
|
-
text-overflow: ellipsis;
|
|
126
|
-
white-space: nowrap;
|
|
127
102
|
`), (0, cssr_1.cE)('item-indicators', `
|
|
128
103
|
display: flex;
|
|
129
104
|
flex-direction: column;
|
|
@@ -162,10 +137,9 @@ exports.default = (0, cssr_1.cB)('chat', `
|
|
|
162
137
|
`, [(0, cssr_1.cE)('header', `
|
|
163
138
|
border-bottom: 1px solid var(--u-border-color);
|
|
164
139
|
width: 100%;
|
|
165
|
-
padding: 24px 20px
|
|
140
|
+
padding: 24px 20px 10px 24px;
|
|
166
141
|
flex-shrink: 0;
|
|
167
142
|
`), (0, cssr_1.cE)('header-title', `
|
|
168
|
-
margin-top: 9px;
|
|
169
143
|
color: var(--u-header-title-color);
|
|
170
144
|
flex: 1;
|
|
171
145
|
min-width: 0;
|
|
@@ -174,6 +148,14 @@ exports.default = (0, cssr_1.cB)('chat', `
|
|
|
174
148
|
white-space: nowrap;
|
|
175
149
|
display: block;
|
|
176
150
|
margin-right: 16px;
|
|
151
|
+
`), (0, cssr_1.cE)('header-subtitle', `
|
|
152
|
+
display: block;
|
|
153
|
+
color: var(--u-sidebar-item-subtitle-color);
|
|
154
|
+
overflow: hidden;
|
|
155
|
+
text-overflow: ellipsis;
|
|
156
|
+
white-space: nowrap;
|
|
157
|
+
minWidth: 0;
|
|
158
|
+
maxWidth: 100%;
|
|
177
159
|
`), (0, cssr_1.cE)('header-actions', `
|
|
178
160
|
padding: 4px;
|
|
179
161
|
flex-shrink: 0;
|
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.12.
|
|
1
|
+
declare const _default: "1.12.13";
|
|
2
2
|
export default _default;
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
package/web-types.json
CHANGED