@uzum-tech/ui 2.2.0 → 2.3.0
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 +1431 -721
- package/dist/index.mjs +1424 -722
- package/dist/index.prod.js +2 -2
- package/dist/index.prod.mjs +2 -2
- package/es/chat/index.d.ts +2 -0
- package/es/chat/index.mjs +1 -0
- package/es/chat/src/Chat.d.ts +20800 -24
- package/es/chat/src/Chat.mjs +1 -1
- package/es/chat/src/ChatMainArea.d.ts +9749 -0
- package/es/chat/src/{ChatParts/MainArea.mjs → ChatMainArea.mjs} +409 -75
- package/es/chat/src/ChatMessages.d.ts +1 -33
- package/es/chat/src/ChatMessages.mjs +79 -167
- package/es/chat/src/interface.d.ts +16 -12
- package/es/chat/src/interface.mjs +7 -1
- package/es/chat/src/styles/index.cssr.mjs +4 -1
- package/es/components.d.ts +28782 -256
- package/es/components.mjs +6 -1
- package/es/config-provider/src/internal-interface.d.ts +4 -0
- package/es/message-bubble/index.d.ts +3 -0
- package/es/message-bubble/index.mjs +2 -0
- package/es/message-bubble/src/MessageBubble.d.ts +304 -0
- package/es/message-bubble/src/MessageBubble.mjs +336 -0
- package/es/message-bubble/src/interface.d.ts +204 -0
- package/es/message-bubble/src/interface.mjs +92 -0
- package/es/message-bubble/src/styles/index.cssr.d.ts +2 -0
- package/es/message-bubble/src/styles/index.cssr.mjs +133 -0
- package/es/message-bubble/styles/dark.d.ts +29 -0
- package/es/message-bubble/styles/dark.mjs +13 -0
- package/es/message-bubble/styles/index.d.ts +3 -0
- package/es/message-bubble/styles/index.mjs +2 -0
- package/es/message-bubble/styles/light.d.ts +49 -0
- package/es/message-bubble/styles/light.mjs +44 -0
- package/es/pagination/src/Pagination.d.ts +4 -0
- package/es/pagination/src/Pagination.mjs +8 -0
- package/es/pagination/src/interface.d.ts +2 -0
- package/es/pagination/src/interface.mjs +2 -0
- package/es/styles.d.ts +1 -0
- package/es/styles.mjs +1 -0
- package/es/themes/dark.mjs +2 -0
- package/es/themes/light.mjs +2 -0
- package/es/upload/src/Upload.d.ts +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/lib/chat/index.d.ts +2 -0
- package/lib/chat/index.js +3 -1
- package/lib/chat/src/Chat.d.ts +20800 -24
- package/lib/chat/src/Chat.js +2 -2
- package/lib/chat/src/ChatMainArea.d.ts +9749 -0
- package/lib/chat/src/{ChatParts/MainArea.js → ChatMainArea.js} +299 -30
- package/lib/chat/src/ChatMessages.d.ts +1 -33
- package/lib/chat/src/ChatMessages.js +61 -158
- package/lib/chat/src/interface.d.ts +16 -12
- package/lib/chat/src/interface.js +7 -1
- package/lib/chat/src/styles/index.cssr.js +4 -1
- package/lib/components.d.ts +28782 -256
- package/lib/components.js +18 -8
- package/lib/config-provider/src/internal-interface.d.ts +4 -0
- package/lib/message-bubble/index.d.ts +3 -0
- package/lib/message-bubble/index.js +14 -0
- package/lib/message-bubble/src/MessageBubble.d.ts +304 -0
- package/lib/message-bubble/src/MessageBubble.js +276 -0
- package/lib/message-bubble/src/interface.d.ts +204 -0
- package/lib/message-bubble/src/interface.js +80 -0
- package/lib/message-bubble/src/styles/index.cssr.d.ts +2 -0
- package/lib/message-bubble/src/styles/index.cssr.js +138 -0
- package/lib/message-bubble/styles/dark.d.ts +29 -0
- package/lib/message-bubble/styles/dark.js +15 -0
- package/lib/message-bubble/styles/index.d.ts +3 -0
- package/lib/message-bubble/styles/index.js +10 -0
- package/lib/message-bubble/styles/light.d.ts +49 -0
- package/lib/message-bubble/styles/light.js +36 -0
- package/lib/pagination/src/Pagination.d.ts +4 -0
- package/lib/pagination/src/Pagination.js +6 -0
- package/lib/pagination/src/interface.d.ts +2 -0
- package/lib/pagination/src/interface.js +1 -1
- package/lib/styles.d.ts +1 -0
- package/lib/styles.js +84 -82
- package/lib/themes/dark.js +78 -76
- package/lib/themes/light.js +76 -74
- package/lib/upload/src/Upload.d.ts +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +4 -4
- package/volar.d.ts +2 -0
- package/web-types.json +182 -1
- package/es/chat/src/ChatParts/MainArea.d.ts +0 -20
- package/lib/chat/src/ChatParts/MainArea.d.ts +0 -20
|
@@ -12,27 +12,229 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.chatMainAreaProps = void 0;
|
|
15
16
|
const vue_1 = require("vue");
|
|
16
|
-
const icons_1 = require("
|
|
17
|
-
const _mixins_1 = require("
|
|
18
|
-
const _utils_1 = require("
|
|
19
|
-
const button_1 = require("
|
|
20
|
-
const flex_1 = require("
|
|
21
|
-
const icon_1 = require("
|
|
22
|
-
const input_1 = require("
|
|
23
|
-
const list_1 = require("
|
|
24
|
-
const safe_top_scrollbar_1 = require("
|
|
25
|
-
const tooltip_1 = require("
|
|
26
|
-
const typography_1 = require("
|
|
27
|
-
const upload_1 = require("
|
|
28
|
-
const
|
|
29
|
-
const
|
|
17
|
+
const icons_1 = require("../../_internal/icons");
|
|
18
|
+
const _mixins_1 = require("../../_mixins");
|
|
19
|
+
const _utils_1 = require("../../_utils");
|
|
20
|
+
const button_1 = require("../../button");
|
|
21
|
+
const flex_1 = require("../../flex");
|
|
22
|
+
const icon_1 = require("../../icon");
|
|
23
|
+
const input_1 = require("../../input");
|
|
24
|
+
const list_1 = require("../../list");
|
|
25
|
+
const safe_top_scrollbar_1 = require("../../safe-top-scrollbar");
|
|
26
|
+
const tooltip_1 = require("../../tooltip");
|
|
27
|
+
const typography_1 = require("../../typography");
|
|
28
|
+
const upload_1 = require("../../upload");
|
|
29
|
+
const styles_1 = require("../styles");
|
|
30
|
+
const ChatMessages_1 = __importDefault(require("./ChatMessages"));
|
|
31
|
+
const interface_1 = require("./interface");
|
|
32
|
+
const index_cssr_1 = __importDefault(require("./styles/index.cssr"));
|
|
30
33
|
const SENDING_DELAY = 100;
|
|
34
|
+
exports.chatMainAreaProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { selectedChat: {
|
|
35
|
+
type: Object,
|
|
36
|
+
default: undefined
|
|
37
|
+
}, messages: {
|
|
38
|
+
type: Array,
|
|
39
|
+
default: () => []
|
|
40
|
+
}, typingChatIds: {
|
|
41
|
+
type: Array,
|
|
42
|
+
default: () => []
|
|
43
|
+
}, loading: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false
|
|
46
|
+
}, loadingCount: {
|
|
47
|
+
type: Number,
|
|
48
|
+
default: 10
|
|
49
|
+
}, headerButtonProps: {
|
|
50
|
+
type: Object,
|
|
51
|
+
default: undefined
|
|
52
|
+
}, headerIconProps: {
|
|
53
|
+
type: Object,
|
|
54
|
+
default: undefined
|
|
55
|
+
}, headerShareButtonProps: {
|
|
56
|
+
type: Object,
|
|
57
|
+
default: undefined
|
|
58
|
+
}, headerProfileButtonProps: {
|
|
59
|
+
type: Object,
|
|
60
|
+
default: undefined
|
|
61
|
+
}, headerCloseButtonProps: {
|
|
62
|
+
type: Object,
|
|
63
|
+
default: undefined
|
|
64
|
+
}, headerShareIconProps: {
|
|
65
|
+
type: Object,
|
|
66
|
+
default: undefined
|
|
67
|
+
}, headerProfileIconProps: {
|
|
68
|
+
type: Object,
|
|
69
|
+
default: undefined
|
|
70
|
+
}, messageUploadProps: {
|
|
71
|
+
type: Object,
|
|
72
|
+
default: undefined
|
|
73
|
+
}, footerInputProps: {
|
|
74
|
+
type: Object,
|
|
75
|
+
default: undefined
|
|
76
|
+
}, footerButtonProps: {
|
|
77
|
+
type: Object,
|
|
78
|
+
default: undefined
|
|
79
|
+
}, footerUploadProps: {
|
|
80
|
+
type: Object,
|
|
81
|
+
default: undefined
|
|
82
|
+
}, footerIconProps: {
|
|
83
|
+
type: Object,
|
|
84
|
+
default: undefined
|
|
85
|
+
}, footerSuffixIconProps: {
|
|
86
|
+
type: Object,
|
|
87
|
+
default: undefined
|
|
88
|
+
}, showAttachButton: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: true
|
|
91
|
+
}, inputPlaceholder: {
|
|
92
|
+
type: String,
|
|
93
|
+
default: undefined
|
|
94
|
+
}, retryText: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: undefined
|
|
97
|
+
}, typingText: {
|
|
98
|
+
type: String,
|
|
99
|
+
default: undefined
|
|
100
|
+
}, closeButtonText: {
|
|
101
|
+
type: String,
|
|
102
|
+
default: undefined
|
|
103
|
+
}, shareButtonTooltip: {
|
|
104
|
+
type: String,
|
|
105
|
+
default: undefined
|
|
106
|
+
}, profileButtonTooltip: {
|
|
107
|
+
type: String,
|
|
108
|
+
default: undefined
|
|
109
|
+
}, unreadNotificationText: {
|
|
110
|
+
type: String,
|
|
111
|
+
default: undefined
|
|
112
|
+
}, bubbleActions: {
|
|
113
|
+
type: Array,
|
|
114
|
+
default: undefined
|
|
115
|
+
}, onMessageSend: {
|
|
116
|
+
type: Function,
|
|
117
|
+
default: undefined
|
|
118
|
+
}, onMessageRetry: {
|
|
119
|
+
type: Function,
|
|
120
|
+
default: undefined
|
|
121
|
+
}, onFooterInputChange: {
|
|
122
|
+
type: Function,
|
|
123
|
+
default: undefined
|
|
124
|
+
}, onChatClose: {
|
|
125
|
+
type: Function,
|
|
126
|
+
default: undefined
|
|
127
|
+
}, onChatShare: {
|
|
128
|
+
type: Function,
|
|
129
|
+
default: undefined
|
|
130
|
+
}, onUserProfile: {
|
|
131
|
+
type: Function,
|
|
132
|
+
default: undefined
|
|
133
|
+
}, onAttachmentUpload: {
|
|
134
|
+
type: Function,
|
|
135
|
+
default: undefined
|
|
136
|
+
}, onAttachmentDownload: {
|
|
137
|
+
type: Function,
|
|
138
|
+
default: undefined
|
|
139
|
+
}, onMessagesScrollToTop: {
|
|
140
|
+
type: Function,
|
|
141
|
+
default: undefined
|
|
142
|
+
}, onMessagesScrollToBottom: {
|
|
143
|
+
type: Function,
|
|
144
|
+
default: undefined
|
|
145
|
+
} });
|
|
31
146
|
exports.default = (0, vue_1.defineComponent)({
|
|
32
147
|
name: 'ChatMainArea',
|
|
33
|
-
|
|
148
|
+
props: exports.chatMainAreaProps,
|
|
149
|
+
setup(props, { slots }) {
|
|
150
|
+
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;
|
|
151
|
+
const UChat = (0, vue_1.inject)(interface_1.chatInjectionKey, null);
|
|
152
|
+
const isStandalone = !UChat;
|
|
153
|
+
const { mergedClsPrefixRef } = (0, _mixins_1.useConfig)(props);
|
|
154
|
+
const mergedThemeRef = (_a = UChat === null || UChat === void 0 ? void 0 : UChat.mergedThemeRef) !== null && _a !== void 0 ? _a : (0, _mixins_1.useTheme)('Chat', '-chat', index_cssr_1.default, styles_1.chatLight, props, mergedClsPrefixRef);
|
|
34
155
|
const { localeRef } = (0, _mixins_1.useLocale)('Chat');
|
|
35
|
-
const
|
|
156
|
+
const selectedChatRef = (_b = UChat === null || UChat === void 0 ? void 0 : UChat.selectedChatRef) !== null && _b !== void 0 ? _b : (0, vue_1.toRef)(props, 'selectedChat');
|
|
157
|
+
const messagesRef = (_c = UChat === null || UChat === void 0 ? void 0 : UChat.messagesRef) !== null && _c !== void 0 ? _c : (0, vue_1.toRef)(props, 'messages');
|
|
158
|
+
const typingChatIdsRef = (_d = UChat === null || UChat === void 0 ? void 0 : UChat.typingChatIdsRef) !== null && _d !== void 0 ? _d : (0, vue_1.toRef)(props, 'typingChatIds');
|
|
159
|
+
const messagesLoadingRef = (_e = UChat === null || UChat === void 0 ? void 0 : UChat.messagesLoadingRef) !== null && _e !== void 0 ? _e : (0, vue_1.toRef)(props, 'loading');
|
|
160
|
+
const messagesLoadingCountRef = (_f = UChat === null || UChat === void 0 ? void 0 : UChat.messagesLoadingCountRef) !== null && _f !== void 0 ? _f : (0, vue_1.toRef)(props, 'loadingCount');
|
|
161
|
+
const headerButtonPropsRef = (_g = UChat === null || UChat === void 0 ? void 0 : UChat.headerButtonPropsRef) !== null && _g !== void 0 ? _g : (0, vue_1.toRef)(props, 'headerButtonProps');
|
|
162
|
+
const headerIconPropsRef = (_h = UChat === null || UChat === void 0 ? void 0 : UChat.headerIconPropsRef) !== null && _h !== void 0 ? _h : (0, vue_1.toRef)(props, 'headerIconProps');
|
|
163
|
+
const headerShareButtonPropsRef = (_j = UChat === null || UChat === void 0 ? void 0 : UChat.headerShareButtonPropsRef) !== null && _j !== void 0 ? _j : (0, vue_1.toRef)(props, 'headerShareButtonProps');
|
|
164
|
+
const headerProfileButtonPropsRef = (_k = UChat === null || UChat === void 0 ? void 0 : UChat.headerProfileButtonPropsRef) !== null && _k !== void 0 ? _k : (0, vue_1.toRef)(props, 'headerProfileButtonProps');
|
|
165
|
+
const headerCloseButtonPropsRef = (_l = UChat === null || UChat === void 0 ? void 0 : UChat.headerCloseButtonPropsRef) !== null && _l !== void 0 ? _l : (0, vue_1.toRef)(props, 'headerCloseButtonProps');
|
|
166
|
+
const headerShareIconPropsRef = (_m = UChat === null || UChat === void 0 ? void 0 : UChat.headerShareIconPropsRef) !== null && _m !== void 0 ? _m : (0, vue_1.toRef)(props, 'headerShareIconProps');
|
|
167
|
+
const headerProfileIconPropsRef = (_o = UChat === null || UChat === void 0 ? void 0 : UChat.headerProfileIconPropsRef) !== null && _o !== void 0 ? _o : (0, vue_1.toRef)(props, 'headerProfileIconProps');
|
|
168
|
+
const messageUploadPropsRef = (_p = UChat === null || UChat === void 0 ? void 0 : UChat.messageUploadPropsRef) !== null && _p !== void 0 ? _p : (0, vue_1.toRef)(props, 'messageUploadProps');
|
|
169
|
+
const footerInputPropsRef = (_q = UChat === null || UChat === void 0 ? void 0 : UChat.footerInputPropsRef) !== null && _q !== void 0 ? _q : (0, vue_1.toRef)(props, 'footerInputProps');
|
|
170
|
+
const footerButtonPropsRef = (_r = UChat === null || UChat === void 0 ? void 0 : UChat.footerButtonPropsRef) !== null && _r !== void 0 ? _r : (0, vue_1.toRef)(props, 'footerButtonProps');
|
|
171
|
+
const footerUploadPropsRef = (_s = UChat === null || UChat === void 0 ? void 0 : UChat.footerUploadPropsRef) !== null && _s !== void 0 ? _s : (0, vue_1.toRef)(props, 'footerUploadProps');
|
|
172
|
+
const footerIconPropsRef = (_t = UChat === null || UChat === void 0 ? void 0 : UChat.footerIconPropsRef) !== null && _t !== void 0 ? _t : (0, vue_1.toRef)(props, 'footerIconProps');
|
|
173
|
+
const footerSuffixIconPropsRef = (_u = UChat === null || UChat === void 0 ? void 0 : UChat.footerSuffixIconPropsRef) !== null && _u !== void 0 ? _u : (0, vue_1.toRef)(props, 'footerSuffixIconProps');
|
|
174
|
+
const inputPlaceholderRef = (_v = UChat === null || UChat === void 0 ? void 0 : UChat.inputPlaceholderRef) !== null && _v !== void 0 ? _v : (0, vue_1.computed)(() => { var _a; return (_a = props.inputPlaceholder) !== null && _a !== void 0 ? _a : localeRef.value.inputPlaceholder; });
|
|
175
|
+
const retryTextRef = (_w = UChat === null || UChat === void 0 ? void 0 : UChat.retryTextRef) !== null && _w !== void 0 ? _w : (0, vue_1.computed)(() => { var _a; return (_a = props.retryText) !== null && _a !== void 0 ? _a : localeRef.value.retryText; });
|
|
176
|
+
const typingTextRef = (_x = UChat === null || UChat === void 0 ? void 0 : UChat.typingTextRef) !== null && _x !== void 0 ? _x : (0, vue_1.computed)(() => { var _a; return (_a = props.typingText) !== null && _a !== void 0 ? _a : localeRef.value.typingText; });
|
|
177
|
+
const closeButtonTextRef = (_y = UChat === null || UChat === void 0 ? void 0 : UChat.closeButtonTextRef) !== null && _y !== void 0 ? _y : (0, vue_1.computed)(() => { var _a; return (_a = props.closeButtonText) !== null && _a !== void 0 ? _a : localeRef.value.closeButtonText; });
|
|
178
|
+
const shareButtonTooltipRef = (_z = UChat === null || UChat === void 0 ? void 0 : UChat.shareButtonTooltipRef) !== null && _z !== void 0 ? _z : (0, vue_1.computed)(() => { var _a; return (_a = props.shareButtonTooltip) !== null && _a !== void 0 ? _a : localeRef.value.shareButtonTooltip; });
|
|
179
|
+
const profileButtonTooltipRef = (_0 = UChat === null || UChat === void 0 ? void 0 : UChat.profileButtonTooltipRef) !== null && _0 !== void 0 ? _0 : (0, vue_1.computed)(() => { var _a; return (_a = props.profileButtonTooltip) !== null && _a !== void 0 ? _a : localeRef.value.profileButtonTooltip; });
|
|
180
|
+
const unreadNotificationTextRef = (_1 = UChat === null || UChat === void 0 ? void 0 : UChat.unreadNotificationTextRef) !== null && _1 !== void 0 ? _1 : (0, vue_1.computed)(() => { var _a; return (_a = props.unreadNotificationText) !== null && _a !== void 0 ? _a : localeRef.value.unreadNotificationText; });
|
|
181
|
+
const notificationsShownSetRef = (_2 = UChat === null || UChat === void 0 ? void 0 : UChat.notificationsShownSetRef) !== null && _2 !== void 0 ? _2 : (0, vue_1.ref)(new Set());
|
|
182
|
+
const unreadCountsBeforeReadRef = (_3 = UChat === null || UChat === void 0 ? void 0 : UChat.unreadCountsBeforeReadRef) !== null && _3 !== void 0 ? _3 : (0, vue_1.ref)({});
|
|
183
|
+
const markNotificationShown = (_4 = UChat === null || UChat === void 0 ? void 0 : UChat.markNotificationShown) !== null && _4 !== void 0 ? _4 : ((chatId) => {
|
|
184
|
+
notificationsShownSetRef.value.add(chatId);
|
|
185
|
+
notificationsShownSetRef.value = new Set(notificationsShownSetRef.value);
|
|
186
|
+
});
|
|
187
|
+
const editMessageIdRef = (_5 = UChat === null || UChat === void 0 ? void 0 : UChat.editMessageIdRef) !== null && _5 !== void 0 ? _5 : (0, vue_1.ref)(null);
|
|
188
|
+
const startEditingMessageRef = (_6 = UChat === null || UChat === void 0 ? void 0 : UChat.startEditingMessage) !== null && _6 !== void 0 ? _6 : (0, vue_1.ref)();
|
|
189
|
+
const bubbleActionsRef = (_7 = UChat === null || UChat === void 0 ? void 0 : UChat.bubbleActionsRef) !== null && _7 !== void 0 ? _7 : (0, vue_1.toRef)(props, 'bubbleActions');
|
|
190
|
+
const handleMessageSend = (_8 = UChat === null || UChat === void 0 ? void 0 : UChat.handleMessageSend) !== null && _8 !== void 0 ? _8 : ((content, attachments) => { var _a; return (_a = props.onMessageSend) === null || _a === void 0 ? void 0 : _a.call(props, content, attachments); });
|
|
191
|
+
const handleMessageRetry = (_9 = UChat === null || UChat === void 0 ? void 0 : UChat.handleMessageRetry) !== null && _9 !== void 0 ? _9 : ((message) => { var _a; return (_a = props.onMessageRetry) === null || _a === void 0 ? void 0 : _a.call(props, message); });
|
|
192
|
+
const handleFooterInputChange = (_10 = UChat === null || UChat === void 0 ? void 0 : UChat.handleFooterInputChange) !== null && _10 !== void 0 ? _10 : ((value, chatId) => { var _a; return (_a = props.onFooterInputChange) === null || _a === void 0 ? void 0 : _a.call(props, value, chatId); });
|
|
193
|
+
const onAttachmentUpload = (_11 = UChat === null || UChat === void 0 ? void 0 : UChat.onAttachmentUpload) !== null && _11 !== void 0 ? _11 : (0, vue_1.toRef)(props, 'onAttachmentUpload');
|
|
194
|
+
const onChatClose = (_12 = UChat === null || UChat === void 0 ? void 0 : UChat.onChatClose) !== null && _12 !== void 0 ? _12 : (0, vue_1.toRef)(props, 'onChatClose');
|
|
195
|
+
const onChatShare = (_13 = UChat === null || UChat === void 0 ? void 0 : UChat.onChatShare) !== null && _13 !== void 0 ? _13 : (0, vue_1.toRef)(props, 'onChatShare');
|
|
196
|
+
const onUserProfile = (_14 = UChat === null || UChat === void 0 ? void 0 : UChat.onUserProfile) !== null && _14 !== void 0 ? _14 : (0, vue_1.toRef)(props, 'onUserProfile');
|
|
197
|
+
const onMessagesScrollToTop = (_15 = UChat === null || UChat === void 0 ? void 0 : UChat.onMessagesScrollToTop) !== null && _15 !== void 0 ? _15 : (0, vue_1.toRef)(props, 'onMessagesScrollToTop');
|
|
198
|
+
const onMessagesScrollToBottom = (_16 = UChat === null || UChat === void 0 ? void 0 : UChat.onMessagesScrollToBottom) !== null && _16 !== void 0 ? _16 : (0, vue_1.toRef)(props, 'onMessagesScrollToBottom');
|
|
199
|
+
const cssVarsRef = (0, vue_1.computed)(() => {
|
|
200
|
+
const { common: { cubicBezierEaseInOut, brandPrimary500, staticGreen, staticRed, textPrimary, textSecondary, textTertiary }, self: { backgroundColor, borderColor, sidebarItemSubtitleColor, mainBackgroundColor, headerBackgroundColor, headerBorderColor, headerTitleColor, messageBubbleBackgroundColorOwn, messageBubbleBackgroundColorOther, messageBubbleTextColorOwn, messageBubbleTextColorOther, messageTimeColor, messageStatusColor, attachmentBackgroundColorOwn, attachmentBackgroundColorOther, footerBackgroundColor, footerBorderColor, inputBackgroundColor, inputBorderColor, inputSuffixColor, unreadNotificationBackgroundColor, unreadNotificationTextColor, typingIndicatorColor, dateSeparatorColor, dateSeparatorBackgroundColor, borderRadius, errorColor } } = mergedThemeRef.value;
|
|
201
|
+
return {
|
|
202
|
+
'--u-bezier': cubicBezierEaseInOut,
|
|
203
|
+
'--u-color-primary': brandPrimary500,
|
|
204
|
+
'--u-color-success': staticGreen,
|
|
205
|
+
'--u-color-error': errorColor || staticRed,
|
|
206
|
+
'--u-text-color-base': textPrimary,
|
|
207
|
+
'--u-text-color-secondary': textSecondary,
|
|
208
|
+
'--u-text-color-disabled': textTertiary,
|
|
209
|
+
'--u-background-color': backgroundColor,
|
|
210
|
+
'--u-border-color': borderColor,
|
|
211
|
+
'--u-sidebar-item-subtitle-color': sidebarItemSubtitleColor,
|
|
212
|
+
'--u-main-background-color': mainBackgroundColor,
|
|
213
|
+
'--u-header-background-color': headerBackgroundColor,
|
|
214
|
+
'--u-header-border-color': headerBorderColor,
|
|
215
|
+
'--u-header-title-color': headerTitleColor,
|
|
216
|
+
'--u-message-bubble-background-color-own': messageBubbleBackgroundColorOwn,
|
|
217
|
+
'--u-message-bubble-background-color-other': messageBubbleBackgroundColorOther,
|
|
218
|
+
'--u-message-bubble-text-color-own': messageBubbleTextColorOwn,
|
|
219
|
+
'--u-message-bubble-text-color-other': messageBubbleTextColorOther,
|
|
220
|
+
'--u-message-time-color': messageTimeColor,
|
|
221
|
+
'--u-message-status-color': messageStatusColor,
|
|
222
|
+
'--u-attachment-background-color-own': attachmentBackgroundColorOwn,
|
|
223
|
+
'--u-attachment-background-color-other': attachmentBackgroundColorOther,
|
|
224
|
+
'--u-footer-background-color': footerBackgroundColor,
|
|
225
|
+
'--u-footer-border-color': footerBorderColor,
|
|
226
|
+
'--u-input-background-color': inputBackgroundColor,
|
|
227
|
+
'--u-input-border-color': inputBorderColor,
|
|
228
|
+
'--u-input-suffix-color': inputSuffixColor,
|
|
229
|
+
'--u-unread-notification-background-color': unreadNotificationBackgroundColor,
|
|
230
|
+
'--u-unread-notification-text-color': unreadNotificationTextColor,
|
|
231
|
+
'--u-typing-indicator-color': typingIndicatorColor,
|
|
232
|
+
'--u-date-separator-color': dateSeparatorColor,
|
|
233
|
+
'--u-date-separator-background-color': dateSeparatorBackgroundColor,
|
|
234
|
+
'--u-border-radius': borderRadius
|
|
235
|
+
};
|
|
236
|
+
});
|
|
237
|
+
const themeClassHandle = (0, _mixins_1.useThemeClass)('chat-main-area', (0, vue_1.computed)(() => ''), cssVarsRef, props);
|
|
36
238
|
const messagesBodyRef = (0, vue_1.ref)();
|
|
37
239
|
const inputRef = (0, vue_1.ref)();
|
|
38
240
|
const inputValue = (0, vue_1.ref)('');
|
|
@@ -108,6 +310,11 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
108
310
|
}
|
|
109
311
|
lastMessageId.value = currentLastId !== null && currentLastId !== void 0 ? currentLastId : null;
|
|
110
312
|
}, { deep: true, flush: 'post' });
|
|
313
|
+
(0, vue_1.onMounted)(() => {
|
|
314
|
+
void (0, vue_1.nextTick)(() => {
|
|
315
|
+
scrollToBottom();
|
|
316
|
+
});
|
|
317
|
+
});
|
|
111
318
|
(0, vue_1.watch)(unreadMessagesCount, (newCount, oldCount) => {
|
|
112
319
|
if (selectedChatRef.value && newCount === 0 && oldCount > 0) {
|
|
113
320
|
showNotificationManually.value = false;
|
|
@@ -154,22 +361,22 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
154
361
|
lastScrollTop.value = scrollTop;
|
|
155
362
|
};
|
|
156
363
|
function scrollToBottom() {
|
|
157
|
-
const
|
|
158
|
-
if (!
|
|
364
|
+
const element = messagesBodyRef.value;
|
|
365
|
+
if (!element)
|
|
159
366
|
return;
|
|
160
|
-
if ('$el' in
|
|
161
|
-
const scrollContainer =
|
|
367
|
+
if ('$el' in element && element.$el instanceof HTMLElement) {
|
|
368
|
+
const scrollContainer = element.$el.querySelector('.u-scrollbar-content');
|
|
162
369
|
if (scrollContainer) {
|
|
163
370
|
scrollContainer.scrollTop = scrollContainer.scrollHeight;
|
|
164
371
|
return;
|
|
165
372
|
}
|
|
166
373
|
}
|
|
167
|
-
if ('scrollTo' in
|
|
168
|
-
|
|
374
|
+
if ('scrollTo' in element && typeof element.scrollTo === 'function') {
|
|
375
|
+
element.scrollTo({ top: 999999, behavior: 'auto' });
|
|
169
376
|
return;
|
|
170
377
|
}
|
|
171
|
-
if ('scrollTop' in
|
|
172
|
-
|
|
378
|
+
if ('scrollTop' in element && 'scrollHeight' in element) {
|
|
379
|
+
element.scrollTop = element.scrollHeight;
|
|
173
380
|
}
|
|
174
381
|
}
|
|
175
382
|
const toKeyString = (value) => {
|
|
@@ -404,7 +611,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
404
611
|
(0, vue_1.h)(upload_1.UUpload, Object.assign({ abstract: true, multiple: true, defaultUpload: false, fileList: attachmentFileList.value, onUpdateFileList: !handleOnChange() ? handleFileListUpdate : undefined }, footerUploadPropsRef.value, { onChange: handleOnChange() }), {
|
|
405
612
|
default: () => ((0, vue_1.h)(flex_1.UFlex, { align: "end", size: "small", wrap: false, class: `${mergedClsPrefixRef.value}-chat-main__input-container` }, {
|
|
406
613
|
default: () => ((0, vue_1.h)(vue_1.Fragment, null,
|
|
407
|
-
(0, vue_1.h)(upload_1.UUploadTrigger, { abstract: true }, {
|
|
614
|
+
props.showAttachButton && ((0, vue_1.h)(upload_1.UUploadTrigger, { abstract: true }, {
|
|
408
615
|
default: ({ handleClick }) => {
|
|
409
616
|
var _a;
|
|
410
617
|
return ((0, vue_1.h)(button_1.UButton, Object.assign({ secondary: true, size: "large", class: `${mergedClsPrefixRef.value}-chat-main__attach-btn` }, footerButtonPropsRef.value, { disabled: ((_a = footerInputPropsRef.value) === null || _a === void 0 ? void 0 : _a.disabled)
|
|
@@ -416,7 +623,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
416
623
|
}))
|
|
417
624
|
}));
|
|
418
625
|
}
|
|
419
|
-
}),
|
|
626
|
+
})),
|
|
420
627
|
(0, vue_1.h)(input_1.UInput, Object.assign({ ref: "inputRef", value: inputValue.value, placeholder: inputPlaceholderRef.value, class: `${mergedClsPrefixRef.value}-chat-main__input`, theme: mergedThemeRef.value.peers.Input, themeOverrides: mergedThemeRef.value.peerOverrides.Input, type: "textarea", autosize: {
|
|
421
628
|
minRows: 1,
|
|
422
629
|
maxRows: 5
|
|
@@ -445,7 +652,60 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
445
652
|
}))
|
|
446
653
|
})));
|
|
447
654
|
};
|
|
655
|
+
if (isStandalone) {
|
|
656
|
+
(0, vue_1.provide)(interface_1.chatInjectionKey, {
|
|
657
|
+
mergedClsPrefixRef,
|
|
658
|
+
mergedThemeRef,
|
|
659
|
+
selectedChatRef,
|
|
660
|
+
messagesRef,
|
|
661
|
+
typingChatIdsRef,
|
|
662
|
+
messagesLoadingRef,
|
|
663
|
+
messagesLoadingCountRef,
|
|
664
|
+
headerButtonPropsRef,
|
|
665
|
+
headerIconPropsRef,
|
|
666
|
+
headerShareButtonPropsRef,
|
|
667
|
+
headerProfileButtonPropsRef,
|
|
668
|
+
headerCloseButtonPropsRef,
|
|
669
|
+
headerShareIconPropsRef,
|
|
670
|
+
headerProfileIconPropsRef,
|
|
671
|
+
messageUploadPropsRef,
|
|
672
|
+
footerInputPropsRef,
|
|
673
|
+
footerButtonPropsRef,
|
|
674
|
+
footerUploadPropsRef,
|
|
675
|
+
footerIconPropsRef,
|
|
676
|
+
footerSuffixIconPropsRef,
|
|
677
|
+
inputPlaceholderRef,
|
|
678
|
+
retryTextRef,
|
|
679
|
+
typingTextRef,
|
|
680
|
+
closeButtonTextRef,
|
|
681
|
+
shareButtonTooltipRef,
|
|
682
|
+
profileButtonTooltipRef,
|
|
683
|
+
unreadNotificationTextRef,
|
|
684
|
+
notificationsShownSetRef,
|
|
685
|
+
unreadCountsBeforeReadRef,
|
|
686
|
+
markNotificationShown,
|
|
687
|
+
handleMessageSend,
|
|
688
|
+
handleMessageRetry,
|
|
689
|
+
handleFooterInputChange,
|
|
690
|
+
startEditingMessage: startEditingMessageRef,
|
|
691
|
+
editMessageIdRef,
|
|
692
|
+
bubbleActionsRef,
|
|
693
|
+
onAttachmentUpload,
|
|
694
|
+
onAttachmentDownload: (0, vue_1.toRef)(props, 'onAttachmentDownload'),
|
|
695
|
+
onChatClose,
|
|
696
|
+
onChatShare,
|
|
697
|
+
onUserProfile,
|
|
698
|
+
onMessagesScrollToTop,
|
|
699
|
+
onMessagesScrollToBottom
|
|
700
|
+
});
|
|
701
|
+
}
|
|
448
702
|
return {
|
|
703
|
+
mergedClsPrefix: mergedClsPrefixRef,
|
|
704
|
+
mergedTheme: mergedThemeRef,
|
|
705
|
+
cssVars: cssVarsRef,
|
|
706
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
707
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender,
|
|
708
|
+
isStandalone,
|
|
449
709
|
renderHeader,
|
|
450
710
|
renderMessages,
|
|
451
711
|
renderEditingBlock,
|
|
@@ -460,12 +720,21 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
460
720
|
};
|
|
461
721
|
},
|
|
462
722
|
render() {
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
723
|
+
var _a;
|
|
724
|
+
(_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
725
|
+
const { mergedClsPrefix } = this;
|
|
726
|
+
const mainArea = ((0, vue_1.h)("div", { class: [
|
|
727
|
+
`${mergedClsPrefix}-chat-main`,
|
|
728
|
+
this.isStandalone && `${mergedClsPrefix}-chat-main--standalone`
|
|
729
|
+
] },
|
|
730
|
+
!this.isStandalone && this.renderHeader(),
|
|
731
|
+
(0, vue_1.h)(safe_top_scrollbar_1.USafeTopScrollbar, { ref: "messagesBodyRef", class: `${mergedClsPrefix}-chat-main__body`, onScroll: this.handleMessagesScroll }, {
|
|
467
732
|
default: () => this.renderMessages()
|
|
468
733
|
}),
|
|
469
734
|
this.renderFooter()));
|
|
735
|
+
if (!this.isStandalone) {
|
|
736
|
+
return mainArea;
|
|
737
|
+
}
|
|
738
|
+
return ((0, vue_1.h)("div", { class: [`${mergedClsPrefix}-chat`, this.themeClass], style: this.cssVars }, mainArea));
|
|
470
739
|
}
|
|
471
740
|
});
|
|
@@ -7226,39 +7226,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
7226
7226
|
renderSkeletonMessage: (isOwn: boolean, index: number) => JSX.Element;
|
|
7227
7227
|
renderDateSeparator: (date: string) => JSX.Element;
|
|
7228
7228
|
renderUnreadNotification: () => JSX.Element;
|
|
7229
|
-
|
|
7230
|
-
contextMenuMessage: import("vue").Ref<ChatMessageData | undefined, ChatMessageData | undefined>;
|
|
7231
|
-
messageContextMenuOptions: import("vue").ComputedRef<import("../..").MenuOption[] | undefined>;
|
|
7232
|
-
handleContextMenuSelect: (key: string) => void;
|
|
7233
|
-
cssVars: import("vue").ComputedRef<{
|
|
7234
|
-
'--u-bezier': string;
|
|
7235
|
-
'--u-color-primary': string;
|
|
7236
|
-
'--u-color-success': string;
|
|
7237
|
-
'--u-color-error': string;
|
|
7238
|
-
'--u-text-color-base': string;
|
|
7239
|
-
'--u-text-color-secondary': string;
|
|
7240
|
-
'--u-text-color-disabled': string;
|
|
7241
|
-
'--u-background-color': string;
|
|
7242
|
-
'--u-border-color': string;
|
|
7243
|
-
'--u-main-background-color': string;
|
|
7244
|
-
'--u-header-background-color': string;
|
|
7245
|
-
'--u-header-border-color': string;
|
|
7246
|
-
'--u-header-title-color': string;
|
|
7247
|
-
'--u-message-bubble-background-color-own': string;
|
|
7248
|
-
'--u-message-bubble-background-color-other': string;
|
|
7249
|
-
'--u-message-bubble-text-color-own': string;
|
|
7250
|
-
'--u-message-bubble-text-color-other': string;
|
|
7251
|
-
'--u-message-time-color': string;
|
|
7252
|
-
'--u-message-status-color': string;
|
|
7253
|
-
'--u-attachment-background-color-own': string;
|
|
7254
|
-
'--u-attachment-background-color-other': string;
|
|
7255
|
-
'--u-unread-notification-background-color': string;
|
|
7256
|
-
'--u-unread-notification-text-color': string;
|
|
7257
|
-
'--u-typing-indicator-color': string;
|
|
7258
|
-
'--u-date-separator-color': string;
|
|
7259
|
-
'--u-date-separator-background-color': string;
|
|
7260
|
-
'--u-border-radius': string;
|
|
7261
|
-
}>;
|
|
7229
|
+
cssVars: import("vue").ComputedRef<Record<string, string>>;
|
|
7262
7230
|
themeClass: import("vue").Ref<string, string>;
|
|
7263
7231
|
onRender: () => void;
|
|
7264
7232
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|