@mpxjs/webpack-plugin 2.10.4-beta.2 → 2.10.4-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.
@@ -113,13 +113,14 @@ module.exports = function (jsonContent, {
113
113
  }
114
114
 
115
115
  if (ctorType === 'page') {
116
- const keysToExtract = ['navigationStyle']
116
+ // const keysToExtract = ['navigationStyle']
117
117
  const configObj = {}
118
- keysToExtract.forEach(key => {
119
- if (jsonObj[key]) {
120
- configObj[key] = jsonObj[key]
121
- }
122
- })
118
+ // 暂时先不注入数据,后续如需要使用再用
119
+ // keysToExtract.forEach(key => {
120
+ // if (jsonObj[key]) {
121
+ // configObj[key] = jsonObj[key]
122
+ // }
123
+ // })
123
124
  loaderContext._module.addPresentationalDependency(new RecordPageConfigsMapDependency(parseRequest(loaderContext.resource).resourcePath, configObj))
124
125
  }
125
126
 
@@ -1,7 +1,7 @@
1
1
  import React, { useContext, useEffect, useMemo } from 'react';
2
2
  import { Keyboard, View } from 'react-native';
3
3
  import Animated, { useSharedValue, useAnimatedStyle, withTiming, Easing } from 'react-native-reanimated';
4
- import { GestureDetector, Gesture } from 'react-native-gesture-handler';
4
+ import { Gesture } from 'react-native-gesture-handler';
5
5
  import { KeyboardAvoidContext } from './context';
6
6
  import { isIOS } from './utils';
7
7
  const KeyboardAvoidingView = ({ children, style, contentContainerStyle }) => {
@@ -85,16 +85,18 @@ const KeyboardAvoidingView = ({ children, style, contentContainerStyle }) => {
85
85
  subscriptions.forEach(subscription => subscription.remove());
86
86
  };
87
87
  }, [keyboardAvoid]);
88
- return (<GestureDetector gesture={gesture}>
89
- <View style={style}>
90
- <Animated.View style={[
88
+ return (
89
+ // <GestureDetector gesture={gesture}>
90
+ <View style={style}>
91
+ <Animated.View style={[
91
92
  contentContainerStyle,
92
93
  animatedStyle
93
94
  ]}>
94
- {children}
95
- </Animated.View>
96
- </View>
97
- </GestureDetector>);
95
+ {children}
96
+ </Animated.View>
97
+ </View>
98
+ // </GestureDetector>
99
+ );
98
100
  };
99
101
  KeyboardAvoidingView.displayName = 'MpxKeyboardAvoidingView';
100
102
  export default KeyboardAvoidingView;
@@ -1,4 +1,4 @@
1
- import { forwardRef, useRef, useContext, useMemo, useState, useEffect } from 'react';
1
+ import { forwardRef, useRef, useContext, useMemo, useState } from 'react';
2
2
  import { warn, isFunction } from '@mpxjs/utils';
3
3
  import Portal from './mpx-portal/index';
4
4
  import { getCustomEvent } from './getInnerListeners';
@@ -74,17 +74,17 @@ const _WebView = forwardRef((props, ref) => {
74
74
  isNavigateBack.current = false;
75
75
  };
76
76
  const navigation = useNavigation();
77
- useEffect(() => {
78
- let beforeRemoveSubscription;
79
- if (__mpx_mode__ !== 'ios') {
80
- beforeRemoveSubscription = navigation?.addListener?.('beforeRemove', beforeRemoveHandle);
81
- }
82
- return () => {
83
- if (isFunction(beforeRemoveSubscription)) {
84
- beforeRemoveSubscription();
85
- }
86
- };
87
- }, []);
77
+ // useEffect(() => {
78
+ // let beforeRemoveSubscription:any
79
+ // if (__mpx_mode__ !== 'ios') {
80
+ // beforeRemoveSubscription = navigation?.addListener?.('beforeRemove', beforeRemoveHandle)
81
+ // }
82
+ // return () => {
83
+ // if (isFunction(beforeRemoveSubscription)) {
84
+ // beforeRemoveSubscription()
85
+ // }
86
+ // }
87
+ // }, [])
88
88
  useNodesRef(props, ref, webViewRef, {
89
89
  style: defaultWebViewStyle
90
90
  });
@@ -160,7 +160,7 @@ const _WebView = forwardRef((props, ref) => {
160
160
  { // case下不允许直接声明,包个块解决该问题
161
161
  const title = postData._documentTitle?.trim();
162
162
  if (title !== undefined) {
163
- navigation && navigation.setOptions({ title });
163
+ navigation && navigation.setPageConfig({ navigationBarTitleText: title });
164
164
  }
165
165
  }
166
166
  break;
@@ -102,18 +102,18 @@ const KeyboardAvoidingView = ({ children, style, contentContainerStyle }: Keyboa
102
102
  }, [keyboardAvoid])
103
103
 
104
104
  return (
105
- <GestureDetector gesture={gesture}>
106
- <View style={style}>
107
- <Animated.View
108
- style={[
109
- contentContainerStyle,
110
- animatedStyle
111
- ]}
112
- >
113
- {children}
114
- </Animated.View>
115
- </View>
116
- </GestureDetector>
105
+ // <GestureDetector gesture={gesture}>
106
+ <View style={style}>
107
+ <Animated.View
108
+ style={[
109
+ contentContainerStyle,
110
+ animatedStyle
111
+ ]}
112
+ >
113
+ {children}
114
+ </Animated.View>
115
+ </View>
116
+ // </GestureDetector>
117
117
  )
118
118
  }
119
119
 
@@ -122,17 +122,17 @@ const _WebView = forwardRef<HandlerRef<WebView, WebViewProps>, WebViewProps>((pr
122
122
 
123
123
  const navigation = useNavigation()
124
124
 
125
- useEffect(() => {
126
- let beforeRemoveSubscription:any
127
- if (__mpx_mode__ !== 'ios') {
128
- beforeRemoveSubscription = navigation?.addListener?.('beforeRemove', beforeRemoveHandle)
129
- }
130
- return () => {
131
- if (isFunction(beforeRemoveSubscription)) {
132
- beforeRemoveSubscription()
133
- }
134
- }
135
- }, [])
125
+ // useEffect(() => {
126
+ // let beforeRemoveSubscription:any
127
+ // if (__mpx_mode__ !== 'ios') {
128
+ // beforeRemoveSubscription = navigation?.addListener?.('beforeRemove', beforeRemoveHandle)
129
+ // }
130
+ // return () => {
131
+ // if (isFunction(beforeRemoveSubscription)) {
132
+ // beforeRemoveSubscription()
133
+ // }
134
+ // }
135
+ // }, [])
136
136
 
137
137
  useNodesRef<WebView, WebViewProps>(props, ref, webViewRef, {
138
138
  style: defaultWebViewStyle
@@ -212,7 +212,7 @@ const _WebView = forwardRef<HandlerRef<WebView, WebViewProps>, WebViewProps>((pr
212
212
  { // case下不允许直接声明,包个块解决该问题
213
213
  const title = postData._documentTitle?.trim()
214
214
  if (title !== undefined) {
215
- navigation && navigation.setOptions({ title })
215
+ navigation && navigation.setPageConfig({ navigationBarTitleText: title })
216
216
  }
217
217
  }
218
218
  break
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.10.4-beta.2",
3
+ "version": "2.10.4-beta.3",
4
4
  "description": "mpx compile core",
5
5
  "keywords": [
6
6
  "mpx"