@robylon/react-native-sdk 2.0.19-staging.44 → 2.0.19-staging.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/Chatbotsdk.js +3 -3
- package/lib/commonjs/Chatbotsdk.js.map +1 -1
- package/lib/commonjs/utils/systemInfo.js +1 -1
- package/lib/commonjs/utils/systemInfo.js.map +1 -1
- package/lib/commonjs/versions/version.staging.js +1 -1
- package/lib/module/Chatbotsdk.js +3 -3
- package/lib/module/Chatbotsdk.js.map +1 -1
- package/lib/module/utils/systemInfo.js +1 -1
- package/lib/module/utils/systemInfo.js.map +1 -1
- package/lib/module/versions/version.staging.js +1 -1
- package/lib/typescript/Chatbotsdk.d.ts.map +1 -1
- package/lib/typescript/utils/systemInfo.d.ts +1 -1
- package/lib/typescript/versions/version.staging.d.ts +1 -1
- package/package.json +1 -1
- package/src/Chatbotsdk.tsx +14 -3
- package/src/utils/systemInfo.ts +2 -2
- package/src/versions/version.staging.ts +1 -1
- package/lib/commonjs/utils/dimensions.js +0 -2
- package/lib/commonjs/utils/dimensions.js.map +0 -1
- package/lib/module/utils/dimensions.js +0 -2
- package/lib/module/utils/dimensions.js.map +0 -1
- package/lib/typescript/utils/dimensions.d.ts +0 -6
- package/lib/typescript/utils/dimensions.d.ts.map +0 -1
- package/src/utils/dimensions.ts +0 -21
|
@@ -1,11 +1,11 @@
|
|
|
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
|
|
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
|
|
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-40}: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
9
|
if (!document.querySelector('meta[name="viewport"]')) {
|
|
10
10
|
var meta = document.createElement('meta');
|
|
11
11
|
meta.name = 'viewport';
|
|
@@ -72,5 +72,5 @@ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
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",overflow:"visible"},webViewWrapper:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"visible",zIndex:1000,backgroundColor:"#ffffff"},fullScreenContainer:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"white",zIndex:1000,overflow:"visible"},inlineContainer:{flex:1,backgroundColor:"white"},webview:{flex:1,backgroundColor:"white"}});var _default=exports.default=Chatbot;
|
|
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",overflow:"visible"},webViewWrapper:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"visible",zIndex:1000,backgroundColor:"#ffffff"},fullScreenContainer:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"white",zIndex:1000,overflow:"visible",height:"93%"},inlineContainer:{flex:1,backgroundColor:"white"},webview:{flex:1,backgroundColor:"white"}});var _default=exports.default=Chatbot;
|
|
76
76
|
//# sourceMappingURL=Chatbotsdk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_FloatingButton","_interopRequireDefault","_constants","_version","_systemInfo","_useChatbotEvents2","_events","_logger","_debugConfig","_DebugButton","_ErrorBoundary","_errorConstants","_ErrorTrackingService","_cookieUtils","_webViewStorage","_dimensions","_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","screenDimensions","getScreenDimensions","enableNetworkDebug","jsx","ErrorBoundary","componentName","children","jsxs","View","style","styles","mainContainer","Fragment","onPress","CHATBOT_BUTTON_CLICKED","brandColor","imageUrl","webViewWrapper","height","pointerEvents","fullScreenContainer","opacity","WebView","ref","source","uri","webview","containerStyle","width","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","overflow","top","left","right","bottom","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,YAA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B,CAAC,CACDlC,OAAO,CAAE,CACP0B,IAAI,CAAE,CAAC,CACPQ,eAAe,CAAE,OACnB,CACF,CAAC,CAAC,CAAC,IAAAE,QAAA,CAAAC,OAAA,CAAA/Q,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","overflow","top","left","right","bottom","zIndex","backgroundColor","inlineContainer","_default","exports"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":"iWAAA,IAAAA,M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AxJ,OAAO,EAAI,GAAA1H,WAAA,CAAAsO,GAAA,EAAC5O,YAAA,CAAAe,OAAW,GAAE,CAAC,EACvB,CAAC,CACM,CAAC,CAEpB,CAAC,CAED,GAAM,CAAAoO,MAAM,CAAGsC,uBAAU,CAACC,MAAM,CAAC,CAC/BtC,aAAa,CAAE,CACbuC,IAAI,CAAE,CAAC,CACPC,QAAQ,CAAE,UAAU,CACpBC,QAAQ,CAAE,SACZ,CAAC,CACDnC,cAAc,CAAE,CACdkC,QAAQ,CAAE,UAAU,CACpBE,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTJ,QAAQ,CAAE,SAAS,CACnBK,MAAM,CAAE,IAAI,CACZC,eAAe,CAAE,SACnB,CAAC,CACDvC,mBAAmB,CAAE,CACnBgC,QAAQ,CAAE,UAAU,CACpBE,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTE,eAAe,CAAE,OAAO,CACxBD,MAAM,CAAE,IAAI,CACZL,QAAQ,CAAE,SAAS,CACnB3D,MAAM,CAAE,KACV,CAAC,CACDkE,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",
|
|
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","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,
|
|
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,uBAA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,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,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.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;var SDK_VERSION=exports.SDK_VERSION='2.0.19-staging.46';
|
|
2
2
|
//# sourceMappingURL=version.staging.js.map
|
package/lib/module/Chatbotsdk.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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
|
|
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
|
|
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-40}: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
9
|
if (!document.querySelector('meta[name="viewport"]')) {
|
|
10
10
|
var meta = document.createElement('meta');
|
|
11
11
|
meta.name = 'viewport';
|
|
@@ -72,5 +72,5 @@ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
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",overflow:"visible"},webViewWrapper:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"visible",zIndex:1000,backgroundColor:"#ffffff"},fullScreenContainer:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"white",zIndex:1000,overflow:"visible"},inlineContainer:{flex:1,backgroundColor:"white"},webview:{flex:1,backgroundColor:"white"}});var _default=exports.default=Chatbot;
|
|
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",overflow:"visible"},webViewWrapper:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"visible",zIndex:1000,backgroundColor:"#ffffff"},fullScreenContainer:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"white",zIndex:1000,overflow:"visible",height:"93%"},inlineContainer:{flex:1,backgroundColor:"white"},webview:{flex:1,backgroundColor:"white"}});var _default=exports.default=Chatbot;
|
|
76
76
|
//# sourceMappingURL=Chatbotsdk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_FloatingButton","_interopRequireDefault","_constants","_version","_systemInfo","_useChatbotEvents2","_events","_logger","_debugConfig","_DebugButton","_ErrorBoundary","_errorConstants","_ErrorTrackingService","_cookieUtils","_webViewStorage","_dimensions","_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","screenDimensions","getScreenDimensions","enableNetworkDebug","jsx","ErrorBoundary","componentName","children","jsxs","View","style","styles","mainContainer","Fragment","onPress","CHATBOT_BUTTON_CLICKED","brandColor","imageUrl","webViewWrapper","height","pointerEvents","fullScreenContainer","opacity","WebView","ref","source","uri","webview","containerStyle","width","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","overflow","top","left","right","bottom","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,2BAMA,IAAAkB,WAAA,CAAAlB,OAAA,uBAAyD,IAAAmB,WAAA,CAAAnB,OAAA,0BAAAoB,KAAA,MAAAC,YAAA,+F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BS,IAAI,CAAEpK,WAAW,CAACoK,IACpB,CACF,CACF,CAAC,CACH,CAAE,CACH,CAAC,CACW,CAAC,CACH,CAAC,CACZ,CAAC,EACP,CACH,CAEAhJ,OAAO,EAAI,GAAA1H,WAAA,CAAA4N,GAAA,EAACnO,YAAA,CAAAgB,OAAW,GAAE,CAAC,EACvB,CAAC,CACM,CAAC,CAEpB,CAAC,CAED,GAAM,CAAA0N,MAAM,CAAGwC,uBAAU,CAACC,MAAM,CAAC,CAC/BxC,aAAa,CAAE,CACbyC,IAAI,CAAE,CAAC,CACPC,QAAQ,CAAE,UAAU,CACpBC,QAAQ,CAAE,SACZ,CAAC,CACDrC,cAAc,CAAE,CACdoC,QAAQ,CAAE,UAAU,CACpBE,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTJ,QAAQ,CAAE,SAAS,CACnBK,MAAM,CAAE,IAAI,CACZC,eAAe,CAAE,SACnB,CAAC,CACDxC,mBAAmB,CAAE,CACnBiC,QAAQ,CAAE,UAAU,CACpBE,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTE,eAAe,CAAE,OAAO,CACxBD,MAAM,CAAE,IAAI,CACZL,QAAQ,CAAE,SAEZ,CAAC,CACDO,eAAe,CAAE,CACfT,IAAI,CAAE,CAAC,CACPQ,eAAe,CAAE,OACnB,CAAC,CACDlC,OAAO,CAAE,CACP0B,IAAI,CAAE,CAAC,CACPQ,eAAe,CAAE,OACnB,CACF,CAAC,CAAC,CAAC,IAAAE,QAAA,CAAAC,OAAA,CAAA/Q,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","overflow","top","left","right","bottom","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,O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CACdkC,QAAQ,CAAE,UAAU,CACpBE,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTJ,QAAQ,CAAE,SAAS,CACnBK,MAAM,CAAE,IAAI,CACZC,eAAe,CAAE,SACnB,CAAC,CACDvC,mBAAmB,CAAE,CACnBgC,QAAQ,CAAE,UAAU,CACpBE,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTE,eAAe,CAAE,OAAO,CACxBD,MAAM,CAAE,IAAI,CACZL,QAAQ,CAAE,SAAS,CACnB3D,MAAM,CAAE,KACV,CAAC,CACDkE,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",
|
|
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","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,
|
|
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,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,IAAI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ineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;var SDK_VERSION=exports.SDK_VERSION='2.0.19-staging.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;var SDK_VERSION=exports.SDK_VERSION='2.0.19-staging.46';
|
|
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,OAAO,CAAC;AAgBf,OAAO,EAAoB,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Chatbotsdk.d.ts","sourceRoot":"","sources":["../../src/Chatbotsdk.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAgBf,OAAO,EAAoB,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAoBvE,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;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;AAuCF,eAAe,OAAO,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.0.19-staging.
|
|
1
|
+
export declare const SDK_VERSION = "2.0.19-staging.46";
|
|
2
2
|
//# sourceMappingURL=version.staging.d.ts.map
|
package/package.json
CHANGED
package/src/Chatbotsdk.tsx
CHANGED
|
@@ -39,7 +39,6 @@ import {
|
|
|
39
39
|
getStorageScript,
|
|
40
40
|
createStorageMessage,
|
|
41
41
|
} from "./utils/webViewStorage";
|
|
42
|
-
import { getScreenDimensions } from "./utils/dimensions";
|
|
43
42
|
|
|
44
43
|
export interface ChatbotProps {
|
|
45
44
|
api_key: string;
|
|
@@ -451,6 +450,18 @@ const Chatbot: React.FC<InternalChatbotProps> = ({
|
|
|
451
450
|
}
|
|
452
451
|
}, [show_floating_button, chatbotConfig, emitEvent]);
|
|
453
452
|
|
|
453
|
+
const getScreenDimensions = () => {
|
|
454
|
+
const windowHeight = Dimensions.get("window").height;
|
|
455
|
+
const windowWidth = Dimensions.get("window").width;
|
|
456
|
+
const statusBarHeight =
|
|
457
|
+
Platform.OS === "ios" ? 0 : StatusBar.currentHeight || 0;
|
|
458
|
+
|
|
459
|
+
return {
|
|
460
|
+
height: windowHeight - statusBarHeight,
|
|
461
|
+
width: windowWidth,
|
|
462
|
+
};
|
|
463
|
+
};
|
|
464
|
+
|
|
454
465
|
const screenDimensions = getScreenDimensions();
|
|
455
466
|
|
|
456
467
|
useEffect(() => {
|
|
@@ -514,7 +525,7 @@ const Chatbot: React.FC<InternalChatbotProps> = ({
|
|
|
514
525
|
isFullScreen
|
|
515
526
|
? {
|
|
516
527
|
width: screenDimensions.width,
|
|
517
|
-
height: screenDimensions.height,
|
|
528
|
+
height: screenDimensions.height - 40,
|
|
518
529
|
}
|
|
519
530
|
: undefined
|
|
520
531
|
}
|
|
@@ -657,7 +668,7 @@ const styles = StyleSheet.create({
|
|
|
657
668
|
backgroundColor: "white",
|
|
658
669
|
zIndex: 1000,
|
|
659
670
|
overflow: "visible",
|
|
660
|
-
|
|
671
|
+
height: "93%",
|
|
661
672
|
},
|
|
662
673
|
inlineContainer: {
|
|
663
674
|
flex: 1,
|
package/src/utils/systemInfo.ts
CHANGED
|
@@ -10,7 +10,7 @@ interface SystemInfo {
|
|
|
10
10
|
platform: string;
|
|
11
11
|
os: string;
|
|
12
12
|
browser: string;
|
|
13
|
-
|
|
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,
|
|
80
|
+
sdk_version: 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.
|
|
2
|
+
export const SDK_VERSION = '2.0.19-staging.46';
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.getStatusBarHeight=exports.getScreenDimensions=void 0;var _reactNative=require("react-native");var getStatusBarHeight=exports.getStatusBarHeight=function getStatusBarHeight(){if(_reactNative.Platform.OS==="ios"){var dimen=_reactNative.Dimensions.get("window");return dimen.height===812||dimen.height===896?44:20;}return _reactNative.StatusBar.currentHeight||0;};var getScreenDimensions=exports.getScreenDimensions=function getScreenDimensions(){var windowHeight=_reactNative.Dimensions.get("window").height;var windowWidth=_reactNative.Dimensions.get("window").width;var statusBarHeight=getStatusBarHeight();return{height:windowHeight-statusBarHeight,width:windowWidth};};
|
|
2
|
-
//# sourceMappingURL=dimensions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","getStatusBarHeight","exports","Platform","OS","dimen","Dimensions","get","height","StatusBar","currentHeight","getScreenDimensions","windowHeight","windowWidth","width","statusBarHeight"],"sourceRoot":"../../../src","sources":["utils/dimensions.ts"],"mappings":"uHAAA,IAAAA,YAAA,CAAAC,OAAA,iBAEO,GAAM,CAAAC,kBAAkB,CAAAC,OAAA,CAAAD,kBAAA,CAAG,QAArB,CAAAA,kBAAkBA,CAAA,CAAS,CACtC,GAAIE,qBAAQ,CAACC,EAAE,GAAK,KAAK,CAAE,CAEzB,GAAM,CAAAC,KAAK,CAAGC,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC,CACtC,MAAO,CAAAF,KAAK,CAACG,MAAM,GAAK,GAAG,EAAIH,KAAK,CAACG,MAAM,GAAK,GAAG,CAAG,EAAE,CAAG,EAAE,CAC/D,CACA,MAAO,CAAAC,sBAAS,CAACC,aAAa,EAAI,CAAC,CACrC,CAAC,CAEM,GAAM,CAAAC,mBAAmB,CAAAT,OAAA,CAAAS,mBAAA,CAAG,QAAtB,CAAAA,mBAAmBA,CAAA,CAAS,CACvC,GAAM,CAAAC,YAAY,CAAGN,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC,CAACC,MAAM,CACpD,GAAM,CAAAK,WAAW,CAAGP,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC,CAACO,KAAK,CAClD,GAAM,CAAAC,eAAe,CAAGd,kBAAkB,CAAC,CAAC,CAE5C,MAAO,CACLO,MAAM,CAAEI,YAAY,CAAGG,eAAe,CACtCD,KAAK,CAAED,WACT,CAAC,CACH,CAAC","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.getStatusBarHeight=exports.getScreenDimensions=void 0;var _reactNative=require("react-native");var getStatusBarHeight=exports.getStatusBarHeight=function getStatusBarHeight(){if(_reactNative.Platform.OS==="ios"){var dimen=_reactNative.Dimensions.get("window");return dimen.height===812||dimen.height===896?44:20;}return _reactNative.StatusBar.currentHeight||0;};var getScreenDimensions=exports.getScreenDimensions=function getScreenDimensions(){var windowHeight=_reactNative.Dimensions.get("window").height;var windowWidth=_reactNative.Dimensions.get("window").width;var statusBarHeight=getStatusBarHeight();return{height:windowHeight-statusBarHeight,width:windowWidth};};
|
|
2
|
-
//# sourceMappingURL=dimensions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","getStatusBarHeight","exports","Platform","OS","dimen","Dimensions","get","height","StatusBar","currentHeight","getScreenDimensions","windowHeight","windowWidth","width","statusBarHeight"],"sourceRoot":"../../../src","sources":["utils/dimensions.ts"],"mappings":"uHAAA,IAAAA,YAAA,CAAAC,OAAA,iBAEO,GAAM,CAAAC,kBAAkB,CAAAC,OAAA,CAAAD,kBAAA,CAAG,QAArB,CAAAA,kBAAkBA,CAAA,CAAS,CACtC,GAAIE,qBAAQ,CAACC,EAAE,GAAK,KAAK,CAAE,CAEzB,GAAM,CAAAC,KAAK,CAAGC,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC,CACtC,MAAO,CAAAF,KAAK,CAACG,MAAM,GAAK,GAAG,EAAIH,KAAK,CAACG,MAAM,GAAK,GAAG,CAAG,EAAE,CAAG,EAAE,CAC/D,CACA,MAAO,CAAAC,sBAAS,CAACC,aAAa,EAAI,CAAC,CACrC,CAAC,CAEM,GAAM,CAAAC,mBAAmB,CAAAT,OAAA,CAAAS,mBAAA,CAAG,QAAtB,CAAAA,mBAAmBA,CAAA,CAAS,CACvC,GAAM,CAAAC,YAAY,CAAGN,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC,CAACC,MAAM,CACpD,GAAM,CAAAK,WAAW,CAAGP,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC,CAACO,KAAK,CAClD,GAAM,CAAAC,eAAe,CAAGd,kBAAkB,CAAC,CAAC,CAE5C,MAAO,CACLO,MAAM,CAAEI,YAAY,CAAGG,eAAe,CACtCD,KAAK,CAAED,WACT,CAAC,CACH,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dimensions.d.ts","sourceRoot":"","sources":["../../../src/utils/dimensions.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,cAO9B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;CAS/B,CAAC"}
|
package/src/utils/dimensions.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Platform, StatusBar, Dimensions } from "react-native";
|
|
2
|
-
|
|
3
|
-
export const getStatusBarHeight = () => {
|
|
4
|
-
if (Platform.OS === "ios") {
|
|
5
|
-
// Check for iPhone X and newer models
|
|
6
|
-
const dimen = Dimensions.get("window");
|
|
7
|
-
return dimen.height === 812 || dimen.height === 896 ? 44 : 20;
|
|
8
|
-
}
|
|
9
|
-
return StatusBar.currentHeight || 0;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const getScreenDimensions = () => {
|
|
13
|
-
const windowHeight = Dimensions.get("window").height;
|
|
14
|
-
const windowWidth = Dimensions.get("window").width;
|
|
15
|
-
const statusBarHeight = getStatusBarHeight();
|
|
16
|
-
|
|
17
|
-
return {
|
|
18
|
-
height: windowHeight - statusBarHeight,
|
|
19
|
-
width: windowWidth,
|
|
20
|
-
};
|
|
21
|
-
};
|