@momo-kits/foundation 0.92.29-optimize.17 → 0.92.29-optimize.18
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/Application/Components.tsx +1 -3
- package/Application/StackScreen.tsx +18 -30
- package/Layout/Screen.tsx +1 -1
- package/package.json +1 -1
|
@@ -405,9 +405,7 @@ const HeaderToolkitAction: React.FC<any> = ({
|
|
|
405
405
|
};
|
|
406
406
|
|
|
407
407
|
const renderPinnedTool = () => {
|
|
408
|
-
const pinKey =
|
|
409
|
-
miniContext?.toolkitConfig?.pinnedTool?.key ||
|
|
410
|
-
toolConfig?.pinnedTool?.key;
|
|
408
|
+
const pinKey = pinnedTool?.key || toolConfig?.pinnedTool?.key;
|
|
411
409
|
const pinTool = toolConfig?.tools?.find((i: any) => i.key === pinKey);
|
|
412
410
|
const {badgeValue, badgeType} = pinnedTool ?? {};
|
|
413
411
|
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import React, {useContext, useEffect, useLayoutEffect, useRef} from 'react';
|
|
2
2
|
import {useHeaderHeight} from '@react-navigation/stack';
|
|
3
|
-
import {
|
|
4
|
-
Alert,
|
|
5
|
-
InteractionManager,
|
|
6
|
-
Linking,
|
|
7
|
-
NativeModules,
|
|
8
|
-
View,
|
|
9
|
-
} from 'react-native';
|
|
3
|
+
import {Alert, InteractionManager, Linking, View} from 'react-native';
|
|
10
4
|
import {ScreenParams} from './types';
|
|
11
5
|
import Navigation from './Navigation';
|
|
12
6
|
import {ApplicationContext, MiniAppContext, ScreenContext} from './index';
|
|
@@ -110,7 +104,6 @@ const StackScreen: React.FC<ScreenParams> = props => {
|
|
|
110
104
|
});
|
|
111
105
|
const interaction = useRef<any>();
|
|
112
106
|
const context = useContext<any>(MiniAppContext);
|
|
113
|
-
|
|
114
107
|
const {screen: Component, options, initialParams} = props.route.params;
|
|
115
108
|
const navigation = new Navigation(props.navigation);
|
|
116
109
|
const heightHeader = useHeaderHeight();
|
|
@@ -162,13 +155,7 @@ const StackScreen: React.FC<ScreenParams> = props => {
|
|
|
162
155
|
navigator?.showModal({screen: EmptyScreen});
|
|
163
156
|
}, 300);
|
|
164
157
|
}
|
|
165
|
-
|
|
166
158
|
navigator?.maxApi?.of?.({screenName});
|
|
167
|
-
NativeModules?.MiniAppModule?.setScreenName?.(
|
|
168
|
-
context.hostId ?? '',
|
|
169
|
-
screenName ?? ''
|
|
170
|
-
);
|
|
171
|
-
|
|
172
159
|
tracked.current.timeoutLoad = setTimeout(() => {
|
|
173
160
|
onScreenLoad();
|
|
174
161
|
}, 5000);
|
|
@@ -191,23 +178,13 @@ const StackScreen: React.FC<ScreenParams> = props => {
|
|
|
191
178
|
if (!tracked.current?.releaseLoad) {
|
|
192
179
|
if (timeLoad.current === 0) {
|
|
193
180
|
timeLoad.current = endTime.current - startTime.current;
|
|
194
|
-
if (context.enableAutoId) {
|
|
195
|
-
Alert.alert(screenName, "Can't get screen load time");
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
const container = NativeModules?.MiniAppModule?.getPreviousContainer?.();
|
|
199
|
-
const routes = props.navigation.getState()?.routes || [];
|
|
200
|
-
const routesLength = routes?.length ?? 0;
|
|
201
|
-
let preScreenName = container?.screenName;
|
|
202
|
-
if (routesLength > 1) {
|
|
203
|
-
preScreenName = routes?.[routesLength - 2]?.params?.screen?.name;
|
|
204
181
|
}
|
|
182
|
+
|
|
205
183
|
context.autoTracking?.({
|
|
206
184
|
appId: context.appId,
|
|
207
185
|
code: context.code,
|
|
208
186
|
buildNumber: context.buildNumber,
|
|
209
187
|
screenName,
|
|
210
|
-
preScreenName,
|
|
211
188
|
action: 'push',
|
|
212
189
|
componentName: 'Screen',
|
|
213
190
|
state: 'load',
|
|
@@ -218,11 +195,18 @@ const StackScreen: React.FC<ScreenParams> = props => {
|
|
|
218
195
|
{value: timeLoad.current / 1000},
|
|
219
196
|
null
|
|
220
197
|
);
|
|
198
|
+
tracked.current.releaseLoad = true;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* debug
|
|
202
|
+
*/
|
|
221
203
|
navigator?.maxApi?.showToastDebug?.({
|
|
222
204
|
appId: `auto - ${context.appId}`,
|
|
223
205
|
message: `${screenName} screen_load_time ${timeLoad.current}`,
|
|
224
206
|
});
|
|
225
|
-
|
|
207
|
+
if (timeLoad.current <= 0 && context.enableAutoId) {
|
|
208
|
+
Alert.alert(screenName, "Can't get screen load time");
|
|
209
|
+
}
|
|
226
210
|
}
|
|
227
211
|
};
|
|
228
212
|
|
|
@@ -236,9 +220,6 @@ const StackScreen: React.FC<ScreenParams> = props => {
|
|
|
236
220
|
}
|
|
237
221
|
if (timeInteraction.current === 0) {
|
|
238
222
|
timeInteraction.current = timeLoad.current;
|
|
239
|
-
if (context.enableAutoId) {
|
|
240
|
-
Alert.alert(screenName, "Can't get screen interaction time");
|
|
241
|
-
}
|
|
242
223
|
}
|
|
243
224
|
|
|
244
225
|
context.autoTracking?.({
|
|
@@ -255,11 +236,18 @@ const StackScreen: React.FC<ScreenParams> = props => {
|
|
|
255
236
|
{value: timeInteraction.current / 1000},
|
|
256
237
|
null
|
|
257
238
|
);
|
|
239
|
+
tracked.current.releaseInteraction = true;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* debug toast
|
|
243
|
+
*/
|
|
258
244
|
navigator?.maxApi?.showToastDebug?.({
|
|
259
245
|
appId: `auto - ${context.appId}`,
|
|
260
246
|
message: `${screenName} screen_interaction_time ${timeInteraction.current}`,
|
|
261
247
|
});
|
|
262
|
-
|
|
248
|
+
if (timeInteraction.current <= 0 && context.enableAutoId) {
|
|
249
|
+
Alert.alert(screenName, "Can't get screen interaction time");
|
|
250
|
+
}
|
|
263
251
|
}
|
|
264
252
|
};
|
|
265
253
|
|
package/Layout/Screen.tsx
CHANGED
|
@@ -145,7 +145,7 @@ const Screen = forwardRef(
|
|
|
145
145
|
let handleScroll;
|
|
146
146
|
let Component: any = View;
|
|
147
147
|
let keyboardOffset = heightHeader - 20;
|
|
148
|
-
if (headerType === 'extended' || animatedHeader) {
|
|
148
|
+
if (headerType === 'extended' || animatedHeader || inputSearchProps) {
|
|
149
149
|
keyboardOffset = -20;
|
|
150
150
|
}
|
|
151
151
|
|