@uzum-tech/ui 1.7.2 → 1.8.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 +1548 -998
- package/dist/index.prod.js +3 -3
- package/es/chat/index.d.ts +4 -0
- package/es/chat/index.js +2 -0
- package/es/chat/src/Chat.d.ts +19 -6
- package/es/chat/src/Chat.js +53 -14
- package/es/chat/src/ChatListItems.d.ts +6027 -0
- package/es/chat/src/ChatListItems.js +187 -0
- package/es/chat/src/ChatMessages.d.ts +6049 -0
- package/es/chat/src/ChatMessages.js +308 -0
- package/es/chat/src/ChatParts/ChatAttachment.js +4 -3
- package/es/chat/src/ChatParts/MainArea.d.ts +0 -2
- package/es/chat/src/ChatParts/MainArea.js +108 -229
- package/es/chat/src/ChatParts/Sidebar.js +16 -80
- package/es/chat/src/interface.d.ts +6 -1
- package/es/chat/src/styles/index.cssr.js +3 -2
- package/es/locales/common/arDZ.js +2 -1
- package/es/locales/common/deDE.js +2 -1
- package/es/locales/common/enGB.js +2 -1
- package/es/locales/common/enUS.d.ts +1 -0
- package/es/locales/common/enUS.js +2 -1
- package/es/locales/common/eo.js +2 -1
- package/es/locales/common/esAR.js +2 -1
- package/es/locales/common/faIR.js +2 -1
- package/es/locales/common/frFR.js +2 -1
- package/es/locales/common/idID.js +2 -1
- package/es/locales/common/itIT.js +2 -1
- package/es/locales/common/jaJP.js +2 -1
- package/es/locales/common/koKR.js +2 -1
- package/es/locales/common/nbNO.js +2 -1
- package/es/locales/common/nlNL.js +2 -1
- package/es/locales/common/plPL.js +2 -1
- package/es/locales/common/ptBR.js +2 -1
- package/es/locales/common/ruRU.js +2 -1
- package/es/locales/common/skSK.js +2 -1
- package/es/locales/common/svSE.js +2 -1
- package/es/locales/common/thTH.js +2 -1
- package/es/locales/common/trTR.js +2 -1
- package/es/locales/common/ukUA.js +2 -1
- package/es/locales/common/viVN.js +2 -1
- package/es/locales/common/zhCN.js +2 -1
- package/es/locales/common/zhTW.js +2 -1
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/chat/index.d.ts +4 -0
- package/lib/chat/index.js +5 -1
- package/lib/chat/src/Chat.d.ts +19 -6
- package/lib/chat/src/Chat.js +52 -13
- package/lib/chat/src/ChatListItems.d.ts +6027 -0
- package/lib/chat/src/ChatListItems.js +193 -0
- package/lib/chat/src/ChatMessages.d.ts +6049 -0
- package/lib/chat/src/ChatMessages.js +314 -0
- package/lib/chat/src/ChatParts/ChatAttachment.js +4 -3
- package/lib/chat/src/ChatParts/MainArea.d.ts +0 -2
- package/lib/chat/src/ChatParts/MainArea.js +107 -228
- package/lib/chat/src/ChatParts/Sidebar.js +17 -78
- package/lib/chat/src/interface.d.ts +6 -1
- package/lib/chat/src/styles/index.cssr.js +3 -2
- package/lib/locales/common/arDZ.js +2 -1
- package/lib/locales/common/deDE.js +2 -1
- package/lib/locales/common/enGB.js +2 -1
- package/lib/locales/common/enUS.d.ts +1 -0
- package/lib/locales/common/enUS.js +2 -1
- package/lib/locales/common/eo.js +2 -1
- package/lib/locales/common/esAR.js +2 -1
- package/lib/locales/common/faIR.js +2 -1
- package/lib/locales/common/frFR.js +2 -1
- package/lib/locales/common/idID.js +2 -1
- package/lib/locales/common/itIT.js +2 -1
- package/lib/locales/common/jaJP.js +2 -1
- package/lib/locales/common/koKR.js +2 -1
- package/lib/locales/common/nbNO.js +2 -1
- package/lib/locales/common/nlNL.js +2 -1
- package/lib/locales/common/plPL.js +2 -1
- package/lib/locales/common/ptBR.js +2 -1
- package/lib/locales/common/ruRU.js +2 -1
- package/lib/locales/common/skSK.js +2 -1
- package/lib/locales/common/svSE.js +2 -1
- package/lib/locales/common/thTH.js +2 -1
- package/lib/locales/common/trTR.js +2 -1
- package/lib/locales/common/ukUA.js +2 -1
- package/lib/locales/common/viVN.js +2 -1
- package/lib/locales/common/zhCN.js +2 -1
- package/lib/locales/common/zhTW.js +2 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/volar.d.ts +2 -0
- package/web-types.json +149 -1
- package/es/chat/src/ChatGlobalState.d.ts +0 -13
- package/es/chat/src/ChatGlobalState.js +0 -32
- package/lib/chat/src/ChatGlobalState.d.ts +0 -13
- package/lib/chat/src/ChatGlobalState.js +0 -36
|
@@ -129,7 +129,8 @@ const enUS = {
|
|
|
129
129
|
inputPlaceholder: 'Type a message...',
|
|
130
130
|
typingText: 'Typing...',
|
|
131
131
|
retryText: 'Resend',
|
|
132
|
-
closeButtonText: 'Close chat'
|
|
132
|
+
closeButtonText: 'Close chat',
|
|
133
|
+
unreadNotificationText: 'new messages'
|
|
133
134
|
}
|
|
134
135
|
};
|
|
135
136
|
export default enUS;
|
package/es/locales/common/eo.js
CHANGED
|
@@ -130,7 +130,8 @@ const eo = {
|
|
|
130
130
|
inputPlaceholder: 'Type a message...',
|
|
131
131
|
typingText: 'Typing...',
|
|
132
132
|
retryText: 'Resend',
|
|
133
|
-
closeButtonText: 'Close chat'
|
|
133
|
+
closeButtonText: 'Close chat',
|
|
134
|
+
unreadNotificationText: 'new messages'
|
|
134
135
|
}
|
|
135
136
|
};
|
|
136
137
|
export default eo;
|
|
@@ -132,7 +132,8 @@ const esAR = {
|
|
|
132
132
|
inputPlaceholder: 'Type a message...',
|
|
133
133
|
typingText: 'Typing...',
|
|
134
134
|
retryText: 'Resend',
|
|
135
|
-
closeButtonText: 'Close chat'
|
|
135
|
+
closeButtonText: 'Close chat',
|
|
136
|
+
unreadNotificationText: 'new messages'
|
|
136
137
|
}
|
|
137
138
|
};
|
|
138
139
|
export default esAR;
|
|
@@ -128,7 +128,8 @@ const faIR = {
|
|
|
128
128
|
inputPlaceholder: 'Type a message...',
|
|
129
129
|
typingText: 'Typing...',
|
|
130
130
|
retryText: 'Resend',
|
|
131
|
-
closeButtonText: 'Close chat'
|
|
131
|
+
closeButtonText: 'Close chat',
|
|
132
|
+
unreadNotificationText: 'new messages'
|
|
132
133
|
}
|
|
133
134
|
};
|
|
134
135
|
export default faIR;
|
|
@@ -128,7 +128,8 @@ const frFR = {
|
|
|
128
128
|
inputPlaceholder: 'Type a message...',
|
|
129
129
|
typingText: 'Typing...',
|
|
130
130
|
retryText: 'Resend',
|
|
131
|
-
closeButtonText: 'Close chat'
|
|
131
|
+
closeButtonText: 'Close chat',
|
|
132
|
+
unreadNotificationText: 'new messages'
|
|
132
133
|
}
|
|
133
134
|
};
|
|
134
135
|
export default frFR;
|
|
@@ -132,7 +132,8 @@ const idID = {
|
|
|
132
132
|
inputPlaceholder: 'Type a message...',
|
|
133
133
|
typingText: 'Typing...',
|
|
134
134
|
retryText: 'Resend',
|
|
135
|
-
closeButtonText: 'Close chat'
|
|
135
|
+
closeButtonText: 'Close chat',
|
|
136
|
+
unreadNotificationText: 'new messages'
|
|
136
137
|
}
|
|
137
138
|
};
|
|
138
139
|
export default idID;
|
|
@@ -131,7 +131,8 @@ const itIT = {
|
|
|
131
131
|
inputPlaceholder: 'Type a message...',
|
|
132
132
|
typingText: 'Typing...',
|
|
133
133
|
retryText: 'Resend',
|
|
134
|
-
closeButtonText: 'Close chat'
|
|
134
|
+
closeButtonText: 'Close chat',
|
|
135
|
+
unreadNotificationText: 'new messages'
|
|
135
136
|
}
|
|
136
137
|
};
|
|
137
138
|
export default itIT;
|
|
@@ -131,7 +131,8 @@ const jaJP = {
|
|
|
131
131
|
inputPlaceholder: 'Type a message...',
|
|
132
132
|
typingText: 'Typing...',
|
|
133
133
|
retryText: 'Resend',
|
|
134
|
-
closeButtonText: 'Close chat'
|
|
134
|
+
closeButtonText: 'Close chat',
|
|
135
|
+
unreadNotificationText: 'new messages'
|
|
135
136
|
}
|
|
136
137
|
};
|
|
137
138
|
export default jaJP;
|
|
@@ -131,7 +131,8 @@ const koKR = {
|
|
|
131
131
|
inputPlaceholder: 'Type a message...',
|
|
132
132
|
typingText: 'Typing...',
|
|
133
133
|
retryText: 'Resend',
|
|
134
|
-
closeButtonText: 'Close chat'
|
|
134
|
+
closeButtonText: 'Close chat',
|
|
135
|
+
unreadNotificationText: 'new messages'
|
|
135
136
|
}
|
|
136
137
|
};
|
|
137
138
|
export default koKR;
|
|
@@ -132,7 +132,8 @@ const nbNO = {
|
|
|
132
132
|
inputPlaceholder: 'Type a message...',
|
|
133
133
|
typingText: 'Typing...',
|
|
134
134
|
retryText: 'Resend',
|
|
135
|
-
closeButtonText: 'Close chat'
|
|
135
|
+
closeButtonText: 'Close chat',
|
|
136
|
+
unreadNotificationText: 'new messages'
|
|
136
137
|
}
|
|
137
138
|
};
|
|
138
139
|
export default nbNO;
|
|
@@ -130,7 +130,8 @@ const nlNL = {
|
|
|
130
130
|
inputPlaceholder: 'Type a message...',
|
|
131
131
|
typingText: 'Typing...',
|
|
132
132
|
retryText: 'Resend',
|
|
133
|
-
closeButtonText: 'Close chat'
|
|
133
|
+
closeButtonText: 'Close chat',
|
|
134
|
+
unreadNotificationText: 'new messages'
|
|
134
135
|
}
|
|
135
136
|
};
|
|
136
137
|
export default nlNL;
|
|
@@ -131,7 +131,8 @@ const plPL = {
|
|
|
131
131
|
inputPlaceholder: 'Type a message...',
|
|
132
132
|
typingText: 'Typing...',
|
|
133
133
|
retryText: 'Resend',
|
|
134
|
-
closeButtonText: 'Close chat'
|
|
134
|
+
closeButtonText: 'Close chat',
|
|
135
|
+
unreadNotificationText: 'new messages'
|
|
135
136
|
}
|
|
136
137
|
};
|
|
137
138
|
export default plPL;
|
|
@@ -128,7 +128,8 @@ const ptBR = {
|
|
|
128
128
|
inputPlaceholder: 'Type a message...',
|
|
129
129
|
typingText: 'Typing...',
|
|
130
130
|
retryText: 'Resend',
|
|
131
|
-
closeButtonText: 'Close chat'
|
|
131
|
+
closeButtonText: 'Close chat',
|
|
132
|
+
unreadNotificationText: 'new messages'
|
|
132
133
|
}
|
|
133
134
|
};
|
|
134
135
|
export default ptBR;
|
|
@@ -133,7 +133,8 @@ const ruRu = {
|
|
|
133
133
|
inputPlaceholder: 'Написать сообщение...',
|
|
134
134
|
typingText: 'Печатает...',
|
|
135
135
|
retryText: 'Повторно отправить',
|
|
136
|
-
closeButtonText: 'Завершить чат'
|
|
136
|
+
closeButtonText: 'Завершить чат',
|
|
137
|
+
unreadNotificationText: 'новых сообщений'
|
|
137
138
|
}
|
|
138
139
|
};
|
|
139
140
|
export default ruRu;
|
|
@@ -132,7 +132,8 @@ const skSK = {
|
|
|
132
132
|
inputPlaceholder: 'Type a message...',
|
|
133
133
|
typingText: 'Typing...',
|
|
134
134
|
retryText: 'Resend',
|
|
135
|
-
closeButtonText: 'Close chat'
|
|
135
|
+
closeButtonText: 'Close chat',
|
|
136
|
+
unreadNotificationText: 'new messages'
|
|
136
137
|
}
|
|
137
138
|
};
|
|
138
139
|
export default skSK;
|
|
@@ -128,7 +128,8 @@ const svSE = {
|
|
|
128
128
|
inputPlaceholder: 'Type a message...',
|
|
129
129
|
typingText: 'Typing...',
|
|
130
130
|
retryText: 'Resend',
|
|
131
|
-
closeButtonText: 'Close chat'
|
|
131
|
+
closeButtonText: 'Close chat',
|
|
132
|
+
unreadNotificationText: 'new messages'
|
|
132
133
|
}
|
|
133
134
|
};
|
|
134
135
|
export default svSE;
|
|
@@ -132,7 +132,8 @@ const thTH = {
|
|
|
132
132
|
inputPlaceholder: 'Type a message...',
|
|
133
133
|
typingText: 'Typing...',
|
|
134
134
|
retryText: 'Resend',
|
|
135
|
-
closeButtonText: 'Close chat'
|
|
135
|
+
closeButtonText: 'Close chat',
|
|
136
|
+
unreadNotificationText: 'new messages'
|
|
136
137
|
}
|
|
137
138
|
};
|
|
138
139
|
export default thTH;
|
|
@@ -129,7 +129,8 @@ const trTR = {
|
|
|
129
129
|
inputPlaceholder: 'Type a message...',
|
|
130
130
|
typingText: 'Typing...',
|
|
131
131
|
retryText: 'Resend',
|
|
132
|
-
closeButtonText: 'Close chat'
|
|
132
|
+
closeButtonText: 'Close chat',
|
|
133
|
+
unreadNotificationText: 'new messages'
|
|
133
134
|
}
|
|
134
135
|
};
|
|
135
136
|
export default trTR;
|
|
@@ -129,7 +129,8 @@ const ukUA = {
|
|
|
129
129
|
inputPlaceholder: 'Type a message...',
|
|
130
130
|
typingText: 'Typing...',
|
|
131
131
|
retryText: 'Resend',
|
|
132
|
-
closeButtonText: 'Close chat'
|
|
132
|
+
closeButtonText: 'Close chat',
|
|
133
|
+
unreadNotificationText: 'new messages'
|
|
133
134
|
}
|
|
134
135
|
};
|
|
135
136
|
export default ukUA;
|
|
@@ -128,7 +128,8 @@ const viVN = {
|
|
|
128
128
|
inputPlaceholder: 'Type a message...',
|
|
129
129
|
typingText: 'Typing...',
|
|
130
130
|
retryText: 'Resend',
|
|
131
|
-
closeButtonText: 'Close chat'
|
|
131
|
+
closeButtonText: 'Close chat',
|
|
132
|
+
unreadNotificationText: 'new messages'
|
|
132
133
|
}
|
|
133
134
|
};
|
|
134
135
|
export default viVN;
|
|
@@ -128,7 +128,8 @@ const zhCN = {
|
|
|
128
128
|
inputPlaceholder: 'Type a message...',
|
|
129
129
|
typingText: 'Typing...',
|
|
130
130
|
retryText: 'Resend',
|
|
131
|
-
closeButtonText: 'Close chat'
|
|
131
|
+
closeButtonText: 'Close chat',
|
|
132
|
+
unreadNotificationText: 'new messages'
|
|
132
133
|
}
|
|
133
134
|
};
|
|
134
135
|
export default zhCN;
|
|
@@ -128,7 +128,8 @@ const zhTW = {
|
|
|
128
128
|
inputPlaceholder: 'Type a message...',
|
|
129
129
|
typingText: 'Typing...',
|
|
130
130
|
retryText: 'Resend',
|
|
131
|
-
closeButtonText: 'Close chat'
|
|
131
|
+
closeButtonText: 'Close chat',
|
|
132
|
+
unreadNotificationText: 'new messages'
|
|
132
133
|
}
|
|
133
134
|
};
|
|
134
135
|
export default zhTW;
|
package/es/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.
|
|
1
|
+
declare const _default: "1.8.0";
|
|
2
2
|
export default _default;
|
package/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.
|
|
1
|
+
export default '1.8.0';
|
package/lib/chat/index.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export { default as UChat } from './src/Chat';
|
|
2
|
+
export { default as UChatListItems } from './src/ChatListItems';
|
|
3
|
+
export { default as UChatMessages } from './src/ChatMessages';
|
|
2
4
|
export type { ChatId, MessageStatus, ChatMessageType, ChatMarkType, ChatProps, ChatListItemProps, ChatMessageProps, ChatMarkProps, ChatHeaderProps, ChatFooterProps, ChatListHeaderProps, ChatSlots, ChatListItemSlots, ChatMessageSlots, ChatMarkSlots, ChatHeaderSlots, ChatFooterSlots, ChatListItemData, ChatMessageData, ChatAttachment, OnChatSelect, OnMessageSend, OnAttachmentUpload, OnFilterChange, OnLoadMoreChats, OnNetworkError, OnUploadError, OnSendError, ChatInst, ChatListInst, chatInjectionKey } from './src/interface';
|
|
5
|
+
export type { ChatListItemsProps } from './src/ChatListItems';
|
|
6
|
+
export type { ChatMessagesProps } from './src/ChatMessages';
|
package/lib/chat/index.js
CHANGED
|
@@ -3,6 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.UChat = void 0;
|
|
6
|
+
exports.UChatMessages = exports.UChatListItems = exports.UChat = void 0;
|
|
7
7
|
var Chat_1 = require("./src/Chat");
|
|
8
8
|
Object.defineProperty(exports, "UChat", { enumerable: true, get: function () { return __importDefault(Chat_1).default; } });
|
|
9
|
+
var ChatListItems_1 = require("./src/ChatListItems");
|
|
10
|
+
Object.defineProperty(exports, "UChatListItems", { enumerable: true, get: function () { return __importDefault(ChatListItems_1).default; } });
|
|
11
|
+
var ChatMessages_1 = require("./src/ChatMessages");
|
|
12
|
+
Object.defineProperty(exports, "UChatMessages", { enumerable: true, get: function () { return __importDefault(ChatMessages_1).default; } });
|
package/lib/chat/src/Chat.d.ts
CHANGED
|
@@ -115,6 +115,10 @@ export declare const chatProps: {
|
|
|
115
115
|
type: PropType<ChatPropsType["closeButtonText"]>;
|
|
116
116
|
default: undefined;
|
|
117
117
|
};
|
|
118
|
+
unreadNotificationText: {
|
|
119
|
+
type: PropType<ChatPropsType["unreadNotificationText"]>;
|
|
120
|
+
default: undefined;
|
|
121
|
+
};
|
|
118
122
|
chatItemsLoading: {
|
|
119
123
|
type: PropType<ChatPropsType["chatItemsLoading"]>;
|
|
120
124
|
default: boolean;
|
|
@@ -2241,6 +2245,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2241
2245
|
type: PropType<ChatPropsType["closeButtonText"]>;
|
|
2242
2246
|
default: undefined;
|
|
2243
2247
|
};
|
|
2248
|
+
unreadNotificationText: {
|
|
2249
|
+
type: PropType<ChatPropsType["unreadNotificationText"]>;
|
|
2250
|
+
default: undefined;
|
|
2251
|
+
};
|
|
2244
2252
|
chatItemsLoading: {
|
|
2245
2253
|
type: PropType<ChatPropsType["chatItemsLoading"]>;
|
|
2246
2254
|
default: boolean;
|
|
@@ -5285,6 +5293,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5285
5293
|
type: PropType<ChatPropsType["closeButtonText"]>;
|
|
5286
5294
|
default: undefined;
|
|
5287
5295
|
};
|
|
5296
|
+
unreadNotificationText: {
|
|
5297
|
+
type: PropType<ChatPropsType["unreadNotificationText"]>;
|
|
5298
|
+
default: undefined;
|
|
5299
|
+
};
|
|
5288
5300
|
chatItemsLoading: {
|
|
5289
5301
|
type: PropType<ChatPropsType["chatItemsLoading"]>;
|
|
5290
5302
|
default: boolean;
|
|
@@ -7312,15 +7324,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
7312
7324
|
typingText: string | undefined;
|
|
7313
7325
|
retryText: string | undefined;
|
|
7314
7326
|
closeButtonText: string | undefined;
|
|
7327
|
+
unreadNotificationText: string | undefined;
|
|
7315
7328
|
maxHeight: string | number;
|
|
7316
7329
|
emptyProps: Partial<Partial<import("../..").EmptyProps> | undefined>;
|
|
7330
|
+
chatItems: ChatListItemData[] | undefined;
|
|
7331
|
+
selectedChatId: import("./interface").ChatId | undefined;
|
|
7332
|
+
typingChatIds: (string | number | symbol)[];
|
|
7333
|
+
onChatSelect: import("./interface").OnChatSelect | undefined;
|
|
7334
|
+
messages: ChatMessageData[] | undefined;
|
|
7335
|
+
onMessageRetry: ((message: ChatMessageData) => void) | undefined;
|
|
7317
7336
|
onChatClose: () => void;
|
|
7318
7337
|
onChatShare: () => void;
|
|
7319
7338
|
onUserProfile: () => void;
|
|
7320
7339
|
headerActions: (() => import("vue").VNodeChild)[] | undefined;
|
|
7321
|
-
chatItems: ChatListItemData[] | undefined;
|
|
7322
|
-
selectedChatId: import("./interface").ChatId | undefined;
|
|
7323
|
-
messages: ChatMessageData[] | undefined;
|
|
7324
7340
|
listEmptyProps: Partial<Partial<import("../..").EmptyProps> | undefined>;
|
|
7325
7341
|
listHeaderTitle: string | (() => import("vue").VNodeChild) | undefined;
|
|
7326
7342
|
listHeaderActions: (() => import("vue").VNodeChild)[] | undefined;
|
|
@@ -7343,14 +7359,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
7343
7359
|
chatItemsLoadingCount: number | undefined;
|
|
7344
7360
|
messagesLoading: boolean | undefined;
|
|
7345
7361
|
messagesLoadingCount: number | undefined;
|
|
7346
|
-
onChatSelect: import("./interface").OnChatSelect | undefined;
|
|
7347
|
-
onMessageRetry: ((message: ChatMessageData) => void) | undefined;
|
|
7348
7362
|
onAttachmentUpload: import("./interface").OnAttachmentUpload | undefined;
|
|
7349
7363
|
onFilterChange: import("./interface").OnFilterChange | undefined;
|
|
7350
7364
|
onLoadMoreChats: import("./interface").OnLoadMoreChats | undefined;
|
|
7351
7365
|
onNetworkError: import("./interface").OnNetworkError | undefined;
|
|
7352
7366
|
onUploadError: import("./interface").OnUploadError | undefined;
|
|
7353
7367
|
onSendError: import("./interface").OnSendError | undefined;
|
|
7354
|
-
typingChatIds: (string | number | symbol)[];
|
|
7355
7368
|
}, {}>;
|
|
7356
7369
|
export default _default;
|
package/lib/chat/src/Chat.js
CHANGED
|
@@ -97,6 +97,9 @@ exports.chatProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), {
|
|
|
97
97
|
}, closeButtonText: {
|
|
98
98
|
type: String,
|
|
99
99
|
default: undefined
|
|
100
|
+
}, unreadNotificationText: {
|
|
101
|
+
type: String,
|
|
102
|
+
default: undefined
|
|
100
103
|
}, chatItemsLoading: {
|
|
101
104
|
type: Boolean,
|
|
102
105
|
default: false
|
|
@@ -165,6 +168,11 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
165
168
|
const { mergedClsPrefixRef } = (0, _mixins_1.useConfig)(props);
|
|
166
169
|
const themeRef = (0, _mixins_1.useTheme)('Chat', '-chat', index_cssr_1.default, styles_1.chatLight, props, mergedClsPrefixRef);
|
|
167
170
|
const { localeRef } = (0, _mixins_1.useLocale)('Chat');
|
|
171
|
+
const notificationsShownSet = (0, vue_1.ref)(new Set());
|
|
172
|
+
const markNotificationShown = (chatId) => {
|
|
173
|
+
notificationsShownSet.value.add(chatId);
|
|
174
|
+
notificationsShownSet.value = new Set(notificationsShownSet.value);
|
|
175
|
+
};
|
|
168
176
|
const cssVarsRef = (0, vue_1.computed)(() => {
|
|
169
177
|
const { common: { cubicBezierEaseInOut }, self: { backgroundColor, borderColor, sidebarBackgroundColor, sidebarBorderColor, sidebarItemBackgroundColor, sidebarItemBackgroundColorHover, sidebarItemBackgroundColorSelected, sidebarItemTextColor, sidebarItemTextColorSelected, sidebarItemSubtitleColor, sidebarItemTimeColor, mainBackgroundColor, headerBackgroundColor, headerBorderColor, headerTitleColor, messageBubbleBackgroundColorOwn, messageBubbleBackgroundColorOther, messageBubbleTextColorOwn, messageBubbleTextColorOther, messageTimeColor, messageStatusColor, attachmentBackgroundColorOwn, attachmentBackgroundColorOther, footerBackgroundColor, footerBorderColor, inputBackgroundColor, inputBorderColor, unreadNotificationBackgroundColor, unreadNotificationTextColor, typingIndicatorColor, dateSeparatorColor, dateSeparatorBackgroundColor, borderRadius, errorColor } } = themeRef.value;
|
|
170
178
|
return {
|
|
@@ -232,11 +240,35 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
232
240
|
}
|
|
233
241
|
return [];
|
|
234
242
|
});
|
|
243
|
+
const lastUnreadCounts = (0, vue_1.ref)({});
|
|
244
|
+
(0, vue_1.watch)(() => props.chatItems, (chatItems) => {
|
|
245
|
+
if (!chatItems)
|
|
246
|
+
return;
|
|
247
|
+
chatItems.forEach((chatItem) => {
|
|
248
|
+
const chatId = chatItem.id;
|
|
249
|
+
const currentUnreadCount = chatItem.unreadCount || 0;
|
|
250
|
+
const lastUnreadCount = lastUnreadCounts.value[chatId] || 0;
|
|
251
|
+
if (currentUnreadCount > lastUnreadCount) {
|
|
252
|
+
const newSet = new Set(notificationsShownSet.value);
|
|
253
|
+
newSet.delete(chatId);
|
|
254
|
+
notificationsShownSet.value = newSet;
|
|
255
|
+
}
|
|
256
|
+
lastUnreadCounts.value[chatId] = currentUnreadCount;
|
|
257
|
+
});
|
|
258
|
+
}, { deep: true, immediate: true });
|
|
259
|
+
const unreadCountsBeforeRead = (0, vue_1.ref)({});
|
|
235
260
|
const handleChatSelect = (chatId) => {
|
|
236
261
|
var _a, _b;
|
|
262
|
+
const previousChatId = uncontrolledSelectedChatIdRef.value;
|
|
263
|
+
if (previousChatId !== undefined && previousChatId !== chatId) {
|
|
264
|
+
emit('mark-messages-read', previousChatId);
|
|
265
|
+
}
|
|
266
|
+
const selectedItem = (_a = props.chatItems) === null || _a === void 0 ? void 0 : _a.find((item) => item.id === chatId);
|
|
267
|
+
const unreadCountBeforeRead = (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.unreadCount) || 0;
|
|
268
|
+
unreadCountsBeforeRead.value[chatId] = unreadCountBeforeRead;
|
|
237
269
|
uncontrolledSelectedChatIdRef.value = chatId;
|
|
238
270
|
emit('update:selectedChatId', chatId);
|
|
239
|
-
|
|
271
|
+
emit('mark-messages-read', chatId);
|
|
240
272
|
if (selectedItem) {
|
|
241
273
|
(_b = props.onChatSelect) === null || _b === void 0 ? void 0 : _b.call(props, chatId, selectedItem);
|
|
242
274
|
}
|
|
@@ -288,6 +320,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
288
320
|
const mergedRetryTextRef = (0, vue_1.computed)(() => { var _a; return (_a = props.retryText) !== null && _a !== void 0 ? _a : localeRef.value.retryText; });
|
|
289
321
|
const mergedTypingTextRef = (0, vue_1.computed)(() => { var _a; return (_a = props.typingText) !== null && _a !== void 0 ? _a : localeRef.value.typingText; });
|
|
290
322
|
const mergedCloseButtonTextRef = (0, vue_1.computed)(() => { var _a; return (_a = props.closeButtonText) !== null && _a !== void 0 ? _a : localeRef.value.closeButtonText; });
|
|
323
|
+
const mergedUnreadNotificationTextRef = (0, vue_1.computed)(() => { var _a; return (_a = props.unreadNotificationText) !== null && _a !== void 0 ? _a : localeRef.value.unreadNotificationText; });
|
|
291
324
|
(0, vue_1.provide)(interface_1.chatInjectionKey, {
|
|
292
325
|
mergedClsPrefixRef,
|
|
293
326
|
chatItemsRef: (0, vue_1.toRef)(props, 'chatItems'),
|
|
@@ -319,6 +352,10 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
319
352
|
retryTextRef: mergedRetryTextRef,
|
|
320
353
|
typingTextRef: mergedTypingTextRef,
|
|
321
354
|
closeButtonTextRef: mergedCloseButtonTextRef,
|
|
355
|
+
unreadNotificationTextRef: mergedUnreadNotificationTextRef,
|
|
356
|
+
notificationsShownSetRef: notificationsShownSet,
|
|
357
|
+
unreadCountsBeforeReadRef: unreadCountsBeforeRead,
|
|
358
|
+
markNotificationShown,
|
|
322
359
|
handleChatSelect,
|
|
323
360
|
handleMessageSend,
|
|
324
361
|
handleMessageRetry,
|
|
@@ -352,17 +389,19 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
352
389
|
}
|
|
353
390
|
: {};
|
|
354
391
|
return ((0, vue_1.h)("div", { class: [`${this.mergedClsPrefix}-chat`, this.themeClass], style: Object.assign(Object.assign({}, maxHeightStyle), this.cssVars) },
|
|
355
|
-
(0, vue_1.h)(flex_1.UFlex, { wrap: false, size: [20, 20], style: { width: '100%' } },
|
|
356
|
-
(0,
|
|
357
|
-
(0,
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
(0,
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
392
|
+
(0, vue_1.h)(flex_1.UFlex, { wrap: false, size: [20, 20], style: { width: '100%' } }, {
|
|
393
|
+
default: () => ((0, vue_1.h)(vue_1.Fragment, null,
|
|
394
|
+
(0, _utils_1.resolveSlot)($slots.sidebar, () => [
|
|
395
|
+
(0, vue_1.h)(Sidebar_1.default, null, {
|
|
396
|
+
sidebarHeaderMain: $slots.sidebarHeaderMain,
|
|
397
|
+
sidebarHeaderActions: $slots.sidebarHeaderActions
|
|
398
|
+
})
|
|
399
|
+
]),
|
|
400
|
+
(0, _utils_1.resolveSlot)($slots.default, () => [
|
|
401
|
+
(0, vue_1.h)(MainArea_1.default, null, {
|
|
402
|
+
headerActions: $slots.headerActions
|
|
403
|
+
})
|
|
404
|
+
])))
|
|
405
|
+
})));
|
|
367
406
|
}
|
|
368
407
|
});
|