quickblox-react-ui-kit 0.3.1-beta.2 → 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.
Files changed (30) hide show
  1. package/README.md +0 -324
  2. package/dist/Presentation/ui-components/TextField/TextField.d.ts +1 -1
  3. package/dist/index-ui.js +87 -16
  4. package/dist/index-ui.js.map +1 -1
  5. package/package.json +2 -4
  6. package/src/Data/mapper/DialogRemoteDTOMapper.ts +7 -1
  7. package/src/Presentation/Views/Dialog/useDialogViewModel.ts +1 -1
  8. package/src/Presentation/Views/DialogInfo/DialogInfo.tsx +28 -2
  9. package/src/Presentation/Views/DialogList/DialogList.tsx +1 -1
  10. package/src/Presentation/Views/EditDialog/EditDialog.tsx +3 -2
  11. package/src/Presentation/Views/PreviewDialog/PreviewDialog.tsx +10 -0
  12. package/src/Presentation/layouts/Desktop/QuickBloxUIKitDesktopLayout.tsx +35 -2
  13. package/src/Presentation/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider.tsx +10 -2
  14. package/storybook-static/docs-Introduction-mdx.60905ccd.iframe.bundle.js +10 -0
  15. package/storybook-static/{docs-Introduction-mdx.bcb06844.iframe.bundle.js.map → docs-Introduction-mdx.60905ccd.iframe.bundle.js.map} +1 -1
  16. package/storybook-static/docs-Styling-mdx.90b5ee43.iframe.bundle.js +10 -0
  17. package/storybook-static/{docs-Styling-mdx.1d6c1212.iframe.bundle.js.map → docs-Styling-mdx.90b5ee43.iframe.bundle.js.map} +1 -1
  18. package/storybook-static/iframe.html +1 -1
  19. package/storybook-static/index.html +4 -8
  20. package/storybook-static/project.json +1 -1
  21. package/storybook-static/{runtime~main.af13ca55.iframe.bundle.js → runtime~main.cbb787ca.iframe.bundle.js} +1 -1
  22. package/tsconfig.buildlib.json +33 -0
  23. package/storybook-static/docs-Introduction-mdx.bcb06844.iframe.bundle.js +0 -10
  24. package/storybook-static/docs-Styling-mdx.1d6c1212.iframe.bundle.js +0 -10
  25. package/storybook-static/sb-addons/onboarding-7/manager-bundle.js +0 -503
  26. package/storybook-static/sb-addons/onboarding-7/manager-bundle.js.LEGAL.txt +0 -48
  27. /package/storybook-static/sb-addons/{interactions-8 → interactions-7}/manager-bundle.js +0 -0
  28. /package/storybook-static/sb-addons/{interactions-8 → interactions-7}/manager-bundle.js.LEGAL.txt +0 -0
  29. /package/storybook-static/sb-addons/{viewport-9 → viewport-8}/manager-bundle.js +0 -0
  30. /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
- ![dashboard!](./src/Presentation/assets/img/web-doc.png "chats dashboard")
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.
@@ -9,5 +9,5 @@ interface TextFieldProps extends Omit<HTMLInputProps, 'onChange'> {
9
9
  value: string;
10
10
  onChange: (value: string) => void;
11
11
  }
12
- declare const TextField: import("react").ForwardRefExoticComponent<Pick<TextFieldProps, "id" | "name" | "size" | "type" | "value" | "children" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "className" | "onClick" | "key" | "color" | "height" | "translate" | "width" | "onChange" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "disabled" | "enterKeyHint" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "list" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "placeholder" | "readOnly" | "required" | "src" | "step" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "icon" | "loading"> & import("react").RefAttributes<HTMLInputElement>>;
12
+ declare const TextField: import("react").ForwardRefExoticComponent<Pick<TextFieldProps, "id" | "name" | "size" | "type" | "value" | "children" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "loading" | "className" | "onClick" | "key" | "color" | "height" | "translate" | "width" | "onChange" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "disabled" | "enterKeyHint" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "list" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "placeholder" | "readOnly" | "required" | "src" | "step" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "icon"> & import("react").RefAttributes<HTMLInputElement>>;
13
13
  export default TextField;
package/dist/index-ui.js CHANGED
@@ -12352,9 +12352,13 @@ var DialogRemoteDTOMapper = /** @class */ (function () {
12352
12352
  DialogRemoteDTOMapper.validateRemoteDTO(dialog);
12353
12353
  var entity = DialogRemoteDTOMapper.createDefaultDialogEntity(dialog.ownerId);
12354
12354
  function formatPhotoUrl() {
12355
- if (dialog.photo && dialog.photo !== 'null') {
12355
+ if (!dialog.photo.includes('https') &&
12356
+ dialog.photo &&
12357
+ dialog.photo !== 'null') {
12356
12358
  return dialog.photo && quickblox_quickblox__WEBPACK_IMPORTED_MODULE_0___default().content.privateUrl(dialog.photo);
12357
12359
  }
12360
+ if (dialog.photo.includes('https'))
12361
+ return dialog.photo;
12358
12362
  return '';
12359
12363
  }
12360
12364
  switch (dialog.type) {
@@ -24214,7 +24218,7 @@ function useDialogViewModel(dialogType, dialogEntity) {
24214
24218
  });
24215
24219
  if ((dialog === null || dialog === void 0 ? void 0 : dialog.type) === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType["private"]) {
24216
24220
  var updDialog = __assign({}, dialog);
24217
- updDialog.lastMessage.dateSent = messageEntity.date_sent;
24221
+ updDialog.lastMessage.dateSent = messageEntity.date_sent / 1000;
24218
24222
  updDialog.lastMessage.text = messageEntity.message;
24219
24223
  updDialog.lastMessage.userId = messageEntity.sender_id;
24220
24224
  updDialog.unreadMessageCount = 0;
@@ -24633,9 +24637,18 @@ var DialogInfo = function (_a) {
24633
24637
  (_b = currentContext.storage.REMOTE_DATA_SOURCE.authInformation) === null || _b === void 0 ? void 0 : _b.userId.toString();
24634
24638
  var useSubContent = subHeaderContent || false;
24635
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);
24636
24642
  var leaveDialogHandler = function () {
24637
24643
  if (!disableAction) {
24638
- // onLeaveDialog((dialogViewModel?.entity || dialog) as GroupDialogEntity);
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
24639
24652
  dialogViewModel
24640
24653
  .deleteDialog(((dialogViewModel === null || dialogViewModel === void 0 ? void 0 : dialogViewModel.entity) || dialog))
24641
24654
  .then(function (result) {
@@ -24648,6 +24661,12 @@ var DialogInfo = function (_a) {
24648
24661
  .catch(function (e) {
24649
24662
  console.log(e);
24650
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);
24651
24670
  });
24652
24671
  }
24653
24672
  };
@@ -24814,12 +24833,21 @@ var DialogInfo = function (_a) {
24814
24833
  }
24815
24834
  };
24816
24835
  }, []);
24817
- return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", __assign({ style: __assign({}, rootStyles), className: "dialog-information-container" }, { children: (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"] &&
24818
- 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', {
24819
- 'dialog-information-profile-edit-button--disable': disableAction,
24820
- }) }, { 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', {
24821
- 'dialog-info-leave--disable': disableAction,
24822
- }) }), (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" }))] })) }))] }) })));
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" }))] })) }))] })] })));
24823
24851
  };
24824
24852
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DialogInfo);
24825
24853
 
@@ -25414,7 +25442,7 @@ var DialogList = function (_a) {
25414
25442
  colorTheme: additionalSettings === null || additionalSettings === void 0 ? void 0 : additionalSettings.themePreview,
25415
25443
  }, title: "".concat(item.entity.name || ''), unreadMessageCount: item.entity.unreadMessageCount > 0
25416
25444
  ? item.entity.unreadMessageCount
25417
- : undefined, message_date_time_sent: getMessageDateTimeSent(), previewMessage: item.entity.lastMessage.text, dialogAvatar: getDialogAvatar(item), onLeaveDialog: onLeaveDialog }) }), index));
25445
+ : undefined, message_date_time_sent: getMessageDateTimeSent(), previewMessage: item.entity.lastMessage.text, dialogAvatar: getDialogAvatar(item), onLeaveDialog: onLeaveDialog }) }), item.entity.id));
25418
25446
  };
25419
25447
  var renderSearchDialogs = function () {
25420
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) {
@@ -26090,7 +26118,7 @@ var EditDialog = function (_a) {
26090
26118
  }
26091
26119
  else {
26092
26120
  return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UserAvatar_UserAvatar__WEBPACK_IMPORTED_MODULE_6__["default"], { urlAvatar: urlAvatar, clickRemoveAvatarHandler: function () {
26093
- setUrlAvatar('');
26121
+ setUrlAvatar('null');
26094
26122
  setErrorMessageUpload('');
26095
26123
  } }));
26096
26124
  }
@@ -26103,7 +26131,8 @@ var EditDialog = function (_a) {
26103
26131
  if (clickUpdatedHandler) {
26104
26132
  var params = {
26105
26133
  dialogTitle: dialogName,
26106
- dialogAvatar: urlAvatar.length ? fileUploadAvatar : '',
26134
+ // dialogAvatar: urlAvatar.length ? fileUploadAvatar : '',
26135
+ dialogAvatar: urlAvatar === 'null' ? 'null' : fileUploadAvatar,
26107
26136
  };
26108
26137
  clickUpdatedHandler(params);
26109
26138
  }
@@ -27084,6 +27113,14 @@ var PreviewDialog = function (_a) {
27084
27113
  }
27085
27114
  };
27086
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]);
27087
27124
  var trimFileName = function (fileName) {
27088
27125
  if (fileName.length > 16) {
27089
27126
  return "".concat(fileName.substring(0, 15), "... .").concat(fileName.slice((Math.max(0, fileName.lastIndexOf('.')) || Infinity) + 1));
@@ -29474,11 +29511,16 @@ var QuickBloxUIKitDesktopLayout = function (_a) {
29474
29511
  .participantId,
29475
29512
  ]
29476
29513
  : [];
29514
+ if (!(participants.length > 0)) return [3 /*break*/, 2];
29477
29515
  return [4 /*yield*/, userViewModel.getUserById(participants[0])];
29478
29516
  case 1:
29479
29517
  senderUser = _a.sent();
29480
29518
  result = (senderUser === null || senderUser === void 0 ? void 0 : senderUser.photo) || '';
29481
- return [2 /*return*/, result];
29519
+ return [3 /*break*/, 3];
29520
+ case 2:
29521
+ result = '';
29522
+ _a.label = 3;
29523
+ case 3: return [2 /*return*/, result];
29482
29524
  }
29483
29525
  });
29484
29526
  }); };
@@ -29772,8 +29814,18 @@ var QuickBloxUIKitDesktopLayout = function (_a) {
29772
29814
  }
29773
29815
  setIsOpen(function (state) { return !state; });
29774
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);
29775
29819
  var handleLeaveDialog = function () {
29776
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
29777
29829
  dialogsViewModel
29778
29830
  .deleteDialog(dialogToLeave)
29779
29831
  .then(function (result) {
@@ -29786,6 +29838,12 @@ var QuickBloxUIKitDesktopLayout = function (_a) {
29786
29838
  .catch(function (e) {
29787
29839
  console.log(e);
29788
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);
29789
29847
  });
29790
29848
  }
29791
29849
  };
@@ -30040,7 +30098,16 @@ var QuickBloxUIKitDesktopLayout = function (_a) {
30040
30098
  handleDialogOnClick();
30041
30099
  }
30042
30100
  }, [dialogToLeave]);
30043
- 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)(_DesktopLayout__WEBPACK_IMPORTED_MODULE_8__["default"], { mainContainerStyles: {
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: {
30044
30111
  minHeight: workHeight,
30045
30112
  maxHeight: workHeight,
30046
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,
@@ -30445,11 +30512,15 @@ function QuickBloxUIKitProvider(_a) {
30445
30512
  // setAuthProcessed(status);
30446
30513
  // };
30447
30514
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
30448
- if (!accountData.accountKey || !accountData.appId || !accountData.authKey) {
30515
+ if (!accountData.accountKey ||
30516
+ !accountData.appId ||
30517
+ (!accountData.authKey && !accountData.sessionToken)) {
30449
30518
  (0,react_toastify__WEBPACK_IMPORTED_MODULE_2__.toast)('Please input AppId, AuthKey, AuthSecret, AccountKey to sign in/up');
30450
30519
  }
30451
30520
  }, []);
30452
- if (!accountData.accountKey || !accountData.appId || !accountData.authKey) {
30521
+ if (!accountData.accountKey ||
30522
+ !accountData.appId ||
30523
+ (!accountData.authKey && !accountData.sessionToken)) {
30453
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] }));
30454
30525
  }
30455
30526
  return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Provider, __assign({ value: {