@robylon/react-native-sdk 2.0.19-staging.33 → 2.0.19-staging.35

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.
@@ -1,18 +1,76 @@
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 _FloatingButton=_interopRequireDefault(require("./FloatingButton"));var _constants=require("./constants");var _version=require("./version");var _systemInfo=require("./utils/systemInfo");var _useChatbotEvents2=require("./hooks/useChatbotEvents");var _events=require("./types/events");var _logger=require("./utils/logger");var _debugConfig=require("./utils/debugConfig");var _ErrorBoundary=require("./components/ErrorBoundary");var _errorConstants=require("./constants/errorConstants");var _ErrorTrackingService=require("./services/ErrorTrackingService");var _cookieUtils=require("./utils/cookieUtils");var _webViewStorage=require("./utils/webViewStorage");var _ChatbotWebView=_interopRequireDefault(require("./components/ChatbotWebView"));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 Chatbot=function Chatbot(_ref){var api_key=_ref.api_key,user_id=_ref.user_id,user_token=_ref.user_token,_ref$show_floating_bu=_ref.show_floating_button,show_floating_button=_ref$show_floating_bu===void 0?true:_ref$show_floating_bu,onEvent=_ref.onEvent,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,user_profile=_ref.user_profile;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 _useState7=(0,_react.useState)(false),_useState8=(0,_slicedToArray2.default)(_useState7,2),toastVisible=_useState8[0],setToastVisible=_useState8[1];var _useState9=(0,_react.useState)(""),_useState10=(0,_slicedToArray2.default)(_useState9,2),toastMessage=_useState10[0],setToastMessage=_useState10[1];var _useState11=(0,_react.useState)(),_useState12=(0,_slicedToArray2.default)(_useState11,2),effectiveUserId=_useState12[0],setEffectiveUserId=_useState12[1];var _useState13=(0,_react.useState)(false),_useState14=(0,_slicedToArray2.default)(_useState13,2),isStorageReady=_useState14[0],setIsStorageReady=_useState14[1];var pendingStorageOps=(0,_react.useRef)([]);var memoryCache=(0,_react.useRef)({});var _useState15=(0,_react.useState)({os:"",browser:""}),_useState16=(0,_slicedToArray2.default)(_useState15,2),systemInfo=_useState16[0],setSystemInfo=_useState16[1];var chatbotConfigForEvents=(0,_react.useMemo)(function(){return{userId:effectiveUserId,isAnonymous:!user_id&&user_id!==0};},[effectiveUserId,user_id]);var _useChatbotEvents=(0,_useChatbotEvents2.useChatbotEvents)({api_key:api_key,chatbotConfig:chatbotConfigForEvents!=null?chatbotConfigForEvents:{},user_profile:user_profile,onEvent:onEvent,systemInfo:systemInfo!=null?systemInfo:{os:"",browser:""}}),emitEvent=_useChatbotEvents.emitEvent,onInternalEvent=_useChatbotEvents.onInternalEvent;var triggerAppInit=function triggerAppInit(){if(webViewRef.current){webViewRef.current.injectJavaScript(`
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 _version=require("./version");var _systemInfo=require("./utils/systemInfo");var _useChatbotEvents2=require("./hooks/useChatbotEvents");var _events=require("./types/events");var _logger=require("./utils/logger");var _debugConfig=require("./utils/debugConfig");var _DebugButton=_interopRequireDefault(require("./components/DebugButton"));var _ErrorBoundary=require("./components/ErrorBoundary");var _errorConstants=require("./constants/errorConstants");var _ErrorTrackingService=require("./services/ErrorTrackingService");var _cookieUtils=require("./utils/cookieUtils");var _webViewStorage=require("./utils/webViewStorage");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 Chatbot=function Chatbot(_ref){var api_key=_ref.api_key,user_id=_ref.user_id,user_token=_ref.user_token,_ref$show_floating_bu=_ref.show_floating_button,show_floating_button=_ref$show_floating_bu===void 0?true:_ref$show_floating_bu,onEvent=_ref.onEvent,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,user_profile=_ref.user_profile;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 _useState7=(0,_react.useState)(false),_useState8=(0,_slicedToArray2.default)(_useState7,2),toastVisible=_useState8[0],setToastVisible=_useState8[1];var _useState9=(0,_react.useState)(""),_useState10=(0,_slicedToArray2.default)(_useState9,2),toastMessage=_useState10[0],setToastMessage=_useState10[1];var _useState11=(0,_react.useState)(),_useState12=(0,_slicedToArray2.default)(_useState11,2),effectiveUserId=_useState12[0],setEffectiveUserId=_useState12[1];var _useState13=(0,_react.useState)(false),_useState14=(0,_slicedToArray2.default)(_useState13,2),isStorageReady=_useState14[0],setIsStorageReady=_useState14[1];var pendingStorageOps=(0,_react.useRef)([]);var memoryCache=(0,_react.useRef)({});var _useState15=(0,_react.useState)({os:"",browser:""}),_useState16=(0,_slicedToArray2.default)(_useState15,2),systemInfo=_useState16[0],setSystemInfo=_useState16[1];var chatbotConfigForEvents=(0,_react.useMemo)(function(){return{userId:effectiveUserId,isAnonymous:!user_id&&user_id!==0};},[effectiveUserId,user_id]);var _useChatbotEvents=(0,_useChatbotEvents2.useChatbotEvents)({api_key:api_key,chatbotConfig:chatbotConfigForEvents!=null?chatbotConfigForEvents:{},user_profile:user_profile,onEvent:onEvent,systemInfo:systemInfo!=null?systemInfo:{os:"",browser:""}}),emitEvent=_useChatbotEvents.emitEvent,onInternalEvent=_useChatbotEvents.onInternalEvent;var triggerAppInit=function triggerAppInit(){if(webViewRef.current){webViewRef.current.injectJavaScript(`
2
2
  // Trigger APP_READY equivalent
3
3
  window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'APP_READY' }));
4
4
  true;
5
5
  `);}};var executeStorageOp=(0,_react.useCallback)(function(operation){if(isStorageReady){operation();}else{pendingStorageOps.current.push(operation);}},[isStorageReady]);var handleMessage=(0,_react.useCallback)(function(event){var _webViewRef$current;var data=event.nativeEvent.data;try{var parsedData=JSON.parse(data);if(Object.values(_webViewStorage.StorageMessageType).includes(parsedData.type)){var storageMessage=parsedData;switch(storageMessage.type){case _webViewStorage.StorageMessageType.STORAGE_READY:setIsStorageReady(true);pendingStorageOps.current.forEach(function(op){return op();});pendingStorageOps.current=[];(_webViewRef$current=webViewRef.current)==null?void 0:_webViewRef$current.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));break;case _webViewStorage.StorageMessageType.STORAGE_RESPONSE:if(storageMessage.key&&storageMessage.value){memoryCache.current[storageMessage.key]=storageMessage.value;if(storageMessage.key==="rblyn_anon"){setEffectiveUserId(storageMessage.value);}}break;case _webViewStorage.StorageMessageType.STORAGE_ERROR:_logger.logger.error("WebView storage error:",storageMessage.error);break;}return;}if(__DEV__){if((parsedData==null?void 0:parsedData.type)==="CONSOLE"){console.log(`WebView ${parsedData==null?void 0:parsedData.level}:`,parsedData==null?void 0:parsedData.data);return;}if((parsedData==null?void 0:parsedData.type)==="ERROR"){console.error("WebView Error:",parsedData==null?void 0:parsedData.data);return;}}if((parsedData==null?void 0:parsedData.type)==="SYSTEM_INFO"){var _parsedData$data;setSystemInfo((_parsedData$data=parsedData==null?void 0:parsedData.data)!=null?_parsedData$data:{os:"",browser:""});return;}if((parsedData==null?void 0:parsedData.type)==="APP_READY"){emitEvent(_events.ChatbotEventType.CHATBOT_APP_READY);if(webViewRef.current&&isWebViewVisible){var _webViewRef$current2,_webViewRef$current3;(_webViewRef$current2=webViewRef.current)==null?void 0:_webViewRef$current2.injectJavaScript((0,_systemInfo.getBrowserAndOSInfoScript)());var messageData={name:"registerUserId",action:"registerUserId",data:{userId:effectiveUserId,token:user_token?`${user_token}`:undefined,userProfile:Object.assign({},user_profile,(0,_systemInfo.getSystemInfo)(systemInfo))}};_logger.logger.debug("messageData====>",JSON.stringify(messageData));(_webViewRef$current3=webViewRef.current)==null?void 0:_webViewRef$current3.injectJavaScript(`
6
6
  window.postMessage(${JSON.stringify({name:"openFrame",domain:"app-domain.com"})}, '*');
7
7
  window.postMessage(${JSON.stringify(messageData)}, '*');
8
- `);}}switch(parsedData==null?void 0:parsedData.type){case"close_chatbot":closeWebView();break;case"CHATBOT_LOADED":emitEvent(_events.ChatbotEventType.CHATBOT_LOADED,parsedData==null?void 0:parsedData.data);break;case"CHAT_INITIALIZED":emitEvent(_events.ChatbotEventType.CHAT_INITIALIZED,parsedData==null?void 0:parsedData.data);break;case"SESSION_REFRESHED":emitEvent(_events.ChatbotEventType.SESSION_REFRESHED,parsedData==null?void 0:parsedData.data);break;case"CHAT_INITIALIZATION_FAILED":emitEvent(_events.ChatbotEventType.CHAT_INITIALIZATION_FAILED,parsedData==null?void 0:parsedData.data);break;default:if(onMessage)onMessage(parsedData!=null?parsedData:{});}}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to parse WebView message"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{messageData:data}});}},[emitEvent,isWebViewVisible,onMessage,systemInfo,effectiveUserId,user_token,user_profile]);(0,_react.useEffect)(function(){var initializeUserId=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(){var userId=user_id?String(user_id):undefined;if(!userId){userId=memoryCache.current["rblyn_anon"];if(!userId){userId=(0,_cookieUtils.generateUUID)();executeStorageOp(function(){var _webViewRef$current4;(_webViewRef$current4=webViewRef.current)==null?void 0:_webViewRef$current4.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.SET_STORAGE,"rblyn_anon",userId));});}}setEffectiveUserId(userId);});return function initializeUserId(){return _ref2.apply(this,arguments);};}();initializeUserId();},[user_id,executeStorageOp]);(0,_react.useEffect)(function(){if(webViewRef.current){webViewRef.current.injectJavaScript((0,_webViewStorage.getStorageScript)());executeStorageOp(function(){var _webViewRef$current5;(_webViewRef$current5=webViewRef.current)==null?void 0:_webViewRef$current5.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));});}},[]);(0,_react.useEffect)(function(){var fetchChatbotConfig=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(){try{var _data$user;var endpointUrl=`${_constants.API_URL}/chat/chatbot/get/`;var payload={client_user_id:effectiveUserId,org_id:api_key,token:user_token,extra_info:{}};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){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to fetch chatbot configuration"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.NETWORK_ERROR,context:{api_key:api_key,user_id:user_id}});}finally{setLoading(false);}});return function fetchChatbotConfig(){return _ref3.apply(this,arguments);};}();if(api_key&&effectiveUserId){fetchChatbotConfig();}},[api_key,effectiveUserId,user_token]);function constructUrl(){if(!effectiveUserId)return"";var params=new URLSearchParams({id:api_key});console.log("BASE_CHATBOT_URL SDK_VERSION",_constants.BASE_CHATBOT_URL,_version.SDK_VERSION);return`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;}var openWebView=(0,_react.useCallback)(function(){setIsWebViewVisible(true);if(enableAnimation){_reactNative.Animated.timing(fadeAnim,{toValue:1,duration:250,useNativeDriver:true}).start(function(){onOpen==null?void 0:onOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}else{fadeAnim.setValue(1);requestAnimationFrame(function(){onOpen==null?void 0:onOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}},[enableAnimation,fadeAnim,onOpen,emitEvent]);var closeWebView=(0,_react.useCallback)(function(){if(webViewRef.current){webViewRef.current.postMessage(JSON.stringify({name:"closeFrame",domain:"app-domain.com"}));}var complete=function complete(){setIsWebViewVisible(false);onClose==null?void 0:onClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);};if(enableAnimation){_reactNative.Animated.timing(fadeAnim,{toValue:0,duration:200,useNativeDriver:true}).start(complete);}else{fadeAnim.setValue(0);requestAnimationFrame(complete);}},[enableAnimation,fadeAnim,onClose,emitEvent]);(0,_react.useEffect)(function(){if(show_floating_button&&chatbotConfig){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_LOADED);}},[show_floating_button,chatbotConfig,emitEvent]);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();(0,_react.useEffect)(function(){if(__DEV__){(0,_debugConfig.enableNetworkDebug)();}},[]);var userAgent=_reactNative.Platform.select({android:"Mozilla/5.0 (Linux; Android 10; Android SDK built for x86) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.120 Mobile Safari/537.36",ios:"Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1"});return(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotSDK",children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.mainContainer,children:!loading&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"FloatingButton",children:show_floating_button&&api_key&&chatbotConfig&&(0,_jsxRuntime.jsx)(_FloatingButton.default,{onPress:function onPress(){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_CLICKED);openWebView();},brandColor:chatbotConfig.brand_color,imageUrl:chatbotConfig.image_url})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[{height:isWebViewVisible?"100%":0}],pointerEvents:"auto",children:(0,_jsxRuntime.jsx)(_ChatbotWebView.default,{ref:webViewRef,source:{uri:constructUrl()},onMessage:handleMessage,onDebugMessage:function onDebugMessage(message){console.log("WebView Debug:",message);},style:styles.webview,allowsInlineMediaPlayback:true,mediaPlaybackRequiresUserAction:false,allowFileAccess:false,geolocationEnabled:false,javaScriptEnabled:true,domStorageEnabled:true,cacheEnabled:true,scrollEnabled:true,bounces:false,onShouldStartLoadWithRequest:function onShouldStartLoadWithRequest(request){var allowedDomains=[_constants.BASE_CHATBOT_URL,"about:blank"];return allowedDomains.some(function(domain){return request.url.startsWith(domain);});},startInLoadingState:isFirstLoadRef.current,onLoadEnd:function onLoadEnd(){isFirstLoadRef.current=false;},onError:function onError(syntheticEvent){var nativeEvent=syntheticEvent.nativeEvent;_ErrorTrackingService.errorTracker.trackError(new Error(nativeEvent.description),"ChatbotWebView",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{url:nativeEvent.url,code:nativeEvent.code}});},userAgent:userAgent,originWhitelist:["*"],mixedContentMode:"always",onContentProcessDidTerminate:function onContentProcessDidTerminate(){var _webViewRef$current6;(_webViewRef$current6=webViewRef.current)==null?void 0:_webViewRef$current6.reload();},injectedJavaScriptBeforeContentLoaded:`
9
- window.onerror = function(message, source, lineno, colno, error) {
10
- window.ReactNativeWebView.postMessage(JSON.stringify({
11
- type: 'ERROR',
12
- data: {message, source, lineno, colno}
13
- }));
14
- return true;
15
- };
16
- true;
17
- `,androidLayerType:"hardware",overScrollMode:"never",textZoom:100,setSupportMultipleWindows:false,allowsBackForwardNavigationGestures:false,useWebKit:true,keyboardDisplayRequiresUserAction:false,hideKeyboardAccessoryView:true,applicationNameForUserAgent:"ChatbotApp"})})]})})});};var styles=_reactNative.StyleSheet.create({mainContainer:{flex:1,position:"relative"},webViewWrapper:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden",zIndex:100},fullScreenContainer:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"white",zIndex:100},inlineContainer:{flex:1,backgroundColor:"white"},webview:{flex:1,backgroundColor:"white"}});var _default=exports.default=Chatbot;
8
+ `);}}switch(parsedData==null?void 0:parsedData.type){case"close_chatbot":closeWebView();break;case"CHATBOT_LOADED":emitEvent(_events.ChatbotEventType.CHATBOT_LOADED,parsedData==null?void 0:parsedData.data);break;case"CHAT_INITIALIZED":emitEvent(_events.ChatbotEventType.CHAT_INITIALIZED,parsedData==null?void 0:parsedData.data);break;case"SESSION_REFRESHED":emitEvent(_events.ChatbotEventType.SESSION_REFRESHED,parsedData==null?void 0:parsedData.data);break;case"CHAT_INITIALIZATION_FAILED":emitEvent(_events.ChatbotEventType.CHAT_INITIALIZATION_FAILED,parsedData==null?void 0:parsedData.data);break;default:if(onMessage)onMessage(parsedData!=null?parsedData:{});}}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to parse WebView message"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{messageData:data}});}},[emitEvent,isWebViewVisible,onMessage,systemInfo,effectiveUserId,user_token,user_profile]);(0,_react.useEffect)(function(){var initializeUserId=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(){var userId=user_id?String(user_id):undefined;if(!userId){userId=memoryCache.current["rblyn_anon"];if(!userId){userId=(0,_cookieUtils.generateUUID)();executeStorageOp(function(){var _webViewRef$current4;(_webViewRef$current4=webViewRef.current)==null?void 0:_webViewRef$current4.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.SET_STORAGE,"rblyn_anon",userId));});}}setEffectiveUserId(userId);});return function initializeUserId(){return _ref2.apply(this,arguments);};}();initializeUserId();},[user_id,executeStorageOp]);(0,_react.useEffect)(function(){if(webViewRef.current){webViewRef.current.injectJavaScript((0,_webViewStorage.getStorageScript)());executeStorageOp(function(){var _webViewRef$current5;(_webViewRef$current5=webViewRef.current)==null?void 0:_webViewRef$current5.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));});}},[]);(0,_react.useEffect)(function(){var fetchChatbotConfig=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(){try{var _data$user;var endpointUrl=`${_constants.API_URL}/chat/chatbot/get/`;var payload={client_user_id:effectiveUserId,org_id:api_key,token:user_token,extra_info:{}};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){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to fetch chatbot configuration"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.NETWORK_ERROR,context:{api_key:api_key,user_id:user_id}});}finally{setLoading(false);}});return function fetchChatbotConfig(){return _ref3.apply(this,arguments);};}();if(api_key&&effectiveUserId){fetchChatbotConfig();}},[api_key,effectiveUserId,user_token]);function constructUrl(){if(!effectiveUserId)return"";var params=new URLSearchParams({id:api_key});console.log("BASE_CHATBOT_URL SDK_VERSION",_constants.BASE_CHATBOT_URL,_version.SDK_VERSION);return`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;}var openWebView=(0,_react.useCallback)(function(){setIsWebViewVisible(true);if(enableAnimation){_reactNative.Animated.timing(fadeAnim,{toValue:1,duration:250,useNativeDriver:true}).start(function(){onOpen==null?void 0:onOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}else{fadeAnim.setValue(1);requestAnimationFrame(function(){onOpen==null?void 0:onOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}},[enableAnimation,fadeAnim,onOpen,emitEvent]);var closeWebView=(0,_react.useCallback)(function(){if(webViewRef.current){webViewRef.current.postMessage(JSON.stringify({name:"closeFrame",domain:"app-domain.com"}));}var complete=function complete(){setIsWebViewVisible(false);onClose==null?void 0:onClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);};if(enableAnimation){_reactNative.Animated.timing(fadeAnim,{toValue:0,duration:200,useNativeDriver:true}).start(complete);}else{fadeAnim.setValue(0);requestAnimationFrame(complete);}},[enableAnimation,fadeAnim,onClose,emitEvent]);(0,_react.useEffect)(function(){if(show_floating_button&&chatbotConfig){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_LOADED);}},[show_floating_button,chatbotConfig,emitEvent]);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();(0,_react.useEffect)(function(){if(__DEV__){(0,_debugConfig.enableNetworkDebug)();}},[]);return(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotSDK",children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.mainContainer,children:[!loading&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"FloatingButton",children:show_floating_button&&api_key&&chatbotConfig&&(0,_jsxRuntime.jsx)(_FloatingButton.default,{onPress:function onPress(){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_CLICKED);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:[styles.fullScreenContainer,{opacity:fadeAnim}],children:(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotWebView",children:(0,_jsxRuntime.jsx)(_reactNativeWebview.WebView,{ref:webViewRef,source:{uri:constructUrl()},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$current6;if(__DEV__){(0,_debugConfig.enableWebViewDebug)(webViewRef);}(_webViewRef$current6=webViewRef.current)==null?void 0:_webViewRef$current6.injectJavaScript(`
9
+ if (!document.querySelector('meta[name="viewport"]')) {
10
+ var meta = document.createElement('meta');
11
+ meta.name = 'viewport';
12
+ meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no';
13
+ document.getElementsByTagName('head')[0].appendChild(meta);
14
+ }
15
+
16
+ if (!document.querySelector('#injectedStyle')) {
17
+ const style = document.createElement('style');
18
+ style.id = 'injectedStyle';
19
+ style.textContent = \`
20
+ html, body, #root, #__next {
21
+ height: 100% !important;
22
+ min-height: 100% !important;
23
+ overflow: hidden !important;
24
+ }
25
+ \`;
26
+ document.head.appendChild(style);
27
+ }
28
+
29
+ window.sendToChatbot = function(message) {
30
+ window.ReactNativeWebView.postMessage(JSON.stringify(message));
31
+ };
32
+
33
+ // Only create observer if it doesn't exist
34
+ if (!window.closeButtonObserver) {
35
+ // Setup mutation observer to watch for close button
36
+ window.closeButtonObserver = new MutationObserver(function(mutations) {
37
+ const closeButton = document.querySelector('.chatbot-close-button');
38
+ if (closeButton && !closeButton.hasAttribute('listener-attached')) {
39
+ closeButton.setAttribute('listener-attached', 'true');
40
+ closeButton.addEventListener('click', () => {
41
+ try {
42
+ const message = { type: 'close_chatbot' };
43
+ window.ReactNativeWebView.postMessage(JSON.stringify(message));
44
+ } catch (error) {
45
+ console.error('Error sending close message:', error);
46
+ }
47
+ });
48
+ console.log('Close button listener attached');
49
+ }
50
+ });
51
+
52
+ // Start observing
53
+ window.closeButtonObserver.observe(document.body, {
54
+ childList: true,
55
+ subtree: true
56
+ });
57
+
58
+ // Initial check for existing button
59
+ const existingButton = document.querySelector('.chatbot-close-button');
60
+ if (existingButton && !existingButton.hasAttribute('listener-attached')) {
61
+ existingButton.setAttribute('listener-attached', 'true');
62
+ existingButton.addEventListener('click', () => {
63
+ try {
64
+ const message = { type: 'close_chatbot' };
65
+ window.ReactNativeWebView.postMessage(JSON.stringify(message));
66
+ } catch (error) {
67
+ console.error('Error sending close message:', error);
68
+ }
69
+ });
70
+ console.log('Close button listener attached to existing button');
71
+ }
72
+ }
73
+
74
+ true;
75
+ `);isFirstLoadRef.current=false;},onError:function onError(syntheticEvent){var nativeEvent=syntheticEvent.nativeEvent;_ErrorTrackingService.errorTracker.trackError(new Error(nativeEvent.description),"ChatbotWebView",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{url:nativeEvent.url,code:nativeEvent.code}});}})})})})]}),__DEV__&&(0,_jsxRuntime.jsx)(_DebugButton.default,{})]})});};var styles=_reactNative.StyleSheet.create({mainContainer:{flex:1,position:"relative"},webViewWrapper:{position:"absolute",top:0,left:0,right:0,bottom:10,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=Chatbot;
18
76
  //# sourceMappingURL=Chatbotsdk.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_FloatingButton","_interopRequireDefault","_constants","_version","_systemInfo","_useChatbotEvents2","_events","_logger","_debugConfig","_ErrorBoundary","_errorConstants","_ErrorTrackingService","_cookieUtils","_webViewStorage","_ChatbotWebView","_jsxRuntime","_this","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Chatbot","_ref","api_key","user_id","user_token","_ref$show_floating_bu","show_floating_button","onEvent","onMessage","_ref$isFullScreen","isFullScreen","_ref$enableAnimation","enableAnimation","onOpen","onClose","user_profile","_useState","useState","_useState2","_slicedToArray2","isWebViewVisible","setIsWebViewVisible","_useState3","_useState4","chatbotConfig","setChatbotConfig","_useState5","_useState6","loading","setLoading","webViewRef","useRef","fadeAnim","Animated","Value","current","isFirstLoadRef","_useState7","_useState8","toastVisible","setToastVisible","_useState9","_useState10","toastMessage","setToastMessage","_useState11","_useState12","effectiveUserId","setEffectiveUserId","_useState13","_useState14","isStorageReady","setIsStorageReady","pendingStorageOps","memoryCache","_useState15","os","browser","_useState16","systemInfo","setSystemInfo","chatbotConfigForEvents","useMemo","userId","isAnonymous","_useChatbotEvents","useChatbotEvents","emitEvent","onInternalEvent","triggerAppInit","injectJavaScript","executeStorageOp","useCallback","operation","push","handleMessage","event","_webViewRef$current","data","nativeEvent","parsedData","JSON","parse","values","StorageMessageType","includes","type","storageMessage","STORAGE_READY","forEach","op","createStorageMessage","GET_STORAGE","STORAGE_RESPONSE","key","value","STORAGE_ERROR","logger","error","__DEV__","console","log","level","_parsedData$data","ChatbotEventType","CHATBOT_APP_READY","_webViewRef$current2","_webViewRef$current3","getBrowserAndOSInfoScript","messageData","name","action","token","undefined","userProfile","assign","getSystemInfo","debug","stringify","domain","closeWebView","CHATBOT_LOADED","CHAT_INITIALIZED","SESSION_REFRESHED","CHAT_INITIALIZATION_FAILED","errorTracker","trackError","Error","ErrorTypes","RUNTIME_ERROR","context","useEffect","initializeUserId","_ref2","_asyncToGenerator2","String","generateUUID","_webViewRef$current4","SET_STORAGE","apply","arguments","getStorageScript","_webViewRef$current5","fetchChatbotConfig","_ref3","_data$user","endpointUrl","API_URL","payload","client_user_id","org_id","extra_info","response","fetch","method","headers","body","ok","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","NETWORK_ERROR","constructUrl","params","URLSearchParams","id","BASE_CHATBOT_URL","SDK_VERSION","toString","openWebView","timing","toValue","duration","useNativeDriver","start","CHATBOT_OPENED","setTimeout","setValue","requestAnimationFrame","postMessage","complete","CHATBOT_CLOSED","CHATBOT_BUTTON_LOADED","getScreenDimensions","windowHeight","Dimensions","height","windowWidth","width","statusBarHeight","Platform","OS","StatusBar","currentHeight","screenDimensions","enableNetworkDebug","userAgent","select","android","ios","jsx","ErrorBoundary","componentName","children","View","style","styles","mainContainer","jsxs","Fragment","onPress","CHATBOT_BUTTON_CLICKED","brandColor","imageUrl","pointerEvents","ref","source","uri","onDebugMessage","message","webview","allowsInlineMediaPlayback","mediaPlaybackRequiresUserAction","allowFileAccess","geolocationEnabled","javaScriptEnabled","domStorageEnabled","cacheEnabled","scrollEnabled","bounces","onShouldStartLoadWithRequest","request","allowedDomains","some","url","startsWith","startInLoadingState","onLoadEnd","onError","syntheticEvent","description","code","originWhitelist","mixedContentMode","onContentProcessDidTerminate","_webViewRef$current6","reload","injectedJavaScriptBeforeContentLoaded","androidLayerType","overScrollMode","textZoom","setSupportMultipleWindows","allowsBackForwardNavigationGestures","useWebKit","keyboardDisplayRequiresUserAction","hideKeyboardAccessoryView","applicationNameForUserAgent","StyleSheet","create","flex","position","webViewWrapper","top","left","right","bottom","overflow","zIndex","fullScreenContainer","backgroundColor","inlineContainer","_default","exports"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":"iWAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WAOA,IAAAC,YAAA,CAAAD,OAAA,iBAUA,IAAAE,eAAA,CAAAC,sBAAA,CAAAH,OAAA,sBACA,IAAAI,UAAA,CAAAJ,OAAA,gBACA,IAAAK,QAAA,CAAAL,OAAA,cACA,IAAAM,WAAA,CAAAN,OAAA,uBACA,IAAAO,kBAAA,CAAAP,OAAA,6BACA,IAAAQ,OAAA,CAAAR,OAAA,mBACA,IAAAS,OAAA,CAAAT,OAAA,mBACA,IAAAU,YAAA,CAAAV,OAAA,wBAEA,IAAAW,cAAA,CAAAX,OAAA,+BACA,IAAAY,eAAA,CAAAZ,OAAA,+BAMA,IAAAa,qBAAA,CAAAb,OAAA,oCACA,IAAAc,YAAA,CAAAd,OAAA,wBACA,IAAAe,eAAA,CAAAf,OAAA,2BAMA,IAAAgB,eAAA,CAAAb,sBAAA,CAAAH,OAAA,iCAAyD,IAAAiB,WAAA,CAAAjB,OAAA,0BAAAkB,KAAA,MAAAC,YAAA,+FAAAC,yBAAAC,CAAA,wBAAAC,OAAA,iBAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAF,wBAAA,UAAAA,yBAAAC,CAAA,SAAAA,CAAA,CAAAG,CAAA,CAAAD,CAAA,IAAAF,CAAA,YAAAtB,wBAAAsB,CAAA,CAAAE,CAAA,MAAAA,CAAA,EAAAF,CAAA,EAAAA,CAAA,CAAAI,UAAA,QAAAJ,CAAA,WAAAA,CAAA,mBAAAA,CAAA,qBAAAA,CAAA,QAAAK,OAAA,CAAAL,CAAA,MAAAG,CAAA,CAAAJ,wBAAA,CAAAG,CAAA,KAAAC,CAAA,EAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,SAAAG,CAAA,CAAAI,GAAA,C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2B,CAAC,YAAY,CACzC,CAAC,CAGE,CAAC,EACP,CACH,CAEG,CAAC,CACM,CAAC,CAEpB,CAAC,CAED,GAAM,CAAAlD,MAAM,CAAGmD,uBAAU,CAACC,MAAM,CAAC,CAC/BnD,aAAa,CAAE,CACboD,IAAI,CAAE,CAAC,CACPC,QAAQ,CAAE,UACZ,CAAC,CACDC,cAAc,CAAE,CACdD,QAAQ,CAAE,UAAU,CACpBE,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTC,QAAQ,CAAE,QAAQ,CAClBC,MAAM,CAAE,GACV,CAAC,CACDC,mBAAmB,CAAE,CACnBR,QAAQ,CAAE,UAAU,CACpBE,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTI,eAAe,CAAE,OAAO,CACxBF,MAAM,CAAE,GACV,CAAC,CACDG,eAAe,CAAE,CACfX,IAAI,CAAE,CAAC,CACPU,eAAe,CAAE,OACnB,CAAC,CACDjD,OAAO,CAAE,CACPuC,IAAI,CAAE,CAAC,CACPU,eAAe,CAAE,OACnB,CACF,CAAC,CAAC,CAAC,IAAAE,QAAA,CAAAC,OAAA,CAAAzS,OAAA,CAEYc,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_FloatingButton","_interopRequireDefault","_constants","_version","_systemInfo","_useChatbotEvents2","_events","_logger","_debugConfig","_DebugButton","_ErrorBoundary","_errorConstants","_ErrorTrackingService","_cookieUtils","_webViewStorage","_jsxRuntime","_this","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Chatbot","_ref","api_key","user_id","user_token","_ref$show_floating_bu","show_floating_button","onEvent","onMessage","_ref$isFullScreen","isFullScreen","_ref$enableAnimation","enableAnimation","onOpen","onClose","user_profile","_useState","useState","_useState2","_slicedToArray2","isWebViewVisible","setIsWebViewVisible","_useState3","_useState4","chatbotConfig","setChatbotConfig","_useState5","_useState6","loading","setLoading","webViewRef","useRef","fadeAnim","Animated","Value","current","isFirstLoadRef","_useState7","_useState8","toastVisible","setToastVisible","_useState9","_useState10","toastMessage","setToastMessage","_useState11","_useState12","effectiveUserId","setEffectiveUserId","_useState13","_useState14","isStorageReady","setIsStorageReady","pendingStorageOps","memoryCache","_useState15","os","browser","_useState16","systemInfo","setSystemInfo","chatbotConfigForEvents","useMemo","userId","isAnonymous","_useChatbotEvents","useChatbotEvents","emitEvent","onInternalEvent","triggerAppInit","injectJavaScript","executeStorageOp","useCallback","operation","push","handleMessage","event","_webViewRef$current","data","nativeEvent","parsedData","JSON","parse","values","StorageMessageType","includes","type","storageMessage","STORAGE_READY","forEach","op","createStorageMessage","GET_STORAGE","STORAGE_RESPONSE","key","value","STORAGE_ERROR","logger","error","__DEV__","console","log","level","_parsedData$data","ChatbotEventType","CHATBOT_APP_READY","_webViewRef$current2","_webViewRef$current3","getBrowserAndOSInfoScript","messageData","name","action","token","undefined","userProfile","assign","getSystemInfo","debug","stringify","domain","closeWebView","CHATBOT_LOADED","CHAT_INITIALIZED","SESSION_REFRESHED","CHAT_INITIALIZATION_FAILED","errorTracker","trackError","Error","ErrorTypes","RUNTIME_ERROR","context","useEffect","initializeUserId","_ref2","_asyncToGenerator2","String","generateUUID","_webViewRef$current4","SET_STORAGE","apply","arguments","getStorageScript","_webViewRef$current5","fetchChatbotConfig","_ref3","_data$user","endpointUrl","API_URL","payload","client_user_id","org_id","extra_info","response","fetch","method","headers","body","ok","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","NETWORK_ERROR","constructUrl","params","URLSearchParams","id","BASE_CHATBOT_URL","SDK_VERSION","toString","openWebView","timing","toValue","duration","useNativeDriver","start","CHATBOT_OPENED","setTimeout","setValue","requestAnimationFrame","postMessage","complete","CHATBOT_CLOSED","CHATBOT_BUTTON_LOADED","getScreenDimensions","windowHeight","Dimensions","height","windowWidth","width","statusBarHeight","Platform","OS","StatusBar","currentHeight","screenDimensions","enableNetworkDebug","jsx","ErrorBoundary","componentName","children","jsxs","View","style","styles","mainContainer","Fragment","onPress","CHATBOT_BUTTON_CLICKED","brandColor","imageUrl","webViewWrapper","pointerEvents","fullScreenContainer","opacity","WebView","ref","source","uri","webview","containerStyle","allowsInlineMediaPlayback","mediaPlaybackRequiresUserAction","allowFileAccess","geolocationEnabled","javaScriptEnabled","domStorageEnabled","cacheEnabled","scrollEnabled","bounces","onShouldStartLoadWithRequest","request","url","startsWith","startInLoadingState","onLoadEnd","_webViewRef$current6","enableWebViewDebug","onError","syntheticEvent","description","code","StyleSheet","create","flex","position","top","left","right","bottom","overflow","zIndex","backgroundColor","inlineContainer","_default","exports"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":"iWAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WAOA,IAAAC,YAAA,CAAAD,OAAA,iBASA,IAAAE,mBAAA,CAAAF,OAAA,yBACA,IAAAG,eAAA,CAAAC,sBAAA,CAAAJ,OAAA,sBACA,IAAAK,UAAA,CAAAL,OAAA,gBACA,IAAAM,QAAA,CAAAN,OAAA,cACA,IAAAO,WAAA,CAAAP,OAAA,uBACA,IAAAQ,kBAAA,CAAAR,OAAA,6BACA,IAAAS,OAAA,CAAAT,OAAA,mBACA,IAAAU,OAAA,CAAAV,OAAA,mBACA,IAAAW,YAAA,CAAAX,OAAA,wBACA,IAAAY,YAAA,CAAAR,sBAAA,CAAAJ,OAAA,8BACA,IAAAa,cAAA,CAAAb,OAAA,+BACA,IAAAc,eAAA,CAAAd,OAAA,+BAMA,IAAAe,qBAAA,CAAAf,OAAA,oCACA,IAAAgB,YAAA,CAAAhB,OAAA,wB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AAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTG,eAAe,CAAE,OAAO,CACxBD,MAAM,CAAE,IACV,CAAC,CACDE,eAAe,CAAE,CACfT,IAAI,CAAE,CAAC,CACPQ,eAAe,CAAE,OACnB,CAAC,CACDjC,OAAO,CAAE,CACPyB,IAAI,CAAE,CAAC,CACPQ,eAAe,CAAE,OACnB,CACF,CAAC,CAAC,CAAC,IAAAE,QAAA,CAAAC,OAAA,CAAAvR,OAAA,CAEYc,OAAO","ignoreList":[]}
@@ -25,5 +25,5 @@ Object.defineProperty(exports,"__esModule",{value:true});exports.getSystemInfo=e
25
25
  }
26
26
  getOSAndBrowser();
27
27
  true;
28
- `;};var getSystemInfo=exports.getSystemInfo=function getSystemInfo(webViewSystemInfo){return{platform:_reactNative.Platform.OS,os:webViewSystemInfo.os||_reactNative.Platform.OS,browser:webViewSystemInfo.browser||"WebView",sdk_version:_version.SDK_VERSION,device:getDeviceType(),screen_size:getScreenSize()};};
28
+ `;};var getSystemInfo=exports.getSystemInfo=function getSystemInfo(webViewSystemInfo){return{platform:_reactNative.Platform.OS,os:webViewSystemInfo.os||_reactNative.Platform.OS,browser:webViewSystemInfo.browser||"WebView",SDK_VERSION:_version.SDK_VERSION,device:getDeviceType(),screen_size:getScreenSize()};};
29
29
  //# sourceMappingURL=systemInfo.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_version","getDeviceType","_Dimensions$get","Dimensions","get","width","height","aspectRatio","Platform","OS","isPad","getScreenSize","Math","round","PixelRatio","getBrowserAndOSInfoScript","exports","getSystemInfo","webViewSystemInfo","platform","os","browser","sdk_version","SDK_VERSION","device","screen_size"],"sourceRoot":"../../../src","sources":["utils/systemInfo.ts"],"mappings":"wHAAA,IAAAA,YAAA,CAAAC,OAAA,iBACA,IAAAC,QAAA,CAAAD,OAAA,eAiBA,GAAM,CAAAE,aAAa,CAAG,QAAhB,CAAAA,aAAaA,CAAA,CAAiB,CAClC,IAAAC,eAAA,CAA0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ACC,EAAE,CACrBW,EAAE,CAAEF,iBAAiB,CAACE,EAAE,EAAIZ,qBAAQ,CAACC,EAAE,CACvCY,OAAO,CAAEH,iBAAiB,CAACG,OAAO,EAAI,SAAS,CAC/CC,WAAW,CAAEC,oBAAW,CACxBC,MAAM,CAAEvB,aAAa,CAAC,CAAC,CACvBwB,WAAW,CAAEd,aAAa,CAAC,CAC7B,CAAC,CACH,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_version","getDeviceType","_Dimensions$get","Dimensions","get","width","height","aspectRatio","Platform","OS","isPad","getScreenSize","Math","round","PixelRatio","getBrowserAndOSInfoScript","exports","getSystemInfo","webViewSystemInfo","platform","os","browser","SDK_VERSION","device","screen_size"],"sourceRoot":"../../../src","sources":["utils/systemInfo.ts"],"mappings":"wHAAA,IAAAA,YAAA,CAAAC,OAAA,iBACA,IAAAC,QAAA,CAAAD,OAAA,eAiBA,GAAM,CAAAE,aAAa,CAAG,QAAhB,CAAAA,aAAaA,CAAA,CAAiB,CAClC,IAAAC,eAAA,CAA0BC,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC,CAA1CC,KAAK,CAAAH,eAAA,CAALG,KAAK,CAAEC,MAAM,CAAAJ,eAAA,CAANI,MAAM,CACrB,GAAM,CAAAC,WAAW,CAAGD,MAAM,CAAGD,KAAK,CAElC,GAAIG,qBAAQ,CAACC,EAAE,GAAK,KAAK,CAAE,CACzB,MAAO,CAAAD,qBAAQ,CAACE,KAAK,CAAG,MAAM,CAAG,QAAQ,CAC3C,CAAC,IAAM,IAAIF,qBAAQ,CAACC,EAAE,GAAK,SAAS,CAAE,CACpC,MAAO,CAAAF,WAAW,CAAG,GAAG,CAAG,gBAAgB,CAAG,eAAe,CAC/D,CACA,MAAO,SAAS,CAClB,CAAC,CAGD,GAAM,CAAAI,aAAa,CAAG,QAAhB,CAAAA,aAAaA,CAAA,CAAqB,CACtC,MAAO,CACLN,KAAK,CAAEO,IAAI,CAACC,KAAK,CAACV,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC,CAACC,KAAK,CAAGS,uBAAU,CAACV,GAAG,CAAC,CAAC,CAAC,CACpEE,MAAM,CAAEM,IAAI,CAACC,KAAK,CAACV,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC,CAACE,MAAM,CAAGQ,uBAAU,CAACV,GAAG,CAAC,CAAC,CACvE,CAAC,CACH,CAAC,CAGM,GAAM,CAAAW,yBAAyB,CAAAC,OAAA,CAAAD,yBAAA,CAAG,QAA5B,CAAAA,yBAAyBA,CAAA,CAAiB,CACrD,MAAO;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,CACH,CAAC,CAGM,GAAM,CAAAE,aAAa,CAAAD,OAAA,CAAAC,aAAA,CAAG,QAAhB,CAAAA,aAAaA,CAAIC,iBAG7B,CAAiB,CAChB,MAAO,CACLC,QAAQ,CAAEX,qBAAQ,CAACC,EAAE,CACrBW,EAAE,CAAEF,iBAAiB,CAACE,EAAE,EAAIZ,qBAAQ,CAACC,EAAE,CACvCY,OAAO,CAAEH,iBAAiB,CAACG,OAAO,EAAI,SAAS,CAC/CC,WAAW,CAAXA,oBAAW,CACXC,MAAM,CAAEtB,aAAa,CAAC,CAAC,CACvBuB,WAAW,CAAEb,aAAa,CAAC,CAC7B,CAAC,CACH,CAAC","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;var SDK_VERSION=exports.SDK_VERSION='2.0.19-staging.33';
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;var SDK_VERSION=exports.SDK_VERSION='2.0.19-staging.35';
2
2
  //# sourceMappingURL=version.staging.js.map
@@ -1,18 +1,76 @@
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 _FloatingButton=_interopRequireDefault(require("./FloatingButton"));var _constants=require("./constants");var _version=require("./version");var _systemInfo=require("./utils/systemInfo");var _useChatbotEvents2=require("./hooks/useChatbotEvents");var _events=require("./types/events");var _logger=require("./utils/logger");var _debugConfig=require("./utils/debugConfig");var _ErrorBoundary=require("./components/ErrorBoundary");var _errorConstants=require("./constants/errorConstants");var _ErrorTrackingService=require("./services/ErrorTrackingService");var _cookieUtils=require("./utils/cookieUtils");var _webViewStorage=require("./utils/webViewStorage");var _ChatbotWebView=_interopRequireDefault(require("./components/ChatbotWebView"));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 Chatbot=function Chatbot(_ref){var api_key=_ref.api_key,user_id=_ref.user_id,user_token=_ref.user_token,_ref$show_floating_bu=_ref.show_floating_button,show_floating_button=_ref$show_floating_bu===void 0?true:_ref$show_floating_bu,onEvent=_ref.onEvent,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,user_profile=_ref.user_profile;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 _useState7=(0,_react.useState)(false),_useState8=(0,_slicedToArray2.default)(_useState7,2),toastVisible=_useState8[0],setToastVisible=_useState8[1];var _useState9=(0,_react.useState)(""),_useState10=(0,_slicedToArray2.default)(_useState9,2),toastMessage=_useState10[0],setToastMessage=_useState10[1];var _useState11=(0,_react.useState)(),_useState12=(0,_slicedToArray2.default)(_useState11,2),effectiveUserId=_useState12[0],setEffectiveUserId=_useState12[1];var _useState13=(0,_react.useState)(false),_useState14=(0,_slicedToArray2.default)(_useState13,2),isStorageReady=_useState14[0],setIsStorageReady=_useState14[1];var pendingStorageOps=(0,_react.useRef)([]);var memoryCache=(0,_react.useRef)({});var _useState15=(0,_react.useState)({os:"",browser:""}),_useState16=(0,_slicedToArray2.default)(_useState15,2),systemInfo=_useState16[0],setSystemInfo=_useState16[1];var chatbotConfigForEvents=(0,_react.useMemo)(function(){return{userId:effectiveUserId,isAnonymous:!user_id&&user_id!==0};},[effectiveUserId,user_id]);var _useChatbotEvents=(0,_useChatbotEvents2.useChatbotEvents)({api_key:api_key,chatbotConfig:chatbotConfigForEvents!=null?chatbotConfigForEvents:{},user_profile:user_profile,onEvent:onEvent,systemInfo:systemInfo!=null?systemInfo:{os:"",browser:""}}),emitEvent=_useChatbotEvents.emitEvent,onInternalEvent=_useChatbotEvents.onInternalEvent;var triggerAppInit=function triggerAppInit(){if(webViewRef.current){webViewRef.current.injectJavaScript(`
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 _version=require("./version");var _systemInfo=require("./utils/systemInfo");var _useChatbotEvents2=require("./hooks/useChatbotEvents");var _events=require("./types/events");var _logger=require("./utils/logger");var _debugConfig=require("./utils/debugConfig");var _DebugButton=_interopRequireDefault(require("./components/DebugButton"));var _ErrorBoundary=require("./components/ErrorBoundary");var _errorConstants=require("./constants/errorConstants");var _ErrorTrackingService=require("./services/ErrorTrackingService");var _cookieUtils=require("./utils/cookieUtils");var _webViewStorage=require("./utils/webViewStorage");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 Chatbot=function Chatbot(_ref){var api_key=_ref.api_key,user_id=_ref.user_id,user_token=_ref.user_token,_ref$show_floating_bu=_ref.show_floating_button,show_floating_button=_ref$show_floating_bu===void 0?true:_ref$show_floating_bu,onEvent=_ref.onEvent,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,user_profile=_ref.user_profile;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 _useState7=(0,_react.useState)(false),_useState8=(0,_slicedToArray2.default)(_useState7,2),toastVisible=_useState8[0],setToastVisible=_useState8[1];var _useState9=(0,_react.useState)(""),_useState10=(0,_slicedToArray2.default)(_useState9,2),toastMessage=_useState10[0],setToastMessage=_useState10[1];var _useState11=(0,_react.useState)(),_useState12=(0,_slicedToArray2.default)(_useState11,2),effectiveUserId=_useState12[0],setEffectiveUserId=_useState12[1];var _useState13=(0,_react.useState)(false),_useState14=(0,_slicedToArray2.default)(_useState13,2),isStorageReady=_useState14[0],setIsStorageReady=_useState14[1];var pendingStorageOps=(0,_react.useRef)([]);var memoryCache=(0,_react.useRef)({});var _useState15=(0,_react.useState)({os:"",browser:""}),_useState16=(0,_slicedToArray2.default)(_useState15,2),systemInfo=_useState16[0],setSystemInfo=_useState16[1];var chatbotConfigForEvents=(0,_react.useMemo)(function(){return{userId:effectiveUserId,isAnonymous:!user_id&&user_id!==0};},[effectiveUserId,user_id]);var _useChatbotEvents=(0,_useChatbotEvents2.useChatbotEvents)({api_key:api_key,chatbotConfig:chatbotConfigForEvents!=null?chatbotConfigForEvents:{},user_profile:user_profile,onEvent:onEvent,systemInfo:systemInfo!=null?systemInfo:{os:"",browser:""}}),emitEvent=_useChatbotEvents.emitEvent,onInternalEvent=_useChatbotEvents.onInternalEvent;var triggerAppInit=function triggerAppInit(){if(webViewRef.current){webViewRef.current.injectJavaScript(`
2
2
  // Trigger APP_READY equivalent
3
3
  window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'APP_READY' }));
4
4
  true;
5
5
  `);}};var executeStorageOp=(0,_react.useCallback)(function(operation){if(isStorageReady){operation();}else{pendingStorageOps.current.push(operation);}},[isStorageReady]);var handleMessage=(0,_react.useCallback)(function(event){var _webViewRef$current;var data=event.nativeEvent.data;try{var parsedData=JSON.parse(data);if(Object.values(_webViewStorage.StorageMessageType).includes(parsedData.type)){var storageMessage=parsedData;switch(storageMessage.type){case _webViewStorage.StorageMessageType.STORAGE_READY:setIsStorageReady(true);pendingStorageOps.current.forEach(function(op){return op();});pendingStorageOps.current=[];(_webViewRef$current=webViewRef.current)==null?void 0:_webViewRef$current.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));break;case _webViewStorage.StorageMessageType.STORAGE_RESPONSE:if(storageMessage.key&&storageMessage.value){memoryCache.current[storageMessage.key]=storageMessage.value;if(storageMessage.key==="rblyn_anon"){setEffectiveUserId(storageMessage.value);}}break;case _webViewStorage.StorageMessageType.STORAGE_ERROR:_logger.logger.error("WebView storage error:",storageMessage.error);break;}return;}if(__DEV__){if((parsedData==null?void 0:parsedData.type)==="CONSOLE"){console.log(`WebView ${parsedData==null?void 0:parsedData.level}:`,parsedData==null?void 0:parsedData.data);return;}if((parsedData==null?void 0:parsedData.type)==="ERROR"){console.error("WebView Error:",parsedData==null?void 0:parsedData.data);return;}}if((parsedData==null?void 0:parsedData.type)==="SYSTEM_INFO"){var _parsedData$data;setSystemInfo((_parsedData$data=parsedData==null?void 0:parsedData.data)!=null?_parsedData$data:{os:"",browser:""});return;}if((parsedData==null?void 0:parsedData.type)==="APP_READY"){emitEvent(_events.ChatbotEventType.CHATBOT_APP_READY);if(webViewRef.current&&isWebViewVisible){var _webViewRef$current2,_webViewRef$current3;(_webViewRef$current2=webViewRef.current)==null?void 0:_webViewRef$current2.injectJavaScript((0,_systemInfo.getBrowserAndOSInfoScript)());var messageData={name:"registerUserId",action:"registerUserId",data:{userId:effectiveUserId,token:user_token?`${user_token}`:undefined,userProfile:Object.assign({},user_profile,(0,_systemInfo.getSystemInfo)(systemInfo))}};_logger.logger.debug("messageData====>",JSON.stringify(messageData));(_webViewRef$current3=webViewRef.current)==null?void 0:_webViewRef$current3.injectJavaScript(`
6
6
  window.postMessage(${JSON.stringify({name:"openFrame",domain:"app-domain.com"})}, '*');
7
7
  window.postMessage(${JSON.stringify(messageData)}, '*');
8
- `);}}switch(parsedData==null?void 0:parsedData.type){case"close_chatbot":closeWebView();break;case"CHATBOT_LOADED":emitEvent(_events.ChatbotEventType.CHATBOT_LOADED,parsedData==null?void 0:parsedData.data);break;case"CHAT_INITIALIZED":emitEvent(_events.ChatbotEventType.CHAT_INITIALIZED,parsedData==null?void 0:parsedData.data);break;case"SESSION_REFRESHED":emitEvent(_events.ChatbotEventType.SESSION_REFRESHED,parsedData==null?void 0:parsedData.data);break;case"CHAT_INITIALIZATION_FAILED":emitEvent(_events.ChatbotEventType.CHAT_INITIALIZATION_FAILED,parsedData==null?void 0:parsedData.data);break;default:if(onMessage)onMessage(parsedData!=null?parsedData:{});}}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to parse WebView message"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{messageData:data}});}},[emitEvent,isWebViewVisible,onMessage,systemInfo,effectiveUserId,user_token,user_profile]);(0,_react.useEffect)(function(){var initializeUserId=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(){var userId=user_id?String(user_id):undefined;if(!userId){userId=memoryCache.current["rblyn_anon"];if(!userId){userId=(0,_cookieUtils.generateUUID)();executeStorageOp(function(){var _webViewRef$current4;(_webViewRef$current4=webViewRef.current)==null?void 0:_webViewRef$current4.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.SET_STORAGE,"rblyn_anon",userId));});}}setEffectiveUserId(userId);});return function initializeUserId(){return _ref2.apply(this,arguments);};}();initializeUserId();},[user_id,executeStorageOp]);(0,_react.useEffect)(function(){if(webViewRef.current){webViewRef.current.injectJavaScript((0,_webViewStorage.getStorageScript)());executeStorageOp(function(){var _webViewRef$current5;(_webViewRef$current5=webViewRef.current)==null?void 0:_webViewRef$current5.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));});}},[]);(0,_react.useEffect)(function(){var fetchChatbotConfig=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(){try{var _data$user;var endpointUrl=`${_constants.API_URL}/chat/chatbot/get/`;var payload={client_user_id:effectiveUserId,org_id:api_key,token:user_token,extra_info:{}};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){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to fetch chatbot configuration"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.NETWORK_ERROR,context:{api_key:api_key,user_id:user_id}});}finally{setLoading(false);}});return function fetchChatbotConfig(){return _ref3.apply(this,arguments);};}();if(api_key&&effectiveUserId){fetchChatbotConfig();}},[api_key,effectiveUserId,user_token]);function constructUrl(){if(!effectiveUserId)return"";var params=new URLSearchParams({id:api_key});console.log("BASE_CHATBOT_URL SDK_VERSION",_constants.BASE_CHATBOT_URL,_version.SDK_VERSION);return`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;}var openWebView=(0,_react.useCallback)(function(){setIsWebViewVisible(true);if(enableAnimation){_reactNative.Animated.timing(fadeAnim,{toValue:1,duration:250,useNativeDriver:true}).start(function(){onOpen==null?void 0:onOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}else{fadeAnim.setValue(1);requestAnimationFrame(function(){onOpen==null?void 0:onOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}},[enableAnimation,fadeAnim,onOpen,emitEvent]);var closeWebView=(0,_react.useCallback)(function(){if(webViewRef.current){webViewRef.current.postMessage(JSON.stringify({name:"closeFrame",domain:"app-domain.com"}));}var complete=function complete(){setIsWebViewVisible(false);onClose==null?void 0:onClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);};if(enableAnimation){_reactNative.Animated.timing(fadeAnim,{toValue:0,duration:200,useNativeDriver:true}).start(complete);}else{fadeAnim.setValue(0);requestAnimationFrame(complete);}},[enableAnimation,fadeAnim,onClose,emitEvent]);(0,_react.useEffect)(function(){if(show_floating_button&&chatbotConfig){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_LOADED);}},[show_floating_button,chatbotConfig,emitEvent]);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();(0,_react.useEffect)(function(){if(__DEV__){(0,_debugConfig.enableNetworkDebug)();}},[]);var userAgent=_reactNative.Platform.select({android:"Mozilla/5.0 (Linux; Android 10; Android SDK built for x86) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.120 Mobile Safari/537.36",ios:"Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1"});return(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotSDK",children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.mainContainer,children:!loading&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"FloatingButton",children:show_floating_button&&api_key&&chatbotConfig&&(0,_jsxRuntime.jsx)(_FloatingButton.default,{onPress:function onPress(){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_CLICKED);openWebView();},brandColor:chatbotConfig.brand_color,imageUrl:chatbotConfig.image_url})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[{height:isWebViewVisible?"100%":0}],pointerEvents:"auto",children:(0,_jsxRuntime.jsx)(_ChatbotWebView.default,{ref:webViewRef,source:{uri:constructUrl()},onMessage:handleMessage,onDebugMessage:function onDebugMessage(message){console.log("WebView Debug:",message);},style:styles.webview,allowsInlineMediaPlayback:true,mediaPlaybackRequiresUserAction:false,allowFileAccess:false,geolocationEnabled:false,javaScriptEnabled:true,domStorageEnabled:true,cacheEnabled:true,scrollEnabled:true,bounces:false,onShouldStartLoadWithRequest:function onShouldStartLoadWithRequest(request){var allowedDomains=[_constants.BASE_CHATBOT_URL,"about:blank"];return allowedDomains.some(function(domain){return request.url.startsWith(domain);});},startInLoadingState:isFirstLoadRef.current,onLoadEnd:function onLoadEnd(){isFirstLoadRef.current=false;},onError:function onError(syntheticEvent){var nativeEvent=syntheticEvent.nativeEvent;_ErrorTrackingService.errorTracker.trackError(new Error(nativeEvent.description),"ChatbotWebView",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{url:nativeEvent.url,code:nativeEvent.code}});},userAgent:userAgent,originWhitelist:["*"],mixedContentMode:"always",onContentProcessDidTerminate:function onContentProcessDidTerminate(){var _webViewRef$current6;(_webViewRef$current6=webViewRef.current)==null?void 0:_webViewRef$current6.reload();},injectedJavaScriptBeforeContentLoaded:`
9
- window.onerror = function(message, source, lineno, colno, error) {
10
- window.ReactNativeWebView.postMessage(JSON.stringify({
11
- type: 'ERROR',
12
- data: {message, source, lineno, colno}
13
- }));
14
- return true;
15
- };
16
- true;
17
- `,androidLayerType:"hardware",overScrollMode:"never",textZoom:100,setSupportMultipleWindows:false,allowsBackForwardNavigationGestures:false,useWebKit:true,keyboardDisplayRequiresUserAction:false,hideKeyboardAccessoryView:true,applicationNameForUserAgent:"ChatbotApp"})})]})})});};var styles=_reactNative.StyleSheet.create({mainContainer:{flex:1,position:"relative"},webViewWrapper:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden",zIndex:100},fullScreenContainer:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"white",zIndex:100},inlineContainer:{flex:1,backgroundColor:"white"},webview:{flex:1,backgroundColor:"white"}});var _default=exports.default=Chatbot;
8
+ `);}}switch(parsedData==null?void 0:parsedData.type){case"close_chatbot":closeWebView();break;case"CHATBOT_LOADED":emitEvent(_events.ChatbotEventType.CHATBOT_LOADED,parsedData==null?void 0:parsedData.data);break;case"CHAT_INITIALIZED":emitEvent(_events.ChatbotEventType.CHAT_INITIALIZED,parsedData==null?void 0:parsedData.data);break;case"SESSION_REFRESHED":emitEvent(_events.ChatbotEventType.SESSION_REFRESHED,parsedData==null?void 0:parsedData.data);break;case"CHAT_INITIALIZATION_FAILED":emitEvent(_events.ChatbotEventType.CHAT_INITIALIZATION_FAILED,parsedData==null?void 0:parsedData.data);break;default:if(onMessage)onMessage(parsedData!=null?parsedData:{});}}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to parse WebView message"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{messageData:data}});}},[emitEvent,isWebViewVisible,onMessage,systemInfo,effectiveUserId,user_token,user_profile]);(0,_react.useEffect)(function(){var initializeUserId=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(){var userId=user_id?String(user_id):undefined;if(!userId){userId=memoryCache.current["rblyn_anon"];if(!userId){userId=(0,_cookieUtils.generateUUID)();executeStorageOp(function(){var _webViewRef$current4;(_webViewRef$current4=webViewRef.current)==null?void 0:_webViewRef$current4.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.SET_STORAGE,"rblyn_anon",userId));});}}setEffectiveUserId(userId);});return function initializeUserId(){return _ref2.apply(this,arguments);};}();initializeUserId();},[user_id,executeStorageOp]);(0,_react.useEffect)(function(){if(webViewRef.current){webViewRef.current.injectJavaScript((0,_webViewStorage.getStorageScript)());executeStorageOp(function(){var _webViewRef$current5;(_webViewRef$current5=webViewRef.current)==null?void 0:_webViewRef$current5.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));});}},[]);(0,_react.useEffect)(function(){var fetchChatbotConfig=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(){try{var _data$user;var endpointUrl=`${_constants.API_URL}/chat/chatbot/get/`;var payload={client_user_id:effectiveUserId,org_id:api_key,token:user_token,extra_info:{}};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){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to fetch chatbot configuration"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.NETWORK_ERROR,context:{api_key:api_key,user_id:user_id}});}finally{setLoading(false);}});return function fetchChatbotConfig(){return _ref3.apply(this,arguments);};}();if(api_key&&effectiveUserId){fetchChatbotConfig();}},[api_key,effectiveUserId,user_token]);function constructUrl(){if(!effectiveUserId)return"";var params=new URLSearchParams({id:api_key});console.log("BASE_CHATBOT_URL SDK_VERSION",_constants.BASE_CHATBOT_URL,_version.SDK_VERSION);return`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;}var openWebView=(0,_react.useCallback)(function(){setIsWebViewVisible(true);if(enableAnimation){_reactNative.Animated.timing(fadeAnim,{toValue:1,duration:250,useNativeDriver:true}).start(function(){onOpen==null?void 0:onOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}else{fadeAnim.setValue(1);requestAnimationFrame(function(){onOpen==null?void 0:onOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}},[enableAnimation,fadeAnim,onOpen,emitEvent]);var closeWebView=(0,_react.useCallback)(function(){if(webViewRef.current){webViewRef.current.postMessage(JSON.stringify({name:"closeFrame",domain:"app-domain.com"}));}var complete=function complete(){setIsWebViewVisible(false);onClose==null?void 0:onClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);};if(enableAnimation){_reactNative.Animated.timing(fadeAnim,{toValue:0,duration:200,useNativeDriver:true}).start(complete);}else{fadeAnim.setValue(0);requestAnimationFrame(complete);}},[enableAnimation,fadeAnim,onClose,emitEvent]);(0,_react.useEffect)(function(){if(show_floating_button&&chatbotConfig){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_LOADED);}},[show_floating_button,chatbotConfig,emitEvent]);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();(0,_react.useEffect)(function(){if(__DEV__){(0,_debugConfig.enableNetworkDebug)();}},[]);return(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotSDK",children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.mainContainer,children:[!loading&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"FloatingButton",children:show_floating_button&&api_key&&chatbotConfig&&(0,_jsxRuntime.jsx)(_FloatingButton.default,{onPress:function onPress(){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_CLICKED);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:[styles.fullScreenContainer,{opacity:fadeAnim}],children:(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotWebView",children:(0,_jsxRuntime.jsx)(_reactNativeWebview.WebView,{ref:webViewRef,source:{uri:constructUrl()},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$current6;if(__DEV__){(0,_debugConfig.enableWebViewDebug)(webViewRef);}(_webViewRef$current6=webViewRef.current)==null?void 0:_webViewRef$current6.injectJavaScript(`
9
+ if (!document.querySelector('meta[name="viewport"]')) {
10
+ var meta = document.createElement('meta');
11
+ meta.name = 'viewport';
12
+ meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no';
13
+ document.getElementsByTagName('head')[0].appendChild(meta);
14
+ }
15
+
16
+ if (!document.querySelector('#injectedStyle')) {
17
+ const style = document.createElement('style');
18
+ style.id = 'injectedStyle';
19
+ style.textContent = \`
20
+ html, body, #root, #__next {
21
+ height: 100% !important;
22
+ min-height: 100% !important;
23
+ overflow: hidden !important;
24
+ }
25
+ \`;
26
+ document.head.appendChild(style);
27
+ }
28
+
29
+ window.sendToChatbot = function(message) {
30
+ window.ReactNativeWebView.postMessage(JSON.stringify(message));
31
+ };
32
+
33
+ // Only create observer if it doesn't exist
34
+ if (!window.closeButtonObserver) {
35
+ // Setup mutation observer to watch for close button
36
+ window.closeButtonObserver = new MutationObserver(function(mutations) {
37
+ const closeButton = document.querySelector('.chatbot-close-button');
38
+ if (closeButton && !closeButton.hasAttribute('listener-attached')) {
39
+ closeButton.setAttribute('listener-attached', 'true');
40
+ closeButton.addEventListener('click', () => {
41
+ try {
42
+ const message = { type: 'close_chatbot' };
43
+ window.ReactNativeWebView.postMessage(JSON.stringify(message));
44
+ } catch (error) {
45
+ console.error('Error sending close message:', error);
46
+ }
47
+ });
48
+ console.log('Close button listener attached');
49
+ }
50
+ });
51
+
52
+ // Start observing
53
+ window.closeButtonObserver.observe(document.body, {
54
+ childList: true,
55
+ subtree: true
56
+ });
57
+
58
+ // Initial check for existing button
59
+ const existingButton = document.querySelector('.chatbot-close-button');
60
+ if (existingButton && !existingButton.hasAttribute('listener-attached')) {
61
+ existingButton.setAttribute('listener-attached', 'true');
62
+ existingButton.addEventListener('click', () => {
63
+ try {
64
+ const message = { type: 'close_chatbot' };
65
+ window.ReactNativeWebView.postMessage(JSON.stringify(message));
66
+ } catch (error) {
67
+ console.error('Error sending close message:', error);
68
+ }
69
+ });
70
+ console.log('Close button listener attached to existing button');
71
+ }
72
+ }
73
+
74
+ true;
75
+ `);isFirstLoadRef.current=false;},onError:function onError(syntheticEvent){var nativeEvent=syntheticEvent.nativeEvent;_ErrorTrackingService.errorTracker.trackError(new Error(nativeEvent.description),"ChatbotWebView",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{url:nativeEvent.url,code:nativeEvent.code}});}})})})})]}),__DEV__&&(0,_jsxRuntime.jsx)(_DebugButton.default,{})]})});};var styles=_reactNative.StyleSheet.create({mainContainer:{flex:1,position:"relative"},webViewWrapper:{position:"absolute",top:0,left:0,right:0,bottom:10,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=Chatbot;
18
76
  //# sourceMappingURL=Chatbotsdk.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_FloatingButton","_interopRequireDefault","_constants","_version","_systemInfo","_useChatbotEvents2","_events","_logger","_debugConfig","_ErrorBoundary","_errorConstants","_ErrorTrackingService","_cookieUtils","_webViewStorage","_ChatbotWebView","_jsxRuntime","_this","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Chatbot","_ref","api_key","user_id","user_token","_ref$show_floating_bu","show_floating_button","onEvent","onMessage","_ref$isFullScreen","isFullScreen","_ref$enableAnimation","enableAnimation","onOpen","onClose","user_profile","_useState","useState","_useState2","_slicedToArray2","isWebViewVisible","setIsWebViewVisible","_useState3","_useState4","chatbotConfig","setChatbotConfig","_useState5","_useState6","loading","setLoading","webViewRef","useRef","fadeAnim","Animated","Value","current","isFirstLoadRef","_useState7","_useState8","toastVisible","setToastVisible","_useState9","_useState10","toastMessage","setToastMessage","_useState11","_useState12","effectiveUserId","setEffectiveUserId","_useState13","_useState14","isStorageReady","setIsStorageReady","pendingStorageOps","memoryCache","_useState15","os","browser","_useState16","systemInfo","setSystemInfo","chatbotConfigForEvents","useMemo","userId","isAnonymous","_useChatbotEvents","useChatbotEvents","emitEvent","onInternalEvent","triggerAppInit","injectJavaScript","executeStorageOp","useCallback","operation","push","handleMessage","event","_webViewRef$current","data","nativeEvent","parsedData","JSON","parse","values","StorageMessageType","includes","type","storageMessage","STORAGE_READY","forEach","op","createStorageMessage","GET_STORAGE","STORAGE_RESPONSE","key","value","STORAGE_ERROR","logger","error","__DEV__","console","log","level","_parsedData$data","ChatbotEventType","CHATBOT_APP_READY","_webViewRef$current2","_webViewRef$current3","getBrowserAndOSInfoScript","messageData","name","action","token","undefined","userProfile","assign","getSystemInfo","debug","stringify","domain","closeWebView","CHATBOT_LOADED","CHAT_INITIALIZED","SESSION_REFRESHED","CHAT_INITIALIZATION_FAILED","errorTracker","trackError","Error","ErrorTypes","RUNTIME_ERROR","context","useEffect","initializeUserId","_ref2","_asyncToGenerator2","String","generateUUID","_webViewRef$current4","SET_STORAGE","apply","arguments","getStorageScript","_webViewRef$current5","fetchChatbotConfig","_ref3","_data$user","endpointUrl","API_URL","payload","client_user_id","org_id","extra_info","response","fetch","method","headers","body","ok","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","NETWORK_ERROR","constructUrl","params","URLSearchParams","id","BASE_CHATBOT_URL","SDK_VERSION","toString","openWebView","timing","toValue","duration","useNativeDriver","start","CHATBOT_OPENED","setTimeout","setValue","requestAnimationFrame","postMessage","complete","CHATBOT_CLOSED","CHATBOT_BUTTON_LOADED","getScreenDimensions","windowHeight","Dimensions","height","windowWidth","width","statusBarHeight","Platform","OS","StatusBar","currentHeight","screenDimensions","enableNetworkDebug","userAgent","select","android","ios","jsx","ErrorBoundary","componentName","children","View","style","styles","mainContainer","jsxs","Fragment","onPress","CHATBOT_BUTTON_CLICKED","brandColor","imageUrl","pointerEvents","ref","source","uri","onDebugMessage","message","webview","allowsInlineMediaPlayback","mediaPlaybackRequiresUserAction","allowFileAccess","geolocationEnabled","javaScriptEnabled","domStorageEnabled","cacheEnabled","scrollEnabled","bounces","onShouldStartLoadWithRequest","request","allowedDomains","some","url","startsWith","startInLoadingState","onLoadEnd","onError","syntheticEvent","description","code","originWhitelist","mixedContentMode","onContentProcessDidTerminate","_webViewRef$current6","reload","injectedJavaScriptBeforeContentLoaded","androidLayerType","overScrollMode","textZoom","setSupportMultipleWindows","allowsBackForwardNavigationGestures","useWebKit","keyboardDisplayRequiresUserAction","hideKeyboardAccessoryView","applicationNameForUserAgent","StyleSheet","create","flex","position","webViewWrapper","top","left","right","bottom","overflow","zIndex","fullScreenContainer","backgroundColor","inlineContainer","_default","exports"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":"iWAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WAOA,IAAAC,YAAA,CAAAD,OAAA,iBAUA,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,CAAE,UACZ,CAAC,CACDC,cAAc,CAAE,CACdD,QAAQ,CAAE,UAAU,CACpBE,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTC,QAAQ,CAAE,QAAQ,CAClBC,MAAM,CAAE,GACV,CAAC,CACDC,mBAAmB,CAAE,CACnBR,QAAQ,CAAE,UAAU,CACpBE,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTI,eAAe,CAAE,OAAO,CACxBF,MAAM,CAAE,GACV,CAAC,CACDG,eAAe,CAAE,CACfX,IAAI,CAAE,CAAC,CACPU,eAAe,CAAE,OACnB,CAAC,CACDjD,OAAO,CAAE,CACPuC,IAAI,CAAE,CAAC,CACPU,eAAe,CAAE,OACnB,CACF,CAAC,CAAC,CAAC,IAAAE,QAAA,CAAAC,OAAA,CAAAzS,OAAA,CAEYc,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_FloatingButton","_interopRequireDefault","_constants","_version","_systemInfo","_useChatbotEvents2","_events","_logger","_debugConfig","_DebugButton","_ErrorBoundary","_errorConstants","_ErrorTrackingService","_cookieUtils","_webViewStorage","_jsxRuntime","_this","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Chatbot","_ref","api_key","user_id","user_token","_ref$show_floating_bu","show_floating_button","onEvent","onMessage","_ref$isFullScreen","isFullScreen","_ref$enableAnimation","enableAnimation","onOpen","onClose","user_profile","_useState","useState","_useState2","_slicedToArray2","isWebViewVisible","setIsWebViewVisible","_useState3","_useState4","chatbotConfig","setChatbotConfig","_useState5","_useState6","loading","setLoading","webViewRef","useRef","fadeAnim","Animated","Value","current","isFirstLoadRef","_useState7","_useState8","toastVisible","setToastVisible","_useState9","_useState10","toastMessage","setToastMessage","_useState11","_useState12","effectiveUserId","setEffectiveUserId","_useState13","_useState14","isStorageReady","setIsStorageReady","pendingStorageOps","memoryCache","_useState15","os","browser","_useState16","systemInfo","setSystemInfo","chatbotConfigForEvents","useMemo","userId","isAnonymous","_useChatbotEvents","useChatbotEvents","emitEvent","onInternalEvent","triggerAppInit","injectJavaScript","executeStorageOp","useCallback","operation","push","handleMessage","event","_webViewRef$current","data","nativeEvent","parsedData","JSON","parse","values","StorageMessageType","includes","type","storageMessage","STORAGE_READY","forEach","op","createStorageMessage","GET_STORAGE","STORAGE_RESPONSE","key","value","STORAGE_ERROR","logger","error","__DEV__","console","log","level","_parsedData$data","ChatbotEventType","CHATBOT_APP_READY","_webViewRef$current2","_webViewRef$current3","getBrowserAndOSInfoScript","messageData","name","action","token","undefined","userProfile","assign","getSystemInfo","debug","stringify","domain","closeWebView","CHATBOT_LOADED","CHAT_INITIALIZED","SESSION_REFRESHED","CHAT_INITIALIZATION_FAILED","errorTracker","trackError","Error","ErrorTypes","RUNTIME_ERROR","context","useEffect","initializeUserId","_ref2","_asyncToGenerator2","String","generateUUID","_webViewRef$current4","SET_STORAGE","apply","arguments","getStorageScript","_webViewRef$current5","fetchChatbotConfig","_ref3","_data$user","endpointUrl","API_URL","payload","client_user_id","org_id","extra_info","response","fetch","method","headers","body","ok","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","NETWORK_ERROR","constructUrl","params","URLSearchParams","id","BASE_CHATBOT_URL","SDK_VERSION","toString","openWebView","timing","toValue","duration","useNativeDriver","start","CHATBOT_OPENED","setTimeout","setValue","requestAnimationFrame","postMessage","complete","CHATBOT_CLOSED","CHATBOT_BUTTON_LOADED","getScreenDimensions","windowHeight","Dimensions","height","windowWidth","width","statusBarHeight","Platform","OS","StatusBar","currentHeight","screenDimensions","enableNetworkDebug","jsx","ErrorBoundary","componentName","children","jsxs","View","style","styles","mainContainer","Fragment","onPress","CHATBOT_BUTTON_CLICKED","brandColor","imageUrl","webViewWrapper","pointerEvents","fullScreenContainer","opacity","WebView","ref","source","uri","webview","containerStyle","allowsInlineMediaPlayback","mediaPlaybackRequiresUserAction","allowFileAccess","geolocationEnabled","javaScriptEnabled","domStorageEnabled","cacheEnabled","scrollEnabled","bounces","onShouldStartLoadWithRequest","request","url","startsWith","startInLoadingState","onLoadEnd","_webViewRef$current6","enableWebViewDebug","onError","syntheticEvent","description","code","StyleSheet","create","flex","position","top","left","right","bottom","overflow","zIndex","backgroundColor","inlineContainer","_default","exports"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":"iWAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WAOA,IAAAC,YAAA,CAAAD,OAAA,iBASA,IAAAE,mBAAA,CAAAF,OAAA,yBACA,IAAAG,eAAA,CAAAC,sBAAA,CAAAJ,OAAA,sBACA,IAAAK,UAAA,CAAAL,OAAA,gBACA,IAAAM,QAAA,CAAAN,OAAA,cACA,IAAAO,WAAA,CAAAP,OAAA,uBACA,IAAAQ,kBAAA,CAAAR,OAAA,6BACA,IAAAS,OAAA,CAAAT,OAAA,mBACA,IAAAU,OAAA,CAAAV,OAAA,mBACA,IAAAW,YAAA,CAAAX,OAAA,wBACA,IAAAY,YAAA,CAAAR,sBAAA,CAAAJ,OAAA,8BACA,IAAAa,cAAA,CAAAb,OAAA,+BACA,IAAAc,eAAA,CAAAd,OAAA,+BAMA,IAAAe,qBAAA,CAAAf,OAAA,oCACA,IAAAgB,YAAA,CAAAhB,OAAA,wBACA,IAAAiB,eAAA,CAAAjB,OAAA,2BAKgC,IAAAkB,WAAA,CAAAlB,OAAA,0BAAAmB,KAAA,MAAAC,YAAA,+FAAAC,yBAAAC,CAAA,wBAAAC,OAAA,iBAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAF,wBAA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AAC,CACPQ,eAAe,CAAE,OACnB,CACF,CAAC,CAAC,CAAC,IAAAE,QAAA,CAAAC,OAAA,CAAAvR,OAAA,CAEYc,OAAO","ignoreList":[]}
@@ -1,3 +1,2 @@
1
-
2
- //# sourceMappingURL=openChatbot.js.mape",{value:true});exports.openChatbot=void 0;var _reactNative=require("react-native");var _constants=require("./constants");var openChatbot=exports.openChatbot=function openChatbot(chatbotId){var additionalParams=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var params=new URLSearchParams(Object.assign({id:chatbotId},additionalParams));var url=`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;_reactNative.Linking.openURL(url);};
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.openChatbot=void 0;var _reactNative=require("react-native");var _constants=require("./constants");var openChatbot=exports.openChatbot=function openChatbot(chatbotId){var additionalParams=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var params=new URLSearchParams(Object.assign({id:chatbotId},additionalParams));var url=`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;_reactNative.Linking.openURL(url);};
3
2
  //# sourceMappingURL=openChatbot.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../src","sources":["openChatbot.tsx"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_constants","openChatbot","exports","chatbotId","additionalParams","arguments","length","undefined","params","URLSearchParams","Object","assign","id","url","BASE_CHATBOT_URL","toString","Linking","openURL"],"sourceRoot":"../../src","sources":["openChatbot.ts"],"mappings":"oFAAA,IAAAA,YAAA,CAAAC,OAAA,iBACA,IAAAC,UAAA,CAAAD,OAAA,gBAEO,GAAM,CAAAE,WAAW,CAAAC,OAAA,CAAAD,WAAA,CAAG,QAAd,CAAAA,WAAWA,CACtBE,SAAiB,CAER,IADT,CAAAC,gBAAwC,CAAAC,SAAA,CAAAC,MAAA,IAAAD,SAAA,MAAAE,SAAA,CAAAF,SAAA,IAAG,CAAC,CAAC,CAE7C,GAAM,CAAAG,MAAM,CAAG,GAAI,CAAAC,eAAe,CAAAC,MAAA,CAAAC,MAAA,EAAGC,EAAE,CAAET,SAAS,EAAKC,gBAAgB,CAAE,CAAC,CAC1E,GAAM,CAAAS,GAAG,CAAG,GAAGC,2BAAgB,IAAIN,MAAM,CAACO,QAAQ,CAAC,CAAC,EAAE,CACtDC,oBAAO,CAACC,OAAO,CAACJ,GAAG,CAAC,CACtB,CAAC","ignoreList":[]}
@@ -25,5 +25,5 @@ Object.defineProperty(exports,"__esModule",{value:true});exports.getSystemInfo=e
25
25
  }
26
26
  getOSAndBrowser();
27
27
  true;
28
- `;};var getSystemInfo=exports.getSystemInfo=function getSystemInfo(webViewSystemInfo){return{platform:_reactNative.Platform.OS,os:webViewSystemInfo.os||_reactNative.Platform.OS,browser:webViewSystemInfo.browser||"WebView",sdk_version:_version.SDK_VERSION,device:getDeviceType(),screen_size:getScreenSize()};};
28
+ `;};var getSystemInfo=exports.getSystemInfo=function getSystemInfo(webViewSystemInfo){return{platform:_reactNative.Platform.OS,os:webViewSystemInfo.os||_reactNative.Platform.OS,browser:webViewSystemInfo.browser||"WebView",SDK_VERSION:_version.SDK_VERSION,device:getDeviceType(),screen_size:getScreenSize()};};
29
29
  //# sourceMappingURL=systemInfo.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_version","getDeviceType","_Dimensions$get","Dimensions","get","width","height","aspectRatio","Platform","OS","isPad","getScreenSize","Math","round","PixelRatio","getBrowserAndOSInfoScript","exports","getSystemInfo","webViewSystemInfo","platform","os","browser","sdk_version","SDK_VERSION","device","screen_size"],"sourceRoot":"../../../src","sources":["utils/systemInfo.ts"],"mappings":"wHAAA,IAAAA,YAAA,CAAAC,OAAA,iBACA,IAAAC,QAAA,CAAAD,OAAA,eAiBA,GAAM,CAAAE,aAAa,CAAG,QAAhB,CAAAA,aAAaA,CAAA,CAAiB,CAClC,IAAAC,eAAA,CAA0BC,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC,CAA1CC,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EAAIZ,qBAAQ,CAACC,EAAE,CACvCY,OAAO,CAAEH,iBAAiB,CAACG,OAAO,EAAI,SAAS,CAC/CC,WAAW,CAAEC,oBAAW,CACxBC,MAAM,CAAEvB,aAAa,CAAC,CAAC,CACvBwB,WAAW,CAAEd,aAAa,CAAC,CAC7B,CAAC,CACH,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_version","getDeviceType","_Dimensions$get","Dimensions","get","width","height","aspectRatio","Platform","OS","isPad","getScreenSize","Math","round","PixelRatio","getBrowserAndOSInfoScript","exports","getSystemInfo","webViewSystemInfo","platform","os","browser","SDK_VERSION","device","screen_size"],"sourceRoot":"../../../src","sources":["utils/systemInfo.ts"],"mappings":"wHAAA,IAAAA,YAAA,CAAAC,OAAA,iBACA,IAAAC,QAAA,CAAAD,OAAA,eAiBA,GAAM,CAAAE,aAAa,CAAG,QAAhB,CAAAA,aAAaA,CAAA,CAAiB,CAClC,IAAAC,eAAA,CAA0BC,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC,CAA1CC,KAAK,CAAAH,eAAA,CAALG,KAAK,CAAEC,MAAM,CAAAJ,eAAA,CAANI,MAAM,CACrB,GAAM,CAAAC,WAAW,CAAGD,MAAM,CAAGD,KAAK,CAElC,GAAIG,qBAAQ,CAACC,EAAE,GAAK,KAAK,CAAE,CACzB,MAAO,CAAAD,qBAAQ,CAACE,KAAK,CAAG,MAAM,CAAG,QAAQ,CAC3C,CAAC,IAAM,IAAIF,qBAAQ,CAACC,EAAE,GAAK,SAAS,CAAE,CACpC,MAAO,CAAAF,WAAW,CAAG,GAAG,CAAG,gBAAgB,CAAG,eAAe,CAC/D,CACA,MAAO,SAAS,CAClB,CAAC,CAGD,GAAM,CAAAI,aAAa,CAAG,QAAhB,CAAAA,aAAaA,CAAA,CAAqB,CACtC,MAAO,CACLN,KAAK,CAAEO,IAAI,CAACC,KAAK,CAACV,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC,CAACC,KAAK,CAAGS,uBAAU,CAACV,GAAG,CAAC,CAAC,CAAC,CACpEE,MAAM,CAAEM,IAAI,CAACC,KAAK,CAACV,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC,CAACE,MAAM,CAAGQ,uBAAU,CAACV,GAAG,CAAC,CAAC,CACvE,CAAC,CACH,CAAC,CAGM,GAAM,CAAAW,yBAAyB,CAAAC,OAAA,CAAAD,yBAAA,CAAG,QAA5B,CAAAA,yBAAyBA,CAAA,CAAiB,CACrD,MAAO;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,CACH,CAAC,CAGM,GAAM,CAAAE,aAAa,CAAAD,OAAA,CAAAC,aAAA,CAAG,QAAhB,CAAAA,aAAaA,CAAIC,iBAG7B,CAAiB,CAChB,MAAO,CACLC,QAAQ,CAAEX,qBAAQ,CAACC,EAAE,CACrBW,EAAE,CAAEF,iBAAiB,CAACE,EAAE,EAAIZ,qBAAQ,CAACC,EAAE,CACvCY,OAAO,CAAEH,iBAAiB,CAACG,OAAO,EAAI,SAAS,CAC/CC,WAAW,CAAXA,oBAAW,CACXC,MAAM,CAAEtB,aAAa,CAAC,CAAC,CACvBuB,WAAW,CAAEb,aAAa,CAAC,CAC7B,CAAC,CACH,CAAC","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;var SDK_VERSION=exports.SDK_VERSION='2.0.19-staging.33';
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;var SDK_VERSION=exports.SDK_VERSION='2.0.19-staging.35';
2
2
  //# sourceMappingURL=version.staging.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chatbotsdk.d.ts","sourceRoot":"","sources":["../../src/Chatbotsdk.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAA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AC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB,CAAC;IACF,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B;AAED,UAAU,oBAAqB,SAAQ,YAAY;IACjD,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;AAcD,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAujB3C,CAAC;AAmCF,eAAe,OAAO,CAAC"}
@@ -6,7 +6,7 @@ interface SystemInfo {
6
6
  platform: string;
7
7
  os: string;
8
8
  browser: string;
9
- sdk_version: string;
9
+ SDK_VERSION: string;
10
10
  device: string;
11
11
  screen_size: ScreenSize;
12
12
  }
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "2.0.19-staging.33";
1
+ export declare const SDK_VERSION = "2.0.19-staging.35";
2
2
  //# sourceMappingURL=version.staging.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robylon/react-native-sdk",
3
- "version": "2.0.19-staging.33",
3
+ "version": "2.0.19-staging.35",
4
4
  "description": "React Native SDK for Robylon",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -42,13 +42,13 @@
42
42
  "babel-plugin-transform-inline-environment-variables": "^0.4.4",
43
43
  "env-cmd": "^10.1.0",
44
44
  "husky": "^8.0.3",
45
- "metro-react-native-babel-preset": "^0.76.5",
46
45
  "react": "^18.0.0",
47
46
  "react-native": "^0.76.5",
48
47
  "react-native-builder-bob": "^0.20.0",
49
48
  "rimraf": "^6.0.1",
50
49
  "semver": "^7.5.4",
51
- "typescript": "^4.5.2"
50
+ "typescript": "^4.5.2",
51
+ "metro-react-native-babel-preset": "^0.76.5"
52
52
  },
53
53
  "react-native-builder-bob": {
54
54
  "source": "src",
@@ -82,8 +82,5 @@
82
82
  "commit-msg": "sh scripts/validate-branch-name.sh",
83
83
  "post-checkout": "node scripts/prevent-direct-branch.js"
84
84
  }
85
- },
86
- "dependencies": {
87
- "react-native-safe-area-context": "^5.1.0"
88
85
  }
89
86
  }
@@ -39,8 +39,6 @@ import {
39
39
  getStorageScript,
40
40
  createStorageMessage,
41
41
  } from "./utils/webViewStorage";
42
- import ChatbotWebView from "./components/ChatbotWebView";
43
- import { SafeAreaView } from "react-native-safe-area-context";
44
42
 
45
43
  export interface ChatbotProps {
46
44
  api_key: string;
@@ -387,7 +385,6 @@ const Chatbot: React.FC<InternalChatbotProps> = ({
387
385
  });
388
386
  console.log("BASE_CHATBOT_URL SDK_VERSION", BASE_CHATBOT_URL, SDK_VERSION);
389
387
  return `${BASE_CHATBOT_URL}?${params.toString()}`;
390
- // return "https://demo.robylon.ai/chat/public/RG5x9i1fvk/";
391
388
  }
392
389
 
393
390
  // Handle opening the chatbot
@@ -491,13 +488,6 @@ const Chatbot: React.FC<InternalChatbotProps> = ({
491
488
  // }
492
489
  // }, []);
493
490
 
494
- // Add userAgent configuration
495
- const userAgent = Platform.select({
496
- android:
497
- "Mozilla/5.0 (Linux; Android 10; Android SDK built for x86) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.120 Mobile Safari/537.36",
498
- ios: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1",
499
- });
500
-
501
491
  return (
502
492
  <ErrorBoundary componentName="ChatbotSDK">
503
493
  <View style={styles.mainContainer}>
@@ -517,99 +507,137 @@ const Chatbot: React.FC<InternalChatbotProps> = ({
517
507
  </ErrorBoundary>
518
508
  <View
519
509
  style={[
520
- // styles.webViewWrapper,
510
+ styles.webViewWrapper,
521
511
  { height: isWebViewVisible ? "100%" : 0 },
522
- // { height: "100%" },
523
512
  ]}
524
- // pointerEvents={isWebViewVisible ? "auto" : "none"}
525
- pointerEvents="auto"
513
+ pointerEvents={isWebViewVisible ? "auto" : "none"}
526
514
  >
527
- {/* <Animated.View
515
+ <Animated.View
528
516
  style={[styles.fullScreenContainer, { opacity: fadeAnim }]}
529
- > */}
530
- {/* <ErrorBoundary componentName="ChatbotWebView"> */}
531
- <ChatbotWebView
532
- ref={webViewRef}
533
- source={{ uri: constructUrl() }}
534
- onMessage={handleMessage}
535
- onDebugMessage={(message) => {
536
- console.log("WebView Debug:", message);
537
- }}
538
- style={styles.webview}
539
- // containerStyle={
540
- // isFullScreen
541
- // ? {
542
- // width: screenDimensions.width,
543
- // height: screenDimensions.height,
544
- // }
545
- // : undefined
546
- // }
547
- allowsInlineMediaPlayback={true}
548
- mediaPlaybackRequiresUserAction={false}
549
- allowFileAccess={false}
550
- geolocationEnabled={false}
551
- javaScriptEnabled={true}
552
- domStorageEnabled={true}
553
- cacheEnabled={true}
554
- scrollEnabled={true}
555
- bounces={false}
556
- onShouldStartLoadWithRequest={(request) => {
557
- // Allow navigation only to trusted domains
558
- const allowedDomains = [BASE_CHATBOT_URL, "about:blank"];
559
- return allowedDomains.some((domain) =>
560
- request.url.startsWith(domain)
561
- );
562
- }}
563
- startInLoadingState={isFirstLoadRef.current}
564
- onLoadEnd={() => {
565
- isFirstLoadRef.current = false;
566
- }}
567
- onError={(syntheticEvent) => {
568
- const { nativeEvent } = syntheticEvent;
569
- errorTracker.trackError(
570
- new Error(nativeEvent.description),
571
- "ChatbotWebView",
572
- {
573
- type: ErrorTypes.RUNTIME_ERROR,
574
- context: {
575
- url: nativeEvent.url,
576
- code: nativeEvent.code,
577
- },
517
+ >
518
+ <ErrorBoundary componentName="ChatbotWebView">
519
+ <WebView
520
+ ref={webViewRef}
521
+ source={{ uri: constructUrl() }}
522
+ onMessage={handleMessage}
523
+ style={styles.webview}
524
+ containerStyle={
525
+ isFullScreen
526
+ ? {
527
+ width: screenDimensions.width,
528
+ height: screenDimensions.height,
529
+ }
530
+ : undefined
578
531
  }
579
- );
580
- }}
581
- userAgent={userAgent}
582
- originWhitelist={["*"]}
583
- mixedContentMode="always"
584
- onContentProcessDidTerminate={() => {
585
- webViewRef.current?.reload();
586
- }}
587
- injectedJavaScriptBeforeContentLoaded={`
588
- window.onerror = function(message, source, lineno, colno, error) {
589
- window.ReactNativeWebView.postMessage(JSON.stringify({
590
- type: 'ERROR',
591
- data: {message, source, lineno, colno}
592
- }));
593
- return true;
594
- };
595
- true;
596
- `}
597
- androidLayerType="hardware"
598
- overScrollMode="never"
599
- textZoom={100}
600
- setSupportMultipleWindows={false}
601
- allowsBackForwardNavigationGestures={false}
602
- useWebKit={true}
603
- keyboardDisplayRequiresUserAction={false}
604
- hideKeyboardAccessoryView={true}
605
- applicationNameForUserAgent="ChatbotApp"
606
- />
607
- {/* </ErrorBoundary> */}
608
- {/* </Animated.View> */}
532
+ allowsInlineMediaPlayback={true}
533
+ mediaPlaybackRequiresUserAction={false}
534
+ allowFileAccess={false}
535
+ geolocationEnabled={false}
536
+ javaScriptEnabled={true}
537
+ domStorageEnabled={true}
538
+ cacheEnabled={true}
539
+ scrollEnabled={true}
540
+ bounces={false}
541
+ onShouldStartLoadWithRequest={(request) => {
542
+ return request.url.startsWith(BASE_CHATBOT_URL);
543
+ }}
544
+ startInLoadingState={isFirstLoadRef.current}
545
+ onLoadEnd={() => {
546
+ if (__DEV__) {
547
+ enableWebViewDebug(webViewRef);
548
+ }
549
+ webViewRef.current?.injectJavaScript(`
550
+ if (!document.querySelector('meta[name="viewport"]')) {
551
+ var meta = document.createElement('meta');
552
+ meta.name = 'viewport';
553
+ meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no';
554
+ document.getElementsByTagName('head')[0].appendChild(meta);
555
+ }
556
+
557
+ if (!document.querySelector('#injectedStyle')) {
558
+ const style = document.createElement('style');
559
+ style.id = 'injectedStyle';
560
+ style.textContent = \`
561
+ html, body, #root, #__next {
562
+ height: 100% !important;
563
+ min-height: 100% !important;
564
+ overflow: hidden !important;
565
+ }
566
+ \`;
567
+ document.head.appendChild(style);
568
+ }
569
+
570
+ window.sendToChatbot = function(message) {
571
+ window.ReactNativeWebView.postMessage(JSON.stringify(message));
572
+ };
573
+
574
+ // Only create observer if it doesn't exist
575
+ if (!window.closeButtonObserver) {
576
+ // Setup mutation observer to watch for close button
577
+ window.closeButtonObserver = new MutationObserver(function(mutations) {
578
+ const closeButton = document.querySelector('.chatbot-close-button');
579
+ if (closeButton && !closeButton.hasAttribute('listener-attached')) {
580
+ closeButton.setAttribute('listener-attached', 'true');
581
+ closeButton.addEventListener('click', () => {
582
+ try {
583
+ const message = { type: 'close_chatbot' };
584
+ window.ReactNativeWebView.postMessage(JSON.stringify(message));
585
+ } catch (error) {
586
+ console.error('Error sending close message:', error);
587
+ }
588
+ });
589
+ console.log('Close button listener attached');
590
+ }
591
+ });
592
+
593
+ // Start observing
594
+ window.closeButtonObserver.observe(document.body, {
595
+ childList: true,
596
+ subtree: true
597
+ });
598
+
599
+ // Initial check for existing button
600
+ const existingButton = document.querySelector('.chatbot-close-button');
601
+ if (existingButton && !existingButton.hasAttribute('listener-attached')) {
602
+ existingButton.setAttribute('listener-attached', 'true');
603
+ existingButton.addEventListener('click', () => {
604
+ try {
605
+ const message = { type: 'close_chatbot' };
606
+ window.ReactNativeWebView.postMessage(JSON.stringify(message));
607
+ } catch (error) {
608
+ console.error('Error sending close message:', error);
609
+ }
610
+ });
611
+ console.log('Close button listener attached to existing button');
612
+ }
613
+ }
614
+
615
+ true;
616
+ `);
617
+ isFirstLoadRef.current = false;
618
+ }}
619
+ onError={(syntheticEvent) => {
620
+ const { nativeEvent } = syntheticEvent;
621
+ errorTracker.trackError(
622
+ new Error(nativeEvent.description),
623
+ "ChatbotWebView",
624
+ {
625
+ type: ErrorTypes.RUNTIME_ERROR,
626
+ context: {
627
+ url: nativeEvent.url,
628
+ code: nativeEvent.code,
629
+ },
630
+ }
631
+ );
632
+ }}
633
+ />
634
+ </ErrorBoundary>
635
+ </Animated.View>
609
636
  </View>
610
637
  </>
611
638
  )}
612
639
  {/* <Toast message={toastMessage} visible={toastVisible} duration={10000} /> */}
640
+ {__DEV__ && <DebugButton />}
613
641
  </View>
614
642
  </ErrorBoundary>
615
643
  );
@@ -625,9 +653,9 @@ const styles = StyleSheet.create({
625
653
  top: 0,
626
654
  left: 0,
627
655
  right: 0,
628
- bottom: 0,
656
+ bottom: 10,
629
657
  overflow: "hidden",
630
- zIndex: 100,
658
+ zIndex: 1000,
631
659
  },
632
660
  fullScreenContainer: {
633
661
  position: "absolute",
@@ -636,7 +664,7 @@ const styles = StyleSheet.create({
636
664
  right: 0,
637
665
  bottom: 0,
638
666
  backgroundColor: "white",
639
- zIndex: 100,
667
+ zIndex: 1000,
640
668
  },
641
669
  inlineContainer: {
642
670
  flex: 1,
@@ -10,7 +10,7 @@ interface SystemInfo {
10
10
  platform: string;
11
11
  os: string;
12
12
  browser: string;
13
- sdk_version: string;
13
+ SDK_VERSION: string;
14
14
  device: string;
15
15
  screen_size: ScreenSize;
16
16
  }
@@ -77,7 +77,7 @@ export const getSystemInfo = (webViewSystemInfo: {
77
77
  platform: Platform.OS,
78
78
  os: webViewSystemInfo.os || Platform.OS,
79
79
  browser: webViewSystemInfo.browser || "WebView",
80
- sdk_version: SDK_VERSION,
80
+ SDK_VERSION,
81
81
  device: getDeviceType(),
82
82
  screen_size: getScreenSize(),
83
83
  };
@@ -1,2 +1,2 @@
1
1
  // This file is auto-generated. Do not modify it manually.
2
- export const SDK_VERSION = '2.0.19-staging.33';
2
+ export const SDK_VERSION = '2.0.19-staging.35';
@@ -1,29 +0,0 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeWebview=require("react-native-webview");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onDebugMessage"];var _this=this,_jsxFileName="/Users/jobinabraham/Developer/personal/robylon-react-native-sdk/src/components/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 ChatbotWebView=(0,_react.forwardRef)(function(props,ref){var onDebugMessage=props.onDebugMessage,restProps=(0,_objectWithoutProperties2.default)(props,_excluded);var defaultInjectedJavaScript=`
2
- // Set viewport
3
- const meta = document.createElement('meta');
4
- meta.name = 'viewport';
5
- meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover';
6
- document.head.appendChild(meta);
7
-
8
- // Basic touch handling
9
- document.documentElement.style.webkitTouchCallout = 'none';
10
- document.documentElement.style.webkitUserSelect = 'none';
11
- document.documentElement.style.userSelect = 'none';
12
-
13
- // Make all interactive elements clickable
14
- const style = document.createElement('style');
15
- style.textContent = \`
16
- * { touch-action: manipulation; }
17
- button, [role="button"], a, input, select, textarea {
18
- cursor: pointer !important;
19
- -webkit-tap-highlight-color: transparent;
20
- }
21
- \`;
22
- document.head.appendChild(style);
23
-
24
- true;
25
- `;return(0,_jsxRuntime.jsx)(_reactNativeWebview.WebView,Object.assign({ref:ref},restProps,{injectedJavaScript:`
26
- ${defaultInjectedJavaScript}
27
- ${props.injectedJavaScript||""}
28
- `,onMessage:props.onMessage,style:[{opacity:0.99},props.style],bounces:false,showsHorizontalScrollIndicator:false,showsVerticalScrollIndicator:false,scalesPageToFit:_reactNative.Platform.OS==="android",automaticallyAdjustContentInsets:false,contentInsetAdjustmentBehavior:"never",decelerationRate:"normal",javaScriptEnabled:true,domStorageEnabled:true,scrollEnabled:true,directionalLockEnabled:true}));});var _default=exports.default=ChatbotWebView;
29
- //# sourceMappingURL=ChatbotWebView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_jsxRuntime","_excluded","_this","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ChatbotWebView","forwardRef","props","ref","onDebugMessage","restProps","_objectWithoutProperties2","defaultInjectedJavaScript","jsx","WebView","assign","injectedJavaScript","onMessage","style","opacity","bounces","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","scalesPageToFit","Platform","OS","automaticallyAdjustContentInsets","contentInsetAdjustmentBehavior","decelerationRate","javaScriptEnabled","domStorageEnabled","scrollEnabled","directionalLockEnabled","_default","exports"],"sourceRoot":"../../../src","sources":["components/ChatbotWebView.tsx"],"mappings":"mRAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBACA,IAAAE,mBAAA,CAAAF,OAAA,yBAA6D,IAAAG,WAAA,CAAAH,OAAA,0BAAAI,SAAA,wBAAAC,KAAA,MAAAC,YAAA,8GAAAC,yBAAAC,CAAA,wBAAAC,OAAA,iBAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,O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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAED,MACE,GAAA/B,WAAA,CAAAgC,GAAA,EAACjC,mBAAA,CAAAkC,OAAO,CAAAjB,MAAA,CAAAkB,MAAA,EACNP,GAAG,CAAEA,GAAI,EACLE,SAAS,EACbM,kBAAkB,CAAE;AAC5B,YAAYJ,yBAAyB;AACrC,YAAYL,KAAK,CAACS,kBAAkB,EAAI,EAAE;AAC1C,SAAU,CACFC,SAAS,CAAEV,KAAK,CAACU,SAAU,CAC3BC,KAAK,CAAE,CAAC,CAAEC,OAAO,CAAE,IAAK,CAAC,CAAEZ,KAAK,CAACW,KAAK,CAAE,CACxCE,OAAO,CAAE,KAAM,CACfC,8BAA8B,CAAE,KAAM,CACtCC,4BAA4B,CAAE,KAAM,CACpCC,eAAe,CAAEC,qBAAQ,CAACC,EAAE,GAAK,SAAU,CAC3CC,gCAAgC,CAAE,KAAM,CACxCC,8BAA8B,CAAC,OAAO,CACtCC,gBAAgB,CAAC,QAAQ,CACzBC,iBAAiB,CAAE,IAAK,CACxBC,iBAAiB,CAAE,IAAK,CACxBC,aAAa,CAAE,IAAK,CACpBC,sBAAsB,CAAE,IAAK,EAC9B,CAAC,CAEN,CACF,CAAC,CAAC,IAAAC,QAAA,CAAAC,OAAA,CAAA3C,OAAA,CAEac,cAAc","ignoreList":[]}
@@ -1,29 +0,0 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeWebview=require("react-native-webview");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onDebugMessage"];var _this=this,_jsxFileName="/Users/jobinabraham/Developer/personal/robylon-react-native-sdk/src/components/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 ChatbotWebView=(0,_react.forwardRef)(function(props,ref){var onDebugMessage=props.onDebugMessage,restProps=(0,_objectWithoutProperties2.default)(props,_excluded);var defaultInjectedJavaScript=`
2
- // Set viewport
3
- const meta = document.createElement('meta');
4
- meta.name = 'viewport';
5
- meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover';
6
- document.head.appendChild(meta);
7
-
8
- // Basic touch handling
9
- document.documentElement.style.webkitTouchCallout = 'none';
10
- document.documentElement.style.webkitUserSelect = 'none';
11
- document.documentElement.style.userSelect = 'none';
12
-
13
- // Make all interactive elements clickable
14
- const style = document.createElement('style');
15
- style.textContent = \`
16
- * { touch-action: manipulation; }
17
- button, [role="button"], a, input, select, textarea {
18
- cursor: pointer !important;
19
- -webkit-tap-highlight-color: transparent;
20
- }
21
- \`;
22
- document.head.appendChild(style);
23
-
24
- true;
25
- `;return(0,_jsxRuntime.jsx)(_reactNativeWebview.WebView,Object.assign({ref:ref},restProps,{injectedJavaScript:`
26
- ${defaultInjectedJavaScript}
27
- ${props.injectedJavaScript||""}
28
- `,onMessage:props.onMessage,style:[{opacity:0.99},props.style],bounces:false,showsHorizontalScrollIndicator:false,showsVerticalScrollIndicator:false,scalesPageToFit:_reactNative.Platform.OS==="android",automaticallyAdjustContentInsets:false,contentInsetAdjustmentBehavior:"never",decelerationRate:"normal",javaScriptEnabled:true,domStorageEnabled:true,scrollEnabled:true,directionalLockEnabled:true}));});var _default=exports.default=ChatbotWebView;
29
- //# sourceMappingURL=ChatbotWebView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_jsxRuntime","_excluded","_this","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ChatbotWebView","forwardRef","props","ref","onDebugMessage","restProps","_objectWithoutProperties2","defaultInjectedJavaScript","jsx","WebView","assign","injectedJavaScript","onMessage","style","opacity","bounces","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","scalesPageToFit","Platform","OS","automaticallyAdjustContentInsets","contentInsetAdjustmentBehavior","decelerationRate","javaScriptEnabled","domStorageEnabled","scrollEnabled","directionalLockEnabled","_default","exports"],"sourceRoot":"../../../src","sources":["components/ChatbotWebView.tsx"],"mappings":"mRAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBACA,IAAAE,mBAAA,CAAAF,OAAA,yBAA6D,IAAAG,WAAA,CAAAH,OAAA,0BAAAI,SAAA,wBAAAC,KAAA,MAAAC,YAAA,8GAAAC,yBAAAC,CAAA,wBAAAC,OAAA,iBAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAF,wBAAA,UAAAA,yBAAAC,CAAA,SAAAA,CAAA,CAAAG,CAAA,CAAAD,CAAA,IAAAF,CAAA,YAAAT,wBAAAS,CAAA,CAAAE,CAAA,MAAAA,CAAA,EAAAF,CAAA,EAAAA,CAAA,CAAAI,UAAA,QAAAJ,CAAA,WAAAA,CAAA,mBAAAA,CAAA,qBAAAA,CAAA,QAAAK,OAAA,CAAAL,CAAA,M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E;AAC5B,YAAYJ,yBAAyB;AACrC,YAAYL,KAAK,CAACS,kBAAkB,EAAI,EAAE;AAC1C,SAAU,CACFC,SAAS,CAAEV,KAAK,CAACU,SAAU,CAC3BC,KAAK,CAAE,CAAC,CAAEC,OAAO,CAAE,IAAK,CAAC,CAAEZ,KAAK,CAACW,KAAK,CAAE,CACxCE,OAAO,CAAE,KAAM,CACfC,8BAA8B,CAAE,KAAM,CACtCC,4BAA4B,CAAE,KAAM,CACpCC,eAAe,CAAEC,qBAAQ,CAACC,EAAE,GAAK,SAAU,CAC3CC,gCAAgC,CAAE,KAAM,CACxCC,8BAA8B,CAAC,OAAO,CACtCC,gBAAgB,CAAC,QAAQ,CACzBC,iBAAiB,CAAE,IAAK,CACxBC,iBAAiB,CAAE,IAAK,CACxBC,aAAa,CAAE,IAAK,CACpBC,sBAAsB,CAAE,IAAK,EAC9B,CAAC,CAEN,CACF,CAAC,CAAC,IAAAC,QAAA,CAAAC,OAAA,CAAA3C,OAAA,CAEac,cAAc","ignoreList":[]}
@@ -1,17 +0,0 @@
1
- import React from "react";
2
- import { WebView, WebViewProps } from "react-native-webview";
3
- interface ChatbotWebViewProps extends WebViewProps {
4
- onDebugMessage?: (message: string) => void;
5
- useWebKit?: boolean;
6
- keyboardDisplayRequiresUserAction?: boolean;
7
- hideKeyboardAccessoryView?: boolean;
8
- applicationNameForUserAgent?: string;
9
- textZoom?: number;
10
- androidLayerType?: "none" | "software" | "hardware";
11
- setSupportMultipleWindows?: boolean;
12
- overScrollMode?: "always" | "content" | "never";
13
- directionalLockEnabled?: boolean;
14
- }
15
- declare const ChatbotWebView: React.ForwardRefExoticComponent<ChatbotWebViewProps & React.RefAttributes<WebView<{}>>>;
16
- export default ChatbotWebView;
17
- //# sourceMappingURL=ChatbotWebView.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChatbotWebView.d.ts","sourceRoot":"","sources":["../../../src/components/ChatbotWebView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE7D,UAAU,mBAAoB,SAAQ,YAAY;IAChD,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iCAAiC,CAAC,EAAE,OAAO,CAAC;IAC5C,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;IACpD,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,cAAc,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;IAChD,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,QAAA,MAAM,cAAc,yFAsDnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,74 +0,0 @@
1
- import React, { forwardRef } from "react";
2
- import { Platform } from "react-native";
3
- import { WebView, WebViewProps } from "react-native-webview";
4
-
5
- interface ChatbotWebViewProps extends WebViewProps {
6
- onDebugMessage?: (message: string) => void;
7
- useWebKit?: boolean;
8
- keyboardDisplayRequiresUserAction?: boolean;
9
- hideKeyboardAccessoryView?: boolean;
10
- applicationNameForUserAgent?: string;
11
- textZoom?: number;
12
- androidLayerType?: "none" | "software" | "hardware";
13
- setSupportMultipleWindows?: boolean;
14
- overScrollMode?: "always" | "content" | "never";
15
- directionalLockEnabled?: boolean;
16
- }
17
-
18
- const ChatbotWebView = forwardRef<WebView, ChatbotWebViewProps>(
19
- (props, ref) => {
20
- const { onDebugMessage, ...restProps } = props;
21
-
22
- const defaultInjectedJavaScript = `
23
- // Set viewport
24
- const meta = document.createElement('meta');
25
- meta.name = 'viewport';
26
- meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover';
27
- document.head.appendChild(meta);
28
-
29
- // Basic touch handling
30
- document.documentElement.style.webkitTouchCallout = 'none';
31
- document.documentElement.style.webkitUserSelect = 'none';
32
- document.documentElement.style.userSelect = 'none';
33
-
34
- // Make all interactive elements clickable
35
- const style = document.createElement('style');
36
- style.textContent = \`
37
- * { touch-action: manipulation; }
38
- button, [role="button"], a, input, select, textarea {
39
- cursor: pointer !important;
40
- -webkit-tap-highlight-color: transparent;
41
- }
42
- \`;
43
- document.head.appendChild(style);
44
-
45
- true;
46
- `;
47
-
48
- return (
49
- <WebView
50
- ref={ref}
51
- {...restProps}
52
- injectedJavaScript={`
53
- ${defaultInjectedJavaScript}
54
- ${props.injectedJavaScript || ""}
55
- `}
56
- onMessage={props.onMessage}
57
- style={[{ opacity: 0.99 }, props.style]}
58
- bounces={false}
59
- showsHorizontalScrollIndicator={false}
60
- showsVerticalScrollIndicator={false}
61
- scalesPageToFit={Platform.OS === "android"}
62
- automaticallyAdjustContentInsets={false}
63
- contentInsetAdjustmentBehavior="never"
64
- decelerationRate="normal"
65
- javaScriptEnabled={true}
66
- domStorageEnabled={true}
67
- scrollEnabled={true}
68
- directionalLockEnabled={true}
69
- />
70
- );
71
- }
72
- );
73
-
74
- export default ChatbotWebView;