@momo-kits/foundation 0.92.29-optimize.11 → 0.92.29-optimize.14

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.
@@ -297,6 +297,7 @@ const HeaderRightAction: React.FC<any> = ({children, ...restProps}) => {
297
297
  const HeaderToolkitAction: React.FC<any> = ({
298
298
  tintColor,
299
299
  pinnedTool,
300
+ runtimeTools = [],
300
301
  preventClose,
301
302
  }) => {
302
303
  const {navigator} = useContext(ApplicationContext);
@@ -333,15 +334,13 @@ const HeaderToolkitAction: React.FC<any> = ({
333
334
  const onMore = () => {
334
335
  onAction?.('onMore');
335
336
  navigator?.maxApi?.dispatchFunction?.(
336
- 'showToolkit',
337
- {
338
- tools: miniContext?.toolkitConfig?.oldTools ?? [
339
- 'addFavorite',
340
- 'addShortcut',
341
- 'share',
342
- ],
343
- },
344
- () => {}
337
+ 'showTools',
338
+ {runtimeTools},
339
+ (res: {item: {action?: string; key: string}}) => {
340
+ const {item} = res;
341
+ navigator?.toolkitCallback?.(item.key);
342
+ getToolkitConfig();
343
+ }
345
344
  );
346
345
  };
347
346
 
@@ -386,7 +385,7 @@ const HeaderToolkitAction: React.FC<any> = ({
386
385
  onPress={() => {
387
386
  navigator?.maxApi?.dispatchFunction?.(
388
387
  'onToolAction',
389
- {item: pinTool},
388
+ [pinTool?.key],
390
389
  () => {
391
390
  getToolkitConfig();
392
391
  }
@@ -95,6 +95,8 @@ const StackScreen: React.FC<ScreenParams> = props => {
95
95
  const timeInteraction = useRef(0);
96
96
  const timeoutLoad = useRef<any>();
97
97
  const tracked = useRef<any>({
98
+ traceIdLoad: undefined,
99
+ traceIdInteraction: undefined,
98
100
  releaseLoad: undefined,
99
101
  releaseInteraction: undefined,
100
102
  timeoutLoad: undefined,
@@ -125,6 +127,15 @@ const StackScreen: React.FC<ScreenParams> = props => {
125
127
  if (options) {
126
128
  navigation.setOptions(options);
127
129
  }
130
+ navigator?.maxApi?.startTraceScreenLoad?.(screenName, (data: any) => {
131
+ tracked.current.traceIdLoad = data?.traceId;
132
+ });
133
+ navigator?.maxApi?.startTraceScreenInteraction?.(
134
+ screenName,
135
+ (data: any) => {
136
+ tracked.current.traceIdInteraction = data?.traceId;
137
+ }
138
+ );
128
139
  }, [options]);
129
140
 
130
141
  /**
@@ -170,6 +181,11 @@ const StackScreen: React.FC<ScreenParams> = props => {
170
181
  state: 'load',
171
182
  duration: timeLoad.current,
172
183
  });
184
+ navigator?.maxApi?.stopTrace?.(
185
+ tracked.current.traceIdLoad,
186
+ {value: timeLoad.current},
187
+ null
188
+ );
173
189
  navigator?.maxApi?.showToastDebug?.({
174
190
  appId: `auto - ${context.appId}`,
175
191
  message: `${screenName} screen_load_time ${timeLoad.current}`,
@@ -189,6 +205,13 @@ const StackScreen: React.FC<ScreenParams> = props => {
189
205
  if (timeLoad.current === 0) {
190
206
  timeLoad.current = endTime.current - startTime.current;
191
207
  }
208
+ if (timeInteraction.current === 0 && context.enableAutoId) {
209
+ if (context.enableAutoId) {
210
+ Alert.alert(screenName, "Can't get screen interaction time");
211
+ }
212
+ timeInteraction.current = timeLoad.current;
213
+ }
214
+
192
215
  context.autoTracking?.({
193
216
  appId: context.appId,
194
217
  code: context.code,
@@ -198,17 +221,15 @@ const StackScreen: React.FC<ScreenParams> = props => {
198
221
  state: 'interaction',
199
222
  duration: timeInteraction.current - timeLoad.current,
200
223
  });
201
-
224
+ navigator?.maxApi?.stopTrace?.(
225
+ tracked.current.traceIdInteraction,
226
+ {value: timeInteraction.current},
227
+ null
228
+ );
202
229
  navigator?.maxApi?.showToastDebug?.({
203
230
  appId: `auto - ${context.appId}`,
204
231
  message: `${screenName} screen_interaction_time ${timeInteraction.current}`,
205
232
  });
206
- if (
207
- timeInteraction.current - timeLoad.current <= 0 &&
208
- context.enableAutoId
209
- ) {
210
- Alert.alert(screenName, "Can't get screen interaction time");
211
- }
212
233
  tracked.current.releaseInteraction = true;
213
234
  }
214
235
  };
package/Input/styles.ts CHANGED
@@ -140,13 +140,13 @@ export default StyleSheet.create({
140
140
  marginTop: Spacing.M,
141
141
  },
142
142
  otpInput: {
143
- height: scaleSize(56),
143
+ height: 56,
144
144
  borderRadius: Radius.S,
145
145
  borderWidth: 1,
146
146
  },
147
147
  otpFloatingView: {
148
148
  position: 'absolute',
149
- top: scaleSize(-Spacing.M + 2),
149
+ top: -Spacing.M + 2,
150
150
  alignSelf: 'center',
151
151
  paddingHorizontal: Spacing.S,
152
152
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.92.29-optimize.11",
3
+ "version": "0.92.29-optimize.14",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},
@@ -43,4 +43,4 @@
43
43
  },
44
44
  "author": "@momo-kits/foundation",
45
45
  "license": "ISC"
46
- }
46
+ }
package/publish.sh CHANGED
@@ -1,13 +1,16 @@
1
1
  #!/bin/bash
2
2
 
3
3
  if [ "$1" == "stable" ]; then
4
-
4
+ npm version $(npm view @momo-kits/foundation@stable version)
5
+ npm version patch
5
6
  npm publish --tag stable --access=public
6
7
  elif [ "$1" == "latest" ]; then
7
-
8
+ npm version $(npm view @momo-kits/foundation@latest version)
9
+ npm version prerelease --preid=rc
8
10
  npm publish --tag latest --access=public
9
11
  else
10
-
12
+ # npm version $(npm view @momo-kits/foundation@beta version)
13
+ # npm version prerelease --preid=beta
11
14
  npm publish --tag beta --access=public
12
15
  fi
13
16