@tarojs/taro-rn 4.0.1 → 4.0.2
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 +8 -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 +20 -13
- 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/chooseImage/index.js +3 -151
- package/dist/lib/chooseImage/index.js.map +1 -1
- package/dist/lib/chooseMedia/index.js +19 -0
- package/dist/lib/chooseMedia/index.js.map +1 -0
- package/dist/lib/chooseVideo/index.js +1 -55
- package/dist/lib/chooseVideo/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 +8 -4
- package/dist/lib/getLocation/index.js.map +1 -1
- package/dist/lib/getRecorderManager/index.js +11 -6
- 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/index.js +1 -0
- package/dist/lib/index.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 +61 -30
- 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 +23 -23
- 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 +11 -23
- package/dist/lib/showActionSheet/ActionSheet.js.map +1 -1
- package/dist/lib/showActionSheet/index.js +10 -24
- package/dist/lib/showActionSheet/index.js.map +1 -1
- package/dist/lib/showModal/Dialog.js +22 -36
- 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/libList.js +1 -0
- package/package.json +70 -69
- 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 +26 -19
- 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/chooseImage/index.ts +3 -155
- package/src/lib/chooseMedia/index.ts +15 -0
- package/src/lib/chooseVideo/index.ts +1 -56
- 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 +7 -2
- package/src/lib/getRecorderManager/index.ts +7 -2
- 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/index.ts +1 -0
- 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 +83 -31
- 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 +18 -16
- 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 +34 -43
- package/src/lib/showActionSheet/index.tsx +11 -36
- package/src/lib/showModal/Dialog.tsx +34 -39
- package/src/lib/showModal/index.tsx +1 -0
- package/src/lib/showModal/toast.tsx +14 -13
- 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 -75
- package/dist/setup.js.map +0 -1
- package/src/__tests__/__mock__/mockAsyncStorage.js +0 -47
- package/src/__tests__/__mock__/mockClipboard.js +0 -15
- package/src/__tests__/__mock__/mockNavigator.js +0 -20
- package/src/__tests__/__mock__/mockNetwork.js +0 -59
- package/src/__tests__/__mock__/mockRNCCameraRoll.js +0 -16
- package/src/__tests__/__mock__/mockRNCGeolocation.js +0 -13
- package/src/__tests__/__mock__/mockVibrate.js +0 -6
- package/src/__tests__/__snapshots__/scanCode.test.tsx.snap +0 -125
- 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 -169
- package/src/setup.ts +0 -84
- /package/{src/types → types}/definition.d.ts +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { TextPropTypes, ViewPropTypes } from 'deprecated-react-native-prop-types'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
+
import React from 'react'
|
|
3
4
|
import {
|
|
4
|
-
View,
|
|
5
|
-
Text,
|
|
6
|
-
TouchableHighlight,
|
|
7
5
|
Dimensions,
|
|
6
|
+
Platform,
|
|
8
7
|
StyleSheet,
|
|
9
|
-
|
|
8
|
+
Text,
|
|
9
|
+
TouchableHighlight,
|
|
10
|
+
View
|
|
10
11
|
} from 'react-native'
|
|
11
|
-
|
|
12
|
+
|
|
12
13
|
import { Mask } from '../Mask'
|
|
13
14
|
import { create } from '../StyleSheet'
|
|
14
15
|
import V from '../variable'
|
|
@@ -33,49 +34,42 @@ const styles = create({
|
|
|
33
34
|
paddingRight: V.weuiDialogGapWidth
|
|
34
35
|
},
|
|
35
36
|
dialogTitle: {
|
|
36
|
-
fontWeight: '
|
|
37
|
-
|
|
38
|
-
iosDialogTitle: {
|
|
39
|
-
fontSize: 18,
|
|
37
|
+
fontWeight: '700',
|
|
38
|
+
fontSize: 17,
|
|
40
39
|
textAlign: 'center'
|
|
41
40
|
},
|
|
41
|
+
|
|
42
42
|
androidDialogTitle: {
|
|
43
43
|
fontSize: 21,
|
|
44
44
|
textAlign: 'left'
|
|
45
45
|
},
|
|
46
|
+
|
|
46
47
|
dialogBody: {
|
|
47
48
|
paddingLeft: V.weuiDialogGapWidth,
|
|
48
|
-
paddingRight: V.weuiDialogGapWidth
|
|
49
|
-
|
|
50
|
-
iosDialogBody: {
|
|
51
|
-
paddingBottom: (0.8 * 15) + 20
|
|
52
|
-
},
|
|
53
|
-
androidDialogBody: {
|
|
54
|
-
paddingTop: 0.25 * 17,
|
|
55
|
-
paddingBottom: (17 * 2) + 20
|
|
49
|
+
paddingRight: V.weuiDialogGapWidth,
|
|
50
|
+
marginBottom: 32
|
|
56
51
|
},
|
|
52
|
+
|
|
57
53
|
dialogBodyText: {
|
|
58
54
|
color: V.weuiTextColorGray,
|
|
59
|
-
|
|
55
|
+
fontSize: 17,
|
|
56
|
+
textAlign: 'center',
|
|
57
|
+
lineHeight: 17 * 1.4,
|
|
60
58
|
android: {
|
|
61
|
-
lineHeight: Math.round(
|
|
59
|
+
lineHeight: Math.round(17 * 1.4)
|
|
62
60
|
}
|
|
63
61
|
},
|
|
64
|
-
|
|
65
|
-
fontSize: 15,
|
|
66
|
-
textAlign: 'center'
|
|
67
|
-
},
|
|
62
|
+
|
|
68
63
|
androidDialogBodyText: {
|
|
69
|
-
fontSize: 17,
|
|
70
64
|
textAlign: 'left'
|
|
71
65
|
},
|
|
72
66
|
dialogFooter: {
|
|
73
|
-
flexDirection: 'row'
|
|
74
|
-
},
|
|
75
|
-
iosDialogFooter: {
|
|
67
|
+
flexDirection: 'row',
|
|
76
68
|
height: 48,
|
|
77
69
|
alignItems: 'center',
|
|
78
70
|
justifyContent: 'center',
|
|
71
|
+
},
|
|
72
|
+
dialogFooterBorder: {
|
|
79
73
|
borderTopWidth: StyleSheet.hairlineWidth,
|
|
80
74
|
borderColor: V.weuiDialogLineColor,
|
|
81
75
|
borderStyle: 'solid'
|
|
@@ -90,17 +84,16 @@ const styles = create({
|
|
|
90
84
|
},
|
|
91
85
|
dialogFooterOpr: {
|
|
92
86
|
alignItems: 'center',
|
|
93
|
-
justifyContent: 'center'
|
|
94
|
-
},
|
|
95
|
-
iosDialogFooterOpr: {
|
|
87
|
+
justifyContent: 'center',
|
|
96
88
|
height: 48,
|
|
97
|
-
flex: 1
|
|
89
|
+
flex: 1,
|
|
98
90
|
},
|
|
99
91
|
androidDialogFooterOpr: {
|
|
100
92
|
height: 42,
|
|
101
93
|
paddingLeft: 16 * 0.8,
|
|
102
94
|
paddingRight: 16 * 0.8
|
|
103
95
|
},
|
|
96
|
+
|
|
104
97
|
dialogFooterOprWithNegativeMarginRight: {
|
|
105
98
|
marginRight: 0 - (16 * 0.8)
|
|
106
99
|
},
|
|
@@ -109,12 +102,13 @@ const styles = create({
|
|
|
109
102
|
borderColor: V.weuiDialogLineColor,
|
|
110
103
|
borderStyle: 'solid'
|
|
111
104
|
},
|
|
112
|
-
|
|
105
|
+
dialogFooterOprText: {
|
|
113
106
|
fontSize: 18
|
|
114
107
|
},
|
|
115
108
|
androidDialogFooterOprText: {
|
|
116
109
|
fontSize: 16
|
|
117
110
|
},
|
|
111
|
+
|
|
118
112
|
defaultDialogFooterOprText: {
|
|
119
113
|
color: '#353535'
|
|
120
114
|
},
|
|
@@ -170,14 +164,15 @@ const Index: React.FC<any> = (
|
|
|
170
164
|
style={[
|
|
171
165
|
styles.dialogFooterOpr,
|
|
172
166
|
styles[`${_type}DialogFooterOpr`],
|
|
173
|
-
_type === '
|
|
174
|
-
|
|
167
|
+
_type === 'android' && idx === buttons.length - 1 ? styles.dialogFooterOprWithNegativeMarginRight : (
|
|
168
|
+
idx > 0 ? styles.dialogFooterOprWithBorder : {}
|
|
169
|
+
),
|
|
175
170
|
]}
|
|
176
171
|
underlayColor={underlayColor}
|
|
177
172
|
{...others}
|
|
178
173
|
>
|
|
179
174
|
<Text
|
|
180
|
-
style={[styles[`${_type}DialogFooterOprText`], { color: btnType }]}
|
|
175
|
+
style={[styles.dialogFooterOprText, styles[`${_type}DialogFooterOprText`], { color: btnType }]}
|
|
181
176
|
>{label}</Text>
|
|
182
177
|
</TouchableHighlight>
|
|
183
178
|
)
|
|
@@ -200,10 +195,10 @@ const Index: React.FC<any> = (
|
|
|
200
195
|
<View style={[styles.dialogHeader, headerStyle]}>
|
|
201
196
|
<Text style={[styles.dialogTitle, styles[`${_type}DialogTitle`], titleStyle]}>{title}</Text>
|
|
202
197
|
</View>
|
|
203
|
-
<View style={[styles.dialogBody,
|
|
198
|
+
<View style={[styles.dialogBody, bodyStyle]}>
|
|
204
199
|
{childrenWithProps}
|
|
205
200
|
</View>
|
|
206
|
-
<View style={[styles.dialogFooter, styles[`${_type}DialogFooter`], footerStyle]}>
|
|
201
|
+
<View style={[styles.dialogFooter, styles[`${_type}DialogFooter`], _type !== 'android' ? styles.dialogFooterBorder : {}, footerStyle]}>
|
|
207
202
|
{_renderButtons()}
|
|
208
203
|
</View>
|
|
209
204
|
</View>
|
|
@@ -214,7 +209,7 @@ const Index: React.FC<any> = (
|
|
|
214
209
|
|
|
215
210
|
Index.propTypes = {
|
|
216
211
|
autoDectect: PropTypes.bool,
|
|
217
|
-
type: PropTypes.oneOf(['ios', 'android']),
|
|
212
|
+
type: PropTypes.oneOf(['ios', 'android', 'harmony']),
|
|
218
213
|
title: PropTypes.string,
|
|
219
214
|
buttons: PropTypes.arrayOf(PropTypes.object),
|
|
220
215
|
visible: PropTypes.bool,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
import PropTypes from 'prop-types'
|
|
3
|
-
import
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { ActivityIndicator, Image, StyleSheet, Text, View } from 'react-native'
|
|
4
4
|
import RootSiblings from 'react-native-root-siblings'
|
|
5
|
-
|
|
6
|
-
import errorPng from './error.png'
|
|
5
|
+
|
|
7
6
|
import { errorHandler, shouldBeObject, successHandler } from '../../utils'
|
|
7
|
+
import errorPng from './error.png'
|
|
8
|
+
import successPng from './success.png'
|
|
8
9
|
|
|
9
10
|
const globalAny: any = global
|
|
10
11
|
|
|
@@ -118,7 +119,7 @@ function showToast (options: Taro.showToast.Option): Promise<TaroGeneral.Callbac
|
|
|
118
119
|
return Promise.reject(res)
|
|
119
120
|
}
|
|
120
121
|
|
|
121
|
-
let {title = '', icon = 'success', image, duration = 1500, mask = false, success, fail, complete} = options || {} // eslint-disable-line
|
|
122
|
+
let { title = '', icon = 'success', image, duration = 1500, mask = false, success, fail, complete } = options || {} // eslint-disable-line
|
|
122
123
|
|
|
123
124
|
const isLoading = (icon === 'loading')
|
|
124
125
|
|
|
@@ -138,7 +139,7 @@ function showToast (options: Taro.showToast.Option): Promise<TaroGeneral.Callbac
|
|
|
138
139
|
</View>
|
|
139
140
|
</View>
|
|
140
141
|
} else if (isLoading) {
|
|
141
|
-
ToastView = <WXLoading title={title} mask={mask}/>
|
|
142
|
+
ToastView = <WXLoading title={title} mask={mask} />
|
|
142
143
|
} else if (icon === 'none') {
|
|
143
144
|
ToastView = <View style={maskStyle}>
|
|
144
145
|
<View style={styles.textGrayBlock}>
|
|
@@ -159,7 +160,7 @@ function showToast (options: Taro.showToast.Option): Promise<TaroGeneral.Callbac
|
|
|
159
160
|
try {
|
|
160
161
|
// setTimeout fires incorrectly when using chrome debug #4470
|
|
161
162
|
// https://github.com/facebook/react-native/issues/4470
|
|
162
|
-
globalAny.wxToastRootSiblings && globalAny.wxToastRootSiblings.destroy()
|
|
163
|
+
globalAny.wxToastRootSiblings && globalAny.wxToastRootSiblings.destroy()
|
|
163
164
|
|
|
164
165
|
globalAny.wxToastRootSiblings = new RootSiblings(ToastView)
|
|
165
166
|
setTimeout(() => {
|
|
@@ -177,7 +178,7 @@ function showToast (options: Taro.showToast.Option): Promise<TaroGeneral.Callbac
|
|
|
177
178
|
}
|
|
178
179
|
}
|
|
179
180
|
|
|
180
|
-
function showLoading (options: Taro.showLoading.Option): Promise<TaroGeneral.CallbackResult> {
|
|
181
|
+
function showLoading (options: Taro.showLoading.Option = { title: '加载中' }): Promise<TaroGeneral.CallbackResult> {
|
|
181
182
|
const isObject = shouldBeObject(options)
|
|
182
183
|
if (!isObject.res) {
|
|
183
184
|
const res = { errMsg: `showLoading${isObject.msg}` }
|
|
@@ -202,7 +203,7 @@ function hideToast (opts: Taro.hideToast.Option = {}): void {
|
|
|
202
203
|
const { success, fail, complete } = opts
|
|
203
204
|
|
|
204
205
|
try {
|
|
205
|
-
globalAny.wxToastRootSiblings && globalAny.wxToastRootSiblings.destroy()
|
|
206
|
+
globalAny.wxToastRootSiblings && globalAny.wxToastRootSiblings.destroy()
|
|
206
207
|
globalAny.wxToastRootSiblings = undefined
|
|
207
208
|
const res = { errMsg: 'showToast:ok' }
|
|
208
209
|
success?.(res)
|
|
@@ -218,7 +219,7 @@ function hideLoading (opts: Taro.hideLoading.Option = {}): void {
|
|
|
218
219
|
const { success, fail, complete } = opts
|
|
219
220
|
|
|
220
221
|
try {
|
|
221
|
-
globalAny.wxToastRootSiblings && globalAny.wxToastRootSiblings.destroy()
|
|
222
|
+
globalAny.wxToastRootSiblings && globalAny.wxToastRootSiblings.destroy()
|
|
222
223
|
globalAny.wxToastRootSiblings = undefined
|
|
223
224
|
const res = { errMsg: 'showLoading:ok' }
|
|
224
225
|
success?.(res)
|
|
@@ -231,8 +232,8 @@ function hideLoading (opts: Taro.hideLoading.Option = {}): void {
|
|
|
231
232
|
}
|
|
232
233
|
|
|
233
234
|
export {
|
|
234
|
-
|
|
235
|
-
showLoading,
|
|
235
|
+
hideLoading,
|
|
236
236
|
hideToast,
|
|
237
|
-
|
|
237
|
+
showLoading,
|
|
238
|
+
showToast
|
|
238
239
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { startGyroscope } from '../gyroscope'
|
|
1
|
+
export { startGyroscope } from '../gyroscope'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { startLocationUpdate } from '../location'
|
|
1
|
+
export { startLocationUpdate } from '../location'
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
function temporarilyNotSupport(apiName:
|
|
1
|
+
function temporarilyNotSupport(apiName: string, recommended?: string, isSync = true) {
|
|
2
2
|
return () => {
|
|
3
3
|
let errMsg = `RN 端暂不支持 API ${apiName}`
|
|
4
|
-
if (
|
|
4
|
+
if (recommended) {
|
|
5
5
|
errMsg += `, 请使用 ${recommended}`
|
|
6
6
|
}
|
|
7
7
|
console.error(errMsg)
|
|
8
8
|
if (!isSync) {
|
|
9
|
-
return Promise.reject(
|
|
10
|
-
errMsg
|
|
11
|
-
})
|
|
9
|
+
return Promise.reject(new Error(errMsg))
|
|
12
10
|
} else {
|
|
13
11
|
return new Error(errMsg)
|
|
14
12
|
}
|
package/src/lib/vibrate.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { Vibration } from 'react-native'
|
|
2
|
+
|
|
2
3
|
import { errorHandler, successHandler } from '../utils'
|
|
3
4
|
|
|
4
5
|
function vibrate (DURATION, API, OPTS): Promise<TaroGeneral.CallbackResult> {
|
|
5
6
|
const res = { errMsg: `${API}:ok` }
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
const { success, fail, complete } = OPTS
|
|
8
|
+
try {
|
|
9
|
+
Vibration.vibrate(DURATION)
|
|
10
|
+
return successHandler(success, complete)(res)
|
|
11
|
+
} catch (err) {
|
|
12
|
+
res.errMsg = err.message
|
|
13
|
+
return errorHandler(fail, complete)(res)
|
|
14
|
+
}
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
function vibrateShort (opts: Taro.vibrateShort.Option = {}): Promise<TaroGeneral.CallbackResult> {
|
|
@@ -22,6 +23,6 @@ function vibrateLong (opts: Taro.vibrateLong.Option = {}): Promise<TaroGeneral.C
|
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
vibrateLong,
|
|
27
|
+
vibrateShort
|
|
27
28
|
}
|
package/src/lib/window.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dimensions, EmitterSubscription, ScaledSize } from 'react-native'
|
|
2
|
+
|
|
2
3
|
import { createCallbackManager } from '../utils'
|
|
3
4
|
|
|
4
5
|
let listener: EmitterSubscription
|
|
@@ -18,4 +19,4 @@ export const addListener = () => {
|
|
|
18
19
|
|
|
19
20
|
export const removeListener = () => {
|
|
20
21
|
listener?.remove()
|
|
21
|
-
}
|
|
22
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
interface CallbackManager {
|
|
2
|
-
add: (opt: any) => void
|
|
3
|
-
remove: (opt: any) => void
|
|
4
|
-
clear: () => void
|
|
5
|
-
count: () => number
|
|
6
|
-
trigger: (...args: any[]) => void
|
|
2
|
+
add: (opt: any) => void
|
|
3
|
+
remove: (opt: any) => void
|
|
4
|
+
clear: () => void
|
|
5
|
+
count: () => number
|
|
6
|
+
trigger: (...args: any[]) => void
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export function createCallbackManager(): CallbackManager {
|
package/src/utils/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
interface ShouldBeObjectResult {
|
|
2
|
-
res: boolean
|
|
3
|
-
msg?: string
|
|
2
|
+
res: boolean
|
|
3
|
+
msg?: string
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
interface GetParameterErrorOption {
|
|
7
|
-
correct: string
|
|
8
|
-
wrong: any
|
|
7
|
+
correct: string
|
|
8
|
+
wrong: any
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
function upperCaseFirstLetter (string: string): string {
|
package/dist/setup.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { jest } from '@jest/globals';
|
|
2
|
-
import '@testing-library/jest-native/extend-expect';
|
|
3
|
-
import mockRNCNetInfo from '@react-native-community/netinfo/jest/netinfo-mock.js';
|
|
4
|
-
import { NetInfoStateType } from '@react-native-community/netinfo';
|
|
5
|
-
import mockRNCAsyncStorage from '@react-native-async-storage/async-storage/jest/async-storage-mock.js';
|
|
6
|
-
import mockRNCDeviceInfo from 'react-native-device-info/jest/react-native-device-info-mock';
|
|
7
|
-
jest.doMock('@react-native-community/netinfo', () => (Object.assign(Object.assign({}, mockRNCNetInfo), { NetInfoStateType })));
|
|
8
|
-
jest.doMock('@react-native-async-storage/async-storage', () => mockRNCAsyncStorage);
|
|
9
|
-
jest.doMock('react-native-device-info', () => mockRNCDeviceInfo);
|
|
10
|
-
jest.doMock('react-native', () => {
|
|
11
|
-
const ReactNative = jest.requireActual('react-native');
|
|
12
|
-
// Vibration readonly so you need use defineProperty rewrite this property descriptor.
|
|
13
|
-
const Vibration = jest.requireActual('./__tests__/__mock__/mockVibrate').default;
|
|
14
|
-
Object.defineProperty(ReactNative, 'Vibration', {
|
|
15
|
-
enumerable: false,
|
|
16
|
-
configurable: false,
|
|
17
|
-
writable: false,
|
|
18
|
-
value: Vibration
|
|
19
|
-
});
|
|
20
|
-
// mockNativeModules: react-native/Libraries/BatchedBridge/NativeModules
|
|
21
|
-
const RNCCameraRoll = jest.requireActual('./__tests__/__mock__/mockRNCCameraRoll').default;
|
|
22
|
-
const MockClipboard = jest.requireActual('./__tests__/__mock__/mockClipboard').default;
|
|
23
|
-
const RNCGeolocation = jest.requireActual('./__tests__/__mock__/mockRNCGeolocation').default;
|
|
24
|
-
ReactNative.NativeModules.RNCCameraRoll = RNCCameraRoll.RNCCameraRoll;
|
|
25
|
-
ReactNative.NativeModules.RNCCameraRollPermissionModule = RNCCameraRoll.RNCCameraRollPermissionModule;
|
|
26
|
-
ReactNative.NativeModules.RNCClipboard = new MockClipboard();
|
|
27
|
-
ReactNative.NativeModules.RNCGeolocation = RNCGeolocation;
|
|
28
|
-
Object.defineProperty(ReactNative.NativeModules, 'ImageLoader', {
|
|
29
|
-
configurable: true,
|
|
30
|
-
enumerable: true,
|
|
31
|
-
get: () => ({
|
|
32
|
-
prefetchImage: jest.fn(),
|
|
33
|
-
getSize: jest.fn((_uri, success) => {
|
|
34
|
-
process.nextTick(() => success && success(320, 240));
|
|
35
|
-
return Promise.resolve([320, 240]);
|
|
36
|
-
}),
|
|
37
|
-
}),
|
|
38
|
-
});
|
|
39
|
-
return ReactNative;
|
|
40
|
-
});
|
|
41
|
-
jest.doMock('expo-modules-core', () => {
|
|
42
|
-
const unimodules = jest.requireActual('expo-modules-core');
|
|
43
|
-
const { NativeModulesProxy } = unimodules;
|
|
44
|
-
NativeModulesProxy.ExpoLocation = {
|
|
45
|
-
getCurrentPositionAsync: jest.fn(() => Promise.resolve({
|
|
46
|
-
coords: {
|
|
47
|
-
latitude: 0,
|
|
48
|
-
longitude: 0,
|
|
49
|
-
speed: 0,
|
|
50
|
-
accuracy: 0,
|
|
51
|
-
altitude: 0
|
|
52
|
-
}
|
|
53
|
-
}))
|
|
54
|
-
};
|
|
55
|
-
return unimodules;
|
|
56
|
-
});
|
|
57
|
-
const grantedPromise = jest.fn(() => Promise.resolve({
|
|
58
|
-
granted: true
|
|
59
|
-
}));
|
|
60
|
-
jest.doMock('expo-image-picker', () => {
|
|
61
|
-
const expoImagePicker = jest.requireActual('expo-image-picker');
|
|
62
|
-
expoImagePicker.requestMediaLibraryPermissionsAsync = grantedPromise;
|
|
63
|
-
return expoImagePicker;
|
|
64
|
-
});
|
|
65
|
-
jest.doMock('expo-location', () => {
|
|
66
|
-
const expoLocation = jest.requireActual('expo-location');
|
|
67
|
-
expoLocation.requestForegroundPermissionsAsync = grantedPromise;
|
|
68
|
-
return expoLocation;
|
|
69
|
-
});
|
|
70
|
-
jest.doMock('expo-barcode-scanner', () => {
|
|
71
|
-
const expoBarcodeSacnner = jest.requireActual('expo-barcode-scanner');
|
|
72
|
-
expoBarcodeSacnner.requestPermissionsAsync = grantedPromise;
|
|
73
|
-
return expoBarcodeSacnner;
|
|
74
|
-
});
|
|
75
|
-
//# sourceMappingURL=setup.js.map
|
package/dist/setup.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
export default class MockStorage {
|
|
2
|
-
constructor (cache = {}) {
|
|
3
|
-
this.storageCache = cache
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
setItem = jest.fn((key, value) => {
|
|
7
|
-
return new Promise((resolve, reject) => {
|
|
8
|
-
return (typeof key !== 'string' || typeof value !== 'string')
|
|
9
|
-
? reject(new Error('key and value must be string'))
|
|
10
|
-
: resolve(this.storageCache[key] = value)
|
|
11
|
-
})
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
getItem = jest.fn((key) => {
|
|
15
|
-
return new Promise((resolve) => {
|
|
16
|
-
// eslint-disable-next-line
|
|
17
|
-
return this.storageCache.hasOwnProperty(key)
|
|
18
|
-
? resolve(this.storageCache[key])
|
|
19
|
-
: resolve(null)
|
|
20
|
-
})
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
removeItem = jest.fn((key) => {
|
|
24
|
-
return new Promise((resolve, reject) => {
|
|
25
|
-
return this.storageCache.hasOwnProperty(key)
|
|
26
|
-
? resolve(delete this.storageCache[key])
|
|
27
|
-
: reject(new Error('No such key!'))
|
|
28
|
-
})
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
clear = jest.fn(() => {
|
|
32
|
-
return new Promise((resolve) => resolve(this.storageCache = {}))
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
getAllKeys = jest.fn(() => {
|
|
36
|
-
return new Promise((resolve) => resolve(Object.keys(this.storageCache)))
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
multiRemove = jest.fn((keys) => {
|
|
40
|
-
return new Promise((resolve) => {
|
|
41
|
-
keys.forEach(key => {
|
|
42
|
-
this.removeItem(key)
|
|
43
|
-
})
|
|
44
|
-
resolve()
|
|
45
|
-
})
|
|
46
|
-
})
|
|
47
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const geolocation = {
|
|
2
|
-
getCurrentPosition (callback) {
|
|
3
|
-
const res = {}
|
|
4
|
-
const coords = {
|
|
5
|
-
latitude: 0,
|
|
6
|
-
longitude: 0,
|
|
7
|
-
speed: 0,
|
|
8
|
-
accuracy: 0,
|
|
9
|
-
altitude: 0
|
|
10
|
-
}
|
|
11
|
-
res.coords = coords
|
|
12
|
-
res.timestamp = Date.now()
|
|
13
|
-
callback && callback(res)
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const navigator = {}
|
|
18
|
-
navigator.geolocation = geolocation
|
|
19
|
-
|
|
20
|
-
export default navigator
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line
|
|
2
|
-
const noop = () => {}
|
|
3
|
-
|
|
4
|
-
export default class NetInfo {
|
|
5
|
-
constructor (connectionType = 'wifi', effectiveConnectionType = '4g') {
|
|
6
|
-
this.connectionType = connectionType
|
|
7
|
-
this.effectiveConnectionType = effectiveConnectionType
|
|
8
|
-
this.eventMaps = {}
|
|
9
|
-
this.connectedStatus = connectionType === 'wifi' || connectionType === 'cellular'
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
isConnected = {
|
|
13
|
-
fetch: this.fetch.bind(this)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
fetch () {
|
|
17
|
-
return new Promise((resolve) => {
|
|
18
|
-
resolve({
|
|
19
|
-
type: this.connectionType,
|
|
20
|
-
})
|
|
21
|
-
})
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
getConnectionInfo () {
|
|
25
|
-
return new Promise((resolve) => {
|
|
26
|
-
const res = {}
|
|
27
|
-
res.type = this.connectionType
|
|
28
|
-
res.effectiveType = this.effectiveConnectionType
|
|
29
|
-
resolve(res)
|
|
30
|
-
})
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
addEventListener (eventName, listener = noop) {
|
|
34
|
-
this.eventMaps[eventName] = listener
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
removeEventListener (eventName, listener = noop) {
|
|
38
|
-
if (this.eventMaps[eventName] === listener) {
|
|
39
|
-
delete this.eventMaps[eventName]
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// 纯粹为了模拟测试用,主动更改网络状态
|
|
44
|
-
changeNetworkType (connectionType, effectiveConnectionType = '4g') {
|
|
45
|
-
if (this.connectionType !== connectionType) {
|
|
46
|
-
this.connectionType = connectionType
|
|
47
|
-
if (connectionType === 'cellular') {
|
|
48
|
-
this.effectiveConnectionType = effectiveConnectionType
|
|
49
|
-
}
|
|
50
|
-
this.connectedStatus = connectionType === 'wifi' || connectionType === 'cellular'
|
|
51
|
-
|
|
52
|
-
const res = {}
|
|
53
|
-
res.type = this.connectionType
|
|
54
|
-
res.effectiveType = this.effectiveConnectionType
|
|
55
|
-
const fn = this.eventMaps.connectionChange
|
|
56
|
-
fn && fn(res)
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
const RNCCameraRoll = {
|
|
2
|
-
deletePhotos: jest.fn(),
|
|
3
|
-
saveToCameraRoll: jest.fn((url, { type }) => Promise.resolve(`${type}://${url}`)),
|
|
4
|
-
getPhotos: jest.fn(() => Promise.resolve()),
|
|
5
|
-
}
|
|
6
|
-
const RNCCameraRollPermissionModule = {
|
|
7
|
-
checkPermission: jest.fn(),
|
|
8
|
-
requestReadWritePermission: jest.fn(),
|
|
9
|
-
requestAddOnlyPermission: jest.fn(),
|
|
10
|
-
refreshPhotoSelection: jest.fn(),
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export default {
|
|
14
|
-
RNCCameraRoll,
|
|
15
|
-
RNCCameraRollPermissionModule,
|
|
16
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export const mockGetCurrentPosition = jest.fn()
|
|
2
|
-
|
|
3
|
-
const RNCGeolocation = {
|
|
4
|
-
addListener: jest.fn(),
|
|
5
|
-
getCurrentPosition: mockGetCurrentPosition,
|
|
6
|
-
removeListeners: jest.fn(),
|
|
7
|
-
requestAuthorization: jest.fn(),
|
|
8
|
-
setConfiguration: jest.fn(),
|
|
9
|
-
startObserving: jest.fn(),
|
|
10
|
-
stopObserving: jest.fn(),
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export default RNCGeolocation
|