@mpxjs/api-proxy 2.10.16 → 2.10.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/api-proxy",
3
- "version": "2.10.16",
3
+ "version": "2.10.17",
4
4
  "description": "convert miniprogram API at each end",
5
5
  "module": "src/index.js",
6
6
  "types": "@types/index.d.ts",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "homepage": "https://github.com/didi/mpx#readme",
39
39
  "dependencies": {
40
- "@mpxjs/utils": "^2.10.16",
40
+ "@mpxjs/utils": "^2.10.17",
41
41
  "axios": "^1.7.3"
42
42
  },
43
43
  "peerDependencies": {
@@ -68,5 +68,5 @@
68
68
  "optional": true
69
69
  }
70
70
  },
71
- "gitHead": "be4129320e298edf935ea35f9ca3d375f75ac51c"
71
+ "gitHead": "33fbd0bb8d4b83555239a8931fabb23022af0866"
72
72
  }
@@ -3,7 +3,8 @@ import { noop } from '@mpxjs/utils'
3
3
 
4
4
  function showActionSheet (options = {}) {
5
5
  const opts = changeOpts(options, {
6
- itemList: 'items'
6
+ itemList: 'items',
7
+ alertText: 'title'
7
8
  })
8
9
 
9
10
  const cacheSuc = opts.success || noop
@@ -0,0 +1,13 @@
1
+ import { ENV_OBJ, changeOpts } from '../../../common/js'
2
+
3
+ function createAnimation (options = {}) {
4
+ const opts = changeOpts(options, {
5
+ timingFunction: 'timeFunction'
6
+ })
7
+
8
+ return ENV_OBJ.createAnimation(opts)
9
+ }
10
+
11
+ export {
12
+ createAnimation
13
+ }
@@ -5,10 +5,10 @@ const oldObserveList = new Set()
5
5
 
6
6
  if (isBrowser) {
7
7
  window.addEventListener('offline', () => {
8
- oldObserveList.forEach(fn => fn({ isConnected: false, type: 'none' }))
8
+ oldObserveList.forEach(fn => fn({ isConnected: false, networkType: 'none' }))
9
9
  })
10
10
  window.addEventListener('online', () => {
11
- oldObserveList.forEach(fn => fn({ isConnected: true, type: 'unknow' }))
11
+ oldObserveList.forEach(fn => fn({ isConnected: true, networkType: 'unknow' }))
12
12
  })
13
13
  }
14
14
 
@@ -22,7 +22,7 @@ export function onNetworkStatusChange (callbackFn) {
22
22
  const isConnected = navigator.onLine
23
23
  callbackFn({
24
24
  isConnected,
25
- type: isConnected ? evt.currentTarget.effectiveType : 'none'
25
+ networkType: isConnected ? evt.currentTarget.effectiveType : 'none'
26
26
  })
27
27
  }
28
28
  fnMap.set(callbackFn, proxyCallback)
@@ -11,7 +11,7 @@ const getSystemInfoSync = function () {
11
11
  brand: DeviceInfo.getBrand(),
12
12
  model: DeviceInfo.getModel(),
13
13
  system: `${DeviceInfo.getSystemName()} ${DeviceInfo.getSystemVersion()}`,
14
- platform: DeviceInfo.isEmulatorSync() ? 'emulator' : DeviceInfo.getSystemName(),
14
+ platform: DeviceInfo.isEmulatorSync() ? 'emulator' : DeviceInfo.getSystemName().toLowerCase(),
15
15
  deviceOrientation: screenWidth > screenHeight ? 'portrait' : 'landscape',
16
16
  fontSizeSetting: PixelRatio.getFontScale()
17
17
  }
@@ -68,7 +68,7 @@ const getDeviceInfo = function () {
68
68
  brand: DeviceInfo.getBrand(),
69
69
  model: DeviceInfo.getModel(),
70
70
  system: `${DeviceInfo.getSystemName()} ${DeviceInfo.getSystemVersion()}`,
71
- platform: DeviceInfo.isEmulatorSync() ? 'emulator' : DeviceInfo.getSystemName(),
71
+ platform: DeviceInfo.isEmulatorSync() ? 'emulator' : DeviceInfo.getSystemName().toLowerCase(),
72
72
  memorySize: DeviceInfo.getTotalMemorySync() / (1024 * 1024)
73
73
  })
74
74
  return deviceInfo
@@ -11,7 +11,7 @@ const getWindowInfo = function () {
11
11
  let safeArea = {}
12
12
  const { top = 0, left = 0, bottom = 0, right = 0 } = insets
13
13
  const layout = navigation.layout || {}
14
- const screenHeight = __mpx_mode__ === 'ios' ? dimensionsScreen.height : dimensionsScreen.height - layout.bottomVirtualHeight // 解决安卓开启屏幕内三建导航安卓把安全区计算进去后产生的影响
14
+ const screenHeight = __mpx_mode__ === 'ios' ? dimensionsScreen.height : dimensionsScreen.height - (layout.bottomVirtualHeight || 0) // 解决安卓开启屏幕内导航安卓把安全区计算进去后产生的影响
15
15
  const screenWidth = __mpx_mode__ === 'ios' ? dimensionsScreen.width : dimensionsScreen.width - right
16
16
  const layoutHeight = layout.height || 0
17
17
  const layoutWidth = layout.width || 0