@cometchat/chat-uikit-react-native 4.2.2 → 4.3.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 (227) hide show
  1. package/README.md +26 -67
  2. package/android/.gradle/7.4/checksums/checksums.lock +0 -0
  3. package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
  4. package/android/build.gradle +1 -1
  5. package/android/src/main/java/com/reactnativecometchatuikit/CometchatUiKitPackage.java +2 -1
  6. package/android/src/main/java/com/reactnativecometchatuikit/ReactVideoView.java +796 -0
  7. package/android/src/main/java/com/reactnativecometchatuikit/ReactVideoViewManager.java +172 -0
  8. package/android/src/main/java/com/scalablevideoview/BuildConfig.java +10 -0
  9. package/android/src/main/java/com/scalablevideoview/PivotPoint.java +13 -0
  10. package/android/src/main/java/com/scalablevideoview/ScalableType.java +34 -0
  11. package/android/src/main/java/com/scalablevideoview/ScalableVideoView.java +255 -0
  12. package/android/src/main/java/com/scalablevideoview/ScaleManager.java +188 -0
  13. package/android/src/main/java/com/scalablevideoview/Size.java +20 -0
  14. package/android/src/main/java/com/zipfile/APEZProvider.java +287 -0
  15. package/android/src/main/java/com/zipfile/APKExpansionSupport.java +81 -0
  16. package/android/src/main/java/com/zipfile/ZipResourceFile.java +428 -0
  17. package/android/src/main/res/values/attrs.xml +37 -0
  18. package/ios/FileManager.m +75 -5
  19. package/ios/Video/CCRCTVideo.h +67 -0
  20. package/ios/Video/CCRCTVideo.m +2031 -0
  21. package/ios/Video/CCRCTVideoManager.h +6 -0
  22. package/ios/Video/CCRCTVideoManager.m +133 -0
  23. package/ios/Video/CCRCTVideoPlayerViewController.h +20 -0
  24. package/ios/Video/CCRCTVideoPlayerViewController.m +43 -0
  25. package/ios/Video/CCRCTVideoPlayerViewControllerDelegate.h +7 -0
  26. package/ios/Video/UIView+FindUIViewController.h +15 -0
  27. package/ios/Video/UIView+FindUIViewController.m +21 -0
  28. package/ios/VideoCaching/RCTVideoCache.h +38 -0
  29. package/ios/VideoCaching/RCTVideoCache.m +174 -0
  30. package/ios/VideoPickerModule.h +7 -0
  31. package/ios/VideoPickerModule.mm +95 -0
  32. package/package.json +3 -4
  33. package/react-native-cometchat-ui-kit.podspec +24 -10
  34. package/src/CometChatContacts/CometChatContacts.tsx +12 -9
  35. package/src/CometChatConversations/CometChatConversations.tsx +84 -64
  36. package/src/CometChatDetails/CometChatDetails.tsx +14 -12
  37. package/src/CometChatGroupMembers/CometChatGroupMembers.tsx +8 -4
  38. package/src/CometChatGroupMembers/resources/check.png +0 -0
  39. package/src/CometChatGroupMembers/resources/index.ts +2 -0
  40. package/src/CometChatGroups/CometChatGroups.tsx +4 -4
  41. package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +57 -15
  42. package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +9 -2
  43. package/src/CometChatMessageInformation/CometChatMessageInformation.tsx +1 -1
  44. package/src/CometChatMessageList/CometChatMessageList.tsx +596 -181
  45. package/src/CometChatMessageList/MessageListConfiguration.ts +55 -4
  46. package/src/CometChatMessageList/resources/index.ts +5 -1
  47. package/src/CometChatMessageList/resources/leftarrowcurve.png +0 -0
  48. package/src/CometChatMessageList/resources/rightarrowcurve.png +0 -0
  49. package/src/CometChatMessages/CometChatMessages.tsx +1 -1
  50. package/src/CometChatThreadedMessages/CometChatThreadedMessages.tsx +4 -12
  51. package/src/CometChatThreadedMessages/style.ts +3 -1
  52. package/src/CometChatUsers/CometChatUsers.tsx +1 -1
  53. package/src/calls/CallUtils.ts +4 -8
  54. package/src/calls/CallingExtentionDecorator.tsx +5 -2
  55. package/src/calls/CometChatCallBubble/styles.ts +2 -1
  56. package/src/calls/CometChatCallButtons/CometChatCallButtons.tsx +14 -3
  57. package/src/calls/CometChatIncomingCall/CometChatIncomingCall.tsx +9 -9
  58. package/src/calls/CometChatOutgoingCall/CometChatOutgoingCall.tsx +80 -73
  59. package/src/extensions/CollaborativeBubble/styles.ts +2 -0
  60. package/src/extensions/SmartReplies/SmartRepliesDecorator.tsx +11 -0
  61. package/src/extensions/index.ts +0 -4
  62. package/src/index.ts +53 -8
  63. package/src/shared/CometChatUiKit/CometChatUIKit.ts +14 -2
  64. package/src/shared/constants/UIKitConstants.ts +1 -0
  65. package/src/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.ts +6 -0
  66. package/src/shared/events/CometChatUIEventHandler/Listener.ts +8 -0
  67. package/src/shared/events/ListenerInitializer.ts +6 -0
  68. package/src/shared/events/messages.ts +2 -0
  69. package/src/shared/framework/MessageDataSource.tsx +29 -25
  70. package/src/shared/index.ts +49 -1
  71. package/src/shared/libs/VideoPlayer/DRMType.js +6 -0
  72. package/src/shared/libs/VideoPlayer/FilterType.js +18 -0
  73. package/src/shared/libs/VideoPlayer/TextTrackType.js +5 -0
  74. package/src/shared/libs/VideoPlayer/Video.js +519 -0
  75. package/src/shared/libs/VideoPlayer/VideoResizeMode.js +5 -0
  76. package/src/shared/libs/VideoPlayerControls/OSSupport/PlatformSupport.tsx +43 -0
  77. package/src/shared/libs/VideoPlayerControls/OSSupport/TVOSSupport.tsx +16 -0
  78. package/src/shared/libs/VideoPlayerControls/OSSupport/index.tsx +1 -0
  79. package/src/shared/libs/VideoPlayerControls/VideoPlayer.tsx +511 -0
  80. package/src/shared/libs/VideoPlayerControls/assets/img/back.png +0 -0
  81. package/src/shared/libs/VideoPlayerControls/assets/img/back@2x.png +0 -0
  82. package/src/shared/libs/VideoPlayerControls/assets/img/back@3x.png +0 -0
  83. package/src/shared/libs/VideoPlayerControls/assets/img/bottom-vignette.png +0 -0
  84. package/src/shared/libs/VideoPlayerControls/assets/img/bottom-vignette@2x.png +0 -0
  85. package/src/shared/libs/VideoPlayerControls/assets/img/bottom-vignette@3x.png +0 -0
  86. package/src/shared/libs/VideoPlayerControls/assets/img/error-icon.png +0 -0
  87. package/src/shared/libs/VideoPlayerControls/assets/img/error-icon@2x.png +0 -0
  88. package/src/shared/libs/VideoPlayerControls/assets/img/error-icon@3x.png +0 -0
  89. package/src/shared/libs/VideoPlayerControls/assets/img/expand.png +0 -0
  90. package/src/shared/libs/VideoPlayerControls/assets/img/expand@2x.png +0 -0
  91. package/src/shared/libs/VideoPlayerControls/assets/img/expand@3x.png +0 -0
  92. package/src/shared/libs/VideoPlayerControls/assets/img/forward.png +0 -0
  93. package/src/shared/libs/VideoPlayerControls/assets/img/forward@2x.png +0 -0
  94. package/src/shared/libs/VideoPlayerControls/assets/img/forward@3x.png +0 -0
  95. package/src/shared/libs/VideoPlayerControls/assets/img/loader-icon.png +0 -0
  96. package/src/shared/libs/VideoPlayerControls/assets/img/loader-icon@2x.png +0 -0
  97. package/src/shared/libs/VideoPlayerControls/assets/img/loader-icon@3x.png +0 -0
  98. package/src/shared/libs/VideoPlayerControls/assets/img/pause.png +0 -0
  99. package/src/shared/libs/VideoPlayerControls/assets/img/pause@2x.png +0 -0
  100. package/src/shared/libs/VideoPlayerControls/assets/img/pause@3x.png +0 -0
  101. package/src/shared/libs/VideoPlayerControls/assets/img/play.png +0 -0
  102. package/src/shared/libs/VideoPlayerControls/assets/img/play@2x.png +0 -0
  103. package/src/shared/libs/VideoPlayerControls/assets/img/play@3x.png +0 -0
  104. package/src/shared/libs/VideoPlayerControls/assets/img/rewind.png +0 -0
  105. package/src/shared/libs/VideoPlayerControls/assets/img/rewind@2x.png +0 -0
  106. package/src/shared/libs/VideoPlayerControls/assets/img/rewind@3x.png +0 -0
  107. package/src/shared/libs/VideoPlayerControls/assets/img/shrink.png +0 -0
  108. package/src/shared/libs/VideoPlayerControls/assets/img/shrink@2x.png +0 -0
  109. package/src/shared/libs/VideoPlayerControls/assets/img/shrink@3x.png +0 -0
  110. package/src/shared/libs/VideoPlayerControls/assets/img/top-vignette.png +0 -0
  111. package/src/shared/libs/VideoPlayerControls/assets/img/top-vignette@2x.png +0 -0
  112. package/src/shared/libs/VideoPlayerControls/assets/img/top-vignette@3x.png +0 -0
  113. package/src/shared/libs/VideoPlayerControls/assets/img/volume.png +0 -0
  114. package/src/shared/libs/VideoPlayerControls/assets/img/volume@2x.png +0 -0
  115. package/src/shared/libs/VideoPlayerControls/assets/img/volume@3x.png +0 -0
  116. package/src/shared/libs/VideoPlayerControls/components/Back/Back.tsx +28 -0
  117. package/src/shared/libs/VideoPlayerControls/components/Back/index.ts +1 -0
  118. package/src/shared/libs/VideoPlayerControls/components/BottomControls.tsx +142 -0
  119. package/src/shared/libs/VideoPlayerControls/components/Control.tsx +45 -0
  120. package/src/shared/libs/VideoPlayerControls/components/Error/Error.tsx +22 -0
  121. package/src/shared/libs/VideoPlayerControls/components/Error/index.ts +1 -0
  122. package/src/shared/libs/VideoPlayerControls/components/Error/styles.ts +21 -0
  123. package/src/shared/libs/VideoPlayerControls/components/Fullscreen.tsx +36 -0
  124. package/src/shared/libs/VideoPlayerControls/components/Loader/Loader.tsx +15 -0
  125. package/src/shared/libs/VideoPlayerControls/components/Loader/index.ts +1 -0
  126. package/src/shared/libs/VideoPlayerControls/components/Loader/styles.ts +16 -0
  127. package/src/shared/libs/VideoPlayerControls/components/NullControl.tsx +7 -0
  128. package/src/shared/libs/VideoPlayerControls/components/Overlay.tsx +23 -0
  129. package/src/shared/libs/VideoPlayerControls/components/PlayPause/PlayPause.tsx +109 -0
  130. package/src/shared/libs/VideoPlayerControls/components/PlayPause/index.ts +1 -0
  131. package/src/shared/libs/VideoPlayerControls/components/PlayPause/styles.ts +21 -0
  132. package/src/shared/libs/VideoPlayerControls/components/Seekbar/Seekbar.tsx +47 -0
  133. package/src/shared/libs/VideoPlayerControls/components/Seekbar/index.ts +1 -0
  134. package/src/shared/libs/VideoPlayerControls/components/Seekbar/styles.ts +37 -0
  135. package/src/shared/libs/VideoPlayerControls/components/Timer/Timer.tsx +28 -0
  136. package/src/shared/libs/VideoPlayerControls/components/Timer/index.ts +1 -0
  137. package/src/shared/libs/VideoPlayerControls/components/Timer/styles.ts +12 -0
  138. package/src/shared/libs/VideoPlayerControls/components/Title.tsx +35 -0
  139. package/src/shared/libs/VideoPlayerControls/components/TopControls.tsx +110 -0
  140. package/src/shared/libs/VideoPlayerControls/components/Volume/Volume.tsx +37 -0
  141. package/src/shared/libs/VideoPlayerControls/components/Volume/index.ts +1 -0
  142. package/src/shared/libs/VideoPlayerControls/components/Volume/styles.ts +31 -0
  143. package/src/shared/libs/VideoPlayerControls/components/index.ts +14 -0
  144. package/src/shared/libs/VideoPlayerControls/components/styles.ts +30 -0
  145. package/src/shared/libs/VideoPlayerControls/hooks/index.ts +3 -0
  146. package/src/shared/libs/VideoPlayerControls/hooks/useAnimations.ts +68 -0
  147. package/src/shared/libs/VideoPlayerControls/hooks/useControlTimeout.tsx +67 -0
  148. package/src/shared/libs/VideoPlayerControls/hooks/usePanResponders.tsx +96 -0
  149. package/src/shared/libs/VideoPlayerControls/index.ts +4 -0
  150. package/src/shared/libs/VideoPlayerControls/styles.ts +19 -0
  151. package/src/shared/libs/VideoPlayerControls/types.ts +290 -0
  152. package/src/shared/libs/VideoPlayerControls/utils.ts +76 -0
  153. package/src/shared/modals/CometChatMessageTemplate.ts +113 -9
  154. package/src/shared/modals/InteractiveData/InteractiveMessage/SchedulerMessage.ts +23 -21
  155. package/src/shared/resources/CometChatLocalize/resources/ar/translation.json +4 -1
  156. package/src/shared/resources/CometChatLocalize/resources/de/translation.json +4 -1
  157. package/src/shared/resources/CometChatLocalize/resources/en/translation.json +6 -3
  158. package/src/shared/resources/CometChatLocalize/resources/es/translation.json +4 -1
  159. package/src/shared/resources/CometChatLocalize/resources/fr/translation.json +4 -1
  160. package/src/shared/resources/CometChatLocalize/resources/hi/translation.json +4 -1
  161. package/src/shared/resources/CometChatLocalize/resources/lt/translation.json +4 -1
  162. package/src/shared/resources/CometChatLocalize/resources/ms/translation.json +4 -1
  163. package/src/shared/resources/CometChatLocalize/resources/pt/translation.json +4 -1
  164. package/src/shared/resources/CometChatLocalize/resources/ru/translation.json +4 -1
  165. package/src/shared/resources/CometChatLocalize/resources/sv/translation.json +4 -1
  166. package/src/shared/resources/CometChatLocalize/resources/zh/translation.json +4 -1
  167. package/src/shared/resources/CometChatLocalize/resources/zh-tw/translation.json +4 -1
  168. package/src/shared/resources/CometChatTheme/Palette.ts +79 -45
  169. package/src/shared/resources/CometChatTheme/Typography.ts +18 -0
  170. package/src/shared/utils/CommonUtils.ts +71 -0
  171. package/src/shared/utils/PermissionUtilIOS.ts +104 -0
  172. package/src/shared/views/CometChatActionSheet/ActionSheetStyle.ts +3 -1
  173. package/src/shared/views/CometChatActionSheet/CometChatActionSheet.tsx +6 -6
  174. package/src/shared/views/CometChatAudioBubble/CometChatAudioBubble.tsx +28 -5
  175. package/src/shared/views/CometChatAudioBubble/style.ts +4 -2
  176. package/src/shared/views/CometChatAvatar/AvatarStyle.ts +1 -1
  177. package/src/shared/views/CometChatBottomSheet/CometChatBottomSheet.tsx +4 -3
  178. package/src/shared/views/CometChatEmojiKeyboard/CometChatEmojiKeyboard.tsx +47 -31
  179. package/src/shared/views/CometChatEmojiKeyboard/EmojiKeyboardConfiguration.ts +5 -5
  180. package/src/shared/views/CometChatEmojiKeyboard/EmojiKeyboardStyle.ts +12 -13
  181. package/src/shared/views/CometChatFileBubble/CometChatFileBubble.tsx +52 -5
  182. package/src/shared/views/CometChatFileBubble/style.ts +4 -2
  183. package/src/shared/views/CometChatImageBubble/CometChatImageBubble.tsx +25 -2
  184. package/src/shared/views/CometChatList/CometChatList.tsx +2 -1
  185. package/src/shared/views/CometChatMessageBubble/CometChatMessageBubble.tsx +51 -2
  186. package/src/shared/views/CometChatQuickReactions/CometChatQuickReactions.tsx +76 -0
  187. package/src/shared/views/CometChatQuickReactions/QuickReactionsConfiguration.tsx +12 -0
  188. package/src/shared/views/CometChatQuickReactions/QuickReactionsStyle.tsx +35 -0
  189. package/src/shared/views/CometChatQuickReactions/index.ts +12 -0
  190. package/src/shared/views/CometChatReactions/CometChatReactions.tsx +166 -0
  191. package/src/shared/views/CometChatReactions/ReactionsConfiguration.tsx +12 -0
  192. package/src/shared/views/CometChatReactions/ReactionsStyle.tsx +43 -0
  193. package/src/shared/views/CometChatReactions/index.ts +12 -0
  194. package/src/{extensions/Reactions/CometChatMessageReactions → shared/views/CometChatReactions}/style.ts +7 -7
  195. package/src/shared/views/CometChatReactionsList/CometChatReactionsList.tsx +335 -0
  196. package/src/shared/views/CometChatReactionsList/ReactionsListConfiguration.tsx +14 -0
  197. package/src/shared/views/CometChatReactionsList/ReactionsListStyle.tsx +67 -0
  198. package/src/shared/views/CometChatReactionsList/index.ts +12 -0
  199. package/src/shared/views/CometChatReactionsList/resources/Spineer.png +0 -0
  200. package/src/shared/views/CometChatReactionsList/resources/index.ts +5 -0
  201. package/src/shared/views/CometChatReceipt/CometChatReceipt.tsx +21 -4
  202. package/src/shared/views/CometChatReceipt/MessageConfiguration.ts +12 -0
  203. package/src/shared/views/CometChatReceipt/resources/error.png +0 -0
  204. package/src/shared/views/CometChatTextBubble/CometChatTextBubble.tsx +1 -1
  205. package/src/shared/views/CometChatVideoBubble/CometChatVideoBubble.tsx +78 -12
  206. package/src/shared/views/CometChatVideoBubble/VideoBubbleStyle.ts +52 -2
  207. package/src/shared/views/CometChatVideoPlayer/CometChatVideoPlayer.tsx +134 -0
  208. package/src/shared/views/CometChatVideoPlayer/index.tsx +1 -0
  209. package/src/shared/views/index.ts +30 -0
  210. package/android/.gradle/7.4.2/checksums/checksums.lock +0 -0
  211. package/android/.gradle/7.4.2/fileChanges/last-build.bin +0 -0
  212. package/android/.gradle/7.4.2/fileHashes/fileHashes.lock +0 -0
  213. package/android/.gradle/7.4.2/gc.properties +0 -0
  214. package/android/.gradle/checksums/checksums.lock +0 -0
  215. package/android/.idea/gradle.xml +0 -13
  216. package/android/.idea/misc.xml +0 -8
  217. package/android/.idea/modules/android.iml +0 -18
  218. package/android/.idea/modules.xml +0 -8
  219. package/android/.idea/vcs.xml +0 -6
  220. package/android/local.properties +0 -8
  221. package/src/extensions/Reactions/CometChatMessageReactions/CometChatMessageReactions.tsx +0 -249
  222. package/src/extensions/Reactions/CometChatMessageReactions/index.ts +0 -3
  223. package/src/extensions/Reactions/ReactionsDecorator.tsx +0 -164
  224. package/src/extensions/Reactions/ReactionsExtension.tsx +0 -48
  225. package/src/extensions/Reactions/index.ts +0 -4
  226. /package/src/{extensions/Reactions → shared/views/CometChatQuickReactions}/resources/AddReactions.png +0 -0
  227. /package/src/{extensions/Reactions → shared/views/CometChatQuickReactions}/resources/index.ts +0 -0
@@ -298,5 +298,8 @@
298
298
  "TRY_AGAIN_CAMEL": "Pabandykite dar kartą",
299
299
  "TIME_SLOT_UNAVAILABLE": "Laiko laiko tarpas nebėra. Prašome pasirinkti kitą.",
300
300
  "MEETING_SCHEDULER": "Susitikimų planuotojas",
301
- "MIN": "mi"
301
+ "MIN": "mi",
302
+ "TAP_TO_REMOVE":"Tocca per rimuovere",
303
+ "ALL":"Tutti",
304
+ "RESOURCE_PERMISSION_REQUIRED": "Questa funzionalità richiede autorizzazioni specifiche per le risorse. Abilita le autorizzazioni necessarie nelle impostazioni del tuo dispositivo"
302
305
  }
@@ -298,5 +298,8 @@
298
298
  "TRY_AGAIN_CAMEL": "Cuba lagi",
299
299
  "TIME_SLOT_UNAVAILABLE": "Slot masa tidak lagi tersedia. Sila pilih yang lain.",
300
300
  "MEETING_SCHEDULER": "Penjadual Mesyuarat",
301
- "MIN": "mi"
301
+ "MIN": "mi",
302
+ "TAP_TO_REMOVE":"Ketik untuk membuang",
303
+ "ALL":"Semua",
304
+ "RESOURCE_PERMISSION_REQUIRED": "Ciri ini memerlukan kebenaran sumber tertentu. Sila aktifkan keizinan yang diperlukan dalam tetapan peranti anda"
302
305
  }
@@ -298,5 +298,8 @@
298
298
  "TRY_AGAIN_CAMEL": "Tente novamente",
299
299
  "TIME_SLOT_UNAVAILABLE": "O intervalo de tempo não está mais disponível. Por favor, escolha outro.",
300
300
  "MEETING_SCHEDULER": "Agendador de reuniões",
301
- "MIN": "mi"
301
+ "MIN": "mi",
302
+ "TAP_TO_REMOVE":"Toque para remover",
303
+ "ALL":"Todos",
304
+ "RESOURCE_PERMISSION_REQUIRED": "Esse recurso requer permissões específicas de recursos. Ative as permissões necessárias nas configurações do seu dispositivo"
302
305
  }
@@ -298,5 +298,8 @@
298
298
  "TRY_AGAIN_CAMEL": "Попробуй еще раз",
299
299
  "TIME_SLOT_UNAVAILABLE": "Временной интервал больше не доступен. Пожалуйста, выберите другое.",
300
300
  "MEETING_SCHEDULER": "Планировщик собраний",
301
- "MIN": "миль"
301
+ "MIN": "миль",
302
+ "TAP_TO_REMOVE":"Нажмите, чтобы удалить",
303
+ "ALL":"Все",
304
+ "RESOURCE_PERMISSION_REQUIRED": "Для этой функции требуются определенные разрешения на использование ресурсов. Пожалуйста, включите необходимые разрешения в настройках устройства"
302
305
  }
@@ -298,5 +298,8 @@
298
298
  "TRY_AGAIN_CAMEL": "Försök igen",
299
299
  "TIME_SLOT_UNAVAILABLE": "Tidslucka är inte längre tillgänglig. Vänligen välj en annan.",
300
300
  "MEETING_SCHEDULER": "Mötesschemaläggare",
301
- "MIN": "mi"
301
+ "MIN": "mi",
302
+ "TAP_TO_REMOVE":"Tryck för att ta bort",
303
+ "ALL":"Allt",
304
+ "RESOURCE_PERMISSION_REQUIRED": "Den här funktionen kräver specifika resursbehörigheter. Aktivera nödvändiga behörigheter i dina enhetsinställningar"
302
305
  }
@@ -298,5 +298,8 @@
298
298
  "TRY_AGAIN_CAMEL": "再试一次",
299
299
  "TIME_SLOT_UNAVAILABLE": "时段不再可用。请选择另一个。",
300
300
  "MEETING_SCHEDULER": "会议安排器",
301
- "MIN": "mi"
301
+ "MIN": "mi",
302
+ "TAP_TO_REMOVE":"点按即可移除",
303
+ "ALL":"全部",
304
+ "RESOURCE_PERMISSION_REQUIRED": "此功能需要特定的资源权限。请在您的设备设置中启用必要的权限"
302
305
  }
@@ -298,5 +298,8 @@
298
298
  "TRY_AGAIN_CAMEL": "再試一次",
299
299
  "TIME_SLOT_UNAVAILABLE": "時段不再可用。請選擇其他。",
300
300
  "MEETING_SCHEDULER": "會議排程器",
301
- "MIN": "小米"
301
+ "MIN": "小米",
302
+ "TAP_TO_REMOVE":"點擊以移除",
303
+ "ALL":"全部",
304
+ "RESOURCE_PERMISSION_REQUIRED": "此功能需要特定的資源權限。請在設備設置中啟用必要的權限"
302
305
  }
@@ -1,3 +1,4 @@
1
+ type modeType = 'light' | 'dark'
1
2
  const modes = {
2
3
  light: 'light',
3
4
  dark: 'dark',
@@ -99,6 +100,8 @@ class PaletteItem {
99
100
  * @param {Object} backgroundColor
100
101
  * @param {Object} primary
101
102
  * @param {Object} primary40
103
+ * @param {Object} primary150
104
+ * @param {Object} primary500
102
105
  * @param {Object} secondary
103
106
  * @param {Object} error
104
107
  * @param {Object} success
@@ -122,6 +125,8 @@ class Palette {
122
125
  primary1: PaletteItem
123
126
  primary13: PaletteItem
124
127
  primary40: PaletteItem
128
+ primary150: PaletteItem
129
+ primary500: PaletteItem
125
130
  secondary: PaletteItem
126
131
  error: PaletteItem
127
132
  success: PaletteItem
@@ -158,9 +163,17 @@ class Palette {
158
163
  [modes.light]: 'rgba(51, 153, 255, .04)',
159
164
  [modes.dark]: 'rgba(51, 153, 255, .04)',
160
165
  }),
166
+ primary150 = new PaletteItem({
167
+ [modes.light]: 'rgba(51, 153, 255, .15)',
168
+ [modes.dark]: 'rgba(51, 153, 255, .15)',
169
+ }),
170
+ primary500 = new PaletteItem({
171
+ [modes.light]: 'rgba(51, 153, 255, .5)',
172
+ [modes.dark]: 'rgba(51, 153, 255, .5)',
173
+ }),
161
174
  secondary = new PaletteItem({
162
- [modes.light]: 'rgba(248, 248, 248, 0.92)',
163
- [modes.dark]: 'rgba(248, 248, 248, 0.92)',
175
+ [modes.light]: 'rgba(248, 248, 248, 0.9)',
176
+ [modes.dark]: 'rgba(248, 248, 248, 0.9)',
164
177
  }),
165
178
  error = new PaletteItem({
166
179
  [modes.light]: 'rgb(255, 59, 48)',
@@ -221,6 +234,8 @@ class Palette {
221
234
  this.primary1 = primary1;
222
235
  this.primary13 = primary13;
223
236
  this.primary40 = primary40;
237
+ this.primary150 = primary150;
238
+ this.primary500 = primary500;
224
239
  this.secondary = secondary;
225
240
  this.error = error;
226
241
  this.success = success;
@@ -240,62 +255,68 @@ class Palette {
240
255
  /**
241
256
  * Getters
242
257
  */
243
- getAccent = () => {
244
- return this.accent[this.mode];
258
+ getAccent = (mode?: modeType) => {
259
+ return this.accent[mode || this.mode];
245
260
  };
246
- getAccent50 = () => {
247
- return this.accent50[this.mode];
261
+ getAccent50 = (mode?: modeType) => {
262
+ return this.accent50[mode || this.mode];
248
263
  };
249
- getAccent100 = () => {
250
- return this.accent100[this.mode];
264
+ getAccent100 = (mode?: modeType) => {
265
+ return this.accent100[mode || this.mode];
251
266
  };
252
- getAccent200 = () => {
253
- return this.accent200[this.mode];
267
+ getAccent200 = (mode?: modeType) => {
268
+ return this.accent200[mode || this.mode];
254
269
  };
255
- getAccent300 = () => {
256
- return this.accent300[this.mode];
270
+ getAccent300 = (mode?: modeType) => {
271
+ return this.accent300[mode || this.mode];
257
272
  };
258
- getAccent400 = () => {
259
- return this.accent400[this.mode];
273
+ getAccent400 = (mode?: modeType) => {
274
+ return this.accent400[mode || this.mode];
260
275
  };
261
- getAccent500 = () => {
262
- return this.accent500[this.mode];
276
+ getAccent500 = (mode?: modeType) => {
277
+ return this.accent500[mode || this.mode];
263
278
  };
264
- getAccent600 = () => {
265
- return this.accent600[this.mode];
279
+ getAccent600 = (mode?: modeType) => {
280
+ return this.accent600[mode || this.mode];
266
281
  };
267
- getAccent700 = () => {
268
- return this.accent700[this.mode];
282
+ getAccent700 = (mode?: modeType) => {
283
+ return this.accent700[mode || this.mode];
269
284
  };
270
- getAccent800 = () => {
271
- return this.accent800[this.mode];
285
+ getAccent800 = (mode?: modeType) => {
286
+ return this.accent800[mode || this.mode];
272
287
  };
273
- getAccent900 = () => {
274
- return this.accent900[this.mode];
288
+ getAccent900 = (mode?: modeType) => {
289
+ return this.accent900[mode || this.mode];
275
290
  };
276
- getSuccess = () => {
277
- return this.success[this.mode];
291
+ getSuccess = (mode?: modeType) => {
292
+ return this.success[mode || this.mode];
278
293
  };
279
- getError = () => {
280
- return this.error[this.mode];
294
+ getError = (mode?: modeType) => {
295
+ return this.error[mode || this.mode];
281
296
  };
282
- getPrimary = () => {
283
- return this.primary[this.mode];
297
+ getPrimary = (mode?: modeType) => {
298
+ return this.primary[mode || this.mode];
284
299
  };
285
- getPrimary1 = () => {
286
- return this.primary1[this.mode];
300
+ getPrimary1 = (mode?: modeType) => {
301
+ return this.primary1[mode || this.mode];
287
302
  };
288
- getPrimary13 = () => {
289
- return this.primary13[this.mode];
303
+ getPrimary13 = (mode?: modeType) => {
304
+ return this.primary13[mode || this.mode];
290
305
  };
291
- getPrimary40 = () => {
292
- return this.primary40[this.mode];
306
+ getPrimary40 = (mode?: modeType) => {
307
+ return this.primary40[mode || this.mode];
308
+ }
309
+ getPrimary150 = (mode?: modeType) => {
310
+ return this.primary150[mode || this.mode];
293
311
  }
294
- getSecondary = () => {
295
- return this.secondary[this.mode];
312
+ getPrimary500 = (mode?: modeType) => {
313
+ return this.primary500[mode || this.mode];
314
+ }
315
+ getSecondary = (mode?: modeType) => {
316
+ return this.secondary[mode || this.mode];
296
317
  };
297
- getBackgroundColor = () => {
298
- return this.backgroundColor[this.mode];
318
+ getBackgroundColor = (mode?: modeType) => {
319
+ return this.backgroundColor[mode || this.mode];
299
320
  };
300
321
 
301
322
 
@@ -333,6 +354,24 @@ class Palette {
333
354
  }
334
355
  }
335
356
 
357
+ setSecondary(colorset) {
358
+ if (colorset && colorset[modes.light] && colorset[modes.dark]) {
359
+ this.secondary = colorset;
360
+ }
361
+ }
362
+
363
+ setPrimary150(colorset) {
364
+ if (colorset && colorset[modes.light] && colorset[modes.dark]) {
365
+ this.primary150 = colorset;
366
+ }
367
+ }
368
+
369
+ setPrimary500(colorset) {
370
+ if (colorset && colorset[modes.light] && colorset[modes.dark]) {
371
+ this.primary500 = colorset;
372
+ }
373
+ }
374
+
336
375
  setError(colorset) {
337
376
  if (colorset && colorset[modes.light] && colorset[modes.dark]) {
338
377
  this.error = colorset;
@@ -341,11 +380,6 @@ class Palette {
341
380
 
342
381
  setAccent(colorset) {
343
382
  if (colorset && colorset[modes.light] && colorset[modes.dark]) {
344
- this.setAccent({
345
- [modes.light]: colorset[modes.light],
346
- [modes.dark]: colorset[modes.dark],
347
- });
348
-
349
383
  this.setAccent900({
350
384
  [modes.light]: colorset[modes.dark],
351
385
  [modes.dark]: colorset[modes.light],
@@ -25,6 +25,7 @@ import { FontStyle } from "../../../shared/base";
25
25
  * @param {Object} text2
26
26
  * @param {Object} caption1
27
27
  * @param {Object} caption2
28
+ * @param {Object} caption3
28
29
  * @param {Object} body
29
30
  */
30
31
 
@@ -50,6 +51,7 @@ class Typography {
50
51
  text2: FontStyle
51
52
  caption1: FontStyle
52
53
  caption2: FontStyle
54
+ caption3: FontStyle
53
55
  body: FontStyle
54
56
  constructor({
55
57
  fontFamily = undefined,
@@ -153,6 +155,11 @@ class Typography {
153
155
  fontWeight: fontWeightMedium,
154
156
  fontSize: 11,
155
157
  }),
158
+ caption3 = new FontStyle({
159
+ fontFamily: fontFamily,
160
+ fontWeight: fontWeightRegular,
161
+ fontSize: 8,
162
+ }),
156
163
  body = new FontStyle({
157
164
  fontFamily: fontFamily,
158
165
  fontWeight: fontWeightRegular,
@@ -181,6 +188,7 @@ class Typography {
181
188
  this.text2 = new FontStyle(text2);
182
189
  this.caption1 = new FontStyle(caption1);
183
190
  this.caption2 = new FontStyle(caption2);
191
+ this.caption3 = new FontStyle(caption3);
184
192
  this.body = new FontStyle(body);
185
193
  }
186
194
 
@@ -364,6 +372,16 @@ class Typography {
364
372
  }
365
373
  }
366
374
 
375
+ setCaption3(captionFont) {
376
+ if (captionFont && captionFont.fontSize) {
377
+ this.caption3.fontSize = captionFont.fontSize;
378
+ }
379
+
380
+ if (captionFont && captionFont.fontWeight) {
381
+ this.caption3.fontWeight = captionFont.fontWeight;
382
+ }
383
+ }
384
+
367
385
  setBody(bodyFont) {
368
386
  if (bodyFont && bodyFont.fontSize) {
369
387
  this.body.fontSize = bodyFont.fontSize;
@@ -0,0 +1,71 @@
1
+ // @ts-ignore
2
+ import { CometChat } from '@cometchat/chat-sdk-react-native';
3
+
4
+ export class CommonUtils {
5
+
6
+ static clone<T extends any>(arg: T): T {
7
+ /*
8
+ If there are additional properties attached to a function or an array object other than the standard properties,
9
+ those properties will be ignored
10
+ Cannot copy private properties (those that start with a "#" symbol inside a class block)
11
+ Functions are copied by reference
12
+ */
13
+ if (typeof arg !== "object" || !arg) {
14
+ return arg;
15
+ }
16
+ let res;
17
+ if (Array.isArray(arg)) {
18
+ // arg is an array, there's no hatch to fool the Array.isArray method, so lets create an array
19
+ res = [];
20
+ for (const value of arg) {
21
+ res.push(CommonUtils.clone(value));
22
+ }
23
+ return res as T;
24
+ }
25
+ else {
26
+ // arg is an object
27
+ res = {};
28
+ const descriptor = Object.getOwnPropertyDescriptors(arg);
29
+ for (const k of Reflect.ownKeys(descriptor)) {
30
+ const curDescriptor = descriptor[k as any];
31
+ if (curDescriptor.hasOwnProperty("value")) {
32
+ // Property is a data property
33
+ Object.defineProperty(res, k, {
34
+ ...curDescriptor,
35
+ value: CommonUtils.clone(curDescriptor["value"])
36
+ });
37
+ }
38
+ else {
39
+ // Property is an accessor property
40
+ Object.defineProperty(res, k, curDescriptor);
41
+ }
42
+ }
43
+ Object.setPrototypeOf(res, Object.getPrototypeOf(arg));
44
+ }
45
+ return res as T;
46
+ }
47
+
48
+
49
+ static getComponentIdFromMessage(message : CometChat.BaseMessage):Object{
50
+ let id = {};
51
+ if (message.receiver instanceof CometChat.User) {
52
+ id['uid'] = (message.sender as CometChat.User).uid;
53
+ } else if (message.receiver instanceof CometChat.Group) {
54
+ id['guid'] = (message.receiver as CometChat.Group).guid;
55
+ }
56
+ if (message.parentMessageId && message.parentMessageId !== 0) {
57
+ id['parentMessageId'] = message.parentMessageId;
58
+ }
59
+ return id;
60
+ }
61
+
62
+ static checkIdBelongsToThisComponent(id, user :CometChat.User, group: CometChat.Group, parentMessageId :string| number): boolean{
63
+ if(id){
64
+ if(id['parentMessageId'] && ( id['parentMessageId'] != parentMessageId ))return false
65
+ if((id['uid'] || user) && id['uid'] != user?.uid) return false;
66
+ if( (id['guid'] || group) && id['guid'] != group?.guid) return false;
67
+ }
68
+ return true;
69
+ }
70
+
71
+ }
@@ -0,0 +1,104 @@
1
+ import { Alert, Linking, NativeModules, Platform } from 'react-native';
2
+ import { localize } from '../../shared/resources/CometChatLocalize/CometChatLocalize';
3
+ const { FileManager } = NativeModules;
4
+
5
+ let instance: PermissionUtilIOS;
6
+ const permissionStatus = {
7
+ 'Not Determined': 0,
8
+ 'Restricted': 1,
9
+ 'Denied': 2,
10
+ 'Authorized': 3,
11
+ 'Unknown': -1,
12
+ } as const;
13
+
14
+ const permissibleResources = ['camera', 'mic'] as const;
15
+ type TPermissibleResources = (typeof permissibleResources)[number];
16
+
17
+ type ValueOf<T> = T[keyof T];
18
+ type TPermissionStatus = ValueOf<typeof permissionStatus>;
19
+
20
+ const permissionStore: Record<TPermissibleResources, TPermissionStatus> = {
21
+ camera: permissionStatus.Unknown,
22
+ mic: permissionStatus.Unknown,
23
+ };
24
+
25
+ class PermissionUtilIOS {
26
+ status = permissionStatus;
27
+ constructor() {
28
+ if (instance) {
29
+ throw new Error('New instance cannot be created!!');
30
+ }
31
+ instance = this;
32
+ }
33
+
34
+ async init() {
35
+ try {
36
+ const res: Record<TPermissibleResources, TPermissionStatus> =
37
+ await FileManager.checkResourcesPermission(['mic', 'camera']);
38
+ for (const resourceType in res) {
39
+ permissionStore[resourceType as TPermissibleResources] =
40
+ res[resourceType as TPermissibleResources];
41
+ }
42
+ permissionStore.camera = res.camera;
43
+ permissionStore.mic = res.mic;
44
+ return true;
45
+ } catch (error: any) {
46
+ return false;
47
+ }
48
+ }
49
+
50
+ async get(resources: TPermissibleResources[]) {
51
+ return resources.map((resource) => {
52
+ if (!permissibleResources.includes(resource)) {
53
+ throw new Error('Invalid resource type');
54
+ }
55
+ return permissionStore[resource];
56
+ });
57
+ }
58
+
59
+ async request(resources: TPermissibleResources[]) {
60
+ for (const resource of resources) {
61
+ if (!permissibleResources.includes(resource)) {
62
+ throw new Error('Invalid resource type');
63
+ }
64
+ }
65
+ const res: Record<TPermissibleResources, TPermissionStatus> =
66
+ await FileManager.requestResourcesPermission(resources);
67
+ for (const resourceType in res) {
68
+ permissionStore[resourceType as TPermissibleResources] =
69
+ res[resourceType as TPermissibleResources];
70
+ }
71
+ }
72
+
73
+ async startResourceBasedTask(resources: TPermissibleResources[]) {
74
+ if (Platform.OS === 'ios') {
75
+ const resourcePermStatuses = await this.get(resources);
76
+ for (let i = 0; i < resourcePermStatuses.length; i++) {
77
+ const resourcePermStatus = resourcePermStatuses[i];
78
+ if (resourcePermStatus === this.status['Not Determined']) {
79
+ await this.request([resources[i]]);
80
+ [resourcePermStatuses[i]] = await this.get([resources[i]]);
81
+ }
82
+ if (resourcePermStatuses[i] === this.status.Denied) {
83
+ Alert.alert(localize('RESOURCE_PERMISSION_REQUIRED'), undefined, [
84
+ {
85
+ style: 'cancel',
86
+ text: localize('CANCEL'),
87
+ },
88
+ {
89
+ style: 'default',
90
+ text: localize('SETTINGS'),
91
+ onPress: () => {
92
+ Linking.openSettings();
93
+ },
94
+ },
95
+ ]);
96
+ return false;
97
+ }
98
+ }
99
+ }
100
+ return true;
101
+ }
102
+ }
103
+
104
+ export const permissionUtilIOS = Object.freeze(new PermissionUtilIOS());
@@ -46,7 +46,7 @@ export class ActionSheetStyles extends BaseStyle {
46
46
  */
47
47
  constructor({
48
48
  width = "100%",
49
- height = 350,
49
+ height,
50
50
  backgroundColor = "transparent",
51
51
  border = new BorderStyle({}),
52
52
  borderRadius = 8,
@@ -59,6 +59,7 @@ export class ActionSheetStyles extends BaseStyle {
59
59
  listItemTitleFont = new FontStyle({fontSize: 17, fontWeight: "400"}),
60
60
  listItemTitleColor = "",
61
61
  paddingHorizontal,
62
+ actionSheetSeparatorTint,
62
63
  }: ActionSheetStylesInterface) {
63
64
  super({
64
65
  width,
@@ -76,5 +77,6 @@ export class ActionSheetStyles extends BaseStyle {
76
77
  this.listItemIconBackground = listItemIconBackground;
77
78
  this.listItemIconBorderRadius = listItemIconBorderRadius;
78
79
  this.paddingHorizontal = paddingHorizontal;
80
+ this.actionSheetSeparatorTint = actionSheetSeparatorTint;
79
81
  }
80
82
  }
@@ -16,7 +16,7 @@ const layoutType = Object.freeze({
16
16
  });
17
17
 
18
18
  const OptionListView = ({
19
- key,
19
+ id,
20
20
  title,
21
21
  iconUrl,
22
22
  iconTint,
@@ -31,13 +31,13 @@ const OptionListView = ({
31
31
  }) => {
32
32
  return (
33
33
  <TouchableOpacity
34
- key={key}
34
+ key={id}
35
35
  style={[
36
36
  Style.listItemContainer,
37
37
  {
38
38
  paddingHorizontal: 10,
39
39
  borderRadius: cornerRadius || 0,
40
- backgroundColor: backgroundColor || theme.palette.getAccent50(),
40
+ backgroundColor: backgroundColor || theme.palette.getBackgroundColor(),
41
41
  justifyContent: !iconUrl ? 'center' : undefined,
42
42
  },
43
43
  ]}
@@ -96,7 +96,7 @@ const OptionGridView = ({
96
96
  style={[
97
97
  Style.gridItemContainer,
98
98
  {
99
- backgroundColor: backgroundColor || theme.palette.getAccent50(),
99
+ backgroundColor: backgroundColor || theme.palette.getBackgroundColor(),
100
100
  borderRadius: cornerRadius || 8,
101
101
  },
102
102
  ]}
@@ -170,11 +170,11 @@ export const CometChatActionSheet = (props: CometChatActionSheetInterface) => {
170
170
 
171
171
  const _render = ({ item }) => {
172
172
  return (
173
- <OptionListView key={item.id} {...item} iconUrl={item.icon || item.iconUrl} theme={theme} backgroundColor={style.listItemBackground} style={style} />
173
+ <OptionListView id={item.id} {...item} iconUrl={item.icon || item.iconUrl} theme={theme} backgroundColor={style.listItemBackground} style={style} />
174
174
  );
175
175
  };
176
176
  const _renderGrid = ({ item }) => (
177
- <OptionGridView key={item.id} {...item} iconUrl={item.icon || item.iconUrl} theme={theme} style={style} />
177
+ <OptionGridView id={item.id} {...item} iconUrl={item.icon || item.iconUrl} theme={theme} style={style} />
178
178
  );
179
179
 
180
180
  const getList = () => {
@@ -1,6 +1,6 @@
1
1
  import React, { useRef, useEffect, useContext } from "react";
2
- import { View, Text, TouchableOpacity, Image, NativeModules, ActivityIndicator, NativeEventEmitter } from "react-native";
3
- import { CometChatContext} from "../../CometChatContext";
2
+ import { View, Text, Image, NativeModules, ActivityIndicator, NativeEventEmitter } from "react-native";
3
+ import { CometChatContext } from "../../CometChatContext";
4
4
  import { CometChatContextType, ImageType } from "../../base/Types";
5
5
  import { AudioBubbleStyle, AudioBubbleStyleInterface } from "./AudioBubbleStyle";
6
6
  import { defaultPauseIcon, defaultPlayIcon, } from "./resources";
@@ -50,8 +50,8 @@ export const CometChatAudioBubble = ({
50
50
  subtitle,
51
51
  title
52
52
  }: CometChatAudioBubbleInterface) => {
53
-
54
- const {theme} = useContext<CometChatContextType>(CometChatContext);
53
+
54
+ const { theme } = useContext<CometChatContextType>(CometChatContext);
55
55
 
56
56
  const _style = new AudioBubbleStyle({
57
57
  backgroundColor: theme?.palette.getBackgroundColor(),
@@ -130,12 +130,35 @@ export const CometChatAudioBubble = ({
130
130
  }
131
131
  }, []);
132
132
 
133
+ const pressTime = useRef(0);
134
+
135
+ const handleTouchStart = () => {
136
+ pressTime.current = Date.now();
137
+ };
138
+
139
+ const handleTouchEnd = () => {
140
+ // if (pressTime.current === null) return;
141
+ const endTime = Date.now();
142
+ const pressDuration = endTime - pressTime.current;
143
+ if (pressDuration < 500) {
144
+ playPauseAudio();
145
+ }
146
+ };
147
+
148
+ // const onTouchMove = () => {
149
+ // pressTime.current = null
150
+ // }
151
+
133
152
  return (
134
153
  <View style={[Style.container, { backgroundColor, ...border, borderRadius, height, width }]}>
135
154
  {
136
155
  status == "loading" ?
137
156
  <ActivityIndicator style={Style.imageStyle} color={iconTint} size={"small"} /> :
138
- <View onTouchEnd={playPauseAudio}>
157
+ <View
158
+ onTouchStart={handleTouchStart}
159
+ onTouchEnd={handleTouchEnd}
160
+ // onTouchMove={onTouchMove}
161
+ >
139
162
  <Image
140
163
  source={
141
164
  status == "playing" ?
@@ -7,7 +7,9 @@ export const Style = StyleSheet.create({
7
7
  height: 56,
8
8
  width: 228,
9
9
  flexDirection: 'row',
10
- alignItems: "center"
10
+ alignItems: "center",
11
+ padding: 8,
12
+ paddingBottom: 0
11
13
  },
12
14
  titleStyle: {
13
15
  opacity: 1,
@@ -24,6 +26,6 @@ export const Style = StyleSheet.create({
24
26
  height: 24,
25
27
  width: 24,
26
28
  tintColor: 'rgb(51, 153, 255)',
27
- margin: 16,
29
+ marginRight: 8,
28
30
  }
29
31
  });
@@ -22,7 +22,7 @@ export class AvatarStyle extends BaseStyle {
22
22
  constructor({
23
23
  height = 40,
24
24
  width = 40,
25
- border = { borderWidth: 1, borderStyle: 'solid', borderColor: 'black' },
25
+ border,
26
26
  borderRadius = 30,
27
27
  backgroundColor = 'rgba(20,20,20,0.58)',
28
28
  nameTextColor = 'rgba(255, 255, 255,0.89)',