@mpxjs/core 2.10.1-beta.1 → 2.10.1-beta.3

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/core",
3
- "version": "2.10.1-beta.1",
3
+ "version": "2.10.1-beta.3",
4
4
  "description": "mpx runtime core",
5
5
  "keywords": [
6
6
  "miniprogram",
@@ -37,7 +37,8 @@ const rulesMap = {
37
37
  wxToDd: extend({}, defaultConvertRule, wxToDdRule),
38
38
  wxToJd: extend({}, defaultConvertRule, wxToJdRule),
39
39
  wxToIos: extend({}, defaultConvertRule, wxToReactRule),
40
- wxToAndroid: extend({}, defaultConvertRule, wxToReactRule)
40
+ wxToAndroid: extend({}, defaultConvertRule, wxToReactRule),
41
+ wxToHarmony: extend({}, defaultConvertRule, wxToReactRule)
41
42
  }
42
43
 
43
44
  export function getConvertRule (convertMode) {
@@ -7,7 +7,8 @@ const convertModes = {
7
7
  'wx-jd': 'wxToJd',
8
8
  'wx-dd': 'wxToDd',
9
9
  'wx-ios': 'wxToIos',
10
- 'wx-android': 'wxToAndroid'
10
+ 'wx-android': 'wxToAndroid',
11
+ 'wx-harmony': 'wxToHarmony'
11
12
  }
12
13
 
13
14
  export function getConvertMode (srcMode) {
@@ -1,3 +1,4 @@
1
+ import { isReact } from '@mpxjs/utils'
1
2
  import pageStatusMixin from './pageStatusMixin'
2
3
  import proxyEventMixin from './proxyEventMixin'
3
4
  import renderHelperMixin from './renderHelperMixin'
@@ -16,7 +17,7 @@ import directiveHelperMixin from './directiveHelperMixin'
16
17
 
17
18
  export default function getBuiltInMixins ({ type, rawOptions = {} }) {
18
19
  let bulitInMixins
19
- if (__mpx_mode__ === 'ios' || __mpx_mode__ === 'android') {
20
+ if (isReact) {
20
21
  bulitInMixins = [
21
22
  proxyEventMixin(),
22
23
  directiveHelperMixin(),
@@ -6,6 +6,8 @@ import { LIFECYCLE } from '../platform/patch/lifecycle/index'
6
6
  import Mpx from '../index'
7
7
  import { createElement, memo, useRef, useEffect } from 'react'
8
8
  import * as ReactNative from 'react-native'
9
+ import { Image } from 'react-native'
10
+
9
11
  import { initAppProvides } from './export/inject'
10
12
 
11
13
  const appHooksMap = makeMap(mergeLifecycle(LIFECYCLE).app)
@@ -181,6 +183,7 @@ export default function createApp (options) {
181
183
  }, [])
182
184
 
183
185
  const { initialRouteName, initialParams } = initialRouteRef.current
186
+ const headerBackImageProps = Mpx.config.rnConfig.headerBackImageProps || null
184
187
  const headerBackImageSource = Mpx.config.rnConfig.headerBackImageSource || null
185
188
  const navScreenOpts = {
186
189
  // 7.x替换headerBackTitleVisible
@@ -188,9 +191,13 @@ export default function createApp (options) {
188
191
  headerBackTitleVisible: false,
189
192
  // 安卓上会出现初始化时闪现导航条的问题
190
193
  headerShown: false,
191
- // 隐藏导航下的那条线
192
194
  headerShadowVisible: false
193
195
  }
196
+ if (headerBackImageProps) {
197
+ navScreenOpts.headerBackImage = () => {
198
+ return createElement(Image, headerBackImageProps)
199
+ }
200
+ }
194
201
  if (headerBackImageSource) {
195
202
  navScreenOpts.headerBackImageSource = headerBackImageSource
196
203
  }
@@ -583,7 +583,7 @@ export function getDefaultOptions ({ type, rawOptions = {}, currentInject }) {
583
583
  headerTintColor: pageConfig.navigationBarTextStyle || 'white'
584
584
  })
585
585
 
586
- if (__mpx_mode__ === 'android') {
586
+ if (__mpx_mode__ === 'android' || __mpx_mode__ === 'harmony') {
587
587
  ReactNative.StatusBar.setBarStyle(pageConfig.barStyle || 'dark-content')
588
588
  ReactNative.StatusBar.setTranslucent(isCustom) // 控制statusbar是否占位
589
589
  const color = isCustom ? 'transparent' : pageConfig.statusBarColor