quickblox-react-ui-kit 0.3.1-beta.3 → 0.3.1-beta.4
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 +0 -324
- package/dist/index-ui.js +75 -13
- package/dist/index-ui.js.map +1 -1
- package/package.json +2 -4
- package/src/Presentation/Views/DialogInfo/DialogInfo.tsx +28 -2
- package/src/Presentation/Views/DialogList/DialogList.tsx +1 -1
- package/src/Presentation/Views/EditDialog/EditDialog.tsx +3 -2
- package/src/Presentation/Views/PreviewDialog/PreviewDialog.tsx +10 -0
- package/src/Presentation/layouts/Desktop/QuickBloxUIKitDesktopLayout.tsx +28 -0
- package/src/Presentation/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider.tsx +10 -2
- package/storybook-static/docs-Introduction-mdx.60905ccd.iframe.bundle.js +10 -0
- package/storybook-static/{docs-Introduction-mdx.bcb06844.iframe.bundle.js.map → docs-Introduction-mdx.60905ccd.iframe.bundle.js.map} +1 -1
- package/storybook-static/docs-Styling-mdx.90b5ee43.iframe.bundle.js +10 -0
- package/storybook-static/{docs-Styling-mdx.1d6c1212.iframe.bundle.js.map → docs-Styling-mdx.90b5ee43.iframe.bundle.js.map} +1 -1
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.html +4 -8
- package/storybook-static/project.json +1 -1
- package/storybook-static/{runtime~main.af13ca55.iframe.bundle.js → runtime~main.cbb787ca.iframe.bundle.js} +1 -1
- package/tsconfig.buildlib.json +33 -0
- package/storybook-static/docs-Introduction-mdx.bcb06844.iframe.bundle.js +0 -10
- package/storybook-static/docs-Styling-mdx.1d6c1212.iframe.bundle.js +0 -10
- package/storybook-static/sb-addons/onboarding-7/manager-bundle.js +0 -503
- package/storybook-static/sb-addons/onboarding-7/manager-bundle.js.LEGAL.txt +0 -48
- /package/storybook-static/sb-addons/{interactions-8 → interactions-7}/manager-bundle.js +0 -0
- /package/storybook-static/sb-addons/{interactions-8 → interactions-7}/manager-bundle.js.LEGAL.txt +0 -0
- /package/storybook-static/sb-addons/{viewport-9 → viewport-8}/manager-bundle.js +0 -0
- /package/storybook-static/sb-addons/{viewport-9 → viewport-8}/manager-bundle.js.LEGAL.txt +0 -0
package/README.md
CHANGED
|
@@ -1,324 +0,0 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
|
|
3
|
-
<p>
|
|
4
|
-
<a href="https://discord.gg/c6bxq9BC"><img src="https://img.shields.io/discord/1042743094833065985?color=5865F2&logo=discord&logoColor=white&label=QuickBlox%20Discord%20server&style=for-the-badge" alt="Discord server" /></a>
|
|
5
|
-
</p>
|
|
6
|
-
|
|
7
|
-
</div>
|
|
8
|
-
|
|
9
|
-
# Overview
|
|
10
|
-
|
|
11
|
-
The QuickBlox UIKit for React is a comprehensive user interface kit specifically designed for building chat applications. It provides a collection of pre-built components, modules, and utilities that simplify the process of creating chat applications.
|
|
12
|
-
|
|
13
|
-
The main goal of the QuickBlox UIKit for React is to offer developers a streamlined and efficient way to implement chat functionality within their React applications.
|
|
14
|
-
|
|
15
|
-
The QuickBlox UIKit for React offers modules that encapsulate complex chat functionalities, such as dialogs and chat management and real-time updates. These modules provide a simplified interface for integrating chat features into applications without the need for extensive knowledge of the underlying protocols or server-side infrastructure.
|
|
16
|
-
|
|
17
|
-
You can view and interact with the interface components of the UI Kit using Storybook. In fact, this provides an interactive environment showcasing different scenarios that UI components might encounter in a live application. To view these, visit our [documentation](https://quickblox.github.io/react-ui-kit/).
|
|
18
|
-
|
|
19
|
-
# Screenshots
|
|
20
|
-
|
|
21
|
-
Chat dashboard with list of dialogs and create new chat dialog;
|
|
22
|
-
|
|
23
|
-

|
|
24
|
-
|
|
25
|
-
## Features
|
|
26
|
-
|
|
27
|
-
QuickBlox UIKit for React provides next functionality:
|
|
28
|
-
- List of dialogs
|
|
29
|
-
- Create dialog(Private or Group)
|
|
30
|
-
- Dialog screen
|
|
31
|
-
- Send text, image, video, audio, file messages
|
|
32
|
-
- Dialog info screen
|
|
33
|
-
- List, invite, remove members
|
|
34
|
-
|
|
35
|
-
# Send your first message
|
|
36
|
-
|
|
37
|
-
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.
|
|
38
|
-
|
|
39
|
-
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.
|
|
40
|
-
[Additional information with sample](https://docs.quickblox.com/docs/react-uikit-send-your-first-message)
|
|
41
|
-
## Requirements
|
|
42
|
-
|
|
43
|
-
The minimum requirements for QuickBlox UIKit for React are:
|
|
44
|
-
- JS QuickBlox SDK v2.15.5
|
|
45
|
-
- React v.18.0
|
|
46
|
-
- TypeScript v.4.9.3
|
|
47
|
-
|
|
48
|
-
# Before you begin
|
|
49
|
-
|
|
50
|
-
Register a new account following [this link](https://admin.quickblox.com/signup). Type in your email and password to sign in. You can also sign in with your Google or Github accounts.
|
|
51
|
-
Create the app clicking New app button.
|
|
52
|
-
Configure the app. Type in the information about your organization into corresponding fields and click Add button.
|
|
53
|
-
Go to Dashboard => YOUR_APP => Overview section and copy your Application ID, Authorization Key, Authorization Secret, and Account Key .
|
|
54
|
-
|
|
55
|
-
## Install QuickBlox SDK
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
npm install quickblox
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## Install QuickBlox UIKit
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
npm install quickblox-react-ui-kit
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## Init QuickBlox SDK
|
|
68
|
-
|
|
69
|
-
To init QuickBlox SDK you need to pass Application ID, Authorization Key, Authorization Secret, and Account Key to the init() method.
|
|
70
|
-
|
|
71
|
-
```
|
|
72
|
-
var APPLICATION_ID = 41;
|
|
73
|
-
var AUTH_KEY = "lkjdueksu7392kj";
|
|
74
|
-
var AUTH_SECRET = "iiohfdija792hj";
|
|
75
|
-
var ACCOUNT_KEY = "sdjfnksnlk2bk1k34kb";
|
|
76
|
-
var CONFIG = { debug: true };
|
|
77
|
-
|
|
78
|
-
QB.init(APPLICATION_ID, AUTH_KEY, AUTH_SECRET, ACCOUNT_KEY, CONFIG);
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
## Authentication
|
|
82
|
-
|
|
83
|
-
Before sending your first message you need to authenticate users in the QuickBlox system. You can read more about different ways of authentication by [this link](https://docs.quickblox.com/docs/js-authentication).
|
|
84
|
-
In our example we show how to authenticate user with login and password.
|
|
85
|
-
|
|
86
|
-
```
|
|
87
|
-
import * as QB from "quickblox/quickblox";
|
|
88
|
-
import {
|
|
89
|
-
QuickBloxUIKitProvider,
|
|
90
|
-
qbDataContext,
|
|
91
|
-
QuickBloxUIKitDesktopLayout,
|
|
92
|
-
LoginData,
|
|
93
|
-
AuthorizationData,
|
|
94
|
-
QBDataContextType,
|
|
95
|
-
} from 'quickblox-ui-kit-react/dist/index-ui';
|
|
96
|
-
|
|
97
|
-
var params = { login: "garry", password: "garry5santos" };
|
|
98
|
-
|
|
99
|
-
QB.login(params, function(error, result) {
|
|
100
|
-
if(error){
|
|
101
|
-
} else {
|
|
102
|
-
// Navigate User to the UIKit
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
const qbUIKitContext: QBDataContextType = React.useContext(qbDataContext);
|
|
106
|
-
```
|
|
107
|
-
To order to config quickblox ui kit provider if you use SDK without session token:
|
|
108
|
-
```
|
|
109
|
-
<QuickBloxUIKitProvider
|
|
110
|
-
maxFileSize={100 * 1000000} //set max size for attachments
|
|
111
|
-
accountData={{ ...QBConfig.credentials }}
|
|
112
|
-
loginData={{
|
|
113
|
-
login: params.login,
|
|
114
|
-
password: params.password,
|
|
115
|
-
}}
|
|
116
|
-
>
|
|
117
|
-
<QuickBloxUIKitDesktopLayout /> // container for DesktopLayout
|
|
118
|
-
</QuickBloxUIKitProvider>
|
|
119
|
-
```
|
|
120
|
-
To order to config quickblox ui kit provider if you use SDK with session token:
|
|
121
|
-
```
|
|
122
|
-
<QuickBloxUIKitProvider
|
|
123
|
-
maxFileSize={100 * 1000000} //set max size for attachments
|
|
124
|
-
accountData={{ ...QBConfig.credentials }} // sessionToken was used in QBConfig
|
|
125
|
-
>
|
|
126
|
-
<QuickBloxUIKitDesktopLayout /> // container for DesktopLayout
|
|
127
|
-
</QuickBloxUIKitProvider>
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
# Customization
|
|
131
|
-
|
|
132
|
-
The QuickBlox UIKit for React allows you to create your own unique view of the UIKit.
|
|
133
|
-
|
|
134
|
-
## Default themes
|
|
135
|
-
The QuickBlox UIKit for React has 2 built in themes: Dark and Light.
|
|
136
|
-
Default theme for UIKit is Light.
|
|
137
|
-
To set theme you need to set value 'dark' to key data-theme in global styles (html[data-theme="dark”]).
|
|
138
|
-
For example, you can use pure JavaScript:
|
|
139
|
-
|
|
140
|
-
```
|
|
141
|
-
document.documentElement.setAttribute('data-theme', 'dark');
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
## Use your own theme
|
|
145
|
-
|
|
146
|
-
There are two options how you can create your own theme:
|
|
147
|
-
- Customize current theme using css
|
|
148
|
-
- Create your own theme to customize selected components
|
|
149
|
-
|
|
150
|
-
To customize the current theme you just need to set the new colors in css variables.
|
|
151
|
-
|
|
152
|
-
Or you can create your own theme. To do this you need to create a new class that implements the UiKitTheme interface.
|
|
153
|
-
|
|
154
|
-
To use your own theme using css you need to create _theme_colors_scheme.scss and set colors
|
|
155
|
-
```
|
|
156
|
-
$background-overlay-light: rgba(19, 29, 40, .80);
|
|
157
|
-
$background-overlay-dark: rgba(144, 151, 159, .80);
|
|
158
|
-
$primary-50: #E7EFFF;
|
|
159
|
-
$primary-100: #C4D7FE;
|
|
160
|
-
$primary-200: #9CBCFE;
|
|
161
|
-
$primary-300: #74A1FD;
|
|
162
|
-
$primary-400: #578CFC;
|
|
163
|
-
$primary-500: #3978FC;
|
|
164
|
-
$primary-600: #3370FC;
|
|
165
|
-
$primary-700: #2C65FB;
|
|
166
|
-
$primary-800: #245BFB;
|
|
167
|
-
$primary-900: #1748FA;
|
|
168
|
-
$primary-a-100: #FFFFFF;
|
|
169
|
-
$primary-a-200: #F7F9FF;
|
|
170
|
-
$primary-a-400: #C4CFFF;
|
|
171
|
-
$primary-a-700: #ABBAFF;
|
|
172
|
-
$secondary-50: #E4E6E8;
|
|
173
|
-
$secondary-100: #BCC1C5;
|
|
174
|
-
$secondary-200: #90979F;
|
|
175
|
-
$secondary-300: #636D78;
|
|
176
|
-
$secondary-400: #414E5B;
|
|
177
|
-
$secondary-500: #202F3E;
|
|
178
|
-
$secondary-600: #1C2A38;
|
|
179
|
-
$secondary-700: #182330;
|
|
180
|
-
$secondary-800: #131D28;
|
|
181
|
-
$secondary-900: #0B121B;
|
|
182
|
-
$secondary-a-100: #74A1FD;
|
|
183
|
-
$secondary-a-200: #3978FC;
|
|
184
|
-
$secondary-a-400: #245BFB;
|
|
185
|
-
$secondary-a-700: #0050DC;
|
|
186
|
-
$system-green-100: #C8F1D6;
|
|
187
|
-
$system-green-200: #A4E7BB;
|
|
188
|
-
$system-green-300: #80DDA0;
|
|
189
|
-
$system-green-400: #64D68B;
|
|
190
|
-
$system-green-500: #49CF77;
|
|
191
|
-
$error-100: #FFC4C1;
|
|
192
|
-
$error-200: #FF9D98;
|
|
193
|
-
$error-300: #FF766E;
|
|
194
|
-
$error-400: #FF584F;
|
|
195
|
-
$error-500: #FF3B30;
|
|
196
|
-
$information: #FDB0FF;
|
|
197
|
-
$highlight: #FFFDC1;
|
|
198
|
-
|
|
199
|
-
```
|
|
200
|
-
To use your own new theme colors create _theme_dark.scss and _theme_light.scss files and set color variable.
|
|
201
|
-
```
|
|
202
|
-
// _theme_dark.scss:
|
|
203
|
-
|
|
204
|
-
html[data-theme="dark"]{
|
|
205
|
-
--color-background-info: #{$primary-500};
|
|
206
|
-
--tertiary-elements: #{$background-overlay-dark};
|
|
207
|
-
--main-elements: #{$primary-300};
|
|
208
|
-
--secondary-elements: #{$primary-a-100};
|
|
209
|
-
--input-elements: #{$secondary-200};
|
|
210
|
-
--disabled-elements: #{$secondary-300};
|
|
211
|
-
--field-border: #{$secondary-200};
|
|
212
|
-
--main-text: #{$primary-a-100};
|
|
213
|
-
--secondary-text: #{$secondary-200};
|
|
214
|
-
--caption: #{$secondary-100};
|
|
215
|
-
--main-background: #{$secondary-500};
|
|
216
|
-
--secondary-background: #{$secondary-800};
|
|
217
|
-
--incoming-background: #{$secondary-400};
|
|
218
|
-
--outgoing-background: #{$primary-500};
|
|
219
|
-
--dropdown-background: #{$secondary-400};
|
|
220
|
-
--chat-input: #{$secondary-800};
|
|
221
|
-
--divider: #{$secondary-400};
|
|
222
|
-
--error: #{$error-300};
|
|
223
|
-
--hightlight: #{$highlight};
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
// _theme_light.scss:
|
|
227
|
-
:root{
|
|
228
|
-
--color-background-info:#{$primary-100};
|
|
229
|
-
--tertiary-elements: #{$secondary-300};
|
|
230
|
-
--main-elements: #{$primary-500};
|
|
231
|
-
--secondary-elements: #{$secondary-500};
|
|
232
|
-
--input-elements: #{$secondary-500};
|
|
233
|
-
--disabled-elements: #{$secondary-100};
|
|
234
|
-
--field-border: #{$secondary-200};
|
|
235
|
-
--main-text: #{$secondary-900};
|
|
236
|
-
--secondary-text: #{$secondary-300};
|
|
237
|
-
--caption: #{$secondary-200};
|
|
238
|
-
--main-background: #{$primary-a-100};
|
|
239
|
-
--secondary-background: #{$primary-a-100};
|
|
240
|
-
--secondary-background-modal: #{$background-overlay-light};
|
|
241
|
-
--incoming-background: #{$secondary-50};
|
|
242
|
-
--outgoing-background: #{$primary-50};
|
|
243
|
-
--dropdown-background: #{$primary-a-100};
|
|
244
|
-
--chat-input: #{$primary-a-200};
|
|
245
|
-
--divider: #{$primary-50};
|
|
246
|
-
--error: #{$error-500};
|
|
247
|
-
--hightlight: #{$highlight};
|
|
248
|
-
}
|
|
249
|
-
```
|
|
250
|
-
To create your own theme to customize selected components you need to create a new class that implements the UiKitTheme interface.
|
|
251
|
-
```
|
|
252
|
-
//DefaultTheme implements UiKitTheme
|
|
253
|
-
export default class CustomTheme extends DefaultTheme {
|
|
254
|
-
divider = (): string => 'var(--divider)';
|
|
255
|
-
mainText = (): string => '#FFFFFF';
|
|
256
|
-
fontFamily = (): string => 'Roboto';
|
|
257
|
-
/*
|
|
258
|
-
The DefaultTheme contains other theme methods :
|
|
259
|
-
caption = (): string => 'var(--caption)';
|
|
260
|
-
chatInput = (): string => 'var(--chat-input)';
|
|
261
|
-
disabledElements = (): string => 'var(--disabled-elements)';
|
|
262
|
-
dropdownBackground = (): string => 'var(--dropdown-background)';
|
|
263
|
-
error = (): string => 'var(--error)';
|
|
264
|
-
fieldBorder = (): string => 'var(--field-border)';
|
|
265
|
-
hightlight = (): string => 'var(--hightlight)';
|
|
266
|
-
incomingBackground = (): string => 'var(--incoming-background)';
|
|
267
|
-
inputElements = (): string => 'var(--input-elements)';
|
|
268
|
-
mainBackground = (): string => 'var(--main-background)';
|
|
269
|
-
mainElements = (): string => 'var(--main-elements)';
|
|
270
|
-
outgoingBackground = (): string => 'var(--outgoing-background)';
|
|
271
|
-
secondaryBackground = (): string => 'var(--secondary-background)';
|
|
272
|
-
secondaryElements = (): string => 'var(--secondary-elements)';
|
|
273
|
-
secondaryText = (): string => 'var(--secondary-text)';
|
|
274
|
-
*/
|
|
275
|
-
}
|
|
276
|
-
```
|
|
277
|
-
and specify selected components:
|
|
278
|
-
- desktop layout container
|
|
279
|
-
```
|
|
280
|
-
<QuickBloxUIKitDesktopLayout theme={new CustomTheme()}>
|
|
281
|
-
```
|
|
282
|
-
- header of dialogs
|
|
283
|
-
```
|
|
284
|
-
<HeaderDialogs title="Dialog 2" theme={new CustomTheme()} />
|
|
285
|
-
```
|
|
286
|
-
- item of dialogs
|
|
287
|
-
```
|
|
288
|
-
<PreviewDialog
|
|
289
|
-
theme={{ selected: true, muted: true, colorTheme={new CustomTheme()} }}
|
|
290
|
-
title="Dialog with states"
|
|
291
|
-
unreadMessageCount={9}
|
|
292
|
-
message_date_time_sent="5 min ago"
|
|
293
|
-
/>
|
|
294
|
-
```
|
|
295
|
-
# Sample
|
|
296
|
-
The source code of the sample is available on GitHub:
|
|
297
|
-
https://github.com/QuickBlox/quickblox-javascript-sdk/tree/gh-pages/samples/react-chat-ui-kit-init-sample
|
|
298
|
-
You can view and interact with the interface components of the UI Kit using Storybook. In fact, this provides an interactive environment showcasing different scenarios that UI components might encounter in a live application. To view these, visit our [documentation](https://quickblox.github.io/react-ui-kit/).
|
|
299
|
-
|
|
300
|
-
## Video guide "How to use AI Feature"
|
|
301
|
-
[Youtube video about AI Assistant](https://youtu.be/BneMtDagOy4)
|
|
302
|
-
# License
|
|
303
|
-
[](#license)
|
|
304
|
-
MIT License [here](https://github.com/QuickBlox/react-ui-kit/blob/main/LICENSE.md).
|
|
305
|
-
|
|
306
|
-
Copyright © 2023 QuickBlox.
|
|
307
|
-
|
|
308
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
309
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
310
|
-
in the Software without restriction, including without limitation the rights
|
|
311
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
312
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
313
|
-
furnished to do so, subject to the following conditions:
|
|
314
|
-
|
|
315
|
-
The above copyright notice and this permission notice shall be included in all
|
|
316
|
-
copies or substantial portions of the Software.
|
|
317
|
-
|
|
318
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
319
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
320
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
321
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
322
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
323
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
324
|
-
SOFTWARE.
|
package/dist/index-ui.js
CHANGED
|
@@ -24637,9 +24637,18 @@ var DialogInfo = function (_a) {
|
|
|
24637
24637
|
(_b = currentContext.storage.REMOTE_DATA_SOURCE.authInformation) === null || _b === void 0 ? void 0 : _b.userId.toString();
|
|
24638
24638
|
var useSubContent = subHeaderContent || false;
|
|
24639
24639
|
var useUpContent = upHeaderContent || false;
|
|
24640
|
+
var _l = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false), isLeaving = _l[0], setIsLeaving = _l[1];
|
|
24641
|
+
var toastLeavingId = react__WEBPACK_IMPORTED_MODULE_1___default().useRef(null);
|
|
24640
24642
|
var leaveDialogHandler = function () {
|
|
24641
24643
|
if (!disableAction) {
|
|
24642
|
-
|
|
24644
|
+
setIsLeaving(true);
|
|
24645
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
24646
|
+
// @ts-ignore
|
|
24647
|
+
toastLeavingId.current = (0,react_toastify__WEBPACK_IMPORTED_MODULE_3__.toast)('leaving dialog', {
|
|
24648
|
+
autoClose: false,
|
|
24649
|
+
isLoading: true,
|
|
24650
|
+
});
|
|
24651
|
+
// eslint-disable-next-line promise/catch-or-return
|
|
24643
24652
|
dialogViewModel
|
|
24644
24653
|
.deleteDialog(((dialogViewModel === null || dialogViewModel === void 0 ? void 0 : dialogViewModel.entity) || dialog))
|
|
24645
24654
|
.then(function (result) {
|
|
@@ -24652,6 +24661,12 @@ var DialogInfo = function (_a) {
|
|
|
24652
24661
|
.catch(function (e) {
|
|
24653
24662
|
console.log(e);
|
|
24654
24663
|
(0,react_toastify__WEBPACK_IMPORTED_MODULE_3__.toast)("Can't leave dialog");
|
|
24664
|
+
})
|
|
24665
|
+
.finally(function () {
|
|
24666
|
+
setIsLeaving(false);
|
|
24667
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
24668
|
+
// @ts-ignore
|
|
24669
|
+
react_toastify__WEBPACK_IMPORTED_MODULE_3__.toast.dismiss(toastLeavingId.current);
|
|
24655
24670
|
});
|
|
24656
24671
|
}
|
|
24657
24672
|
};
|
|
@@ -24818,12 +24833,21 @@ var DialogInfo = function (_a) {
|
|
|
24818
24833
|
}
|
|
24819
24834
|
};
|
|
24820
24835
|
}, []);
|
|
24821
|
-
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.
|
|
24822
|
-
|
|
24823
|
-
|
|
24824
|
-
|
|
24825
|
-
|
|
24826
|
-
|
|
24836
|
+
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", __assign({ style: __assign({}, rootStyles), className: "dialog-information-container" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { style: {
|
|
24837
|
+
position: 'absolute',
|
|
24838
|
+
top: '0',
|
|
24839
|
+
left: '0',
|
|
24840
|
+
width: '100%',
|
|
24841
|
+
height: '100%',
|
|
24842
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
24843
|
+
zIndex: '100',
|
|
24844
|
+
display: isLeaving ? 'block' : 'none',
|
|
24845
|
+
} }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components_containers_ColumnContainer_ColumnContainer__WEBPACK_IMPORTED_MODULE_5__["default"], { children: [useUpContent && upHeaderContent, (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui_components_Header_Header__WEBPACK_IMPORTED_MODULE_19__["default"], __assign({ title: "Dialog information", className: "header-dialog-info" }, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_icons__WEBPACK_IMPORTED_MODULE_16__.CloseSvg, { onClick: onCloseDialogInformationHandler, className: "header-dialog-info-icon" }) })), useSubContent && subHeaderContent, (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", __assign({ className: "dialog-information-profile" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", __assign({ className: "dialog-information-profile-avatar" }, { children: renderIconForTypeDialog((dialogViewModel === null || dialogViewModel === void 0 ? void 0 : dialogViewModel.entity) || dialog) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", __assign({ className: "dialog-information-profile-dialog-name" }, { children: ((_c = dialogViewModel === null || dialogViewModel === void 0 ? void 0 : dialogViewModel.entity) === null || _c === void 0 ? void 0 : _c.name) || (dialog === null || dialog === void 0 ? void 0 : dialog.name) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", __assign({ className: "dialog-information-profile-edit" }, { children: dialog.type !== _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_8__.DialogType["private"] &&
|
|
24846
|
+
dialog.ownerId === currentUserId ? ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", __assign({ className: classnames__WEBPACK_IMPORTED_MODULE_4___default()('dialog-information-profile-edit-button', {
|
|
24847
|
+
'dialog-information-profile-edit-button--disable': disableAction,
|
|
24848
|
+
}) }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui_components__WEBPACK_IMPORTED_MODULE_17__.Button, __assign({ variant: "text", onClick: editModal.toggleModal, disabled: disableAction }, { children: "Edit" })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui_components__WEBPACK_IMPORTED_MODULE_17__.DialogWindow, __assign({ title: "Edit dialog", onClose: editModal.toggleModal, open: editModal.isOpen }, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_EditDialog_EditDialog__WEBPACK_IMPORTED_MODULE_11__["default"], { disableActions: disableAction, nameDialog: (dialogViewModel === null || dialogViewModel === void 0 ? void 0 : dialogViewModel.entity.name) || dialog.name, typeDialog: (dialogViewModel === null || dialogViewModel === void 0 ? void 0 : dialogViewModel.entity.type) || dialog.type, ulrIcon: getUrlAvatar((dialogViewModel === null || dialogViewModel === void 0 ? void 0 : dialogViewModel.entity) || dialog), typeAddEditDialog: _EditDialog_EditDialog__WEBPACK_IMPORTED_MODULE_11__.TypeOpenDialog.edit, clickUpdatedHandler: getDialogUpdatedInfoHandler, clickCancelHandler: editModal.toggleModal }) }))] }))) : null }))] })), dialog.type !== _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_8__.DialogType["private"] ? ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui_components__WEBPACK_IMPORTED_MODULE_17__.SettingsItem, __assign({ icon: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_icons__WEBPACK_IMPORTED_MODULE_16__.GroupChatSvg, {}), title: "Members", rightSection: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui_components__WEBPACK_IMPORTED_MODULE_17__.Badge, { mute: true, count: users.length, limit: 100 }), className: "dialog-info-members" }, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components_containers_ColumnContainer_ColumnContainer__WEBPACK_IMPORTED_MODULE_5__["default"], { children: [users && users.length > 0 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", __assign({ className: "dialog-info-action-wrapper-settings no-padding" }, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UsersList_UsersList__WEBPACK_IMPORTED_MODULE_7__["default"], { maxHeight: 75, usersFirstPageToView: users, allUsers: users, usersInDialogCount: users.length }) }))), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", __assign({ className: "dialog-info-action-wrapper-settings" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui_components__WEBPACK_IMPORTED_MODULE_17__.DialogWindow, __assign({ disableActions: disableAction, title: "Edit dialog", open: inviteMembersModal.isOpen, onClose: inviteMembersModal.toggleModal }, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_InviteMembers_InviteMembers__WEBPACK_IMPORTED_MODULE_20__["default"], { participants: _Domain_entity_PublicDialogEntity__WEBPACK_IMPORTED_MODULE_12__.PublicDialogEntity.getParticipants((dialogViewModel === null || dialogViewModel === void 0 ? void 0 : dialogViewModel.entity) || dialog), applyInviteUsersHandler: applyInviteUsersHandler, cancelInviteMembersHandler: inviteMembersModal.toggleModal, typeAddEditDialog: _EditDialog_EditDialog__WEBPACK_IMPORTED_MODULE_11__.TypeOpenDialog.edit, typeDialog: dialog.type, idOwnerDialog: dialog.ownerId }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui_components__WEBPACK_IMPORTED_MODULE_17__.Button, __assign({ className: "dialog-info-action-wrapper-button", onClick: inviteMembersModal.toggleModal, variant: "outlined", disabled: dialog.ownerId !== currentUserId || disableAction }, { children: "Invite members" })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui_components__WEBPACK_IMPORTED_MODULE_17__.Button, __assign({ className: "dialog-info-action-wrapper-button", onClick: function () { return onShowAllMemberClick(true); }, variant: "outlined", disabled: disableAction }, { children: "See all members" }))] }))] }) }))) : null, (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui_components__WEBPACK_IMPORTED_MODULE_17__.SettingsItem, { icon: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_icons__WEBPACK_IMPORTED_MODULE_16__.LeaveSvg, {}), title: "Leave dialog", onClick: !disableAction ? leaveModal.toggleModal : undefined, className: classnames__WEBPACK_IMPORTED_MODULE_4___default()('dialog-info-leave', {
|
|
24849
|
+
'dialog-info-leave--disable': disableAction,
|
|
24850
|
+
}) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui_components__WEBPACK_IMPORTED_MODULE_17__.DialogWindow, __assign({ open: leaveModal.isOpen, title: "Leave dialog?", onClose: leaveModal.toggleModal }, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", __assign({ className: "dialog-leave-container" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui_components__WEBPACK_IMPORTED_MODULE_17__.Button, __assign({ variant: "outlined", onClick: leaveModal.toggleModal }, { children: "Cancel" })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui_components__WEBPACK_IMPORTED_MODULE_17__.Button, __assign({ variant: "danger", onClick: leaveDialogHandler }, { children: "Leave" }))] })) }))] })] })));
|
|
24827
24851
|
};
|
|
24828
24852
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DialogInfo);
|
|
24829
24853
|
|
|
@@ -25418,7 +25442,7 @@ var DialogList = function (_a) {
|
|
|
25418
25442
|
colorTheme: additionalSettings === null || additionalSettings === void 0 ? void 0 : additionalSettings.themePreview,
|
|
25419
25443
|
}, title: "".concat(item.entity.name || ''), unreadMessageCount: item.entity.unreadMessageCount > 0
|
|
25420
25444
|
? item.entity.unreadMessageCount
|
|
25421
|
-
: undefined, message_date_time_sent: getMessageDateTimeSent(), previewMessage: item.entity.lastMessage.text, dialogAvatar: getDialogAvatar(item), onLeaveDialog: onLeaveDialog }) }),
|
|
25445
|
+
: undefined, message_date_time_sent: getMessageDateTimeSent(), previewMessage: item.entity.lastMessage.text, dialogAvatar: getDialogAvatar(item), onLeaveDialog: onLeaveDialog }) }), item.entity.id));
|
|
25422
25446
|
};
|
|
25423
25447
|
var renderSearchDialogs = function () {
|
|
25424
25448
|
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui_components_TextField_TextField__WEBPACK_IMPORTED_MODULE_17__["default"], { className: "search-dialog-text-field", disabled: dialogListViewModel === null || dialogListViewModel === void 0 ? void 0 : dialogListViewModel.loading, placeholder: "Search", icon: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_icons__WEBPACK_IMPORTED_MODULE_11__.SearchSvg, { className: "search-dialog-text-field__icon" }), value: nameDialogForSearch, onChange: function (value) {
|
|
@@ -26094,7 +26118,7 @@ var EditDialog = function (_a) {
|
|
|
26094
26118
|
}
|
|
26095
26119
|
else {
|
|
26096
26120
|
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UserAvatar_UserAvatar__WEBPACK_IMPORTED_MODULE_6__["default"], { urlAvatar: urlAvatar, clickRemoveAvatarHandler: function () {
|
|
26097
|
-
setUrlAvatar('');
|
|
26121
|
+
setUrlAvatar('null');
|
|
26098
26122
|
setErrorMessageUpload('');
|
|
26099
26123
|
} }));
|
|
26100
26124
|
}
|
|
@@ -26107,7 +26131,8 @@ var EditDialog = function (_a) {
|
|
|
26107
26131
|
if (clickUpdatedHandler) {
|
|
26108
26132
|
var params = {
|
|
26109
26133
|
dialogTitle: dialogName,
|
|
26110
|
-
dialogAvatar: urlAvatar.length ? fileUploadAvatar : '',
|
|
26134
|
+
// dialogAvatar: urlAvatar.length ? fileUploadAvatar : '',
|
|
26135
|
+
dialogAvatar: urlAvatar === 'null' ? 'null' : fileUploadAvatar,
|
|
26111
26136
|
};
|
|
26112
26137
|
clickUpdatedHandler(params);
|
|
26113
26138
|
}
|
|
@@ -27088,6 +27113,14 @@ var PreviewDialog = function (_a) {
|
|
|
27088
27113
|
}
|
|
27089
27114
|
};
|
|
27090
27115
|
}, []);
|
|
27116
|
+
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
|
|
27117
|
+
getFileForPreview();
|
|
27118
|
+
return function () {
|
|
27119
|
+
if (fileUrl) {
|
|
27120
|
+
URL.revokeObjectURL(fileUrl);
|
|
27121
|
+
}
|
|
27122
|
+
};
|
|
27123
|
+
}, [previewMessage]);
|
|
27091
27124
|
var trimFileName = function (fileName) {
|
|
27092
27125
|
if (fileName.length > 16) {
|
|
27093
27126
|
return "".concat(fileName.substring(0, 15), "... .").concat(fileName.slice((Math.max(0, fileName.lastIndexOf('.')) || Infinity) + 1));
|
|
@@ -29781,8 +29814,18 @@ var QuickBloxUIKitDesktopLayout = function (_a) {
|
|
|
29781
29814
|
}
|
|
29782
29815
|
setIsOpen(function (state) { return !state; });
|
|
29783
29816
|
};
|
|
29817
|
+
var _22 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false), isLeaving = _22[0], setIsLeaving = _22[1];
|
|
29818
|
+
var toastLeavingId = react__WEBPACK_IMPORTED_MODULE_1___default().useRef(null);
|
|
29784
29819
|
var handleLeaveDialog = function () {
|
|
29785
29820
|
if (dialogToLeave) {
|
|
29821
|
+
setIsLeaving(true);
|
|
29822
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
29823
|
+
// @ts-ignore
|
|
29824
|
+
toastLeavingId.current = (0,react_toastify__WEBPACK_IMPORTED_MODULE_4__.toast)('leaving dialog', {
|
|
29825
|
+
autoClose: false,
|
|
29826
|
+
isLoading: true,
|
|
29827
|
+
});
|
|
29828
|
+
// eslint-disable-next-line promise/catch-or-return
|
|
29786
29829
|
dialogsViewModel
|
|
29787
29830
|
.deleteDialog(dialogToLeave)
|
|
29788
29831
|
.then(function (result) {
|
|
@@ -29795,6 +29838,12 @@ var QuickBloxUIKitDesktopLayout = function (_a) {
|
|
|
29795
29838
|
.catch(function (e) {
|
|
29796
29839
|
console.log(e);
|
|
29797
29840
|
(0,react_toastify__WEBPACK_IMPORTED_MODULE_4__.toast)("Can't leave dialog");
|
|
29841
|
+
})
|
|
29842
|
+
.finally(function () {
|
|
29843
|
+
setIsLeaving(false);
|
|
29844
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
29845
|
+
// @ts-ignore
|
|
29846
|
+
react_toastify__WEBPACK_IMPORTED_MODULE_4__.toast.dismiss(toastLeavingId.current);
|
|
29798
29847
|
});
|
|
29799
29848
|
}
|
|
29800
29849
|
};
|
|
@@ -30049,7 +30098,16 @@ var QuickBloxUIKitDesktopLayout = function (_a) {
|
|
|
30049
30098
|
handleDialogOnClick();
|
|
30050
30099
|
}
|
|
30051
30100
|
}, [dialogToLeave]);
|
|
30052
|
-
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui_components_Toast_ToastProvider__WEBPACK_IMPORTED_MODULE_38__["default"], { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", __assign({ className: "qb-uikit-layout" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
|
|
30101
|
+
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui_components_Toast_ToastProvider__WEBPACK_IMPORTED_MODULE_38__["default"], { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", __assign({ className: "qb-uikit-layout" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { style: {
|
|
30102
|
+
position: 'absolute',
|
|
30103
|
+
top: '0',
|
|
30104
|
+
left: '0',
|
|
30105
|
+
width: '100%',
|
|
30106
|
+
height: '100%',
|
|
30107
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
30108
|
+
zIndex: '100',
|
|
30109
|
+
display: isLeaving ? 'block' : 'none',
|
|
30110
|
+
} }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_DesktopLayout__WEBPACK_IMPORTED_MODULE_8__["default"], { mainContainerStyles: {
|
|
30053
30111
|
minHeight: workHeight,
|
|
30054
30112
|
maxHeight: workHeight,
|
|
30055
30113
|
}, onHeightChange: handleHeightChange, theme: theme, dialogsView: showDialogList ? ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Views_DialogList_DialogList__WEBPACK_IMPORTED_MODULE_6__["default"], { disableAction: !isOnline, scrollableHeight: dialogListScrollableHeight,
|
|
@@ -30454,11 +30512,15 @@ function QuickBloxUIKitProvider(_a) {
|
|
|
30454
30512
|
// setAuthProcessed(status);
|
|
30455
30513
|
// };
|
|
30456
30514
|
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
|
|
30457
|
-
if (!accountData.accountKey ||
|
|
30515
|
+
if (!accountData.accountKey ||
|
|
30516
|
+
!accountData.appId ||
|
|
30517
|
+
(!accountData.authKey && !accountData.sessionToken)) {
|
|
30458
30518
|
(0,react_toastify__WEBPACK_IMPORTED_MODULE_2__.toast)('Please input AppId, AuthKey, AuthSecret, AccountKey to sign in/up');
|
|
30459
30519
|
}
|
|
30460
30520
|
}, []);
|
|
30461
|
-
if (!accountData.accountKey ||
|
|
30521
|
+
if (!accountData.accountKey ||
|
|
30522
|
+
!accountData.appId ||
|
|
30523
|
+
(!accountData.authKey && !accountData.sessionToken)) {
|
|
30462
30524
|
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_toastify__WEBPACK_IMPORTED_MODULE_2__.ToastContainer, { position: "top-center", autoClose: 5000, bodyClassName: "toast__body", toastClassName: "toast", pauseOnHover: false, closeButton: false, hideProgressBar: true }), children] }));
|
|
30463
30525
|
}
|
|
30464
30526
|
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Provider, __assign({ value: {
|