quickblox-react-ui-kit 0.3.0-beta.2 → 0.3.0-beta.3

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 (129) hide show
  1. package/dist/Data/repository/DialogsRepository.d.ts +1 -0
  2. package/dist/Data/source/remote/IRemoteDataSource.d.ts +1 -0
  3. package/dist/Data/source/remote/RemoteDataSource.d.ts +2 -0
  4. package/dist/Domain/entity/DialogEventInfo.d.ts +4 -0
  5. package/dist/Domain/use_cases/GetAllMessagesForDialog.d.ts +3 -3
  6. package/dist/Domain/use_cases/UpdateCurrentDialogInDataSourceUseCase.d.ts +10 -0
  7. package/dist/Presentation/Views/Dialog/DialogViewModel.d.ts +2 -0
  8. package/dist/Presentation/Views/Dialog/MessageItem/MessageItem.d.ts +2 -2
  9. package/dist/Presentation/ui-components/MessageInput/MessageInput.stories.d.ts +4 -4
  10. package/dist/index-ui.js +549 -422
  11. package/dist/index-ui.js.map +1 -1
  12. package/dist/qb-api-calls/index.d.ts +1 -0
  13. package/package.json +1 -1
  14. package/src/App.tsx +2 -2
  15. package/src/Data/repository/DialogsRepository.ts +16 -0
  16. package/src/Data/source/remote/IRemoteDataSource.ts +2 -0
  17. package/src/Data/source/remote/RemoteDataSource.ts +89 -10
  18. package/src/Domain/entity/DialogEventInfo.ts +4 -0
  19. package/src/Domain/use_cases/GetAllMessagesForDialog.ts +3 -3
  20. package/src/Domain/use_cases/GetDialogByIdUseCase.ts +5 -1
  21. package/src/Domain/use_cases/UpdateCurrentDialogInDataSourceUseCase.ts +31 -0
  22. package/src/Presentation/Views/Dialog/DialogViewModel.ts +2 -0
  23. package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogsWithSearch.scss +10 -0
  24. package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogsWithSearch.tsx +12 -13
  25. package/src/Presentation/Views/Dialog/MessageItem/MessageItem.tsx +17 -9
  26. package/src/Presentation/Views/Dialog/useDialogViewModel.ts +64 -32
  27. package/src/Presentation/Views/DialogInfo/DialogInfo.scss +3 -11
  28. package/src/Presentation/Views/DialogInfo/MembersList/MembersList.scss +8 -99
  29. package/src/Presentation/Views/DialogInfo/MembersList/MembersList.tsx +9 -29
  30. package/src/Presentation/Views/DialogList/useDialogListViewModel.ts +83 -3
  31. package/src/Presentation/Views/EditDialog/EditDialog.scss +1 -40
  32. package/src/Presentation/Views/EditDialog/EditDialog.tsx +9 -14
  33. package/src/Presentation/Views/InviteMembers/InviteMembers.tsx +14 -15
  34. package/src/Presentation/icons/media/video-file.svg +2 -2
  35. package/src/Presentation/layouts/Desktop/DesktopLayout.scss +8 -8
  36. package/src/Presentation/layouts/Desktop/QuickBloxUIKitDesktopLayout.tsx +119 -100
  37. package/src/Presentation/ui-components/Avatar/avatar.stories.tsx +1 -1
  38. package/src/Presentation/ui-components/Badge/Badge.stories.ts +1 -1
  39. package/src/Presentation/ui-components/Button/Button.stories.ts +1 -1
  40. package/src/Presentation/ui-components/DialogBanner/DialogBanner.stories.ts +2 -1
  41. package/src/Presentation/ui-components/DialogItemPreview/DialogItemPreview.stories.tsx +29 -1
  42. package/src/Presentation/ui-components/DialogItemPreview/DialogItemPreview.tsx +4 -1
  43. package/src/Presentation/ui-components/DialogWindow/DialogWindow.stories.tsx +2 -1
  44. package/src/Presentation/ui-components/Dropdown/Dropdown.stories.tsx +2 -1
  45. package/src/Presentation/ui-components/Dropdown/Dropdown.tsx +4 -1
  46. package/src/Presentation/ui-components/Header/Header.stories.tsx +2 -1
  47. package/src/Presentation/ui-components/Loader/Loader.stories.ts +1 -1
  48. package/src/Presentation/ui-components/Message/Bubble/AttachmentBubble/AttachmentBubble.tsx +6 -1
  49. package/src/Presentation/ui-components/Message/Bubble/AudioBubble/AudioBubble.scss +13 -0
  50. package/src/Presentation/ui-components/Message/Bubble/AudioBubble/AudioBubble.tsx +16 -2
  51. package/src/Presentation/ui-components/Message/Bubble/VideoBubble/VideoBubble.scss +9 -0
  52. package/src/Presentation/ui-components/Message/Bubble/VideoBubble/VideoBubble.tsx +15 -17
  53. package/src/Presentation/ui-components/Message/Message.stories.tsx +80 -1
  54. package/src/Presentation/ui-components/MessageInput/MessageInput.stories.tsx +16 -8
  55. package/src/Presentation/ui-components/MessageSeparator/MessageSeparator.stories.ts +3 -1
  56. package/src/Presentation/ui-components/Placeholder/Placeholder.stories.tsx +2 -6
  57. package/src/Presentation/ui-components/PreviewFileMessage/PreviewFileMessage.stories.ts +12 -1
  58. package/src/Presentation/ui-components/SettingsItem/SettingsItem.stories.tsx +5 -1
  59. package/src/Presentation/ui-components/TextField/TextField.stories.ts +7 -2
  60. package/src/Presentation/ui-components/Toast/Toast.stories.tsx +1 -1
  61. package/src/Presentation/ui-components/UserListItem/UserListItem.stories.tsx +3 -1
  62. package/src/index.scss +0 -2
  63. package/src/qb-api-calls/index.ts +1 -0
  64. package/storybook-static/433.dffc897e.iframe.bundle.js +1 -0
  65. package/storybook-static/603.4cf0423b.iframe.bundle.js +1 -0
  66. package/storybook-static/{758.d99b0166.iframe.bundle.js → 758.e75a5a47.iframe.bundle.js} +3 -3
  67. package/storybook-static/{758.d99b0166.iframe.bundle.js.map → 758.e75a5a47.iframe.bundle.js.map} +1 -1
  68. package/storybook-static/{472.3c9e81e6.iframe.bundle.js → 768.e44c05aa.iframe.bundle.js} +3 -3
  69. package/storybook-static/{472.3c9e81e6.iframe.bundle.js.map → 768.e44c05aa.iframe.bundle.js.map} +1 -1
  70. package/storybook-static/{926.f14bb932.iframe.bundle.js → 926.f5308089.iframe.bundle.js} +2 -2
  71. package/storybook-static/{926.f14bb932.iframe.bundle.js.map → 926.f5308089.iframe.bundle.js.map} +1 -1
  72. package/storybook-static/Presentation-ui-components-Avatar-avatar-stories.cf806856.iframe.bundle.js +1 -0
  73. package/storybook-static/Presentation-ui-components-Badge-Badge-stories.9449e470.iframe.bundle.js +14 -0
  74. package/storybook-static/{Presentation-ui-components-Badge-Badge-stories.fea53429.iframe.bundle.js.map → Presentation-ui-components-Badge-Badge-stories.9449e470.iframe.bundle.js.map} +1 -1
  75. package/storybook-static/Presentation-ui-components-Button-Button-stories.4fac7996.iframe.bundle.js +1 -0
  76. package/storybook-static/Presentation-ui-components-DialogBanner-DialogBanner-stories.fa91d2c7.iframe.bundle.js +10 -0
  77. package/storybook-static/{Presentation-ui-components-DialogBanner-DialogBanner-stories.6b2a3f72.iframe.bundle.js.map → Presentation-ui-components-DialogBanner-DialogBanner-stories.fa91d2c7.iframe.bundle.js.map} +1 -1
  78. package/storybook-static/Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.90aa44c5.iframe.bundle.js +1 -0
  79. package/storybook-static/Presentation-ui-components-DialogWindow-DialogWindow-stories.3523a670.iframe.bundle.js +1 -0
  80. package/storybook-static/Presentation-ui-components-Dropdown-Dropdown-stories.aacf2ec2.iframe.bundle.js +1 -0
  81. package/storybook-static/Presentation-ui-components-Header-Header-stories.073c4507.iframe.bundle.js +1 -0
  82. package/storybook-static/Presentation-ui-components-Loader-Loader-stories.9bf3fb63.iframe.bundle.js +1 -0
  83. package/storybook-static/{Presentation-ui-components-Message-Message-stories.63bec01b.iframe.bundle.js → Presentation-ui-components-Message-Message-stories.343dfae0.iframe.bundle.js} +1 -1
  84. package/storybook-static/Presentation-ui-components-MessageInput-MessageInput-stories.262a0cf2.iframe.bundle.js +1 -0
  85. package/storybook-static/{Presentation-ui-components-MessageSeparator-MessageSeparator-stories.82483823.iframe.bundle.js → Presentation-ui-components-MessageSeparator-MessageSeparator-stories.a7d43c0b.iframe.bundle.js} +3 -3
  86. package/storybook-static/{Presentation-ui-components-MessageSeparator-MessageSeparator-stories.82483823.iframe.bundle.js.map → Presentation-ui-components-MessageSeparator-MessageSeparator-stories.a7d43c0b.iframe.bundle.js.map} +1 -1
  87. package/storybook-static/Presentation-ui-components-Placeholder-Placeholder-stories.871f508c.iframe.bundle.js +1 -0
  88. package/storybook-static/Presentation-ui-components-PreviewFileMessage-PreviewFileMessage-stories.1661d95b.iframe.bundle.js +1 -0
  89. package/storybook-static/Presentation-ui-components-SettingsItem-SettingsItem-stories.8f6fca84.iframe.bundle.js +1 -0
  90. package/storybook-static/Presentation-ui-components-TextField-TextField-stories.4a2eef3e.iframe.bundle.js +1 -0
  91. package/storybook-static/{Presentation-ui-components-Toast-Toast-stories.e26b2e07.iframe.bundle.js → Presentation-ui-components-Toast-Toast-stories.55e63162.iframe.bundle.js} +1 -1
  92. package/storybook-static/{Presentation-ui-components-UserListItem-UserListItem-stories.e88f4206.iframe.bundle.js → Presentation-ui-components-UserListItem-UserListItem-stories.04d3eefe.iframe.bundle.js} +1 -1
  93. package/storybook-static/docs-Introduction-mdx.ac401482.iframe.bundle.js +10 -0
  94. package/storybook-static/docs-Introduction-mdx.ac401482.iframe.bundle.js.map +1 -0
  95. package/storybook-static/docs-Styling-mdx.1d6c1212.iframe.bundle.js +10 -0
  96. package/storybook-static/docs-Styling-mdx.1d6c1212.iframe.bundle.js.map +1 -0
  97. package/storybook-static/iframe.html +4 -4
  98. package/storybook-static/index.json +1 -1
  99. package/storybook-static/main.597d432b.iframe.bundle.js +1 -0
  100. package/storybook-static/project.json +1 -1
  101. package/storybook-static/runtime~main.e945879b.iframe.bundle.js +1 -0
  102. package/storybook-static/static/css/{Presentation-ui-components-Message-Message-stories.a518b61a.chunk.css → Presentation-ui-components-Message-Message-stories.0e129b10.chunk.css} +3 -3
  103. package/storybook-static/static/css/{Presentation-ui-components-Message-Message-stories.a518b61a.chunk.css.map → Presentation-ui-components-Message-Message-stories.0e129b10.chunk.css.map} +1 -1
  104. package/storybook-static/static/css/{Presentation-ui-components-Placeholder-Placeholder-stories.1ebf88ab.chunk.css → Presentation-ui-components-Placeholder-Placeholder-stories.cb7fb80a.chunk.css} +1 -2
  105. package/storybook-static/static/css/Presentation-ui-components-Placeholder-Placeholder-stories.cb7fb80a.chunk.css.map +1 -0
  106. package/storybook-static/static/css/{main.4e852eef.css → main.6fa55a2c.css} +2 -2
  107. package/storybook-static/static/css/{main.4e852eef.css.map → main.6fa55a2c.css.map} +1 -1
  108. package/storybook-static/static/media/video-file.dc2971be489b2af7b1c04dcc55bfe881.svg +3 -0
  109. package/storybook-static/stories.json +1 -1
  110. package/storybook-static/312.0aa0e670.iframe.bundle.js +0 -1
  111. package/storybook-static/341.bea6d0bd.iframe.bundle.js +0 -1
  112. package/storybook-static/Presentation-ui-components-Avatar-avatar-stories.2fb23ae6.iframe.bundle.js +0 -1
  113. package/storybook-static/Presentation-ui-components-Badge-Badge-stories.fea53429.iframe.bundle.js +0 -14
  114. package/storybook-static/Presentation-ui-components-Button-Button-stories.f6c6437b.iframe.bundle.js +0 -1
  115. package/storybook-static/Presentation-ui-components-DialogBanner-DialogBanner-stories.6b2a3f72.iframe.bundle.js +0 -10
  116. package/storybook-static/Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.f1cb9d40.iframe.bundle.js +0 -1
  117. package/storybook-static/Presentation-ui-components-DialogWindow-DialogWindow-stories.0ad17c54.iframe.bundle.js +0 -1
  118. package/storybook-static/Presentation-ui-components-Dropdown-Dropdown-stories.3b620239.iframe.bundle.js +0 -1
  119. package/storybook-static/Presentation-ui-components-Header-Header-stories.45503161.iframe.bundle.js +0 -1
  120. package/storybook-static/Presentation-ui-components-Loader-Loader-stories.8b53bb33.iframe.bundle.js +0 -1
  121. package/storybook-static/Presentation-ui-components-MessageInput-MessageInput-stories.728a66ad.iframe.bundle.js +0 -1
  122. package/storybook-static/Presentation-ui-components-Placeholder-Placeholder-stories.0898ead6.iframe.bundle.js +0 -1
  123. package/storybook-static/Presentation-ui-components-PreviewFileMessage-PreviewFileMessage-stories.973cdb64.iframe.bundle.js +0 -1
  124. package/storybook-static/Presentation-ui-components-SettingsItem-SettingsItem-stories.0af0b8a8.iframe.bundle.js +0 -1
  125. package/storybook-static/Presentation-ui-components-TextField-TextField-stories.5987d2bb.iframe.bundle.js +0 -1
  126. package/storybook-static/main.0332574c.iframe.bundle.js +0 -1
  127. package/storybook-static/runtime~main.16726a14.iframe.bundle.js +0 -1
  128. package/storybook-static/static/css/Presentation-ui-components-Placeholder-Placeholder-stories.1ebf88ab.chunk.css.map +0 -1
  129. package/storybook-static/static/media/video-file.dbd1f8c63a3769f9e9a027f0922d56b2.svg +0 -3
@@ -18,6 +18,7 @@ export default class DialogsRepository implements IDialogsRepository {
18
18
  saveDialogToLocal(entity: DialogEntity): Promise<boolean>;
19
19
  createDialogInRemote(entity: DialogEntity): Promise<DialogEntity>;
20
20
  updateDialogInLocal(entity: DialogEntity): Promise<DialogEntity>;
21
+ updateCurrentDialogInLocalDataSource(entity: DialogEntity): Promise<DialogEntity>;
21
22
  updateDialogInRemote(entity: DialogEntity): Promise<DialogEntity>;
22
23
  getDialogFromLocal(dialogId: string): Promise<DialogEntity>;
23
24
  getDialogFromRemote(dialogId: string): Promise<DialogEntity>;
@@ -33,4 +33,5 @@ export interface IRemoteDataSource extends IRemoteMessaging<RemoteMessageDTO> {
33
33
  getFile(dto: RemoteFileDTO): Promise<RemoteFileDTO>;
34
34
  deleteFile(dto: RemoteFileDTO): Promise<void>;
35
35
  subscribeToChatConnectionEvents(fileId: string): Promise<void>;
36
+ updateCurrentDialog(dto: RemoteDialogDTO): void;
36
37
  }
@@ -41,8 +41,10 @@ export declare class RemoteDataSource implements IRemoteDataSource {
41
41
  private _authInformation;
42
42
  get authInformation(): AuthorizationData | undefined;
43
43
  set authInformation(value: AuthorizationData | undefined);
44
+ private currentDialog;
44
45
  getCurrentDialogDTOMapper(): IDTOMapper;
45
46
  constructor();
47
+ updateCurrentDialog(dto: RemoteDialogDTO): void;
46
48
  setUpMockStorage(): Promise<void>;
47
49
  private createUserSession;
48
50
  static initSDK(sdkParams: QBInitParams): boolean;
@@ -1,14 +1,18 @@
1
1
  import EventMessageType from './EventMessageType';
2
2
  import { NotificationTypes } from './NotificationTypes';
3
3
  import { MessageEntity } from './MessageEntity';
4
+ import { DialogEntity } from './DialogEntity';
4
5
  export type MessageStatus = {
6
+ deliveryStatus: 'delivered' | 'read' | 'sent' | 'sending';
5
7
  isTyping: boolean;
6
8
  userId: number;
7
9
  dialogId: string;
10
+ messageId: string;
8
11
  };
9
12
  export type DialogEventInfo = {
10
13
  eventMessageType: EventMessageType;
11
14
  notificationTypes: NotificationTypes | undefined;
15
+ dialogInfo?: DialogEntity | undefined;
12
16
  messageInfo: MessageEntity | undefined;
13
17
  messageStatus: MessageStatus | undefined;
14
18
  };
@@ -1,11 +1,11 @@
1
1
  import { IUseCase } from './base/IUseCase';
2
2
  import { MessageEntity } from '../entity/MessageEntity';
3
3
  import { IMessagesRepository } from '../repository/IMessagesRepository';
4
- import { Pagination } from '../repository/Pagination';
5
- export declare class GetAllMessagesForDialogMock implements IUseCase<void, Array<MessageEntity>> {
4
+ import { PaginatedResult, Pagination } from '../repository/Pagination';
5
+ export declare class GetAllMessagesForDialogMock implements IUseCase<void, PaginatedResult<MessageEntity>> {
6
6
  private messagesRepository;
7
7
  private readonly dialogId;
8
8
  private currentPagination;
9
9
  constructor(messagesRepository: IMessagesRepository, dialogId: string, currentPagination: Pagination);
10
- execute(): Promise<Array<MessageEntity>>;
10
+ execute(): Promise<PaginatedResult<MessageEntity>>;
11
11
  }
@@ -0,0 +1,10 @@
1
+ import { DialogEntity } from '../entity/DialogEntity';
2
+ import DialogsRepository from '../../Data/repository/DialogsRepository';
3
+ import { IUseCase } from './base/IUseCase';
4
+ import { GroupDialogEntity } from '../entity/GroupDialogEntity';
5
+ export declare class UpdateCurrentDialogInDataSourceUseCase implements IUseCase<void, DialogEntity> {
6
+ private dialogRepository;
7
+ private updateDialog;
8
+ constructor(dialogRepository: DialogsRepository, updateDialog: GroupDialogEntity);
9
+ execute(): Promise<DialogEntity>;
10
+ }
@@ -1,9 +1,11 @@
1
1
  import BaseViewModel, { FunctionTypeFileToToBoolean, FunctionTypeForwardMessagesParamsToBoolean, FunctionTypePaginationToVoid, FunctionTypeReplyMessagesParamsToBoolean, FunctionTypeStringToVoid, FunctionTypeVoidToVoid } from '../../../CommonTypes/BaseViewModel';
2
2
  import { MessageEntity } from '../../../Domain/entity/MessageEntity';
3
3
  import { DialogEntity } from '../../../Domain/entity/DialogEntity';
4
+ import { Pagination } from '../../../Domain/repository/Pagination';
4
5
  export interface DialogViewModel extends BaseViewModel<DialogEntity> {
5
6
  loading: boolean;
6
7
  error: string;
8
+ pagination: Pagination;
7
9
  messages: MessageEntity[];
8
10
  getMessages: FunctionTypePaginationToVoid;
9
11
  sendTextMessage: FunctionTypeStringToVoid;
@@ -5,7 +5,7 @@ import { AIMessageWidget } from '../AIWidgets/AIMessageWidget';
5
5
  import './MessageItem.scss';
6
6
  export type MessageItemProps = {
7
7
  message: MessageEntity;
8
- userId?: number;
8
+ currentUserId?: number;
9
9
  AITranslateWidget?: AIMessageWidget;
10
10
  AIAssistWidget?: AIMessageWidget;
11
11
  maxTokens: number;
@@ -19,4 +19,4 @@ export type MessageItemProps = {
19
19
  messagesToView: MessageEntity[];
20
20
  onError: (messageError: string) => void;
21
21
  };
22
- export default function MessageItem({ message, userId, enableForwarding, enableReplying, onReply, onForward, listRef, messagesToView, AITranslateWidget, AIAssistWidget, maxTokens, defaultTranslationLanguage, languagesForAITranslate, onError, }: MessageItemProps): JSX.Element | null;
22
+ export default function MessageItem({ message, currentUserId, enableForwarding, enableReplying, onReply, onForward, listRef, messagesToView, AITranslateWidget, AIAssistWidget, maxTokens, defaultTranslationLanguage, languagesForAITranslate, onError, }: MessageItemProps): JSX.Element | null;
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
2
2
  import MessageInput from './MessageInput';
3
3
  declare const meta: Meta<typeof MessageInput>;
4
4
  export default meta;
5
- export declare const Default: StoryObj<typeof MessageInput>;
6
- export declare const WithVoiceMessage: StoryObj<typeof MessageInput>;
7
- export declare const WithPreview: StoryObj<typeof MessageInput>;
8
- export declare const LoadingState: StoryObj<typeof MessageInput>;
5
+ export declare const MessageInputDefault: StoryObj<typeof MessageInput>;
6
+ export declare const MessageInputWithVoiceMessage: StoryObj<typeof MessageInput>;
7
+ export declare const MessageInputWithPreview: StoryObj<typeof MessageInput>;
8
+ export declare const MessageInputLoadingState: StoryObj<typeof MessageInput>;