quickblox-react-ui-kit 0.5.0 → 0.5.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.
Files changed (41) hide show
  1. package/dist/Data/dto/file/LocalFileDTO.d.ts +1 -1
  2. package/dist/Data/dto/file/LocalFileDTO.d.ts.map +1 -1
  3. package/dist/Data/dto/file/RemoteFileDTO.d.ts +1 -1
  4. package/dist/Data/dto/file/RemoteFileDTO.d.ts.map +1 -1
  5. package/dist/Data/source/remote/Mapper/MessageDTOMapper.d.ts.map +1 -1
  6. package/dist/Data/source/remote/RemoteDataSource.d.ts.map +1 -1
  7. package/dist/Domain/entity/ChatMessageAttachmentEntity.d.ts +1 -1
  8. package/dist/Domain/entity/ChatMessageAttachmentEntity.d.ts.map +1 -1
  9. package/dist/Domain/entity/FileEntity.d.ts +1 -1
  10. package/dist/Domain/entity/FileEntity.d.ts.map +1 -1
  11. package/dist/Presentation/Views/Dialog/MessageItem/MessageItem.d.ts.map +1 -1
  12. package/dist/Presentation/Views/Dialog/useDialogViewModel.d.ts.map +1 -1
  13. package/dist/index-ui.js +7804 -8165
  14. package/package.json +2 -2
  15. package/src/Data/DefaultConfigurations.ts +1 -1
  16. package/src/Data/dto/file/LocalFileDTO.ts +1 -1
  17. package/src/Data/dto/file/RemoteFileDTO.ts +1 -1
  18. package/src/Data/source/remote/Mapper/MessageDTOMapper.ts +26 -13
  19. package/src/Data/source/remote/RemoteDataSource.ts +14 -7
  20. package/src/Domain/entity/ChatMessageAttachmentEntity.ts +1 -1
  21. package/src/Domain/entity/FileEntity.ts +1 -1
  22. package/src/Presentation/Views/Dialog/MessageItem/MessageItem.tsx +6 -1
  23. package/src/Presentation/Views/Dialog/SystemMessageBanner/SystemMessageBanner.scss +0 -1
  24. package/src/Presentation/Views/Dialog/useDialogViewModel.ts +21 -0
  25. package/src/Presentation/Views/DialogInfo/DialogInfo.scss +4 -2
  26. package/src/QBconfig.ts +2 -2
  27. package/storybook-static/363.a2d33b79.iframe.bundle.js +2 -0
  28. package/storybook-static/{363.2cb21716.iframe.bundle.js.LICENSE.txt → 363.a2d33b79.iframe.bundle.js.LICENSE.txt} +0 -13
  29. package/storybook-static/Presentation-ui-components-MessageInput-MessageInput-stories.9b4b2514.iframe.bundle.js +1 -0
  30. package/storybook-static/iframe.html +1 -1
  31. package/storybook-static/project.json +1 -1
  32. package/storybook-static/{runtime~main.7d4dacf8.iframe.bundle.js → runtime~main.940703c6.iframe.bundle.js} +1 -1
  33. package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +1 -1
  34. package/storybook-static/sb-addons/essentials-backgrounds-5/manager-bundle.js +3 -3
  35. package/storybook-static/sb-addons/essentials-measure-8/manager-bundle.js +1 -1
  36. package/storybook-static/sb-addons/essentials-outline-9/manager-bundle.js +1 -1
  37. package/storybook-static/sb-addons/essentials-toolbars-7/manager-bundle.js +1 -1
  38. package/storybook-static/sb-addons/essentials-viewport-6/manager-bundle.js +1 -1
  39. package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +1 -1
  40. package/storybook-static/363.2cb21716.iframe.bundle.js +0 -2
  41. package/storybook-static/Presentation-ui-components-MessageInput-MessageInput-stories.729e41fc.iframe.bundle.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quickblox-react-ui-kit",
3
- "version": "0.5.0",
3
+ "version": "0.5.1-beta.1",
4
4
  "main": "dist/index-ui.js",
5
5
  "types": "dist/index-ui.d.ts",
6
6
  "license": "MIT",
@@ -12,7 +12,7 @@
12
12
  "qb-ai-core": "^0.1.3",
13
13
  "qb-ai-rephrase": "^0.1.2",
14
14
  "qb-ai-translate": "^0.1.2",
15
- "quickblox": "^2.19.2",
15
+ "quickblox": "^2.19.3-beta.4",
16
16
  "media-recorder-js": "^2.1.0",
17
17
  "react": "^19.0.0",
18
18
  "react-dom": "^19.0.0",
@@ -256,7 +256,7 @@ export class DefaultConfigurations {
256
256
  },
257
257
  appConfig: {
258
258
  maxFileSize: 10 * 1024 * 1024,
259
- sessionTimeOut: 122,
259
+ sessionTimeOut: 119,
260
260
  chatProtocol: {
261
261
  active: 2,
262
262
  },
@@ -7,7 +7,7 @@ export class LocalFileDTO {
7
7
 
8
8
  public name: string;
9
9
 
10
- public size: number;
10
+ public size: number | string;
11
11
 
12
12
  public type?: string;
13
13
 
@@ -7,7 +7,7 @@ export class RemoteFileDTO {
7
7
 
8
8
  public name: string;
9
9
 
10
- public size: number;
10
+ public size: number | string;
11
11
 
12
12
  public type: string;
13
13
 
@@ -188,20 +188,33 @@ export class MessageDTOMapper implements IDTOMapper {
188
188
  }
189
189
 
190
190
  //
191
- public static convertAttachment(
192
- attachment: ChatMessageAttachmentEntity,
193
- ): ChatMessageAttachment {
194
- return {
195
- id: attachment.id.toString(),
196
- uid: attachment.uid || '',
197
- type: attachment.type.toString(),
198
- url: attachment.url || '',
199
- name: attachment.name || '',
200
- size: attachment.size || 0,
201
- };
202
- }
191
+ // public static convertAttachment(
192
+ // attachment: ChatMessageAttachmentEntity,
193
+ // ): ChatMessageAttachment {
194
+ // return {
195
+ // id: attachment.id.toString(),
196
+ // uid: attachment.uid || '',
197
+ // type: attachment.type.toString(),
198
+ // url: attachment.url || '',
199
+ // name: attachment.name || '',
200
+ // size: attachment.size || 0,
201
+ // };
202
+ // }
203
+ public static convertAttachment(
204
+ attachment: ChatMessageAttachmentEntity,
205
+ ): ChatMessageAttachment {
206
+ return {
207
+ id: attachment.id.toString(),
208
+ uid: attachment.uid?.toString() || '',
209
+ type: attachment.type.toString(),
210
+ url: attachment.url?.toString() || '',
211
+ name: attachment.name?.toString() || '',
212
+ size: attachment.size?.toString() || '',
213
+ } as ChatMessageAttachment;
214
+ }
215
+
203
216
 
204
- public static convertToQBChatNewMessage(
217
+ public static convertToQBChatNewMessage(
205
218
  messages: RemoteMessageDTO[],
206
219
  ): QBChatMessage[] {
207
220
  return messages.map((message) => {
@@ -1729,13 +1729,20 @@ export class RemoteDataSource implements IRemoteDataSource {
1729
1729
  if (dto.attachments?.length > 0) {
1730
1730
  qbEntity.extension.attachments = [];
1731
1731
  dto.attachments.forEach((att) => {
1732
- const chatMessageAttachment: ChatMessageAttachment = {
1733
- id: att.id,
1734
- name: att.name,
1735
- size: att.size,
1736
- type: att.type.toString(),
1737
- uid: att.uid,
1738
- };
1732
+ // const chatMessageAttachment: ChatMessageAttachment = {
1733
+ // id: att.id,
1734
+ // name: att.name,
1735
+ // size: att.size,
1736
+ // type: att.type.toString(),
1737
+ // uid: att.uid,
1738
+ // };
1739
+ const chatMessageAttachment: ChatMessageAttachment = {
1740
+ id: att.id?.toString(),
1741
+ name: att.name?.toString(),
1742
+ size: att.size?.toString(),
1743
+ type: att.type?.toString(),
1744
+ uid: att.uid?.toString(),
1745
+ };
1739
1746
 
1740
1747
  qbEntity.extension.attachments?.push(chatMessageAttachment);
1741
1748
  });
@@ -10,6 +10,6 @@ export default interface ChatMessageAttachmentEntity {
10
10
  /** Link to a file in Internet */
11
11
  url?: string;
12
12
  name?: string;
13
- size?: number;
13
+ size?: number | string;
14
14
  [key: string]: unknown;
15
15
  }
@@ -5,7 +5,7 @@ export interface FileEntity {
5
5
  uid: string;
6
6
  url?: string;
7
7
  name?: string;
8
- size?: number;
8
+ size?: number | string;
9
9
  type?: FileType;
10
10
  data?: File;
11
11
  }
@@ -196,10 +196,15 @@ export default function MessageItem({
196
196
  return (
197
197
  <>
198
198
  {message.qb_original_messages.map((nestedMessage) => {
199
+ const senderNameNestedMessage =
200
+ nestedMessage.sender?.full_name ||
201
+ nestedMessage.sender?.login ||
202
+ nestedMessage.sender?.email ||
203
+ '';
199
204
  return (
200
205
  <Message
201
206
  key={nestedMessage.id}
202
- userName={senderName}
207
+ userName={senderNameNestedMessage}
203
208
  status={getStatusMessage(nestedMessage)}
204
209
  time={getTimeShort24hFormat(message.date_sent)}
205
210
  type={currentMessageType}
@@ -10,7 +10,6 @@
10
10
  align-items: center;
11
11
  justify-content: center;
12
12
  flex-shrink: 0;
13
- width: 328px;
14
13
  position: relative;
15
14
  }
16
15
  .username-join-this-chat {
@@ -236,6 +236,27 @@ export default function useDialogViewModel(
236
236
  }
237
237
  }
238
238
 
239
+ if (message.qb_original_messages) {
240
+ const nestedObj = message.qb_original_messages
241
+ if (nestedObj && nestedObj.length > 0) {
242
+ if (userDictionary) {
243
+ nestedObj[0].sender = userDictionary[nestedObj[0].sender_id];
244
+ if (
245
+ nestedObj[0].sender &&
246
+ nestedObj[0].sender.full_name &&
247
+ regex &&
248
+ !regex.test(nestedObj[0].sender.full_name)
249
+ ) {
250
+ nestedObj[0].sender.full_name = 'Unknown';
251
+ }
252
+ }
253
+
254
+ obj.qb_original_messages = nestedObj
255
+ }
256
+
257
+ }
258
+
259
+
239
260
  return obj;
240
261
  });
241
262
 
@@ -80,15 +80,17 @@ $dialog-information-container-dialog-information-height: 64px;
80
80
  overflow: visible;
81
81
  }
82
82
  .dialog-information-profile-dialog-name {
83
- margin-top: 8px;
84
83
  color: var(--main-text, #0b1b0f);
85
84
  text-align: center;
86
85
  font: var(--title-title-medium);
87
86
  left: 134.5px;
88
87
  top: 112px;
89
- display: flex;
90
88
  align-items: center;
91
89
  justify-content: center;
90
+ margin: 8px 12px 0 12px;
91
+ white-space: nowrap;
92
+ overflow: hidden;
93
+ text-overflow: ellipsis;
92
94
  }
93
95
  .dialog-information-profile-edit {
94
96
  right: -10px;
package/src/QBconfig.ts CHANGED
@@ -123,11 +123,11 @@ export const QBConfig: QBUIKitConfig = {
123
123
  },
124
124
  appConfig: {
125
125
  maxFileSize: 10485760,
126
- sessionTimeOut: 122,
126
+ sessionTimeOut: 119,
127
127
  chatProtocol: {
128
128
  active: 2,
129
129
  },
130
- pingLocalhostTimeInterval: 0,
130
+ pingLocalhostTimeInterval: 5,
131
131
  chatReconnectionTimeInterval: 3,
132
132
  debug: true,
133
133
  enableForwarding: true,