@robylon/react-native-sdk 1.10.1-staging.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/lib/commonjs/ChatbotWebview.js +45 -0
- package/lib/commonjs/ChatbotWebview.js.map +1 -0
- package/lib/commonjs/Chatbotsdk.js +310 -0
- package/lib/commonjs/Chatbotsdk.js.map +1 -0
- package/lib/commonjs/FloatingButton.js +61 -0
- package/lib/commonjs/FloatingButton.js.map +1 -0
- package/lib/commonjs/LoadingIndicator.js +21 -0
- package/lib/commonjs/LoadingIndicator.js.map +1 -0
- package/lib/commonjs/config.js +11 -0
- package/lib/commonjs/config.js.map +1 -0
- package/lib/commonjs/constants.js +10 -0
- package/lib/commonjs/constants.js.map +1 -0
- package/lib/commonjs/global.d.js +8 -0
- package/lib/commonjs/global.d.js.map +1 -0
- package/lib/commonjs/index.js +21 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/openChatbot.js +18 -0
- package/lib/commonjs/openChatbot.js.map +1 -0
- package/lib/module/ChatbotWebview.js +34 -0
- package/lib/module/ChatbotWebview.js.map +1 -0
- package/lib/module/Chatbotsdk.js +301 -0
- package/lib/module/Chatbotsdk.js.map +1 -0
- package/lib/module/FloatingButton.js +54 -0
- package/lib/module/FloatingButton.js.map +1 -0
- package/lib/module/LoadingIndicator.js +14 -0
- package/lib/module/LoadingIndicator.js.map +1 -0
- package/lib/module/config.js +5 -0
- package/lib/module/config.js.map +1 -0
- package/lib/module/constants.js +4 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/global.d.js +7 -0
- package/lib/module/global.d.js.map +1 -0
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/openChatbot.js +11 -0
- package/lib/module/openChatbot.js.map +1 -0
- package/lib/typescript/ChatbotWebview.d.ts +8 -0
- package/lib/typescript/ChatbotWebview.d.ts.map +1 -0
- package/lib/typescript/Chatbotsdk.d.ts +16 -0
- package/lib/typescript/Chatbotsdk.d.ts.map +1 -0
- package/lib/typescript/FloatingButton.d.ts +9 -0
- package/lib/typescript/FloatingButton.d.ts.map +1 -0
- package/lib/typescript/LoadingIndicator.d.ts +4 -0
- package/lib/typescript/LoadingIndicator.d.ts.map +1 -0
- package/lib/typescript/config.d.ts +5 -0
- package/lib/typescript/config.d.ts.map +1 -0
- package/lib/typescript/constants.d.ts +2 -0
- package/lib/typescript/constants.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +3 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/openChatbot.d.ts +2 -0
- package/lib/typescript/openChatbot.d.ts.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import React, { useState, useEffect, useRef, useMemo } from "react";
|
|
2
|
+
import { View, StyleSheet, Animated, Dimensions, Platform, StatusBar } from "react-native";
|
|
3
|
+
import { WebView } from "react-native-webview";
|
|
4
|
+
import FloatingButton from "./FloatingButton";
|
|
5
|
+
import { BASE_CHATBOT_URL } from "./constants";
|
|
6
|
+
const ChatbotSDK = ({
|
|
7
|
+
api_key,
|
|
8
|
+
user_id,
|
|
9
|
+
user_token,
|
|
10
|
+
additional_params = {},
|
|
11
|
+
show_floating_button = true,
|
|
12
|
+
onMessage,
|
|
13
|
+
isFullScreen = true,
|
|
14
|
+
enableAnimation = true,
|
|
15
|
+
onOpen,
|
|
16
|
+
onClose
|
|
17
|
+
}) => {
|
|
18
|
+
const [isWebViewVisible, setIsWebViewVisible] = useState(false);
|
|
19
|
+
const [chatbotConfig, setChatbotConfig] = useState(null);
|
|
20
|
+
const [loading, setLoading] = useState(true);
|
|
21
|
+
const webViewRef = useRef(null);
|
|
22
|
+
const fadeAnim = useRef(new Animated.Value(0)).current;
|
|
23
|
+
const isFirstLoadRef = useRef(true);
|
|
24
|
+
const webViewUrl = useMemo(() => constructUrl(), [api_key, user_id, additional_params]);
|
|
25
|
+
const stableAdditionalParams = useMemo(() => additional_params, [JSON.stringify(additional_params)]);
|
|
26
|
+
const triggerAppInit = () => {
|
|
27
|
+
if (webViewRef.current) {
|
|
28
|
+
webViewRef.current.injectJavaScript(`
|
|
29
|
+
// Trigger APP_READY equivalent
|
|
30
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'APP_READY' }));
|
|
31
|
+
true;
|
|
32
|
+
`);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
const fetchChatbotConfig = async () => {
|
|
37
|
+
try {
|
|
38
|
+
var _data$user;
|
|
39
|
+
const endpointUrl = `https://stage-api.robylon.ai/users/auth/copilot/`;
|
|
40
|
+
const payload = {
|
|
41
|
+
client_user_id: user_id,
|
|
42
|
+
org_id: api_key,
|
|
43
|
+
token: user_token,
|
|
44
|
+
extra_info: stableAdditionalParams
|
|
45
|
+
};
|
|
46
|
+
const response = await fetch(endpointUrl, {
|
|
47
|
+
method: "POST",
|
|
48
|
+
headers: {
|
|
49
|
+
"Content-Type": "application/json"
|
|
50
|
+
},
|
|
51
|
+
body: JSON.stringify(payload)
|
|
52
|
+
});
|
|
53
|
+
if (!response.ok) {
|
|
54
|
+
throw new Error("Failed to fetch chatbot configuration");
|
|
55
|
+
}
|
|
56
|
+
const data = await response.json();
|
|
57
|
+
const orgInfo = data === null || data === void 0 || (_data$user = data.user) === null || _data$user === void 0 ? void 0 : _data$user.org_info;
|
|
58
|
+
if (orgInfo) {
|
|
59
|
+
var _orgInfo$config, _orgInfo$brand_config, _orgInfo$config2;
|
|
60
|
+
setChatbotConfig({
|
|
61
|
+
brand_color: (orgInfo === null || orgInfo === void 0 || (_orgInfo$config = orgInfo.config) === null || _orgInfo$config === void 0 ? void 0 : _orgInfo$config.brand_colour) || "#007AFF",
|
|
62
|
+
image_url: (orgInfo === null || orgInfo === void 0 || (_orgInfo$brand_config = orgInfo.brand_config) === null || _orgInfo$brand_config === void 0 ? void 0 : _orgInfo$brand_config.launcher_logo_url) || "",
|
|
63
|
+
welcome_message: (orgInfo === null || orgInfo === void 0 || (_orgInfo$config2 = orgInfo.config) === null || _orgInfo$config2 === void 0 ? void 0 : _orgInfo$config2.welcome_message) || ""
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
} catch (error) {
|
|
67
|
+
console.error("Error fetching chatbot configuration:", error);
|
|
68
|
+
} finally {
|
|
69
|
+
setLoading(false);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
if (api_key && user_id) {
|
|
73
|
+
fetchChatbotConfig();
|
|
74
|
+
}
|
|
75
|
+
}, [api_key, user_id, user_token, stableAdditionalParams]);
|
|
76
|
+
function constructUrl() {
|
|
77
|
+
if (!user_id) return "";
|
|
78
|
+
const params = new URLSearchParams({
|
|
79
|
+
id: api_key,
|
|
80
|
+
user_id,
|
|
81
|
+
...additional_params
|
|
82
|
+
});
|
|
83
|
+
return `${BASE_CHATBOT_URL}?${params.toString()}`;
|
|
84
|
+
}
|
|
85
|
+
const openWebView = () => {
|
|
86
|
+
setIsWebViewVisible(true);
|
|
87
|
+
if (enableAnimation) {
|
|
88
|
+
Animated.timing(fadeAnim, {
|
|
89
|
+
toValue: 1,
|
|
90
|
+
duration: 250,
|
|
91
|
+
useNativeDriver: true
|
|
92
|
+
}).start(() => {
|
|
93
|
+
onOpen === null || onOpen === void 0 || onOpen();
|
|
94
|
+
if (!isFirstLoadRef.current) {
|
|
95
|
+
// If not first load, manually trigger initialization
|
|
96
|
+
setTimeout(triggerAppInit, 100);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
} else {
|
|
100
|
+
fadeAnim.setValue(1);
|
|
101
|
+
requestAnimationFrame(() => {
|
|
102
|
+
onOpen === null || onOpen === void 0 || onOpen();
|
|
103
|
+
if (!isFirstLoadRef.current) {
|
|
104
|
+
setTimeout(triggerAppInit, 100);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
const closeWebView = () => {
|
|
110
|
+
if (webViewRef.current) {
|
|
111
|
+
console.log("closeWebView");
|
|
112
|
+
webViewRef.current.postMessage(JSON.stringify({
|
|
113
|
+
name: "closeFrame",
|
|
114
|
+
domain: "app-domain.com"
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
117
|
+
const complete = () => {
|
|
118
|
+
setIsWebViewVisible(false);
|
|
119
|
+
onClose === null || onClose === void 0 || onClose();
|
|
120
|
+
};
|
|
121
|
+
if (enableAnimation) {
|
|
122
|
+
Animated.timing(fadeAnim, {
|
|
123
|
+
toValue: 0,
|
|
124
|
+
duration: 200,
|
|
125
|
+
useNativeDriver: true
|
|
126
|
+
}).start(complete);
|
|
127
|
+
} else {
|
|
128
|
+
fadeAnim.setValue(0);
|
|
129
|
+
requestAnimationFrame(complete);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
const handleMessage = event => {
|
|
133
|
+
const {
|
|
134
|
+
data
|
|
135
|
+
} = event.nativeEvent;
|
|
136
|
+
try {
|
|
137
|
+
const parsedData = JSON.parse(data);
|
|
138
|
+
if (parsedData.type === "APP_READY") {
|
|
139
|
+
console.log("APP_READY", webViewRef.current && isWebViewVisible);
|
|
140
|
+
if (webViewRef.current && isWebViewVisible) {
|
|
141
|
+
webViewRef.current.injectJavaScript(`
|
|
142
|
+
window.postMessage(${JSON.stringify({
|
|
143
|
+
name: "openFrame",
|
|
144
|
+
domain: "app-domain.com"
|
|
145
|
+
})}, '*');
|
|
146
|
+
window.postMessage(${JSON.stringify({
|
|
147
|
+
name: "registerUserId",
|
|
148
|
+
action: "registerUserId",
|
|
149
|
+
domain: "app-domain.com",
|
|
150
|
+
data: {
|
|
151
|
+
userId: `${user_id}`,
|
|
152
|
+
token: `${user_token}`
|
|
153
|
+
}
|
|
154
|
+
})}, '*');
|
|
155
|
+
`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if (typeof parsedData !== "object" || !parsedData.type) {
|
|
159
|
+
console.warn("Invalid message structure");
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
switch (parsedData.type) {
|
|
163
|
+
case "close_chatbot":
|
|
164
|
+
closeWebView();
|
|
165
|
+
break;
|
|
166
|
+
default:
|
|
167
|
+
if (onMessage) onMessage(parsedData);
|
|
168
|
+
}
|
|
169
|
+
} catch (error) {
|
|
170
|
+
console.error("Failed to parse or process WebView message:", error);
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
const getScreenDimensions = () => {
|
|
174
|
+
const windowHeight = Dimensions.get("window").height;
|
|
175
|
+
const windowWidth = Dimensions.get("window").width;
|
|
176
|
+
const statusBarHeight = Platform.OS === "ios" ? 0 : StatusBar.currentHeight || 0;
|
|
177
|
+
return {
|
|
178
|
+
height: windowHeight - statusBarHeight,
|
|
179
|
+
width: windowWidth
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
const screenDimensions = getScreenDimensions();
|
|
183
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
184
|
+
style: styles.mainContainer
|
|
185
|
+
}, !loading && /*#__PURE__*/React.createElement(React.Fragment, null, show_floating_button && api_key && chatbotConfig && /*#__PURE__*/React.createElement(FloatingButton, {
|
|
186
|
+
onPress: openWebView,
|
|
187
|
+
brandColor: chatbotConfig.brand_color,
|
|
188
|
+
imageUrl: chatbotConfig.image_url
|
|
189
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
190
|
+
style: [styles.webViewWrapper, {
|
|
191
|
+
height: isWebViewVisible ? "100%" : 0
|
|
192
|
+
}],
|
|
193
|
+
pointerEvents: isWebViewVisible ? "auto" : "none"
|
|
194
|
+
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
195
|
+
style: [isFullScreen ? styles.fullScreenContainer : styles.inlineContainer, {
|
|
196
|
+
opacity: fadeAnim
|
|
197
|
+
}]
|
|
198
|
+
}, /*#__PURE__*/React.createElement(WebView, {
|
|
199
|
+
ref: webViewRef,
|
|
200
|
+
source: {
|
|
201
|
+
uri: webViewUrl
|
|
202
|
+
},
|
|
203
|
+
onMessage: handleMessage,
|
|
204
|
+
style: styles.webview,
|
|
205
|
+
containerStyle: isFullScreen ? {
|
|
206
|
+
width: screenDimensions.width,
|
|
207
|
+
height: screenDimensions.height
|
|
208
|
+
} : undefined,
|
|
209
|
+
allowsInlineMediaPlayback: true,
|
|
210
|
+
mediaPlaybackRequiresUserAction: false,
|
|
211
|
+
allowFileAccess: false,
|
|
212
|
+
geolocationEnabled: false,
|
|
213
|
+
javaScriptEnabled: true,
|
|
214
|
+
domStorageEnabled: true,
|
|
215
|
+
cacheEnabled: true,
|
|
216
|
+
scrollEnabled: true,
|
|
217
|
+
bounces: false,
|
|
218
|
+
onShouldStartLoadWithRequest: request => {
|
|
219
|
+
return request.url.startsWith(BASE_CHATBOT_URL);
|
|
220
|
+
},
|
|
221
|
+
startInLoadingState: isFirstLoadRef.current,
|
|
222
|
+
onLoadEnd: () => {
|
|
223
|
+
var _webViewRef$current;
|
|
224
|
+
(_webViewRef$current = webViewRef.current) === null || _webViewRef$current === void 0 || _webViewRef$current.injectJavaScript(`
|
|
225
|
+
if (!document.querySelector('meta[name="viewport"]')) {
|
|
226
|
+
var meta = document.createElement('meta');
|
|
227
|
+
meta.name = 'viewport';
|
|
228
|
+
meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no';
|
|
229
|
+
document.getElementsByTagName('head')[0].appendChild(meta);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
if (!document.querySelector('#injectedStyle')) {
|
|
233
|
+
const style = document.createElement('style');
|
|
234
|
+
style.id = 'injectedStyle';
|
|
235
|
+
style.textContent = \`
|
|
236
|
+
html, body, #root, #__next {
|
|
237
|
+
height: 100% !important;
|
|
238
|
+
min-height: 100% !important;
|
|
239
|
+
overflow: hidden !important;
|
|
240
|
+
}
|
|
241
|
+
\`;
|
|
242
|
+
document.head.appendChild(style);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
window.sendToChatbot = function(message) {
|
|
246
|
+
window.ReactNativeWebView.postMessage(JSON.stringify(message));
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
var closeButton = document.querySelector('.chatbot-close-button');
|
|
250
|
+
if (closeButton) {
|
|
251
|
+
closeButton.addEventListener('click', () => {
|
|
252
|
+
window.sendToChatbot({ type: 'close_chatbot' });
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
true;
|
|
257
|
+
`);
|
|
258
|
+
isFirstLoadRef.current = false;
|
|
259
|
+
},
|
|
260
|
+
onError: syntheticEvent => {
|
|
261
|
+
const {
|
|
262
|
+
nativeEvent
|
|
263
|
+
} = syntheticEvent;
|
|
264
|
+
console.warn("WebView error:", nativeEvent);
|
|
265
|
+
}
|
|
266
|
+
})))));
|
|
267
|
+
};
|
|
268
|
+
const styles = StyleSheet.create({
|
|
269
|
+
mainContainer: {
|
|
270
|
+
flex: 1,
|
|
271
|
+
position: "relative"
|
|
272
|
+
},
|
|
273
|
+
webViewWrapper: {
|
|
274
|
+
position: "absolute",
|
|
275
|
+
top: 0,
|
|
276
|
+
left: 0,
|
|
277
|
+
right: 0,
|
|
278
|
+
bottom: 0,
|
|
279
|
+
overflow: "hidden",
|
|
280
|
+
zIndex: 1000
|
|
281
|
+
},
|
|
282
|
+
fullScreenContainer: {
|
|
283
|
+
position: "absolute",
|
|
284
|
+
top: 0,
|
|
285
|
+
left: 0,
|
|
286
|
+
right: 0,
|
|
287
|
+
bottom: 0,
|
|
288
|
+
backgroundColor: "white",
|
|
289
|
+
zIndex: 1000
|
|
290
|
+
},
|
|
291
|
+
inlineContainer: {
|
|
292
|
+
flex: 1,
|
|
293
|
+
backgroundColor: "white"
|
|
294
|
+
},
|
|
295
|
+
webview: {
|
|
296
|
+
flex: 1,
|
|
297
|
+
backgroundColor: "white"
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
export default ChatbotSDK;
|
|
301
|
+
//# sourceMappingURL=Chatbotsdk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useState","useEffect","useRef","useMemo","View","StyleSheet","Animated","Dimensions","Platform","StatusBar","WebView","FloatingButton","BASE_CHATBOT_URL","ChatbotSDK","api_key","user_id","user_token","additional_params","show_floating_button","onMessage","isFullScreen","enableAnimation","onOpen","onClose","isWebViewVisible","setIsWebViewVisible","chatbotConfig","setChatbotConfig","loading","setLoading","webViewRef","fadeAnim","Value","current","isFirstLoadRef","webViewUrl","constructUrl","stableAdditionalParams","JSON","stringify","triggerAppInit","injectJavaScript","fetchChatbotConfig","_data$user","endpointUrl","payload","client_user_id","org_id","token","extra_info","response","fetch","method","headers","body","ok","Error","data","json","orgInfo","user","org_info","_orgInfo$config","_orgInfo$brand_config","_orgInfo$config2","brand_color","config","brand_colour","image_url","brand_config","launcher_logo_url","welcome_message","error","console","params","URLSearchParams","id","toString","openWebView","timing","toValue","duration","useNativeDriver","start","setTimeout","setValue","requestAnimationFrame","closeWebView","log","postMessage","name","domain","complete","handleMessage","event","nativeEvent","parsedData","parse","type","action","userId","warn","getScreenDimensions","windowHeight","get","height","windowWidth","width","statusBarHeight","OS","currentHeight","screenDimensions","createElement","style","styles","mainContainer","Fragment","onPress","brandColor","imageUrl","webViewWrapper","pointerEvents","fullScreenContainer","inlineContainer","opacity","ref","source","uri","webview","containerStyle","undefined","allowsInlineMediaPlayback","mediaPlaybackRequiresUserAction","allowFileAccess","geolocationEnabled","javaScriptEnabled","domStorageEnabled","cacheEnabled","scrollEnabled","bounces","onShouldStartLoadWithRequest","request","url","startsWith","startInLoadingState","onLoadEnd","_webViewRef$current","onError","syntheticEvent","create","flex","position","top","left","right","bottom","overflow","zIndex","backgroundColor"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,EAAEC,MAAM,EAAEC,OAAO,QAAQ,OAAO;AACnE,SACEC,IAAI,EACJC,UAAU,EACVC,QAAQ,EACRC,UAAU,EACVC,QAAQ,EACRC,SA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IACnB6B,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACTG,eAAe,EAAE,OAAO;IACxBD,MAAM,EAAE;EACV,CAAC;EACDlC,eAAe,EAAE;IACf2B,IAAI,EAAE,CAAC;IACPQ,eAAe,EAAE;EACnB,CAAC;EACD9B,OAAO,EAAE;IACPsB,IAAI,EAAE,CAAC;IACPQ,eAAe,EAAE;EACnB;AACF,CAAC,CAAC;AAEF,eAAejJ,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TouchableOpacity, StyleSheet, Text, Image } from "react-native";
|
|
3
|
+
const FloatingButton = ({
|
|
4
|
+
onPress,
|
|
5
|
+
brandColor = "#007AFF",
|
|
6
|
+
// Default color
|
|
7
|
+
imageUrl
|
|
8
|
+
}) => {
|
|
9
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
10
|
+
style: [styles.button, {
|
|
11
|
+
backgroundColor: brandColor
|
|
12
|
+
}],
|
|
13
|
+
onPress: onPress
|
|
14
|
+
}, imageUrl ? /*#__PURE__*/React.createElement(Image, {
|
|
15
|
+
source: {
|
|
16
|
+
uri: imageUrl
|
|
17
|
+
},
|
|
18
|
+
style: styles.buttonImage
|
|
19
|
+
}) : /*#__PURE__*/React.createElement(Text, {
|
|
20
|
+
style: styles.buttonText
|
|
21
|
+
}, "Chat"));
|
|
22
|
+
};
|
|
23
|
+
const styles = StyleSheet.create({
|
|
24
|
+
button: {
|
|
25
|
+
position: "absolute",
|
|
26
|
+
bottom: 20,
|
|
27
|
+
right: 20,
|
|
28
|
+
borderRadius: 30,
|
|
29
|
+
width: 60,
|
|
30
|
+
height: 60,
|
|
31
|
+
justifyContent: "center",
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
elevation: 5,
|
|
34
|
+
shadowColor: "#000",
|
|
35
|
+
shadowOffset: {
|
|
36
|
+
width: 0,
|
|
37
|
+
height: 2
|
|
38
|
+
},
|
|
39
|
+
shadowOpacity: 0.25,
|
|
40
|
+
shadowRadius: 3.84
|
|
41
|
+
},
|
|
42
|
+
buttonText: {
|
|
43
|
+
color: "white",
|
|
44
|
+
fontSize: 16,
|
|
45
|
+
fontWeight: "bold"
|
|
46
|
+
},
|
|
47
|
+
buttonImage: {
|
|
48
|
+
width: 40,
|
|
49
|
+
height: 40,
|
|
50
|
+
borderRadius: 20
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
export default FloatingButton;
|
|
54
|
+
//# sourceMappingURL=FloatingButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","TouchableOpacity","StyleSheet","Text","Image","FloatingButton","onPress","brandColor","imageUrl","createElement","style","styles","button","backgroundColor","source","uri","buttonImage","buttonText","create","position","bottom","right","borderRadius","width","height","justifyContent","alignItems","elevation","shadowColor","shadowOffset","shadowOpacity","shadowRadius","color","fontSize","fontWeight"],"sourceRoot":"../../src","sources":["FloatingButton.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,gBAAgB,EAAEC,UAAU,EAAEC,IAAI,EAAEC,KAAK,QAAQ,cAAc;AAQxE,MAAMC,cAA6C,GAAGA,CAAC;EACrDC,OAAO;EACPC,UAAU,GAAG,SAAS;EAAE;EACxBC;AACF,CAAC,KAAK;EACJ,oBACER,KAAA,CAAAS,aAAA,CAACR,gBAAgB;IACfS,KAAK,EAAE,CAACC,MAAM,CAACC,MAAM,EAAE;MAAEC,eAAe,EAAEN;IAAW,CAAC,CAAE;IACxDD,OAAO,EAAEA;EAAQ,GAEhBE,QAAQ,gBACPR,KAAA,CAAAS,aAAA,CAACL,KAAK;IAACU,MAAM,EAAE;MAAEC,GAAG,EAAEP;IAAS,CAAE;IAACE,KAAK,EAAEC,MAAM,CAACK;EAAY,CAAE,CAAC,gBAE/DhB,KAAA,CAAAS,aAAA,CAACN,IAAI;IAACO,KAAK,EAAEC,MAAM,CAACM;EAAW,GAAC,MAAU,CAE5B,CAAC;AAEvB,CAAC;AAED,MAAMN,MAAM,GAAGT,UAAU,CAACgB,MAAM,CAAC;EAC/BN,MAAM,EAAE;IACNO,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,EAAE;IACVC,KAAK,EAAE,EAAE;IACTC,YAAY,EAAE,EAAE;IAChBC,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBC,SAAS,EAAE,CAAC;IACZC,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE;MAAEN,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACrCM,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE;EAChB,CAAC;EACDd,UAAU,EAAE;IACVe,KAAK,EAAE,OAAO;IACdC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EACd,CAAC;EACDlB,WAAW,EAAE;IACXO,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVF,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAEF,eAAejB,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View, ActivityIndicator } from "react-native";
|
|
3
|
+
const LoadingIndicator = () => /*#__PURE__*/React.createElement(View, {
|
|
4
|
+
style: {
|
|
5
|
+
flex: 1,
|
|
6
|
+
justifyContent: "center",
|
|
7
|
+
alignItems: "center"
|
|
8
|
+
}
|
|
9
|
+
}, /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
10
|
+
size: "large",
|
|
11
|
+
color: "#0000ff"
|
|
12
|
+
}));
|
|
13
|
+
export default LoadingIndicator;
|
|
14
|
+
//# sourceMappingURL=LoadingIndicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","ActivityIndicator","LoadingIndicator","createElement","style","flex","justifyContent","alignItems","size","color"],"sourceRoot":"../../src","sources":["LoadingIndicator.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAA+B,OAAO;AAClD,SAASC,IAAI,EAAEC,iBAAiB,QAAQ,cAAc;AAGtD,MAAMC,gBAA0B,GAAGA,CAAA,kBACjCH,KAAA,CAAAI,aAAA,CAACH,IAAI;EAACI,KAAK,EAAE;IAAEC,IAAI,EAAE,CAAC;IAAEC,cAAc,EAAE,QAAQ;IAAEC,UAAU,EAAE;EAAS;AAAE,gBACvER,KAAA,CAAAI,aAAA,CAACF,iBAAiB;EAACO,IAAI,EAAC,OAAO;EAACC,KAAK,EAAC;AAAS,CAAE,CAC7C,CACP;AAED,eAAeP,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["config","API_URL","process","env","DEBUG"],"sourceRoot":"../../src","sources":["config.ts"],"mappings":"AAAA,OAAO,MAAMA,MAAM,GAAG;EACpBC,OAAO,EAAEC,OAAO,CAACC,GAAG,CAACF,OAAO,IAAI,yBAAyB;EACzDG,KAAK,EAAEF,OAAO,CAACC,GAAG,CAACC,KAAK,KAAK;AAC/B,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BASE_CHATBOT_DOMAIN","process","env","CHATBOT_DOMAIN","CHATBOT_PATH","BASE_CHATBOT_URL"],"sourceRoot":"../../src","sources":["constants.ts"],"mappings":"AAAA,MAAMA,mBAAmB,GAAGC,OAAO,CAACC,GAAG,CAACC,cAAc,IAAI,EAAE;AAC5D,MAAMC,YAAY,GAAGH,OAAO,CAACC,GAAG,CAACE,YAAY,IAAI,EAAE;AACnD,OAAO,MAAMC,gBAAgB,GAAG,GAAGL,mBAAmB,IAAII,YAAY,EAAE","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["global.d.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["default","ChatbotSDK","openChatbot"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,OAAO,IAAIC,UAAU,QAAQ,cAAc;AACpD,SAASC,WAAW,QAAQ,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Linking } from "react-native";
|
|
2
|
+
import { BASE_CHATBOT_URL } from "./constants";
|
|
3
|
+
export const openChatbot = (chatbotId, additionalParams = {}) => {
|
|
4
|
+
const params = new URLSearchParams({
|
|
5
|
+
id: chatbotId,
|
|
6
|
+
...additionalParams
|
|
7
|
+
});
|
|
8
|
+
const url = `${BASE_CHATBOT_URL}?${params.toString()}`;
|
|
9
|
+
Linking.openURL(url);
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=openChatbot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Linking","BASE_CHATBOT_URL","openChatbot","chatbotId","additionalParams","params","URLSearchParams","id","url","toString","openURL"],"sourceRoot":"../../src","sources":["openChatbot.ts"],"mappings":"AAAA,SAASA,OAAO,QAAQ,cAAc;AACtC,SAASC,gBAAgB,QAAQ,aAAa;AAE9C,OAAO,MAAMC,WAAW,GAAGA,CACzBC,SAAiB,EACjBC,gBAAwC,GAAG,CAAC,CAAC,KACpC;EACT,MAAMC,MAAM,GAAG,IAAIC,eAAe,CAAC;IAAEC,EAAE,EAAEJ,SAAS;IAAE,GAAGC;EAAiB,CAAC,CAAC;EAC1E,MAAMI,GAAG,GAAG,GAAGP,gBAAgB,IAAII,MAAM,CAACI,QAAQ,CAAC,CAAC,EAAE;EACtDT,OAAO,CAACU,OAAO,CAACF,GAAG,CAAC;AACtB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatbotWebview.d.ts","sourceRoot":"","sources":["../../src/ChatbotWebview.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAMnD,UAAU,mBAAmB;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3C;AAUD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAuBxD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface ChatbotSDKProps {
|
|
3
|
+
api_key: string;
|
|
4
|
+
user_id?: string;
|
|
5
|
+
user_token?: string;
|
|
6
|
+
additional_params?: Record<string, string>;
|
|
7
|
+
show_floating_button?: boolean;
|
|
8
|
+
onMessage?: (message: any) => void;
|
|
9
|
+
isFullScreen?: boolean;
|
|
10
|
+
enableAnimation?: boolean;
|
|
11
|
+
onOpen?: () => void;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
}
|
|
14
|
+
declare const ChatbotSDK: React.FC<ChatbotSDKProps>;
|
|
15
|
+
export default ChatbotSDK;
|
|
16
|
+
//# sourceMappingURL=Chatbotsdk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chatbotsdk.d.ts","sourceRoot":"","sources":["../../src/Chatbotsdk.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAapE,UAAU,eAAe;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACnC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAaD,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAkTzC,CAAC;AAmCF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface FloatingButtonProps {
|
|
3
|
+
onPress: () => void;
|
|
4
|
+
brandColor?: string;
|
|
5
|
+
imageUrl?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const FloatingButton: React.FC<FloatingButtonProps>;
|
|
8
|
+
export default FloatingButton;
|
|
9
|
+
//# sourceMappingURL=FloatingButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingButton.d.ts","sourceRoot":"","sources":["../../src/FloatingButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,mBAAmB;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAiBjD,CAAC;AA8BF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadingIndicator.d.ts","sourceRoot":"","sources":["../../src/LoadingIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAI7B,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;CAGlB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,QAA2C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openChatbot.d.ts","sourceRoot":"","sources":["../../src/openChatbot.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,cACX,MAAM,qBACC,OAAO,MAAM,EAAE,MAAM,CAAC,KACvC,IAIF,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@robylon/react-native-sdk",
|
|
3
|
+
"version": "1.10.1-staging.0",
|
|
4
|
+
"description": "React Native SDK for Robylon",
|
|
5
|
+
"main": "lib/commonjs/index.js",
|
|
6
|
+
"module": "lib/module/index.js",
|
|
7
|
+
"types": "lib/typescript/index.d.ts",
|
|
8
|
+
"react-native": "src/index.tsx",
|
|
9
|
+
"source": "src/index.tsx",
|
|
10
|
+
"files": [
|
|
11
|
+
"lib",
|
|
12
|
+
"!**/__tests__",
|
|
13
|
+
"!**/__fixtures__",
|
|
14
|
+
"!**/__mocks__"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"prepare": "bob build",
|
|
18
|
+
"build": "bob build",
|
|
19
|
+
"clean": "del lib",
|
|
20
|
+
"publish-dry": "npm run build & npm publish --dry-run",
|
|
21
|
+
"publish-sdk": "npm run build & npm publish",
|
|
22
|
+
"prebuild:staging": "cp .npmignore.staging .npmignore",
|
|
23
|
+
"prebuild:production": "cp .npmignore.production .npmignore",
|
|
24
|
+
"build:staging": "env-cmd -f .env.staging npm run build",
|
|
25
|
+
"build:production": "env-cmd -f .env.production npm run build",
|
|
26
|
+
"version:staging": "npm version prerelease --preid staging",
|
|
27
|
+
"version:production": "npm version patch",
|
|
28
|
+
"publish:staging": "npm run prebuild:staging && npm run version:staging && npm run build:staging && npm publish --tag staging",
|
|
29
|
+
"publish:production": "npm run prebuild:production && npm run version:production && npm run build:production && npm publish --tag latest"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"react": "*",
|
|
33
|
+
"react-native": "*",
|
|
34
|
+
"react-native-webview": "*"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/node": "^22.10.1",
|
|
38
|
+
"@types/react": "^18.0.0",
|
|
39
|
+
"@types/react-native": "^0.70.0",
|
|
40
|
+
"env-cmd": "^10.1.0",
|
|
41
|
+
"react": "^18.0.0",
|
|
42
|
+
"react-native": "^0.70.0",
|
|
43
|
+
"react-native-builder-bob": "^0.20.0",
|
|
44
|
+
"typescript": "^4.5.2"
|
|
45
|
+
},
|
|
46
|
+
"react-native-builder-bob": {
|
|
47
|
+
"source": "src",
|
|
48
|
+
"output": "lib",
|
|
49
|
+
"targets": [
|
|
50
|
+
"commonjs",
|
|
51
|
+
"module",
|
|
52
|
+
[
|
|
53
|
+
"typescript",
|
|
54
|
+
{
|
|
55
|
+
"project": "tsconfig.build.json",
|
|
56
|
+
"tsc": "./node_modules/.bin/tsc"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
"author": "",
|
|
62
|
+
"license": "ISC"
|
|
63
|
+
}
|