@momo-kits/foundation 0.121.3-tracking.4 → 0.121.3-tracking.6

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.
@@ -21,9 +21,7 @@ const MiniAppContext = (Platform as any).MiniAppContext ?? Context;
21
21
  const ScreenContext = (Platform as any).ScreenContext ?? Context;
22
22
  const ComponentContext = (Platform as any).ComponentContext ?? Context;
23
23
  const SkeletonContext = createContext({loading: false});
24
- const TrackingScopeContext = createContext<{scopeName?: string}>({
25
- scopeName: undefined,
26
- });
24
+ const TrackingScopeContext = (Platform as any).ComponentContext ?? Context;
27
25
 
28
26
  export {
29
27
  ApplicationContext,
@@ -175,11 +175,13 @@ const useComponentId = (componentName: string, accessibilityLabel?: string) => {
175
175
  const screen = useContext<any>(ScreenContext);
176
176
  const {scopeName} = useContext<any>(TrackingScopeContext);
177
177
 
178
+ const scope = scopeName ? `${scopeName}/` : '';
179
+
178
180
  const componentId = useMemo(() => {
179
181
  if (accessibilityLabel) {
180
182
  return accessibilityLabel;
181
183
  }
182
- return `${app.appId}/${app.code}/${screen.screenName}/${scopeName}/${componentName}`;
184
+ return `${app.appId}/${app.code}/${screen.screenName}/${scope}${componentName}`;
183
185
  }, [componentName, accessibilityLabel, app, screen]);
184
186
 
185
187
  return {componentId};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.121.3-tracking.4",
3
+ "version": "0.121.3-tracking.6",
4
4
  "minimumDeployTarget": 32,
5
5
  "deploymentTarget": 121,
6
6
  "description": "React Native Component Kits",