quickblox-react-ui-kit 0.4.6-beta.4 → 0.4.7
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/CommonTypes/CommonTypes.d.ts +12 -0
- package/dist/Data/source/remote/RemoteDataSource.d.ts +5 -0
- package/dist/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogListItem/DialogListItem.d.ts +1 -1
- package/dist/Presentation/Views/Flow/CreateDialog/CreateDialog.d.ts +1 -0
- package/dist/Presentation/ui-components/DialogItemPreview/DialogItemPreview.d.ts +3 -3
- package/dist/Presentation/ui-components/Header/Header.d.ts +1 -1
- package/dist/index-ui.d.ts +47 -3
- package/dist/index-ui.js +25470 -17586
- package/dist/index-ui.js.map +1 -1
- package/global.d.ts +3 -202
- package/package.json +1 -1
- package/src/App.scss +5 -0
- package/src/App.tsx +58 -33
- package/src/CommonTypes/CommonTypes.ts +13 -0
- package/src/Data/DefaultConfigurations.ts +4 -0
- package/src/Data/source/remote/RemoteDataSource.ts +210 -148
- package/src/Domain/use_cases/CreateDialogUseCase.ts +0 -1
- package/src/Domain/use_cases/ForwardMessagesUseCase.ts +0 -1
- package/src/Domain/use_cases/GetAllDialogsUseCase.ts +0 -1
- package/src/Domain/use_cases/GetAllDialogsUseCaseWithMock.ts +0 -2
- package/src/Domain/use_cases/GetAllMessagesForDialog.ts +0 -1
- package/src/Domain/use_cases/GetAllUsersUseCase.ts +0 -1
- package/src/Domain/use_cases/GetDialogByIdUseCase.ts +0 -2
- package/src/Domain/use_cases/GetUsersByIdsUseCase.ts +0 -1
- package/src/Domain/use_cases/LeaveDialogUseCase.ts +0 -1
- package/src/Domain/use_cases/RemoveUsersFromTheDialogUseCase.ts +0 -1
- package/src/Domain/use_cases/ReplyMessagesUseCase.ts +0 -2
- package/src/Domain/use_cases/SendTextMessageUseCase.ts +0 -3
- package/src/Domain/use_cases/SubscribeToDialogEventsUseCase.ts +0 -26
- package/src/Domain/use_cases/SubscribeToDialogsUpdatesUseCase.ts +0 -1
- package/src/Domain/use_cases/SyncDialogsUseCase.ts +1 -2
- package/src/Domain/use_cases/UpdateCurrentDialogInDataSourceUseCase.ts +0 -2
- package/src/Domain/use_cases/UpdateDialogUseCase.ts +0 -2
- package/src/Domain/use_cases/UploadFileUseCase.ts +0 -2
- package/src/Domain/use_cases/UserTypingMessageUseCase.ts +0 -2
- package/src/Domain/use_cases/ai/AIAnswerAssistUseCase.ts +0 -2
- package/src/Domain/use_cases/ai/AIAnswerAssistWithProxyUseCase.ts +0 -3
- package/src/Domain/use_cases/ai/AIAnswerAssistWithSDKUseCase.ts +0 -2
- package/src/Domain/use_cases/ai/AIRephraseUseCase.ts +0 -3
- package/src/Domain/use_cases/ai/AIRephraseWithProxyUseCase.ts +0 -3
- package/src/Domain/use_cases/ai/AITranslateUseCase.ts +0 -2
- package/src/Domain/use_cases/ai/AITranslateWithProxyUseCase.ts +0 -3
- package/src/Domain/use_cases/ai/AITranslateWithSDKUseCase.ts +0 -3
- package/src/Domain/use_cases/base/Subscribable/SubscriptionPerformer.ts +0 -1
- package/src/Presentation/Views/Dialog/AIWidgets/AIRephraseWidget/AIRephraseWidget.tsx +1 -1
- package/src/Presentation/Views/Dialog/AIWidgets/AIWidgetActions/AIWidgetActions.scss +12 -6
- package/src/Presentation/Views/Dialog/AIWidgets/AIWidgetActions/AIWidgetActions.tsx +4 -2
- package/src/Presentation/Views/Dialog/Dialog.scss +7 -1
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogListItem/DialogListItem.scss +17 -29
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogListItem/DialogListItem.tsx +8 -13
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/ForwardMessageFlow.scss +9 -9
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/InputForForwarding/InputForForwarding.scss +11 -0
- package/src/Presentation/Views/Dialog/MessageContextMenu/MessageContextMenu.tsx +3 -2
- package/src/Presentation/Views/Dialog/useDialogViewModel.ts +10 -21
- package/src/Presentation/Views/DialogInfo/DialogInfo.scss +19 -25
- package/src/Presentation/Views/DialogInfo/DialogInfo.tsx +2 -2
- package/src/Presentation/Views/DialogInfo/DialogMemberButton/DialogMembersButton.scss +0 -17
- package/src/Presentation/Views/DialogInfo/MembersList/MembersList.scss +9 -1
- package/src/Presentation/Views/DialogInfo/UsersList/SingleUser/SingleUser.scss +0 -1
- package/src/Presentation/Views/DialogInfo/UsersList/useUsersListViewModel.ts +2 -4
- package/src/Presentation/Views/DialogList/useDialogListViewModel.ts +0 -1
- package/src/Presentation/Views/EditDialog/EditDialog.scss +1 -38
- package/src/Presentation/Views/Flow/CreateDialog/CreateDialog.scss +17 -42
- package/src/Presentation/Views/Flow/CreateDialog/CreateDialog.tsx +45 -39
- package/src/Presentation/Views/Flow/CreateDialogFlow/CreateNewDialogFlow.tsx +6 -2
- package/src/Presentation/Views/InviteMembers/InviteMembers.scss +4 -33
- package/src/Presentation/Views/InviteMembers/InviteMembers.tsx +23 -4
- package/src/Presentation/Views/PreviewDialog/PreviewDialog.scss +8 -0
- package/src/Presentation/Views/PreviewDialog/PreviewDialog.tsx +8 -5
- package/src/Presentation/components/UI/Buttons/MainButton/MainButton.css +5 -10
- package/src/Presentation/components/UI/Placeholders/ErrorComponent/ErrorComponent.scss +0 -5
- package/src/Presentation/components/containers/ColumnContainer/ColumnContainer.scss +1 -10
- package/src/Presentation/layouts/TestStage/LoginView/Login.scss +6 -3
- package/src/Presentation/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider.tsx +1 -33
- package/src/Presentation/themes/styles/_theme_colors_scheme.scss +1 -1
- package/src/Presentation/themes/styles/_theme_dark.scss +5 -4
- package/src/Presentation/themes/styles/_theme_light.scss +3 -2
- package/src/Presentation/ui-components/Avatar/Avatar.scss +8 -5
- package/src/Presentation/ui-components/Avatar/Avatar.tsx +2 -1
- package/src/Presentation/ui-components/Badge/Badge.tsx +1 -0
- package/src/Presentation/ui-components/Button/Button.scss +5 -6
- package/src/Presentation/ui-components/Button/Button.tsx +7 -2
- package/src/Presentation/ui-components/CheckBox/CheckBox.scss +23 -0
- package/src/Presentation/ui-components/CheckBox/CheckBox.tsx +19 -7
- package/src/Presentation/ui-components/DialogBanner/DialogBanner.tsx +1 -0
- package/src/Presentation/ui-components/DialogItemPreview/DialogItemPreview.scss +3 -3
- package/src/Presentation/ui-components/DialogItemPreview/DialogItemPreview.tsx +3 -3
- package/src/Presentation/ui-components/DialogWindow/DialogWindow.scss +7 -4
- package/src/Presentation/ui-components/DialogWindow/DialogWindow.tsx +1 -1
- package/src/Presentation/ui-components/Dropdown/Dropdown.tsx +1 -1
- package/src/Presentation/ui-components/Dropdown/DropdownOption.tsx +2 -1
- package/src/Presentation/ui-components/Header/Header.scss +9 -2
- package/src/Presentation/ui-components/Header/Header.tsx +1 -1
- package/src/Presentation/ui-components/Loader/Loader.tsx +1 -0
- package/src/Presentation/ui-components/Message/Bubble/AudioBubble/AudioBubble.scss +1 -0
- package/src/Presentation/ui-components/Message/Bubble/FileBubble/FileBubble.tsx +1 -0
- package/src/Presentation/ui-components/Message/Bubble/ImageBubble/ImageBubble.tsx +1 -0
- package/src/Presentation/ui-components/Message/Bubble/TextBubble/TextBubble.scss +13 -3
- package/src/Presentation/ui-components/Message/Bubble/TextBubble/TextBubble.tsx +1 -0
- package/src/Presentation/ui-components/Message/Bubble/VideoBubble/VideoBubble.tsx +1 -0
- package/src/Presentation/ui-components/Message/FileUrl/FileUrl.scss +0 -3
- package/src/Presentation/ui-components/Message/FileUrl/FileUrl.tsx +1 -0
- package/src/Presentation/ui-components/Message/Message.scss +5 -1
- package/src/Presentation/ui-components/MessageInput/MessageInput.scss +5 -1
- package/src/Presentation/ui-components/MessageInput/MessageInput.tsx +1 -1
- package/src/Presentation/ui-components/MessageInput/VoiceRecordingProgress/VoiceRecordingProgress.tsx +1 -1
- package/src/Presentation/ui-components/MessageSeparator/MessageSeparator.scss +13 -13
- package/src/Presentation/ui-components/Placeholder/Placeholder.scss +5 -0
- package/src/Presentation/ui-components/Placeholder/Placeholder.tsx +1 -1
- package/src/Presentation/ui-components/PreviewFileMessage/PreviewFileMessage.scss +4 -1
- package/src/Presentation/ui-components/PreviewFileMessage/PreviewFileMessage.tsx +1 -0
- package/src/Presentation/ui-components/SettingsItem/SettingsItem.scss +5 -1
- package/src/Presentation/ui-components/SettingsItem/SettingsItem.tsx +1 -1
- package/src/Presentation/ui-components/TextField/TextField.scss +5 -3
- package/src/Presentation/ui-components/Toast/Toast.scss +3 -3
- package/src/Presentation/ui-components/Toast/ToastProvider.tsx +2 -2
- package/src/Presentation/ui-components/UserListItem/UserListItem.scss +11 -3
- package/src/Presentation/ui-components/UserListItem/UserListItem.tsx +1 -0
- package/src/QBconfig.ts +2 -0
- package/src/hooks/useQuickBloxUIKit.ts +101 -18
- package/src/index-ui.ts +111 -18
- package/src/qb-api-calls/index.ts +52 -3
- package/storybook-static/{217.3c66ff1e.iframe.bundle.js → 217.07d5c7a3.iframe.bundle.js} +3 -3
- package/storybook-static/{217.3c66ff1e.iframe.bundle.js.map → 217.07d5c7a3.iframe.bundle.js.map} +1 -1
- package/storybook-static/735.6ee62079.iframe.bundle.js +2 -0
- package/storybook-static/{844.6041e1a5.iframe.bundle.js → 844.e8bfd664.iframe.bundle.js} +3 -3
- package/storybook-static/{844.6041e1a5.iframe.bundle.js.map → 844.e8bfd664.iframe.bundle.js.map} +1 -1
- package/storybook-static/{961.c94da456.iframe.bundle.js → 961.d47fc2bc.iframe.bundle.js} +2 -2
- package/storybook-static/Presentation-ui-components-Avatar-avatar-stories.a5ba7608.iframe.bundle.js +2 -0
- package/storybook-static/Presentation-ui-components-Badge-Badge-stories.c8824861.iframe.bundle.js +2 -0
- package/storybook-static/Presentation-ui-components-Button-Button-stories.fa2aa72c.iframe.bundle.js +2 -0
- package/storybook-static/Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.b6998344.iframe.bundle.js +2 -0
- package/storybook-static/Presentation-ui-components-DialogWindow-DialogWindow-stories.a724643f.iframe.bundle.js +2 -0
- package/storybook-static/Presentation-ui-components-Dropdown-Dropdown-stories.a03feb06.iframe.bundle.js +2 -0
- package/storybook-static/Presentation-ui-components-Header-Header-stories.978f0af5.iframe.bundle.js +2 -0
- package/storybook-static/Presentation-ui-components-Loader-Loader-stories.4e80520d.iframe.bundle.js +2 -0
- package/storybook-static/Presentation-ui-components-Message-Message-stories.213a90f6.iframe.bundle.js +2 -0
- package/storybook-static/Presentation-ui-components-MessageInput-MessageInput-stories.be8aa2d9.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-SettingsItem-SettingsItem-stories.e7f5a274.iframe.bundle.js +2 -0
- package/storybook-static/Presentation-ui-components-TextField-TextField-stories.969cfe2e.iframe.bundle.js +2 -0
- package/storybook-static/Presentation-ui-components-Toast-Toast-stories.4f00432b.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-UserListItem-UserListItem-stories.1713eab7.iframe.bundle.js +2 -0
- package/storybook-static/iframe.html +2 -2
- package/storybook-static/project.json +1 -1
- package/storybook-static/{runtime~main.5a7ba727.iframe.bundle.js → runtime~main.17766d00.iframe.bundle.js} +1 -1
- package/storybook-static/sb-manager/globals-runtime.js +1 -1
- package/storybook-static/735.82f96f8a.iframe.bundle.js +0 -2
- package/storybook-static/Presentation-ui-components-Avatar-avatar-stories.b363e9a1.iframe.bundle.js +0 -2
- package/storybook-static/Presentation-ui-components-Badge-Badge-stories.85dd97b0.iframe.bundle.js +0 -2
- package/storybook-static/Presentation-ui-components-Button-Button-stories.1e4ae2b4.iframe.bundle.js +0 -2
- package/storybook-static/Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.4e25a94d.iframe.bundle.js +0 -2
- package/storybook-static/Presentation-ui-components-DialogWindow-DialogWindow-stories.e22e8be5.iframe.bundle.js +0 -2
- package/storybook-static/Presentation-ui-components-Dropdown-Dropdown-stories.8321872b.iframe.bundle.js +0 -2
- package/storybook-static/Presentation-ui-components-Header-Header-stories.1cff200a.iframe.bundle.js +0 -2
- package/storybook-static/Presentation-ui-components-Loader-Loader-stories.7391dde4.iframe.bundle.js +0 -2
- package/storybook-static/Presentation-ui-components-Message-Message-stories.49f0dbbf.iframe.bundle.js +0 -2
- package/storybook-static/Presentation-ui-components-MessageInput-MessageInput-stories.4aa88de3.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-SettingsItem-SettingsItem-stories.d74853ab.iframe.bundle.js +0 -2
- package/storybook-static/Presentation-ui-components-TextField-TextField-stories.19812f7d.iframe.bundle.js +0 -2
- package/storybook-static/Presentation-ui-components-Toast-Toast-stories.5e19f10e.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-UserListItem-UserListItem-stories.d2f60e13.iframe.bundle.js +0 -2
- /package/storybook-static/{217.3c66ff1e.iframe.bundle.js.LICENSE.txt → 217.07d5c7a3.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{735.82f96f8a.iframe.bundle.js.LICENSE.txt → 735.6ee62079.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{844.6041e1a5.iframe.bundle.js.LICENSE.txt → 844.e8bfd664.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{961.c94da456.iframe.bundle.js.LICENSE.txt → 961.d47fc2bc.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{Presentation-ui-components-Avatar-avatar-stories.b363e9a1.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-Avatar-avatar-stories.a5ba7608.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{Presentation-ui-components-Badge-Badge-stories.85dd97b0.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-Badge-Badge-stories.c8824861.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{Presentation-ui-components-Button-Button-stories.1e4ae2b4.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-Button-Button-stories.fa2aa72c.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.4e25a94d.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.b6998344.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{Presentation-ui-components-DialogWindow-DialogWindow-stories.e22e8be5.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-DialogWindow-DialogWindow-stories.a724643f.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{Presentation-ui-components-Dropdown-Dropdown-stories.8321872b.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-Dropdown-Dropdown-stories.a03feb06.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{Presentation-ui-components-Header-Header-stories.1cff200a.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-Header-Header-stories.978f0af5.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{Presentation-ui-components-Loader-Loader-stories.7391dde4.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-Loader-Loader-stories.4e80520d.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{Presentation-ui-components-Message-Message-stories.49f0dbbf.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-Message-Message-stories.213a90f6.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{Presentation-ui-components-SettingsItem-SettingsItem-stories.d74853ab.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-SettingsItem-SettingsItem-stories.e7f5a274.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{Presentation-ui-components-TextField-TextField-stories.19812f7d.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-TextField-TextField-stories.969cfe2e.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{Presentation-ui-components-UserListItem-UserListItem-stories.d2f60e13.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-UserListItem-UserListItem-stories.1713eab7.iframe.bundle.js.LICENSE.txt} +0 -0
package/global.d.ts
CHANGED
|
@@ -1,204 +1,5 @@
|
|
|
1
|
-
// interface Tone {
|
|
2
|
-
// name: string;
|
|
3
|
-
// description: string;
|
|
4
|
-
// iconEmoji: string;
|
|
5
|
-
// }
|
|
6
|
-
//
|
|
7
|
-
// type Primitive = string | number | boolean | undefined | null | Date | File;
|
|
8
|
-
|
|
9
|
-
// type SetTails<T, R extends Primitive> = T extends Array<unknown>
|
|
10
|
-
// ? Array<T[number] extends Primitive ? R : SetTails<T[number], R>>
|
|
11
|
-
// : {
|
|
12
|
-
// [K in keyof T]: T[K] extends Primitive ? R : SetTails<T[K], R>;
|
|
13
|
-
// };
|
|
14
|
-
|
|
15
|
-
// type ProxyConfig = {
|
|
16
|
-
// api: string;
|
|
17
|
-
// servername: string;
|
|
18
|
-
// port: string;
|
|
19
|
-
// };
|
|
20
|
-
// interface WidgetConfig {
|
|
21
|
-
// apiKey: string;
|
|
22
|
-
// useDefault: boolean;
|
|
23
|
-
// maxTokens: number;
|
|
24
|
-
// proxyConfig: ProxyConfig;
|
|
25
|
-
// }
|
|
26
|
-
//
|
|
27
|
-
// interface AITranslateWidgetConfig extends WidgetConfig {
|
|
28
|
-
// defaultLanguage: string;
|
|
29
|
-
// languages: string[];
|
|
30
|
-
// }
|
|
31
|
-
//
|
|
32
|
-
// interface AIRephraseWidgetConfig extends WidgetConfig {
|
|
33
|
-
// defaultTone: string;
|
|
34
|
-
// Tones: Tone[];
|
|
35
|
-
// }
|
|
36
|
-
|
|
37
|
-
// interface QBConfig {
|
|
38
|
-
// credentials: {
|
|
39
|
-
// appId: number;
|
|
40
|
-
// accountKey: string;
|
|
41
|
-
// authKey: string;
|
|
42
|
-
// authSecret: string;
|
|
43
|
-
// sessionToken: string; // ??? ui-kit
|
|
44
|
-
// };
|
|
45
|
-
// configAIApi: {
|
|
46
|
-
// // ui-kit
|
|
47
|
-
// AIAnswerAssistWidgetConfig: WidgetConfig;
|
|
48
|
-
// AITranslateWidgetConfig: AITranslateWidgetConfig;
|
|
49
|
-
// AIRephraseWidgetConfig: AIRephraseWidgetConfig;
|
|
50
|
-
// };
|
|
51
|
-
// appConfig: {
|
|
52
|
-
// maxFileSize: number; // ui-kit
|
|
53
|
-
// sessionTimeOut: number; // ?? webRTc -> ui-kit
|
|
54
|
-
// chatProtocol: {
|
|
55
|
-
// active: number;
|
|
56
|
-
// };
|
|
57
|
-
// debug: boolean;
|
|
58
|
-
// enableForwarding: boolean; // ui-kit
|
|
59
|
-
// enableReplying: boolean; // ui-kit
|
|
60
|
-
// regexUserName?: string; // ui-kit
|
|
61
|
-
// endpoints: {
|
|
62
|
-
// api: string;
|
|
63
|
-
// chat: string;
|
|
64
|
-
// };
|
|
65
|
-
// // on: {
|
|
66
|
-
// // sessionExpired: (handleResponse: any, retry: any) => Promise<void>;
|
|
67
|
-
// // };
|
|
68
|
-
// streamManagement: {
|
|
69
|
-
// enable: boolean;
|
|
70
|
-
// };
|
|
71
|
-
// };
|
|
72
|
-
// }
|
|
73
|
-
|
|
74
|
-
/*
|
|
75
|
-
* QuickBlox Types - start
|
|
76
|
-
|
|
77
|
-
*/
|
|
78
|
-
|
|
79
1
|
type Dictionary<T> = Record<string, T>;
|
|
80
|
-
//
|
|
81
|
-
// type RequiredProps<T, K extends keyof T> = T & Required<Pick<T, K>>;
|
|
82
|
-
|
|
83
|
-
// declare enum QBChatProtocol {
|
|
84
|
-
// BOSH = 1,
|
|
85
|
-
// WebSockets = 2,
|
|
86
|
-
// }
|
|
87
|
-
//
|
|
88
|
-
// interface ICEServer {
|
|
89
|
-
// urls: string;
|
|
90
|
-
// username: string;
|
|
91
|
-
// credential: string;
|
|
92
|
-
// }
|
|
93
|
-
|
|
94
|
-
// declare enum QBChatDialogType {
|
|
95
|
-
// PUBLIC_GROUP = 1,
|
|
96
|
-
// GROUP = 2,
|
|
97
|
-
// PRIVATE = 3,
|
|
98
|
-
// }
|
|
99
|
-
|
|
100
|
-
// declare interface QBChatDialog {
|
|
101
|
-
// /** ID of the dialog. Generated automatically by the server after dialog creation. */
|
|
102
|
-
// _id: string;
|
|
103
|
-
// /** ID of dialog's owner. */
|
|
104
|
-
// user_id: QBUser['id'];
|
|
105
|
-
// /** Date & time when a record was created, filled automatically. */
|
|
106
|
-
// created_at: string;
|
|
107
|
-
// /** Date & time when a record was created, filled automatically. */
|
|
108
|
-
// updated_at: string;
|
|
109
|
-
// /**
|
|
110
|
-
// * Type of dialog. Possible values are:
|
|
111
|
-
// * - type=1 (`PUBLIC_GROUP`)
|
|
112
|
-
// * - type=2 (`GROUP`)
|
|
113
|
-
// * - type=3 (`PRIVATE`)
|
|
114
|
-
// */
|
|
115
|
-
// type: QBChatDialogType;
|
|
116
|
-
// /**
|
|
117
|
-
// * Name of a group chat. Makes sense if type=1 (`PUBLIC_GROUP`) or type=2 (`GROUP`).
|
|
118
|
-
// * The maximum length for the dialog name is 200 symbols.
|
|
119
|
-
// */
|
|
120
|
-
// name: string;
|
|
121
|
-
// /**
|
|
122
|
-
// * Photo of a group chat. Makes sense if type=1 (`PUBLIC_GROUP`) or type=2 (`GROUP`).
|
|
123
|
-
// * Can contain a link to a file in Content module, Custom Objects module or just a web link.
|
|
124
|
-
// */
|
|
125
|
-
// photo: null | string;
|
|
126
|
-
// /**
|
|
127
|
-
// * JID of XMPP room for group chat to connect. Nil if type=3 (PRIVATE).
|
|
128
|
-
// * Generated automatically by the server after dialog creation.
|
|
129
|
-
// */
|
|
130
|
-
// xmpp_room_jid: string | null;
|
|
131
|
-
// /** Array of users' IDs - dialog occupants. Does not make sense if type=1 (PUBLIC_GROUP). */
|
|
132
|
-
// occupants_ids: number[];
|
|
133
|
-
// /** Last sent message in this dialog. */
|
|
134
|
-
// last_message: string | null;
|
|
135
|
-
// /** Timestamp of last sent message in this dialog. */
|
|
136
|
-
// last_message_date_sent: number | null | string; // todo: switch type to number
|
|
137
|
-
// /** ID of the user who sent last message in this dialog. */
|
|
138
|
-
// last_message_user_id: QBUser['id'] | null;
|
|
139
|
-
// /** ID of last message in this dialog. */
|
|
140
|
-
// last_message_id: string | null;
|
|
141
|
-
// /** Number of unread messages in this dialog for a current user. */
|
|
142
|
-
// unread_messages_count: number | null;
|
|
143
|
-
// /**
|
|
144
|
-
// * - Information about class and fields in Custom Objects.
|
|
145
|
-
// * - Any dialog can be extended using Custom Objects to store additional parameters.
|
|
146
|
-
// */
|
|
147
|
-
// data?: {
|
|
148
|
-
// /** Class name in Custom Objects. */
|
|
149
|
-
// class_name: string;
|
|
150
|
-
// /** Field name of class in Custom Objects. Can be many: 1..N. */
|
|
151
|
-
// [field_name_N: string]: QBCustomField;
|
|
152
|
-
// };
|
|
153
|
-
// new_occupants_ids?: number[]; // TODO: EXTENDS TYPE AND SWITCH TO THIS NEW TYPE
|
|
154
|
-
// joined?: boolean; // TODO: EXTENDS TYPE AND SWITCH TO THIS NEW TYPE
|
|
155
|
-
// }
|
|
156
|
-
|
|
157
|
-
// declare interface QBChatNewMessage {
|
|
158
|
-
// type: 'chat' | 'groupchat';
|
|
159
|
-
// body: string;
|
|
160
|
-
// notification_type?: string; // TODO: NED ADD TO TYPE
|
|
161
|
-
// dialog_id: QBChatDialog['_id']; // TODO: NED ADD TO TYPE
|
|
162
|
-
// extension: {
|
|
163
|
-
// attachments?: ChatMessageAttachment[];
|
|
164
|
-
// save_to_history: 0 | 1;
|
|
165
|
-
// dialog_id: QBChatDialog['_id'];
|
|
166
|
-
// notification_type?: string; // TODO: NED ADD TO TYPE
|
|
167
|
-
// sender_id?: QBUser['id']; // TODO: NED ADD TO TYPE
|
|
168
|
-
// qb_message_action?: 'forward' | 'reply'; // TODO: NED ADD TO TYPE
|
|
169
|
-
// origin_sender_name?: string; // TODO: NED ADD TO TYPE
|
|
170
|
-
// qb_original_messages?: string; // TODO: NED ADD TO TYPE
|
|
171
|
-
// };
|
|
172
|
-
// markable: 0 | 1;
|
|
173
|
-
// }
|
|
174
2
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
// /** Connect to the chat by user id */
|
|
179
|
-
// userId: QBUser['id'];
|
|
180
|
-
// /** The user's password or session token */
|
|
181
|
-
// password: string;
|
|
182
|
-
// }
|
|
183
|
-
// | {
|
|
184
|
-
// /** Connect to the chat by user jid */
|
|
185
|
-
// jid: string;
|
|
186
|
-
// /** The user's password or session token */
|
|
187
|
-
// password: string;
|
|
188
|
-
// }
|
|
189
|
-
// | {
|
|
190
|
-
// /** Connect to the chat by user's email */
|
|
191
|
-
// email: string;
|
|
192
|
-
// /** The user's password or session token */
|
|
193
|
-
// password: string;
|
|
194
|
-
// };
|
|
195
|
-
//
|
|
196
|
-
// type QBCustomField =
|
|
197
|
-
// | string
|
|
198
|
-
// | string[]
|
|
199
|
-
// | number
|
|
200
|
-
// | number[]
|
|
201
|
-
// | boolean
|
|
202
|
-
// | boolean[]
|
|
203
|
-
// | null
|
|
204
|
-
// | undefined;
|
|
3
|
+
interface Window {
|
|
4
|
+
webkitAudioContext: typeof AudioContext;
|
|
5
|
+
}
|
package/package.json
CHANGED
package/src/App.scss
CHANGED
package/src/App.tsx
CHANGED
|
@@ -15,6 +15,9 @@ import QuickBloxUIKitDesktopLayout from './Presentation/layouts/Desktop/QuickBlo
|
|
|
15
15
|
import DefaultTheme from './Presentation/themes/DefaultThemes/DefaultTheme';
|
|
16
16
|
import useQbUIKitDataContext from './Presentation/providers/QuickBloxUIKitProvider/useQbUIKitDataContext';
|
|
17
17
|
import { QBConfig } from './QBconfig';
|
|
18
|
+
import MainButton, {
|
|
19
|
+
TypeButton,
|
|
20
|
+
} from './Presentation/components/UI/Buttons/MainButton/MainButton';
|
|
18
21
|
|
|
19
22
|
function App() {
|
|
20
23
|
if ((window as any).QB === undefined) {
|
|
@@ -178,6 +181,11 @@ function App() {
|
|
|
178
181
|
data,
|
|
179
182
|
);
|
|
180
183
|
await prepareContent().catch();
|
|
184
|
+
currentContext.setSubscribeOnSessionExpiredListener(() => {
|
|
185
|
+
console.timeLog('call OnSessionExpiredListener ... start');
|
|
186
|
+
// logoutHandler();
|
|
187
|
+
console.log('OnSessionExpiredListener ... end');
|
|
188
|
+
});
|
|
181
189
|
navigate('/desktop-test-mock');
|
|
182
190
|
}
|
|
183
191
|
}
|
|
@@ -201,40 +209,57 @@ function App() {
|
|
|
201
209
|
// });
|
|
202
210
|
|
|
203
211
|
return (
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
{
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
element={
|
|
221
|
-
<div>
|
|
222
|
-
<div style={{ height: '56px' }}>Q-communicate</div>
|
|
223
|
-
<QuickBloxUIKitDesktopLayout
|
|
224
|
-
theme={new DefaultTheme()}
|
|
225
|
-
uikitHeightOffset="56px"
|
|
226
|
-
// AIAssist={{
|
|
227
|
-
// enabled: true,
|
|
228
|
-
// default: true,
|
|
229
|
-
// AIWidget: defaultAIAnswer,
|
|
230
|
-
// }}
|
|
231
|
-
/>
|
|
232
|
-
</div>
|
|
233
|
-
}
|
|
234
|
-
/>
|
|
235
|
-
</Routes>
|
|
212
|
+
<>
|
|
213
|
+
<div className="btn-group">
|
|
214
|
+
<MainButton
|
|
215
|
+
typeButton={TypeButton.outlined}
|
|
216
|
+
title="Light Theme"
|
|
217
|
+
clickHandler={() => {
|
|
218
|
+
document.documentElement.setAttribute('data-theme', 'light');
|
|
219
|
+
}}
|
|
220
|
+
/>
|
|
221
|
+
<MainButton
|
|
222
|
+
typeButton={TypeButton.defaultDisabled}
|
|
223
|
+
title="Dark Theme"
|
|
224
|
+
clickHandler={() => {
|
|
225
|
+
document.documentElement.setAttribute('data-theme', 'dark');
|
|
226
|
+
}}
|
|
227
|
+
/>
|
|
236
228
|
</div>
|
|
237
|
-
|
|
229
|
+
<QuickBloxUIKitProvider
|
|
230
|
+
maxFileSize={QBConfig.appConfig.maxFileSize}
|
|
231
|
+
// SDK={QB} //init SDK
|
|
232
|
+
accountData={{ ...QBConfig.credentials, sessionToken: '' }}
|
|
233
|
+
qbConfig={{ ...QBConfig }}
|
|
234
|
+
loginData={{
|
|
235
|
+
login: currentUser.login,
|
|
236
|
+
password: currentUser.password,
|
|
237
|
+
}}
|
|
238
|
+
>
|
|
239
|
+
<div className="App">
|
|
240
|
+
<Routes>
|
|
241
|
+
{/* eslint-disable-next-line @typescript-eslint/no-misused-promises */}
|
|
242
|
+
<Route path="/" element={<Login loginHandler={loginHandler} />} />
|
|
243
|
+
<Route
|
|
244
|
+
path="/desktop-test-mock"
|
|
245
|
+
element={
|
|
246
|
+
<div>
|
|
247
|
+
<QuickBloxUIKitDesktopLayout
|
|
248
|
+
theme={new DefaultTheme()}
|
|
249
|
+
uikitHeightOffset="56px"
|
|
250
|
+
// AIAssist={{
|
|
251
|
+
// enabled: true,
|
|
252
|
+
// default: true,
|
|
253
|
+
// AIWidget: defaultAIAnswer,
|
|
254
|
+
// }}
|
|
255
|
+
/>
|
|
256
|
+
</div>
|
|
257
|
+
}
|
|
258
|
+
/>
|
|
259
|
+
</Routes>
|
|
260
|
+
</div>
|
|
261
|
+
</QuickBloxUIKitProvider>
|
|
262
|
+
</>
|
|
238
263
|
);
|
|
239
264
|
}
|
|
240
265
|
|
|
@@ -85,10 +85,23 @@ export interface QBUIKitConfig extends QBConfig {
|
|
|
85
85
|
chatProtocol: {
|
|
86
86
|
active: number;
|
|
87
87
|
};
|
|
88
|
+
pingLocalhostTimeInterval: number;
|
|
89
|
+
chatReconnectionTimeInterval: number;
|
|
88
90
|
debug: boolean;
|
|
89
91
|
enableForwarding: boolean;
|
|
90
92
|
enableReplying: boolean;
|
|
91
93
|
regexUserName?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Whether public dialogs should be shown in the dialogs list.
|
|
96
|
+
* Defaults to false if not provided.
|
|
97
|
+
*/
|
|
98
|
+
showPublicDialogsInList?: boolean;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Whether creating public dialogs is allowed.
|
|
102
|
+
* Defaults to false if not provided.
|
|
103
|
+
*/
|
|
104
|
+
allowPublicDialogCreation?: boolean;
|
|
92
105
|
endpoints: {
|
|
93
106
|
api: string;
|
|
94
107
|
chat: string;
|
|
@@ -260,10 +260,14 @@ export class DefaultConfigurations {
|
|
|
260
260
|
chatProtocol: {
|
|
261
261
|
active: 2,
|
|
262
262
|
},
|
|
263
|
+
pingLocalhostTimeInterval: 0,
|
|
264
|
+
chatReconnectionTimeInterval: 3,
|
|
263
265
|
debug: true,
|
|
264
266
|
enableForwarding: true,
|
|
265
267
|
enableReplying: true,
|
|
266
268
|
regexUserName: '', // '/^(?=[a-zA-Z])[-a-zA-Z_ ]{3,49}(?<! )$/',
|
|
269
|
+
showPublicDialogsInList: false,
|
|
270
|
+
allowPublicDialogCreation: false,
|
|
267
271
|
endpoints: {
|
|
268
272
|
api: 'api.quickblox.com',
|
|
269
273
|
chat: 'chat.quickblox.com',
|