@momo-kits/foundation 0.81.7-beta.1 → 0.81.7-beta.10

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.
@@ -166,7 +166,9 @@ const HeaderLeft: React.FC<HeaderBackProps> = ({
166
166
 
167
167
  if (navigator?.trackingInfo) {
168
168
  navigator?.maxApi?.trackEvent('service_icon_clicked', {
169
- ...navigator?.trackingInfo,
169
+ feature_code: navigator.trackingInfo.code,
170
+ app_id: navigator.trackingInfo.appId,
171
+ miniapp_version: navigator.trackingInfo.buildNumber,
170
172
  screen_name: currentRoute?.params?.screen?.name ?? currentRoute?.name,
171
173
  trigger_id: '111154000000000000',
172
174
  icon_name: 'back',
@@ -192,6 +194,8 @@ const HeaderLeft: React.FC<HeaderBackProps> = ({
192
194
  } else {
193
195
  navigator?.ref.current?.goBack();
194
196
  }
197
+ } else if (navigator?.maxApi) {
198
+ navigator?.maxApi?.dismiss(navigator.dismissData);
195
199
  } else {
196
200
  const currentTime = new Date().getTime();
197
201
  const requestId = `navigationBackPress#${currentTime}`;
@@ -58,7 +58,6 @@ const Modal: React.FC<ModalParams> = props => {
58
58
  */
59
59
  useEffect(() => {
60
60
  if (navigator?.trackingInfo) {
61
- const TRIGGER_ID = '111012100000000000';
62
61
  const navigationRoutes = props.navigation.getState()?.routes || [];
63
62
  const routesLength = navigationRoutes.length;
64
63
  let screen_name = navigationRoutes?.[0]?.params?.screen?.name;
@@ -67,7 +66,9 @@ const Modal: React.FC<ModalParams> = props => {
67
66
  }
68
67
  const error_code = (screen as Function)?.()?.props?.information;
69
68
  navigator?.maxApi?.trackEvent('service_component_displayed', {
70
- ...navigator?.trackingInfo,
69
+ feature_code: navigator.trackingInfo.code,
70
+ app_id: navigator.trackingInfo.appId,
71
+ miniapp_version: navigator.trackingInfo.buildNumber,
71
72
  screen_name,
72
73
  trigger_id: '111012100000000000',
73
74
  component_type: 'popup',
@@ -77,7 +78,9 @@ const Modal: React.FC<ModalParams> = props => {
77
78
 
78
79
  return () => {
79
80
  navigator?.maxApi?.trackEvent('service_icon_clicked', {
80
- ...navigator?.trackingInfo,
81
+ feature_code: navigator?.trackingInfo?.code,
82
+ app_id: navigator?.trackingInfo?.appId,
83
+ miniapp_version: navigator?.trackingInfo?.buildNumber,
81
84
  screen_name,
82
85
  trigger_id: '111154100000000001',
83
86
  component_type: 'popup',
@@ -15,7 +15,7 @@ class Navigation {
15
15
  }
16
16
 
17
17
  /**
18
- * navigation options will be remove if used
18
+ * navigation options filter by design system rule
19
19
  * @param params
20
20
  */
21
21
  private filterParams = (params: NavigationOptions) => {
@@ -28,6 +28,12 @@ class Navigation {
28
28
  );
29
29
  }
30
30
  }
31
+
32
+ if (params.headerLeft) {
33
+ console.warn('headerLeft not allow override render by design system!');
34
+ delete params.headerLeft;
35
+ }
36
+
31
37
  return params;
32
38
  };
33
39
 
@@ -36,10 +42,7 @@ class Navigation {
36
42
  * @param params
37
43
  */
38
44
  setOptions = (params: NavigationOptions) => {
39
- if (__DEV__) {
40
- params = this.filterParams(params);
41
- }
42
- params = getOptions(params, this.theme);
45
+ params = getOptions(this.filterParams(params), this.theme);
43
46
  this.instance.setOptions(params);
44
47
  };
45
48
  }
@@ -12,6 +12,7 @@ class Navigator {
12
12
  toolkitConfig?: HeaderToolkitProps;
13
13
  maxApi?: any;
14
14
  trackingInfo?: TrackingInfo;
15
+ dismissData?: any;
15
16
 
16
17
  constructor(navigation: any) {
17
18
  this.ref = navigation;
@@ -38,7 +38,9 @@ const StackScreen: React.FC<ScreenParams> = props => {
38
38
  navigationRoutes[routesLength - 2]?.params?.screen?.name;
39
39
  }
40
40
  navigator?.maxApi?.trackEvent('service_frame_displayed', {
41
- ...navigator?.trackingInfo,
41
+ feature_code: navigator.trackingInfo.code,
42
+ app_id: navigator.trackingInfo.appId,
43
+ miniapp_version: navigator.trackingInfo.buildNumber,
42
44
  screen_name: Component.name,
43
45
  pre_screen_name,
44
46
  trigger_id: '111378000000000000',
@@ -81,9 +81,9 @@ export type LocalizationObject = {
81
81
 
82
82
  export type TrackingInfo = {
83
83
  [key: string]: any;
84
- feature_code: string;
85
- app_id: string;
86
- miniapp_version: number;
84
+ code: string;
85
+ appId: string;
86
+ buildNumber: number;
87
87
  };
88
88
 
89
89
  export type NavigationContainerProps = {
@@ -105,7 +105,6 @@ export type ScreenParams = {
105
105
  [key: string]: any;
106
106
  screen: Screen;
107
107
  options?: NavigationOptions;
108
- tracking?: any;
109
108
  };
110
109
 
111
110
  export interface ModalParams extends ScreenParams {
@@ -153,9 +153,9 @@ const Spacing = {
153
153
  L: 16,
154
154
  XL: 24,
155
155
  XXL: 32,
156
- Size48: 48,
157
- Size56: 56,
158
- Size64: 64,
156
+ Size3XL: 48,
157
+ Size4XL: 56,
158
+ Size5XL: 64,
159
159
  };
160
160
 
161
161
  const Radius = {
@@ -5,11 +5,6 @@ import {GridContext} from './index';
5
5
  import styles from './styles';
6
6
 
7
7
  export interface ItemSectionListProps extends SectionListProps<any> {
8
- /**
9
- * Require key support number columns change grid system
10
- */
11
-
12
- key: string;
13
8
  /**
14
9
  * Represents the width of the Card component in terms of span numbers (1-12).
15
10
  */
@@ -17,7 +12,6 @@ export interface ItemSectionListProps extends SectionListProps<any> {
17
12
  }
18
13
 
19
14
  const ItemSectionList: FC<ItemSectionListProps> = ({
20
- key,
21
15
  renderItem,
22
16
  widthSpan,
23
17
  style,
package/Layout/index.ts CHANGED
@@ -6,6 +6,7 @@ import {createContext} from 'react';
6
6
  import {GridContextProps} from './types';
7
7
  import Item from './Item';
8
8
  import ItemList from './ItemList';
9
+ import ItemSectionList from './ItemSectionList';
9
10
 
10
11
  const GridContext = createContext<GridContextProps>({
11
12
  numberOfColumns: 12,
@@ -23,4 +24,5 @@ export {
23
24
  validateChildren,
24
25
  Item,
25
26
  ItemList,
27
+ ItemSectionList,
26
28
  };
package/Title/index.tsx CHANGED
@@ -69,6 +69,7 @@ const Title: FC<TitleProps> = ({
69
69
  styles.title,
70
70
  {
71
71
  fontFamily: `${theme.font}-${titleWeight}`,
72
+ color: theme.colors.text.default,
72
73
  },
73
74
  ]}>
74
75
  {title}
package/Title/styles.ts CHANGED
@@ -4,6 +4,10 @@ import {Radius, Spacing} from '../Consts';
4
4
 
5
5
  export default StyleSheet.create({
6
6
  card_small: {
7
+ fontSize: scaleSize(14),
8
+ lineHeight: scaleSize(20),
9
+ },
10
+ card_medium: {
7
11
  fontSize: scaleSize(16),
8
12
  lineHeight: scaleSize(22),
9
13
  },
@@ -11,10 +15,14 @@ export default StyleSheet.create({
11
15
  fontSize: scaleSize(18),
12
16
  lineHeight: scaleSize(26),
13
17
  },
14
- section_small: {
18
+ section_medium: {
15
19
  fontSize: scaleSize(20),
16
20
  lineHeight: scaleSize(28),
17
21
  },
22
+ section_small: {
23
+ fontSize: scaleSize(16),
24
+ lineHeight: scaleSize(22),
25
+ },
18
26
  section_large: {
19
27
  fontSize: scaleSize(24),
20
28
  lineHeight: scaleSize(34),
package/Title/types.ts CHANGED
@@ -22,7 +22,7 @@ export type TitleProps = {
22
22
  * 'large' - A larger, more prominent title.
23
23
  * 'small' - A smaller, less prominent title.
24
24
  */
25
- size?: 'large' | 'small';
25
+ size?: 'large' | 'medium' | 'small';
26
26
 
27
27
  /**
28
28
  * Optional. Represents the name or key of the icon to be displayed alongside the title.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.81.7-beta.1",
3
+ "version": "0.81.7-beta.10",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {