react-native-inapp-inspector 1.1.13 → 1.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/README.md +9 -34
  2. package/dist/commonjs/assets/svgAssets.d.ts +3 -0
  3. package/dist/commonjs/assets/svgAssets.js +17 -0
  4. package/dist/commonjs/components/AnalyticsEventCard.d.ts +1 -14
  5. package/dist/commonjs/components/AnalyticsEventCard.js +120 -50
  6. package/dist/commonjs/components/AnalyticsGraph.d.ts +2 -6
  7. package/dist/commonjs/components/AnalyticsGraph.js +8 -8
  8. package/dist/commonjs/components/AnalyticsTabView.d.ts +15 -0
  9. package/dist/commonjs/components/AnalyticsTabView.js +157 -0
  10. package/dist/commonjs/components/AnimatedEntrance.d.ts +1 -1
  11. package/dist/commonjs/components/AnimatedEntrance.js +2 -2
  12. package/dist/commonjs/components/ApiDetailView.d.ts +22 -0
  13. package/dist/commonjs/components/ApiDetailView.js +304 -0
  14. package/dist/commonjs/components/ApisTabView.d.ts +33 -0
  15. package/dist/commonjs/components/ApisTabView.js +235 -0
  16. package/dist/commonjs/components/CodeSnippet.d.ts +1 -5
  17. package/dist/commonjs/components/CodeSnippet.js +34 -34
  18. package/dist/commonjs/components/ConsoleLogCard.d.ts +1 -8
  19. package/dist/commonjs/components/ConsoleLogCard.js +262 -442
  20. package/dist/commonjs/components/ConsoleLogDetailView.d.ts +9 -0
  21. package/dist/commonjs/components/ConsoleLogDetailView.js +278 -0
  22. package/dist/commonjs/components/ConsoleLogsTabView.d.ts +24 -0
  23. package/dist/commonjs/components/ConsoleLogsTabView.js +354 -0
  24. package/dist/commonjs/components/DiffViewer.js +4 -2
  25. package/dist/commonjs/components/DomainHeader.js +66 -41
  26. package/dist/commonjs/components/EmptyState.d.ts +2 -2
  27. package/dist/commonjs/components/EmptyState.js +2 -2
  28. package/dist/commonjs/components/EndOfListFooter.d.ts +8 -0
  29. package/dist/commonjs/components/EndOfListFooter.js +90 -0
  30. package/dist/commonjs/components/ErrorBoundary.d.ts +5 -14
  31. package/dist/commonjs/components/ErrorBoundary.js +28 -28
  32. package/dist/commonjs/components/FloatingBubble.d.ts +14 -0
  33. package/dist/commonjs/components/FloatingBubble.js +75 -0
  34. package/dist/commonjs/components/HeadersSection.js +5 -3
  35. package/dist/commonjs/components/HighlightText.d.ts +1 -1
  36. package/dist/commonjs/components/HighlightText.js +5 -7
  37. package/dist/commonjs/components/Inspector/AnalyticsTab.d.ts +3 -0
  38. package/dist/commonjs/components/Inspector/AnalyticsTab.js +232 -0
  39. package/dist/commonjs/components/Inspector/ConsoleTab.d.ts +3 -0
  40. package/dist/commonjs/components/Inspector/ConsoleTab.js +410 -0
  41. package/dist/commonjs/components/Inspector/FabLauncher.d.ts +3 -0
  42. package/dist/commonjs/components/Inspector/FabLauncher.js +54 -0
  43. package/dist/commonjs/components/Inspector/InsightsDashboard.d.ts +3 -0
  44. package/dist/commonjs/components/Inspector/InsightsDashboard.js +619 -0
  45. package/dist/commonjs/components/Inspector/InspectorContext.d.ts +5 -0
  46. package/dist/commonjs/components/Inspector/InspectorContext.js +18 -0
  47. package/dist/commonjs/components/Inspector/InspectorHeader.d.ts +3 -0
  48. package/dist/commonjs/components/Inspector/InspectorHeader.js +452 -0
  49. package/dist/commonjs/components/Inspector/LogDetail.d.ts +3 -0
  50. package/dist/commonjs/components/Inspector/LogDetail.js +963 -0
  51. package/dist/commonjs/components/Inspector/MainScreen.d.ts +3 -0
  52. package/dist/commonjs/components/Inspector/MainScreen.js +68 -0
  53. package/dist/commonjs/components/Inspector/NavigationTracker.d.ts +3 -0
  54. package/dist/commonjs/components/Inspector/NavigationTracker.js +12 -0
  55. package/dist/commonjs/components/Inspector/NetworkDetail.d.ts +3 -0
  56. package/dist/commonjs/components/Inspector/NetworkDetail.js +405 -0
  57. package/dist/commonjs/components/Inspector/NetworkTab.d.ts +3 -0
  58. package/dist/commonjs/components/Inspector/NetworkTab.js +281 -0
  59. package/dist/commonjs/components/Inspector/ReduxTab.d.ts +3 -0
  60. package/dist/commonjs/components/Inspector/ReduxTab.js +75 -0
  61. package/dist/commonjs/components/Inspector/SettingsPanel.d.ts +3 -0
  62. package/dist/commonjs/components/Inspector/SettingsPanel.js +1476 -0
  63. package/dist/commonjs/components/Inspector/TabBar.d.ts +3 -0
  64. package/dist/commonjs/components/Inspector/TabBar.js +95 -0
  65. package/dist/commonjs/components/Inspector/WebViewTab.d.ts +3 -0
  66. package/dist/commonjs/components/Inspector/WebViewTab.js +757 -0
  67. package/dist/commonjs/components/InspectorHeader.d.ts +19 -0
  68. package/dist/commonjs/components/InspectorHeader.js +329 -0
  69. package/dist/commonjs/components/InspectorTabBar.d.ts +16 -0
  70. package/dist/commonjs/components/InspectorTabBar.js +90 -0
  71. package/dist/commonjs/components/JsonViewer.d.ts +4 -1
  72. package/dist/commonjs/components/JsonViewer.js +110 -171
  73. package/dist/commonjs/components/LogCard.js +109 -86
  74. package/dist/commonjs/components/MetaAccordion.d.ts +1 -10
  75. package/dist/commonjs/components/MetaAccordion.js +23 -21
  76. package/dist/commonjs/components/NavigationTracker.d.ts +7 -0
  77. package/dist/commonjs/components/NavigationTracker.js +76 -0
  78. package/dist/commonjs/components/NetworkIcons.d.ts +6 -0
  79. package/dist/commonjs/components/NetworkIcons.js +54 -8
  80. package/dist/commonjs/components/ReduxTabView.d.ts +9 -0
  81. package/dist/commonjs/components/ReduxTabView.js +56 -0
  82. package/dist/commonjs/components/ReduxTreeView.js +241 -200
  83. package/dist/commonjs/components/SegmentedTabs.d.ts +15 -0
  84. package/dist/commonjs/components/SegmentedTabs.js +52 -0
  85. package/dist/commonjs/components/SettingsView.d.ts +13 -0
  86. package/dist/commonjs/components/SettingsView.js +328 -0
  87. package/dist/commonjs/components/TouchableScale.d.ts +2 -2
  88. package/dist/commonjs/components/TouchableScale.js +2 -2
  89. package/dist/commonjs/components/TreeNode.js +2 -2
  90. package/dist/commonjs/constants/index.js +1 -12
  91. package/dist/commonjs/constants/version.d.ts +1 -1
  92. package/dist/commonjs/constants/version.js +1 -1
  93. package/dist/commonjs/customHooks/analyticsLogger.d.ts +8 -0
  94. package/dist/commonjs/customHooks/analyticsLogger.js +42 -1
  95. package/dist/commonjs/customHooks/consoleLogger.js +137 -13
  96. package/dist/commonjs/customHooks/networkLogger.d.ts +0 -1
  97. package/dist/commonjs/customHooks/networkLogger.js +0 -1
  98. package/dist/commonjs/customHooks/reduxLogger.d.ts +2 -9
  99. package/dist/commonjs/enums/index.d.ts +39 -0
  100. package/dist/commonjs/enums/index.js +50 -0
  101. package/dist/commonjs/helpers/index.d.ts +27 -1
  102. package/dist/commonjs/helpers/index.js +187 -12
  103. package/dist/commonjs/helpers/settingsStore.d.ts +2 -24
  104. package/dist/commonjs/i18n/en.json +144 -0
  105. package/dist/commonjs/i18n/index.d.ts +2 -0
  106. package/dist/commonjs/i18n/index.js +27 -0
  107. package/dist/commonjs/i18n/locales/en.json +314 -0
  108. package/dist/commonjs/index.d.ts +2 -3
  109. package/dist/commonjs/index.js +207 -4927
  110. package/dist/commonjs/styles/AppColors.d.ts +148 -0
  111. package/dist/commonjs/styles/AppColors.js +176 -0
  112. package/dist/commonjs/styles/common.d.ts +3 -0
  113. package/dist/commonjs/styles/common.js +201 -0
  114. package/dist/commonjs/styles/index.d.ts +219 -435
  115. package/dist/commonjs/styles/index.js +312 -488
  116. package/dist/commonjs/types/enums.d.ts +9 -0
  117. package/dist/commonjs/types/enums.js +4 -0
  118. package/dist/commonjs/types/index.d.ts +4 -111
  119. package/dist/commonjs/types/index.js +16 -0
  120. package/dist/commonjs/types/interfaces.d.ts +337 -0
  121. package/dist/commonjs/types/interfaces.js +2 -0
  122. package/dist/esm/assets/svgAssets.d.ts +3 -0
  123. package/dist/esm/assets/svgAssets.js +14 -0
  124. package/dist/esm/components/AnalyticsEventCard.d.ts +1 -14
  125. package/dist/esm/components/AnalyticsEventCard.js +118 -48
  126. package/dist/esm/components/AnalyticsGraph.d.ts +2 -6
  127. package/dist/esm/components/AnalyticsGraph.js +8 -8
  128. package/dist/esm/components/AnalyticsTabView.d.ts +15 -0
  129. package/dist/esm/components/AnalyticsTabView.js +151 -0
  130. package/dist/esm/components/AnimatedEntrance.d.ts +1 -1
  131. package/dist/esm/components/AnimatedEntrance.js +2 -2
  132. package/dist/esm/components/ApiDetailView.d.ts +22 -0
  133. package/dist/esm/components/ApiDetailView.js +264 -0
  134. package/dist/esm/components/ApisTabView.d.ts +33 -0
  135. package/dist/esm/components/ApisTabView.js +196 -0
  136. package/dist/esm/components/CodeSnippet.d.ts +1 -5
  137. package/dist/esm/components/CodeSnippet.js +34 -34
  138. package/dist/esm/components/ConsoleLogCard.d.ts +1 -8
  139. package/dist/esm/components/ConsoleLogCard.js +262 -409
  140. package/dist/esm/components/ConsoleLogDetailView.d.ts +9 -0
  141. package/dist/esm/components/ConsoleLogDetailView.js +271 -0
  142. package/dist/esm/components/ConsoleLogsTabView.d.ts +24 -0
  143. package/dist/esm/components/ConsoleLogsTabView.js +348 -0
  144. package/dist/esm/components/DiffViewer.js +4 -2
  145. package/dist/esm/components/DomainHeader.js +66 -41
  146. package/dist/esm/components/EmptyState.d.ts +2 -2
  147. package/dist/esm/components/EmptyState.js +2 -2
  148. package/dist/esm/components/EndOfListFooter.d.ts +8 -0
  149. package/dist/esm/components/EndOfListFooter.js +83 -0
  150. package/dist/esm/components/ErrorBoundary.d.ts +5 -14
  151. package/dist/esm/components/ErrorBoundary.js +29 -29
  152. package/dist/esm/components/FloatingBubble.d.ts +14 -0
  153. package/dist/esm/components/FloatingBubble.js +68 -0
  154. package/dist/esm/components/HeadersSection.js +5 -3
  155. package/dist/esm/components/HighlightText.d.ts +1 -1
  156. package/dist/esm/components/HighlightText.js +5 -7
  157. package/dist/esm/components/Inspector/AnalyticsTab.d.ts +3 -0
  158. package/dist/esm/components/Inspector/AnalyticsTab.js +194 -0
  159. package/dist/esm/components/Inspector/ConsoleTab.d.ts +3 -0
  160. package/dist/esm/components/Inspector/ConsoleTab.js +372 -0
  161. package/dist/esm/components/Inspector/FabLauncher.d.ts +3 -0
  162. package/dist/esm/components/Inspector/FabLauncher.js +49 -0
  163. package/dist/esm/components/Inspector/InsightsDashboard.d.ts +3 -0
  164. package/dist/esm/components/Inspector/InsightsDashboard.js +614 -0
  165. package/dist/esm/components/Inspector/InspectorContext.d.ts +5 -0
  166. package/dist/esm/components/Inspector/InspectorContext.js +13 -0
  167. package/dist/esm/components/Inspector/InspectorHeader.d.ts +3 -0
  168. package/dist/esm/components/Inspector/InspectorHeader.js +447 -0
  169. package/dist/esm/components/Inspector/LogDetail.d.ts +3 -0
  170. package/dist/esm/components/Inspector/LogDetail.js +925 -0
  171. package/dist/esm/components/Inspector/MainScreen.d.ts +3 -0
  172. package/dist/esm/components/Inspector/MainScreen.js +63 -0
  173. package/dist/esm/components/Inspector/NavigationTracker.d.ts +3 -0
  174. package/dist/esm/components/Inspector/NavigationTracker.js +10 -0
  175. package/dist/esm/components/Inspector/NetworkDetail.d.ts +3 -0
  176. package/dist/esm/components/Inspector/NetworkDetail.js +367 -0
  177. package/dist/esm/components/Inspector/NetworkTab.d.ts +3 -0
  178. package/dist/esm/components/Inspector/NetworkTab.js +243 -0
  179. package/dist/esm/components/Inspector/ReduxTab.d.ts +3 -0
  180. package/dist/esm/components/Inspector/ReduxTab.js +70 -0
  181. package/dist/esm/components/Inspector/SettingsPanel.d.ts +3 -0
  182. package/dist/esm/components/Inspector/SettingsPanel.js +1438 -0
  183. package/dist/esm/components/Inspector/TabBar.d.ts +3 -0
  184. package/dist/esm/components/Inspector/TabBar.js +90 -0
  185. package/dist/esm/components/Inspector/WebViewTab.d.ts +3 -0
  186. package/dist/esm/components/Inspector/WebViewTab.js +752 -0
  187. package/dist/esm/components/InspectorHeader.d.ts +19 -0
  188. package/dist/esm/components/InspectorHeader.js +323 -0
  189. package/dist/esm/components/InspectorTabBar.d.ts +16 -0
  190. package/dist/esm/components/InspectorTabBar.js +84 -0
  191. package/dist/esm/components/JsonViewer.d.ts +4 -1
  192. package/dist/esm/components/JsonViewer.js +111 -172
  193. package/dist/esm/components/LogCard.js +111 -88
  194. package/dist/esm/components/MetaAccordion.d.ts +1 -10
  195. package/dist/esm/components/MetaAccordion.js +23 -21
  196. package/dist/esm/components/NavigationTracker.d.ts +7 -0
  197. package/dist/esm/components/NavigationTracker.js +39 -0
  198. package/dist/esm/components/NetworkIcons.d.ts +6 -0
  199. package/dist/esm/components/NetworkIcons.js +46 -6
  200. package/dist/esm/components/ReduxTabView.d.ts +9 -0
  201. package/dist/esm/components/ReduxTabView.js +50 -0
  202. package/dist/esm/components/ReduxTreeView.js +243 -202
  203. package/dist/esm/components/SegmentedTabs.d.ts +15 -0
  204. package/dist/esm/components/SegmentedTabs.js +47 -0
  205. package/dist/esm/components/SettingsView.d.ts +13 -0
  206. package/dist/esm/components/SettingsView.js +321 -0
  207. package/dist/esm/components/TouchableScale.d.ts +2 -2
  208. package/dist/esm/components/TouchableScale.js +2 -2
  209. package/dist/esm/components/TreeNode.js +2 -2
  210. package/dist/esm/constants/index.js +1 -12
  211. package/dist/esm/constants/version.d.ts +1 -1
  212. package/dist/esm/constants/version.js +1 -1
  213. package/dist/esm/customHooks/analyticsLogger.d.ts +8 -0
  214. package/dist/esm/customHooks/analyticsLogger.js +37 -0
  215. package/dist/esm/customHooks/consoleLogger.js +137 -13
  216. package/dist/esm/customHooks/networkLogger.d.ts +0 -1
  217. package/dist/esm/customHooks/networkLogger.js +0 -1
  218. package/dist/esm/customHooks/reduxLogger.d.ts +2 -9
  219. package/dist/esm/enums/index.d.ts +39 -0
  220. package/dist/esm/enums/index.js +47 -0
  221. package/dist/esm/helpers/index.d.ts +27 -1
  222. package/dist/esm/helpers/index.js +180 -11
  223. package/dist/esm/helpers/settingsStore.d.ts +2 -24
  224. package/dist/esm/i18n/en.json +144 -0
  225. package/dist/esm/i18n/index.d.ts +2 -0
  226. package/dist/esm/i18n/index.js +22 -0
  227. package/dist/esm/i18n/locales/en.json +314 -0
  228. package/dist/esm/index.d.ts +2 -3
  229. package/dist/esm/index.js +207 -4923
  230. package/dist/esm/styles/AppColors.d.ts +148 -0
  231. package/dist/esm/styles/AppColors.js +176 -0
  232. package/dist/esm/styles/common.d.ts +3 -0
  233. package/dist/esm/styles/common.js +197 -0
  234. package/dist/esm/styles/index.d.ts +219 -435
  235. package/dist/esm/styles/index.js +312 -488
  236. package/dist/esm/types/enums.d.ts +9 -0
  237. package/dist/esm/types/enums.js +3 -0
  238. package/dist/esm/types/index.d.ts +4 -111
  239. package/dist/esm/types/index.js +2 -1
  240. package/dist/esm/types/interfaces.d.ts +337 -0
  241. package/dist/esm/types/interfaces.js +1 -0
  242. package/example/App.tsx +88 -1
  243. package/example/android/app/build.gradle +29 -1
  244. package/example/android/app/src/main/java/com/example/MainApplication.kt +25 -0
  245. package/example/android/build.gradle +31 -4
  246. package/example/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  247. package/example/android/gradle.properties +1 -0
  248. package/example/android/settings.gradle +20 -1
  249. package/example/package-lock.json +1 -1
  250. package/package.json +3 -1
@@ -0,0 +1,39 @@
1
+ export declare enum InspectorTab {
2
+ APIs = "apis",
3
+ Logs = "logs",
4
+ Analytics = "analytics",
5
+ Redux = "redux"
6
+ }
7
+ export declare enum ApiDetailTab {
8
+ Response = "response",
9
+ Request = "request",
10
+ Headers = "headers",
11
+ Metadata = "metadata"
12
+ }
13
+ export declare enum JsonViewerMode {
14
+ Pretty = "pretty",
15
+ Raw = "raw",
16
+ Table = "table"
17
+ }
18
+ export declare enum ReduxSubTab {
19
+ State = "state",
20
+ Timeline = "timeline"
21
+ }
22
+ export declare enum ReduxActionSubTab {
23
+ Payload = "payload",
24
+ Diff = "diff",
25
+ State = "state"
26
+ }
27
+ export declare enum ConsoleLogLevel {
28
+ Info = "info",
29
+ Warn = "warn",
30
+ Error = "error"
31
+ }
32
+ export declare enum SortOrderEnum {
33
+ Newest = "newest",
34
+ Oldest = "oldest"
35
+ }
36
+ export declare enum AnalyticsSource {
37
+ Firebase = "firebase",
38
+ Manual = "manual"
39
+ }
@@ -0,0 +1,47 @@
1
+ export var InspectorTab;
2
+ (function (InspectorTab) {
3
+ InspectorTab["APIs"] = "apis";
4
+ InspectorTab["Logs"] = "logs";
5
+ InspectorTab["Analytics"] = "analytics";
6
+ InspectorTab["Redux"] = "redux";
7
+ })(InspectorTab || (InspectorTab = {}));
8
+ export var ApiDetailTab;
9
+ (function (ApiDetailTab) {
10
+ ApiDetailTab["Response"] = "response";
11
+ ApiDetailTab["Request"] = "request";
12
+ ApiDetailTab["Headers"] = "headers";
13
+ ApiDetailTab["Metadata"] = "metadata";
14
+ })(ApiDetailTab || (ApiDetailTab = {}));
15
+ export var JsonViewerMode;
16
+ (function (JsonViewerMode) {
17
+ JsonViewerMode["Pretty"] = "pretty";
18
+ JsonViewerMode["Raw"] = "raw";
19
+ JsonViewerMode["Table"] = "table";
20
+ })(JsonViewerMode || (JsonViewerMode = {}));
21
+ export var ReduxSubTab;
22
+ (function (ReduxSubTab) {
23
+ ReduxSubTab["State"] = "state";
24
+ ReduxSubTab["Timeline"] = "timeline";
25
+ })(ReduxSubTab || (ReduxSubTab = {}));
26
+ export var ReduxActionSubTab;
27
+ (function (ReduxActionSubTab) {
28
+ ReduxActionSubTab["Payload"] = "payload";
29
+ ReduxActionSubTab["Diff"] = "diff";
30
+ ReduxActionSubTab["State"] = "state";
31
+ })(ReduxActionSubTab || (ReduxActionSubTab = {}));
32
+ export var ConsoleLogLevel;
33
+ (function (ConsoleLogLevel) {
34
+ ConsoleLogLevel["Info"] = "info";
35
+ ConsoleLogLevel["Warn"] = "warn";
36
+ ConsoleLogLevel["Error"] = "error";
37
+ })(ConsoleLogLevel || (ConsoleLogLevel = {}));
38
+ export var SortOrderEnum;
39
+ (function (SortOrderEnum) {
40
+ SortOrderEnum["Newest"] = "newest";
41
+ SortOrderEnum["Oldest"] = "oldest";
42
+ })(SortOrderEnum || (SortOrderEnum = {}));
43
+ export var AnalyticsSource;
44
+ (function (AnalyticsSource) {
45
+ AnalyticsSource["Firebase"] = "firebase";
46
+ AnalyticsSource["Manual"] = "manual";
47
+ })(AnalyticsSource || (AnalyticsSource = {}));
@@ -1,4 +1,4 @@
1
- import { NetworkLog, RouteInfo, DiffResult } from '../types';
1
+ import { NetworkLog, RouteInfo, DiffResult, JsonContent } from '../types';
2
2
  export declare const getDomainColor: (domain: string) => string;
3
3
  export declare const formatDateTime: (timestamp: number) => string;
4
4
  export declare const getStatusColor: (status: number | null) => string;
@@ -22,3 +22,29 @@ export declare const formatDateTimeToAnalytics: (ts: number) => string;
22
22
  export declare const getBundleIdentifier: () => string;
23
23
  export declare const getAppName: () => string;
24
24
  export declare const handleOpenExternalLink: (url: string) => void;
25
+ /** Formats a timestamp as HH:MM:SS (no milliseconds). */
26
+ export declare const formatTimeShort: (ts: number) => string;
27
+ /** Formats a timestamp as HH:MM:SS.mmm (with milliseconds). */
28
+ export declare const formatTime: (ts: number) => string;
29
+ /** Formats a relative gap like "+2s" / "+1m 5s" / "+350ms". */
30
+ export declare const formatGap: (ms: number) => string;
31
+ /** Finds the first JSON object/array embedded anywhere in a log message. */
32
+ export declare const getJsonContent: (message: string) => JsonContent | null;
33
+ /** Pretty-prints JSON data showing 3-4 lines with trailing "..." */
34
+ export declare const getJsonPreviewText: (data: any, maxLines?: number) => {
35
+ text: string;
36
+ hasMore: boolean;
37
+ };
38
+ export interface ParsedStackFrame {
39
+ raw: string;
40
+ functionName: string;
41
+ fileName: string;
42
+ fullPath: string;
43
+ fileExt?: 'tsx' | 'jsx' | 'ts' | 'js' | 'other';
44
+ isUserCode?: boolean;
45
+ lineNumber?: string;
46
+ columnNumber?: string;
47
+ isOrigin?: boolean;
48
+ }
49
+ /** Parses a stack trace line to extract function name, file name, extension (.tsx/.jsx/.ts), line, and column numbers */
50
+ export declare const parseStackLine: (rawLine: string, isOrigin?: boolean) => ParsedStackFrame;
@@ -52,10 +52,52 @@ export const getSize = (data) => {
52
52
  return '—';
53
53
  }
54
54
  };
55
+ // Try loading community clipboard or native clipboard modules with graceful fallbacks
56
+ const getClipboardModule = () => {
57
+ try {
58
+ // @ts-ignore
59
+ const community = require('@react-native-clipboard/clipboard');
60
+ if (community?.default?.setString)
61
+ return community.default;
62
+ if (community?.setString)
63
+ return community;
64
+ }
65
+ catch { }
66
+ try {
67
+ // @ts-ignore
68
+ const oldCommunity = require('@react-native-community/clipboard');
69
+ if (oldCommunity?.default?.setString)
70
+ return oldCommunity.default;
71
+ if (oldCommunity?.setString)
72
+ return oldCommunity;
73
+ }
74
+ catch { }
75
+ try {
76
+ if (NativeModules?.RNCClipboard?.setString)
77
+ return NativeModules.RNCClipboard;
78
+ }
79
+ catch { }
80
+ return Clipboard;
81
+ };
55
82
  export const copyToClipboard = (value, label) => {
56
83
  const resolved = typeof value === 'function' ? value() : value;
57
84
  const text = typeof resolved === 'string' ? resolved : JSON.stringify(resolved, null, 2);
58
- Clipboard.setString(text ?? '');
85
+ const textToCopy = text ?? '';
86
+ try {
87
+ const cb = getClipboardModule();
88
+ if (cb && typeof cb.setString === 'function') {
89
+ cb.setString(textToCopy);
90
+ }
91
+ else {
92
+ Clipboard.setString(textToCopy);
93
+ }
94
+ }
95
+ catch {
96
+ try {
97
+ Clipboard.setString(textToCopy);
98
+ }
99
+ catch { }
100
+ }
59
101
  if (Platform.OS === 'android') {
60
102
  ToastAndroid.show(`${label} copied`, ToastAndroid.SHORT);
61
103
  }
@@ -262,14 +304,7 @@ export const getAppName = () => {
262
304
  // Try iOS via PlatformConstants
263
305
  const constants = NativeModules.PlatformConstants;
264
306
  if (constants && typeof constants.interfaceIdiom === 'string') {
265
- // On iOS, try to get display name from the main bundle
266
- const SettingsManager = NativeModules.SettingsManager;
267
- if (SettingsManager && SettingsManager.settings) {
268
- const appName = SettingsManager.settings.AppleLocale
269
- ? undefined
270
- : undefined;
271
- // Fallback: try to parse from SourceCode
272
- }
307
+ // Fallback: try to parse from SourceCode
273
308
  }
274
309
  // Try react-native-device-info
275
310
  const RNDeviceInfo = NativeModules.RNDeviceInfo;
@@ -305,13 +340,147 @@ export const getAppName = () => {
305
340
  export const handleOpenExternalLink = (url) => {
306
341
  if (!url)
307
342
  return;
308
- Alert.alert('Open Link', `Do you want to open this link in your web browser?\n\n${url}`, [
343
+ const openUrl = formatDisplayUrl(url);
344
+ Alert.alert('Open Link', `Do you want to open this link in your web browser?\n\n${openUrl}`, [
309
345
  { text: 'Cancel', style: 'cancel' },
310
346
  {
311
347
  text: 'Open',
312
348
  onPress: () => {
313
- Linking.openURL(url).catch(() => { });
349
+ Linking.openURL(openUrl).catch(() => { });
314
350
  },
315
351
  },
316
352
  ]);
317
353
  };
354
+ /** Formats a timestamp as HH:MM:SS (no milliseconds). */
355
+ export const formatTimeShort = (ts) => {
356
+ const d = new Date(ts);
357
+ const hh = String(d.getHours()).padStart(2, '0');
358
+ const mm = String(d.getMinutes()).padStart(2, '0');
359
+ const ss = String(d.getSeconds()).padStart(2, '0');
360
+ return `${hh}:${mm}:${ss}`;
361
+ };
362
+ /** Formats a timestamp as HH:MM:SS.mmm (with milliseconds). */
363
+ export const formatTime = (ts) => {
364
+ const d = new Date(ts);
365
+ const hh = String(d.getHours()).padStart(2, '0');
366
+ const mm = String(d.getMinutes()).padStart(2, '0');
367
+ const ss = String(d.getSeconds()).padStart(2, '0');
368
+ const ms = String(d.getMilliseconds()).padStart(3, '0');
369
+ return `${hh}:${mm}:${ss}.${ms}`;
370
+ };
371
+ /** Formats a relative gap like "+2s" / "+1m 5s" / "+350ms". */
372
+ export const formatGap = (ms) => {
373
+ if (ms < 1000)
374
+ return `+${ms}ms`;
375
+ const s = Math.round(ms / 1000);
376
+ if (s < 60)
377
+ return `+${s}s`;
378
+ const m = Math.floor(s / 60);
379
+ const rem = s % 60;
380
+ return rem > 0 ? `+${m}m ${rem}s` : `+${m}m`;
381
+ };
382
+ /** Finds the first JSON object/array embedded anywhere in a log message. */
383
+ export const getJsonContent = (message) => {
384
+ if (!message)
385
+ return null;
386
+ const indices = [];
387
+ for (let i = 0; i < message.length; i++) {
388
+ if (message[i] === '{' || message[i] === '[') {
389
+ indices.push(i);
390
+ }
391
+ }
392
+ for (const index of indices) {
393
+ const candidate = message.substring(index).trim();
394
+ try {
395
+ const parsed = JSON.parse(candidate);
396
+ if (parsed !== null && typeof parsed === 'object') {
397
+ const header = message.substring(0, index).trim();
398
+ return { header, data: parsed };
399
+ }
400
+ }
401
+ catch (e) {
402
+ // Ignore
403
+ }
404
+ }
405
+ return null;
406
+ };
407
+ /** Pretty-prints JSON data showing 3-4 lines with trailing "..." */
408
+ export const getJsonPreviewText = (data, maxLines = 4) => {
409
+ try {
410
+ const formatted = JSON.stringify(data, null, 2);
411
+ const lines = formatted.split('\n');
412
+ if (lines.length > maxLines) {
413
+ return {
414
+ text: lines.slice(0, maxLines).join('\n') + '\n...',
415
+ hasMore: true,
416
+ };
417
+ }
418
+ return {
419
+ text: formatted,
420
+ hasMore: false,
421
+ };
422
+ }
423
+ catch (e) {
424
+ return {
425
+ text: String(data),
426
+ hasMore: false,
427
+ };
428
+ }
429
+ };
430
+ /** Parses a stack trace line to extract function name, file name, extension (.tsx/.jsx/.ts), line, and column numbers */
431
+ export const parseStackLine = (rawLine, isOrigin = false) => {
432
+ let line = rawLine.trim().replace(/^at /, '');
433
+ // Format: func@file:line:col (JSC / Hermes format)
434
+ if (line.includes('@')) {
435
+ const atIndex = line.indexOf('@');
436
+ const funcPart = line.substring(0, atIndex).trim();
437
+ const pathPart = line.substring(atIndex + 1).trim();
438
+ line = funcPart ? `${funcPart} (${pathPart})` : pathPart;
439
+ }
440
+ // Check for "func (path:line:col)" or "path:line:col"
441
+ const parenMatch = line.match(/^(.*?)\s*\((.*?)\)$/);
442
+ let functionName = '<anonymous>';
443
+ let locationPart = line;
444
+ if (parenMatch) {
445
+ functionName = parenMatch[1].trim() || '<anonymous>';
446
+ locationPart = parenMatch[2].trim();
447
+ }
448
+ // Remove "address at " prefix if present in Hermes
449
+ locationPart = locationPart.replace(/^address at /, '');
450
+ // Extract file, line, and col from locationPart (e.g. "path/to/file.tsx:42:15" or "http://...:42:15")
451
+ const locMatch = locationPart.match(/^(.*?):(\d+):(\d+)$/);
452
+ let fullPath = locationPart;
453
+ let lineNumber;
454
+ let columnNumber;
455
+ if (locMatch) {
456
+ fullPath = locMatch[1];
457
+ lineNumber = locMatch[2];
458
+ columnNumber = locMatch[3];
459
+ }
460
+ // Clean file name (remove query strings, packager urls, and parent paths)
461
+ let cleanPath = fullPath.split('?')[0].split('&')[0].replace(/[)]+$/, '');
462
+ // Remove protocol prefixes
463
+ cleanPath = cleanPath.replace(/^(?:https?:\/\/[^\/]+\/|file:\/\/\/|webpack:\/\/\/?)/, '');
464
+ const fileName = cleanPath.split('/').pop() || cleanPath;
465
+ // Determine file extension (.tsx, .jsx, .ts, .js)
466
+ const extMatch = fileName.match(/\.([a-z0-9]+)$/i);
467
+ const ext = extMatch ? extMatch[1].toLowerCase() : '';
468
+ const fileExt = ext === 'tsx' || ext === 'jsx' || ext === 'ts' || ext === 'js'
469
+ ? ext
470
+ : 'other';
471
+ const isUserCode = !cleanPath.includes('node_modules') &&
472
+ !cleanPath.includes('react-native/') &&
473
+ !cleanPath.includes('react-native-inapp-inspector') &&
474
+ (fileExt === 'tsx' || fileExt === 'jsx' || fileExt === 'ts' || fileExt === 'js');
475
+ return {
476
+ raw: rawLine,
477
+ functionName,
478
+ fileName,
479
+ fullPath: cleanPath,
480
+ fileExt,
481
+ isUserCode,
482
+ lineNumber,
483
+ columnNumber,
484
+ isOrigin,
485
+ };
486
+ };
@@ -1,28 +1,6 @@
1
- export interface InspectorStorage {
2
- getItem: (key: string) => string | null | Promise<string | null>;
3
- setItem: (key: string, value: string) => void | Promise<void>;
4
- }
1
+ import { InspectorStorage, PersistedSettings } from '../types';
2
+ export { InspectorStorage, PersistedSettings };
5
3
  export declare function setCustomStorage(storage: InspectorStorage | null): void;
6
- export interface PersistedSettings {
7
- isDark?: boolean;
8
- modalHeightPercent?: number;
9
- modalAnimationType?: string;
10
- tabVisibility?: Record<string, boolean>;
11
- defaultTab?: string;
12
- maxNetworkLogs?: number;
13
- maxConsoleLogs?: number;
14
- showConsoleLevels?: {
15
- info: boolean;
16
- warn: boolean;
17
- error: boolean;
18
- };
19
- webViewCaptureCssJs?: boolean;
20
- reduxAutoRefresh?: boolean;
21
- reduxExpandDepth?: number;
22
- slowRequestThreshold?: number;
23
- insightsShowConsoleAlerts?: boolean;
24
- showDuplicateLogs?: boolean;
25
- }
26
4
  export declare function loadSettings(): Promise<PersistedSettings>;
27
5
  export declare function saveSettings(settings: PersistedSettings): void;
28
6
  export declare function clearPersistedSettings(): Promise<void>;
@@ -0,0 +1,144 @@
1
+ {
2
+ "header": {
3
+ "title": "InApp Inspector",
4
+ "clear_all": "Clear Everything",
5
+ "clear_all_confirm": "This clears all tabs — APIs, Logs, Analytics, WebView and Redux timeline. Continue?",
6
+ "cancel": "Cancel",
7
+ "clear": "Clear All",
8
+ "engine": "Engine: React Native"
9
+ },
10
+ "tabs": {
11
+ "apis": "APIs",
12
+ "logs": "Logs",
13
+ "analytics": "Analytics",
14
+ "redux": "Redux"
15
+ },
16
+ "search": {
17
+ "apis_placeholder": "Search by URL, method, or status...",
18
+ "logs_placeholder": "Search logs...",
19
+ "log_details_placeholder": "Search in log details...",
20
+ "analytics_placeholder": "Search events...",
21
+ "redux_placeholder": "Search Redux keys or values...",
22
+ "request_placeholder": "Search request...",
23
+ "response_placeholder": "Search response..."
24
+ },
25
+ "filters": {
26
+ "group_by_domain": "Group by Domain",
27
+ "all": "All",
28
+ "user_log": "User Log",
29
+ "info": "Info",
30
+ "warn": "Warn",
31
+ "error": "Error",
32
+ "analytics": "Analytics",
33
+ "showing_requests": "Showing ({{filtered}}/{{total}}) requests",
34
+ "showing_logs": "Showing ({{filtered}}/{{total}}) logs showing",
35
+ "filtering_logs": "Filtering with {{filters}} ({{filtered}}/{{total}}) logs is showing",
36
+ "showing_analytics": "Showing ({{filtered}}/{{total}}) analytics events"
37
+ },
38
+ "details": {
39
+ "console_log": "Console Log",
40
+ "caller_location": "CALLER LOCATION",
41
+ "log_payload": "LOG PAYLOAD",
42
+ "captured_at": "Captured at: ",
43
+ "chars": "chars",
44
+ "query_params": "Query Params",
45
+ "duration": "Duration",
46
+ "timestamp": "Timestamp",
47
+ "request_size": "Request Size",
48
+ "response_size": "Response Size",
49
+ "caller_stack": "Caller Stack",
50
+ "response_headers": "Response Headers",
51
+ "request_headers": "Request Headers",
52
+ "request_payload": "Request Payload",
53
+ "response": "Response",
54
+ "tab_response": "Response",
55
+ "tab_request": "Request",
56
+ "tab_headers": "Headers",
57
+ "tab_metadata": "Metadata",
58
+ "network_request": "Network Request",
59
+ "copy_all": "COPY ALL",
60
+ "general_info": "General Info",
61
+ "no_headers": "No Headers",
62
+ "no_payload": "No Payload",
63
+ "no_response": "No Response"
64
+ },
65
+ "analytics": {
66
+ "title": "Analytics Events",
67
+ "empty": "No analytics events recorded yet.",
68
+ "user_context": "User Context",
69
+ "id": "ID",
70
+ "show_props": "Show Props",
71
+ "hide_props": "Hide Props",
72
+ "event_details": "Event Details",
73
+ "event_name": "Event Name",
74
+ "timestamp": "Timestamp",
75
+ "parameters": "Parameters",
76
+ "no_parameters": "No Parameters"
77
+ },
78
+ "redux": {
79
+ "title": "Redux Store & History",
80
+ "search_label": "SEARCH REDUX STATE / ACTIONS",
81
+ "no_actions": "NO ACTIONS DISPATCHED YET",
82
+ "no_store_title": "No Redux Store",
83
+ "no_store_sub": "To inspect Redux store, call connectReduxStore(store) at app start.",
84
+ "empty_store_title": "Empty Store",
85
+ "empty_store_sub": "Connected store state is empty.",
86
+ "root_reducers": "Root State Reducers",
87
+ "slices": "slice(s)"
88
+ },
89
+ "settings": {
90
+ "title": "Inspector Settings",
91
+ "appearance": "APPEARANCE",
92
+ "dark_mode": "Dark Mode Theme",
93
+ "dark_mode_desc": "Switch between dark and light inspector theme",
94
+ "module_visibility": "MODULE VISIBILITY & TABS",
95
+ "apis_tab": "Network APIs Tab",
96
+ "apis_tab_desc": "Show or hide Network APIs monitoring tab",
97
+ "logs_tab": "Console Logs Tab",
98
+ "logs_tab_desc": "Show or hide Console Logs tab",
99
+ "analytics_tab": "Analytics Events Tab",
100
+ "analytics_tab_desc": "Show or hide Analytics Events tab",
101
+ "redux_tab": "Redux Timeline Tab",
102
+ "redux_tab_desc": "Show or hide Redux store state inspector tab",
103
+ "default_landing_tab": "DEFAULT LANDING TAB",
104
+ "storage_persistence": "STORAGE & PERSISTENCE",
105
+ "custom_storage": "Custom Storage Adapter",
106
+ "custom_storage_active": "Active (AsyncStorage / Custom Storage attached)",
107
+ "custom_storage_memory": "In-Memory only (No persistent storage attached)",
108
+ "reset_settings": "Reset Persisted Settings",
109
+ "reset_settings_desc": "Clear saved theme, tab visibility & preferences",
110
+ "reset_confirm_title": "Reset Settings",
111
+ "reset_confirm_msg": "Are you sure you want to reset all persisted preferences to default?",
112
+ "reset": "Reset",
113
+ "reset_done": "Settings reset to default."
114
+ },
115
+ "empty": {
116
+ "loading": "Loading logs...",
117
+ "no_matching_apis": "No matching APIs",
118
+ "no_network_activity": "No network activity",
119
+ "try_adjusting_filters": "Try adjusting your filters or search.",
120
+ "listening_api_calls": "Listening for incoming API calls...",
121
+ "reload_app": "Reload App",
122
+ "reload": "Reload",
123
+ "reload_dev_only": "App reload is typically only available in development mode."
124
+ },
125
+ "error": {
126
+ "native_crash": "🔴 NATIVE CRASH",
127
+ "js_crash": "🟡 JAVASCRIPT CRASH",
128
+ "crash_desc": "The In-App Inspector or active view encountered an error. Traceback details are parsed below:",
129
+ "method": "Method:",
130
+ "file": "File:",
131
+ "line": "Line:",
132
+ "col": "Col:",
133
+ "copy_traceback": "📋 Copy Crash Traceback",
134
+ "retry_reload": "Retry / Reload",
135
+ "close_inspector": "Close Inspector"
136
+ },
137
+ "json": {
138
+ "pretty_print": "Pretty Print",
139
+ "pretty": "Pretty",
140
+ "raw": "Raw",
141
+ "table": "Table",
142
+ "empty_object": "Empty Object"
143
+ }
144
+ }
@@ -0,0 +1,2 @@
1
+ declare const i18n: import("i18next").i18n;
2
+ export default i18n;
@@ -0,0 +1,22 @@
1
+ import i18next from 'i18next';
2
+ import { initReactI18next } from 'react-i18next';
3
+ import en from './locales/en.json';
4
+ // Dedicated instance so the inspector never collides with the host app's own
5
+ // i18next setup (or with i18next instances created by other libraries).
6
+ const i18n = i18next.createInstance();
7
+ i18n.use(initReactI18next).init({
8
+ lng: 'en',
9
+ fallbackLng: 'en',
10
+ resources: {
11
+ en: {
12
+ translation: en,
13
+ },
14
+ },
15
+ interpolation: {
16
+ escapeValue: false,
17
+ },
18
+ react: {
19
+ useSuspense: false,
20
+ },
21
+ });
22
+ export default i18n;