quickblox-react-ui-kit 0.3.1-beta.5 → 0.3.1-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/Presentation/ui-components/TextField/TextField.d.ts +1 -1
  2. package/dist/index-ui.js +11 -41
  3. package/dist/index-ui.js.map +1 -1
  4. package/package.json +1 -1
  5. package/src/Data/source/remote/RemoteDataSource.ts +6 -2
  6. package/src/Presentation/Views/DialogList/DialogList.tsx +0 -37
  7. package/src/Presentation/Views/EditDialog/EditDialog.tsx +1 -0
  8. package/src/Presentation/layouts/Desktop/QuickBloxUIKitDesktopLayout.tsx +4 -1
  9. package/src/Presentation/ui-components/MessageInput/AttachmentUploader/AttachmentUploader.tsx +2 -0
  10. package/src/Presentation/ui-components/PreviewFileMessage/PreviewFileMessage.scss +1 -1
  11. package/src/Presentation/ui-components/Toast/Toast.scss +5 -0
  12. package/src/Presentation/ui-components/Toast/ToastProvider.tsx +1 -0
  13. package/storybook-static/{703.2cbec951.iframe.bundle.js → 703.776b9f13.iframe.bundle.js} +2 -2
  14. package/storybook-static/{703.2cbec951.iframe.bundle.js.map → 703.776b9f13.iframe.bundle.js.map} +1 -1
  15. package/storybook-static/Presentation-ui-components-MessageInput-MessageInput-stories.0d1800d9.iframe.bundle.js +1 -0
  16. package/storybook-static/{Presentation-ui-components-Toast-Toast-stories.b903385b.iframe.bundle.js → Presentation-ui-components-Toast-Toast-stories.1b8758fc.iframe.bundle.js} +2 -2
  17. package/storybook-static/{Presentation-ui-components-Toast-Toast-stories.b903385b.iframe.bundle.js.map → Presentation-ui-components-Toast-Toast-stories.1b8758fc.iframe.bundle.js.map} +1 -1
  18. package/storybook-static/iframe.html +1 -1
  19. package/storybook-static/project.json +1 -1
  20. package/storybook-static/{runtime~main.bbf4d5b0.iframe.bundle.js → runtime~main.3464b25a.iframe.bundle.js} +1 -1
  21. package/storybook-static/static/css/{Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.2a9e5bc3.chunk.css → Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.6d563072.chunk.css} +2 -2
  22. package/storybook-static/static/css/{Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.2a9e5bc3.chunk.css.map → Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.6d563072.chunk.css.map} +1 -1
  23. package/storybook-static/static/css/Presentation-ui-components-PreviewFileMessage-PreviewFileMessage-stories.31cd021e.chunk.css +3 -0
  24. package/storybook-static/static/css/Presentation-ui-components-PreviewFileMessage-PreviewFileMessage-stories.31cd021e.chunk.css.map +1 -0
  25. package/storybook-static/static/css/{Presentation-ui-components-Toast-Toast-stories.11d83296.chunk.css → Presentation-ui-components-Toast-Toast-stories.a5b284f4.chunk.css} +2 -2
  26. package/storybook-static/static/css/{Presentation-ui-components-Toast-Toast-stories.11d83296.chunk.css.map → Presentation-ui-components-Toast-Toast-stories.a5b284f4.chunk.css.map} +1 -1
  27. package/src/package_artan_react_ui.json +0 -91
  28. package/src/package_original.json +0 -115
  29. package/storybook-static/Presentation-ui-components-MessageInput-MessageInput-stories.bf8a24d1.iframe.bundle.js +0 -1
  30. package/storybook-static/static/css/Presentation-ui-components-PreviewFileMessage-PreviewFileMessage-stories.015ac417.chunk.css +0 -3
  31. package/storybook-static/static/css/Presentation-ui-components-PreviewFileMessage-PreviewFileMessage-stories.015ac417.chunk.css.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quickblox-react-ui-kit",
3
- "version": "0.3.1-beta.5",
3
+ "version": "0.3.1-beta.7",
4
4
  "main": "dist/index-ui.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -635,9 +635,13 @@ export class RemoteDataSource implements IRemoteDataSource {
635
635
  };
636
636
  QB.chat.onMessageErrorListener = (messageId: string, error: unknown) => {
637
637
  console.log(
638
- `EVENT: receive error messageid: ${messageId}, error: ${stringifyError(
638
+ `EVENT: receive error message id: ${messageId}, error: ${stringifyError(
639
639
  error,
640
- )}`,
640
+ )}, current auth status is: ${this.authProcessed ? 'true' : 'false'}`,
641
+ );
642
+ this.subscriptionOnSessionExpiredListener.informSubscribers(
643
+ true,
644
+ EventMessageType.LocalMessage,
641
645
  );
642
646
  };
643
647
 
@@ -242,43 +242,6 @@ const DialogList: React.FC<DialogsProps> = ({
242
242
  return AvatarComponent;
243
243
  };
244
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
-
282
245
  return (
283
246
  <div
284
247
  key={item.entity.id}
@@ -80,6 +80,7 @@ const EditDialog: React.FC<EditDialogProps> = ({
80
80
 
81
81
  const fileSize = file?.size || 0;
82
82
 
83
+ console.log('MAX_FILE_SIZE', maxUploadFileSize, ' fileSize', fileSize);
83
84
  if (fileSize >= maxUploadFileSize) {
84
85
  setErrorMessageUpload(errorMessageUploadMaxSize);
85
86
 
@@ -61,6 +61,7 @@ import useModal from '../../../hooks/useModal';
61
61
  import useQBConnection from '../../providers/QuickBloxUIKitProvider/useQBConnection';
62
62
  import { ProxyConfig } from '../../../CommonTypes/CommonTypes';
63
63
  import EventMessageType from '../../../Domain/entity/EventMessageType';
64
+ import { formatFileSize } from '../../../utils/formatFileSize';
64
65
 
65
66
  type AIWidgetPlaceHolder = {
66
67
  enabled: boolean;
@@ -922,7 +923,9 @@ const QuickBloxUIKitDesktopLayout: React.FC<
922
923
  }
923
924
  } else if (fileToSend) {
924
925
  toast(
925
- `file size ${fileToSend?.size} must be less then ${MAXSIZE_FOR_MESSAGE} mb.`,
926
+ `file size ${formatFileSize(
927
+ fileToSend?.size,
928
+ )} must be less then ${MAXSIZE_FOR_MESSAGE} mb.`,
926
929
  );
927
930
  setFileToSend(null);
928
931
  }
@@ -26,6 +26,8 @@ const AttachmentUploader: React.FC<AttachmentMessageProps> = ({
26
26
  style={{ display: 'none' }}
27
27
  onChange={(event) => {
28
28
  onChangeFile(event);
29
+ // eslint-disable-next-line no-param-reassign
30
+ event.target.value = '';
29
31
  }}
30
32
  disabled={disableAction}
31
33
  />
@@ -5,7 +5,7 @@
5
5
 
6
6
  &__image {
7
7
  object-fit: cover;
8
- display: block;
8
+ display: flex;
9
9
  width: 32px;
10
10
  height: 32px;
11
11
  background: var(--incoming-background, #e4e6e8);
@@ -1,3 +1,7 @@
1
+ .container {
2
+ width: 25%;
3
+ }
4
+
1
5
  .toast {
2
6
  min-height: 24px;
3
7
  padding: 4px 12px;
@@ -13,5 +17,6 @@
13
17
  line-height: 16px;
14
18
  letter-spacing: 0.5px;
15
19
  color: var(--main-background);
20
+ text-align: center;
16
21
  }
17
22
  }
@@ -14,6 +14,7 @@ export default function ToastProvider({ children }: ToastProps) {
14
14
  return (
15
15
  <ToastContext.Provider value={undefined}>
16
16
  <ToastContainer
17
+ className="container"
17
18
  position="top-center"
18
19
  autoClose={3000}
19
20
  bodyClassName="toast__body"