esoftplay 0.0.107 → 0.0.108
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 +10 -21
- package/bin/router.js +0 -39
- package/esp.ts +1 -0
- package/global.ts +1 -1
- package/modules/content/comment.tsx +7 -6
- package/modules/content/gallery.tsx +4 -5
- package/modules/lib/datepicker.tsx +11 -11
- package/modules/lib/infinite.tsx +2 -1
- package/modules/lib/input.tsx +17 -9
- package/modules/lib/navigation.ts +1 -1
- package/modules/lib/picture.tsx +4 -3
- package/modules/lib/toast.tsx +13 -26
- package/modules/lib/updater.tsx +1 -1
- package/modules/lib/webview.tsx +1 -0
- package/modules/lib/worker.tsx +4 -0
- package/modules/use/deeplink.ts +10 -2
- package/modules/user/data.ts +3 -1
- package/modules/user/index.tsx +10 -1
- package/package.json +1 -2
package/bin/build.js
CHANGED
|
@@ -119,24 +119,7 @@ if (fs.existsSync(packjson)) {
|
|
|
119
119
|
|
|
120
120
|
/* Create esp command line */
|
|
121
121
|
if (args[0] == "install") {
|
|
122
|
-
execSync('
|
|
123
|
-
spawn('esp', ['start'], { stdio: 'inherit' })
|
|
124
|
-
.on('exit', function (code) {
|
|
125
|
-
console.log(code);
|
|
126
|
-
})
|
|
127
|
-
.on('error', function () {
|
|
128
|
-
console.log("Installing the package 'esoftplay-cli'...");
|
|
129
|
-
spawn('npm', ['install', '--global', '--loglevel', 'error', 'esoftplay-cli'], {
|
|
130
|
-
stdio: ['inherit', 'ignore', 'inherit'],
|
|
131
|
-
}).on('close', function (code) {
|
|
132
|
-
if (code !== 0) {
|
|
133
|
-
console.error('Installing esoftplay-cli failed. You can install it manually with:');
|
|
134
|
-
console.error(' npm install --global esoftplay-cli');
|
|
135
|
-
} else {
|
|
136
|
-
console.log('esoftplay-cli installed. You can run `esp help` for instructions.');
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
});
|
|
122
|
+
execSync('cd ../../ && node ./node_modules/esoftplay/bin/router.js', { stdio: ['inherit', 'inherit', 'inherit'] })
|
|
140
123
|
}
|
|
141
124
|
|
|
142
125
|
/* Update app.json */
|
|
@@ -371,16 +354,23 @@ export default function App() {
|
|
|
371
354
|
cmd += "&& yarn add " + installDevLibs.join(" ") + " --dev "
|
|
372
355
|
if (installExpoLibs.length > 0)
|
|
373
356
|
cmd += "&& expo install " + installExpoLibs.join(" ")
|
|
374
|
-
|
|
357
|
+
cmd += "&& node ./node_modules/esoftplay/bin/router.js"
|
|
375
358
|
execSync(cmd, { stdio: ['inherit', 'inherit', 'inherit'] })
|
|
376
359
|
console.log('App.js has been replace to App.tsx');
|
|
360
|
+
/* bugfix AsyncStorage @firebase, remove this section if firebase has update the AsyncStorage */
|
|
361
|
+
if (fs.existsSync('../@firebase/app/dist/index.rn.cjs.js')) {
|
|
362
|
+
let firebaseText = fs.readFileSync('../@firebase/app/dist/index.rn.cjs.js', 'utf8')
|
|
363
|
+
firebaseText = firebaseText.replace("var AsyncStorage = require('react-native').AsyncStorage;", "var AsyncStorage = require('@react-native-async-storage/async-storage');")
|
|
364
|
+
fs.writeFileSync('../@firebase/app/dist/index.rn.cjs.js', firebaseText)
|
|
365
|
+
}
|
|
366
|
+
/* end AsyncStorage @firebase section */
|
|
377
367
|
if (fs.existsSync('../@expo/vector-icons')) {
|
|
378
368
|
let esoftplayIcon = ''
|
|
379
369
|
fs.readdir('../@expo/vector-icons/build', (err, files) => {
|
|
380
370
|
const dfiles = files.filter((file) => file.includes('d.ts'))
|
|
381
371
|
dfiles.map((dfile, i) => {
|
|
382
372
|
const rdfile = fs.readFileSync('../@expo/vector-icons/build/' + dfile, { encoding: 'utf8' })
|
|
383
|
-
const names = (/import\("\.\/createIconSet"\)\.Icon<((.*))
|
|
373
|
+
const names = (/import\("\.\/createIconSet"\)\.Icon<((.*))\,.*>/g).exec(rdfile);
|
|
384
374
|
if (names && names[1].includes('|')) {
|
|
385
375
|
esoftplayIcon += 'export type ' + dfile.replace('.d.ts', 'Types') + ' = ' + names[1] + '\n';
|
|
386
376
|
}
|
|
@@ -392,7 +382,6 @@ export default function App() {
|
|
|
392
382
|
}
|
|
393
383
|
console.log('Please wait until processes has finished...');
|
|
394
384
|
});
|
|
395
|
-
// execSync('esp start', { stdio: ['inherit', 'inherit', 'inherit'] })
|
|
396
385
|
}
|
|
397
386
|
} else {
|
|
398
387
|
console.log(packjson + " not found!!")
|
package/bin/router.js
CHANGED
|
@@ -108,7 +108,6 @@ checks.forEach(modules => {
|
|
|
108
108
|
return console.log(err)
|
|
109
109
|
} else {
|
|
110
110
|
var isIndexed = (tmpExp.indexOf(clsName) > -1) ? false : true;
|
|
111
|
-
// console.log(isIndexed, clsName);
|
|
112
111
|
var isHooks = false
|
|
113
112
|
var isUseLibs = false
|
|
114
113
|
/* REGEX HOOKS */
|
|
@@ -509,43 +508,6 @@ function isChange(path, compare) {
|
|
|
509
508
|
/* CREATE REDUCER LIST */
|
|
510
509
|
function createReducer() {
|
|
511
510
|
if (countRead >= countLoop) {
|
|
512
|
-
// var CodeImporter = "";
|
|
513
|
-
// var CodeReducer = "";
|
|
514
|
-
// for (const key in Reducers) {
|
|
515
|
-
// if (HookReducers.includes(key)) {
|
|
516
|
-
// CodeImporter += "\nimport * as " + key + " from '../../." + Reducers[key] + "';";
|
|
517
|
-
// } else {
|
|
518
|
-
// CodeImporter += "\nimport " + key + " from '../../." + Reducers[key] + "';";
|
|
519
|
-
// }
|
|
520
|
-
// CodeReducer += "\n\t" + key + ": " + key + ".reducer,";
|
|
521
|
-
// }
|
|
522
|
-
// if (CodeReducer != "") {
|
|
523
|
-
// CodeReducer = CodeReducer.substr(0, CodeReducer.length - 1);
|
|
524
|
-
// }
|
|
525
|
-
// Text = "import { combineReducers } from 'redux'" +
|
|
526
|
-
// "\nimport { persistReducer } from 'redux-persist'" +
|
|
527
|
-
// "\nimport AsyncStorage from '@react-native-async-storage/async-storage'" + CodeImporter +
|
|
528
|
-
// "\n\nconst combiner = combineReducers({" + CodeReducer +
|
|
529
|
-
// "\n})\n\n" +
|
|
530
|
-
// "\nconst persistConfig = {" +
|
|
531
|
-
// "\n\tkey: 'root'," +
|
|
532
|
-
// "\n\tstorage: AsyncStorage," +
|
|
533
|
-
// "\n\twhitelist: ['" + Object.keys(Persistor).join('\',\'') + "']" +
|
|
534
|
-
// "\n}" +
|
|
535
|
-
// "\nconst reducers = (state, action) => {" +
|
|
536
|
-
// "\n\tif (action.type === 'user_class_delete') {" +
|
|
537
|
-
// "\n\t\tstate = undefined" +
|
|
538
|
-
// "\n\t}" +
|
|
539
|
-
// "\n\treturn combiner(state, action)" +
|
|
540
|
-
// "\n }" +
|
|
541
|
-
// "\nexport default persistReducer(persistConfig, reducers)";
|
|
542
|
-
// if (isChange(tmpDir + "reducers.js", Text)) {
|
|
543
|
-
// fs.writeFile(tmpDir + "reducers.js", Text, { flag: 'w' }, function (err) {
|
|
544
|
-
// if (err) {
|
|
545
|
-
// return console.log(err);
|
|
546
|
-
// }
|
|
547
|
-
// })
|
|
548
|
-
// }
|
|
549
511
|
createRouter()
|
|
550
512
|
createIndex();
|
|
551
513
|
} else {
|
|
@@ -587,7 +549,6 @@ function createRouter() {
|
|
|
587
549
|
item += "" +
|
|
588
550
|
"import * as " + ucword(module) + ucword(task) + SuffixHooksProperty + " from '../../." + Modules[module][task] + "';\n" +
|
|
589
551
|
"const " + ucword(module) + ucword(task) + " = React.memo(_" + ucword(module) + ucword(task) + ", isEqual); \n" +
|
|
590
|
-
// "const " + ucword(module) + ucword(task) + " = _" + ucword(module) + ucword(task) + "; \n" +
|
|
591
552
|
"export { " + ucword(module) + ucword(task) + SuffixHooksProperty + ", " + ucword(module) + ucword(task) + " };\n"
|
|
592
553
|
} else if (UseLibs.includes(nav)) {
|
|
593
554
|
item += "" +
|
package/esp.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { esp, LibLocale, UserRoutes } from 'esoftplay';
|
|
2
2
|
import Constants from 'expo-constants';
|
|
3
3
|
import { LogBox, Platform } from 'react-native';
|
|
4
|
+
import 'react-native-reanimated';
|
|
4
5
|
import _assets from './cache/assets';
|
|
5
6
|
import navs from './cache/navigations';
|
|
6
7
|
import routers from './cache/routers';
|
package/global.ts
CHANGED
|
@@ -98,7 +98,7 @@ export default function m(props: ContentCommentProps): any {
|
|
|
98
98
|
<View style={{ flex: 1, backgroundColor: "white" }} >
|
|
99
99
|
<ContentHeader title="Login dengan akun" />
|
|
100
100
|
<View style={{ flexDirection: "row", alignItems: "center", justifyContent: "center", paddingRight: 16 }} >
|
|
101
|
-
<Text style={{ flex: 1, padding: 10,
|
|
101
|
+
<Text style={{ flex: 1, padding: 10, color: '#606060' }} >{"Silakan login dengan salah satu akun sosial media berikut untuk dapat mengirimkan komentar"}</Text>
|
|
102
102
|
<View style={{ justifyContent: "center" }} >
|
|
103
103
|
<Pressable
|
|
104
104
|
onPress={() => { setShowLoginForm(false) }} >
|
|
@@ -113,6 +113,7 @@ export default function m(props: ContentCommentProps): any {
|
|
|
113
113
|
</View>
|
|
114
114
|
)
|
|
115
115
|
}
|
|
116
|
+
let x =(item) => <ContentComment_item url={url} url_post={url_post} {...item} />
|
|
116
117
|
|
|
117
118
|
return (
|
|
118
119
|
<View style={{ flex: 1 }} >
|
|
@@ -130,19 +131,19 @@ export default function m(props: ContentCommentProps): any {
|
|
|
130
131
|
<Image source={{ uri: headerComment.image }} style={{ height: 50, backgroundColor: '#f8f8f8', width: 50, resizeMode: 'cover', overflow: 'hidden', borderRadius: 25 }} />
|
|
131
132
|
</View>
|
|
132
133
|
<View style={{ flex: 1, paddingVertical: 16, marginHorizontal: 16 }} >
|
|
133
|
-
<Text style={{
|
|
134
|
-
<Text style={{
|
|
135
|
-
<Text style={{
|
|
134
|
+
<Text style={{ fontSize: 10, fontWeight: "500", letterSpacing: 1.5, color: "#686868" }} >{LibUtils.moment(headerComment.date).format('DD MMM YYYY HH:mm').toUpperCase()}</Text>
|
|
135
|
+
<Text style={{ fontSize: 16, fontWeight: "500", lineHeight: 20, color: "#060606", marginTop: 8 }} >{headerComment.name}</Text>
|
|
136
|
+
<Text style={{ fontSize: 14, fontWeight: "500", lineHeight: 20, color: "#606060" }} >{headerComment.content}</Text>
|
|
136
137
|
<Pressable style={{ flexDirection: 'row' }} >
|
|
137
138
|
<View style={{ flexDirection: 'row', alignItems: 'center', marginTop: 9, /* backgroundColor: '#f1f1f1', padding: 3, borderRadius: 6 */ }} >
|
|
138
139
|
<LibIcon.AntDesign name='message1' size={12} color="#ababab" />
|
|
139
|
-
<Text style={{
|
|
140
|
+
<Text style={{ fontSize: 12, lineHeight: 16, color: "#ababab", marginLeft: 5 }} >{headerComment.reply} Balasan</Text>
|
|
140
141
|
</View>
|
|
141
142
|
</Pressable>
|
|
142
143
|
</View>
|
|
143
144
|
</View>
|
|
144
145
|
}
|
|
145
|
-
renderItem={
|
|
146
|
+
renderItem={x}
|
|
146
147
|
/>
|
|
147
148
|
<View style={{ flexDirection: 'row', backgroundColor: 'white', alignItems: 'center' }} >
|
|
148
149
|
{
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { LibIcon, LibNavigation, LibStyle, LibUtils } from 'esoftplay';
|
|
4
4
|
import React, { useRef } from 'react';
|
|
5
|
-
import { Pressable,
|
|
5
|
+
import { Pressable, View } from 'react-native';
|
|
6
6
|
import Gallery from 'react-native-awesome-gallery';
|
|
7
7
|
|
|
8
8
|
export interface ContentGalleryArgs {
|
|
@@ -26,8 +26,7 @@ export default function m(props: ContentGalleryProps): any {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
return (
|
|
29
|
-
<
|
|
30
|
-
style={{ flex: 1, backgroundColor: 'black' }} >
|
|
29
|
+
<View style={{ flex: 1, overflow: 'hidden', backgroundColor: 'black' }} >
|
|
31
30
|
<Gallery
|
|
32
31
|
data={images.map((image) => (image?.image))}
|
|
33
32
|
onSwipeToClose={() => {
|
|
@@ -44,9 +43,9 @@ export default function m(props: ContentGalleryProps): any {
|
|
|
44
43
|
onPress={() => {
|
|
45
44
|
LibNavigation.back()
|
|
46
45
|
}}
|
|
47
|
-
style={{ position: 'absolute', height: 35, alignItems: 'center', justifyContent: 'center', width: 35, borderRadius: 17.5, backgroundColor: 'rgba(0,0,0,0.3)', borderWidth: 1, borderColor: 'white', top: LibStyle.STATUSBAR_HEIGHT + 24,
|
|
46
|
+
style={{ position: 'absolute', height: 35, alignItems: 'center', justifyContent: 'center', width: 35, borderRadius: 17.5, backgroundColor: 'rgba(0,0,0,0.3)', borderWidth: 1, borderColor: 'white', top: LibStyle.STATUSBAR_HEIGHT + 24, left: 24 }} >
|
|
48
47
|
<LibIcon name='close' color="white" />
|
|
49
48
|
</Pressable>
|
|
50
|
-
</
|
|
49
|
+
</View>
|
|
51
50
|
)
|
|
52
51
|
}
|
|
@@ -164,17 +164,17 @@ export default function m(props: LibDatepickerProps): any {
|
|
|
164
164
|
</TouchableOpacity>
|
|
165
165
|
</View>
|
|
166
166
|
<View style={{ height: 175, flexDirection: 'row' }} >
|
|
167
|
-
<View style={{ width:
|
|
167
|
+
<View style={{ width: showDateView ? undefined : 0, flex: showDateView ? 1 : 0, }} >
|
|
168
168
|
<ScrollPicker
|
|
169
|
-
ref={
|
|
170
|
-
dataSource={
|
|
171
|
-
selectedIndex={
|
|
169
|
+
ref={refDate}
|
|
170
|
+
dataSource={dates}
|
|
171
|
+
selectedIndex={dates.indexOf(date)}
|
|
172
172
|
itemHeight={35}
|
|
173
173
|
wrapperHeight={175}
|
|
174
174
|
wrapperColor={'#ffffff'}
|
|
175
175
|
highlightColor={'#c8c7cc'}
|
|
176
176
|
renderItem={itemRenderer}
|
|
177
|
-
onValueChange={
|
|
177
|
+
onValueChange={onDateChange}
|
|
178
178
|
/>
|
|
179
179
|
</View>
|
|
180
180
|
<View style={{ width: showMonthView ? undefined : 0, flex: showMonthView ? 1 : 0, }} >
|
|
@@ -190,24 +190,24 @@ export default function m(props: LibDatepickerProps): any {
|
|
|
190
190
|
onValueChange={onMonthChange}
|
|
191
191
|
/>
|
|
192
192
|
</View>
|
|
193
|
-
<View style={{ width:
|
|
193
|
+
<View style={{ width: showYearView ? undefined : 0, flex: showYearView ? 1 : 0, }} >
|
|
194
194
|
<ScrollPicker
|
|
195
|
-
ref={
|
|
196
|
-
dataSource={
|
|
197
|
-
selectedIndex={
|
|
195
|
+
ref={refYear}
|
|
196
|
+
dataSource={years}
|
|
197
|
+
selectedIndex={years.indexOf(year)}
|
|
198
198
|
itemHeight={35}
|
|
199
199
|
wrapperHeight={175}
|
|
200
200
|
wrapperColor={'#ffffff'}
|
|
201
201
|
highlightColor={'#c8c7cc'}
|
|
202
202
|
renderItem={itemRenderer}
|
|
203
|
-
onValueChange={
|
|
203
|
+
onValueChange={onYearChange}
|
|
204
204
|
/>
|
|
205
205
|
</View>
|
|
206
206
|
</View>
|
|
207
207
|
<LinearGradient
|
|
208
208
|
start={{ x: 1, y: 0 }}
|
|
209
209
|
end={{ x: 1, y: 1 }}
|
|
210
|
-
colors={['rgba(255,255,255,1)','rgba(255,255,255,0.8)', 'rgba(255,255,255,0)','rgba(255,255,255,0.8)', 'rgba(255,255,255,1)']}
|
|
210
|
+
colors={['rgba(255,255,255,1)', 'rgba(255,255,255,0.8)', 'rgba(255,255,255,0)', 'rgba(255,255,255,0.8)', 'rgba(255,255,255,1)']}
|
|
211
211
|
pointerEvents='none' style={{ height: 175, position: 'absolute', top: 44, bottom: 0, left: 0, right: 0 }} />
|
|
212
212
|
</View>
|
|
213
213
|
)
|
package/modules/lib/infinite.tsx
CHANGED
|
@@ -16,6 +16,7 @@ export interface LibInfiniteProps {
|
|
|
16
16
|
onResult?: (res: any, uri: string) => void,
|
|
17
17
|
filterData?: (item: any, index: number, array: any[]) => boolean,
|
|
18
18
|
error?: string,
|
|
19
|
+
LoadingView?: any,
|
|
19
20
|
errorView?: ((msg: string) => any) | any,
|
|
20
21
|
mainIndex?: string,
|
|
21
22
|
stickyHeaderIndices?: number[],
|
|
@@ -174,7 +175,7 @@ export default class m extends LibComponent<LibInfiniteProps, LibInfiniteState>{
|
|
|
174
175
|
<View style={{ flex: 1 }} >
|
|
175
176
|
{
|
|
176
177
|
(!data || data.length) == 0 && !this.isStop ?
|
|
177
|
-
<LibLoading />
|
|
178
|
+
this.props.LoadingView || <LibLoading />
|
|
178
179
|
:
|
|
179
180
|
<FlatList
|
|
180
181
|
ref={this.flatlist}
|
package/modules/lib/input.tsx
CHANGED
|
@@ -58,6 +58,7 @@ export default class m extends LibComponent<LibInputProps, LibInputState>{
|
|
|
58
58
|
this.clearError = this.clearError.bind(this);
|
|
59
59
|
this.setHelper = this.setHelper.bind(this);
|
|
60
60
|
this.clearHelper = this.clearHelper.bind(this);
|
|
61
|
+
this.reverseString = this.reverseString.bind(this);
|
|
61
62
|
this.getTextMasked = this.getTextMasked.bind(this);
|
|
62
63
|
}
|
|
63
64
|
|
|
@@ -93,20 +94,27 @@ export default class m extends LibComponent<LibInputProps, LibInputState>{
|
|
|
93
94
|
this.setState({ error: undefined })
|
|
94
95
|
}
|
|
95
96
|
|
|
97
|
+
reverseString(str: string): string {
|
|
98
|
+
let out = '';
|
|
99
|
+
for (let i = str.length - 1; i >= 0; i--) {
|
|
100
|
+
out += str[i];
|
|
101
|
+
}
|
|
102
|
+
return out;
|
|
103
|
+
}
|
|
104
|
+
|
|
96
105
|
mask(text: string): string {
|
|
97
|
-
let _text = text
|
|
98
106
|
let { mask, maskFrom } = this.props
|
|
99
107
|
if (mask) {
|
|
100
108
|
if (!maskFrom) maskFrom = 'start'
|
|
101
|
-
let rMask = mask
|
|
102
|
-
let rText = this.unmask(
|
|
109
|
+
let rMask = mask
|
|
110
|
+
let rText = this.unmask(text)
|
|
103
111
|
if (maskFrom == 'end') {
|
|
104
|
-
rMask =
|
|
105
|
-
rText =
|
|
112
|
+
rMask = this.reverseString(mask)
|
|
113
|
+
rText = this.reverseString(rText)
|
|
106
114
|
}
|
|
107
115
|
let maskedText = ''
|
|
108
|
-
|
|
109
|
-
|
|
116
|
+
let _addRange = 0
|
|
117
|
+
let _addMaskChar = ''
|
|
110
118
|
for (let i = 0; i < rMask.length; i++) {
|
|
111
119
|
const iMask = rMask[i];
|
|
112
120
|
if (iMask == '#') {
|
|
@@ -124,12 +132,12 @@ export default class m extends LibComponent<LibInputProps, LibInputState>{
|
|
|
124
132
|
}
|
|
125
133
|
}
|
|
126
134
|
if (maskFrom == 'end') {
|
|
127
|
-
maskedText =
|
|
135
|
+
maskedText = this.reverseString(maskedText)
|
|
128
136
|
}
|
|
129
137
|
this.ref.setNativeProps({ text: maskedText })
|
|
130
138
|
return maskedText
|
|
131
139
|
}
|
|
132
|
-
return
|
|
140
|
+
return text
|
|
133
141
|
}
|
|
134
142
|
|
|
135
143
|
unmask(text: string): string {
|
package/modules/lib/picture.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// withHooks
|
|
2
2
|
// noPage
|
|
3
3
|
|
|
4
|
+
import { esp, LibStyle, LibWorker, LibWorkloop, useSafeState } from 'esoftplay';
|
|
5
|
+
import * as FileSystem from 'expo-file-system';
|
|
4
6
|
import React, { useMemo } from 'react';
|
|
5
|
-
import {
|
|
6
|
-
import { useSafeState, LibWorker, LibStyle, LibWorkloop, esp, } from 'esoftplay';
|
|
7
|
-
import * as FileSystem from 'expo-file-system'
|
|
7
|
+
import { Image, PixelRatio, Platform, View } from 'react-native';
|
|
8
8
|
const sh = require("shorthash")
|
|
9
9
|
|
|
10
10
|
export interface LibPictureSource {
|
|
@@ -36,6 +36,7 @@ const getCacheEntry = async (uri: string, toSize: number): Promise<{ exists: boo
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
const fetchPicture = LibWorker.registerJobAsync('lib_picture_fetch', (url: string, toSize: number) => {
|
|
39
|
+
'show source';
|
|
39
40
|
return new Promise((resolve, reject) => {
|
|
40
41
|
fetch(url, { mode: 'cors' })
|
|
41
42
|
.then(response => response.blob())
|
package/modules/lib/toast.tsx
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
// noPage
|
|
3
3
|
|
|
4
4
|
import { LibStyle, useGlobalState } from 'esoftplay';
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { useEffect } from 'react';
|
|
6
6
|
import { Text } from 'react-native';
|
|
7
|
-
import Animated, {
|
|
8
|
-
;
|
|
7
|
+
import Animated, { interpolate, useAnimatedProps, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
9
8
|
|
|
10
9
|
export interface LibToastProps {
|
|
11
10
|
|
|
@@ -39,35 +38,23 @@ export function show(message: string, timeout?: number): void {
|
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
export default function m(props: LibToastProps): any {
|
|
42
|
-
const data = state.
|
|
43
|
-
|
|
41
|
+
const [data] = state.useState()
|
|
42
|
+
const anim = useSharedValue(0)
|
|
44
43
|
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
})
|
|
51
|
-
const op = animatable.interpolate({
|
|
52
|
-
inputRange: [0, 0.7, 1],
|
|
53
|
-
outputRange: [0, 0, 1],
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
const showHide = useCallback((show: boolean) => {
|
|
57
|
-
Animated.timing(animatable, {
|
|
58
|
-
toValue: show ? 1 : 0,
|
|
59
|
-
duration: 500,
|
|
60
|
-
easing: EasingNode.linear
|
|
61
|
-
}).start()
|
|
62
|
-
}, [data])
|
|
44
|
+
const style = useAnimatedProps(() => ({
|
|
45
|
+
transform: [{
|
|
46
|
+
translateY: interpolate(anim.value, [0, 1], [-(LibStyle.STATUSBAR_HEIGHT + 400), 0])
|
|
47
|
+
}],
|
|
48
|
+
opacity: interpolate(anim.value, [0, 0.8, 1], [0, 0, 1])
|
|
49
|
+
}))
|
|
63
50
|
|
|
64
51
|
useEffect(() => {
|
|
65
|
-
|
|
52
|
+
anim.value = withTiming(data?.message ? 1 : 0, { duration: 500 })
|
|
66
53
|
}, [data])
|
|
67
54
|
|
|
68
55
|
return (
|
|
69
|
-
<Animated.View style={{ position: 'absolute', top: LibStyle.STATUSBAR_HEIGHT + 70, left: 0, right: 0,
|
|
70
|
-
<Text style={{ fontSize:
|
|
56
|
+
<Animated.View style={[{ position: 'absolute', top: LibStyle.STATUSBAR_HEIGHT + 70, left: 0, right: 0, marginVertical: 4, marginHorizontal: 13, borderRadius: 4, borderWidth: 1, borderColor: '#505050', backgroundColor: '#323232', paddingVertical: 13, paddingHorizontal: 16, }, style, LibStyle.elevation(2)]} >
|
|
57
|
+
<Text style={{ fontSize: 14, textAlign: "center", color: 'white' }} >{String(data?.message || '')}</Text>
|
|
71
58
|
</Animated.View>
|
|
72
59
|
)
|
|
73
60
|
}
|
package/modules/lib/updater.tsx
CHANGED
package/modules/lib/webview.tsx
CHANGED
|
@@ -127,6 +127,7 @@ class ewebview extends LibComponent<LibWebviewProps, LibWebviewState> {
|
|
|
127
127
|
<Animated.View style={{ height: this.state.height, overflow: "hidden" }}>
|
|
128
128
|
<WebView
|
|
129
129
|
{...otherprops}
|
|
130
|
+
cacheEnabled={false}
|
|
130
131
|
ref={(e: any) => this.webview = e}
|
|
131
132
|
source={this.state.source}
|
|
132
133
|
bounces={bounces !== undefined ? bounces : true}
|
package/modules/lib/worker.tsx
CHANGED
|
@@ -32,6 +32,7 @@ export default class m extends Component<LibWorkerProps, LibWorkerState> {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
static registerJob(name: string, func: Function): (params: any[], res: (data: any) => void) => void {
|
|
35
|
+
'show source';
|
|
35
36
|
const x = func.toString().replace('function', 'function ' + name)
|
|
36
37
|
_global.injectedJavaScripts.push(x)
|
|
37
38
|
m.dispatch(() => x, '', () => { })
|
|
@@ -54,6 +55,7 @@ export default class m extends Component<LibWorkerProps, LibWorkerState> {
|
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
static registerJobAsync(name: string, func: (...fparams: any[]) => Promise<any>): (params: any[], res: (data: any) => void) => void {
|
|
58
|
+
'show source';
|
|
57
59
|
const x = func.toString().replace('function', 'function ' + name)
|
|
58
60
|
_global.injectedJavaScripts.push(x)
|
|
59
61
|
m.dispatch(() => x, '', () => { })
|
|
@@ -86,6 +88,7 @@ export default class m extends Component<LibWorkerProps, LibWorkerState> {
|
|
|
86
88
|
}
|
|
87
89
|
|
|
88
90
|
static jobAsync(func: (...fparams: any[]) => Promise<any>, params: (string | number | boolean)[], res: (data: any) => void): void {
|
|
91
|
+
'show source';
|
|
89
92
|
if (Platform.OS == 'android')
|
|
90
93
|
if (Platform.Version <= 22) {
|
|
91
94
|
(async () => res(await func(...params)))()
|
|
@@ -105,6 +108,7 @@ export default class m extends Component<LibWorkerProps, LibWorkerState> {
|
|
|
105
108
|
}
|
|
106
109
|
|
|
107
110
|
static job(func: Function, params: (string | number | boolean)[], res: (data: any) => void): void {
|
|
111
|
+
'show source';
|
|
108
112
|
if (Platform.OS == 'android')
|
|
109
113
|
if (Platform.Version <= 22) {
|
|
110
114
|
return res(func(...params))
|
package/modules/use/deeplink.ts
CHANGED
|
@@ -6,12 +6,19 @@ import { useCallback, useEffect } from 'react';
|
|
|
6
6
|
import { Alert, Linking } from 'react-native';
|
|
7
7
|
|
|
8
8
|
export default function m(defaultUrl?: string): void {
|
|
9
|
-
const doLink = useCallback(({ url }:
|
|
9
|
+
const doLink = useCallback(({ url }: { url: string }) => {
|
|
10
10
|
const { domain, uri } = esp.config()
|
|
11
11
|
if (url?.includes(defaultUrl || domain))
|
|
12
12
|
LibUtils.debounce(() => {
|
|
13
13
|
url = url.replace((domain + uri), (domain + uri + 'deeplink/'))
|
|
14
|
-
|
|
14
|
+
function removeLastDot(url: string) {
|
|
15
|
+
if (url.substr(url.length - 1, 1) == '.') {
|
|
16
|
+
url = url.substring(0, url.length - 1)
|
|
17
|
+
return removeLastDot(url)
|
|
18
|
+
}
|
|
19
|
+
return url
|
|
20
|
+
}
|
|
21
|
+
new LibCurl().custom(removeLastDot(url), null,
|
|
15
22
|
(res) => {
|
|
16
23
|
if (res.ok == 1) {
|
|
17
24
|
function nav(module: string, url: string) {
|
|
@@ -20,6 +27,7 @@ export default function m(defaultUrl?: string): void {
|
|
|
20
27
|
nav(module, url)
|
|
21
28
|
}, 500);
|
|
22
29
|
} else {
|
|
30
|
+
//@ts-nocheck
|
|
23
31
|
LibNavigation.push(module, { url: url })
|
|
24
32
|
}
|
|
25
33
|
}
|
package/modules/user/data.ts
CHANGED
|
@@ -28,7 +28,9 @@ export default class m {
|
|
|
28
28
|
|
|
29
29
|
deleteAll(): void {
|
|
30
30
|
AsyncStorage.getItem("user_data_dependent").then((x) => {
|
|
31
|
-
|
|
31
|
+
if (_global?.useGlobalUserDelete) {
|
|
32
|
+
Object.values?.(_global?.useGlobalUserDelete)?.map?.((func) => func?.())
|
|
33
|
+
}
|
|
32
34
|
if (x) AsyncStorage.multiRemove(JSON.parse(x))
|
|
33
35
|
})
|
|
34
36
|
}
|
package/modules/user/index.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import { esp, LibDialog, LibImage, LibNet_status, LibProgress, LibStyle, LibToas
|
|
|
5
5
|
import * as Font from "expo-font";
|
|
6
6
|
import firebase from 'firebase';
|
|
7
7
|
import React, { useEffect, useMemo } from "react";
|
|
8
|
-
import { View } from "react-native";
|
|
8
|
+
import { Alert, View } from "react-native";
|
|
9
9
|
//@ts-ignore
|
|
10
10
|
import Navs from "../../cache/navs";
|
|
11
11
|
|
|
@@ -47,6 +47,14 @@ export default function m(props: UserIndexProps): any {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
useMemo(() => {
|
|
50
|
+
const timeout = setTimeout(() => {
|
|
51
|
+
Alert.alert("Yey...! Pembaharuan sudah selesai", "Silahkan mulai ulang aplikasi kamu", [
|
|
52
|
+
{
|
|
53
|
+
onPress: () => LibUpdaterProperty.install(),
|
|
54
|
+
text: "Mulai Ulang Sekarang"
|
|
55
|
+
}
|
|
56
|
+
], { cancelable: false })
|
|
57
|
+
}, 30 * 1000);
|
|
50
58
|
if (esp.config('firebase').hasOwnProperty('apiKey')) {
|
|
51
59
|
if (!firebase.apps.length) {
|
|
52
60
|
firebase.initializeApp(esp.config('firebase'));
|
|
@@ -59,6 +67,7 @@ export default function m(props: UserIndexProps): any {
|
|
|
59
67
|
if (isNew) {
|
|
60
68
|
LibUpdaterProperty.install()
|
|
61
69
|
} else {
|
|
70
|
+
clearTimeout(timeout)
|
|
62
71
|
setLoading(false)
|
|
63
72
|
}
|
|
64
73
|
})
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "esoftplay",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.108",
|
|
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",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"install": "esp start",
|
|
9
8
|
"postinstall": "node ./bin/build.js install",
|
|
10
9
|
"test": "node ./bin/build.js install"
|
|
11
10
|
},
|