@mpxjs/api-proxy 2.10.17 → 2.10.18
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/@types/index.d.ts +27 -0
- package/package.json +12 -4
- package/src/platform/api/base/index.ios.js +1 -0
- package/src/platform/api/base/index.web.js +1 -4
- package/src/platform/api/base/rnCanIUse.js +93 -0
- package/src/platform/api/base/rnCanIUseConfig.js +231 -0
- package/src/platform/api/ble-connection/index.ali.js +67 -2
- package/src/platform/api/ble-connection/index.ios.js +861 -0
- package/src/platform/api/ble-connection/index.js +65 -2
- package/src/platform/api/create-intersection-observer/rnIntersectionObserver.js +3 -0
- package/src/platform/api/device/wifi/index.ios.js +236 -0
- package/src/platform/api/device/wifi/index.js +22 -0
- package/src/platform/api/route/index.ios.js +13 -7
- package/src/platform/api/setting/index.ios.js +36 -0
- package/src/platform/index.js +3 -0
|
@@ -6,8 +6,71 @@ const createBLEConnection = ENV_OBJ.createBLEConnection || envError('createBLECo
|
|
|
6
6
|
|
|
7
7
|
const onBLEConnectionStateChange = ENV_OBJ.onBLEConnectionStateChange || envError('onBLEConnectionStateChange')
|
|
8
8
|
|
|
9
|
+
const offBLEConnectionStateChange = ENV_OBJ.offBLEConnectionStateChange || envError('offBLEConnectionStateChange')
|
|
10
|
+
|
|
11
|
+
const openBluetoothAdapter = ENV_OBJ.openBluetoothAdapter || envError('openBluetoothAdapter')
|
|
12
|
+
|
|
13
|
+
const closeBluetoothAdapter = ENV_OBJ.closeBluetoothAdapter || envError('closeBluetoothAdapter')
|
|
14
|
+
|
|
15
|
+
const startBluetoothDevicesDiscovery = ENV_OBJ.startBluetoothDevicesDiscovery || envError('startBluetoothDevicesDiscovery')
|
|
16
|
+
|
|
17
|
+
const stopBluetoothDevicesDiscovery = ENV_OBJ.stopBluetoothDevicesDiscovery || envError('stopBluetoothDevicesDiscovery')
|
|
18
|
+
|
|
19
|
+
const onBluetoothDeviceFound = ENV_OBJ.onBluetoothDeviceFound || envError('onBluetoothDeviceFound')
|
|
20
|
+
|
|
21
|
+
const offBluetoothDeviceFound = ENV_OBJ.offBluetoothDeviceFound || envError('offBluetoothDeviceFound')
|
|
22
|
+
|
|
23
|
+
const getConnectedBluetoothDevices = ENV_OBJ.getConnectedBluetoothDevices || envError('getConnectedBluetoothDevices')
|
|
24
|
+
|
|
25
|
+
const getBluetoothAdapterState = ENV_OBJ.getBluetoothAdapterState || envError('getBluetoothAdapterState')
|
|
26
|
+
|
|
27
|
+
const onBluetoothAdapterStateChange = ENV_OBJ.onBluetoothAdapterStateChange || envError('onBluetoothAdapterStateChange')
|
|
28
|
+
|
|
29
|
+
const offBluetoothAdapterStateChange = ENV_OBJ.offBluetoothAdapterStateChange || envError('offBluetoothAdapterStateChange')
|
|
30
|
+
|
|
31
|
+
const getBluetoothDevices = ENV_OBJ.getBluetoothDevices || envError('getBluetoothDevices')
|
|
32
|
+
|
|
33
|
+
const writeBLECharacteristicValue = ENV_OBJ.writeBLECharacteristicValue || envError('writeBLECharacteristicValue')
|
|
34
|
+
|
|
35
|
+
const readBLECharacteristicValue = ENV_OBJ.readBLECharacteristicValue || envError('readBLECharacteristicValue')
|
|
36
|
+
|
|
37
|
+
const notifyBLECharacteristicValueChange = ENV_OBJ.notifyBLECharacteristicValueChange || envError('notifyBLECharacteristicValueChange')
|
|
38
|
+
|
|
39
|
+
const onBLECharacteristicValueChange = ENV_OBJ.onBLECharacteristicValueChange || envError('onBLECharacteristicValueChange')
|
|
40
|
+
|
|
41
|
+
const offBLECharacteristicValueChange = ENV_OBJ.offBLECharacteristicValueChange || envError('offBLECharacteristicValueChange')
|
|
42
|
+
|
|
43
|
+
const setBLEMTU = ENV_OBJ.setBLEMTU || envError('setBLEMTU')
|
|
44
|
+
|
|
45
|
+
const getBLEDeviceRSSI = ENV_OBJ.getBLEDeviceRSSI || envError('getBLEDeviceRSSI')
|
|
46
|
+
|
|
47
|
+
const getBLEDeviceServices = ENV_OBJ.getBLEDeviceServices || envError('getBLEDeviceServices')
|
|
48
|
+
|
|
49
|
+
const getBLEDeviceCharacteristics = ENV_OBJ.getBLEDeviceCharacteristics || envError('getBLEDeviceCharacteristics')
|
|
50
|
+
|
|
9
51
|
export {
|
|
10
|
-
|
|
52
|
+
onBLEConnectionStateChange,
|
|
53
|
+
offBLEConnectionStateChange,
|
|
54
|
+
openBluetoothAdapter,
|
|
55
|
+
closeBluetoothAdapter,
|
|
56
|
+
startBluetoothDevicesDiscovery,
|
|
57
|
+
stopBluetoothDevicesDiscovery,
|
|
58
|
+
onBluetoothDeviceFound,
|
|
59
|
+
offBluetoothDeviceFound,
|
|
60
|
+
getConnectedBluetoothDevices,
|
|
61
|
+
getBluetoothAdapterState,
|
|
62
|
+
onBluetoothAdapterStateChange,
|
|
63
|
+
offBluetoothAdapterStateChange,
|
|
64
|
+
getBluetoothDevices,
|
|
65
|
+
writeBLECharacteristicValue,
|
|
66
|
+
readBLECharacteristicValue,
|
|
67
|
+
notifyBLECharacteristicValueChange,
|
|
68
|
+
onBLECharacteristicValueChange,
|
|
69
|
+
offBLECharacteristicValueChange,
|
|
70
|
+
setBLEMTU,
|
|
71
|
+
getBLEDeviceRSSI,
|
|
72
|
+
getBLEDeviceServices,
|
|
73
|
+
getBLEDeviceCharacteristics,
|
|
11
74
|
createBLEConnection,
|
|
12
|
-
|
|
75
|
+
closeBLEConnection
|
|
13
76
|
}
|
|
@@ -201,6 +201,9 @@ class RNIntersectionObserver {
|
|
|
201
201
|
|
|
202
202
|
// 计算节点的rect信息
|
|
203
203
|
_measureTarget (isInit = false) {
|
|
204
|
+
if (!this.observerRefs || !this.relativeRef) {
|
|
205
|
+
return
|
|
206
|
+
}
|
|
204
207
|
Promise.all([
|
|
205
208
|
this._getReferenceRect(this.observerRefs),
|
|
206
209
|
this._getReferenceRect(this.relativeRef)
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { PermissionsAndroid } from 'react-native'
|
|
2
|
+
import { noop, type } from '@mpxjs/utils'
|
|
3
|
+
import mpx from '@mpxjs/core'
|
|
4
|
+
let startWifiReady = false
|
|
5
|
+
const wifiListListeners = []
|
|
6
|
+
|
|
7
|
+
async function requestWifiPermission () {
|
|
8
|
+
const granted = await PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, {
|
|
9
|
+
title: 'Location permission is required for WiFi connections',
|
|
10
|
+
message:
|
|
11
|
+
'This app needs location permission as this is required ' +
|
|
12
|
+
'to scan for wifi networks.',
|
|
13
|
+
buttonNegative: 'DENY',
|
|
14
|
+
buttonPositive: 'ALLOW'
|
|
15
|
+
})
|
|
16
|
+
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
|
|
17
|
+
return true
|
|
18
|
+
} else {
|
|
19
|
+
return false
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function startWifi (options = {}) {
|
|
24
|
+
const { success = noop, fail = noop, complete = noop } = options
|
|
25
|
+
if (__mpx_mode__ === 'ios') {
|
|
26
|
+
const result = {
|
|
27
|
+
errMsg: 'startWifi:fail ios system not support, you need to manually go to the Settings to enable wifi'
|
|
28
|
+
}
|
|
29
|
+
fail(result)
|
|
30
|
+
complete(result)
|
|
31
|
+
return
|
|
32
|
+
}
|
|
33
|
+
const WifiManager = require('react-native-wifi-reborn').default
|
|
34
|
+
let wifiPermission = requestWifiPermission
|
|
35
|
+
if (mpx.config?.rnConfig?.wifiPermission) {
|
|
36
|
+
wifiPermission = mpx.config.rnConfig.wifiPermission
|
|
37
|
+
}
|
|
38
|
+
wifiPermission().then(async () => {
|
|
39
|
+
let enabled
|
|
40
|
+
try {
|
|
41
|
+
enabled = await WifiManager.isEnabled()
|
|
42
|
+
} catch (e) {
|
|
43
|
+
enabled = false
|
|
44
|
+
}
|
|
45
|
+
if (!enabled) {
|
|
46
|
+
const result = {
|
|
47
|
+
errMsg: 'startWifi:fail wifi not turned on',
|
|
48
|
+
errCode: 12005
|
|
49
|
+
}
|
|
50
|
+
fail(result)
|
|
51
|
+
complete(result)
|
|
52
|
+
return
|
|
53
|
+
}
|
|
54
|
+
startWifiReady = true
|
|
55
|
+
const result = {
|
|
56
|
+
errMsg: 'startWifi:success'
|
|
57
|
+
}
|
|
58
|
+
success(result)
|
|
59
|
+
complete(result)
|
|
60
|
+
}).catch((err) => {
|
|
61
|
+
const result = {
|
|
62
|
+
errMsg: 'startWifi:fail ' + (typeof err === 'string' ? err : ''),
|
|
63
|
+
errCode: 12001
|
|
64
|
+
}
|
|
65
|
+
fail(result)
|
|
66
|
+
complete(result)
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function stopWifi (options = {}) {
|
|
71
|
+
const { success = noop, fail = noop, complete = noop } = options
|
|
72
|
+
if (__mpx_mode__ === 'ios') {
|
|
73
|
+
const result = {
|
|
74
|
+
errMsg: 'stopWifi:fail ios system not support, you need to manually go to the Settings to enable wifi'
|
|
75
|
+
}
|
|
76
|
+
fail(result)
|
|
77
|
+
complete(result)
|
|
78
|
+
return
|
|
79
|
+
}
|
|
80
|
+
startWifiReady = false
|
|
81
|
+
wifiListListeners.length = 0
|
|
82
|
+
const result = {
|
|
83
|
+
errMsg: 'stopWifi:success'
|
|
84
|
+
}
|
|
85
|
+
success(result)
|
|
86
|
+
complete(result)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function getWifiList (options = {}) {
|
|
90
|
+
const { success = noop, fail = noop, complete = noop } = options
|
|
91
|
+
if (__mpx_mode__ === 'ios') {
|
|
92
|
+
const result = {
|
|
93
|
+
errMsg: 'getWifiList:fail ios system not support'
|
|
94
|
+
}
|
|
95
|
+
fail(result)
|
|
96
|
+
complete(result)
|
|
97
|
+
return
|
|
98
|
+
}
|
|
99
|
+
if (!startWifiReady) {
|
|
100
|
+
const result = {
|
|
101
|
+
errMsg: 'getWifiList:fail not init startWifi',
|
|
102
|
+
errCode: 12000
|
|
103
|
+
}
|
|
104
|
+
fail(result)
|
|
105
|
+
complete(result)
|
|
106
|
+
return
|
|
107
|
+
}
|
|
108
|
+
const WifiManager = require('react-native-wifi-reborn').default
|
|
109
|
+
WifiManager.reScanAndLoadWifiList().then((res) => {
|
|
110
|
+
const wifiList = res.map(item => {
|
|
111
|
+
return {
|
|
112
|
+
SSID: item.SSID,
|
|
113
|
+
BSSID: item.BSSID,
|
|
114
|
+
frequency: item.frequency,
|
|
115
|
+
signalStrength: 100 + (item.level || 0)
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
wifiListListeners.forEach(callback => {
|
|
119
|
+
if (type(callback) === 'Function') {
|
|
120
|
+
callback({ wifiList })
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
const result = {
|
|
124
|
+
errMsg: 'getWifiList:success',
|
|
125
|
+
errno: 0,
|
|
126
|
+
errCode: 0
|
|
127
|
+
}
|
|
128
|
+
success(result)
|
|
129
|
+
complete(result)
|
|
130
|
+
}).catch(() => {
|
|
131
|
+
const result = {
|
|
132
|
+
errMsg: 'getWifiList:fail'
|
|
133
|
+
}
|
|
134
|
+
fail(result)
|
|
135
|
+
complete(result)
|
|
136
|
+
})
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function onGetWifiList (callback) {
|
|
140
|
+
if (!startWifiReady && wifiListListeners.indexOf(callback) > -1) {
|
|
141
|
+
return
|
|
142
|
+
}
|
|
143
|
+
wifiListListeners.push(callback)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function offGetWifiList (callback) {
|
|
147
|
+
if (!startWifiReady) {
|
|
148
|
+
return
|
|
149
|
+
}
|
|
150
|
+
const index = wifiListListeners.indexOf(callback)
|
|
151
|
+
if (index > -1) {
|
|
152
|
+
wifiListListeners.splice(index, 1)
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function getConnectedWifi (options = {}) {
|
|
157
|
+
const { partialInfo = false, success = noop, fail = noop, complete = noop } = options
|
|
158
|
+
|
|
159
|
+
if (!startWifiReady) {
|
|
160
|
+
const result = {
|
|
161
|
+
errMsg: 'getConnectedWifi:fail not init startWifi',
|
|
162
|
+
errCode: 12000
|
|
163
|
+
}
|
|
164
|
+
fail(result)
|
|
165
|
+
complete(result)
|
|
166
|
+
return
|
|
167
|
+
}
|
|
168
|
+
const WifiManager = require('react-native-wifi-reborn').default
|
|
169
|
+
if (partialInfo) {
|
|
170
|
+
WifiManager.getCurrentWifiSSID().then((res) => {
|
|
171
|
+
const wifi = {
|
|
172
|
+
SSID: res,
|
|
173
|
+
BSSID: '', // iOS无法获取BSSID
|
|
174
|
+
signalStrength: 0,
|
|
175
|
+
frequency: 0
|
|
176
|
+
}
|
|
177
|
+
const result = {
|
|
178
|
+
wifi: wifi,
|
|
179
|
+
errMsg: 'getConnectedWifi:ok'
|
|
180
|
+
}
|
|
181
|
+
success(result)
|
|
182
|
+
complete(result)
|
|
183
|
+
}).catch(() => {
|
|
184
|
+
const result = {
|
|
185
|
+
errMsg: 'getConnectedWifi:fail'
|
|
186
|
+
}
|
|
187
|
+
fail(result)
|
|
188
|
+
complete(result)
|
|
189
|
+
})
|
|
190
|
+
} else {
|
|
191
|
+
Promise.all([
|
|
192
|
+
WifiManager.getCurrentWifiSSID().catch(() => null),
|
|
193
|
+
WifiManager.getBSSID().catch(() => ''),
|
|
194
|
+
WifiManager.getCurrentSignalStrength().catch(() => 0),
|
|
195
|
+
WifiManager.getFrequency().catch(() => 0)
|
|
196
|
+
]).then(([ssid, bssid, signalStrength, frequency]) => {
|
|
197
|
+
if (!ssid) {
|
|
198
|
+
const result = {
|
|
199
|
+
errMsg: 'getConnectedWifi:fail'
|
|
200
|
+
}
|
|
201
|
+
fail(result)
|
|
202
|
+
complete(result)
|
|
203
|
+
return
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const wifi = {
|
|
207
|
+
SSID: ssid,
|
|
208
|
+
BSSID: bssid,
|
|
209
|
+
signalStrength: signalStrength,
|
|
210
|
+
frequency: frequency
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const result = {
|
|
214
|
+
wifi: wifi,
|
|
215
|
+
errMsg: 'getConnectedWifi:ok'
|
|
216
|
+
}
|
|
217
|
+
success(result)
|
|
218
|
+
complete(result)
|
|
219
|
+
}).catch(() => {
|
|
220
|
+
const result = {
|
|
221
|
+
errMsg: 'getConnectedWifi:fail'
|
|
222
|
+
}
|
|
223
|
+
fail(result)
|
|
224
|
+
complete(result)
|
|
225
|
+
})
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export {
|
|
230
|
+
startWifi,
|
|
231
|
+
stopWifi,
|
|
232
|
+
getWifiList,
|
|
233
|
+
onGetWifiList,
|
|
234
|
+
offGetWifiList,
|
|
235
|
+
getConnectedWifi
|
|
236
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ENV_OBJ, envError } from '../../../../common/js'
|
|
2
|
+
|
|
3
|
+
const startWifi = ENV_OBJ.startWifi || envError('startWifi')
|
|
4
|
+
|
|
5
|
+
const stopWifi = ENV_OBJ.stopWifi || envError('stopWifi')
|
|
6
|
+
|
|
7
|
+
const getWifiList = ENV_OBJ.getWifiList || envError('getWifiList')
|
|
8
|
+
|
|
9
|
+
const getConnectedWifi = ENV_OBJ.getConnectedWifi || envError('getConnectedWifi')
|
|
10
|
+
|
|
11
|
+
const onGetWifiList = ENV_OBJ.onGetWifiList || envError('onGetWifiList')
|
|
12
|
+
|
|
13
|
+
const offGetWifiList = ENV_OBJ.offGetWifiList || envError('offGetWifiList')
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
startWifi,
|
|
17
|
+
stopWifi,
|
|
18
|
+
getWifiList,
|
|
19
|
+
onGetWifiList,
|
|
20
|
+
offGetWifiList,
|
|
21
|
+
getConnectedWifi
|
|
22
|
+
}
|
|
@@ -14,14 +14,18 @@ function getBasePath (navigation) {
|
|
|
14
14
|
let timerId = null
|
|
15
15
|
function isLock (navigationHelper, type, options) {
|
|
16
16
|
if (navigationHelper.lastSuccessCallback && navigationHelper.lastFailCallback) {
|
|
17
|
-
const
|
|
17
|
+
const { path } = parseUrl(options.url || '')
|
|
18
|
+
const res = {
|
|
19
|
+
errMsg: `${type}:fail the previous routing event didn't complete`,
|
|
20
|
+
path
|
|
21
|
+
}
|
|
18
22
|
failHandle(res, options.fail, options.complete)
|
|
19
23
|
return true
|
|
20
24
|
}
|
|
21
25
|
clearTimeout(timerId)
|
|
22
26
|
timerId = setTimeout(() => {
|
|
23
27
|
if (navigationHelper.lastSuccessCallback && navigationHelper.lastFailCallback) {
|
|
24
|
-
navigationHelper.lastFailCallback(
|
|
28
|
+
navigationHelper.lastFailCallback(`${type}:fail timeout ${options.url || ''}`)
|
|
25
29
|
navigationHelper.lastFailCallback = null
|
|
26
30
|
}
|
|
27
31
|
}, 1000)
|
|
@@ -39,7 +43,7 @@ function navigateTo (options = {}) {
|
|
|
39
43
|
if (options.events) {
|
|
40
44
|
eventChannel._addListeners(options.events)
|
|
41
45
|
}
|
|
42
|
-
const { path, queryObj } = parseUrl(options.url)
|
|
46
|
+
const { path, queryObj } = parseUrl(options.url, true)
|
|
43
47
|
const basePath = getBasePath(navigation)
|
|
44
48
|
const finalPath = resolvePath(path, basePath).slice(1)
|
|
45
49
|
|
|
@@ -66,7 +70,7 @@ function redirectTo (options = {}) {
|
|
|
66
70
|
return
|
|
67
71
|
}
|
|
68
72
|
if (navigation && navigationHelper) {
|
|
69
|
-
const { path, queryObj } = parseUrl(options.url)
|
|
73
|
+
const { path, queryObj } = parseUrl(options.url, true)
|
|
70
74
|
const basePath = getBasePath(navigation)
|
|
71
75
|
const finalPath = resolvePath(path, basePath).slice(1)
|
|
72
76
|
navigation.replace(finalPath, queryObj)
|
|
@@ -100,8 +104,10 @@ function navigateBack (options = {}) {
|
|
|
100
104
|
}
|
|
101
105
|
if (delta >= routeLength && global.__mpx?.config.rnConfig.onAppBack?.(delta - routeLength + 1)) {
|
|
102
106
|
nextTick(() => {
|
|
103
|
-
navigationHelper.lastSuccessCallback
|
|
104
|
-
|
|
107
|
+
if (navigationHelper.lastSuccessCallback) {
|
|
108
|
+
navigationHelper.lastSuccessCallback()
|
|
109
|
+
navigationHelper.lastSuccessCallback = null
|
|
110
|
+
}
|
|
105
111
|
})
|
|
106
112
|
} else {
|
|
107
113
|
navigation.pop(delta)
|
|
@@ -116,7 +122,7 @@ function reLaunch (options = {}) {
|
|
|
116
122
|
return
|
|
117
123
|
}
|
|
118
124
|
if (navigation && navigationHelper) {
|
|
119
|
-
const { path, queryObj } = parseUrl(options.url)
|
|
125
|
+
const { path, queryObj } = parseUrl(options.url, true)
|
|
120
126
|
const basePath = getBasePath(navigation)
|
|
121
127
|
const finalPath = resolvePath(path, basePath).slice(1)
|
|
122
128
|
navigation.reset({
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { getWindowInfo } from '../system/rnSystem'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* RN 平台模拟胶囊按钮的布局位置
|
|
5
|
+
* 由于 RN 应用没有微信的右上角胶囊按钮,这里返回一个基于屏幕尺寸和安全区计算的模拟值
|
|
6
|
+
* 主要用于保持代码兼容性,让开发者可以获取顶部导航区域的参考尺寸
|
|
7
|
+
*/
|
|
8
|
+
const getMenuButtonBoundingClientRect = function () {
|
|
9
|
+
const windowInfo = getWindowInfo()
|
|
10
|
+
const { screenWidth, statusBarHeight } = windowInfo
|
|
11
|
+
|
|
12
|
+
// 微信小程序胶囊按钮的典型尺寸
|
|
13
|
+
const CAPSULE_WIDTH = 87 // 胶囊宽度
|
|
14
|
+
const CAPSULE_HEIGHT = 32 // 胶囊高度
|
|
15
|
+
const MARGIN_RIGHT = 7 // 距离右边距离
|
|
16
|
+
const MARGIN_TOP = 4 // 状态栏下方的间距
|
|
17
|
+
|
|
18
|
+
// 计算胶囊按钮的位置
|
|
19
|
+
const top = statusBarHeight + MARGIN_TOP
|
|
20
|
+
const right = screenWidth - MARGIN_RIGHT
|
|
21
|
+
const left = right - CAPSULE_WIDTH
|
|
22
|
+
const bottom = top + CAPSULE_HEIGHT
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
width: CAPSULE_WIDTH,
|
|
26
|
+
height: CAPSULE_HEIGHT,
|
|
27
|
+
top,
|
|
28
|
+
right,
|
|
29
|
+
bottom,
|
|
30
|
+
left
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
getMenuButtonBoundingClientRect
|
|
36
|
+
}
|
package/src/platform/index.js
CHANGED
|
@@ -37,6 +37,9 @@ export * from './api/create-selector-query'
|
|
|
37
37
|
// getNetworkType, onNetworkStatusChange, offNetworkStatusChange
|
|
38
38
|
export * from './api/device/network'
|
|
39
39
|
|
|
40
|
+
// startWifi, stopWifi, getWifiList, onGetWifiList, offGetWifiList, getConnectedWifi
|
|
41
|
+
export * from './api/device/wifi'
|
|
42
|
+
|
|
40
43
|
// downloadFile, uploadFile
|
|
41
44
|
export * from './api/file'
|
|
42
45
|
|