@aks-dev/easyui 1.1.5 → 1.2.0

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.
Files changed (27) hide show
  1. package/android/build.gradle +43 -28
  2. package/android/src/main/java/com/easyui/{UpgradeModule.java → RNEasyuiModuleImpl.java} +71 -28
  3. package/android/src/main/java/com/easyui/RNEasyuiPackage.java +31 -19
  4. package/android/src/newarch/com/easyui/RNEasyuiModule.java +76 -0
  5. package/android/src/oldarch/com/easyui/RNEasyuiModule.java +79 -0
  6. package/dist/components/AnimationModal/AnimationModal.d.ts +5 -6
  7. package/dist/components/AnimationModal/AnimationModal.d.ts.map +1 -1
  8. package/dist/components/Hud/AlertBottomView/AlertBottomView.d.ts.map +1 -1
  9. package/dist/components/Hud/AlertBottomView/AlertBottomView.js +7 -12
  10. package/dist/components/Hud/AlertBottomView/AlertBottomView.md +245 -0
  11. package/dist/components/Hud/AlertSheetView/AlertSheetView.d.ts.map +1 -1
  12. package/dist/components/Hud/AlertSheetView/AlertSheetView.js +7 -12
  13. package/dist/components/Hud/AlertSheetView/AlertSheetView.md +180 -0
  14. package/dist/index.d.ts +1 -2
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +2 -2
  17. package/dist/jsbridge/RNEasyui.d.ts +28 -3
  18. package/dist/jsbridge/RNEasyui.d.ts.map +1 -1
  19. package/dist/jsbridge/RNEasyui.js +36 -1
  20. package/dist/jsbridge/UpgradeModule.d.ts +3 -3
  21. package/dist/jsbridge/UpgradeModule.d.ts.map +1 -1
  22. package/dist/specs/NativeRNEasyui.d.ts +18 -0
  23. package/dist/specs/NativeRNEasyui.d.ts.map +1 -0
  24. package/dist/specs/NativeRNEasyui.js +2 -0
  25. package/package.json +11 -2
  26. package/src/specs/NativeRNEasyui.ts +20 -0
  27. package/android/src/main/java/com/easyui/RNEasyuiModule.java +0 -86
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aks-dev/easyui",
3
- "version": "1.1.5",
3
+ "version": "1.2.0",
4
4
  "description": "工具箱",
5
5
  "exports": {
6
6
  ".": {
@@ -36,7 +36,8 @@
36
36
  "!/tsconfig.md",
37
37
  "!/i.sh",
38
38
  "!/src/**/assets/*",
39
- "!/docs"
39
+ "!/docs",
40
+ "/src/specs"
40
41
  ],
41
42
  "homepage": "https://gitee.com/the_period_of_the_ten_kingdoms",
42
43
  "repository": {
@@ -72,5 +73,13 @@
72
73
  },
73
74
  "publishConfig": {
74
75
  "registry": "https://registry.npmjs.org/"
76
+ },
77
+ "codegenConfig": {
78
+ "name": "RNEasyuiSpec",
79
+ "type": "modules",
80
+ "jsSrcsDir": "./src/specs",
81
+ "android": {
82
+ "javaPackageName": "com.easyui"
83
+ }
75
84
  }
76
85
  }
@@ -0,0 +1,20 @@
1
+ import type { TurboModule } from 'react-native';
2
+ import { TurboModuleRegistry } from 'react-native';
3
+ type UpgradeOptions = {
4
+ title?: string;
5
+ version: string;
6
+ downloadUrl: string;
7
+ note: string;
8
+ force: boolean;
9
+ };
10
+ export interface Spec extends TurboModule {
11
+ getAppVersion(): Promise<string>;
12
+ getOSVersion(): Promise<string>;
13
+ getDeviceBrand(): Promise<string>;
14
+ gotoDesktop():void;
15
+ upgrade: (options: UpgradeOptions) => Promise<string>
16
+ }
17
+
18
+ export default TurboModuleRegistry.getEnforcing<Spec>(
19
+ 'RNEasyui',
20
+ ) as Spec;
@@ -1,86 +0,0 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-04-25 17:57:29
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2022-10-24 16:08:50
6
- * @FilePath: /@aks-dev/easyui/android/src/main/java/com/easyui/RNEasyuiModule.java
7
- */
8
-
9
- package com.easyui;
10
-
11
- import android.content.Intent;
12
-
13
- import androidx.core.app.ActivityCompat;
14
-
15
- import com.facebook.react.bridge.Promise;
16
- import com.facebook.react.bridge.ReactApplicationContext;
17
- import com.facebook.react.bridge.ReactContextBaseJavaModule;
18
- import com.facebook.react.bridge.ReactMethod;
19
- import android.os.Build;
20
-
21
- public class RNEasyuiModule extends ReactContextBaseJavaModule {
22
-
23
- private final ReactApplicationContext context;
24
-
25
- public RNEasyuiModule(ReactApplicationContext reactContext) {
26
- super(reactContext);
27
- this.context = reactContext;
28
- }
29
-
30
- @Override
31
- public String getName() {
32
- return "RNEasyui";
33
- }
34
-
35
-
36
- @ReactMethod
37
- public void getDeviceBrand(Promise promise) {
38
- promise.resolve( Build.BRAND+ Build.MODEL);
39
- }
40
-
41
- @Deprecated
42
- @ReactMethod
43
- public void getStatusBarHeight(final Promise promise) {
44
-
45
- // int status_bar_height = context.getResources().getDimensionPixelSize(context.getResources().getIdentifier("status_bar_height", "dimen", "android"));
46
- // promise.resolve(status_bar_height);
47
- int result = 0;
48
- int resId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
49
- if (resId > 0) {
50
- result = context.getResources().getDimensionPixelSize(resId);
51
- }
52
- promise.resolve(result);
53
-
54
- }
55
-
56
-
57
-
58
-
59
-
60
- @Deprecated
61
- @ReactMethod
62
- public void getNavigationBarHeight(final Promise promise) {
63
-
64
- // int navigation_bar_height = context.getResources().getDimensionPixelSize(context.getResources().getIdentifier("navigation_bar_height", "dimen", "android"));
65
- // promise.resolve(navigation_bar_height);
66
-
67
- int resourceId = 0;
68
- int rid = context.getResources().getIdentifier("config_showNavigationBar", "bool", "android");
69
- if (rid != 0) {
70
- resourceId = context.getResources().getIdentifier("navigation_bar_height", "dimen", "android");
71
- int result = context.getResources().getDimensionPixelSize(resourceId);
72
- promise.resolve(result);
73
- } else {
74
- promise.resolve(0);
75
- }
76
- }
77
-
78
-
79
- @ReactMethod
80
- public void gotoDesktop() {
81
- //启动一个意图,回到桌面
82
- Intent desktop = new Intent(Intent.ACTION_MAIN);
83
- desktop.addCategory(Intent.CATEGORY_HOME);
84
- ActivityCompat.startActivity(getCurrentActivity(), desktop, null);
85
- }
86
- }