quickblox-react-ui-kit 0.1.7 → 0.2.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/Presentation/Views/Base/BaseViewModel.d.ts +8 -0
- package/dist/Presentation/Views/Dialogs/Dialogs.d.ts +3 -1
- package/dist/Presentation/components/UI/Dialogs/DialogInformation/DialogInformation.d.ts +3 -1
- package/dist/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/AIWidget.d.ts +8 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/ErrorMessageIcon.d.ts +11 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/UseDefaultAIAssistAnswerWidgetWithProxy.d.ts +9 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/UseDefaultTextInputWidget.d.ts +2 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/useDefaultVoiceInputWidget.d.ts +2 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/ContextMenu.d.ts +10 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/MessagesView.d.ts +7 -1
- package/dist/Presentation/components/UI/svgs/Icons/Media/AIWidget/index.d.ts +4 -0
- package/dist/Presentation/components/layouts/Desktop/QuickBloxUIKitDesktopLayout.d.ts +9 -0
- package/dist/Presentation/components/layouts/TestStage/CompanyLogo/CompanyLogo.d.ts +3 -0
- package/dist/Presentation/components/providers/QuickBloxUIKitProvider/useQbInitializedDataContext.d.ts +3 -0
- package/dist/Presentation/components/providers/QuickBloxUIKitProvider/useQbUIKitDataContext.d.ts +3 -0
- package/dist/QBconfig.d.ts +12 -0
- package/dist/index-ui.d.ts +3 -2
- package/dist/index-ui.js +72 -17
- package/dist/utils/utils.d.ts +3 -0
- package/package.json +1 -1
- package/src/App.tsx +21 -19
- package/src/Presentation/Views/Base/BaseViewModel.ts +17 -1
- package/src/Presentation/Views/Dialogs/Dialogs.tsx +14 -9
- package/src/Presentation/Views/Dialogs/useDialogsViewModel.ts +1 -1
- package/src/Presentation/components/UI/Dialogs/DialogInformation/DialogInformation.tsx +17 -8
- package/src/Presentation/components/UI/Dialogs/DialogInformation/UsersList/useUsersListViewModel.ts +2 -2
- package/src/Presentation/components/UI/Dialogs/EditDialog/EditDialog.tsx +2 -2
- package/src/Presentation/components/UI/Dialogs/InviteMembers/useInviteMembersViewModel.ts +2 -2
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/AIWidget.ts +13 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/ErrorMessageIcon.tsx +98 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/UseDefaultAIAssistAnswerWidgetWithProxy.tsx +136 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/UseDefaultTextInputWidget.tsx +60 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/AIWidgets/useDefaultVoiceInputWidget.tsx +86 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/ContextMenu.tsx +96 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/MessagesView.tsx +275 -51
- package/src/Presentation/components/UI/Dialogs/MessagesView/useMessagesViewModel.ts +2 -2
- package/src/Presentation/components/UI/svgs/Icons/Media/AIWidget/Send.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/AIWidget/index.tsx +39 -0
- package/src/Presentation/components/layouts/Desktop/QuickBloxUIKitDesktopLayout.tsx +83 -8
- package/src/Presentation/components/layouts/TestStage/CompanyLogo/CompanyLogo.tsx +27 -0
- package/src/Presentation/components/layouts/TestStage/LoginView/Login.tsx +2 -2
- package/src/Presentation/components/providers/QuickBloxUIKitProvider/useEventMessagesRepository.ts +2 -2
- package/src/Presentation/components/providers/QuickBloxUIKitProvider/{useQbDataContext.ts → useQbInitializedDataContext.ts} +2 -2
- package/src/Presentation/components/providers/QuickBloxUIKitProvider/useQbUIKitDataContext.ts +11 -0
- package/src/QBconfig.ts +12 -0
- package/src/index-ui.ts +4 -2
- package/src/utils/utils.ts +39 -0
- package/dist/Presentation/components/providers/QuickBloxUIKitProvider/useQbDataContext.d.ts +0 -3
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { Pagination } from '../../../Domain/repository/Pagination';
|
|
2
3
|
import { GroupDialogEntity } from '../../../Domain/entity/GroupDialogEntity';
|
|
3
4
|
import { DialogEntity } from '../../../Domain/entity/DialogEntity';
|
|
@@ -13,6 +14,10 @@ export type EditDialogParams = {
|
|
|
13
14
|
dialogTitle: string;
|
|
14
15
|
dialogAvatar: File | string | null;
|
|
15
16
|
};
|
|
17
|
+
export interface IChatMessage {
|
|
18
|
+
role: string;
|
|
19
|
+
content: string;
|
|
20
|
+
}
|
|
16
21
|
export type FunctionTypeFileToToVoid = (file: File) => void;
|
|
17
22
|
export type FunctionTypePaginationToVoid = (pagination: Pagination) => void;
|
|
18
23
|
export type FunctionTypeVoidToVoid = () => void;
|
|
@@ -22,3 +27,6 @@ export type FunctionTypeEditDialogParamsToVoid = (params: EditDialogParams) => v
|
|
|
22
27
|
export type FunctionTypeDialogEntityToDialogEntity = (entity: GroupDialogEntity) => Promise<DialogEntity>;
|
|
23
28
|
export type FunctionTypeDialogEntityToBoolean = (entity: GroupDialogEntity) => Promise<boolean>;
|
|
24
29
|
export type FunctionTypeFileToFileEntity = (file: File) => Promise<FileEntity>;
|
|
30
|
+
export type FunctionTypeJSXElement = () => JSX.Element;
|
|
31
|
+
export type FunctionTypeFileWithContextToToVoid = (file: File, context: IChatMessage[]) => void;
|
|
32
|
+
export type FunctionTypeStringWithContextToVoid = (value: string, context: IChatMessage[]) => void;
|
|
@@ -9,13 +9,15 @@ type DialogsComponentSettings = {
|
|
|
9
9
|
themeName?: ThemeNames;
|
|
10
10
|
withoutHeader?: boolean;
|
|
11
11
|
useSubHeader?: boolean;
|
|
12
|
+
useUpHeader?: boolean;
|
|
12
13
|
themeHeader?: UiKitTheme;
|
|
13
14
|
themePreview?: UiKitTheme;
|
|
14
15
|
};
|
|
15
16
|
type DialogsProps = {
|
|
16
17
|
header?: React.ReactNode;
|
|
17
18
|
subHeaderContent?: React.ReactNode;
|
|
18
|
-
|
|
19
|
+
upHeaderContent?: React.ReactNode;
|
|
20
|
+
onDialogSelectHandler?: FunctionTypeViewModelToVoid<DialogEntity>;
|
|
19
21
|
dialogsViewModel: DialogsViewModel;
|
|
20
22
|
additionalSettings?: DialogsComponentSettings;
|
|
21
23
|
};
|
|
@@ -7,8 +7,10 @@ import UiKitTheme from '../../../../assets/UiKitTheme';
|
|
|
7
7
|
type HeaderDialogsProps = {
|
|
8
8
|
dialog: DialogEntity;
|
|
9
9
|
dialogViewModel: DialogsViewModel;
|
|
10
|
-
|
|
10
|
+
onCloseDialogInformationHandler: FunctionTypeVoidToVoid;
|
|
11
11
|
theme?: UiKitTheme;
|
|
12
|
+
subHeaderContent?: React.ReactNode;
|
|
13
|
+
upHeaderContent?: React.ReactNode;
|
|
12
14
|
};
|
|
13
15
|
declare const DialogInformation: React.FC<HeaderDialogsProps>;
|
|
14
16
|
export default DialogInformation;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FunctionTypeFileWithContextToToVoid, FunctionTypeJSXElement, FunctionTypeStringWithContextToVoid } from '../../../../../Views/Base/BaseViewModel';
|
|
2
|
+
export interface AIWidget {
|
|
3
|
+
renderWidget: FunctionTypeJSXElement;
|
|
4
|
+
textToWidget: FunctionTypeStringWithContextToVoid;
|
|
5
|
+
fileToWidget: FunctionTypeFileWithContextToToVoid;
|
|
6
|
+
textToContent: string | undefined;
|
|
7
|
+
fileToContent: File | undefined;
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type ErrorDescription = {
|
|
3
|
+
title: string;
|
|
4
|
+
action: () => void;
|
|
5
|
+
};
|
|
6
|
+
type ErrorMessageIconProps = {
|
|
7
|
+
errorMessageText: string;
|
|
8
|
+
errorsDescriptions?: ErrorDescription[];
|
|
9
|
+
};
|
|
10
|
+
declare function ErrorMessageIcon({ errorMessageText, errorsDescriptions, }: ErrorMessageIconProps): JSX.Element;
|
|
11
|
+
export default ErrorMessageIcon;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AIWidget } from './AIWidget';
|
|
2
|
+
interface MessageWidgetProps {
|
|
3
|
+
servername: string;
|
|
4
|
+
api: string;
|
|
5
|
+
port: string;
|
|
6
|
+
sessionToken: string;
|
|
7
|
+
}
|
|
8
|
+
export default function UseDefaultAIAssistAnswerWidgetWithProxy({ servername, api, port, sessionToken, }: MessageWidgetProps): AIWidget;
|
|
9
|
+
export {};
|
|
@@ -2,12 +2,18 @@ import React from 'react';
|
|
|
2
2
|
import './MessagesView.scss';
|
|
3
3
|
import { FunctionTypeVoidToVoid } from '../../../../Views/Base/BaseViewModel';
|
|
4
4
|
import UiKitTheme from '../../../../assets/UiKitTheme';
|
|
5
|
+
import { AIWidget } from './AIWidgets/AIWidget';
|
|
5
6
|
import { DialogsViewModel } from '../../../../Views/Dialogs/DialogViewModel';
|
|
6
7
|
type HeaderDialogsMessagesProps = {
|
|
8
|
+
AIEditMessage?: AIWidget;
|
|
9
|
+
AITranslation?: AIWidget;
|
|
10
|
+
AIAnswerToMessage?: AIWidget;
|
|
7
11
|
dialogsViewModel: DialogsViewModel;
|
|
8
|
-
|
|
12
|
+
onDialogInformationHandler?: FunctionTypeVoidToVoid;
|
|
9
13
|
maxWidthToResize?: string;
|
|
10
14
|
theme?: UiKitTheme;
|
|
15
|
+
subHeaderContent?: React.ReactNode;
|
|
16
|
+
upHeaderContent?: React.ReactNode;
|
|
11
17
|
};
|
|
12
18
|
declare const MessagesView: React.FC<HeaderDialogsMessagesProps>;
|
|
13
19
|
export default MessagesView;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import UiKitTheme from '../../../assets/UiKitTheme';
|
|
3
|
+
import { AIWidget } from '../../UI/Dialogs/MessagesView/AIWidgets/AIWidget';
|
|
4
|
+
type AIWidgetPlaceHolder = {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
default: boolean;
|
|
7
|
+
AIWidget?: AIWidget;
|
|
8
|
+
};
|
|
3
9
|
type QuickBloxUIKitDesktopLayoutProps = {
|
|
4
10
|
theme?: UiKitTheme;
|
|
11
|
+
AIEditMessage?: AIWidgetPlaceHolder;
|
|
12
|
+
AITranslation?: AIWidgetPlaceHolder;
|
|
13
|
+
AIAnswerToMessage?: AIWidgetPlaceHolder;
|
|
5
14
|
};
|
|
6
15
|
declare const QuickBloxUIKitDesktopLayout: React.FC<QuickBloxUIKitDesktopLayoutProps>;
|
|
7
16
|
export default QuickBloxUIKitDesktopLayout;
|
package/dist/QBconfig.d.ts
CHANGED
|
@@ -6,6 +6,18 @@ export declare const QBConfig: {
|
|
|
6
6
|
authSecret: string;
|
|
7
7
|
sessionToken: string;
|
|
8
8
|
};
|
|
9
|
+
configAIApi: {
|
|
10
|
+
AIAnswerAssistWidgetConfig: {
|
|
11
|
+
apiKey: string;
|
|
12
|
+
useDefault: boolean;
|
|
13
|
+
proxyConfig: {
|
|
14
|
+
api: string;
|
|
15
|
+
servername: string;
|
|
16
|
+
port: string;
|
|
17
|
+
sessionToken: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
9
21
|
appConfig: {
|
|
10
22
|
maxFileSize: number;
|
|
11
23
|
sessionTimeOut: number;
|
package/dist/index-ui.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import MainButton, { TypeButton } from './Presentation/components/UI/Buttons/Mai
|
|
|
3
3
|
import QuickBloxUIKitProvider, { qbDataContext, QBDataContextType } from './Presentation/components/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider';
|
|
4
4
|
import { LocalDataSource } from './Data/source/local/LocalDataSource';
|
|
5
5
|
import useQBConnection from './Presentation/components/providers/QuickBloxUIKitProvider/useQBConnection';
|
|
6
|
-
import
|
|
6
|
+
import useQbInitializedDataContext from './Presentation/components/providers/QuickBloxUIKitProvider/useQbInitializedDataContext';
|
|
7
7
|
import useEventMessagesRepository from './Presentation/components/providers/QuickBloxUIKitProvider/useEventMessagesRepository';
|
|
8
8
|
import { DialogsViewModel } from './Presentation/Views/Dialogs/DialogViewModel';
|
|
9
9
|
import useDialogsViewModel from './Presentation/Views/Dialogs/useDialogsViewModel';
|
|
@@ -23,4 +23,5 @@ import { LoginData, AuthorizationData, RemoteDataSource } from './Data/source/re
|
|
|
23
23
|
import QuickBloxUIKitDesktopLayout from './Presentation/components/layouts/Desktop/QuickBloxUIKitDesktopLayout';
|
|
24
24
|
import DefaultTheme from './Presentation/assets/DefaultThemes/DefaultTheme';
|
|
25
25
|
import UiKitTheme from './Presentation/assets/UiKitTheme';
|
|
26
|
-
|
|
26
|
+
import useQbUIKitDataContext from './Presentation/components/providers/QuickBloxUIKitProvider/useQbUIKitDataContext';
|
|
27
|
+
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, };
|