quickblox-react-ui-kit 0.2.3 → 0.2.5
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/README.md +3 -2
- package/dist/CommonTypes/FunctionResult.d.ts +5 -1
- package/dist/Data/DefaultConfigurations.d.ts +2 -2
- package/dist/Data/repository/DialogsRepository.d.ts +1 -0
- package/dist/Data/repository/EventMessagesRepository.d.ts +1 -0
- package/dist/Data/repository/MessagesRepository.d.ts +2 -2
- package/dist/Domain/entity/NotificationTypes.d.ts +1 -0
- package/dist/Domain/repository/IDialogsRepository.d.ts +1 -0
- package/dist/Domain/repository/IMessagesRepository.d.ts +2 -2
- package/dist/Domain/use_cases/CreateDialogUseCase.d.ts +2 -1
- package/dist/Domain/use_cases/LeaveDialogUseCase.d.ts +2 -1
- package/dist/Domain/use_cases/RemoveUsersFromTheDialogUseCase.d.ts +2 -1
- package/dist/Domain/use_cases/SubscribeToDialogEventsUseCase.d.ts +1 -0
- package/dist/Domain/use_cases/UpdateDialogUseCase.d.ts +2 -1
- package/dist/Domain/use_cases/ai/AIAnswerAssistUseCase.d.ts +13 -0
- package/dist/Domain/use_cases/ai/AIAnswerAssistWithProxyUseCase.d.ts +13 -0
- package/dist/Domain/use_cases/ai/AITranslateUseCase.d.ts +14 -0
- package/dist/Domain/use_cases/ai/AITranslateWithProxyUseCase.d.ts +14 -0
- package/dist/Presentation/Views/Base/BaseViewModel.d.ts +3 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/AIMessageWidget.d.ts +4 -1
- package/dist/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/AIWidgetActions/AIWidgetActions.d.ts +3 -2
- package/dist/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/Tone.d.ts +5 -13
- package/dist/Presentation/components/UI/Dialogs/MessagesView/DefaultAttachmentComponent/DefaultAttachmentComponent.d.ts +8 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/ErrorToast/ErrorToast.d.ts +7 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/InComingMessage/AvatarContentIncomingUser/AvatarContentIncomingUser.d.ts +3 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/InComingMessage/InComingMessage.d.ts +12 -3
- package/dist/Presentation/components/UI/Dialogs/MessagesView/MessagesView.d.ts +10 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/MessagesViewModel.d.ts +2 -2
- package/dist/Presentation/components/UI/Dialogs/MessagesView/SystemDateBanner/SystemDateBanner.d.ts +7 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/SystemMessageBanner/SystemMessageBanner.d.ts +7 -0
- package/dist/Presentation/components/UI/Dialogs/PreviewDialog/PreviewAudioFile/PreviewAudioFile.d.ts +7 -0
- package/dist/Presentation/components/UI/Dialogs/PreviewDialog/PreviewDefaultFile/PreviewDefaultFile.d.ts +7 -0
- package/dist/Presentation/components/UI/Dialogs/PreviewDialog/PreviewImageFile/PreviewImageFile.d.ts +8 -0
- package/dist/Presentation/components/UI/Dialogs/PreviewDialog/PreviewVideoFile/PreviewVideoFile.d.ts +7 -0
- package/dist/Presentation/components/UI/svgs/Icons/AIWidgets/BotIcon/BotIcon.d.ts +4 -0
- package/dist/QBconfig.d.ts +14 -3
- package/dist/index-ui.d.ts +5 -1
- package/dist/index-ui.js +410 -61
- package/dist/utils/utils.d.ts +9 -0
- package/global.d.ts +12 -4
- package/package.json +5 -1
- package/src/App.tsx +1 -1
- package/src/CommonTypes/FunctionResult.ts +6 -1
- package/src/Data/DefaultConfigurations.ts +155 -19
- package/src/Data/repository/DialogsRepository.ts +4 -0
- package/src/Data/repository/EventMessagesRepository.ts +34 -0
- package/src/Data/repository/MessagesRepository.ts +16 -10
- package/src/Data/source/exception/MapperDTOException.ts +3 -0
- package/src/Data/source/remote/RemoteDataSource.ts +134 -112
- package/src/Domain/entity/NotificationTypes.ts +2 -0
- package/src/Domain/repository/IDialogsRepository.ts +2 -0
- package/src/Domain/repository/IMessagesRepository.ts +2 -2
- package/src/Domain/use_cases/CreateDialogUseCase.ts +8 -1
- package/src/Domain/use_cases/GetAllDialogsUseCaseWithMock.ts +1 -0
- package/src/Domain/use_cases/LeaveDialogUseCase.ts +8 -1
- package/src/Domain/use_cases/RemoveUsersFromTheDialogUseCase.ts +40 -17
- package/src/Domain/use_cases/SendTextMessageUseCase.ts +3 -2
- package/src/Domain/use_cases/SubscribeToDialogEventsUseCase.ts +21 -0
- package/src/Domain/use_cases/UpdateDialogUseCase.ts +8 -1
- package/src/Domain/use_cases/ai/AIAnswerAssistUseCase.ts +69 -0
- package/src/Domain/use_cases/ai/AIAnswerAssistWithProxyUseCase.ts +71 -0
- package/src/Domain/use_cases/ai/AIRephraseUseCase.ts +38 -36
- package/src/Domain/use_cases/ai/AIRephraseWithProxyUseCase.ts +25 -21
- package/src/Domain/use_cases/ai/AITranslateUseCase.ts +76 -0
- package/src/Domain/use_cases/ai/AITranslateWithProxyUseCase.ts +79 -0
- package/src/Domain/use_cases/base/Subscribable/SubscriptionPerformer.ts +7 -10
- package/src/Presentation/Views/Base/BaseViewModel.ts +3 -0
- package/src/Presentation/Views/Dialogs/Dialogs.scss +3 -0
- package/src/Presentation/Views/Dialogs/Dialogs.tsx +1 -1
- package/src/Presentation/Views/Dialogs/useDialogsViewModel.ts +109 -48
- package/src/Presentation/assets/styles/_variables.scss +19 -0
- package/src/Presentation/components/UI/Buttons/MainButton/MainButton.scss +9 -0
- package/src/Presentation/components/UI/Dialogs/EditDialog/EditDialog.scss +3 -0
- package/src/Presentation/components/UI/Dialogs/InviteMembers/InviteMembers.scss +3 -0
- package/src/Presentation/components/UI/Dialogs/MembersList/MembersList.scss +3 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/AIMessageWidget.ts +7 -2
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/AIWidgetActions/AIWidgetActions.tsx +10 -4
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/Tone.ts +29 -15
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/UseDefaultAIAssistAnswerWidget.tsx +10 -6
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/UseDefaultAIAssistAnswerWidgetWithProxy.tsx +10 -6
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/UseDefaultAIRephraseMessageWidget.tsx +17 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/UseDefaultAIRephraseMessageWidgetWithProxy.tsx +16 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/UseDefaultAITranslateWidget.tsx +13 -12
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/UseDefaultAITranslateWidgetWithProxy.tsx +13 -12
- package/src/Presentation/components/UI/Dialogs/MessagesView/AudioAttachmentComponent/AudioAttachmentComponent.tsx +1 -1
- package/src/Presentation/components/UI/Dialogs/MessagesView/DefaultAttachmentComponent/DefaultAttachmentComponent.scss +76 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/DefaultAttachmentComponent/DefaultAttachmentComponent.tsx +40 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/ErrorToast/ErrorToast.scss +26 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/ErrorToast/ErrorToast.tsx +25 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/ImageAttachmentComponent/ImageAttachmentComponent.tsx +8 -6
- package/src/Presentation/components/UI/Dialogs/MessagesView/InComingMessage/AvatarContentIncomingUser/AvatarContentIncomingUser.tsx +6 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/InComingMessage/InComingMessage.scss +5 -7
- package/src/Presentation/components/UI/Dialogs/MessagesView/InComingMessage/InComingMessage.tsx +138 -405
- package/src/Presentation/components/UI/Dialogs/MessagesView/MessagesView.scss +14 -26
- package/src/Presentation/components/UI/Dialogs/MessagesView/MessagesView.tsx +658 -429
- package/src/Presentation/components/UI/Dialogs/MessagesView/MessagesViewModel.ts +2 -2
- package/src/Presentation/components/UI/Dialogs/MessagesView/OutGoingMessage/OutGoingMessage.tsx +1 -1
- package/src/Presentation/components/UI/Dialogs/MessagesView/SystemDateBanner/SystemDateBanner.scss +23 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/SystemDateBanner/SystemDateBanner.tsx +17 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/SystemMessageBanner/SystemMessageBanner.scss +21 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/SystemMessageBanner/SystemMessageBanner.tsx +17 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/useMessagesViewModel.ts +124 -83
- package/src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewAudioFile/PreviewAudioFile.scss +62 -0
- package/src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewAudioFile/PreviewAudioFile.tsx +25 -0
- package/src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewDefaultFile/PreviewDefaultFile.scss +61 -0
- package/src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewDefaultFile/PreviewDefaultFile.tsx +32 -0
- package/src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewDialog.scss +29 -3
- package/src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewDialog.tsx +55 -4
- package/src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewImageFile/PreviewImageFile.scss +40 -0
- package/src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewImageFile/PreviewImageFile.tsx +26 -0
- package/src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewVideoFile/PreviewVideoFile.scss +62 -0
- package/src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewVideoFile/PreviewVideoFile.tsx +25 -0
- package/src/Presentation/components/UI/svgs/Icons/AIWidgets/BotIcon/BotIcon.svg +5 -0
- package/src/Presentation/components/UI/svgs/Icons/AIWidgets/BotIcon/BotIcon.tsx +50 -0
- package/src/Presentation/components/layouts/Desktop/QuickBloxUIKitDesktopLayout.tsx +3 -15
- package/src/Presentation/components/providers/QuickBloxUIKitProvider/useQbInitializedDataContext.ts +15 -14
- package/src/QBconfig.ts +156 -10
- package/src/index-ui.ts +8 -1
- package/src/index.scss +0 -1
- package/src/package_artan_react_ui.json +13 -9
- package/src/package_original.json +5 -1
- package/src/utils/utils.ts +63 -0
- package/src/Presentation/assets/styles/_reset-styles.scss +0 -435
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ QuickBlox UIKit for React provides next functionality:
|
|
|
35
35
|
The QuickBlox UIKit for React comprises a collection of pre-assembled UI components that enable effortless creation of an in-app chat equipped with all the necessary messaging functionalities. Our development kit encompasses light and dark themes, colors, and various other features. These components can be personalized to fashion an engaging messaging interface that reflects your brand's distinct identity.
|
|
36
36
|
|
|
37
37
|
The QuickBlox UIKit fully supports both private and group dialogs. To initiate the process of sending a message from the ground up using Java or Kotlin, please refer to the instructions provided in the guide below.
|
|
38
|
-
|
|
38
|
+
[Additional information with sample](https://docs.quickblox.com/docs/react-uikit-send-your-first-message)
|
|
39
39
|
## Requirements
|
|
40
40
|
|
|
41
41
|
The minimum requirements for QuickBlox UIKit for React are:
|
|
@@ -293,7 +293,8 @@ and specify selected components:
|
|
|
293
293
|
# Sample
|
|
294
294
|
|
|
295
295
|
https://github.com/QuickBlox/quickblox-javascript-sdk/tree/gh-pages/samples/react-chat-ui-kit-init-sample
|
|
296
|
-
|
|
296
|
+
## Video guide "How to use AI Feature"
|
|
297
|
+
[Youtube video about AI Assistant](https://youtu.be/BneMtDagOy4)
|
|
297
298
|
# License
|
|
298
299
|
[](#license)
|
|
299
300
|
MIT License [here](https://github.com/QuickBlox/react-ui-kit/blob/main/LICENSE.md).
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Tone } from "../Presentation/components/UI/Dialogs/MessagesView/AIWidgets/Tone";
|
|
1
2
|
export type FunctionResult<T> = {
|
|
2
3
|
result: T | T[] | boolean;
|
|
3
4
|
error: any;
|
|
@@ -6,10 +7,12 @@ export type ProxyConfig = {
|
|
|
6
7
|
api: string;
|
|
7
8
|
servername: string;
|
|
8
9
|
port: string;
|
|
9
|
-
sessionToken: string;
|
|
10
10
|
};
|
|
11
11
|
export interface WidgetConfig {
|
|
12
|
+
organizationName: string;
|
|
13
|
+
openAIModel: string;
|
|
12
14
|
apiKey: string;
|
|
15
|
+
maxTokens: number;
|
|
13
16
|
useDefault: boolean;
|
|
14
17
|
proxyConfig: ProxyConfig;
|
|
15
18
|
}
|
|
@@ -19,6 +22,7 @@ export interface AITranslateWidgetConfig extends WidgetConfig {
|
|
|
19
22
|
}
|
|
20
23
|
export interface AIRephraseWidgetConfig extends WidgetConfig {
|
|
21
24
|
defaultTone: string;
|
|
25
|
+
Tones: Tone[];
|
|
22
26
|
}
|
|
23
27
|
export interface QBConfig {
|
|
24
28
|
credentials: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ProxyConfig, QBConfig } from '../CommonTypes/FunctionResult';
|
|
2
2
|
export declare class DefaultConfigurations {
|
|
3
3
|
static getDefaultProxyConfig(): ProxyConfig;
|
|
4
|
-
static getDefaultLanguageForAITranslate(): string;
|
|
5
|
-
static getAdditionalLanguagesForAITranslate(): string[];
|
|
4
|
+
static getDefaultLanguageForAITranslate(configAITranslate: AITranslateWidgetConfig): string;
|
|
5
|
+
static getAdditionalLanguagesForAITranslate(configAITranslate: AITranslateWidgetConfig): string[];
|
|
6
6
|
static getDefaultQBConfig(): QBConfig;
|
|
7
7
|
}
|
|
@@ -10,6 +10,7 @@ export default class DialogsRepository implements IDialogsRepository {
|
|
|
10
10
|
private dialogRemoteDTOMapper;
|
|
11
11
|
private dialogLocalDTOMapper;
|
|
12
12
|
constructor(localDataStorage: ILocalDataSource, remoteDataSource: IRemoteDataSource);
|
|
13
|
+
release(): void;
|
|
13
14
|
subscribeLocalSync(subscriber: FunctionTypeVoidToVoid): void;
|
|
14
15
|
unsubscribeLocalSync(): void;
|
|
15
16
|
isLocalSynced(): Promise<boolean>;
|
|
@@ -26,6 +26,7 @@ export default class EventMessagesRepository implements IRemoteMessaging<Message
|
|
|
26
26
|
protected NewMessageEventHandler(messageInfo: RemoteMessageDTO): void;
|
|
27
27
|
protected NewDialogEventHandler(messageInfo: RemoteMessageDTO): void;
|
|
28
28
|
protected DeleteLeaveDialogEventHandler(messageInfo: RemoteMessageDTO): void;
|
|
29
|
+
protected RemoteUserDialogEventHandler(messageInfo: RemoteMessageDTO): void;
|
|
29
30
|
protected UpdateDialogEventHandler(messageInfo: RemoteMessageDTO): void;
|
|
30
31
|
dispatchEvent<TEventInfo>(even: EventMessageType, eventBody: TEventInfo, receivers: number[]): void;
|
|
31
32
|
subscribeOnMessaging(callback: CallBackFunction<MessageEntity>, nameSubscription?: string): void;
|
|
@@ -17,8 +17,8 @@ export default class MessagesRepository implements IMessagesRepository {
|
|
|
17
17
|
getMessagesFromRemote(dialogId: string, pagination: Pagination): Promise<PaginatedResult<MessageEntity>>;
|
|
18
18
|
typingMessageStart(dialog: DialogEntity, senderId: number): Promise<void>;
|
|
19
19
|
typingMessageStop(dialog: DialogEntity, senderId: number): Promise<void>;
|
|
20
|
-
saveMessageToLocal(entity: MessageEntity): Promise<
|
|
21
|
-
sendMessageToRemote(entity: MessageEntity): Promise<
|
|
20
|
+
saveMessageToLocal(entity: MessageEntity): Promise<MessageEntity>;
|
|
21
|
+
sendMessageToRemote(entity: MessageEntity): Promise<MessageEntity>;
|
|
22
22
|
updateMessageInLocal(entity: MessageEntity): Promise<boolean>;
|
|
23
23
|
updateMessageInRemote(entity: MessageEntity): Promise<boolean>;
|
|
24
24
|
}
|
|
@@ -2,8 +2,8 @@ import { MessageEntity } from '../entity/MessageEntity';
|
|
|
2
2
|
import { PaginatedResult, Pagination } from './Pagination';
|
|
3
3
|
import { DialogEntity } from '../entity/DialogEntity';
|
|
4
4
|
export interface IMessagesRepository {
|
|
5
|
-
saveMessageToLocal(message: MessageEntity): Promise<
|
|
6
|
-
sendMessageToRemote(message: MessageEntity): Promise<
|
|
5
|
+
saveMessageToLocal(message: MessageEntity): Promise<MessageEntity>;
|
|
6
|
+
sendMessageToRemote(message: MessageEntity): Promise<MessageEntity>;
|
|
7
7
|
getMessagesFromLocal(dialogId: string): Promise<Array<MessageEntity>>;
|
|
8
8
|
getMessagesFromRemote(dialogId: string, pagination: Pagination): Promise<PaginatedResult<MessageEntity>>;
|
|
9
9
|
updateMessageInLocal(message: MessageEntity): Promise<boolean>;
|
|
@@ -7,6 +7,7 @@ export declare class CreateDialogUseCase implements IUseCase<void, DialogEntity>
|
|
|
7
7
|
private dialogRepository;
|
|
8
8
|
private eventMessagesRepository;
|
|
9
9
|
private newDialog;
|
|
10
|
-
|
|
10
|
+
private textInformationMessage;
|
|
11
|
+
constructor(eventMessagesRepository: EventMessagesRepository, dialogRepository: DialogsRepository, newDialog: GroupDialogEntity, textInformationMessage: string);
|
|
11
12
|
execute(): Promise<DialogEntity>;
|
|
12
13
|
}
|
|
@@ -13,6 +13,7 @@ export declare class LeaveDialogUseCase implements IUseCase<void, boolean> {
|
|
|
13
13
|
private eventMessagesRepository;
|
|
14
14
|
private dialogToLeave;
|
|
15
15
|
private leaveType;
|
|
16
|
-
|
|
16
|
+
private textInformationMessage;
|
|
17
|
+
constructor(eventMessagesRepository: EventMessagesRepository, dialogRepository: DialogsRepository, dialog: DialogEntity, leaveType: DialogLeaveTypeArcheType, textInformationMessage: string);
|
|
17
18
|
execute(): Promise<boolean>;
|
|
18
19
|
}
|
|
@@ -7,6 +7,7 @@ export declare class RemoveUsersFromTheDialogUseCase implements IUseCase<void, b
|
|
|
7
7
|
private eventMessagesRepository;
|
|
8
8
|
private dialogToLeave;
|
|
9
9
|
private usersIds;
|
|
10
|
-
|
|
10
|
+
private textInformationMessage;
|
|
11
|
+
constructor(eventMessagesRepository: EventMessagesRepository, dialogRepository: DialogsRepository, dialog: DialogEntity, usersIds: Array<number>, textInformationMessage: string);
|
|
11
12
|
execute(): Promise<boolean>;
|
|
12
13
|
}
|
|
@@ -12,5 +12,6 @@ export declare class SubscribeToDialogEventsUseCase extends BaseUseCase<DialogEv
|
|
|
12
12
|
newMessageEventHandler(messageEntity: MessageEntity): void;
|
|
13
13
|
updateDialogEventHandler(messageEntity: MessageEntity): void;
|
|
14
14
|
leaveDialogEventHandler(messageEntity: MessageEntity): void;
|
|
15
|
+
removeUserDialogEventHandler(messageEntity: MessageEntity): void;
|
|
15
16
|
newDialogEventHandler(messageEntity: MessageEntity): void;
|
|
16
17
|
}
|
|
@@ -7,6 +7,7 @@ export declare class UpdateDialogUseCase implements IUseCase<void, DialogEntity>
|
|
|
7
7
|
private dialogRepository;
|
|
8
8
|
private eventMessagesRepository;
|
|
9
9
|
private updateDialog;
|
|
10
|
-
|
|
10
|
+
private textInformationMessage;
|
|
11
|
+
constructor(eventMessagesRepository: EventMessagesRepository, dialogRepository: DialogsRepository, updateDialog: GroupDialogEntity, textInformationMessage: string);
|
|
11
12
|
execute(): Promise<DialogEntity>;
|
|
12
13
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IChatMessage } from '../../../Data/source/AISource';
|
|
2
|
+
import { IUseCase } from '../base/IUseCase';
|
|
3
|
+
export declare class AIAnswerAssistUseCase implements IUseCase<void, string> {
|
|
4
|
+
private textToSend;
|
|
5
|
+
private dialogMessages;
|
|
6
|
+
private servername;
|
|
7
|
+
private api;
|
|
8
|
+
private port;
|
|
9
|
+
private sessionToken;
|
|
10
|
+
private openAIModel;
|
|
11
|
+
constructor(textToSend: string, dialogMessages: IChatMessage[], servername: string, api: string, port: string, sessionToken: string, openAIModel?: string);
|
|
12
|
+
execute(): Promise<string>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IChatMessage } from '../../../Data/source/AISource';
|
|
2
|
+
import { IUseCase } from '../base/IUseCase';
|
|
3
|
+
export declare class AIAnswerAssistWithProxyUseCase implements IUseCase<void, string> {
|
|
4
|
+
private textToSend;
|
|
5
|
+
private dialogMessages;
|
|
6
|
+
private servername;
|
|
7
|
+
private api;
|
|
8
|
+
private port;
|
|
9
|
+
private sessionToken;
|
|
10
|
+
private openAIModel;
|
|
11
|
+
constructor(textToSend: string, dialogMessages: IChatMessage[], servername: string, api: string, port: string, sessionToken: string, openAIModel?: string);
|
|
12
|
+
execute(): Promise<string>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IChatMessage } from '../../../Data/source/AISource';
|
|
2
|
+
import { IUseCase } from '../base/IUseCase';
|
|
3
|
+
export declare class AITranslateUseCase implements IUseCase<void, string> {
|
|
4
|
+
private textToSend;
|
|
5
|
+
private language;
|
|
6
|
+
private dialogMessages;
|
|
7
|
+
private servername;
|
|
8
|
+
private api;
|
|
9
|
+
private port;
|
|
10
|
+
private sessionToken;
|
|
11
|
+
private openAIModel;
|
|
12
|
+
constructor(textToSend: string, language: string, dialogMessages: IChatMessage[], servername: string, api: string, port: string, sessionToken: string, openAIModel?: string);
|
|
13
|
+
execute(): Promise<string>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IChatMessage } from '../../../Data/source/AISource';
|
|
2
|
+
import { IUseCase } from '../base/IUseCase';
|
|
3
|
+
export declare class AITranslateWithProxyUseCase implements IUseCase<void, string> {
|
|
4
|
+
private textToSend;
|
|
5
|
+
private language;
|
|
6
|
+
private dialogMessages;
|
|
7
|
+
private servername;
|
|
8
|
+
private api;
|
|
9
|
+
private port;
|
|
10
|
+
private sessionToken;
|
|
11
|
+
private openAIModel;
|
|
12
|
+
constructor(textToSend: string, language: string, dialogMessages: IChatMessage[], servername: string, api: string, port: string, sessionToken: string, openAIModel?: string);
|
|
13
|
+
execute(): Promise<string>;
|
|
14
|
+
}
|
|
@@ -4,6 +4,7 @@ import { GroupDialogEntity } from '../../../Domain/entity/GroupDialogEntity';
|
|
|
4
4
|
import { DialogEntity } from '../../../Domain/entity/DialogEntity';
|
|
5
5
|
import { FileEntity } from '../../../Domain/entity/FileEntity';
|
|
6
6
|
import { IChatMessage } from '../../../Data/source/AISource';
|
|
7
|
+
import { Tone } from '../../components/UI/Dialogs/MessagesView/AIWidgets/Tone';
|
|
7
8
|
export default class BaseViewModel<TResult> {
|
|
8
9
|
get entity(): TResult;
|
|
9
10
|
set entity(value: TResult);
|
|
@@ -16,6 +17,7 @@ export type EditDialogParams = {
|
|
|
16
17
|
dialogAvatar: File | string | null;
|
|
17
18
|
};
|
|
18
19
|
export type FunctionTypeFileToToVoid = (file: File) => void;
|
|
20
|
+
export type FunctionTypeFileToToBoolean = (file: File) => Promise<boolean>;
|
|
19
21
|
export type FunctionTypePaginationToVoid = (pagination: Pagination) => void;
|
|
20
22
|
export type FunctionTypeVoidToVoid = () => void;
|
|
21
23
|
export type FunctionTypeStringToVoid = (value: string) => void;
|
|
@@ -34,3 +36,4 @@ export type FunctionTypeStringWithContextToVoid = (value: string, context: IChat
|
|
|
34
36
|
export type FunctionTypeStringWithContextToString = (value: string, context: IChatMessage[], additionalSettings?: {
|
|
35
37
|
[key: string]: any;
|
|
36
38
|
}) => Promise<string>;
|
|
39
|
+
export type FunctionTypeVoidToTones = () => Tone[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FunctionTypeFileWithContextToToVoid, FunctionTypeJSXElement, FunctionTypeStringWithContextToString } from '../../../../../Views/Base/BaseViewModel';
|
|
1
|
+
import { FunctionTypeFileWithContextToToVoid, FunctionTypeJSXElement, FunctionTypeStringWithContextToString, FunctionTypeVoidToTones } from '../../../../../Views/Base/BaseViewModel';
|
|
2
2
|
export interface MessageWidgetProps {
|
|
3
3
|
servername: string;
|
|
4
4
|
api: string;
|
|
@@ -17,6 +17,9 @@ export interface AIFileWidget extends AIWidget {
|
|
|
17
17
|
export interface AIMessageWidget extends AITextWidget {
|
|
18
18
|
textToWidget: FunctionTypeStringWithContextToString;
|
|
19
19
|
}
|
|
20
|
+
export interface AIRephraseWidget extends AIMessageWidget {
|
|
21
|
+
tonesToWidget: FunctionTypeVoidToTones;
|
|
22
|
+
}
|
|
20
23
|
export interface AIAttachmentWidget extends AIFileWidget {
|
|
21
24
|
fileToWidget: FunctionTypeFileWithContextToToVoid;
|
|
22
25
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './AIWidgetActions.scss';
|
|
3
|
-
type MenuItem = {
|
|
3
|
+
export type MenuItem = {
|
|
4
4
|
title: string;
|
|
5
5
|
icon?: JSX.Element;
|
|
6
6
|
action: () => void;
|
|
@@ -9,6 +9,7 @@ type ContextMenuProps = {
|
|
|
9
9
|
widgetToRender?: JSX.Element;
|
|
10
10
|
items?: MenuItem[];
|
|
11
11
|
title?: string | null;
|
|
12
|
+
disabled?: boolean;
|
|
12
13
|
};
|
|
13
|
-
declare function AIWidgetActions({ items, widgetToRender, title, }: ContextMenuProps): JSX.Element;
|
|
14
|
+
declare function AIWidgetActions({ items, widgetToRender, title, disabled, }: ContextMenuProps): JSX.Element;
|
|
14
15
|
export default AIWidgetActions;
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Empathetic = "Empathetic Tone",
|
|
6
|
-
Neutral = "Neutral Tone",
|
|
7
|
-
Assertive = "Assertive Tone",
|
|
8
|
-
Instructive = "Instructive Tone",
|
|
9
|
-
Persuasive = "Persuasive Tone",
|
|
10
|
-
Sarcastic = "Sarcastic/Ironic Tone",
|
|
11
|
-
Poetic = "Poetic Tone",
|
|
12
|
-
Unchanged = "Unchanged"
|
|
1
|
+
export interface Tone {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
iconEmoji: string;
|
|
13
5
|
}
|
|
14
6
|
export declare const toneToString: (tone: Tone) => string;
|
|
15
|
-
export declare const stringToTone: (toneStr: string) => Tone | undefined;
|
|
7
|
+
export declare const stringToTone: (toneStr: string, description?: string, emoji?: string) => Tone | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './DefaultAttachmentComponent.scss';
|
|
3
|
+
type DefaultAttachmentComponentProps = {
|
|
4
|
+
fileName: string;
|
|
5
|
+
fileUrl: string;
|
|
6
|
+
};
|
|
7
|
+
declare const DefaultAttachmentComponent: React.FC<DefaultAttachmentComponentProps>;
|
|
8
|
+
export default DefaultAttachmentComponent;
|
package/dist/Presentation/components/UI/Dialogs/MessagesView/InComingMessage/InComingMessage.d.ts
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import './InComingMessage.scss';
|
|
3
3
|
import UiKitTheme from '../../../../../assets/UiKitTheme';
|
|
4
4
|
import { MessageEntity } from '../../../../../../Domain/entity/MessageEntity';
|
|
5
5
|
import { AIMessageWidget } from '../AIWidgets/AIMessageWidget';
|
|
6
|
+
import { AvatarContentIncomingUserProps } from './AvatarContentIncomingUser/AvatarContentIncomingUser';
|
|
7
|
+
import { UserEntity } from '../../../../../../Domain/entity/UserEntity';
|
|
8
|
+
export type GetUserNameFct = (props: {
|
|
9
|
+
userId?: number;
|
|
10
|
+
sender?: UserEntity;
|
|
11
|
+
}) => Promise<string | undefined>;
|
|
6
12
|
export declare function InComingMessage(props: {
|
|
7
13
|
theme: UiKitTheme | undefined;
|
|
8
|
-
|
|
14
|
+
senderNameFct: GetUserNameFct;
|
|
9
15
|
message: MessageEntity;
|
|
10
|
-
|
|
16
|
+
onStartLoader: () => void;
|
|
17
|
+
onStopLoader: () => void;
|
|
18
|
+
onErrorToast: (messageError: string) => void;
|
|
11
19
|
currentUserId?: number;
|
|
12
20
|
messagesToView: MessageEntity[];
|
|
13
21
|
AITranslation?: AIMessageWidget;
|
|
14
22
|
AIAnswerToMessage?: AIMessageWidget;
|
|
23
|
+
userIconRenderer?: (props: AvatarContentIncomingUserProps) => React.ReactElement;
|
|
15
24
|
}): JSX.Element;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './MessagesView.scss';
|
|
3
|
+
import { UserEntity } from '../../../../../Domain/entity/UserEntity';
|
|
3
4
|
import UiKitTheme from '../../../../assets/UiKitTheme';
|
|
4
5
|
import { AIMessageWidget } from './AIWidgets/AIMessageWidget';
|
|
5
6
|
import { DialogsViewModel } from '../../../../Views/Dialogs/DialogViewModel';
|
|
6
7
|
import { FunctionTypeVoidToVoid } from '../../../../Views/Base/BaseViewModel';
|
|
8
|
+
import { AvatarContentIncomingUserProps } from './InComingMessage/AvatarContentIncomingUser/AvatarContentIncomingUser';
|
|
7
9
|
type HeaderDialogsMessagesProps = {
|
|
8
10
|
AIRephrase?: AIMessageWidget;
|
|
9
11
|
AITranslate?: AIMessageWidget;
|
|
@@ -12,8 +14,16 @@ type HeaderDialogsMessagesProps = {
|
|
|
12
14
|
onDialogInformationHandler?: FunctionTypeVoidToVoid;
|
|
13
15
|
maxWidthToResize?: string;
|
|
14
16
|
theme?: UiKitTheme;
|
|
17
|
+
headerContent?: React.ReactNode;
|
|
15
18
|
subHeaderContent?: React.ReactNode;
|
|
16
19
|
upHeaderContent?: React.ReactNode;
|
|
20
|
+
rootStyles?: React.CSSProperties;
|
|
21
|
+
messagesContainerStyles?: React.CSSProperties;
|
|
22
|
+
userIconRenderer?: (props: AvatarContentIncomingUserProps) => React.ReactElement;
|
|
23
|
+
getSenderNameFct?: (props: {
|
|
24
|
+
sender?: UserEntity;
|
|
25
|
+
userId?: number;
|
|
26
|
+
}) => Promise<string | undefined>;
|
|
17
27
|
};
|
|
18
28
|
declare const MessagesView: React.FC<HeaderDialogsMessagesProps>;
|
|
19
29
|
export default MessagesView;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import BaseViewModel, {
|
|
1
|
+
import BaseViewModel, { FunctionTypeFileToToBoolean, FunctionTypePaginationToVoid, FunctionTypeStringToVoid, FunctionTypeVoidToVoid } from '../../../../Views/Base/BaseViewModel';
|
|
2
2
|
import { MessageEntity } from '../../../../../Domain/entity/MessageEntity';
|
|
3
3
|
import { DialogEntity } from '../../../../../Domain/entity/DialogEntity';
|
|
4
4
|
export interface MessagesViewModel extends BaseViewModel<DialogEntity> {
|
|
@@ -7,7 +7,7 @@ export interface MessagesViewModel extends BaseViewModel<DialogEntity> {
|
|
|
7
7
|
messages: MessageEntity[];
|
|
8
8
|
getMessages: FunctionTypePaginationToVoid;
|
|
9
9
|
sendTextMessage: FunctionTypeStringToVoid;
|
|
10
|
-
sendAttachmentMessage:
|
|
10
|
+
sendAttachmentMessage: FunctionTypeFileToToBoolean;
|
|
11
11
|
release: FunctionTypeVoidToVoid;
|
|
12
12
|
sendTypingTextMessage: FunctionTypeVoidToVoid;
|
|
13
13
|
typingText: string;
|
package/dist/QBconfig.d.ts
CHANGED
|
@@ -8,17 +8,22 @@ export declare const QBConfig: {
|
|
|
8
8
|
};
|
|
9
9
|
configAIApi: {
|
|
10
10
|
AIAnswerAssistWidgetConfig: {
|
|
11
|
+
organizationName: string;
|
|
12
|
+
openAIModel: string;
|
|
11
13
|
apiKey: string;
|
|
14
|
+
maxTokens: number;
|
|
12
15
|
useDefault: boolean;
|
|
13
16
|
proxyConfig: {
|
|
14
17
|
api: string;
|
|
15
18
|
servername: string;
|
|
16
19
|
port: string;
|
|
17
|
-
sessionToken: string;
|
|
18
20
|
};
|
|
19
21
|
};
|
|
20
22
|
AITranslateWidgetConfig: {
|
|
23
|
+
organizationName: string;
|
|
24
|
+
openAIModel: string;
|
|
21
25
|
apiKey: string;
|
|
26
|
+
maxTokens: number;
|
|
22
27
|
useDefault: boolean;
|
|
23
28
|
defaultLanguage: string;
|
|
24
29
|
languages: string[];
|
|
@@ -26,18 +31,24 @@ export declare const QBConfig: {
|
|
|
26
31
|
api: string;
|
|
27
32
|
servername: string;
|
|
28
33
|
port: string;
|
|
29
|
-
sessionToken: string;
|
|
30
34
|
};
|
|
31
35
|
};
|
|
32
36
|
AIRephraseWidgetConfig: {
|
|
37
|
+
organizationName: string;
|
|
38
|
+
openAIModel: string;
|
|
33
39
|
apiKey: string;
|
|
40
|
+
maxTokens: number;
|
|
34
41
|
useDefault: boolean;
|
|
35
42
|
defaultTone: string;
|
|
43
|
+
Tones: {
|
|
44
|
+
name: string;
|
|
45
|
+
description: string;
|
|
46
|
+
iconEmoji: string;
|
|
47
|
+
}[];
|
|
36
48
|
proxyConfig: {
|
|
37
49
|
api: string;
|
|
38
50
|
servername: string;
|
|
39
51
|
port: string;
|
|
40
|
-
sessionToken: string;
|
|
41
52
|
};
|
|
42
53
|
};
|
|
43
54
|
};
|
package/dist/index-ui.d.ts
CHANGED
|
@@ -28,4 +28,8 @@ import { AIMessageWidget } from './Presentation/components/UI/Dialogs/MessagesVi
|
|
|
28
28
|
import { AISource, IChatMessage } from './Data/source/AISource';
|
|
29
29
|
import AIWidgetIcon from './Presentation/components/UI/svgs/Icons/AIWidgets/AIWidget';
|
|
30
30
|
import ErrorMessageIcon from './Presentation/components/UI/Dialogs/MessagesView/AIWidgets/ErrorMessageIcon';
|
|
31
|
-
|
|
31
|
+
import PreviewDialogViewModel from './Presentation/components/UI/Dialogs/PreviewDialog/PreviewDialogViewModel';
|
|
32
|
+
import { AvatarContentIncomingUserProps } from './Presentation/components/UI/Dialogs/MessagesView/InComingMessage/AvatarContentIncomingUser/AvatarContentIncomingUser';
|
|
33
|
+
import { FunctionTypeViewModelToVoid } from './Presentation/Views/Base/BaseViewModel';
|
|
34
|
+
import { GetUserNameFct } from './Presentation/components/UI/Dialogs/MessagesView/InComingMessage/InComingMessage';
|
|
35
|
+
export { MainButton, TypeButton, type LoginData, type AuthorizationData, QuickBloxUIKitProvider, qbDataContext, type QBDataContextType, RemoteDataSource, LocalDataSource, useQBConnection, useQbInitializedDataContext, useQbUIKitDataContext, useEventMessagesRepository, type DialogsViewModel, useDialogsViewModel, SubscribeToDialogEventsUseCase, Pagination, type DialogEventInfo, EventMessageType, NotificationTypes, stringifyError, DesktopLayout, DialogsComponent, MessagesView, DialogInformation, type DialogEntity, BaseViewModel, QuickBloxUIKitDesktopLayout, DefaultTheme, type UiKitTheme, type AIMessageWidget, AISource, type IChatMessage, AIWidgetIcon, ErrorMessageIcon, PreviewDialogViewModel, type FunctionTypeViewModelToVoid, type AvatarContentIncomingUserProps, type GetUserNameFct };
|