react-native-inapp-inspector 1.0.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/LICENSE +21 -0
- package/README.md +97 -0
- package/dist/commonjs/components/AnalyticsDetail.d.ts +6 -0
- package/dist/commonjs/components/AnalyticsDetail.js +558 -0
- package/dist/commonjs/components/AnalyticsEventCard.d.ts +18 -0
- package/dist/commonjs/components/AnalyticsEventCard.js +327 -0
- package/dist/commonjs/components/AnalyticsGraph.d.ts +8 -0
- package/dist/commonjs/components/AnalyticsGraph.js +416 -0
- package/dist/commonjs/components/CodeSnippet.d.ts +8 -0
- package/dist/commonjs/components/CodeSnippet.js +427 -0
- package/dist/commonjs/components/ConsoleLogCard.d.ts +10 -0
- package/dist/commonjs/components/ConsoleLogCard.js +401 -0
- package/dist/commonjs/components/CopyButton.d.ts +4 -0
- package/dist/commonjs/components/CopyButton.js +69 -0
- package/dist/commonjs/components/DiffViewer.d.ts +7 -0
- package/dist/commonjs/components/DiffViewer.js +86 -0
- package/dist/commonjs/components/DomainHeader.d.ts +18 -0
- package/dist/commonjs/components/DomainHeader.js +136 -0
- package/dist/commonjs/components/EmptyState.d.ts +5 -0
- package/dist/commonjs/components/EmptyState.js +40 -0
- package/dist/commonjs/components/HeadersSection.d.ts +4 -0
- package/dist/commonjs/components/HeadersSection.js +155 -0
- package/dist/commonjs/components/HighlightText.d.ts +3 -0
- package/dist/commonjs/components/HighlightText.js +57 -0
- package/dist/commonjs/components/JsonViewer.d.ts +7 -0
- package/dist/commonjs/components/JsonViewer.js +19 -0
- package/dist/commonjs/components/LogCard.d.ts +4 -0
- package/dist/commonjs/components/LogCard.js +179 -0
- package/dist/commonjs/components/MetaAccordion.d.ts +4 -0
- package/dist/commonjs/components/MetaAccordion.js +113 -0
- package/dist/commonjs/components/MiniBarChart.d.ts +7 -0
- package/dist/commonjs/components/MiniBarChart.js +56 -0
- package/dist/commonjs/components/MiniLineChart.d.ts +6 -0
- package/dist/commonjs/components/MiniLineChart.js +58 -0
- package/dist/commonjs/components/NetworkIcons.d.ts +31 -0
- package/dist/commonjs/components/NetworkIcons.js +245 -0
- package/dist/commonjs/components/SectionHeader.d.ts +4 -0
- package/dist/commonjs/components/SectionHeader.js +87 -0
- package/dist/commonjs/components/SourcePageCard.d.ts +4 -0
- package/dist/commonjs/components/SourcePageCard.js +132 -0
- package/dist/commonjs/components/TouchableScale.d.ts +9 -0
- package/dist/commonjs/components/TouchableScale.js +44 -0
- package/dist/commonjs/components/TreeNode.d.ts +4 -0
- package/dist/commonjs/components/TreeNode.js +140 -0
- package/dist/commonjs/constants/index.d.ts +7 -0
- package/dist/commonjs/constants/index.js +35 -0
- package/dist/commonjs/customHooks/analyticsLogger.d.ts +21 -0
- package/dist/commonjs/customHooks/analyticsLogger.js +160 -0
- package/dist/commonjs/customHooks/consoleLogger.d.ts +5 -0
- package/dist/commonjs/customHooks/consoleLogger.js +141 -0
- package/dist/commonjs/customHooks/logFilters.d.ts +5 -0
- package/dist/commonjs/customHooks/logFilters.js +34 -0
- package/dist/commonjs/customHooks/networkLogger.d.ts +20 -0
- package/dist/commonjs/customHooks/networkLogger.js +272 -0
- package/dist/commonjs/customHooks/useAccordion.d.ts +17 -0
- package/dist/commonjs/customHooks/useAccordion.js +48 -0
- package/dist/commonjs/customHooks/webViewLogger.d.ts +22 -0
- package/dist/commonjs/customHooks/webViewLogger.js +412 -0
- package/dist/commonjs/helpers/index.d.ts +20 -0
- package/dist/commonjs/helpers/index.js +229 -0
- package/dist/commonjs/index.d.ts +7 -0
- package/dist/commonjs/index.js +2668 -0
- package/dist/commonjs/styles/AppColors.d.ts +27 -0
- package/dist/commonjs/styles/AppColors.js +30 -0
- package/dist/commonjs/styles/AppFonts.d.ts +7 -0
- package/dist/commonjs/styles/AppFonts.js +10 -0
- package/dist/commonjs/styles/index.d.ts +1488 -0
- package/dist/commonjs/styles/index.js +1357 -0
- package/dist/commonjs/types/index.d.ts +127 -0
- package/dist/commonjs/types/index.js +2 -0
- package/dist/esm/components/AnalyticsDetail.d.ts +6 -0
- package/dist/esm/components/AnalyticsDetail.js +520 -0
- package/dist/esm/components/AnalyticsEventCard.d.ts +18 -0
- package/dist/esm/components/AnalyticsEventCard.js +288 -0
- package/dist/esm/components/AnalyticsGraph.d.ts +8 -0
- package/dist/esm/components/AnalyticsGraph.js +378 -0
- package/dist/esm/components/CodeSnippet.d.ts +8 -0
- package/dist/esm/components/CodeSnippet.js +392 -0
- package/dist/esm/components/ConsoleLogCard.d.ts +10 -0
- package/dist/esm/components/ConsoleLogCard.js +362 -0
- package/dist/esm/components/CopyButton.d.ts +4 -0
- package/dist/esm/components/CopyButton.js +31 -0
- package/dist/esm/components/DiffViewer.d.ts +7 -0
- package/dist/esm/components/DiffViewer.js +48 -0
- package/dist/esm/components/DomainHeader.d.ts +18 -0
- package/dist/esm/components/DomainHeader.js +98 -0
- package/dist/esm/components/EmptyState.d.ts +5 -0
- package/dist/esm/components/EmptyState.js +35 -0
- package/dist/esm/components/HeadersSection.d.ts +4 -0
- package/dist/esm/components/HeadersSection.js +117 -0
- package/dist/esm/components/HighlightText.d.ts +3 -0
- package/dist/esm/components/HighlightText.js +52 -0
- package/dist/esm/components/JsonViewer.d.ts +7 -0
- package/dist/esm/components/JsonViewer.js +14 -0
- package/dist/esm/components/LogCard.d.ts +4 -0
- package/dist/esm/components/LogCard.js +141 -0
- package/dist/esm/components/MetaAccordion.d.ts +4 -0
- package/dist/esm/components/MetaAccordion.js +108 -0
- package/dist/esm/components/MiniBarChart.d.ts +7 -0
- package/dist/esm/components/MiniBarChart.js +18 -0
- package/dist/esm/components/MiniLineChart.d.ts +6 -0
- package/dist/esm/components/MiniLineChart.js +20 -0
- package/dist/esm/components/NetworkIcons.d.ts +31 -0
- package/dist/esm/components/NetworkIcons.js +176 -0
- package/dist/esm/components/SectionHeader.d.ts +4 -0
- package/dist/esm/components/SectionHeader.js +49 -0
- package/dist/esm/components/SourcePageCard.d.ts +4 -0
- package/dist/esm/components/SourcePageCard.js +94 -0
- package/dist/esm/components/TouchableScale.d.ts +9 -0
- package/dist/esm/components/TouchableScale.js +9 -0
- package/dist/esm/components/TreeNode.d.ts +4 -0
- package/dist/esm/components/TreeNode.js +102 -0
- package/dist/esm/constants/index.d.ts +7 -0
- package/dist/esm/constants/index.js +32 -0
- package/dist/esm/customHooks/analyticsLogger.d.ts +21 -0
- package/dist/esm/customHooks/analyticsLogger.js +152 -0
- package/dist/esm/customHooks/consoleLogger.d.ts +5 -0
- package/dist/esm/customHooks/consoleLogger.js +134 -0
- package/dist/esm/customHooks/logFilters.d.ts +5 -0
- package/dist/esm/customHooks/logFilters.js +31 -0
- package/dist/esm/customHooks/networkLogger.d.ts +20 -0
- package/dist/esm/customHooks/networkLogger.js +264 -0
- package/dist/esm/customHooks/useAccordion.d.ts +17 -0
- package/dist/esm/customHooks/useAccordion.js +46 -0
- package/dist/esm/customHooks/webViewLogger.d.ts +22 -0
- package/dist/esm/customHooks/webViewLogger.js +365 -0
- package/dist/esm/helpers/index.d.ts +20 -0
- package/dist/esm/helpers/index.js +207 -0
- package/dist/esm/index.d.ts +7 -0
- package/dist/esm/index.js +2611 -0
- package/dist/esm/styles/AppColors.d.ts +27 -0
- package/dist/esm/styles/AppColors.js +27 -0
- package/dist/esm/styles/AppFonts.d.ts +7 -0
- package/dist/esm/styles/AppFonts.js +7 -0
- package/dist/esm/styles/index.d.ts +1488 -0
- package/dist/esm/styles/index.js +1355 -0
- package/dist/esm/types/index.d.ts +127 -0
- package/dist/esm/types/index.js +1 -0
- package/fonts/Inter/Inter.ttc +0 -0
- package/fonts/Inter/InterVariable-Italic.ttf +0 -0
- package/fonts/Inter/InterVariable.ttf +0 -0
- package/fonts/Inter/LICENSE.txt +92 -0
- package/fonts/Inter/extras/otf/Inter-Black.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-BlackItalic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-Bold.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-BoldItalic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-ExtraBold.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-ExtraBoldItalic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-ExtraLight.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-ExtraLightItalic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-Italic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-Light.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-LightItalic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-Medium.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-MediumItalic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-Regular.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-SemiBold.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-SemiBoldItalic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-Thin.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-ThinItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-Black.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-BlackItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-Bold.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-BoldItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-ExtraBold.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-ExtraBoldItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-ExtraLight.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-ExtraLightItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-Italic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-Light.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-LightItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-Medium.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-MediumItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-Regular.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-SemiBold.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-SemiBoldItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-Thin.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-ThinItalic.otf +0 -0
- package/fonts/Inter/extras/ttf/Inter-Black.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-BlackItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-Bold.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-BoldItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-ExtraBold.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-ExtraBoldItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-ExtraLight.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-ExtraLightItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-Italic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-Light.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-LightItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-Medium.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-MediumItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-Regular.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-SemiBold.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-SemiBoldItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-Thin.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-ThinItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-Black.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-BlackItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-Bold.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-BoldItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-ExtraBold.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-ExtraBoldItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-ExtraLight.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-ExtraLightItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-Italic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-Light.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-LightItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-Medium.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-MediumItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-Regular.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-SemiBold.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-SemiBoldItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-Thin.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-ThinItalic.ttf +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-Black.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-BlackItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-Bold.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-BoldItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-ExtraBold.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-ExtraBoldItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-ExtraLight.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-ExtraLightItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-Italic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-Light.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-LightItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-Medium.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-MediumItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-Regular.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-SemiBold.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-SemiBoldItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-Thin.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-ThinItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-Black.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-BlackItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-Bold.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-BoldItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-ExtraBold.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-ExtraBoldItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-ExtraLight.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-ExtraLightItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-Italic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-Light.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-LightItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-Medium.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-MediumItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-Regular.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-SemiBold.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-SemiBoldItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-Thin.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-ThinItalic.woff2 +0 -0
- package/fonts/Inter/help.txt +165 -0
- package/fonts/Inter/web/Inter-Black.woff2 +0 -0
- package/fonts/Inter/web/Inter-BlackItalic.woff2 +0 -0
- package/fonts/Inter/web/Inter-Bold.woff2 +0 -0
- package/fonts/Inter/web/Inter-BoldItalic.woff2 +0 -0
- package/fonts/Inter/web/Inter-ExtraBold.woff2 +0 -0
- package/fonts/Inter/web/Inter-ExtraBoldItalic.woff2 +0 -0
- package/fonts/Inter/web/Inter-ExtraLight.woff2 +0 -0
- package/fonts/Inter/web/Inter-ExtraLightItalic.woff2 +0 -0
- package/fonts/Inter/web/Inter-Italic.woff2 +0 -0
- package/fonts/Inter/web/Inter-Light.woff2 +0 -0
- package/fonts/Inter/web/Inter-LightItalic.woff2 +0 -0
- package/fonts/Inter/web/Inter-Medium.woff2 +0 -0
- package/fonts/Inter/web/Inter-MediumItalic.woff2 +0 -0
- package/fonts/Inter/web/Inter-Regular.woff2 +0 -0
- package/fonts/Inter/web/Inter-SemiBold.woff2 +0 -0
- package/fonts/Inter/web/Inter-SemiBoldItalic.woff2 +0 -0
- package/fonts/Inter/web/Inter-Thin.woff2 +0 -0
- package/fonts/Inter/web/Inter-ThinItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-Black.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-BlackItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-Bold.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-BoldItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-ExtraBold.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-ExtraBoldItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-ExtraLight.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-ExtraLightItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-Italic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-Light.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-LightItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-Medium.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-MediumItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-Regular.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-SemiBold.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-SemiBoldItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-Thin.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-ThinItalic.woff2 +0 -0
- package/fonts/Inter/web/InterVariable-Italic.woff2 +0 -0
- package/fonts/Inter/web/InterVariable.woff2 +0 -0
- package/fonts/Inter/web/inter.css +148 -0
- package/package.json +52 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Svg, { Circle, Line, Path, Rect } from 'react-native-svg';
|
|
3
|
+
// Stylesheet
|
|
4
|
+
import { AppColors } from '../styles/AppColors';
|
|
5
|
+
export const EmptyRadarIcon = ({ color = AppColors.purple, size = 32 }) => {
|
|
6
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
7
|
+
<Path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" stroke={color} strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
|
|
8
|
+
<Circle cx="12" cy="11" r="3" stroke={color} strokeWidth="1.5"/>
|
|
9
|
+
<Path d="M12 14v3" stroke={color} strokeWidth="1.5" strokeLinecap="round"/>
|
|
10
|
+
</Svg>);
|
|
11
|
+
};
|
|
12
|
+
export const MapPinIcon = ({ color = AppColors.grayTextWeak, size = 14, }) => {
|
|
13
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
14
|
+
<Path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
15
|
+
<Circle cx="12" cy="10" r="3" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
16
|
+
</Svg>);
|
|
17
|
+
};
|
|
18
|
+
export const ScreenIcon = ({ color = AppColors.grayTextWeak, size = 14, }) => {
|
|
19
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
20
|
+
<Rect x="3" y="4" width="18" height="16" rx="2" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
21
|
+
<Path d="M3 8h18M8 20V8" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
22
|
+
</Svg>);
|
|
23
|
+
};
|
|
24
|
+
export const ExpandCollapseIcon = ({ isExpanded, color = AppColors.grayTextWeak, size = 14, }) => {
|
|
25
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
26
|
+
{isExpanded ? (<Path d="M4 14h6v6M20 10h-6V4M14 10l7-7M10 14l-7 7" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>) : (<Path d="M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>)}
|
|
27
|
+
</Svg>);
|
|
28
|
+
};
|
|
29
|
+
export const SearchIcon = ({ color = AppColors.primaryLight, size = 18, }) => {
|
|
30
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
31
|
+
<Circle cx="11" cy="11" r="8" stroke={color} strokeWidth="2"/>
|
|
32
|
+
<Line x1="16.5" y1="16.5" x2="22" y2="22" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
33
|
+
</Svg>);
|
|
34
|
+
};
|
|
35
|
+
export const ClearIcon = ({ color = AppColors.grayTextWeak, size = 14 }) => {
|
|
36
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
37
|
+
<Path d="M18 6L6 18M6 6l12 12" stroke={color} strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"/>
|
|
38
|
+
</Svg>);
|
|
39
|
+
};
|
|
40
|
+
export const ClockIcon = ({ color = AppColors.grayTextWeak, size = 14 }) => {
|
|
41
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
42
|
+
<Circle cx="12" cy="12" r="10" stroke={color} strokeWidth="2"/>
|
|
43
|
+
<Line x1="12" y1="12" x2="12" y2="7" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
44
|
+
<Line x1="12" y1="12" x2="16" y2="14" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
45
|
+
</Svg>);
|
|
46
|
+
};
|
|
47
|
+
export const CalendarIcon = ({ color = AppColors.grayTextWeak, size = 14, }) => {
|
|
48
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
49
|
+
<Rect x="3" y="4" width="18" height="18" rx="2" stroke={color} strokeWidth="2"/>
|
|
50
|
+
<Line x1="3" y1="9" x2="21" y2="9" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
51
|
+
<Line x1="8" y1="2" x2="8" y2="6" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
52
|
+
<Line x1="16" y1="2" x2="16" y2="6" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
53
|
+
</Svg>);
|
|
54
|
+
};
|
|
55
|
+
export const StatusIcon = ({ color = AppColors.grayTextWeak }) => {
|
|
56
|
+
return (<Svg width={14} height={14} viewBox="0 0 24 24" fill="none">
|
|
57
|
+
<Circle cx="12" cy="12" r="10" stroke={color} strokeWidth="2"/>
|
|
58
|
+
<Line x1="12" y1="8" x2="12" y2="12" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
59
|
+
<Circle cx="12" cy="16" r="1" fill={color}/>
|
|
60
|
+
</Svg>);
|
|
61
|
+
};
|
|
62
|
+
export const SizeIcon = ({ color = AppColors.grayTextWeak }) => {
|
|
63
|
+
return (<Svg width={14} height={14} viewBox="0 0 24 24" fill="none">
|
|
64
|
+
<Path d="M4 6h16M4 10h10M4 14h13M4 18h7" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
65
|
+
</Svg>);
|
|
66
|
+
};
|
|
67
|
+
export const RequestIcon = ({ color = AppColors.offerPurple }) => {
|
|
68
|
+
return (<Svg width={14} height={14} viewBox="0 0 24 24" fill="none">
|
|
69
|
+
<Path d="M5 12h14M13 6l6 6-6 6" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
70
|
+
</Svg>);
|
|
71
|
+
};
|
|
72
|
+
export const ResponseIcon = ({ color = AppColors.greenColor }) => {
|
|
73
|
+
return (<Svg width={14} height={14} viewBox="0 0 24 24" fill="none">
|
|
74
|
+
<Path d="M19 12H5M11 18l-6-6 6-6" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
75
|
+
</Svg>);
|
|
76
|
+
};
|
|
77
|
+
export const HeadersIcon = ({ color = AppColors.skyBlue }) => {
|
|
78
|
+
return (<Svg width={14} height={14} viewBox="0 0 24 24" fill="none">
|
|
79
|
+
<Path d="M4 6h16M4 12h16M4 18h10" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
80
|
+
</Svg>);
|
|
81
|
+
};
|
|
82
|
+
export const CopyIcon = ({ color = AppColors.grayTextWeak, size = 14 }) => {
|
|
83
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
84
|
+
<Path d="M9 9V5a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-4" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
85
|
+
<Rect x="3" y="7" width="10" height="14" rx="2" stroke={color} strokeWidth="2"/>
|
|
86
|
+
</Svg>);
|
|
87
|
+
};
|
|
88
|
+
export const FetchIcon = ({ color = AppColors.grayTextWeak, size = 14 }) => {
|
|
89
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
90
|
+
<Path d="M8 9l3 3-3 3M13 15h3" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
91
|
+
<Rect x="3" y="3" width="18" height="18" rx="2" stroke={color} strokeWidth="2"/>
|
|
92
|
+
</Svg>);
|
|
93
|
+
};
|
|
94
|
+
export const TerminalIcon = ({ color = AppColors.grayTextWeak, size = 14, }) => {
|
|
95
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
96
|
+
<Path d="M4 17l6-6-6-6M12 19h8" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
97
|
+
</Svg>);
|
|
98
|
+
};
|
|
99
|
+
export const CheckIcon = ({ color = AppColors.greenColor, size = 14 }) => {
|
|
100
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
101
|
+
<Path d="M20 6L9 17l-5-5" stroke={color} strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"/>
|
|
102
|
+
</Svg>);
|
|
103
|
+
};
|
|
104
|
+
export const FailIcon = ({ color = AppColors.errorColor, size = 10 }) => {
|
|
105
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
106
|
+
<Path d="M18 6L6 18M6 6l12 12" stroke={color} strokeWidth="3" strokeLinecap="round" strokeLinejoin="round"/>
|
|
107
|
+
</Svg>);
|
|
108
|
+
};
|
|
109
|
+
export const TrashIcon = ({ color = AppColors.primaryLight, size = 18 }) => {
|
|
110
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
111
|
+
<Path d="M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
112
|
+
</Svg>);
|
|
113
|
+
};
|
|
114
|
+
export const HeaderPauseIcon = ({ isPaused, color = AppColors.primaryLight, size = 20, }) => {
|
|
115
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
116
|
+
{isPaused ? (<Path d="M5 3l14 9-14 9V3z" fill={color}/>) : (<Path d="M6 5h3v14H6V5zm9 0h3v14h-3V5z" fill={color}/>)}
|
|
117
|
+
</Svg>);
|
|
118
|
+
};
|
|
119
|
+
export const ExportIcon = ({ color = AppColors.primaryLight, size = 18, }) => {
|
|
120
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
121
|
+
<Path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
122
|
+
</Svg>);
|
|
123
|
+
};
|
|
124
|
+
export const SignalIcon = ({ color = AppColors.primaryLight, size = 18, }) => {
|
|
125
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
126
|
+
<Path d="M2 20h.01M7 20v-4M12 20v-8M17 20V8M22 20V4" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
127
|
+
</Svg>);
|
|
128
|
+
};
|
|
129
|
+
export const DiffIcon = ({ color = AppColors.grayTextWeak, size = 14 }) => {
|
|
130
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
131
|
+
<Path d="M7 8h10M12 3v10" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
132
|
+
<Path d="M7 19h10" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
133
|
+
</Svg>);
|
|
134
|
+
};
|
|
135
|
+
export const GlobeIcon = ({ color = AppColors.grayTextWeak, size = 14 }) => {
|
|
136
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
137
|
+
<Circle cx="12" cy="12" r="10" stroke={color} strokeWidth="2"/>
|
|
138
|
+
<Path d="M12 2C8 7 8 17 12 22M12 2c4 5 4 15 0 20M2 12h20" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
139
|
+
</Svg>);
|
|
140
|
+
};
|
|
141
|
+
export const SortArrowIcon = ({ color = AppColors.primaryLight, size = 20, direction = 'down', }) => {
|
|
142
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
143
|
+
{direction === 'down' ? (<>
|
|
144
|
+
<Path d="M4 6h10M4 12h7M4 18h4" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
145
|
+
<Path d="M18 6v12m0 0l-3-3m3 3l3-3" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
146
|
+
</>) : (<>
|
|
147
|
+
<Path d="M4 6h4M4 12h7M4 18h10" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
148
|
+
<Path d="M18 18V6m0 0l-3 3m3-3l3 3" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
149
|
+
</>)}
|
|
150
|
+
</Svg>);
|
|
151
|
+
};
|
|
152
|
+
export const ChevronIcon = ({ color = AppColors.grayTextWeak, size = 14, }) => {
|
|
153
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
154
|
+
<Path d="M6 9l6 6 6-6" stroke={color} strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"/>
|
|
155
|
+
</Svg>);
|
|
156
|
+
};
|
|
157
|
+
export const FilterIcon = ({ color = AppColors.grayTextWeak, size = 18, }) => {
|
|
158
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
159
|
+
<Path d="M4 6h16M7 12h10M10 18h4" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
160
|
+
</Svg>);
|
|
161
|
+
};
|
|
162
|
+
export const DownloadIcon = ({ color = AppColors.primaryLight, size = 18, }) => {
|
|
163
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
164
|
+
<Path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
165
|
+
</Svg>);
|
|
166
|
+
};
|
|
167
|
+
export const CloseWhite = ({ color = '#FFFFFF', size = 20 }) => {
|
|
168
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
169
|
+
<Path d="M18 6L6 18M6 6l12 12" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
170
|
+
</Svg>);
|
|
171
|
+
};
|
|
172
|
+
export const WhiteBackNavigation = ({ color = '#FFFFFF', size = 20 }) => {
|
|
173
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
174
|
+
<Path d="M19 12H5M12 19l-7-7 7-7" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
175
|
+
</Svg>);
|
|
176
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React, { useRef, useEffect } from 'react';
|
|
2
|
+
import { Animated, View, Pressable, Text } from 'react-native';
|
|
3
|
+
// Stylesheet
|
|
4
|
+
import { AppColors } from '../styles/AppColors';
|
|
5
|
+
// Components
|
|
6
|
+
import CopyButton from './CopyButton';
|
|
7
|
+
import TouchableScale from './TouchableScale';
|
|
8
|
+
// Assets
|
|
9
|
+
import { RequestIcon, ResponseIcon, HeadersIcon, DiffIcon, ChevronIcon, } from './NetworkIcons';
|
|
10
|
+
// Stylesheet
|
|
11
|
+
import styles from '../styles';
|
|
12
|
+
const SectionHeader = ({ title, value, expanded, onToggleExpand, showDiff, isDiffing, onToggleDiff, }) => {
|
|
13
|
+
const isOpen = expanded === undefined ? false : !!expanded;
|
|
14
|
+
const chevronAnim = useRef(new Animated.Value(isOpen ? 1 : 0)).current;
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
Animated.timing(chevronAnim, {
|
|
17
|
+
toValue: isOpen ? 1 : 0,
|
|
18
|
+
duration: 220,
|
|
19
|
+
useNativeDriver: true,
|
|
20
|
+
}).start();
|
|
21
|
+
}, [isOpen]);
|
|
22
|
+
const chevronRotate = chevronAnim.interpolate({
|
|
23
|
+
inputRange: [0, 1],
|
|
24
|
+
outputRange: ['0deg', '180deg'],
|
|
25
|
+
});
|
|
26
|
+
return (<View style={styles.sectionHeaderGradient}>
|
|
27
|
+
<View style={styles.sectionHeaderRow}>
|
|
28
|
+
<Pressable style={styles.sectionTitleRow} onPress={onToggleExpand} hitSlop={12}>
|
|
29
|
+
{title === 'Request' || title === 'API' ? (<RequestIcon color={AppColors.offerPurple}/>) : title === 'Response' ? (<ResponseIcon color={AppColors.greenColor}/>) : (<HeadersIcon color={AppColors.skyBlue}/>)}
|
|
30
|
+
<Text style={styles.sectionTitle}>{title}</Text>
|
|
31
|
+
</Pressable>
|
|
32
|
+
<View style={styles.sectionHeaderActions}>
|
|
33
|
+
{showDiff && (<TouchableScale onPress={onToggleDiff} hitSlop={12} style={[
|
|
34
|
+
styles.iconSquareBtn,
|
|
35
|
+
isDiffing ? styles.iconSquareBtnActive : null,
|
|
36
|
+
]}>
|
|
37
|
+
<DiffIcon color={isDiffing ? AppColors.skyBlue : AppColors.grayTextWeak} size={14}/>
|
|
38
|
+
</TouchableScale>)}
|
|
39
|
+
<CopyButton value={value} label={title}/>
|
|
40
|
+
<TouchableScale onPress={onToggleExpand} hitSlop={12} style={styles.iconSquareBtn}>
|
|
41
|
+
<Animated.View style={{ transform: [{ rotate: chevronRotate }] }}>
|
|
42
|
+
<ChevronIcon color={AppColors.grayTextStrong} size={14}/>
|
|
43
|
+
</Animated.View>
|
|
44
|
+
</TouchableScale>
|
|
45
|
+
</View>
|
|
46
|
+
</View>
|
|
47
|
+
</View>);
|
|
48
|
+
};
|
|
49
|
+
export default SectionHeader;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Pressable, Text, Animated } from 'react-native';
|
|
3
|
+
import Svg, { Rect, Path } from 'react-native-svg';
|
|
4
|
+
// Components
|
|
5
|
+
import CopyButton from './CopyButton';
|
|
6
|
+
// Custom Hooks
|
|
7
|
+
import useAccordion from '../customHooks/useAccordion';
|
|
8
|
+
// Assets
|
|
9
|
+
import { ChevronIcon } from './NetworkIcons';
|
|
10
|
+
// Stylesheet
|
|
11
|
+
import { AppColors } from '../styles/AppColors';
|
|
12
|
+
import styles from '../styles';
|
|
13
|
+
const SourcePageCard = ({ routeInfo }) => {
|
|
14
|
+
const main = useAccordion(true, 600, 280);
|
|
15
|
+
const params = useAccordion(false, 800, 260);
|
|
16
|
+
const hasParams = routeInfo.params && Object.keys(routeInfo.params).length > 0;
|
|
17
|
+
return (<View style={styles.sourcePageCard}>
|
|
18
|
+
<Pressable onPress={main.toggleOpen} hitSlop={12}>
|
|
19
|
+
<View style={styles.sourcePageAccordionHeader}>
|
|
20
|
+
<View style={styles.sourcePageTop}>
|
|
21
|
+
<View style={styles.sourcePageIcon}>
|
|
22
|
+
<Svg width={14} height={14} viewBox="0 0 24 24" fill="none">
|
|
23
|
+
<Rect x="3" y="3" width="7" height="7" rx="1.5" stroke={AppColors.purple} strokeWidth="2"/>
|
|
24
|
+
<Rect x="14" y="3" width="7" height="7" rx="1.5" stroke={AppColors.purple} strokeWidth="2"/>
|
|
25
|
+
<Rect x="3" y="14" width="7" height="7" rx="1.5" stroke={AppColors.purple} strokeWidth="2"/>
|
|
26
|
+
<Path d="M14 17.5h7M17.5 14v7" stroke={AppColors.purple} strokeWidth="2" strokeLinecap="round"/>
|
|
27
|
+
</Svg>
|
|
28
|
+
</View>
|
|
29
|
+
<View style={{ flex: 1 }}>
|
|
30
|
+
<Text style={styles.sourcePageLabel}>Source Page</Text>
|
|
31
|
+
<Text style={styles.sourcePageValue} numberOfLines={1}>
|
|
32
|
+
{routeInfo.path}
|
|
33
|
+
</Text>
|
|
34
|
+
</View>
|
|
35
|
+
</View>
|
|
36
|
+
<View style={styles.sourcePageHeaderRight}>
|
|
37
|
+
<CopyButton value={routeInfo.path} label="Source Path"/>
|
|
38
|
+
<View style={styles.iconSquareBtn}>
|
|
39
|
+
<Animated.View style={main.chevronStyle}>
|
|
40
|
+
<ChevronIcon color={AppColors.grayTextStrong} size={14}/>
|
|
41
|
+
</Animated.View>
|
|
42
|
+
</View>
|
|
43
|
+
</View>
|
|
44
|
+
</View>
|
|
45
|
+
</Pressable>
|
|
46
|
+
|
|
47
|
+
<Animated.View style={main.bodyStyle}>
|
|
48
|
+
{hasParams && (<View style={styles.sourceParamsBox}>
|
|
49
|
+
<Pressable onPress={params.toggleOpen} hitSlop={10}>
|
|
50
|
+
<View style={styles.paramsAccordionHeader}>
|
|
51
|
+
<View style={styles.paramsAccordionLeft}>
|
|
52
|
+
<Text style={styles.sourceParamsLabel}>Parameters</Text>
|
|
53
|
+
<View style={styles.headerCountBadge}>
|
|
54
|
+
<Text style={styles.headerCountText}>
|
|
55
|
+
{Object.keys(routeInfo.params).length}
|
|
56
|
+
</Text>
|
|
57
|
+
</View>
|
|
58
|
+
</View>
|
|
59
|
+
<View style={styles.paramsAccordionRight}>
|
|
60
|
+
<CopyButton value={routeInfo.params} label="Parameters"/>
|
|
61
|
+
<View style={styles.iconSquareBtn}>
|
|
62
|
+
<Animated.View style={params.chevronStyle}>
|
|
63
|
+
<ChevronIcon color={AppColors.grayTextStrong} size={14}/>
|
|
64
|
+
</Animated.View>
|
|
65
|
+
</View>
|
|
66
|
+
</View>
|
|
67
|
+
</View>
|
|
68
|
+
</Pressable>
|
|
69
|
+
|
|
70
|
+
<Animated.View style={params.bodyStyle}>
|
|
71
|
+
<View style={styles.paramsBody}>
|
|
72
|
+
{Object.entries(routeInfo.params).map(([key, val], i, arr) => (<View key={key} style={[
|
|
73
|
+
styles.paramRow,
|
|
74
|
+
i < arr.length - 1 ? styles.paramRowBorder : null,
|
|
75
|
+
]}>
|
|
76
|
+
<Text style={styles.paramKey}>{key}</Text>
|
|
77
|
+
<View style={styles.paramValueRow}>
|
|
78
|
+
<Text selectable style={styles.paramValue}>
|
|
79
|
+
{typeof val === 'object'
|
|
80
|
+
? JSON.stringify(val)
|
|
81
|
+
: String(val)}
|
|
82
|
+
</Text>
|
|
83
|
+
<CopyButton value={typeof val === 'object'
|
|
84
|
+
? JSON.stringify(val)
|
|
85
|
+
: String(val)} label={key}/>
|
|
86
|
+
</View>
|
|
87
|
+
</View>))}
|
|
88
|
+
</View>
|
|
89
|
+
</Animated.View>
|
|
90
|
+
</View>)}
|
|
91
|
+
</Animated.View>
|
|
92
|
+
</View>);
|
|
93
|
+
};
|
|
94
|
+
export default SourcePageCard;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const TouchableScale: ({ onPress, style, children, hitSlop, disabled, }: {
|
|
3
|
+
onPress?: () => void;
|
|
4
|
+
style?: any;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
hitSlop?: any;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}) => React.JSX.Element;
|
|
9
|
+
export default TouchableScale;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
|
+
import { Animated, Pressable } from 'react-native';
|
|
3
|
+
const TouchableScale = ({ onPress, style, children, hitSlop, disabled, }) => {
|
|
4
|
+
const scale = useRef(new Animated.Value(1)).current;
|
|
5
|
+
return (<Pressable disabled={disabled} style={style} onPressIn={() => Animated.spring(scale, { toValue: 0.94, useNativeDriver: true }).start()} onPressOut={() => Animated.spring(scale, { toValue: 1, useNativeDriver: true }).start()} onPress={onPress} hitSlop={hitSlop}>
|
|
6
|
+
<Animated.View style={{ transform: [{ scale }] }}>{children}</Animated.View>
|
|
7
|
+
</Pressable>);
|
|
8
|
+
};
|
|
9
|
+
export default TouchableScale;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
2
|
+
import { Text, View, Image, Animated, Pressable } from 'react-native';
|
|
3
|
+
// Helpers
|
|
4
|
+
import { escapeRegex } from '../helpers';
|
|
5
|
+
// Assets
|
|
6
|
+
import { ChevronIcon } from './NetworkIcons';
|
|
7
|
+
// Stylesheet
|
|
8
|
+
import { AppColors } from '../styles/AppColors';
|
|
9
|
+
import styles from '../styles';
|
|
10
|
+
const TreeNode = React.memo(function TreeNode({ data, name, level = 0, search, forceOpen, }) {
|
|
11
|
+
const [localOpen, setLocalOpen] = useState(level < 1);
|
|
12
|
+
const open = forceOpen !== undefined ? forceOpen : localOpen;
|
|
13
|
+
const isObject = typeof data === 'object' && data !== null;
|
|
14
|
+
const isArray = Array.isArray(data);
|
|
15
|
+
function renderHighlighted(text) {
|
|
16
|
+
if (text === 'null' || text === 'undefined') {
|
|
17
|
+
return [
|
|
18
|
+
<Text key="nil" style={styles.codeTextNil}>
|
|
19
|
+
{text}
|
|
20
|
+
</Text>,
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
if (!search) {
|
|
24
|
+
return [
|
|
25
|
+
<Text key="plain" style={styles.codeText}>
|
|
26
|
+
{text}
|
|
27
|
+
</Text>,
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
const regex = new RegExp(`(${escapeRegex(search)})`, 'gi');
|
|
31
|
+
const parts = text.split(regex);
|
|
32
|
+
return parts.map((part, i) => part.toLowerCase() === search.toLowerCase() ? (<Text key={i} style={styles.highlight}>
|
|
33
|
+
{part}
|
|
34
|
+
</Text>) : (<Text key={i} style={styles.codeText}>
|
|
35
|
+
{part}
|
|
36
|
+
</Text>));
|
|
37
|
+
}
|
|
38
|
+
const indentStyle = { paddingLeft: level * 12 };
|
|
39
|
+
if (isObject && data._isFile) {
|
|
40
|
+
const file = data;
|
|
41
|
+
const isImage = file.type?.includes('image');
|
|
42
|
+
return (<View style={[indentStyle, styles.filePreviewNode]}>
|
|
43
|
+
{name !== undefined && (<Text style={[styles.codeKey, { marginBottom: 4 }]}>{`"${String(name)}": `}</Text>)}
|
|
44
|
+
<View style={styles.filePreviewCard}>
|
|
45
|
+
{isImage ? (<Image source={{ uri: file.uri }} style={styles.filePreviewThumb} resizeMode="cover"/>) : (<View style={styles.filePreviewDoc}>
|
|
46
|
+
<Text style={{ fontSize: 20 }}>📄</Text>
|
|
47
|
+
</View>)}
|
|
48
|
+
<View style={{ flex: 1 }}>
|
|
49
|
+
<Text style={styles.filePreviewName} numberOfLines={1}>
|
|
50
|
+
{file.name}
|
|
51
|
+
</Text>
|
|
52
|
+
<Text style={styles.filePreviewType}>{file.type}</Text>
|
|
53
|
+
</View>
|
|
54
|
+
</View>
|
|
55
|
+
</View>);
|
|
56
|
+
}
|
|
57
|
+
if (!isObject) {
|
|
58
|
+
const serialized = JSON.stringify(data) ?? String(data);
|
|
59
|
+
const prefix = name !== undefined ? `"${String(name)}": ` : null;
|
|
60
|
+
return (<View style={indentStyle}>
|
|
61
|
+
<Text selectable={true} style={styles.codeText}>
|
|
62
|
+
<Text style={styles.codeKey}>{prefix}</Text>
|
|
63
|
+
{renderHighlighted(serialized)}
|
|
64
|
+
</Text>
|
|
65
|
+
</View>);
|
|
66
|
+
}
|
|
67
|
+
const entries = isArray
|
|
68
|
+
? data.map((v, i) => [i, v])
|
|
69
|
+
: Object.entries(data);
|
|
70
|
+
const countLabel = isArray ? `[${entries.length}]` : `{${entries.length}}`;
|
|
71
|
+
const treeChevronAnim = useRef(new Animated.Value(open ? 1 : 0)).current;
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
Animated.timing(treeChevronAnim, {
|
|
74
|
+
toValue: open ? 1 : 0,
|
|
75
|
+
duration: 160,
|
|
76
|
+
useNativeDriver: true,
|
|
77
|
+
}).start();
|
|
78
|
+
}, [open]);
|
|
79
|
+
const treeChevronRotate = treeChevronAnim.interpolate({
|
|
80
|
+
inputRange: [0, 1],
|
|
81
|
+
outputRange: ['0deg', '180deg'],
|
|
82
|
+
});
|
|
83
|
+
return (<View style={indentStyle}>
|
|
84
|
+
<Pressable style={styles.treeRow} onPress={() => setLocalOpen(v => !v)} hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}>
|
|
85
|
+
<Animated.View style={{ transform: [{ rotate: treeChevronRotate }], marginRight: 6 }}>
|
|
86
|
+
<ChevronIcon color={AppColors.grayTextWeak} size={12}/>
|
|
87
|
+
</Animated.View>
|
|
88
|
+
{name !== undefined && (<Text style={[styles.codeKey, styles.treeKeyMargin]}>{`"${String(name)}"`}</Text>)}
|
|
89
|
+
{isArray ? (<View style={styles.arrayBadge}>
|
|
90
|
+
<Text style={styles.arrayBadgeText}>{countLabel}</Text>
|
|
91
|
+
</View>) : (<View style={styles.objectBadge}>
|
|
92
|
+
<Text style={styles.objectBadgeText}>{countLabel}</Text>
|
|
93
|
+
</View>)}
|
|
94
|
+
</Pressable>
|
|
95
|
+
|
|
96
|
+
{open &&
|
|
97
|
+
entries.map(([k, v]) => (<TreeNode key={String(k)} name={k} data={v} level={level + 1} search={search} forceOpen={forceOpen}/>))}
|
|
98
|
+
|
|
99
|
+
{open && <Text style={styles.codeSyntax}>{isArray ? ']' : '}'}</Text>}
|
|
100
|
+
</View>);
|
|
101
|
+
});
|
|
102
|
+
export default TreeNode;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Method } from '../types';
|
|
2
|
+
import { StatusFilter } from '../types';
|
|
3
|
+
export declare const STATUS_FILTERS: StatusFilter[];
|
|
4
|
+
export declare const METHOD_COLORS: Record<Method, string>;
|
|
5
|
+
export declare const DOMAIN_COLORS: string[];
|
|
6
|
+
export declare const DURATION_FAST_MS = 200;
|
|
7
|
+
export declare const DURATION_SLOW_MS = 800;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Styles
|
|
2
|
+
import { AppColors } from '../styles/AppColors';
|
|
3
|
+
export const STATUS_FILTERS = [
|
|
4
|
+
'ALL',
|
|
5
|
+
'2xx',
|
|
6
|
+
'3xx',
|
|
7
|
+
'4xx',
|
|
8
|
+
'5xx',
|
|
9
|
+
'Failed',
|
|
10
|
+
];
|
|
11
|
+
export const METHOD_COLORS = {
|
|
12
|
+
ALL: AppColors.grayText,
|
|
13
|
+
GET: AppColors.purple,
|
|
14
|
+
POST: AppColors.greenColor,
|
|
15
|
+
PUT: AppColors.lightOrange,
|
|
16
|
+
PATCH: AppColors.offerPurple,
|
|
17
|
+
DELETE: AppColors.errorColor,
|
|
18
|
+
};
|
|
19
|
+
export const DOMAIN_COLORS = [
|
|
20
|
+
'#1a5276',
|
|
21
|
+
'#8e44ad',
|
|
22
|
+
'#1e8449',
|
|
23
|
+
'#c0392b',
|
|
24
|
+
'#d35400',
|
|
25
|
+
'#d68910',
|
|
26
|
+
'#16a085',
|
|
27
|
+
'#27ae60',
|
|
28
|
+
'#2c3e50',
|
|
29
|
+
'#c2185b',
|
|
30
|
+
];
|
|
31
|
+
export const DURATION_FAST_MS = 200;
|
|
32
|
+
export const DURATION_SLOW_MS = 800;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AnalyticsEvent } from '../types';
|
|
2
|
+
export declare const subscribeAnalyticsEvents: (callback: (events: AnalyticsEvent[]) => void) => () => void;
|
|
3
|
+
export declare const clearAnalyticsEvents: () => void;
|
|
4
|
+
export declare const getAnalyticsEvents: () => AnalyticsEvent[];
|
|
5
|
+
/**
|
|
6
|
+
* Directly push an event into the inspector without going through Firebase.
|
|
7
|
+
* Useful for custom analytics wrappers or testing.
|
|
8
|
+
*/
|
|
9
|
+
export declare const logAnalyticsEvent: (name: string, params?: Record<string, any>, userProperties?: Record<string, any>) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Monkey-patches a @react-native-firebase/analytics instance so all calls
|
|
12
|
+
* are intercepted and forwarded to the NetworkInspector analytics tab.
|
|
13
|
+
*
|
|
14
|
+
* Pass the result of `analytics()` (the default app instance or any named one).
|
|
15
|
+
* Safe to call multiple times with the same instance — won't double-patch.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* import analytics from '@react-native-firebase/analytics';
|
|
19
|
+
* setupAnalyticsLogger(analytics());
|
|
20
|
+
*/
|
|
21
|
+
export declare const setupAnalyticsLogger: (analyticsInstance: any) => void;
|