@robylon/react-native-sdk 1.10.1-staging.10 → 1.10.1-staging.3

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 (39) hide show
  1. package/.npmignore.staging +1 -1
  2. package/babel.config.js +3 -16
  3. package/lib/commonjs/ChatbotWebview.js +44 -1
  4. package/lib/commonjs/ChatbotWebview.js.map +1 -1
  5. package/lib/commonjs/Chatbotsdk.js +309 -1
  6. package/lib/commonjs/Chatbotsdk.js.map +1 -1
  7. package/lib/commonjs/FloatingButton.js +60 -1
  8. package/lib/commonjs/FloatingButton.js.map +1 -1
  9. package/lib/commonjs/LoadingIndicator.js +20 -1
  10. package/lib/commonjs/LoadingIndicator.js.map +1 -1
  11. package/lib/commonjs/config.js +10 -1
  12. package/lib/commonjs/config.js.map +1 -1
  13. package/lib/commonjs/constants.js +9 -1
  14. package/lib/commonjs/constants.js.map +1 -1
  15. package/lib/commonjs/global.d.js +7 -1
  16. package/lib/commonjs/global.d.js.map +1 -1
  17. package/lib/commonjs/index.js +20 -1
  18. package/lib/commonjs/index.js.map +1 -1
  19. package/lib/commonjs/openChatbot.js +16 -2
  20. package/lib/module/ChatbotWebview.js +33 -1
  21. package/lib/module/ChatbotWebview.js.map +1 -1
  22. package/lib/module/Chatbotsdk.js +300 -1
  23. package/lib/module/Chatbotsdk.js.map +1 -1
  24. package/lib/module/FloatingButton.js +53 -1
  25. package/lib/module/FloatingButton.js.map +1 -1
  26. package/lib/module/LoadingIndicator.js +13 -1
  27. package/lib/module/LoadingIndicator.js.map +1 -1
  28. package/lib/module/config.js +4 -1
  29. package/lib/module/config.js.map +1 -1
  30. package/lib/module/constants.js +3 -1
  31. package/lib/module/constants.js.map +1 -1
  32. package/lib/module/global.d.js +6 -1
  33. package/lib/module/global.d.js.map +1 -1
  34. package/lib/module/index.js +2 -1
  35. package/lib/module/index.js.map +1 -1
  36. package/lib/module/openChatbot.js +10 -1
  37. package/lib/module/openChatbot.js.map +1 -1
  38. package/package.json +13 -20
  39. package/src/FloatingButton.tsx +6 -6
@@ -3,4 +3,4 @@ __tests__/
3
3
  __fixtures__/
4
4
  __mocks__/
5
5
  .env*
6
- *.log
6
+ *.log
package/babel.config.js CHANGED
@@ -1,17 +1,4 @@
1
- module.exports = function (api) {
2
- api.cache(true);
3
- return {
4
- presets: ["module:metro-react-native-babel-preset"],
5
- plugins: [
6
- [
7
- "inline-dotenv",
8
- {
9
- path:
10
- process.env.NODE_ENV === "production"
11
- ? ".env.production"
12
- : ".env.staging",
13
- },
14
- ],
15
- ],
16
- };
1
+ module.exports = {
2
+ presets: ["module:metro-react-native-babel-preset"],
3
+ plugins: ["transform-inline-environment-variables"],
17
4
  };
@@ -1,2 +1,45 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ChatbotWebview=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeWebview=require("react-native-webview");var _constants=require("./constants");var _LoadingIndicator=_interopRequireDefault(require("./LoadingIndicator"));var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/jobinabraham/Developer/personal/robylon-react-native-sdk/src/ChatbotWebview.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var constructUrl=function constructUrl(chatbotId){var additionalParams=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var params=new URLSearchParams(Object.assign({id:chatbotId},additionalParams));return _constants.BASE_CHATBOT_URL+"?"+params.toString();};var ChatbotWebview=exports.ChatbotWebview=function ChatbotWebview(_ref){var chatbotId=_ref.chatbotId,additionalParams=_ref.additionalParams;var _useState=(0,_react.useState)(""),_useState2=(0,_slicedToArray2.default)(_useState,2),url=_useState2[0],setUrl=_useState2[1];(0,_react.useEffect)(function(){setUrl(constructUrl(chatbotId,additionalParams));},[chatbotId,additionalParams]);return(0,_jsxRuntime.jsx)(_reactNative.View,{style:{flex:1},children:url?(0,_jsxRuntime.jsx)(_reactNativeWebview.WebView,{source:{uri:url},startInLoadingState:true,renderLoading:function renderLoading(){return(0,_jsxRuntime.jsx)(_LoadingIndicator.default,{});}}):(0,_jsxRuntime.jsx)(_LoadingIndicator.default,{})});};
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ChatbotWebview = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _reactNativeWebview = require("react-native-webview");
10
+ var _constants = require("./constants");
11
+ var _LoadingIndicator = _interopRequireDefault(require("./LoadingIndicator"));
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
+ // File: src/ChatbotWebview.tsx
16
+
17
+ const constructUrl = (chatbotId, additionalParams = {}) => {
18
+ const params = new URLSearchParams({
19
+ id: chatbotId,
20
+ ...additionalParams
21
+ });
22
+ return `${_constants.BASE_CHATBOT_URL}?${params.toString()}`;
23
+ };
24
+ const ChatbotWebview = ({
25
+ chatbotId,
26
+ additionalParams
27
+ }) => {
28
+ const [url, setUrl] = (0, _react.useState)("");
29
+ (0, _react.useEffect)(() => {
30
+ setUrl(constructUrl(chatbotId, additionalParams));
31
+ }, [chatbotId, additionalParams]);
32
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
33
+ style: {
34
+ flex: 1
35
+ }
36
+ }, url ? /*#__PURE__*/_react.default.createElement(_reactNativeWebview.WebView, {
37
+ source: {
38
+ uri: url
39
+ },
40
+ startInLoadingState: true,
41
+ renderLoading: () => /*#__PURE__*/_react.default.createElement(_LoadingIndicator.default, null)
42
+ }) : /*#__PURE__*/_react.default.createElement(_LoadingIndicator.default, null));
43
+ };
44
+ exports.ChatbotWebview = ChatbotWebview;
2
45
  //# sourceMappingURL=ChatbotWebview.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_constants","_LoadingIndicator","_interopRequireDefault","_jsxRuntime","_this","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","constructUrl","chatbotId","additionalParams","arguments","length","undefined","params","URLSearchParams","assign","id","BASE_CHATBOT_URL","toString","ChatbotWebview","exports","_ref","_useState","useState","_useState2","_slicedToArray2","url","setUrl","useEffect","jsx","View","style","flex","children","WebView","source","uri","startInLoadingState","renderLoading"],"sourceRoot":"../../src","sources":["ChatbotWebview.tsx"],"mappings":"sQACA,IAAAA,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AAI,CAAE,CACrBW,mBAAmB,CAAE,IAAK,CAC1BC,aAAa,CAAE,QAAf,CAAAA,aAAaA,CAAA,QAAQ,GAAAtD,WAAA,CAAA6C,GAAA,EAAC/C,iBAAA,CAAAW,OAAgB,GAAE,CAAC,EAAC,CAC3C,CAAC,CAEF,GAAAT,WAAA,CAAA6C,GAAA,EAAC/C,iBAAA,CAAAW,OAAgB,GAAE,CACpB,CACG,CAAC,CAEX,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_constants","_LoadingIndicator","_interopRequireDefault","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","constructUrl","chatbotId","additionalParams","params","URLSearchParams","id","BASE_CHATBOT_URL","toString","ChatbotWebview","url","setUrl","useState","useEffect","createElement","View","style","flex","WebView","source","uri","startInLoadingState","renderLoading","exports"],"sourceRoot":"../../src","sources":["ChatbotWebview.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAC,sBAAA,CAAAL,OAAA;AAAkD,SAAAK,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAA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AAAC,gBAAS,EAAC,MAAM;IACdF,MAAM,CAACV,YAAY,CAACC,SAAS,EAAEC,gBAAgB,CAAC,CAAC;EACnD,CAAC,EAAE,CAACD,SAAS,EAAEC,gBAAgB,CAAC,CAAC;EAEjC,oBACE9B,MAAA,CAAAU,OAAA,CAAA+B,aAAA,CAACtC,YAAA,CAAAuC,IAAI;IAACC,KAAK,EAAE;MAAEC,IAAI,EAAE;IAAE;EAAE,GACtBP,GAAG,gBACFrC,MAAA,CAAAU,OAAA,CAAA+B,aAAA,CAACrC,mBAAA,CAAAyC,OAAO;IACNC,MAAM,EAAE;MAAEC,GAAG,EAAEV;IAAI,CAAE;IACrBW,mBAAmB,EAAE,IAAK;IAC1BC,aAAa,EAAEA,CAAA,kBAAMjD,MAAA,CAAAU,OAAA,CAAA+B,aAAA,CAACnC,iBAAA,CAAAI,OAAgB,MAAE;EAAE,CAC3C,CAAC,gBAEFV,MAAA,CAAAU,OAAA,CAAA+B,aAAA,CAACnC,iBAAA,CAAAI,OAAgB,MAAE,CAEjB,CAAC;AAEX,CAAC;AAACwC,OAAA,CAAAd,cAAA,GAAAA,cAAA","ignoreList":[]}
@@ -1,2 +1,310 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeWebview=require("react-native-webview");var _FloatingButton=_interopRequireDefault(require("./FloatingButton"));var _constants=require("./constants");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/jobinabraham/Developer/personal/robylon-react-native-sdk/src/Chatbotsdk.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var ChatbotSDK=function ChatbotSDK(_ref){var api_key=_ref.api_key,user_id=_ref.user_id,user_token=_ref.user_token,_ref$additional_param=_ref.additional_params,additional_params=_ref$additional_param===void 0?{}:_ref$additional_param,_ref$show_floating_bu=_ref.show_floating_button,show_floating_button=_ref$show_floating_bu===void 0?true:_ref$show_floating_bu,onMessage=_ref.onMessage,_ref$isFullScreen=_ref.isFullScreen,isFullScreen=_ref$isFullScreen===void 0?true:_ref$isFullScreen,_ref$enableAnimation=_ref.enableAnimation,enableAnimation=_ref$enableAnimation===void 0?true:_ref$enableAnimation,onOpen=_ref.onOpen,onClose=_ref.onClose;var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),isWebViewVisible=_useState2[0],setIsWebViewVisible=_useState2[1];var _useState3=(0,_react.useState)(null),_useState4=(0,_slicedToArray2.default)(_useState3,2),chatbotConfig=_useState4[0],setChatbotConfig=_useState4[1];var _useState5=(0,_react.useState)(true),_useState6=(0,_slicedToArray2.default)(_useState5,2),loading=_useState6[0],setLoading=_useState6[1];var webViewRef=(0,_react.useRef)(null);var fadeAnim=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;var isFirstLoadRef=(0,_react.useRef)(true);var webViewUrl=(0,_react.useMemo)(function(){return constructUrl();},[api_key,user_id,additional_params]);var stableAdditionalParams=(0,_react.useMemo)(function(){return additional_params;},[JSON.stringify(additional_params)]);var triggerAppInit=function triggerAppInit(){if(webViewRef.current){webViewRef.current.injectJavaScript("\n // Trigger APP_READY equivalent\n window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'APP_READY' }));\n true;\n ");}};(0,_react.useEffect)(function(){var fetchChatbotConfig=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(){try{var _data$user;var endpointUrl="https://stage-api.robylon.ai/users/auth/copilot/";var payload={client_user_id:user_id,org_id:api_key,token:user_token,extra_info:stableAdditionalParams};var response=yield fetch(endpointUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(payload)});if(!response.ok){throw new Error("Failed to fetch chatbot configuration");}var data=yield response.json();var orgInfo=data==null?void 0:(_data$user=data.user)==null?void 0:_data$user.org_info;if(orgInfo){var _orgInfo$config,_orgInfo$brand_config,_orgInfo$config2;setChatbotConfig({brand_color:(orgInfo==null?void 0:(_orgInfo$config=orgInfo.config)==null?void 0:_orgInfo$config.brand_colour)||"#007AFF",image_url:(orgInfo==null?void 0:(_orgInfo$brand_config=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config.launcher_logo_url)||"",welcome_message:(orgInfo==null?void 0:(_orgInfo$config2=orgInfo.config)==null?void 0:_orgInfo$config2.welcome_message)||""});}}catch(error){console.error("Error fetching chatbot configuration:",error);}finally{setLoading(false);}});return function fetchChatbotConfig(){return _ref2.apply(this,arguments);};}();if(api_key&&user_id){fetchChatbotConfig();}},[api_key,user_id,user_token,stableAdditionalParams]);function constructUrl(){if(!user_id)return"";var params=new URLSearchParams(Object.assign({id:api_key,user_id:user_id},additional_params));return _constants.BASE_CHATBOT_URL+"?"+params.toString();}var openWebView=function openWebView(){setIsWebViewVisible(true);if(enableAnimation){_reactNative.Animated.timing(fadeAnim,{toValue:1,duration:250,useNativeDriver:true}).start(function(){onOpen==null?void 0:onOpen();if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}else{fadeAnim.setValue(1);requestAnimationFrame(function(){onOpen==null?void 0:onOpen();if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}};var closeWebView=function closeWebView(){if(webViewRef.current){console.log("closeWebView");webViewRef.current.postMessage(JSON.stringify({name:"closeFrame",domain:"app-domain.com"}));}var complete=function complete(){setIsWebViewVisible(false);onClose==null?void 0:onClose();};if(enableAnimation){_reactNative.Animated.timing(fadeAnim,{toValue:0,duration:200,useNativeDriver:true}).start(complete);}else{fadeAnim.setValue(0);requestAnimationFrame(complete);}};var handleMessage=function handleMessage(event){var data=event.nativeEvent.data;try{var parsedData=JSON.parse(data);if(parsedData.type==="APP_READY"){console.log("APP_READY",webViewRef.current&&isWebViewVisible);if(webViewRef.current&&isWebViewVisible){webViewRef.current.injectJavaScript("\n window.postMessage("+JSON.stringify({name:"openFrame",domain:"app-domain.com"})+", '*');\n window.postMessage("+JSON.stringify({name:"registerUserId",action:"registerUserId",domain:"app-domain.com",data:{userId:""+user_id,token:""+user_token}})+", '*');\n ");}}if(typeof parsedData!=="object"||!parsedData.type){console.warn("Invalid message structure");return;}switch(parsedData.type){case"close_chatbot":closeWebView();break;default:if(onMessage)onMessage(parsedData);}}catch(error){console.error("Failed to parse or process WebView message:",error);}};var getScreenDimensions=function getScreenDimensions(){var windowHeight=_reactNative.Dimensions.get("window").height;var windowWidth=_reactNative.Dimensions.get("window").width;var statusBarHeight=_reactNative.Platform.OS==="ios"?0:_reactNative.StatusBar.currentHeight||0;return{height:windowHeight-statusBarHeight,width:windowWidth};};var screenDimensions=getScreenDimensions();return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.mainContainer,children:!loading&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[show_floating_button&&api_key&&chatbotConfig&&(0,_jsxRuntime.jsx)(_FloatingButton.default,{onPress:openWebView,brandColor:chatbotConfig.brand_color,imageUrl:chatbotConfig.image_url}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.webViewWrapper,{height:isWebViewVisible?"100%":0}],pointerEvents:isWebViewVisible?"auto":"none",children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[isFullScreen?styles.fullScreenContainer:styles.inlineContainer,{opacity:fadeAnim}],children:(0,_jsxRuntime.jsx)(_reactNativeWebview.WebView,{ref:webViewRef,source:{uri:webViewUrl},onMessage:handleMessage,style:styles.webview,containerStyle:isFullScreen?{width:screenDimensions.width,height:screenDimensions.height}:undefined,allowsInlineMediaPlayback:true,mediaPlaybackRequiresUserAction:false,allowFileAccess:false,geolocationEnabled:false,javaScriptEnabled:true,domStorageEnabled:true,cacheEnabled:true,scrollEnabled:true,bounces:false,onShouldStartLoadWithRequest:function onShouldStartLoadWithRequest(request){return request.url.startsWith(_constants.BASE_CHATBOT_URL);},startInLoadingState:isFirstLoadRef.current,onLoadEnd:function onLoadEnd(){var _webViewRef$current;(_webViewRef$current=webViewRef.current)==null?void 0:_webViewRef$current.injectJavaScript("\n if (!document.querySelector('meta[name=\"viewport\"]')) {\n var meta = document.createElement('meta');\n meta.name = 'viewport';\n meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no';\n document.getElementsByTagName('head')[0].appendChild(meta);\n }\n\n if (!document.querySelector('#injectedStyle')) {\n const style = document.createElement('style');\n style.id = 'injectedStyle';\n style.textContent = `\n html, body, #root, #__next {\n height: 100% !important;\n min-height: 100% !important;\n overflow: hidden !important;\n }\n `;\n document.head.appendChild(style);\n }\n\n window.sendToChatbot = function(message) {\n window.ReactNativeWebView.postMessage(JSON.stringify(message));\n };\n\n var closeButton = document.querySelector('.chatbot-close-button');\n if (closeButton) {\n closeButton.addEventListener('click', () => {\n window.sendToChatbot({ type: 'close_chatbot' });\n });\n }\n \n true;\n");isFirstLoadRef.current=false;},onError:function onError(syntheticEvent){var nativeEvent=syntheticEvent.nativeEvent;console.warn("WebView error:",nativeEvent);}})})})]})});};var styles=_reactNative.StyleSheet.create({mainContainer:{flex:1,position:"relative"},webViewWrapper:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden",zIndex:1000},fullScreenContainer:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"white",zIndex:1000},inlineContainer:{flex:1,backgroundColor:"white"},webview:{flex:1,backgroundColor:"white"}});var _default=exports.default=ChatbotSDK;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _reactNativeWebview = require("react-native-webview");
10
+ var _FloatingButton = _interopRequireDefault(require("./FloatingButton"));
11
+ var _constants = require("./constants");
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
+ const ChatbotSDK = ({
16
+ api_key,
17
+ user_id,
18
+ user_token,
19
+ additional_params = {},
20
+ show_floating_button = true,
21
+ onMessage,
22
+ isFullScreen = true,
23
+ enableAnimation = true,
24
+ onOpen,
25
+ onClose
26
+ }) => {
27
+ const [isWebViewVisible, setIsWebViewVisible] = (0, _react.useState)(false);
28
+ const [chatbotConfig, setChatbotConfig] = (0, _react.useState)(null);
29
+ const [loading, setLoading] = (0, _react.useState)(true);
30
+ const webViewRef = (0, _react.useRef)(null);
31
+ const fadeAnim = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
32
+ const isFirstLoadRef = (0, _react.useRef)(true);
33
+ const webViewUrl = (0, _react.useMemo)(() => constructUrl(), [api_key, user_id, additional_params]);
34
+ const stableAdditionalParams = (0, _react.useMemo)(() => additional_params, [JSON.stringify(additional_params)]);
35
+ const triggerAppInit = () => {
36
+ if (webViewRef.current) {
37
+ webViewRef.current.injectJavaScript(`
38
+ // Trigger APP_READY equivalent
39
+ window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'APP_READY' }));
40
+ true;
41
+ `);
42
+ }
43
+ };
44
+ (0, _react.useEffect)(() => {
45
+ const fetchChatbotConfig = async () => {
46
+ try {
47
+ var _data$user;
48
+ const endpointUrl = `https://stage-api.robylon.ai/users/auth/copilot/`;
49
+ const payload = {
50
+ client_user_id: user_id,
51
+ org_id: api_key,
52
+ token: user_token,
53
+ extra_info: stableAdditionalParams
54
+ };
55
+ const response = await fetch(endpointUrl, {
56
+ method: "POST",
57
+ headers: {
58
+ "Content-Type": "application/json"
59
+ },
60
+ body: JSON.stringify(payload)
61
+ });
62
+ if (!response.ok) {
63
+ throw new Error("Failed to fetch chatbot configuration");
64
+ }
65
+ const data = await response.json();
66
+ const orgInfo = data === null || data === void 0 || (_data$user = data.user) === null || _data$user === void 0 ? void 0 : _data$user.org_info;
67
+ if (orgInfo) {
68
+ var _orgInfo$config, _orgInfo$brand_config, _orgInfo$config2;
69
+ setChatbotConfig({
70
+ brand_color: (orgInfo === null || orgInfo === void 0 || (_orgInfo$config = orgInfo.config) === null || _orgInfo$config === void 0 ? void 0 : _orgInfo$config.brand_colour) || "#007AFF",
71
+ 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) || "",
72
+ welcome_message: (orgInfo === null || orgInfo === void 0 || (_orgInfo$config2 = orgInfo.config) === null || _orgInfo$config2 === void 0 ? void 0 : _orgInfo$config2.welcome_message) || ""
73
+ });
74
+ }
75
+ } catch (error) {
76
+ console.error("Error fetching chatbot configuration:", error);
77
+ } finally {
78
+ setLoading(false);
79
+ }
80
+ };
81
+ if (api_key && user_id) {
82
+ fetchChatbotConfig();
83
+ }
84
+ }, [api_key, user_id, user_token, stableAdditionalParams]);
85
+ function constructUrl() {
86
+ if (!user_id) return "";
87
+ const params = new URLSearchParams({
88
+ id: api_key,
89
+ user_id,
90
+ ...additional_params
91
+ });
92
+ return `${_constants.BASE_CHATBOT_URL}?${params.toString()}`;
93
+ }
94
+ const openWebView = () => {
95
+ setIsWebViewVisible(true);
96
+ if (enableAnimation) {
97
+ _reactNative.Animated.timing(fadeAnim, {
98
+ toValue: 1,
99
+ duration: 250,
100
+ useNativeDriver: true
101
+ }).start(() => {
102
+ onOpen === null || onOpen === void 0 || onOpen();
103
+ if (!isFirstLoadRef.current) {
104
+ // If not first load, manually trigger initialization
105
+ setTimeout(triggerAppInit, 100);
106
+ }
107
+ });
108
+ } else {
109
+ fadeAnim.setValue(1);
110
+ requestAnimationFrame(() => {
111
+ onOpen === null || onOpen === void 0 || onOpen();
112
+ if (!isFirstLoadRef.current) {
113
+ setTimeout(triggerAppInit, 100);
114
+ }
115
+ });
116
+ }
117
+ };
118
+ const closeWebView = () => {
119
+ if (webViewRef.current) {
120
+ console.log("closeWebView");
121
+ webViewRef.current.postMessage(JSON.stringify({
122
+ name: "closeFrame",
123
+ domain: "app-domain.com"
124
+ }));
125
+ }
126
+ const complete = () => {
127
+ setIsWebViewVisible(false);
128
+ onClose === null || onClose === void 0 || onClose();
129
+ };
130
+ if (enableAnimation) {
131
+ _reactNative.Animated.timing(fadeAnim, {
132
+ toValue: 0,
133
+ duration: 200,
134
+ useNativeDriver: true
135
+ }).start(complete);
136
+ } else {
137
+ fadeAnim.setValue(0);
138
+ requestAnimationFrame(complete);
139
+ }
140
+ };
141
+ const handleMessage = event => {
142
+ const {
143
+ data
144
+ } = event.nativeEvent;
145
+ try {
146
+ const parsedData = JSON.parse(data);
147
+ if (parsedData.type === "APP_READY") {
148
+ console.log("APP_READY", webViewRef.current && isWebViewVisible);
149
+ if (webViewRef.current && isWebViewVisible) {
150
+ webViewRef.current.injectJavaScript(`
151
+ window.postMessage(${JSON.stringify({
152
+ name: "openFrame",
153
+ domain: "app-domain.com"
154
+ })}, '*');
155
+ window.postMessage(${JSON.stringify({
156
+ name: "registerUserId",
157
+ action: "registerUserId",
158
+ domain: "app-domain.com",
159
+ data: {
160
+ userId: `${user_id}`,
161
+ token: `${user_token}`
162
+ }
163
+ })}, '*');
164
+ `);
165
+ }
166
+ }
167
+ if (typeof parsedData !== "object" || !parsedData.type) {
168
+ console.warn("Invalid message structure");
169
+ return;
170
+ }
171
+ switch (parsedData.type) {
172
+ case "close_chatbot":
173
+ closeWebView();
174
+ break;
175
+ default:
176
+ if (onMessage) onMessage(parsedData);
177
+ }
178
+ } catch (error) {
179
+ console.error("Failed to parse or process WebView message:", error);
180
+ }
181
+ };
182
+ const getScreenDimensions = () => {
183
+ const windowHeight = _reactNative.Dimensions.get("window").height;
184
+ const windowWidth = _reactNative.Dimensions.get("window").width;
185
+ const statusBarHeight = _reactNative.Platform.OS === "ios" ? 0 : _reactNative.StatusBar.currentHeight || 0;
186
+ return {
187
+ height: windowHeight - statusBarHeight,
188
+ width: windowWidth
189
+ };
190
+ };
191
+ const screenDimensions = getScreenDimensions();
192
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
193
+ style: styles.mainContainer
194
+ }, !loading && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, show_floating_button && api_key && chatbotConfig && /*#__PURE__*/_react.default.createElement(_FloatingButton.default, {
195
+ onPress: openWebView,
196
+ brandColor: chatbotConfig.brand_color,
197
+ imageUrl: chatbotConfig.image_url
198
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
199
+ style: [styles.webViewWrapper, {
200
+ height: isWebViewVisible ? "100%" : 0
201
+ }],
202
+ pointerEvents: isWebViewVisible ? "auto" : "none"
203
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
204
+ style: [isFullScreen ? styles.fullScreenContainer : styles.inlineContainer, {
205
+ opacity: fadeAnim
206
+ }]
207
+ }, /*#__PURE__*/_react.default.createElement(_reactNativeWebview.WebView, {
208
+ ref: webViewRef,
209
+ source: {
210
+ uri: webViewUrl
211
+ },
212
+ onMessage: handleMessage,
213
+ style: styles.webview,
214
+ containerStyle: isFullScreen ? {
215
+ width: screenDimensions.width,
216
+ height: screenDimensions.height
217
+ } : undefined,
218
+ allowsInlineMediaPlayback: true,
219
+ mediaPlaybackRequiresUserAction: false,
220
+ allowFileAccess: false,
221
+ geolocationEnabled: false,
222
+ javaScriptEnabled: true,
223
+ domStorageEnabled: true,
224
+ cacheEnabled: true,
225
+ scrollEnabled: true,
226
+ bounces: false,
227
+ onShouldStartLoadWithRequest: request => {
228
+ return request.url.startsWith(_constants.BASE_CHATBOT_URL);
229
+ },
230
+ startInLoadingState: isFirstLoadRef.current,
231
+ onLoadEnd: () => {
232
+ var _webViewRef$current;
233
+ (_webViewRef$current = webViewRef.current) === null || _webViewRef$current === void 0 || _webViewRef$current.injectJavaScript(`
234
+ if (!document.querySelector('meta[name="viewport"]')) {
235
+ var meta = document.createElement('meta');
236
+ meta.name = 'viewport';
237
+ meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no';
238
+ document.getElementsByTagName('head')[0].appendChild(meta);
239
+ }
240
+
241
+ if (!document.querySelector('#injectedStyle')) {
242
+ const style = document.createElement('style');
243
+ style.id = 'injectedStyle';
244
+ style.textContent = \`
245
+ html, body, #root, #__next {
246
+ height: 100% !important;
247
+ min-height: 100% !important;
248
+ overflow: hidden !important;
249
+ }
250
+ \`;
251
+ document.head.appendChild(style);
252
+ }
253
+
254
+ window.sendToChatbot = function(message) {
255
+ window.ReactNativeWebView.postMessage(JSON.stringify(message));
256
+ };
257
+
258
+ var closeButton = document.querySelector('.chatbot-close-button');
259
+ if (closeButton) {
260
+ closeButton.addEventListener('click', () => {
261
+ window.sendToChatbot({ type: 'close_chatbot' });
262
+ });
263
+ }
264
+
265
+ true;
266
+ `);
267
+ isFirstLoadRef.current = false;
268
+ },
269
+ onError: syntheticEvent => {
270
+ const {
271
+ nativeEvent
272
+ } = syntheticEvent;
273
+ console.warn("WebView error:", nativeEvent);
274
+ }
275
+ })))));
276
+ };
277
+ const styles = _reactNative.StyleSheet.create({
278
+ mainContainer: {
279
+ flex: 1,
280
+ position: "relative"
281
+ },
282
+ webViewWrapper: {
283
+ position: "absolute",
284
+ top: 0,
285
+ left: 0,
286
+ right: 0,
287
+ bottom: 0,
288
+ overflow: "hidden",
289
+ zIndex: 1000
290
+ },
291
+ fullScreenContainer: {
292
+ position: "absolute",
293
+ top: 0,
294
+ left: 0,
295
+ right: 0,
296
+ bottom: 0,
297
+ backgroundColor: "white",
298
+ zIndex: 1000
299
+ },
300
+ inlineContainer: {
301
+ flex: 1,
302
+ backgroundColor: "white"
303
+ },
304
+ webview: {
305
+ flex: 1,
306
+ backgroundColor: "white"
307
+ }
308
+ });
309
+ var _default = exports.default = ChatbotSDK;
2
310
  //# sourceMappingURL=Chatbotsdk.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_FloatingButton","_interopRequireDefault","_constants","_jsxRuntime","_this","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ChatbotSDK","_ref","api_key","user_id","user_token","_ref$additional_param","additional_params","_ref$show_floating_bu","show_floating_button","onMessage","_ref$isFullScreen","isFullScreen","_ref$enableAnimation","enableAnimation","onOpen","onClose","_useState","useState","_useState2","_slicedToArray2","isWebViewVisible","setIsWebViewVisible","_useState3","_useState4","chatbotConfig","setChatbotConfig","_useState5","_useState6","loading","setLoading","webViewRef","useRef","fadeAnim","Animated","Value","current","isFirstLoadRef","webViewUrl","useMemo","constructUrl","stableAdditionalParams","JSON","stringify","triggerAppInit","injectJavaScript","useEffect","fetchChatbotConfig","_ref2","_asyncToGenerator2","_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","apply","arguments","params","URLSearchParams","assign","id","BASE_CHATBOT_URL","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","Dimensions","height","windowWidth","width","statusBarHeight","Platform","OS","StatusBar","currentHeight","screenDimensions","jsx","View","style","styles","mainContainer","children","jsxs","Fragment","onPress","brandColor","imageUrl","webViewWrapper","pointerEvents","fullScreenContainer","inlineContainer","opacity","WebView","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","StyleSheet","create","flex","position","top","left","right","bottom","overflow","zIndex","backgroundColor","_default","exports"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":"iWAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBAQA,IAAAE,mBAAA,CAAAF,OAAA,yBACA,IAAAG,eAAA,CAAAC,sBAAA,CAAAJ,OAAA,sBACA,IAAAK,UAAA,CAAAL,OAAA,gBAA+C,IAAAM,WAAA,CAAAN,OAAA,0BAAAO,KAAA,MAAAC,YAAA,+FAAAC,yBAAAC,CAAA,wBAAAC,OAAA,iBAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAF,wBAAA,UAAAA,yBAAAC,CAAA,SAAAA,CAA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,CAAC,CACgBR,cAAc,CAACD,OAAO,CAAG,KAAK,CAChC,CAAE,CACFgI,OAAO,CAAE,QAAT,CAAAA,OAAOA,CAAGC,cAAc,CAAK,CAC3B,GAAQ,CAAA3D,WAAW,CAAK2D,cAAc,CAA9B3D,WAAW,CACnB1B,OAAO,CAACgC,IAAI,CAAC,gBAAgB,CAAEN,WAAW,CAAC,CAC7C,CAAE,CACH,CAAC,CACW,CAAC,CACZ,CAAC,EACP,CACH,CACG,CAAC,CAEX,CAAC,CAED,GAAM,CAAAsB,MAAM,CAAGsC,uBAAU,CAACC,MAAM,CAAC,CAC/BtC,aAAa,CAAE,CACbuC,IAAI,CAAE,CAAC,CACPC,QAAQ,CAAE,UACZ,CAAC,CACDjC,cAAc,CAAE,CACdiC,QAAQ,CAAE,UAAU,CACpBC,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTC,QAAQ,CAAE,QAAQ,CAClBC,MAAM,CAAE,IACV,CAAC,CACDrC,mBAAmB,CAAE,CACnB+B,QAAQ,CAAE,UAAU,CACpBC,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTG,eAAe,CAAE,OAAO,CACxBD,MAAM,CAAE,IACV,CAAC,CACDpC,eAAe,CAAE,CACf6B,IAAI,CAAE,CAAC,CACPQ,eAAe,CAAE,OACnB,CAAC,CACD/B,OAAO,CAAE,CACPuB,IAAI,CAAE,CAAC,CACPQ,eAAe,CAAE,OACnB,CACF,CAAC,CAAC,CAAC,IAAAC,QAAA,CAAAC,OAAA,CAAA/L,OAAA,CAEYc,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_FloatingButton","_interopRequireDefault","_constants","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ChatbotSDK","api_key","user_id","user_token","additional_params","show_floating_button","onMessage","isFullScreen","enableAnimation","onOpen","onClose","isWebViewVisible","setIsWebViewVisible","useState","chatbotConfig","setChatbotConfig","loading","setLoading","webViewRef","useRef","fadeAnim","Animated","Value","current","isFirstLoadRef","webViewUrl","useMemo","constructUrl","stableAdditionalParams","JSON","stringify","triggerAppInit","injectJavaScript","useEffect","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","BASE_CHATBOT_URL","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","Dimensions","height","windowWidth","width","statusBarHeight","Platform","OS","StatusBar","currentHeight","screenDimensions","createElement","View","style","styles","mainContainer","Fragment","onPress","brandColor","imageUrl","webViewWrapper","pointerEvents","fullScreenContainer","inlineContainer","opacity","WebView","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","StyleSheet","create","flex","position","top","left","right","bottom","overflow","zIndex","backgroundColor","_default","exports"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAC,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C;IACTC,QAAQ,EAAE,QAAQ;IAClBC,MAAM,EAAE;EACV,CAAC;EACDrC,mBAAmB,EAAE;IACnB+B,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;EACDpC,eAAe,EAAE;IACf6B,IAAI,EAAE,CAAC;IACPQ,eAAe,EAAE;EACnB,CAAC;EACD/B,OAAO,EAAE;IACPuB,IAAI,EAAE,CAAC;IACPQ,eAAe,EAAE;EACnB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAhL,OAAA,GAEYkB,UAAU","ignoreList":[]}
@@ -1,2 +1,61 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/jobinabraham/Developer/personal/robylon-react-native-sdk/src/FloatingButton.tsx";var FloatingButton=function FloatingButton(_ref){var onPress=_ref.onPress,_ref$brandColor=_ref.brandColor,brandColor=_ref$brandColor===void 0?"#007AFF":_ref$brandColor,imageUrl=_ref.imageUrl;return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:[styles.button,{backgroundColor:brandColor}],onPress:onPress,children:imageUrl?(0,_jsxRuntime.jsx)(_reactNative.Image,{source:{uri:imageUrl},style:styles.buttonImage}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.buttonText,children:"Chat"})});};var styles=_reactNative.StyleSheet.create({button:{position:"absolute",bottom:20,right:20,borderRadius:24,width:48,height:48,justifyContent:"center",alignItems:"center",elevation:5,shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:0.25,shadowRadius:3.84},buttonText:{color:"white",fontSize:16,fontWeight:"bold"},buttonImage:{width:48,height:48,borderRadius:24}});var _default=exports.default=FloatingButton;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ const FloatingButton = ({
11
+ onPress,
12
+ brandColor = "#007AFF",
13
+ // Default color
14
+ imageUrl
15
+ }) => {
16
+ return /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
17
+ style: [styles.button, {
18
+ backgroundColor: brandColor
19
+ }],
20
+ onPress: onPress
21
+ }, imageUrl ? /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
22
+ source: {
23
+ uri: imageUrl
24
+ },
25
+ style: styles.buttonImage
26
+ }) : /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
27
+ style: styles.buttonText
28
+ }, "Chat"));
29
+ };
30
+ const styles = _reactNative.StyleSheet.create({
31
+ button: {
32
+ position: "absolute",
33
+ bottom: 20,
34
+ right: 20,
35
+ borderRadius: 30,
36
+ width: 60,
37
+ height: 60,
38
+ justifyContent: "center",
39
+ alignItems: "center",
40
+ elevation: 5,
41
+ shadowColor: "#000",
42
+ shadowOffset: {
43
+ width: 0,
44
+ height: 2
45
+ },
46
+ shadowOpacity: 0.25,
47
+ shadowRadius: 3.84
48
+ },
49
+ buttonText: {
50
+ color: "white",
51
+ fontSize: 16,
52
+ fontWeight: "bold"
53
+ },
54
+ buttonImage: {
55
+ width: 40,
56
+ height: 40,
57
+ borderRadius: 20
58
+ }
59
+ });
60
+ var _default = exports.default = FloatingButton;
2
61
  //# sourceMappingURL=FloatingButton.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_jsxRuntime","_this","_jsxFileName","FloatingButton","_ref","onPress","_ref$brandColor","brandColor","imageUrl","jsx","TouchableOpacity","style","styles","button","backgroundColor","children","Image","source","uri","buttonImage","Text","buttonText","StyleSheet","create","position","bottom","right","borderRadius","width","height","justifyContent","alignItems","elevation","shadowColor","shadowOffset","shadowOpacity","shadowRadius","color","fontSize","fontWeight","_default","exports","default"],"sourceRoot":"../../src","sources":["FloatingButton.tsx"],"mappings":"mKAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBAAyE,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,KAAA,MAAAC,YAAA,0FAQzE,GAAM,CAAAC,cAA6C,CAAG,QAAhD,CAAAA,cAA6CA,CAAAC,IAAA,CAI7C,IAHJ,CAAAC,OAAO,CAAAD,IAAA,CAAPC,OAAO,CAAAC,eAAA,CAAAF,IAAA,CACPG,UAAU,CAAVA,UAAU,CAAAD,eAAA,UAAG,SAAS,CAAAA,eAAA,CACtBE,QAAQ,CAAAJ,IAAA,CAARI,QAAQ,CAER,MACE,GAAAR,WAAA,CAAAS,GAAA,EAACV,YAAA,CAAAW,gBAAgB,EACfC,KAAK,CAAE,CAACC,MAAM,CAACC,MAAM,CAAE,CAAEC,eAAe,CAAEP,UAAW,CAAC,CAAE,CACxDF,OAAO,CAAEA,OAAQ,CAAAU,QAAA,CAEhBP,QAAQ,CACP,GAAAR,WAAA,CAAAS,GAAA,EAACV,YAAA,CAAAiB,KAAK,EAACC,MAAM,CAAE,CAAEC,GAAG,CAAEV,QAAS,CAAE,CAACG,KAAK,CAAEC,MAAM,CAACO,WAAY,CAAE,CAAC,CAE/D,GAAAnB,WAAA,CAAAS,GAAA,EAACV,YAAA,CAAAqB,IAAI,EAACT,KAAK,CAAEC,MAAM,CAACS,UAAW,CAAAN,QAAA,CAAC,MAAI,CAAM,CAC3C,CACe,CAAC,CAEvB,CAAC,CAED,GAAM,CAAAH,MAAM,CAAGU,uBAAU,CAACC,MAAM,CAAC,CAC/BV,MAAM,CAAE,CACNW,QAAQ,CAAE,UAAU,CACpBC,MAAM,CAAE,EAAE,CACVC,KAAK,CAAE,EAAE,CACTC,YAAY,CAAE,EAAE,CAChBC,KAAK,CAAE,EAAE,CACTC,MAAM,CAAE,EAAE,CACVC,cAAc,CAAE,QAAQ,CACxBC,UAAU,CAAE,QAAQ,CACpBC,SAAS,CAAE,CAAC,CACZC,WAAW,CAAE,MAAM,CACnBC,YAAY,CAAE,CAAEN,KAAK,CAAE,CAAC,CAAEC,MAAM,CAAE,CAAE,CAAC,CACrCM,aAAa,CAAE,IAAI,CACnBC,YAAY,CAAE,IAChB,CAAC,CACDf,UAAU,CAAE,CACVgB,KAAK,CAAE,OAAO,CACdC,QAAQ,CAAE,EAAE,CACZC,UAAU,CAAE,MACd,CAAC,CACDpB,WAAW,CAAE,CACXS,KAAK,CAAE,EAAE,CACTC,MAAM,CAAE,EAAE,CACVF,YAAY,CAAE,EAChB,CACF,CAAC,CAAC,CAAC,IAAAa,QAAA,CAAAC,OAAA,CAAAC,OAAA,CAEYvC,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","e","__esModule","default","FloatingButton","onPress","brandColor","imageUrl","createElement","TouchableOpacity","style","styles","button","backgroundColor","Image","source","uri","buttonImage","Text","buttonText","StyleSheet","create","position","bottom","right","borderRadius","width","height","justifyContent","alignItems","elevation","shadowColor","shadowOffset","shadowOpacity","shadowRadius","color","fontSize","fontWeight","_default","exports"],"sourceRoot":"../../src","sources":["FloatingButton.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAyE,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAQzE,MAAMG,cAA6C,GAAGA,CAAC;EACrDC,OAAO;EACPC,UAAU,GAAG,SAAS;EAAE;EACxBC;AACF,CAAC,KAAK;EACJ,oBACEV,MAAA,CAAAM,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@@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/jobinabraham/Developer/personal/robylon-react-native-sdk/src/LoadingIndicator.tsx";var LoadingIndicator=function LoadingIndicator(){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:{flex:1,justifyContent:"center",alignItems:"center"},children:(0,_jsxRuntime.jsx)(_reactNative.ActivityIndicator,{size:"large",color:"#0000ff"})});};var _default=exports.default=LoadingIndicator;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ const LoadingIndicator = () => /*#__PURE__*/_react.default.createElement(_reactNative.View, {
11
+ style: {
12
+ flex: 1,
13
+ justifyContent: "center",
14
+ alignItems: "center"
15
+ }
16
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.ActivityIndicator, {
17
+ size: "large",
18
+ color: "#0000ff"
19
+ }));
20
+ var _default = exports.default = LoadingIndicator;
2
21
  //# sourceMappingURL=LoadingIndicator.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_jsxRuntime","_this","_jsxFileName","LoadingIndicator","jsx","View","style","flex","justifyContent","alignItems","children","ActivityIndicator","size","color","_default","exports","default"],"sourceRoot":"../../src","sources":["LoadingIndicator.tsx"],"mappings":"mKAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBAAuD,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,KAAA,MAAAC,YAAA,4FAGvD,GAAM,CAAAC,gBAA0B,CAAG,QAA7B,CAAAA,gBAA0BA,CAAA,QAC9B,GAAAH,WAAA,CAAAI,GAAA,EAACL,YAAA,CAAAM,IAAI,EAACC,KAAK,CAAE,CAAEC,IAAI,CAAE,CAAC,CAAEC,cAAc,CAAE,QAAQ,CAAEC,UAAU,CAAE,QAAS,CAAE,CAAAC,QAAA,CACvE,GAAAV,WAAA,CAAAI,GAAA,EAACL,YAAA,CAAAY,iBAAiB,EAACC,IAAI,CAAC,OAAO,CAACC,KAAK,CAAC,SAAS,CAAE,CAAC,CAC9C,CAAC,EACR,CAAC,IAAAC,QAAA,CAAAC,OAAA,CAAAC,OAAA,CAEab,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","e","__esModule","default","LoadingIndicator","createElement","View","style","flex","justifyContent","alignItems","ActivityIndicator","size","color","_default","exports"],"sourceRoot":"../../src","sources":["LoadingIndicator.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAuD,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGvD,MAAMG,gBAA0B,GAAGA,CAAA,kBACjCP,MAAA,CAAAM,OAAA,CAAAE,aAAA,CAACL,YAAA,CAAAM,IAAI;EAACC,KAAK,EAAE;IAAEC,IAAI,EAAE,CAAC;IAAEC,cAAc,EAAE,QAAQ;IAAEC,UAAU,EAAE;EAAS;AAAE,gBACvEb,MAAA,CAAAM,OAAA,CAAAE,aAAA,CAACL,YAAA,CAAAW,iBAAiB;EAACC,IAAI,EAAC,OAAO;EAACC,KAAK,EAAC;AAAS,CAAE,CAC7C,CACP;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAZ,OAAA,GAEaC,gBAAgB","ignoreList":[]}
@@ -1,2 +1,11 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.config=void 0;var config=exports.config={API_URL:process&&process.env&&process.env.API_URL||"https://staging-api.robylon.com"||'https://api.robylon.com',DEBUG:(process&&process.env&&process.env.DEBUG||"true")==='true'};
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.config = void 0;
7
+ const config = exports.config = {
8
+ API_URL: process.env.API_URL || 'https://api.robylon.com',
9
+ DEBUG: process.env.DEBUG === 'true'
10
+ };
2
11
  //# sourceMappingURL=config.js.map