@cometchat/chat-uikit-react-native 5.3.10 → 5.4.0

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 (138) hide show
  1. package/android/.gradle/7.4/checksums/checksums.lock +0 -0
  2. package/android/.gradle/7.4/fileChanges/last-build.bin +0 -0
  3. package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
  4. package/android/.gradle/7.4/gc.properties +0 -0
  5. package/android/.gradle/vcs-1/gc.properties +0 -0
  6. package/android/src/main/java/com/reactnativecometchatuikit/CometChatClipboardModule.kt +52 -0
  7. package/android/src/main/java/com/reactnativecometchatuikit/CometchatUiKitPackage.java +1 -0
  8. package/android/src/main/java/com/reactnativecometchatuikit/FileManager.java +95 -8
  9. package/android/src/main/java/com/reactnativecometchatuikit/RichTextEditorView.kt +237 -6
  10. package/android/src/main/java/com/reactnativecometchatuikit/RichTextEditorViewManager.kt +2 -1
  11. package/android/src/main/java/com/reactnativecometchatuikit/SoundPlayer.java +85 -47
  12. package/ios/CometChatClipboardModule.m +11 -0
  13. package/ios/CometChatClipboardModule.swift +41 -0
  14. package/ios/FileManager.m +201 -39
  15. package/ios/RichTextEditorView.swift +312 -4
  16. package/ios/RichTextEditorViewManager.m +1 -0
  17. package/ios/SoundPlayer.m +18 -6
  18. package/package.json +9 -7
  19. package/react-native-cometchat-ui-kit.podspec +1 -0
  20. package/src/CometChatCompactMessageComposer/CometChatCompactMessageComposer.tsx +692 -107
  21. package/src/CometChatConversations/CometChatConversations.tsx +19 -6
  22. package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +649 -49
  23. package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +23 -4
  24. package/src/CometChatMessageList/CometChatMessageList.tsx +463 -54
  25. package/src/CometChatMessageList/MANUAL_TEST_CASES.md +154 -0
  26. package/src/CometChatMessageList/components/MessageListItem.tsx +30 -17
  27. package/src/CometChatMessageList/style.ts +33 -5
  28. package/src/CometChatRichTextEditor/RichTextEditorViewNativeComponent.ts +13 -0
  29. package/src/CometChatRichTextEditor/index.tsx +25 -0
  30. package/src/CometChatSearch/CometChatSearch.tsx +296 -154
  31. package/src/calls/CallingExtension.tsx +19 -13
  32. package/src/extensions/LinkPreview/LinkPreviewBubble.tsx +20 -1
  33. package/src/extensions/ThumbnailGeneration/ThumbnailGenerationDecorator.tsx +20 -9
  34. package/src/index.ts +39 -0
  35. package/src/shared/CometChatUiKit/CometChatUIKit.ts +40 -34
  36. package/src/shared/base/Types.ts +3 -0
  37. package/src/shared/constants/UIKitConstants.ts +15 -1
  38. package/src/shared/framework/DataSource.ts +14 -4
  39. package/src/shared/framework/DataSourceDecorator.tsx +17 -8
  40. package/src/shared/framework/MessageDataSource.tsx +307 -60
  41. package/src/shared/helper/useToast.tsx +29 -0
  42. package/src/shared/icons/components/audio-file-type.tsx +11 -22
  43. package/src/shared/icons/components/document-file-type.tsx +11 -24
  44. package/src/shared/icons/components/image-file-type.tsx +12 -21
  45. package/src/shared/icons/components/link-file-type.tsx +25 -0
  46. package/src/shared/icons/components/pdf-file-type.tsx +11 -22
  47. package/src/shared/icons/components/presentation-file-type.tsx +11 -24
  48. package/src/shared/icons/components/spreadsheet-file-type.tsx +11 -24
  49. package/src/shared/icons/components/text-file-type.tsx +11 -21
  50. package/src/shared/icons/components/unknown-file-type.tsx +21 -25
  51. package/src/shared/icons/components/video-file-type.tsx +11 -24
  52. package/src/shared/icons/components/zip-file-type.tsx +11 -24
  53. package/src/shared/icons/icon-mapping.tsx +2 -0
  54. package/src/shared/index.ts +28 -0
  55. package/src/shared/modals/AttachmentPickerConfiguration.ts +13 -0
  56. package/src/shared/modals/SelectedAttachment.ts +65 -0
  57. package/src/shared/modals/UploadState.ts +10 -0
  58. package/src/shared/modals/index.ts +4 -0
  59. package/src/shared/resources/CometChatLocalizeNew/resources/de/translation.json +42 -1
  60. package/src/shared/resources/CometChatLocalizeNew/resources/en/translation.json +42 -1
  61. package/src/shared/resources/CometChatLocalizeNew/resources/es/translation.json +43 -2
  62. package/src/shared/resources/CometChatLocalizeNew/resources/fr/translation.json +43 -2
  63. package/src/shared/resources/CometChatLocalizeNew/resources/hi/translation.json +43 -2
  64. package/src/shared/resources/CometChatLocalizeNew/resources/hu/translation.json +43 -2
  65. package/src/shared/resources/CometChatLocalizeNew/resources/it/translation.json +43 -2
  66. package/src/shared/resources/CometChatLocalizeNew/resources/ja/translation.json +43 -2
  67. package/src/shared/resources/CometChatLocalizeNew/resources/ko/translation.json +43 -2
  68. package/src/shared/resources/CometChatLocalizeNew/resources/lt/translation.json +43 -2
  69. package/src/shared/resources/CometChatLocalizeNew/resources/ms/translation.json +43 -2
  70. package/src/shared/resources/CometChatLocalizeNew/resources/nl/translation.json +43 -2
  71. package/src/shared/resources/CometChatLocalizeNew/resources/pt/translation.json +43 -2
  72. package/src/shared/resources/CometChatLocalizeNew/resources/ru/translation.json +43 -2
  73. package/src/shared/resources/CometChatLocalizeNew/resources/sv/translation.json +43 -2
  74. package/src/shared/resources/CometChatLocalizeNew/resources/tr/translation.json +43 -2
  75. package/src/shared/resources/CometChatLocalizeNew/resources/zh/translation.json +43 -2
  76. package/src/shared/resources/CometChatLocalizeNew/resources/zh-tw/translation.json +43 -2
  77. package/src/shared/services/UploadQueueService.ts +145 -0
  78. package/src/shared/services/index.ts +2 -0
  79. package/src/shared/utils/CometChatMessagePreview/CometChatMessagePreview.tsx +42 -18
  80. package/src/shared/utils/MessageUtils.tsx +13 -4
  81. package/src/shared/utils/attachmentLimits.ts +156 -0
  82. package/src/shared/utils/audioPlaybackCoordinator.ts +28 -0
  83. package/src/shared/utils/batchMediaContext.tsx +30 -0
  84. package/src/shared/utils/conversationUtils.ts +26 -4
  85. package/src/shared/utils/groupAttachments.ts +93 -0
  86. package/src/shared/utils/index.ts +8 -0
  87. package/src/shared/utils/openMultiFileChooser.ts +123 -0
  88. package/src/shared/utils/partitionAttachmentsByKind.ts +44 -0
  89. package/src/shared/views/ClipboardPasteHandler/ClipboardPasteHandler.ts +28 -0
  90. package/src/shared/views/ClipboardPasteHandler/NativeCometChatClipboardModule.ts +16 -0
  91. package/src/shared/views/ClipboardPasteHandler/index.ts +2 -0
  92. package/src/shared/views/CometChatActionSheet/CometChatActionSheet.tsx +1 -0
  93. package/src/shared/views/CometChatAttachmentPreview/CometChatAttachmentPreview.style.ts +32 -0
  94. package/src/shared/views/CometChatAttachmentPreview/CometChatAttachmentPreview.tsx +90 -0
  95. package/src/shared/views/CometChatAttachmentPreview/CometChatAttachmentPreviewItem.tsx +276 -0
  96. package/src/shared/views/CometChatAttachmentPreview/CometChatAttachmentTile.tsx +827 -0
  97. package/src/shared/views/CometChatAttachmentPreview/CometChatAttachmentTray.tsx +110 -0
  98. package/src/shared/views/CometChatAttachmentPreview/StagedVideoDurationProbe.tsx +53 -0
  99. package/src/shared/views/CometChatAttachmentPreview/index.ts +8 -0
  100. package/src/shared/views/CometChatAttachmentViewer/CometChatAttachmentViewer.tsx +305 -0
  101. package/src/shared/views/CometChatAttachmentViewer/index.ts +2 -0
  102. package/src/shared/views/CometChatAudioBubble/CometChatAudioBubble.tsx +71 -74
  103. package/src/shared/views/CometChatAudiosBubble/CometChatAudiosBubble.tsx +587 -0
  104. package/src/shared/views/CometChatAudiosBubble/index.ts +2 -0
  105. package/src/shared/views/CometChatBottomSheet/CometChatBottomSheet.tsx +5 -7
  106. package/src/shared/views/CometChatCaptionText/CometChatCaptionText.tsx +182 -0
  107. package/src/shared/views/CometChatCaptionText/index.ts +2 -0
  108. package/src/shared/views/CometChatComposerErrorBanner.tsx +83 -0
  109. package/src/shared/views/CometChatConversationStarter/CometChatConversationStarter.tsx +141 -0
  110. package/src/shared/views/CometChatConversationStarter/index.ts +2 -0
  111. package/src/shared/views/CometChatConversationSummary/CometChatConversationSummary.tsx +155 -0
  112. package/src/shared/views/CometChatConversationSummary/index.ts +2 -0
  113. package/src/shared/views/CometChatFileBubble/style.ts +6 -4
  114. package/src/shared/views/CometChatFilesBubble/CometChatFilesBubble.tsx +316 -0
  115. package/src/shared/views/CometChatFilesBubble/index.ts +2 -0
  116. package/src/shared/views/CometChatImagesBubble/CometChatImagesBubble.tsx +323 -0
  117. package/src/shared/views/CometChatImagesBubble/index.ts +2 -0
  118. package/src/shared/views/CometChatMediaViewer/CometChatMediaViewer.tsx +425 -0
  119. package/src/shared/views/CometChatMediaViewer/index.ts +2 -0
  120. package/src/shared/views/CometChatMediaViewer/mediaViewerUtils.ts +30 -0
  121. package/src/shared/views/CometChatMessageBubble/CometChatMessageBubble.tsx +14 -4
  122. package/src/shared/views/CometChatSendButtonView/CometChatSendButtonView.tsx +1 -0
  123. package/src/shared/views/CometChatSmartReplies/CometChatSmartReplies.tsx +172 -0
  124. package/src/shared/views/CometChatSmartReplies/index.ts +2 -0
  125. package/src/shared/views/CometChatVideoBubble/style.ts +3 -3
  126. package/src/shared/views/CometChatVideosBubble/CometChatVideosBubble.tsx +441 -0
  127. package/src/shared/views/CometChatVideosBubble/index.ts +2 -0
  128. package/src/shared/views/CometChatVoiceNoteBubble/CometChatVoiceNoteBubble.tsx +78 -0
  129. package/src/shared/views/CometChatVoiceNoteBubble/index.ts +2 -0
  130. package/src/shared/views/index.ts +37 -1
  131. package/src/theme/CometChatThemeHelper.ts +8 -0
  132. package/src/theme/default/color/dark.ts +9 -0
  133. package/src/theme/default/color/light.ts +10 -0
  134. package/src/theme/type.ts +73 -0
  135. package/src/CometChatMessageList/PERFORMANCE_ARCHITECTURE.md +0 -478
  136. package/src/CometChatMessageList/SEARCH_NAV_PERF_PLAN.md +0 -613
  137. package/src/shared/CometChatUiKit/CometChatUIKit.changes.md +0 -76
  138. package/src/shared/CometChatUiKit/checkAuthSettings-review.md +0 -211
@@ -125,6 +125,14 @@ export type CometChatMessageHeaderInterface = {
125
125
  * A function to **replace** the default menu items entirely.
126
126
  */
127
127
  options?: ({ user, group }: { user?: CometChat.User; group?: CometChat.Group }) => MenuItemInterface[];
128
+ /**
129
+ * When true, adds "Conversation Summary" as an item inside the ⋮ options menu.
130
+ */
131
+ showConversationSummaryButton?: boolean;
132
+ /**
133
+ * Called when the user taps "Conversation Summary" in the options menu.
134
+ */
135
+ onConversationSummaryPress?: () => void;
128
136
  };
129
137
 
130
138
  interface Translations {
@@ -162,6 +170,8 @@ export const CometChatMessageHeader = (props: CometChatMessageHeaderInterface) =
162
170
  onNewChatButtonClick,
163
171
  onChatHistoryButtonClick,
164
172
  options,
173
+ showConversationSummaryButton = false,
174
+ onConversationSummaryPress,
165
175
  } = props;
166
176
 
167
177
  const [groupObj, setGroupObj] = useState(group);
@@ -181,10 +191,19 @@ export const CometChatMessageHeader = (props: CometChatMessageHeaderInterface) =
181
191
 
182
192
  // Build menu items following CometChat pattern
183
193
  const buildMenuItems = useCallback((): MenuItemInterface[] => {
184
- if (options) return options({ user: userObj, group: groupObj });
185
-
186
- return [];
187
- }, [options, userObj, groupObj, isAgenticUser]);
194
+ const baseItems: MenuItemInterface[] = options ? options({ user: userObj, group: groupObj }) : [];
195
+ if (showConversationSummaryButton && onConversationSummaryPress) {
196
+ return [
197
+ ...baseItems,
198
+ {
199
+ text: t('ai_conversation_summary_title'),
200
+ onPress: onConversationSummaryPress,
201
+ icon: <Icon name="ai-conversation-summary" width={20} height={20} color={theme.color.iconSecondary} />,
202
+ },
203
+ ];
204
+ }
205
+ return baseItems;
206
+ }, [options, userObj, groupObj, isAgenticUser, showConversationSummaryButton, onConversationSummaryPress, theme, t]);
188
207
 
189
208
  // Handle option selection
190
209
  const handleOptionSelect = useCallback((item: MenuItemInterface) => {