esoftplay 0.0.135-s → 0.0.135-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.
@@ -2,32 +2,32 @@
2
2
  import { LibComponent } from 'esoftplay/cache/lib/component/import';
3
3
  import { LibFocus } from 'esoftplay/cache/lib/focus/import';
4
4
  import React from 'react';
5
- import { Platform, ScrollView, StyleSheet, Text, TouchableOpacity, TouchableWithoutFeedback, View } from 'react-native';
5
+ import { Platform, ScrollView, StyleSheet, Text, TouchableOpacity, TouchableWithoutFeedback, View, ViewStyle } from 'react-native';
6
6
 
7
7
  export interface LibCarrouselProps {
8
8
  children: any,
9
9
  autoplay?: boolean,
10
10
  delay?: number,
11
11
  currentPage?: number,
12
- style?: any,
13
- pageStyle?: any,
14
- contentContainerStyle?: any,
12
+ style?: ViewStyle,
13
+ pageStyle?: ViewStyle,
14
+ contentContainerStyle?: ViewStyle,
15
15
  pageInfo?: boolean,
16
16
  pageInfoBackgroundColor?: string,
17
17
  pageInfoTextStyle?: any,
18
- pageInfoBottomContainerStyle?: any,
18
+ pageInfoBottomContainerStyle?: ViewStyle,
19
19
  pageInfoTextSeparator?: string,
20
20
  bullets?: boolean,
21
- bulletsContainerStyle?: any,
22
- bulletStyle?: any,
21
+ bulletsContainerStyle?: ViewStyle,
22
+ bulletStyle?: ViewStyle,
23
23
  arrows?: boolean,
24
- arrowsContainerStyle?: any,
25
- arrowStyle?: any,
26
- leftArrowStyle?: any,
27
- rightArrowStyle?: any,
24
+ arrowsContainerStyle?: ViewStyle,
25
+ arrowStyle?: ViewStyle,
26
+ leftArrowStyle?: ViewStyle,
27
+ rightArrowStyle?: ViewStyle,
28
28
  leftArrowText?: string,
29
29
  rightArrowText?: string,
30
- chosenBulletStyle?: any,
30
+ chosenBulletStyle?: ViewStyle,
31
31
  onAnimateNextPage?: (currentPage: number) => void,
32
32
  onPageBeingChanged?: (nextPage: number) => void,
33
33
  swipe?: boolean,
@@ -2,12 +2,12 @@
2
2
  // noPage
3
3
  import esp from 'esoftplay/esp';
4
4
  import React, { useEffect, useMemo, useRef } from 'react';
5
- import { ScrollView, View } from 'react-native';
5
+ import { ScrollView, StyleProp, View, ViewStyle } from 'react-native';
6
6
 
7
7
  export interface LibCarrousel_snapProps {
8
8
  data: any[]
9
9
  align?: 'center' | 'left'
10
- style?: any,
10
+ style?: StyleProp<ViewStyle>,
11
11
  maxWidth: number,
12
12
  autoCycle?: boolean,
13
13
  loop?: boolean,
@@ -2,7 +2,7 @@
2
2
  // noPage
3
3
  import useSafeState from 'esoftplay/state';
4
4
  import React, { useEffect } from 'react';
5
- import { Pressable } from 'react-native';
5
+ import { Pressable, ViewStyle } from 'react-native';
6
6
  import Animated, { runOnJS, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
7
7
 
8
8
 
@@ -13,7 +13,7 @@ export interface LibCollapsProps {
13
13
  header: (isShow: boolean) => any,
14
14
  children: any,
15
15
  onToggle?: (expanded: boolean) => void,
16
- style?: any
16
+ style?: ViewStyle
17
17
  }
18
18
  export default function m(props: LibCollapsProps): any {
19
19
  const [expand, setExpand] = useSafeState(props.show)
@@ -55,7 +55,7 @@ export default function m(props: LibCollapsProps): any {
55
55
 
56
56
  return (
57
57
  <Animated.View>
58
- <Pressable onPress={toggle} style={{ zIndex: 11 }} >
58
+ <Pressable onPress={toggle} style={{ ...props.style, zIndex: 11 }} >
59
59
  {props.header(expand)}
60
60
  </Pressable>
61
61
  {expand &&
@@ -1,10 +1,10 @@
1
1
  // noPage
2
2
  import { LibComponent } from 'esoftplay/cache/lib/component/import';
3
3
  import React from 'react';
4
- import { TextInput } from 'react-native';
4
+ import { StyleProp, TextInput, TextStyle } from 'react-native';
5
5
 
6
6
  export interface LibDirect_textProps {
7
- style?: any,
7
+ style?: StyleProp<TextStyle>,
8
8
  initialText?: string
9
9
  }
10
10
  export interface LibDirect_textState {
@@ -8,7 +8,7 @@ import { LibTheme } from 'esoftplay/cache/lib/theme/import';
8
8
  import esp from 'esoftplay/esp';
9
9
  import useGlobalState from 'esoftplay/global';
10
10
  import React from 'react';
11
- import { Button, TouchableOpacity, View } from 'react-native';
11
+ import { Button, StyleProp, TextStyle, TouchableOpacity, View } from 'react-native';
12
12
 
13
13
  export interface ComponentEditboxProps {
14
14
  defaultValue?: string,
@@ -36,7 +36,7 @@ export interface ComponentEditboxProps {
36
36
  secureTextEntry?: boolean,
37
37
  selectTextOnFocus?: boolean,
38
38
  selectionColor?: string,
39
- style?: any,
39
+ style?: StyleProp<TextStyle>,
40
40
  value?: string,
41
41
  }
42
42
 
@@ -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?: any,
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[]
@@ -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?: any,
41
+ style?: TextStyle,
42
42
  value?: string,
43
43
  }
44
44
 
@@ -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?: any
13
+ style?: ViewStyle
14
14
  }
15
15
  export default function m(props: LibKeyboard_avoidProps): any {
16
16
 
@@ -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?: any,
32
+ style?: ViewStyle,
33
33
  ItemSeparatorComponent?: any,
34
34
  onScroll?: (e: any) => void,
35
35
  scrollEventThrottle?: number,
@@ -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
- setTimeout(Updates.reloadAsync)
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.hide()
48
+ LibProgress?.hide?.()
43
49
  } else {
44
50
  Updates.fetchUpdateAsync()
45
51
  .then(({ isNew }) => {
46
- callback?.(isNew)
52
+ if (isNew && callback)
53
+ callback?.(isNew)
47
54
  }).catch((e) => {
48
55
  Alert.alert("Update Gagal", e)
49
- LibProgress.hide()
56
+ LibProgress?.hide?.()
50
57
  })
51
58
  }
52
59
  })
@@ -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?: any
15
+ style?: ViewStyle
16
16
  }
17
17
  export default function m(props: LibVideoProps): any {
18
18
  const code = props.code
@@ -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?: any,
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}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay",
3
- "version": "0.0.135-s",
3
+ "version": "0.0.135-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",