esoftplay 0.0.142-x → 0.0.142-y

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,7 +2,6 @@
2
2
  import { LibNavigationRoutes } from 'esoftplay';
3
3
  import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
4
4
  import { LibObject } from 'esoftplay/cache/lib/object/import';
5
- import { LibUtils } from 'esoftplay/cache/lib/utils/import';
6
5
  import { EspRouterInterface } from 'esoftplay/cache/routers';
7
6
  import esp from 'esoftplay/esp';
8
7
  import useGlobalState from 'esoftplay/global';
@@ -13,8 +12,6 @@ export interface RNTypes extends EspRouterInterface {
13
12
  "View": typeof View,
14
13
  "Text": typeof Text,
15
14
  "ScrollView": typeof ScrollView,
16
- // "TouchableOpacity": typeof TouchableOpacity,
17
- // "TextInput": typeof TextInput,
18
15
  }
19
16
 
20
17
  const formState = useGlobalState({})
@@ -63,7 +60,6 @@ function buildUIFromJSON(json: any): ReactElement {
63
60
  }
64
61
  }
65
62
  if (type == 'select') {
66
- console.log(type, postkey, key)
67
63
  const [_key, _value] = postkey.split(":")
68
64
  _props[key] = () => {
69
65
  formState.set(LibObject.set(formState.get(), _value)(_key))
@@ -109,9 +105,15 @@ const action: any = {
109
105
  new (esp.mod('lib/curl'))(args[0], post, (res, msg) => {
110
106
  esp.modProp("lib/toast").show(msg)
111
107
  esp.mod("lib/progress").hide()
108
+ if (res.includes("navigate")) {
109
+ LibNavigation.replace(res.navigate.module, res.navigate.params)
110
+ }
112
111
  }, (err) => {
113
112
  esp.modProp("lib/toast").show(err.message)
114
113
  esp.mod("lib/progress").hide()
114
+ if (err.result.includes("navigate")) {
115
+ LibNavigation.replace(err.result.navigate.module, err.result.navigate.params)
116
+ }
115
117
  })
116
118
  }
117
119
  }
@@ -124,24 +126,19 @@ export const forms = {
124
126
  /** Klik [disini](https://github.com/dev-esoftplay/mobile-docs/blob/main/modules/lib/compose.md#actions) untuk melihat dokumentasi*/
125
127
  export const actions = {
126
128
  navigate: (module: LibNavigationRoutes, params: any) => {
127
- LibNavigation.navigate(module, params)
129
+ return `#action.navigate.[${module},${params}]`
128
130
  },
129
131
  replace: (module: LibNavigationRoutes, params: any) => {
130
- LibNavigation.replace(module, params)
132
+ return `#action.replace.[${module},${params}]`
131
133
  },
132
134
  back: () => {
133
- LibNavigation.back()
135
+ return `#action.back`
134
136
  },
135
137
  copy: (args: string) => {
136
- LibUtils.copyToClipboard(args)
137
- esp.modProp("lib/toast").show(args + " copied!")
138
+ return `#action.copy.[${args}]`
138
139
  },
139
140
  curl: (uri: string, post?: any) => {
140
- new (esp.mod('lib/curl'))(uri, post, (res, msg) => {
141
- esp.modProp("lib/toast").show(msg)
142
- }, (err) => {
143
- esp.modProp("lib/toast").show(err.message)
144
- }, 1)
141
+ return `#action.curl.["${uri}", ${post}]`
145
142
  }
146
143
  }
147
144
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay",
3
- "version": "0.0.142-x",
3
+ "version": "0.0.142-y",
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",