@uzum-tech/ui 1.11.1 → 1.12.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 +10830 -6653
- package/dist/index.prod.js +4 -4
- package/es/_internal/icons/BurgerMenuIcon.d.ts +2 -0
- package/es/_internal/icons/BurgerMenuIcon.js +4 -0
- package/es/_internal/icons/Logout.d.ts +2 -0
- package/es/_internal/icons/Logout.js +4 -0
- package/es/_internal/icons/OzbekFlag.d.ts +2 -0
- package/es/_internal/icons/OzbekFlag.js +15 -0
- package/es/_internal/icons/RussiaFlag.d.ts +2 -0
- package/es/_internal/icons/RussiaFlag.js +11 -0
- package/es/_internal/icons/SendFilled.d.ts +2 -0
- package/es/_internal/icons/SendFilled.js +9 -0
- package/es/_internal/icons/index.d.ts +5 -0
- package/es/_internal/icons/index.js +5 -0
- package/es/_styles/common/dark.js +1 -1
- package/es/_styles/common/light.d.ts +1 -0
- package/es/_styles/common/light.js +1 -1
- package/es/chat/src/Chat.d.ts +464 -83
- package/es/chat/src/Chat.js +17 -2
- package/es/chat/src/ChatListItems.d.ts +497 -94
- package/es/chat/src/ChatListItems.js +1 -1
- package/es/chat/src/ChatMessages.d.ts +501 -94
- package/es/chat/src/ChatMessages.js +115 -22
- package/es/chat/src/ChatParts/MainArea.d.ts +7 -3
- package/es/chat/src/ChatParts/MainArea.js +110 -14
- package/es/chat/src/ChatParts/Sidebar.d.ts +64 -11
- package/es/chat/src/interface.d.ts +18 -0
- package/es/chat/src/interface.js +6 -0
- package/es/chat/src/styles/index.cssr.js +22 -1
- package/es/chat/styles/dark.d.ts +41 -8
- package/es/chat/styles/dark.js +6 -2
- package/es/chat/styles/light.d.ts +42 -8
- package/es/chat/styles/light.js +7 -2
- package/es/components.d.ts +3 -0
- package/es/components.js +3 -0
- package/es/config-provider/src/internal-interface.d.ts +17 -0
- package/es/dialog/src/DialogProvider.d.ts +2 -0
- package/es/form/src/FormItemCol.d.ts +2 -2
- package/es/form/src/FormItemGridItem.d.ts +2 -2
- package/es/form/src/FormItemRow.d.ts +1 -1
- package/es/grid/src/Grid.d.ts +1 -1
- package/es/grid/src/GridItem.d.ts +2 -2
- package/es/header/demos/mock.d.ts +2 -0
- package/es/header/demos/mock.js +235 -0
- package/es/header/index.d.ts +12 -0
- package/es/header/index.js +10 -0
- package/es/header/src/Header.d.ts +604 -0
- package/es/header/src/Header.js +320 -0
- package/es/header/src/HeaderActions.d.ts +120 -0
- package/es/header/src/HeaderActions.js +166 -0
- package/es/header/src/HeaderDesktopLayout.d.ts +25 -0
- package/es/header/src/HeaderDesktopLayout.js +24 -0
- package/es/header/src/HeaderMobileLayout.d.ts +25 -0
- package/es/header/src/HeaderMobileLayout.js +21 -0
- package/es/header/src/HeaderNavigation.d.ts +128 -0
- package/es/header/src/HeaderNavigation.js +172 -0
- package/es/header/src/HeaderSearchDesktop.d.ts +79 -0
- package/es/header/src/HeaderSearchDesktop.js +77 -0
- package/es/header/src/HeaderSearchMobile.d.ts +73 -0
- package/es/header/src/HeaderSearchMobile.js +126 -0
- package/es/header/src/HeaderSearchResults.d.ts +81 -0
- package/es/header/src/HeaderSearchResults.js +74 -0
- package/es/header/src/constants.d.ts +1 -0
- package/es/header/src/constants.js +1 -0
- package/es/header/src/interface.d.ts +58 -0
- package/es/header/src/interface.js +1 -0
- package/es/header/src/mobile/HeaderMobile.d.ts +218 -0
- package/es/header/src/mobile/HeaderMobile.js +241 -0
- package/es/header/src/styles/index.cssr.d.ts +6 -0
- package/es/header/src/styles/index.cssr.js +519 -0
- package/es/header/src/utils.d.ts +12 -0
- package/es/header/src/utils.js +47 -0
- package/es/header/styles/dark.d.ts +36 -0
- package/es/header/styles/dark.js +9 -0
- package/es/header/styles/index.d.ts +3 -0
- package/es/header/styles/index.js +2 -0
- package/es/header/styles/light.d.ts +72 -0
- package/es/header/styles/light.js +45 -0
- package/es/icon/src/Icon.d.ts +3 -0
- package/es/icon/src/Icon.js +3 -2
- package/es/icon-bar/index.d.ts +4 -0
- package/es/icon-bar/index.js +2 -0
- package/es/icon-bar/src/IconBar.d.ts +175 -0
- package/es/icon-bar/src/IconBar.js +57 -0
- package/es/icon-bar/src/IconBarItem.d.ts +163 -0
- package/es/icon-bar/src/IconBarItem.js +50 -0
- package/es/icon-bar/src/styles/index.cssr.d.ts +2 -0
- package/es/icon-bar/src/styles/index.cssr.js +62 -0
- package/es/icon-bar/styles/dark.d.ts +3 -0
- package/es/icon-bar/styles/dark.js +8 -0
- package/es/icon-bar/styles/index.d.ts +3 -0
- package/es/icon-bar/styles/index.js +2 -0
- package/es/icon-bar/styles/light.d.ts +19 -0
- package/es/icon-bar/styles/light.js +23 -0
- package/es/locales/common/arDZ.js +11 -1
- package/es/locales/common/deDE.js +11 -1
- package/es/locales/common/enGB.js +11 -1
- package/es/locales/common/enUS.d.ts +10 -0
- package/es/locales/common/enUS.js +11 -1
- package/es/locales/common/eo.js +11 -1
- package/es/locales/common/esAR.js +11 -1
- package/es/locales/common/faIR.js +11 -1
- package/es/locales/common/frFR.js +11 -1
- package/es/locales/common/idID.js +11 -1
- package/es/locales/common/itIT.js +11 -1
- package/es/locales/common/jaJP.js +11 -1
- package/es/locales/common/koKR.js +11 -1
- package/es/locales/common/nbNO.js +11 -1
- package/es/locales/common/nlNL.js +11 -1
- package/es/locales/common/plPL.js +11 -1
- package/es/locales/common/ptBR.js +11 -1
- package/es/locales/common/ruRU.js +11 -1
- package/es/locales/common/skSK.js +11 -1
- package/es/locales/common/svSE.js +11 -1
- package/es/locales/common/thTH.js +11 -1
- package/es/locales/common/trTR.js +11 -1
- package/es/locales/common/ukUA.js +11 -1
- package/es/locales/common/viVN.js +11 -1
- package/es/locales/common/zhCN.js +11 -1
- package/es/locales/common/zhTW.js +11 -1
- package/es/modal-fullscreen/src/ModalFull.js +1 -1
- package/es/qr-code/index.d.ts +2 -0
- package/es/qr-code/index.js +1 -0
- package/es/qr-code/src/QrCode.d.ts +171 -0
- package/es/qr-code/src/QrCode.js +229 -0
- package/es/qr-code/src/qrcodegen.d.ts +95 -0
- package/es/qr-code/src/qrcodegen.js +949 -0
- package/es/qr-code/src/styles/index.cssr.d.ts +2 -0
- package/es/qr-code/src/styles/index.cssr.js +8 -0
- package/es/qr-code/styles/dark.d.ts +3 -0
- package/es/qr-code/styles/dark.js +11 -0
- package/es/qr-code/styles/index.d.ts +3 -0
- package/es/qr-code/styles/index.js +2 -0
- package/es/qr-code/styles/light.d.ts +9 -0
- package/es/qr-code/styles/light.js +12 -0
- package/es/theme-editor/src/ThemeEditor.d.ts +1 -0
- package/es/themes/dark.js +7 -1
- package/es/themes/light.js +7 -1
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/icons/BurgerMenuIcon.d.ts +2 -0
- package/lib/_internal/icons/BurgerMenuIcon.js +6 -0
- package/lib/_internal/icons/Logout.d.ts +2 -0
- package/lib/_internal/icons/Logout.js +6 -0
- package/lib/_internal/icons/OzbekFlag.d.ts +2 -0
- package/lib/_internal/icons/OzbekFlag.js +17 -0
- package/lib/_internal/icons/RussiaFlag.d.ts +2 -0
- package/lib/_internal/icons/RussiaFlag.js +13 -0
- package/lib/_internal/icons/SendFilled.d.ts +2 -0
- package/lib/_internal/icons/SendFilled.js +11 -0
- package/lib/_internal/icons/index.d.ts +5 -0
- package/lib/_internal/icons/index.js +11 -1
- package/lib/_styles/common/dark.js +1 -1
- package/lib/_styles/common/light.d.ts +1 -0
- package/lib/_styles/common/light.js +1 -1
- package/lib/chat/src/Chat.d.ts +464 -83
- package/lib/chat/src/Chat.js +17 -2
- package/lib/chat/src/ChatListItems.d.ts +497 -94
- package/lib/chat/src/ChatListItems.js +1 -1
- package/lib/chat/src/ChatMessages.d.ts +501 -94
- package/lib/chat/src/ChatMessages.js +113 -20
- package/lib/chat/src/ChatParts/MainArea.d.ts +7 -3
- package/lib/chat/src/ChatParts/MainArea.js +108 -12
- package/lib/chat/src/ChatParts/Sidebar.d.ts +64 -11
- package/lib/chat/src/interface.d.ts +18 -0
- package/lib/chat/src/interface.js +7 -1
- package/lib/chat/src/styles/index.cssr.js +22 -1
- package/lib/chat/styles/dark.d.ts +41 -8
- package/lib/chat/styles/dark.js +6 -2
- package/lib/chat/styles/light.d.ts +42 -8
- package/lib/chat/styles/light.js +7 -2
- package/lib/components.d.ts +3 -0
- package/lib/components.js +3 -0
- package/lib/config-provider/src/internal-interface.d.ts +17 -0
- package/lib/dialog/src/DialogProvider.d.ts +2 -0
- package/lib/form/src/FormItemCol.d.ts +2 -2
- package/lib/form/src/FormItemGridItem.d.ts +2 -2
- package/lib/form/src/FormItemRow.d.ts +1 -1
- package/lib/grid/src/Grid.d.ts +1 -1
- package/lib/grid/src/GridItem.d.ts +2 -2
- package/lib/header/demos/mock.d.ts +2 -0
- package/lib/header/demos/mock.js +238 -0
- package/lib/header/index.d.ts +12 -0
- package/lib/header/index.js +48 -0
- package/lib/header/src/Header.d.ts +604 -0
- package/lib/header/src/Header.js +349 -0
- package/lib/header/src/HeaderActions.d.ts +120 -0
- package/lib/header/src/HeaderActions.js +172 -0
- package/lib/header/src/HeaderDesktopLayout.d.ts +25 -0
- package/lib/header/src/HeaderDesktopLayout.js +27 -0
- package/lib/header/src/HeaderMobileLayout.d.ts +25 -0
- package/lib/header/src/HeaderMobileLayout.js +24 -0
- package/lib/header/src/HeaderNavigation.d.ts +128 -0
- package/lib/header/src/HeaderNavigation.js +175 -0
- package/lib/header/src/HeaderSearchDesktop.d.ts +79 -0
- package/lib/header/src/HeaderSearchDesktop.js +83 -0
- package/lib/header/src/HeaderSearchMobile.d.ts +73 -0
- package/lib/header/src/HeaderSearchMobile.js +132 -0
- package/lib/header/src/HeaderSearchResults.d.ts +81 -0
- package/lib/header/src/HeaderSearchResults.js +77 -0
- package/lib/header/src/constants.d.ts +1 -0
- package/lib/header/src/constants.js +4 -0
- package/lib/header/src/interface.d.ts +58 -0
- package/lib/header/src/interface.js +2 -0
- package/lib/header/src/mobile/HeaderMobile.d.ts +218 -0
- package/lib/header/src/mobile/HeaderMobile.js +244 -0
- package/lib/header/src/styles/index.cssr.d.ts +6 -0
- package/lib/header/src/styles/index.cssr.js +525 -0
- package/lib/header/src/utils.d.ts +12 -0
- package/lib/header/src/utils.js +58 -0
- package/lib/header/styles/dark.d.ts +36 -0
- package/lib/header/styles/dark.js +11 -0
- package/lib/header/styles/index.d.ts +3 -0
- package/lib/header/styles/index.js +10 -0
- package/lib/header/styles/light.d.ts +72 -0
- package/lib/header/styles/light.js +49 -0
- package/lib/icon/src/Icon.d.ts +3 -0
- package/lib/icon/src/Icon.js +3 -2
- package/lib/icon-bar/index.d.ts +4 -0
- package/lib/icon-bar/index.js +12 -0
- package/lib/icon-bar/src/IconBar.d.ts +175 -0
- package/lib/icon-bar/src/IconBar.js +63 -0
- package/lib/icon-bar/src/IconBarItem.d.ts +163 -0
- package/lib/icon-bar/src/IconBarItem.js +56 -0
- package/lib/icon-bar/src/styles/index.cssr.d.ts +2 -0
- package/lib/icon-bar/src/styles/index.cssr.js +67 -0
- package/lib/icon-bar/styles/dark.d.ts +3 -0
- package/lib/icon-bar/styles/dark.js +10 -0
- package/lib/icon-bar/styles/index.d.ts +3 -0
- package/lib/icon-bar/styles/index.js +10 -0
- package/lib/icon-bar/styles/light.d.ts +19 -0
- package/lib/icon-bar/styles/light.js +27 -0
- package/lib/locales/common/arDZ.js +11 -1
- package/lib/locales/common/deDE.js +11 -1
- package/lib/locales/common/enGB.js +11 -1
- package/lib/locales/common/enUS.d.ts +10 -0
- package/lib/locales/common/enUS.js +11 -1
- package/lib/locales/common/eo.js +11 -1
- package/lib/locales/common/esAR.js +11 -1
- package/lib/locales/common/faIR.js +11 -1
- package/lib/locales/common/frFR.js +11 -1
- package/lib/locales/common/idID.js +11 -1
- package/lib/locales/common/itIT.js +11 -1
- package/lib/locales/common/jaJP.js +11 -1
- package/lib/locales/common/koKR.js +11 -1
- package/lib/locales/common/nbNO.js +11 -1
- package/lib/locales/common/nlNL.js +11 -1
- package/lib/locales/common/plPL.js +11 -1
- package/lib/locales/common/ptBR.js +11 -1
- package/lib/locales/common/ruRU.js +11 -1
- package/lib/locales/common/skSK.js +11 -1
- package/lib/locales/common/svSE.js +11 -1
- package/lib/locales/common/thTH.js +11 -1
- package/lib/locales/common/trTR.js +11 -1
- package/lib/locales/common/ukUA.js +11 -1
- package/lib/locales/common/viVN.js +11 -1
- package/lib/locales/common/zhCN.js +11 -1
- package/lib/locales/common/zhTW.js +11 -1
- package/lib/modal-fullscreen/src/ModalFull.js +1 -1
- package/lib/qr-code/index.d.ts +2 -0
- package/lib/qr-code/index.js +9 -0
- package/lib/qr-code/src/QrCode.d.ts +171 -0
- package/lib/qr-code/src/QrCode.js +235 -0
- package/lib/qr-code/src/qrcodegen.d.ts +95 -0
- package/lib/qr-code/src/qrcodegen.js +950 -0
- package/lib/qr-code/src/styles/index.cssr.d.ts +2 -0
- package/lib/qr-code/src/styles/index.cssr.js +13 -0
- package/lib/qr-code/styles/dark.d.ts +3 -0
- package/lib/qr-code/styles/dark.js +13 -0
- package/lib/qr-code/styles/index.d.ts +3 -0
- package/lib/qr-code/styles/index.js +10 -0
- package/lib/qr-code/styles/light.d.ts +9 -0
- package/lib/qr-code/styles/light.js +14 -0
- package/lib/theme-editor/src/ThemeEditor.d.ts +1 -0
- package/lib/themes/dark.js +7 -1
- package/lib/themes/light.js +7 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/volar.d.ts +12 -0
- package/web-types.json +854 -2
|
@@ -9,6 +9,7 @@ const interface_1 = require("./interface");
|
|
|
9
9
|
const ChatAttachment_1 = __importDefault(require("./ChatParts/ChatAttachment"));
|
|
10
10
|
const icon_1 = require("../../icon");
|
|
11
11
|
const skeleton_1 = require("../../skeleton");
|
|
12
|
+
const dropdown_1 = require("../../dropdown");
|
|
12
13
|
const index_cssr_1 = __importDefault(require("./styles/index.cssr"));
|
|
13
14
|
const styles_1 = require("../styles");
|
|
14
15
|
const _mixins_1 = require("../../_mixins");
|
|
@@ -65,6 +66,8 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
65
66
|
const { mergedClsPrefixRef } = (0, _mixins_1.useConfig)(props);
|
|
66
67
|
const themeRef = (_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);
|
|
67
68
|
const { localeRef } = (0, _mixins_1.useLocale)('Chat');
|
|
69
|
+
const contextMenuShow = (0, vue_1.ref)(false);
|
|
70
|
+
const contextMenuMessage = (0, vue_1.ref)();
|
|
68
71
|
const cssVarsRef = (0, vue_1.computed)(() => {
|
|
69
72
|
const { common: { cubicBezierEaseInOut, brandPrimary500, staticGreen, staticRed, textPrimary, textSecondary, textTertiary }, self: { backgroundColor, borderColor, mainBackgroundColor, headerBackgroundColor, headerBorderColor, headerTitleColor, messageBubbleBackgroundColorOwn, messageBubbleBackgroundColorOther, messageBubbleTextColorOwn, messageBubbleTextColorOther, messageTimeColor, messageStatusColor, attachmentBackgroundColorOwn, attachmentBackgroundColorOther, unreadNotificationBackgroundColor, unreadNotificationTextColor, typingIndicatorColor, dateSeparatorColor, dateSeparatorBackgroundColor, borderRadius, errorColor } } = themeRef.value;
|
|
70
73
|
return {
|
|
@@ -110,6 +113,50 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
110
113
|
var _a;
|
|
111
114
|
(_a = props.onMessageRetry) === null || _a === void 0 ? void 0 : _a.call(props, message);
|
|
112
115
|
};
|
|
116
|
+
const messageContextMenuOptions = (0, vue_1.computed)(() => {
|
|
117
|
+
var _a;
|
|
118
|
+
const message = contextMenuMessage.value;
|
|
119
|
+
if (!message)
|
|
120
|
+
return;
|
|
121
|
+
const bubbleActions = (_a = UChat === null || UChat === void 0 ? void 0 : UChat.bubbleActionsRef) === null || _a === void 0 ? void 0 : _a.value;
|
|
122
|
+
if (!bubbleActions || bubbleActions.length === 0) {
|
|
123
|
+
return [];
|
|
124
|
+
}
|
|
125
|
+
const result = [];
|
|
126
|
+
for (const action of bubbleActions) {
|
|
127
|
+
if (action.visible && !action.visible(message)) {
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
const label = typeof action.label === 'function' ? action.label() : action.label;
|
|
131
|
+
result.push({
|
|
132
|
+
label,
|
|
133
|
+
key: String(action.key)
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
return result;
|
|
137
|
+
});
|
|
138
|
+
const handleContextMenuSelect = (key) => {
|
|
139
|
+
var _a, _b;
|
|
140
|
+
const message = contextMenuMessage.value;
|
|
141
|
+
if (!message)
|
|
142
|
+
return;
|
|
143
|
+
if (key === interface_1.ChatBubbleActionKey.EDIT) {
|
|
144
|
+
const startEditing = (_a = UChat === null || UChat === void 0 ? void 0 : UChat.startEditingMessage) === null || _a === void 0 ? void 0 : _a.value;
|
|
145
|
+
if (startEditing) {
|
|
146
|
+
startEditing(message);
|
|
147
|
+
}
|
|
148
|
+
contextMenuShow.value = false;
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const bubbleActions = (_b = UChat === null || UChat === void 0 ? void 0 : UChat.bubbleActionsRef) === null || _b === void 0 ? void 0 : _b.value;
|
|
152
|
+
if (!bubbleActions)
|
|
153
|
+
return;
|
|
154
|
+
const action = bubbleActions.find((action) => action.key === key);
|
|
155
|
+
if (action) {
|
|
156
|
+
action.handler(message);
|
|
157
|
+
}
|
|
158
|
+
contextMenuShow.value = false;
|
|
159
|
+
};
|
|
113
160
|
const renderDateSeparator = (date) => {
|
|
114
161
|
return ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-chat-main__date-separator` },
|
|
115
162
|
(0, vue_1.h)("span", null, date)));
|
|
@@ -135,35 +182,69 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
135
182
|
] }, message.content && (0, vue_1.h)("span", null, message.content)));
|
|
136
183
|
};
|
|
137
184
|
const renderMessage = (message) => {
|
|
185
|
+
var _a, _b, _c;
|
|
138
186
|
const isOwn = message.isOwn;
|
|
139
187
|
const attachments = message.attachment
|
|
140
188
|
? Array.isArray(message.attachment)
|
|
141
189
|
? message.attachment
|
|
142
190
|
: [message.attachment]
|
|
143
191
|
: [];
|
|
144
|
-
|
|
192
|
+
const isContextMenuForThisMessage = contextMenuShow.value && ((_a = contextMenuMessage.value) === null || _a === void 0 ? void 0 : _a.id) === message.id;
|
|
193
|
+
const hasBubbleActionsSlot = slots.bubbleActions !== undefined;
|
|
194
|
+
const hasBubbleActionsConfig = ((_b = UChat === null || UChat === void 0 ? void 0 : UChat.bubbleActionsRef) === null || _b === void 0 ? void 0 : _b.value) &&
|
|
195
|
+
UChat.bubbleActionsRef.value.length > 0;
|
|
196
|
+
const messageBubbleContent = message.content || attachments.length > 1 ? ((0, vue_1.h)("div", { class: [
|
|
197
|
+
`${mergedClsPrefixRef.value}-chat-main__message-bubble`,
|
|
198
|
+
isOwn
|
|
199
|
+
? `${mergedClsPrefixRef.value}-chat-main__message-bubble--own`
|
|
200
|
+
: `${mergedClsPrefixRef.value}-chat-main__message-bubble--other`
|
|
201
|
+
] },
|
|
202
|
+
attachments.length > 0 && ((0, vue_1.h)(ChatAttachment_1.default, { message: message, attachments: attachments, uploadProps: props.uploadProps, withPadding: true }, {
|
|
203
|
+
default: slots.messageAttachment,
|
|
204
|
+
'upload-file-title': slots.messageAttachmentTitle,
|
|
205
|
+
'upload-file-subtitle': slots.messageAttachmentSubtitle
|
|
206
|
+
})),
|
|
207
|
+
message.content && ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-chat-main__message-text` }, message.content)))) : attachments.length === 1 ? ((0, vue_1.h)(ChatAttachment_1.default, { message: message, attachments: attachments, uploadProps: props.uploadProps }, {
|
|
208
|
+
default: slots.messageAttachment,
|
|
209
|
+
'upload-file-title': slots.messageAttachmentTitle,
|
|
210
|
+
'upload-file-subtitle': slots.messageAttachmentSubtitle
|
|
211
|
+
})) : null;
|
|
212
|
+
const messageContent = ((0, vue_1.h)("div", { key: message.id, class: [
|
|
145
213
|
`${mergedClsPrefixRef.value}-chat-main__message`,
|
|
146
214
|
isOwn
|
|
147
215
|
? `${mergedClsPrefixRef.value}-chat-main__message--own`
|
|
148
216
|
: `${mergedClsPrefixRef.value}-chat-main__message--other`
|
|
149
217
|
] },
|
|
150
218
|
(0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-chat-main__message-wrapper` },
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
219
|
+
hasBubbleActionsSlot ? ((0, vue_1.h)("div", { onContextmenu: (e) => {
|
|
220
|
+
e.preventDefault();
|
|
221
|
+
contextMenuShow.value = false;
|
|
222
|
+
void (0, vue_1.nextTick)().then(() => {
|
|
223
|
+
contextMenuShow.value = true;
|
|
224
|
+
contextMenuMessage.value = message;
|
|
225
|
+
});
|
|
226
|
+
} }, (_c = slots.bubbleActions) === null || _c === void 0 ? void 0 :
|
|
227
|
+
_c.call(slots, message),
|
|
228
|
+
messageBubbleContent)) : hasBubbleActionsConfig ? ((0, vue_1.h)(dropdown_1.UDropdown, { show: isContextMenuForThisMessage, onUpdateShow: (show) => {
|
|
229
|
+
var _a;
|
|
230
|
+
if (!show && ((_a = contextMenuMessage.value) === null || _a === void 0 ? void 0 : _a.id) === message.id) {
|
|
231
|
+
contextMenuShow.value = false;
|
|
232
|
+
}
|
|
233
|
+
}, onClickoutside: () => {
|
|
234
|
+
var _a;
|
|
235
|
+
if (((_a = contextMenuMessage.value) === null || _a === void 0 ? void 0 : _a.id) === message.id) {
|
|
236
|
+
contextMenuShow.value = false;
|
|
237
|
+
}
|
|
238
|
+
}, trigger: "manual", placement: "bottom-start", options: messageContextMenuOptions.value, onSelect: handleContextMenuSelect }, {
|
|
239
|
+
default: () => ((0, vue_1.h)("div", { onContextmenu: (event) => {
|
|
240
|
+
event.preventDefault();
|
|
241
|
+
contextMenuShow.value = false;
|
|
242
|
+
void (0, vue_1.nextTick)().then(() => {
|
|
243
|
+
contextMenuShow.value = true;
|
|
244
|
+
contextMenuMessage.value = message;
|
|
245
|
+
});
|
|
246
|
+
} }, messageBubbleContent))
|
|
247
|
+
})) : (messageBubbleContent),
|
|
167
248
|
(0, vue_1.h)("div", { class: [
|
|
168
249
|
`${mergedClsPrefixRef.value}-chat-main__message-meta`,
|
|
169
250
|
isOwn
|
|
@@ -174,7 +255,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
174
255
|
] }, message.status === interface_1.MessageStatus.RETRY ? ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-chat-main__message-retry`, onClick: () => {
|
|
175
256
|
handleMessageRetry(message);
|
|
176
257
|
}, style: { cursor: 'pointer' } },
|
|
177
|
-
(0, vue_1.h)(icon_1.UIcon, { size: 16, component: statusIconMapper[interface_1.MessageStatus.RETRY], class: `${mergedClsPrefixRef.value}-chat-main__message-retry-icon`, theme: themeRef.value.peers.
|
|
258
|
+
(0, vue_1.h)(icon_1.UIcon, { size: 16, component: statusIconMapper[interface_1.MessageStatus.RETRY], class: `${mergedClsPrefixRef.value}-chat-main__message-retry-icon`, theme: themeRef.value.peers.StatusIcon, themeOverrides: themeRef.value.peerOverrides.StatusIcon }),
|
|
178
259
|
(0, vue_1.h)("span", { class: `${mergedClsPrefixRef.value}-chat-main__message-retry-text` }, mergedRetryTextRef.value))) : ((0, vue_1.h)(vue_1.Fragment, null,
|
|
179
260
|
(0, vue_1.h)("span", { class: `${mergedClsPrefixRef.value}-chat-main__message-time` }, message.timestamp),
|
|
180
261
|
isOwn && message.status && ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-chat-main__message-status` }, slots.messageStatus
|
|
@@ -182,7 +263,8 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
182
263
|
: statusIconMapper[message.status] && ((0, vue_1.h)(icon_1.UIcon, { size: 16, component: statusIconMapper[message.status], class: [
|
|
183
264
|
`${mergedClsPrefixRef.value}-chat-main__message-status-icon`,
|
|
184
265
|
`${mergedClsPrefixRef.value}-chat-main__message-status-icon--${String(message.status)}`
|
|
185
|
-
], theme: themeRef.value.peers.
|
|
266
|
+
], theme: themeRef.value.peers.StatusIcon, themeOverrides: themeRef.value.peerOverrides.StatusIcon }))))))))));
|
|
267
|
+
return messageContent;
|
|
186
268
|
};
|
|
187
269
|
const renderTypingIndicator = () => {
|
|
188
270
|
return ((0, vue_1.h)("div", { class: [
|
|
@@ -234,6 +316,10 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
234
316
|
renderSkeletonMessage,
|
|
235
317
|
renderDateSeparator,
|
|
236
318
|
renderUnreadNotification,
|
|
319
|
+
contextMenuShow,
|
|
320
|
+
contextMenuMessage,
|
|
321
|
+
messageContextMenuOptions,
|
|
322
|
+
handleContextMenuSelect,
|
|
237
323
|
cssVars: cssVarsRef,
|
|
238
324
|
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
239
325
|
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
|
|
@@ -311,7 +397,14 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
311
397
|
padding: '0',
|
|
312
398
|
background: 'transparent'
|
|
313
399
|
} },
|
|
314
|
-
(0, vue_1.h)("div", { class: `${mergedClsPrefixRef}-chat-main__messages-container
|
|
400
|
+
(0, vue_1.h)("div", { class: `${mergedClsPrefixRef}-chat-main__messages-container`, onContextmenu: (event) => {
|
|
401
|
+
const target = event.target;
|
|
402
|
+
const messagesContainer = event.currentTarget;
|
|
403
|
+
if (target === messagesContainer) {
|
|
404
|
+
event.preventDefault();
|
|
405
|
+
this.contextMenuShow = false;
|
|
406
|
+
}
|
|
407
|
+
} },
|
|
315
408
|
messagesWithDates.map((item) => {
|
|
316
409
|
var _a;
|
|
317
410
|
if (item.type === 'date-separator') {
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { type ChatMessageData } from '../interface';
|
|
1
3
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
4
|
renderHeader: () => JSX.Element;
|
|
3
5
|
renderMessages: () => JSX.Element;
|
|
6
|
+
renderEditingBlock: () => JSX.Element | null;
|
|
4
7
|
renderFooter: () => JSX.Element;
|
|
5
|
-
messagesBodyRef:
|
|
8
|
+
messagesBodyRef: Ref<HTMLElement | {
|
|
6
9
|
$el: HTMLElement;
|
|
7
10
|
} | undefined>;
|
|
8
|
-
inputRef:
|
|
9
|
-
inputValue:
|
|
11
|
+
inputRef: Ref<HTMLInputElement | undefined>;
|
|
12
|
+
inputValue: Ref<string>;
|
|
10
13
|
handleSendMessage: () => Promise<void>;
|
|
11
14
|
handleMessagesScroll: (e: Event) => void;
|
|
12
15
|
scrollToBottom: () => void;
|
|
16
|
+
editingMessage: Ref<ChatMessageData | null>;
|
|
13
17
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
14
18
|
export default _default;
|
|
@@ -23,13 +23,16 @@ const upload_1 = require("../../../upload");
|
|
|
23
23
|
const flex_1 = require("../../../flex");
|
|
24
24
|
const _utils_1 = require("../../../_utils");
|
|
25
25
|
const typography_1 = require("../../../typography");
|
|
26
|
+
const list_1 = require("../../../list");
|
|
27
|
+
const _mixins_1 = require("../../../_mixins");
|
|
26
28
|
const ChatMessages_1 = __importDefault(require("../ChatMessages"));
|
|
27
29
|
const icons_1 = require("../../../_internal/icons");
|
|
28
30
|
const SENDING_DELAY = 100;
|
|
29
31
|
exports.default = (0, vue_1.defineComponent)({
|
|
30
32
|
name: 'ChatMainArea',
|
|
31
33
|
setup(_, { slots }) {
|
|
32
|
-
const {
|
|
34
|
+
const { localeRef } = (0, _mixins_1.useLocale)('Chat');
|
|
35
|
+
const { mergedClsPrefixRef, mergedThemeRef, selectedChatRef, messagesRef, typingChatIdsRef, messagesLoadingRef, messagesLoadingCountRef, headerButtonPropsRef, headerIconPropsRef, headerShareButtonPropsRef, headerProfileButtonPropsRef, headerCloseButtonPropsRef, headerShareIconPropsRef, headerProfileIconPropsRef, messageUploadPropsRef, footerInputPropsRef, footerButtonPropsRef, footerUploadPropsRef, footerIconPropsRef, footerSuffixIconPropsRef, inputPlaceholderRef, retryTextRef, typingTextRef, closeButtonTextRef, shareButtonTooltipRef, profileButtonTooltipRef, unreadNotificationTextRef, notificationsShownSetRef, unreadCountsBeforeReadRef, markNotificationShown, handleMessageSend, handleMessageRetry, handleFooterInputChange, startEditingMessage: startEditingMessageRef, editMessageIdRef, bubbleActionsRef, onAttachmentUpload, onChatClose, onChatShare, onUserProfile, onMessagesScrollToTop, onMessagesScrollToBottom
|
|
33
36
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
34
37
|
} = (0, vue_1.inject)(interface_1.chatInjectionKey);
|
|
35
38
|
const messagesBodyRef = (0, vue_1.ref)();
|
|
@@ -40,6 +43,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
40
43
|
const lastScrollTop = (0, vue_1.ref)(0);
|
|
41
44
|
const scrollTopFired = (0, vue_1.ref)(false);
|
|
42
45
|
const scrollBottomFired = (0, vue_1.ref)(false);
|
|
46
|
+
const editingMessage = (0, vue_1.ref)(null);
|
|
43
47
|
const unreadMessagesCount = (0, vue_1.computed)(() => {
|
|
44
48
|
if (!messagesRef.value)
|
|
45
49
|
return 0;
|
|
@@ -63,6 +67,10 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
63
67
|
shouldScrollOnLoad.value = true;
|
|
64
68
|
attachmentFileList.value = [];
|
|
65
69
|
uploadedAttachmentsMap.value.clear();
|
|
70
|
+
editingMessage.value = null;
|
|
71
|
+
if (editMessageIdRef) {
|
|
72
|
+
editMessageIdRef.value = null;
|
|
73
|
+
}
|
|
66
74
|
if (unreadBeforeRead > 0 &&
|
|
67
75
|
!notificationsShownSetRef.value.has(newChat.id)) {
|
|
68
76
|
hasUnreadMessages.value = true;
|
|
@@ -194,8 +202,9 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
194
202
|
buttons.push((0, vue_1.h)(tooltip_1.UTooltip, null, {
|
|
195
203
|
trigger: () => ((0, vue_1.h)(button_1.UButton, Object.assign({ secondary: true, circle: true, size: "large" }, shareButtonProps, { theme: mergedThemeRef.value.peers.Button, themeOverrides: mergedThemeRef.value.peerOverrides
|
|
196
204
|
.Button, onClick: () => { var _a; return (_a = onChatShare === null || onChatShare === void 0 ? void 0 : onChatShare.value) === null || _a === void 0 ? void 0 : _a.call(onChatShare); } }), {
|
|
197
|
-
default: () => ((0, vue_1.h)(icon_1.UIcon, Object.assign({ size: 20 }, shareIconProps, { theme: mergedThemeRef.value.peers
|
|
198
|
-
.
|
|
205
|
+
default: () => ((0, vue_1.h)(icon_1.UIcon, Object.assign({ size: 20 }, shareIconProps, { theme: mergedThemeRef.value.peers
|
|
206
|
+
.HeaderShareIcon, themeOverrides: mergedThemeRef.value.peerOverrides
|
|
207
|
+
.HeaderShareIcon }), {
|
|
199
208
|
default: () => ((0, vue_1.h)(icons_1.ArrowHookUpRight, null))
|
|
200
209
|
}))
|
|
201
210
|
})),
|
|
@@ -204,8 +213,9 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
204
213
|
buttons.push((0, vue_1.h)(tooltip_1.UTooltip, null, {
|
|
205
214
|
trigger: () => ((0, vue_1.h)(button_1.UButton, Object.assign({ secondary: true, circle: true, size: "large" }, profileButtonProps, { theme: mergedThemeRef.value.peers.Button, themeOverrides: mergedThemeRef.value.peerOverrides
|
|
206
215
|
.Button, onClick: () => { var _a; return (_a = onUserProfile === null || onUserProfile === void 0 ? void 0 : onUserProfile.value) === null || _a === void 0 ? void 0 : _a.call(onUserProfile); } }), {
|
|
207
|
-
default: () => ((0, vue_1.h)(icon_1.UIcon, Object.assign({ size: 20 }, profileIconProps, { theme: mergedThemeRef.value.peers
|
|
208
|
-
.
|
|
216
|
+
default: () => ((0, vue_1.h)(icon_1.UIcon, Object.assign({ size: 20 }, profileIconProps, { theme: mergedThemeRef.value.peers
|
|
217
|
+
.HeaderProfileIcon, themeOverrides: mergedThemeRef.value.peerOverrides
|
|
218
|
+
.HeaderProfileIcon }), {
|
|
209
219
|
default: () => (0, vue_1.h)(icons_1.PersonNote, null)
|
|
210
220
|
}))
|
|
211
221
|
})),
|
|
@@ -226,9 +236,33 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
226
236
|
messageAttachment: slots.messageAttachment,
|
|
227
237
|
messageAttachmentTitle: slots.messageAttachmentTitle,
|
|
228
238
|
messageAttachmentSubtitle: slots.messageAttachmentSubtitle,
|
|
229
|
-
messageStatus: slots.messageStatus
|
|
239
|
+
messageStatus: slots.messageStatus,
|
|
240
|
+
bubbleActions: slots.bubbleActions
|
|
230
241
|
}));
|
|
231
242
|
};
|
|
243
|
+
const startEditingMessage = (message) => {
|
|
244
|
+
editingMessage.value = message;
|
|
245
|
+
if (editMessageIdRef) {
|
|
246
|
+
editMessageIdRef.value = message.id;
|
|
247
|
+
}
|
|
248
|
+
inputValue.value =
|
|
249
|
+
typeof message.content === 'string' ? message.content : '';
|
|
250
|
+
attachmentFileList.value = [];
|
|
251
|
+
uploadedAttachmentsMap.value.clear();
|
|
252
|
+
};
|
|
253
|
+
const cancelEditingMessage = () => {
|
|
254
|
+
editingMessage.value = null;
|
|
255
|
+
if (editMessageIdRef) {
|
|
256
|
+
editMessageIdRef.value = null;
|
|
257
|
+
}
|
|
258
|
+
inputValue.value = '';
|
|
259
|
+
if (selectedChatRef.value) {
|
|
260
|
+
inputValue.value = chatInputs.value[selectedChatRef.value.id] || '';
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
if (startEditingMessageRef) {
|
|
264
|
+
startEditingMessageRef.value = startEditingMessage;
|
|
265
|
+
}
|
|
232
266
|
const isSending = (0, vue_1.ref)(false);
|
|
233
267
|
const handleSendMessage = () => __awaiter(this, void 0, void 0, function* () {
|
|
234
268
|
if (isSending.value) {
|
|
@@ -236,6 +270,36 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
236
270
|
}
|
|
237
271
|
const hasContent = inputValue.value.trim();
|
|
238
272
|
const hasAttachments = attachmentFileList.value.length > 0;
|
|
273
|
+
if ((editMessageIdRef === null || editMessageIdRef === void 0 ? void 0 : editMessageIdRef.value) && hasContent) {
|
|
274
|
+
isSending.value = true;
|
|
275
|
+
try {
|
|
276
|
+
const messageToEdit = editingMessage.value;
|
|
277
|
+
if (messageToEdit) {
|
|
278
|
+
const updatedMessage = Object.assign(Object.assign({}, messageToEdit), { content: inputValue.value.trim() });
|
|
279
|
+
const bubbleActions = bubbleActionsRef === null || bubbleActionsRef === void 0 ? void 0 : bubbleActionsRef.value;
|
|
280
|
+
if (bubbleActions) {
|
|
281
|
+
const editAction = bubbleActions.find((action) => action.key === interface_1.ChatBubbleActionKey.EDIT);
|
|
282
|
+
if (editAction) {
|
|
283
|
+
editAction.handler(updatedMessage);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
editingMessage.value = null;
|
|
288
|
+
if (editMessageIdRef) {
|
|
289
|
+
editMessageIdRef.value = null;
|
|
290
|
+
}
|
|
291
|
+
inputValue.value = '';
|
|
292
|
+
if (selectedChatRef.value) {
|
|
293
|
+
chatInputs.value[selectedChatRef.value.id] = '';
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
finally {
|
|
297
|
+
setTimeout(() => {
|
|
298
|
+
isSending.value = false;
|
|
299
|
+
}, SENDING_DELAY);
|
|
300
|
+
}
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
239
303
|
if ((hasContent || hasAttachments) &&
|
|
240
304
|
selectedChatRef.value &&
|
|
241
305
|
handleMessageSend) {
|
|
@@ -296,17 +360,37 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
296
360
|
}))();
|
|
297
361
|
}
|
|
298
362
|
};
|
|
363
|
+
const renderEditingBlock = () => {
|
|
364
|
+
if (!(editMessageIdRef === null || editMessageIdRef === void 0 ? void 0 : editMessageIdRef.value) || !editingMessage.value)
|
|
365
|
+
return null;
|
|
366
|
+
return ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-chat-main__editing-block` },
|
|
367
|
+
(0, vue_1.h)(list_1.UList, { bordered: true }, {
|
|
368
|
+
default: () => {
|
|
369
|
+
var _a;
|
|
370
|
+
return ((0, vue_1.h)(list_1.UListItem, { header: { text: localeRef.value.editingTitle }, description: { text: ((_a = editingMessage.value) === null || _a === void 0 ? void 0 : _a.content) || '' } }, {
|
|
371
|
+
suffix: () => ((0, vue_1.h)(button_1.UButton, { text: true, circle: true, size: "small", onClick: cancelEditingMessage, theme: mergedThemeRef.value.peers.Button, themeOverrides: mergedThemeRef.value.peerOverrides.Button }, {
|
|
372
|
+
icon: () => ((0, vue_1.h)(icon_1.UIcon, { size: 16 }, {
|
|
373
|
+
default: () => (0, vue_1.h)(icons_1.CloseIcon, null)
|
|
374
|
+
}))
|
|
375
|
+
}))
|
|
376
|
+
}));
|
|
377
|
+
}
|
|
378
|
+
})));
|
|
379
|
+
};
|
|
299
380
|
const renderFooter = () => {
|
|
300
381
|
return ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-chat-main__footer` },
|
|
301
382
|
(0, vue_1.h)(upload_1.UUpload, Object.assign({ abstract: true, multiple: true, defaultUpload: false, fileList: attachmentFileList.value, onUpdateFileList: handleFileListUpdate }, footerUploadPropsRef.value), {
|
|
302
|
-
default: () => ((0, vue_1.h)(flex_1.UFlex, { align: "
|
|
383
|
+
default: () => ((0, vue_1.h)(flex_1.UFlex, { align: "end", size: "small", wrap: false, class: `${mergedClsPrefixRef.value}-chat-main__input-container` }, {
|
|
303
384
|
default: () => ((0, vue_1.h)(vue_1.Fragment, null,
|
|
304
385
|
(0, vue_1.h)(upload_1.UUploadTrigger, { abstract: true }, {
|
|
305
386
|
default: ({ handleClick }) => {
|
|
306
387
|
var _a;
|
|
307
|
-
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
|
|
308
|
-
|
|
309
|
-
|
|
388
|
+
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) ||
|
|
389
|
+
!!(editMessageIdRef === null || editMessageIdRef === void 0 ? void 0 : editMessageIdRef.value), theme: mergedThemeRef.value.peers.Button, themeOverrides: mergedThemeRef.value.peerOverrides.Button, onClick: handleClick }), {
|
|
390
|
+
default: () => ((0, vue_1.h)(icon_1.UIcon, Object.assign({ size: 24 }, footerIconPropsRef.value, { theme: mergedThemeRef.value.peers
|
|
391
|
+
.FooterAttachIcon, themeOverrides: mergedThemeRef.value.peerOverrides
|
|
392
|
+
.FooterAttachIcon }), {
|
|
393
|
+
default: () => (0, _utils_1.resolveSlot)(slots.footerAttachIcon, () => [(0, vue_1.h)(icons_1.AttachIcon, null)])
|
|
310
394
|
}))
|
|
311
395
|
}));
|
|
312
396
|
}
|
|
@@ -322,20 +406,32 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
322
406
|
e.stopPropagation();
|
|
323
407
|
void handleSendMessage();
|
|
324
408
|
}
|
|
325
|
-
} })
|
|
409
|
+
} }), {
|
|
410
|
+
prefix: () => renderEditingBlock(),
|
|
411
|
+
suffix: () => ((0, vue_1.h)(icon_1.UIcon, Object.assign({ size: 24, class: `${mergedClsPrefixRef.value}-chat-main__input-suffix` }, footerSuffixIconPropsRef.value, { theme: mergedThemeRef.value.peers.FooterSuffixIcon, themeOverrides: mergedThemeRef.value.peerOverrides
|
|
412
|
+
.FooterSuffixIcon, onClick: () => {
|
|
413
|
+
void handleSendMessage();
|
|
414
|
+
} }), {
|
|
415
|
+
default: () => (0, _utils_1.resolveSlot)(slots.footerSuffixIcon, () => [
|
|
416
|
+
(0, vue_1.h)(icons_1.SendFilled, null)
|
|
417
|
+
])
|
|
418
|
+
}))
|
|
419
|
+
})))
|
|
326
420
|
}))
|
|
327
421
|
})));
|
|
328
422
|
};
|
|
329
423
|
return {
|
|
330
424
|
renderHeader,
|
|
331
425
|
renderMessages,
|
|
426
|
+
renderEditingBlock,
|
|
332
427
|
renderFooter,
|
|
333
428
|
messagesBodyRef,
|
|
334
429
|
inputRef,
|
|
335
430
|
inputValue,
|
|
336
431
|
handleSendMessage,
|
|
337
432
|
handleMessagesScroll,
|
|
338
|
-
scrollToBottom
|
|
433
|
+
scrollToBottom,
|
|
434
|
+
editingMessage
|
|
339
435
|
};
|
|
340
436
|
},
|
|
341
437
|
render() {
|
|
@@ -38,6 +38,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
38
38
|
footerBorderColor: string;
|
|
39
39
|
inputBackgroundColor: string;
|
|
40
40
|
inputBorderColor: string;
|
|
41
|
+
inputSuffixColor: string;
|
|
41
42
|
unreadNotificationBackgroundColor: string;
|
|
42
43
|
unreadNotificationTextColor: string;
|
|
43
44
|
typingIndicatorColor: string;
|
|
@@ -572,14 +573,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
572
573
|
iconSizeLarge: string;
|
|
573
574
|
rippleDuration: string;
|
|
574
575
|
}, any>;
|
|
575
|
-
Icon: import("../../../_mixins").Theme<"Icon", {
|
|
576
|
-
color: string;
|
|
577
|
-
opacity1Depth: string;
|
|
578
|
-
opacity2Depth: string;
|
|
579
|
-
opacity3Depth: string;
|
|
580
|
-
opacity4Depth: string;
|
|
581
|
-
opacity5Depth: string;
|
|
582
|
-
}, any>;
|
|
583
576
|
List: import("../../../_mixins").Theme<"List", {
|
|
584
577
|
iconSize: string;
|
|
585
578
|
iconSpace: string;
|
|
@@ -675,6 +668,46 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
675
668
|
codeColor: string;
|
|
676
669
|
codeBorder: string;
|
|
677
670
|
}, any>;
|
|
671
|
+
StatusIcon: import("../../../_mixins").Theme<"Icon", {
|
|
672
|
+
color: string;
|
|
673
|
+
opacity1Depth: string;
|
|
674
|
+
opacity2Depth: string;
|
|
675
|
+
opacity3Depth: string;
|
|
676
|
+
opacity4Depth: string;
|
|
677
|
+
opacity5Depth: string;
|
|
678
|
+
}, any>;
|
|
679
|
+
FooterAttachIcon: import("../../../_mixins").Theme<"Icon", {
|
|
680
|
+
color: string;
|
|
681
|
+
opacity1Depth: string;
|
|
682
|
+
opacity2Depth: string;
|
|
683
|
+
opacity3Depth: string;
|
|
684
|
+
opacity4Depth: string;
|
|
685
|
+
opacity5Depth: string;
|
|
686
|
+
}, any>;
|
|
687
|
+
FooterSuffixIcon: import("../../../_mixins").Theme<"Icon", {
|
|
688
|
+
color: string;
|
|
689
|
+
opacity1Depth: string;
|
|
690
|
+
opacity2Depth: string;
|
|
691
|
+
opacity3Depth: string;
|
|
692
|
+
opacity4Depth: string;
|
|
693
|
+
opacity5Depth: string;
|
|
694
|
+
}, any>;
|
|
695
|
+
HeaderShareIcon: import("../../../_mixins").Theme<"Icon", {
|
|
696
|
+
color: string;
|
|
697
|
+
opacity1Depth: string;
|
|
698
|
+
opacity2Depth: string;
|
|
699
|
+
opacity3Depth: string;
|
|
700
|
+
opacity4Depth: string;
|
|
701
|
+
opacity5Depth: string;
|
|
702
|
+
}, any>;
|
|
703
|
+
HeaderProfileIcon: import("../../../_mixins").Theme<"Icon", {
|
|
704
|
+
color: string;
|
|
705
|
+
opacity1Depth: string;
|
|
706
|
+
opacity2Depth: string;
|
|
707
|
+
opacity3Depth: string;
|
|
708
|
+
opacity4Depth: string;
|
|
709
|
+
opacity5Depth: string;
|
|
710
|
+
}, any>;
|
|
678
711
|
};
|
|
679
712
|
peerOverrides: {
|
|
680
713
|
Input?: {
|
|
@@ -894,17 +927,37 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
894
927
|
[x: string]: any;
|
|
895
928
|
} | undefined;
|
|
896
929
|
} | undefined;
|
|
897
|
-
|
|
930
|
+
List?: {
|
|
898
931
|
peers?: {
|
|
899
932
|
[x: string]: any;
|
|
900
933
|
} | undefined;
|
|
901
934
|
} | undefined;
|
|
902
|
-
|
|
935
|
+
Typography?: {
|
|
903
936
|
peers?: {
|
|
904
937
|
[x: string]: any;
|
|
905
938
|
} | undefined;
|
|
906
939
|
} | undefined;
|
|
907
|
-
|
|
940
|
+
StatusIcon?: {
|
|
941
|
+
peers?: {
|
|
942
|
+
[x: string]: any;
|
|
943
|
+
} | undefined;
|
|
944
|
+
} | undefined;
|
|
945
|
+
FooterAttachIcon?: {
|
|
946
|
+
peers?: {
|
|
947
|
+
[x: string]: any;
|
|
948
|
+
} | undefined;
|
|
949
|
+
} | undefined;
|
|
950
|
+
FooterSuffixIcon?: {
|
|
951
|
+
peers?: {
|
|
952
|
+
[x: string]: any;
|
|
953
|
+
} | undefined;
|
|
954
|
+
} | undefined;
|
|
955
|
+
HeaderShareIcon?: {
|
|
956
|
+
peers?: {
|
|
957
|
+
[x: string]: any;
|
|
958
|
+
} | undefined;
|
|
959
|
+
} | undefined;
|
|
960
|
+
HeaderProfileIcon?: {
|
|
908
961
|
peers?: {
|
|
909
962
|
[x: string]: any;
|
|
910
963
|
} | undefined;
|
|
@@ -25,6 +25,11 @@ export declare enum ChatMarkType {
|
|
|
25
25
|
EVENT = "event",
|
|
26
26
|
DIVIDER = "divider"
|
|
27
27
|
}
|
|
28
|
+
export declare enum ChatBubbleActionKey {
|
|
29
|
+
EDIT = "edit",
|
|
30
|
+
COPY = "copy",
|
|
31
|
+
DELETE = "delete"
|
|
32
|
+
}
|
|
28
33
|
export type ChatId = string | number | symbol;
|
|
29
34
|
export interface ChatListItemData {
|
|
30
35
|
id: ChatId;
|
|
@@ -150,6 +155,7 @@ export interface ChatProps {
|
|
|
150
155
|
footerUploadProps?: Partial<UploadProps>;
|
|
151
156
|
footerUploadTriggerProps?: any;
|
|
152
157
|
footerIconProps?: Partial<IconProps>;
|
|
158
|
+
footerSuffixIconProps?: Partial<IconProps>;
|
|
153
159
|
emptyProps?: Partial<EmptyProps>;
|
|
154
160
|
retryText?: string;
|
|
155
161
|
typingText?: string;
|
|
@@ -164,6 +170,7 @@ export interface ChatProps {
|
|
|
164
170
|
onChatSelect?: OnChatSelect;
|
|
165
171
|
onMessageSend?: OnMessageSend;
|
|
166
172
|
onMessageRetry?: (message: ChatMessageData) => void;
|
|
173
|
+
bubbleActions?: ChatBubbleAction[];
|
|
167
174
|
onAttachmentUpload?: OnAttachmentUpload;
|
|
168
175
|
onAttachmentDownload?: OnAttachmentDownload;
|
|
169
176
|
onFilterChange?: OnFilterChange;
|
|
@@ -190,6 +197,7 @@ export interface ChatSlots {
|
|
|
190
197
|
messageAttachment?: (message: ChatMessageData) => VNodeChild;
|
|
191
198
|
messageAttachmentTitle?: (file: any) => VNodeChild;
|
|
192
199
|
messageAttachmentSubtitle?: (file: any) => VNodeChild;
|
|
200
|
+
bubbleActions?: (message: ChatMessageData) => VNodeChild;
|
|
193
201
|
}
|
|
194
202
|
export interface ChatListItemSlots {
|
|
195
203
|
avatar?: () => VNodeChild;
|
|
@@ -203,6 +211,12 @@ export interface ChatMessageSlots {
|
|
|
203
211
|
timestamp?: () => VNodeChild;
|
|
204
212
|
status?: () => VNodeChild;
|
|
205
213
|
}
|
|
214
|
+
export interface ChatBubbleAction {
|
|
215
|
+
key: ChatBubbleActionKey | string;
|
|
216
|
+
label: string | (() => VNodeChild);
|
|
217
|
+
handler: (message: ChatMessageData) => void;
|
|
218
|
+
visible?: (message: ChatMessageData) => boolean;
|
|
219
|
+
}
|
|
206
220
|
export interface ChatListHeaderProps {
|
|
207
221
|
title?: string | (() => VNodeChild);
|
|
208
222
|
actions?: Array<() => VNodeChild>;
|
|
@@ -282,6 +296,7 @@ export declare const chatInjectionKey: InjectionKey<{
|
|
|
282
296
|
footerUploadPropsRef: Ref<Partial<UploadProps> | undefined>;
|
|
283
297
|
footerUploadTriggerPropsRef: Ref<Record<string, any> | undefined>;
|
|
284
298
|
footerIconPropsRef: Ref<Partial<IconProps> | undefined>;
|
|
299
|
+
footerSuffixIconPropsRef: Ref<Partial<IconProps> | undefined>;
|
|
285
300
|
inputPlaceholderRef: Ref<string>;
|
|
286
301
|
retryTextRef: Ref<string>;
|
|
287
302
|
typingTextRef: Ref<string>;
|
|
@@ -295,6 +310,9 @@ export declare const chatInjectionKey: InjectionKey<{
|
|
|
295
310
|
handleChatSelect: (chatId: ChatId) => void;
|
|
296
311
|
handleMessageSend: (content: string, attachments?: ChatAttachment[]) => void;
|
|
297
312
|
handleMessageRetry: (message: ChatMessageData) => void;
|
|
313
|
+
startEditingMessage?: Ref<((message: ChatMessageData) => void) | undefined>;
|
|
314
|
+
editMessageIdRef?: Ref<ChatId | null>;
|
|
315
|
+
bubbleActionsRef?: Ref<ChatBubbleAction[] | undefined>;
|
|
298
316
|
handleFooterInputChange: (value: string, chatId: ChatId) => void;
|
|
299
317
|
markMessagesAsRead?: (chatId: ChatId) => void;
|
|
300
318
|
handleFilterChange: (filter: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.chatInjectionKey = exports.ChatMarkType = exports.ChatMessageType = exports.MessageStatus = void 0;
|
|
3
|
+
exports.chatInjectionKey = exports.ChatBubbleActionKey = exports.ChatMarkType = exports.ChatMessageType = exports.MessageStatus = void 0;
|
|
4
4
|
const _utils_1 = require("../../_utils");
|
|
5
5
|
var MessageStatus;
|
|
6
6
|
(function (MessageStatus) {
|
|
@@ -22,4 +22,10 @@ var ChatMarkType;
|
|
|
22
22
|
ChatMarkType["EVENT"] = "event";
|
|
23
23
|
ChatMarkType["DIVIDER"] = "divider";
|
|
24
24
|
})(ChatMarkType || (exports.ChatMarkType = ChatMarkType = {}));
|
|
25
|
+
var ChatBubbleActionKey;
|
|
26
|
+
(function (ChatBubbleActionKey) {
|
|
27
|
+
ChatBubbleActionKey["EDIT"] = "edit";
|
|
28
|
+
ChatBubbleActionKey["COPY"] = "copy";
|
|
29
|
+
ChatBubbleActionKey["DELETE"] = "delete";
|
|
30
|
+
})(ChatBubbleActionKey || (exports.ChatBubbleActionKey = ChatBubbleActionKey = {}));
|
|
25
31
|
exports.chatInjectionKey = (0, _utils_1.createInjectionKey)('chat');
|