@bbearai/react-native 0.10.2 → 0.10.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/dist/index.d.mts CHANGED
@@ -84,6 +84,8 @@ interface BugBearContextValue {
84
84
  success: boolean;
85
85
  error?: string;
86
86
  }>;
87
+ /** Track a navigation event (call from React Navigation's onStateChange) */
88
+ trackNavigation: (routeName: string) => void;
87
89
  /** Number of queued offline operations waiting to be sent. */
88
90
  queuedCount: number;
89
91
  /** URL to the BugBear web dashboard (for linking testers to the full web experience) */
package/dist/index.d.ts CHANGED
@@ -84,6 +84,8 @@ interface BugBearContextValue {
84
84
  success: boolean;
85
85
  error?: string;
86
86
  }>;
87
+ /** Track a navigation event (call from React Navigation's onStateChange) */
88
+ trackNavigation: (routeName: string) => void;
87
89
  /** Number of queued offline operations waiting to be sent. */
88
90
  queuedCount: number;
89
91
  /** URL to the BugBear web dashboard (for linking testers to the full web experience) */
package/dist/index.js CHANGED
@@ -14826,6 +14826,8 @@ var BugBearContext = (0, import_react.createContext)({
14826
14826
  refreshIssueCounts: async () => {
14827
14827
  },
14828
14828
  reopenReport: async () => ({ success: false }),
14829
+ trackNavigation: () => {
14830
+ },
14829
14831
  queuedCount: 0,
14830
14832
  dashboardUrl: void 0,
14831
14833
  onError: void 0
@@ -14940,8 +14942,11 @@ function BugBearProvider({ config, children, appVersion, enabled = true }) {
14940
14942
  const enhanced = contextCapture.getEnhancedContext();
14941
14943
  const enriched = {
14942
14944
  ...options,
14945
+ route: options.route ?? contextCapture.getCurrentRoute?.(),
14943
14946
  consoleLogs: options.consoleLogs ?? enhanced.consoleLogs,
14944
- networkSnapshot: options.networkSnapshot ?? enhanced.networkRequests
14947
+ networkSnapshot: options.networkSnapshot ?? enhanced.networkRequests,
14948
+ appContext: options.appContext ?? client.getAppContext(),
14949
+ deviceInfo: options.deviceInfo ?? getDeviceInfo()
14945
14950
  };
14946
14951
  const result = await client.addFinding(activeSession.id, enriched);
14947
14952
  if (result.success && result.finding) {
@@ -14949,7 +14954,10 @@ function BugBearProvider({ config, children, appVersion, enabled = true }) {
14949
14954
  setActiveSession((prev) => prev ? { ...prev, findingsCount: prev.findingsCount + 1 } : null);
14950
14955
  }
14951
14956
  return result;
14952
- }, [client, activeSession]);
14957
+ }, [client, activeSession, getDeviceInfo]);
14958
+ const trackNavigation = (0, import_react.useCallback)((routeName) => {
14959
+ if (client) client.trackNavigation(routeName);
14960
+ }, [client]);
14953
14961
  const updateTesterProfile = (0, import_react.useCallback)(async (updates) => {
14954
14962
  if (!client) return { success: false, error: "Client not initialized" };
14955
14963
  const result = await client.updateTesterProfile(updates);
@@ -15227,6 +15235,7 @@ function BugBearProvider({ config, children, appVersion, enabled = true }) {
15227
15235
  issueCounts,
15228
15236
  refreshIssueCounts,
15229
15237
  reopenReport,
15238
+ trackNavigation,
15230
15239
  queuedCount,
15231
15240
  dashboardUrl: config.dashboardUrl,
15232
15241
  onError: config.onError
package/dist/index.mjs CHANGED
@@ -14793,6 +14793,8 @@ var BugBearContext = createContext({
14793
14793
  refreshIssueCounts: async () => {
14794
14794
  },
14795
14795
  reopenReport: async () => ({ success: false }),
14796
+ trackNavigation: () => {
14797
+ },
14796
14798
  queuedCount: 0,
14797
14799
  dashboardUrl: void 0,
14798
14800
  onError: void 0
@@ -14907,8 +14909,11 @@ function BugBearProvider({ config, children, appVersion, enabled = true }) {
14907
14909
  const enhanced = contextCapture.getEnhancedContext();
14908
14910
  const enriched = {
14909
14911
  ...options,
14912
+ route: options.route ?? contextCapture.getCurrentRoute?.(),
14910
14913
  consoleLogs: options.consoleLogs ?? enhanced.consoleLogs,
14911
- networkSnapshot: options.networkSnapshot ?? enhanced.networkRequests
14914
+ networkSnapshot: options.networkSnapshot ?? enhanced.networkRequests,
14915
+ appContext: options.appContext ?? client.getAppContext(),
14916
+ deviceInfo: options.deviceInfo ?? getDeviceInfo()
14912
14917
  };
14913
14918
  const result = await client.addFinding(activeSession.id, enriched);
14914
14919
  if (result.success && result.finding) {
@@ -14916,7 +14921,10 @@ function BugBearProvider({ config, children, appVersion, enabled = true }) {
14916
14921
  setActiveSession((prev) => prev ? { ...prev, findingsCount: prev.findingsCount + 1 } : null);
14917
14922
  }
14918
14923
  return result;
14919
- }, [client, activeSession]);
14924
+ }, [client, activeSession, getDeviceInfo]);
14925
+ const trackNavigation = useCallback((routeName) => {
14926
+ if (client) client.trackNavigation(routeName);
14927
+ }, [client]);
14920
14928
  const updateTesterProfile = useCallback(async (updates) => {
14921
14929
  if (!client) return { success: false, error: "Client not initialized" };
14922
14930
  const result = await client.updateTesterProfile(updates);
@@ -15194,6 +15202,7 @@ function BugBearProvider({ config, children, appVersion, enabled = true }) {
15194
15202
  issueCounts,
15195
15203
  refreshIssueCounts,
15196
15204
  reopenReport,
15205
+ trackNavigation,
15197
15206
  queuedCount,
15198
15207
  dashboardUrl: config.dashboardUrl,
15199
15208
  onError: config.onError
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbearai/react-native",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "description": "BugBear React Native components for mobile apps",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",