esoftplay 0.0.110 → 0.0.111
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/bin/build.js +8 -4
- package/bin/router.js +1 -1
- package/error.ts +2 -3
- package/esp.ts +20 -17
- package/modules/lib/crypt.js +2 -1
- package/modules/lib/curl.ts +73 -24
- package/modules/lib/datepicker.tsx +1 -1
- package/modules/lib/image.tsx +1 -1
- package/modules/lib/picture.tsx +10 -5
- package/modules/lib/timepicker.tsx +131 -0
- package/modules/user/index.tsx +7 -5
- package/modules/user/login.tsx +1 -1
- package/modules/user/notification.tsx +3 -3
- package/package.json +1 -1
package/bin/build.js
CHANGED
|
@@ -27,7 +27,7 @@ if (fs.existsSync(packjson)) {
|
|
|
27
27
|
/* ADD SCRIPTS.PRESTART AND SCRIPTS.POSTSTOP */
|
|
28
28
|
|
|
29
29
|
if (args[0] == "install") {
|
|
30
|
-
$package.scripts.start = "esp start && expo start"
|
|
30
|
+
$package.scripts.start = "esp start && expo start --dev-client"
|
|
31
31
|
fs.writeFile(packjson, JSON.stringify($package, null, 2), (err) => {
|
|
32
32
|
if (err) throw err;
|
|
33
33
|
console.log('package.json has been updated');
|
|
@@ -210,9 +210,10 @@ yarn-error.log\n\
|
|
|
210
210
|
import * as ErrorReport from 'esoftplay/error';
|
|
211
211
|
import * as Notifications from 'expo-notifications';
|
|
212
212
|
import React, { useEffect, useRef } from 'react';
|
|
213
|
-
import { enableScreens } from 'react-native-screens';
|
|
213
|
+
import { enableScreens, enableFreeze } from 'react-native-screens';
|
|
214
214
|
const { globalIdx } = require('esoftplay/global');
|
|
215
215
|
enableScreens();
|
|
216
|
+
enableFreeze(true);
|
|
216
217
|
|
|
217
218
|
Notifications.addNotificationResponseReceivedListener(x => LibNotification.onAction(x));
|
|
218
219
|
|
|
@@ -253,11 +254,11 @@ export default function App() {
|
|
|
253
254
|
'expo-status-bar',
|
|
254
255
|
'expo-secure-store',
|
|
255
256
|
'expo-updates',
|
|
256
|
-
'firebase',
|
|
257
257
|
'immhelper',
|
|
258
258
|
'dayjs',
|
|
259
259
|
'react-fast-compare',
|
|
260
260
|
'react-native-gesture-handler',
|
|
261
|
+
'react-native-fast-image',
|
|
261
262
|
'react-native-awesome-gallery',
|
|
262
263
|
'react-native-picker-scrollview',
|
|
263
264
|
'react-native-pinch-zoom-view-movable',
|
|
@@ -310,8 +311,11 @@ export default function App() {
|
|
|
310
311
|
cmd += "&& yarn add " + installDevLibs.join(" ") + " --dev "
|
|
311
312
|
if (installExpoLibs.length > 0)
|
|
312
313
|
cmd += "&& expo install " + installExpoLibs.join(" ")
|
|
313
|
-
|
|
314
|
+
cmd += " && node ./node_modules/esoftplay/bin/router.js"
|
|
314
315
|
execSync(cmd)
|
|
316
|
+
// if (fs.existsSync("../../node_modules/esoftplay/bin/router.js")) {
|
|
317
|
+
// execSync("node ../../node_modules/esoftplay/bin/router.js")
|
|
318
|
+
// }
|
|
315
319
|
console.log('App.js has been replace to App.tsx');
|
|
316
320
|
// /* bugfix AsyncStorage @firebase, remove this section if firebase has update the AsyncStorage */
|
|
317
321
|
// if (fs.existsSync('../@firebase/app/dist/index.rn.cjs.js')) {
|
package/bin/router.js
CHANGED
|
@@ -383,7 +383,7 @@ declare module "esoftplay" {
|
|
|
383
383
|
function useGlobalState<S>(initialState?: S, option?: useGlobalOption): useGlobalReturn<S>;
|
|
384
384
|
function usePersistState<S>(key: string, initialState?: S | (() => S)): [S, (a: S | ((b: S )=> S)) => S | undefined, (a?: (x: S) => void) => void, () => void];
|
|
385
385
|
function useSafeState<S>(initialState?: S | (() => S)): [S, (a: S | ((b: S )=> S)) => S | undefined];
|
|
386
|
-
function applyStyle(style:
|
|
386
|
+
function applyStyle<T>(style: T): T;
|
|
387
387
|
function usePersistState<S>(key: string, initialState?: S | (() => S)): [S, (a: S) => void, (a?: (x: S)=> void) => void, () => void];
|
|
388
388
|
namespace esp {
|
|
389
389
|
function appjson(): any;
|
package/error.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
2
|
-
import { LibCurl, UserClass } from 'esoftplay';
|
|
2
|
+
import { LibCurl, UserClass, esp } from 'esoftplay';
|
|
3
3
|
import Constants from 'expo-constants';
|
|
4
4
|
import { Platform } from 'react-native';
|
|
5
|
-
import esp from './esp';
|
|
6
5
|
import { default as UserRoutes } from './modules/user/routes';
|
|
7
6
|
let pack = require('../../package.json');
|
|
8
7
|
let app = require('../../app.json');
|
|
@@ -42,7 +41,7 @@ export function reportApiError(fetch: any, error: any) {
|
|
|
42
41
|
'fetch: ' + String(JSON.stringify(fetch || {}, undefined, 2)).replace(/[\[\]\{\}\"]+/g, ''),
|
|
43
42
|
'error: ' + error
|
|
44
43
|
].join('\n')
|
|
45
|
-
|
|
44
|
+
|
|
46
45
|
if (manifest?.packagerOpts) {
|
|
47
46
|
let post = {
|
|
48
47
|
text: msg,
|
package/esp.ts
CHANGED
|
@@ -10,25 +10,28 @@ LogBox.ignoreLogs(['YellowBox has been replaced with LogBox. Please call LogBox.
|
|
|
10
10
|
LogBox.ignoreLogs(['VirtualizedLists should never be nested inside plain ScrollViews with the same orientation - use another VirtualizedList-backed container instead.']);
|
|
11
11
|
let app = require('../../app.json');
|
|
12
12
|
let conf = require('../../config.json');
|
|
13
|
-
let lconf
|
|
13
|
+
let lconf
|
|
14
|
+
try {
|
|
15
|
+
lconf = require('../../config.live.json');
|
|
16
|
+
} catch (error) {
|
|
17
|
+
|
|
18
|
+
}
|
|
14
19
|
|
|
15
20
|
export default (() => {
|
|
16
|
-
function mergeDeep(target
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} else {
|
|
29
|
-
target[key] = sourceValue;
|
|
21
|
+
function mergeDeep(target, ...sources) {
|
|
22
|
+
target = Object(target);
|
|
23
|
+
for (let source of sources) {
|
|
24
|
+
source = Object(source);
|
|
25
|
+
for (let key in source) {
|
|
26
|
+
if (source.hasOwnProperty(key)) {
|
|
27
|
+
if (source[key] && typeof source[key] === 'object') {
|
|
28
|
+
target[key] = mergeDeep(target[key], source[key]);
|
|
29
|
+
} else {
|
|
30
|
+
target[key] = source[key];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
30
33
|
}
|
|
31
|
-
}
|
|
34
|
+
}
|
|
32
35
|
return target;
|
|
33
36
|
}
|
|
34
37
|
app = mergeDeep(app, conf)
|
|
@@ -89,7 +92,7 @@ export default (() => {
|
|
|
89
92
|
function lang(moduleTask: string, langName: string, ...stringToBe: string[]): string {
|
|
90
93
|
let string = esp.assets("locale/" + langId() + ".json")?.[moduleTask]?.[langName]
|
|
91
94
|
if (!string) {
|
|
92
|
-
string = esp.assets("locale/id.json")
|
|
95
|
+
string = esp.assets("locale/id.json")[moduleTask][langName]
|
|
93
96
|
}
|
|
94
97
|
function sprintf(string: string, index: number) {
|
|
95
98
|
if (stringToBe[index] != undefined) {
|