@mpxjs/api-proxy 2.9.61 → 2.9.64

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 (34) hide show
  1. package/@types/index.d.ts +3 -4
  2. package/LICENSE +433 -0
  3. package/package.json +9 -8
  4. package/src/common/js/utils.js +10 -1
  5. package/src/platform/api/action-sheet/rnActionSheet.jsx +1 -1
  6. package/src/platform/api/base/index.web.js +4 -1
  7. package/src/platform/api/clipboard-data/rnClipboard.js +18 -11
  8. package/src/platform/api/create-selector-query/rnNodesRef.js +15 -13
  9. package/src/platform/api/create-selector-query/rnSelectQuery.js +6 -0
  10. package/src/platform/api/device/network/rnNetwork.js +1 -1
  11. package/src/platform/api/ext/index.ali.js +23 -0
  12. package/src/platform/api/ext/index.js +10 -0
  13. package/src/platform/api/keyboard/index.android.js +1 -0
  14. package/src/platform/api/keyboard/index.ios.js +62 -0
  15. package/src/platform/api/keyboard/index.js +13 -0
  16. package/src/platform/api/location/index.ios.js +1 -1
  17. package/src/platform/api/location/index.web.js +1 -1
  18. package/src/platform/api/make-phone-call/rnMakePhone.js +1 -1
  19. package/src/platform/api/modal/rnModal.jsx +38 -16
  20. package/src/platform/api/page-scroll-to/index.web.js +1 -1
  21. package/src/platform/api/request/index.web.js +2 -2
  22. package/src/platform/api/screen-brightness/rnScreenBrightness.js +29 -44
  23. package/src/platform/api/set-navigation-bar/index.ios.js +14 -18
  24. package/src/platform/api/socket/SocketTask.js +1 -1
  25. package/src/platform/api/storage/rnStorage.js +5 -5
  26. package/src/platform/api/system/index.web.js +1 -1
  27. package/src/platform/api/system/rnSystem.js +36 -30
  28. package/src/platform/api/toast/rnToast.jsx +8 -8
  29. package/src/platform/api/vibrate/index.android.js +1 -0
  30. package/src/platform/api/vibrate/index.ios.js +39 -0
  31. package/src/platform/api/vibrate/index.js +10 -0
  32. package/src/platform/index.js +9 -0
  33. package/src/platform/api/toast/error.png +0 -0
  34. package/src/platform/api/toast/success.png +0 -0
@@ -0,0 +1,39 @@
1
+ import ReactNativeHapticFeedback from 'react-native-haptic-feedback'
2
+ import { Vibration } from 'react-native'
3
+ import { successHandle, failHandle } from '../../../common/js'
4
+
5
+ const getType = function (type = 'light') {
6
+ return 'impact' + type[0].toUpperCase() + type.substr(1)
7
+ }
8
+ const vibrateShort = function (options = {}) {
9
+ const { type = 'light', success, fail, complete } = options
10
+ try {
11
+ ReactNativeHapticFeedback.trigger(getType(type), {
12
+ ignoreAndroidSystemSettings: true,
13
+ enableVibrateFallback: true
14
+ })
15
+ const result = {
16
+ errMsg: 'vibrateShort:ok'
17
+ }
18
+ successHandle(result, success, complete)
19
+ } catch (e) {
20
+ const result = {
21
+ errMsg: 'vibrateShort:fail'
22
+ }
23
+ failHandle(result, fail, complete)
24
+ }
25
+ }
26
+
27
+ const vibrateLong = function (options = {}) {
28
+ const { success, complete } = options
29
+ Vibration.vibrate(400)
30
+ const result = {
31
+ errMsg: 'vibrateLong:ok'
32
+ }
33
+ successHandle(result, success, complete)
34
+ }
35
+
36
+ export {
37
+ vibrateShort,
38
+ vibrateLong
39
+ }
@@ -0,0 +1,10 @@
1
+ import { ENV_OBJ, envError } from '../../../common/js'
2
+
3
+ const vibrateShort = ENV_OBJ.vibrateShort || envError('vibrateShort')
4
+
5
+ const vibrateLong = ENV_OBJ.vibrateLong || envError('vibrateLong')
6
+
7
+ export {
8
+ vibrateShort,
9
+ vibrateLong
10
+ }
@@ -110,3 +110,12 @@ export * from './api/lifecycle'
110
110
 
111
111
  // getLocation, openLocation, chooseLocation
112
112
  export * from './api/location'
113
+
114
+ // getExtConfig, getExtConfigSync
115
+ export * from './api/ext'
116
+
117
+ // vibrateShort, vibrateLong
118
+ export * from './api/vibrate'
119
+
120
+ // onKeyboardHeightChange, offKeyboardHeightChange, hideKeyboard
121
+ export * from './api/keyboard'
Binary file
Binary file