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.
Files changed (358) hide show
  1. package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +57 -0
  2. package/dist/commonjs/analytics.js +1 -24
  3. package/dist/commonjs/bundle.js +1 -16
  4. package/dist/commonjs/capture.d.ts +2 -0
  5. package/dist/commonjs/capture.js +1 -32
  6. package/dist/commonjs/components/AnalyticsDetail.js +92 -623
  7. package/dist/commonjs/components/AnalyticsEventCard.js +54 -350
  8. package/dist/commonjs/components/AnalyticsGraph.js +70 -370
  9. package/dist/commonjs/components/AnimatedEntrance.js +1 -11
  10. package/dist/commonjs/components/AppHeaderLogo.js +7 -134
  11. package/dist/commonjs/components/BrandCircleIcon.js +73 -118
  12. package/dist/commonjs/components/BrandSquareIcon.js +63 -108
  13. package/dist/commonjs/components/CodeSnippet.js +48 -623
  14. package/dist/commonjs/components/ConsoleLogCard.js +63 -537
  15. package/dist/commonjs/components/CopyButton.js +3 -89
  16. package/dist/commonjs/components/DiffViewer.js +19 -83
  17. package/dist/commonjs/components/DomainHeader.js +27 -127
  18. package/dist/commonjs/components/EmptyState.d.ts +1 -0
  19. package/dist/commonjs/components/EmptyState.js +10 -87
  20. package/dist/commonjs/components/EndOfListFooter.js +7 -81
  21. package/dist/commonjs/components/ErrorBoundary.js +72 -566
  22. package/dist/commonjs/components/HeadersSection.js +31 -110
  23. package/dist/commonjs/components/HighlightText.js +17 -58
  24. package/dist/commonjs/components/Inspector/AboutModal.d.ts +6 -0
  25. package/dist/commonjs/components/Inspector/AboutModal.js +351 -0
  26. package/dist/commonjs/components/Inspector/AnalyticsFilterModal.js +98 -797
  27. package/dist/commonjs/components/Inspector/AnalyticsTab.js +284 -930
  28. package/dist/commonjs/components/Inspector/BundleTab.js +551 -2918
  29. package/dist/commonjs/components/Inspector/ConsoleTab.js +79 -492
  30. package/dist/commonjs/components/Inspector/CrashDetail.js +123 -672
  31. package/dist/commonjs/components/Inspector/CrashFilterModal.js +66 -498
  32. package/dist/commonjs/components/Inspector/CrashTab.js +98 -670
  33. package/dist/commonjs/components/Inspector/DebuggingTab.js +64 -871
  34. package/dist/commonjs/components/Inspector/DeviceInfoTab.js +143 -907
  35. package/dist/commonjs/components/Inspector/FabLauncher.js +85 -54
  36. package/dist/commonjs/components/Inspector/FeatureUnderDevNotice.js +6 -99
  37. package/dist/commonjs/components/Inspector/FeedbackModal.d.ts +9 -0
  38. package/dist/commonjs/components/Inspector/FeedbackModal.js +167 -521
  39. package/dist/commonjs/components/Inspector/InspectorContext.js +1 -21
  40. package/dist/commonjs/components/Inspector/InspectorHeader.js +219 -1093
  41. package/dist/commonjs/components/Inspector/LogDetail.js +168 -994
  42. package/dist/commonjs/components/Inspector/MainScreen.js +60 -332
  43. package/dist/commonjs/components/Inspector/MediaGalleryTab.js +136 -278
  44. package/dist/commonjs/components/Inspector/MediaPreviewModal.js +134 -361
  45. package/dist/commonjs/components/Inspector/NavigationTracker.js +1 -12
  46. package/dist/commonjs/components/Inspector/NetworkDetail.js +96 -432
  47. package/dist/commonjs/components/Inspector/NetworkFilterModal.js +60 -576
  48. package/dist/commonjs/components/Inspector/NetworkTab.js +84 -514
  49. package/dist/commonjs/components/Inspector/NpmStarPrompt.js +17 -433
  50. package/dist/commonjs/components/Inspector/NpmUpdateToast.js +25 -298
  51. package/dist/commonjs/components/Inspector/PerformanceTab.js +182 -1397
  52. package/dist/commonjs/components/Inspector/ReduxDetail.js +188 -1089
  53. package/dist/commonjs/components/Inspector/ReduxTab.js +85 -701
  54. package/dist/commonjs/components/Inspector/SettingsPanel.js +431 -3431
  55. package/dist/commonjs/components/Inspector/SkeletonPlaceholder.js +11 -180
  56. package/dist/commonjs/components/Inspector/StorageTab.js +93 -826
  57. package/dist/commonjs/components/Inspector/TabBar.js +47 -183
  58. package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +34 -408
  59. package/dist/commonjs/components/JsonViewer.js +168 -380
  60. package/dist/commonjs/components/LogCard.js +57 -567
  61. package/dist/commonjs/components/LogSyntaxHighlighter.js +11 -130
  62. package/dist/commonjs/components/MetaAccordion.js +69 -238
  63. package/dist/commonjs/components/MiniBarChart.js +3 -56
  64. package/dist/commonjs/components/MiniLineChart.js +3 -58
  65. package/dist/commonjs/components/NetworkIcons.d.ts +7 -0
  66. package/dist/commonjs/components/NetworkIcons.js +479 -997
  67. package/dist/commonjs/components/QRCodeView.js +5 -79
  68. package/dist/commonjs/components/SectionHeader.js +15 -37
  69. package/dist/commonjs/components/SegmentedTabs.js +7 -61
  70. package/dist/commonjs/components/SkeletonPlaceholder.js +11 -180
  71. package/dist/commonjs/components/Slider.js +15 -243
  72. package/dist/commonjs/components/SourcePageCard.js +30 -89
  73. package/dist/commonjs/components/Toast.js +5 -147
  74. package/dist/commonjs/components/TouchableScale.js +3 -24
  75. package/dist/commonjs/components/TreeNode.js +55 -130
  76. package/dist/commonjs/console.js +1 -16
  77. package/dist/commonjs/constants/index.js +1 -32
  78. package/dist/commonjs/constants/telemetryConfig.js +1 -6
  79. package/dist/commonjs/constants/version.d.ts +1 -1
  80. package/dist/commonjs/constants/version.js +1 -4
  81. package/dist/commonjs/crash.js +1 -23
  82. package/dist/commonjs/customHooks/analyticsLogger.js +1 -250
  83. package/dist/commonjs/customHooks/bundleAnalyzer.js +1 -957
  84. package/dist/commonjs/customHooks/consoleLogger.js +6 -445
  85. package/dist/commonjs/customHooks/crashHandler.js +7 -656
  86. package/dist/commonjs/customHooks/logFilters.js +1 -23
  87. package/dist/commonjs/customHooks/networkLogger.js +2 -536
  88. package/dist/commonjs/customHooks/performanceTracker.js +63 -750
  89. package/dist/commonjs/customHooks/reduxLogger.js +2 -313
  90. package/dist/commonjs/customHooks/storageInspector.js +1 -435
  91. package/dist/commonjs/customHooks/useAccordion.js +1 -18
  92. package/dist/commonjs/decorators/index.js +1 -100
  93. package/dist/commonjs/helpers/gaAnalyticsRegistry.js +1 -148
  94. package/dist/commonjs/helpers/index.js +8 -921
  95. package/dist/commonjs/helpers/memoryManager.js +1 -99
  96. package/dist/commonjs/helpers/qrGenerator.js +1 -367
  97. package/dist/commonjs/helpers/remoteConfig.js +1 -165
  98. package/dist/commonjs/helpers/searchQueryParser.js +1 -62
  99. package/dist/commonjs/helpers/settingsStore.js +1 -144
  100. package/dist/commonjs/helpers/telemetry.js +1 -501
  101. package/dist/commonjs/helpers/toast.js +1 -20
  102. package/dist/commonjs/i18n/index.js +1 -90
  103. package/dist/commonjs/i18n/locales/en.json +1 -1122
  104. package/dist/commonjs/index.js +5 -2153
  105. package/dist/commonjs/metro.js +6 -468
  106. package/dist/commonjs/native/NativeInspector.d.ts +3 -0
  107. package/dist/commonjs/native/NativeInspector.js +1 -402
  108. package/dist/commonjs/native/NativeNetworkInspector.d.ts +1 -0
  109. package/dist/commonjs/native/NativeNetworkInspector.js +1 -4
  110. package/dist/commonjs/network.js +1 -13
  111. package/dist/commonjs/performance.js +1 -29
  112. package/dist/commonjs/redux.js +1 -20
  113. package/dist/commonjs/storage.js +1 -14
  114. package/dist/commonjs/styles/AppColors.js +1 -423
  115. package/dist/commonjs/styles/AppFonts.js +1 -17
  116. package/dist/commonjs/styles/common.js +1 -190
  117. package/dist/commonjs/styles/index.d.ts +6 -0
  118. package/dist/commonjs/styles/index.js +1 -1589
  119. package/dist/commonjs/types/enums.d.ts +2 -1
  120. package/dist/commonjs/types/enums.js +1 -150
  121. package/dist/commonjs/types/index.js +1 -18
  122. package/dist/commonjs/types/interfaces.d.ts +7 -0
  123. package/dist/commonjs/types/interfaces.js +1 -2
  124. package/dist/esm/analytics.js +1 -2
  125. package/dist/esm/bundle.js +1 -2
  126. package/dist/esm/capture.d.ts +2 -0
  127. package/dist/esm/capture.js +1 -29
  128. package/dist/esm/components/AnalyticsDetail.js +171 -664
  129. package/dist/esm/components/AnalyticsEventCard.js +77 -335
  130. package/dist/esm/components/AnalyticsGraph.js +95 -357
  131. package/dist/esm/components/AnimatedEntrance.js +1 -6
  132. package/dist/esm/components/AppHeaderLogo.js +7 -94
  133. package/dist/esm/components/BrandCircleIcon.js +114 -119
  134. package/dist/esm/components/BrandSquareIcon.js +73 -78
  135. package/dist/esm/components/CodeSnippet.js +58 -595
  136. package/dist/esm/components/ConsoleLogCard.js +91 -526
  137. package/dist/esm/components/CopyButton.js +3 -51
  138. package/dist/esm/components/DiffViewer.js +22 -48
  139. package/dist/esm/components/DomainHeader.js +43 -138
  140. package/dist/esm/components/EmptyState.d.ts +1 -0
  141. package/dist/esm/components/EmptyState.js +17 -56
  142. package/dist/esm/components/EndOfListFooter.js +15 -83
  143. package/dist/esm/components/ErrorBoundary.js +125 -582
  144. package/dist/esm/components/HeadersSection.js +52 -93
  145. package/dist/esm/components/HighlightText.js +17 -53
  146. package/dist/esm/components/Inspector/AboutModal.d.ts +6 -0
  147. package/dist/esm/components/Inspector/AboutModal.js +351 -0
  148. package/dist/esm/components/Inspector/AnalyticsFilterModal.js +225 -886
  149. package/dist/esm/components/Inspector/AnalyticsTab.js +296 -904
  150. package/dist/esm/components/Inspector/BundleTab.js +1175 -3502
  151. package/dist/esm/components/Inspector/ConsoleTab.js +113 -488
  152. package/dist/esm/components/Inspector/CrashDetail.js +236 -747
  153. package/dist/esm/components/Inspector/CrashFilterModal.js +149 -541
  154. package/dist/esm/components/Inspector/CrashTab.js +177 -711
  155. package/dist/esm/components/Inspector/DebuggingTab.js +156 -923
  156. package/dist/esm/components/Inspector/DeviceInfoTab.js +199 -924
  157. package/dist/esm/components/Inspector/FabLauncher.js +85 -49
  158. package/dist/esm/components/Inspector/FeatureUnderDevNotice.js +14 -70
  159. package/dist/esm/components/Inspector/FeedbackModal.d.ts +9 -0
  160. package/dist/esm/components/Inspector/FeedbackModal.js +182 -499
  161. package/dist/esm/components/Inspector/InspectorContext.js +1 -12
  162. package/dist/esm/components/Inspector/InspectorHeader.js +309 -1145
  163. package/dist/esm/components/Inspector/LogDetail.js +235 -1023
  164. package/dist/esm/components/Inspector/MainScreen.js +86 -320
  165. package/dist/esm/components/Inspector/MediaGalleryTab.js +157 -259
  166. package/dist/esm/components/Inspector/MediaPreviewModal.js +153 -340
  167. package/dist/esm/components/Inspector/NavigationTracker.js +1 -10
  168. package/dist/esm/components/Inspector/NetworkDetail.js +141 -472
  169. package/dist/esm/components/Inspector/NetworkFilterModal.js +122 -597
  170. package/dist/esm/components/Inspector/NetworkTab.js +125 -517
  171. package/dist/esm/components/Inspector/NpmStarPrompt.js +58 -434
  172. package/dist/esm/components/Inspector/NpmUpdateToast.js +45 -281
  173. package/dist/esm/components/Inspector/PerformanceTab.js +393 -1570
  174. package/dist/esm/components/Inspector/ReduxDetail.js +307 -1170
  175. package/dist/esm/components/Inspector/ReduxTab.js +144 -722
  176. package/dist/esm/components/Inspector/SettingsPanel.js +647 -3609
  177. package/dist/esm/components/Inspector/SkeletonPlaceholder.js +30 -163
  178. package/dist/esm/components/Inspector/StorageTab.js +172 -866
  179. package/dist/esm/components/Inspector/TabBar.js +52 -183
  180. package/dist/esm/components/Inspector/UpdateAvailableModal.js +79 -416
  181. package/dist/esm/components/JsonViewer.js +179 -353
  182. package/dist/esm/components/LogCard.js +93 -565
  183. package/dist/esm/components/LogSyntaxHighlighter.js +11 -123
  184. package/dist/esm/components/MetaAccordion.js +136 -267
  185. package/dist/esm/components/MiniBarChart.js +3 -18
  186. package/dist/esm/components/MiniLineChart.js +3 -20
  187. package/dist/esm/components/NetworkIcons.d.ts +7 -0
  188. package/dist/esm/components/NetworkIcons.js +481 -817
  189. package/dist/esm/components/QRCodeView.js +8 -45
  190. package/dist/esm/components/SectionHeader.js +22 -39
  191. package/dist/esm/components/SegmentedTabs.js +8 -57
  192. package/dist/esm/components/SkeletonPlaceholder.js +30 -163
  193. package/dist/esm/components/Slider.js +24 -213
  194. package/dist/esm/components/SourcePageCard.js +65 -86
  195. package/dist/esm/components/Toast.js +10 -117
  196. package/dist/esm/components/TouchableScale.js +3 -19
  197. package/dist/esm/components/TreeNode.js +58 -95
  198. package/dist/esm/console.js +1 -2
  199. package/dist/esm/constants/index.js +1 -28
  200. package/dist/esm/constants/telemetryConfig.js +1 -3
  201. package/dist/esm/constants/version.d.ts +1 -1
  202. package/dist/esm/constants/version.js +1 -1
  203. package/dist/esm/crash.js +1 -2
  204. package/dist/esm/customHooks/analyticsLogger.js +1 -230
  205. package/dist/esm/customHooks/bundleAnalyzer.js +1 -944
  206. package/dist/esm/customHooks/consoleLogger.js +6 -432
  207. package/dist/esm/customHooks/crashHandler.js +7 -630
  208. package/dist/esm/customHooks/logFilters.js +1 -20
  209. package/dist/esm/customHooks/networkLogger.js +2 -519
  210. package/dist/esm/customHooks/performanceTracker.js +63 -723
  211. package/dist/esm/customHooks/reduxLogger.js +2 -293
  212. package/dist/esm/customHooks/storageInspector.js +1 -418
  213. package/dist/esm/customHooks/useAccordion.js +1 -16
  214. package/dist/esm/decorators/index.js +1 -95
  215. package/dist/esm/helpers/gaAnalyticsRegistry.js +1 -143
  216. package/dist/esm/helpers/index.js +8 -861
  217. package/dist/esm/helpers/memoryManager.js +1 -91
  218. package/dist/esm/helpers/qrGenerator.js +1 -364
  219. package/dist/esm/helpers/remoteConfig.js +1 -160
  220. package/dist/esm/helpers/searchQueryParser.js +1 -59
  221. package/dist/esm/helpers/settingsStore.js +1 -134
  222. package/dist/esm/helpers/telemetry.js +1 -489
  223. package/dist/esm/helpers/toast.js +1 -15
  224. package/dist/esm/i18n/index.js +1 -78
  225. package/dist/esm/i18n/locales/en.json +1 -1122
  226. package/dist/esm/index.js +7 -1967
  227. package/dist/esm/metro.js +6 -459
  228. package/dist/esm/native/NativeInspector.d.ts +3 -0
  229. package/dist/esm/native/NativeInspector.js +1 -370
  230. package/dist/esm/native/NativeNetworkInspector.d.ts +1 -0
  231. package/dist/esm/native/NativeNetworkInspector.js +1 -2
  232. package/dist/esm/network.js +1 -1
  233. package/dist/esm/performance.js +1 -2
  234. package/dist/esm/redux.js +1 -1
  235. package/dist/esm/storage.js +1 -1
  236. package/dist/esm/styles/AppColors.js +1 -417
  237. package/dist/esm/styles/AppFonts.js +1 -13
  238. package/dist/esm/styles/common.js +1 -186
  239. package/dist/esm/styles/index.d.ts +6 -0
  240. package/dist/esm/styles/index.js +1 -1551
  241. package/dist/esm/types/enums.d.ts +2 -1
  242. package/dist/esm/types/enums.js +1 -147
  243. package/dist/esm/types/index.js +1 -2
  244. package/dist/esm/types/interfaces.d.ts +7 -0
  245. package/dist/esm/types/interfaces.js +1 -1
  246. package/ios/NetworkInspectorModule.mm +253 -136
  247. package/package.json +5 -3
  248. package/react-native-inapp-inspector.podspec +1 -1
  249. package/src/native/NativeInspector.ts +17 -0
  250. package/src/native/NativeNetworkInspector.ts +1 -0
  251. package/src/analytics.ts +0 -35
  252. package/src/bundle.ts +0 -25
  253. package/src/capture.ts +0 -101
  254. package/src/components/AnalyticsDetail.tsx +0 -870
  255. package/src/components/AnalyticsEventCard.tsx +0 -444
  256. package/src/components/AnalyticsGraph.tsx +0 -583
  257. package/src/components/AnimatedEntrance.tsx +0 -20
  258. package/src/components/AppHeaderLogo.tsx +0 -143
  259. package/src/components/BrandCircleIcon.tsx +0 -144
  260. package/src/components/BrandSquareIcon.tsx +0 -184
  261. package/src/components/CodeSnippet.tsx +0 -725
  262. package/src/components/ConsoleLogCard.tsx +0 -679
  263. package/src/components/CopyButton.tsx +0 -87
  264. package/src/components/DiffViewer.tsx +0 -82
  265. package/src/components/DomainHeader.tsx +0 -224
  266. package/src/components/EmptyState.tsx +0 -95
  267. package/src/components/EndOfListFooter.tsx +0 -100
  268. package/src/components/ErrorBoundary.tsx +0 -688
  269. package/src/components/HeadersSection.tsx +0 -172
  270. package/src/components/HighlightText.tsx +0 -100
  271. package/src/components/Inspector/AnalyticsFilterModal.tsx +0 -1250
  272. package/src/components/Inspector/AnalyticsTab.tsx +0 -1362
  273. package/src/components/Inspector/BundleTab.tsx +0 -4768
  274. package/src/components/Inspector/ConsoleTab.tsx +0 -726
  275. package/src/components/Inspector/CrashDetail.tsx +0 -997
  276. package/src/components/Inspector/CrashFilterModal.tsx +0 -721
  277. package/src/components/Inspector/CrashTab.tsx +0 -933
  278. package/src/components/Inspector/DebuggingTab.tsx +0 -1103
  279. package/src/components/Inspector/DeviceInfoTab.tsx +0 -1397
  280. package/src/components/Inspector/FabLauncher.tsx +0 -80
  281. package/src/components/Inspector/FeatureUnderDevNotice.tsx +0 -94
  282. package/src/components/Inspector/FeedbackModal.tsx +0 -626
  283. package/src/components/Inspector/InspectorContext.tsx +0 -28
  284. package/src/components/Inspector/InspectorHeader.tsx +0 -1545
  285. package/src/components/Inspector/LogDetail.tsx +0 -1431
  286. package/src/components/Inspector/MainScreen.tsx +0 -459
  287. package/src/components/Inspector/MediaGalleryTab.tsx +0 -355
  288. package/src/components/Inspector/MediaPreviewModal.tsx +0 -435
  289. package/src/components/Inspector/NavigationTracker.tsx +0 -13
  290. package/src/components/Inspector/NetworkDetail.tsx +0 -795
  291. package/src/components/Inspector/NetworkFilterModal.tsx +0 -730
  292. package/src/components/Inspector/NetworkTab.tsx +0 -820
  293. package/src/components/Inspector/NpmStarPrompt.tsx +0 -532
  294. package/src/components/Inspector/NpmUpdateToast.tsx +0 -387
  295. package/src/components/Inspector/PerformanceTab.tsx +0 -1967
  296. package/src/components/Inspector/ReduxDetail.tsx +0 -1651
  297. package/src/components/Inspector/ReduxTab.tsx +0 -987
  298. package/src/components/Inspector/SettingsPanel.tsx +0 -4580
  299. package/src/components/Inspector/SkeletonPlaceholder.tsx +0 -206
  300. package/src/components/Inspector/StorageTab.tsx +0 -1159
  301. package/src/components/Inspector/TabBar.tsx +0 -263
  302. package/src/components/Inspector/UpdateAvailableModal.tsx +0 -555
  303. package/src/components/JsonViewer.tsx +0 -547
  304. package/src/components/LogCard.tsx +0 -694
  305. package/src/components/LogSyntaxHighlighter.tsx +0 -178
  306. package/src/components/MetaAccordion.tsx +0 -355
  307. package/src/components/MiniBarChart.tsx +0 -42
  308. package/src/components/MiniLineChart.tsx +0 -33
  309. package/src/components/NetworkIcons.tsx +0 -2599
  310. package/src/components/QRCodeView.tsx +0 -75
  311. package/src/components/SectionHeader.tsx +0 -101
  312. package/src/components/SegmentedTabs.tsx +0 -83
  313. package/src/components/SkeletonPlaceholder.tsx +0 -206
  314. package/src/components/Slider.tsx +0 -300
  315. package/src/components/SourcePageCard.tsx +0 -150
  316. package/src/components/Toast.tsx +0 -131
  317. package/src/components/TouchableScale.tsx +0 -61
  318. package/src/components/TreeNode.tsx +0 -171
  319. package/src/console.ts +0 -24
  320. package/src/constants/index.ts +0 -41
  321. package/src/constants/telemetryConfig.ts +0 -4
  322. package/src/constants/version.ts +0 -3
  323. package/src/crash.ts +0 -32
  324. package/src/customHooks/analyticsLogger.ts +0 -336
  325. package/src/customHooks/bundleAnalyzer.ts +0 -1256
  326. package/src/customHooks/consoleLogger.ts +0 -530
  327. package/src/customHooks/crashHandler.ts +0 -944
  328. package/src/customHooks/logFilters.ts +0 -32
  329. package/src/customHooks/networkLogger.ts +0 -624
  330. package/src/customHooks/performanceTracker.ts +0 -1014
  331. package/src/customHooks/reduxLogger.ts +0 -406
  332. package/src/customHooks/storageInspector.ts +0 -513
  333. package/src/customHooks/useAccordion.tsx +0 -27
  334. package/src/decorators/index.ts +0 -184
  335. package/src/helpers/gaAnalyticsRegistry.ts +0 -204
  336. package/src/helpers/index.ts +0 -1092
  337. package/src/helpers/memoryManager.ts +0 -138
  338. package/src/helpers/qrGenerator.ts +0 -430
  339. package/src/helpers/remoteConfig.ts +0 -212
  340. package/src/helpers/searchQueryParser.ts +0 -84
  341. package/src/helpers/settingsStore.ts +0 -171
  342. package/src/helpers/telemetry.ts +0 -568
  343. package/src/helpers/toast.ts +0 -17
  344. package/src/i18n/index.ts +0 -104
  345. package/src/i18n/locales/en.json +0 -1125
  346. package/src/index.tsx +0 -2635
  347. package/src/metro.ts +0 -598
  348. package/src/network.ts +0 -22
  349. package/src/performance.ts +0 -38
  350. package/src/redux.ts +0 -23
  351. package/src/storage.ts +0 -18
  352. package/src/styles/AppColors.ts +0 -455
  353. package/src/styles/AppFonts.ts +0 -26
  354. package/src/styles/common.ts +0 -209
  355. package/src/styles/index.ts +0 -1606
  356. package/src/types/enums.ts +0 -208
  357. package/src/types/index.ts +0 -34
  358. package/src/types/interfaces.ts +0 -530
@@ -1,1159 +0,0 @@
1
- import React, {useState, useEffect, useMemo, useCallback, useRef} from 'react';
2
- import {
3
- View,
4
- Text,
5
- ScrollView,
6
- FlatList,
7
- TextInput,
8
- Modal,
9
- Alert,
10
- StyleSheet,
11
- ActivityIndicator,
12
- Platform,
13
- } from 'react-native';
14
- import TouchableScale from '../TouchableScale';
15
- import CopyButton from '../CopyButton';
16
- import globalStyles from '../../styles';
17
- import {AppColors} from '../../styles/AppColors';
18
- import {AppFonts} from '../../styles/AppFonts';
19
- import {useTranslation} from '../../i18n';
20
- import {
21
- DatabaseIcon,
22
- SearchIcon,
23
- ClearIcon,
24
- PlusIcon,
25
- PencilIcon,
26
- TrashIcon,
27
- CopyIcon,
28
- CheckIcon,
29
- CircleAlertIcon,
30
- LayersIcon,
31
- ResetIcon,
32
- ChevronIcon,
33
- WarningTriangleIcon,
34
- } from '../NetworkIcons';
35
- import {
36
- fetchStorageEntries,
37
- setStorageEntry,
38
- removeStorageEntry,
39
- clearStorageDriver,
40
- isAsyncStorageConnected,
41
- isMMKVConnected,
42
- getRegisteredMMKVInstanceIds,
43
- subscribeToStorageChanges,
44
- StorageDriver,
45
- StorageEntry,
46
- } from '../../customHooks/storageInspector';
47
- import {copyToClipboard} from '../../helpers';
48
- import {showToast} from '../../helpers/toast';
49
-
50
- const getTypeBadge = (type: StorageEntry['type']) => {
51
- switch (type) {
52
- case 'json':
53
- return {label: 'JSON', color: AppColors.purple, bg: `${AppColors.purple}16`};
54
- case 'number':
55
- return {label: 'NUM', color: AppColors.warningIconGold, bg: `${AppColors.warningIconGold}16`};
56
- case 'boolean':
57
- return {label: 'BOOL', color: AppColors.emerald500, bg: `${AppColors.emerald500}16`};
58
- case 'null':
59
- return {label: 'NULL', color: AppColors.grayTextWeak, bg: `${AppColors.grayTextWeak}16`};
60
- default:
61
- return {label: 'STR', color: AppColors.blue500, bg: `${AppColors.blue500}16`};
62
- }
63
- };
64
-
65
- const StorageEntryCard = React.memo(function StorageEntryCard({
66
- entry,
67
- isExpanded,
68
- onToggleExpand,
69
- onCopy,
70
- onEdit,
71
- onDelete,
72
- badge,
73
- }: {
74
- entry: StorageEntry;
75
- isExpanded: boolean;
76
- onToggleExpand: (key: string) => void;
77
- onCopy: (entry: StorageEntry) => void;
78
- onEdit: (entry: StorageEntry) => void;
79
- onDelete: (key: string) => void;
80
- badge: {label: string; color: string; bg: string};
81
- }) {
82
- const formattedBytes = useMemo(() => {
83
- return entry.byteSize < 1024
84
- ? `${entry.byteSize} B`
85
- : `${(entry.byteSize / 1024).toFixed(1)} KB`;
86
- }, [entry.byteSize]);
87
-
88
- // Lazy compute displayed value to avoid layout thrashing on large JSON strings
89
- const displayValue = useMemo(() => {
90
- if (!isExpanded) {
91
- if (entry.value.length > 250) {
92
- return entry.value.slice(0, 250) + '...';
93
- }
94
- return entry.value;
95
- }
96
-
97
- if (entry.type === 'json') {
98
- try {
99
- const parsed = entry.parsedValue ?? JSON.parse(entry.value);
100
- return JSON.stringify(parsed, null, 2);
101
- } catch {
102
- return entry.value;
103
- }
104
- }
105
- return entry.value;
106
- }, [isExpanded, entry.value, entry.type, entry.parsedValue]);
107
-
108
- return (
109
- <View style={styles.entryCard}>
110
- {/* Entry Header: Key name, Type Badge, Size, Actions */}
111
- <View style={styles.entryHeader}>
112
- <View style={{flex: 1, marginRight: 8}}>
113
- <View style={{flexDirection: 'row', alignItems: 'center', gap: 6, flexWrap: 'wrap'}}>
114
- <Text style={styles.entryKey} numberOfLines={1} selectable>
115
- {entry.key}
116
- </Text>
117
- <View
118
- style={[
119
- styles.typeBadge,
120
- {backgroundColor: badge.bg, borderColor: `${badge.color}33`},
121
- ]}>
122
- <Text style={[styles.typeBadgeText, {color: badge.color}]}>
123
- {badge.label}
124
- </Text>
125
- </View>
126
- <Text style={styles.sizeText}>{formattedBytes}</Text>
127
- </View>
128
- </View>
129
-
130
- {/* Actions: Copy, Edit, Delete */}
131
- <View style={styles.entryActions}>
132
- <TouchableScale
133
- hitSlop={6}
134
- onPress={() => onCopy(entry)}
135
- style={styles.entryActionBtn}>
136
- <CopyIcon size={12} color={AppColors.grayText} />
137
- </TouchableScale>
138
-
139
- <TouchableScale
140
- hitSlop={6}
141
- onPress={() => onEdit(entry)}
142
- style={styles.entryActionBtn}>
143
- <PencilIcon size={12} color={AppColors.purple} />
144
- </TouchableScale>
145
-
146
- <TouchableScale
147
- hitSlop={6}
148
- onPress={() => onDelete(entry.key)}
149
- style={[styles.entryActionBtn, {backgroundColor: `${AppColors.errorColor}12`}]}>
150
- <TrashIcon size={12} color={AppColors.errorColor} />
151
- </TouchableScale>
152
- </View>
153
- </View>
154
-
155
- {/* Entry Value Preview / Viewer */}
156
- <TouchableScale
157
- onPress={() => onToggleExpand(entry.key)}
158
- style={styles.valuePreviewBox}>
159
- <Text
160
- style={styles.valuePreviewText}
161
- numberOfLines={isExpanded ? undefined : 3}
162
- selectable={isExpanded}>
163
- {displayValue}
164
- </Text>
165
- {entry.value.length > 80 && (
166
- <View style={{flexDirection: 'row', alignItems: 'center', gap: 4, marginTop: 4}}>
167
- <Text style={styles.expandHint}>
168
- {isExpanded ? 'Collapse' : 'Expand'}
169
- </Text>
170
- <ChevronIcon
171
- direction={isExpanded ? 'up' : 'down'}
172
- size={10}
173
- color={AppColors.purple}
174
- />
175
- </View>
176
- )}
177
- </TouchableScale>
178
- </View>
179
- );
180
- });
181
-
182
- export const StorageTab = React.memo(() => {
183
- const {t} = useTranslation();
184
- const listRef = useRef<FlatList>(null);
185
- const [activeDriver, setActiveDriver] = useState<StorageDriver>('asyncStorage');
186
- const [activeMMKVId, setActiveMMKVId] = useState<string>('default');
187
- const [entries, setEntries] = useState<StorageEntry[]>([]);
188
- const [isLoading, setIsLoading] = useState<boolean>(true);
189
- const [search, setSearch] = useState<string>('');
190
- const [expandedKeys, setExpandedKeys] = useState<Record<string, boolean>>({});
191
-
192
- // Modal State for Create / Edit
193
- const [modalVisible, setModalVisible] = useState<boolean>(false);
194
- const [modalMode, setModalMode] = useState<'create' | 'edit'>('create');
195
- const [editKeyName, setEditKeyName] = useState<string>('');
196
- const [editValue, setEditValue] = useState<string>('');
197
- const [editType, setEditType] = useState<'string' | 'json' | 'number' | 'boolean'>('string');
198
- const [jsonError, setJsonError] = useState<string | null>(null);
199
-
200
- const mmkvInstanceIds = useMemo(() => getRegisteredMMKVInstanceIds(), []);
201
-
202
- // Fetch entries
203
- const loadEntries = useCallback(async () => {
204
- setIsLoading(true);
205
- try {
206
- const data = await fetchStorageEntries(
207
- activeDriver,
208
- activeDriver === 'mmkv' ? activeMMKVId : undefined,
209
- );
210
- setEntries(data);
211
- } catch {
212
- setEntries([]);
213
- } finally {
214
- setIsLoading(false);
215
- }
216
- }, [activeDriver, activeMMKVId]);
217
-
218
- useEffect(() => {
219
- loadEntries();
220
- const unsubscribe = subscribeToStorageChanges(loadEntries);
221
- return unsubscribe;
222
- }, [loadEntries]);
223
-
224
- // Toggle JSON accordion
225
- const toggleExpand = (key: string) => {
226
- setExpandedKeys(prev => ({...prev, [key]: !prev[key]}));
227
- };
228
-
229
- // Open Create Modal
230
- const handleOpenCreate = () => {
231
- setModalMode('create');
232
- setEditKeyName('');
233
- setEditValue('');
234
- setEditType('string');
235
- setJsonError(null);
236
- setModalVisible(true);
237
- };
238
-
239
- // Open Edit Modal
240
- const handleOpenEdit = (entry: StorageEntry) => {
241
- setModalMode('edit');
242
- setEditKeyName(entry.key);
243
- setEditValue(entry.value);
244
- setEditType(entry.type === 'json' ? 'json' : entry.type === 'number' ? 'number' : entry.type === 'boolean' ? 'boolean' : 'string');
245
- setJsonError(null);
246
- setModalVisible(true);
247
- };
248
-
249
- // Delete single key
250
- const handleDeleteKey = (key: string) => {
251
- Alert.alert(
252
- 'Delete Storage Key',
253
- `Are you sure you want to permanently delete "${key}" from ${activeDriver === 'asyncStorage' ? 'AsyncStorage' : 'MMKV'}?`,
254
- [
255
- {text: 'Cancel', style: 'cancel'},
256
- {
257
- text: 'Delete',
258
- style: 'destructive',
259
- onPress: async () => {
260
- const ok = await removeStorageEntry(
261
- activeDriver,
262
- key,
263
- activeDriver === 'mmkv' ? activeMMKVId : undefined,
264
- );
265
- if (ok) {
266
- showToast(`Deleted "${key}"`);
267
- loadEntries();
268
- } else {
269
- showToast(`Failed to delete "${key}"`);
270
- }
271
- },
272
- },
273
- ],
274
- );
275
- };
276
-
277
- // Clear all keys
278
- const handleClearAll = () => {
279
- Alert.alert(
280
- 'Wipe All Storage Keys',
281
- `Are you sure you want to clear all ${entries.length} keys in ${activeDriver === 'asyncStorage' ? 'AsyncStorage' : 'MMKV'}? This cannot be undone.`,
282
- [
283
- {text: 'Cancel', style: 'cancel'},
284
- {
285
- text: 'Wipe All',
286
- style: 'destructive',
287
- onPress: async () => {
288
- const ok = await clearStorageDriver(
289
- activeDriver,
290
- activeDriver === 'mmkv' ? activeMMKVId : undefined,
291
- );
292
- if (ok) {
293
- showToast('All storage keys wiped');
294
- loadEntries();
295
- }
296
- },
297
- },
298
- ],
299
- );
300
- };
301
-
302
- // Save Modal (Create / Update)
303
- const handleSaveModal = async () => {
304
- if (!editKeyName.trim()) {
305
- showToast('Key name cannot be empty');
306
- return;
307
- }
308
-
309
- let finalVal = editValue;
310
-
311
- if (editType === 'json') {
312
- try {
313
- // Validate JSON
314
- const parsed = JSON.parse(editValue);
315
- finalVal = JSON.stringify(parsed);
316
- } catch (err: any) {
317
- setJsonError('Invalid JSON: ' + err.message);
318
- return;
319
- }
320
- } else if (editType === 'number') {
321
- if (isNaN(Number(editValue))) {
322
- setJsonError('Value must be a valid number');
323
- return;
324
- }
325
- }
326
-
327
- const success = await setStorageEntry(
328
- activeDriver,
329
- editKeyName.trim(),
330
- finalVal,
331
- activeDriver === 'mmkv' ? activeMMKVId : undefined,
332
- );
333
-
334
- if (success) {
335
- showToast(modalMode === 'create' ? `Added "${editKeyName.trim()}"` : `Updated "${editKeyName.trim()}"`);
336
- setModalVisible(false);
337
- loadEntries();
338
- } else {
339
- showToast('Error saving storage key');
340
- }
341
- };
342
-
343
- // Format / Beautify JSON in modal
344
- const handleBeautifyJson = () => {
345
- try {
346
- const parsed = JSON.parse(editValue);
347
- setEditValue(JSON.stringify(parsed, null, 2));
348
- setJsonError(null);
349
- setEditType('json');
350
- showToast('Formatted JSON');
351
- } catch {
352
- setJsonError('Cannot format: invalid JSON syntax');
353
- }
354
- };
355
-
356
- // Filter entries
357
- const filteredEntries = useMemo(() => {
358
- if (!search.trim()) return entries;
359
- const tokens = search.toLowerCase().trim().split(/\s+/).filter(Boolean);
360
- return entries.filter(e => {
361
- const corpus = `${e.key} ${e.value}`.toLowerCase();
362
- return tokens.every(tok => corpus.includes(tok));
363
- });
364
- }, [entries, search]);
365
-
366
- const totalBytes = useMemo(() => {
367
- return entries.reduce((sum, e) => sum + e.byteSize, 0);
368
- }, [entries]);
369
-
370
- const formattedTotalSize = useMemo(() => {
371
- if (totalBytes < 1024) return `${totalBytes} B`;
372
- if (totalBytes < 1024 * 1024) return `${(totalBytes / 1024).toFixed(1)} KB`;
373
- return `${(totalBytes / (1024 * 1024)).toFixed(2)} MB`;
374
- }, [totalBytes]);
375
-
376
- const handleCopyEntry = useCallback((entry: StorageEntry) => {
377
- copyToClipboard(entry.value, entry.key);
378
- showToast(`Copied value of "${entry.key}"`);
379
- }, []);
380
-
381
- const renderItem = useCallback(
382
- ({item}: {item: StorageEntry}) => (
383
- <StorageEntryCard
384
- entry={item}
385
- isExpanded={Boolean(expandedKeys[item.key])}
386
- onToggleExpand={toggleExpand}
387
- onCopy={handleCopyEntry}
388
- onEdit={handleOpenEdit}
389
- onDelete={handleDeleteKey}
390
- badge={getTypeBadge(item.type)}
391
- />
392
- ),
393
- [expandedKeys, handleCopyEntry],
394
- );
395
-
396
- const isConnected =
397
- activeDriver === 'asyncStorage'
398
- ? isAsyncStorageConnected()
399
- : isMMKVConnected();
400
-
401
- return (
402
- <View style={styles.container}>
403
- {/* ── Driver Sub-Tabs ── */}
404
- <View style={styles.driverTabsWrapper}>
405
- <ScrollView
406
- horizontal
407
- showsHorizontalScrollIndicator={false}
408
- contentContainerStyle={styles.driverTabsContainer}>
409
- <TouchableScale
410
- onPress={() => setActiveDriver('asyncStorage')}
411
- style={[
412
- styles.driverTabPill,
413
- activeDriver === 'asyncStorage' && styles.driverTabPillActive,
414
- ]}>
415
- <DatabaseIcon
416
- size={13}
417
- color={
418
- activeDriver === 'asyncStorage'
419
- ? AppColors.white
420
- : AppColors.grayText
421
- }
422
- />
423
- <Text
424
- style={[
425
- styles.driverTabText,
426
- activeDriver === 'asyncStorage' && styles.driverTabTextActive,
427
- ]}>
428
- AsyncStorage
429
- </Text>
430
- {activeDriver === 'asyncStorage' && entries.length > 0 && (
431
- <View style={styles.driverCountBadge}>
432
- <Text style={styles.driverCountText}>{entries.length}</Text>
433
- </View>
434
- )}
435
- </TouchableScale>
436
-
437
- <TouchableScale
438
- onPress={() => setActiveDriver('mmkv')}
439
- style={[
440
- styles.driverTabPill,
441
- activeDriver === 'mmkv' && styles.driverTabPillActive,
442
- ]}>
443
- <LayersIcon
444
- size={13}
445
- color={
446
- activeDriver === 'mmkv'
447
- ? AppColors.white
448
- : AppColors.grayText
449
- }
450
- />
451
- <Text
452
- style={[
453
- styles.driverTabText,
454
- activeDriver === 'mmkv' && styles.driverTabTextActive,
455
- ]}>
456
- MMKV
457
- </Text>
458
- {activeDriver === 'mmkv' && entries.length > 0 && (
459
- <View style={styles.driverCountBadge}>
460
- <Text style={styles.driverCountText}>{entries.length}</Text>
461
- </View>
462
- )}
463
- </TouchableScale>
464
-
465
- {/* MMKV Named Instance Dropdown/Pills */}
466
- {activeDriver === 'mmkv' && mmkvInstanceIds.length > 1 && (
467
- <View style={{flexDirection: 'row', alignItems: 'center', gap: 4, marginLeft: 6}}>
468
- {mmkvInstanceIds.map(id => (
469
- <TouchableScale
470
- key={id}
471
- onPress={() => setActiveMMKVId(id)}
472
- style={[
473
- styles.instancePill,
474
- activeMMKVId === id && styles.instancePillActive,
475
- ]}>
476
- <Text
477
- style={[
478
- styles.instancePillText,
479
- activeMMKVId === id && styles.instancePillTextActive,
480
- ]}>
481
- {id}
482
- </Text>
483
- </TouchableScale>
484
- ))}
485
- </View>
486
- )}
487
- </ScrollView>
488
- </View>
489
-
490
- {/* ── Search & Actions Bar ── */}
491
- <View style={styles.actionBar}>
492
- <View style={styles.searchBar}>
493
- <SearchIcon size={14} color={AppColors.grayTextWeak} />
494
- <TextInput
495
- value={search}
496
- onChangeText={setSearch}
497
- placeholder={`Search ${entries.length} keys & values...`}
498
- placeholderTextColor={AppColors.grayTextWeak}
499
- style={styles.searchInput}
500
- clearButtonMode="while-editing"
501
- />
502
- {search.length > 0 && (
503
- <View style={{flexDirection: 'row', alignItems: 'center', gap: 4}}>
504
- <View
505
- style={{
506
- backgroundColor: `${AppColors.purple}20`,
507
- borderRadius: 10,
508
- paddingHorizontal: 6,
509
- paddingVertical: 1.5,
510
- }}>
511
- <Text
512
- style={{
513
- color: AppColors.purple,
514
- fontSize: 9.5,
515
- fontFamily: AppFonts.interBold,
516
- }}>
517
- {filteredEntries.length}
518
- </Text>
519
- </View>
520
- <TouchableScale onPress={() => setSearch('')} hitSlop={8}>
521
- <ClearIcon size={13} color={AppColors.grayTextWeak} />
522
- </TouchableScale>
523
- </View>
524
- )}
525
- </View>
526
-
527
- {/* Action Buttons: Add Key & Refresh */}
528
- <TouchableScale
529
- onPress={handleOpenCreate}
530
- style={styles.addKeyBtn}
531
- hitSlop={6}>
532
- <PlusIcon size={13} color={AppColors.white} />
533
- <Text style={styles.addKeyBtnText}>Add</Text>
534
- </TouchableScale>
535
-
536
- <TouchableScale
537
- onPress={loadEntries}
538
- style={styles.actionIconBtn}
539
- hitSlop={6}>
540
- <ResetIcon size={13} color={AppColors.grayText} />
541
- </TouchableScale>
542
-
543
- {entries.length > 0 && (
544
- <TouchableScale
545
- onPress={handleClearAll}
546
- style={[styles.actionIconBtn, {borderColor: `${AppColors.errorColor}33`, backgroundColor: `${AppColors.errorColor}12`}]}
547
- hitSlop={6}>
548
- <TrashIcon size={13} color={AppColors.errorColor} />
549
- </TouchableScale>
550
- )}
551
- </View>
552
-
553
- {/* ── Stats Strip ── */}
554
- <View style={styles.statsStrip}>
555
- <Text style={styles.statsText}>
556
- {filteredEntries.length} of {entries.length} Keys • {formattedTotalSize}
557
- </Text>
558
- <Text style={styles.statsSubtext}>
559
- {activeDriver === 'asyncStorage' ? 'SQLite Key-Value' : `MMKV (${activeMMKVId})`}
560
- </Text>
561
- </View>
562
-
563
- {/* ── Storage Entries List ── */}
564
- {isLoading ? (
565
- <View style={styles.loadingContainer}>
566
- <ActivityIndicator size="small" color={AppColors.purple} />
567
- <Text style={styles.loadingText}>Loading storage entries...</Text>
568
- </View>
569
- ) : (
570
- <>
571
- <FlatList
572
- ref={listRef}
573
- data={filteredEntries}
574
- keyExtractor={item => item.key}
575
- renderItem={renderItem}
576
- initialNumToRender={10}
577
- maxToRenderPerBatch={10}
578
- windowSize={5}
579
- removeClippedSubviews={Platform.OS === 'android'}
580
- style={styles.scrollArea}
581
- contentContainerStyle={styles.scrollContent}
582
- showsVerticalScrollIndicator={false}
583
- ListEmptyComponent={
584
- <View style={styles.emptyContainer}>
585
- <View style={styles.emptyIconWrap}>
586
- <DatabaseIcon size={28} color={AppColors.grayTextWeak} />
587
- </View>
588
- <Text style={styles.emptyTitle}>
589
- {search.trim().length > 0
590
- ? 'No matching keys found'
591
- : `No ${activeDriver === 'asyncStorage' ? 'AsyncStorage' : 'MMKV'} Keys`}
592
- </Text>
593
- <Text style={styles.emptySubtitle}>
594
- {search.trim().length > 0
595
- ? `No keys or values match "${search}"`
596
- : `Storage is auto-detected. Tap "+ Add" above to create your first ${activeDriver === 'asyncStorage' ? 'AsyncStorage' : 'MMKV'} key!`}
597
- </Text>
598
- {search.trim().length > 0 && (
599
- <TouchableScale
600
- onPress={() => setSearch('')}
601
- style={{
602
- marginTop: 12,
603
- paddingHorizontal: 14,
604
- paddingVertical: 6,
605
- borderRadius: 8,
606
- backgroundColor: AppColors.grayBackground,
607
- borderWidth: 1,
608
- borderColor: AppColors.grayBorderSecondary,
609
- }}>
610
- <Text style={{color: AppColors.brandPurple, fontSize: 12, fontFamily: AppFonts.interBold}}>
611
- Clear Search
612
- </Text>
613
- </TouchableScale>
614
- )}
615
- </View>
616
- }
617
- ListFooterComponent={<View style={{height: 60}} />}
618
- />
619
- </>
620
- )}
621
-
622
- {/* ── Create / Edit Key Modal ── */}
623
- <Modal
624
- visible={modalVisible}
625
- transparent
626
- animationType="fade"
627
- onRequestClose={() => setModalVisible(false)}>
628
- <View style={styles.modalOverlay}>
629
- <View style={styles.modalCard}>
630
- <View style={styles.modalHeader}>
631
- <Text style={styles.modalTitle}>
632
- {modalMode === 'create' ? 'Add Storage Key' : `Edit: ${editKeyName}`}
633
- </Text>
634
- <TouchableScale onPress={() => setModalVisible(false)} hitSlop={8}>
635
- <ClearIcon size={16} color={AppColors.grayText} />
636
- </TouchableScale>
637
- </View>
638
-
639
- {/* Key Name Input */}
640
- <View style={styles.inputGroup}>
641
- <Text style={styles.inputLabel}>KEY NAME</Text>
642
- <TextInput
643
- value={editKeyName}
644
- onChangeText={setEditKeyName}
645
- placeholder="e.g. user_session, auth_token"
646
- placeholderTextColor={AppColors.grayTextWeak}
647
- editable={modalMode === 'create'}
648
- style={[
649
- styles.textInput,
650
- modalMode === 'edit' && styles.textInputDisabled,
651
- ]}
652
- autoCapitalize="none"
653
- />
654
- </View>
655
-
656
- {/* Type Selector Strip */}
657
- <View style={styles.inputGroup}>
658
- <View style={{flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', marginBottom: 4}}>
659
- <Text style={styles.inputLabel}>VALUE TYPE</Text>
660
- {editType === 'json' && (
661
- <TouchableScale onPress={handleBeautifyJson} hitSlop={6}>
662
- <Text style={styles.formatJsonBtn}>Beautify JSON</Text>
663
- </TouchableScale>
664
- )}
665
- </View>
666
- <View style={styles.typeSelectorStrip}>
667
- {(['string', 'json', 'number', 'boolean'] as const).map(t => {
668
- const isSel = editType === t;
669
- return (
670
- <TouchableScale
671
- key={t}
672
- onPress={() => {
673
- setEditType(t);
674
- setJsonError(null);
675
- }}
676
- style={[
677
- styles.typePill,
678
- isSel && styles.typePillActive,
679
- ]}>
680
- <Text
681
- style={[
682
- styles.typePillText,
683
- isSel && styles.typePillTextActive,
684
- ]}>
685
- {t.toUpperCase()}
686
- </Text>
687
- </TouchableScale>
688
- );
689
- })}
690
- </View>
691
- </View>
692
-
693
- {/* Value Input */}
694
- <View style={styles.inputGroup}>
695
- <Text style={styles.inputLabel}>VALUE CONTENT</Text>
696
- <TextInput
697
- value={editValue}
698
- onChangeText={v => {
699
- setEditValue(v);
700
- if (jsonError) setJsonError(null);
701
- }}
702
- placeholder={
703
- editType === 'json'
704
- ? '{"userId": 123, "isLoggedIn": true}'
705
- : editType === 'number'
706
- ? '42'
707
- : editType === 'boolean'
708
- ? 'true'
709
- : 'String value...'
710
- }
711
- placeholderTextColor={AppColors.grayTextWeak}
712
- style={[styles.textInput, styles.textAreaInput]}
713
- multiline
714
- textAlignVertical="top"
715
- autoCapitalize="none"
716
- />
717
- {jsonError && (
718
- <View style={{flexDirection: 'row', alignItems: 'center', gap: 5, marginTop: 4}}>
719
- <WarningTriangleIcon size={12} color={AppColors.errorColor} />
720
- <Text style={styles.errorText}>{jsonError}</Text>
721
- </View>
722
- )}
723
- </View>
724
-
725
- {/* Modal Actions */}
726
- <View style={styles.modalActions}>
727
- <TouchableScale
728
- onPress={() => setModalVisible(false)}
729
- style={styles.cancelBtn}>
730
- <Text style={styles.cancelBtnText}>Cancel</Text>
731
- </TouchableScale>
732
- <TouchableScale
733
- onPress={handleSaveModal}
734
- style={styles.saveBtn}>
735
- <CheckIcon size={14} color={AppColors.white} />
736
- <Text style={styles.saveBtnText}>Save Key</Text>
737
- </TouchableScale>
738
- </View>
739
- </View>
740
- </View>
741
- </Modal>
742
- </View>
743
- );
744
- });
745
-
746
- const styles = StyleSheet.create({
747
- container: {
748
- flex: 1,
749
- backgroundColor: AppColors.grayBackground,
750
- },
751
- driverTabsWrapper: {
752
- backgroundColor: AppColors.primaryLight,
753
- borderBottomWidth: 1,
754
- borderBottomColor: AppColors.dividerColor,
755
- paddingVertical: 8,
756
- },
757
- driverTabsContainer: {
758
- paddingHorizontal: 12,
759
- flexDirection: 'row',
760
- alignItems: 'center',
761
- gap: 6,
762
- },
763
- driverTabPill: {
764
- flexDirection: 'row',
765
- alignItems: 'center',
766
- gap: 6,
767
- paddingHorizontal: 11,
768
- paddingVertical: 6,
769
- borderRadius: 8,
770
- backgroundColor: AppColors.grayBackground,
771
- borderWidth: 1,
772
- borderColor: AppColors.grayBorderSecondary,
773
- },
774
- driverTabPillActive: {
775
- backgroundColor: AppColors.purple,
776
- borderColor: AppColors.purple,
777
- },
778
- driverTabText: {
779
- fontFamily: AppFonts.interBold,
780
- fontSize: 11.5,
781
- color: AppColors.grayText,
782
- },
783
- driverTabTextActive: {
784
- color: AppColors.white,
785
- },
786
- driverCountBadge: {
787
- backgroundColor: 'rgba(255, 255, 255, 0.25)',
788
- paddingHorizontal: 5,
789
- paddingVertical: 1,
790
- borderRadius: 6,
791
- },
792
- driverCountText: {
793
- fontFamily: AppFonts.interBold,
794
- fontSize: 9,
795
- color: AppColors.white,
796
- },
797
- instancePill: {
798
- paddingHorizontal: 7,
799
- paddingVertical: 3,
800
- borderRadius: 6,
801
- backgroundColor: `${AppColors.purple}14`,
802
- borderWidth: 1,
803
- borderColor: `${AppColors.purple}30`,
804
- },
805
- instancePillActive: {
806
- backgroundColor: AppColors.purple,
807
- borderColor: AppColors.purple,
808
- },
809
- instancePillText: {
810
- fontFamily: AppFonts.interBold,
811
- fontSize: 10,
812
- color: AppColors.purple,
813
- },
814
- instancePillTextActive: {
815
- color: AppColors.white,
816
- },
817
- actionBar: {
818
- flexDirection: 'row',
819
- alignItems: 'center',
820
- paddingHorizontal: 12,
821
- paddingVertical: 8,
822
- backgroundColor: AppColors.primaryLight,
823
- borderBottomWidth: 1,
824
- borderBottomColor: AppColors.dividerColor,
825
- gap: 6,
826
- },
827
- searchBar: {
828
- flex: 1,
829
- flexDirection: 'row',
830
- alignItems: 'center',
831
- backgroundColor: AppColors.grayBackground,
832
- borderRadius: 8,
833
- paddingHorizontal: 9,
834
- paddingVertical: Platform.OS === 'ios' ? 6 : 2,
835
- borderWidth: 1,
836
- borderColor: AppColors.grayBorderSecondary,
837
- gap: 6,
838
- },
839
- searchInput: {
840
- flex: 1,
841
- fontFamily: AppFonts.interMedium,
842
- fontSize: 12,
843
- color: AppColors.primaryBlack,
844
- padding: 0,
845
- },
846
- addKeyBtn: {
847
- flexDirection: 'row',
848
- alignItems: 'center',
849
- gap: 4,
850
- paddingHorizontal: 10,
851
- paddingVertical: 6,
852
- borderRadius: 8,
853
- backgroundColor: AppColors.purple,
854
- },
855
- addKeyBtnText: {
856
- fontFamily: AppFonts.interBold,
857
- fontSize: 11,
858
- color: AppColors.white,
859
- },
860
- actionIconBtn: {
861
- width: 30,
862
- height: 30,
863
- borderRadius: 8,
864
- alignItems: 'center',
865
- justifyContent: 'center',
866
- backgroundColor: AppColors.grayBackground,
867
- borderWidth: 1,
868
- borderColor: AppColors.grayBorderSecondary,
869
- },
870
- statsStrip: {
871
- flexDirection: 'row',
872
- alignItems: 'center',
873
- justifyContent: 'space-between',
874
- paddingHorizontal: 12,
875
- paddingVertical: 5,
876
- backgroundColor: `${AppColors.grayBorderSecondary}40`,
877
- },
878
- statsText: {
879
- fontFamily: AppFonts.interMedium,
880
- fontSize: 10,
881
- color: AppColors.grayText,
882
- },
883
- statsSubtext: {
884
- fontFamily: AppFonts.interBold,
885
- fontSize: 9.5,
886
- color: AppColors.grayTextWeak,
887
- },
888
- scrollArea: {
889
- flex: 1,
890
- },
891
- scrollContent: {
892
- padding: 12,
893
- gap: 10,
894
- paddingBottom: 100,
895
- },
896
- entryCard: {
897
- backgroundColor: AppColors.primaryLight,
898
- borderRadius: 10,
899
- borderWidth: 1,
900
- borderColor: AppColors.grayBorderSecondary,
901
- padding: 10,
902
- gap: 8,
903
- shadowColor: AppColors.black,
904
- shadowOpacity: 0.02,
905
- shadowRadius: 3,
906
- shadowOffset: {width: 0, height: 1},
907
- elevation: 1,
908
- },
909
- entryHeader: {
910
- flexDirection: 'row',
911
- alignItems: 'center',
912
- justifyContent: 'space-between',
913
- },
914
- entryKey: {
915
- fontFamily: AppFonts.interBold,
916
- fontSize: 12.5,
917
- color: AppColors.primaryBlack,
918
- },
919
- typeBadge: {
920
- paddingHorizontal: 5,
921
- paddingVertical: 1,
922
- borderRadius: 4,
923
- borderWidth: 1,
924
- },
925
- typeBadgeText: {
926
- fontFamily: AppFonts.interBold,
927
- fontSize: 8.5,
928
- },
929
- sizeText: {
930
- fontFamily: AppFonts.interRegular,
931
- fontSize: 10,
932
- color: AppColors.grayTextWeak,
933
- },
934
- entryActions: {
935
- flexDirection: 'row',
936
- alignItems: 'center',
937
- gap: 5,
938
- },
939
- entryActionBtn: {
940
- padding: 5,
941
- borderRadius: 5,
942
- backgroundColor: AppColors.grayBackground,
943
- },
944
- valuePreviewBox: {
945
- backgroundColor: AppColors.grayBackground,
946
- borderRadius: 6,
947
- padding: 8,
948
- borderWidth: 1,
949
- borderColor: `${AppColors.grayBorderSecondary}80`,
950
- },
951
- valuePreviewText: {
952
- fontFamily: AppFonts.interRegular,
953
- fontSize: 11,
954
- color: AppColors.primaryBlack,
955
- lineHeight: 16,
956
- },
957
- expandHint: {
958
- fontFamily: AppFonts.interBold,
959
- fontSize: 9.5,
960
- color: AppColors.purple,
961
- marginTop: 4,
962
- },
963
- loadingContainer: {
964
- flex: 1,
965
- alignItems: 'center',
966
- justifyContent: 'center',
967
- gap: 8,
968
- },
969
- loadingText: {
970
- fontFamily: AppFonts.interMedium,
971
- fontSize: 12,
972
- color: AppColors.grayText,
973
- },
974
- emptyContainer: {
975
- padding: 24,
976
- alignItems: 'center',
977
- justifyContent: 'center',
978
- },
979
- emptyIconWrap: {
980
- width: 56,
981
- height: 56,
982
- borderRadius: 28,
983
- backgroundColor: `${AppColors.grayBorderSecondary}40`,
984
- alignItems: 'center',
985
- justifyContent: 'center',
986
- marginBottom: 12,
987
- },
988
- emptyTitle: {
989
- fontFamily: AppFonts.interBold,
990
- fontSize: 14,
991
- color: AppColors.primaryBlack,
992
- marginBottom: 4,
993
- },
994
- emptySubtitle: {
995
- fontFamily: AppFonts.interRegular,
996
- fontSize: 11.5,
997
- color: AppColors.grayText,
998
- textAlign: 'center',
999
- maxWidth: 280,
1000
- },
1001
- connectGuideCard: {
1002
- marginTop: 20,
1003
- width: '100%',
1004
- backgroundColor: AppColors.primaryLight,
1005
- borderRadius: 10,
1006
- borderWidth: 1,
1007
- borderColor: AppColors.grayBorderSecondary,
1008
- padding: 12,
1009
- gap: 6,
1010
- },
1011
- connectGuideTitle: {
1012
- fontFamily: AppFonts.interBold,
1013
- fontSize: 11,
1014
- color: AppColors.purple,
1015
- },
1016
- connectGuideCode: {
1017
- fontFamily: AppFonts.interRegular,
1018
- fontSize: 10,
1019
- color: AppColors.grayText,
1020
- lineHeight: 15,
1021
- },
1022
- modalOverlay: {
1023
- flex: 1,
1024
- backgroundColor: 'rgba(0, 0, 0, 0.5)',
1025
- justifyContent: 'center',
1026
- alignItems: 'center',
1027
- padding: 16,
1028
- },
1029
- modalCard: {
1030
- width: '100%',
1031
- maxWidth: 400,
1032
- backgroundColor: AppColors.primaryLight,
1033
- borderRadius: 14,
1034
- padding: 16,
1035
- gap: 12,
1036
- shadowColor: AppColors.black,
1037
- shadowOpacity: 0.2,
1038
- shadowRadius: 10,
1039
- shadowOffset: {width: 0, height: 4},
1040
- elevation: 5,
1041
- },
1042
- modalHeader: {
1043
- flexDirection: 'row',
1044
- alignItems: 'center',
1045
- justifyContent: 'space-between',
1046
- borderBottomWidth: 1,
1047
- borderBottomColor: AppColors.dividerColor,
1048
- paddingBottom: 10,
1049
- },
1050
- modalTitle: {
1051
- fontFamily: AppFonts.interBold,
1052
- fontSize: 14,
1053
- color: AppColors.primaryBlack,
1054
- },
1055
- inputGroup: {
1056
- gap: 4,
1057
- },
1058
- inputLabel: {
1059
- fontFamily: AppFonts.interBold,
1060
- fontSize: 9.5,
1061
- color: AppColors.grayTextWeak,
1062
- letterSpacing: 0.5,
1063
- },
1064
- textInput: {
1065
- backgroundColor: AppColors.grayBackground,
1066
- borderRadius: 8,
1067
- paddingHorizontal: 10,
1068
- paddingVertical: 8,
1069
- fontFamily: AppFonts.interMedium,
1070
- fontSize: 12,
1071
- color: AppColors.primaryBlack,
1072
- borderWidth: 1,
1073
- borderColor: AppColors.grayBorderSecondary,
1074
- },
1075
- textInputDisabled: {
1076
- backgroundColor: `${AppColors.grayBorderSecondary}40`,
1077
- color: AppColors.grayText,
1078
- },
1079
- textAreaInput: {
1080
- minHeight: 90,
1081
- maxHeight: 160,
1082
- fontFamily: AppFonts.interRegular,
1083
- fontSize: 11,
1084
- },
1085
- typeSelectorStrip: {
1086
- flexDirection: 'row',
1087
- alignItems: 'center',
1088
- gap: 6,
1089
- },
1090
- typePill: {
1091
- flex: 1,
1092
- alignItems: 'center',
1093
- paddingVertical: 6,
1094
- borderRadius: 6,
1095
- backgroundColor: AppColors.grayBackground,
1096
- borderWidth: 1,
1097
- borderColor: AppColors.grayBorderSecondary,
1098
- },
1099
- typePillActive: {
1100
- backgroundColor: AppColors.purple,
1101
- borderColor: AppColors.purple,
1102
- },
1103
- typePillText: {
1104
- fontFamily: AppFonts.interBold,
1105
- fontSize: 10,
1106
- color: AppColors.grayText,
1107
- },
1108
- typePillTextActive: {
1109
- color: AppColors.white,
1110
- },
1111
- formatJsonBtn: {
1112
- fontFamily: AppFonts.interBold,
1113
- fontSize: 10,
1114
- color: AppColors.purple,
1115
- },
1116
- errorText: {
1117
- fontFamily: AppFonts.interMedium,
1118
- fontSize: 10,
1119
- color: AppColors.errorColor,
1120
- marginTop: 2,
1121
- },
1122
- modalActions: {
1123
- flexDirection: 'row',
1124
- alignItems: 'center',
1125
- gap: 10,
1126
- marginTop: 4,
1127
- },
1128
- cancelBtn: {
1129
- flex: 1,
1130
- alignItems: 'center',
1131
- paddingVertical: 10,
1132
- borderRadius: 8,
1133
- backgroundColor: AppColors.grayBackground,
1134
- borderWidth: 1,
1135
- borderColor: AppColors.grayBorderSecondary,
1136
- },
1137
- cancelBtnText: {
1138
- fontFamily: AppFonts.interBold,
1139
- fontSize: 12,
1140
- color: AppColors.grayText,
1141
- },
1142
- saveBtn: {
1143
- flex: 1.5,
1144
- flexDirection: 'row',
1145
- alignItems: 'center',
1146
- justifyContent: 'center',
1147
- gap: 5,
1148
- paddingVertical: 10,
1149
- borderRadius: 8,
1150
- backgroundColor: AppColors.purple,
1151
- },
1152
- saveBtnText: {
1153
- fontFamily: AppFonts.interBold,
1154
- fontSize: 12,
1155
- color: AppColors.white,
1156
- },
1157
- });
1158
-
1159
- export default StorageTab;