@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
@@ -25,74 +25,341 @@ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, gene
25
25
  step((generator = generator.apply(thisArg, _arguments || [])).next());
26
26
  });
27
27
  };
28
- import { computed, defineComponent, Fragment, h, inject, nextTick, ref, watch } from 'vue';
29
- import { ArrowHookUpRight, AttachIcon, CloseIcon, PersonNote, SendFilled } from "../../../_internal/icons/index.mjs";
30
- import { useLocale } from "../../../_mixins/index.mjs";
31
- import { resolveSlot } from "../../../_utils/index.mjs";
32
- import { UButton } from "../../../button/index.mjs";
33
- import { UFlex } from "../../../flex/index.mjs";
34
- import { UIcon } from "../../../icon/index.mjs";
35
- import { UInput } from "../../../input/index.mjs";
36
- import { UList, UListItem } from "../../../list/index.mjs";
37
- import { USafeTopScrollbar } from "../../../safe-top-scrollbar/index.mjs";
38
- import { UTooltip } from "../../../tooltip/index.mjs";
39
- import { UText } from "../../../typography/index.mjs";
40
- import { UUpload, UUploadTrigger } from "../../../upload/index.mjs";
41
- import UChatMessages from "../ChatMessages.mjs";
42
- import { ChatBubbleActionKey, chatInjectionKey, ChatMessageType, MessageStatus } from "../interface.mjs";
28
+ import { computed, defineComponent, Fragment, h, inject, nextTick, onMounted, provide, ref, toRef, watch } from 'vue';
29
+ import { ArrowHookUpRight, AttachIcon, CloseIcon, PersonNote, SendFilled } from "../../_internal/icons/index.mjs";
30
+ import { useConfig, useLocale, useTheme, useThemeClass } from "../../_mixins/index.mjs";
31
+ import { resolveSlot } from "../../_utils/index.mjs";
32
+ import { UButton } from "../../button/index.mjs";
33
+ import { UFlex } from "../../flex/index.mjs";
34
+ import { UIcon } from "../../icon/index.mjs";
35
+ import { UInput } from "../../input/index.mjs";
36
+ import { UList, UListItem } from "../../list/index.mjs";
37
+ import { USafeTopScrollbar } from "../../safe-top-scrollbar/index.mjs";
38
+ import { UTooltip } from "../../tooltip/index.mjs";
39
+ import { UText } from "../../typography/index.mjs";
40
+ import { UUpload, UUploadTrigger } from "../../upload/index.mjs";
41
+ import { chatLight } from "../styles/index.mjs";
42
+ import UChatMessages from "./ChatMessages.mjs";
43
+ import { ChatBubbleActionKey, chatInjectionKey, ChatMessageType, MessageStatus } from "./interface.mjs";
44
+ import style from "./styles/index.cssr.mjs";
43
45
  const SENDING_DELAY = 100;
46
+ export const chatMainAreaProps = Object.assign(Object.assign({}, useTheme.props), {
47
+ selectedChat: {
48
+ type: Object,
49
+ default: undefined
50
+ },
51
+ messages: {
52
+ type: Array,
53
+ default: () => []
54
+ },
55
+ typingChatIds: {
56
+ type: Array,
57
+ default: () => []
58
+ },
59
+ loading: {
60
+ type: Boolean,
61
+ default: false
62
+ },
63
+ loadingCount: {
64
+ type: Number,
65
+ default: 10
66
+ },
67
+ headerButtonProps: {
68
+ type: Object,
69
+ default: undefined
70
+ },
71
+ headerIconProps: {
72
+ type: Object,
73
+ default: undefined
74
+ },
75
+ headerShareButtonProps: {
76
+ type: Object,
77
+ default: undefined
78
+ },
79
+ headerProfileButtonProps: {
80
+ type: Object,
81
+ default: undefined
82
+ },
83
+ headerCloseButtonProps: {
84
+ type: Object,
85
+ default: undefined
86
+ },
87
+ headerShareIconProps: {
88
+ type: Object,
89
+ default: undefined
90
+ },
91
+ headerProfileIconProps: {
92
+ type: Object,
93
+ default: undefined
94
+ },
95
+ messageUploadProps: {
96
+ type: Object,
97
+ default: undefined
98
+ },
99
+ footerInputProps: {
100
+ type: Object,
101
+ default: undefined
102
+ },
103
+ footerButtonProps: {
104
+ type: Object,
105
+ default: undefined
106
+ },
107
+ footerUploadProps: {
108
+ type: Object,
109
+ default: undefined
110
+ },
111
+ footerIconProps: {
112
+ type: Object,
113
+ default: undefined
114
+ },
115
+ footerSuffixIconProps: {
116
+ type: Object,
117
+ default: undefined
118
+ },
119
+ showAttachButton: {
120
+ type: Boolean,
121
+ default: true
122
+ },
123
+ inputPlaceholder: {
124
+ type: String,
125
+ default: undefined
126
+ },
127
+ retryText: {
128
+ type: String,
129
+ default: undefined
130
+ },
131
+ typingText: {
132
+ type: String,
133
+ default: undefined
134
+ },
135
+ closeButtonText: {
136
+ type: String,
137
+ default: undefined
138
+ },
139
+ shareButtonTooltip: {
140
+ type: String,
141
+ default: undefined
142
+ },
143
+ profileButtonTooltip: {
144
+ type: String,
145
+ default: undefined
146
+ },
147
+ unreadNotificationText: {
148
+ type: String,
149
+ default: undefined
150
+ },
151
+ bubbleActions: {
152
+ type: Array,
153
+ default: undefined
154
+ },
155
+ onMessageSend: {
156
+ type: Function,
157
+ default: undefined
158
+ },
159
+ onMessageRetry: {
160
+ type: Function,
161
+ default: undefined
162
+ },
163
+ onFooterInputChange: {
164
+ type: Function,
165
+ default: undefined
166
+ },
167
+ onChatClose: {
168
+ type: Function,
169
+ default: undefined
170
+ },
171
+ onChatShare: {
172
+ type: Function,
173
+ default: undefined
174
+ },
175
+ onUserProfile: {
176
+ type: Function,
177
+ default: undefined
178
+ },
179
+ onAttachmentUpload: {
180
+ type: Function,
181
+ default: undefined
182
+ },
183
+ onAttachmentDownload: {
184
+ type: Function,
185
+ default: undefined
186
+ },
187
+ onMessagesScrollToTop: {
188
+ type: Function,
189
+ default: undefined
190
+ },
191
+ onMessagesScrollToBottom: {
192
+ type: Function,
193
+ default: undefined
194
+ }
195
+ });
44
196
  export default defineComponent({
45
197
  name: 'ChatMainArea',
46
- setup(_, {
198
+ props: chatMainAreaProps,
199
+ setup(props, {
47
200
  slots
48
201
  }) {
202
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16;
203
+ const UChat = inject(chatInjectionKey, null);
204
+ const isStandalone = !UChat;
205
+ const {
206
+ mergedClsPrefixRef
207
+ } = useConfig(props);
208
+ const mergedThemeRef = (_a = UChat === null || UChat === void 0 ? void 0 : UChat.mergedThemeRef) !== null && _a !== void 0 ? _a : useTheme('Chat', '-chat', style, chatLight, props, mergedClsPrefixRef);
49
209
  const {
50
210
  localeRef
51
211
  } = useLocale('Chat');
52
- const {
53
- mergedClsPrefixRef,
54
- mergedThemeRef,
55
- selectedChatRef,
56
- messagesRef,
57
- typingChatIdsRef,
58
- messagesLoadingRef,
59
- messagesLoadingCountRef,
60
- headerButtonPropsRef,
61
- headerIconPropsRef,
62
- headerShareButtonPropsRef,
63
- headerProfileButtonPropsRef,
64
- headerCloseButtonPropsRef,
65
- headerShareIconPropsRef,
66
- headerProfileIconPropsRef,
67
- messageUploadPropsRef,
68
- footerInputPropsRef,
69
- footerButtonPropsRef,
70
- footerUploadPropsRef,
71
- footerIconPropsRef,
72
- footerSuffixIconPropsRef,
73
- inputPlaceholderRef,
74
- retryTextRef,
75
- typingTextRef,
76
- closeButtonTextRef,
77
- shareButtonTooltipRef,
78
- profileButtonTooltipRef,
79
- unreadNotificationTextRef,
80
- notificationsShownSetRef,
81
- unreadCountsBeforeReadRef,
82
- markNotificationShown,
83
- handleMessageSend,
84
- handleMessageRetry,
85
- handleFooterInputChange,
86
- startEditingMessage: startEditingMessageRef,
87
- editMessageIdRef,
88
- bubbleActionsRef,
89
- onAttachmentUpload,
90
- onChatClose,
91
- onChatShare,
92
- onUserProfile,
93
- onMessagesScrollToTop,
94
- onMessagesScrollToBottom
95
- } = inject(chatInjectionKey);
212
+ const selectedChatRef = (_b = UChat === null || UChat === void 0 ? void 0 : UChat.selectedChatRef) !== null && _b !== void 0 ? _b : toRef(props, 'selectedChat');
213
+ const messagesRef = (_c = UChat === null || UChat === void 0 ? void 0 : UChat.messagesRef) !== null && _c !== void 0 ? _c : toRef(props, 'messages');
214
+ const typingChatIdsRef = (_d = UChat === null || UChat === void 0 ? void 0 : UChat.typingChatIdsRef) !== null && _d !== void 0 ? _d : toRef(props, 'typingChatIds');
215
+ const messagesLoadingRef = (_e = UChat === null || UChat === void 0 ? void 0 : UChat.messagesLoadingRef) !== null && _e !== void 0 ? _e : toRef(props, 'loading');
216
+ const messagesLoadingCountRef = (_f = UChat === null || UChat === void 0 ? void 0 : UChat.messagesLoadingCountRef) !== null && _f !== void 0 ? _f : toRef(props, 'loadingCount');
217
+ const headerButtonPropsRef = (_g = UChat === null || UChat === void 0 ? void 0 : UChat.headerButtonPropsRef) !== null && _g !== void 0 ? _g : toRef(props, 'headerButtonProps');
218
+ const headerIconPropsRef = (_h = UChat === null || UChat === void 0 ? void 0 : UChat.headerIconPropsRef) !== null && _h !== void 0 ? _h : toRef(props, 'headerIconProps');
219
+ const headerShareButtonPropsRef = (_j = UChat === null || UChat === void 0 ? void 0 : UChat.headerShareButtonPropsRef) !== null && _j !== void 0 ? _j : toRef(props, 'headerShareButtonProps');
220
+ const headerProfileButtonPropsRef = (_k = UChat === null || UChat === void 0 ? void 0 : UChat.headerProfileButtonPropsRef) !== null && _k !== void 0 ? _k : toRef(props, 'headerProfileButtonProps');
221
+ const headerCloseButtonPropsRef = (_l = UChat === null || UChat === void 0 ? void 0 : UChat.headerCloseButtonPropsRef) !== null && _l !== void 0 ? _l : toRef(props, 'headerCloseButtonProps');
222
+ const headerShareIconPropsRef = (_m = UChat === null || UChat === void 0 ? void 0 : UChat.headerShareIconPropsRef) !== null && _m !== void 0 ? _m : toRef(props, 'headerShareIconProps');
223
+ const headerProfileIconPropsRef = (_o = UChat === null || UChat === void 0 ? void 0 : UChat.headerProfileIconPropsRef) !== null && _o !== void 0 ? _o : toRef(props, 'headerProfileIconProps');
224
+ const messageUploadPropsRef = (_p = UChat === null || UChat === void 0 ? void 0 : UChat.messageUploadPropsRef) !== null && _p !== void 0 ? _p : toRef(props, 'messageUploadProps');
225
+ const footerInputPropsRef = (_q = UChat === null || UChat === void 0 ? void 0 : UChat.footerInputPropsRef) !== null && _q !== void 0 ? _q : toRef(props, 'footerInputProps');
226
+ const footerButtonPropsRef = (_r = UChat === null || UChat === void 0 ? void 0 : UChat.footerButtonPropsRef) !== null && _r !== void 0 ? _r : toRef(props, 'footerButtonProps');
227
+ const footerUploadPropsRef = (_s = UChat === null || UChat === void 0 ? void 0 : UChat.footerUploadPropsRef) !== null && _s !== void 0 ? _s : toRef(props, 'footerUploadProps');
228
+ const footerIconPropsRef = (_t = UChat === null || UChat === void 0 ? void 0 : UChat.footerIconPropsRef) !== null && _t !== void 0 ? _t : toRef(props, 'footerIconProps');
229
+ const footerSuffixIconPropsRef = (_u = UChat === null || UChat === void 0 ? void 0 : UChat.footerSuffixIconPropsRef) !== null && _u !== void 0 ? _u : toRef(props, 'footerSuffixIconProps');
230
+ const inputPlaceholderRef = (_v = UChat === null || UChat === void 0 ? void 0 : UChat.inputPlaceholderRef) !== null && _v !== void 0 ? _v : computed(() => {
231
+ var _a;
232
+ return (_a = props.inputPlaceholder) !== null && _a !== void 0 ? _a : localeRef.value.inputPlaceholder;
233
+ });
234
+ const retryTextRef = (_w = UChat === null || UChat === void 0 ? void 0 : UChat.retryTextRef) !== null && _w !== void 0 ? _w : computed(() => {
235
+ var _a;
236
+ return (_a = props.retryText) !== null && _a !== void 0 ? _a : localeRef.value.retryText;
237
+ });
238
+ const typingTextRef = (_x = UChat === null || UChat === void 0 ? void 0 : UChat.typingTextRef) !== null && _x !== void 0 ? _x : computed(() => {
239
+ var _a;
240
+ return (_a = props.typingText) !== null && _a !== void 0 ? _a : localeRef.value.typingText;
241
+ });
242
+ const closeButtonTextRef = (_y = UChat === null || UChat === void 0 ? void 0 : UChat.closeButtonTextRef) !== null && _y !== void 0 ? _y : computed(() => {
243
+ var _a;
244
+ return (_a = props.closeButtonText) !== null && _a !== void 0 ? _a : localeRef.value.closeButtonText;
245
+ });
246
+ const shareButtonTooltipRef = (_z = UChat === null || UChat === void 0 ? void 0 : UChat.shareButtonTooltipRef) !== null && _z !== void 0 ? _z : computed(() => {
247
+ var _a;
248
+ return (_a = props.shareButtonTooltip) !== null && _a !== void 0 ? _a : localeRef.value.shareButtonTooltip;
249
+ });
250
+ const profileButtonTooltipRef = (_0 = UChat === null || UChat === void 0 ? void 0 : UChat.profileButtonTooltipRef) !== null && _0 !== void 0 ? _0 : computed(() => {
251
+ var _a;
252
+ return (_a = props.profileButtonTooltip) !== null && _a !== void 0 ? _a : localeRef.value.profileButtonTooltip;
253
+ });
254
+ const unreadNotificationTextRef = (_1 = UChat === null || UChat === void 0 ? void 0 : UChat.unreadNotificationTextRef) !== null && _1 !== void 0 ? _1 : computed(() => {
255
+ var _a;
256
+ return (_a = props.unreadNotificationText) !== null && _a !== void 0 ? _a : localeRef.value.unreadNotificationText;
257
+ });
258
+ const notificationsShownSetRef = (_2 = UChat === null || UChat === void 0 ? void 0 : UChat.notificationsShownSetRef) !== null && _2 !== void 0 ? _2 : ref(new Set());
259
+ const unreadCountsBeforeReadRef = (_3 = UChat === null || UChat === void 0 ? void 0 : UChat.unreadCountsBeforeReadRef) !== null && _3 !== void 0 ? _3 : ref({});
260
+ const markNotificationShown = (_4 = UChat === null || UChat === void 0 ? void 0 : UChat.markNotificationShown) !== null && _4 !== void 0 ? _4 : chatId => {
261
+ notificationsShownSetRef.value.add(chatId);
262
+ notificationsShownSetRef.value = new Set(notificationsShownSetRef.value);
263
+ };
264
+ const editMessageIdRef = (_5 = UChat === null || UChat === void 0 ? void 0 : UChat.editMessageIdRef) !== null && _5 !== void 0 ? _5 : ref(null);
265
+ const startEditingMessageRef = (_6 = UChat === null || UChat === void 0 ? void 0 : UChat.startEditingMessage) !== null && _6 !== void 0 ? _6 : ref();
266
+ const bubbleActionsRef = (_7 = UChat === null || UChat === void 0 ? void 0 : UChat.bubbleActionsRef) !== null && _7 !== void 0 ? _7 : toRef(props, 'bubbleActions');
267
+ const handleMessageSend = (_8 = UChat === null || UChat === void 0 ? void 0 : UChat.handleMessageSend) !== null && _8 !== void 0 ? _8 : (content, attachments) => {
268
+ var _a;
269
+ return (_a = props.onMessageSend) === null || _a === void 0 ? void 0 : _a.call(props, content, attachments);
270
+ };
271
+ const handleMessageRetry = (_9 = UChat === null || UChat === void 0 ? void 0 : UChat.handleMessageRetry) !== null && _9 !== void 0 ? _9 : message => {
272
+ var _a;
273
+ return (_a = props.onMessageRetry) === null || _a === void 0 ? void 0 : _a.call(props, message);
274
+ };
275
+ const handleFooterInputChange = (_10 = UChat === null || UChat === void 0 ? void 0 : UChat.handleFooterInputChange) !== null && _10 !== void 0 ? _10 : (value, chatId) => {
276
+ var _a;
277
+ return (_a = props.onFooterInputChange) === null || _a === void 0 ? void 0 : _a.call(props, value, chatId);
278
+ };
279
+ const onAttachmentUpload = (_11 = UChat === null || UChat === void 0 ? void 0 : UChat.onAttachmentUpload) !== null && _11 !== void 0 ? _11 : toRef(props, 'onAttachmentUpload');
280
+ const onChatClose = (_12 = UChat === null || UChat === void 0 ? void 0 : UChat.onChatClose) !== null && _12 !== void 0 ? _12 : toRef(props, 'onChatClose');
281
+ const onChatShare = (_13 = UChat === null || UChat === void 0 ? void 0 : UChat.onChatShare) !== null && _13 !== void 0 ? _13 : toRef(props, 'onChatShare');
282
+ const onUserProfile = (_14 = UChat === null || UChat === void 0 ? void 0 : UChat.onUserProfile) !== null && _14 !== void 0 ? _14 : toRef(props, 'onUserProfile');
283
+ const onMessagesScrollToTop = (_15 = UChat === null || UChat === void 0 ? void 0 : UChat.onMessagesScrollToTop) !== null && _15 !== void 0 ? _15 : toRef(props, 'onMessagesScrollToTop');
284
+ const onMessagesScrollToBottom = (_16 = UChat === null || UChat === void 0 ? void 0 : UChat.onMessagesScrollToBottom) !== null && _16 !== void 0 ? _16 : toRef(props, 'onMessagesScrollToBottom');
285
+ const cssVarsRef = computed(() => {
286
+ const {
287
+ common: {
288
+ cubicBezierEaseInOut,
289
+ brandPrimary500,
290
+ staticGreen,
291
+ staticRed,
292
+ textPrimary,
293
+ textSecondary,
294
+ textTertiary
295
+ },
296
+ self: {
297
+ backgroundColor,
298
+ borderColor,
299
+ sidebarItemSubtitleColor,
300
+ mainBackgroundColor,
301
+ headerBackgroundColor,
302
+ headerBorderColor,
303
+ headerTitleColor,
304
+ messageBubbleBackgroundColorOwn,
305
+ messageBubbleBackgroundColorOther,
306
+ messageBubbleTextColorOwn,
307
+ messageBubbleTextColorOther,
308
+ messageTimeColor,
309
+ messageStatusColor,
310
+ attachmentBackgroundColorOwn,
311
+ attachmentBackgroundColorOther,
312
+ footerBackgroundColor,
313
+ footerBorderColor,
314
+ inputBackgroundColor,
315
+ inputBorderColor,
316
+ inputSuffixColor,
317
+ unreadNotificationBackgroundColor,
318
+ unreadNotificationTextColor,
319
+ typingIndicatorColor,
320
+ dateSeparatorColor,
321
+ dateSeparatorBackgroundColor,
322
+ borderRadius,
323
+ errorColor
324
+ }
325
+ } = mergedThemeRef.value;
326
+ return {
327
+ '--u-bezier': cubicBezierEaseInOut,
328
+ '--u-color-primary': brandPrimary500,
329
+ '--u-color-success': staticGreen,
330
+ '--u-color-error': errorColor || staticRed,
331
+ '--u-text-color-base': textPrimary,
332
+ '--u-text-color-secondary': textSecondary,
333
+ '--u-text-color-disabled': textTertiary,
334
+ '--u-background-color': backgroundColor,
335
+ '--u-border-color': borderColor,
336
+ '--u-sidebar-item-subtitle-color': sidebarItemSubtitleColor,
337
+ '--u-main-background-color': mainBackgroundColor,
338
+ '--u-header-background-color': headerBackgroundColor,
339
+ '--u-header-border-color': headerBorderColor,
340
+ '--u-header-title-color': headerTitleColor,
341
+ '--u-message-bubble-background-color-own': messageBubbleBackgroundColorOwn,
342
+ '--u-message-bubble-background-color-other': messageBubbleBackgroundColorOther,
343
+ '--u-message-bubble-text-color-own': messageBubbleTextColorOwn,
344
+ '--u-message-bubble-text-color-other': messageBubbleTextColorOther,
345
+ '--u-message-time-color': messageTimeColor,
346
+ '--u-message-status-color': messageStatusColor,
347
+ '--u-attachment-background-color-own': attachmentBackgroundColorOwn,
348
+ '--u-attachment-background-color-other': attachmentBackgroundColorOther,
349
+ '--u-footer-background-color': footerBackgroundColor,
350
+ '--u-footer-border-color': footerBorderColor,
351
+ '--u-input-background-color': inputBackgroundColor,
352
+ '--u-input-border-color': inputBorderColor,
353
+ '--u-input-suffix-color': inputSuffixColor,
354
+ '--u-unread-notification-background-color': unreadNotificationBackgroundColor,
355
+ '--u-unread-notification-text-color': unreadNotificationTextColor,
356
+ '--u-typing-indicator-color': typingIndicatorColor,
357
+ '--u-date-separator-color': dateSeparatorColor,
358
+ '--u-date-separator-background-color': dateSeparatorBackgroundColor,
359
+ '--u-border-radius': borderRadius
360
+ };
361
+ });
362
+ const themeClassHandle = useThemeClass('chat-main-area', computed(() => ''), cssVarsRef, props);
96
363
  const messagesBodyRef = ref();
97
364
  const inputRef = ref();
98
365
  const inputValue = ref('');
@@ -166,6 +433,11 @@ export default defineComponent({
166
433
  deep: true,
167
434
  flush: 'post'
168
435
  });
436
+ onMounted(() => {
437
+ void nextTick(() => {
438
+ scrollToBottom();
439
+ });
440
+ });
169
441
  watch(unreadMessagesCount, (newCount, oldCount) => {
170
442
  if (selectedChatRef.value && newCount === 0 && oldCount > 0) {
171
443
  showNotificationManually.value = false;
@@ -213,24 +485,24 @@ export default defineComponent({
213
485
  lastScrollTop.value = scrollTop;
214
486
  };
215
487
  function scrollToBottom() {
216
- const el = messagesBodyRef.value;
217
- if (!el) return;
218
- if ('$el' in el && el.$el instanceof HTMLElement) {
219
- const scrollContainer = el.$el.querySelector('.u-scrollbar-content');
488
+ const element = messagesBodyRef.value;
489
+ if (!element) return;
490
+ if ('$el' in element && element.$el instanceof HTMLElement) {
491
+ const scrollContainer = element.$el.querySelector('.u-scrollbar-content');
220
492
  if (scrollContainer) {
221
493
  scrollContainer.scrollTop = scrollContainer.scrollHeight;
222
494
  return;
223
495
  }
224
496
  }
225
- if ('scrollTo' in el && typeof el.scrollTo === 'function') {
226
- el.scrollTo({
497
+ if ('scrollTo' in element && typeof element.scrollTo === 'function') {
498
+ element.scrollTo({
227
499
  top: 999999,
228
500
  behavior: 'auto'
229
501
  });
230
502
  return;
231
503
  }
232
- if ('scrollTop' in el && 'scrollHeight' in el) {
233
- el.scrollTop = el.scrollHeight;
504
+ if ('scrollTop' in element && 'scrollHeight' in element) {
505
+ element.scrollTop = element.scrollHeight;
234
506
  }
235
507
  }
236
508
  const toKeyString = value => {
@@ -368,6 +640,7 @@ export default defineComponent({
368
640
  messageAttachmentTitle: slots.messageAttachmentTitle,
369
641
  messageAttachmentSubtitle: slots.messageAttachmentSubtitle,
370
642
  messageStatus: slots.messageStatus,
643
+ messageAfterContent: slots.messageAfterContent,
371
644
  bubbleActions: slots.bubbleActions
372
645
  });
373
646
  };
@@ -556,7 +829,7 @@ export default defineComponent({
556
829
  wrap: false,
557
830
  class: `${mergedClsPrefixRef.value}-chat-main__input-container`
558
831
  }, {
559
- default: () => h(Fragment, null, h(UUploadTrigger, {
832
+ default: () => h(Fragment, null, props.showAttachButton && h(UUploadTrigger, {
560
833
  abstract: true
561
834
  }, {
562
835
  default: ({
@@ -626,7 +899,60 @@ export default defineComponent({
626
899
  })
627
900
  }));
628
901
  };
902
+ if (isStandalone) {
903
+ provide(chatInjectionKey, {
904
+ mergedClsPrefixRef,
905
+ mergedThemeRef,
906
+ selectedChatRef,
907
+ messagesRef,
908
+ typingChatIdsRef,
909
+ messagesLoadingRef,
910
+ messagesLoadingCountRef,
911
+ headerButtonPropsRef,
912
+ headerIconPropsRef,
913
+ headerShareButtonPropsRef,
914
+ headerProfileButtonPropsRef,
915
+ headerCloseButtonPropsRef,
916
+ headerShareIconPropsRef,
917
+ headerProfileIconPropsRef,
918
+ messageUploadPropsRef,
919
+ footerInputPropsRef,
920
+ footerButtonPropsRef,
921
+ footerUploadPropsRef,
922
+ footerIconPropsRef,
923
+ footerSuffixIconPropsRef,
924
+ inputPlaceholderRef,
925
+ retryTextRef,
926
+ typingTextRef,
927
+ closeButtonTextRef,
928
+ shareButtonTooltipRef,
929
+ profileButtonTooltipRef,
930
+ unreadNotificationTextRef,
931
+ notificationsShownSetRef,
932
+ unreadCountsBeforeReadRef,
933
+ markNotificationShown,
934
+ handleMessageSend,
935
+ handleMessageRetry,
936
+ handleFooterInputChange,
937
+ startEditingMessage: startEditingMessageRef,
938
+ editMessageIdRef,
939
+ bubbleActionsRef,
940
+ onAttachmentUpload,
941
+ onAttachmentDownload: toRef(props, 'onAttachmentDownload'),
942
+ onChatClose,
943
+ onChatShare,
944
+ onUserProfile,
945
+ onMessagesScrollToTop,
946
+ onMessagesScrollToBottom
947
+ });
948
+ }
629
949
  return {
950
+ mergedClsPrefix: mergedClsPrefixRef,
951
+ mergedTheme: mergedThemeRef,
952
+ cssVars: cssVarsRef,
953
+ themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
954
+ onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender,
955
+ isStandalone,
630
956
  renderHeader,
631
957
  renderMessages,
632
958
  renderEditingBlock,
@@ -641,17 +967,26 @@ export default defineComponent({
641
967
  };
642
968
  },
643
969
  render() {
970
+ var _a;
971
+ (_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
644
972
  const {
645
- mergedClsPrefixRef
646
- } = inject(chatInjectionKey);
647
- return h("div", {
648
- class: `${mergedClsPrefixRef.value}-chat-main`
649
- }, this.renderHeader(), h(USafeTopScrollbar, {
973
+ mergedClsPrefix
974
+ } = this;
975
+ const mainArea = h("div", {
976
+ class: [`${mergedClsPrefix}-chat-main`, this.isStandalone && `${mergedClsPrefix}-chat-main--standalone`]
977
+ }, !this.isStandalone && this.renderHeader(), h(USafeTopScrollbar, {
650
978
  ref: "messagesBodyRef",
651
- class: `${mergedClsPrefixRef.value}-chat-main__body`,
979
+ class: `${mergedClsPrefix}-chat-main__body`,
652
980
  onScroll: this.handleMessagesScroll
653
981
  }, {
654
982
  default: () => this.renderMessages()
655
983
  }), this.renderFooter());
984
+ if (!this.isStandalone) {
985
+ return mainArea;
986
+ }
987
+ return h("div", {
988
+ class: [`${mergedClsPrefix}-chat`, this.themeClass],
989
+ style: this.cssVars
990
+ }, mainArea);
656
991
  }
657
992
  });