react-native-package-fast 0.2.3 → 0.2.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-package-fast",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "test",
5
5
  "main": "./src/module/index.js",
6
6
  "types": "./src/typescript/index.d.ts",
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.toastFunc=exports.default=exports.dataSave=exports.copyFunc=exports.checkKey=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")),_asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")),_react=_interopRequireWildcard(require("react")),_reactNative=require("react-native"),_ColorsLog=_interopRequireDefault(require("./components/ColorsLog")),_NetworkLogger=_interopRequireDefault(require("./components/NetworkLogger")),_libs=require("./libs"),_index=require("../index"),_reactNativeDeviceInfo=_interopRequireDefault(require("react-native-device-info"));function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!=typeof obj&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!=key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}return newObj.default=obj,cache&&cache.set(obj,newObj),newObj}function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var source,i=1;i<arguments.length;i++)for(var key in source=arguments[i],source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);return target},_extends.apply(this,arguments)}function formatCurrentDate(){var d=new Date,month=""+(d.getMonth()+1),day=""+d.getDate(),year=d.getFullYear();return 2>month.length&&(month="0"+month),2>day.length&&(day="0"+day),[year,month,day].join("")}var copyFunc=function(){};exports.copyFunc=copyFunc;var toastFunc=function(){};exports.toastFunc=toastFunc;var checkKey=function(){var _ref=(0,_asyncToGenerator2.default)(function*(_cer){if(_cer){var _DeviceInfo$getApplic,_encode$split,_encode$split2,appName=null===_reactNativeDeviceInfo.default||void 0===_reactNativeDeviceInfo.default||null===(_DeviceInfo$getApplic=_reactNativeDeviceInfo.default.getApplicationName)||void 0===_DeviceInfo$getApplic?void 0:_DeviceInfo$getApplic.call(_reactNativeDeviceInfo.default),encode=yield(0,_index.CryptoCore)().decrypt(_cer),current=formatCurrentDate(),time=null===encode||void 0===encode||null===(_encode$split=encode.split("_"))||void 0===_encode$split?void 0:_encode$split[0],name=null===encode||void 0===encode||null===(_encode$split2=encode.split("_"))||void 0===_encode$split2?void 0:_encode$split2[1];return!!(8===(null===time||void 0===time?void 0:time.length)&&time>current&&appName.toLowerCase()===name.toLowerCase())}return!1});return function(){return _ref.apply(this,arguments)}}();exports.checkKey=checkKey;var dataSave={tabCurrent:"all",debug:!1};exports.dataSave=dataSave;var FloatButtonLogger=(0,_react.forwardRef)(function(props,ref){var _useState=(0,_react.useState)(!1),_useState2=(0,_slicedToArray2.default)(_useState,2),isOpenList=_useState2[0],setOpenList=_useState2[1],_useState3=(0,_react.useState)(!1),_useState4=(0,_slicedToArray2.default)(_useState3,2),isVisible=_useState4[0],setVisible=_useState4[1],dataRef=(0,_react.useRef)((null===props||void 0===props?void 0:props.data)||{}),init=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(){var can=yield checkKey(null===props||void 0===props?void 0:props.certification);if(can){var _props$data,_props$data2,_props$data3;setVisible(null===props||void 0===props?void 0:props.visible),exports.copyFunc=copyFunc=null===props||void 0===props||null===(_props$data=props.data)||void 0===_props$data?void 0:_props$data.copyFunc,exports.toastFunc=toastFunc=null===props||void 0===props||null===(_props$data2=props.data)||void 0===_props$data2?void 0:_props$data2.toastFunc,dataSave.tabCurrent=(null===props||void 0===props||null===(_props$data3=props.data)||void 0===_props$data3?void 0:_props$data3.initTab)||"all",dataSave.debug=(null===props||void 0===props?void 0:props.debug)||!1,(0,_index.startNetworkLogging)(),_reactNative.DeviceEventEmitter.addListener("logData",function(data){_index.listLogs.push(Object.assign({},data,{time:new Date,type:"log"}))})}});return function(){return _ref2.apply(this,arguments)}}();(0,_react.useMemo)(function(){init()},[]);var show=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(data){var can=yield checkKey(null===data||void 0===data?void 0:data.certification);if(can){var _dataRef$current,_dataRef$current2,_dataRef$current3,_dataRef$current4;dataRef.current=data||{},setVisible(!0),exports.copyFunc=copyFunc=null===(_dataRef$current=dataRef.current)||void 0===_dataRef$current?void 0:_dataRef$current.copyFunc,exports.toastFunc=toastFunc=null===(_dataRef$current2=dataRef.current)||void 0===_dataRef$current2?void 0:_dataRef$current2.toastFunc,dataSave.debug=(null===(_dataRef$current3=dataRef.current)||void 0===_dataRef$current3?void 0:_dataRef$current3.debug)||!1,dataSave.tabCurrent=(null===(_dataRef$current4=dataRef.current)||void 0===_dataRef$current4?void 0:_dataRef$current4.initTab)||"all",(0,_index.startNetworkLogging)(),_reactNative.DeviceEventEmitter.addListener("logData",function(data){_index.listLogs.push(Object.assign({},data,{time:new Date,type:"log"}))})}});return function(){return _ref3.apply(this,arguments)}}();return(0,_react.useImperativeHandle)(ref,function(){return{show:show,hide:function hide(){setVisible(!1)}}}),isVisible?isOpenList?_react.default.createElement(_libs.ViewAppLog,{pointerEvents:"box-none",style:{position:"absolute",left:0,bottom:0,right:0,top:0,justifyContent:"flex-end"}},_react.default.createElement(_libs.ViewAppLog,{flex:1},_react.default.createElement(_NetworkLogger.default,_extends({onBack:function onBack(){setOpenList(!1)}},dataRef.current)))):_react.default.createElement(_reactNative.TouchableOpacity,{onLongPress:null===props||void 0===props?void 0:props.onLongPress,style:{position:"absolute",left:0,bottom:100},onPress:function onPress(){setOpenList(!0)}},_react.default.createElement(_libs.ViewAppLog,{center:!0,width:15,height:100,style:{backgroundColor:_ColorsLog.default.badge_28,borderTopRightRadius:60,borderBottomRightRadius:60}})):null}),_default=FloatButtonLogger;export default _default;
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.toastFunc=exports.default=exports.dataSave=exports.copyFunc=exports.checkKey=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")),_asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")),_react=_interopRequireWildcard(require("react")),_reactNative=require("react-native"),_ColorsLog=_interopRequireDefault(require("./components/ColorsLog")),_NetworkLogger=_interopRequireDefault(require("./components/NetworkLogger")),_libs=require("./libs"),_index=require("../index"),_reactNativeDeviceInfo=_interopRequireDefault(require("react-native-device-info"));function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!=typeof obj&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!=key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}return newObj.default=obj,cache&&cache.set(obj,newObj),newObj}function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var source,i=1;i<arguments.length;i++)for(var key in source=arguments[i],source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);return target},_extends.apply(this,arguments)}function formatCurrentDate(){var d=new Date,month=""+(d.getMonth()+1),day=""+d.getDate(),year=d.getFullYear();return 2>month.length&&(month="0"+month),2>day.length&&(day="0"+day),[year,month,day].join("")}var copyFunc=function(){};exports.copyFunc=copyFunc;var toastFunc=function(){};exports.toastFunc=toastFunc;var checkKey=function(){var _ref=(0,_asyncToGenerator2.default)(function*(_cer){if(_cer){var _DeviceInfo$getApplic,_encode$split,_encode$split2,appName=null===_reactNativeDeviceInfo.default||void 0===_reactNativeDeviceInfo.default||null===(_DeviceInfo$getApplic=_reactNativeDeviceInfo.default.getApplicationName)||void 0===_DeviceInfo$getApplic?void 0:_DeviceInfo$getApplic.call(_reactNativeDeviceInfo.default),encode=yield(0,_index.CryptoCore)().decrypt(_cer),current=formatCurrentDate(),time=null===encode||void 0===encode||null===(_encode$split=encode.split("_"))||void 0===_encode$split?void 0:_encode$split[0],name=null===encode||void 0===encode||null===(_encode$split2=encode.split("_"))||void 0===_encode$split2?void 0:_encode$split2[1];return!!(8===(null===time||void 0===time?void 0:time.length)&&time>current&&appName.toLowerCase()===name.toLowerCase())}return!1});return function(){return _ref.apply(this,arguments)}}();exports.checkKey=checkKey;var dataSave={tabCurrent:"all",debug:!1};exports.dataSave=dataSave;var FloatButtonLogger=(0,_react.forwardRef)(function(props,ref){var _useState=(0,_react.useState)(!1),_useState2=(0,_slicedToArray2.default)(_useState,2),isOpenList=_useState2[0],setOpenList=_useState2[1],_useState3=(0,_react.useState)(!1),_useState4=(0,_slicedToArray2.default)(_useState3,2),isVisible=_useState4[0],setVisible=_useState4[1],dataRef=(0,_react.useRef)((null===props||void 0===props?void 0:props.data)||{}),init=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(){var can=yield checkKey(null===props||void 0===props?void 0:props.certification);if(can){var _props$data,_props$data2,_props$data3;setVisible(null===props||void 0===props?void 0:props.visible),exports.copyFunc=copyFunc=null===props||void 0===props||null===(_props$data=props.data)||void 0===_props$data?void 0:_props$data.copyFunc,exports.toastFunc=toastFunc=null===props||void 0===props||null===(_props$data2=props.data)||void 0===_props$data2?void 0:_props$data2.toastFunc,dataSave.tabCurrent=(null===props||void 0===props||null===(_props$data3=props.data)||void 0===_props$data3?void 0:_props$data3.initTab)||"all",dataSave.debug=(null===props||void 0===props?void 0:props.debug)||!1,(0,_index.startNetworkLogging)({forceEnable:!0}),_reactNative.DeviceEventEmitter.addListener("logData",function(data){_index.listLogs.push(Object.assign({},data,{time:new Date,type:"log"}))})}});return function(){return _ref2.apply(this,arguments)}}();(0,_react.useMemo)(function(){init()},[]);var show=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(data){var can=yield checkKey(null===data||void 0===data?void 0:data.certification);if(can){var _dataRef$current,_dataRef$current2,_dataRef$current3,_dataRef$current4;dataRef.current=data||{},setVisible(!0),exports.copyFunc=copyFunc=null===(_dataRef$current=dataRef.current)||void 0===_dataRef$current?void 0:_dataRef$current.copyFunc,exports.toastFunc=toastFunc=null===(_dataRef$current2=dataRef.current)||void 0===_dataRef$current2?void 0:_dataRef$current2.toastFunc,dataSave.debug=(null===(_dataRef$current3=dataRef.current)||void 0===_dataRef$current3?void 0:_dataRef$current3.debug)||!1,dataSave.tabCurrent=(null===(_dataRef$current4=dataRef.current)||void 0===_dataRef$current4?void 0:_dataRef$current4.initTab)||"all",(0,_index.startNetworkLogging)({forceEnable:!0}),_reactNative.DeviceEventEmitter.addListener("logData",function(data){_index.listLogs.push(Object.assign({},data,{time:new Date,type:"log"}))})}});return function(){return _ref3.apply(this,arguments)}}();return(0,_react.useImperativeHandle)(ref,function(){return{show:show,hide:function hide(){setVisible(!1)}}}),isVisible?isOpenList?_react.default.createElement(_libs.ViewAppLog,{pointerEvents:"box-none",style:{position:"absolute",left:0,bottom:0,right:0,top:0,justifyContent:"flex-end"}},_react.default.createElement(_libs.ViewAppLog,{flex:1},_react.default.createElement(_NetworkLogger.default,_extends({onBack:function onBack(){setOpenList(!1)}},dataRef.current)))):_react.default.createElement(_reactNative.TouchableOpacity,{onLongPress:null===props||void 0===props?void 0:props.onLongPress,style:{position:"absolute",left:0,bottom:100},onPress:function onPress(){setOpenList(!0)}},_react.default.createElement(_libs.ViewAppLog,{center:!0,width:15,height:100,style:{backgroundColor:_ColorsLog.default.badge_28,borderTopRightRadius:60,borderBottomRightRadius:60}})):null}),_default=FloatButtonLogger;export default _default;