@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.
- package/lib/react/processJSON.js +7 -6
- package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.jsx +10 -8
- package/lib/runtime/components/react/dist/mpx-web-view.jsx +13 -13
- package/lib/runtime/components/react/mpx-keyboard-avoiding-view.tsx +12 -12
- package/lib/runtime/components/react/mpx-web-view.tsx +12 -12
- package/package.json +1 -1
package/lib/react/processJSON.js
CHANGED
|
@@ -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
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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 {
|
|
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 (
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
return (
|
|
89
|
+
// <GestureDetector gesture={gesture}>
|
|
90
|
+
<View style={style}>
|
|
91
|
+
<Animated.View style={[
|
|
91
92
|
contentContainerStyle,
|
|
92
93
|
animatedStyle
|
|
93
94
|
]}>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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.
|
|
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
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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.
|
|
215
|
+
navigation && navigation.setPageConfig({ navigationBarTitleText: title })
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
break
|