@uzum-tech/ui 2.2.1 → 2.3.1

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.
Files changed (91) hide show
  1. package/dist/index.js +1359 -625
  2. package/dist/index.mjs +1352 -626
  3. package/dist/index.prod.js +2 -2
  4. package/dist/index.prod.mjs +2 -2
  5. package/es/chat/index.d.ts +2 -0
  6. package/es/chat/index.mjs +1 -0
  7. package/es/chat/src/Chat.d.ts +22008 -158
  8. package/es/chat/src/Chat.mjs +1 -1
  9. package/es/chat/src/ChatListItems.d.ts +360 -0
  10. package/es/chat/src/ChatMainArea.d.ts +10109 -0
  11. package/es/chat/src/{ChatParts/MainArea.mjs → ChatMainArea.mjs} +410 -75
  12. package/es/chat/src/ChatMessages.d.ts +361 -33
  13. package/es/chat/src/ChatMessages.mjs +106 -167
  14. package/es/chat/src/ChatParts/Sidebar.d.ts +78 -0
  15. package/es/chat/src/interface.d.ts +17 -12
  16. package/es/chat/src/interface.mjs +7 -1
  17. package/es/chat/src/styles/index.cssr.mjs +4 -1
  18. package/es/chat/styles/dark.d.ts +27 -0
  19. package/es/chat/styles/dark.mjs +2 -0
  20. package/es/chat/styles/light.d.ts +27 -0
  21. package/es/chat/styles/light.mjs +2 -0
  22. package/es/components.d.ts +30865 -513
  23. package/es/components.mjs +6 -1
  24. package/es/config-provider/src/internal-interface.d.ts +4 -0
  25. package/es/message-bubble/index.d.ts +3 -0
  26. package/es/message-bubble/index.mjs +2 -0
  27. package/es/message-bubble/src/MessageBubble.d.ts +304 -0
  28. package/es/message-bubble/src/MessageBubble.mjs +340 -0
  29. package/es/message-bubble/src/interface.d.ts +206 -0
  30. package/es/message-bubble/src/interface.mjs +92 -0
  31. package/es/message-bubble/src/styles/index.cssr.d.ts +2 -0
  32. package/es/message-bubble/src/styles/index.cssr.mjs +131 -0
  33. package/es/message-bubble/styles/dark.d.ts +29 -0
  34. package/es/message-bubble/styles/dark.mjs +13 -0
  35. package/es/message-bubble/styles/index.d.ts +3 -0
  36. package/es/message-bubble/styles/index.mjs +2 -0
  37. package/es/message-bubble/styles/light.d.ts +49 -0
  38. package/es/message-bubble/styles/light.mjs +44 -0
  39. package/es/styles.d.ts +1 -0
  40. package/es/styles.mjs +1 -0
  41. package/es/themes/dark.mjs +2 -0
  42. package/es/themes/light.mjs +2 -0
  43. package/es/upload/src/Upload.d.ts +1 -1
  44. package/es/version.d.ts +1 -1
  45. package/es/version.mjs +1 -1
  46. package/lib/chat/index.d.ts +2 -0
  47. package/lib/chat/index.js +3 -1
  48. package/lib/chat/src/Chat.d.ts +22008 -158
  49. package/lib/chat/src/Chat.js +2 -2
  50. package/lib/chat/src/ChatListItems.d.ts +360 -0
  51. package/lib/chat/src/ChatMainArea.d.ts +10109 -0
  52. package/lib/chat/src/{ChatParts/MainArea.js → ChatMainArea.js} +300 -30
  53. package/lib/chat/src/ChatMessages.d.ts +361 -33
  54. package/lib/chat/src/ChatMessages.js +68 -158
  55. package/lib/chat/src/ChatParts/Sidebar.d.ts +78 -0
  56. package/lib/chat/src/interface.d.ts +17 -12
  57. package/lib/chat/src/interface.js +7 -1
  58. package/lib/chat/src/styles/index.cssr.js +4 -1
  59. package/lib/chat/styles/dark.d.ts +27 -0
  60. package/lib/chat/styles/dark.js +6 -4
  61. package/lib/chat/styles/light.d.ts +27 -0
  62. package/lib/chat/styles/light.js +6 -4
  63. package/lib/components.d.ts +30865 -513
  64. package/lib/components.js +18 -8
  65. package/lib/config-provider/src/internal-interface.d.ts +4 -0
  66. package/lib/message-bubble/index.d.ts +3 -0
  67. package/lib/message-bubble/index.js +14 -0
  68. package/lib/message-bubble/src/MessageBubble.d.ts +304 -0
  69. package/lib/message-bubble/src/MessageBubble.js +280 -0
  70. package/lib/message-bubble/src/interface.d.ts +206 -0
  71. package/lib/message-bubble/src/interface.js +80 -0
  72. package/lib/message-bubble/src/styles/index.cssr.d.ts +2 -0
  73. package/lib/message-bubble/src/styles/index.cssr.js +136 -0
  74. package/lib/message-bubble/styles/dark.d.ts +29 -0
  75. package/lib/message-bubble/styles/dark.js +15 -0
  76. package/lib/message-bubble/styles/index.d.ts +3 -0
  77. package/lib/message-bubble/styles/index.js +10 -0
  78. package/lib/message-bubble/styles/light.d.ts +49 -0
  79. package/lib/message-bubble/styles/light.js +36 -0
  80. package/lib/styles.d.ts +1 -0
  81. package/lib/styles.js +84 -82
  82. package/lib/themes/dark.js +78 -76
  83. package/lib/themes/light.js +76 -74
  84. package/lib/upload/src/Upload.d.ts +1 -1
  85. package/lib/version.d.ts +1 -1
  86. package/lib/version.js +1 -1
  87. package/package.json +2 -2
  88. package/volar.d.ts +2 -0
  89. package/web-types.json +177 -14
  90. package/es/chat/src/ChatParts/MainArea.d.ts +0 -20
  91. package/lib/chat/src/ChatParts/MainArea.d.ts +0 -20
@@ -1,19 +1,10 @@
1
- import { computed, defineComponent, Fragment, h, inject, nextTick, ref } from 'vue';
2
- import { CheckmarkDoneSharp, MdTime, Refresh } from "../../_internal/icons/index.mjs";
1
+ import { computed, defineComponent, h, inject } from 'vue';
3
2
  import { useConfig, useLocale, useTheme, useThemeClass } from "../../_mixins/index.mjs";
4
- import { UDropdown } from "../../dropdown/index.mjs";
5
- import { UIcon } from "../../icon/index.mjs";
3
+ import { MessageBubbleServiceVariant, MessageBubbleType, UMessageBubble } from "../../message-bubble/index.mjs";
6
4
  import { USkeleton } from "../../skeleton/index.mjs";
7
5
  import { chatLight } from "../styles/index.mjs";
8
- import ChatAttachmentComponent from "./ChatParts/ChatAttachment.mjs";
9
- import { ChatBubbleActionKey, chatInjectionKey, ChatMarkType, ChatMessageType, MessageStatus } from "./interface.mjs";
6
+ import { ChatBubbleActionKey, chatInjectionKey, ChatMarkType, ChatMessageType, markTypeToServiceVariantMap, MessageStatus } from "./interface.mjs";
10
7
  import style from "./styles/index.cssr.mjs";
11
- const statusIconMapper = {
12
- [MessageStatus.READ]: CheckmarkDoneSharp,
13
- [MessageStatus.PENDING]: MdTime,
14
- [MessageStatus.RETRY]: Refresh,
15
- [MessageStatus.UNREAD]: CheckmarkDoneSharp
16
- };
17
8
  export const chatMessagesProps = Object.assign(Object.assign({}, useTheme.props), {
18
9
  messages: {
19
10
  type: Array,
@@ -79,8 +70,23 @@ export default defineComponent({
79
70
  const {
80
71
  localeRef
81
72
  } = useLocale('Chat');
82
- const contextMenuShow = ref(false);
83
- const contextMenuMessage = ref();
73
+ const messageBubbleThemeOverridesRef = computed(() => {
74
+ const {
75
+ self,
76
+ peerOverrides
77
+ } = themeRef.value;
78
+ return Object.assign({
79
+ messageBubbleBackgroundColorOwn: self.messageBubbleBackgroundColorOwn,
80
+ messageBubbleBackgroundColorOther: self.messageBubbleBackgroundColorOther,
81
+ messageBubbleTextColorOwn: self.messageBubbleTextColorOwn,
82
+ messageBubbleTextColorOther: self.messageBubbleTextColorOther,
83
+ messageTimeColor: self.messageTimeColor,
84
+ attachmentBackgroundColorOwn: self.attachmentBackgroundColorOwn,
85
+ attachmentBackgroundColorOther: self.attachmentBackgroundColorOther,
86
+ unreadNotificationBackgroundColor: self.unreadNotificationBackgroundColor,
87
+ unreadNotificationTextColor: self.unreadNotificationTextColor
88
+ }, peerOverrides.MessageBubble);
89
+ });
84
90
  const cssVarsRef = computed(() => {
85
91
  const {
86
92
  common: {
@@ -163,46 +169,25 @@ export default defineComponent({
163
169
  var _a;
164
170
  (_a = props.onMessageRetry) === null || _a === void 0 ? void 0 : _a.call(props, message);
165
171
  };
166
- const messageContextMenuOptions = computed(() => {
172
+ const getMessageBubbleActions = message => {
167
173
  var _a;
168
- const message = contextMenuMessage.value;
169
- if (!message) return;
170
174
  const bubbleActions = (_a = UChat === null || UChat === void 0 ? void 0 : UChat.bubbleActionsRef) === null || _a === void 0 ? void 0 : _a.value;
171
- if (!bubbleActions || bubbleActions.length === 0) {
172
- return [];
173
- }
174
- const result = [];
175
- for (const action of bubbleActions) {
176
- if (action.visible && !action.visible(message)) {
177
- continue;
178
- }
179
- const label = typeof action.label === 'function' ? action.label() : action.label;
180
- result.push({
181
- label,
182
- key: String(action.key)
183
- });
175
+ if (!(bubbleActions === null || bubbleActions === void 0 ? void 0 : bubbleActions.length)) {
176
+ return undefined;
184
177
  }
185
- return result;
186
- });
187
- const handleContextMenuSelect = key => {
188
- var _a, _b;
189
- const message = contextMenuMessage.value;
190
- if (!message) return;
191
- if (key === ChatBubbleActionKey.EDIT) {
192
- const startEditing = (_a = UChat === null || UChat === void 0 ? void 0 : UChat.startEditingMessage) === null || _a === void 0 ? void 0 : _a.value;
193
- if (startEditing) {
194
- startEditing(message);
178
+ return bubbleActions.filter(action => !action.visible || action.visible(message)).map(action => ({
179
+ key: String(action.key),
180
+ label: action.label,
181
+ handler: () => {
182
+ var _a;
183
+ if (action.key === ChatBubbleActionKey.EDIT) {
184
+ const startEditing = (_a = UChat === null || UChat === void 0 ? void 0 : UChat.startEditingMessage) === null || _a === void 0 ? void 0 : _a.value;
185
+ startEditing === null || startEditing === void 0 ? void 0 : startEditing(message);
186
+ return;
187
+ }
188
+ action.handler(message);
195
189
  }
196
- contextMenuShow.value = false;
197
- return;
198
- }
199
- const bubbleActions = (_b = UChat === null || UChat === void 0 ? void 0 : UChat.bubbleActionsRef) === null || _b === void 0 ? void 0 : _b.value;
200
- if (!bubbleActions) return;
201
- const action = bubbleActions.find(action => action.key === key);
202
- if (action) {
203
- action.handler(message);
204
- }
205
- contextMenuShow.value = false;
190
+ }));
206
191
  };
207
192
  const renderDateSeparator = date => {
208
193
  return h("div", {
@@ -212,119 +197,85 @@ export default defineComponent({
212
197
  const renderUnreadNotification = () => {
213
198
  var _a;
214
199
  const count = (_a = props.unreadNotificationCount) !== null && _a !== void 0 ? _a : unreadMessagesCount.value;
215
- return h("div", {
216
- class: `${mergedClsPrefixRef.value}-chat-main__unread-notification`
217
- }, h("span", null, count, ' ', mergedUnreadNotificationTextRef.value));
200
+ return h(UMessageBubble, {
201
+ type: MessageBubbleType.SERVICE,
202
+ serviceVariant: MessageBubbleServiceVariant.UNREAD,
203
+ content: `${count} ${mergedUnreadNotificationTextRef.value}`,
204
+ theme: themeRef.value.peers.MessageBubble,
205
+ themeOverrides: messageBubbleThemeOverridesRef.value
206
+ });
218
207
  };
219
208
  const renderMarkMessage = message => {
220
- const markTypeClass = message.markType === ChatMarkType.SYSTEM ? 'system' : message.markType === ChatMarkType.EVENT ? 'event' : 'divider';
221
- return h("div", {
222
- key: message.id,
223
- class: [`${mergedClsPrefixRef.value}-chat-main__mark`, `${mergedClsPrefixRef.value}-chat-main__mark--${markTypeClass}`]
224
- }, message.content && h("span", null, message.content));
209
+ var _a;
210
+ const serviceVariant = markTypeToServiceVariantMap[(_a = message.markType) !== null && _a !== void 0 ? _a : ChatMarkType.DIVIDER];
211
+ return h(UMessageBubble, {
212
+ key: String(message.id),
213
+ type: MessageBubbleType.SERVICE,
214
+ serviceVariant: serviceVariant,
215
+ content: message.content,
216
+ theme: themeRef.value.peers.MessageBubble,
217
+ themeOverrides: messageBubbleThemeOverridesRef.value
218
+ });
225
219
  };
226
220
  const renderMessage = message => {
227
- var _a, _b, _c;
228
- const isOwn = message.isOwn;
229
221
  const attachments = message.attachment ? Array.isArray(message.attachment) ? message.attachment : [message.attachment] : [];
230
- const isContextMenuForThisMessage = contextMenuShow.value && ((_a = contextMenuMessage.value) === null || _a === void 0 ? void 0 : _a.id) === message.id;
231
- const hasBubbleActionsSlot = slots.bubbleActions !== undefined;
232
- const hasBubbleActionsConfig = ((_b = UChat === null || UChat === void 0 ? void 0 : UChat.bubbleActionsRef) === null || _b === void 0 ? void 0 : _b.value) && UChat.bubbleActionsRef.value.length > 0;
233
- const messageBubbleContent = message.content || attachments.length > 1 ? h("div", {
234
- class: [`${mergedClsPrefixRef.value}-chat-main__message-bubble`, isOwn ? `${mergedClsPrefixRef.value}-chat-main__message-bubble--own` : `${mergedClsPrefixRef.value}-chat-main__message-bubble--other`]
235
- }, attachments.length > 0 && h(ChatAttachmentComponent, {
236
- message: message,
237
- attachments: attachments,
222
+ const messageBubbleAttachments = attachments.map(attachment => ({
223
+ id: attachment.id,
224
+ name: attachment.name,
225
+ url: attachment.url,
226
+ size: attachment.size,
227
+ thumbnail: typeof attachment.thumbnail === 'string' ? attachment.thumbnail : undefined,
228
+ preview: typeof attachment.preview === 'string' ? attachment.preview : undefined,
229
+ status: attachment.status ? String(attachment.status) : undefined,
230
+ percentage: attachment.percentage,
231
+ type: attachment.type
232
+ }));
233
+ const handleMessageBubbleRetry = () => {
234
+ handleMessageRetry(message);
235
+ };
236
+ const handleMessageBubbleAttachmentDownload = attachment => {
237
+ var _a;
238
+ const originalAttachment = attachments.find(item => String(item.id) === String(attachment.id));
239
+ if (originalAttachment && ((_a = UChat === null || UChat === void 0 ? void 0 : UChat.onAttachmentDownload) === null || _a === void 0 ? void 0 : _a.value)) {
240
+ return UChat.onAttachmentDownload.value(originalAttachment);
241
+ }
242
+ };
243
+ return h(UMessageBubble, {
244
+ key: String(message.id),
245
+ type: MessageBubbleType.MESSAGE,
246
+ isOwn: Boolean(message.isOwn),
247
+ content: message.content,
248
+ timestamp: message.timestamp,
249
+ title: message.title,
250
+ status: message.status,
251
+ attachments: messageBubbleAttachments,
238
252
  uploadProps: props.uploadProps,
239
- withPadding: true
253
+ retryText: mergedRetryTextRef.value,
254
+ actions: getMessageBubbleActions(message),
255
+ onRetry: handleMessageBubbleRetry,
256
+ onAttachmentDownload: handleMessageBubbleAttachmentDownload,
257
+ theme: themeRef.value.peers.MessageBubble,
258
+ themeOverrides: messageBubbleThemeOverridesRef.value
240
259
  }, {
241
- default: slots.messageAttachment,
242
- 'upload-file-title': slots.messageAttachmentTitle,
243
- 'upload-file-subtitle': slots.messageAttachmentSubtitle
244
- }), message.content && h("div", {
245
- class: `${mergedClsPrefixRef.value}-chat-main__message-text`
246
- }, message.content)) : attachments.length === 1 ? h(ChatAttachmentComponent, {
247
- message: message,
248
- attachments: attachments,
249
- uploadProps: props.uploadProps
250
- }, {
251
- default: slots.messageAttachment,
252
- 'upload-file-title': slots.messageAttachmentTitle,
253
- 'upload-file-subtitle': slots.messageAttachmentSubtitle
254
- }) : null;
255
- const messageContent = h("div", {
256
- key: message.id,
257
- class: [`${mergedClsPrefixRef.value}-chat-main__message`, isOwn ? `${mergedClsPrefixRef.value}-chat-main__message--own` : `${mergedClsPrefixRef.value}-chat-main__message--other`]
258
- }, h("div", {
259
- class: [`${mergedClsPrefixRef.value}-chat-main__message-wrapper`, isOwn ? `${mergedClsPrefixRef.value}-chat-main__message-wrapper--own` : `${mergedClsPrefixRef.value}-chat-main__message-wrapper--other`]
260
- }, hasBubbleActionsSlot ? h("div", {
261
- onContextmenu: e => {
262
- e.preventDefault();
263
- contextMenuShow.value = false;
264
- void nextTick().then(() => {
265
- contextMenuShow.value = true;
266
- contextMenuMessage.value = message;
267
- });
268
- }
269
- }, (_c = slots.bubbleActions) === null || _c === void 0 ? void 0 : _c.call(slots, message), messageBubbleContent) : hasBubbleActionsConfig ? h(UDropdown, {
270
- show: isContextMenuForThisMessage,
271
- onUpdateShow: show => {
260
+ bubbleActions: slots.bubbleActions ? () => {
272
261
  var _a;
273
- if (!show && ((_a = contextMenuMessage.value) === null || _a === void 0 ? void 0 : _a.id) === message.id) {
274
- contextMenuShow.value = false;
275
- }
276
- },
277
- onClickoutside: () => {
262
+ return (_a = slots.bubbleActions) === null || _a === void 0 ? void 0 : _a.call(slots, message);
263
+ } : undefined,
264
+ messageStatus: slots.messageStatus ? () => {
278
265
  var _a;
279
- if (((_a = contextMenuMessage.value) === null || _a === void 0 ? void 0 : _a.id) === message.id) {
280
- contextMenuShow.value = false;
281
- }
282
- },
283
- trigger: "manual",
284
- placement: "bottom-start",
285
- options: messageContextMenuOptions.value,
286
- onSelect: handleContextMenuSelect
287
- }, {
288
- default: () => h("div", {
289
- onContextmenu: event => {
290
- event.preventDefault();
291
- contextMenuShow.value = false;
292
- void nextTick().then(() => {
293
- contextMenuShow.value = true;
294
- contextMenuMessage.value = message;
295
- });
296
- }
297
- }, messageBubbleContent)
298
- }) : messageBubbleContent, h("div", {
299
- class: [`${mergedClsPrefixRef.value}-chat-main__message-meta`, isOwn ? `${mergedClsPrefixRef.value}-chat-main__message-meta--own` : `${mergedClsPrefixRef.value}-chat-main__message-meta--other`, message.status === MessageStatus.RETRY && `${mergedClsPrefixRef.value}-chat-main__message-meta--retry`]
300
- }, message.status === MessageStatus.RETRY ? h("div", {
301
- class: `${mergedClsPrefixRef.value}-chat-main__message-retry`,
302
- onClick: () => {
303
- handleMessageRetry(message);
304
- },
305
- style: {
306
- cursor: 'pointer'
307
- }
308
- }, h(UIcon, {
309
- size: 16,
310
- component: statusIconMapper[MessageStatus.RETRY],
311
- class: `${mergedClsPrefixRef.value}-chat-main__message-retry-icon`,
312
- theme: themeRef.value.peers.StatusIcon,
313
- themeOverrides: themeRef.value.peerOverrides.StatusIcon
314
- }), h("span", {
315
- class: `${mergedClsPrefixRef.value}-chat-main__message-retry-text`
316
- }, mergedRetryTextRef.value)) : h(Fragment, null, h("span", {
317
- class: `${mergedClsPrefixRef.value}-chat-main__message-time`
318
- }, message.timestamp), isOwn && message.status && h("div", {
319
- class: `${mergedClsPrefixRef.value}-chat-main__message-status`
320
- }, slots.messageStatus ? slots.messageStatus(message) : statusIconMapper[message.status] && h(UIcon, {
321
- size: 16,
322
- component: statusIconMapper[message.status],
323
- class: [`${mergedClsPrefixRef.value}-chat-main__message-status-icon`, `${mergedClsPrefixRef.value}-chat-main__message-status-icon--${String(message.status)}`],
324
- theme: themeRef.value.peers.StatusIcon,
325
- themeOverrides: themeRef.value.peerOverrides.StatusIcon
326
- }))))));
327
- return messageContent;
266
+ return (_a = slots.messageStatus) === null || _a === void 0 ? void 0 : _a.call(slots, message);
267
+ } : undefined,
268
+ messageAttachment: slots.messageAttachment ? () => {
269
+ var _a;
270
+ return (_a = slots.messageAttachment) === null || _a === void 0 ? void 0 : _a.call(slots, message);
271
+ } : undefined,
272
+ afterContent: slots.messageAfterContent ? () => {
273
+ var _a;
274
+ return (_a = slots.messageAfterContent) === null || _a === void 0 ? void 0 : _a.call(slots, message);
275
+ } : undefined,
276
+ 'upload-file-title': slots.messageAttachmentTitle,
277
+ 'upload-file-subtitle': slots.messageAttachmentSubtitle
278
+ });
328
279
  };
329
280
  const renderSkeletonMessage = (isOwn, index) => {
330
281
  return h("div", {
@@ -359,10 +310,6 @@ export default defineComponent({
359
310
  renderSkeletonMessage,
360
311
  renderDateSeparator,
361
312
  renderUnreadNotification,
362
- contextMenuShow,
363
- contextMenuMessage,
364
- messageContextMenuOptions,
365
- handleContextMenuSelect,
366
313
  cssVars: cssVarsRef,
367
314
  themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
368
315
  onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
@@ -458,15 +405,7 @@ export default defineComponent({
458
405
  background: 'transparent'
459
406
  }
460
407
  }, h("div", {
461
- class: `${mergedClsPrefixRef}-chat-main__messages-container`,
462
- onContextmenu: event => {
463
- const target = event.target;
464
- const messagesContainer = event.currentTarget;
465
- if (target === messagesContainer) {
466
- event.preventDefault();
467
- this.contextMenuShow = false;
468
- }
469
- }
408
+ class: `${mergedClsPrefixRef}-chat-main__messages-container`
470
409
  }, messagesWithDates.map(item => {
471
410
  var _a;
472
411
  if (item.type === 'date-separator') {
@@ -677,6 +677,33 @@ declare const _default: import("vue").DefineComponent<{}, {
677
677
  codeColor: string;
678
678
  codeBorder: string;
679
679
  }, any>;
680
+ MessageBubble: import("../../../_mixins").Theme<"MessageBubble", {
681
+ messageBubbleBackgroundColorOwn: string;
682
+ messageBubbleBackgroundColorOther: string;
683
+ messageBubbleTextColorOwn: string;
684
+ messageBubbleTextColorOther: string;
685
+ messageTimeColor: string;
686
+ messageStatusReadColor: string;
687
+ messageStatusSuccessColor: string;
688
+ attachmentBackgroundColorOwn: string;
689
+ attachmentBackgroundColorOther: string;
690
+ messageErrorColor: string;
691
+ messageBorderRadius: string;
692
+ unreadNotificationBackgroundColor: string;
693
+ unreadNotificationTextColor: string;
694
+ serviceMessageTextColor: string;
695
+ serviceMessageBackgroundColor: string;
696
+ messageTitleColor: string;
697
+ }, {
698
+ StatusIcon: import("../../../_mixins").Theme<"Icon", {
699
+ color: string;
700
+ opacity1Depth: string;
701
+ opacity2Depth: string;
702
+ opacity3Depth: string;
703
+ opacity4Depth: string;
704
+ opacity5Depth: string;
705
+ }, any>;
706
+ }>;
680
707
  StatusIcon: import("../../../_mixins").Theme<"Icon", {
681
708
  color: string;
682
709
  opacity1Depth: string;
@@ -946,6 +973,18 @@ declare const _default: import("vue").DefineComponent<{}, {
946
973
  [x: string]: any;
947
974
  } | undefined;
948
975
  } | undefined;
976
+ MessageBubble?: {
977
+ peers?: {
978
+ StatusIcon?: import("../../../_mixins/use-theme").ExtractThemeOverrides<import("../../../_mixins").Theme<"Icon", {
979
+ color: string;
980
+ opacity1Depth: string;
981
+ opacity2Depth: string;
982
+ opacity3Depth: string;
983
+ opacity4Depth: string;
984
+ opacity5Depth: string;
985
+ }, any>> | undefined;
986
+ } | undefined;
987
+ } | undefined;
949
988
  StatusIcon?: {
950
989
  peers?: {
951
990
  [x: string]: any;
@@ -1639,6 +1678,33 @@ declare const _default: import("vue").DefineComponent<{}, {
1639
1678
  codeColor: string;
1640
1679
  codeBorder: string;
1641
1680
  }, any>;
1681
+ MessageBubble: import("../../../_mixins").Theme<"MessageBubble", {
1682
+ messageBubbleBackgroundColorOwn: string;
1683
+ messageBubbleBackgroundColorOther: string;
1684
+ messageBubbleTextColorOwn: string;
1685
+ messageBubbleTextColorOther: string;
1686
+ messageTimeColor: string;
1687
+ messageStatusReadColor: string;
1688
+ messageStatusSuccessColor: string;
1689
+ attachmentBackgroundColorOwn: string;
1690
+ attachmentBackgroundColorOther: string;
1691
+ messageErrorColor: string;
1692
+ messageBorderRadius: string;
1693
+ unreadNotificationBackgroundColor: string;
1694
+ unreadNotificationTextColor: string;
1695
+ serviceMessageTextColor: string;
1696
+ serviceMessageBackgroundColor: string;
1697
+ messageTitleColor: string;
1698
+ }, {
1699
+ StatusIcon: import("../../../_mixins").Theme<"Icon", {
1700
+ color: string;
1701
+ opacity1Depth: string;
1702
+ opacity2Depth: string;
1703
+ opacity3Depth: string;
1704
+ opacity4Depth: string;
1705
+ opacity5Depth: string;
1706
+ }, any>;
1707
+ }>;
1642
1708
  StatusIcon: import("../../../_mixins").Theme<"Icon", {
1643
1709
  color: string;
1644
1710
  opacity1Depth: string;
@@ -1908,6 +1974,18 @@ declare const _default: import("vue").DefineComponent<{}, {
1908
1974
  [x: string]: any;
1909
1975
  } | undefined;
1910
1976
  } | undefined;
1977
+ MessageBubble?: {
1978
+ peers?: {
1979
+ StatusIcon?: import("../../../_mixins/use-theme").ExtractThemeOverrides<import("../../../_mixins").Theme<"Icon", {
1980
+ color: string;
1981
+ opacity1Depth: string;
1982
+ opacity2Depth: string;
1983
+ opacity3Depth: string;
1984
+ opacity4Depth: string;
1985
+ opacity5Depth: string;
1986
+ }, any>> | undefined;
1987
+ } | undefined;
1988
+ } | undefined;
1911
1989
  StatusIcon?: {
1912
1990
  peers?: {
1913
1991
  [x: string]: any;
@@ -9,6 +9,7 @@ import type { InputProps } from '../../input';
9
9
  import type { UploadProps } from '../../upload';
10
10
  import type { OnChangePayload } from '../../upload/src/interface';
11
11
  import type { ChatTheme } from '../styles';
12
+ import { MessageBubbleServiceVariant } from '../../message-bubble';
12
13
  export declare enum MessageStatus {
13
14
  READ = "read",
14
15
  UNREAD = "unread",
@@ -84,6 +85,7 @@ export interface ChatMessageData {
84
85
  senderAvatar?: string | (() => VNodeChild);
85
86
  senderName?: string | (() => VNodeChild);
86
87
  markType?: ChatMarkType;
88
+ title?: string | (() => VNodeChild);
87
89
  }
88
90
  export interface ChatMessageProps {
89
91
  id: ChatId;
@@ -97,6 +99,7 @@ export interface ChatMessageProps {
97
99
  senderAvatar?: string | (() => VNodeChild);
98
100
  senderName?: string | (() => VNodeChild);
99
101
  disabled?: boolean;
102
+ title?: string | (() => VNodeChild);
100
103
  }
101
104
  export interface ChatListItemProps {
102
105
  id: ChatId;
@@ -201,6 +204,7 @@ export interface ChatSlots {
201
204
  chatItemSuffix?: (item: ChatListItemData) => VNodeChild;
202
205
  messageStatus?: (message: ChatMessageData) => VNodeChild;
203
206
  messageContent?: (message: ChatMessageData) => VNodeChild;
207
+ messageAfterContent?: (message: ChatMessageData) => VNodeChild;
204
208
  messageTimestamp?: (message: ChatMessageData) => VNodeChild;
205
209
  messageAttachment?: (message: ChatMessageData) => VNodeChild;
206
210
  messageAttachmentTitle?: (file: any) => VNodeChild;
@@ -245,6 +249,18 @@ export interface ChatFooterProps {
245
249
  actions?: Array<() => VNodeChild>;
246
250
  inputProps?: Partial<InputProps>;
247
251
  }
252
+ export interface ChatInst {
253
+ scrollToBottom: () => void;
254
+ scrollToMessage: (key: ChatId) => void;
255
+ sendMessage: (content: string, attachments?: ChatAttachment[]) => void;
256
+ }
257
+ export interface ChatListInst {
258
+ selectChat: (key: ChatId) => void;
259
+ updateItem: (key: ChatId, item: Partial<ChatListItemData>) => void;
260
+ addItem: (item: ChatListItemData) => void;
261
+ removeItem: (key: ChatId) => void;
262
+ }
263
+ export type HandleOnChangeType = ((data: OnChangePayload) => void) | undefined;
248
264
  export type OnChatSelect = (key: ChatId, item: ChatListItemData) => void;
249
265
  export type OnMessageSend = (content: string, attachments?: ChatAttachment[]) => void;
250
266
  export type OnAttachmentUpload = (file: File) => Promise<ChatAttachment>;
@@ -265,17 +281,6 @@ export type OnSendError = (error: {
265
281
  message: string;
266
282
  content: string;
267
283
  }) => void;
268
- export interface ChatInst {
269
- scrollToBottom: () => void;
270
- scrollToMessage: (key: ChatId) => void;
271
- sendMessage: (content: string, attachments?: ChatAttachment[]) => void;
272
- }
273
- export interface ChatListInst {
274
- selectChat: (key: ChatId) => void;
275
- updateItem: (key: ChatId, item: Partial<ChatListItemData>) => void;
276
- addItem: (item: ChatListItemData) => void;
277
- removeItem: (key: ChatId) => void;
278
- }
279
284
  export declare const chatInjectionKey: InjectionKey<{
280
285
  mergedClsPrefixRef: Ref<string>;
281
286
  mergedThemeRef: Ref<MergedTheme<ChatTheme>>;
@@ -354,4 +359,4 @@ export declare const chatInjectionKey: InjectionKey<{
354
359
  headerShareIconPropsRef: Ref<Partial<IconProps> | undefined>;
355
360
  headerProfileIconPropsRef: Ref<Partial<IconProps> | undefined>;
356
361
  }>;
357
- export type HandleOnChangeType = ((data: OnChangePayload) => void) | undefined;
362
+ export declare const markTypeToServiceVariantMap: Record<ChatMarkType, MessageBubbleServiceVariant>;
@@ -1,4 +1,5 @@
1
1
  import { createInjectionKey } from "../../_utils/index.mjs";
2
+ import { MessageBubbleServiceVariant } from "../../message-bubble/index.mjs";
2
3
  export var MessageStatus;
3
4
  (function (MessageStatus) {
4
5
  MessageStatus["READ"] = "read";
@@ -32,4 +33,9 @@ export var ChatBubbleActionKey;
32
33
  ChatBubbleActionKey["COPY"] = "copy";
33
34
  ChatBubbleActionKey["DELETE"] = "delete";
34
35
  })(ChatBubbleActionKey || (ChatBubbleActionKey = {}));
35
- export const chatInjectionKey = createInjectionKey('chat');
36
+ export const chatInjectionKey = createInjectionKey('chat');
37
+ export const markTypeToServiceVariantMap = {
38
+ [ChatMarkType.SYSTEM]: MessageBubbleServiceVariant.SYSTEM,
39
+ [ChatMarkType.EVENT]: MessageBubbleServiceVariant.EVENT,
40
+ [ChatMarkType.DIVIDER]: MessageBubbleServiceVariant.DIVIDER
41
+ };
@@ -129,7 +129,10 @@ export default cB('chat', `
129
129
  height: 100%;
130
130
  max-height: 100%;
131
131
  min-height: 0;
132
- `, [cE('header', `
132
+ `, [cM('standalone', `
133
+ border: none;
134
+ border-radius: 0;
135
+ `), cE('header', `
133
136
  border-bottom: 1px solid var(--u-border-color);
134
137
  width: 100%;
135
138
  padding: 24px 20px 10px 24px;
@@ -662,6 +662,33 @@ declare const chatDark: import("../../_mixins").Theme<"Chat", {
662
662
  codeColor: string;
663
663
  codeBorder: string;
664
664
  }, any>;
665
+ MessageBubble: import("../../_mixins").Theme<"MessageBubble", {
666
+ messageBubbleBackgroundColorOwn: string;
667
+ messageBubbleBackgroundColorOther: string;
668
+ messageBubbleTextColorOwn: string;
669
+ messageBubbleTextColorOther: string;
670
+ messageTimeColor: string;
671
+ messageStatusReadColor: string;
672
+ messageStatusSuccessColor: string;
673
+ attachmentBackgroundColorOwn: string;
674
+ attachmentBackgroundColorOther: string;
675
+ messageErrorColor: string;
676
+ messageBorderRadius: string;
677
+ unreadNotificationBackgroundColor: string;
678
+ unreadNotificationTextColor: string;
679
+ serviceMessageTextColor: string;
680
+ serviceMessageBackgroundColor: string;
681
+ messageTitleColor: string;
682
+ }, {
683
+ StatusIcon: import("../../_mixins").Theme<"Icon", {
684
+ color: string;
685
+ opacity1Depth: string;
686
+ opacity2Depth: string;
687
+ opacity3Depth: string;
688
+ opacity4Depth: string;
689
+ opacity5Depth: string;
690
+ }, any>;
691
+ }>;
665
692
  StatusIcon: import("../../_mixins").Theme<"Icon", {
666
693
  color: string;
667
694
  opacity1Depth: string;
@@ -7,6 +7,7 @@ import { emptyDark } from "../../empty/styles/index.mjs";
7
7
  import { iconDark } from "../../icon/styles/index.mjs";
8
8
  import { inputDark } from "../../input/styles/index.mjs";
9
9
  import { listDark } from "../../list/styles/index.mjs";
10
+ import { messageBubbleDark } from "../../message-bubble/styles/index.mjs";
10
11
  import { selectDark } from "../../select/styles/index.mjs";
11
12
  import { typographyDark } from "../../typography/styles/index.mjs";
12
13
  import { self } from "./light.mjs";
@@ -22,6 +23,7 @@ const chatDark = createTheme({
22
23
  Button: buttonDark,
23
24
  List: listDark,
24
25
  Typography: typographyDark,
26
+ MessageBubble: messageBubbleDark,
25
27
  StatusIcon: iconDark,
26
28
  FooterAttachIcon: iconDark,
27
29
  FooterSuffixIcon: iconDark,
@@ -700,6 +700,33 @@ declare const chatLight: import("../../_mixins").Theme<"Chat", {
700
700
  codeColor: string;
701
701
  codeBorder: string;
702
702
  }, any>;
703
+ MessageBubble: import("../../_mixins").Theme<"MessageBubble", {
704
+ messageBubbleBackgroundColorOwn: string;
705
+ messageBubbleBackgroundColorOther: string;
706
+ messageBubbleTextColorOwn: string;
707
+ messageBubbleTextColorOther: string;
708
+ messageTimeColor: string;
709
+ messageStatusReadColor: string;
710
+ messageStatusSuccessColor: string;
711
+ attachmentBackgroundColorOwn: string;
712
+ attachmentBackgroundColorOther: string;
713
+ messageErrorColor: string;
714
+ messageBorderRadius: string;
715
+ unreadNotificationBackgroundColor: string;
716
+ unreadNotificationTextColor: string;
717
+ serviceMessageTextColor: string;
718
+ serviceMessageBackgroundColor: string;
719
+ messageTitleColor: string;
720
+ }, {
721
+ StatusIcon: import("../../_mixins").Theme<"Icon", {
722
+ color: string;
723
+ opacity1Depth: string;
724
+ opacity2Depth: string;
725
+ opacity3Depth: string;
726
+ opacity4Depth: string;
727
+ opacity5Depth: string;
728
+ }, any>;
729
+ }>;
703
730
  StatusIcon: import("../../_mixins").Theme<"Icon", {
704
731
  color: string;
705
732
  opacity1Depth: string;
@@ -9,6 +9,7 @@ import { iconLight } from "../../icon/styles/index.mjs";
9
9
  import { inputLight } from "../../input/styles/index.mjs";
10
10
  import { self as inputSelf } from "../../input/styles/light.mjs";
11
11
  import { listLight } from "../../list/styles/index.mjs";
12
+ import { messageBubbleLight } from "../../message-bubble/styles/index.mjs";
12
13
  import { selectLight } from "../../select/styles/index.mjs";
13
14
  import { typographyLight } from "../../typography/styles/index.mjs";
14
15
  const chatInputLight = Object.assign(Object.assign({}, inputLight), {
@@ -109,6 +110,7 @@ const chatLight = createTheme({
109
110
  Button: buttonLight,
110
111
  List: listLight,
111
112
  Typography: typographyLight,
113
+ MessageBubble: messageBubbleLight,
112
114
  StatusIcon: iconLight,
113
115
  FooterAttachIcon: iconLight,
114
116
  FooterSuffixIcon: iconLight,