@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
@@ -0,0 +1,290 @@
1
+ import type {RefObject} from 'react';
2
+ import type {ViewStyle, StyleProp, Animated, ImageSourcePropType} from 'react-native';
3
+ // import type Reanimated from 'react-native-reanimated';
4
+ // import type {StyleProps} from 'react-native-reanimated';
5
+ // import type {VideoRef, ReactVideoProps} from 'react-native-video';
6
+
7
+ export type WithRequiredProperty<Type, Key extends keyof Type> = Type & {
8
+ [Property in Key]-?: Type[Property];
9
+ };
10
+
11
+ export type VideoAnimations = {
12
+ AnimatedView: any;
13
+ hideControlAnimation: () => void;
14
+ showControlAnimation: () => void;
15
+ bottomControl: any; // type AnimatedViewStyle = Animated.AnimatedProps<ViewProps>['style'];
16
+ topControl: any;
17
+ controlsOpacity: any;
18
+ };
19
+
20
+ export interface VideoPlayerProps {
21
+ loadingIconColor?: string;
22
+ playIcon?: ImageSourcePropType
23
+ playIconColor?: string
24
+ pauseIcon?: ImageSourcePropType
25
+ pauseIconColor?: string
26
+ backIcon?: ImageSourcePropType
27
+ backIconColor?: string
28
+ volumeIcon?: ImageSourcePropType
29
+ volumeIconColor?: string
30
+
31
+ repeat?: boolean;
32
+ resizeMode?: string;
33
+ paused?: boolean;
34
+ muted?: boolean;
35
+ volume?: number;
36
+ rate?: number;
37
+ onSeek?: Function;
38
+ onError?: Function;
39
+ onEnd?: Function;
40
+ onLoad?: Function;
41
+ onLoadStart?: Function;
42
+ onProgress?: Function;
43
+ source: object;
44
+ animations?: VideoAnimations;
45
+ useAnimations?: (controlAnimationTiming: number) => VideoAnimations;
46
+ /**
47
+ * If true, clicking the fullscreen button will toggle the <Video />
48
+ * component between cover/contain, set to false
49
+ * if you want to customize fullscreen behaviour
50
+ *
51
+ * @default false
52
+ */
53
+ toggleResizeModeOnFullscreen?: boolean;
54
+
55
+ /**
56
+ * The amount of time (in milliseconds) to animate the controls in and out.
57
+ *
58
+ * @default 500
59
+ */
60
+ controlAnimationTiming?: number;
61
+
62
+ /**
63
+ * Tapping twice within this amount of time in milliseconds is considered a double tap.
64
+ * Single taps will not be actioned until this time has expired
65
+ *
66
+ * @default 100
67
+ */
68
+ doubleTapTime?: number;
69
+
70
+ /**
71
+ * The VideoPlayer fullscreen state.
72
+ *
73
+ * @default false
74
+ */
75
+ isFullscreen?: boolean;
76
+
77
+ /**
78
+ * Show or hide the controls on first render
79
+ *
80
+ * @default false
81
+ */
82
+ showOnStart?: boolean;
83
+
84
+ /**
85
+ * Show or hide the controls on end of video
86
+ *
87
+ * @default false
88
+ */
89
+ showOnEnd?: boolean;
90
+
91
+ /**
92
+ * Always show controls.
93
+ *
94
+ * @default false
95
+ */
96
+ alwaysShowControls?: boolean;
97
+
98
+ /**
99
+ * Title of the video
100
+ */
101
+ title?: string;
102
+
103
+ /**
104
+ * If true, show the time remaing, else show the current time in the Player.
105
+ *
106
+ * @default false
107
+ */
108
+ showTimeRemaining?: boolean;
109
+
110
+ /**
111
+ * Show duration of the media.
112
+ *
113
+ * @default false
114
+ */
115
+ showDuration?: boolean;
116
+
117
+ /**
118
+ * If true, convert time to hours in the Player
119
+ *
120
+ * @default false
121
+ */
122
+ showHours?: boolean;
123
+
124
+ /**
125
+ * Function fired when back button is pressed, override if using custom navigation
126
+ */
127
+ onBack?: () => void;
128
+
129
+ /**
130
+ * Fired when the video enters fullscreen after the fullscreen button is pressed
131
+ */
132
+ onEnterFullscreen?: () => void;
133
+
134
+ /**
135
+ * Fired when the video exits fullscreen after the fullscreen button is pressed
136
+ */
137
+ onExitFullscreen?: () => void;
138
+
139
+ /**
140
+ * Fired when the controls disappear
141
+ */
142
+ onHideControls?: () => void;
143
+
144
+ /**
145
+ * Fired when the controls appear
146
+ */
147
+ onShowControls?: () => void;
148
+
149
+ /**
150
+ * Fired when the video is paused after the play/pause button is pressed
151
+ */
152
+ onPause?: () => void;
153
+
154
+ /**
155
+ * Fired when the video begins playing after the play/pause button is pressed
156
+ */
157
+ onPlay?: () => void;
158
+
159
+ /**
160
+ * Hide controls after X amount of time in milliseconds
161
+ *
162
+ * @default 15000
163
+ */
164
+ controlTimeoutDelay?: number;
165
+
166
+ /**
167
+ * If true, single tapping anywhere on the video (other than a control) toggles between playing and paused.
168
+ *
169
+ * @default false
170
+ */
171
+ tapAnywhereToPause?: boolean;
172
+
173
+ /**
174
+ * StyleSheet passed to the <Video /> component
175
+ *
176
+ */
177
+ videoStyle?: StyleProp<ViewStyle>;
178
+
179
+ /**
180
+ * Container styles
181
+ *
182
+ */
183
+ containerStyle?: StyleProp<ViewStyle>;
184
+
185
+ /**
186
+ * Fill/handle colour of the seekbar
187
+ *
188
+ * @default '#FFF'
189
+ */
190
+ seekColor?: string;
191
+
192
+ /**
193
+ * Hide the back button
194
+ *
195
+ * @default false
196
+ */
197
+ disableBack?: boolean;
198
+
199
+ /**
200
+ * Hide the Volume control
201
+ *
202
+ * @default false
203
+ */
204
+ disableVolume?: boolean;
205
+
206
+ /**
207
+ * Hide the fullscreen button
208
+ *
209
+ * @default false
210
+ */
211
+ disableFullscreen?: boolean;
212
+
213
+ /**
214
+ * Hide the timer
215
+ *
216
+ * @default false
217
+ */
218
+ disableTimer?: boolean;
219
+
220
+ /**
221
+ * Hide the seekbar
222
+ *
223
+ * @default false
224
+ */
225
+ disableSeekbar?: boolean;
226
+
227
+ /**
228
+ * Hide the play/pause toggle and the rewind/forward buttons
229
+ *
230
+ * @default false
231
+ */
232
+ disablePlayPause?: boolean;
233
+
234
+ /**
235
+ * Hide the rewind/forward buttons without hiding the play/pause button
236
+ *
237
+ * @default false
238
+ */
239
+ disableSeekButtons?: boolean;
240
+
241
+ /**
242
+ * Hide the transparent overlay which is active when the controls are shown. Generally used when you want to disable all the controls.
243
+ *
244
+ * @default false
245
+ */
246
+ disableOverlay?: boolean;
247
+
248
+ /**
249
+ * When using the default React Native navigator and do not override the `onBack` function,
250
+ * you'll need to pass the navigator to the VideoPlayer for it to function
251
+ *
252
+ * @default null
253
+ */
254
+ navigator?: any;
255
+
256
+ /**
257
+ * Pass ref to the `<Video/>` component
258
+ *
259
+ * @default false
260
+ */
261
+ videoRef?: RefObject<any>;
262
+
263
+ /**
264
+ * Number of seconds to rewind or forward.
265
+ *
266
+ * @default 15
267
+ */
268
+ rewindTime?: number;
269
+
270
+ /**
271
+ * Object allowing fine grained control of the pan responder
272
+ *
273
+ * @default { horizontal: true, inverted: false }
274
+ */
275
+ pan?: {
276
+ /**
277
+ * Boolean representing if the player is oriented horizontally or vertically
278
+ *
279
+ * @default true
280
+ */
281
+ horizontal?: boolean;
282
+
283
+ /**
284
+ * Boolean representing if the player controls pan gesture should be inverted
285
+ *
286
+ * @default false
287
+ */
288
+ inverted?: boolean;
289
+ };
290
+ }
@@ -0,0 +1,76 @@
1
+ // import padStart from 'lodash/padStart';
2
+
3
+ export const _onBack = (navigator: any) => {
4
+ if (navigator && navigator.pop) {
5
+ return () => navigator.pop();
6
+ }
7
+ return () =>
8
+ console.warn(
9
+ 'Warning: _onBack requires navigator property to function. Either modify the onBack prop or pass a navigator prop',
10
+ );
11
+ };
12
+
13
+ export const calculateTime = (args: FormatTime) => {
14
+ const {
15
+ time: currentTime = 0,
16
+ duration,
17
+ showTimeRemaining,
18
+ showDuration,
19
+ } = args;
20
+
21
+ const formattedDuration = !showDuration
22
+ ? ''
23
+ : `/${formatTime({
24
+ ...args,
25
+ time: duration,
26
+ showTimeRemaining: false,
27
+ })}`;
28
+
29
+ if (showTimeRemaining) {
30
+ const time = duration - currentTime;
31
+ return `${formatTime({...args, time})}${formattedDuration}`;
32
+ }
33
+
34
+ return `${formatTime({...args, time: currentTime})}${formattedDuration}`;
35
+ };
36
+
37
+ interface FormatTime {
38
+ time?: number;
39
+ duration: number;
40
+ showDuration: boolean;
41
+ showTimeRemaining: boolean;
42
+ showHours: boolean;
43
+ }
44
+
45
+ const formatTime = ({
46
+ time = 0,
47
+ duration,
48
+ showTimeRemaining,
49
+ showHours,
50
+ }: FormatTime) => {
51
+ const symbol = showTimeRemaining ? '-' : '';
52
+ time = Math.min(Math.max(time, 0), duration);
53
+
54
+ if (!showHours) {
55
+ const formattedMinutes = Math.floor(time / 60)
56
+ .toFixed(0)
57
+ .padStart(2, '0');
58
+ const formattedSeconds = Math.floor(time % 60)
59
+ .toFixed(0)
60
+ .padStart(2, '0');
61
+
62
+ return `${symbol}${formattedMinutes}:${formattedSeconds}`;
63
+ }
64
+
65
+ const formattedHours = Math.floor(time / 3600)
66
+ .toFixed(0)
67
+ .padStart(2, '0');
68
+ const formattedMinutes = (Math.floor(time / 60) % 60)
69
+ .toFixed(0)
70
+ .padStart(2, '0');
71
+ const formattedSeconds = Math.floor(time % 60)
72
+ .toFixed(0)
73
+ .padStart(2, '0');
74
+
75
+ return `${symbol}${formattedHours}:${formattedMinutes}:${formattedSeconds}`;
76
+ };
@@ -1,33 +1,136 @@
1
1
  import { CometChat } from "@cometchat/chat-sdk-react-native";
2
- import { CometChatOptions } from "./CometChatOptions";
3
- import { MessageBubbleAlignmentType, MessageListAlignmentType } from "../constants/UIKitConstants";
2
+ import { MessageBubbleAlignmentType } from "../constants/UIKitConstants";
4
3
  import { CometChatMessageOption } from "./CometChatMessageOption";
5
4
 
5
+ /**
6
+ * Represents the interface for a message template.
7
+ */
6
8
  interface MessageTemplateInterface {
9
+ /**
10
+ * The category of the message template.
11
+ */
7
12
  category: string,
13
+
14
+ /**
15
+ * The type of the message template.
16
+ */
8
17
  type: (typeof CometChat.MESSAGE_TYPE)[keyof typeof CometChat.MESSAGE_TYPE],
18
+
19
+ /**
20
+ * The content view of the message template.
21
+ * @param messageObject - The message object.
22
+ * @param alignment - The alignment of the message bubble.
23
+ * @returns The JSX element representing the content view.
24
+ */
9
25
  ContentView?: (messageObject: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => JSX.Element,
26
+
27
+ /**
28
+ * The bubble view of the message template.
29
+ * @param messageObject - The message object.
30
+ * @returns The JSX element representing the bubble view.
31
+ */
10
32
  BubbleView?: (messageObject: CometChat.BaseMessage) => JSX.Element,
33
+
34
+ /**
35
+ * The header view of the message template.
36
+ * @param messageObject - The message object.
37
+ * @param alignment - The alignment of the message bubble.
38
+ * @returns The JSX element representing the header view.
39
+ */
11
40
  HeaderView?: (messageObject: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => JSX.Element,
41
+
42
+ /**
43
+ * The status info view of the message template for DateTime and Receipt.
44
+ * @param messageObject - The message object.
45
+ * @param alignment - The alignment of the message bubble.
46
+ * @returns The JSX element representing the status info view.
47
+ */
48
+ StatusInfoView?: (messageObject: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => JSX.Element,
49
+
50
+ /**
51
+ * The footer view of the message template.
52
+ * @param messageObject - The message object.
53
+ * @param alignment - The alignment of the message bubble.
54
+ * @returns The JSX element representing the footer view.
55
+ */
12
56
  FooterView?: (messageObject: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => JSX.Element,
57
+
58
+ /**
59
+ * The options of the message template.
60
+ * @param loggedInUser - The logged in user.
61
+ * @param messageObject - The message object.
62
+ * @param group - The group.
63
+ * @returns The array of CometChatMessageOption.
64
+ */
13
65
  options?: (loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group: CometChat.Group) => CometChatMessageOption[],
14
66
  }
15
67
 
68
+ /**
69
+ * Represents a message template for CometChat.
70
+ */
16
71
  export class CometChatMessageTemplate implements MessageTemplateInterface {
17
- category: string
18
- type: (typeof CometChat.MESSAGE_TYPE)[keyof typeof CometChat.MESSAGE_TYPE]
19
- ContentView: (messageObject: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => JSX.Element
20
- BubbleView: (messageObject: CometChat.BaseMessage) => JSX.Element
21
- HeaderView: (messageObject: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => JSX.Element
22
- FooterView: (messageObject: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => JSX.Element
23
- options: (loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group: CometChat.Group) => CometChatMessageOption[]
72
+ /**
73
+ * The category of the message template.
74
+ */
75
+ category: string;
76
+ /**
77
+ * The type of the message template.
78
+ */
79
+ type: (typeof CometChat.MESSAGE_TYPE)[keyof typeof CometChat.MESSAGE_TYPE];
80
+ /**
81
+ * The content view of the message template.
82
+ * @param messageObject - The message object.
83
+ * @param alignment - The alignment of the message bubble.
84
+ * @returns The JSX element representing the content view.
85
+ */
86
+ ContentView: (messageObject: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => JSX.Element;
87
+ /**
88
+ * The bubble view of the message template.
89
+ * @param messageObject - The message object.
90
+ * @returns The JSX element representing the bubble view.
91
+ */
92
+ BubbleView: (messageObject: CometChat.BaseMessage) => JSX.Element;
93
+ /**
94
+ * The header view of the message template.
95
+ * @param messageObject - The message object.
96
+ * @param alignment - The alignment of the message bubble.
97
+ * @returns The JSX element representing the header view.
98
+ */
99
+ HeaderView: (messageObject: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => JSX.Element;
100
+ /**
101
+ * The status info view of the message template for DateTime and Receipt.
102
+ * @param messageObject - The message object.
103
+ * @param alignment - The alignment of the message bubble.
104
+ * @returns The JSX element representing the status info view.
105
+ */
106
+ StatusInfoView?: (messageObject: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => JSX.Element;
107
+ /**
108
+ * The footer view of the message template.
109
+ * @param messageObject - The message object.
110
+ * @param alignment - The alignment of the message bubble.
111
+ * @returns The JSX element representing the footer view.
112
+ */
113
+ FooterView: (messageObject: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => JSX.Element;
114
+ /**
115
+ * The options of the message template.
116
+ * @param loggedInUser - The logged in user.
117
+ * @param messageObject - The message object.
118
+ * @param group - The group.
119
+ * @returns The array of CometChatMessageOption.
120
+ */
121
+ options: (loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group: CometChat.Group) => CometChatMessageOption[];
24
122
 
123
+ /**
124
+ * Constructs a new instance of the CometChatMessageTemplate class.
125
+ * @param {MessageTemplateInterface} options - The options for the message template.
126
+ */
25
127
  constructor({
26
128
  category = "MESSAGE",
27
129
  type = CometChat.MESSAGE_TYPE.TEXT,
28
130
  ContentView,
29
131
  BubbleView,
30
132
  HeaderView,
133
+ StatusInfoView,
31
134
  FooterView,
32
135
  options,
33
136
  }: MessageTemplateInterface) {
@@ -36,6 +139,7 @@ export class CometChatMessageTemplate implements MessageTemplateInterface {
36
139
  this.ContentView = ContentView;
37
140
  this.BubbleView = BubbleView;
38
141
  this.HeaderView = HeaderView;
142
+ this.StatusInfoView = StatusInfoView;
39
143
  this.FooterView = FooterView;
40
144
  this.options = options;
41
145
  }
@@ -12,37 +12,39 @@ interface Availability {
12
12
  }
13
13
 
14
14
  interface InteractiveData {
15
- title: string;
16
- avatarUrl: string;
17
- goalCompletionText: string;
15
+ title?: string;
16
+ avatarUrl?: string;
17
+ goalCompletionText?: string;
18
18
  timezoneCode: string;
19
- bufferTime: number;
20
- duration: number;
19
+ bufferTime?: number;
20
+ duration?: number;
21
21
  availability: Availability;
22
- dateRangeStart: number;
23
- dateRangeEnd: number;
24
- icsFileUrl: string;
22
+ dateRangeStart?: number;
23
+ dateRangeEnd?: number;
24
+ icsFileUrl?: string;
25
25
  scheduleElement: ButtonElement;
26
26
  }
27
27
 
28
28
  export class SchedulerMessage extends CometChat.InteractiveMessage {
29
29
  private interactiveData: InteractiveData;
30
- private title: string;
31
- private avatarUrl: string;
32
- private goalCompletionText: string;
30
+ private title?: string;
31
+ private avatarUrl?: string;
32
+ private goalCompletionText?: string;
33
33
  private timezoneCode: string;
34
- private bufferTime: number;
35
- private duration: number;
34
+ private bufferTime?: number;
35
+ private duration?: number;
36
36
  private availability: Availability;
37
- private dateRangeStart: number;
38
- private dateRangeEnd: number;
39
- private icsFileUrl: string;
37
+ private dateRangeStart?: number;
38
+ private dateRangeEnd?: number;
39
+ private icsFileUrl?: string;
40
40
  private scheduleElement: ButtonElement;
41
41
 
42
+
42
43
  constructor(
43
44
  receiverId: string,
44
45
  receiverType: string,
45
46
  interactiveData: InteractiveData
47
+
46
48
  ) {
47
49
  super(
48
50
  receiverId,
@@ -70,7 +72,7 @@ export class SchedulerMessage extends CometChat.InteractiveMessage {
70
72
  setTimezoneCode(timezoneCode: string) {
71
73
  this.timezoneCode = timezoneCode;
72
74
  }
73
- setduration(duration: number) {
75
+ setDuration(duration: number) {
74
76
  this.duration = duration;
75
77
  }
76
78
  setBufferTime(bufferTime: number) {
@@ -82,7 +84,7 @@ export class SchedulerMessage extends CometChat.InteractiveMessage {
82
84
  setDateRangeStart(dateRangeStart: number) {
83
85
  this.dateRangeStart = dateRangeStart;
84
86
  }
85
- setdateRangeEnd(dateRangeEnd: number) {
87
+ setDateRangeEnd(dateRangeEnd: number) {
86
88
  this.dateRangeEnd = dateRangeEnd;
87
89
  }
88
90
  setIcsFileUrl(icsFileUrl: string) {
@@ -110,7 +112,7 @@ export class SchedulerMessage extends CometChat.InteractiveMessage {
110
112
  getTimezoneCode() {
111
113
  return this.timezoneCode;
112
114
  }
113
- getduration() {
115
+ getDuration() {
114
116
  return this.duration;
115
117
  }
116
118
  getBufferTime() {
@@ -119,10 +121,10 @@ export class SchedulerMessage extends CometChat.InteractiveMessage {
119
121
  getAvailability() {
120
122
  return this.availability;
121
123
  }
122
- getdateRangeStart() {
124
+ getDateRangeStart() {
123
125
  return this.dateRangeStart;
124
126
  }
125
- getdateRangeEnd() {
127
+ getDateRangeEnd() {
126
128
  return this.dateRangeEnd;
127
129
  }
128
130
  getIcsFileUrl() {
@@ -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": "Versuche es noch einmal",
299
299
  "TIME_SLOT_UNAVAILABLE": "Das Zeitfenster ist nicht mehr verfügbar. Bitte wählen Sie ein anderes.",
300
300
  "MEETING_SCHEDULER": "Planer für Besprechungen",
301
- "MIN": "mi"
301
+ "MIN": "mi",
302
+ "TAP_TO_REMOVE":"Zum Entfernen antippen",
303
+ "ALL":"Alle",
304
+ "RESOURCE_PERMISSION_REQUIRED": "Für diese Funktion sind spezielle Ressourcenberechtigungen erforderlich. Bitte aktivieren Sie die erforderlichen Berechtigungen in Ihren Geräteeinstellungen"
302
305
  }
@@ -51,8 +51,8 @@
51
51
  "VIDEO_CALL": "Video call",
52
52
  "AUDIO_CALL": "Audio call",
53
53
  "LOADING": "Loading...",
54
- "REPLY": "reply",
55
- "REPLIES": "replies",
54
+ "REPLY": "Reply",
55
+ "REPLIES": "Replies",
56
56
  "LAUNCH": "Launch",
57
57
  "SHARED_COLLABORATIVE_DOCUMENT": "has shared a collaborative document",
58
58
  "SHARED_COLLABORATIVE_WHITEBOARD": "has shared a collaborative whiteboard",
@@ -298,5 +298,8 @@
298
298
  "TRY_AGAIN_CAMEL": "Try again",
299
299
  "TIME_SLOT_UNAVAILABLE": "Time slot no longer available. Please choose another.",
300
300
  "MEETING_SCHEDULER": "Meeting Scheduler",
301
- "MIN": "min"
301
+ "MIN": "min",
302
+ "TAP_TO_REMOVE":"Tap to remove",
303
+ "ALL": "All",
304
+ "RESOURCE_PERMISSION_REQUIRED": "This feature requires specific resource permission(s). Please enable the necessary permissions in your device settings."
302
305
  }
@@ -298,5 +298,8 @@
298
298
  "TRY_AGAIN_CAMEL": "Inténtalo de nuevo",
299
299
  "TIME_SLOT_UNAVAILABLE": "La franja horaria ya no está disponible. Por favor, elige otro.",
300
300
  "MEETING_SCHEDULER": "Programador de reuniones",
301
- "MIN": "mi"
301
+ "MIN": "mi",
302
+ "TAP_TO_REMOVE":"Pulsa para eliminar",
303
+ "ALL":"Todas",
304
+ "RESOURCE_PERMISSION_REQUIRED": "Esta función requiere permisos de recursos específicos. Habilite los permisos necesarios en la configuración de su dispositivo"
302
305
  }
@@ -298,5 +298,8 @@
298
298
  "TRY_AGAIN_CAMEL": "Essayez à nouveau",
299
299
  "TIME_SLOT_UNAVAILABLE": "Le créneau horaire n'est plus disponible. Veuillez en choisir un autre.",
300
300
  "MEETING_SCHEDULER": "Planificateur de réunions",
301
- "MIN": "mi"
301
+ "MIN": "mi",
302
+ "TAP_TO_REMOVE":"Touchez pour supprimer",
303
+ "ALL":"Tous",
304
+ "RESOURCE_PERMISSION_REQUIRED": "Cette fonctionnalité nécessite des autorisations de ressources spécifiques. Veuillez activer les autorisations nécessaires dans les paramètres de votre appareil"
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
  }