esoftplay 0.0.108-q → 0.0.108-u

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/_cache.ts CHANGED
@@ -42,7 +42,9 @@ export default (() => {
42
42
  if (o?.persistKey) {
43
43
  AsyncStorage.setItem(o.persistKey, JSON.stringify(value[_idx]))
44
44
  }
45
- o.listener(ns instanceof Function ? ns(value[_idx]) : ns)
45
+ if (o?.listener) {
46
+ o?.listener?.(ns instanceof Function ? ns(value[_idx]) : ns)
47
+ }
46
48
  }
47
49
  };
48
50
 
package/bin/build.js CHANGED
@@ -255,6 +255,29 @@ yarn.lock\n\
255
255
  console.log('.gitignore has been created');
256
256
  });
257
257
 
258
+ // const AppJS = `import { esp, LibNotification } from 'esoftplay';
259
+ // import * as ErrorReport from 'esoftplay/error';
260
+ // import * as Notifications from 'expo-notifications';
261
+ // import React, { useEffect, useRef } from 'react';
262
+ // import { enableFreeze, enableScreens } from 'react-native-screens';
263
+ // const { globalIdx } = require('esoftplay/global')
264
+ // enableScreens();
265
+ // enableFreeze(true);
266
+
267
+ // Notifications.addNotificationResponseReceivedListener(x => LibNotification.onAction(x))
268
+
269
+ // export default function App() {
270
+ // const Home = useRef(esp.home()).current
271
+
272
+ // useEffect(() => {
273
+ // globalIdx.reset()
274
+ // ErrorReport.getError()
275
+ // }, [])
276
+
277
+ // return <Home />
278
+ // }`;
279
+
280
+
258
281
  const AppJS = `import React, { useEffect, useRef } from 'react';
259
282
  import { esp, LibNotification } from 'esoftplay';
260
283
  import * as ErrorReport from 'esoftplay/error'
@@ -360,13 +383,13 @@ export default function App() {
360
383
  cmd += "&& node ./node_modules/esoftplay/bin/router.js"
361
384
  execSync(cmd, { stdio: ['inherit', 'inherit', 'inherit'] })
362
385
  console.log('App.js has been replace to App.tsx');
363
- /* bugfix AsyncStorage @firebase, remove this section if firebase has update the AsyncStorage */
364
- if (fs.existsSync('../@firebase/app/dist/index.rn.cjs.js')) {
365
- let firebaseText = fs.readFileSync('../@firebase/app/dist/index.rn.cjs.js', 'utf8')
366
- firebaseText = firebaseText.replace("var AsyncStorage = require('react-native').AsyncStorage;", "var AsyncStorage = require('@react-native-async-storage/async-storage').default;")
367
- fs.writeFileSync('../@firebase/app/dist/index.rn.cjs.js', firebaseText)
368
- }
369
- /* end AsyncStorage @firebase section */
386
+ // /* bugfix AsyncStorage @firebase, remove this section if firebase has update the AsyncStorage */
387
+ // if (fs.existsSync('../@firebase/app/dist/index.rn.cjs.js')) {
388
+ // let firebaseText = fs.readFileSync('../@firebase/app/dist/index.rn.cjs.js', 'utf8')
389
+ // firebaseText = firebaseText.replace("var AsyncStorage = require('react-native').AsyncStorage;", "var AsyncStorage = require('@react-native-async-storage/async-storage').default;")
390
+ // fs.writeFileSync('../@firebase/app/dist/index.rn.cjs.js', firebaseText)
391
+ // }
392
+ // /* end AsyncStorage @firebase section */
370
393
  if (fs.existsSync('../@expo/vector-icons')) {
371
394
  let esoftplayIcon = ''
372
395
  fs.readdir('../@expo/vector-icons/build', (err, files) => {
@@ -55,6 +55,7 @@ export default class ecurl {
55
55
  if (this.abort?.cancel) {
56
56
  // reportApiError(`Request timeout`, this.url + this.uri)
57
57
  this.closeConnection()
58
+ LibProgress.hide()
58
59
  }
59
60
  }, customTimeout ?? this.timeout);
60
61
  }
@@ -73,7 +73,7 @@ export default class EList extends LibComponent<LibListProps, LibListState> {
73
73
  render(): any {
74
74
  const isStatic = () => {
75
75
  if (this.props.staticHeight)
76
- return { getItemLayout: (data, index) => this.props.staticHeight ? ({ length: this.props.staticHeight, offset: this.props.staticHeight, index: index }) : undefined }
76
+ return ({ getItemLayout: (data, index) => this.props.staticHeight ? ({ length: this.props.staticHeight, offset: this.props.staticHeight, index: index }) : undefined })
77
77
  }
78
78
  return (
79
79
  <View ref={(e) => this.view = e} style={[{ flex: 1 }]} >
@@ -22,6 +22,19 @@ export default (() => {
22
22
  libNavigationData._navigation = nav
23
23
  }
24
24
 
25
+ static getArgs(props: any, key: string, defOutput?: any): any {
26
+ if (defOutput == undefined) {
27
+ defOutput = "";
28
+ }
29
+ return props?.route?.params?.[key] || defOutput;
30
+ }
31
+ static getArgsAll<S>(props: any, defOutput?: any): S {
32
+ if (defOutput == undefined) {
33
+ defOutput = "";
34
+ }
35
+ return props?.route?.params || defOutput;
36
+ }
37
+
25
38
  static navigation(): any {
26
39
  return libNavigationData?._navigation
27
40
  }
@@ -60,12 +60,14 @@ export default class eutils {
60
60
  }
61
61
 
62
62
  static getArgs(props: any, key: string, defOutput?: any): any {
63
+ console.warn('LibUtils.getArgs is deprecated, use LibNavigation.getArgs instead')
63
64
  if (defOutput == undefined) {
64
65
  defOutput = "";
65
66
  }
66
67
  return props?.route?.params?.[key] || defOutput;
67
68
  }
68
69
  static getArgsAll<S>(props: any, defOutput?: any): S {
70
+ console.warn('LibUtils.getArgsAll is deprecated, use LibNavigation.getArgsAll instead')
69
71
  if (defOutput == undefined) {
70
72
  defOutput = "";
71
73
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay",
3
- "version": "0.0.108-q",
3
+ "version": "0.0.108-u",
4
4
  "description": "embedding data from esoftplay framework (web based) into mobile app",
5
5
  "main": "cache/index.js",
6
6
  "types": "../../index.d.ts",