react-native-inapp-inspector 2.3.18 → 2.3.20
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/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +57 -0
- package/dist/commonjs/analytics.js +1 -24
- package/dist/commonjs/bundle.js +1 -16
- package/dist/commonjs/capture.d.ts +2 -0
- package/dist/commonjs/capture.js +1 -32
- package/dist/commonjs/components/AnalyticsDetail.js +92 -623
- package/dist/commonjs/components/AnalyticsEventCard.js +54 -350
- package/dist/commonjs/components/AnalyticsGraph.js +70 -370
- package/dist/commonjs/components/AnimatedEntrance.js +1 -11
- package/dist/commonjs/components/AppHeaderLogo.js +7 -134
- package/dist/commonjs/components/BrandCircleIcon.js +73 -118
- package/dist/commonjs/components/BrandSquareIcon.js +63 -108
- package/dist/commonjs/components/CodeSnippet.js +48 -623
- package/dist/commonjs/components/ConsoleLogCard.js +63 -537
- package/dist/commonjs/components/CopyButton.js +3 -89
- package/dist/commonjs/components/DiffViewer.js +19 -83
- package/dist/commonjs/components/DomainHeader.js +27 -127
- package/dist/commonjs/components/EmptyState.d.ts +1 -0
- package/dist/commonjs/components/EmptyState.js +10 -87
- package/dist/commonjs/components/EndOfListFooter.js +7 -81
- package/dist/commonjs/components/ErrorBoundary.js +72 -566
- package/dist/commonjs/components/HeadersSection.js +31 -110
- package/dist/commonjs/components/HighlightText.js +17 -58
- package/dist/commonjs/components/Inspector/AboutModal.d.ts +6 -0
- package/dist/commonjs/components/Inspector/AboutModal.js +351 -0
- package/dist/commonjs/components/Inspector/AnalyticsFilterModal.js +98 -797
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +284 -930
- package/dist/commonjs/components/Inspector/BundleTab.js +551 -2918
- package/dist/commonjs/components/Inspector/ConsoleTab.js +79 -492
- package/dist/commonjs/components/Inspector/CrashDetail.js +123 -672
- package/dist/commonjs/components/Inspector/CrashFilterModal.js +66 -498
- package/dist/commonjs/components/Inspector/CrashTab.js +98 -670
- package/dist/commonjs/components/Inspector/DebuggingTab.js +64 -871
- package/dist/commonjs/components/Inspector/DeviceInfoTab.js +143 -907
- package/dist/commonjs/components/Inspector/FabLauncher.js +85 -54
- package/dist/commonjs/components/Inspector/FeatureUnderDevNotice.js +6 -99
- package/dist/commonjs/components/Inspector/FeedbackModal.d.ts +9 -0
- package/dist/commonjs/components/Inspector/FeedbackModal.js +167 -521
- package/dist/commonjs/components/Inspector/InspectorContext.js +1 -21
- package/dist/commonjs/components/Inspector/InspectorHeader.js +219 -1093
- package/dist/commonjs/components/Inspector/LogDetail.js +168 -994
- package/dist/commonjs/components/Inspector/MainScreen.js +60 -332
- package/dist/commonjs/components/Inspector/MediaGalleryTab.js +136 -278
- package/dist/commonjs/components/Inspector/MediaPreviewModal.js +134 -361
- package/dist/commonjs/components/Inspector/NavigationTracker.js +1 -12
- package/dist/commonjs/components/Inspector/NetworkDetail.js +96 -432
- package/dist/commonjs/components/Inspector/NetworkFilterModal.js +60 -576
- package/dist/commonjs/components/Inspector/NetworkTab.js +84 -514
- package/dist/commonjs/components/Inspector/NpmStarPrompt.js +17 -433
- package/dist/commonjs/components/Inspector/NpmUpdateToast.js +25 -298
- package/dist/commonjs/components/Inspector/PerformanceTab.js +182 -1397
- package/dist/commonjs/components/Inspector/ReduxDetail.js +188 -1089
- package/dist/commonjs/components/Inspector/ReduxTab.js +85 -701
- package/dist/commonjs/components/Inspector/SettingsPanel.js +431 -3431
- package/dist/commonjs/components/Inspector/SkeletonPlaceholder.js +11 -180
- package/dist/commonjs/components/Inspector/StorageTab.js +93 -826
- package/dist/commonjs/components/Inspector/TabBar.js +47 -183
- package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +34 -408
- package/dist/commonjs/components/JsonViewer.js +168 -380
- package/dist/commonjs/components/LogCard.js +57 -567
- package/dist/commonjs/components/LogSyntaxHighlighter.js +11 -130
- package/dist/commonjs/components/MetaAccordion.js +69 -238
- package/dist/commonjs/components/MiniBarChart.js +3 -56
- package/dist/commonjs/components/MiniLineChart.js +3 -58
- package/dist/commonjs/components/NetworkIcons.d.ts +7 -0
- package/dist/commonjs/components/NetworkIcons.js +479 -997
- package/dist/commonjs/components/QRCodeView.js +5 -79
- package/dist/commonjs/components/SectionHeader.js +15 -37
- package/dist/commonjs/components/SegmentedTabs.js +7 -61
- package/dist/commonjs/components/SkeletonPlaceholder.js +11 -180
- package/dist/commonjs/components/Slider.js +15 -243
- package/dist/commonjs/components/SourcePageCard.js +30 -89
- package/dist/commonjs/components/Toast.js +5 -147
- package/dist/commonjs/components/TouchableScale.js +3 -24
- package/dist/commonjs/components/TreeNode.js +55 -130
- package/dist/commonjs/console.js +1 -16
- package/dist/commonjs/constants/index.js +1 -32
- package/dist/commonjs/constants/telemetryConfig.js +1 -6
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -4
- package/dist/commonjs/crash.js +1 -23
- package/dist/commonjs/customHooks/analyticsLogger.js +1 -250
- package/dist/commonjs/customHooks/bundleAnalyzer.js +1 -957
- package/dist/commonjs/customHooks/consoleLogger.js +6 -445
- package/dist/commonjs/customHooks/crashHandler.js +7 -656
- package/dist/commonjs/customHooks/logFilters.js +1 -23
- package/dist/commonjs/customHooks/networkLogger.js +2 -536
- package/dist/commonjs/customHooks/performanceTracker.js +63 -750
- package/dist/commonjs/customHooks/reduxLogger.js +2 -313
- package/dist/commonjs/customHooks/storageInspector.js +1 -435
- package/dist/commonjs/customHooks/useAccordion.js +1 -18
- package/dist/commonjs/decorators/index.js +1 -100
- package/dist/commonjs/helpers/gaAnalyticsRegistry.js +1 -148
- package/dist/commonjs/helpers/index.js +8 -921
- package/dist/commonjs/helpers/memoryManager.js +1 -99
- package/dist/commonjs/helpers/qrGenerator.js +1 -367
- package/dist/commonjs/helpers/remoteConfig.js +1 -165
- package/dist/commonjs/helpers/searchQueryParser.js +1 -62
- package/dist/commonjs/helpers/settingsStore.js +1 -144
- package/dist/commonjs/helpers/telemetry.js +1 -501
- package/dist/commonjs/helpers/toast.js +1 -20
- package/dist/commonjs/i18n/index.js +1 -90
- package/dist/commonjs/i18n/locales/en.json +1 -1122
- package/dist/commonjs/index.js +5 -2153
- package/dist/commonjs/metro.js +6 -468
- package/dist/commonjs/native/NativeInspector.d.ts +3 -0
- package/dist/commonjs/native/NativeInspector.js +1 -402
- package/dist/commonjs/native/NativeNetworkInspector.d.ts +1 -0
- package/dist/commonjs/native/NativeNetworkInspector.js +1 -4
- package/dist/commonjs/network.js +1 -13
- package/dist/commonjs/performance.js +1 -29
- package/dist/commonjs/redux.js +1 -20
- package/dist/commonjs/storage.js +1 -14
- package/dist/commonjs/styles/AppColors.js +1 -423
- package/dist/commonjs/styles/AppFonts.js +1 -17
- package/dist/commonjs/styles/common.js +1 -190
- package/dist/commonjs/styles/index.d.ts +6 -0
- package/dist/commonjs/styles/index.js +1 -1589
- package/dist/commonjs/types/enums.d.ts +2 -1
- package/dist/commonjs/types/enums.js +1 -150
- package/dist/commonjs/types/index.js +1 -18
- package/dist/commonjs/types/interfaces.d.ts +7 -0
- package/dist/commonjs/types/interfaces.js +1 -2
- package/dist/esm/analytics.js +1 -2
- package/dist/esm/bundle.js +1 -2
- package/dist/esm/capture.d.ts +2 -0
- package/dist/esm/capture.js +1 -29
- package/dist/esm/components/AnalyticsDetail.js +171 -664
- package/dist/esm/components/AnalyticsEventCard.js +77 -335
- package/dist/esm/components/AnalyticsGraph.js +95 -357
- package/dist/esm/components/AnimatedEntrance.js +1 -6
- package/dist/esm/components/AppHeaderLogo.js +7 -94
- package/dist/esm/components/BrandCircleIcon.js +114 -119
- package/dist/esm/components/BrandSquareIcon.js +73 -78
- package/dist/esm/components/CodeSnippet.js +58 -595
- package/dist/esm/components/ConsoleLogCard.js +91 -526
- package/dist/esm/components/CopyButton.js +3 -51
- package/dist/esm/components/DiffViewer.js +22 -48
- package/dist/esm/components/DomainHeader.js +43 -138
- package/dist/esm/components/EmptyState.d.ts +1 -0
- package/dist/esm/components/EmptyState.js +17 -56
- package/dist/esm/components/EndOfListFooter.js +15 -83
- package/dist/esm/components/ErrorBoundary.js +125 -582
- package/dist/esm/components/HeadersSection.js +52 -93
- package/dist/esm/components/HighlightText.js +17 -53
- package/dist/esm/components/Inspector/AboutModal.d.ts +6 -0
- package/dist/esm/components/Inspector/AboutModal.js +351 -0
- package/dist/esm/components/Inspector/AnalyticsFilterModal.js +225 -886
- package/dist/esm/components/Inspector/AnalyticsTab.js +296 -904
- package/dist/esm/components/Inspector/BundleTab.js +1175 -3502
- package/dist/esm/components/Inspector/ConsoleTab.js +113 -488
- package/dist/esm/components/Inspector/CrashDetail.js +236 -747
- package/dist/esm/components/Inspector/CrashFilterModal.js +149 -541
- package/dist/esm/components/Inspector/CrashTab.js +177 -711
- package/dist/esm/components/Inspector/DebuggingTab.js +156 -923
- package/dist/esm/components/Inspector/DeviceInfoTab.js +199 -924
- package/dist/esm/components/Inspector/FabLauncher.js +85 -49
- package/dist/esm/components/Inspector/FeatureUnderDevNotice.js +14 -70
- package/dist/esm/components/Inspector/FeedbackModal.d.ts +9 -0
- package/dist/esm/components/Inspector/FeedbackModal.js +182 -499
- package/dist/esm/components/Inspector/InspectorContext.js +1 -12
- package/dist/esm/components/Inspector/InspectorHeader.js +309 -1145
- package/dist/esm/components/Inspector/LogDetail.js +235 -1023
- package/dist/esm/components/Inspector/MainScreen.js +86 -320
- package/dist/esm/components/Inspector/MediaGalleryTab.js +157 -259
- package/dist/esm/components/Inspector/MediaPreviewModal.js +153 -340
- package/dist/esm/components/Inspector/NavigationTracker.js +1 -10
- package/dist/esm/components/Inspector/NetworkDetail.js +141 -472
- package/dist/esm/components/Inspector/NetworkFilterModal.js +122 -597
- package/dist/esm/components/Inspector/NetworkTab.js +125 -517
- package/dist/esm/components/Inspector/NpmStarPrompt.js +58 -434
- package/dist/esm/components/Inspector/NpmUpdateToast.js +45 -281
- package/dist/esm/components/Inspector/PerformanceTab.js +393 -1570
- package/dist/esm/components/Inspector/ReduxDetail.js +307 -1170
- package/dist/esm/components/Inspector/ReduxTab.js +144 -722
- package/dist/esm/components/Inspector/SettingsPanel.js +647 -3609
- package/dist/esm/components/Inspector/SkeletonPlaceholder.js +30 -163
- package/dist/esm/components/Inspector/StorageTab.js +172 -866
- package/dist/esm/components/Inspector/TabBar.js +52 -183
- package/dist/esm/components/Inspector/UpdateAvailableModal.js +79 -416
- package/dist/esm/components/JsonViewer.js +179 -353
- package/dist/esm/components/LogCard.js +93 -565
- package/dist/esm/components/LogSyntaxHighlighter.js +11 -123
- package/dist/esm/components/MetaAccordion.js +136 -267
- package/dist/esm/components/MiniBarChart.js +3 -18
- package/dist/esm/components/MiniLineChart.js +3 -20
- package/dist/esm/components/NetworkIcons.d.ts +7 -0
- package/dist/esm/components/NetworkIcons.js +481 -817
- package/dist/esm/components/QRCodeView.js +8 -45
- package/dist/esm/components/SectionHeader.js +22 -39
- package/dist/esm/components/SegmentedTabs.js +8 -57
- package/dist/esm/components/SkeletonPlaceholder.js +30 -163
- package/dist/esm/components/Slider.js +24 -213
- package/dist/esm/components/SourcePageCard.js +65 -86
- package/dist/esm/components/Toast.js +10 -117
- package/dist/esm/components/TouchableScale.js +3 -19
- package/dist/esm/components/TreeNode.js +58 -95
- package/dist/esm/console.js +1 -2
- package/dist/esm/constants/index.js +1 -28
- package/dist/esm/constants/telemetryConfig.js +1 -3
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/crash.js +1 -2
- package/dist/esm/customHooks/analyticsLogger.js +1 -230
- package/dist/esm/customHooks/bundleAnalyzer.js +1 -944
- package/dist/esm/customHooks/consoleLogger.js +6 -432
- package/dist/esm/customHooks/crashHandler.js +7 -630
- package/dist/esm/customHooks/logFilters.js +1 -20
- package/dist/esm/customHooks/networkLogger.js +2 -519
- package/dist/esm/customHooks/performanceTracker.js +63 -723
- package/dist/esm/customHooks/reduxLogger.js +2 -293
- package/dist/esm/customHooks/storageInspector.js +1 -418
- package/dist/esm/customHooks/useAccordion.js +1 -16
- package/dist/esm/decorators/index.js +1 -95
- package/dist/esm/helpers/gaAnalyticsRegistry.js +1 -143
- package/dist/esm/helpers/index.js +8 -861
- package/dist/esm/helpers/memoryManager.js +1 -91
- package/dist/esm/helpers/qrGenerator.js +1 -364
- package/dist/esm/helpers/remoteConfig.js +1 -160
- package/dist/esm/helpers/searchQueryParser.js +1 -59
- package/dist/esm/helpers/settingsStore.js +1 -134
- package/dist/esm/helpers/telemetry.js +1 -489
- package/dist/esm/helpers/toast.js +1 -15
- package/dist/esm/i18n/index.js +1 -78
- package/dist/esm/i18n/locales/en.json +1 -1122
- package/dist/esm/index.js +7 -1967
- package/dist/esm/metro.js +6 -459
- package/dist/esm/native/NativeInspector.d.ts +3 -0
- package/dist/esm/native/NativeInspector.js +1 -370
- package/dist/esm/native/NativeNetworkInspector.d.ts +1 -0
- package/dist/esm/native/NativeNetworkInspector.js +1 -2
- package/dist/esm/network.js +1 -1
- package/dist/esm/performance.js +1 -2
- package/dist/esm/redux.js +1 -1
- package/dist/esm/storage.js +1 -1
- package/dist/esm/styles/AppColors.js +1 -417
- package/dist/esm/styles/AppFonts.js +1 -13
- package/dist/esm/styles/common.js +1 -186
- package/dist/esm/styles/index.d.ts +6 -0
- package/dist/esm/styles/index.js +1 -1551
- package/dist/esm/types/enums.d.ts +2 -1
- package/dist/esm/types/enums.js +1 -147
- package/dist/esm/types/index.js +1 -2
- package/dist/esm/types/interfaces.d.ts +7 -0
- package/dist/esm/types/interfaces.js +1 -1
- package/ios/NetworkInspectorModule.mm +253 -136
- package/package.json +5 -3
- package/react-native-inapp-inspector.podspec +1 -1
- package/src/native/NativeInspector.ts +17 -0
- package/src/native/NativeNetworkInspector.ts +1 -0
- package/src/analytics.ts +0 -35
- package/src/bundle.ts +0 -25
- package/src/capture.ts +0 -101
- package/src/components/AnalyticsDetail.tsx +0 -870
- package/src/components/AnalyticsEventCard.tsx +0 -444
- package/src/components/AnalyticsGraph.tsx +0 -583
- package/src/components/AnimatedEntrance.tsx +0 -20
- package/src/components/AppHeaderLogo.tsx +0 -143
- package/src/components/BrandCircleIcon.tsx +0 -144
- package/src/components/BrandSquareIcon.tsx +0 -184
- package/src/components/CodeSnippet.tsx +0 -725
- package/src/components/ConsoleLogCard.tsx +0 -679
- package/src/components/CopyButton.tsx +0 -87
- package/src/components/DiffViewer.tsx +0 -82
- package/src/components/DomainHeader.tsx +0 -224
- package/src/components/EmptyState.tsx +0 -95
- package/src/components/EndOfListFooter.tsx +0 -100
- package/src/components/ErrorBoundary.tsx +0 -688
- package/src/components/HeadersSection.tsx +0 -172
- package/src/components/HighlightText.tsx +0 -100
- package/src/components/Inspector/AnalyticsFilterModal.tsx +0 -1250
- package/src/components/Inspector/AnalyticsTab.tsx +0 -1362
- package/src/components/Inspector/BundleTab.tsx +0 -4768
- package/src/components/Inspector/ConsoleTab.tsx +0 -726
- package/src/components/Inspector/CrashDetail.tsx +0 -997
- package/src/components/Inspector/CrashFilterModal.tsx +0 -721
- package/src/components/Inspector/CrashTab.tsx +0 -933
- package/src/components/Inspector/DebuggingTab.tsx +0 -1103
- package/src/components/Inspector/DeviceInfoTab.tsx +0 -1397
- package/src/components/Inspector/FabLauncher.tsx +0 -80
- package/src/components/Inspector/FeatureUnderDevNotice.tsx +0 -94
- package/src/components/Inspector/FeedbackModal.tsx +0 -626
- package/src/components/Inspector/InspectorContext.tsx +0 -28
- package/src/components/Inspector/InspectorHeader.tsx +0 -1545
- package/src/components/Inspector/LogDetail.tsx +0 -1431
- package/src/components/Inspector/MainScreen.tsx +0 -459
- package/src/components/Inspector/MediaGalleryTab.tsx +0 -355
- package/src/components/Inspector/MediaPreviewModal.tsx +0 -435
- package/src/components/Inspector/NavigationTracker.tsx +0 -13
- package/src/components/Inspector/NetworkDetail.tsx +0 -795
- package/src/components/Inspector/NetworkFilterModal.tsx +0 -730
- package/src/components/Inspector/NetworkTab.tsx +0 -820
- package/src/components/Inspector/NpmStarPrompt.tsx +0 -532
- package/src/components/Inspector/NpmUpdateToast.tsx +0 -387
- package/src/components/Inspector/PerformanceTab.tsx +0 -1967
- package/src/components/Inspector/ReduxDetail.tsx +0 -1651
- package/src/components/Inspector/ReduxTab.tsx +0 -987
- package/src/components/Inspector/SettingsPanel.tsx +0 -4580
- package/src/components/Inspector/SkeletonPlaceholder.tsx +0 -206
- package/src/components/Inspector/StorageTab.tsx +0 -1159
- package/src/components/Inspector/TabBar.tsx +0 -263
- package/src/components/Inspector/UpdateAvailableModal.tsx +0 -555
- package/src/components/JsonViewer.tsx +0 -547
- package/src/components/LogCard.tsx +0 -694
- package/src/components/LogSyntaxHighlighter.tsx +0 -178
- package/src/components/MetaAccordion.tsx +0 -355
- package/src/components/MiniBarChart.tsx +0 -42
- package/src/components/MiniLineChart.tsx +0 -33
- package/src/components/NetworkIcons.tsx +0 -2599
- package/src/components/QRCodeView.tsx +0 -75
- package/src/components/SectionHeader.tsx +0 -101
- package/src/components/SegmentedTabs.tsx +0 -83
- package/src/components/SkeletonPlaceholder.tsx +0 -206
- package/src/components/Slider.tsx +0 -300
- package/src/components/SourcePageCard.tsx +0 -150
- package/src/components/Toast.tsx +0 -131
- package/src/components/TouchableScale.tsx +0 -61
- package/src/components/TreeNode.tsx +0 -171
- package/src/console.ts +0 -24
- package/src/constants/index.ts +0 -41
- package/src/constants/telemetryConfig.ts +0 -4
- package/src/constants/version.ts +0 -3
- package/src/crash.ts +0 -32
- package/src/customHooks/analyticsLogger.ts +0 -336
- package/src/customHooks/bundleAnalyzer.ts +0 -1256
- package/src/customHooks/consoleLogger.ts +0 -530
- package/src/customHooks/crashHandler.ts +0 -944
- package/src/customHooks/logFilters.ts +0 -32
- package/src/customHooks/networkLogger.ts +0 -624
- package/src/customHooks/performanceTracker.ts +0 -1014
- package/src/customHooks/reduxLogger.ts +0 -406
- package/src/customHooks/storageInspector.ts +0 -513
- package/src/customHooks/useAccordion.tsx +0 -27
- package/src/decorators/index.ts +0 -184
- package/src/helpers/gaAnalyticsRegistry.ts +0 -204
- package/src/helpers/index.ts +0 -1092
- package/src/helpers/memoryManager.ts +0 -138
- package/src/helpers/qrGenerator.ts +0 -430
- package/src/helpers/remoteConfig.ts +0 -212
- package/src/helpers/searchQueryParser.ts +0 -84
- package/src/helpers/settingsStore.ts +0 -171
- package/src/helpers/telemetry.ts +0 -568
- package/src/helpers/toast.ts +0 -17
- package/src/i18n/index.ts +0 -104
- package/src/i18n/locales/en.json +0 -1125
- package/src/index.tsx +0 -2635
- package/src/metro.ts +0 -598
- package/src/network.ts +0 -22
- package/src/performance.ts +0 -38
- package/src/redux.ts +0 -23
- package/src/storage.ts +0 -18
- package/src/styles/AppColors.ts +0 -455
- package/src/styles/AppFonts.ts +0 -26
- package/src/styles/common.ts +0 -209
- package/src/styles/index.ts +0 -1606
- package/src/types/enums.ts +0 -208
- package/src/types/index.ts +0 -34
- package/src/types/interfaces.ts +0 -530
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {StyleSheet, Text, View, TextStyle, Linking} from 'react-native';
|
|
3
|
-
import {AppColors} from '../styles/AppColors';
|
|
4
|
-
import {AppFonts} from '../styles/AppFonts';
|
|
5
|
-
import {escapeRegex, handleOpenExternalLink} from '../helpers';
|
|
6
|
-
|
|
7
|
-
export interface LogSyntaxHighlighterProps {
|
|
8
|
-
text: string;
|
|
9
|
-
search?: string;
|
|
10
|
-
numberOfLines?: number;
|
|
11
|
-
style?: TextStyle | TextStyle[];
|
|
12
|
-
detectLinks?: boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface Token {
|
|
16
|
-
type:
|
|
17
|
-
| 'key'
|
|
18
|
-
| 'string'
|
|
19
|
-
| 'number'
|
|
20
|
-
| 'boolean'
|
|
21
|
-
| 'null'
|
|
22
|
-
| 'url'
|
|
23
|
-
| 'bracket'
|
|
24
|
-
| 'tag'
|
|
25
|
-
| 'plain';
|
|
26
|
-
value: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const TOKEN_REGEX =
|
|
30
|
-
/("(?:\\.|[^"\\])*"(?=\s*:))|("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')|(\b-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b)|(\b(?:true|false)\b)|(\b(?:null|undefined|NaN)\b)|(https?:\/\/[^\s"',]+)|(\[[\w\s_-]+\])|([{}[\],:])|([^"'\d\s{}[\],:]+|[ \t\r\n]+)/g;
|
|
31
|
-
|
|
32
|
-
export const tokenizeText = (input: string): Token[] => {
|
|
33
|
-
if (!input) return [];
|
|
34
|
-
const tokens: Token[] = [];
|
|
35
|
-
let match: RegExpExecArray | null;
|
|
36
|
-
TOKEN_REGEX.lastIndex = 0;
|
|
37
|
-
|
|
38
|
-
while ((match = TOKEN_REGEX.exec(input)) !== null) {
|
|
39
|
-
if (match[1]) {
|
|
40
|
-
tokens.push({type: 'key', value: match[1]});
|
|
41
|
-
} else if (match[2]) {
|
|
42
|
-
tokens.push({type: 'string', value: match[2]});
|
|
43
|
-
} else if (match[3]) {
|
|
44
|
-
tokens.push({type: 'number', value: match[3]});
|
|
45
|
-
} else if (match[4]) {
|
|
46
|
-
tokens.push({type: 'boolean', value: match[4]});
|
|
47
|
-
} else if (match[5]) {
|
|
48
|
-
tokens.push({type: 'null', value: match[5]});
|
|
49
|
-
} else if (match[6]) {
|
|
50
|
-
tokens.push({type: 'url', value: match[6]});
|
|
51
|
-
} else if (match[7]) {
|
|
52
|
-
tokens.push({type: 'tag', value: match[7]});
|
|
53
|
-
} else if (match[8]) {
|
|
54
|
-
tokens.push({type: 'bracket', value: match[8]});
|
|
55
|
-
} else if (match[9]) {
|
|
56
|
-
tokens.push({type: 'plain', value: match[9]});
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return tokens;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const getTokenColor = (type: Token['type']): string => {
|
|
64
|
-
switch (type) {
|
|
65
|
-
case 'key':
|
|
66
|
-
return AppColors.sky600 || '#0369a1';
|
|
67
|
-
case 'string':
|
|
68
|
-
return AppColors.emerald600 || '#059669';
|
|
69
|
-
case 'number':
|
|
70
|
-
return AppColors.amber600 || '#d97706';
|
|
71
|
-
case 'boolean':
|
|
72
|
-
return AppColors.purple || '#7c3aed';
|
|
73
|
-
case 'null':
|
|
74
|
-
return AppColors.red600 || '#dc2626';
|
|
75
|
-
case 'url':
|
|
76
|
-
return '#0284c7';
|
|
77
|
-
case 'tag':
|
|
78
|
-
return AppColors.violet600 || '#7c3aed';
|
|
79
|
-
case 'bracket':
|
|
80
|
-
return AppColors.slate500 || '#64748b';
|
|
81
|
-
case 'plain':
|
|
82
|
-
default:
|
|
83
|
-
return AppColors.primaryBlack || '#1e293b';
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
export const LogSyntaxHighlighter: React.FC<LogSyntaxHighlighterProps> = React.memo(
|
|
88
|
-
({text, search, numberOfLines, style, detectLinks = true}) => {
|
|
89
|
-
if (!text) return null;
|
|
90
|
-
|
|
91
|
-
const tokens = React.useMemo(() => tokenizeText(text), [text]);
|
|
92
|
-
|
|
93
|
-
const renderToken = (token: Token, tokenIdx: number) => {
|
|
94
|
-
const baseColor = getTokenColor(token.type);
|
|
95
|
-
const isUrl = token.type === 'url';
|
|
96
|
-
const isKey = token.type === 'key';
|
|
97
|
-
|
|
98
|
-
const tokenStyle: TextStyle = {
|
|
99
|
-
color: baseColor,
|
|
100
|
-
fontFamily: isKey ? AppFonts.interBold : AppFonts.interRegular,
|
|
101
|
-
textDecorationLine: isUrl ? 'underline' : 'none',
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
if (!search || search.trim().length === 0) {
|
|
105
|
-
return (
|
|
106
|
-
<Text
|
|
107
|
-
key={tokenIdx}
|
|
108
|
-
style={tokenStyle}
|
|
109
|
-
onPress={
|
|
110
|
-
isUrl && detectLinks
|
|
111
|
-
? () => handleOpenExternalLink(token.value)
|
|
112
|
-
: undefined
|
|
113
|
-
}>
|
|
114
|
-
{token.value}
|
|
115
|
-
</Text>
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
const regex = new RegExp(`(${escapeRegex(search.trim())})`, 'gi');
|
|
120
|
-
const parts = token.value.split(regex);
|
|
121
|
-
|
|
122
|
-
return (
|
|
123
|
-
<Text key={tokenIdx} style={tokenStyle}>
|
|
124
|
-
{parts.map((part, partIdx) => {
|
|
125
|
-
const isMatch =
|
|
126
|
-
part.toLowerCase() === search.trim().toLowerCase();
|
|
127
|
-
return isMatch ? (
|
|
128
|
-
<Text
|
|
129
|
-
key={partIdx}
|
|
130
|
-
style={[
|
|
131
|
-
tokenStyle,
|
|
132
|
-
styles.searchHighlight,
|
|
133
|
-
]}>
|
|
134
|
-
{part}
|
|
135
|
-
</Text>
|
|
136
|
-
) : (
|
|
137
|
-
<Text
|
|
138
|
-
key={partIdx}
|
|
139
|
-
style={tokenStyle}
|
|
140
|
-
onPress={
|
|
141
|
-
isUrl && detectLinks
|
|
142
|
-
? () => handleOpenExternalLink(token.value)
|
|
143
|
-
: undefined
|
|
144
|
-
}>
|
|
145
|
-
{part}
|
|
146
|
-
</Text>
|
|
147
|
-
);
|
|
148
|
-
})}
|
|
149
|
-
</Text>
|
|
150
|
-
);
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
return (
|
|
154
|
-
<Text
|
|
155
|
-
style={[styles.containerText, style]}
|
|
156
|
-
numberOfLines={numberOfLines}>
|
|
157
|
-
{tokens.map(renderToken)}
|
|
158
|
-
</Text>
|
|
159
|
-
);
|
|
160
|
-
},
|
|
161
|
-
);
|
|
162
|
-
|
|
163
|
-
const styles = StyleSheet.create({
|
|
164
|
-
containerText: {
|
|
165
|
-
fontFamily: AppFonts.interRegular,
|
|
166
|
-
fontSize: 12,
|
|
167
|
-
lineHeight: 18,
|
|
168
|
-
color: AppColors.primaryBlack,
|
|
169
|
-
},
|
|
170
|
-
searchHighlight: {
|
|
171
|
-
backgroundColor: '#fef08a',
|
|
172
|
-
color: '#854d0e',
|
|
173
|
-
fontFamily: AppFonts.interBold,
|
|
174
|
-
borderRadius: 2,
|
|
175
|
-
},
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
export default LogSyntaxHighlighter;
|
|
@@ -1,355 +0,0 @@
|
|
|
1
|
-
import React, {useState} from 'react';
|
|
2
|
-
import {useTranslation} from '../i18n';
|
|
3
|
-
import {View, Pressable, Text} from 'react-native';
|
|
4
|
-
|
|
5
|
-
// Constants
|
|
6
|
-
import {DURATION_FAST_MS, DURATION_SLOW_MS} from '../constants';
|
|
7
|
-
|
|
8
|
-
// Custom Hooks
|
|
9
|
-
import useAccordion from '../customHooks/useAccordion';
|
|
10
|
-
|
|
11
|
-
// Helpers
|
|
12
|
-
import {getDurationColor, handleOpenExternalLink} from '../helpers';
|
|
13
|
-
|
|
14
|
-
// Types
|
|
15
|
-
import {MetaAccordionProps} from '../types';
|
|
16
|
-
|
|
17
|
-
// Assets
|
|
18
|
-
import {
|
|
19
|
-
ChevronIcon,
|
|
20
|
-
CalendarIcon,
|
|
21
|
-
StatusIcon,
|
|
22
|
-
ClockIcon,
|
|
23
|
-
SizeIcon,
|
|
24
|
-
TerminalIcon,
|
|
25
|
-
GlobeIcon,
|
|
26
|
-
} from './NetworkIcons';
|
|
27
|
-
|
|
28
|
-
// Components
|
|
29
|
-
import TouchableScale from './TouchableScale';
|
|
30
|
-
import CopyButton from './CopyButton';
|
|
31
|
-
|
|
32
|
-
// Stylesheet
|
|
33
|
-
import {AppColors} from '../styles/AppColors';
|
|
34
|
-
import {AppFonts} from '../styles/AppFonts';
|
|
35
|
-
import styles from '../styles';
|
|
36
|
-
|
|
37
|
-
const MetaAccordion = ({
|
|
38
|
-
status,
|
|
39
|
-
statusColor,
|
|
40
|
-
duration,
|
|
41
|
-
size,
|
|
42
|
-
triggeredAt,
|
|
43
|
-
method,
|
|
44
|
-
contentType,
|
|
45
|
-
url,
|
|
46
|
-
}: MetaAccordionProps) => {
|
|
47
|
-
const {t} = useTranslation();
|
|
48
|
-
const [urlExpanded, setUrlExpanded] = useState(false);
|
|
49
|
-
const {isOpen, toggleOpen, chevronStyle} = useAccordion(true);
|
|
50
|
-
const isFailed = status === 0 || status == null;
|
|
51
|
-
|
|
52
|
-
const renderFormattedUrl = (rawUrl: string) => {
|
|
53
|
-
if (!rawUrl) return '—';
|
|
54
|
-
try {
|
|
55
|
-
const doubleSlashIndex = rawUrl.indexOf('//');
|
|
56
|
-
let temp = rawUrl;
|
|
57
|
-
let protocol = '';
|
|
58
|
-
if (doubleSlashIndex !== -1) {
|
|
59
|
-
protocol = rawUrl.substring(0, doubleSlashIndex + 2);
|
|
60
|
-
temp = rawUrl.substring(doubleSlashIndex + 2);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const slashIndex = temp.indexOf('/');
|
|
64
|
-
let host = temp;
|
|
65
|
-
let pathAndSearch = '';
|
|
66
|
-
if (slashIndex !== -1) {
|
|
67
|
-
host = temp.substring(0, slashIndex);
|
|
68
|
-
pathAndSearch = temp.substring(slashIndex);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const queryIndex = pathAndSearch.indexOf('?');
|
|
72
|
-
let pathname = pathAndSearch;
|
|
73
|
-
let search = '';
|
|
74
|
-
if (queryIndex !== -1) {
|
|
75
|
-
pathname = pathAndSearch.substring(0, queryIndex);
|
|
76
|
-
search = pathAndSearch.substring(queryIndex);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return (
|
|
80
|
-
<Text style={{lineHeight: 16}}>
|
|
81
|
-
{protocol ? (
|
|
82
|
-
<Text style={{color: AppColors.slate400, fontFamily: AppFonts.interRegular}}>{protocol}</Text>
|
|
83
|
-
) : null}
|
|
84
|
-
<Text style={{color: AppColors.purple, fontFamily: AppFonts.interBold}}>{host}</Text>
|
|
85
|
-
<Text style={{color: AppColors.slate700, fontFamily: AppFonts.interMedium}}>{pathname}</Text>
|
|
86
|
-
{search ? (
|
|
87
|
-
<Text style={{color: AppColors.teal600, fontFamily: AppFonts.interRegular}}>{search}</Text>
|
|
88
|
-
) : null}
|
|
89
|
-
</Text>
|
|
90
|
-
);
|
|
91
|
-
} catch {
|
|
92
|
-
return rawUrl;
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
<View style={styles.metaContainer}>
|
|
98
|
-
<Pressable onPress={toggleOpen} hitSlop={12}>
|
|
99
|
-
<View style={styles.metaHeader}>
|
|
100
|
-
<Text style={styles.metaTitle}>Metadata</Text>
|
|
101
|
-
<View style={{flexDirection: 'row', alignItems: 'center', gap: 8}}>
|
|
102
|
-
<CopyButton
|
|
103
|
-
value={{
|
|
104
|
-
status: status ?? 0,
|
|
105
|
-
duration: duration != null ? `${duration} ms` : '—',
|
|
106
|
-
size: size || '—',
|
|
107
|
-
triggeredAt: triggeredAt || '',
|
|
108
|
-
method: method || 'GET',
|
|
109
|
-
contentType: contentType || 'application/json',
|
|
110
|
-
url: url || '',
|
|
111
|
-
}}
|
|
112
|
-
label="Metadata"
|
|
113
|
-
/>
|
|
114
|
-
<View style={chevronStyle}>
|
|
115
|
-
<ChevronIcon color={AppColors.grayTextWeak} size={14} />
|
|
116
|
-
</View>
|
|
117
|
-
</View>
|
|
118
|
-
</View>
|
|
119
|
-
</Pressable>
|
|
120
|
-
|
|
121
|
-
{isOpen && (
|
|
122
|
-
<View style={styles.metaBody}>
|
|
123
|
-
<View style={styles.metaRow}>
|
|
124
|
-
<View style={styles.metaLabelRow}>
|
|
125
|
-
<CalendarIcon color={AppColors.grayTextWeak} size={14} />
|
|
126
|
-
<Text style={styles.metaLabel}>{t('network.triggeredAt')}</Text>
|
|
127
|
-
</View>
|
|
128
|
-
<Text
|
|
129
|
-
style={[
|
|
130
|
-
styles.metaValue,
|
|
131
|
-
{color: AppColors.purple, fontSize: 12},
|
|
132
|
-
]}>
|
|
133
|
-
{triggeredAt}
|
|
134
|
-
</Text>
|
|
135
|
-
</View>
|
|
136
|
-
<View style={styles.metaDivider} />
|
|
137
|
-
|
|
138
|
-
<View style={styles.metaRow}>
|
|
139
|
-
<View style={styles.metaLabelRow}>
|
|
140
|
-
<TerminalIcon color={AppColors.grayTextWeak} size={14} />
|
|
141
|
-
<Text style={styles.metaLabel}>{t('network.methodHeader')}</Text>
|
|
142
|
-
</View>
|
|
143
|
-
<View
|
|
144
|
-
style={[
|
|
145
|
-
styles.statusChip,
|
|
146
|
-
{
|
|
147
|
-
borderColor: `${AppColors.brandPurple}40`,
|
|
148
|
-
backgroundColor: `${AppColors.brandPurple}14`,
|
|
149
|
-
},
|
|
150
|
-
]}>
|
|
151
|
-
<Text
|
|
152
|
-
style={[
|
|
153
|
-
styles.statusText,
|
|
154
|
-
{color: AppColors.purple, fontFamily: AppFonts.interBold},
|
|
155
|
-
]}>
|
|
156
|
-
{method || 'GET'}
|
|
157
|
-
</Text>
|
|
158
|
-
</View>
|
|
159
|
-
</View>
|
|
160
|
-
<View style={styles.metaDivider} />
|
|
161
|
-
|
|
162
|
-
<View style={styles.metaRow}>
|
|
163
|
-
<View style={styles.metaLabelRow}>
|
|
164
|
-
<StatusIcon color={AppColors.grayTextWeak} />
|
|
165
|
-
<Text style={styles.metaLabel}>{t('network.statusHeader')}</Text>
|
|
166
|
-
</View>
|
|
167
|
-
<View
|
|
168
|
-
style={[
|
|
169
|
-
styles.statusChip,
|
|
170
|
-
{
|
|
171
|
-
borderColor: isFailed
|
|
172
|
-
? `${AppColors.errorColor}40`
|
|
173
|
-
: `${statusColor}40`,
|
|
174
|
-
backgroundColor: isFailed
|
|
175
|
-
? `${AppColors.errorColor}15`
|
|
176
|
-
: `${statusColor}15`,
|
|
177
|
-
},
|
|
178
|
-
]}>
|
|
179
|
-
<Text
|
|
180
|
-
style={[
|
|
181
|
-
styles.statusText,
|
|
182
|
-
{color: isFailed ? AppColors.errorColor : statusColor},
|
|
183
|
-
]}>
|
|
184
|
-
{isFailed ? t('network.failedNetworkError') : String(status)}
|
|
185
|
-
</Text>
|
|
186
|
-
</View>
|
|
187
|
-
</View>
|
|
188
|
-
<View style={styles.metaDivider} />
|
|
189
|
-
|
|
190
|
-
<View style={styles.metaRow}>
|
|
191
|
-
<View style={styles.metaLabelRow}>
|
|
192
|
-
<GlobeIcon color={AppColors.grayTextWeak} size={14} />
|
|
193
|
-
<Text style={styles.metaLabel}>{t('network.contentType')}</Text>
|
|
194
|
-
</View>
|
|
195
|
-
<Text style={styles.metaValue}>
|
|
196
|
-
{contentType || 'application/json'}
|
|
197
|
-
</Text>
|
|
198
|
-
</View>
|
|
199
|
-
<View style={styles.metaDivider} />
|
|
200
|
-
|
|
201
|
-
<View style={styles.metaRow}>
|
|
202
|
-
<View style={styles.metaLabelRow}>
|
|
203
|
-
<ClockIcon color={AppColors.grayTextWeak} size={14} />
|
|
204
|
-
<Text style={styles.metaLabel}>{t('network.durationHeader')}</Text>
|
|
205
|
-
</View>
|
|
206
|
-
<View style={styles.metaValueRow}>
|
|
207
|
-
{duration != null && !isFailed && (
|
|
208
|
-
<View
|
|
209
|
-
style={[
|
|
210
|
-
styles.perfBadge,
|
|
211
|
-
{
|
|
212
|
-
backgroundColor: `${getDurationColor(duration)}15`,
|
|
213
|
-
borderColor: `${getDurationColor(duration)}40`,
|
|
214
|
-
},
|
|
215
|
-
]}>
|
|
216
|
-
<Text
|
|
217
|
-
style={[
|
|
218
|
-
styles.perfBadgeText,
|
|
219
|
-
{color: getDurationColor(duration)},
|
|
220
|
-
]}>
|
|
221
|
-
{duration < DURATION_FAST_MS
|
|
222
|
-
? t('network.perf.fast')
|
|
223
|
-
: duration < DURATION_SLOW_MS
|
|
224
|
-
? t('network.perf.moderate')
|
|
225
|
-
: t('network.perf.slow')}
|
|
226
|
-
</Text>
|
|
227
|
-
</View>
|
|
228
|
-
)}
|
|
229
|
-
<Text style={styles.metaValue}>
|
|
230
|
-
{duration != null ? `${duration} ms` : '—'}
|
|
231
|
-
</Text>
|
|
232
|
-
</View>
|
|
233
|
-
</View>
|
|
234
|
-
|
|
235
|
-
{/* Visual Latency Timing Breakdown Waterfall */}
|
|
236
|
-
{duration != null && !isFailed && (
|
|
237
|
-
<View style={{paddingVertical: 8, gap: 6}}>
|
|
238
|
-
<View style={{flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center'}}>
|
|
239
|
-
<Text style={{fontFamily: AppFonts.interBold, fontSize: 11, color: AppColors.primaryBlack}}>
|
|
240
|
-
{t('network.timingWaterfall')}
|
|
241
|
-
</Text>
|
|
242
|
-
<Text style={{fontFamily: AppFonts.interMedium, fontSize: 10.5, color: getDurationColor(duration)}}>
|
|
243
|
-
{duration < DURATION_FAST_MS
|
|
244
|
-
? t('network.perf.fast')
|
|
245
|
-
: duration < DURATION_SLOW_MS
|
|
246
|
-
? t('network.perf.moderate')
|
|
247
|
-
: t('network.perf.slow')}
|
|
248
|
-
</Text>
|
|
249
|
-
</View>
|
|
250
|
-
|
|
251
|
-
<View
|
|
252
|
-
style={{
|
|
253
|
-
height: 6,
|
|
254
|
-
backgroundColor: AppColors.grayBorderSecondary,
|
|
255
|
-
borderRadius: 3,
|
|
256
|
-
overflow: 'hidden',
|
|
257
|
-
}}>
|
|
258
|
-
<View
|
|
259
|
-
style={{
|
|
260
|
-
height: '100%',
|
|
261
|
-
width: `${Math.min(100, Math.max(8, (duration / 1200) * 100))}%`,
|
|
262
|
-
backgroundColor: getDurationColor(duration),
|
|
263
|
-
borderRadius: 3,
|
|
264
|
-
}}
|
|
265
|
-
/>
|
|
266
|
-
</View>
|
|
267
|
-
|
|
268
|
-
<View style={{flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', marginTop: 1}}>
|
|
269
|
-
<Text style={{fontFamily: AppFonts.interRegular, fontSize: 9.5, color: AppColors.grayTextWeak}}>
|
|
270
|
-
0 ms
|
|
271
|
-
</Text>
|
|
272
|
-
<Text style={{fontFamily: AppFonts.interBold, fontSize: 10, color: getDurationColor(duration)}}>
|
|
273
|
-
{duration} ms
|
|
274
|
-
</Text>
|
|
275
|
-
<Text style={{fontFamily: AppFonts.interRegular, fontSize: 9.5, color: AppColors.grayTextWeak}}>
|
|
276
|
-
1,200+ ms
|
|
277
|
-
</Text>
|
|
278
|
-
</View>
|
|
279
|
-
</View>
|
|
280
|
-
)}
|
|
281
|
-
<View style={styles.metaDivider} />
|
|
282
|
-
|
|
283
|
-
<View style={styles.metaRow}>
|
|
284
|
-
<View style={styles.metaLabelRow}>
|
|
285
|
-
<SizeIcon color={AppColors.grayTextWeak} />
|
|
286
|
-
<Text style={styles.metaLabel}>{t('network.sizeHeader')}</Text>
|
|
287
|
-
</View>
|
|
288
|
-
<Text style={styles.metaValue}>{size}</Text>
|
|
289
|
-
</View>
|
|
290
|
-
<View style={styles.metaDivider} />
|
|
291
|
-
|
|
292
|
-
<View style={[styles.metaRow, {alignItems: 'flex-start', flexDirection: 'column', gap: 6}]}>
|
|
293
|
-
<View style={{flexDirection: 'row', justifyContent: 'space-between', width: '100%', alignItems: 'center'}}>
|
|
294
|
-
<View style={styles.metaLabelRow}>
|
|
295
|
-
<GlobeIcon color={AppColors.grayTextWeak} size={14} />
|
|
296
|
-
<Text style={styles.metaLabel}>{t('network.fullUrl')}</Text>
|
|
297
|
-
</View>
|
|
298
|
-
|
|
299
|
-
<View style={{flexDirection: 'row', alignItems: 'center', gap: 10}}>
|
|
300
|
-
{url && url.length > 50 && (
|
|
301
|
-
<TouchableScale onPress={() => setUrlExpanded(prev => !prev)} hitSlop={8}>
|
|
302
|
-
<Text style={{
|
|
303
|
-
fontFamily: AppFonts.interBold,
|
|
304
|
-
fontSize: 10.5,
|
|
305
|
-
color: AppColors.purple,
|
|
306
|
-
}}>
|
|
307
|
-
{urlExpanded ? t('network.showLess') : t('network.showMore')}
|
|
308
|
-
</Text>
|
|
309
|
-
</TouchableScale>
|
|
310
|
-
)}
|
|
311
|
-
|
|
312
|
-
{url && (
|
|
313
|
-
<TouchableScale onPress={() => handleOpenExternalLink(url)} hitSlop={8}>
|
|
314
|
-
<Text style={{
|
|
315
|
-
fontFamily: AppFonts.interBold,
|
|
316
|
-
fontSize: 10.5,
|
|
317
|
-
color: AppColors.purple,
|
|
318
|
-
textDecorationLine: 'underline',
|
|
319
|
-
}}>
|
|
320
|
-
{t('network.open')}
|
|
321
|
-
</Text>
|
|
322
|
-
</TouchableScale>
|
|
323
|
-
)}
|
|
324
|
-
</View>
|
|
325
|
-
</View>
|
|
326
|
-
|
|
327
|
-
<View style={{
|
|
328
|
-
backgroundColor: AppColors.slate50,
|
|
329
|
-
borderRadius: 8,
|
|
330
|
-
padding: 8,
|
|
331
|
-
borderWidth: 1.5,
|
|
332
|
-
borderColor: AppColors.slate200,
|
|
333
|
-
width: '100%',
|
|
334
|
-
marginTop: 2,
|
|
335
|
-
}}>
|
|
336
|
-
<Text
|
|
337
|
-
selectable={true}
|
|
338
|
-
numberOfLines={urlExpanded ? undefined : 2}
|
|
339
|
-
ellipsizeMode="tail"
|
|
340
|
-
style={{
|
|
341
|
-
fontSize: 11,
|
|
342
|
-
textAlign: 'left',
|
|
343
|
-
lineHeight: 16.5,
|
|
344
|
-
}}>
|
|
345
|
-
{renderFormattedUrl(url)}
|
|
346
|
-
</Text>
|
|
347
|
-
</View>
|
|
348
|
-
</View>
|
|
349
|
-
</View>
|
|
350
|
-
)}
|
|
351
|
-
</View>
|
|
352
|
-
);
|
|
353
|
-
};
|
|
354
|
-
|
|
355
|
-
export default MetaAccordion;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Svg, {Rect} from 'react-native-svg';
|
|
3
|
-
|
|
4
|
-
const MiniBarChart = ({
|
|
5
|
-
data,
|
|
6
|
-
color,
|
|
7
|
-
maxVal,
|
|
8
|
-
}: {
|
|
9
|
-
data: number[];
|
|
10
|
-
color: string;
|
|
11
|
-
maxVal?: number;
|
|
12
|
-
}) => {
|
|
13
|
-
if (!data || data.length === 0) return <Svg width={40} height={16} />;
|
|
14
|
-
const max = maxVal || Math.max(...data, 1);
|
|
15
|
-
const paddedData =
|
|
16
|
-
data.length < 10
|
|
17
|
-
? [...Array(10 - data.length).fill(0), ...data]
|
|
18
|
-
: data.slice(-10);
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<Svg width={40} height={16} viewBox="0 0 40 16">
|
|
22
|
-
{paddedData.map((val, i) => {
|
|
23
|
-
const h = Math.max((val / max) * 16, 2);
|
|
24
|
-
const opacity = val === 0 && maxVal === 1 ? 0.2 : 1;
|
|
25
|
-
return (
|
|
26
|
-
<Rect
|
|
27
|
-
key={i}
|
|
28
|
-
x={i * 4}
|
|
29
|
-
y={16 - h}
|
|
30
|
-
width={2.5}
|
|
31
|
-
height={h}
|
|
32
|
-
fill={color}
|
|
33
|
-
rx={1}
|
|
34
|
-
opacity={opacity}
|
|
35
|
-
/>
|
|
36
|
-
);
|
|
37
|
-
})}
|
|
38
|
-
</Svg>
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export default MiniBarChart;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Svg, {Path} from 'react-native-svg';
|
|
3
|
-
|
|
4
|
-
const MiniLineChart = ({data, color}: {data: number[]; color: string}) => {
|
|
5
|
-
if (!data || data.length === 0) return <Svg width={40} height={16} />;
|
|
6
|
-
|
|
7
|
-
const paddedData =
|
|
8
|
-
data.length < 10
|
|
9
|
-
? [...Array(10 - data.length).fill(data[0] || 0), ...data]
|
|
10
|
-
: data.slice(-10);
|
|
11
|
-
const max = Math.max(...paddedData, 1);
|
|
12
|
-
const min = Math.min(...paddedData, 0);
|
|
13
|
-
const range = max - min || 1;
|
|
14
|
-
const dx = 40 / 9;
|
|
15
|
-
const points = paddedData
|
|
16
|
-
.map((d, i) => `${i * dx},${14 - ((d - min) / range) * 12}`)
|
|
17
|
-
.join(' L ');
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<Svg width={40} height={16} viewBox="0 0 40 16">
|
|
21
|
-
<Path
|
|
22
|
-
d={`M ${points}`}
|
|
23
|
-
fill="none"
|
|
24
|
-
stroke={color}
|
|
25
|
-
strokeWidth={1.5}
|
|
26
|
-
strokeLinecap="round"
|
|
27
|
-
strokeLinejoin="round"
|
|
28
|
-
/>
|
|
29
|
-
</Svg>
|
|
30
|
-
);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export default MiniLineChart;
|