esoftplay 0.0.135 → 0.0.136
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 +14 -15
- package/bin/cli.js +46 -80
- package/bin/mover.js +81 -79
- package/bin/router.js +2 -0
- package/global.ts +1 -0
- package/modules/lib/carrousel.tsx +17 -13
- package/modules/lib/carrousel_snap.tsx +2 -2
- package/modules/lib/collaps.tsx +3 -3
- package/modules/lib/datepicker.tsx +4 -2
- package/modules/lib/direct_text.tsx +2 -2
- package/modules/lib/editbox.tsx +2 -2
- package/modules/lib/focus.tsx +2 -2
- package/modules/lib/gradient.tsx +2 -1
- package/modules/lib/icon.tsx +14 -13
- package/modules/lib/image.tsx +10 -5
- package/modules/lib/infinite.tsx +2 -3
- package/modules/lib/input.tsx +4 -3
- package/modules/lib/keyboard_avoid.tsx +2 -2
- package/modules/lib/lazy.tsx +2 -1
- package/modules/lib/list.tsx +2 -2
- package/modules/lib/notification.ts +12 -6
- package/modules/lib/picture.tsx +2 -1
- package/modules/lib/pin.tsx +4 -4
- package/modules/lib/scroll.tsx +2 -2
- package/modules/lib/scrollpicker.tsx +5 -3
- package/modules/lib/slidingup.tsx +2 -1
- package/modules/lib/textstyle.tsx +2 -2
- package/modules/lib/toast.tsx +1 -0
- package/modules/lib/updater.tsx +11 -4
- package/modules/lib/video.tsx +2 -2
- package/modules/lib/webview.tsx +10 -8
- package/modules/use/worker.tsx +21 -0
- package/moment.ts +10 -0
- package/package.json +1 -1
- package/timeout.d.ts +2 -0
- package/timeout.ts +91 -0
package/modules/lib/gradient.tsx
CHANGED
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
// noPage
|
|
3
3
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
4
4
|
import React from 'react';
|
|
5
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
5
6
|
|
|
6
7
|
export interface LibGradientArgs {
|
|
7
8
|
|
|
8
9
|
}
|
|
9
10
|
export interface LibGradientProps {
|
|
10
|
-
style?:
|
|
11
|
+
style?: StyleProp<ViewStyle>,
|
|
11
12
|
children: any,
|
|
12
13
|
direction: "top-to-bottom" | "bottom-to-top" | "left-to-right" | "right-to-left" | "top-left-to-bottom-right" | "bottom-right-to-top-left" | "top-right-to-bottom-left" | "bottom-left-to-top-right",
|
|
13
14
|
colors: string[]
|
package/modules/lib/icon.tsx
CHANGED
|
@@ -26,85 +26,86 @@ import {
|
|
|
26
26
|
} from '@expo/vector-icons/build/esoftplay_icons';
|
|
27
27
|
import { LibComponent } from 'esoftplay/cache/lib/component/import';
|
|
28
28
|
import React from 'react';
|
|
29
|
+
import { TextStyle } from 'react-native';
|
|
29
30
|
|
|
30
31
|
export interface LibAntDesignIconProps {
|
|
31
32
|
name: AntDesignTypes,
|
|
32
33
|
size?: number,
|
|
33
34
|
color?: string,
|
|
34
|
-
style?:
|
|
35
|
+
style?: TextStyle
|
|
35
36
|
}
|
|
36
37
|
export interface LibEvilIconsIconProps {
|
|
37
38
|
name: EvilIconsTypes,
|
|
38
39
|
size?: number,
|
|
39
40
|
color?: string,
|
|
40
|
-
style?:
|
|
41
|
+
style?: TextStyle
|
|
41
42
|
}
|
|
42
43
|
export interface LibFeatherIconProps {
|
|
43
44
|
name: FeatherTypes,
|
|
44
45
|
size?: number,
|
|
45
46
|
color?: string,
|
|
46
|
-
style?:
|
|
47
|
+
style?: TextStyle
|
|
47
48
|
}
|
|
48
49
|
export interface LibFontAwesomeIconProps {
|
|
49
50
|
name: FontAwesomeTypes,
|
|
50
51
|
size?: number,
|
|
51
52
|
color?: string,
|
|
52
|
-
style?:
|
|
53
|
+
style?: TextStyle
|
|
53
54
|
}
|
|
54
55
|
export interface LibFontistoIconProps {
|
|
55
56
|
name: FontistoTypes,
|
|
56
57
|
size?: number,
|
|
57
58
|
color?: string,
|
|
58
|
-
style?:
|
|
59
|
+
style?: TextStyle
|
|
59
60
|
}
|
|
60
61
|
export interface LibFoundationIconProps {
|
|
61
62
|
name: FoundationTypes,
|
|
62
63
|
size?: number,
|
|
63
64
|
color?: string,
|
|
64
|
-
style?:
|
|
65
|
+
style?: TextStyle
|
|
65
66
|
}
|
|
66
67
|
export interface LibMaterialIconsIconProps {
|
|
67
68
|
name: MaterialIconsTypes,
|
|
68
69
|
size?: number,
|
|
69
70
|
color?: string,
|
|
70
|
-
style?:
|
|
71
|
+
style?: TextStyle
|
|
71
72
|
}
|
|
72
73
|
export interface LibEntypoIconProps {
|
|
73
74
|
name: EntypoTypes,
|
|
74
75
|
size?: number,
|
|
75
76
|
color?: string,
|
|
76
|
-
style?:
|
|
77
|
+
style?: TextStyle
|
|
77
78
|
}
|
|
78
79
|
export interface LibOcticonsIconProps {
|
|
79
80
|
name: OcticonsTypes,
|
|
80
81
|
size?: number,
|
|
81
82
|
color?: string,
|
|
82
|
-
style?:
|
|
83
|
+
style?: TextStyle
|
|
83
84
|
}
|
|
84
85
|
export interface LibZocialIconProps {
|
|
85
86
|
name: ZocialTypes,
|
|
86
87
|
size?: number,
|
|
87
88
|
color?: string,
|
|
88
|
-
style?:
|
|
89
|
+
style?: TextStyle
|
|
89
90
|
}
|
|
90
91
|
export interface LibSimpleLineIconProps {
|
|
91
92
|
name: SimpleLineIconsTypes,
|
|
92
93
|
size?: number,
|
|
93
94
|
color?: string,
|
|
94
|
-
style?:
|
|
95
|
+
style?: TextStyle
|
|
95
96
|
}
|
|
96
97
|
export interface LibIoniconsProps {
|
|
97
98
|
name: IoniconsTypes,
|
|
98
99
|
size?: number,
|
|
99
100
|
color?: string,
|
|
100
|
-
style?:
|
|
101
|
+
style?: TextStyle
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
export interface LibIconProps {
|
|
104
105
|
name: MaterialCommunityIconsTypes,
|
|
105
106
|
size?: number,
|
|
106
107
|
color?: string,
|
|
107
|
-
style?:
|
|
108
|
+
style?: TextStyle
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
export type LibIconStyle = MaterialCommunityIconsTypes
|
package/modules/lib/image.tsx
CHANGED
|
@@ -104,7 +104,7 @@ class m extends LibComponent<LibImageProps, LibImageState> {
|
|
|
104
104
|
|
|
105
105
|
static fromCamera(options?: LibImageCameraOptions): Promise<string> {
|
|
106
106
|
return new Promise((_r) => {
|
|
107
|
-
|
|
107
|
+
const timer = setTimeout(async () => {
|
|
108
108
|
const cameraPermission = await ImagePicker.getCameraPermissionsAsync();
|
|
109
109
|
var finalStatus = cameraPermission.status
|
|
110
110
|
if (finalStatus !== 'granted') {
|
|
@@ -144,13 +144,14 @@ class m extends LibComponent<LibImageProps, LibImageState> {
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
})
|
|
147
|
+
clearTimeout(timer)
|
|
147
148
|
}, 1);
|
|
148
149
|
})
|
|
149
150
|
}
|
|
150
151
|
|
|
151
152
|
static fromGallery(options?: LibImageGalleryOptions): Promise<string | string[]> {
|
|
152
153
|
return new Promise((_r) => {
|
|
153
|
-
|
|
154
|
+
const timer= setTimeout(async () => {
|
|
154
155
|
const { status } = await ImagePicker.getMediaLibraryPermissionsAsync();
|
|
155
156
|
var finalStatus = status
|
|
156
157
|
if (finalStatus !== 'granted') {
|
|
@@ -231,6 +232,7 @@ class m extends LibComponent<LibImageProps, LibImageState> {
|
|
|
231
232
|
}, 1)
|
|
232
233
|
});
|
|
233
234
|
})
|
|
235
|
+
clearTimeout(timer)
|
|
234
236
|
}, 1)
|
|
235
237
|
})
|
|
236
238
|
}
|
|
@@ -255,7 +257,7 @@ class m extends LibComponent<LibImageProps, LibImageState> {
|
|
|
255
257
|
}
|
|
256
258
|
}
|
|
257
259
|
|
|
258
|
-
|
|
260
|
+
const timer= setTimeout(async () => {
|
|
259
261
|
const manipImage = await ImageManipulator.manipulateAsync(
|
|
260
262
|
result.uri,
|
|
261
263
|
doResize ? [{ resize: { width: wantedwidth, height: wantedheight } }] : [],
|
|
@@ -270,6 +272,7 @@ class m extends LibComponent<LibImageProps, LibImageState> {
|
|
|
270
272
|
LibProgress.hide()
|
|
271
273
|
r(msg.message);
|
|
272
274
|
}, 1)
|
|
275
|
+
clearTimeout(timer)
|
|
273
276
|
}, 1);
|
|
274
277
|
}
|
|
275
278
|
})
|
|
@@ -333,22 +336,24 @@ class m extends LibComponent<LibImageProps, LibImageState> {
|
|
|
333
336
|
{
|
|
334
337
|
image ?
|
|
335
338
|
<TouchableOpacity onPress={() => {
|
|
336
|
-
setTimeout(
|
|
339
|
+
const timer = setTimeout(
|
|
337
340
|
async () => {
|
|
338
341
|
let imageUri = await m.processImage(image, maxDimension)
|
|
339
342
|
m.setResult(imageUri)
|
|
340
343
|
this.setState({ image: null })
|
|
344
|
+
clearTimeout(timer)
|
|
341
345
|
});
|
|
342
346
|
}} >
|
|
343
347
|
<LibIcon.Ionicons name='ios-checkmark-circle' style={{ fontSize: 40, color: 'white' }} />
|
|
344
348
|
</TouchableOpacity>
|
|
345
349
|
:
|
|
346
350
|
<TouchableOpacity onPress={() => {
|
|
347
|
-
|
|
351
|
+
const timer = setTimeout(
|
|
348
352
|
async () => {
|
|
349
353
|
m.hide()
|
|
350
354
|
this.setState({ image: null })
|
|
351
355
|
});
|
|
356
|
+
clearTimeout(timer)
|
|
352
357
|
}} >
|
|
353
358
|
<LibIcon.Ionicons name='ios-close-circle' style={{ fontSize: 40, color: 'white' }} />
|
|
354
359
|
</TouchableOpacity>
|
package/modules/lib/infinite.tsx
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
// noPage
|
|
2
|
-
import { FlashList } from "@shopify/flash-list";
|
|
2
|
+
import { ContentStyle, FlashList } from "@shopify/flash-list";
|
|
3
3
|
import { LibComponent } from 'esoftplay/cache/lib/component/import';
|
|
4
4
|
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
5
|
-
import { LibListItemLayout } from 'esoftplay/cache/lib/list/import';
|
|
6
5
|
import { LibLoading } from 'esoftplay/cache/lib/loading/import';
|
|
7
6
|
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
8
7
|
import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
|
|
@@ -54,7 +53,7 @@ export interface LibInfiniteProps {
|
|
|
54
53
|
renderItem: (item: any, index: number) => any,
|
|
55
54
|
viewabilityConfig?: any,
|
|
56
55
|
removeClippedSubviews?: boolean,
|
|
57
|
-
style?:
|
|
56
|
+
style?: ContentStyle
|
|
58
57
|
}
|
|
59
58
|
|
|
60
59
|
export interface LibInfiniteState {
|
package/modules/lib/input.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import { LibTheme } from 'esoftplay/cache/lib/theme/import';
|
|
|
5
5
|
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
6
6
|
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import { Platform, TextInput, View } from 'react-native';
|
|
8
|
+
import { Platform, TextInput, TextStyle, View } from 'react-native';
|
|
9
9
|
|
|
10
10
|
export interface LibInputProps {
|
|
11
11
|
icon?: (color: string) => any,
|
|
@@ -38,7 +38,7 @@ export interface LibInputProps {
|
|
|
38
38
|
secureTextEntry?: boolean,
|
|
39
39
|
selectTextOnFocus?: boolean,
|
|
40
40
|
selectionColor?: string,
|
|
41
|
-
style?:
|
|
41
|
+
style?: TextStyle,
|
|
42
42
|
value?: string,
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -179,10 +179,11 @@ export default class m extends LibComponent<LibInputProps, LibInputState>{
|
|
|
179
179
|
|
|
180
180
|
componentDidMount(): void {
|
|
181
181
|
super.componentDidMount()
|
|
182
|
-
|
|
182
|
+
const timer = setTimeout(() => {
|
|
183
183
|
if (this.props.defaultValue) {
|
|
184
184
|
this.setText(this.props.defaultValue)
|
|
185
185
|
}
|
|
186
|
+
clearTimeout(timer)
|
|
186
187
|
});
|
|
187
188
|
}
|
|
188
189
|
|
|
@@ -5,12 +5,12 @@ import NavigationContainerRefContext from '@react-navigation/core/src/Navigation
|
|
|
5
5
|
import NavigationContext from '@react-navigation/core/src/NavigationContext';
|
|
6
6
|
import type { NavigationProp } from '@react-navigation/core/src/types';
|
|
7
7
|
import React, { useRef, useState } from 'react';
|
|
8
|
-
import { KeyboardAvoidingView, Platform } from 'react-native';
|
|
8
|
+
import { KeyboardAvoidingView, Platform, ViewStyle } from 'react-native';
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
export interface LibKeyboard_avoidProps {
|
|
12
12
|
children?: any,
|
|
13
|
-
style?:
|
|
13
|
+
style?: ViewStyle
|
|
14
14
|
}
|
|
15
15
|
export default function m(props: LibKeyboard_avoidProps): any {
|
|
16
16
|
|
package/modules/lib/lazy.tsx
CHANGED
|
@@ -35,8 +35,9 @@ export default function m(props: LibLazyProps): any {
|
|
|
35
35
|
InteractionManager.runAfterInteractions(() => {
|
|
36
36
|
startTransition(() => {
|
|
37
37
|
item(true)
|
|
38
|
-
|
|
38
|
+
const timer = setTimeout(() => {
|
|
39
39
|
next()
|
|
40
|
+
clearTimeout(timer)
|
|
40
41
|
}, 50);
|
|
41
42
|
})
|
|
42
43
|
})
|
package/modules/lib/list.tsx
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
//
|
|
5
|
-
import { FlashList } from "@shopify/flash-list";
|
|
5
|
+
import { ContentStyle, FlashList } from "@shopify/flash-list";
|
|
6
6
|
import { LibComponent } from 'esoftplay/cache/lib/component/import';
|
|
7
7
|
import React from "react";
|
|
8
8
|
import { View } from 'react-native';
|
|
@@ -41,7 +41,7 @@ export interface LibListProps {
|
|
|
41
41
|
renderFooter?: () => any,
|
|
42
42
|
renderItem: (item: any, index: number) => any,
|
|
43
43
|
viewabilityConfig?: any,
|
|
44
|
-
style?:
|
|
44
|
+
style?: ContentStyle,
|
|
45
45
|
removeClippedSubviews?: boolean,
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -194,13 +194,15 @@ export default {
|
|
|
194
194
|
const data = this.getData(notification)
|
|
195
195
|
function doOpen(data: any) {
|
|
196
196
|
if (!LibNavigation.getIsReady()) {
|
|
197
|
-
|
|
197
|
+
const timer = setTimeout(() => {
|
|
198
198
|
doOpen(data)
|
|
199
|
+
clearTimeout(timer)
|
|
199
200
|
}, 300);
|
|
200
201
|
return
|
|
201
202
|
} else {
|
|
202
|
-
|
|
203
|
+
const timer = setTimeout(() => {
|
|
203
204
|
this.openPushNotif(data)
|
|
205
|
+
clearTimeout(timer)
|
|
204
206
|
}, 0)
|
|
205
207
|
}
|
|
206
208
|
}
|
|
@@ -283,19 +285,21 @@ export default {
|
|
|
283
285
|
} else {
|
|
284
286
|
btns.push({ text: "OK", onPress: () => { }, style: "cancel" })
|
|
285
287
|
}
|
|
286
|
-
|
|
288
|
+
const timer = setTimeout(() => {
|
|
287
289
|
Alert.alert(
|
|
288
290
|
param.title,
|
|
289
291
|
param.message,
|
|
290
292
|
btns, { cancelable: false }
|
|
291
293
|
)
|
|
294
|
+
clearTimeout(timer)
|
|
292
295
|
}, 10)
|
|
293
296
|
break;
|
|
294
297
|
case "default":
|
|
295
298
|
if (param.module && param.module != "") {
|
|
296
299
|
if (!String(param.module).includes("/")) param.module = param.module + "/index"
|
|
297
|
-
|
|
300
|
+
const timer = setTimeout(() => {
|
|
298
301
|
LibNavigation.navigate(param.module, param.params)
|
|
302
|
+
clearTimeout(timer)
|
|
299
303
|
}, 10)
|
|
300
304
|
}
|
|
301
305
|
break;
|
|
@@ -315,20 +319,22 @@ export default {
|
|
|
315
319
|
} else {
|
|
316
320
|
btns.push({ text: "OK", onPress: () => { }, style: "cancel" })
|
|
317
321
|
}
|
|
318
|
-
|
|
322
|
+
const timer = setTimeout(() => {
|
|
319
323
|
Alert.alert(
|
|
320
324
|
data.title,
|
|
321
325
|
data.message,
|
|
322
326
|
btns,
|
|
323
327
|
{ cancelable: false }
|
|
324
328
|
)
|
|
329
|
+
clearTimeout(timer)
|
|
325
330
|
}, 10)
|
|
326
331
|
break;
|
|
327
332
|
case "default":
|
|
328
333
|
if (param.module != "") {
|
|
329
334
|
if (!String(param.module).includes("/")) param.module = param.module + "/index"
|
|
330
|
-
|
|
335
|
+
const timer = setTimeout(() => {
|
|
331
336
|
LibNavigation.navigate(param.module, param.arguments)
|
|
337
|
+
clearTimeout(timer)
|
|
332
338
|
}, 10)
|
|
333
339
|
}
|
|
334
340
|
break;
|
package/modules/lib/picture.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// withHooks
|
|
2
2
|
// noPage
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { ImageStyle } from 'react-native';
|
|
4
5
|
import FastImage from 'react-native-fast-image';
|
|
5
6
|
|
|
6
7
|
export interface LibPictureSource {
|
|
@@ -8,7 +9,7 @@ export interface LibPictureSource {
|
|
|
8
9
|
}
|
|
9
10
|
export interface LibPictureProps {
|
|
10
11
|
source: LibPictureSource | any,
|
|
11
|
-
style:
|
|
12
|
+
style: ImageStyle,
|
|
12
13
|
resizeMode?: "contain" | "cover",
|
|
13
14
|
noCache?: boolean,
|
|
14
15
|
onError?: () => void,
|
package/modules/lib/pin.tsx
CHANGED
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
// noPage
|
|
3
3
|
|
|
4
4
|
import React, { useEffect, useRef, useState } from 'react';
|
|
5
|
-
import { TextInput, View } from 'react-native';
|
|
5
|
+
import { TextInput, View, ViewStyle } from 'react-native';
|
|
6
6
|
|
|
7
7
|
export interface LibPinProps {
|
|
8
8
|
length: number,
|
|
9
9
|
onChangePin: (pin: string) => void
|
|
10
|
-
boxStyle?:
|
|
10
|
+
boxStyle?: ViewStyle,
|
|
11
11
|
overrideKeyboard?: boolean,
|
|
12
12
|
pinValue?: string,
|
|
13
|
-
pinStyle?:
|
|
13
|
+
pinStyle?: ViewStyle
|
|
14
14
|
}
|
|
15
15
|
export default function m(props: LibPinProps): any {
|
|
16
16
|
const [pin, setPin] = useState<string[]>([])
|
|
17
17
|
const input = useRef<TextInput>(null)
|
|
18
18
|
|
|
19
19
|
useEffect(() => {
|
|
20
|
-
|
|
20
|
+
const timer = setTimeout(() => { input?.current?.focus() ; clearTimeout(timer)}, 100);
|
|
21
21
|
setPin(props?.pinValue?.split?.(''))
|
|
22
22
|
props.onChangePin(props?.pinValue || '')
|
|
23
23
|
}, [props.pinValue])
|
package/modules/lib/scroll.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// noPage
|
|
2
2
|
import { LibComponent } from 'esoftplay/cache/lib/component/import';
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { RefreshControl, ScrollView, View } from "react-native";
|
|
4
|
+
import { RefreshControl, ScrollView, View, ViewStyle } from "react-native";
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
Using ScrollView
|
|
@@ -29,7 +29,7 @@ var Escroll = esp.mod("lib/scroll")
|
|
|
29
29
|
|
|
30
30
|
export interface LibScrollProps {
|
|
31
31
|
bounces?: boolean,
|
|
32
|
-
style?:
|
|
32
|
+
style?: ViewStyle,
|
|
33
33
|
ItemSeparatorComponent?: any,
|
|
34
34
|
onScroll?: (e: any) => void,
|
|
35
35
|
scrollEventThrottle?: number,
|
|
@@ -6,14 +6,15 @@ import {
|
|
|
6
6
|
Dimensions,
|
|
7
7
|
Platform, ScrollView, StyleSheet,
|
|
8
8
|
Text,
|
|
9
|
-
View
|
|
9
|
+
View,
|
|
10
|
+
ViewStyle
|
|
10
11
|
} from 'react-native';
|
|
11
12
|
|
|
12
13
|
export interface LibScrollpickerProps {
|
|
13
14
|
itemHeight: number;
|
|
14
15
|
wrapperHeight: number;
|
|
15
16
|
selectedIndex: number;
|
|
16
|
-
style?:
|
|
17
|
+
style?: ViewStyle;
|
|
17
18
|
highlightColor: string;
|
|
18
19
|
wrapperColor: string;
|
|
19
20
|
renderItem: (item: any, index: number, isSelected: boolean) => any;
|
|
@@ -49,8 +50,9 @@ export default class m extends LibComponent<LibScrollpickerProps, LibScrollpicke
|
|
|
49
50
|
componentDidMount() {
|
|
50
51
|
super.componentDidMount()
|
|
51
52
|
if (this.props.selectedIndex) {
|
|
52
|
-
|
|
53
|
+
const timer = setTimeout(() => {
|
|
53
54
|
this.scrollToIndex(this.props.selectedIndex);
|
|
55
|
+
clearTimeout(timer)
|
|
54
56
|
}, 0);
|
|
55
57
|
}
|
|
56
58
|
}
|
|
@@ -46,8 +46,9 @@ export default class m extends LibComponent<LibSlidingupProps, LibSlidingupState
|
|
|
46
46
|
Keyboard.dismiss()
|
|
47
47
|
if (this.props.children) {
|
|
48
48
|
this.setState({ show: true }, () => {
|
|
49
|
-
|
|
49
|
+
const timer = setTimeout(() => {
|
|
50
50
|
this._toggleSubview(true)
|
|
51
|
+
clearTimeout(timer)
|
|
51
52
|
}, 1);
|
|
52
53
|
})
|
|
53
54
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// noPage
|
|
2
2
|
import { LibComponent } from 'esoftplay/cache/lib/component/import';
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { StyleSheet, Text } from "react-native";
|
|
4
|
+
import { StyleSheet, Text, TextStyle } from "react-native";
|
|
5
5
|
|
|
6
6
|
export interface LibTextstyleProps {
|
|
7
7
|
textStyle: "largeTitle" | "title1" | "title2" | "title3" | "headline" | "body" | "callout" | "subhead" | "footnote" | "caption1" | "caption2" | "m_h1" | "m_h2" | "m_h3" | "m_h4" | "m_h5" | "m_h6" | "m_subtitle1" | "m_subtitle2" | "m_body1" | "m_body2" | "m_button" | "m_caption" | "m_overline",
|
|
8
|
-
style?:
|
|
8
|
+
style?: TextStyle,
|
|
9
9
|
children?: string | "",
|
|
10
10
|
numberOfLines?: number,
|
|
11
11
|
ellipsizeMode?: string,
|
package/modules/lib/toast.tsx
CHANGED
package/modules/lib/updater.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
|
4
4
|
import { LibProgress } from 'esoftplay/cache/lib/progress/import';
|
|
5
5
|
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
6
6
|
import esp from 'esoftplay/esp';
|
|
7
|
+
import { createTimeout } from 'esoftplay/timeout';
|
|
7
8
|
|
|
8
9
|
import Constants from 'expo-constants';
|
|
9
10
|
import * as Updates from 'expo-updates';
|
|
@@ -15,7 +16,12 @@ export interface LibUpdaterProps {
|
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export function install(): void {
|
|
18
|
-
|
|
19
|
+
const timeout = createTimeout()
|
|
20
|
+
timeout.set(() => {
|
|
21
|
+
Updates?.reloadAsync?.()
|
|
22
|
+
timeout.clear()
|
|
23
|
+
}, 100)
|
|
24
|
+
|
|
19
25
|
}
|
|
20
26
|
|
|
21
27
|
export function alertInstall(title?: string, msg?: string): void {
|
|
@@ -39,14 +45,15 @@ export function check(callback?: (isNew: boolean) => void): void {
|
|
|
39
45
|
Updates.checkForUpdateAsync().then(({ isAvailable }) => {
|
|
40
46
|
if (!isAvailable) {
|
|
41
47
|
callback?.(false)
|
|
42
|
-
LibProgress
|
|
48
|
+
LibProgress?.hide?.()
|
|
43
49
|
} else {
|
|
44
50
|
Updates.fetchUpdateAsync()
|
|
45
51
|
.then(({ isNew }) => {
|
|
46
|
-
|
|
52
|
+
if (isNew && callback)
|
|
53
|
+
callback?.(isNew)
|
|
47
54
|
}).catch((e) => {
|
|
48
55
|
Alert.alert("Update Gagal", e)
|
|
49
|
-
LibProgress
|
|
56
|
+
LibProgress?.hide?.()
|
|
50
57
|
})
|
|
51
58
|
}
|
|
52
59
|
})
|
package/modules/lib/video.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
|
4
4
|
import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
|
|
5
5
|
import esp from 'esoftplay/esp';
|
|
6
6
|
import React from 'react';
|
|
7
|
-
import { ActivityIndicator, StyleSheet, View } from 'react-native';
|
|
7
|
+
import { ActivityIndicator, StyleSheet, View, ViewStyle } from 'react-native';
|
|
8
8
|
import { WebView } from 'react-native-webview';
|
|
9
9
|
|
|
10
10
|
export interface LibVideoArgs {
|
|
@@ -12,7 +12,7 @@ export interface LibVideoArgs {
|
|
|
12
12
|
}
|
|
13
13
|
export interface LibVideoProps {
|
|
14
14
|
code: string,
|
|
15
|
-
style?:
|
|
15
|
+
style?: ViewStyle
|
|
16
16
|
}
|
|
17
17
|
export default function m(props: LibVideoProps): any {
|
|
18
18
|
const code = props.code
|
package/modules/lib/webview.tsx
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { LibComponent } from 'esoftplay/cache/lib/component/import';
|
|
4
4
|
import esp from 'esoftplay/esp';
|
|
5
5
|
import React from "react";
|
|
6
|
-
import { Animated, Dimensions, Linking, Platform } from "react-native";
|
|
6
|
+
import { Animated, Dimensions, Linking, Platform, ViewStyle } from "react-native";
|
|
7
7
|
import { WebView } from 'react-native-webview';
|
|
8
8
|
let { width } = Dimensions.get("window");
|
|
9
9
|
|
|
@@ -24,7 +24,7 @@ export interface LibWebviewProps {
|
|
|
24
24
|
onMessage?: any,
|
|
25
25
|
bounces?: any,
|
|
26
26
|
onLoadEnd?: any,
|
|
27
|
-
style?:
|
|
27
|
+
style?: ViewStyle,
|
|
28
28
|
scrollEnabled?: any,
|
|
29
29
|
automaticallyAdjustContentInsets?: any,
|
|
30
30
|
scalesPageToFit?: any,
|
|
@@ -43,14 +43,14 @@ class ewebview extends LibComponent<LibWebviewProps, LibWebviewState> {
|
|
|
43
43
|
_animatedValue: any;
|
|
44
44
|
webview: any;
|
|
45
45
|
heightMessage: any;
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
static defaultProps = {
|
|
48
48
|
needAnimate: true,
|
|
49
49
|
AnimationDuration: 500,
|
|
50
50
|
defaultHeight: 100,
|
|
51
51
|
needAutoResetHeight: true
|
|
52
52
|
};
|
|
53
|
-
|
|
53
|
+
|
|
54
54
|
constructor(props: LibWebviewProps) {
|
|
55
55
|
super(props);
|
|
56
56
|
this.props = props
|
|
@@ -67,7 +67,7 @@ class ewebview extends LibComponent<LibWebviewProps, LibWebviewState> {
|
|
|
67
67
|
this.resetHeight = this.resetHeight.bind(this)
|
|
68
68
|
this.resetSmallHeight = this.resetSmallHeight.bind(this)
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
|
|
71
71
|
static getDerivedStateFromProps(nextProps, prevState) {
|
|
72
72
|
const config = esp.config();
|
|
73
73
|
return { source: nextProps.source && nextProps.source.hasOwnProperty("html") ? { html: config.webviewOpen + nextProps.source.html + config.webviewClose } : nextProps.source }
|
|
@@ -128,7 +128,7 @@ class ewebview extends LibComponent<LibWebviewProps, LibWebviewState> {
|
|
|
128
128
|
<Animated.View style={{ height: this.state.height, overflow: "hidden" }}>
|
|
129
129
|
<WebView
|
|
130
130
|
{...otherprops}
|
|
131
|
-
cacheEnabled={false}
|
|
131
|
+
cacheEnabled={false}
|
|
132
132
|
ref={(e: any) => this.webview = e}
|
|
133
133
|
source={this.state.source}
|
|
134
134
|
bounces={bounces !== undefined ? bounces : true}
|
|
@@ -142,11 +142,13 @@ class ewebview extends LibComponent<LibWebviewProps, LibWebviewState> {
|
|
|
142
142
|
}}
|
|
143
143
|
injectedJavaScript={'window.ReactNativeWebView.postMessage(document.body.scrollWidth+"-"+document.body.scrollHeight)'}
|
|
144
144
|
onLoadEnd={() => {
|
|
145
|
-
if (this.props.onFinishLoad !== undefined)
|
|
146
|
-
|
|
145
|
+
if (this.props.onFinishLoad !== undefined){
|
|
146
|
+
const timer = setTimeout(() => {
|
|
147
147
|
this.setState({ isFinish: true })
|
|
148
148
|
this.props.onFinishLoad()
|
|
149
|
+
clearTimeout(timer)
|
|
149
150
|
}, 1000)
|
|
151
|
+
}
|
|
150
152
|
}}
|
|
151
153
|
style={[{ width: width, height: this.state.height }, style !== undefined ? style : {}]}
|
|
152
154
|
scrollEnabled={scrollEnabled !== undefined ? scrollEnabled : false}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// useLibs
|
|
2
|
+
|
|
3
|
+
import { runOnJS, runOnUI } from "react-native-reanimated";
|
|
4
|
+
|
|
5
|
+
export interface UseWorkerProps {
|
|
6
|
+
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default function m(func: (args: any[]) => void): (args: any[], callback: (res: any) => void) => void {
|
|
10
|
+
return (args: any[], callback: (res: any) => void) => {
|
|
11
|
+
function clbk(out: any) {
|
|
12
|
+
"worklet"
|
|
13
|
+
runOnJS(callback)(out)
|
|
14
|
+
}
|
|
15
|
+
function run() {
|
|
16
|
+
"worklet"
|
|
17
|
+
clbk(func(args))
|
|
18
|
+
}
|
|
19
|
+
runOnUI(run)()
|
|
20
|
+
}
|
|
21
|
+
}
|
package/moment.ts
CHANGED
|
@@ -73,6 +73,16 @@ export default function moment(date?: string | Date | any) {
|
|
|
73
73
|
const out = dayjs(_d).format(custom)
|
|
74
74
|
return out
|
|
75
75
|
},
|
|
76
|
+
serverFormat: (custom: string) => {
|
|
77
|
+
const _d = resetTimeOffset(_date)
|
|
78
|
+
const out = dayjs(_d).format(custom)
|
|
79
|
+
return out
|
|
80
|
+
},
|
|
81
|
+
localeFormat: (custom: string, ignoreTimezone?: boolean) => {
|
|
82
|
+
const _d = _date
|
|
83
|
+
const out = dayjs(_d).format(custom)
|
|
84
|
+
return out
|
|
85
|
+
},
|
|
76
86
|
toDate: () => {
|
|
77
87
|
const out = dayjs(_date).toDate()
|
|
78
88
|
return out
|
package/package.json
CHANGED
package/timeout.d.ts
ADDED