react-native-inapp-inspector 1.1.14 → 1.1.15
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/README.md +9 -34
- package/dist/commonjs/assets/svgAssets.d.ts +3 -0
- package/dist/commonjs/assets/svgAssets.js +17 -0
- package/dist/commonjs/components/AnalyticsEventCard.d.ts +1 -14
- package/dist/commonjs/components/AnalyticsEventCard.js +34 -51
- package/dist/commonjs/components/AnalyticsGraph.d.ts +2 -6
- package/dist/commonjs/components/AnalyticsGraph.js +8 -8
- package/dist/commonjs/components/AnalyticsTabView.d.ts +15 -0
- package/dist/commonjs/components/AnalyticsTabView.js +157 -0
- package/dist/commonjs/components/AnimatedEntrance.d.ts +1 -1
- package/dist/commonjs/components/AnimatedEntrance.js +2 -2
- package/dist/commonjs/components/ApiDetailView.d.ts +22 -0
- package/dist/commonjs/components/ApiDetailView.js +304 -0
- package/dist/commonjs/components/ApisTabView.d.ts +33 -0
- package/dist/commonjs/components/ApisTabView.js +235 -0
- package/dist/commonjs/components/CodeSnippet.d.ts +1 -5
- package/dist/commonjs/components/CodeSnippet.js +34 -34
- package/dist/commonjs/components/ConsoleLogCard.d.ts +1 -8
- package/dist/commonjs/components/ConsoleLogCard.js +262 -442
- package/dist/commonjs/components/ConsoleLogDetailView.d.ts +9 -0
- package/dist/commonjs/components/ConsoleLogDetailView.js +278 -0
- package/dist/commonjs/components/ConsoleLogsTabView.d.ts +24 -0
- package/dist/commonjs/components/ConsoleLogsTabView.js +354 -0
- package/dist/commonjs/components/DiffViewer.js +4 -2
- package/dist/commonjs/components/DomainHeader.js +66 -41
- package/dist/commonjs/components/EmptyState.d.ts +2 -2
- package/dist/commonjs/components/EmptyState.js +2 -2
- package/dist/commonjs/components/EndOfListFooter.d.ts +8 -0
- package/dist/commonjs/components/EndOfListFooter.js +90 -0
- package/dist/commonjs/components/ErrorBoundary.d.ts +5 -14
- package/dist/commonjs/components/ErrorBoundary.js +28 -28
- package/dist/commonjs/components/FloatingBubble.d.ts +14 -0
- package/dist/commonjs/components/FloatingBubble.js +75 -0
- package/dist/commonjs/components/HeadersSection.js +5 -3
- package/dist/commonjs/components/HighlightText.d.ts +1 -1
- package/dist/commonjs/components/HighlightText.js +5 -7
- package/dist/commonjs/components/Inspector/AnalyticsTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +232 -0
- package/dist/commonjs/components/Inspector/ConsoleTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/ConsoleTab.js +410 -0
- package/dist/commonjs/components/Inspector/FabLauncher.d.ts +3 -0
- package/dist/commonjs/components/Inspector/FabLauncher.js +54 -0
- package/dist/commonjs/components/Inspector/InsightsDashboard.d.ts +3 -0
- package/dist/commonjs/components/Inspector/InsightsDashboard.js +619 -0
- package/dist/commonjs/components/Inspector/InspectorContext.d.ts +5 -0
- package/dist/commonjs/components/Inspector/InspectorContext.js +18 -0
- package/dist/commonjs/components/Inspector/InspectorHeader.d.ts +3 -0
- package/dist/commonjs/components/Inspector/InspectorHeader.js +452 -0
- package/dist/commonjs/components/Inspector/LogDetail.d.ts +3 -0
- package/dist/commonjs/components/Inspector/LogDetail.js +963 -0
- package/dist/commonjs/components/Inspector/MainScreen.d.ts +3 -0
- package/dist/commonjs/components/Inspector/MainScreen.js +68 -0
- package/dist/commonjs/components/Inspector/NavigationTracker.d.ts +3 -0
- package/dist/commonjs/components/Inspector/NavigationTracker.js +12 -0
- package/dist/commonjs/components/Inspector/NetworkDetail.d.ts +3 -0
- package/dist/commonjs/components/Inspector/NetworkDetail.js +405 -0
- package/dist/commonjs/components/Inspector/NetworkTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/NetworkTab.js +281 -0
- package/dist/commonjs/components/Inspector/ReduxTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/ReduxTab.js +75 -0
- package/dist/commonjs/components/Inspector/SettingsPanel.d.ts +3 -0
- package/dist/commonjs/components/Inspector/SettingsPanel.js +1476 -0
- package/dist/commonjs/components/Inspector/TabBar.d.ts +3 -0
- package/dist/commonjs/components/Inspector/TabBar.js +95 -0
- package/dist/commonjs/components/Inspector/WebViewTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/WebViewTab.js +757 -0
- package/dist/commonjs/components/InspectorHeader.d.ts +19 -0
- package/dist/commonjs/components/InspectorHeader.js +329 -0
- package/dist/commonjs/components/InspectorTabBar.d.ts +16 -0
- package/dist/commonjs/components/InspectorTabBar.js +90 -0
- package/dist/commonjs/components/JsonViewer.d.ts +4 -1
- package/dist/commonjs/components/JsonViewer.js +110 -171
- package/dist/commonjs/components/LogCard.js +109 -86
- package/dist/commonjs/components/MetaAccordion.d.ts +1 -10
- package/dist/commonjs/components/MetaAccordion.js +23 -21
- package/dist/commonjs/components/NavigationTracker.d.ts +7 -0
- package/dist/commonjs/components/NavigationTracker.js +76 -0
- package/dist/commonjs/components/NetworkIcons.d.ts +6 -0
- package/dist/commonjs/components/NetworkIcons.js +54 -8
- package/dist/commonjs/components/ReduxTabView.d.ts +9 -0
- package/dist/commonjs/components/ReduxTabView.js +56 -0
- package/dist/commonjs/components/ReduxTreeView.js +241 -200
- package/dist/commonjs/components/SegmentedTabs.d.ts +15 -0
- package/dist/commonjs/components/SegmentedTabs.js +52 -0
- package/dist/commonjs/components/SettingsView.d.ts +13 -0
- package/dist/commonjs/components/SettingsView.js +328 -0
- package/dist/commonjs/components/TouchableScale.d.ts +2 -2
- package/dist/commonjs/components/TouchableScale.js +2 -2
- package/dist/commonjs/components/TreeNode.js +2 -2
- package/dist/commonjs/constants/index.js +1 -12
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/consoleLogger.js +137 -13
- package/dist/commonjs/customHooks/networkLogger.d.ts +0 -1
- package/dist/commonjs/customHooks/networkLogger.js +0 -1
- package/dist/commonjs/customHooks/reduxLogger.d.ts +2 -9
- package/dist/commonjs/enums/index.d.ts +39 -0
- package/dist/commonjs/enums/index.js +50 -0
- package/dist/commonjs/helpers/index.d.ts +27 -1
- package/dist/commonjs/helpers/index.js +187 -12
- package/dist/commonjs/helpers/settingsStore.d.ts +2 -24
- package/dist/commonjs/i18n/en.json +144 -0
- package/dist/commonjs/i18n/index.d.ts +2 -0
- package/dist/commonjs/i18n/index.js +27 -0
- package/dist/commonjs/i18n/locales/en.json +314 -0
- package/dist/commonjs/index.d.ts +1 -2
- package/dist/commonjs/index.js +196 -4800
- package/dist/commonjs/styles/AppColors.d.ts +148 -0
- package/dist/commonjs/styles/AppColors.js +176 -0
- package/dist/commonjs/styles/common.d.ts +3 -0
- package/dist/commonjs/styles/common.js +201 -0
- package/dist/commonjs/styles/index.d.ts +167 -442
- package/dist/commonjs/styles/index.js +239 -471
- package/dist/commonjs/types/enums.d.ts +9 -0
- package/dist/commonjs/types/enums.js +4 -0
- package/dist/commonjs/types/index.d.ts +4 -111
- package/dist/commonjs/types/index.js +16 -0
- package/dist/commonjs/types/interfaces.d.ts +337 -0
- package/dist/commonjs/types/interfaces.js +2 -0
- package/dist/esm/assets/svgAssets.d.ts +3 -0
- package/dist/esm/assets/svgAssets.js +14 -0
- package/dist/esm/components/AnalyticsEventCard.d.ts +1 -14
- package/dist/esm/components/AnalyticsEventCard.js +32 -49
- package/dist/esm/components/AnalyticsGraph.d.ts +2 -6
- package/dist/esm/components/AnalyticsGraph.js +8 -8
- package/dist/esm/components/AnalyticsTabView.d.ts +15 -0
- package/dist/esm/components/AnalyticsTabView.js +151 -0
- package/dist/esm/components/AnimatedEntrance.d.ts +1 -1
- package/dist/esm/components/AnimatedEntrance.js +2 -2
- package/dist/esm/components/ApiDetailView.d.ts +22 -0
- package/dist/esm/components/ApiDetailView.js +264 -0
- package/dist/esm/components/ApisTabView.d.ts +33 -0
- package/dist/esm/components/ApisTabView.js +196 -0
- package/dist/esm/components/CodeSnippet.d.ts +1 -5
- package/dist/esm/components/CodeSnippet.js +34 -34
- package/dist/esm/components/ConsoleLogCard.d.ts +1 -8
- package/dist/esm/components/ConsoleLogCard.js +262 -409
- package/dist/esm/components/ConsoleLogDetailView.d.ts +9 -0
- package/dist/esm/components/ConsoleLogDetailView.js +271 -0
- package/dist/esm/components/ConsoleLogsTabView.d.ts +24 -0
- package/dist/esm/components/ConsoleLogsTabView.js +348 -0
- package/dist/esm/components/DiffViewer.js +4 -2
- package/dist/esm/components/DomainHeader.js +66 -41
- package/dist/esm/components/EmptyState.d.ts +2 -2
- package/dist/esm/components/EmptyState.js +2 -2
- package/dist/esm/components/EndOfListFooter.d.ts +8 -0
- package/dist/esm/components/EndOfListFooter.js +83 -0
- package/dist/esm/components/ErrorBoundary.d.ts +5 -14
- package/dist/esm/components/ErrorBoundary.js +29 -29
- package/dist/esm/components/FloatingBubble.d.ts +14 -0
- package/dist/esm/components/FloatingBubble.js +68 -0
- package/dist/esm/components/HeadersSection.js +5 -3
- package/dist/esm/components/HighlightText.d.ts +1 -1
- package/dist/esm/components/HighlightText.js +5 -7
- package/dist/esm/components/Inspector/AnalyticsTab.d.ts +3 -0
- package/dist/esm/components/Inspector/AnalyticsTab.js +194 -0
- package/dist/esm/components/Inspector/ConsoleTab.d.ts +3 -0
- package/dist/esm/components/Inspector/ConsoleTab.js +372 -0
- package/dist/esm/components/Inspector/FabLauncher.d.ts +3 -0
- package/dist/esm/components/Inspector/FabLauncher.js +49 -0
- package/dist/esm/components/Inspector/InsightsDashboard.d.ts +3 -0
- package/dist/esm/components/Inspector/InsightsDashboard.js +614 -0
- package/dist/esm/components/Inspector/InspectorContext.d.ts +5 -0
- package/dist/esm/components/Inspector/InspectorContext.js +13 -0
- package/dist/esm/components/Inspector/InspectorHeader.d.ts +3 -0
- package/dist/esm/components/Inspector/InspectorHeader.js +447 -0
- package/dist/esm/components/Inspector/LogDetail.d.ts +3 -0
- package/dist/esm/components/Inspector/LogDetail.js +925 -0
- package/dist/esm/components/Inspector/MainScreen.d.ts +3 -0
- package/dist/esm/components/Inspector/MainScreen.js +63 -0
- package/dist/esm/components/Inspector/NavigationTracker.d.ts +3 -0
- package/dist/esm/components/Inspector/NavigationTracker.js +10 -0
- package/dist/esm/components/Inspector/NetworkDetail.d.ts +3 -0
- package/dist/esm/components/Inspector/NetworkDetail.js +367 -0
- package/dist/esm/components/Inspector/NetworkTab.d.ts +3 -0
- package/dist/esm/components/Inspector/NetworkTab.js +243 -0
- package/dist/esm/components/Inspector/ReduxTab.d.ts +3 -0
- package/dist/esm/components/Inspector/ReduxTab.js +70 -0
- package/dist/esm/components/Inspector/SettingsPanel.d.ts +3 -0
- package/dist/esm/components/Inspector/SettingsPanel.js +1438 -0
- package/dist/esm/components/Inspector/TabBar.d.ts +3 -0
- package/dist/esm/components/Inspector/TabBar.js +90 -0
- package/dist/esm/components/Inspector/WebViewTab.d.ts +3 -0
- package/dist/esm/components/Inspector/WebViewTab.js +752 -0
- package/dist/esm/components/InspectorHeader.d.ts +19 -0
- package/dist/esm/components/InspectorHeader.js +323 -0
- package/dist/esm/components/InspectorTabBar.d.ts +16 -0
- package/dist/esm/components/InspectorTabBar.js +84 -0
- package/dist/esm/components/JsonViewer.d.ts +4 -1
- package/dist/esm/components/JsonViewer.js +111 -172
- package/dist/esm/components/LogCard.js +111 -88
- package/dist/esm/components/MetaAccordion.d.ts +1 -10
- package/dist/esm/components/MetaAccordion.js +23 -21
- package/dist/esm/components/NavigationTracker.d.ts +7 -0
- package/dist/esm/components/NavigationTracker.js +39 -0
- package/dist/esm/components/NetworkIcons.d.ts +6 -0
- package/dist/esm/components/NetworkIcons.js +46 -6
- package/dist/esm/components/ReduxTabView.d.ts +9 -0
- package/dist/esm/components/ReduxTabView.js +50 -0
- package/dist/esm/components/ReduxTreeView.js +243 -202
- package/dist/esm/components/SegmentedTabs.d.ts +15 -0
- package/dist/esm/components/SegmentedTabs.js +47 -0
- package/dist/esm/components/SettingsView.d.ts +13 -0
- package/dist/esm/components/SettingsView.js +321 -0
- package/dist/esm/components/TouchableScale.d.ts +2 -2
- package/dist/esm/components/TouchableScale.js +2 -2
- package/dist/esm/components/TreeNode.js +2 -2
- package/dist/esm/constants/index.js +1 -12
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/consoleLogger.js +137 -13
- package/dist/esm/customHooks/networkLogger.d.ts +0 -1
- package/dist/esm/customHooks/networkLogger.js +0 -1
- package/dist/esm/customHooks/reduxLogger.d.ts +2 -9
- package/dist/esm/enums/index.d.ts +39 -0
- package/dist/esm/enums/index.js +47 -0
- package/dist/esm/helpers/index.d.ts +27 -1
- package/dist/esm/helpers/index.js +180 -11
- package/dist/esm/helpers/settingsStore.d.ts +2 -24
- package/dist/esm/i18n/en.json +144 -0
- package/dist/esm/i18n/index.d.ts +2 -0
- package/dist/esm/i18n/index.js +22 -0
- package/dist/esm/i18n/locales/en.json +314 -0
- package/dist/esm/index.d.ts +1 -2
- package/dist/esm/index.js +200 -4796
- package/dist/esm/styles/AppColors.d.ts +148 -0
- package/dist/esm/styles/AppColors.js +176 -0
- package/dist/esm/styles/common.d.ts +3 -0
- package/dist/esm/styles/common.js +197 -0
- package/dist/esm/styles/index.d.ts +167 -442
- package/dist/esm/styles/index.js +239 -471
- package/dist/esm/types/enums.d.ts +9 -0
- package/dist/esm/types/enums.js +3 -0
- package/dist/esm/types/index.d.ts +4 -111
- package/dist/esm/types/index.js +2 -1
- package/dist/esm/types/interfaces.d.ts +337 -0
- package/dist/esm/types/interfaces.js +1 -0
- package/example/App.tsx +88 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<a href="https://github.com/vengatmacuser/react-native-inapp-inspector"><img src="https://img.shields.io/badge/platform-iOS%20%7C%20Android-blue" alt="platform" /></a>
|
|
15
15
|
</p>
|
|
16
16
|
|
|
17
|
-
A self-contained in-app debugging overlay for React Native. Inspect network traffic, console output, analytics events, Redux state
|
|
17
|
+
A self-contained in-app debugging overlay for React Native. Inspect network traffic, console output, analytics events, and Redux state directly inside your app.
|
|
18
18
|
|
|
19
19
|
<p align="center">
|
|
20
20
|
<img src="https://raw.githubusercontent.com/vengatmacuser/react-native-inapp-inspector/main/assets/walkthrough.gif" alt="React Native In-App Inspector Walkthrough" width="360" style="border-radius: 20px;" />
|
|
@@ -27,11 +27,9 @@ A self-contained in-app debugging overlay for React Native. Inspect network traf
|
|
|
27
27
|
| Feature | Description |
|
|
28
28
|
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
29
29
|
| Network inspector | Captures `fetch` and axios `GET`, `POST`, `PUT`, `PATCH`, and `DELETE` calls with URL, method, status, headers, body, response, duration, caller, cURL, and fetch snippets. |
|
|
30
|
-
| Insights dashboard | Shows request totals, status breakdowns, latency, payload size, slow requests, and recent activity charts. |
|
|
31
30
|
| Console logger | Captures `console.log`, `console.info`, `console.warn`, and `console.error` with source method and caller details. |
|
|
32
31
|
| Analytics tracker | Captures manual analytics events and patched `@react-native-firebase/analytics` calls including `logEvent`, `logScreenView`, user properties, and user id. |
|
|
33
32
|
| Redux inspector | Connects to a Redux store, displays the live state tree, tracks dispatched actions, affected slices, and action history. |
|
|
34
|
-
| WebView inspector | Provides an instrumented `WebView` with console capture, navigation history, HTML/CSS/JS snapshots, and optional loading overlay. |
|
|
35
33
|
| Error boundary | Exports an `ErrorBoundary` for catching React errors and wrapping the inspector safely. |
|
|
36
34
|
|
|
37
35
|
---
|
|
@@ -54,10 +52,10 @@ yarn add -D react-native-inapp-inspector axios
|
|
|
54
52
|
|
|
55
53
|
The package has React and React Native as peer dependencies. It depends on `@react-navigation/native`, `react-native-linear-gradient`, and `react-native-svg`. The current network logger imports `axios` for axios interception, so install `axios` even if most of your requests use `fetch`.
|
|
56
54
|
|
|
57
|
-
Install optional integrations when you use
|
|
55
|
+
Install optional integrations when you use Firebase Analytics capture:
|
|
58
56
|
|
|
59
57
|
```bash
|
|
60
|
-
npm install
|
|
58
|
+
npm install @react-native-firebase/analytics
|
|
61
59
|
```
|
|
62
60
|
|
|
63
61
|
For iOS, install pods after adding native dependencies:
|
|
@@ -107,6 +105,12 @@ You can disable the overlay without removing it from your tree:
|
|
|
107
105
|
<NetworkInspector enabled={false} />
|
|
108
106
|
```
|
|
109
107
|
|
|
108
|
+
Use `isEnabled` (defaults to `true`) to fully hide the floating launcher button:
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
<NetworkInspector isEnabled={false} />
|
|
112
|
+
```
|
|
113
|
+
|
|
110
114
|
---
|
|
111
115
|
|
|
112
116
|
## Settings Persistence
|
|
@@ -249,26 +253,6 @@ The Redux tab shows the latest state tree, recent dispatches, payloads, and chan
|
|
|
249
253
|
|
|
250
254
|
---
|
|
251
255
|
|
|
252
|
-
## WebView Inspection
|
|
253
|
-
|
|
254
|
-
Use the exported `WebView` as a drop-in wrapper around `react-native-webview`.
|
|
255
|
-
|
|
256
|
-
```tsx
|
|
257
|
-
import {WebView} from 'react-native-inapp-inspector';
|
|
258
|
-
|
|
259
|
-
<WebView source={{uri: 'https://example.com'}} />;
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
The wrapper forwards your props and ref, preserves your `onMessage`, `onNavigationStateChange`, `onLoadStart`, and `onLoadEnd` handlers, and injects scripts for WebView console logs, navigation history, and source snapshots.
|
|
263
|
-
|
|
264
|
-
Disable the loading overlay with `showLoader={false}`:
|
|
265
|
-
|
|
266
|
-
```tsx
|
|
267
|
-
<WebView source={{uri: 'https://example.com'}} showLoader={false} />
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
---
|
|
271
|
-
|
|
272
256
|
## Error Boundary
|
|
273
257
|
|
|
274
258
|
```tsx
|
|
@@ -303,15 +287,6 @@ import {ErrorBoundary} from 'react-native-inapp-inspector';
|
|
|
303
287
|
| `subscribeReduxState(callback)` | function | Subscribes to Redux state updates and returns an unsubscribe function. |
|
|
304
288
|
| `getActionHistory()` | function | Returns the recent dispatched Redux actions. |
|
|
305
289
|
| `clearActionHistory()` | function | Clears the Redux action history. |
|
|
306
|
-
| `WebView` | component | Instrumented WebView wrapper. |
|
|
307
|
-
| `getWebViewLogs()` | function | Returns captured WebView console logs. |
|
|
308
|
-
| `getWebViewNavHistory()` | function | Returns captured WebView navigation history. |
|
|
309
|
-
| `getWebViewHtml()` | function | Returns the latest captured WebView HTML. |
|
|
310
|
-
| `getWebViewCss()` | function | Returns the latest captured WebView CSS. |
|
|
311
|
-
| `getWebViewJs()` | function | Returns the latest captured WebView JavaScript. |
|
|
312
|
-
| `getWebViewHtmlUrl()` | function | Returns the URL for the latest captured WebView source snapshot. |
|
|
313
|
-
| `clearWebViewData()` | function | Clears captured WebView logs, navigation, and source data. |
|
|
314
|
-
| `subscribeWebView(callback)` | function | Subscribes to WebView data changes and returns an unsubscribe function. |
|
|
315
290
|
| `ErrorBoundary` | component | React error boundary component. |
|
|
316
291
|
|
|
317
292
|
---
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const PRETTY_SVG = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M5 3C3.9 3 3 3.9 3 5v1.5c0 .8-.7 1.5-1.5 1.5S0 7.3 0 6.5V5c0-2.8 2.2-5 5-5 .6 0 1 .4 1 1s-.4 1-1 1zm6 0c-1.1 0-2 .9-2 2v1.5c0 .8-.7 1.5-1.5 1.5S6 9.3 6 8.5V5c0-2.8 2.2-5 5-5 .6 0 1 .4 1 1s-.4 1-1 1z\" fill=\"currentColor\" opacity=\"0.9\"/>\n <path d=\"M3 11v1.5c0 .8.7 1.5 1.5 1.5S6 13.3 6 12.5V11H3zm7 0v1.5c0 .8.7 1.5 1.5 1.5S13 13.3 13 12.5V11H10z\" fill=\"currentColor\" opacity=\"0.6\"/>\n</svg>";
|
|
2
|
+
export declare const RAW_SVG = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"1\" y=\"2\" width=\"10\" height=\"1.5\" rx=\"0.75\" fill=\"currentColor\" opacity=\"0.9\"/>\n <rect x=\"1\" y=\"5.5\" width=\"14\" height=\"1.5\" rx=\"0.75\" fill=\"currentColor\" opacity=\"0.6\"/>\n <rect x=\"1\" y=\"9\" width=\"8\" height=\"1.5\" rx=\"0.75\" fill=\"currentColor\" opacity=\"0.45\"/>\n <rect x=\"1\" y=\"12.5\" width=\"12\" height=\"1.5\" rx=\"0.75\" fill=\"currentColor\" opacity=\"0.3\"/>\n</svg>";
|
|
3
|
+
export declare const TABLE_SVG = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"1\" y=\"1\" width=\"14\" height=\"14\" rx=\"2\" stroke=\"currentColor\" stroke-width=\"1.2\" opacity=\"0.7\"/>\n <path d=\"M1 5.5h14M1 10h14M5.5 1v14M10.5 1v14\" stroke=\"currentColor\" stroke-width=\"0.8\" opacity=\"0.5\"/>\n</svg>";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TABLE_SVG = exports.RAW_SVG = exports.PRETTY_SVG = void 0;
|
|
4
|
+
exports.PRETTY_SVG = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5
|
+
<path d="M5 3C3.9 3 3 3.9 3 5v1.5c0 .8-.7 1.5-1.5 1.5S0 7.3 0 6.5V5c0-2.8 2.2-5 5-5 .6 0 1 .4 1 1s-.4 1-1 1zm6 0c-1.1 0-2 .9-2 2v1.5c0 .8-.7 1.5-1.5 1.5S6 9.3 6 8.5V5c0-2.8 2.2-5 5-5 .6 0 1 .4 1 1s-.4 1-1 1z" fill="currentColor" opacity="0.9"/>
|
|
6
|
+
<path d="M3 11v1.5c0 .8.7 1.5 1.5 1.5S6 13.3 6 12.5V11H3zm7 0v1.5c0 .8.7 1.5 1.5 1.5S13 13.3 13 12.5V11H10z" fill="currentColor" opacity="0.6"/>
|
|
7
|
+
</svg>`;
|
|
8
|
+
exports.RAW_SVG = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
9
|
+
<rect x="1" y="2" width="10" height="1.5" rx="0.75" fill="currentColor" opacity="0.9"/>
|
|
10
|
+
<rect x="1" y="5.5" width="14" height="1.5" rx="0.75" fill="currentColor" opacity="0.6"/>
|
|
11
|
+
<rect x="1" y="9" width="8" height="1.5" rx="0.75" fill="currentColor" opacity="0.45"/>
|
|
12
|
+
<rect x="1" y="12.5" width="12" height="1.5" rx="0.75" fill="currentColor" opacity="0.3"/>
|
|
13
|
+
</svg>`;
|
|
14
|
+
exports.TABLE_SVG = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
15
|
+
<rect x="1" y="1" width="14" height="14" rx="2" stroke="currentColor" stroke-width="1.2" opacity="0.7"/>
|
|
16
|
+
<path d="M1 5.5h14M1 10h14M5.5 1v14M10.5 1v14" stroke="currentColor" stroke-width="0.8" opacity="0.5"/>
|
|
17
|
+
</svg>`;
|
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { AnalyticsEventCardProps } from '../types';
|
|
3
3
|
export declare function getEventColor(name: string): string;
|
|
4
|
-
export interface AnalyticsEventCardProps {
|
|
5
|
-
event: AnalyticsEvent & {
|
|
6
|
-
count?: number;
|
|
7
|
-
};
|
|
8
|
-
onPress: () => void;
|
|
9
|
-
isNew?: boolean;
|
|
10
|
-
searchStr?: string;
|
|
11
|
-
isFirst: boolean;
|
|
12
|
-
isLast: boolean;
|
|
13
|
-
msSincePrev?: number;
|
|
14
|
-
showTimestamp?: boolean;
|
|
15
|
-
computedScreenName?: string;
|
|
16
|
-
}
|
|
17
4
|
declare const AnalyticsEventCard: React.NamedExoticComponent<AnalyticsEventCardProps>;
|
|
18
5
|
export default AnalyticsEventCard;
|
|
@@ -41,18 +41,19 @@ const react_1 = __importStar(require("react"));
|
|
|
41
41
|
const react_native_1 = require("react-native");
|
|
42
42
|
const AppColors_1 = require("../styles/AppColors");
|
|
43
43
|
const AppFonts_1 = require("../styles/AppFonts");
|
|
44
|
+
const helpers_1 = require("../helpers");
|
|
44
45
|
const HighlightText_1 = __importDefault(require("./HighlightText"));
|
|
45
46
|
const TouchableScale_1 = __importDefault(require("./TouchableScale"));
|
|
46
47
|
// ─── Palette (Google Analytics colours) ───────────────────────────────────────
|
|
47
48
|
const EVENT_PALETTE = [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
AppColors_1.AppColors.googleBlue, // blue
|
|
50
|
+
AppColors_1.AppColors.googleGreen, // green
|
|
51
|
+
AppColors_1.AppColors.googlePurple, // purple
|
|
52
|
+
AppColors_1.AppColors.googleTeal, // teal
|
|
53
|
+
AppColors_1.AppColors.googleRed, // red
|
|
54
|
+
AppColors_1.AppColors.googleOrange, // orange
|
|
55
|
+
AppColors_1.AppColors.blue700, // dark blue
|
|
56
|
+
AppColors_1.AppColors.materialGreen, // dark green
|
|
56
57
|
];
|
|
57
58
|
function getEventColor(name) {
|
|
58
59
|
const safeName = typeof name === 'string' ? name : String(name || '');
|
|
@@ -63,24 +64,6 @@ function getEventColor(name) {
|
|
|
63
64
|
return EVENT_PALETTE[Math.abs(hash) % EVENT_PALETTE.length];
|
|
64
65
|
}
|
|
65
66
|
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
|
66
|
-
function formatTime(ts) {
|
|
67
|
-
const d = new Date(ts);
|
|
68
|
-
const hh = String(d.getHours()).padStart(2, '0');
|
|
69
|
-
const mm = String(d.getMinutes()).padStart(2, '0');
|
|
70
|
-
const ss = String(d.getSeconds()).padStart(2, '0');
|
|
71
|
-
const ms = String(d.getMilliseconds()).padStart(3, '0');
|
|
72
|
-
return `${hh}:${mm}:${ss}.${ms}`;
|
|
73
|
-
}
|
|
74
|
-
function formatGap(ms) {
|
|
75
|
-
if (ms < 1000)
|
|
76
|
-
return `+${ms}ms`;
|
|
77
|
-
const s = Math.round(ms / 1000);
|
|
78
|
-
if (s < 60)
|
|
79
|
-
return `+${s}s`;
|
|
80
|
-
const m = Math.floor(s / 60);
|
|
81
|
-
const rem = s % 60;
|
|
82
|
-
return rem > 0 ? `+${m}m ${rem}s` : `+${m}m`;
|
|
83
|
-
}
|
|
84
67
|
function getEventCategory(name) {
|
|
85
68
|
if (!name)
|
|
86
69
|
return 'Custom';
|
|
@@ -114,27 +97,27 @@ function getCategoryColors(category) {
|
|
|
114
97
|
switch (category) {
|
|
115
98
|
case 'Page View':
|
|
116
99
|
return {
|
|
117
|
-
bg:
|
|
118
|
-
border:
|
|
119
|
-
text:
|
|
100
|
+
bg: AppColors_1.AppColors.blueBg,
|
|
101
|
+
border: AppColors_1.AppColors.blueBorder,
|
|
102
|
+
text: AppColors_1.AppColors.blue800,
|
|
120
103
|
};
|
|
121
104
|
case 'Ecommerce':
|
|
122
105
|
return {
|
|
123
|
-
bg:
|
|
124
|
-
border:
|
|
125
|
-
text:
|
|
106
|
+
bg: AppColors_1.AppColors.greenBg,
|
|
107
|
+
border: AppColors_1.AppColors.greenBorder,
|
|
108
|
+
text: AppColors_1.AppColors.materialGreen,
|
|
126
109
|
};
|
|
127
110
|
case 'System':
|
|
128
111
|
return {
|
|
129
|
-
bg:
|
|
130
|
-
border:
|
|
131
|
-
text:
|
|
112
|
+
bg: AppColors_1.AppColors.greyBg,
|
|
113
|
+
border: AppColors_1.AppColors.greyBorder,
|
|
114
|
+
text: AppColors_1.AppColors.grey600,
|
|
132
115
|
};
|
|
133
116
|
default:
|
|
134
117
|
return {
|
|
135
|
-
bg:
|
|
136
|
-
border:
|
|
137
|
-
text:
|
|
118
|
+
bg: AppColors_1.AppColors.purpleBg,
|
|
119
|
+
border: AppColors_1.AppColors.purpleBorder,
|
|
120
|
+
text: AppColors_1.AppColors.purpleText,
|
|
138
121
|
};
|
|
139
122
|
}
|
|
140
123
|
}
|
|
@@ -160,7 +143,7 @@ const AnalyticsEventCard = react_1.default.memo(function AnalyticsEventCard({ ev
|
|
|
160
143
|
return (<react_native_1.View style={cardStyles.container}>
|
|
161
144
|
{/* ── Gap Indicator ─────────────────────────────────────────────────── */}
|
|
162
145
|
{showGap && (<react_native_1.View style={cardStyles.gapContainer}>
|
|
163
|
-
<react_native_1.Text style={[cardStyles.gapText, { color: AppColors_1.AppColors.grayTextWeak }]}>{formatGap(msSincePrev)}</react_native_1.Text>
|
|
146
|
+
<react_native_1.Text style={[cardStyles.gapText, { color: AppColors_1.AppColors.grayTextWeak }]}>{(0, helpers_1.formatGap)(msSincePrev)}</react_native_1.Text>
|
|
164
147
|
</react_native_1.View>)}
|
|
165
148
|
|
|
166
149
|
{/* ── Main Card ─────────────────────────────────────────────────────── */}
|
|
@@ -215,7 +198,7 @@ const AnalyticsEventCard = react_1.default.memo(function AnalyticsEventCard({ ev
|
|
|
215
198
|
</react_native_1.View>) : null}
|
|
216
199
|
</react_native_1.View>
|
|
217
200
|
<react_native_1.Text style={[cardStyles.timestamp, { color: AppColors_1.AppColors.grayTextWeak }]}>
|
|
218
|
-
{formatTime(event.timestamp)}
|
|
201
|
+
{(0, helpers_1.formatTime)(event.timestamp)}
|
|
219
202
|
</react_native_1.Text>
|
|
220
203
|
</react_native_1.View>
|
|
221
204
|
|
|
@@ -254,8 +237,8 @@ const AnalyticsEventCard = react_1.default.memo(function AnalyticsEventCard({ ev
|
|
|
254
237
|
{(() => {
|
|
255
238
|
const items = event.params?.items;
|
|
256
239
|
if (Array.isArray(items) && items.length > 0) {
|
|
257
|
-
return (<react_native_1.View style={[cardStyles.chip, { backgroundColor:
|
|
258
|
-
<react_native_1.Text style={[cardStyles.chipText, { color:
|
|
240
|
+
return (<react_native_1.View style={[cardStyles.chip, { backgroundColor: AppColors_1.AppColors.amberBg, borderColor: AppColors_1.AppColors.amberBorder }]}>
|
|
241
|
+
<react_native_1.Text style={[cardStyles.chipText, { color: AppColors_1.AppColors.amber700, fontFamily: AppFonts_1.AppFonts.interBold }]}>
|
|
259
242
|
🛒 {items.length} {items.length === 1 ? 'item' : 'items'}
|
|
260
243
|
</react_native_1.Text>
|
|
261
244
|
</react_native_1.View>);
|
|
@@ -269,8 +252,8 @@ const AnalyticsEventCard = react_1.default.memo(function AnalyticsEventCard({ ev
|
|
|
269
252
|
const isPrimitive = typeof val === 'string' || typeof val === 'number';
|
|
270
253
|
if (isPrimitive) {
|
|
271
254
|
const currencyStr = typeof currency === 'string' || typeof currency === 'number' ? String(currency) : '';
|
|
272
|
-
return (<react_native_1.View style={[cardStyles.chip, { backgroundColor:
|
|
273
|
-
<react_native_1.Text style={[cardStyles.chipText, { color:
|
|
255
|
+
return (<react_native_1.View style={[cardStyles.chip, { backgroundColor: AppColors_1.AppColors.emeraldBg, borderColor: AppColors_1.AppColors.emeraldBorder }]}>
|
|
256
|
+
<react_native_1.Text style={[cardStyles.chipText, { color: AppColors_1.AppColors.emerald600, fontFamily: AppFonts_1.AppFonts.interBold }]}>
|
|
274
257
|
💰 {String(val)} {currencyStr}
|
|
275
258
|
</react_native_1.Text>
|
|
276
259
|
</react_native_1.View>);
|
|
@@ -299,12 +282,12 @@ const cardStyles = react_native_1.StyleSheet.create({
|
|
|
299
282
|
letterSpacing: 0.5,
|
|
300
283
|
},
|
|
301
284
|
modernCard: {
|
|
302
|
-
backgroundColor:
|
|
285
|
+
backgroundColor: AppColors_1.AppColors.white,
|
|
303
286
|
borderRadius: 8,
|
|
304
287
|
borderWidth: 1,
|
|
305
|
-
borderColor:
|
|
288
|
+
borderColor: AppColors_1.AppColors.dividerColor,
|
|
306
289
|
padding: 8,
|
|
307
|
-
shadowColor:
|
|
290
|
+
shadowColor: AppColors_1.AppColors.black,
|
|
308
291
|
shadowOpacity: 0.03,
|
|
309
292
|
shadowRadius: 3,
|
|
310
293
|
shadowOffset: { width: 0, height: 1 },
|
|
@@ -334,7 +317,7 @@ const cardStyles = react_native_1.StyleSheet.create({
|
|
|
334
317
|
color: AppColors_1.AppColors.grayTextWeak,
|
|
335
318
|
},
|
|
336
319
|
highlight: {
|
|
337
|
-
backgroundColor:
|
|
320
|
+
backgroundColor: AppColors_1.AppColors.yellowHighlight,
|
|
338
321
|
color: AppColors_1.AppColors.primaryBlack,
|
|
339
322
|
borderRadius: 2,
|
|
340
323
|
},
|
|
@@ -372,8 +355,8 @@ const cardStyles = react_native_1.StyleSheet.create({
|
|
|
372
355
|
marginRight: 4,
|
|
373
356
|
},
|
|
374
357
|
duplicateBadge: {
|
|
375
|
-
backgroundColor:
|
|
376
|
-
borderColor:
|
|
358
|
+
backgroundColor: AppColors_1.AppColors.roseBg,
|
|
359
|
+
borderColor: AppColors_1.AppColors.roseBorder,
|
|
377
360
|
borderWidth: 1,
|
|
378
361
|
paddingHorizontal: 5,
|
|
379
362
|
paddingVertical: 2,
|
|
@@ -382,7 +365,7 @@ const cardStyles = react_native_1.StyleSheet.create({
|
|
|
382
365
|
duplicateText: {
|
|
383
366
|
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
384
367
|
fontSize: 9,
|
|
385
|
-
color:
|
|
368
|
+
color: AppColors_1.AppColors.rose600,
|
|
386
369
|
textTransform: 'uppercase',
|
|
387
370
|
letterSpacing: 0.5,
|
|
388
371
|
},
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
event: AnalyticsEvent;
|
|
5
|
-
accentColor: string;
|
|
6
|
-
}
|
|
7
|
-
declare const AnalyticsGraph: ({ event, accentColor }: Props) => React.JSX.Element;
|
|
2
|
+
import { AnalyticsGraphProps } from '../types';
|
|
3
|
+
declare const AnalyticsGraph: ({ event, accentColor }: AnalyticsGraphProps) => React.JSX.Element;
|
|
8
4
|
export default AnalyticsGraph;
|
|
@@ -91,7 +91,7 @@ const AnalyticsGraph = ({ event, accentColor }) => {
|
|
|
91
91
|
const typeData = [
|
|
92
92
|
{ label: 'Strings', value: paramTypes.string, color: AppColors_1.AppColors.purple },
|
|
93
93
|
{ label: 'Numbers', value: paramTypes.number, color: AppColors_1.AppColors.skyBlue },
|
|
94
|
-
{ label: 'Booleans', value: paramTypes.boolean, color:
|
|
94
|
+
{ label: 'Booleans', value: paramTypes.boolean, color: AppColors_1.AppColors.amber500 }, // Amber
|
|
95
95
|
{ label: 'Objects', value: paramTypes.object, color: AppColors_1.AppColors.greenColor },
|
|
96
96
|
].filter(d => d.value > 0);
|
|
97
97
|
strings.sort((a, b) => b.value - a.value);
|
|
@@ -132,7 +132,7 @@ const AnalyticsGraph = ({ event, accentColor }) => {
|
|
|
132
132
|
<BarChart data={filteredItems.map((item, i) => ({
|
|
133
133
|
label: item.item_name || item.item_id || `Item ${i + 1}`,
|
|
134
134
|
value: item.price,
|
|
135
|
-
}))} accentColor={AppColors_1.AppColors.successGreen
|
|
135
|
+
}))} accentColor={AppColors_1.AppColors.successGreen} maxBarWidth={maxBarWidth} isGradient={false}/>
|
|
136
136
|
</react_native_1.View>)}
|
|
137
137
|
</react_native_1.View>);
|
|
138
138
|
};
|
|
@@ -219,12 +219,12 @@ const GaugeChart = ({ data, accentColor, }) => {
|
|
|
219
219
|
paddingTop: 6,
|
|
220
220
|
paddingBottom: 6,
|
|
221
221
|
}}>
|
|
222
|
-
{data.map(
|
|
222
|
+
{data.map(d => {
|
|
223
223
|
const fillPct = Math.min(Math.abs(d.value) / maxVal, 1);
|
|
224
224
|
const strokeDashoffset = Math.max(circumference - fillPct * circumference, 0.001); // avoid exact 0
|
|
225
225
|
return (<react_native_1.View key={d.label} style={{ alignItems: 'center', width: 70 }}>
|
|
226
226
|
<react_native_svg_1.default width="60" height="60" viewBox="0 0 60 60">
|
|
227
|
-
<react_native_svg_1.Circle cx="30" cy="30" r={radius} stroke=
|
|
227
|
+
<react_native_svg_1.Circle cx="30" cy="30" r={radius} stroke={AppColors_1.AppColors.grayBorderSecondary} strokeWidth={stroke} fill="none"/>
|
|
228
228
|
<react_native_svg_1.Circle cx="30" cy="30" r={radius} stroke={accentColor} strokeWidth={stroke} fill="none" strokeLinecap="round" strokeDasharray={circumference} strokeDashoffset={strokeDashoffset} rotation="-90" origin="30, 30"/>
|
|
229
229
|
</react_native_svg_1.default>
|
|
230
230
|
<react_native_1.View style={{
|
|
@@ -286,12 +286,12 @@ const CalendarChart = ({ data, accentColor, }) => {
|
|
|
286
286
|
<react_native_1.View style={{
|
|
287
287
|
width: 58,
|
|
288
288
|
height: 62,
|
|
289
|
-
backgroundColor:
|
|
289
|
+
backgroundColor: AppColors_1.AppColors.white,
|
|
290
290
|
borderRadius: 8,
|
|
291
291
|
borderWidth: 1,
|
|
292
292
|
borderColor: AppColors_1.AppColors.grayBorderSecondary,
|
|
293
293
|
overflow: 'hidden',
|
|
294
|
-
shadowColor:
|
|
294
|
+
shadowColor: AppColors_1.AppColors.black,
|
|
295
295
|
shadowOpacity: 0.05,
|
|
296
296
|
shadowRadius: 4,
|
|
297
297
|
shadowOffset: { width: 0, height: 2 },
|
|
@@ -307,7 +307,7 @@ const CalendarChart = ({ data, accentColor, }) => {
|
|
|
307
307
|
<react_native_1.Text style={{
|
|
308
308
|
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
309
309
|
fontSize: 9,
|
|
310
|
-
color:
|
|
310
|
+
color: AppColors_1.AppColors.white,
|
|
311
311
|
textTransform: 'uppercase',
|
|
312
312
|
letterSpacing: 0.5,
|
|
313
313
|
}}>
|
|
@@ -319,7 +319,7 @@ const CalendarChart = ({ data, accentColor, }) => {
|
|
|
319
319
|
flex: 1,
|
|
320
320
|
justifyContent: 'center',
|
|
321
321
|
alignItems: 'center',
|
|
322
|
-
backgroundColor:
|
|
322
|
+
backgroundColor: AppColors_1.AppColors.grayBackground,
|
|
323
323
|
}}>
|
|
324
324
|
<react_native_1.Text style={{
|
|
325
325
|
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AnalyticsEvent } from '../types';
|
|
3
|
+
interface AnalyticsTabViewProps {
|
|
4
|
+
analyticsSearch: string;
|
|
5
|
+
onSetAnalyticsSearch: (val: string) => void;
|
|
6
|
+
onDeleteEvents: () => void;
|
|
7
|
+
selectedEvent: AnalyticsEvent | null;
|
|
8
|
+
onSelectEvent: (event: AnalyticsEvent | null) => void;
|
|
9
|
+
filteredAnalyticsEvents: AnalyticsEvent[];
|
|
10
|
+
visibleAnalyticsEvents: AnalyticsEvent[];
|
|
11
|
+
currentUserProperties: Record<string, any>;
|
|
12
|
+
currentUserId: string | null;
|
|
13
|
+
}
|
|
14
|
+
export declare const AnalyticsTabView: React.FC<AnalyticsTabViewProps>;
|
|
15
|
+
export default AnalyticsTabView;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AnalyticsTabView = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const react_native_1 = require("react-native");
|
|
9
|
+
const react_i18next_1 = require("react-i18next");
|
|
10
|
+
const TouchableScale_1 = __importDefault(require("./TouchableScale"));
|
|
11
|
+
const AnalyticsEventCard_1 = __importDefault(require("./AnalyticsEventCard"));
|
|
12
|
+
const AnalyticsDetail_1 = __importDefault(require("./AnalyticsDetail"));
|
|
13
|
+
const EmptyState_1 = __importDefault(require("./EmptyState"));
|
|
14
|
+
const AnimatedEntrance_1 = __importDefault(require("./AnimatedEntrance"));
|
|
15
|
+
const NetworkIcons_1 = require("./NetworkIcons");
|
|
16
|
+
const AppColors_1 = require("../styles/AppColors");
|
|
17
|
+
const AppFonts_1 = require("../styles/AppFonts");
|
|
18
|
+
const styles_1 = __importDefault(require("../styles"));
|
|
19
|
+
exports.AnalyticsTabView = react_1.default.memo(({ analyticsSearch, onSetAnalyticsSearch, onDeleteEvents, selectedEvent, onSelectEvent, filteredAnalyticsEvents, visibleAnalyticsEvents, currentUserProperties, currentUserId, }) => {
|
|
20
|
+
const { t } = (0, react_i18next_1.useTranslation)();
|
|
21
|
+
const [userPropsExpanded, setUserPropsExpanded] = react_1.default.useState(false);
|
|
22
|
+
const renderItem = react_1.default.useCallback(({ item, index }) => (<AnimatedEntrance_1.default index={index} distance={8}>
|
|
23
|
+
<AnalyticsEventCard_1.default event={item} searchStr={analyticsSearch} onPress={() => onSelectEvent(item)}/>
|
|
24
|
+
</AnimatedEntrance_1.default>), [analyticsSearch, onSelectEvent]);
|
|
25
|
+
const keyExtractor = react_1.default.useCallback((item, index) => item.id != null ? item.id.toString() : index.toString(), []);
|
|
26
|
+
const renderAnalyticsHeader = () => {
|
|
27
|
+
const hasProps = Object.keys(currentUserProperties ?? {}).length > 0;
|
|
28
|
+
const total = visibleAnalyticsEvents.length;
|
|
29
|
+
const filtered = filteredAnalyticsEvents.length;
|
|
30
|
+
return (<react_native_1.View style={{ paddingHorizontal: 16, paddingTop: 8, paddingBottom: 4 }}>
|
|
31
|
+
{(hasProps || currentUserId) && (<react_native_1.View style={{
|
|
32
|
+
backgroundColor: AppColors_1.AppColors.primaryLight,
|
|
33
|
+
borderRadius: 10,
|
|
34
|
+
borderWidth: 1,
|
|
35
|
+
borderColor: AppColors_1.AppColors.grayBorderSecondary,
|
|
36
|
+
marginBottom: 10,
|
|
37
|
+
overflow: 'hidden',
|
|
38
|
+
}}>
|
|
39
|
+
<react_native_1.Pressable onPress={() => setUserPropsExpanded(v => !v)} style={{
|
|
40
|
+
flexDirection: 'row',
|
|
41
|
+
alignItems: 'center',
|
|
42
|
+
justifyContent: 'space-between',
|
|
43
|
+
padding: 10,
|
|
44
|
+
backgroundColor: AppColors_1.AppColors.grayBackground,
|
|
45
|
+
}}>
|
|
46
|
+
<react_native_1.View style={{
|
|
47
|
+
flexDirection: 'row',
|
|
48
|
+
alignItems: 'center',
|
|
49
|
+
gap: 6,
|
|
50
|
+
}}>
|
|
51
|
+
<NetworkIcons_1.UserIcon color={AppColors_1.AppColors.purple} size={14}/>
|
|
52
|
+
<react_native_1.Text style={{
|
|
53
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
54
|
+
fontSize: 12,
|
|
55
|
+
color: AppColors_1.AppColors.primaryBlack,
|
|
56
|
+
}}>
|
|
57
|
+
{t('analytics.user_context')}
|
|
58
|
+
</react_native_1.Text>
|
|
59
|
+
{currentUserId && (<react_native_1.View style={{
|
|
60
|
+
backgroundColor: 'rgba(104,75,155,0.1)',
|
|
61
|
+
paddingHorizontal: 6,
|
|
62
|
+
paddingVertical: 1,
|
|
63
|
+
borderRadius: 4,
|
|
64
|
+
}}>
|
|
65
|
+
<react_native_1.Text style={{
|
|
66
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
67
|
+
fontSize: 9,
|
|
68
|
+
color: AppColors_1.AppColors.purple,
|
|
69
|
+
}}>
|
|
70
|
+
{t('analytics.id')}: {currentUserId}
|
|
71
|
+
</react_native_1.Text>
|
|
72
|
+
</react_native_1.View>)}
|
|
73
|
+
</react_native_1.View>
|
|
74
|
+
<react_native_1.Text style={{
|
|
75
|
+
fontFamily: AppFonts_1.AppFonts.interMedium,
|
|
76
|
+
fontSize: 11,
|
|
77
|
+
color: AppColors_1.AppColors.purple,
|
|
78
|
+
}}>
|
|
79
|
+
{userPropsExpanded ? t('analytics.hide_props') : t('analytics.show_props')}
|
|
80
|
+
</react_native_1.Text>
|
|
81
|
+
</react_native_1.Pressable>
|
|
82
|
+
|
|
83
|
+
{userPropsExpanded && hasProps && (<react_native_1.View style={{
|
|
84
|
+
padding: 10,
|
|
85
|
+
borderTopWidth: 1,
|
|
86
|
+
borderTopColor: AppColors_1.AppColors.dividerColor,
|
|
87
|
+
gap: 4,
|
|
88
|
+
}}>
|
|
89
|
+
{Object.entries(currentUserProperties ?? {}).map(([k, v]) => (<react_native_1.View key={k} style={{
|
|
90
|
+
flexDirection: 'row',
|
|
91
|
+
justifyContent: 'space-between',
|
|
92
|
+
}}>
|
|
93
|
+
<react_native_1.Text style={{
|
|
94
|
+
fontFamily: AppFonts_1.AppFonts.interMedium,
|
|
95
|
+
fontSize: 11,
|
|
96
|
+
color: AppColors_1.AppColors.grayTextWeak,
|
|
97
|
+
}}>
|
|
98
|
+
{k}
|
|
99
|
+
</react_native_1.Text>
|
|
100
|
+
<react_native_1.Text style={{
|
|
101
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
102
|
+
fontSize: 11,
|
|
103
|
+
color: AppColors_1.AppColors.primaryBlack,
|
|
104
|
+
}}>
|
|
105
|
+
{String(v)}
|
|
106
|
+
</react_native_1.Text>
|
|
107
|
+
</react_native_1.View>))}
|
|
108
|
+
</react_native_1.View>)}
|
|
109
|
+
</react_native_1.View>)}
|
|
110
|
+
|
|
111
|
+
<react_native_1.Text style={[styles_1.default.resultCount, { marginBottom: 4 }]}>
|
|
112
|
+
{t('filters.showing_analytics', { filtered, total })}
|
|
113
|
+
</react_native_1.Text>
|
|
114
|
+
</react_native_1.View>);
|
|
115
|
+
};
|
|
116
|
+
return (<react_native_1.View style={{ flex: 1 }}>
|
|
117
|
+
{selectedEvent != null ? (<AnalyticsDetail_1.default event={selectedEvent} onClose={() => onSelectEvent(null)}/>) : (<react_native_1.View style={{ flex: 1 }}>
|
|
118
|
+
<react_native_1.View style={{
|
|
119
|
+
backgroundColor: AppColors_1.AppColors.white,
|
|
120
|
+
borderBottomWidth: 1,
|
|
121
|
+
borderBottomColor: AppColors_1.AppColors.dividerColor,
|
|
122
|
+
paddingBottom: 6,
|
|
123
|
+
}}>
|
|
124
|
+
<react_native_1.View style={[
|
|
125
|
+
styles_1.default.toolbarRow,
|
|
126
|
+
{ marginTop: 12, marginBottom: 8 },
|
|
127
|
+
]}>
|
|
128
|
+
<react_native_1.View style={styles_1.default.searchContainer}>
|
|
129
|
+
<NetworkIcons_1.SearchIcon color={AppColors_1.AppColors.grayTextWeak} size={16}/>
|
|
130
|
+
<react_native_1.TextInput placeholder={t('search.analytics_placeholder')} placeholderTextColor={AppColors_1.AppColors.grayTextWeak} value={analyticsSearch} onChangeText={onSetAnalyticsSearch} style={styles_1.default.searchInput} autoCorrect={false} autoCapitalize="none"/>
|
|
131
|
+
{analyticsSearch.length > 0 && (<react_native_1.Pressable onPress={() => onSetAnalyticsSearch('')} hitSlop={10} style={styles_1.default.clearBtn}>
|
|
132
|
+
<NetworkIcons_1.ClearIcon color={AppColors_1.AppColors.grayTextWeak} size={14}/>
|
|
133
|
+
</react_native_1.Pressable>)}
|
|
134
|
+
</react_native_1.View>
|
|
135
|
+
|
|
136
|
+
<react_native_1.View style={styles_1.default.toolbarRight}>
|
|
137
|
+
<TouchableScale_1.default style={[
|
|
138
|
+
styles_1.default.toolbarBtn,
|
|
139
|
+
{
|
|
140
|
+
borderColor: 'rgba(255,46,87,0.22)',
|
|
141
|
+
backgroundColor: 'rgba(255,46,87,0.06)',
|
|
142
|
+
},
|
|
143
|
+
]} onPress={onDeleteEvents} hitSlop={6}>
|
|
144
|
+
<NetworkIcons_1.WipeIcon color={AppColors_1.AppColors.errorColor} size={15}/>
|
|
145
|
+
</TouchableScale_1.default>
|
|
146
|
+
</react_native_1.View>
|
|
147
|
+
</react_native_1.View>
|
|
148
|
+
</react_native_1.View>
|
|
149
|
+
|
|
150
|
+
<react_native_1.FlatList data={filteredAnalyticsEvents} keyExtractor={keyExtractor} ListHeaderComponent={renderAnalyticsHeader} renderItem={renderItem} initialNumToRender={15} maxToRenderPerBatch={15} windowSize={7} removeClippedSubviews={true} ListEmptyComponent={<EmptyState_1.default isSearch={analyticsSearch.length > 0}/>} contentContainerStyle={[
|
|
151
|
+
styles_1.default.listContent,
|
|
152
|
+
filteredAnalyticsEvents.length === 0 && { flexGrow: 1 },
|
|
153
|
+
]} keyboardShouldPersistTaps="handled"/>
|
|
154
|
+
</react_native_1.View>)}
|
|
155
|
+
</react_native_1.View>);
|
|
156
|
+
});
|
|
157
|
+
exports.default = exports.AnalyticsTabView;
|
|
@@ -8,5 +8,5 @@ interface AnimatedEntranceProps {
|
|
|
8
8
|
index?: number;
|
|
9
9
|
style?: ViewStyle | ViewStyle[];
|
|
10
10
|
}
|
|
11
|
-
declare const AnimatedEntrance:
|
|
11
|
+
declare const AnimatedEntrance: React.NamedExoticComponent<AnimatedEntranceProps>;
|
|
12
12
|
export default AnimatedEntrance;
|
|
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
const react_1 = __importStar(require("react"));
|
|
37
37
|
const react_native_1 = require("react-native");
|
|
38
|
-
const AnimatedEntrance = ({ children, delay = 0, distance = 10, duration = 220, index = 0, style, })
|
|
38
|
+
const AnimatedEntrance = react_1.default.memo(function AnimatedEntrance({ children, delay = 0, distance = 10, duration = 220, index = 0, style, }) {
|
|
39
39
|
const progress = (0, react_1.useRef)(new react_native_1.Animated.Value(0)).current;
|
|
40
40
|
(0, react_1.useEffect)(() => {
|
|
41
41
|
progress.setValue(0);
|
|
@@ -68,5 +68,5 @@ const AnimatedEntrance = ({ children, delay = 0, distance = 10, duration = 220,
|
|
|
68
68
|
]}>
|
|
69
69
|
{children}
|
|
70
70
|
</react_native_1.Animated.View>);
|
|
71
|
-
};
|
|
71
|
+
});
|
|
72
72
|
exports.default = AnimatedEntrance;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NetworkLog } from '../types';
|
|
3
|
+
import { ApiDetailTab } from '../enums';
|
|
4
|
+
interface ApiDetailViewProps {
|
|
5
|
+
selected: NetworkLog;
|
|
6
|
+
apiDetailActiveTab: ApiDetailTab | 'metadata' | 'headers' | 'request' | 'response';
|
|
7
|
+
onSetApiDetailActiveTab: (tab: ApiDetailTab | 'metadata' | 'headers' | 'request' | 'response') => void;
|
|
8
|
+
detailSearch: string;
|
|
9
|
+
onSetDetailSearch: (val: string) => void;
|
|
10
|
+
reqExpanded: boolean;
|
|
11
|
+
onToggleReqExpanded: () => void;
|
|
12
|
+
resExpanded: boolean;
|
|
13
|
+
onToggleResExpanded: () => void;
|
|
14
|
+
showReqDiff: boolean;
|
|
15
|
+
onToggleShowReqDiff: () => void;
|
|
16
|
+
showResDiff: boolean;
|
|
17
|
+
onToggleShowResDiff: () => void;
|
|
18
|
+
prevRequestData: any;
|
|
19
|
+
prevResponseData: any;
|
|
20
|
+
}
|
|
21
|
+
export declare const ApiDetailView: React.FC<ApiDetailViewProps>;
|
|
22
|
+
export default ApiDetailView;
|