@cometchat/chat-uikit-react-native 4.0.0 → 4.0.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 (198) hide show
  1. package/LICENSE.md +3 -0
  2. package/README.md +1 -1
  3. package/lib/AI/AIConversationStarter/AIConversationStarter.d.ts +12 -0
  4. package/lib/AI/AIConversationStarter/AIConversationStarter.js +31 -0
  5. package/lib/AI/AIConversationStarter/AIConversationStarter.js.map +1 -0
  6. package/lib/AI/AIConversationStarter/AIConversationStarterDecorator.d.ts +25 -0
  7. package/lib/AI/AIConversationStarter/AIConversationStarterDecorator.js +175 -0
  8. package/lib/AI/AIConversationStarter/AIConversationStarterDecorator.js.map +1 -0
  9. package/lib/AI/AIConversationStarter/AIConversationStarterStyle.d.ts +4 -0
  10. package/lib/AI/AIConversationStarter/AIConversationStarterStyle.js +8 -0
  11. package/lib/AI/AIConversationStarter/AIConversationStarterStyle.js.map +1 -0
  12. package/lib/AI/AIConversationStarter/configuration.d.ts +14 -0
  13. package/lib/AI/AIConversationStarter/configuration.js +16 -0
  14. package/lib/AI/AIConversationStarter/configuration.js.map +1 -0
  15. package/lib/AI/AIConversationStarter/style.d.ts +31 -0
  16. package/lib/AI/AIConversationStarter/style.js +62 -0
  17. package/lib/AI/AIConversationStarter/style.js.map +1 -0
  18. package/lib/AI/AIEnabler.d.ts +10 -0
  19. package/lib/AI/AIEnabler.js +102 -0
  20. package/lib/AI/AIEnabler.js.map +1 -0
  21. package/lib/AI/AIEnablerDecorator.d.ts +43 -0
  22. package/lib/AI/AIEnablerDecorator.js +251 -0
  23. package/lib/AI/AIEnablerDecorator.js.map +1 -0
  24. package/lib/AI/AIExtensionDataSource.d.ts +6 -0
  25. package/lib/AI/AIExtensionDataSource.js +10 -0
  26. package/lib/AI/AIExtensionDataSource.js.map +1 -0
  27. package/lib/AI/AISmartReplies/AISmartReplies.d.ts +10 -0
  28. package/lib/AI/AISmartReplies/AISmartReplies.js +23 -0
  29. package/lib/AI/AISmartReplies/AISmartReplies.js.map +1 -0
  30. package/lib/AI/AISmartReplies/AISmartRepliesDecorator.d.ts +7 -0
  31. package/lib/AI/AISmartReplies/AISmartRepliesDecorator.js +12 -0
  32. package/lib/AI/AISmartReplies/AISmartRepliesDecorator.js.map +1 -0
  33. package/lib/AI/AISmartReplies/AISmartRepliesStyle.d.ts +12 -0
  34. package/lib/AI/AISmartReplies/AISmartRepliesStyle.js +15 -0
  35. package/lib/AI/AISmartReplies/AISmartRepliesStyle.js.map +1 -0
  36. package/lib/AI/AISmartReplies/configuration.d.ts +14 -0
  37. package/lib/AI/AISmartReplies/configuration.js +16 -0
  38. package/lib/AI/AISmartReplies/configuration.js.map +1 -0
  39. package/lib/AI/CardView.d.ts +19 -0
  40. package/lib/AI/CardView.js +45 -0
  41. package/lib/AI/CardView.js.map +1 -0
  42. package/lib/AI/CardViewStyle.d.ts +29 -0
  43. package/lib/AI/CardViewStyle.js +36 -0
  44. package/lib/AI/CardViewStyle.js.map +1 -0
  45. package/lib/AI/configuration.d.ts +14 -0
  46. package/lib/AI/configuration.js +16 -0
  47. package/lib/AI/configuration.js.map +1 -0
  48. package/lib/AI/resources/index.d.ts +5 -0
  49. package/lib/AI/resources/index.js +6 -0
  50. package/lib/AI/resources/index.js.map +1 -0
  51. package/lib/AI/style.d.ts +115 -0
  52. package/lib/AI/style.js +139 -0
  53. package/lib/AI/style.js.map +1 -0
  54. package/lib/AI/utils.d.ts +38 -0
  55. package/lib/AI/utils.js +28 -0
  56. package/lib/AI/utils.js.map +1 -0
  57. package/lib/CometChatConversations/ConversationsConfiguration.d.ts +0 -1
  58. package/lib/CometChatDetails/DetailsConfiguration.d.ts +0 -1
  59. package/lib/CometChatGroupMembers/GroupMemberConfiguration.d.ts +0 -1
  60. package/lib/CometChatGroups/GroupsConfiguration.d.ts +0 -1
  61. package/lib/CometChatMessageComposer/CometChatMessageComposer.js +7 -1
  62. package/lib/CometChatMessageComposer/CometChatMessageComposer.js.map +1 -1
  63. package/lib/CometChatMessageHeader/MessageHeaderConfiguration.d.ts +0 -1
  64. package/lib/CometChatMessageList/CometChatMessageList.js +49 -18
  65. package/lib/CometChatMessageList/CometChatMessageList.js.map +1 -1
  66. package/lib/CometChatMessageList/MessageListConfiguration.d.ts +0 -1
  67. package/lib/CometChatMessages/MessagesConfiguration.d.ts +0 -1
  68. package/lib/CometChatTabs/TabItems.d.ts +0 -1
  69. package/lib/CometChatThreadedMessages/ThreadedMessagesConfiguration.d.ts +0 -1
  70. package/lib/calls/CometChatCallDetails/CallDetailsConfiguration.d.ts +0 -1
  71. package/lib/calls/CometChatCallHistory/CallHistoryConfiguration.d.ts +0 -1
  72. package/lib/calls/CometChatIncomingCall/CometChatIncomingCall.js +3 -3
  73. package/lib/calls/CometChatIncomingCall/CometChatIncomingCall.js.map +1 -1
  74. package/lib/extensions/ImageModeration/ImageModerationDecorator.d.ts +0 -1
  75. package/lib/extensions/ImageModeration/ImageModerationFilter.js +4 -4
  76. package/lib/extensions/ImageModeration/ImageModerationFilter.js.map +1 -1
  77. package/lib/extensions/LinkPreview/LinkPreviewExtentionDecorator.d.ts +0 -1
  78. package/lib/extensions/MessageTranslation/MessageTranslationDecorator.d.ts +0 -1
  79. package/lib/extensions/SmartReplies/SmartRepliesDecorator.js +1 -1
  80. package/lib/extensions/SmartReplies/SmartRepliesDecorator.js.map +1 -1
  81. package/lib/extensions/Stickers/StickersExtensionDecorator.d.ts +1 -1
  82. package/lib/extensions/Stickers/StickersExtensionDecorator.js +4 -2
  83. package/lib/extensions/Stickers/StickersExtensionDecorator.js.map +1 -1
  84. package/lib/extensions/TextModeration/TextModerationExtensionDecorator.d.ts +0 -1
  85. package/lib/index.d.ts +13 -0
  86. package/lib/index.js +14 -0
  87. package/lib/index.js.map +1 -1
  88. package/lib/shared/CometChatUiKit/CometChatUIKit.d.ts +2 -0
  89. package/lib/shared/CometChatUiKit/CometChatUIKit.js +13 -2
  90. package/lib/shared/CometChatUiKit/CometChatUIKit.js.map +1 -1
  91. package/lib/shared/CometChatUiKit/UIKitSettings.d.ts +5 -1
  92. package/lib/shared/CometChatUiKit/UIKitSettings.js +3 -1
  93. package/lib/shared/CometChatUiKit/UIKitSettings.js.map +1 -1
  94. package/lib/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.js +2 -0
  95. package/lib/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.js.map +1 -1
  96. package/lib/shared/events/CometChatUIEventHandler/Listener.d.ts +3 -1
  97. package/lib/shared/events/CometChatUIEventHandler/Listener.js +4 -1
  98. package/lib/shared/events/CometChatUIEventHandler/Listener.js.map +1 -1
  99. package/lib/shared/events/CometChatUIEvents.d.ts +2 -1
  100. package/lib/shared/events/CometChatUIEvents.js +1 -0
  101. package/lib/shared/events/CometChatUIEvents.js.map +1 -1
  102. package/lib/shared/framework/DataSource.d.ts +1 -2
  103. package/lib/shared/framework/DataSourceDecorator.d.ts +1 -2
  104. package/lib/shared/framework/DataSourceDecorator.js +2 -2
  105. package/lib/shared/framework/DataSourceDecorator.js.map +1 -1
  106. package/lib/shared/framework/MessageDataSource.d.ts +1 -1
  107. package/lib/shared/framework/MessageDataSource.js +2 -2
  108. package/lib/shared/framework/MessageDataSource.js.map +1 -1
  109. package/lib/shared/helper/types/index.d.ts +0 -1
  110. package/lib/shared/modals/CometChatDetailsOption.d.ts +0 -1
  111. package/lib/shared/modals/CometChatMessageOption.d.ts +0 -1
  112. package/lib/shared/modals/CometChatMessageTemplate.d.ts +0 -1
  113. package/lib/shared/resources/CometChatLocalize/CometChatLocalize.d.ts +230 -153
  114. package/lib/shared/resources/CometChatLocalize/resources/ar/translation.json +4 -0
  115. package/lib/shared/resources/CometChatLocalize/resources/de/translation.json +4 -0
  116. package/lib/shared/resources/CometChatLocalize/resources/en/translation.json +4 -0
  117. package/lib/shared/resources/CometChatLocalize/resources/es/translation.json +4 -0
  118. package/lib/shared/resources/CometChatLocalize/resources/fr/translation.json +4 -0
  119. package/lib/shared/resources/CometChatLocalize/resources/hi/translation.json +4 -0
  120. package/lib/shared/resources/CometChatLocalize/resources/lt/translation.json +4 -0
  121. package/lib/shared/resources/CometChatLocalize/resources/ms/translation.json +4 -0
  122. package/lib/shared/resources/CometChatLocalize/resources/pt/translation.json +4 -0
  123. package/lib/shared/resources/CometChatLocalize/resources/ru/translation.json +4 -0
  124. package/lib/shared/resources/CometChatLocalize/resources/sv/translation.json +4 -0
  125. package/lib/shared/resources/CometChatLocalize/resources/zh/translation.json +4 -0
  126. package/lib/shared/resources/CometChatLocalize/resources/zh-tw/translation.json +4 -0
  127. package/package.json +3 -3
  128. package/src/AI/AIConversationStarter/AIConversationStarter.ts +33 -0
  129. package/src/AI/AIConversationStarter/AIConversationStarterDecorator.tsx +232 -0
  130. package/src/AI/AIConversationStarter/AIConversationStarterStyle.ts +8 -0
  131. package/src/AI/AIConversationStarter/configuration.ts +18 -0
  132. package/src/AI/AIConversationStarter/style.ts +76 -0
  133. package/src/AI/AIEnabler.ts +115 -0
  134. package/src/AI/AIEnablerDecorator.tsx +324 -0
  135. package/src/AI/AIExtensionDataSource.ts +12 -0
  136. package/src/AI/AISmartReplies/AISmartReplies.ts +28 -0
  137. package/src/AI/AISmartReplies/AISmartRepliesDecorator.ts +18 -0
  138. package/src/AI/AISmartReplies/AISmartRepliesStyle.ts +16 -0
  139. package/src/AI/AISmartReplies/configuration.ts +17 -0
  140. package/src/AI/CardView.tsx +81 -0
  141. package/src/AI/CardViewStyle.ts +37 -0
  142. package/src/AI/configuration.ts +17 -0
  143. package/src/AI/resources/ai-empty.png +0 -0
  144. package/src/AI/resources/ai-error.png +0 -0
  145. package/src/AI/resources/ai.png +0 -0
  146. package/src/AI/resources/index.ts +11 -0
  147. package/src/AI/resources/spineer.png +0 -0
  148. package/src/AI/style.ts +177 -0
  149. package/src/AI/utils.ts +39 -0
  150. package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +13 -4
  151. package/src/CometChatMessageList/CometChatMessageList.tsx +24 -17
  152. package/src/extensions/SmartReplies/SmartRepliesDecorator.tsx +1 -1
  153. package/src/extensions/Stickers/StickersExtensionDecorator.tsx +4 -2
  154. package/src/index.ts +15 -0
  155. package/src/shared/CometChatUiKit/CometChatUIKit.ts +20 -7
  156. package/src/shared/CometChatUiKit/UIKitSettings.ts +8 -0
  157. package/src/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.ts +2 -0
  158. package/src/shared/events/CometChatUIEventHandler/Listener.ts +5 -1
  159. package/src/shared/events/CometChatUIEvents.ts +1 -0
  160. package/src/shared/framework/DataSource.ts +1 -1
  161. package/src/shared/framework/DataSourceDecorator.tsx +2 -2
  162. package/src/shared/framework/MessageDataSource.tsx +2 -2
  163. package/src/shared/resources/CometChatLocalize/resources/ar/translation.json +4 -0
  164. package/src/shared/resources/CometChatLocalize/resources/de/translation.json +4 -0
  165. package/src/shared/resources/CometChatLocalize/resources/en/translation.json +4 -0
  166. package/src/shared/resources/CometChatLocalize/resources/es/translation.json +4 -0
  167. package/src/shared/resources/CometChatLocalize/resources/fr/translation.json +4 -0
  168. package/src/shared/resources/CometChatLocalize/resources/hi/translation.json +4 -0
  169. package/src/shared/resources/CometChatLocalize/resources/lt/translation.json +4 -0
  170. package/src/shared/resources/CometChatLocalize/resources/ms/translation.json +4 -0
  171. package/src/shared/resources/CometChatLocalize/resources/pt/translation.json +4 -0
  172. package/src/shared/resources/CometChatLocalize/resources/ru/translation.json +4 -0
  173. package/src/shared/resources/CometChatLocalize/resources/sv/translation.json +4 -0
  174. package/src/shared/resources/CometChatLocalize/resources/zh/translation.json +4 -0
  175. package/src/shared/resources/CometChatLocalize/resources/zh-tw/translation.json +4 -0
  176. package/LICENSE +0 -21
  177. package/android/.gradle/7.4/checksums/checksums.lock +0 -0
  178. package/android/.gradle/7.4/checksums/md5-checksums.bin +0 -0
  179. package/android/.gradle/7.4/checksums/sha1-checksums.bin +0 -0
  180. package/android/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock +0 -0
  181. package/android/.gradle/7.4/fileChanges/last-build.bin +0 -0
  182. package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
  183. package/android/.gradle/7.4/gc.properties +0 -0
  184. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  185. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  186. package/android/.gradle/vcs-1/gc.properties +0 -0
  187. package/android/.idea/.gitignore +0 -3
  188. package/android/.idea/gradle.xml +0 -13
  189. package/android/.idea/misc.xml +0 -9
  190. package/android/.idea/vcs.xml +0 -6
  191. package/android/local.properties +0 -8
  192. package/src/.DS_Store +0 -0
  193. package/src/CometChatMessageInformation/.DS_Store +0 -0
  194. package/src/calls/CometChatCallHistory/.DS_Store +0 -0
  195. package/src/shared/framework/.DS_Store +0 -0
  196. package/src/shared/views/.DS_Store +0 -0
  197. package/src/shared/views/CometChatAudioBubble/.DS_Store +0 -0
  198. package/src/shared/views/CometChatFileBubble/.DS_Store +0 -0
@@ -0,0 +1,251 @@
1
+ import { CometChat } from "@cometchat/chat-sdk-react-native";
2
+ import { DataSourceDecorator, CometChatTheme, CometChatUIEvents, localize, CometChatUIEventHandler, CometChatBottomSheet } from "../shared";
3
+ import { CardView } from "./CardView";
4
+ import { getRepliesWrapperStyle, getRepliesStyle, getCardViewStyle, getButtonStyles, emptyLabelStyle, errorLabelStyle, getloadingStateStyle } from "./style";
5
+ import { ReceiverTypeConstants, ViewAlignment } from "../shared/constants/UIKitConstants";
6
+ import { Image, TouchableOpacity, View, Text, ScrollView, Keyboard } from "react-native";
7
+ import React, { useState, useContext } from "react";
8
+ import { AIBotIcon, loadingIcon, emptyIcon, errorIcon } from './resources';
9
+ import { CometChatContext } from "../shared/CometChatContext";
10
+ import { AIEnablerConfiguration } from "./configuration";
11
+ import { State } from "./utils";
12
+ import { AIConversationStarterConfiguration } from "./AIConversationStarter/configuration";
13
+ import { AISmartRepliesConfiguration } from "./AISmartReplies/configuration";
14
+ export class AIEnablerDecorator extends DataSourceDecorator {
15
+ smartReplyConfiguration = new AISmartRepliesConfiguration({});
16
+ conversationStarterConfiguration = new AIConversationStarterConfiguration({});
17
+ features = {};
18
+ configuration = new AIEnablerConfiguration({});
19
+ newDataSource;
20
+ showAiButton = false;
21
+ theme;
22
+ id;
23
+ user;
24
+ group;
25
+ loggedInUser;
26
+ cardViewStyle = {};
27
+ buttonRef;
28
+ setCallback;
29
+ isPannelVisible = false;
30
+ repliesView;
31
+ errorStateText = localize("SOMETHING_WRONG");
32
+ emptyStateText = localize("NO_MESSAGES_FOUND");
33
+ keyboardDidShowListener;
34
+ keyboardDidHideListener;
35
+ onButtonClick = (id) => {
36
+ if (id == "smart-replies") {
37
+ this.showDefaultPanel(State.loading);
38
+ this.getSmartReplies().then((replies) => {
39
+ if (!replies || (replies?.length && replies.length <= 0)) {
40
+ this.showDefaultPanel(State.empty);
41
+ }
42
+ else {
43
+ this.repliesView = (<View style={{ width: this.cardViewStyle?.width || "100%", height: this.cardViewStyle?.height || 200, backgroundColor: this.cardViewStyle?.backgroundColor, borderRadius: this.cardViewStyle?.borderRadius, ...this.cardViewStyle?.border, marginTop: 8 }}>
44
+ <ScrollView style={{ height: "100%", width: "100%" }}>
45
+ {replies}
46
+ </ScrollView>
47
+
48
+
49
+ </View>);
50
+ CometChatUIEventHandler.emitUIEvent(CometChatUIEvents.showPanel, {
51
+ alignment: ViewAlignment.composerBottom,
52
+ child: () => this.repliesView,
53
+ });
54
+ }
55
+ this.isPannelVisible = true;
56
+ })
57
+ .catch((err) => {
58
+ this.showDefaultPanel(State.error, err);
59
+ });
60
+ }
61
+ };
62
+ cardsData = {};
63
+ constructor(dataSource, features, configuration) {
64
+ super(dataSource);
65
+ this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this.hideOnKeyboardShow);
66
+ this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this.showOnKeyboardShow);
67
+ if (configuration) {
68
+ this.configuration = configuration;
69
+ }
70
+ this.newDataSource = dataSource;
71
+ this.features = features;
72
+ CometChat.getLoggedinUser().then((user) => {
73
+ if (user) {
74
+ this.loggedInUser = user;
75
+ }
76
+ });
77
+ }
78
+ getDataSource() {
79
+ return this.newDataSource;
80
+ }
81
+ getId() {
82
+ return "aienabler";
83
+ }
84
+ hideOnKeyboardShow = () => {
85
+ if (this.isPannelVisible) {
86
+ CometChatUIEventHandler.emitUIEvent(CometChatUIEvents.hidePanel, {
87
+ alignment: ViewAlignment.composerBottom,
88
+ child: () => (null),
89
+ });
90
+ }
91
+ };
92
+ showOnKeyboardShow = () => {
93
+ if (this.isPannelVisible) {
94
+ CometChatUIEventHandler.emitUIEvent(CometChatUIEvents.hidePanel, {
95
+ alignment: ViewAlignment.composerBottom,
96
+ child: () => this.repliesView,
97
+ });
98
+ }
99
+ };
100
+ editReply(reply) {
101
+ CometChatUIEventHandler.emitUIEvent(CometChatUIEvents.hidePanel, {
102
+ alignment: ViewAlignment.composerBottom,
103
+ child: () => (null),
104
+ });
105
+ this.isPannelVisible = false;
106
+ CometChatUIEventHandler.emitUIEvent(CometChatUIEvents.ccComposeMessage, { text: reply });
107
+ this.keyboardDidShowListener?.remove();
108
+ this.keyboardDidHideListener?.remove();
109
+ }
110
+ closeBottomsheet = () => {
111
+ if (this.setCallback) {
112
+ this.setCallback(false);
113
+ }
114
+ };
115
+ getSmartReplies() {
116
+ return new Promise((resolve, reject) => {
117
+ let receiverId = this.user ? this.user?.getUid() : this.group?.getGuid();
118
+ let receiverType = this.user ? ReceiverTypeConstants.user : ReceiverTypeConstants.group;
119
+ if (this.smartReplyConfiguration?.customView) {
120
+ CometChat.getSmartReplies(receiverId, receiverType).then((response) => {
121
+ this.smartReplyConfiguration.customView(response, this.closeBottomsheet).then((res) => {
122
+ return resolve((<View>{res}</View>));
123
+ })
124
+ .catch((err) => {
125
+ return reject(err);
126
+ });
127
+ })
128
+ .catch((err) => {
129
+ return reject(err);
130
+ });
131
+ }
132
+ else if (this.smartReplyConfiguration?.onClick) {
133
+ this.smartReplyConfiguration?.onClick(this.user, this.group).then((response) => {
134
+ return resolve((<View>{response}</View>));
135
+ })
136
+ .catch((err) => {
137
+ return reject(err);
138
+ });
139
+ }
140
+ else {
141
+ CometChat.getSmartReplies(receiverId, receiverType).then((response) => {
142
+ let view = [];
143
+ Object.keys(response).forEach((reply) => {
144
+ if (response[reply] && response[reply] != "") {
145
+ view.push((<TouchableOpacity style={getRepliesWrapperStyle(this.theme, this.smartReplyConfiguration?.smartRepliesStyle, this.configuration?.listItemStyle)} key={response[reply]} // Make sure to set a unique key for each item
146
+ onPress={() => this.editReply(response[reply])}>
147
+ <Text style={getRepliesStyle(this.theme, this.smartReplyConfiguration?.smartRepliesStyle, this.configuration?.listItemStyle)}>{response[reply]}</Text>
148
+ </TouchableOpacity>));
149
+ }
150
+ });
151
+ return resolve((<View>{view}</View>));
152
+ })
153
+ .catch((err) => {
154
+ return reject(err);
155
+ });
156
+ }
157
+ });
158
+ }
159
+ showDefaultPanel(state = State.loading, error) {
160
+ this.closeBottomsheet();
161
+ let LoadingView = this.smartReplyConfiguration?.LoadingStateView || this.configuration.LoadingStateView;
162
+ let EmptyView = this.smartReplyConfiguration?.EmptyStateView || this.configuration.EmptyStateView;
163
+ let ErrorView = this.smartReplyConfiguration?.ErrorStateView || this.configuration.ErrorStateView;
164
+ CometChatUIEventHandler.emitUIEvent(CometChatUIEvents.showPanel, {
165
+ alignment: ViewAlignment.composerBottom,
166
+ child: () => (<View style={{ width: this.cardViewStyle?.width || "100%", height: this.cardViewStyle?.height || 160, backgroundColor: this.cardViewStyle?.backgroundColor, borderRadius: this.cardViewStyle?.borderRadius, ...this.cardViewStyle?.border, justifyContent: "center", alignItems: "center" }}>
167
+ {state == State.loading ? LoadingView ? <LoadingView /> : <View style={{ width: this.cardViewStyle?.width || "100%", height: this.cardViewStyle?.height || 160, backgroundColor: this.cardViewStyle?.backgroundColor, borderRadius: this.cardViewStyle?.borderRadius, ...this.cardViewStyle?.border, justifyContent: "center", alignItems: "center" }}>
168
+ <Image source={this.configuration?.loadingIconURL ?? loadingIcon} style={{ height: 32, width: 32, tintColor: this.cardViewStyle?.loadingIconTint }}/>
169
+ <Text style={getloadingStateStyle(this.theme, this.cardViewStyle, this.smartReplyConfiguration?.smartRepliesStyle)}> {localize("GENERATING_REPLIES")}</Text>
170
+ </View>
171
+ :
172
+ state == State.empty ?
173
+ EmptyView ? <EmptyView /> : <View style={{ width: this.cardViewStyle?.width || "100%", height: this.cardViewStyle?.height || 160, backgroundColor: this.cardViewStyle?.backgroundColor, borderRadius: this.cardViewStyle?.borderRadius, ...this.cardViewStyle?.border, justifyContent: "center", alignItems: "center" }}>
174
+ <Image source={this.configuration?.emptyIconURL ?? emptyIcon} style={{ height: 32, width: 32, tintColor: this.cardViewStyle?.emptyIconTint }}/>
175
+ <Text style={emptyLabelStyle(this.cardViewStyle, this.smartReplyConfiguration.smartRepliesStyle)}> {this.emptyStateText}</Text>
176
+ </View>
177
+ : ErrorView ? ErrorView(error) :
178
+ <View style={{ width: this.cardViewStyle?.width || "100%", height: this.cardViewStyle?.height || 160, backgroundColor: this.cardViewStyle?.backgroundColor, borderRadius: this.cardViewStyle?.borderRadius, ...this.cardViewStyle?.border, justifyContent: "center", alignItems: "center" }}>
179
+ <Image source={this.configuration?.errorIconURL ?? errorIcon} style={{ height: 32, width: 32, tintColor: this.cardViewStyle?.errorIconTint }}/>
180
+ <Text style={errorLabelStyle(this.cardViewStyle, this.smartReplyConfiguration.smartRepliesStyle)}>{this.errorStateText}</Text>
181
+ </View>}
182
+
183
+
184
+ </View>),
185
+ });
186
+ this.isPannelVisible = true;
187
+ }
188
+ getAuxiliaryOptions(user, group, id, theme) {
189
+ let contextTheme = useContext(CometChatContext);
190
+ if (contextTheme?.theme) {
191
+ this.theme = contextTheme.theme;
192
+ }
193
+ else {
194
+ this.theme = theme || new CometChatTheme({});
195
+ }
196
+ this.cardViewStyle = getCardViewStyle(this.theme, this.configuration?.listStyle, this.smartReplyConfiguration.smartRepliesStyle);
197
+ this.id = id;
198
+ this.user = user;
199
+ this.group = group;
200
+ let auxiliaryOptions = super.getAuxiliaryOptions(user, group, id, theme);
201
+ this.cardsData = {
202
+ smartReply: {
203
+ title: localize("SUGGEST_A_REPLIES"),
204
+ onClick: this.onButtonClick,
205
+ id: "smart-replies",
206
+ style: getButtonStyles(this.theme, this.smartReplyConfiguration?.smartRepliesStyle, this.configuration?.listItemStyle)
207
+ },
208
+ conversationStarter: {
209
+ title: "Conversation Starter",
210
+ onClick: this.onButtonClick,
211
+ id: "conversation-starter",
212
+ style: getButtonStyles(this.theme, this.conversationStarterConfiguration?.conversationStarterStyle)
213
+ }
214
+ };
215
+ if (!id.parentMessageId || Number(id.parentMessageId) <= 0 || id.parentMessageId == undefined) {
216
+ auxiliaryOptions.unshift(this.getAIAuxiliaryButton(id, user, group, theme));
217
+ }
218
+ return auxiliaryOptions;
219
+ }
220
+ getAIAuxiliaryButton(id, user, group, theme) {
221
+ const [aiFeatures, setAiFeatures] = useState(false);
222
+ let cards = [];
223
+ this.setCallback = setAiFeatures;
224
+ if (this.features && Object.keys(this.features).length > 0) {
225
+ if (this.features?.["smart-replies"]?.enabled) {
226
+ this.smartReplyConfiguration = this.features?.["smart-replies"]?.configuration ?? new AISmartRepliesConfiguration({});
227
+ cards.push(this.cardsData.smartReply);
228
+ }
229
+ }
230
+ return (<TouchableOpacity onPress={() => {
231
+ CometChatUIEventHandler.emitUIEvent(CometChatUIEvents.hidePanel, {
232
+ alignment: ViewAlignment.composerBottom,
233
+ child: () => (null),
234
+ });
235
+ if (this.isPannelVisible) {
236
+ setAiFeatures(false);
237
+ this.isPannelVisible = false;
238
+ return;
239
+ }
240
+ setAiFeatures(true);
241
+ }} style={{ justifyContent: "center" }}>
242
+ <Image source={this.configuration?.buttonIconURL || AIBotIcon} style={{ height: 32, width: 32, marginLeft: 8, marginRight: 8, color: 'red' }}/>
243
+ {<CometChatBottomSheet isOpen={aiFeatures} sliderMaxHeight={this.cardViewStyle?.height || 350} onClose={() => {
244
+ setAiFeatures(false);
245
+ }}>
246
+ <CardView cardViewStyle={this.cardViewStyle} buttons={cards}/>
247
+ </CometChatBottomSheet>}
248
+ </TouchableOpacity>);
249
+ }
250
+ }
251
+ //# sourceMappingURL=AIEnablerDecorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AIEnablerDecorator.js","sourceRoot":"","sources":["../../src/AI/AIEnablerDecorator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAc,cAAc,EAAE,iBAAiB,EAAE,QAAQ,EAAE,uBAAuB,EAAE,oBAAoB,EAAuD,MAAM,WAAW,CAAC;AAG7M,OAAO,EAAE,QAAQ,EAAQ,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAyD,eAAe,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpN,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAC1F,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACzF,OAAO,KAAK,EAAE,EAAqB,QAAQ,EAAO,UAAU,EAAC,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAC,WAAW,EAAC,SAAS,EAAC,SAAS,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAA2B,KAAK,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,kCAAkC,EAAE,MAAM,uCAAuC,CAAC;AAC3F,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAE7E,MAAM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UAAA,CAAC,QAAQ,CACP,aAAa,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAClC,OAAO,CAAC,CAAC,KAAK,CAAC,EAEnB;QAAA,EAAE,oBAAoB,CAAC,CAE3B;IAAA,EAAE,gBAAgB,CAAC,CAAC,CAAA;IAEtB,CAAC;CAEF"}
@@ -0,0 +1,6 @@
1
+ import { ExtensionsDataSource } from "../shared/framework/ExtensionsDataSource";
2
+ import { AIEnablerConfiguration } from "./configuration";
3
+ export declare abstract class AIExtensionDataSource extends ExtensionsDataSource {
4
+ getConfiguration(): any;
5
+ setConfiguration(config?: AIEnablerConfiguration): void;
6
+ }
@@ -0,0 +1,10 @@
1
+ import { ExtensionsDataSource } from "../shared/framework/ExtensionsDataSource";
2
+ export class AIExtensionDataSource extends ExtensionsDataSource {
3
+ getConfiguration() {
4
+ }
5
+ ;
6
+ setConfiguration(config) {
7
+ }
8
+ ;
9
+ }
10
+ //# sourceMappingURL=AIExtensionDataSource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AIExtensionDataSource.js","sourceRoot":"","sources":["../../src/AI/AIExtensionDataSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAGhF,MAAM,OAAgB,qBAAsB,SAAQ,oBAAoB;IACrE,gBAAgB;IAEhB,CAAC;IAAA,CAAC;IACF,gBAAgB,CAAC,MAA8B;IAE/C,CAAC;IAAA,CAAC;CAEJ"}
@@ -0,0 +1,10 @@
1
+ import { AIExtensionDataSource } from "../AIExtensionDataSource";
2
+ import { AISmartRepliesConfiguration } from "./configuration";
3
+ export declare class AISmartRepliesExtension extends AIExtensionDataSource {
4
+ private configuration?;
5
+ constructor(configuration?: AISmartRepliesConfiguration);
6
+ addExtension(): void;
7
+ getExtensionId(): string;
8
+ enable(): void;
9
+ getConfiguration(): AISmartRepliesConfiguration;
10
+ }
@@ -0,0 +1,23 @@
1
+ import { AISmartRepliesExtensionDecorator } from "./AISmartRepliesDecorator";
2
+ import { ChatConfigurator } from "../../shared";
3
+ import { AIExtensionDataSource } from "../AIExtensionDataSource";
4
+ export class AISmartRepliesExtension extends AIExtensionDataSource {
5
+ configuration;
6
+ constructor(configuration) {
7
+ super();
8
+ this.configuration = configuration;
9
+ }
10
+ addExtension() {
11
+ ChatConfigurator.enable((dataSource) => new AISmartRepliesExtensionDecorator(dataSource, this.configuration));
12
+ }
13
+ getExtensionId() {
14
+ return "smart-replies";
15
+ }
16
+ enable() {
17
+ this.addExtension();
18
+ }
19
+ getConfiguration() {
20
+ return this.configuration;
21
+ }
22
+ }
23
+ //# sourceMappingURL=AISmartReplies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AISmartReplies.js","sourceRoot":"","sources":["../../../src/AI/AISmartReplies/AISmartReplies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAG,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,MAAM,OAAO,uBAAwB,SAAQ,qBAAqB;IAExD,aAAa,CAA+B;IAEtD,YAAY,aAA2C;QACrD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IACU,YAAY;QACnB,gBAAgB,CAAC,MAAM,CAAC,CAAC,UAAe,EAAE,EAAE,CAAC,IAAI,gCAAgC,CAAC,UAAU,EAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IACpH,CAAC;IACQ,cAAc;QACrB,OAAO,eAAe,CAAC;IACzB,CAAC;IACQ,MAAM;QACb,IAAI,CAAC,YAAY,EAAE,CAAA;IAErB,CAAC;IACO,gBAAgB;QACtB,OAAO,IAAI,CAAC,aAAa,CAAC;IACxB,CAAC;CAGN"}
@@ -0,0 +1,7 @@
1
+ import { DataSource, DataSourceDecorator } from "../../shared";
2
+ import { AISmartRepliesConfiguration } from "./configuration";
3
+ export declare class AISmartRepliesExtensionDecorator extends DataSourceDecorator {
4
+ configuration?: AISmartRepliesConfiguration;
5
+ constructor(dataSource: DataSource, configuration?: AISmartRepliesConfiguration);
6
+ getId(): string;
7
+ }
@@ -0,0 +1,12 @@
1
+ import { DataSourceDecorator } from "../../shared";
2
+ export class AISmartRepliesExtensionDecorator extends DataSourceDecorator {
3
+ configuration;
4
+ constructor(dataSource, configuration) {
5
+ super(dataSource);
6
+ this.configuration = configuration;
7
+ }
8
+ getId() {
9
+ return "aismartreply";
10
+ }
11
+ }
12
+ //# sourceMappingURL=AISmartRepliesDecorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AISmartRepliesDecorator.js","sourceRoot":"","sources":["../../../src/AI/AISmartReplies/AISmartRepliesDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAI9D,MAAM,OAAO,gCAAiC,SAAQ,mBAAmB;IAChE,aAAa,CAA8B;IAClD,YAAY,UAAqB,EAAC,aAA0C;QAC5E,KAAK,CAAC,UAAU,CAAC,CAAC;QAClB,IAAI,CAAC,aAAa,GAAI,aAAa,CAAC;IACtC,CAAC;IACU,KAAK;QACZ,OAAO,cAAc,CAAC;IACxB,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ import { FontStyleInterface, BorderStyleInterface } from "../../shared";
2
+ import { AIButtonsStyle } from "../utils";
3
+ export declare class AISmartRepliesStyle extends AIButtonsStyle {
4
+ buttonTextColor?: string;
5
+ buttonTextFont?: FontStyleInterface;
6
+ buttonBorder?: BorderStyleInterface;
7
+ buttonBorderRadius?: string;
8
+ buttonHeight?: string;
9
+ buttonWidth?: string;
10
+ buttonBackgroundColor?: string;
11
+ constructor(props: Partial<AIButtonsStyle>);
12
+ }
@@ -0,0 +1,15 @@
1
+ import { AIButtonsStyle } from "../utils";
2
+ export class AISmartRepliesStyle extends AIButtonsStyle {
3
+ buttonTextColor;
4
+ buttonTextFont;
5
+ buttonBorder;
6
+ buttonBorderRadius;
7
+ buttonHeight;
8
+ buttonWidth;
9
+ buttonBackgroundColor;
10
+ constructor(props) {
11
+ super({ ...props });
12
+ Object.assign(this, props);
13
+ }
14
+ }
15
+ //# sourceMappingURL=AISmartRepliesStyle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AISmartRepliesStyle.js","sourceRoot":"","sources":["../../../src/AI/AISmartReplies/AISmartRepliesStyle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,OAAO,mBAAoB,SAAQ,cAAc;IACnD,eAAe,CAAS;IACxB,cAAc,CAAqB;IACnC,YAAY,CAAuB;IACnC,kBAAkB,CAAS;IAC3B,YAAY,CAAS;IACrB,WAAW,CAAS;IACpB,qBAAqB,CAAS;IAC9B,YAAY,KAA8B;QACxC,KAAK,CAAC,EAAC,GAAG,KAAK,EAAC,CAAC,CAAA;QACjB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC7B,CAAC;CACF"}
@@ -0,0 +1,14 @@
1
+ import { CometChat } from '@cometchat/chat-sdk-react-native';
2
+ import { AISmartRepliesStyle } from './AISmartRepliesStyle';
3
+ export declare class AISmartRepliesConfiguration {
4
+ onClick?: (user?: CometChat.User, group?: CometChat.Group) => Promise<Object>;
5
+ smartRepliesStyle?: AISmartRepliesStyle;
6
+ customView?: (response: Object, closeBottomsheet?: () => void) => Promise<Object>;
7
+ ErrorStateView?: (e?: CometChat.CometChatException) => JSX.Element;
8
+ EmptyStateView?: () => JSX.Element;
9
+ LoadingStateView?: () => JSX.Element;
10
+ loadingIconURL?: string;
11
+ errorIconURL?: string;
12
+ emptyIconURL?: string;
13
+ constructor(props: Partial<AISmartRepliesConfiguration>);
14
+ }
@@ -0,0 +1,16 @@
1
+ import { loadingIcon, errorIcon, emptyIcon } from '../resources';
2
+ export class AISmartRepliesConfiguration {
3
+ onClick;
4
+ smartRepliesStyle;
5
+ customView;
6
+ ErrorStateView;
7
+ EmptyStateView;
8
+ LoadingStateView;
9
+ loadingIconURL = loadingIcon;
10
+ errorIconURL = errorIcon;
11
+ emptyIconURL = emptyIcon;
12
+ constructor(props) {
13
+ Object.assign(this, props);
14
+ }
15
+ }
16
+ //# sourceMappingURL=configuration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../src/AI/AISmartReplies/configuration.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACjE,MAAM,OAAO,2BAA2B;IACpC,OAAO,CAAiE;IACxE,iBAAiB,CAAsB;IACvC,UAAU,CAAkE;IAC5E,cAAc,CAAqD;IACnE,cAAc,CAAqB;IACnC,gBAAgB,CAAqB;IACrC,cAAc,GAAW,WAAW,CAAC;IACrC,YAAY,GAAW,SAAS,CAAC;IACjC,YAAY,GAAW,SAAS,CAAC;IACjC,YAAY,KAA2C;QACrD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC7B,CAAC;CACF"}
@@ -0,0 +1,19 @@
1
+ import { CardViewStyle } from './CardViewStyle';
2
+ import React from 'react';
3
+ import { AIButtonsStyle } from './utils';
4
+ export type Card = {
5
+ title?: string;
6
+ id?: string;
7
+ onClick?: (id: string) => void;
8
+ style?: AIButtonsStyle;
9
+ };
10
+ interface CardProps {
11
+ buttons?: Card[];
12
+ backCallback?: (callback: () => void) => void;
13
+ cardViewStyle?: CardViewStyle;
14
+ }
15
+ export declare const CardView: {
16
+ (props: CardProps): React.JSX.Element;
17
+ defaultProps: CardProps;
18
+ };
19
+ export default CardView;
@@ -0,0 +1,45 @@
1
+ import { useState } from 'react';
2
+ import { contentContainerStyle, getButtonStyles, getPopoverStyle } from './style';
3
+ import { CometChatTheme } from '../shared';
4
+ import { TouchableOpacity, Text, ScrollView } from 'react-native';
5
+ import React from 'react';
6
+ import { View } from 'react-native';
7
+ ;
8
+ const defaultProps = {
9
+ buttons: undefined,
10
+ backCallback: undefined,
11
+ cardViewStyle: undefined
12
+ };
13
+ export const CardView = (props) => {
14
+ const [currentSection, setCurrentSection] = useState(null);
15
+ function fetchButtonContent(button) {
16
+ setCurrentSection(button?.id);
17
+ if (button && button.onClick) {
18
+ button.onClick(button.id);
19
+ }
20
+ }
21
+ function getButtons() {
22
+ return (<View style={{
23
+ width: "100%",
24
+ backgroundColor: "transparent",
25
+ }}>
26
+ {props.buttons.map(item => (<TouchableOpacity key={item.id} // Make sure to set a unique key for each item
27
+ onPress={() => fetchButtonContent(item)}>
28
+ <Text style={getButtonStyles(new CometChatTheme({}), item?.style)}>{item.title}</Text>
29
+ </TouchableOpacity>))}
30
+ </View>);
31
+ }
32
+ return (<View style={getPopoverStyle(props.cardViewStyle)}>
33
+
34
+ <View style={contentContainerStyle}>
35
+ {!currentSection && props.buttons && (<ScrollView style={{ height: "100%", width: "100%" }}>
36
+
37
+ {getButtons()}
38
+ </ScrollView>)}
39
+
40
+ </View>
41
+ </View>);
42
+ };
43
+ CardView.defaultProps = defaultProps;
44
+ export default CardView;
45
+ //# sourceMappingURL=CardView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardView.js","sourceRoot":"","sources":["../../src/AI/CardView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAG,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAI,qBAAqB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEpF,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAC,IAAI,EAAC,UAAU,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAYnC,CAAC;AAEF,MAAM,YAAY,GAAa;IAC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AAqB,CAAC,CAClC;QAAA,CAAC,CAAC,cAAc,IAAI,KAAK,CAAC,OAAO,IAAK,CACpC,CAAC,UAAU,CAAE,KAAK,CAAC,CAAC,EAAC,MAAM,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,EAAC,CAAC,CAE/C;;YAAA,CAAE,UAAU,EAAE,CAChB;UAAA,EAAE,UAAU,CAAC,CAGd,CAEH;;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,QAAQ,CAAC,YAAY,GAAG,YAAY,CAAA;AACpC,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { BaseStyle, BorderStyleInterface, FontStyleInterface } from "../shared";
2
+ export declare class CardViewStyle extends BaseStyle {
3
+ emptyStateTextFont?: FontStyleInterface;
4
+ emptyStateTextColor?: string;
5
+ errorStateTextFont?: FontStyleInterface;
6
+ errorStateTextColor?: string;
7
+ loadingStateTextFont?: FontStyleInterface;
8
+ loadingStateTextColor?: string;
9
+ loadingIconTint?: string;
10
+ errorIconTint?: string;
11
+ emptyIconTint?: string;
12
+ boxShadow?: string;
13
+ constructor(props: Partial<CardViewStyle>);
14
+ }
15
+ export declare class CardStyle extends BaseStyle {
16
+ buttonTextColor?: string;
17
+ buttonTextFont?: FontStyleInterface;
18
+ buttonBorder?: BorderStyleInterface;
19
+ buttonBorderRadius?: string;
20
+ buttonHeight?: string;
21
+ buttonWidth?: string;
22
+ buttonBackgroundColor?: string;
23
+ repliesTextFont?: FontStyleInterface;
24
+ repliesTextBorder?: BorderStyleInterface;
25
+ repliesTextBorderRadius?: string;
26
+ repliesTextColor?: string;
27
+ repliesTextBackgroundColor?: string;
28
+ constructor(props: Partial<CardViewStyle>);
29
+ }
@@ -0,0 +1,36 @@
1
+ import { BaseStyle } from "../shared";
2
+ export class CardViewStyle extends BaseStyle {
3
+ emptyStateTextFont;
4
+ emptyStateTextColor = "#bcbcbc";
5
+ errorStateTextFont;
6
+ errorStateTextColor = "#bcbcbc";
7
+ loadingStateTextFont;
8
+ loadingStateTextColor = "#bcbcbc";
9
+ loadingIconTint = "#bcbcbc";
10
+ errorIconTint = "#bcbcbc";
11
+ emptyIconTint = "#bcbcbc";
12
+ boxShadow;
13
+ constructor(props) {
14
+ super({});
15
+ Object.assign(this, props);
16
+ }
17
+ }
18
+ export class CardStyle extends BaseStyle {
19
+ buttonTextColor;
20
+ buttonTextFont;
21
+ buttonBorder;
22
+ buttonBorderRadius;
23
+ buttonHeight;
24
+ buttonWidth;
25
+ buttonBackgroundColor;
26
+ repliesTextFont;
27
+ repliesTextBorder;
28
+ repliesTextBorderRadius;
29
+ repliesTextColor;
30
+ repliesTextBackgroundColor;
31
+ constructor(props) {
32
+ super({});
33
+ Object.assign(this, props);
34
+ }
35
+ }
36
+ //# sourceMappingURL=CardViewStyle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardViewStyle.js","sourceRoot":"","sources":["../../src/AI/CardViewStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA4C,MAAM,WAAW,CAAC;AAEhF,MAAM,OAAO,aAAe,SAAQ,SAAS;IACzC,kBAAkB,CAAsB;IACxC,mBAAmB,GAAY,SAAS,CAAC;IACzC,kBAAkB,CAAsB;IACxC,mBAAmB,GAAY,SAAS,CAAC;IACzC,oBAAoB,CAAsB;IAC1C,qBAAqB,GAAY,SAAS,CAAC;IAC3C,eAAe,GAAY,SAAS,CAAC;IACrC,aAAa,GAAY,SAAS,CAAC;IACnC,aAAa,GAAY,SAAS,CAAC;IACnC,SAAS,CAAS;IAChB,YAAY,KAA6B;QACrC,KAAK,CAAC,EAAE,CAAC,CAAA;QACT,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC7B,CAAC;CACN;AAED,MAAM,OAAO,SAAW,SAAQ,SAAS;IACvC,eAAe,CAAS;IACxB,cAAc,CAAqB;IACnC,YAAY,CAAuB;IACnC,kBAAkB,CAAS;IAC3B,YAAY,CAAS;IACrB,WAAW,CAAS;IACpB,qBAAqB,CAAS;IAC9B,eAAe,CAAqB;IACpC,iBAAiB,CAAuB;IACxC,uBAAuB,CAAS;IAChC,gBAAgB,CAAS;IACzB,0BAA0B,CAAS;IACjC,YAAY,KAA6B;QACrC,KAAK,CAAC,EAAE,CAAC,CAAA;QACT,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC7B,CAAC;CACN"}
@@ -0,0 +1,14 @@
1
+ import { CardStyle, CardViewStyle } from "./CardViewStyle";
2
+ import { CometChat } from '@cometchat/chat-sdk-react-native';
3
+ export declare class AIEnablerConfiguration {
4
+ listStyle?: CardViewStyle;
5
+ listItemStyle?: CardStyle;
6
+ buttonIconURL?: string;
7
+ ErrorStateView?: (e?: CometChat.CometChatException) => JSX.Element;
8
+ EmptyStateView?: () => JSX.Element;
9
+ LoadingStateView?: () => JSX.Element;
10
+ loadingIconURL?: string;
11
+ errorIconURL?: string;
12
+ emptyIconURL?: string;
13
+ constructor(props: Partial<AIEnablerConfiguration>);
14
+ }
@@ -0,0 +1,16 @@
1
+ import { emptyIcon, errorIcon, loadingIcon } from "./resources";
2
+ export class AIEnablerConfiguration {
3
+ listStyle;
4
+ listItemStyle;
5
+ buttonIconURL = "";
6
+ ErrorStateView;
7
+ EmptyStateView;
8
+ LoadingStateView;
9
+ loadingIconURL = loadingIcon;
10
+ errorIconURL = errorIcon;
11
+ emptyIconURL = emptyIcon;
12
+ constructor(props) {
13
+ Object.assign(this, props);
14
+ }
15
+ }
16
+ //# sourceMappingURL=configuration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../src/AI/configuration.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAChE,MAAM,OAAO,sBAAsB;IAC/B,SAAS,CAAiB;IAC1B,aAAa,CAAY;IACzB,aAAa,GAAY,EAAE,CAAC;IAC5B,cAAc,CAAqD;IACnE,cAAc,CAAqB;IACnC,gBAAgB,CAAqB;IACrC,cAAc,GAAW,WAAW,CAAC;IACrC,YAAY,GAAW,SAAS,CAAC;IACjC,YAAY,GAAW,SAAS,CAAC;IACjC,YAAY,KAAsC;QAChD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC7B,CAAC;CACF"}
@@ -0,0 +1,5 @@
1
+ import AIBotIcon from "./ai.png";
2
+ import loadingIcon from './spineer.png';
3
+ import errorIcon from './ai-error.png';
4
+ import emptyIcon from './ai-empty.png';
5
+ export { AIBotIcon, loadingIcon, errorIcon, emptyIcon };
@@ -0,0 +1,6 @@
1
+ import AIBotIcon from "./ai.png";
2
+ import loadingIcon from './spineer.png';
3
+ import errorIcon from './ai-error.png';
4
+ import emptyIcon from './ai-empty.png';
5
+ export { AIBotIcon, loadingIcon, errorIcon, emptyIcon };
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/AI/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,UAAU,CAAC;AACjC,OAAO,WAAW,MAAM,eAAe,CAAA;AACvC,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,SAAS,MAAM,gBAAgB,CAAA;AAEtC,OAAO,EACH,SAAS,EACT,WAAW,EACX,SAAS,EACT,SAAS,EACZ,CAAA"}