@mpxjs/core 2.10.17-beta.2 → 2.10.17-beta.5

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.17-beta.2",
3
+ "version": "2.10.17-beta.5",
4
4
  "description": "mpx runtime core",
5
5
  "keywords": [
6
6
  "miniprogram",
@@ -1,4 +1,4 @@
1
- import { isObject, isArray, dash2hump, cached, isEmptyObject, hasOwn, getFocusedNavigation, noop } from '@mpxjs/utils'
1
+ import { isObject, isArray, dash2hump, cached, isEmptyObject, hasOwn, getFocusedNavigation } from '@mpxjs/utils'
2
2
  import { StyleSheet, Dimensions } from 'react-native'
3
3
  import { reactive } from '../../observer/reactive'
4
4
  import Mpx from '../../index'
@@ -12,7 +12,7 @@ global.__mpxPageSizeCountMap = reactive({})
12
12
 
13
13
  global.__GCC = function (className, classMap, classMapValueCache) {
14
14
  if (!classMapValueCache.has(className)) {
15
- const styleObj = classMap[className]?.()
15
+ const styleObj = classMap[className]?.(global.__formatValue)
16
16
  styleObj && classMapValueCache.set(className, styleObj)
17
17
  }
18
18
  return classMapValueCache.get(className)
@@ -271,13 +271,13 @@ export default function styleHelperMixin () {
271
271
  if (localStyle._media?.length) {
272
272
  mergeResult(localStyle._default, getMediaStyle(localStyle._media))
273
273
  } else {
274
- mergeResult(localStyle._default)
274
+ mergeResult(localStyle)
275
275
  }
276
- } else if (appStyle = getAppClassStyle(className)) {
276
+ } else if (appStyle = global.__getAppClassStyle?.(className)) {
277
277
  if (appStyle._media?.length) {
278
278
  mergeResult(appStyle._default, getMediaStyle(appStyle._media))
279
279
  } else {
280
- mergeResult(appStyle._default)
280
+ mergeResult(appStyle)
281
281
  }
282
282
  } else if (isObject(this.__props[className])) {
283
283
  // externalClasses必定以对象形式传递下来
@@ -295,13 +295,17 @@ function createInstance ({ propsRef, type, rawOptions, currentInject, validProps
295
295
  instance[key] = method.bind(instance)
296
296
  })
297
297
  }
298
-
298
+ const loadParams = {}
299
299
  if (type === 'page') {
300
300
  const props = propsRef.current
301
301
  instance.route = props.route.name
302
302
  global.__mpxPagesMap = global.__mpxPagesMap || {}
303
303
  global.__mpxPagesMap[props.route.key] = [instance, props.navigation]
304
304
  setFocusedNavigation(props.navigation)
305
+
306
+ if (!global.__mpxAppHotLaunched && global.__mpxInitialRunParams) {
307
+ Object.assign(loadParams, global.__mpxInitialRunParams)
308
+ }
305
309
  set(global.__mpxPageSizeCountMap, pageId, global.__mpxSizeCount)
306
310
  // App onLaunch 在 Page created 之前执行
307
311
  if (!global.__mpxAppHotLaunched && global.__mpxAppOnLaunch) {
@@ -311,11 +315,10 @@ function createInstance ({ propsRef, type, rawOptions, currentInject, validProps
311
315
 
312
316
  const proxy = instance.__mpxProxy = new MpxProxy(rawOptions, instance)
313
317
  proxy.created()
314
-
315
318
  if (type === 'page') {
316
319
  const props = propsRef.current
317
320
  const decodedQuery = {}
318
- const rawQuery = props.route.params || {}
321
+ const rawQuery = Object.assign({}, loadParams, props.route.params || {})
319
322
  if (isObject(rawQuery)) {
320
323
  for (const key in rawQuery) {
321
324
  decodedQuery[key] = decodeURIComponent(rawQuery[key])