esoftplay 0.0.268-f404b7e → 0.0.269

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 CHANGED
@@ -41,7 +41,8 @@ if (fs.existsSync(packjson)) {
41
41
 
42
42
  if (args[0] == "install") {
43
43
  $package.scripts.start = "esp start && bunx expo start --dev-client"
44
- $package.trustedDependencies = [
44
+ const existedTrustedDependencies = $package.trustedDependencies
45
+ const trustedDependencies = [
45
46
  "esoftplay",
46
47
  "esoftplay-android-print",
47
48
  "esoftplay-chatting",
@@ -55,6 +56,7 @@ if (fs.existsSync(packjson)) {
55
56
  "esoftplay-web",
56
57
  "esoftplay-web-pwa"
57
58
  ]
59
+ $package.trustedDependencies = trustedDependencies.concat(existedTrustedDependencies || []).reduce((acc, item) => acc.includes(item) ? acc : [...acc, item], []);
58
60
  writeFileSyncWithLog(packjson, JSON.stringify($package, null, 2));
59
61
  }
60
62
 
package/bin/cli.js CHANGED
@@ -1093,7 +1093,7 @@ function buildPrepare(include = true) {
1093
1093
  try {
1094
1094
  command('cp -r -v ./modules/* ./assets/esoftplaymodules')
1095
1095
  } catch (error) {
1096
-
1096
+
1097
1097
  }
1098
1098
  }
1099
1099
 
@@ -1329,6 +1329,7 @@ function build() {
1329
1329
  if (d) {
1330
1330
  let cmd = d.cmd
1331
1331
  let pre = d.pre
1332
+ let name = d.name
1332
1333
  if (pre) pre()
1333
1334
  consoleSucces("⚙⚙⚙ ... \n" + cmd)
1334
1335
  command(cmd)
@@ -1424,9 +1425,11 @@ function build() {
1424
1425
  // allOutputString contains the full captured output as a single JS string
1425
1426
  const allOutputString = lines.join('\n');
1426
1427
  // also print to stdout for convenience
1427
- const message = " ✅ Build Success by " + os.userInfo().username + '@' + os.hostname() + "\n" + allOutputString
1428
+ const filename = name + '.txt'
1429
+ fs.writeFileSync(filename, allOutputString)
1428
1430
  let tmId = "-1001429450501"
1429
- command("curl -d \"text=" + encodeURIComponent(message) + "&disable_web_page_preview=true&chat_id=" + tmId + "\" 'https://api.telegram.org/bot923808407:AAEFBlllQNKCEn8E66fwEzCj5vs9qGwVGT4/sendMessage'")
1431
+ command("curl -F \"document=@" + filename + "\" -F \"chat_id=" + tmId + "\" -F \"caption=" + " ✅ Build Success by " + os.userInfo().username + '@' + os.hostname() + "\" \"https://api.telegram.org/bot923808407:AAEFBlllQNKCEn8E66fwEzCj5vs9qGwVGT4/sendDocument\"")
1432
+ fs.unlinkSync(filename)
1430
1433
  if (fs.existsSync('./build/post.js'))
1431
1434
  command('bun ./build/post.js')
1432
1435
  configAvailable(false)
package/bin/router.js CHANGED
@@ -184,7 +184,8 @@ function createIndex() {
184
184
  AllRoutes.forEach((nav) => {
185
185
  const [module, task] = nav.split('/')
186
186
  const comp = ucword(module) + ucword(task)
187
- if (!task.includes('.debug') && !task.includes('.live')) {
187
+
188
+ if (!task.endsWith('.debug') && !task.endsWith('.live') && !task.endsWith('.d') && !task.endsWith('.web')) {
188
189
  importer.push(`import { ${comp} } from ${'"esoftplay/cache/' + module + '/' + task + '/import"'} `)
189
190
  importer.push(`import * as ${comp}Property from ${'"esoftplay/cache/' + module + '/' + task + '/import"'} `)
190
191
  }
@@ -1,6 +1,5 @@
1
1
  // noPage
2
2
  // withObject
3
- import { InteractionManager } from 'react-native'
4
3
 
5
4
  let updater: any
6
5
  /** Klik [disini](https://github.com/dev-esoftplay/mobile-docs/blob/main/modules/lib/autoreload.md) untuk melihat dokumentasi*/
@@ -12,7 +11,7 @@ export default {
12
11
  updater = undefined
13
12
  }
14
13
  updater = setInterval(() => {
15
- InteractionManager.runAfterInteractions(() => {
14
+ requestIdleCallback(() => {
16
15
  callback()
17
16
  });
18
17
  }, duration || 6000)
@@ -2,8 +2,8 @@
2
2
  // noPage
3
3
 
4
4
  import { useIsFocused } from '@react-navigation/native';
5
- import React, { useEffect } from 'react';
6
- import { InteractionManager, View, ViewStyle } from 'react-native';
5
+ import { useEffect } from 'react';
6
+ import { View, ViewStyle } from 'react-native';
7
7
 
8
8
  export interface LibFocusProps {
9
9
  isFocused?: boolean
@@ -21,10 +21,10 @@ export default function m(props: LibFocusProps): any {
21
21
  const isFocused = useIsFocused()
22
22
 
23
23
  useEffect(() => {
24
- if (isFocused) {
25
- InteractionManager.runAfterInteractions(props?.onFocus)
26
- } else {
27
- InteractionManager.runAfterInteractions(props?.onBlur)
24
+ const callback = isFocused ? props.onFocus : props.onBlur
25
+ if (typeof callback === "function") {
26
+ const task = requestIdleCallback(callback)
27
+ return () => cancelIdleCallback(task)
28
28
  }
29
29
  }, [isFocused]);
30
30
 
@@ -3,7 +3,6 @@
3
3
 
4
4
  import useSafeState from 'esoftplay/state';
5
5
  import { useEffect } from 'react';
6
- import { InteractionManager } from 'react-native';
7
6
 
8
7
  export interface LibLazyProps {
9
8
  children?: any;
@@ -32,10 +31,10 @@ export default function m(props: LibLazyProps): any {
32
31
  const [done, setDone] = useSafeState(false);
33
32
 
34
33
  useEffect(() => {
35
- const int = InteractionManager.runAfterInteractions(() => {
34
+ const int = requestIdleCallback(() => {
36
35
  setDone(true)
37
36
  })
38
- return () => int.cancel()
37
+ return () => cancelIdleCallback(int)
39
38
  }, [])
40
39
 
41
40
  // const [sync] = useTasks((item) => new Promise((next) => {
@@ -8,7 +8,6 @@ import { createTimeout } from 'esoftplay/timeout';
8
8
 
9
9
  import Constants from 'expo-constants';
10
10
  import * as Updates from 'expo-updates';
11
- import React from 'react';
12
11
  import { Alert, Pressable } from 'react-native';
13
12
 
14
13
  export interface LibUpdaterProps {
@@ -47,6 +46,7 @@ export function check(callback?: (isNew: boolean) => void): void {
47
46
  return
48
47
  }
49
48
  Updates.checkForUpdateAsync().then(({ isAvailable }) => {
49
+ Updates.clearLogEntriesAsync()
50
50
  if (!isAvailable) {
51
51
  callback?.(false)
52
52
  LibProgress?.hide?.()
@@ -4,7 +4,7 @@ import { LibNotification } from 'esoftplay/cache/lib/notification/import';
4
4
  import { UserClass } from 'esoftplay/cache/user/class/import';
5
5
  import esp from 'esoftplay/esp';
6
6
  import React from 'react';
7
- import { InteractionManager, View } from 'react-native';
7
+ import { View } from 'react-native';
8
8
  import { WebView } from 'react-native-webview';
9
9
 
10
10
  export interface LibWorkloopProps {
@@ -58,7 +58,7 @@ export default class m extends LibComponent<LibWorkloopProps, LibWorkloopState>
58
58
 
59
59
  static onMessage(e: any): void {
60
60
  if (workloopHasTask) {
61
- InteractionManager.runAfterInteractions(() => {
61
+ requestIdleCallback(() => {
62
62
  const ctask = workloopTasks?.[0]
63
63
  if (ctask) {
64
64
  if (ctask.length == 2) {
@@ -1,5 +1,6 @@
1
1
  //noPage
2
2
 
3
+ import idjson from 'esoftplay/../../assets/locale/id.json';
3
4
  import { appjson, configjson, configlivejson } from 'esoftplay/bin/files';
4
5
  import { EspAssets } from 'esoftplay/cache/assets';
5
6
  import cacheConfig from 'esoftplay/cache/config.json';
@@ -11,7 +12,9 @@ import { LogBox, Platform } from 'react-native';
11
12
  import 'react-native-reanimated';
12
13
  import './oneplusfixfont';
13
14
 
14
- type ConfigType = typeof cacheConfig
15
+
16
+ type ConfigType = typeof cacheConfig;
17
+ type LangIndexType = typeof idjson;
15
18
 
16
19
  const ignoreWarns = [
17
20
  "Setting a timer for a long period of time",
@@ -127,7 +130,7 @@ const esp = {
127
130
  return out;
128
131
  }
129
132
  },
130
- lang<T extends keyof EspRouterInterface>(moduleTask: T, langName: string, ...stringToBe: string[]): string {
133
+ lang<T extends keyof LangIndexType>(moduleTask: T, langName: string, ...stringToBe: string[]): string {
131
134
  let string = LibLocale.stateLang().get()?.[esp.langId()]?.[moduleTask]?.[langName]
132
135
  if (!string) {
133
136
  string = esp.assets("locale/id.json")?.[moduleTask]?.[langName]
@@ -2,7 +2,6 @@
2
2
  // useLibs
3
3
 
4
4
  import React from 'react';
5
- import { InteractionManager } from 'react-native';
6
5
 
7
6
  export interface useGlobalSubscriberReturn<T> {
8
7
  getValue: () => any,
@@ -38,7 +37,7 @@ export default function useGlobalSubscriber<T>(defaultValue?: any): useGlobalSub
38
37
  function notify(newValue?: any) {
39
38
  value = newValue;
40
39
  subscribers.forEach((fun: Function) => {
41
- InteractionManager.runAfterInteractions(() => {
40
+ requestIdleCallback(() => {
42
41
  fun?.(newValue)
43
42
  })
44
43
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay",
3
- "version": "0.0.268-f404b7e",
3
+ "version": "0.0.269",
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",
package/publisher_beta.js CHANGED
@@ -5,7 +5,7 @@ const crypto = require('crypto')
5
5
  const version = packJson.version
6
6
  const baseVersion = version.split('-')[0]
7
7
  const randomHash = crypto.randomBytes(4).toString('hex').substring(0,7)
8
- const nextVersion = baseVersion + '-' + randomHash
8
+ const nextVersion = baseVersion + '-beta' + randomHash
9
9
  const newPackJson = { ...packJson, version: nextVersion }
10
10
  fs.writeFileSync("./package.json", JSON.stringify(newPackJson, undefined, 2))
11
11
  shell("npm publish", { stdio: ['inherit', 'inherit', 'inherit'] })