@tarojs/taro-rn 4.0.0-beta.75 → 4.0.0-beta.77
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/LICENSE +1 -8
- package/apiList.js +31 -31
- package/dist/api/index.js +1 -1
- package/dist/api/index.js.map +1 -1
- package/dist/lib/Mask.js +2 -2
- package/dist/lib/Mask.js.map +1 -1
- package/dist/lib/Popup.js +3 -3
- package/dist/lib/Popup.js.map +1 -1
- package/dist/lib/StyleSheet.js +1 -1
- package/dist/lib/StyleSheet.js.map +1 -1
- package/dist/lib/accelerometer.js +1 -1
- package/dist/lib/accelerometer.js.map +1 -1
- package/dist/lib/chooseMedia/index.js.map +1 -1
- package/dist/lib/clearStorage/index.js +2 -2
- package/dist/lib/clearStorage/index.js.map +1 -1
- package/dist/lib/compressImage/index.js +1 -1
- package/dist/lib/compressImage/index.js.map +1 -1
- package/dist/lib/connectSocket/index.js.map +1 -1
- package/dist/lib/connectSocket/socketTask.js +1 -1
- package/dist/lib/connectSocket/socketTask.js.map +1 -1
- package/dist/lib/createCameraContext/index.js +3 -3
- package/dist/lib/createCameraContext/index.js.map +1 -1
- package/dist/lib/createInnerAudioContext/index.js +2 -2
- package/dist/lib/createInnerAudioContext/index.js.map +1 -1
- package/dist/lib/createVideoContext/index.js +7 -7
- package/dist/lib/createVideoContext/index.js.map +1 -1
- package/dist/lib/deviceMotion.js +2 -2
- package/dist/lib/deviceMotion.js.map +1 -1
- package/dist/lib/file.js +4 -4
- package/dist/lib/file.js.map +1 -1
- package/dist/lib/getAppBaseInfo/index.js +2 -2
- package/dist/lib/getAppBaseInfo/index.js.map +1 -1
- package/dist/lib/getClipboardData/index.js.map +1 -1
- package/dist/lib/getImageInfo/index.js +2 -2
- package/dist/lib/getImageInfo/index.js.map +1 -1
- package/dist/lib/getLocation/index.js +2 -2
- package/dist/lib/getLocation/index.js.map +1 -1
- package/dist/lib/getRecorderManager/index.js +5 -5
- package/dist/lib/getRecorderManager/index.js.map +1 -1
- package/dist/lib/getStorage/index.js.map +1 -1
- package/dist/lib/getStorageInfo/index.js +2 -2
- package/dist/lib/getStorageInfo/index.js.map +1 -1
- package/dist/lib/getSystemInfo/index.js +1 -1
- package/dist/lib/getSystemInfo/index.js.map +1 -1
- package/dist/lib/getSystemInfoSync/index.js +2 -2
- package/dist/lib/getSystemInfoSync/index.js.map +1 -1
- package/dist/lib/gyroscope.js +1 -1
- package/dist/lib/gyroscope.js.map +1 -1
- package/dist/lib/keyboard.js +3 -3
- package/dist/lib/keyboard.js.map +1 -1
- package/dist/lib/location.js.map +1 -1
- package/dist/lib/makePhoneCall/index.js +1 -1
- package/dist/lib/makePhoneCall/index.js.map +1 -1
- package/dist/lib/media.js +15 -13
- package/dist/lib/media.js.map +1 -1
- package/dist/lib/network.js +1 -1
- package/dist/lib/network.js.map +1 -1
- package/dist/lib/offWindowResize/index.js.map +1 -1
- package/dist/lib/onWindowResize/index.js +1 -1
- package/dist/lib/onWindowResize/index.js.map +1 -1
- package/dist/lib/openUrl/index.js +1 -1
- package/dist/lib/openUrl/index.js.map +1 -1
- package/dist/lib/permission.js +6 -5
- package/dist/lib/permission.js.map +1 -1
- package/dist/lib/previewImage/index.js +3 -3
- package/dist/lib/previewImage/index.js.map +1 -1
- package/dist/lib/request/index.js +1 -1
- package/dist/lib/request/index.js.map +1 -1
- package/dist/lib/scanCode/index.js +22 -22
- package/dist/lib/scanCode/index.js.map +1 -1
- package/dist/lib/screen.js +2 -2
- package/dist/lib/screen.js.map +1 -1
- package/dist/lib/setClipboardData/index.js +2 -2
- package/dist/lib/setClipboardData/index.js.map +1 -1
- package/dist/lib/setKeepScreenOn/index.js +1 -1
- package/dist/lib/setKeepScreenOn/index.js.map +1 -1
- package/dist/lib/setStorage/index.js.map +1 -1
- package/dist/lib/showActionSheet/ActionSheet.js +3 -3
- package/dist/lib/showActionSheet/ActionSheet.js.map +1 -1
- package/dist/lib/showActionSheet/index.js.map +1 -1
- package/dist/lib/showModal/Dialog.js +3 -3
- package/dist/lib/showModal/Dialog.js.map +1 -1
- package/dist/lib/showModal/index.js.map +1 -1
- package/dist/lib/showModal/toast.js +6 -6
- package/dist/lib/showModal/toast.js.map +1 -1
- package/dist/lib/unsupportedApi.js +2 -4
- package/dist/lib/unsupportedApi.js.map +1 -1
- package/dist/lib/variable.js +1 -1
- package/dist/lib/variable.js.map +1 -1
- package/dist/lib/vibrate.js +1 -1
- package/dist/lib/vibrate.js.map +1 -1
- package/dist/lib/window.js.map +1 -1
- package/dist/utils/callbackManager.js.map +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +65 -60
- package/src/api/index.ts +31 -31
- package/src/lib/ENV_TYPE/index.ts +1 -1
- package/src/lib/Mask.tsx +2 -2
- package/src/lib/Popup.tsx +8 -6
- package/src/lib/StyleSheet.ts +1 -1
- package/src/lib/accelerometer.ts +2 -1
- package/src/lib/arrayBufferToBase64/index.ts +1 -1
- package/src/lib/base64ToArrayBuffer/index.ts +1 -1
- package/src/lib/chooseMedia/index.ts +1 -1
- package/src/lib/clearStorage/index.ts +1 -0
- package/src/lib/clearStorageSync/index.ts +1 -1
- package/src/lib/compressImage/index.ts +1 -0
- package/src/lib/connectSocket/socketTask.ts +7 -9
- package/src/lib/createCameraContext/index.ts +6 -4
- package/src/lib/createInnerAudioContext/index.ts +1 -0
- package/src/lib/createSelectorQuery/index.ts +1 -1
- package/src/lib/deviceMotion.ts +4 -3
- package/src/lib/file.ts +9 -8
- package/src/lib/getClipboardData/index.ts +1 -0
- package/src/lib/getEnv/index.ts +1 -1
- package/src/lib/getFileSystemManager/index.ts +1 -1
- package/src/lib/getLocation/index.ts +4 -3
- package/src/lib/getRecorderManager/index.ts +1 -1
- package/src/lib/getStorage/index.ts +1 -0
- package/src/lib/getStorageInfo/index.ts +1 -0
- package/src/lib/getStorageInfoSync/index.ts +1 -1
- package/src/lib/getStorageSync/index.ts +1 -1
- package/src/lib/getSystemInfo/index.ts +2 -2
- package/src/lib/getSystemInfoSync/index.ts +3 -3
- package/src/lib/gyroscope.ts +47 -46
- package/src/lib/keyboard.ts +5 -4
- package/src/lib/location.ts +6 -5
- package/src/lib/makePhoneCall/index.ts +2 -1
- package/src/lib/media.ts +21 -18
- package/src/lib/network.ts +5 -5
- package/src/lib/offLocationChange/index.ts +1 -1
- package/src/lib/offUserCaptureScreen/index.ts +1 -1
- package/src/lib/onLocationChange/index.ts +1 -1
- package/src/lib/onUserCaptureScreen/index.ts +1 -1
- package/src/lib/onWindowResize/index.ts +2 -2
- package/src/lib/openUrl/index.d.ts +23 -22
- package/src/lib/openUrl/index.ts +2 -1
- package/src/lib/permission.ts +33 -25
- package/src/lib/previewImage/index.tsx +4 -3
- package/src/lib/removeStorageSync/index.ts +1 -1
- package/src/lib/request/index.ts +2 -2
- package/src/lib/scanCode/index.tsx +17 -15
- package/src/lib/screen.ts +1 -0
- package/src/lib/setClipboardData/index.ts +3 -2
- package/src/lib/setKeepScreenOn/index.ts +2 -1
- package/src/lib/setStorage/index.ts +1 -0
- package/src/lib/setStorageSync/index.ts +1 -1
- package/src/lib/showActionSheet/ActionSheet.tsx +7 -6
- package/src/lib/showActionSheet/index.tsx +1 -0
- package/src/lib/showModal/Dialog.tsx +7 -6
- package/src/lib/showModal/index.tsx +1 -0
- package/src/lib/showModal/toast.tsx +12 -11
- package/src/lib/startGyroscope/index.ts +1 -1
- package/src/lib/startLocationUpdate/index.ts +1 -1
- package/src/lib/unsupportedApi.ts +3 -5
- package/src/lib/vibrate.ts +11 -10
- package/src/lib/window.ts +3 -2
- package/src/utils/callbackManager.ts +5 -5
- package/src/utils/index.ts +4 -4
- package/{src/types → types}/vue/index.d.ts +2 -3
- package/dist/setup.js +0 -58
- package/dist/setup.js.map +0 -1
- package/src/__tests__/__mock__/mockRNCCameraRoll.js +0 -7
- package/src/__tests__/__mock__/mockRNCGeolocation.js +0 -13
- package/src/__tests__/__snapshots__/scanCode.test.tsx.snap +0 -154
- package/src/__tests__/clipboard.test.ts +0 -88
- package/src/__tests__/deviceMotion.test.ts +0 -37
- package/src/__tests__/geolocation.test.ts +0 -60
- package/src/__tests__/interactive.test.tsx +0 -101
- package/src/__tests__/keyboard.test.ts +0 -46
- package/src/__tests__/media.test.ts +0 -104
- package/src/__tests__/network.test.ts +0 -57
- package/src/__tests__/others.test.ts +0 -25
- package/src/__tests__/phone.test.ts +0 -31
- package/src/__tests__/request.test.ts +0 -146
- package/src/__tests__/scanCode.test.tsx +0 -14
- package/src/__tests__/storage.test.ts +0 -202
- package/src/__tests__/system.test.ts +0 -69
- package/src/__tests__/vibrate.test.ts +0 -27
- package/src/__tests__/websocket.test.ts +0 -170
- package/src/setup.ts +0 -64
- /package/{src/types → types}/definition.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/taro-rn",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.77",
|
|
4
4
|
"description": "Taro RN framework",
|
|
5
|
+
"author": "O2Team",
|
|
6
|
+
"license": "MIT",
|
|
5
7
|
"main": "dist/index.js",
|
|
6
|
-
"
|
|
8
|
+
"types": "types/index.d.ts",
|
|
7
9
|
"files": [
|
|
8
10
|
"dist",
|
|
9
11
|
"src",
|
|
@@ -18,80 +20,83 @@
|
|
|
18
20
|
"keywords": [
|
|
19
21
|
"taro"
|
|
20
22
|
],
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">= 18"
|
|
25
|
+
},
|
|
23
26
|
"dependencies": {
|
|
24
|
-
"@bam.tech/react-native-image-resizer": "
|
|
25
|
-
"@react-native-async-storage/async-storage": "
|
|
26
|
-
"@react-native-camera-roll/camera-roll": "
|
|
27
|
-
"@react-native-clipboard/clipboard": "
|
|
28
|
-
"@react-native-community/geolocation": "
|
|
29
|
-
"@react-native-community/netinfo": "
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"deprecated-react-native-prop-types": "^2.3.0",
|
|
27
|
+
"@bam.tech/react-native-image-resizer": "3.0.9",
|
|
28
|
+
"@react-native-async-storage/async-storage": "1.23.1",
|
|
29
|
+
"@react-native-camera-roll/camera-roll": "7.7.0",
|
|
30
|
+
"@react-native-clipboard/clipboard": "1.14.1",
|
|
31
|
+
"@react-native-community/geolocation": "3.2.1",
|
|
32
|
+
"@react-native-community/netinfo": "11.3.2",
|
|
33
|
+
"base64-js": "^1.5.1",
|
|
34
|
+
"deprecated-react-native-prop-types": "^5.0.0",
|
|
33
35
|
"expo-av": "~13.10.0",
|
|
34
|
-
"expo-barcode-scanner": "~
|
|
35
|
-
"expo-brightness": "~
|
|
36
|
-
"expo-camera": "~
|
|
37
|
-
"expo-file-system": "~
|
|
38
|
-
"expo-image-picker": "~
|
|
39
|
-
"expo-keep-awake": "~
|
|
40
|
-
"expo-location": "~
|
|
41
|
-
"expo-sensors": "~
|
|
42
|
-
"nullthrows": "^1.1.1",
|
|
36
|
+
"expo-barcode-scanner": "~13.0.1",
|
|
37
|
+
"expo-brightness": "~12.0.1",
|
|
38
|
+
"expo-camera": "~15.0.8",
|
|
39
|
+
"expo-file-system": "~17.0.1",
|
|
40
|
+
"expo-image-picker": "~15.0.4",
|
|
41
|
+
"expo-keep-awake": "~13.0.1",
|
|
42
|
+
"expo-location": "~17.0.1",
|
|
43
|
+
"expo-sensors": "~13.0.6",
|
|
43
44
|
"prop-types": "^15.8.1",
|
|
44
|
-
"react-native-device-info": "
|
|
45
|
-
"react-native-image-zoom-viewer": "
|
|
46
|
-
"react-native-root-siblings": "
|
|
47
|
-
"react-native-
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"@tarojs/runtime-rn": "4.0.0-beta.75"
|
|
45
|
+
"react-native-device-info": "11.1.0",
|
|
46
|
+
"react-native-image-zoom-viewer": "3.0.1",
|
|
47
|
+
"react-native-root-siblings": "5.0.1",
|
|
48
|
+
"react-native-safe-area-context": "4.10.1",
|
|
49
|
+
"@tarojs/runtime-rn": "4.0.0-beta.77",
|
|
50
|
+
"@tarojs/taro": "4.0.0-beta.77"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@babel/core": "^7.
|
|
54
|
-
"@babel/
|
|
53
|
+
"@babel/core": "^7.24.4",
|
|
54
|
+
"@babel/parser": "^7.24.4",
|
|
55
|
+
"@babel/preset-env": "^7.24.4",
|
|
56
|
+
"@babel/traverse": "^7.24.4",
|
|
55
57
|
"@react-native/babel-preset": "^0.73.18",
|
|
56
58
|
"@testing-library/jest-native": "^5.4.2",
|
|
57
59
|
"@testing-library/react-native": "^12.4.1",
|
|
58
|
-
"
|
|
60
|
+
"cpy-cli": "^5.0.0",
|
|
59
61
|
"dpdm": "^3.14.0",
|
|
60
|
-
"expo": "~
|
|
61
|
-
"
|
|
62
|
-
"jest": "^29.3.1",
|
|
63
|
-
"jest-cli": "^29.3.1",
|
|
64
|
-
"jest-environment-node": "^29.5.0",
|
|
65
|
-
"jest-expo": "^50.0.0",
|
|
62
|
+
"expo": "~51.0.5",
|
|
63
|
+
"jest-expo": "^51.0.1",
|
|
66
64
|
"mock-socket": "^7.1.0",
|
|
67
|
-
"react": "18.2.0",
|
|
68
|
-
"react-native": "^0.
|
|
69
|
-
"react-test-renderer": "18.2.0"
|
|
65
|
+
"react": "^18.2.0",
|
|
66
|
+
"react-native": "^0.72.3"
|
|
70
67
|
},
|
|
71
68
|
"peerDependencies": {
|
|
72
|
-
"@bam.tech/react-native-image-resizer": "
|
|
73
|
-
"@react-native-async-storage/async-storage": "
|
|
74
|
-
"@react-native-camera-roll/camera-roll": "
|
|
75
|
-
"@react-native-clipboard/clipboard": "
|
|
76
|
-
"@react-native-community/geolocation": "
|
|
77
|
-
"@react-native-community/netinfo": "
|
|
78
|
-
"expo
|
|
79
|
-
"expo-
|
|
80
|
-
"expo-
|
|
81
|
-
"expo-
|
|
82
|
-
"expo-
|
|
83
|
-
"expo-
|
|
84
|
-
"expo-
|
|
85
|
-
"expo-
|
|
86
|
-
"expo-
|
|
87
|
-
"
|
|
88
|
-
"react
|
|
69
|
+
"@bam.tech/react-native-image-resizer": ">= 3.0.0",
|
|
70
|
+
"@react-native-async-storage/async-storage": ">= 1.21.0",
|
|
71
|
+
"@react-native-camera-roll/camera-roll": ">= 7.2.0",
|
|
72
|
+
"@react-native-clipboard/clipboard": ">= 1.13.0",
|
|
73
|
+
"@react-native-community/geolocation": ">= 3.2.0",
|
|
74
|
+
"@react-native-community/netinfo": ">= 11.2.0",
|
|
75
|
+
"expo": ">= 51",
|
|
76
|
+
"expo-av": ">= 13.10.0",
|
|
77
|
+
"expo-barcode-scanner": ">= 13",
|
|
78
|
+
"expo-brightness": ">= 12",
|
|
79
|
+
"expo-camera": ">= 15",
|
|
80
|
+
"expo-file-system": ">= 17",
|
|
81
|
+
"expo-image-picker": ">= 15",
|
|
82
|
+
"expo-keep-awake": ">= 13",
|
|
83
|
+
"expo-location": ">= 17",
|
|
84
|
+
"expo-sensors": ">= 13",
|
|
85
|
+
"react": ">= 18",
|
|
86
|
+
"react-native": ">= 0.63.0",
|
|
87
|
+
"react-native-device-info": ">= 11",
|
|
88
|
+
"react-native-image-zoom-viewer": ">= 3",
|
|
89
|
+
"react-native-root-siblings": ">= 5",
|
|
90
|
+
"react-native-safe-area-context": ">= 4.8.0"
|
|
89
91
|
},
|
|
90
92
|
"scripts": {
|
|
93
|
+
"prod": "pnpm run build",
|
|
91
94
|
"assets": "cpy 'src/**/*.png' '!src/__tests__/*' dist",
|
|
92
|
-
"
|
|
95
|
+
"prebuild": "pnpm run clean",
|
|
96
|
+
"clean": "rimraf --impl=move-remove ./dist apiList.js libList.js",
|
|
97
|
+
"build": "tsc && pnpm run assets && pnpm run script",
|
|
93
98
|
"dev": "pnpm run assets && tsc --watch",
|
|
94
|
-
"lint": "eslint .",
|
|
99
|
+
"lint": "eslint src script __tests__ --ext .js,.jsx.ts,.tsx",
|
|
95
100
|
"test": "jest --silent",
|
|
96
101
|
"test:ci": "jest --ci -i --coverage --silent",
|
|
97
102
|
"test:coverage": "jest --coverage",
|
package/src/api/index.ts
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
export {
|
|
2
2
|
Current,
|
|
3
|
-
getCurrentInstance,
|
|
4
|
-
useDidShow,
|
|
5
|
-
useDidHide,
|
|
6
|
-
useLoad,
|
|
7
|
-
useReady,
|
|
8
|
-
useUnload,
|
|
9
|
-
useLaunch,
|
|
10
|
-
usePageNotFound,
|
|
11
|
-
useRouter,
|
|
12
|
-
usePullDownRefresh,
|
|
13
|
-
useReachBottom,
|
|
14
|
-
usePageScroll,
|
|
15
|
-
useTabItemTap,
|
|
16
|
-
useResize,
|
|
17
3
|
eventCenter,
|
|
18
4
|
Events,
|
|
5
|
+
getApp,
|
|
6
|
+
getCurrentInstance,
|
|
7
|
+
getCurrentPages,
|
|
8
|
+
hideNavigationBarLoading,
|
|
9
|
+
hideTabBar,
|
|
10
|
+
hideTabBarRedDot,
|
|
11
|
+
navigateBack,
|
|
19
12
|
navigateTo,
|
|
13
|
+
pageScrollTo,
|
|
14
|
+
pxTransform,
|
|
20
15
|
redirectTo,
|
|
21
|
-
navigateBack,
|
|
22
|
-
switchTab,
|
|
23
16
|
reLaunch,
|
|
24
|
-
showTabBar,
|
|
25
|
-
hideTabBar,
|
|
26
|
-
showTabBarRedDot,
|
|
27
|
-
hideTabBarRedDot,
|
|
28
|
-
setTabBarBadge,
|
|
29
17
|
removeTabBarBadge,
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
setBackgroundColor,
|
|
19
|
+
setBackgroundTextStyle,
|
|
32
20
|
setNavigationBarColor,
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
setNavigationBarTitle,
|
|
22
|
+
setTabBarBadge,
|
|
23
|
+
setTabBarItem,
|
|
35
24
|
setTabBarStyle,
|
|
36
|
-
|
|
37
|
-
|
|
25
|
+
showNavigationBarLoading,
|
|
26
|
+
showTabBar,
|
|
27
|
+
showTabBarRedDot,
|
|
38
28
|
startPullDownRefresh,
|
|
39
29
|
stopPullDownRefresh,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
switchTab,
|
|
31
|
+
useDidHide,
|
|
32
|
+
useDidShow,
|
|
33
|
+
useLaunch,
|
|
34
|
+
useLoad,
|
|
35
|
+
usePageNotFound,
|
|
36
|
+
usePageScroll,
|
|
37
|
+
usePullDownRefresh,
|
|
38
|
+
useReachBottom,
|
|
39
|
+
useReady,
|
|
40
|
+
useResize,
|
|
41
|
+
useRouter,
|
|
42
|
+
useTabItemTap,
|
|
43
|
+
useUnload
|
|
44
44
|
} from '@tarojs/runtime-rn'
|
package/src/lib/Mask.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ViewPropTypes } from 'deprecated-react-native-prop-types'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
+
import React from 'react'
|
|
3
4
|
import { StyleSheet, TouchableWithoutFeedback, View } from 'react-native'
|
|
4
|
-
import { ViewPropTypes } from 'deprecated-react-native-prop-types'
|
|
5
5
|
|
|
6
6
|
const styles = StyleSheet.create({
|
|
7
7
|
mask: {
|
package/src/lib/Popup.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { ViewPropTypes } from 'deprecated-react-native-prop-types'
|
|
2
|
+
import PropTypes from 'prop-types'
|
|
1
3
|
import React, { Component } from 'react'
|
|
4
|
+
import { Animated, Dimensions, Easing, Modal, StyleSheet, View } from 'react-native'
|
|
2
5
|
|
|
3
|
-
import PropTypes from 'prop-types'
|
|
4
|
-
import { Modal, View, StyleSheet, Dimensions, Animated, Easing } from 'react-native'
|
|
5
|
-
import { ViewPropTypes } from 'deprecated-react-native-prop-types'
|
|
6
6
|
import { Mask } from './Mask'
|
|
7
7
|
|
|
8
8
|
const { width, height } = Dimensions.get('window')
|
|
@@ -17,7 +17,7 @@ const styles = StyleSheet.create({
|
|
|
17
17
|
})
|
|
18
18
|
|
|
19
19
|
interface Props {
|
|
20
|
-
visible?: boolean
|
|
20
|
+
visible?: boolean
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
class Popup extends Component<any, any> {
|
|
@@ -53,9 +53,11 @@ class Popup extends Component<any, any> {
|
|
|
53
53
|
}).start(() => this.setState({ visible: false }))
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
+
|
|
56
57
|
componentWillUnmount (): void {
|
|
57
|
-
this.timer && clearTimeout(this.timer)
|
|
58
|
+
this.timer && clearTimeout(this.timer)
|
|
58
59
|
}
|
|
60
|
+
|
|
59
61
|
handleLayout (): void {
|
|
60
62
|
this.timer = setTimeout(() => {
|
|
61
63
|
this.popup?.measure((_x, _y, _w, h) => {
|
|
@@ -69,7 +71,7 @@ class Popup extends Component<any, any> {
|
|
|
69
71
|
}).start()
|
|
70
72
|
})
|
|
71
73
|
})
|
|
72
|
-
},)
|
|
74
|
+
},) // 处理鸿蒙系统handleLayout 回调 this.popup为空的情况
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
render (): JSX.Element {
|
package/src/lib/StyleSheet.ts
CHANGED
package/src/lib/accelerometer.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Accelerometer } from 'expo-sensors'
|
|
2
|
+
|
|
2
3
|
import { createCallbackManager, errorHandler, successHandler } from '../utils'
|
|
3
4
|
|
|
4
5
|
const _cbManager = createCallbackManager()
|
|
@@ -68,8 +69,8 @@ function stopAccelerometer(opts: Taro.stopAccelerometer.Option = {}): Promise<Ta
|
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
export {
|
|
71
|
-
onAccelerometerChange,
|
|
72
72
|
offAccelerometerChange,
|
|
73
|
+
onAccelerometerChange,
|
|
73
74
|
startAccelerometer,
|
|
74
75
|
stopAccelerometer
|
|
75
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { clearStorageSync } from '../unsupportedApi'
|
|
1
|
+
export { clearStorageSync } from '../unsupportedApi'
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
ws: WebSocket
|
|
3
|
-
_destroyWhenClose: () => void
|
|
1
|
+
class SocketTask {
|
|
2
|
+
ws: WebSocket
|
|
3
|
+
_destroyWhenClose: () => void
|
|
4
4
|
closeDetail: {
|
|
5
|
-
code: number
|
|
6
|
-
reason: string
|
|
7
|
-
}
|
|
8
|
-
}
|
|
5
|
+
code: number
|
|
6
|
+
reason: string
|
|
7
|
+
}
|
|
9
8
|
|
|
10
|
-
class SocketTask {
|
|
11
9
|
constructor (url: string, protocols: string[] | undefined) {
|
|
12
10
|
if (protocols) {
|
|
13
11
|
// eslint-disable-next-line no-undef
|
|
@@ -105,7 +103,7 @@ class SocketTask {
|
|
|
105
103
|
onError (func?: Taro.SocketTask.OnErrorCallback): void {
|
|
106
104
|
this.ws.onerror = () => {
|
|
107
105
|
func && func({
|
|
108
|
-
errMsg:
|
|
106
|
+
errMsg: 'There was an error with your websocket.',
|
|
109
107
|
})
|
|
110
108
|
}
|
|
111
109
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { Camera } from 'expo-camera'
|
|
2
|
+
|
|
1
3
|
import { errorHandler, successHandler } from '../../utils'
|
|
2
|
-
|
|
4
|
+
|
|
3
5
|
const globalAny: any = global
|
|
4
6
|
|
|
5
7
|
class CameraContext {
|
|
@@ -14,8 +16,8 @@ class CameraContext {
|
|
|
14
16
|
* 开始录像
|
|
15
17
|
*/
|
|
16
18
|
startRecord = (option: Taro.CameraContext.StartRecordOption) => {
|
|
17
|
-
Promise.all([requestCameraPermissionsAsync(), requestMicrophonePermissionsAsync()]).then(([cameraPermission, microphonePermission]) => {
|
|
18
|
-
if(cameraPermission.granted && microphonePermission.granted) {
|
|
19
|
+
Promise.all([Camera.requestCameraPermissionsAsync(), Camera.requestMicrophonePermissionsAsync()]).then(([cameraPermission, microphonePermission]) => {
|
|
20
|
+
if (cameraPermission.granted && microphonePermission.granted) {
|
|
19
21
|
this.cameraRef?.recordAsync().then((res) => {
|
|
20
22
|
const { uri } = res
|
|
21
23
|
const result = {
|
|
@@ -76,7 +78,7 @@ class CameraContext {
|
|
|
76
78
|
break
|
|
77
79
|
}
|
|
78
80
|
try {
|
|
79
|
-
const { granted } = await requestCameraPermissionsAsync()
|
|
81
|
+
const { granted } = await Camera.requestCameraPermissionsAsync()
|
|
80
82
|
if (granted) {
|
|
81
83
|
if (this.cameraRef?.takePictureAsync) {
|
|
82
84
|
const { uri } = await this.cameraRef.takePictureAsync({ quality: _quality })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { createSelectorQuery } from '../unsupportedApi'
|
|
1
|
+
export { createSelectorQuery } from '../unsupportedApi'
|
package/src/lib/deviceMotion.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Taro from '@tarojs/taro'
|
|
2
2
|
import { DeviceMotion } from 'expo-sensors'
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
import { createCallbackManager, errorHandler, successHandler } from '../utils'
|
|
4
5
|
|
|
5
6
|
const _cbManager = createCallbackManager()
|
|
6
7
|
let _listener: any
|
|
@@ -44,7 +45,7 @@ function startDeviceMotionListening (object: Taro.startDeviceMotionListening.Opt
|
|
|
44
45
|
_cbManager.trigger(rotation)
|
|
45
46
|
})
|
|
46
47
|
DeviceMotion.setUpdateInterval(intervalMap[interval] || intervalMap.normal)
|
|
47
|
-
|
|
48
|
+
|
|
48
49
|
return successHandler(success, complete)(res)
|
|
49
50
|
} catch (error) {
|
|
50
51
|
res.errMsg = 'startDeviceMotionListening:fail'
|
|
@@ -71,8 +72,8 @@ function stopDeviceMotionListening (object: Taro.stopDeviceMotionListening.Optio
|
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
export {
|
|
74
|
-
onDeviceMotionChange,
|
|
75
75
|
offDeviceMotionChange,
|
|
76
|
+
onDeviceMotionChange,
|
|
76
77
|
startDeviceMotionListening,
|
|
77
78
|
stopDeviceMotionListening
|
|
78
79
|
}
|
package/src/lib/file.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import * as FileSystem from 'expo-file-system'
|
|
2
2
|
import { Platform } from 'react-native'
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
import { errorHandler, shouldBeObject, successHandler } from '../utils'
|
|
4
5
|
|
|
5
6
|
interface Func {
|
|
6
7
|
(arg: any): void
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
interface ExtPromise<T> extends Promise<T> {
|
|
10
|
-
onProgressUpdateCb?: Func
|
|
11
|
-
onProgressUpdate?: Func
|
|
11
|
+
onProgressUpdateCb?: Func
|
|
12
|
+
onProgressUpdate?: Func
|
|
12
13
|
abort?: Func
|
|
13
14
|
}
|
|
14
15
|
|
|
@@ -339,10 +340,10 @@ async function getFileInfo (opts: Taro.getFileInfo.Option): Promise<Taro.getFile
|
|
|
339
340
|
|
|
340
341
|
export {
|
|
341
342
|
downloadFile,
|
|
342
|
-
|
|
343
|
-
saveFile,
|
|
344
|
-
removeSavedFile,
|
|
345
|
-
getSavedFileList,
|
|
343
|
+
getFileInfo,
|
|
346
344
|
getSavedFileInfo,
|
|
347
|
-
|
|
345
|
+
getSavedFileList,
|
|
346
|
+
removeSavedFile,
|
|
347
|
+
saveFile,
|
|
348
|
+
uploadFile
|
|
348
349
|
}
|
package/src/lib/getEnv/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { getFileSystemManager } from '../unsupportedApi'
|
|
1
|
+
export { getFileSystemManager } from '../unsupportedApi'
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import Geolocation from '@react-native-community/geolocation'
|
|
2
|
+
|
|
2
3
|
import { errorHandler } from '../../utils'
|
|
3
4
|
|
|
4
5
|
export async function getLocation(opts: Taro.getLocation.Option = {}): Promise<Taro.getLocation.SuccessCallbackResult> {
|
|
5
6
|
const { isHighAccuracy = false, highAccuracyExpireTime = 3000, success, fail, complete } = opts
|
|
6
7
|
const requestAuthorization = () => {
|
|
7
8
|
return new Promise((resolve, reject) => {
|
|
8
|
-
Geolocation.requestAuthorization(()=>resolve({granted: true}), (err)=>reject(err))
|
|
9
|
+
Geolocation.requestAuthorization(() => resolve({ granted: true }), (err) => reject(err))
|
|
9
10
|
})
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
+
|
|
12
13
|
try {
|
|
13
14
|
// @ts-ignore
|
|
14
15
|
// todo: fix types
|
|
15
|
-
const {granted} = await requestAuthorization()
|
|
16
|
+
const { granted } = await requestAuthorization()
|
|
16
17
|
if (!granted) {
|
|
17
18
|
const res = { errMsg: 'Permissions denied!' }
|
|
18
19
|
return errorHandler(fail, complete)(res)
|
|
@@ -81,7 +81,7 @@ class RecorderManager {
|
|
|
81
81
|
playsInSilentModeIOS: true,
|
|
82
82
|
staysActiveInBackground: false,
|
|
83
83
|
shouldDuckAndroid: true,
|
|
84
|
-
interruptionModeAndroid: 1, //InterruptionModeAndroid.DoNotMix
|
|
84
|
+
interruptionModeAndroid: 1, // InterruptionModeAndroid.DoNotMix
|
|
85
85
|
playThroughEarpieceAndroid: true
|
|
86
86
|
} as any)
|
|
87
87
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { getStorageInfoSync } from '../unsupportedApi'
|
|
1
|
+
export { getStorageInfoSync } from '../unsupportedApi'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { getStorageSync } from '../unsupportedApi'
|
|
1
|
+
export { getStorageSync } from '../unsupportedApi'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { errorHandler, successHandler } from '../../utils'
|
|
1
2
|
import { getSystemInfoSync } from '../getSystemInfoSync'
|
|
2
|
-
import { successHandler, errorHandler } from '../../utils'
|
|
3
3
|
|
|
4
|
-
export function getSystemInfo(opts: Taro.getSystemInfo.Option
|
|
4
|
+
export function getSystemInfo(opts: Taro.getSystemInfo.Option = {}): Promise<Taro.getSystemInfo.Result> {
|
|
5
5
|
const { success, fail, complete }: any = opts
|
|
6
6
|
try {
|
|
7
7
|
const res = {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Platform,
|
|
3
2
|
Dimensions,
|
|
4
3
|
PixelRatio,
|
|
4
|
+
Platform,
|
|
5
5
|
StatusBar
|
|
6
6
|
} from 'react-native'
|
|
7
|
-
import { initialWindowMetrics } from 'react-native-safe-area-context'
|
|
8
7
|
import DeviceInfo from 'react-native-device-info'
|
|
8
|
+
import { initialWindowMetrics } from 'react-native-safe-area-context'
|
|
9
9
|
|
|
10
10
|
export function getSystemInfoSync(): Taro.getSystemInfoSync.Result {
|
|
11
11
|
const res: any = {}
|
|
@@ -28,7 +28,7 @@ export function getSystemInfoSync(): Taro.getSystemInfoSync.Result {
|
|
|
28
28
|
let { top = 0, bottom = 0 } = initialWindowMetrics?.insets || {}
|
|
29
29
|
// NOTE:android 在沉浸式切换时,有几率top值为0。
|
|
30
30
|
// https://github.com/th3rdwave/react-native-safe-area-context/issues/364
|
|
31
|
-
if(Platform.OS === 'android') { top = StatusBar.currentHeight || 0
|
|
31
|
+
if (Platform.OS === 'android') { top = StatusBar.currentHeight || 0 }
|
|
32
32
|
|
|
33
33
|
try {
|
|
34
34
|
const W = Math.min(screenWidth, screenHeight)
|