react-native-inapp-inspector 2.4.1 → 2.5.0
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.ar.md +163 -0
- package/README.de.md +163 -0
- package/README.es.md +164 -0
- package/README.fr.md +163 -0
- package/README.hi.md +163 -0
- package/README.ja.md +180 -0
- package/README.ko.md +163 -0
- package/README.md +340 -243
- package/README.pt-BR.md +163 -0
- package/README.ru.md +163 -0
- package/README.zh-CN.md +387 -0
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +605 -23
- package/assets/banner_dark.svg +186 -0
- package/assets/banner_light.svg +186 -0
- package/assets/icon_circle.svg +148 -0
- package/assets/icon_square.svg +369 -0
- package/assets/inapp_inspector_icon.gif +0 -0
- package/assets/inapp_inspector_icon_original.gif +0 -0
- package/assets/social_preview.png +0 -0
- package/assets/walkthrough.gif +0 -0
- package/dist/commonjs/capture.d.ts +2 -0
- package/dist/commonjs/capture.js +1 -1
- package/dist/commonjs/components/AnalyticsDetail.js +23 -23
- package/dist/commonjs/components/AnalyticsEventCard.js +1 -1
- package/dist/commonjs/components/AnalyticsGraph.js +44 -44
- package/dist/commonjs/components/AnimatedBrandOwl.d.ts +7 -0
- package/dist/commonjs/components/AnimatedBrandOwl.js +175 -0
- package/dist/commonjs/components/AppHeaderLogo.d.ts +1 -0
- package/dist/commonjs/components/AppHeaderLogo.js +5 -3
- package/dist/commonjs/components/BrandCircleIcon.js +28 -28
- package/dist/commonjs/components/BrandSquareIcon.d.ts +5 -0
- package/dist/commonjs/components/BrandSquareIcon.js +139 -0
- package/dist/commonjs/components/ConsoleLogCard.d.ts +2 -1
- package/dist/commonjs/components/ConsoleLogCard.js +23 -39
- package/dist/commonjs/components/Inspector/AboutModal.js +44 -54
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +6 -6
- package/dist/commonjs/components/Inspector/ConfirmationModal.d.ts +13 -0
- package/dist/commonjs/components/Inspector/ConfirmationModal.js +30 -0
- package/dist/commonjs/components/Inspector/ConsoleTab.js +12 -12
- package/dist/commonjs/components/Inspector/CrashTab.js +44 -9
- package/dist/commonjs/components/Inspector/DebuggingTab.js +17 -17
- package/dist/commonjs/components/Inspector/DeviceInfoTab.js +1 -1
- package/dist/commonjs/components/Inspector/FabLauncher.js +30 -33
- package/dist/commonjs/components/Inspector/FeatureUnderDevNotice.js +2 -2
- package/dist/commonjs/components/Inspector/FloatingCaptureWidget.d.ts +3 -0
- package/dist/commonjs/components/Inspector/FloatingCaptureWidget.js +54 -0
- package/dist/commonjs/components/Inspector/GlobalCrashScreenModal.d.ts +11 -0
- package/dist/commonjs/components/Inspector/GlobalCrashScreenModal.js +234 -0
- package/dist/commonjs/components/Inspector/InspectorHeader.js +137 -127
- package/dist/commonjs/components/Inspector/LanguageSelectorModal.d.ts +15 -0
- package/dist/commonjs/components/Inspector/LanguageSelectorModal.js +172 -0
- package/dist/commonjs/components/Inspector/MainScreen.js +55 -35
- package/dist/commonjs/components/Inspector/MediaGalleryTab.js +40 -35
- package/dist/commonjs/components/Inspector/MediaPreviewModal.d.ts +36 -0
- package/dist/commonjs/components/Inspector/MediaPreviewModal.js +341 -135
- package/dist/commonjs/components/Inspector/NetworkTab.js +50 -50
- package/dist/commonjs/components/Inspector/NpmUpdateToast.js +1 -1
- package/dist/commonjs/components/Inspector/PushCard.d.ts +3 -2
- package/dist/commonjs/components/Inspector/PushCard.js +5 -4
- package/dist/commonjs/components/Inspector/PushDetail.js +41 -32
- package/dist/commonjs/components/Inspector/PushTab.js +12 -12
- package/dist/commonjs/components/Inspector/ReduxDetail.js +32 -32
- package/dist/commonjs/components/Inspector/ReduxTab.js +10 -8
- package/dist/commonjs/components/Inspector/SecondaryTelemetryStrip.d.ts +2 -0
- package/dist/commonjs/components/Inspector/SecondaryTelemetryStrip.js +43 -0
- package/dist/commonjs/components/Inspector/SettingsPanel.js +287 -139
- package/dist/commonjs/components/Inspector/SocketCard.d.ts +5 -0
- package/dist/commonjs/components/Inspector/SocketCard.js +116 -0
- package/dist/commonjs/components/Inspector/SocketDetail.d.ts +4 -0
- package/dist/commonjs/components/Inspector/SocketDetail.js +327 -0
- package/dist/commonjs/components/Inspector/SocketFilterModal.d.ts +13 -0
- package/dist/commonjs/components/Inspector/SocketFilterModal.js +69 -0
- package/dist/commonjs/components/Inspector/SocketTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/SocketTab.js +112 -0
- package/dist/commonjs/components/Inspector/StorageTab.js +39 -37
- package/dist/commonjs/components/Inspector/SupportModal.d.ts +7 -0
- package/dist/commonjs/components/Inspector/SupportModal.js +125 -0
- package/dist/commonjs/components/Inspector/SupportPage.d.ts +5 -0
- package/dist/commonjs/components/Inspector/SupportPage.js +227 -0
- package/dist/commonjs/components/Inspector/TabBar.js +24 -23
- package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +24 -24
- package/dist/commonjs/components/JsonViewer.js +50 -48
- package/dist/commonjs/components/LogCard.d.ts +3 -2
- package/dist/commonjs/components/LogCard.js +27 -25
- package/dist/commonjs/components/LogSyntaxHighlighter.js +5 -5
- package/dist/commonjs/components/ModuleErrorBoundary.js +5 -5
- package/dist/commonjs/components/NetworkIcons.d.ts +42 -0
- package/dist/commonjs/components/NetworkIcons.js +139 -6
- package/dist/commonjs/components/SegmentedTabs.js +1 -1
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/crash.d.ts +1 -1
- package/dist/commonjs/crash.js +1 -1
- package/dist/commonjs/customHooks/crashHandler.d.ts +2 -1
- package/dist/commonjs/customHooks/crashHandler.js +7 -7
- package/dist/commonjs/customHooks/socketLogger.d.ts +26 -0
- package/dist/commonjs/customHooks/socketLogger.js +2 -0
- package/dist/commonjs/editor.d.ts +13 -0
- package/dist/commonjs/editor.js +1 -0
- package/dist/commonjs/helpers/index.d.ts +1 -0
- package/dist/commonjs/helpers/index.js +3 -3
- package/dist/commonjs/helpers/memoryManager.d.ts +1 -0
- package/dist/commonjs/helpers/memoryManager.js +1 -1
- package/dist/commonjs/helpers/searchQueryParser.d.ts +1 -1
- package/dist/commonjs/helpers/searchQueryParser.js +5 -1
- package/dist/commonjs/helpers/settingsStore.d.ts +1 -0
- package/dist/commonjs/helpers/settingsStore.js +1 -1
- package/dist/commonjs/helpers/shareFormatter.d.ts +3 -1
- package/dist/commonjs/helpers/shareFormatter.js +8 -7
- package/dist/commonjs/helpers/telemetry.js +1 -1
- package/dist/commonjs/i18n/index.d.ts +99 -1
- package/dist/commonjs/i18n/index.js +1 -1
- package/dist/commonjs/i18n/locales/ar.json +1 -1
- package/dist/commonjs/i18n/locales/bn.json +1 -0
- package/dist/commonjs/i18n/locales/de.json +1 -1
- package/dist/commonjs/i18n/locales/en.json +1 -1
- package/dist/commonjs/i18n/locales/es.json +1 -1
- package/dist/commonjs/i18n/locales/fr.json +1 -1
- package/dist/commonjs/i18n/locales/gu.json +1 -0
- package/dist/commonjs/i18n/locales/hi.json +1 -1
- package/dist/commonjs/i18n/locales/id.json +1 -0
- package/dist/commonjs/i18n/locales/it.json +1 -0
- package/dist/commonjs/i18n/locales/ja.json +1 -1
- package/dist/commonjs/i18n/locales/kn.json +1 -0
- package/dist/commonjs/i18n/locales/ko.json +1 -1
- package/dist/commonjs/i18n/locales/ml.json +1 -0
- package/dist/commonjs/i18n/locales/mr.json +1 -0
- package/dist/commonjs/i18n/locales/nl.json +1 -0
- package/dist/commonjs/i18n/locales/pa.json +1 -0
- package/dist/commonjs/i18n/locales/pl.json +1 -0
- package/dist/commonjs/i18n/locales/pt.json +1 -1
- package/dist/commonjs/i18n/locales/ru.json +1 -1
- package/dist/commonjs/i18n/locales/ta.json +1 -0
- package/dist/commonjs/i18n/locales/te.json +1 -0
- package/dist/commonjs/i18n/locales/tr.json +1 -0
- package/dist/commonjs/i18n/locales/vi.json +1 -0
- package/dist/commonjs/i18n/locales/zh.json +1 -1
- package/dist/commonjs/index.d.ts +16 -13
- package/dist/commonjs/index.js +5 -4
- package/dist/commonjs/native/NativeInspector.d.ts +4 -0
- package/dist/commonjs/native/NativeInspector.js +1 -1
- package/dist/commonjs/native/NativeNetworkInspector.d.ts +4 -0
- package/dist/commonjs/socket.d.ts +4 -0
- package/dist/commonjs/socket.js +1 -0
- package/dist/commonjs/styles/AppColors.d.ts +42 -2
- package/dist/commonjs/styles/AppColors.js +1 -1
- package/dist/commonjs/styles/common.js +1 -1
- package/dist/commonjs/styles/index.d.ts +30 -0
- package/dist/commonjs/styles/index.js +1 -1
- package/dist/commonjs/types/editor.d.ts +96 -0
- package/dist/commonjs/types/editor.js +1 -0
- package/dist/commonjs/types/enums.d.ts +40 -0
- package/dist/commonjs/types/enums.js +1 -1
- package/dist/commonjs/types/interfaces.d.ts +143 -1
- package/dist/esm/capture.d.ts +2 -0
- package/dist/esm/capture.js +1 -1
- package/dist/esm/components/AnalyticsDetail.js +31 -31
- package/dist/esm/components/AnalyticsEventCard.js +1 -1
- package/dist/esm/components/AnalyticsGraph.js +74 -74
- package/dist/esm/components/AnimatedBrandOwl.d.ts +7 -0
- package/dist/esm/components/AnimatedBrandOwl.js +175 -0
- package/dist/esm/components/AppHeaderLogo.d.ts +1 -0
- package/dist/esm/components/AppHeaderLogo.js +7 -5
- package/dist/esm/components/BrandCircleIcon.js +70 -70
- package/dist/esm/components/BrandSquareIcon.d.ts +5 -0
- package/dist/esm/components/BrandSquareIcon.js +139 -0
- package/dist/esm/components/ConsoleLogCard.d.ts +2 -1
- package/dist/esm/components/ConsoleLogCard.js +61 -77
- package/dist/esm/components/Inspector/AboutModal.js +85 -95
- package/dist/esm/components/Inspector/AnalyticsTab.js +24 -24
- package/dist/esm/components/Inspector/ConfirmationModal.d.ts +13 -0
- package/dist/esm/components/Inspector/ConfirmationModal.js +30 -0
- package/dist/esm/components/Inspector/ConsoleTab.js +48 -48
- package/dist/esm/components/Inspector/CrashTab.js +203 -168
- package/dist/esm/components/Inspector/DebuggingTab.js +29 -29
- package/dist/esm/components/Inspector/DeviceInfoTab.js +75 -75
- package/dist/esm/components/Inspector/FabLauncher.js +57 -60
- package/dist/esm/components/Inspector/FeatureUnderDevNotice.js +7 -7
- package/dist/esm/components/Inspector/FloatingCaptureWidget.d.ts +3 -0
- package/dist/esm/components/Inspector/FloatingCaptureWidget.js +54 -0
- package/dist/esm/components/Inspector/GlobalCrashScreenModal.d.ts +11 -0
- package/dist/esm/components/Inspector/GlobalCrashScreenModal.js +234 -0
- package/dist/esm/components/Inspector/InspectorHeader.js +162 -152
- package/dist/esm/components/Inspector/LanguageSelectorModal.d.ts +15 -0
- package/dist/esm/components/Inspector/LanguageSelectorModal.js +172 -0
- package/dist/esm/components/Inspector/MainScreen.js +130 -110
- package/dist/esm/components/Inspector/MediaGalleryTab.js +83 -78
- package/dist/esm/components/Inspector/MediaPreviewModal.d.ts +36 -0
- package/dist/esm/components/Inspector/MediaPreviewModal.js +345 -139
- package/dist/esm/components/Inspector/NetworkTab.js +130 -130
- package/dist/esm/components/Inspector/NpmUpdateToast.js +1 -1
- package/dist/esm/components/Inspector/PushCard.d.ts +3 -2
- package/dist/esm/components/Inspector/PushCard.js +23 -22
- package/dist/esm/components/Inspector/PushDetail.js +45 -36
- package/dist/esm/components/Inspector/PushTab.js +23 -23
- package/dist/esm/components/Inspector/ReduxDetail.js +42 -42
- package/dist/esm/components/Inspector/ReduxTab.js +20 -18
- package/dist/esm/components/Inspector/SecondaryTelemetryStrip.d.ts +2 -0
- package/dist/esm/components/Inspector/SecondaryTelemetryStrip.js +43 -0
- package/dist/esm/components/Inspector/SettingsPanel.js +526 -378
- package/dist/esm/components/Inspector/SocketCard.d.ts +5 -0
- package/dist/esm/components/Inspector/SocketCard.js +116 -0
- package/dist/esm/components/Inspector/SocketDetail.d.ts +4 -0
- package/dist/esm/components/Inspector/SocketDetail.js +327 -0
- package/dist/esm/components/Inspector/SocketFilterModal.d.ts +13 -0
- package/dist/esm/components/Inspector/SocketFilterModal.js +69 -0
- package/dist/esm/components/Inspector/SocketTab.d.ts +3 -0
- package/dist/esm/components/Inspector/SocketTab.js +112 -0
- package/dist/esm/components/Inspector/StorageTab.js +139 -137
- package/dist/esm/components/Inspector/SupportModal.d.ts +7 -0
- package/dist/esm/components/Inspector/SupportModal.js +125 -0
- package/dist/esm/components/Inspector/SupportPage.d.ts +5 -0
- package/dist/esm/components/Inspector/SupportPage.js +227 -0
- package/dist/esm/components/Inspector/TabBar.js +36 -35
- package/dist/esm/components/Inspector/UpdateAvailableModal.js +22 -22
- package/dist/esm/components/JsonViewer.js +66 -64
- package/dist/esm/components/LogCard.d.ts +3 -2
- package/dist/esm/components/LogCard.js +57 -55
- package/dist/esm/components/LogSyntaxHighlighter.js +5 -5
- package/dist/esm/components/ModuleErrorBoundary.js +23 -23
- package/dist/esm/components/NetworkIcons.d.ts +42 -0
- package/dist/esm/components/NetworkIcons.js +139 -6
- package/dist/esm/components/SegmentedTabs.js +7 -7
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/crash.d.ts +1 -1
- package/dist/esm/crash.js +1 -1
- package/dist/esm/customHooks/crashHandler.d.ts +2 -1
- package/dist/esm/customHooks/crashHandler.js +7 -7
- package/dist/esm/customHooks/socketLogger.d.ts +26 -0
- package/dist/esm/customHooks/socketLogger.js +2 -0
- package/dist/esm/editor.d.ts +13 -0
- package/dist/esm/editor.js +1 -0
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.js +4 -4
- package/dist/esm/helpers/memoryManager.d.ts +1 -0
- package/dist/esm/helpers/memoryManager.js +1 -1
- package/dist/esm/helpers/searchQueryParser.d.ts +1 -1
- package/dist/esm/helpers/searchQueryParser.js +5 -1
- package/dist/esm/helpers/settingsStore.d.ts +1 -0
- package/dist/esm/helpers/settingsStore.js +1 -1
- package/dist/esm/helpers/shareFormatter.d.ts +3 -1
- package/dist/esm/helpers/shareFormatter.js +8 -7
- package/dist/esm/helpers/telemetry.js +1 -1
- package/dist/esm/i18n/index.d.ts +99 -1
- package/dist/esm/i18n/index.js +1 -1
- package/dist/esm/i18n/locales/ar.json +1 -1
- package/dist/esm/i18n/locales/bn.json +1 -0
- package/dist/esm/i18n/locales/de.json +1 -1
- package/dist/esm/i18n/locales/en.json +1 -1
- package/dist/esm/i18n/locales/es.json +1 -1
- package/dist/esm/i18n/locales/fr.json +1 -1
- package/dist/esm/i18n/locales/gu.json +1 -0
- package/dist/esm/i18n/locales/hi.json +1 -1
- package/dist/esm/i18n/locales/id.json +1 -0
- package/dist/esm/i18n/locales/it.json +1 -0
- package/dist/esm/i18n/locales/ja.json +1 -1
- package/dist/esm/i18n/locales/kn.json +1 -0
- package/dist/esm/i18n/locales/ko.json +1 -1
- package/dist/esm/i18n/locales/ml.json +1 -0
- package/dist/esm/i18n/locales/mr.json +1 -0
- package/dist/esm/i18n/locales/nl.json +1 -0
- package/dist/esm/i18n/locales/pa.json +1 -0
- package/dist/esm/i18n/locales/pl.json +1 -0
- package/dist/esm/i18n/locales/pt.json +1 -1
- package/dist/esm/i18n/locales/ru.json +1 -1
- package/dist/esm/i18n/locales/ta.json +1 -0
- package/dist/esm/i18n/locales/te.json +1 -0
- package/dist/esm/i18n/locales/tr.json +1 -0
- package/dist/esm/i18n/locales/vi.json +1 -0
- package/dist/esm/i18n/locales/zh.json +1 -1
- package/dist/esm/index.d.ts +16 -13
- package/dist/esm/index.js +8 -7
- package/dist/esm/native/NativeInspector.d.ts +4 -0
- package/dist/esm/native/NativeInspector.js +1 -1
- package/dist/esm/native/NativeNetworkInspector.d.ts +4 -0
- package/dist/esm/socket.d.ts +4 -0
- package/dist/esm/socket.js +1 -0
- package/dist/esm/styles/AppColors.d.ts +42 -2
- package/dist/esm/styles/AppColors.js +1 -1
- package/dist/esm/styles/common.js +1 -1
- package/dist/esm/styles/index.d.ts +30 -0
- package/dist/esm/styles/index.js +1 -1
- package/dist/esm/types/editor.d.ts +96 -0
- package/dist/esm/types/editor.js +1 -0
- package/dist/esm/types/enums.d.ts +40 -0
- package/dist/esm/types/enums.js +1 -1
- package/dist/esm/types/interfaces.d.ts +143 -1
- package/editor.d.ts +1 -0
- package/editor.js +1 -0
- package/ios/NetworkInspectorModule.mm +531 -12
- package/package.json +213 -2
- package/react-native-inapp-inspector.podspec +1 -1
- package/src/native/NativeInspector.ts +65 -4
- package/src/native/NativeNetworkInspector.ts +4 -0
package/dist/esm/capture.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export type AudioSource = 'none' | 'app' | 'mic' | 'mixed';
|
|
|
5
5
|
export type RecordingFormat = 'mp4' | 'gif';
|
|
6
6
|
export declare const ScreenCapture: {
|
|
7
7
|
takeScreenshot: (options?: ScreenshotOptions) => Promise<ScreenshotResult | null>;
|
|
8
|
+
captureScreenshot: (options?: ScreenshotOptions) => Promise<ScreenshotResult | null>;
|
|
8
9
|
startRecording: (options?: RecordingOptions) => Promise<boolean>;
|
|
9
10
|
stopRecording: () => Promise<RecordingResult | null>;
|
|
10
11
|
isRecording: () => Promise<boolean>;
|
|
@@ -16,6 +17,7 @@ export declare const ScreenCapture: {
|
|
|
16
17
|
};
|
|
17
18
|
export declare const ScreenRecorder: {
|
|
18
19
|
takeScreenshot: (options?: ScreenshotOptions) => Promise<ScreenshotResult | null>;
|
|
20
|
+
captureScreenshot: (options?: ScreenshotOptions) => Promise<ScreenshotResult | null>;
|
|
19
21
|
startRecording: (options?: RecordingOptions) => Promise<boolean>;
|
|
20
22
|
stopRecording: () => Promise<RecordingResult | null>;
|
|
21
23
|
isRecording: () => Promise<boolean>;
|
package/dist/esm/capture.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{takeNativeScreenshot as
|
|
1
|
+
import{takeNativeScreenshot as r,startNativeVideoRecording as a,stopNativeVideoRecording as n,isNativeRecordingActive as i,playNativeVideo as c,convertNativeVideoToGif as o,fetchCapturedMediaList as d,deleteCapturedMediaFile as s,clearAllCapturedMediaFiles as u}from"./native/NativeInspector";export const ScreenCapture={takeScreenshot:async e=>r(e),captureScreenshot:async e=>r(e),startRecording:async e=>a(e),stopRecording:async()=>n(),isRecording:async()=>i(),playVideo:async e=>c(e),convertToGif:async(e,t)=>o(e,t),getMediaList:async()=>d(),deleteMedia:async e=>s(e),clearAllMedia:async()=>u()},ScreenRecorder=ScreenCapture;export default ScreenCapture;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useState as q,useMemo as
|
|
1
|
+
import{useState as q,useMemo as P}from"react";import{Pressable as Ce,ScrollView as Te,StyleSheet as Ve,Text as B,TextInput as Be,View as C}from"react-native";import G from"./CopyButton";import Ie from"./ShareButton";import Y from"./JsonViewer";import Se from"./SegmentedTabs";import Q from"./HighlightText";import Pe from"./AnimatedEntrance";import{AppFonts as S}from"../styles/AppFonts";import{AppColors as e}from"../styles/AppColors";import{getSize as Re,formatDateTime as De}from"../helpers";import{shareAnalyticsReport as We}from"../helpers/shareFormatter";import{getEventCategory as He}from"../helpers/gaAnalyticsRegistry";import{useTranslation as Fe}from"../i18n";import{SparkleIcon as X,ClockIcon as Ae,SearchIcon as Ne,ClearIcon as Oe,LayersIcon as Ee,CartIcon as Ke,GlobeIcon as Le,BoltIcon as Me,PinIcon as $e,MoneyIcon as _e,PrettyIcon as Ue,TableIcon as Z,DocIcon as Je,PackageIcon as Ge}from"./NetworkIcons";const Ye=({event:T})=>{const{t:k}=Fe(),[j,ee]=q("overview"),[R,v]=q(""),I=P(()=>T.params??{},[T.params]),F=P(()=>T.userProperties??{},[T.userProperties]),A=P(()=>Object.keys(I),[I]),D=P(()=>Object.keys(F),[F]),M=P(()=>He(T.name,I),[T.name,I]),O=P(()=>({name:T.name,timestamp:T.timestamp,source:T.source,...T.screenName?{screenName:T.screenName}:{},...T.screenClass?{screenClass:T.screenClass}:{},...T.userId?{userId:T.userId}:{},...T.sessionId?{sessionId:T.sessionId}:{},...T.trackingId?{trackingId:T.trackingId}:{},params:I,...D.length>0?{userProperties:F}:{}}),[T,I,D.length,F]),E=P(()=>{const V=I.value??I.price,z=I.currency??"USD";return V!=null&&!isNaN(Number(V))?{amount:Number(V).toFixed(2),currency:String(z).toUpperCase()}:null},[I]),$=P(()=>Array.isArray(I.items)?I.items.length:null,[I.items]),_=P(()=>T.screenName||I.firebase_screen||I.screen_name||I.page_title||T.screenClass||I.firebase_screen_class,[T.screenName,T.screenClass,I]),U=P(()=>{const V=Object.entries(I);if(!R.trim())return V;const z=R.toLowerCase();return V.filter(([K,W])=>{const L=typeof W=="object"?JSON.stringify(W):String(W);return K.toLowerCase().includes(z)||L.toLowerCase().includes(z)})},[I,R]),H=P(()=>{switch(M){case"ecommerce":return{label:k("analytics.ecommerceCategory"),color:e.amber700,bg:e.amber100,border:e.amber200,icon:V=><Ke color={V}size={11}/>};case"page_view":return{label:k("analytics.screensCategory"),color:e.sky600,bg:e.sky100,border:e.sky400,icon:V=><Le color={V}size={11}/>};case"system":return{label:k("analytics.systemCategory"),color:e.purple,bg:e.purple100,border:e.purple200,icon:V=><Me color={V}size={11}/>};default:return{label:k("analytics.customCategory"),color:e.brandPurple,bg:e.purple100,border:e.purple200,icon:V=><X color={V}size={11}/>}}},[M,k]),re=[{key:"overview",label:`${k("analytics.overviewTab")} (${A.length})`,icon:V=><Z color={V?e.white:e.grayText}size={12}/>},{key:"json",label:"JSON Payload",icon:V=><Ue color={V?e.white:e.grayText}size={12}/>}];return<Te style={r.scroll}contentContainerStyle={r.content}showsVerticalScrollIndicator contentInsetAdjustmentBehavior="never"automaticallyAdjustContentInsets={!1}>
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
<C style={r.heroCard}>
|
|
@@ -16,7 +16,7 @@ import{useState as q,useMemo as z}from"react";import{Pressable as Ce,ScrollView
|
|
|
16
16
|
<C style={[r.sourceBadge,T.source==="firebase"?{backgroundColor:e.amberBg,borderColor:e.amberBorder}:{backgroundColor:e.purpleBg,borderColor:e.purpleBorder}]}>
|
|
17
17
|
<C style={[r.sourceDot,{backgroundColor:T.source==="firebase"?e.firebaseOrange:e.purple}]}/>
|
|
18
18
|
<B style={[r.sourceBadgeText,{color:T.source==="firebase"?e.amber800Warm:e.purple}]}>
|
|
19
|
-
{T.source==="firebase"?
|
|
19
|
+
{T.source==="firebase"?k("analytics.sourceFirebase"):k("analytics.sourceCustom")}
|
|
20
20
|
</B>
|
|
21
21
|
</C>
|
|
22
22
|
|
|
@@ -31,8 +31,8 @@ import{useState as q,useMemo as z}from"react";import{Pressable as Ce,ScrollView
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
<C style={{flexDirection:"row",alignItems:"center",gap:6}}>
|
|
34
|
-
<
|
|
35
|
-
<G value={JSON.stringify(O,null,2)}label={
|
|
34
|
+
<Ie onShare={()=>We(T)}/>
|
|
35
|
+
<G value={JSON.stringify(O,null,2)}label={k("analytics.eventDetails")}/>
|
|
36
36
|
</C>
|
|
37
37
|
</C>
|
|
38
38
|
|
|
@@ -46,7 +46,7 @@ import{useState as q,useMemo as z}from"react";import{Pressable as Ce,ScrollView
|
|
|
46
46
|
|
|
47
47
|
<C style={r.metaRow}>
|
|
48
48
|
<C style={r.timePill}>
|
|
49
|
-
<
|
|
49
|
+
<Ae color={e.purple}size={11}/>
|
|
50
50
|
<B style={r.timeText}>
|
|
51
51
|
{De(T.timestamp)}
|
|
52
52
|
</B>
|
|
@@ -63,17 +63,17 @@ import{useState as q,useMemo as z}from"react";import{Pressable as Ce,ScrollView
|
|
|
63
63
|
|
|
64
64
|
<C style={r.metricsBar}>
|
|
65
65
|
<C style={r.metricPill}>
|
|
66
|
-
<B style={r.metricLabel}>Params
|
|
67
|
-
<B style={r.metricValue}>{
|
|
66
|
+
<B style={r.metricLabel}>{k("analytics.metricParams","Params:")}</B>
|
|
67
|
+
<B style={r.metricValue}>{A.length}</B>
|
|
68
68
|
</C>
|
|
69
69
|
|
|
70
70
|
{D.length>0&&<C style={r.metricPill}>
|
|
71
|
-
<B style={r.metricLabel}>User Props
|
|
71
|
+
<B style={r.metricLabel}>{k("analytics.metricUserProps","User Props:")}</B>
|
|
72
72
|
<B style={r.metricValue}>{D.length}</B>
|
|
73
73
|
</C>}
|
|
74
74
|
|
|
75
75
|
<C style={r.metricPill}>
|
|
76
|
-
<B style={r.metricLabel}>Size
|
|
76
|
+
<B style={r.metricLabel}>{k("analytics.metricSize","Size:")}</B>
|
|
77
77
|
<B style={r.metricValue}>{Re(O)}</B>
|
|
78
78
|
</C>
|
|
79
79
|
|
|
@@ -87,7 +87,7 @@ import{useState as q,useMemo as z}from"react";import{Pressable as Ce,ScrollView
|
|
|
87
87
|
{$!==null&&<C style={r.itemsPill}>
|
|
88
88
|
<Ge size={12}color={e.blue700}/>
|
|
89
89
|
<B style={r.itemsValue}>
|
|
90
|
-
{
|
|
90
|
+
{k("analytics.metricItems",{count:$},"{{count}} items")}
|
|
91
91
|
</B>
|
|
92
92
|
</C>}
|
|
93
93
|
</C>
|
|
@@ -95,28 +95,28 @@ import{useState as q,useMemo as z}from"react";import{Pressable as Ce,ScrollView
|
|
|
95
95
|
|
|
96
96
|
|
|
97
97
|
<C style={r.tabsWrap}>
|
|
98
|
-
<
|
|
98
|
+
<Se tabs={re}activeKey={j}onChange={V=>ee(V)}/>
|
|
99
99
|
</C>
|
|
100
100
|
|
|
101
101
|
|
|
102
|
-
{
|
|
102
|
+
{j==="overview"&&<C style={r.tabContent}>
|
|
103
103
|
|
|
104
104
|
{(T.userId||T.sessionId||T.trackingId)&&<C style={r.sectionCard}>
|
|
105
105
|
<C style={r.sectionHeader}>
|
|
106
106
|
<Ee color={e.purple}size={12}/>
|
|
107
|
-
<B style={r.sectionTitle}>SESSION & IDENTITY</B>
|
|
107
|
+
<B style={r.sectionTitle}>{k("analytics.sessionIdentity","SESSION & IDENTITY")}</B>
|
|
108
108
|
</C>
|
|
109
109
|
<C style={r.sectionBody}>
|
|
110
110
|
{T.userId&&<C style={r.kvRow}>
|
|
111
|
-
<B style={r.kvKey}>User ID:</B>
|
|
111
|
+
<B style={r.kvKey}>{k("analytics.userId","User ID")}:</B>
|
|
112
112
|
<B style={r.kvVal}selectable>{T.userId}</B>
|
|
113
113
|
</C>}
|
|
114
114
|
{T.sessionId&&<C style={r.kvRow}>
|
|
115
|
-
<B style={r.kvKey}>Session ID:</B>
|
|
115
|
+
<B style={r.kvKey}>{k("analytics.sessionId","Session ID")}:</B>
|
|
116
116
|
<B style={r.kvVal}selectable>{T.sessionId}</B>
|
|
117
117
|
</C>}
|
|
118
118
|
{T.trackingId&&<C style={r.kvRow}>
|
|
119
|
-
<B style={r.kvKey}>Tracking ID:</B>
|
|
119
|
+
<B style={r.kvKey}>{k("analytics.trackingId","Tracking ID")}:</B>
|
|
120
120
|
<B style={r.kvVal}selectable>{T.trackingId}</B>
|
|
121
121
|
</C>}
|
|
122
122
|
</C>
|
|
@@ -128,34 +128,34 @@ import{useState as q,useMemo as z}from"react";import{Pressable as Ce,ScrollView
|
|
|
128
128
|
<C style={{flexDirection:"row",alignItems:"center",gap:6}}>
|
|
129
129
|
<Z color={e.brandPurple}size={12}/>
|
|
130
130
|
<B style={r.sectionTitle}>
|
|
131
|
-
EVENT PARAMETERS ({
|
|
131
|
+
{k("analytics.eventParameters",{count:A.length},"EVENT PARAMETERS ({{count}})")}
|
|
132
132
|
</B>
|
|
133
133
|
</C>
|
|
134
134
|
<B style={r.sectionSubtitle}>
|
|
135
|
-
Key-Value Attributes
|
|
135
|
+
{k("analytics.keyValueAttributes","Key-Value Attributes")}
|
|
136
136
|
</B>
|
|
137
137
|
</C>
|
|
138
138
|
|
|
139
139
|
|
|
140
|
-
{
|
|
141
|
-
<
|
|
142
|
-
<Be placeholder="Filter parameters by key or value..."placeholderTextColor={e.grayTextWeak}value={R}onChangeText={v}style={r.searchInput}autoCorrect={!1}autoCapitalize="none"/>
|
|
140
|
+
{A.length>4&&<C style={r.searchBar}>
|
|
141
|
+
<Ne color={e.grayTextWeak}size={13}/>
|
|
142
|
+
<Be placeholder={k("analytics.filterParamsPlaceholder","Filter parameters by key or value...")}placeholderTextColor={e.grayTextWeak}value={R}onChangeText={v}style={r.searchInput}autoCorrect={!1}autoCapitalize="none"/>
|
|
143
143
|
{R.length>0&&<Ce onPress={()=>v("")}hitSlop={8}>
|
|
144
144
|
<Oe color={e.grayTextWeak}size={13}/>
|
|
145
145
|
</Ce>}
|
|
146
146
|
</C>}
|
|
147
147
|
|
|
148
|
-
{
|
|
149
|
-
<
|
|
148
|
+
{A.length===0?<C style={r.emptyParamsBox}>
|
|
149
|
+
<Je color={e.grayTextWeak}size={16}/>
|
|
150
150
|
<B style={r.emptyParamsText}>
|
|
151
|
-
No custom parameters recorded for this event.
|
|
151
|
+
{k("analytics.noParamsRecorded","No custom parameters recorded for this event.")}
|
|
152
152
|
</B>
|
|
153
|
-
</C>:
|
|
153
|
+
</C>:U.length===0?<C style={r.emptyParamsBox}>
|
|
154
154
|
<B style={r.emptyParamsText}>
|
|
155
|
-
No parameters matching "{
|
|
155
|
+
{k("analytics.noParamsMatching",{search:R},'No parameters matching "{{search}}"')}
|
|
156
156
|
</B>
|
|
157
157
|
</C>:<C style={r.paramList}>
|
|
158
|
-
{
|
|
158
|
+
{U.map(([V,z],K)=>{const W=typeof z=="object"&&z!==null,L=Array.isArray(z);let N=typeof z;z===null?N="null":L?N=`array [${z.length}]`:W&&(N="object");const J=W?JSON.stringify(z,null,2):String(z),te=V==="value"||V==="price"||V==="currency"||V==="screen_name"||V==="item_id"||V==="item_name";return<Pe key={V}index={K}distance={4}>
|
|
159
159
|
<C style={r.paramCard}>
|
|
160
160
|
|
|
161
161
|
<C style={r.paramCardHeader}>
|
|
@@ -163,17 +163,17 @@ import{useState as q,useMemo as z}from"react";import{Pressable as Ce,ScrollView
|
|
|
163
163
|
<Q text={V}search={R}style={[r.paramKeyText,te&&r.paramKeyHighlighted]}highlightStyle={r.highlight}/>
|
|
164
164
|
<C style={r.typeBadge}>
|
|
165
165
|
<B style={r.typeBadgeText}>
|
|
166
|
-
{
|
|
166
|
+
{N.toUpperCase()}
|
|
167
167
|
</B>
|
|
168
168
|
</C>
|
|
169
169
|
</C>
|
|
170
170
|
|
|
171
|
-
<G value={
|
|
171
|
+
<G value={J}label={V}/>
|
|
172
172
|
</C>
|
|
173
173
|
|
|
174
174
|
|
|
175
175
|
<C style={r.paramValBox}>
|
|
176
|
-
{W?<Y data={
|
|
176
|
+
{W?<Y data={z}search={R}hideTabs wrap/>:<Q text={J}search={R}style={r.paramValText}highlightStyle={r.highlight}selectable/>}
|
|
177
177
|
</C>
|
|
178
178
|
</C>
|
|
179
179
|
</Pe>})}
|
|
@@ -200,7 +200,7 @@ import{useState as q,useMemo as z}from"react";import{Pressable as Ce,ScrollView
|
|
|
200
200
|
</C>}
|
|
201
201
|
|
|
202
202
|
|
|
203
|
-
{
|
|
203
|
+
{j==="json"&&<C style={r.jsonContainer}>
|
|
204
204
|
<Y data={O}defaultExpandDepth={2}fullHeight/>
|
|
205
205
|
</C>}
|
|
206
206
|
</Te>},r=Ve.create({scroll:{flex:1,backgroundColor:e.grayBackground},content:{paddingTop:12,paddingBottom:40,paddingHorizontal:12},heroCard:{backgroundColor:e.white,borderRadius:12,padding:14,borderWidth:1,borderColor:e.dividerColor,shadowColor:e.primaryBlack,shadowOffset:{width:0,height:1},shadowOpacity:.04,shadowRadius:4,elevation:2,marginBottom:12},heroTopRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:10},idBadge:{paddingHorizontal:6,paddingVertical:2.5,borderRadius:5,backgroundColor:`${e.slate500}12`,borderWidth:1,borderColor:`${e.slate500}22`},idBadgeText:{fontFamily:S.interBold,fontSize:10,color:e.grayTextWeak,letterSpacing:.2},sourceBadge:{flexDirection:"row",alignItems:"center",gap:4.5,paddingHorizontal:7,paddingVertical:3,borderRadius:5,borderWidth:1},sourceDot:{width:6,height:6,borderRadius:3},sourceBadgeText:{fontFamily:S.interBold,fontSize:9.5,letterSpacing:.4},catBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:7,paddingVertical:3,borderRadius:5,borderWidth:1},catBadgeText:{fontFamily:S.interBold,fontSize:9.5,letterSpacing:.3},titleRow:{marginBottom:8},eventTitle:{fontFamily:S.interBold,fontSize:16,color:e.primaryBlack,lineHeight:22},metaRow:{flexDirection:"row",alignItems:"center",gap:6,flexWrap:"wrap",marginBottom:10},timePill:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:`${e.purple}14`,paddingHorizontal:7,paddingVertical:3,borderRadius:5,borderWidth:1,borderColor:`${e.purple}2E`},timeText:{fontFamily:S.interMedium,fontSize:10.5,color:e.purple},screenPill:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:`${e.sky500}14`,paddingHorizontal:7,paddingVertical:3,borderRadius:5,borderWidth:1,borderColor:`${e.sky500}2E`,maxWidth:220},screenText:{fontFamily:S.interMedium,fontSize:10.5,color:e.sky600},metricsBar:{flexDirection:"row",alignItems:"center",gap:6,flexWrap:"wrap",paddingTop:8,borderTopWidth:1,borderTopColor:e.dividerColor},metricPill:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:e.grayBackground,paddingHorizontal:7,paddingVertical:3,borderRadius:5,borderWidth:1,borderColor:e.dividerColor},metricLabel:{fontFamily:S.interMedium,fontSize:10.5,color:e.grayTextWeak},metricValue:{fontFamily:S.interBold,fontSize:10.5,color:e.primaryBlack},revenuePill:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:e.emeraldBg,paddingHorizontal:7,paddingVertical:3,borderRadius:5,borderWidth:1,borderColor:e.emeraldBorder},revenueValue:{fontFamily:S.interBold,fontSize:10.5,color:e.greenSuccessDark},itemsPill:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:e.blueTintBg,paddingHorizontal:7,paddingVertical:3,borderRadius:5,borderWidth:1,borderColor:e.sky100},itemsValue:{fontFamily:S.interBold,fontSize:10.5,color:e.blue700},tabsWrap:{marginBottom:12},tabContent:{gap:12},sectionCard:{backgroundColor:e.white,borderRadius:12,padding:12,borderWidth:1,borderColor:e.dividerColor,shadowColor:e.primaryBlack,shadowOffset:{width:0,height:1},shadowOpacity:.04,shadowRadius:4,elevation:2},sectionHeader:{flexDirection:"row",alignItems:"center",gap:6,marginBottom:10,paddingBottom:6,borderBottomWidth:1,borderBottomColor:e.dividerColor},sectionHeaderBetween:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:10,paddingBottom:6,borderBottomWidth:1,borderBottomColor:e.dividerColor},sectionTitle:{fontFamily:S.interBold,fontSize:11,color:e.slate700,letterSpacing:.4},sectionSubtitle:{fontFamily:S.interMedium,fontSize:10,color:e.grayTextWeak},sectionBody:{gap:6},kvRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:3},kvKey:{fontFamily:S.interMedium,fontSize:11,color:e.grayTextWeak},kvVal:{fontFamily:S.interBold,fontSize:11,color:e.primaryBlack},searchBar:{flexDirection:"row",alignItems:"center",backgroundColor:e.grayBackground,borderRadius:8,paddingHorizontal:8,paddingVertical:5,borderWidth:1,borderColor:e.dividerColor,marginBottom:10,gap:6},searchInput:{flex:1,fontFamily:S.interRegular,fontSize:11,color:e.primaryBlack,paddingVertical:0},emptyParamsBox:{alignItems:"center",justifyContent:"center",paddingVertical:20,gap:6},emptyParamsText:{fontFamily:S.interMedium,fontSize:11,color:e.grayTextWeak},paramList:{gap:8},paramCard:{backgroundColor:e.grayBackground,borderRadius:8,padding:9,borderWidth:1,borderColor:e.dividerColor},paramCardHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:4},paramKeyText:{fontFamily:S.interBold,fontSize:11.5,color:e.primaryBlack},paramKeyHighlighted:{color:e.brandPurple},typeBadge:{backgroundColor:e.slate200,paddingHorizontal:5,paddingVertical:1.5,borderRadius:3},typeBadgeText:{fontFamily:S.interBold,fontSize:8.5,color:e.slate700,letterSpacing:.3},paramValBox:{marginTop:2},paramValText:{fontFamily:S.interRegular,fontSize:11,color:e.slate700,lineHeight:16},jsonContainer:{borderRadius:12,borderWidth:1,borderColor:e.dividerColor,overflow:"hidden",backgroundColor:e.white,minHeight:300},highlight:{backgroundColor:e.yellow200,color:e.yellow800,fontFamily:S.interBold}});export default Ye;
|
|
@@ -97,4 +97,4 @@ import K,{useEffect as U,useRef as q}from"react";import{Animated as F,StyleSheet
|
|
|
97
97
|
</C>
|
|
98
98
|
</C>
|
|
99
99
|
</Te>
|
|
100
|
-
</C>}),r=j.create({container:{paddingHorizontal:
|
|
100
|
+
</C>}),r=j.create({container:{paddingHorizontal:5,paddingVertical:4,height:86,justifyContent:"center"},gapContainer:{flexDirection:"row",alignItems:"center",justifyContent:"center",marginVertical:4,gap:8},gapLine:{flex:1,height:1,backgroundColor:`${e.dividerColor}`},gapText:{fontFamily:T.interBold,fontSize:9.5,color:e.grayTextWeak,letterSpacing:.5},modernCard:{backgroundColor:e.white,borderRadius:10,borderWidth:1,borderColor:e.dividerColor,paddingHorizontal:8,paddingVertical:8,shadowColor:e.black,shadowOpacity:.03,shadowRadius:3,shadowOffset:{width:0,height:1},elevation:1,overflow:"hidden",height:78,justifyContent:"space-between"},cardHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",height:24},iconBadge:{width:22,height:22,borderRadius:6,borderWidth:1,alignItems:"center",justifyContent:"center"},eventName:{fontFamily:T.interBold,fontSize:13,lineHeight:17,letterSpacing:.1,color:e.primaryBlack},timestamp:{fontFamily:T.interMedium,fontSize:10.5,lineHeight:14,color:e.grayTextWeak},highlight:{backgroundColor:e.yellowHighlight,color:e.primaryBlack,borderRadius:2},cardBody:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:24,overflow:"hidden"},chipsRow:{flexDirection:"row",alignItems:"center",flexWrap:"nowrap",gap:6,flex:1,overflow:"hidden"},chip:{flexDirection:"row",alignItems:"center",paddingHorizontal:6,paddingVertical:2.5,borderRadius:4.5,borderWidth:1,gap:3.5},chipText:{fontFamily:T.interMedium,fontSize:10,lineHeight:13,color:e.grayText},screenDot:{width:5,height:5,borderRadius:2.5},duplicateBadge:{backgroundColor:e.roseBg,borderColor:e.roseBorder,borderWidth:1,paddingHorizontal:5,paddingVertical:1.5,borderRadius:4},duplicateText:{fontFamily:T.interBold,fontSize:8.5,color:e.rose600,textTransform:"uppercase"},idBadge:{paddingHorizontal:5.5,paddingVertical:2,borderRadius:5,backgroundColor:`${e.slate500}12`,borderWidth:1,borderColor:`${e.slate500}22`},idBadgeText:{fontFamily:T.interBold,fontSize:9.5,color:e.grayTextWeak,letterSpacing:.2},categoryBadge:{borderWidth:1,paddingHorizontal:5,paddingVertical:1.5,borderRadius:4},categoryText:{fontFamily:T.interBold,fontSize:8.5,textTransform:"uppercase",letterSpacing:.4}});export default We;
|
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
import
|
|
2
|
-
<
|
|
1
|
+
import L from"react";import{View as T,Text as S,ScrollView as W,Dimensions as Y,StyleSheet as Z}from"react-native";import A,{Rect as Q,Text as O,Line as U,Circle as D,Path as X,Defs as Tt,LinearGradient as St,Stop as P}from"react-native-svg";import{AppColors as a}from"../styles/AppColors";import{AppFonts as C}from"../styles/AppFonts";import{useTranslation as Bt}from"../i18n";const R=24,G=12,Ct=({event:n,accentColor:s})=>{const{t:o}=Bt(),e=n.params||{},i=(Array.isArray(e.items)?e.items:null)?.filter(r=>typeof r.price=="number")||[],t=[];Object.entries(e).forEach(([r,l])=>{typeof l=="number"&&!r.toLowerCase().includes("id")&&!r.toLowerCase().includes("timestamp")&&t.push({key:r,value:l})});const c=[],b=/^\d{4}-\d{2}-\d{2}/;Object.entries(e).forEach(([r,l])=>{if(typeof l=="string"&&l.length>=10&&b.test(l)){const V=new Date(l);isNaN(V.getTime())||c.push({key:r,date:V})}});const B={};Object.values(e).forEach(r=>{let l=typeof r;r===null&&(l="null"),Array.isArray(r)&&(l="array"),B[l]=(B[l]||0)+1});const v=[a.purple,a.skyBlue,a.amber500,a.greenColor],M=Object.entries(B).map(([r,l],V)=>({label:r,value:l,color:v[V%v.length]})),F=[];Object.entries(e).forEach(([r,l])=>{typeof l=="string"&&F.push({label:r,value:l.length})}),F.sort((r,l)=>l.value-r.value);const z=F.slice(0,5),N=i.length>0,E=t.length>0,_=c.length>0,J=z.length>0,K=M.length>0,$=Y.get("window").width-60-40;return<T style={k.container}>
|
|
2
|
+
<S style={k.headerTitle}>{o("analytics.dataVisualization","Data Visualization")}</S>
|
|
3
3
|
|
|
4
|
-
{
|
|
5
|
-
<
|
|
6
|
-
<
|
|
4
|
+
{K&&<T style={k.chartBlock}>
|
|
5
|
+
<S style={k.chartTitle}>{o("analytics.dataTypesBreakdown","Data Types Breakdown")}</S>
|
|
6
|
+
<Mt data={M}/>
|
|
7
7
|
</T>}
|
|
8
8
|
|
|
9
|
-
{
|
|
10
|
-
<
|
|
11
|
-
<
|
|
9
|
+
{J&&<T style={k.chartBlock}>
|
|
10
|
+
<S style={k.chartTitle}>{o("analytics.highestPayloadStrings","Highest Payload Strings")}</S>
|
|
11
|
+
<H data={z}accentColor={a.purple}maxBarWidth={$}isGradient/>
|
|
12
12
|
</T>}
|
|
13
13
|
|
|
14
|
-
{
|
|
15
|
-
<
|
|
16
|
-
<
|
|
14
|
+
{E&&<T style={k.chartBlock}>
|
|
15
|
+
<S style={k.chartTitle}>{o("analytics.topLevelMetrics","Top-Level Metrics")}</S>
|
|
16
|
+
<Vt data={t.map(r=>({label:r.key,value:r.value}))}accentColor={s}/>
|
|
17
17
|
</T>}
|
|
18
18
|
|
|
19
|
-
{
|
|
20
|
-
<
|
|
21
|
-
<
|
|
19
|
+
{_&&<T style={k.chartBlock}>
|
|
20
|
+
<S style={k.chartTitle}>{o("analytics.importantDates","Important Dates")}</S>
|
|
21
|
+
<Dt data={c.map(r=>({label:r.key,date:r.date}))}accentColor={s}/>
|
|
22
22
|
</T>}
|
|
23
23
|
|
|
24
|
-
{
|
|
25
|
-
<
|
|
26
|
-
<
|
|
24
|
+
{N&&<T style={k.chartBlock}>
|
|
25
|
+
<S style={k.chartTitle}>{o("analytics.itemPrices","Item Prices")}</S>
|
|
26
|
+
<H data={i.map((r,l)=>({label:r.item_name||r.item_id||`Item ${l+1}`,value:r.price}))}accentColor={a.successGreen}maxBarWidth={$}isGradient={!1}/>
|
|
27
27
|
</T>}
|
|
28
|
-
</T>},I=(
|
|
29
|
-
M ${
|
|
30
|
-
A ${
|
|
31
|
-
L ${
|
|
32
|
-
A ${
|
|
28
|
+
</T>},I=(n,s,o,e)=>{const h=(e-90)*Math.PI/180;return{x:n+o*Math.cos(h),y:s+o*Math.sin(h)}},vt=(n,s,o,e,h,i)=>{const t=I(n,s,o,i),c=I(n,s,o,h),b=I(n,s,e,i),B=I(n,s,e,h),v=i-h<=180?"0":"1";return`
|
|
29
|
+
M ${t.x} ${t.y}
|
|
30
|
+
A ${o} ${o} 0 ${v} 0 ${c.x} ${c.y}
|
|
31
|
+
L ${B.x} ${B.y}
|
|
32
|
+
A ${e} ${e} 0 ${v} 1 ${b.x} ${b.y}
|
|
33
33
|
Z
|
|
34
|
-
`},
|
|
34
|
+
`},Mt=({data:n})=>{const s=n.reduce((t,c)=>t+c.value,0);if(s===0)return null;let o=0;const e=50,h=30,i=60;return<T style={{flexDirection:"row",alignItems:"center"}}>
|
|
35
35
|
<A width="120"height="120"viewBox="0 0 120 120">
|
|
36
|
-
{
|
|
37
|
-
<D cx={
|
|
38
|
-
<D cx={
|
|
39
|
-
|
|
36
|
+
{n.map((t,c)=>{if(t.value===0)return null;const b=t.value/s*360,B=o,v=o+b;if(o+=b,b===360)return<L.Fragment key={c}>
|
|
37
|
+
<D cx={i}cy={i}r={e}fill={t.color}/>
|
|
38
|
+
<D cx={i}cy={i}r={h}fill={a.primaryLight}/>
|
|
39
|
+
</L.Fragment>;const M=vt(i,i,e,h,B,v);return<X key={c}d={M}fill={t.color}/>})}
|
|
40
40
|
</A>
|
|
41
41
|
<T style={{marginLeft:16,flex:1,gap:6}}>
|
|
42
|
-
{
|
|
43
|
-
<T style={{width:10,height:10,borderRadius:5,backgroundColor:
|
|
44
|
-
<
|
|
45
|
-
{
|
|
46
|
-
</
|
|
42
|
+
{n.map((t,c)=>t.value===0?null:<T key={c}style={{flexDirection:"row",alignItems:"center",gap:6}}>
|
|
43
|
+
<T style={{width:10,height:10,borderRadius:5,backgroundColor:t.color}}/>
|
|
44
|
+
<S style={{fontFamily:C.interMedium,fontSize:11,color:a.grayTextStrong}}>
|
|
45
|
+
{t.label} ({t.value})
|
|
46
|
+
</S>
|
|
47
47
|
</T>)}
|
|
48
48
|
</T>
|
|
49
|
-
</T>},
|
|
50
|
-
{
|
|
49
|
+
</T>},Vt=({data:n,accentColor:s})=>{const o=Math.max(...n.map(t=>Math.abs(t.value)),1),e=26,h=5,i=2*Math.PI*e;return<W horizontal showsHorizontalScrollIndicator={!1}contentContainerStyle={{gap:16,paddingRight:16,paddingTop:6,paddingBottom:6}}>
|
|
50
|
+
{n.map(t=>{const c=Math.min(Math.abs(t.value)/o,1),b=Math.max(i-c*i,.001);return<T key={t.label}style={{alignItems:"center",width:70}}>
|
|
51
51
|
<A width="60"height="60"viewBox="0 0 60 60">
|
|
52
|
-
<D cx="30"cy="30"r={
|
|
53
|
-
<D cx="30"cy="30"r={
|
|
52
|
+
<D cx="30"cy="30"r={e}stroke={a.grayBorderSecondary}strokeWidth={h}fill="none"/>
|
|
53
|
+
<D cx="30"cy="30"r={e}stroke={s}strokeWidth={h}fill="none"strokeLinecap="round"strokeDasharray={i}strokeDashoffset={b}rotation="-90"origin="30, 30"/>
|
|
54
54
|
</A>
|
|
55
55
|
<T style={{position:"absolute",top:20,height:20,width:60,justifyContent:"center",alignItems:"center"}}>
|
|
56
|
-
<
|
|
57
|
-
{
|
|
58
|
-
</
|
|
56
|
+
<S style={{fontFamily:C.interBold,fontSize:13,color:a.primaryBlack,textAlign:"center"}}>
|
|
57
|
+
{t.value>=1e3?(t.value/1e3).toFixed(1)+"k":t.value}
|
|
58
|
+
</S>
|
|
59
59
|
</T>
|
|
60
|
-
<
|
|
61
|
-
{
|
|
62
|
-
</
|
|
60
|
+
<S style={{fontFamily:C.interMedium,fontSize:10,color:a.grayTextWeak,marginTop:6,textAlign:"center"}}numberOfLines={1}>
|
|
61
|
+
{t.label}
|
|
62
|
+
</S>
|
|
63
63
|
</T>})}
|
|
64
|
-
</
|
|
65
|
-
{
|
|
66
|
-
<T style={{width:58,height:62,backgroundColor:
|
|
64
|
+
</W>},Dt=({data:n,accentColor:s})=>{const o=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return<W horizontal showsHorizontalScrollIndicator={!1}contentContainerStyle={{gap:16,paddingRight:16,paddingTop:6,paddingBottom:6}}>
|
|
65
|
+
{n.map((e,h)=>{const i=o[e.date.getMonth()],t=e.date.getDate(),c=e.date.getFullYear();return<T key={e.label+h}style={{width:70,alignItems:"center"}}>
|
|
66
|
+
<T style={{width:58,height:62,backgroundColor:a.white,borderRadius:8,borderWidth:1,borderColor:a.grayBorderSecondary,overflow:"hidden",shadowColor:a.black,shadowOpacity:.05,shadowRadius:4,shadowOffset:{width:0,height:2},elevation:2}}>
|
|
67
67
|
|
|
68
68
|
<T style={{backgroundColor:s,height:18,justifyContent:"center",alignItems:"center"}}>
|
|
69
|
-
<
|
|
70
|
-
{
|
|
71
|
-
</
|
|
69
|
+
<S style={{fontFamily:C.interBold,fontSize:9,color:a.white,textTransform:"uppercase",letterSpacing:.5}}>
|
|
70
|
+
{i} {c}
|
|
71
|
+
</S>
|
|
72
72
|
</T>
|
|
73
73
|
|
|
74
|
-
<T style={{flex:1,justifyContent:"center",alignItems:"center",backgroundColor:
|
|
75
|
-
<
|
|
76
|
-
{
|
|
77
|
-
</
|
|
74
|
+
<T style={{flex:1,justifyContent:"center",alignItems:"center",backgroundColor:a.grayBackground}}>
|
|
75
|
+
<S style={{fontFamily:C.interBold,fontSize:24,color:a.primaryBlack}}>
|
|
76
|
+
{t}
|
|
77
|
+
</S>
|
|
78
78
|
</T>
|
|
79
79
|
</T>
|
|
80
80
|
|
|
81
|
-
<
|
|
82
|
-
{
|
|
83
|
-
</
|
|
81
|
+
<S style={{fontFamily:C.interMedium,fontSize:10,color:a.grayTextWeak,marginTop:8,textAlign:"center"}}numberOfLines={2}>
|
|
82
|
+
{e.label.replace(/_/g," ")}
|
|
83
|
+
</S>
|
|
84
84
|
</T>})}
|
|
85
|
-
</
|
|
86
|
-
<A width="100%"height={
|
|
87
|
-
<
|
|
88
|
-
<
|
|
89
|
-
<
|
|
90
|
-
<
|
|
91
|
-
</
|
|
92
|
-
</
|
|
93
|
-
{
|
|
85
|
+
</W>},H=({data:n,accentColor:s,maxBarWidth:o,isGradient:e=!1})=>{const h=Math.max(...n.map(t=>t.value),1),i=n.length*(R+G)+10;return<T style={k.svgContainer}>
|
|
86
|
+
<A width="100%"height={i}>
|
|
87
|
+
<Tt>
|
|
88
|
+
<St id="barGrad"x1="0"y1="0"x2="1"y2="0">
|
|
89
|
+
<P offset="0"stopColor={s}stopOpacity="0.6"/>
|
|
90
|
+
<P offset="1"stopColor={s}stopOpacity="1"/>
|
|
91
|
+
</St>
|
|
92
|
+
</Tt>
|
|
93
|
+
{n.map((t,c)=>{const b=c*(R+G),B=Math.max(t.value/h*o,2);return<L.Fragment key={t.label}>
|
|
94
94
|
|
|
95
|
-
<
|
|
96
|
-
{
|
|
97
|
-
</
|
|
95
|
+
<O x={0}y={b+12}fill={a.grayTextStrong}fontSize="11"fontFamily={C.interMedium}>
|
|
96
|
+
{t.label}
|
|
97
|
+
</O>
|
|
98
98
|
|
|
99
99
|
|
|
100
|
-
<
|
|
100
|
+
<U x1={0}y1={b+24}x2={o}y2={b+24}stroke={a.grayBorderSecondary}strokeDasharray="4"/>
|
|
101
101
|
|
|
102
102
|
|
|
103
|
-
<
|
|
103
|
+
<Q x={0}y={b+16}width={B}height={14}fill={e?"url(#barGrad)":s}rx={4}opacity={.85}/>
|
|
104
104
|
|
|
105
105
|
|
|
106
|
-
<
|
|
107
|
-
{
|
|
108
|
-
</
|
|
109
|
-
|
|
106
|
+
<O x={B+6}y={b+26}fill={a.primaryBlack}fontSize="11"fontFamily={C.interBold}>
|
|
107
|
+
{t.value}
|
|
108
|
+
</O>
|
|
109
|
+
</L.Fragment>})}
|
|
110
110
|
</A>
|
|
111
|
-
</T>},
|
|
111
|
+
</T>},k=Z.create({container:{backgroundColor:a.primaryLight,borderWidth:1,borderColor:a.grayBorderSecondary,borderRadius:12,marginBottom:10,padding:14,overflow:"hidden"},headerTitle:{fontFamily:C.interBold,color:a.primaryBlack,fontSize:14,marginBottom:12,borderBottomWidth:1,borderBottomColor:a.dividerColor,paddingBottom:8},chartBlock:{marginBottom:16},chartTitle:{fontFamily:C.interMedium,color:a.grayTextWeak,fontSize:12,textTransform:"uppercase",letterSpacing:.5,marginBottom:8},svgContainer:{marginTop:4}});export default Ct;
|