react-native-inapp-inspector 1.1.13 → 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 +120 -50
- 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/analyticsLogger.d.ts +8 -0
- package/dist/commonjs/customHooks/analyticsLogger.js +42 -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 +2 -3
- package/dist/commonjs/index.js +207 -4927
- 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 +219 -435
- package/dist/commonjs/styles/index.js +312 -488
- 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 +118 -48
- 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/analyticsLogger.d.ts +8 -0
- package/dist/esm/customHooks/analyticsLogger.js +37 -0
- 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 +2 -3
- package/dist/esm/index.js +207 -4923
- 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 +219 -435
- package/dist/esm/styles/index.js +312 -488
- 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/example/android/app/build.gradle +29 -1
- package/example/android/app/src/main/java/com/example/MainApplication.kt +25 -0
- package/example/android/build.gradle +31 -4
- package/example/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/example/android/gradle.properties +1 -0
- package/example/android/settings.gradle +20 -1
- package/example/package-lock.json +1 -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,44 +41,85 @@ 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) {
|
|
59
|
+
const safeName = typeof name === 'string' ? name : String(name || '');
|
|
58
60
|
let hash = 0;
|
|
59
|
-
for (let i = 0; i <
|
|
60
|
-
hash = (hash * 31 +
|
|
61
|
+
for (let i = 0; i < safeName.length; i++) {
|
|
62
|
+
hash = (hash * 31 + safeName.charCodeAt(i)) | 0;
|
|
61
63
|
}
|
|
62
64
|
return EVENT_PALETTE[Math.abs(hash) % EVENT_PALETTE.length];
|
|
63
65
|
}
|
|
64
66
|
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
|
65
|
-
function
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
function getEventCategory(name) {
|
|
68
|
+
if (!name)
|
|
69
|
+
return 'Custom';
|
|
70
|
+
const lowercaseName = name.toLowerCase();
|
|
71
|
+
if (lowercaseName === 'screen_view' || lowercaseName === 'page_view') {
|
|
72
|
+
return 'Page View';
|
|
73
|
+
}
|
|
74
|
+
// Ecommerce events
|
|
75
|
+
const ecommerceEvents = [
|
|
76
|
+
'purchase', 'add_to_cart', 'begin_checkout', 'view_item',
|
|
77
|
+
'select_item', 'remove_from_cart', 'view_cart',
|
|
78
|
+
'add_shipping_info', 'add_payment_info', 'refund',
|
|
79
|
+
'view_item_list', 'select_promotion', 'view_promotion'
|
|
80
|
+
];
|
|
81
|
+
if (ecommerceEvents.includes(lowercaseName)) {
|
|
82
|
+
return 'Ecommerce';
|
|
83
|
+
}
|
|
84
|
+
// Firebase System Auto-events
|
|
85
|
+
const systemEvents = [
|
|
86
|
+
'first_open', 'session_start', 'user_engagement',
|
|
87
|
+
'app_clear_data', 'app_exception', 'app_update', 'os_update',
|
|
88
|
+
'notification_receive', 'notification_open', 'notification_dismiss',
|
|
89
|
+
'screen_active', 'screen_inactive'
|
|
90
|
+
];
|
|
91
|
+
if (systemEvents.includes(lowercaseName) || lowercaseName.startsWith('firebase_') || lowercaseName.startsWith('_')) {
|
|
92
|
+
return 'System';
|
|
93
|
+
}
|
|
94
|
+
return 'Custom';
|
|
72
95
|
}
|
|
73
|
-
function
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
96
|
+
function getCategoryColors(category) {
|
|
97
|
+
switch (category) {
|
|
98
|
+
case 'Page View':
|
|
99
|
+
return {
|
|
100
|
+
bg: AppColors_1.AppColors.blueBg,
|
|
101
|
+
border: AppColors_1.AppColors.blueBorder,
|
|
102
|
+
text: AppColors_1.AppColors.blue800,
|
|
103
|
+
};
|
|
104
|
+
case 'Ecommerce':
|
|
105
|
+
return {
|
|
106
|
+
bg: AppColors_1.AppColors.greenBg,
|
|
107
|
+
border: AppColors_1.AppColors.greenBorder,
|
|
108
|
+
text: AppColors_1.AppColors.materialGreen,
|
|
109
|
+
};
|
|
110
|
+
case 'System':
|
|
111
|
+
return {
|
|
112
|
+
bg: AppColors_1.AppColors.greyBg,
|
|
113
|
+
border: AppColors_1.AppColors.greyBorder,
|
|
114
|
+
text: AppColors_1.AppColors.grey600,
|
|
115
|
+
};
|
|
116
|
+
default:
|
|
117
|
+
return {
|
|
118
|
+
bg: AppColors_1.AppColors.purpleBg,
|
|
119
|
+
border: AppColors_1.AppColors.purpleBorder,
|
|
120
|
+
text: AppColors_1.AppColors.purpleText,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
82
123
|
}
|
|
83
124
|
// ─── Component ────────────────────────────────────────────────────────────────
|
|
84
125
|
const AnalyticsEventCard = react_1.default.memo(function AnalyticsEventCard({ event, onPress, isNew = false, searchStr = '', msSincePrev, computedScreenName, }) {
|
|
@@ -102,7 +143,7 @@ const AnalyticsEventCard = react_1.default.memo(function AnalyticsEventCard({ ev
|
|
|
102
143
|
return (<react_native_1.View style={cardStyles.container}>
|
|
103
144
|
{/* ── Gap Indicator ─────────────────────────────────────────────────── */}
|
|
104
145
|
{showGap && (<react_native_1.View style={cardStyles.gapContainer}>
|
|
105
|
-
<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>
|
|
106
147
|
</react_native_1.View>)}
|
|
107
148
|
|
|
108
149
|
{/* ── Main Card ─────────────────────────────────────────────────────── */}
|
|
@@ -128,6 +169,19 @@ const AnalyticsEventCard = react_1.default.memo(function AnalyticsEventCard({ ev
|
|
|
128
169
|
<HighlightText_1.default text={event.name} search={searchStr} style={[cardStyles.eventName, { color: color }]} highlightStyle={cardStyles.highlight}/>
|
|
129
170
|
</react_native_1.View>
|
|
130
171
|
|
|
172
|
+
{(() => {
|
|
173
|
+
const category = getEventCategory(event.name);
|
|
174
|
+
const tagColors = getCategoryColors(category);
|
|
175
|
+
return (<react_native_1.View style={[
|
|
176
|
+
cardStyles.categoryBadge,
|
|
177
|
+
{ backgroundColor: tagColors.bg, borderColor: tagColors.border },
|
|
178
|
+
]}>
|
|
179
|
+
<react_native_1.Text style={[cardStyles.categoryText, { color: tagColors.text }]}>
|
|
180
|
+
{category}
|
|
181
|
+
</react_native_1.Text>
|
|
182
|
+
</react_native_1.View>);
|
|
183
|
+
})()}
|
|
184
|
+
|
|
131
185
|
{event.count !== undefined ? (<react_native_1.View style={[
|
|
132
186
|
cardStyles.duplicateBadge,
|
|
133
187
|
event.count === 1 && {
|
|
@@ -144,27 +198,31 @@ const AnalyticsEventCard = react_1.default.memo(function AnalyticsEventCard({ ev
|
|
|
144
198
|
</react_native_1.View>) : null}
|
|
145
199
|
</react_native_1.View>
|
|
146
200
|
<react_native_1.Text style={[cardStyles.timestamp, { color: AppColors_1.AppColors.grayTextWeak }]}>
|
|
147
|
-
{formatTime(event.timestamp)}
|
|
201
|
+
{(0, helpers_1.formatTime)(event.timestamp)}
|
|
148
202
|
</react_native_1.Text>
|
|
149
203
|
</react_native_1.View>
|
|
150
204
|
|
|
151
205
|
{/* Bottom Row: Metadata Chips & Sparkline */}
|
|
152
206
|
<react_native_1.View style={cardStyles.cardBody}>
|
|
153
207
|
<react_native_1.View style={cardStyles.chipsRow}>
|
|
154
|
-
{
|
|
155
|
-
|
|
156
|
-
event.params?.firebase_screen ||
|
|
157
|
-
event.params?.screen_name ||
|
|
158
|
-
event.params?.firebase_screen_class ? (<react_native_1.View style={[cardStyles.chip, { backgroundColor: AppColors_1.AppColors.grayBackground, borderColor: AppColors_1.AppColors.grayBorderSecondary }]}>
|
|
159
|
-
<react_native_1.View style={[cardStyles.screenDot, { backgroundColor: color }]}/>
|
|
160
|
-
<react_native_1.Text style={[cardStyles.chipText, { color: AppColors_1.AppColors.grayText }]} numberOfLines={1}>
|
|
161
|
-
{computedScreenName ||
|
|
208
|
+
{(() => {
|
|
209
|
+
const rawScreenName = computedScreenName ||
|
|
162
210
|
event.screenName ||
|
|
163
211
|
event.params?.firebase_screen ||
|
|
164
212
|
event.params?.screen_name ||
|
|
165
|
-
event.params?.firebase_screen_class
|
|
166
|
-
|
|
167
|
-
|
|
213
|
+
event.params?.firebase_screen_class;
|
|
214
|
+
if (!rawScreenName)
|
|
215
|
+
return null;
|
|
216
|
+
const screenNameStr = typeof rawScreenName === 'object'
|
|
217
|
+
? JSON.stringify(rawScreenName)
|
|
218
|
+
: String(rawScreenName);
|
|
219
|
+
return (<react_native_1.View style={[cardStyles.chip, { backgroundColor: AppColors_1.AppColors.grayBackground, borderColor: AppColors_1.AppColors.grayBorderSecondary }]}>
|
|
220
|
+
<react_native_1.View style={[cardStyles.screenDot, { backgroundColor: color }]}/>
|
|
221
|
+
<react_native_1.Text style={[cardStyles.chipText, { color: AppColors_1.AppColors.grayText }]} numberOfLines={1}>
|
|
222
|
+
{screenNameStr}
|
|
223
|
+
</react_native_1.Text>
|
|
224
|
+
</react_native_1.View>);
|
|
225
|
+
})()}
|
|
168
226
|
|
|
169
227
|
<react_native_1.View style={[cardStyles.chip, { backgroundColor: AppColors_1.AppColors.grayBackground, borderColor: AppColors_1.AppColors.grayBorderSecondary }]}>
|
|
170
228
|
<react_native_1.Text style={[cardStyles.chipText, { color: AppColors_1.AppColors.grayText }]}>
|
|
@@ -179,8 +237,8 @@ const AnalyticsEventCard = react_1.default.memo(function AnalyticsEventCard({ ev
|
|
|
179
237
|
{(() => {
|
|
180
238
|
const items = event.params?.items;
|
|
181
239
|
if (Array.isArray(items) && items.length > 0) {
|
|
182
|
-
return (<react_native_1.View style={[cardStyles.chip, { backgroundColor:
|
|
183
|
-
<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 }]}>
|
|
184
242
|
🛒 {items.length} {items.length === 1 ? 'item' : 'items'}
|
|
185
243
|
</react_native_1.Text>
|
|
186
244
|
</react_native_1.View>);
|
|
@@ -194,8 +252,8 @@ const AnalyticsEventCard = react_1.default.memo(function AnalyticsEventCard({ ev
|
|
|
194
252
|
const isPrimitive = typeof val === 'string' || typeof val === 'number';
|
|
195
253
|
if (isPrimitive) {
|
|
196
254
|
const currencyStr = typeof currency === 'string' || typeof currency === 'number' ? String(currency) : '';
|
|
197
|
-
return (<react_native_1.View style={[cardStyles.chip, { backgroundColor:
|
|
198
|
-
<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 }]}>
|
|
199
257
|
💰 {String(val)} {currencyStr}
|
|
200
258
|
</react_native_1.Text>
|
|
201
259
|
</react_native_1.View>);
|
|
@@ -224,12 +282,12 @@ const cardStyles = react_native_1.StyleSheet.create({
|
|
|
224
282
|
letterSpacing: 0.5,
|
|
225
283
|
},
|
|
226
284
|
modernCard: {
|
|
227
|
-
backgroundColor:
|
|
285
|
+
backgroundColor: AppColors_1.AppColors.white,
|
|
228
286
|
borderRadius: 8,
|
|
229
287
|
borderWidth: 1,
|
|
230
|
-
borderColor:
|
|
288
|
+
borderColor: AppColors_1.AppColors.dividerColor,
|
|
231
289
|
padding: 8,
|
|
232
|
-
shadowColor:
|
|
290
|
+
shadowColor: AppColors_1.AppColors.black,
|
|
233
291
|
shadowOpacity: 0.03,
|
|
234
292
|
shadowRadius: 3,
|
|
235
293
|
shadowOffset: { width: 0, height: 1 },
|
|
@@ -259,7 +317,7 @@ const cardStyles = react_native_1.StyleSheet.create({
|
|
|
259
317
|
color: AppColors_1.AppColors.grayTextWeak,
|
|
260
318
|
},
|
|
261
319
|
highlight: {
|
|
262
|
-
backgroundColor:
|
|
320
|
+
backgroundColor: AppColors_1.AppColors.yellowHighlight,
|
|
263
321
|
color: AppColors_1.AppColors.primaryBlack,
|
|
264
322
|
borderRadius: 2,
|
|
265
323
|
},
|
|
@@ -297,8 +355,8 @@ const cardStyles = react_native_1.StyleSheet.create({
|
|
|
297
355
|
marginRight: 4,
|
|
298
356
|
},
|
|
299
357
|
duplicateBadge: {
|
|
300
|
-
backgroundColor:
|
|
301
|
-
borderColor:
|
|
358
|
+
backgroundColor: AppColors_1.AppColors.roseBg,
|
|
359
|
+
borderColor: AppColors_1.AppColors.roseBorder,
|
|
302
360
|
borderWidth: 1,
|
|
303
361
|
paddingHorizontal: 5,
|
|
304
362
|
paddingVertical: 2,
|
|
@@ -307,7 +365,19 @@ const cardStyles = react_native_1.StyleSheet.create({
|
|
|
307
365
|
duplicateText: {
|
|
308
366
|
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
309
367
|
fontSize: 9,
|
|
310
|
-
color:
|
|
368
|
+
color: AppColors_1.AppColors.rose600,
|
|
369
|
+
textTransform: 'uppercase',
|
|
370
|
+
letterSpacing: 0.5,
|
|
371
|
+
},
|
|
372
|
+
categoryBadge: {
|
|
373
|
+
borderWidth: 1,
|
|
374
|
+
paddingHorizontal: 5,
|
|
375
|
+
paddingVertical: 2,
|
|
376
|
+
borderRadius: 4,
|
|
377
|
+
},
|
|
378
|
+
categoryText: {
|
|
379
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
380
|
+
fontSize: 9,
|
|
311
381
|
textTransform: 'uppercase',
|
|
312
382
|
letterSpacing: 0.5,
|
|
313
383
|
},
|
|
@@ -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;
|