esoftplay 0.0.135 → 0.0.136-b
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 +52 -92
- 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/bin/build.js
CHANGED
|
@@ -168,6 +168,10 @@ if (fs.existsSync(packjson)) {
|
|
|
168
168
|
"simulator": true
|
|
169
169
|
}
|
|
170
170
|
},
|
|
171
|
+
"development_build": {
|
|
172
|
+
"developmentClient": true,
|
|
173
|
+
"distribution": "internal"
|
|
174
|
+
},
|
|
171
175
|
"preview": {
|
|
172
176
|
"distribution": "internal",
|
|
173
177
|
"ios": {
|
|
@@ -194,19 +198,13 @@ if (fs.existsSync(packjson)) {
|
|
|
194
198
|
})
|
|
195
199
|
|
|
196
200
|
const babelconf = `module.exports = function (api) {
|
|
197
|
-
api.cache(true);
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
plugins.push("react-native-reanimated/plugin")
|
|
206
|
-
return {
|
|
207
|
-
presets: ["babel-preset-expo"],
|
|
208
|
-
plugins
|
|
209
|
-
};
|
|
201
|
+
api.cache(true);
|
|
202
|
+
let plugins = []
|
|
203
|
+
plugins.push("react-native-reanimated/plugin")
|
|
204
|
+
return {
|
|
205
|
+
presets: ["babel-preset-expo"],
|
|
206
|
+
plugins
|
|
207
|
+
};
|
|
210
208
|
};
|
|
211
209
|
|
|
212
210
|
`
|
|
@@ -326,8 +324,6 @@ export default UserIndex`;
|
|
|
326
324
|
}
|
|
327
325
|
let devLibs = [
|
|
328
326
|
"@babel/core",
|
|
329
|
-
"babel-plugin-transform-react-native-style-optimizer",
|
|
330
|
-
"babel-plugin-transform-remove-console",
|
|
331
327
|
"@types/react",
|
|
332
328
|
"typescript",
|
|
333
329
|
]
|
|
@@ -340,6 +336,9 @@ export default UserIndex`;
|
|
|
340
336
|
expoLib.forEach((exlib) => {
|
|
341
337
|
if (fs.existsSync("../../node_modules/" + exlib)) {
|
|
342
338
|
console.log(exlib + " is Exist, Skipped")
|
|
339
|
+
if (exlib == '@expo/vector-icons') {
|
|
340
|
+
installExpoLibs.push(exlib)
|
|
341
|
+
}
|
|
343
342
|
} else {
|
|
344
343
|
console.log("⚙⚙⚙ INSTALLING ... " + exlib)
|
|
345
344
|
installExpoLibs.push(exlib)
|
package/bin/cli.js
CHANGED
|
@@ -132,9 +132,6 @@ switch (args[0]) {
|
|
|
132
132
|
createMaster(args[1])
|
|
133
133
|
break;
|
|
134
134
|
case "start":
|
|
135
|
-
jsEng(appjson, false)
|
|
136
|
-
jsEng(appdebug, false)
|
|
137
|
-
jsEng(applive, false)
|
|
138
135
|
excludeModules()
|
|
139
136
|
execution();
|
|
140
137
|
break;
|
|
@@ -270,23 +267,6 @@ function consoleFunc(msg, success) {
|
|
|
270
267
|
}
|
|
271
268
|
}
|
|
272
269
|
|
|
273
|
-
|
|
274
|
-
function jsEng(file, isHermes) {
|
|
275
|
-
if (fs.existsSync(file)) {
|
|
276
|
-
var txt = fs.readFileSync(file, 'utf8');
|
|
277
|
-
let isJSON = txt.startsWith('{') || txt.startsWith('[')
|
|
278
|
-
if (!isJSON) {
|
|
279
|
-
consoleError('app.json tidak valid')
|
|
280
|
-
return
|
|
281
|
-
}
|
|
282
|
-
let app = JSON.parse(txt)
|
|
283
|
-
app.expo.jsEngine = isHermes ? "hermes" : "hermes"
|
|
284
|
-
fs.writeFileSync(file, JSON.stringify(app, undefined, 2))
|
|
285
|
-
} else {
|
|
286
|
-
consoleError(file)
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
270
|
function configUpdate(state) {
|
|
291
271
|
let _path;
|
|
292
272
|
let _slug
|
|
@@ -476,9 +456,9 @@ function readToJSON(path) {
|
|
|
476
456
|
|
|
477
457
|
|
|
478
458
|
function publish(notes) {
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
459
|
+
consoleSucces("START PULL OTA..")
|
|
460
|
+
command('cd /var/www/html/ota && git fetch origin master && git reset --hard FETCH_HEAD && git clean -df')
|
|
461
|
+
consoleSucces("END PULL OTA..")
|
|
482
462
|
let status = "-"
|
|
483
463
|
let isCustomServer = false
|
|
484
464
|
let ajson = readToJSON(appjson)
|
|
@@ -501,7 +481,7 @@ function publish(notes) {
|
|
|
501
481
|
if (fs.existsSync(appdebug)) {
|
|
502
482
|
adebug = readToJSON(appdebug)
|
|
503
483
|
}
|
|
504
|
-
if (ajson.expo.updates.url) {
|
|
484
|
+
if (ajson.expo.updates.hasOwnProperty('url')) {
|
|
505
485
|
isCustomServer = true
|
|
506
486
|
}
|
|
507
487
|
if (clive) {
|
|
@@ -567,8 +547,6 @@ function publish(notes) {
|
|
|
567
547
|
ajson.config = {}
|
|
568
548
|
}
|
|
569
549
|
ajson.config.publish_id = last_id + 1
|
|
570
|
-
fs.writeFileSync(appjson, JSON.stringify(ajson, undefined, 2))
|
|
571
|
-
consoleSucces("start publishing " + status.toUpperCase() + " - PUBLISH_ID : " + (last_id + 1))
|
|
572
550
|
if (isCustomServer) {
|
|
573
551
|
if (!fs.existsSync('/var/www/html/ota/')) {
|
|
574
552
|
consoleError("ota not found at /var/www/html/ota, please clone it first!")
|
|
@@ -579,8 +557,17 @@ function publish(notes) {
|
|
|
579
557
|
let date_format_str;
|
|
580
558
|
if (isUpdateExist) {
|
|
581
559
|
currentUpdate = fs.readdirSync('/var/www/html/ota/updates/' + ajson.expo.runtimeVersion)[0]
|
|
582
|
-
|
|
583
|
-
|
|
560
|
+
let formattedDate = new Date(currentUpdate * 1000).toLocaleString('id', {
|
|
561
|
+
day: '2-digit',
|
|
562
|
+
month: 'long',
|
|
563
|
+
year: 'numeric',
|
|
564
|
+
hour: '2-digit',
|
|
565
|
+
minute: '2-digit',
|
|
566
|
+
second: '2-digit',
|
|
567
|
+
hour12: false, // Use 24-hour format
|
|
568
|
+
timeZone: 'Asia/Jakarta'
|
|
569
|
+
});
|
|
570
|
+
date_format_str = formattedDate
|
|
584
571
|
}
|
|
585
572
|
var out = false
|
|
586
573
|
const rl = readline.createInterface({
|
|
@@ -595,14 +582,16 @@ isDebug : ${cjson.config.isDebug}
|
|
|
595
582
|
runtimeVersion : ${ajson.expo.runtimeVersion}
|
|
596
583
|
Update terakhir: ${currentUpdate ? date_format_str : '- not found'}
|
|
597
584
|
|
|
598
|
-
Pastikan data sudah benar sebelum anda melanjutkan, lanjut publish
|
|
585
|
+
Pastikan data sudah benar sebelum anda melanjutkan, lanjut publish ketikkan runtimeVersion: `,
|
|
599
586
|
function (input) {
|
|
600
587
|
out = input
|
|
601
588
|
rl.close();
|
|
602
589
|
});
|
|
603
590
|
|
|
604
591
|
rl.on("close", function () {
|
|
605
|
-
if (out && out
|
|
592
|
+
if (out && out == ajson.expo.runtimeVersion) {
|
|
593
|
+
fs.writeFileSync(appjson, JSON.stringify(ajson, undefined, 2))
|
|
594
|
+
consoleSucces("start publishing " + status.toUpperCase() + " - PUBLISH_ID : " + (last_id + 1))
|
|
606
595
|
command("rm -rf ./dist && esp start && currentPath=$(pwd) && cd /var/www/html/ota/ && npm run publish $currentPath \"" + notes + "\" && cd $currentPath && rm -rf ./dist")
|
|
607
596
|
consoleSucces("Berhasil")
|
|
608
597
|
const os = require('os')
|
|
@@ -640,6 +629,8 @@ Pastikan data sudah benar sebelum anda melanjutkan, lanjut publish(y/n)?`,
|
|
|
640
629
|
});
|
|
641
630
|
return
|
|
642
631
|
} else {
|
|
632
|
+
fs.writeFileSync(appjson, JSON.stringify(ajson, undefined, 2))
|
|
633
|
+
consoleSucces("start publishing " + status.toUpperCase() + " - PUBLISH_ID : " + (last_id + 1))
|
|
643
634
|
command("expo p")
|
|
644
635
|
consoleSucces("Berhasil")
|
|
645
636
|
const os = require('os')
|
|
@@ -811,38 +802,27 @@ function buildPrepare(include = true) {
|
|
|
811
802
|
}
|
|
812
803
|
}
|
|
813
804
|
|
|
814
|
-
|
|
815
805
|
function configAvailable(enabled) {
|
|
816
|
-
|
|
817
|
-
let _git = fs.readFileSync(gitignore, 'utf8')
|
|
818
|
-
var ignore = "config.json"
|
|
819
|
-
var notignore = "#config.json"
|
|
806
|
+
function replace(_git, ignore, enabled) {
|
|
820
807
|
if (enabled) {
|
|
821
|
-
_git = _git.replace(ignore,
|
|
808
|
+
_git = _git.replace('\n' + ignore, '\n#' + ignore)
|
|
822
809
|
} else {
|
|
823
|
-
_git = _git.replace(
|
|
824
|
-
}
|
|
825
|
-
var ignore = "config.live.json"
|
|
826
|
-
var notignore = "#config.live.json"
|
|
827
|
-
if (enabled) {
|
|
828
|
-
_git = _git.replace(ignore, notignore)
|
|
829
|
-
} else {
|
|
830
|
-
_git = _git.replace(notignore, ignore)
|
|
831
|
-
}
|
|
832
|
-
var ignore = "config.debug.json"
|
|
833
|
-
var notignore = "#config.debug.json"
|
|
834
|
-
if (enabled) {
|
|
835
|
-
_git = _git.replace(ignore, notignore)
|
|
836
|
-
} else {
|
|
837
|
-
_git = _git.replace(notignore, ignore)
|
|
838
|
-
}
|
|
839
|
-
var ignore = "code-signing/"
|
|
840
|
-
var notignore = "#code-signing/"
|
|
841
|
-
if (enabled) {
|
|
842
|
-
_git = _git.replace(ignore, notignore)
|
|
843
|
-
} else {
|
|
844
|
-
_git = _git.replace(notignore, ignore)
|
|
810
|
+
_git = _git.replace('\n#' + ignore, '\n' + ignore)
|
|
845
811
|
}
|
|
812
|
+
return _git
|
|
813
|
+
}
|
|
814
|
+
if (fs.existsSync(gitignore)) {
|
|
815
|
+
let _git = fs.readFileSync(gitignore, 'utf8')
|
|
816
|
+
const ignores = [
|
|
817
|
+
"config.json",
|
|
818
|
+
"config.live.json",
|
|
819
|
+
"config.debug.json",
|
|
820
|
+
"code-signing/",
|
|
821
|
+
"certificate.pem"
|
|
822
|
+
]
|
|
823
|
+
ignores.forEach((key) => {
|
|
824
|
+
_git = replace(_git, key, enabled)
|
|
825
|
+
})
|
|
846
826
|
fs.writeFileSync(gitignore, _git, { encoding: 'utf8' })
|
|
847
827
|
} else {
|
|
848
828
|
consoleError(gitignore)
|
|
@@ -883,82 +863,62 @@ function build() {
|
|
|
883
863
|
pre: () => {
|
|
884
864
|
configAvailable(true)
|
|
885
865
|
devClientPre(appjson)
|
|
886
|
-
jsEng(appjson, false)
|
|
887
|
-
jsEng(appdebug, false)
|
|
888
|
-
jsEng(applive, false)
|
|
889
|
-
consoleSucces("Hermes dinonaktifkan")
|
|
890
866
|
}
|
|
891
867
|
},
|
|
892
868
|
{
|
|
893
|
-
name: "2. IOS (
|
|
869
|
+
name: "2. IOS (Development) - Non Simulator",
|
|
870
|
+
cmd: "eas build --platform ios --profile development_build" + local,
|
|
871
|
+
pre: () => {
|
|
872
|
+
configAvailable(true)
|
|
873
|
+
devClientPre(appjson)
|
|
874
|
+
}
|
|
875
|
+
},
|
|
876
|
+
{
|
|
877
|
+
name: "3. IOS (Preview) - Simulator",
|
|
894
878
|
cmd: "eas build --platform ios --profile preview" + local,
|
|
895
879
|
pre: () => {
|
|
896
880
|
configAvailable(true)
|
|
897
881
|
devClientPos(appjson)
|
|
898
|
-
jsEng(appjson, true)
|
|
899
|
-
jsEng(appdebug, true)
|
|
900
|
-
jsEng(applive, true)
|
|
901
|
-
consoleSucces("Hermes diaktifkan")
|
|
902
882
|
}
|
|
903
883
|
},
|
|
904
884
|
{
|
|
905
|
-
name: "
|
|
885
|
+
name: "4. IOS (Preview) - Non Simulator",
|
|
906
886
|
cmd: "eas build --platform ios --profile preview_build" + local,
|
|
907
887
|
pre: () => {
|
|
908
888
|
configAvailable(true)
|
|
909
889
|
devClientPos(appjson)
|
|
910
|
-
jsEng(appjson, true)
|
|
911
|
-
jsEng(appdebug, true)
|
|
912
|
-
jsEng(applive, true)
|
|
913
|
-
consoleSucces("Hermes diaktifkan")
|
|
914
890
|
}
|
|
915
891
|
},
|
|
916
892
|
{
|
|
917
|
-
name: "
|
|
893
|
+
name: "5. IOS (Production) - ipa",
|
|
918
894
|
cmd: "eas build --platform ios --profile production" + local,
|
|
919
895
|
pre: () => {
|
|
920
896
|
configAvailable(true)
|
|
921
897
|
devClientPos(appjson)
|
|
922
|
-
jsEng(appjson, true)
|
|
923
|
-
jsEng(appdebug, true)
|
|
924
|
-
jsEng(applive, true)
|
|
925
|
-
consoleSucces("Hermes diaktifkan")
|
|
926
898
|
}
|
|
927
899
|
},
|
|
928
900
|
{
|
|
929
|
-
name: "
|
|
901
|
+
name: "6. Android (Development) - apk",
|
|
930
902
|
cmd: "eas build --platform android --profile development" + local,
|
|
931
903
|
pre: () => {
|
|
932
904
|
configAvailable(true)
|
|
933
905
|
devClientPre(appjson)
|
|
934
|
-
jsEng(appjson, false)
|
|
935
|
-
jsEng(appdebug, false)
|
|
936
|
-
jsEng(applive, false)
|
|
937
|
-
consoleSucces("Hermes dinonaktifkan")
|
|
938
906
|
}
|
|
939
907
|
},
|
|
940
908
|
{
|
|
941
|
-
name: "
|
|
909
|
+
name: "7. Android (Preview) - apk",
|
|
942
910
|
cmd: "eas build --platform android --profile preview" + local,
|
|
943
911
|
pre: () => {
|
|
944
912
|
configAvailable(true)
|
|
945
913
|
devClientPos(appjson)
|
|
946
|
-
jsEng(appjson, true)
|
|
947
|
-
jsEng(appdebug, true)
|
|
948
|
-
jsEng(applive, true)
|
|
949
|
-
consoleSucces("Hermes diaktifkan")
|
|
950
914
|
}
|
|
951
915
|
},
|
|
952
916
|
{
|
|
953
|
-
name: "
|
|
917
|
+
name: "8. Android (Production) - aab",
|
|
954
918
|
cmd: "eas build --platform android --profile production" + local,
|
|
955
919
|
pre: () => {
|
|
956
920
|
configAvailable(true)
|
|
957
921
|
devClientPos(appjson)
|
|
958
|
-
jsEng(appjson, true)
|
|
959
|
-
jsEng(appdebug, true)
|
|
960
|
-
jsEng(applive, true)
|
|
961
|
-
consoleSucces("Hermes diaktifkan")
|
|
962
922
|
}
|
|
963
923
|
}
|
|
964
924
|
]
|
package/bin/mover.js
CHANGED
|
@@ -13,96 +13,98 @@ const mainModule = args[0]
|
|
|
13
13
|
const moduleName = args[0]?.split("-")?.[1]
|
|
14
14
|
|
|
15
15
|
/* copy directory */
|
|
16
|
-
if (fs.existsSync(
|
|
17
|
-
if (fs.existsSync('../esoftplay/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
if (fs.existsSync("../" + mainModule + "/" + moduleName)) {
|
|
17
|
+
if (fs.existsSync('../esoftplay/esp.ts')) {
|
|
18
|
+
if (fs.existsSync('../esoftplay/modules/' + moduleName))
|
|
19
|
+
shell('rm -r ../esoftplay/modules/' + moduleName)
|
|
20
|
+
shell("cp -r ../" + mainModule + "/" + moduleName + " ../esoftplay/modules/")
|
|
21
|
+
} else {
|
|
22
|
+
throw "Mohon install esoftplay package terlebih dahulu"
|
|
23
|
+
}
|
|
23
24
|
|
|
24
|
-
function readAsJson(path) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
function readAsJson(path) {
|
|
26
|
+
let out = ""
|
|
27
|
+
try {
|
|
28
|
+
out = JSON.parse(fs.readFileSync(path, { encoding: 'utf8' }))
|
|
29
|
+
} catch (e) {
|
|
29
30
|
|
|
31
|
+
}
|
|
32
|
+
return out;
|
|
30
33
|
}
|
|
31
|
-
return out;
|
|
32
|
-
}
|
|
33
34
|
|
|
34
|
-
function injectConfig(configPath) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
function injectConfig(configPath) {
|
|
36
|
+
if (fs.existsSync(configPath)) {
|
|
37
|
+
const config = "../" + mainModule + "/config.json"
|
|
38
|
+
const exsConf = readAsJson(configPath)
|
|
39
|
+
const conf = readAsJson(config)
|
|
40
|
+
let _cf = merge({ config: conf }, exsConf)
|
|
41
|
+
fs.writeFileSync(configPath, JSON.stringify({ ..._cf }, undefined, 2))
|
|
42
|
+
}
|
|
41
43
|
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/* injectConfig */
|
|
45
|
-
injectConfig("../../config.json")
|
|
46
|
-
injectConfig("../../config.live.json")
|
|
47
|
-
injectConfig("../../config.debug.json")
|
|
48
44
|
|
|
49
|
-
/*
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
shell("mkdir -p ../../assets/" + moduleName)
|
|
54
|
-
try {
|
|
55
|
-
shell("cp -r -n ../" + mainModule + "/assets/* ../../assets/" + moduleName + "/")
|
|
56
|
-
} catch (error) { }
|
|
57
|
-
}
|
|
45
|
+
/* injectConfig */
|
|
46
|
+
injectConfig("../../config.json")
|
|
47
|
+
injectConfig("../../config.live.json")
|
|
48
|
+
injectConfig("../../config.debug.json")
|
|
58
49
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
50
|
+
/* move assets */
|
|
51
|
+
if (fs.existsSync("../" + mainModule + "/assets/")) {
|
|
52
|
+
console.log("ADA ASSETS");
|
|
53
|
+
if (!fs.existsSync("../../assets/" + moduleName))
|
|
54
|
+
shell("mkdir -p ../../assets/" + moduleName)
|
|
55
|
+
try {
|
|
56
|
+
shell("cp -r -n ../" + mainModule + "/assets/* ../../assets/" + moduleName + "/")
|
|
57
|
+
} catch (error) { }
|
|
58
|
+
}
|
|
67
59
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
60
|
+
if (fs.existsSync("../" + mainModule + "/fonts/")) {
|
|
61
|
+
console.log("ADA FONTS");
|
|
62
|
+
if (!fs.existsSync("../../" + assetsFonts))
|
|
63
|
+
shell("mkdir -p ../../" + assetsFonts)
|
|
64
|
+
try {
|
|
65
|
+
shell("cp -r -n ../" + mainModule + "/fonts/* ../../" + assetsFonts + "/")
|
|
66
|
+
} catch (error) { }
|
|
75
67
|
}
|
|
76
|
-
fs.writeFileSync("../../assets/locale/id.json", JSON.stringify(moduleLang, undefined, 2))
|
|
77
|
-
/* sort id.JSON */
|
|
78
|
-
shell("cd ../../ && bun ./node_modules/esoftplay/bin/locale.js")
|
|
79
|
-
}
|
|
80
68
|
|
|
81
|
-
/* inject
|
|
82
|
-
if (fs.existsSync("../" + mainModule + "/
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
libsToSkip.push(element)
|
|
69
|
+
/* inject lang */
|
|
70
|
+
if (fs.existsSync("../" + mainModule + "/id.json")) {
|
|
71
|
+
let moduleLang = readAsJson("../" + mainModule + "/id.json")
|
|
72
|
+
if (fs.existsSync("../../assets/locale/id.json")) {
|
|
73
|
+
let projectLang = readAsJson("../../assets/locale/id.json")
|
|
74
|
+
let _lg = merge(moduleLang, projectLang)
|
|
75
|
+
moduleLang = { ..._lg }
|
|
89
76
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
libs = libs.filter((x) => x != lib)
|
|
94
|
-
console.log(lib + " is exist, Skipped")
|
|
95
|
-
})
|
|
77
|
+
fs.writeFileSync("../../assets/locale/id.json", JSON.stringify(moduleLang, undefined, 2))
|
|
78
|
+
/* sort id.JSON */
|
|
79
|
+
shell("cd ../../ && bun ./node_modules/esoftplay/bin/locale.js")
|
|
96
80
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
81
|
+
|
|
82
|
+
/* inject libs */
|
|
83
|
+
if (fs.existsSync("../" + mainModule + "/libs.json")) {
|
|
84
|
+
let libs = readAsJson("../" + mainModule + "/libs.json")
|
|
85
|
+
let libsToSkip = []
|
|
86
|
+
libs.forEach((element, index) => {
|
|
87
|
+
console.log(element.split("@")[0])
|
|
88
|
+
if (fs.existsSync("../../node_modules/" + element.split("@")[0])) {
|
|
89
|
+
libsToSkip.push(element)
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
if (libsToSkip.length > 0) {
|
|
93
|
+
libsToSkip.forEach((lib) => {
|
|
94
|
+
libs = libs.filter((x) => x != lib)
|
|
95
|
+
console.log(lib + " is exist, Skipped")
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
if (libs.length > 0) {
|
|
99
|
+
console.log("mohon tunggu ..")
|
|
100
|
+
console.log("installing \\n" + libs.join("\\n"))
|
|
101
|
+
shell("cd ../../ && expo install " + libs.join(" && expo install "))
|
|
102
|
+
}
|
|
103
|
+
console.log("Success..!")
|
|
101
104
|
}
|
|
102
|
-
console.log("Success..!")
|
|
103
|
-
}
|
|
104
105
|
|
|
105
|
-
/* execute mover on master */
|
|
106
|
-
if (fs.existsSync("../" + mainModule + "/mover.js")) {
|
|
107
|
-
|
|
108
|
-
}
|
|
106
|
+
/* execute mover on master */
|
|
107
|
+
if (fs.existsSync("../" + mainModule + "/mover.js")) {
|
|
108
|
+
shell("bun ../" + mainModule + "/mover.js", { stdio: 'inherit' })
|
|
109
|
+
}
|
|
110
|
+
}
|
package/bin/router.js
CHANGED
|
@@ -168,10 +168,12 @@ function createIndex() {
|
|
|
168
168
|
importer.push(`import useSafeState from 'esoftplay/state'`)
|
|
169
169
|
importer.push(`import useLazyState from 'esoftplay/lazy'`)
|
|
170
170
|
importer.push(`import Storage from 'esoftplay/storage'`)
|
|
171
|
+
importer.push(`import { createDebounce, createInterval, createTimeout, useDebounce, useInterval, useTimeout } from 'esoftplay/timeout'`)
|
|
171
172
|
AllRoutes.forEach((nav) => {
|
|
172
173
|
const [module, task] = nav.split('/')
|
|
173
174
|
const comp = ucword(module) + ucword(task)
|
|
174
175
|
importer.push(`import { ${comp} } from ${'"esoftplay/cache/' + module + '/' + task + '/import"'} `)
|
|
176
|
+
importer.push(`import { * as ${comp}Property } from ${'"esoftplay/cache/' + module + '/' + task + '/import"'} `)
|
|
175
177
|
})
|
|
176
178
|
var PreText = ''
|
|
177
179
|
var Text = `
|
package/global.ts
CHANGED
|
@@ -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?:
|
|
13
|
-
pageStyle?:
|
|
14
|
-
contentContainerStyle?:
|
|
12
|
+
style?: ViewStyle,
|
|
13
|
+
pageStyle?: ViewStyle,
|
|
14
|
+
contentContainerStyle?: ViewStyle,
|
|
15
15
|
pageInfo?: boolean,
|
|
16
16
|
pageInfoBackgroundColor?: string,
|
|
17
17
|
pageInfoTextStyle?: any,
|
|
18
|
-
pageInfoBottomContainerStyle?:
|
|
18
|
+
pageInfoBottomContainerStyle?: ViewStyle,
|
|
19
19
|
pageInfoTextSeparator?: string,
|
|
20
20
|
bullets?: boolean,
|
|
21
|
-
bulletsContainerStyle?:
|
|
22
|
-
bulletStyle?:
|
|
21
|
+
bulletsContainerStyle?: ViewStyle,
|
|
22
|
+
bulletStyle?: ViewStyle,
|
|
23
23
|
arrows?: boolean,
|
|
24
|
-
arrowsContainerStyle?:
|
|
25
|
-
arrowStyle?:
|
|
26
|
-
leftArrowStyle?:
|
|
27
|
-
rightArrowStyle?:
|
|
24
|
+
arrowsContainerStyle?: ViewStyle,
|
|
25
|
+
arrowStyle?: ViewStyle,
|
|
26
|
+
leftArrowStyle?: ViewStyle,
|
|
27
|
+
rightArrowStyle?: ViewStyle,
|
|
28
28
|
leftArrowText?: string,
|
|
29
29
|
rightArrowText?: string,
|
|
30
|
-
chosenBulletStyle?:
|
|
30
|
+
chosenBulletStyle?: ViewStyle,
|
|
31
31
|
onAnimateNextPage?: (currentPage: number) => void,
|
|
32
32
|
onPageBeingChanged?: (nextPage: number) => void,
|
|
33
33
|
swipe?: boolean,
|
|
@@ -205,7 +205,11 @@ export default class m extends LibComponent<LibCarrouselProps, LibCarrouselState
|
|
|
205
205
|
_onLayout(event: any): void {
|
|
206
206
|
const { height, width } = event.nativeEvent.layout;
|
|
207
207
|
this.setState({ size: { width, height } });
|
|
208
|
-
|
|
208
|
+
|
|
209
|
+
const timer = setTimeout(() => {
|
|
210
|
+
this._placeCritical(this.state.currentPage)
|
|
211
|
+
clearTimeout(timer)
|
|
212
|
+
}, 0);
|
|
209
213
|
}
|
|
210
214
|
|
|
211
215
|
_clearTimer(): void {
|
|
@@ -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?:
|
|
10
|
+
style?: StyleProp<ViewStyle>,
|
|
11
11
|
maxWidth: number,
|
|
12
12
|
autoCycle?: boolean,
|
|
13
13
|
loop?: boolean,
|
package/modules/lib/collaps.tsx
CHANGED
|
@@ -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?:
|
|
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 &&
|
|
@@ -90,8 +90,9 @@ export default function m(props: LibDatepickerProps): any {
|
|
|
90
90
|
}
|
|
91
91
|
setMonths(_months)
|
|
92
92
|
if (reset) {
|
|
93
|
-
|
|
93
|
+
const timer = setTimeout(() => {
|
|
94
94
|
refMonth.current!.scrollToIndex(0)
|
|
95
|
+
clearTimeout(timer)
|
|
95
96
|
}, 200);
|
|
96
97
|
setMonth(allMonths[0])
|
|
97
98
|
}
|
|
@@ -117,8 +118,9 @@ export default function m(props: LibDatepickerProps): any {
|
|
|
117
118
|
}
|
|
118
119
|
setDates(_dates)
|
|
119
120
|
if (reset) {
|
|
120
|
-
setTimeout(() => {
|
|
121
|
+
const timer = setTimeout(() => {
|
|
121
122
|
refDate.current!.scrollToIndex(0)
|
|
123
|
+
clearTimeout(timer)
|
|
122
124
|
}, 200);
|
|
123
125
|
setDate(_dates[0])
|
|
124
126
|
}
|
|
@@ -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?:
|
|
7
|
+
style?: StyleProp<TextStyle>,
|
|
8
8
|
initialText?: string
|
|
9
9
|
}
|
|
10
10
|
export interface LibDirect_textState {
|