quickblox-react-ui-kit 0.3.0-beta.4 → 0.3.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CommonTypes/CommonTypes.d.ts +142 -0
- package/dist/CommonTypes/FunctionResult.d.ts +0 -54
- package/dist/Data/DefaultConfigurations.d.ts +2 -2
- package/dist/Data/Stubs.d.ts +5 -4
- package/dist/Data/dto/dialog/LocalDialogDTO.d.ts +1 -1
- package/dist/Data/dto/dialog/RemoteDialogDTO.d.ts +1 -1
- package/dist/Data/source/remote/Mapper/MessageDTOMapper.d.ts +1 -0
- package/dist/Domain/entity/LastMessageEntity.d.ts +1 -1
- package/dist/Presentation/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider.d.ts +3 -1
- package/dist/Presentation/ui-components/TextField/TextField.d.ts +2 -2
- package/dist/QBconfig.d.ts +2 -76
- package/dist/index-ui.js +985 -973
- package/dist/index-ui.js.map +1 -1
- package/dist/qb-api-calls/index.d.ts +13 -12
- package/dist/utils/formatFileSize.d.ts +1 -0
- package/dist/utils/parse.d.ts +1 -0
- package/global.d.ts +159 -2836
- package/package.json +4 -2
- package/src/App.tsx +2 -1
- package/src/CommonTypes/CommonTypes.ts +228 -0
- package/src/CommonTypes/FunctionResult.ts +0 -59
- package/src/Data/Creator.ts +1 -0
- package/src/Data/DefaultConfigurations.ts +6 -2
- package/src/Data/Stubs.ts +30 -29
- package/src/Data/dto/dialog/LocalDialogDTO.ts +2 -2
- package/src/Data/dto/dialog/RemoteDialogDTO.ts +2 -2
- package/src/Data/mapper/DialogLocalDTOMapper.ts +4 -10
- package/src/Data/mapper/DialogRemoteDTOMapper.ts +5 -10
- package/src/Data/repository/ConnectionRepository.ts +1 -0
- package/src/Data/repository/UsersRepository.ts +1 -1
- package/src/Data/source/local/ChatLocalStorageDataSource.ts +14 -14
- package/src/Data/source/remote/Mapper/DialogDTOMapper.ts +65 -47
- package/src/Data/source/remote/Mapper/FileDTOMapper.ts +4 -0
- package/src/Data/source/remote/Mapper/MessageDTOMapper.ts +1 -0
- package/src/Data/source/remote/Mapper/UserDTOMapper.ts +1 -0
- package/src/Data/source/remote/RemoteDataSource.ts +31 -10
- package/src/Domain/entity/LastMessageEntity.ts +1 -1
- package/src/Presentation/Views/Dialog/useDialogViewModel.ts +8 -0
- package/src/Presentation/Views/DialogInfo/DialogInfo.tsx +1 -1
- package/src/Presentation/Views/DialogList/DialogList.tsx +65 -2
- package/src/Presentation/Views/EditDialog/EditDialog.tsx +4 -3
- package/src/Presentation/Views/InviteMembers/InviteMembers.tsx +9 -1
- package/src/Presentation/Views/PreviewDialog/PreviewDialog.tsx +1 -0
- package/src/Presentation/layouts/Desktop/QuickBloxUIKitDesktopLayout.tsx +388 -515
- package/src/Presentation/layouts/TestStage/LoginView/Login.tsx +7 -11
- package/src/Presentation/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider.tsx +30 -2
- package/src/Presentation/ui-components/SettingsItem/SettingsItem.stories.tsx +1 -0
- package/src/Presentation/ui-components/TextField/TextField.tsx +58 -48
- package/src/QBconfig.ts +13 -11
- package/src/qb-api-calls/index.ts +39 -14
- package/src/utils/formatFileSize.ts +8 -0
- package/src/utils/parse.ts +2 -0
- package/storybook-static/703.1137fb37.iframe.bundle.js +33 -0
- package/storybook-static/703.1137fb37.iframe.bundle.js.map +1 -0
- package/storybook-static/{758.53b4954a.iframe.bundle.js → 938.56e9d83c.iframe.bundle.js} +1 -14
- package/storybook-static/Presentation-ui-components-Avatar-avatar-stories.1b74ae55.iframe.bundle.js +14 -0
- package/storybook-static/Presentation-ui-components-Avatar-avatar-stories.1b74ae55.iframe.bundle.js.map +1 -0
- package/storybook-static/Presentation-ui-components-Button-Button-stories.84103f20.iframe.bundle.js +14 -0
- package/storybook-static/Presentation-ui-components-Button-Button-stories.84103f20.iframe.bundle.js.map +1 -0
- package/storybook-static/Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.bf9005d3.iframe.bundle.js +14 -0
- package/storybook-static/Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.bf9005d3.iframe.bundle.js.map +1 -0
- package/storybook-static/Presentation-ui-components-DialogWindow-DialogWindow-stories.f81a8e38.iframe.bundle.js +14 -0
- package/storybook-static/Presentation-ui-components-DialogWindow-DialogWindow-stories.f81a8e38.iframe.bundle.js.map +1 -0
- package/storybook-static/Presentation-ui-components-Dropdown-Dropdown-stories.141a3ae7.iframe.bundle.js +14 -0
- package/storybook-static/Presentation-ui-components-Dropdown-Dropdown-stories.141a3ae7.iframe.bundle.js.map +1 -0
- package/storybook-static/Presentation-ui-components-Header-Header-stories.9f45c30e.iframe.bundle.js +14 -0
- package/storybook-static/Presentation-ui-components-Header-Header-stories.9f45c30e.iframe.bundle.js.map +1 -0
- package/storybook-static/Presentation-ui-components-Loader-Loader-stories.af01e15d.iframe.bundle.js +14 -0
- package/storybook-static/Presentation-ui-components-Loader-Loader-stories.af01e15d.iframe.bundle.js.map +1 -0
- package/storybook-static/Presentation-ui-components-Message-Message-stories.264d251d.iframe.bundle.js +14 -0
- package/storybook-static/Presentation-ui-components-Message-Message-stories.264d251d.iframe.bundle.js.map +1 -0
- package/storybook-static/Presentation-ui-components-MessageInput-MessageInput-stories.0c6310aa.iframe.bundle.js +1 -0
- package/storybook-static/{Presentation-ui-components-Placeholder-Placeholder-stories.871f508c.iframe.bundle.js → Presentation-ui-components-Placeholder-Placeholder-stories.97287936.iframe.bundle.js} +14 -1
- package/storybook-static/Presentation-ui-components-Placeholder-Placeholder-stories.97287936.iframe.bundle.js.map +1 -0
- package/storybook-static/Presentation-ui-components-PreviewFileMessage-PreviewFileMessage-stories.a9f5cd67.iframe.bundle.js +14 -0
- package/storybook-static/Presentation-ui-components-PreviewFileMessage-PreviewFileMessage-stories.a9f5cd67.iframe.bundle.js.map +1 -0
- package/storybook-static/Presentation-ui-components-SettingsItem-SettingsItem-stories.429a72d5.iframe.bundle.js +14 -0
- package/storybook-static/Presentation-ui-components-SettingsItem-SettingsItem-stories.429a72d5.iframe.bundle.js.map +1 -0
- package/storybook-static/Presentation-ui-components-TextField-TextField-stories.fd8caf6c.iframe.bundle.js +14 -0
- package/storybook-static/Presentation-ui-components-TextField-TextField-stories.fd8caf6c.iframe.bundle.js.map +1 -0
- package/storybook-static/{Presentation-ui-components-Toast-Toast-stories.55e63162.iframe.bundle.js → Presentation-ui-components-Toast-Toast-stories.b903385b.iframe.bundle.js} +14 -1
- package/storybook-static/Presentation-ui-components-Toast-Toast-stories.b903385b.iframe.bundle.js.map +1 -0
- package/storybook-static/{Presentation-ui-components-UserListItem-UserListItem-stories.04d3eefe.iframe.bundle.js → Presentation-ui-components-UserListItem-UserListItem-stories.8781472b.iframe.bundle.js} +14 -1
- package/storybook-static/Presentation-ui-components-UserListItem-UserListItem-stories.8781472b.iframe.bundle.js.map +1 -0
- package/storybook-static/{docs-Introduction-mdx.ac401482.iframe.bundle.js → docs-Introduction-mdx.bcb06844.iframe.bundle.js} +2 -2
- package/storybook-static/{docs-Introduction-mdx.ac401482.iframe.bundle.js.map → docs-Introduction-mdx.bcb06844.iframe.bundle.js.map} +1 -1
- package/storybook-static/iframe.html +2 -2
- package/storybook-static/{main.597d432b.iframe.bundle.js → main.2f6d7582.iframe.bundle.js} +1 -1
- package/storybook-static/project.json +1 -1
- package/storybook-static/runtime~main.8d5710fb.iframe.bundle.js +1 -0
- package/webpack.config.js +2 -1
- package/storybook-static/758.53b4954a.iframe.bundle.js.map +0 -1
- package/storybook-static/Presentation-ui-components-Avatar-avatar-stories.cf806856.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-Button-Button-stories.4fac7996.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.6665bbfb.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-DialogWindow-DialogWindow-stories.cf340397.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-Dropdown-Dropdown-stories.b32a1e17.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-Header-Header-stories.073c4507.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-Loader-Loader-stories.9bf3fb63.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-Message-Message-stories.343dfae0.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-MessageInput-MessageInput-stories.c2ead6a5.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-PreviewFileMessage-PreviewFileMessage-stories.527e000e.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-SettingsItem-SettingsItem-stories.2ff75703.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-TextField-TextField-stories.4a2eef3e.iframe.bundle.js +0 -1
- package/storybook-static/runtime~main.12da9712.iframe.bundle.js +0 -1
|
@@ -81,6 +81,8 @@ const DialogList: React.FC<DialogsProps> = ({
|
|
|
81
81
|
const [showSearchDialogs, setShowSearchDialogs] = React.useState(false);
|
|
82
82
|
const [nameDialogForSearch, setNameDialogForSearch] = React.useState('');
|
|
83
83
|
const [isMobile] = useMobileLayout();
|
|
84
|
+
const [pointerEventsValue, setPointerEventsValue] =
|
|
85
|
+
React.useState<string>('auto');
|
|
84
86
|
|
|
85
87
|
useEffect(() => {
|
|
86
88
|
dialogs.slice(0);
|
|
@@ -115,6 +117,27 @@ const DialogList: React.FC<DialogsProps> = ({
|
|
|
115
117
|
|
|
116
118
|
setDialogsToView(dialogs);
|
|
117
119
|
}, [dialogListViewModel?.dialogs, selectedDialog]);
|
|
120
|
+
let timeout: NodeJS.Timeout | number | undefined;
|
|
121
|
+
|
|
122
|
+
useEffect(() => {
|
|
123
|
+
return () => {
|
|
124
|
+
if (timeout) {
|
|
125
|
+
clearTimeout(timeout);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}, []);
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
// let timeout: NodeJS.Timeout | number | undefined;
|
|
131
|
+
|
|
132
|
+
if (dialogListViewModel && dialogListViewModel.loading) {
|
|
133
|
+
setPointerEventsValue('none');
|
|
134
|
+
timeout = setTimeout(() => {
|
|
135
|
+
setPointerEventsValue('auto');
|
|
136
|
+
}, 12000); // блокировать нажатие на 12 секунд
|
|
137
|
+
} else {
|
|
138
|
+
setPointerEventsValue('auto');
|
|
139
|
+
}
|
|
140
|
+
}, [dialogListViewModel.loading]);
|
|
118
141
|
|
|
119
142
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
120
143
|
const fetchMoreData = () => {
|
|
@@ -185,7 +208,7 @@ const DialogList: React.FC<DialogsProps> = ({
|
|
|
185
208
|
let formattedValue = '';
|
|
186
209
|
|
|
187
210
|
if (item.entity.lastMessage.dateSent) {
|
|
188
|
-
dateInt =
|
|
211
|
+
dateInt = item.entity.lastMessage.dateSent;
|
|
189
212
|
if (Number.isNaN(dateInt)) {
|
|
190
213
|
return formattedValue;
|
|
191
214
|
}
|
|
@@ -219,6 +242,43 @@ const DialogList: React.FC<DialogsProps> = ({
|
|
|
219
242
|
return AvatarComponent;
|
|
220
243
|
};
|
|
221
244
|
|
|
245
|
+
/*
|
|
246
|
+
import React, {useState, useEffect} from 'react';
|
|
247
|
+
|
|
248
|
+
// предполагая, что dialogListViewModel определен в родительском компоненте и передан в этот компонент как проп
|
|
249
|
+
const YourComponent = ({ dialogListViewModel }) => {
|
|
250
|
+
const [pointerEventsValue, setPointerEvents] = useState('auto');
|
|
251
|
+
|
|
252
|
+
// поведение на 12 секунд
|
|
253
|
+
useEffect(() => {
|
|
254
|
+
let timeout;
|
|
255
|
+
if (dialogListViewModel && dialogListViewModel.loading) {
|
|
256
|
+
setPointerEvents('none');
|
|
257
|
+
timeout = setTimeout(() => {
|
|
258
|
+
setPointerEvents('auto');
|
|
259
|
+
}, 12000); // блокировать нажатие на 12 секунд
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// поведение на отмену эффекта
|
|
263
|
+
return () => {
|
|
264
|
+
if (timeout) {
|
|
265
|
+
clearTimeout(timeout);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}, [dialogListViewModel]);
|
|
269
|
+
|
|
270
|
+
return (
|
|
271
|
+
<div
|
|
272
|
+
style={{
|
|
273
|
+
pointerEventsValue: pointerEventsValue
|
|
274
|
+
}}
|
|
275
|
+
>
|
|
276
|
+
...
|
|
277
|
+
</div>
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
*/
|
|
281
|
+
|
|
222
282
|
return (
|
|
223
283
|
<div
|
|
224
284
|
key={index}
|
|
@@ -243,7 +303,10 @@ const DialogList: React.FC<DialogsProps> = ({
|
|
|
243
303
|
});
|
|
244
304
|
}}
|
|
245
305
|
style={{
|
|
246
|
-
pointerEvents: !dialogListViewModel?.loading ? 'auto' : 'none',
|
|
306
|
+
// pointerEvents: !dialogListViewModel?.loading ? 'auto' : 'none',
|
|
307
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
308
|
+
// @ts-ignore
|
|
309
|
+
pointerEvents: pointerEventsValue || 'auto',
|
|
247
310
|
}}
|
|
248
311
|
>
|
|
249
312
|
<PreviewDialog
|
|
@@ -14,6 +14,7 @@ import GroupChat from '../../components/UI/svgs/Icons/Contents/GroupChat';
|
|
|
14
14
|
import PublicChannel from '../../components/UI/svgs/Icons/Contents/PublicChannel';
|
|
15
15
|
import useQbInitializedDataContext from '../../providers/QuickBloxUIKitProvider/useQbInitializedDataContext';
|
|
16
16
|
import { Button, TextField } from '../../ui-components';
|
|
17
|
+
import { formatFileSize } from '../../../utils/formatFileSize';
|
|
17
18
|
import './EditDialog.scss';
|
|
18
19
|
|
|
19
20
|
export const TypeOpenDialog = {
|
|
@@ -47,9 +48,9 @@ const EditDialog: React.FC<EditDialogProps> = ({
|
|
|
47
48
|
const maxUploadFileSize = currentContext.InitParams.maxFileSize;
|
|
48
49
|
const minLengthNameDialog = 3;
|
|
49
50
|
const maxLengthNameDialog = 60;
|
|
50
|
-
const errorMessageUploadMaxSize = `file
|
|
51
|
-
maxUploadFileSize
|
|
52
|
-
}
|
|
51
|
+
const errorMessageUploadMaxSize = `The file should not exceed this size: ${formatFileSize(
|
|
52
|
+
maxUploadFileSize,
|
|
53
|
+
)}`;
|
|
53
54
|
|
|
54
55
|
const [dialogName, setDialogName] = useState(nameDialog);
|
|
55
56
|
const [fileUploadAvatar, setFileUploadAvatar] = useState<File | null>(null);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
2
|
import './InviteMembers.scss';
|
|
3
3
|
import ColumnContainer from '../../components/containers/ColumnContainer/ColumnContainer';
|
|
4
4
|
import RowRightContainer from '../../components/containers/RowRightContainer/RowRightContainer';
|
|
@@ -143,6 +143,7 @@ const InviteMembers: React.FC<InviteMembersProps> = ({
|
|
|
143
143
|
};
|
|
144
144
|
|
|
145
145
|
const [userNameForFilter, setUserNameForFilter] = useState<string>('');
|
|
146
|
+
const inputRef = useRef<HTMLInputElement>(null);
|
|
146
147
|
|
|
147
148
|
useEffect(() => {
|
|
148
149
|
if (userNameForFilter.length > 2) {
|
|
@@ -150,6 +151,9 @@ const InviteMembers: React.FC<InviteMembersProps> = ({
|
|
|
150
151
|
|
|
151
152
|
userViewModel.updateFilter(newFilter);
|
|
152
153
|
}
|
|
154
|
+
|
|
155
|
+
setTimeout(() => inputRef.current?.focus(), 500);
|
|
156
|
+
|
|
153
157
|
if (userNameForFilter.length === 0) {
|
|
154
158
|
userViewModel.updateFilter('');
|
|
155
159
|
}
|
|
@@ -159,6 +163,9 @@ const InviteMembers: React.FC<InviteMembersProps> = ({
|
|
|
159
163
|
if (userNameForFilter.length > 2) {
|
|
160
164
|
userViewModel.getUsers(new Pagination(0, userPerPage));
|
|
161
165
|
}
|
|
166
|
+
|
|
167
|
+
setTimeout(() => inputRef.current?.focus(), 500);
|
|
168
|
+
|
|
162
169
|
if (userNameForFilter.length === 0) {
|
|
163
170
|
userViewModel.getUsers(new Pagination(0, userPerPage));
|
|
164
171
|
}
|
|
@@ -170,6 +177,7 @@ const InviteMembers: React.FC<InviteMembersProps> = ({
|
|
|
170
177
|
<div className="container-invite-members--add-members-container">
|
|
171
178
|
<div className="container-invite-members--add-members-container--wrapper">
|
|
172
179
|
<TextField
|
|
180
|
+
ref={inputRef}
|
|
173
181
|
className="filtered-text-field"
|
|
174
182
|
disabled={userViewModel.loading}
|
|
175
183
|
placeholder="Search"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
2
2
|
import React, { useEffect } from 'react';
|
|
3
|
+
import QB from 'quickblox/quickblox';
|
|
3
4
|
import './PreviewDialog.scss';
|
|
4
5
|
import { DialogType } from '../../../Domain/entity/DialogTypes';
|
|
5
6
|
import PreviewDialogViewModel from './PreviewDialogViewModel';
|