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.
Files changed (177) hide show
  1. package/dist/CommonTypes/CommonTypes.d.ts +12 -0
  2. package/dist/Data/source/remote/RemoteDataSource.d.ts +5 -0
  3. package/dist/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogListItem/DialogListItem.d.ts +1 -1
  4. package/dist/Presentation/Views/Flow/CreateDialog/CreateDialog.d.ts +1 -0
  5. package/dist/Presentation/ui-components/DialogItemPreview/DialogItemPreview.d.ts +3 -3
  6. package/dist/Presentation/ui-components/Header/Header.d.ts +1 -1
  7. package/dist/index-ui.d.ts +47 -3
  8. package/dist/index-ui.js +25470 -17586
  9. package/dist/index-ui.js.map +1 -1
  10. package/global.d.ts +3 -202
  11. package/package.json +1 -1
  12. package/src/App.scss +5 -0
  13. package/src/App.tsx +58 -33
  14. package/src/CommonTypes/CommonTypes.ts +13 -0
  15. package/src/Data/DefaultConfigurations.ts +4 -0
  16. package/src/Data/source/remote/RemoteDataSource.ts +210 -148
  17. package/src/Domain/use_cases/CreateDialogUseCase.ts +0 -1
  18. package/src/Domain/use_cases/ForwardMessagesUseCase.ts +0 -1
  19. package/src/Domain/use_cases/GetAllDialogsUseCase.ts +0 -1
  20. package/src/Domain/use_cases/GetAllDialogsUseCaseWithMock.ts +0 -2
  21. package/src/Domain/use_cases/GetAllMessagesForDialog.ts +0 -1
  22. package/src/Domain/use_cases/GetAllUsersUseCase.ts +0 -1
  23. package/src/Domain/use_cases/GetDialogByIdUseCase.ts +0 -2
  24. package/src/Domain/use_cases/GetUsersByIdsUseCase.ts +0 -1
  25. package/src/Domain/use_cases/LeaveDialogUseCase.ts +0 -1
  26. package/src/Domain/use_cases/RemoveUsersFromTheDialogUseCase.ts +0 -1
  27. package/src/Domain/use_cases/ReplyMessagesUseCase.ts +0 -2
  28. package/src/Domain/use_cases/SendTextMessageUseCase.ts +0 -3
  29. package/src/Domain/use_cases/SubscribeToDialogEventsUseCase.ts +0 -26
  30. package/src/Domain/use_cases/SubscribeToDialogsUpdatesUseCase.ts +0 -1
  31. package/src/Domain/use_cases/SyncDialogsUseCase.ts +1 -2
  32. package/src/Domain/use_cases/UpdateCurrentDialogInDataSourceUseCase.ts +0 -2
  33. package/src/Domain/use_cases/UpdateDialogUseCase.ts +0 -2
  34. package/src/Domain/use_cases/UploadFileUseCase.ts +0 -2
  35. package/src/Domain/use_cases/UserTypingMessageUseCase.ts +0 -2
  36. package/src/Domain/use_cases/ai/AIAnswerAssistUseCase.ts +0 -2
  37. package/src/Domain/use_cases/ai/AIAnswerAssistWithProxyUseCase.ts +0 -3
  38. package/src/Domain/use_cases/ai/AIAnswerAssistWithSDKUseCase.ts +0 -2
  39. package/src/Domain/use_cases/ai/AIRephraseUseCase.ts +0 -3
  40. package/src/Domain/use_cases/ai/AIRephraseWithProxyUseCase.ts +0 -3
  41. package/src/Domain/use_cases/ai/AITranslateUseCase.ts +0 -2
  42. package/src/Domain/use_cases/ai/AITranslateWithProxyUseCase.ts +0 -3
  43. package/src/Domain/use_cases/ai/AITranslateWithSDKUseCase.ts +0 -3
  44. package/src/Domain/use_cases/base/Subscribable/SubscriptionPerformer.ts +0 -1
  45. package/src/Presentation/Views/Dialog/AIWidgets/AIRephraseWidget/AIRephraseWidget.tsx +1 -1
  46. package/src/Presentation/Views/Dialog/AIWidgets/AIWidgetActions/AIWidgetActions.scss +12 -6
  47. package/src/Presentation/Views/Dialog/AIWidgets/AIWidgetActions/AIWidgetActions.tsx +4 -2
  48. package/src/Presentation/Views/Dialog/Dialog.scss +7 -1
  49. package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogListItem/DialogListItem.scss +17 -29
  50. package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogListItem/DialogListItem.tsx +8 -13
  51. package/src/Presentation/Views/Dialog/ForwardMessageFlow/ForwardMessageFlow.scss +9 -9
  52. package/src/Presentation/Views/Dialog/ForwardMessageFlow/InputForForwarding/InputForForwarding.scss +11 -0
  53. package/src/Presentation/Views/Dialog/MessageContextMenu/MessageContextMenu.tsx +3 -2
  54. package/src/Presentation/Views/Dialog/useDialogViewModel.ts +10 -21
  55. package/src/Presentation/Views/DialogInfo/DialogInfo.scss +19 -25
  56. package/src/Presentation/Views/DialogInfo/DialogInfo.tsx +2 -2
  57. package/src/Presentation/Views/DialogInfo/DialogMemberButton/DialogMembersButton.scss +0 -17
  58. package/src/Presentation/Views/DialogInfo/MembersList/MembersList.scss +9 -1
  59. package/src/Presentation/Views/DialogInfo/UsersList/SingleUser/SingleUser.scss +0 -1
  60. package/src/Presentation/Views/DialogInfo/UsersList/useUsersListViewModel.ts +2 -4
  61. package/src/Presentation/Views/DialogList/useDialogListViewModel.ts +0 -1
  62. package/src/Presentation/Views/EditDialog/EditDialog.scss +1 -38
  63. package/src/Presentation/Views/Flow/CreateDialog/CreateDialog.scss +17 -42
  64. package/src/Presentation/Views/Flow/CreateDialog/CreateDialog.tsx +45 -39
  65. package/src/Presentation/Views/Flow/CreateDialogFlow/CreateNewDialogFlow.tsx +6 -2
  66. package/src/Presentation/Views/InviteMembers/InviteMembers.scss +4 -33
  67. package/src/Presentation/Views/InviteMembers/InviteMembers.tsx +23 -4
  68. package/src/Presentation/Views/PreviewDialog/PreviewDialog.scss +8 -0
  69. package/src/Presentation/Views/PreviewDialog/PreviewDialog.tsx +8 -5
  70. package/src/Presentation/components/UI/Buttons/MainButton/MainButton.css +5 -10
  71. package/src/Presentation/components/UI/Placeholders/ErrorComponent/ErrorComponent.scss +0 -5
  72. package/src/Presentation/components/containers/ColumnContainer/ColumnContainer.scss +1 -10
  73. package/src/Presentation/layouts/TestStage/LoginView/Login.scss +6 -3
  74. package/src/Presentation/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider.tsx +1 -33
  75. package/src/Presentation/themes/styles/_theme_colors_scheme.scss +1 -1
  76. package/src/Presentation/themes/styles/_theme_dark.scss +5 -4
  77. package/src/Presentation/themes/styles/_theme_light.scss +3 -2
  78. package/src/Presentation/ui-components/Avatar/Avatar.scss +8 -5
  79. package/src/Presentation/ui-components/Avatar/Avatar.tsx +2 -1
  80. package/src/Presentation/ui-components/Badge/Badge.tsx +1 -0
  81. package/src/Presentation/ui-components/Button/Button.scss +5 -6
  82. package/src/Presentation/ui-components/Button/Button.tsx +7 -2
  83. package/src/Presentation/ui-components/CheckBox/CheckBox.scss +23 -0
  84. package/src/Presentation/ui-components/CheckBox/CheckBox.tsx +19 -7
  85. package/src/Presentation/ui-components/DialogBanner/DialogBanner.tsx +1 -0
  86. package/src/Presentation/ui-components/DialogItemPreview/DialogItemPreview.scss +3 -3
  87. package/src/Presentation/ui-components/DialogItemPreview/DialogItemPreview.tsx +3 -3
  88. package/src/Presentation/ui-components/DialogWindow/DialogWindow.scss +7 -4
  89. package/src/Presentation/ui-components/DialogWindow/DialogWindow.tsx +1 -1
  90. package/src/Presentation/ui-components/Dropdown/Dropdown.tsx +1 -1
  91. package/src/Presentation/ui-components/Dropdown/DropdownOption.tsx +2 -1
  92. package/src/Presentation/ui-components/Header/Header.scss +9 -2
  93. package/src/Presentation/ui-components/Header/Header.tsx +1 -1
  94. package/src/Presentation/ui-components/Loader/Loader.tsx +1 -0
  95. package/src/Presentation/ui-components/Message/Bubble/AudioBubble/AudioBubble.scss +1 -0
  96. package/src/Presentation/ui-components/Message/Bubble/FileBubble/FileBubble.tsx +1 -0
  97. package/src/Presentation/ui-components/Message/Bubble/ImageBubble/ImageBubble.tsx +1 -0
  98. package/src/Presentation/ui-components/Message/Bubble/TextBubble/TextBubble.scss +13 -3
  99. package/src/Presentation/ui-components/Message/Bubble/TextBubble/TextBubble.tsx +1 -0
  100. package/src/Presentation/ui-components/Message/Bubble/VideoBubble/VideoBubble.tsx +1 -0
  101. package/src/Presentation/ui-components/Message/FileUrl/FileUrl.scss +0 -3
  102. package/src/Presentation/ui-components/Message/FileUrl/FileUrl.tsx +1 -0
  103. package/src/Presentation/ui-components/Message/Message.scss +5 -1
  104. package/src/Presentation/ui-components/MessageInput/MessageInput.scss +5 -1
  105. package/src/Presentation/ui-components/MessageInput/MessageInput.tsx +1 -1
  106. package/src/Presentation/ui-components/MessageInput/VoiceRecordingProgress/VoiceRecordingProgress.tsx +1 -1
  107. package/src/Presentation/ui-components/MessageSeparator/MessageSeparator.scss +13 -13
  108. package/src/Presentation/ui-components/Placeholder/Placeholder.scss +5 -0
  109. package/src/Presentation/ui-components/Placeholder/Placeholder.tsx +1 -1
  110. package/src/Presentation/ui-components/PreviewFileMessage/PreviewFileMessage.scss +4 -1
  111. package/src/Presentation/ui-components/PreviewFileMessage/PreviewFileMessage.tsx +1 -0
  112. package/src/Presentation/ui-components/SettingsItem/SettingsItem.scss +5 -1
  113. package/src/Presentation/ui-components/SettingsItem/SettingsItem.tsx +1 -1
  114. package/src/Presentation/ui-components/TextField/TextField.scss +5 -3
  115. package/src/Presentation/ui-components/Toast/Toast.scss +3 -3
  116. package/src/Presentation/ui-components/Toast/ToastProvider.tsx +2 -2
  117. package/src/Presentation/ui-components/UserListItem/UserListItem.scss +11 -3
  118. package/src/Presentation/ui-components/UserListItem/UserListItem.tsx +1 -0
  119. package/src/QBconfig.ts +2 -0
  120. package/src/hooks/useQuickBloxUIKit.ts +101 -18
  121. package/src/index-ui.ts +111 -18
  122. package/src/qb-api-calls/index.ts +52 -3
  123. package/storybook-static/{217.3c66ff1e.iframe.bundle.js → 217.07d5c7a3.iframe.bundle.js} +3 -3
  124. package/storybook-static/{217.3c66ff1e.iframe.bundle.js.map → 217.07d5c7a3.iframe.bundle.js.map} +1 -1
  125. package/storybook-static/735.6ee62079.iframe.bundle.js +2 -0
  126. package/storybook-static/{844.6041e1a5.iframe.bundle.js → 844.e8bfd664.iframe.bundle.js} +3 -3
  127. package/storybook-static/{844.6041e1a5.iframe.bundle.js.map → 844.e8bfd664.iframe.bundle.js.map} +1 -1
  128. package/storybook-static/{961.c94da456.iframe.bundle.js → 961.d47fc2bc.iframe.bundle.js} +2 -2
  129. package/storybook-static/Presentation-ui-components-Avatar-avatar-stories.a5ba7608.iframe.bundle.js +2 -0
  130. package/storybook-static/Presentation-ui-components-Badge-Badge-stories.c8824861.iframe.bundle.js +2 -0
  131. package/storybook-static/Presentation-ui-components-Button-Button-stories.fa2aa72c.iframe.bundle.js +2 -0
  132. package/storybook-static/Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.b6998344.iframe.bundle.js +2 -0
  133. package/storybook-static/Presentation-ui-components-DialogWindow-DialogWindow-stories.a724643f.iframe.bundle.js +2 -0
  134. package/storybook-static/Presentation-ui-components-Dropdown-Dropdown-stories.a03feb06.iframe.bundle.js +2 -0
  135. package/storybook-static/Presentation-ui-components-Header-Header-stories.978f0af5.iframe.bundle.js +2 -0
  136. package/storybook-static/Presentation-ui-components-Loader-Loader-stories.4e80520d.iframe.bundle.js +2 -0
  137. package/storybook-static/Presentation-ui-components-Message-Message-stories.213a90f6.iframe.bundle.js +2 -0
  138. package/storybook-static/Presentation-ui-components-MessageInput-MessageInput-stories.be8aa2d9.iframe.bundle.js +1 -0
  139. package/storybook-static/Presentation-ui-components-SettingsItem-SettingsItem-stories.e7f5a274.iframe.bundle.js +2 -0
  140. package/storybook-static/Presentation-ui-components-TextField-TextField-stories.969cfe2e.iframe.bundle.js +2 -0
  141. package/storybook-static/Presentation-ui-components-Toast-Toast-stories.4f00432b.iframe.bundle.js +1 -0
  142. package/storybook-static/Presentation-ui-components-UserListItem-UserListItem-stories.1713eab7.iframe.bundle.js +2 -0
  143. package/storybook-static/iframe.html +2 -2
  144. package/storybook-static/project.json +1 -1
  145. package/storybook-static/{runtime~main.5a7ba727.iframe.bundle.js → runtime~main.17766d00.iframe.bundle.js} +1 -1
  146. package/storybook-static/sb-manager/globals-runtime.js +1 -1
  147. package/storybook-static/735.82f96f8a.iframe.bundle.js +0 -2
  148. package/storybook-static/Presentation-ui-components-Avatar-avatar-stories.b363e9a1.iframe.bundle.js +0 -2
  149. package/storybook-static/Presentation-ui-components-Badge-Badge-stories.85dd97b0.iframe.bundle.js +0 -2
  150. package/storybook-static/Presentation-ui-components-Button-Button-stories.1e4ae2b4.iframe.bundle.js +0 -2
  151. package/storybook-static/Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.4e25a94d.iframe.bundle.js +0 -2
  152. package/storybook-static/Presentation-ui-components-DialogWindow-DialogWindow-stories.e22e8be5.iframe.bundle.js +0 -2
  153. package/storybook-static/Presentation-ui-components-Dropdown-Dropdown-stories.8321872b.iframe.bundle.js +0 -2
  154. package/storybook-static/Presentation-ui-components-Header-Header-stories.1cff200a.iframe.bundle.js +0 -2
  155. package/storybook-static/Presentation-ui-components-Loader-Loader-stories.7391dde4.iframe.bundle.js +0 -2
  156. package/storybook-static/Presentation-ui-components-Message-Message-stories.49f0dbbf.iframe.bundle.js +0 -2
  157. package/storybook-static/Presentation-ui-components-MessageInput-MessageInput-stories.4aa88de3.iframe.bundle.js +0 -1
  158. package/storybook-static/Presentation-ui-components-SettingsItem-SettingsItem-stories.d74853ab.iframe.bundle.js +0 -2
  159. package/storybook-static/Presentation-ui-components-TextField-TextField-stories.19812f7d.iframe.bundle.js +0 -2
  160. package/storybook-static/Presentation-ui-components-Toast-Toast-stories.5e19f10e.iframe.bundle.js +0 -1
  161. package/storybook-static/Presentation-ui-components-UserListItem-UserListItem-stories.d2f60e13.iframe.bundle.js +0 -2
  162. /package/storybook-static/{217.3c66ff1e.iframe.bundle.js.LICENSE.txt → 217.07d5c7a3.iframe.bundle.js.LICENSE.txt} +0 -0
  163. /package/storybook-static/{735.82f96f8a.iframe.bundle.js.LICENSE.txt → 735.6ee62079.iframe.bundle.js.LICENSE.txt} +0 -0
  164. /package/storybook-static/{844.6041e1a5.iframe.bundle.js.LICENSE.txt → 844.e8bfd664.iframe.bundle.js.LICENSE.txt} +0 -0
  165. /package/storybook-static/{961.c94da456.iframe.bundle.js.LICENSE.txt → 961.d47fc2bc.iframe.bundle.js.LICENSE.txt} +0 -0
  166. /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
  167. /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
  168. /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
  169. /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
  170. /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
  171. /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
  172. /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
  173. /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
  174. /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
  175. /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
  176. /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
  177. /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
- // TODO: add export to SDK
176
- // type ChatConnectParams =
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quickblox-react-ui-kit",
3
- "version": "0.4.6-beta.4",
3
+ "version": "0.4.7",
4
4
  "main": "dist/index-ui.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
package/src/App.scss CHANGED
@@ -1,3 +1,8 @@
1
1
  body {
2
2
  font-family: 'Roboto';
3
3
  }
4
+
5
+ .btn-group {
6
+ display: flex;
7
+ flex-flow: row;
8
+ }
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
- <QuickBloxUIKitProvider
205
- maxFileSize={QBConfig.appConfig.maxFileSize}
206
- // SDK={QB} //init SDK
207
- accountData={{ ...QBConfig.credentials, sessionToken: '' }}
208
- qbConfig={{ ...QBConfig }}
209
- loginData={{
210
- login: currentUser.login,
211
- password: currentUser.password,
212
- }}
213
- >
214
- <div className="App">
215
- <Routes>
216
- {/* eslint-disable-next-line @typescript-eslint/no-misused-promises */}
217
- <Route path="/" element={<Login loginHandler={loginHandler} />} />
218
- <Route
219
- path="/desktop-test-mock"
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
- </QuickBloxUIKitProvider>
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',