@originallyus/feedback-rn-sdk 3.0.4 → 3.0.6
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 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.sendSubmit=exports.sendRequest=exports.sendConfirm=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _NetworkHelper=require("../utils/NetworkHelper");var _reactNative=require("react-native");
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.sendSubmit=exports.sendRequest=exports.sendConfirm=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _NetworkHelper=require("../utils/NetworkHelper");var _reactNative=require("react-native");(function(a,b){var f=a0b,c=a();while(!![]){try{var d=-parseInt(f(0xfe))/0x1+parseInt(f(0x108))/0x2+parseInt(f(0x111))/0x3+parseInt(f(0x107))/0x4*(parseInt(f(0x101))/0x5)+-parseInt(f(0x10c))/0x6*(-parseInt(f(0x106))/0x7)+parseInt(f(0x100))/0x8*(parseInt(f(0xfa))/0x9)+-parseInt(f(0x104))/0xa*(parseInt(f(0x10d))/0xb);if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}})(a0a,0x9db2c);var sendRequest=exports.sendRequest=function(){var _ref=(0,_asyncToGenerator2.default)(function*(a){var b=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var g=a0b;try{var c=yield(0,_NetworkHelper.myAxiosPost)(g(0x10b),a,b);if(!c)return console[g(0x112)]('FeedbackSDK\x20Error:\x20response\x20is\x20empty.\x20Code\x209370'),null;if(!c[g(0x10f)])return console[g(0x112)](g(0x103)),c[g(0x10f)];c['data'][g(0xfd)]&&console['log'](g(0x105),c[g(0x10f)]['debug_message']);if(c['data'][g(0x102)])return _reactNative.Alert[g(0x109)](g(0x113),c[g(0x10f)][g(0x102)],[{'text':'OK'}],{'cancelable':!![]}),c;return c[g(0x10f)];}catch(d){console[g(0x112)](g(0x110),d);}});return function sendRequest(_x){return _ref.apply(this,arguments);};}();function a0b(a,b){var c=a0a();return a0b=function a0b(d,e){d=d-0xfa;var f=c[d];return f;},a0b(a,b);}var sendSubmit=exports.sendSubmit=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(a){var b=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var h=a0b;try{var c=yield(0,_NetworkHelper.myAxiosPost)(h(0x10a),a,b);if(!c)return console[h(0x112)](h(0xfc)),null;if(!c['data'])return console['log']('FeedbackSDK\x20Error:\x20response.data\x20is\x20empty.\x20Code\x202373'),c[h(0x10f)];if(c[h(0x10f)][h(0x102)])return _reactNative.Alert[h(0x109)]('FeedbackSDK\x20Error',c[h(0x10f)]['error'],[{'text':'OK'}],{'cancelable':!![]}),c;return c[h(0x10f)];}catch(d){console[h(0x112)](h(0xfb),d);}});return function sendSubmit(_x2){return _ref2.apply(this,arguments);};}();var sendConfirm=exports.sendConfirm=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(a){var b=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i=a0b;try{var c=yield(0,_NetworkHelper.myAxiosPost)(i(0x10e),a,b);if(!c)return console[i(0x112)]('FeedbackSDK\x20Error:\x20response\x20is\x20empty.\x20Code\x209377'),null;if(!c[i(0x10f)])return console[i(0x112)](i(0xff)),c[i(0x10f)];c[i(0x10f)][i(0xfd)]&&console[i(0x112)](i(0x105),c[i(0x10f)][i(0xfd)]);if(c['data']['error'])return _reactNative.Alert[i(0x109)](i(0x113),c[i(0x10f)][i(0x102)],[{'text':'OK'}],{'cancelable':!![]}),c;return c[i(0x10f)];}catch(d){console[i(0x112)](i(0x110),d);}});return function sendConfirm(_x3){return _ref3.apply(this,arguments);};}();function a0a(){var j=['FeedbackSDK\x20Error','36wiulQU','FeedbackSDK\x20Error:\x20request\x20form\x20error.\x20Code\x208417','FeedbackSDK\x20Error:\x20response\x20is\x20empty.\x20Code\x202370','debug_message','256439aumlsl','FeedbackSDK\x20Error:\x20response.data\x20is\x20empty.\x20Code\x209322','2454832sIopIP','665wWxnlv','error','FeedbackSDK\x20Error:\x20response.data\x20is\x20empty.\x20Code\x209373','2138590BsbvYc','FeedbackSDK\x20Debug:','21hqyQyV','4faexZg','257936CDFtJQ','alert','/LXvcFSTTOqxxmJX9qQar','/8vs2qwFD1rlSFWIa13Wc','2352036VfwoXQ','110lmNiha','/xPm2OGUrgAAVLom2NSZd','data','FeedbackSDK\x20Error:\x20request\x20form\x20error.\x20Code\x207451','1525278lMYzfr','log'];a0a=function a0a(){return j;};return a0a();}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AIAFeedbackInstance=void 0;Object.defineProperty(exports,"FeedbackInlineSurvey",{enumerable:true,get:function get(){return _inlineSurvey.default;}});exports.default=void 0;var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _reactNativeEncryptedStorage=_interopRequireDefault(require("react-native-encrypted-storage"));var _reactNativeRate=_interopRequireWildcard(require("react-native-rate"));var _component=require("./component");var _api=require("./api");var _const=require("./utils/const");var _StatusBarHeight=require("./utils/StatusBarHeight");var _=_interopRequireWildcard(require("./utils/MyFunction"));var _reactNativeAndroidKeyboardAdjustOriginallyus=_interopRequireDefault(require("react-native-android-keyboard-adjust-originallyus"));var _reactNativeDeviceInfo=_interopRequireDefault(require("react-native-device-info"));var _confirmStep=_interopRequireDefault(require("./component/confirmStep"));var _inlineSurvey=_interopRequireDefault(require("./component/inlineSurvey"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/tiem/Documents/Job/app/originally-us-rn-feedback-sdk/src_uglifyjs/index.jsx",_this3=this;function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}function _callSuper(t,o,e){return o=(0,_getPrototypeOf2.default)(o),(0,_possibleConstructorReturn2.default)(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],(0,_getPrototypeOf2.default)(t).constructor):o.apply(t,e));}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}var deviceHeight=_reactNative.Dimensions.get('window').height;var requestFormTimestamp=null;var submitFormTimestamp=null;var AIAFeedbackInstance=exports.AIAFeedbackInstance=null;var AIAFeedback=function(_React$Component){function AIAFeedback(props){var _this;(0,_classCallCheck2.default)(this,AIAFeedback);_this=_callSuper(this,AIAFeedback,[props]);_this.openAnimation=(0,_asyncToGenerator2.default)(function*(){_reactNative.Animated.timing(_this.isVisibleValue,{toValue:1,useNativeDriver:false}).start();});_this.getKeyboardInputMode=(0,_asyncToGenerator2.default)(function*(){if(_reactNative.Platform.OS==='android'){var inputMode=yield _reactNativeAndroidKeyboardAdjustOriginallyus.default.getCurrentSoftInputMode();_this.setState(Object.assign({},_this.state,{defaultNumberSoftInputMode:inputMode}));}return null;});_this.restoreKeyboardInputMode=function(){switch(_this.state.defaultNumberSoftInputMode){case 48:_reactNativeAndroidKeyboardAdjustOriginallyus.default.setAdjustNothing();console.log('AndroidKeyboardAdjust.setAdjustNothing()');break;case 32:_reactNativeAndroidKeyboardAdjustOriginallyus.default.setAdjustPan();console.log('AndroidKeyboardAdjust.setAdjustPan()');break;case 16:_reactNativeAndroidKeyboardAdjustOriginallyus.default.setAdjustResize();console.log('AndroidKeyboardAdjust.setAdjustResize()');break;case 0:_reactNativeAndroidKeyboardAdjustOriginallyus.default.setStateUnspecified();console.log('AndroidKeyboardAdjust.setStateUnspecified()');break;default:break;}};_this.onKeyboardDidShow=function(e){if(!_this.state.isVisible)return;var form=_this.state.form;_this.isShowingKeyboard=true;var customKeyboardHeight=e.endCoordinates.height;if(_const.isTablet&&(form==null?void 0:form.instrusive_style)==1)customKeyboardHeight=e.endCoordinates.height;if(!_const.isTablet&&(form==null?void 0:form.instrusive_style)==1&&_reactNative.Platform.OS==='android')customKeyboardHeight=1;_reactNative.Animated.timing(_this.keyboardHeight,{toValue:customKeyboardHeight,duration:300,easing:_reactNative.Easing.ease,useNativeDriver:false}).start(function(){if(_this.scrollViewInputRef){_this.scrollViewInputRef.scrollToEnd({duration:350,animated:true});}});};_this.onKeyboardDidHide=function(){if(!_this.state.isVisible)return;_this.isShowingKeyboard=false;_reactNative.Animated.timing(_this.keyboardHeight,{toValue:0,duration:350,useNativeDriver:false}).start();};_this.getVersion=function(){return _const.X_Version_Npm;};_this.setFormSlug=function(formSlug){if(!formSlug)return;if(formSlug.trim().length<2)return;_this.formSlug=formSlug.trim();};_this.setAppSecret=function(appSecret){_this.appSecret=appSecret;exports.AIAFeedbackInstance=AIAFeedbackInstance=_this;};_this.setAppUserId=function(){var userId=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'';try{if(typeof userId==='object'&&userId!==null){var userIdObject=Object.keys(userId).length===0?'':JSON.stringify(userId);_this.appUserId=userIdObject;return;}var userIdString=userId?userId.toString():'';_this.appUserId=userIdString;}catch(error){console.log('FeedbackSDK setAppUserId error:',error);_this.appUserId='';}};_this.setLanguage=function(language){if(!language||language.length<2){language='en';}language=language.toLowerCase();_this.language=language;};_this.setMetadata=function(metadata){if(!metadata)return;_this.metadata={metadata:metadata};};_this.testRatingForm=function(eventTag,callbackFn){_this.requestForm(true,eventTag,callbackFn);};_this.showRatingForm=function(eventTag,callbackFn){_this.requestForm(false,eventTag,callbackFn);};_this.showInlineForm=function(eventTag,slug){var callbackFn=arguments.length>2&&arguments[2]!==undefined?arguments[2]:function(){return null;};var debug=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;_this.setFormSlug(slug);_this.requestForm(debug,eventTag,callbackFn);};_this.hideRatingForm=function(){_this.setState({form:{},originalFormModel:{},numStar:0,inputValue:'',loading:false,listActiveSelect:[],isVisible:false,didSubmitted:false,isShowingExtraForm:false,heightScreenTablet:'auto'});_this.performCallbackFunction();_this.sdkCallbackFunction=null;_this.animatedValue=new _reactNative.Animated.Value(0);_this.isShowingKeyboard=false;_this.keyboardHeight=new _reactNative.Animated.Value(0);};_this.performCallbackFunction=function(){if(_this.sdkCallbackFunction&&typeof _this.sdkCallbackFunction==='function'){_this.sdkCallbackFunction(_this.formDidShow);}_this.restoreKeyboardInputMode();_this.sdkCallbackFunction=null;};_this.requestForm=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(debug){var eventTag=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'';var callbackFn=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(_this.state.isVisible)return;console.log({bundleId:_reactNativeDeviceInfo.default.getBundleId()});_this.formDidShow=false;_this.sdkCallbackFunction=null;if(callbackFn&&typeof callbackFn==='function'){_this.sdkCallbackFunction=callbackFn;}if(requestFormTimestamp){var nowTimestamp=Date.now();if(nowTimestamp-requestFormTimestamp<3000)return;}requestFormTimestamp=Date.now();_this.setState({form:{},originalFormModel:{},numStar:0,inputValue:'',loading:false,listActiveSelect:[],didSubmitted:false,isShowingExtraForm:false});_this.eventTag=eventTag;_this.debug=debug?1:0;var build_number=yield _.getBuildNumber();var storage_key=`dk3@sq8_${build_number}`;var install_timestamp=yield _reactNativeEncryptedStorage.default.getItem(storage_key);if(!install_timestamp)_reactNativeEncryptedStorage.default.setItem(storage_key,`${Math.floor(Date.now()/1000)}`);var bodyData={slug:_this.formSlug,debug:debug,event_tag:eventTag,install_timestamp:install_timestamp||0,metadata:_this.metadata||null};var headers={'X-App-Secret':_this.appSecret,'X-App-User-Id':_this.appUserId,'X-Lang':_this.language};var res=yield(0,_api.sendRequest)(bodyData,{headers:headers});if(res!=null&&res.error){if(debug)Alert.alert('FeedbackSDK Error',res==null?void 0:res.error,[{text:'OK'}],{cancelable:true});_this.performCallbackFunction();return;}if(!(res!=null&&res.title)||!(res!=null&&res.theme)){_this.performCallbackFunction();return;}if((res==null?void 0:res.delay_second)>0){_this.saveDelayFormData(res);_this.setState({form:res});return;}_this.formDidShow=true;_this.setState({form:res,isVisible:true},function(){setTimeout(function(){_reactNative.Animated.timing(_this.animatedValue,{toValue:1,useNativeDriver:false}).start();},350);});});return function(_x){return _ref3.apply(this,arguments);};}();_this.confirmForm=function(){var _ref4=(0,_asyncToGenerator2.default)(function*(debug,request_id){_this.debug=debug?1:0;var build_number=yield _.getBuildNumber();var storage_key=`dk3@sq8_${build_number}`;var install_timestamp=yield _reactNativeEncryptedStorage.default.getItem(storage_key);if(!install_timestamp)_reactNativeEncryptedStorage.default.setItem(storage_key,`${Math.floor(Date.now()/1000)}`);var bodyData={slug:_this.formSlug,debug:debug,install_timestamp:install_timestamp||0,metadata:_this.metadata||null,request_id:request_id};var headers={'X-App-Secret':_this.appSecret,'X-App-User-Id':_this.appUserId,'X-Lang':_this.language};var res=yield(0,_api.sendConfirm)(bodyData,{headers:headers});if(res!=null&&res.error){if(debug)Alert.alert('FeedbackSDK Error',res==null?void 0:res.error,[{text:'OK'}],{cancelable:true});return;}return res;});return function(_x2,_x3){return _ref4.apply(this,arguments);};}();_this.closeAnimation=function(callback){return _reactNative.Animated.timing(_this.isVisibleValue,{toValue:0,useNativeDriver:false}).start(callback);};_this.handleButtonClose=function(){_this.closeAnimation(function(){_this.hideRatingForm();_this.setState({confirmStep:true});});};_this.handleChangeText=function(value){_this.setState({inputValue:value});};_this.handleMultiSelectOption=function(index){var listActiveSelect=_this.state.listActiveSelect;var indexActive=listActiveSelect.indexOf(index);if(indexActive===-1){listActiveSelect.push(index);_this.setState({listActiveSelect:(0,_toConsumableArray2.default)(listActiveSelect)});}else{_this.setState({listActiveSelect:listActiveSelect.filter(function(element,i){return element!==index;})});}};_this.handleSelectOption=function(index){_this.setState({listActiveSelect:[index]});};_this.handlePressRating=function(numberValue){var autoSubmit=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;_this.setState({numStar:numberValue},function(){var _this$state$form,_this$state$form2,_this$state$form2$aut,_this$state$form3,_this$state$form3$aut;if((_this$state$form=_this.state.form)!=null&&_this$state$form.auto_submit&&(_this$state$form2=_this.state.form)!=null&&(_this$state$form2$aut=_this$state$form2.auto_submit)!=null&&_this$state$form2$aut.length&&(_this$state$form3=_this.state.form)!=null&&(_this$state$form3$aut=_this$state$form3.auto_submit)!=null&&_this$state$form3$aut.includes(numberValue)||!autoSubmit){_this.submitForm(autoSubmit);}});};_this.blinkAnimation=function(){_reactNative.Animated.sequence([_reactNative.Animated.timing(_this.opacityAnimatedValue,{toValue:0,duration:350,useNativeDriver:false}),_reactNative.Animated.timing(_this.opacityAnimatedValue,{toValue:1,duration:350,useNativeDriver:false})]).start();};_this.submitForm=(0,_asyncToGenerator2.default)(function*(){var _form$url;var isAutoSubmit=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var _this$state=_this.state,numStar=_this$state.numStar,inputValue=_this$state.inputValue,listActiveSelect=_this$state.listActiveSelect,form=_this$state.form,isShowingExtraForm=_this$state.isShowingExtraForm,originalFormModel=_this$state.originalFormModel,didSubmitted=_this$state.didSubmitted;if(submitFormTimestamp){var nowTimestamp=Date.now();if(nowTimestamp-submitFormTimestamp<1000)return;}submitFormTimestamp=Date.now();if(form!=null&&form.url&&(form==null?void 0:(_form$url=form.url)==null?void 0:_form$url.length)>5){_reactNative.Linking.canOpenURL(form==null?void 0:form.url).then(function(supported){supported&&_reactNative.Linking.openURL(form==null?void 0:form.url);},function(err){return console.log('FeedbackSDK Error:',err);});}if(form&&!form.auto_store_review){var url=_reactNative.Platform.OS==='ios'?form==null?void 0:form.ios_review_url:form==null?void 0:form.android_review_url;if(url){_reactNative.Linking.canOpenURL(url).then(function(supported){supported&&_reactNative.Linking.openURL(url);},function(err){return console.log('FeedbackSDK Error:',err);});}}if(isShowingExtraForm){_this.handleSubmitFormResponse(originalFormModel);return;}if(didSubmitted){_this.handleButtonClose();return;}_this.setState({loading:true});var bodyData={slug:_this.formSlug,rating:numStar,event_tag:_this.eventTag,debug:_this.debug,request_id:form==null?void 0:form.id,selected_options:listActiveSelect.join(','),free_text:inputValue,auto:isAutoSubmit,metadata:_this.metadata||null};var install_timestamp=yield _reactNativeEncryptedStorage.default.getItem('@opkjnbvfdxc');if(!install_timestamp)yield _reactNativeEncryptedStorage.default.setItem('@opkjnbvfdxc',`${Math.floor(Date.now()/1000)}`);var headers={'X-App-Secret':_this.appSecret,'X-App-User-Id':_this.appUserId,'X-Lang':_this.language};var res=yield(0,_api.sendSubmit)(bodyData,{headers:headers});if(res!=null&&res.error){Alert.alert('FeedbackSDK Error',res==null?void 0:res.error,[{text:'OK'}],{cancelable:true});_this.hideRatingForm();return;}_this.setState({didSubmitted:true});_this.setState({loading:false});if(res!=null&&res.auto_store_review){var options={AppleAppID:`${res==null?void 0:res.ios_store_app_id}`,OtherAndroidURL:res==null?void 0:res.android_review_url,preferredAndroidMarket:_reactNativeRate.AndroidMarket.Google,preferInApp:true,openAppStoreIfInAppFails:false};_reactNativeRate.default.rate(options,function(success){console.log('success',success);});}if(res!=null&&res.extra_form){_this.handleExtraFormResponse(res);return;}_this.handleSubmitFormResponse(res);return;});_this.handleExtraFormResponse=function(res){_this.setState({isShowingExtraForm:true},function(){_this.blinkAnimation();setTimeout(function(){_this.setState({originalFormModel:res,form:res.extra_form});},350);});};_this.handleSubmitFormResponse=function(res){if(res.action==="linked_survey"){_this.blinkAnimation();_this.setFormSlug(res.slug);_this.setState({numStar:null,didSubmitted:false,form:res,isVisible:true});return;}if(res.action==="dismiss"){_this.closeAnimation(function(){return _this.hideRatingForm();});return;}_this.setState({isShowingExtraForm:false},function(){_this.blinkAnimation();setTimeout(function(){_this.setState({originalFormModel:null,form:res});},350);});};_this.functions={submitForm:_this.submitForm,handlePressRating:_this.handlePressRating,handleButtonClose:_this.handleButtonClose,handleChangeText:_this.handleChangeText,handleSelectOption:_this.handleSelectOption,handleMultiSelectOption:_this.handleMultiSelectOption,scrollViewInputRef:function scrollViewInputRef(ref){return _this.scrollViewInputRef=ref;}};_this.validationSplashScreenSettings=function(res){return res.splash_screen_title&&res.splash_screen_question&&res.splash_screen_button_proceed&&res.splash_screen_button_skip&&res.splash_screen_title.trim().length>0&&res.splash_screen_question.trim().length>0&&res.splash_screen_button_proceed.trim().length>0&&res.splash_screen_button_skip.trim().length>0;};_this.checkSplashScreen=function(res,debug){var validSetting=this.validationSplashScreenSettings(res);if(res.instrusive_style===1&&res.splash_screen_enabled===1&&debug&&!validSetting){console.warn('%cFeedbackSDK Warning:','color: #ff0000; font-size: 16px; font-weight: bold;');console.warn("Splash screen settings are not valid");}if(res.instrusive_style===1&&res.splash_screen_enabled===1&&validSetting||res.backend_force_splash_secreen_endable&&validSetting){res.splashScreenEnabled=1;}};_this.saveDelayFormData=function(form){try{var now=new Date().getTime();_this.showMoment=form.delay_second*1000+now;_this.expireMoment=form.delay_second_expiry*1000+now;var data={form:form,showMoment:_this.showMoment,expireMoment:_this.expireMoment};var stringifyData=JSON.stringify(data);_reactNativeEncryptedStorage.default.setItem('formData',stringifyData);}catch(error){}};_this.clearDelayFormData=function(){try{_reactNativeEncryptedStorage.default.removeItem('formData');}catch(error){}};_this.getDelayFormData=(0,_asyncToGenerator2.default)(function*(){try{var data=yield _reactNativeEncryptedStorage.default.getItem('formData');var parseData=JSON.parse(data);if(!_.isNil(parseData)){_this.showMoment=parseData.showMoment;_this.expireMoment=parseData.expireMoment;_this.setState({form:parseData.form});}}catch(error){}});_this.resetTimeout=function(){_this.clearDelayFormData();_this.showMoment=0;clearInterval(_this.timeId);_this.timeId=undefined;};_this.controlTimeout=function(){if(!_this.showMoment)return;_this.timeId=setInterval(function(){var now=new Date().getTime();if(_this.expireMoment<=now){_this.resetTimeout();return;}if(_this.showMoment>0&&_this.showMoment<=now){_this.confirmForm(_this.debug,_this.state.form.id);_this.setState({isVisible:true});_this.resetTimeout();}},500);};_this.confirmStepOnPress=function(){_this.isVisibleValue.setValue(0);_this.setState({confirmStep:false},function(){_this.openAnimation();});};_this.state={form:{},originalFormModel:{},numStar:0,inputValue:'',loading:false,listActiveSelect:[],isVisible:false,didSubmitted:false,isShowingExtraForm:false,heightScreenTablet:'auto',defaultNumberSoftInputMode:null,confirmStep:true};_this.animatedValue=new _reactNative.Animated.Value(0);_this.keyboardHeight=new _reactNative.Animated.Value(0);_this.formSlug='native_rating_form';_this.scrollViewInputRef=null;_this.isShowingKeyboard=false;_this.timeout=null;_this.formDidShow=true;_this.eventTag=null;_this.showKeyboardSub=null;_this.hideKeyboardSub=null;_this.heightParentView=0;_this.isVisibleValue=new _reactNative.Animated.Value(0);_this.opacityAnimatedValue=new _reactNative.Animated.Value(1);_this.metadata=null;_this.sdkCallbackFunction=null;_this.appUserId='',_this.appSecret='',_this.language='en';return _this;}(0,_inherits2.default)(AIAFeedback,_React$Component);return(0,_createClass2.default)(AIAFeedback,[{key:"componentDidMount",value:function componentDidMount(){var _this$props;this.getDelayFormData();this.getKeyboardInputMode();if(_reactNative.Platform.OS==='ios'){this.showKeyboardSub=_reactNative.Keyboard.addListener('keyboardWillShow',this.onKeyboardDidShow);this.hideKeyboardSub=_reactNative.Keyboard.addListener('keyboardWillHide',this.onKeyboardDidHide);return;}this.showKeyboardSub=_reactNative.Keyboard.addListener('keyboardDidShow',this.onKeyboardDidShow);this.hideKeyboardSub=_reactNative.Keyboard.addListener('keyboardDidHide',this.onKeyboardDidHide);_reactNative.StatusBar.setTranslucent(!!((_this$props=this.props)!=null&&_this$props.translucent));_reactNative.StatusBar.setBackgroundColor('transparent');}},{key:"componentWillUnmount",value:function componentWillUnmount(){try{var _this$showKeyboardSub,_this$hideKeyboardSub;if(this.timeId)clearInterval(this.timeId);if(this.timeout)clearTimeout(this.timeout);if((_this$showKeyboardSub=this.showKeyboardSub)!=null&&_this$showKeyboardSub.remove&&(_this$hideKeyboardSub=this.hideKeyboardSub)!=null&&_this$hideKeyboardSub.remove){this.showKeyboardSub.remove();this.hideKeyboardSub.remove();return;}if(_reactNative.Platform.OS==='ios'){if(_reactNative.Keyboard.removeListener){_reactNative.Keyboard.removeListener('keyboardWillShow',this.onKeyboardDidShow);_reactNative.Keyboard.removeListener('keyboardWillHide',this.onKeyboardDidHide);}return;}if(_reactNative.Keyboard.removeListener){_reactNative.Keyboard.removeListener('keyboardDidShow',this.onKeyboardDidShow);_reactNative.Keyboard.removeListener('keyboardDidHide',this.onKeyboardDidHide);}}catch(error){console.log('FeedbackSDK Error:',error);}}},{key:"componentDidUpdate",value:function componentDidUpdate(_prevProps,prevState){var isVisible=this.state.isVisible;if(!this.timeId){this.controlTimeout();}if(isVisible&&isVisible!==prevState.isVisible){if(this.state.form.type==='content_usefulness'){if(this.inlineSurveyRef){var _this$inlineSurveyRef;(_this$inlineSurveyRef=this.inlineSurveyRef)==null?void 0:_this$inlineSurveyRef.setShowSurvey(this.state.form);return;}}this.state.confirmStep&&this.validationSplashScreenSettings(this.state.form)?this.isVisibleValue.setValue(1):this.openAnimation();}}},{key:"render",value:function render(){var _this$props2,_this2=this;var _this$state2=this.state,form=_this$state2.form,numStar=_this$state2.numStar,inputValue=_this$state2.inputValue,listActiveSelect=_this$state2.listActiveSelect,didSubmitted=_this$state2.didSubmitted,loading=_this$state2.loading,isShowingExtraForm=_this$state2.isShowingExtraForm,heightScreenTablet=_this$state2.heightScreenTablet;if(!form)return null;if(!form.theme)return null;var theme=form.theme;var hasSplash=this.validationSplashScreenSettings(form);var heightParentViewAni=this.isVisibleValue.interpolate({inputRange:[0,1],outputRange:[deviceHeight,0]});var aniMarginSelectBtn=this.keyboardHeight.interpolate({inputRange:[0,200],outputRange:[16/667*_const.heightScreen,10/667*_const.heightScreen]});var cmtTranslateY=this.animatedValue.interpolate({inputRange:[0,1],outputRange:[150,0]});var cmtAniOpacity=this.animatedValue.interpolate({inputRange:[0,1],outputRange:[0,1]});var opacityUI=this.opacityAnimatedValue.interpolate({inputRange:[0,1],outputRange:[0,1]});var widthStyle=_const.widthScreen;var translateX=-(widthStyle/2);var bottomStyle='auto';var rightStyle='auto';var leftStyle='50%';if(form.instrusive_style!=1){bottomStyle=0;}if(form.instrusive_style!=1&&_const.isTablet){widthStyle=_const.widthScreenNonIntr;rightStyle='15%';translateX=0;leftStyle='auto';}var heightUI;if(_const.isTablet)heightUI=heightScreenTablet;else{heightUI=heightScreenTablet==='auto'?'auto':_const.heightScreen-40;}var heightNonIntrusCondition=_const.heightScreen-40;if(_const.isTablet)heightNonIntrusCondition=_const.heightScreen/1.5;var animationOutSideApp=0;var animationInSideApp=0;if(_const.isTablet||!_const.isTablet&&form.instrusive_style!=1&&_reactNative.Platform.OS!=='android')animationOutSideApp=this.keyboardHeight;if(!_const.isTablet&&form.instrusive_style==1)animationInSideApp=this.keyboardHeight;var isSoftInputModeResize=_reactNative.Platform.OS==='android'&&!!form.instrusive_style;if(isSoftInputModeResize){_reactNativeAndroidKeyboardAdjustOriginallyus.default.setAdjustResize();console.warn('keyboard show on full screen');}var finalHeight=_const.isTablet?heightScreenTablet:_const.heightScreen;if(this!=null&&(_this$props2=this.props)!=null&&_this$props2.translucent)finalHeight=_const.heightScreen+(_reactNative.StatusBar==null?void 0:_reactNative.StatusBar.currentHeight);var statusBarHeight=(0,_StatusBarHeight.getStatusBarHeight)()+8;var transformStyle={transform:[{translateY:heightParentViewAni},{translateX:translateX}],paddingBottom:animationOutSideApp,width:widthStyle,bottom:bottomStyle,right:rightStyle,left:leftStyle};var animations={aniMarginSelectBtn:aniMarginSelectBtn,cmtTranslateY:cmtTranslateY,cmtAniOpacity:cmtAniOpacity,animationInSideApp:animationInSideApp};var states={inputValue:inputValue,numStar:numStar,listActiveSelect:listActiveSelect,loading:loading,isShowingExtraForm:isShowingExtraForm};var hasIntrusiveStyle=Object.keys(form).length>0&&form.instrusive_style==1;if(this.state.form.type==='content_usefulness'&&!_.isNil(this.inlineSurveyRef))return;if(this.state.confirmStep&&hasSplash&&hasIntrusiveStyle){return(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[styles.wrapper,transformStyle],children:(0,_jsxRuntime.jsx)(ContentWrapper,{backgroundColor:theme==null?void 0:theme.body_bg_color,children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{onLayout:function onLayout(event){var height=event.nativeEvent.layout.height;if(_const.isTablet)return;if(height>_const.heightScreen&&heightScreenTablet==='auto'){_this2.setState({heightScreenTablet:_const.heightScreen});}},style:{flex:1,height:finalHeight,opacity:opacityUI,paddingBottom:_const.isTablet?35:statusBarHeight},children:(0,_jsxRuntime.jsx)(_confirmStep.default,{theme:theme,handleButtonClose:this.handleButtonClose,form:form,onProcess:this.confirmStepOnPress})})})});}return(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{style:[styles.wrapper,transformStyle],children:[hasIntrusiveStyle&&(0,_jsxRuntime.jsx)(ContentWrapper,{backgroundColor:theme==null?void 0:theme.body_bg_color,children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{onLayout:function onLayout(event){var height=event.nativeEvent.layout.height;if(_const.isTablet)return;if(height>_const.heightScreen&&heightScreenTablet==='auto'){_this2.setState({heightScreenTablet:_const.heightScreen});}},style:{flex:1,height:finalHeight,opacity:opacityUI,paddingBottom:_const.isTablet?35:statusBarHeight},children:(0,_jsxRuntime.jsx)(_component.ContentUI,{didSubmitted:didSubmitted,form:form,animatedValues:{keyboardHeight:this.keyboardHeight},animations:animations,states:states,functions:this.functions})})}),!hasIntrusiveStyle&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[{borderTopLeftRadius:16/375*_const.widthScreenNonIntr,borderTopRightRadius:16/375*_const.widthScreenNonIntr,backgroundColor:(theme==null?void 0:theme.body_bg_color)||'#fff'}],children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{onLayout:function onLayout(event){var height=event.nativeEvent.layout.height;if(_const.isTablet)return;if(height>heightNonIntrusCondition&&heightScreenTablet==='auto'){_this2.setState({heightScreenTablet:heightNonIntrusCondition});}},style:{flex:1,height:heightUI,opacity:opacityUI,paddingBottom:statusBarHeight},children:(0,_jsxRuntime.jsx)(_component.ContentUI,{didSubmitted:didSubmitted,form:form,animatedValues:{keyboardHeight:this.keyboardHeight},animations:animations,states:states,functions:this.functions})})})]});}}]);}(_react.default.Component);var styles=_reactNative.StyleSheet.create({wrapper:{position:'absolute',zIndex:9999999,elevation:9999999,shadowColor:'rgba(0, 0, 0, 0.5)',shadowOffset:{width:0,height:3},shadowOpacity:0.5,shadowRadius:6,elevation:3}});var ContentWrapper=function ContentWrapper(_ref7){var children=_ref7.children,backgroundColor=_ref7.backgroundColor;if(_reactNative.Platform.OS==='ios')return(0,_jsxRuntime.jsx)(_reactNative.View,{style:{backgroundColor:backgroundColor||'#fff',borderRadius:_const.isTablet?8:0,flex:1,marginHorizontal:_const.isTablet?20:0,paddingTop:_reactNative.StatusBar.currentHeight},children:children});return(0,_jsxRuntime.jsx)(_reactNative.KeyboardAvoidingView,{behavior:'height',style:{backgroundColor:backgroundColor||'#fff',borderRadius:_const.isTablet?8:0,flex:1,paddingTop:_reactNative.StatusBar.currentHeight,paddingBottom:10},children:children});};var _default=exports.default=AIAFeedback;
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AIAFeedbackInstance=void 0;Object.defineProperty(exports,"FeedbackInlineSurvey",{enumerable:true,get:function get(){return _inlineSurvey.default;}});exports.default=void 0;var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _reactNativeAndroidKeyboardAdjustOriginallyus=_interopRequireDefault(require("react-native-android-keyboard-adjust-originallyus"));var _reactNativeDeviceInfo=_interopRequireDefault(require("react-native-device-info"));var _reactNativeEncryptedStorage=_interopRequireDefault(require("react-native-encrypted-storage"));var _reactNativeRate=_interopRequireWildcard(require("react-native-rate"));var _api=require("./api");var _component=require("./component");var _confirmStep=_interopRequireDefault(require("./component/confirmStep"));var _inlineSurvey=_interopRequireDefault(require("./component/inlineSurvey"));var _const=require("./utils/const");var _=_interopRequireWildcard(require("./utils/MyFunction"));var _StatusBarHeight=require("./utils/StatusBarHeight");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/tiem/Documents/Job/app/originally-us-rn-feedback-sdk/src_uglifyjs/index.jsx",_this3=this;function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}function _callSuper(t,o,e){return o=(0,_getPrototypeOf2.default)(o),(0,_possibleConstructorReturn2.default)(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],(0,_getPrototypeOf2.default)(t).constructor):o.apply(t,e));}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}var deviceHeight=_reactNative.Dimensions.get('window').height;var requestFormTimestamp=null;var submitFormTimestamp=null;var AIAFeedbackInstance=exports.AIAFeedbackInstance=null;var AIAFeedback=function(_React$Component){function AIAFeedback(props){var _this;(0,_classCallCheck2.default)(this,AIAFeedback);_this=_callSuper(this,AIAFeedback,[props]);_this.openAnimation=(0,_asyncToGenerator2.default)(function*(){_reactNative.Animated.timing(_this.isVisibleValue,{toValue:1,useNativeDriver:false}).start();});_this.getKeyboardInputMode=(0,_asyncToGenerator2.default)(function*(){if(_reactNative.Platform.OS==='android'){var inputMode=yield _reactNativeAndroidKeyboardAdjustOriginallyus.default.getCurrentSoftInputMode();_this.setState(Object.assign({},_this.state,{defaultNumberSoftInputMode:inputMode}));}return null;});_this.restoreKeyboardInputMode=function(){switch(_this.state.defaultNumberSoftInputMode){case 48:_reactNativeAndroidKeyboardAdjustOriginallyus.default.setAdjustNothing();console.log('AndroidKeyboardAdjust.setAdjustNothing()');break;case 32:_reactNativeAndroidKeyboardAdjustOriginallyus.default.setAdjustPan();console.log('AndroidKeyboardAdjust.setAdjustPan()');break;case 16:_reactNativeAndroidKeyboardAdjustOriginallyus.default.setAdjustResize();console.log('AndroidKeyboardAdjust.setAdjustResize()');break;case 0:_reactNativeAndroidKeyboardAdjustOriginallyus.default.setStateUnspecified();console.log('AndroidKeyboardAdjust.setStateUnspecified()');break;default:break;}};_this.onKeyboardDidShow=function(e){if(!_this.state.isVisible)return;var form=_this.state.form;_this.isShowingKeyboard=true;var customKeyboardHeight=e.endCoordinates.height;if(_const.isTablet&&(form==null?void 0:form.instrusive_style)==1)customKeyboardHeight=e.endCoordinates.height;if(!_const.isTablet&&(form==null?void 0:form.instrusive_style)==1&&_reactNative.Platform.OS==='android')customKeyboardHeight=1;_reactNative.Animated.timing(_this.keyboardHeight,{toValue:customKeyboardHeight,duration:300,easing:_reactNative.Easing.ease,useNativeDriver:false}).start(function(){if(_this.scrollViewInputRef){_this.scrollViewInputRef.scrollToEnd({duration:350,animated:true});}});};_this.onKeyboardDidHide=function(){if(!_this.state.isVisible)return;_this.isShowingKeyboard=false;_reactNative.Animated.timing(_this.keyboardHeight,{toValue:0,duration:350,useNativeDriver:false}).start();};_this.getVersion=function(){return _const.X_Version_Npm;};_this.setFormSlug=function(formSlug){if(!formSlug)return;if(formSlug.trim().length<2)return;_this.formSlug=formSlug.trim();};_this.setAppSecret=function(appSecret){_this.appSecret=appSecret;exports.AIAFeedbackInstance=AIAFeedbackInstance=_this;};_this.setAppUserId=function(){var userId=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'';try{if(typeof userId==='object'&&userId!==null){var userIdObject=Object.keys(userId).length===0?'':JSON.stringify(userId);_this.appUserId=userIdObject;return;}var userIdString=userId?userId.toString():'';_this.appUserId=userIdString;}catch(error){console.log('FeedbackSDK setAppUserId error:',error);_this.appUserId='';}};_this.setLanguage=function(language){if(!language||language.length<2){language='en';}language=language.toLowerCase();_this.language=language;};_this.setMetadata=function(metadata){if(!metadata)return;_this.metadata={metadata:metadata};};_this.testRatingForm=function(eventTag,callbackFn){_this.requestForm(true,eventTag,callbackFn);};_this.showRatingForm=function(eventTag,callbackFn){_this.requestForm(false,eventTag,callbackFn);};_this.showInlineForm=function(eventTag,slug){var callbackFn=arguments.length>2&&arguments[2]!==undefined?arguments[2]:function(){return null;};var debug=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;_this.setFormSlug(slug);_this.requestForm(debug,eventTag,callbackFn);};_this.hideRatingForm=function(){_this.setState({form:{},originalFormModel:{},numStar:0,inputValue:'',loading:false,listActiveSelect:[],isVisible:false,didSubmitted:false,isShowingExtraForm:false,heightScreenTablet:'auto'});_this.performCallbackFunction();_this.sdkCallbackFunction=null;_this.animatedValue=new _reactNative.Animated.Value(0);_this.isShowingKeyboard=false;_this.keyboardHeight=new _reactNative.Animated.Value(0);};_this.performCallbackFunction=function(){if(_this.sdkCallbackFunction&&typeof _this.sdkCallbackFunction==='function'){_this.sdkCallbackFunction(_this.formDidShow);}_this.restoreKeyboardInputMode();_this.sdkCallbackFunction=null;};_this.requestForm=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(debug){var eventTag=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'';var callbackFn=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(_this.state.isVisible)return;console.log({bundleId:_reactNativeDeviceInfo.default.getBundleId()});_this.formDidShow=false;_this.sdkCallbackFunction=null;if(callbackFn&&typeof callbackFn==='function'){_this.sdkCallbackFunction=callbackFn;}if(requestFormTimestamp){var nowTimestamp=Date.now();if(nowTimestamp-requestFormTimestamp<3000)return;}requestFormTimestamp=Date.now();_this.setState({form:{},originalFormModel:{},numStar:0,inputValue:'',loading:false,listActiveSelect:[],didSubmitted:false,isShowingExtraForm:false});_this.eventTag=eventTag;_this.debug=debug?1:0;var build_number=yield _.getBuildNumber();var storage_key=`dk3@sq8_${build_number}`;var install_timestamp=yield _reactNativeEncryptedStorage.default.getItem(storage_key);if(!install_timestamp)_reactNativeEncryptedStorage.default.setItem(storage_key,`${Math.floor(Date.now()/1000)}`);var bodyData={slug:_this.formSlug,debug:debug,event_tag:eventTag,install_timestamp:install_timestamp||0,metadata:_this.metadata||null};var headers={'X-App-Secret':_this.appSecret,'X-App-User-Id':_this.appUserId,'X-Lang':_this.language};var res=yield(0,_api.sendRequest)(bodyData,{headers:headers});if(res!=null&&res.error){if(debug)_reactNative.Alert.alert('FeedbackSDK Error',res==null?void 0:res.error,[{text:'OK'}],{cancelable:true});_this.performCallbackFunction();return;}if(!(res!=null&&res.title)||!(res!=null&&res.theme)){_this.performCallbackFunction();return;}if((res==null?void 0:res.delay_second)>0){_this.saveDelayFormData(res);_this.setState({form:res});return;}_this.formDidShow=true;_this.setState({form:res,isVisible:true},function(){setTimeout(function(){_reactNative.Animated.timing(_this.animatedValue,{toValue:1,useNativeDriver:false}).start();},350);});});return function(_x){return _ref3.apply(this,arguments);};}();_this.confirmForm=function(){var _ref4=(0,_asyncToGenerator2.default)(function*(debug,request_id){_this.debug=debug?1:0;var build_number=yield _.getBuildNumber();var storage_key=`dk3@sq8_${build_number}`;var install_timestamp=yield _reactNativeEncryptedStorage.default.getItem(storage_key);if(!install_timestamp)_reactNativeEncryptedStorage.default.setItem(storage_key,`${Math.floor(Date.now()/1000)}`);var bodyData={slug:_this.formSlug,debug:debug,install_timestamp:install_timestamp||0,metadata:_this.metadata||null,request_id:request_id};var headers={'X-App-Secret':_this.appSecret,'X-App-User-Id':_this.appUserId,'X-Lang':_this.language};var res=yield(0,_api.sendConfirm)(bodyData,{headers:headers});if(res!=null&&res.error){if(debug)_reactNative.Alert.alert('FeedbackSDK Error',res==null?void 0:res.error,[{text:'OK'}],{cancelable:true});return;}return res;});return function(_x2,_x3){return _ref4.apply(this,arguments);};}();_this.closeAnimation=function(callback){return _reactNative.Animated.timing(_this.isVisibleValue,{toValue:0,useNativeDriver:false}).start(callback);};_this.handleButtonClose=function(){_this.closeAnimation(function(){_this.hideRatingForm();_this.setState({confirmStep:true});});};_this.handleChangeText=function(value){_this.setState({inputValue:value});};_this.handleMultiSelectOption=function(index){var listActiveSelect=_this.state.listActiveSelect;var indexActive=listActiveSelect.indexOf(index);if(indexActive===-1){listActiveSelect.push(index);_this.setState({listActiveSelect:(0,_toConsumableArray2.default)(listActiveSelect)});}else{_this.setState({listActiveSelect:listActiveSelect.filter(function(element,i){return element!==index;})});}};_this.handleSelectOption=function(index){_this.setState({listActiveSelect:[index]});};_this.handlePressRating=function(numberValue){var autoSubmit=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;_this.setState({numStar:numberValue},function(){var _this$state$form,_this$state$form2,_this$state$form2$aut,_this$state$form3,_this$state$form3$aut;if((_this$state$form=_this.state.form)!=null&&_this$state$form.auto_submit&&(_this$state$form2=_this.state.form)!=null&&(_this$state$form2$aut=_this$state$form2.auto_submit)!=null&&_this$state$form2$aut.length&&(_this$state$form3=_this.state.form)!=null&&(_this$state$form3$aut=_this$state$form3.auto_submit)!=null&&_this$state$form3$aut.includes(numberValue)||!autoSubmit){_this.submitForm(autoSubmit);}});};_this.blinkAnimation=function(){_reactNative.Animated.sequence([_reactNative.Animated.timing(_this.opacityAnimatedValue,{toValue:0,duration:350,useNativeDriver:false}),_reactNative.Animated.timing(_this.opacityAnimatedValue,{toValue:1,duration:350,useNativeDriver:false})]).start();};_this.submitForm=(0,_asyncToGenerator2.default)(function*(){var _form$url;var isAutoSubmit=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var _this$state=_this.state,numStar=_this$state.numStar,inputValue=_this$state.inputValue,listActiveSelect=_this$state.listActiveSelect,form=_this$state.form,isShowingExtraForm=_this$state.isShowingExtraForm,originalFormModel=_this$state.originalFormModel,didSubmitted=_this$state.didSubmitted;if(submitFormTimestamp){var nowTimestamp=Date.now();if(nowTimestamp-submitFormTimestamp<1000)return;}submitFormTimestamp=Date.now();if(form!=null&&form.url&&(form==null?void 0:(_form$url=form.url)==null?void 0:_form$url.length)>5){_reactNative.Linking.canOpenURL(form==null?void 0:form.url).then(function(supported){supported&&_reactNative.Linking.openURL(form==null?void 0:form.url);},function(err){return console.log('FeedbackSDK Error:',err);});}if(form&&!form.auto_store_review){var url=_reactNative.Platform.OS==='ios'?form==null?void 0:form.ios_review_url:form==null?void 0:form.android_review_url;if(url){_reactNative.Linking.canOpenURL(url).then(function(supported){supported&&_reactNative.Linking.openURL(url);},function(err){return console.log('FeedbackSDK Error:',err);});}}if(isShowingExtraForm){_this.handleSubmitFormResponse(originalFormModel);return;}if(didSubmitted){_this.handleButtonClose();return;}_this.setState({loading:true});var bodyData={slug:_this.formSlug,rating:numStar,event_tag:_this.eventTag,debug:_this.debug,request_id:form==null?void 0:form.id,selected_options:listActiveSelect.join(','),free_text:inputValue,auto:isAutoSubmit,metadata:_this.metadata||null};var install_timestamp=yield _reactNativeEncryptedStorage.default.getItem('@opkjnbvfdxc');if(!install_timestamp)yield _reactNativeEncryptedStorage.default.setItem('@opkjnbvfdxc',`${Math.floor(Date.now()/1000)}`);var headers={'X-App-Secret':_this.appSecret,'X-App-User-Id':_this.appUserId,'X-Lang':_this.language};var res=yield(0,_api.sendSubmit)(bodyData,{headers:headers});if(res!=null&&res.error){_reactNative.Alert.alert('FeedbackSDK Error',res==null?void 0:res.error,[{text:'OK'}],{cancelable:true});_this.hideRatingForm();return;}_this.setState({didSubmitted:true});_this.setState({loading:false});if(res!=null&&res.auto_store_review){var options={AppleAppID:`${res==null?void 0:res.ios_store_app_id}`,OtherAndroidURL:res==null?void 0:res.android_review_url,preferredAndroidMarket:_reactNativeRate.AndroidMarket.Google,preferInApp:true,openAppStoreIfInAppFails:false};_reactNativeRate.default.rate(options,function(success){console.log('success',success);});}if(res!=null&&res.extra_form){_this.handleExtraFormResponse(res);return;}_this.handleSubmitFormResponse(res);return;});_this.handleExtraFormResponse=function(res){_this.setState({isShowingExtraForm:true},function(){_this.blinkAnimation();setTimeout(function(){_this.setState({originalFormModel:res,form:res.extra_form});},350);});};_this.handleSubmitFormResponse=function(res){if(res.action==="linked_survey"){_this.blinkAnimation();_this.setFormSlug(res.slug);_this.setState({numStar:null,didSubmitted:false,form:res,isVisible:true});return;}if(res.action==="dismiss"){_this.closeAnimation(function(){return _this.hideRatingForm();});return;}_this.setState({isShowingExtraForm:false},function(){_this.blinkAnimation();setTimeout(function(){_this.setState({originalFormModel:null,form:res});},350);});};_this.functions={submitForm:_this.submitForm,handlePressRating:_this.handlePressRating,handleButtonClose:_this.handleButtonClose,handleChangeText:_this.handleChangeText,handleSelectOption:_this.handleSelectOption,handleMultiSelectOption:_this.handleMultiSelectOption,scrollViewInputRef:function scrollViewInputRef(ref){return _this.scrollViewInputRef=ref;}};_this.validationSplashScreenSettings=function(res){return res.splash_screen_title&&res.splash_screen_question&&res.splash_screen_button_proceed&&res.splash_screen_button_skip&&res.splash_screen_title.trim().length>0&&res.splash_screen_question.trim().length>0&&res.splash_screen_button_proceed.trim().length>0&&res.splash_screen_button_skip.trim().length>0;};_this.checkSplashScreen=function(res,debug){var validSetting=this.validationSplashScreenSettings(res);if(res.instrusive_style===1&&res.splash_screen_enabled===1&&debug&&!validSetting){console.warn('%cFeedbackSDK Warning:','color: #ff0000; font-size: 16px; font-weight: bold;');console.warn("Splash screen settings are not valid");}if(res.instrusive_style===1&&res.splash_screen_enabled===1&&validSetting||res.backend_force_splash_secreen_endable&&validSetting){res.splashScreenEnabled=1;}};_this.saveDelayFormData=function(form){try{var now=new Date().getTime();_this.showMoment=form.delay_second*1000+now;_this.expireMoment=form.delay_second_expiry*1000+now;var data={form:form,showMoment:_this.showMoment,expireMoment:_this.expireMoment};var stringifyData=JSON.stringify(data);_reactNativeEncryptedStorage.default.setItem('formData',stringifyData);}catch(error){}};_this.clearDelayFormData=function(){try{_reactNativeEncryptedStorage.default.removeItem('formData');}catch(error){}};_this.getDelayFormData=(0,_asyncToGenerator2.default)(function*(){try{var data=yield _reactNativeEncryptedStorage.default.getItem('formData');var parseData=JSON.parse(data);if(!_.isNil(parseData)){_this.showMoment=parseData.showMoment;_this.expireMoment=parseData.expireMoment;_this.setState({form:parseData.form});}}catch(error){}});_this.resetTimeout=function(){_this.clearDelayFormData();_this.showMoment=0;clearInterval(_this.timeId);_this.timeId=undefined;};_this.controlTimeout=function(){if(!_this.showMoment)return;_this.timeId=setInterval(function(){var now=new Date().getTime();if(_this.expireMoment<=now){_this.resetTimeout();return;}if(_this.showMoment>0&&_this.showMoment<=now){_this.confirmForm(_this.debug,_this.state.form.id);_this.setState({isVisible:true});_this.resetTimeout();}},500);};_this.confirmStepOnPress=function(){_this.isVisibleValue.setValue(0);_this.setState({confirmStep:false},function(){_this.openAnimation();});};_this.state={form:{},originalFormModel:{},numStar:0,inputValue:'',loading:false,listActiveSelect:[],isVisible:false,didSubmitted:false,isShowingExtraForm:false,heightScreenTablet:'auto',defaultNumberSoftInputMode:null,confirmStep:true};_this.animatedValue=new _reactNative.Animated.Value(0);_this.keyboardHeight=new _reactNative.Animated.Value(0);_this.formSlug='native_rating_form';_this.scrollViewInputRef=null;_this.isShowingKeyboard=false;_this.timeout=null;_this.formDidShow=true;_this.eventTag=null;_this.showKeyboardSub=null;_this.hideKeyboardSub=null;_this.heightParentView=0;_this.isVisibleValue=new _reactNative.Animated.Value(0);_this.opacityAnimatedValue=new _reactNative.Animated.Value(1);_this.metadata=null;_this.sdkCallbackFunction=null;_this.appUserId='',_this.appSecret='',_this.language='en';if(!_reactNativeAndroidKeyboardAdjustOriginallyus.default&&_reactNative.Platform.OS==='android'){_reactNative.Alert.alert('Error',`AndroidKeyboardAdjust library is not installed correctly please check console for more details`);console.error('AndroidKeyboardAdjust library is not installed correctly please check the installation guide and reinstall your app. https://www.npmjs.com/package/react-native-android-keyboard-adjust-originallyus');}return _this;}(0,_inherits2.default)(AIAFeedback,_React$Component);return(0,_createClass2.default)(AIAFeedback,[{key:"componentDidMount",value:function componentDidMount(){var _this$props;this.getDelayFormData();this.getKeyboardInputMode();if(_reactNative.Platform.OS==='ios'){this.showKeyboardSub=_reactNative.Keyboard.addListener('keyboardWillShow',this.onKeyboardDidShow);this.hideKeyboardSub=_reactNative.Keyboard.addListener('keyboardWillHide',this.onKeyboardDidHide);return;}this.showKeyboardSub=_reactNative.Keyboard.addListener('keyboardDidShow',this.onKeyboardDidShow);this.hideKeyboardSub=_reactNative.Keyboard.addListener('keyboardDidHide',this.onKeyboardDidHide);_reactNative.StatusBar.setTranslucent(!!((_this$props=this.props)!=null&&_this$props.translucent));_reactNative.StatusBar.setBackgroundColor('transparent');}},{key:"componentWillUnmount",value:function componentWillUnmount(){try{var _this$showKeyboardSub,_this$hideKeyboardSub;if(this.timeId)clearInterval(this.timeId);if(this.timeout)clearTimeout(this.timeout);if((_this$showKeyboardSub=this.showKeyboardSub)!=null&&_this$showKeyboardSub.remove&&(_this$hideKeyboardSub=this.hideKeyboardSub)!=null&&_this$hideKeyboardSub.remove){this.showKeyboardSub.remove();this.hideKeyboardSub.remove();return;}if(_reactNative.Platform.OS==='ios'){if(_reactNative.Keyboard.removeListener){_reactNative.Keyboard.removeListener('keyboardWillShow',this.onKeyboardDidShow);_reactNative.Keyboard.removeListener('keyboardWillHide',this.onKeyboardDidHide);}return;}if(_reactNative.Keyboard.removeListener){_reactNative.Keyboard.removeListener('keyboardDidShow',this.onKeyboardDidShow);_reactNative.Keyboard.removeListener('keyboardDidHide',this.onKeyboardDidHide);}}catch(error){console.log('FeedbackSDK Error:',error);}}},{key:"componentDidUpdate",value:function componentDidUpdate(_prevProps,prevState){var isVisible=this.state.isVisible;if(!this.timeId){this.controlTimeout();}if(isVisible&&isVisible!==prevState.isVisible){if(this.state.form.type==='content_usefulness'){if(this.inlineSurveyRef){var _this$inlineSurveyRef;(_this$inlineSurveyRef=this.inlineSurveyRef)==null?void 0:_this$inlineSurveyRef.setShowSurvey(this.state.form);return;}}this.state.confirmStep&&this.validationSplashScreenSettings(this.state.form)?this.isVisibleValue.setValue(1):this.openAnimation();}}},{key:"render",value:function render(){var _this$props2,_this2=this;var _this$state2=this.state,form=_this$state2.form,numStar=_this$state2.numStar,inputValue=_this$state2.inputValue,listActiveSelect=_this$state2.listActiveSelect,didSubmitted=_this$state2.didSubmitted,loading=_this$state2.loading,isShowingExtraForm=_this$state2.isShowingExtraForm,heightScreenTablet=_this$state2.heightScreenTablet;if(!form)return null;if(!form.theme)return null;var theme=form.theme;var hasSplash=this.validationSplashScreenSettings(form);var heightParentViewAni=this.isVisibleValue.interpolate({inputRange:[0,1],outputRange:[deviceHeight,0]});var aniMarginSelectBtn=this.keyboardHeight.interpolate({inputRange:[0,200],outputRange:[16/667*_const.heightScreen,10/667*_const.heightScreen]});var cmtTranslateY=this.animatedValue.interpolate({inputRange:[0,1],outputRange:[150,0]});var cmtAniOpacity=this.animatedValue.interpolate({inputRange:[0,1],outputRange:[0,1]});var opacityUI=this.opacityAnimatedValue.interpolate({inputRange:[0,1],outputRange:[0,1]});var widthStyle=_const.widthScreen;var translateX=-(widthStyle/2);var bottomStyle='auto';var rightStyle='auto';var leftStyle='50%';if(form.instrusive_style!=1){bottomStyle=0;}if(form.instrusive_style!=1&&_const.isTablet){widthStyle=_const.widthScreenNonIntr;rightStyle='15%';translateX=0;leftStyle='auto';}var heightUI;if(_const.isTablet)heightUI=heightScreenTablet;else{heightUI=heightScreenTablet==='auto'?'auto':_const.heightScreen-40;}var heightNonIntrusCondition=_const.heightScreen-40;if(_const.isTablet)heightNonIntrusCondition=_const.heightScreen/1.5;var animationOutSideApp=0;var animationInSideApp=0;if(_const.isTablet||!_const.isTablet&&form.instrusive_style!=1&&_reactNative.Platform.OS!=='android')animationOutSideApp=this.keyboardHeight;if(!_const.isTablet&&form.instrusive_style==1)animationInSideApp=this.keyboardHeight;var isSoftInputModeResize=_reactNative.Platform.OS==='android'&&!!form.instrusive_style;if(isSoftInputModeResize){_reactNativeAndroidKeyboardAdjustOriginallyus.default.setAdjustResize();console.warn('keyboard show on full screen');}var finalHeight=_const.isTablet?heightScreenTablet:_const.heightScreen;if(this!=null&&(_this$props2=this.props)!=null&&_this$props2.translucent)finalHeight=_const.heightScreen+(_reactNative.StatusBar==null?void 0:_reactNative.StatusBar.currentHeight);var statusBarHeight=(0,_StatusBarHeight.getStatusBarHeight)()+8;var transformStyle={transform:[{translateY:heightParentViewAni},{translateX:translateX}],paddingBottom:animationOutSideApp,width:widthStyle,bottom:bottomStyle,right:rightStyle,left:leftStyle};var animations={aniMarginSelectBtn:aniMarginSelectBtn,cmtTranslateY:cmtTranslateY,cmtAniOpacity:cmtAniOpacity,animationInSideApp:animationInSideApp};var states={inputValue:inputValue,numStar:numStar,listActiveSelect:listActiveSelect,loading:loading,isShowingExtraForm:isShowingExtraForm};var hasIntrusiveStyle=Object.keys(form).length>0&&form.instrusive_style==1;if(this.state.form.type==='content_usefulness'&&!_.isNil(this.inlineSurveyRef))return;if(this.state.confirmStep&&hasSplash&&hasIntrusiveStyle){return(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[styles.wrapper,transformStyle],children:(0,_jsxRuntime.jsx)(ContentWrapper,{backgroundColor:theme==null?void 0:theme.body_bg_color,children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{onLayout:function onLayout(event){var height=event.nativeEvent.layout.height;if(_const.isTablet)return;if(height>_const.heightScreen&&heightScreenTablet==='auto'){_this2.setState({heightScreenTablet:_const.heightScreen});}},style:{flex:1,height:finalHeight,opacity:opacityUI,paddingBottom:_const.isTablet?35:statusBarHeight},children:(0,_jsxRuntime.jsx)(_confirmStep.default,{theme:theme,handleButtonClose:this.handleButtonClose,form:form,onProcess:this.confirmStepOnPress})})})});}return(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{style:[styles.wrapper,transformStyle],children:[hasIntrusiveStyle&&(0,_jsxRuntime.jsx)(ContentWrapper,{backgroundColor:theme==null?void 0:theme.body_bg_color,children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{onLayout:function onLayout(event){var height=event.nativeEvent.layout.height;if(_const.isTablet)return;if(height>_const.heightScreen&&heightScreenTablet==='auto'){_this2.setState({heightScreenTablet:_const.heightScreen});}},style:{flex:1,height:finalHeight,opacity:opacityUI,paddingBottom:_const.isTablet?35:statusBarHeight},children:(0,_jsxRuntime.jsx)(_component.ContentUI,{didSubmitted:didSubmitted,form:form,animatedValues:{keyboardHeight:this.keyboardHeight},animations:animations,states:states,functions:this.functions})})}),!hasIntrusiveStyle&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[{borderTopLeftRadius:16/375*_const.widthScreenNonIntr,borderTopRightRadius:16/375*_const.widthScreenNonIntr,backgroundColor:(theme==null?void 0:theme.body_bg_color)||'#fff'}],children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{onLayout:function onLayout(event){var height=event.nativeEvent.layout.height;if(_const.isTablet)return;if(height>heightNonIntrusCondition&&heightScreenTablet==='auto'){_this2.setState({heightScreenTablet:heightNonIntrusCondition});}},style:{flex:1,height:heightUI,opacity:opacityUI,paddingBottom:statusBarHeight},children:(0,_jsxRuntime.jsx)(_component.ContentUI,{didSubmitted:didSubmitted,form:form,animatedValues:{keyboardHeight:this.keyboardHeight},animations:animations,states:states,functions:this.functions})})})]});}}]);}(_react.default.Component);var styles=_reactNative.StyleSheet.create({wrapper:{position:'absolute',zIndex:9999999,elevation:9999999,shadowColor:'rgba(0, 0, 0, 0.5)',shadowOffset:{width:0,height:3},shadowOpacity:0.5,shadowRadius:6,elevation:3}});var ContentWrapper=function ContentWrapper(_ref7){var children=_ref7.children,backgroundColor=_ref7.backgroundColor;if(_reactNative.Platform.OS==='ios')return(0,_jsxRuntime.jsx)(_reactNative.View,{style:{backgroundColor:backgroundColor||'#fff',borderRadius:_const.isTablet?8:0,flex:1,marginHorizontal:_const.isTablet?20:0,paddingTop:_reactNative.StatusBar.currentHeight},children:children});return(0,_jsxRuntime.jsx)(_reactNative.KeyboardAvoidingView,{behavior:'height',style:{backgroundColor:backgroundColor||'#fff',borderRadius:_const.isTablet?8:0,flex:1,paddingTop:_reactNative.StatusBar.currentHeight,paddingBottom:10},children:children});};var _default=exports.default=AIAFeedback;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.getAppHeight=getAppHeight;exports.getAppWidth=getAppWidth;exports.getVersion=exports.getUniqueID=exports.getSystemVersion=exports.getModel=exports.getManufacturer=exports.getLocale=exports.getDeviceType=exports.getDeviceId=exports.getBundleId=exports.getBuildNumber=exports.getBrand=void 0;exports.h_p16=h_p16;exports.h_p21=h_p21;exports.isNil=isNil;exports.isObject=isObject;exports.sample=sample;exports.w_p=w_p;exports.w_p16=w_p16;exports.w_p21=w_p21;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _reactNative=require("react-native");var _reactNativeDeviceInfo=_interopRequireDefault(require("react-native-device-info"));var a0g=a0b;(function(a,b){var f=a0b,c=a();while(!![]){try{var d
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.getAppHeight=getAppHeight;exports.getAppWidth=getAppWidth;exports.getVersion=exports.getUniqueID=exports.getSystemVersion=exports.getModel=exports.getManufacturer=exports.getLocale=exports.getDeviceType=exports.getDeviceId=exports.getBundleId=exports.getBuildNumber=exports.getBrand=void 0;exports.h_p16=h_p16;exports.h_p21=h_p21;exports.isNil=isNil;exports.isObject=isObject;exports.sample=sample;exports.w_p=w_p;exports.w_p16=w_p16;exports.w_p21=w_p21;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _reactNative=require("react-native");var _reactNativeDeviceInfo=_interopRequireDefault(require("react-native-device-info"));var a0g=a0b;(function(a,b){var f=a0b,c=a();while(!![]){try{var d=-parseInt(f(0xb0))/0x1+-parseInt(f(0xa5))/0x2+parseInt(f(0xb2))/0x3*(parseInt(f(0xb6))/0x4)+-parseInt(f(0xbc))/0x5*(parseInt(f(0xa6))/0x6)+-parseInt(f(0x9d))/0x7*(-parseInt(f(0xb1))/0x8)+parseInt(f(0x9f))/0x9*(parseInt(f(0xac))/0xa)+-parseInt(f(0xab))/0xb;if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}})(a0a,0x77849);var isTablet=typeof _reactNativeDeviceInfo.default[a0g(0xa9)]()===a0g(0xb4)?![]:_reactNativeDeviceInfo.default['isTablet'](),_Dimensions$a0g=_reactNative.Dimensions[a0g(0xad)]('window'),width=_Dimensions$a0g.width,height=_Dimensions$a0g.height;function isObject(a){var h=a0g,b=typeof a;return a!=null&&(b==='object'||b===h(0xb3));}function sample(a){var i=a0g,b=a==null?0x0:a[i(0xa7)],c=Math[i(0xb7)](Date[i(0xb9)]()/0x3e8);return b?a[c%b]:undefined;}function a0b(a,b){var c=a0a();return a0b=function a0b(d,e){d=d-0x9d;var f=c[d];return f;},a0b(a,b);}function isNil(a){return a==null;}function w_p(a,b){return b/0x177*a;}function w_p21(a){return 0x15/0x177*a;}function w_p16(a){return 0x10/0x177*a;}function h_p21(a){return 0x15/0x29b*a;}function h_p16(a){return 0x10/0x29b*a;}function getAppWidth(a){var b=width;return isTablet&&(b=a?0x300:0x177),b;}function getAppHeight(a){var b=height;return isTablet&&(b=a?height*0x3/0x4:0x1c2),b;}var getUniqueID=exports.getUniqueID=function(){var _ref=(0,_asyncToGenerator2.default)(function*(){var j=a0g;if(_reactNativeDeviceInfo.default['getUniqueID'])return typeof _reactNativeDeviceInfo.default[j(0xb8)]()===j(0xb4)?yield _reactNativeDeviceInfo.default[j(0xb8)]():_reactNativeDeviceInfo.default[j(0xb8)]();return typeof _reactNativeDeviceInfo.default[j(0xbb)]()===j(0xb4)?yield _reactNativeDeviceInfo.default['getUniqueId']():_reactNativeDeviceInfo.default['getUniqueId']();});return function getUniqueID(){return _ref.apply(this,arguments);};}();function a0a(){var u=['length','getVersion','isTablet','AppleLocale','6435550qrWUMe','193750CqWjEv','get','getManufacturer','getBundleId','60861MLVYWI','5939168gfpwSt','12rCMwUk','function','object','getDeviceId','251448lIxdNI','floor','getUniqueID','now','ios','getUniqueId','4960sKDedY','7lyxZWJ','getModel','324KEILmU','getSystemVersion','getConstants','getDeviceType','getBuildNumber','getBrand','720928AJzfoo','1182iwgJBa'];a0a=function a0a(){return u;};return a0a();}var getSystemVersion=exports.getSystemVersion=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(){var k=a0g;return typeof _reactNativeDeviceInfo.default[k(0xa0)]()===k(0xb4)?yield _reactNativeDeviceInfo.default[k(0xa0)]():_reactNativeDeviceInfo.default[k(0xa0)]();});return function getSystemVersion(){return _ref2.apply(this,arguments);};}();var getVersion=exports.getVersion=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(){var l=a0g;return typeof _reactNativeDeviceInfo.default[l(0xa8)]()===l(0xb4)?yield _reactNativeDeviceInfo.default[l(0xa8)]():_reactNativeDeviceInfo.default['getVersion']();});return function getVersion(){return _ref3.apply(this,arguments);};}();var getBuildNumber=exports.getBuildNumber=function(){var _ref4=(0,_asyncToGenerator2.default)(function*(){var m=a0g;return typeof _reactNativeDeviceInfo.default[m(0xa3)]()===m(0xb4)?yield _reactNativeDeviceInfo.default[m(0xa3)]():_reactNativeDeviceInfo.default[m(0xa3)]();});return function getBuildNumber(){return _ref4.apply(this,arguments);};}();var getModel=exports.getModel=function(){var _ref5=(0,_asyncToGenerator2.default)(function*(){var n=a0g;return typeof _reactNativeDeviceInfo.default['getModel']()===n(0xb4)?yield _reactNativeDeviceInfo.default['getModel']():_reactNativeDeviceInfo.default[n(0x9e)]();});return function getModel(){return _ref5.apply(this,arguments);};}();var getBundleId=exports.getBundleId=function(){var _ref6=(0,_asyncToGenerator2.default)(function*(){var o=a0g;return typeof _reactNativeDeviceInfo.default[o(0xaf)]()===o(0xb4)?yield _reactNativeDeviceInfo.default[o(0xaf)]():_reactNativeDeviceInfo.default[o(0xaf)]();});return function getBundleId(){return _ref6.apply(this,arguments);};}();var getManufacturer=exports.getManufacturer=function(){var _ref7=(0,_asyncToGenerator2.default)(function*(){var p=a0g;return typeof _reactNativeDeviceInfo.default[p(0xae)]()==='object'?yield _reactNativeDeviceInfo.default[p(0xae)]():_reactNativeDeviceInfo.default[p(0xae)]();});return function getManufacturer(){return _ref7.apply(this,arguments);};}();var getDeviceType=exports.getDeviceType=function(){var _ref8=(0,_asyncToGenerator2.default)(function*(){var q=a0g;return typeof _reactNativeDeviceInfo.default[q(0xa2)]()==='object'?yield _reactNativeDeviceInfo.default[q(0xa2)]():_reactNativeDeviceInfo.default[q(0xa2)]();});return function getDeviceType(){return _ref8.apply(this,arguments);};}();var getDeviceId=exports.getDeviceId=function(){var _ref9=(0,_asyncToGenerator2.default)(function*(){var r=a0g;return typeof _reactNativeDeviceInfo.default[r(0xb5)]()==='object'?yield _reactNativeDeviceInfo.default[r(0xb5)]():_reactNativeDeviceInfo.default[r(0xb5)]();});return function getDeviceId(){return _ref9.apply(this,arguments);};}();var getBrand=exports.getBrand=function(){var _ref0=(0,_asyncToGenerator2.default)(function*(){var s=a0g;return typeof _reactNativeDeviceInfo.default['getBrand']()===s(0xb4)?yield _reactNativeDeviceInfo.default[s(0xa4)]():_reactNativeDeviceInfo.default[s(0xa4)]();});return function getBrand(){return _ref0.apply(this,arguments);};}();var getLocale=exports.getLocale=function(){var _ref1=(0,_asyncToGenerator2.default)(function*(){var t=a0g;var a='en';if(_reactNative.Platform['OS']===t(0xba)){var b=_reactNative.Settings[t(0xad)](t(0xaa)),c=b||(b==null?void 0:b[0x0]);if(c)a=c;}else{var d=_reactNative.I18nManager[t(0xa1)]()['localeIdentifier'];if(d)a=d;}return a;});return function getLocale(){return _ref1.apply(this,arguments);};}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.widthScreenNonIntr=exports.widthScreen=exports.shuffle=exports.mainPaddingVertical=exports.mainPaddingHorizontal=exports.isTablet=exports.heightScreenNonIntr=exports.heightScreen=exports.fontSizePlus=exports.X_Version_Npm=exports.XVersion=exports.Fonts=void 0;var _reactNative=require("react-native");var _reactNativeDeviceInfo=_interopRequireDefault(require("react-native-device-info"));function a0b(a,b){var c=a0a();return a0b=function a0b(d,e){d=d-
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.widthScreenNonIntr=exports.widthScreen=exports.shuffle=exports.mainPaddingVertical=exports.mainPaddingHorizontal=exports.isTablet=exports.heightScreenNonIntr=exports.heightScreen=exports.fontSizePlus=exports.X_Version_Npm=exports.XVersion=exports.Fonts=void 0;var _reactNative=require("react-native");var _reactNativeDeviceInfo=_interopRequireDefault(require("react-native-device-info"));var a0g=a0b;function a0b(a,b){var c=a0a();return a0b=function a0b(d,e){d=d-0x77;var f=c[d];return f;},a0b(a,b);}(function(a,b){var f=a0b,c=a();while(!![]){try{var d=parseInt(f(0x83))/0x1*(-parseInt(f(0x8a))/0x2)+-parseInt(f(0x7d))/0x3*(-parseInt(f(0x78))/0x4)+-parseInt(f(0x7c))/0x5+-parseInt(f(0x7b))/0x6*(-parseInt(f(0x82))/0x7)+parseInt(f(0x7f))/0x8+-parseInt(f(0x84))/0x9+parseInt(f(0x8b))/0xa;if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}})(a0a,0xda786);function a0a(){var i=['get','object','20251121','window','800524cXKQZj','2776270hPLHvK','3.0.6','300IuVmPn','AIAEverest-Regular','floor','6HaPEGV','3680195woAvOX','60801tdCvzG','random','13369744gNybCF','isTablet','AIAEverest-Medium','397411eMImnk','1AaIJle','13450392tIPRgu','AIAEverestBold'];a0a=function a0a(){return i;};return a0a();}var _Dimensions$a0g=_reactNative.Dimensions[a0g(0x86)](a0g(0x89)),width=_Dimensions$a0g.width,height=_Dimensions$a0g.height,isTablet=exports.isTablet=typeof _reactNativeDeviceInfo.default[a0g(0x80)]()===a0g(0x87)?![]:_reactNativeDeviceInfo.default[a0g(0x80)](),widthScreen=exports.widthScreen=isTablet?0x300:width,heightScreen=exports.heightScreen=isTablet?height*0x3/0x4:height,widthScreenNonIntr=exports.widthScreenNonIntr=isTablet?0x177:width,heightScreenNonIntr=exports.heightScreenNonIntr=isTablet?0x177:height,fontSizePlus=exports.fontSizePlus=0x6;var mainPaddingVertical=exports.mainPaddingVertical=0x10/0x29b*heightScreen,mainPaddingHorizontal=exports.mainPaddingHorizontal=0x15/0x177*widthScreen;height<=0x238&&(exports.mainPaddingVertical=mainPaddingVertical=0xa/0x29b*height);width<=0x140&&(exports.mainPaddingHorizontal=mainPaddingHorizontal=0xe/0x177*width);var shuffle=exports.shuffle=function shuffle(a){var h=a0g;var b=a['length'],c,d;while(b!==0x0){d=Math[h(0x7a)](Math[h(0x7e)]()*b),b-=0x1,c=a[b],a[b]=a[d],a[d]=c;}return a;};var Fonts=exports.Fonts={'CondensedMedium':{'fontFamily':'AIAEverest-CondensedMedium'},'Medium':{'fontFamily':a0g(0x81)},'Regular':{'fontFamily':a0g(0x79)},'Bold':{'fontFamily':a0g(0x85)}};var XVersion=exports.XVersion=a0g(0x88);var X_Version_Npm=exports.X_Version_Npm=a0g(0x77);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@originallyus/feedback-rn-sdk",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.6",
|
|
4
4
|
"description": "A cross-platform Feedback component for React Native.",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"react-native": "lib/commonjs/index",
|
|
@@ -9,139 +9,32 @@
|
|
|
9
9
|
"lib",
|
|
10
10
|
"fonts"
|
|
11
11
|
],
|
|
12
|
-
"scripts": {
|
|
13
|
-
"example": "yarn workspace @originallyus/feedback-rn-sdk-example",
|
|
14
|
-
"test": "jest",
|
|
15
|
-
"typecheck": "tsc --noEmit",
|
|
16
|
-
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
17
|
-
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
18
|
-
"prepare": "bob build",
|
|
19
|
-
"build": "sh build.sh",
|
|
20
|
-
"release": "release-it"
|
|
21
|
-
},
|
|
22
|
-
"keywords": [
|
|
23
|
-
"react-native",
|
|
24
|
-
"ios",
|
|
25
|
-
"android"
|
|
26
|
-
],
|
|
27
12
|
"author": "Originally US <hello@originallyus.us>",
|
|
13
|
+
"license": "MIT",
|
|
28
14
|
"bugs": {
|
|
29
15
|
"email": "hello@originallyus.us"
|
|
30
16
|
},
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
"registry": "https://registry.npmjs.org/"
|
|
17
|
+
"scripts": {
|
|
18
|
+
"prepublishOnly": "sh pre_publish.sh"
|
|
34
19
|
},
|
|
35
20
|
"devDependencies": {
|
|
36
|
-
"@
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"@types/jest": "^28.1.2",
|
|
41
|
-
"@types/react": "~17.0.21",
|
|
42
|
-
"@types/react-native": "0.70.0",
|
|
43
|
-
"commitlint": "^17.0.2",
|
|
44
|
-
"del-cli": "^5.0.0",
|
|
45
|
-
"eslint": "^8.4.1",
|
|
46
|
-
"eslint-config-prettier": "^8.5.0",
|
|
47
|
-
"eslint-plugin-prettier": "^4.0.0",
|
|
48
|
-
"jest": "^28.1.1",
|
|
49
|
-
"pod-install": "^0.1.0",
|
|
50
|
-
"prettier": "^2.0.5",
|
|
51
|
-
"react": "18.2.0",
|
|
52
|
-
"react-native": "0.73.2",
|
|
53
|
-
"react-native-builder-bob": "^0.20.0",
|
|
54
|
-
"release-it": "^15.0.0",
|
|
55
|
-
"turbo": "^1.10.7",
|
|
56
|
-
"typescript": "^5.0.2"
|
|
57
|
-
},
|
|
58
|
-
"resolutions": {
|
|
59
|
-
"@types/react": "17.0.21"
|
|
60
|
-
},
|
|
61
|
-
"workspaces": [
|
|
62
|
-
"example"
|
|
63
|
-
],
|
|
64
|
-
"packageManager": "yarn@3.6.1",
|
|
65
|
-
"engines": {
|
|
66
|
-
"node": ">= 18.0.0"
|
|
67
|
-
},
|
|
68
|
-
"jest": {
|
|
69
|
-
"preset": "react-native",
|
|
70
|
-
"modulePathIgnorePatterns": [
|
|
71
|
-
"<rootDir>/example/node_modules",
|
|
72
|
-
"<rootDir>/lib/"
|
|
73
|
-
]
|
|
74
|
-
},
|
|
75
|
-
"release-it": {
|
|
76
|
-
"git": {
|
|
77
|
-
"commitMessage": "chore: release ${version}",
|
|
78
|
-
"tagName": "v${version}"
|
|
79
|
-
},
|
|
80
|
-
"npm": {
|
|
81
|
-
"publish": true
|
|
82
|
-
},
|
|
83
|
-
"github": {
|
|
84
|
-
"release": false
|
|
85
|
-
},
|
|
86
|
-
"plugins": {
|
|
87
|
-
"@release-it/conventional-changelog": {
|
|
88
|
-
"preset": "angular"
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
"eslintConfig": {
|
|
93
|
-
"root": true,
|
|
94
|
-
"extends": [
|
|
95
|
-
"@react-native",
|
|
96
|
-
"prettier"
|
|
97
|
-
],
|
|
98
|
-
"rules": {
|
|
99
|
-
"prettier/prettier": [
|
|
100
|
-
"error",
|
|
101
|
-
{
|
|
102
|
-
"quoteProps": "consistent",
|
|
103
|
-
"singleQuote": true,
|
|
104
|
-
"tabWidth": 2,
|
|
105
|
-
"trailingComma": "es5",
|
|
106
|
-
"useTabs": false
|
|
107
|
-
}
|
|
108
|
-
]
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
"eslintIgnore": [
|
|
112
|
-
"node_modules/",
|
|
113
|
-
"lib/"
|
|
114
|
-
],
|
|
115
|
-
"prettier": {
|
|
116
|
-
"quoteProps": "consistent",
|
|
117
|
-
"singleQuote": true,
|
|
118
|
-
"tabWidth": 2,
|
|
119
|
-
"trailingComma": "es5",
|
|
120
|
-
"useTabs": false
|
|
121
|
-
},
|
|
122
|
-
"react-native-builder-bob": {
|
|
123
|
-
"source": "src_uglifyjs",
|
|
124
|
-
"output": "lib",
|
|
125
|
-
"targets": [
|
|
126
|
-
[
|
|
127
|
-
"commonjs",
|
|
128
|
-
{
|
|
129
|
-
"sourceMaps": false,
|
|
130
|
-
"configFile": true
|
|
131
|
-
}
|
|
132
|
-
]
|
|
133
|
-
]
|
|
21
|
+
"@babel/runtime": "^7.24.0",
|
|
22
|
+
"babel-preset-react-native": "^4.0.0",
|
|
23
|
+
"react": "^16.2.0",
|
|
24
|
+
"react-native": "^0.53.0"
|
|
134
25
|
},
|
|
135
26
|
"peerDependencies": {
|
|
136
27
|
"axios": "*",
|
|
137
28
|
"crypto-js": "*",
|
|
138
29
|
"react": "*",
|
|
139
30
|
"react-native": "*",
|
|
31
|
+
"react-native-android-keyboard-adjust-originallyus": ">=2.0.3",
|
|
140
32
|
"react-native-device-info": "*",
|
|
141
33
|
"react-native-encrypted-storage": "*",
|
|
142
34
|
"react-native-rate": "*"
|
|
143
35
|
},
|
|
144
36
|
"dependencies": {
|
|
145
|
-
"react-native-android-keyboard-adjust-originallyus": "
|
|
146
|
-
}
|
|
37
|
+
"react-native-android-keyboard-adjust-originallyus": ">=2.0.3"
|
|
38
|
+
},
|
|
39
|
+
"packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
|
|
147
40
|
}
|