react-native-inapp-inspector 1.1.28 → 1.1.31

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 (77) hide show
  1. package/android/src/main/java/com/inappinspector/NetworkInspectorModule.java +29 -80
  2. package/dist/commonjs/components/AnalyticsDetail.js +668 -108
  3. package/dist/commonjs/components/AppHeaderLogo.js +15 -15
  4. package/dist/commonjs/components/ConsoleLogCard.js +112 -66
  5. package/dist/commonjs/components/CopyButton.js +15 -1
  6. package/dist/commonjs/components/DomainHeader.js +64 -32
  7. package/dist/commonjs/components/HighlightText.js +7 -1
  8. package/dist/commonjs/components/Inspector/AnalyticsTab.js +332 -221
  9. package/dist/commonjs/components/Inspector/ConsoleTab.js +162 -56
  10. package/dist/commonjs/components/Inspector/InspectorHeader.js +70 -119
  11. package/dist/commonjs/components/Inspector/LogDetail.js +53 -17
  12. package/dist/commonjs/components/Inspector/MainScreen.js +4 -0
  13. package/dist/commonjs/components/Inspector/NetworkDetail.js +24 -24
  14. package/dist/commonjs/components/Inspector/NetworkTab.js +4 -1
  15. package/dist/commonjs/components/Inspector/ReduxDetail.js +237 -42
  16. package/dist/commonjs/components/Inspector/ReduxTab.js +456 -35
  17. package/dist/commonjs/components/JsonViewer.js +26 -4
  18. package/dist/commonjs/components/LogCard.js +103 -11
  19. package/dist/commonjs/components/NetworkIcons.js +19 -10
  20. package/dist/commonjs/components/Toast.d.ts +3 -0
  21. package/dist/commonjs/components/Toast.js +152 -0
  22. package/dist/commonjs/components/TouchableScale.d.ts +1 -0
  23. package/dist/commonjs/components/TouchableScale.js +3 -3
  24. package/dist/commonjs/components/TreeNode.js +12 -2
  25. package/dist/commonjs/constants/index.js +6 -6
  26. package/dist/commonjs/constants/version.d.ts +1 -1
  27. package/dist/commonjs/constants/version.js +1 -1
  28. package/dist/commonjs/customHooks/reduxLogger.js +128 -5
  29. package/dist/commonjs/helpers/index.d.ts +4 -0
  30. package/dist/commonjs/helpers/index.js +107 -92
  31. package/dist/commonjs/helpers/toast.d.ts +4 -0
  32. package/dist/commonjs/helpers/toast.js +20 -0
  33. package/dist/commonjs/i18n/locales/en.json +49 -3
  34. package/dist/commonjs/styles/AppColors.d.ts +6 -0
  35. package/dist/commonjs/styles/AppColors.js +6 -0
  36. package/dist/commonjs/styles/index.d.ts +82 -15
  37. package/dist/commonjs/styles/index.js +92 -26
  38. package/dist/commonjs/types/interfaces.d.ts +7 -0
  39. package/dist/esm/components/AnalyticsDetail.js +670 -110
  40. package/dist/esm/components/AppHeaderLogo.js +15 -15
  41. package/dist/esm/components/ConsoleLogCard.js +114 -68
  42. package/dist/esm/components/CopyButton.js +15 -1
  43. package/dist/esm/components/DomainHeader.js +64 -32
  44. package/dist/esm/components/HighlightText.js +7 -1
  45. package/dist/esm/components/Inspector/AnalyticsTab.js +334 -223
  46. package/dist/esm/components/Inspector/ConsoleTab.js +163 -57
  47. package/dist/esm/components/Inspector/InspectorHeader.js +71 -120
  48. package/dist/esm/components/Inspector/LogDetail.js +55 -19
  49. package/dist/esm/components/Inspector/MainScreen.js +4 -0
  50. package/dist/esm/components/Inspector/NetworkDetail.js +25 -25
  51. package/dist/esm/components/Inspector/NetworkTab.js +4 -1
  52. package/dist/esm/components/Inspector/ReduxDetail.js +239 -44
  53. package/dist/esm/components/Inspector/ReduxTab.js +458 -37
  54. package/dist/esm/components/JsonViewer.js +26 -4
  55. package/dist/esm/components/LogCard.js +105 -13
  56. package/dist/esm/components/NetworkIcons.js +19 -10
  57. package/dist/esm/components/Toast.d.ts +3 -0
  58. package/dist/esm/components/Toast.js +117 -0
  59. package/dist/esm/components/TouchableScale.d.ts +1 -0
  60. package/dist/esm/components/TouchableScale.js +3 -3
  61. package/dist/esm/components/TreeNode.js +12 -2
  62. package/dist/esm/constants/index.js +6 -6
  63. package/dist/esm/constants/version.d.ts +1 -1
  64. package/dist/esm/constants/version.js +1 -1
  65. package/dist/esm/customHooks/reduxLogger.js +128 -5
  66. package/dist/esm/helpers/index.d.ts +4 -0
  67. package/dist/esm/helpers/index.js +102 -92
  68. package/dist/esm/helpers/toast.d.ts +4 -0
  69. package/dist/esm/helpers/toast.js +15 -0
  70. package/dist/esm/i18n/locales/en.json +49 -3
  71. package/dist/esm/styles/AppColors.d.ts +6 -0
  72. package/dist/esm/styles/AppColors.js +6 -0
  73. package/dist/esm/styles/index.d.ts +82 -15
  74. package/dist/esm/styles/index.js +92 -26
  75. package/dist/esm/types/interfaces.d.ts +7 -0
  76. package/ios/NetworkInspectorModule.m +0 -10
  77. package/package.json +13 -10
@@ -93,9 +93,9 @@ const JsonTableRow = react_1.default.memo(({ itemKey, val, search, }) => {
93
93
  </react_native_1.View>);
94
94
  });
95
95
  // ── JsonViewer Component ─────────────────────────────────────────────────────
96
- const JsonViewer = react_1.default.memo(({ data, search, forceOpen, defaultExpandDepth, wrap, fullHeight = false, maxHeight, mode: externalMode, onModeChange, hideTabs = false, }) => {
96
+ const JsonViewer = react_1.default.memo(({ data, search, forceOpen, defaultExpandDepth = 1, wrap, fullHeight = false, maxHeight, mode: externalMode, onModeChange, hideTabs = false, }) => {
97
97
  const { t } = (0, i18n_1.useTranslation)();
98
- const [internalMode, setInternalMode] = (0, react_1.useState)('pretty');
98
+ const [internalMode, setInternalMode] = (0, react_1.useState)('raw');
99
99
  const mode = externalMode ?? internalMode;
100
100
  const setMode = (newMode) => {
101
101
  if (onModeChange) {
@@ -116,6 +116,10 @@ const JsonViewer = react_1.default.memo(({ data, search, forceOpen, defaultExpan
116
116
  return String(data);
117
117
  }
118
118
  }, [data]);
119
+ const [showFullRaw, setShowFullRaw] = (0, react_1.useState)(false);
120
+ const RAW_LIMIT = 50000;
121
+ const isTruncated = rawText.length > RAW_LIMIT && !showFullRaw;
122
+ const displayRawText = isTruncated ? rawText.slice(0, RAW_LIMIT) : rawText;
119
123
  (0, react_1.useEffect)(() => {
120
124
  if (externalMode) {
121
125
  setInternalMode(externalMode);
@@ -186,7 +190,7 @@ const JsonViewer = react_1.default.memo(({ data, search, forceOpen, defaultExpan
186
190
  <react_native_1.View style={contentWrapperStyle}>
187
191
  {mode === 'pretty' && (isEmpty ? (<react_native_1.View style={localStyles.emptyTable}>
188
192
  <react_native_1.Text style={localStyles.emptyTableText}>
189
- {t('network.emptyResponse')}
193
+ {t('network.jsonViewer.emptyPayload')}
190
194
  </react_native_1.Text>
191
195
  </react_native_1.View>) : (wrap ? (fullHeight ? (<react_native_1.ScrollView style={{ flex: 1 }} contentContainerStyle={{ flexGrow: 1 }}>
192
196
  <react_native_1.View style={[styles_1.default.codeBlock, { width: '100%' }]}>{tree}</react_native_1.View>
@@ -201,12 +205,30 @@ const JsonViewer = react_1.default.memo(({ data, search, forceOpen, defaultExpan
201
205
  </react_native_1.ScrollView>))))}
202
206
 
203
207
  {mode === 'raw' && (<react_native_1.ScrollView style={scrollStyle} contentContainerStyle={localStyles.rawContainer} showsVerticalScrollIndicator={true} nestedScrollEnabled={true}>
204
- <HighlightText_1.default text={rawText} search={search} detectLinks={true} style={localStyles.rawPlainText} highlightStyle={{
208
+ <HighlightText_1.default text={displayRawText} search={search} detectLinks={rawText.length < 20000} style={localStyles.rawPlainText} selectable={true} highlightStyle={{
205
209
  backgroundColor: AppColors_1.AppColors.yellowHighlight,
206
210
  color: AppColors_1.AppColors.primaryBlack,
207
211
  borderRadius: 3,
208
212
  paddingHorizontal: 2,
209
213
  }}/>
214
+ {isTruncated && (<react_native_1.TouchableOpacity onPress={() => setShowFullRaw(true)} style={{
215
+ marginTop: 10,
216
+ backgroundColor: `${AppColors_1.AppColors.brandPurple}15`,
217
+ paddingVertical: 8,
218
+ paddingHorizontal: 12,
219
+ borderRadius: 6,
220
+ alignItems: 'center',
221
+ borderWidth: 1,
222
+ borderColor: `${AppColors_1.AppColors.brandPurple}30`,
223
+ }}>
224
+ <react_native_1.Text style={{
225
+ fontFamily: AppFonts_1.AppFonts.interBold,
226
+ fontSize: 11,
227
+ color: AppColors_1.AppColors.brandPurple,
228
+ }}>
229
+ Showing first 50 KB ({Math.round(rawText.length / 1024)} KB total) · Tap to load full
230
+ </react_native_1.Text>
231
+ </react_native_1.TouchableOpacity>)}
210
232
  </react_native_1.ScrollView>)}
211
233
 
212
234
  {mode === 'table' && (fullHeight ? (<react_native_1.ScrollView style={scrollStyle}>
@@ -51,6 +51,27 @@ const i18n_1 = require("../i18n");
51
51
  const LogCard = react_1.default.memo(function LogCard({ item, onPress, timelineMinStart, timelineTotalRange, isNew, isSelected, onToggleSelect, searchStr, }) {
52
52
  const { t } = (0, i18n_1.useTranslation)();
53
53
  const methodColor = constants_1.METHOD_COLORS[item.method] ?? constants_1.METHOD_COLORS.ALL;
54
+ const handleOpenUrl = (e) => {
55
+ e?.stopPropagation?.();
56
+ react_native_1.Alert.alert(t('common.openInBrowser') || 'Open in Browser', `${t('common.openInBrowserPrompt') || 'Are you sure you want to open this URL in your external browser?'}\n\n${item.url}`, [
57
+ { text: t('common.cancel') || 'Cancel', style: 'cancel' },
58
+ {
59
+ text: t('common.open') || 'Open',
60
+ onPress: () => {
61
+ react_native_1.Linking.canOpenURL(item.url)
62
+ .then(supported => {
63
+ if (supported) {
64
+ react_native_1.Linking.openURL(item.url);
65
+ }
66
+ else {
67
+ react_native_1.Linking.openURL(item.url).catch(() => { });
68
+ }
69
+ })
70
+ .catch(() => { });
71
+ },
72
+ },
73
+ ]);
74
+ };
54
75
  const isFailed = item.status === 0 || (item.status != null && item.status >= 400);
55
76
  const isLoading = item.status == null;
56
77
  const statusColor = (0, helpers_1.getStatusColor)(item.status);
@@ -76,10 +97,6 @@ const LogCard = react_1.default.memo(function LogCard({ item, onPress, timelineM
76
97
  }).start();
77
98
  }
78
99
  }, [isNew]);
79
- const path = (0, helpers_1.getPath)(item.url);
80
- const baseUrl = (0, helpers_1.getBaseUrl)(item.url) || item.url;
81
- const slug = path && path !== '/' ? path : item.url;
82
- const showSlug = slug !== baseUrl && slug !== item.url;
83
100
  const triggeredAt = (0, helpers_1.formatDateTime)(item.startTime);
84
101
  const isJson = item.url.split('?')[0].toLowerCase().endsWith('.json');
85
102
  return (<TouchableScale_1.default onPress={onPress} style={[
@@ -90,7 +107,7 @@ const LogCard = react_1.default.memo(function LogCard({ item, onPress, timelineM
90
107
  },
91
108
  ]}>
92
109
  <react_native_1.View style={styles_1.default.cardBody}>
93
- {/* Row 1: Header (Checkbox, Serial, Method Badge, Base URL / Host with HTTPS, Status Pill) */}
110
+ {/* Row 1: Header (Checkbox, Serial, Method Badge, Client Tag, Status Pill) */}
94
111
  <react_native_1.View style={styles_1.default.cardHeaderRow}>
95
112
  <react_native_1.View style={styles_1.default.cardHeaderLeft}>
96
113
  <react_native_1.Pressable onPress={() => onToggleSelect(item.id)} hitSlop={12} style={[
@@ -150,7 +167,82 @@ const LogCard = react_1.default.memo(function LogCard({ item, onPress, timelineM
150
167
  </react_native_1.Text>
151
168
  </react_native_1.View>)}
152
169
 
153
- <HighlightText_1.default text={baseUrl || item.url} search={searchStr} style={styles_1.default.cardHostText} highlightStyle={styles_1.default.highlight} numberOfLines={1} ellipsizeMode="tail"/>
170
+ {/* Protocol / HTTPS Badge */}
171
+ <react_native_1.View style={[
172
+ styles_1.default.chip,
173
+ {
174
+ backgroundColor: item.url.toLowerCase().startsWith('https')
175
+ ? '#ECFDF5'
176
+ : '#FFFBEB',
177
+ borderColor: item.url.toLowerCase().startsWith('https')
178
+ ? '#A7F3D0'
179
+ : '#FDE68A',
180
+ paddingHorizontal: 4,
181
+ paddingVertical: 1,
182
+ borderRadius: 4,
183
+ },
184
+ ]}>
185
+ <react_native_1.Text style={[
186
+ styles_1.default.chipText,
187
+ {
188
+ fontFamily: AppFonts_1.AppFonts.interBold,
189
+ fontSize: 8,
190
+ color: item.url.toLowerCase().startsWith('https')
191
+ ? '#059669'
192
+ : '#D97706',
193
+ },
194
+ ]}>
195
+ {item.url.toLowerCase().startsWith('https') ? 'HTTPS' : 'HTTP'}
196
+ </react_native_1.Text>
197
+ </react_native_1.View>
198
+
199
+ {/* GraphQL Indicator */}
200
+ {(item.url.toLowerCase().includes('graphql') ||
201
+ item.client === 'apollo' ||
202
+ item.client === 'graphql') && (<react_native_1.View style={[
203
+ styles_1.default.chip,
204
+ {
205
+ backgroundColor: '#FDF2F8',
206
+ borderColor: '#FBCFE8',
207
+ paddingHorizontal: 4,
208
+ paddingVertical: 1,
209
+ borderRadius: 4,
210
+ },
211
+ ]}>
212
+ <react_native_1.Text style={[
213
+ styles_1.default.chipText,
214
+ {
215
+ fontFamily: AppFonts_1.AppFonts.interBold,
216
+ fontSize: 8,
217
+ color: '#DB2777',
218
+ },
219
+ ]}>
220
+ GQL
221
+ </react_native_1.Text>
222
+ </react_native_1.View>)}
223
+
224
+ {/* In-Line Duration / Latency Pill */}
225
+ {item.duration != null && !isFailed && (<react_native_1.View style={[
226
+ styles_1.default.chip,
227
+ {
228
+ backgroundColor: `${durationColor}12`,
229
+ borderColor: `${durationColor}2E`,
230
+ paddingHorizontal: 4.5,
231
+ paddingVertical: 1,
232
+ borderRadius: 4,
233
+ },
234
+ ]}>
235
+ <react_native_1.Text style={[
236
+ styles_1.default.chipText,
237
+ {
238
+ fontFamily: AppFonts_1.AppFonts.interBold,
239
+ fontSize: 8.5,
240
+ color: durationColor,
241
+ },
242
+ ]}>
243
+ {item.duration}ms
244
+ </react_native_1.Text>
245
+ </react_native_1.View>)}
154
246
  </react_native_1.View>
155
247
 
156
248
  <react_native_1.View style={[
@@ -187,12 +279,12 @@ const LogCard = react_1.default.memo(function LogCard({ item, onPress, timelineM
187
279
  </react_native_1.View>
188
280
  </react_native_1.View>
189
281
 
190
- {/* Row 2: Full URL Capsule Container */}
282
+ {/* Row 2: Full URL Capsule Container (Clickable with link prompt) */}
191
283
  <react_native_1.View style={styles_1.default.cardSlugBox}>
192
- <react_native_1.View style={styles_1.default.slugLeft}>
193
- <react_native_1.Text style={styles_1.default.slugTag}>URL</react_native_1.Text>
194
- <HighlightText_1.default text={item.url} search={searchStr} style={styles_1.default.slugText} highlightStyle={styles_1.default.highlight} numberOfLines={2} ellipsizeMode="middle"/>
195
- </react_native_1.View>
284
+ <react_native_1.Pressable onPress={handleOpenUrl} style={styles_1.default.slugLeft} hitSlop={6}>
285
+ <react_native_1.Text style={styles_1.default.slugTag}>URL ↗</react_native_1.Text>
286
+ <HighlightText_1.default text={item.url} search={searchStr} style={[styles_1.default.slugText, { color: AppColors_1.AppColors.skyBlue, textDecorationLine: 'underline' }]} highlightStyle={styles_1.default.highlight} numberOfLines={2} ellipsizeMode="middle"/>
287
+ </react_native_1.Pressable>
196
288
 
197
289
  <react_native_1.View style={styles_1.default.slugRight}>
198
290
  {isJson && (<react_native_1.View style={[
@@ -463,16 +463,22 @@ exports.ForwardChevronIcon = ForwardChevronIcon;
463
463
  exports.BundleIcon = exports.PackageIcon;
464
464
  const LiveStateIcon = ({ color = AppColors_1.AppColors.purple, size = 14, }) => {
465
465
  return (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
466
- <react_native_svg_1.Path d="M12 3v3M12 18v3M3 12h3M18 12h3" stroke={color} strokeWidth="2" strokeLinecap="round"/>
467
- <react_native_svg_1.Circle cx="12" cy="12" r="3.5" stroke={color} strokeWidth="1.8" fill={`${color}22`}/>
468
- <react_native_svg_1.Circle cx="12" cy="12" r="1.5" fill={color}/>
466
+ <react_native_svg_1.Circle cx="12" cy="12" r="9" stroke={color} strokeWidth="1.8" strokeDasharray="3 3" opacity={0.6}/>
467
+ <react_native_svg_1.Circle cx="12" cy="12" r="4.5" stroke={color} strokeWidth="1.8"/>
468
+ <react_native_svg_1.Circle cx="12" cy="12" r="2" fill={color}/>
469
+ <react_native_svg_1.Path d="M12 2v2.5M12 19.5V22M2 12h2.5M19.5 12H22" stroke={color} strokeWidth="1.8" strokeLinecap="round"/>
469
470
  </react_native_svg_1.default>);
470
471
  };
471
472
  exports.LiveStateIcon = LiveStateIcon;
472
473
  const TimelineIcon = ({ color = AppColors_1.AppColors.purple, size = 14, }) => {
473
474
  return (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
474
- <react_native_svg_1.Circle cx="12" cy="12" r="8.5" stroke={color} strokeWidth="1.8"/>
475
- <react_native_svg_1.Path d="M12 7.5v4.5l3 2" stroke={color} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/>
475
+ <react_native_svg_1.Path d="M6 3v18" stroke={color} strokeWidth="1.8" strokeLinecap="round"/>
476
+ <react_native_svg_1.Circle cx="6" cy="6" r="2.5" stroke={color} strokeWidth="1.8" fill={`${color}25`}/>
477
+ <react_native_svg_1.Path d="M6 12h5a3 3 0 0 0 3-3V6" stroke={color} strokeWidth="1.8" strokeLinecap="round"/>
478
+ <react_native_svg_1.Circle cx="14" cy="6" r="2.5" stroke={color} strokeWidth="1.8" fill={color}/>
479
+ <react_native_svg_1.Circle cx="6" cy="18" r="2.5" stroke={color} strokeWidth="1.8" fill={color}/>
480
+ <react_native_svg_1.Path d="M6 18h8" stroke={color} strokeWidth="1.8" strokeLinecap="round"/>
481
+ <react_native_svg_1.Circle cx="17" cy="18" r="2.5" stroke={color} strokeWidth="1.8" fill={`${color}25`}/>
476
482
  </react_native_svg_1.default>);
477
483
  };
478
484
  exports.TimelineIcon = TimelineIcon;
@@ -484,16 +490,19 @@ const RefreshCcwIcon = ({ color = AppColors_1.AppColors.grayTextWeak, size = 14,
484
490
  exports.RefreshCcwIcon = RefreshCcwIcon;
485
491
  const StorageIcon = ({ color = AppColors_1.AppColors.purple, size = 14, }) => {
486
492
  return (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
487
- <react_native_svg_1.Ellipse cx="12" cy="6" rx="8" ry="2.8" stroke={color} strokeWidth="1.8"/>
488
- <react_native_svg_1.Path d="M20 12c0 1.55-3.58 2.8-8 2.8s-8-1.25-8-2.8" stroke={color} strokeWidth="1.8" strokeLinecap="round"/>
489
- <react_native_svg_1.Path d="M4 6v12c0 1.55 3.58 2.8 8 2.8s8-1.25 8-2.8V6" stroke={color} strokeWidth="1.8" strokeLinecap="round"/>
493
+ <react_native_svg_1.Ellipse cx="12" cy="5" rx="8" ry="2.5" stroke={color} strokeWidth="1.8"/>
494
+ <react_native_svg_1.Path d="M4 5v4.5c0 1.38 3.58 2.5 8 2.5s8-1.12 8-2.5V5" stroke={color} strokeWidth="1.8" strokeLinecap="round"/>
495
+ <react_native_svg_1.Path d="M4 9.5v4.5c0 1.38 3.58 2.5 8 2.5s8-1.12 8-2.5v-4.5" stroke={color} strokeWidth="1.8" strokeLinecap="round"/>
496
+ <react_native_svg_1.Path d="M4 14v4.5c0 1.38 3.58 2.5 8 2.5s8-1.12 8-2.5V14" stroke={color} strokeWidth="1.8" strokeLinecap="round"/>
490
497
  </react_native_svg_1.default>);
491
498
  };
492
499
  exports.StorageIcon = StorageIcon;
493
500
  const MetadataIcon = ({ color = AppColors_1.AppColors.purple, size = 14, }) => {
494
501
  return (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
495
- <react_native_svg_1.Circle cx="12" cy="12" r="8.5" stroke={color} strokeWidth="1.8"/>
496
- <react_native_svg_1.Path d="M12 16v-4M12 8.2h.01" stroke={color} strokeWidth="2" strokeLinecap="round"/>
502
+ <react_native_svg_1.Rect x="3" y="3" width="18" height="18" rx="4" stroke={color} strokeWidth="1.8"/>
503
+ <react_native_svg_1.Path d="M7 8h10M7 12h6M7 16h7" stroke={color} strokeWidth="1.8" strokeLinecap="round"/>
504
+ <react_native_svg_1.Circle cx="16.5" cy="12" r="1.5" fill={color}/>
505
+ <react_native_svg_1.Circle cx="16.5" cy="16" r="1.5" fill={color}/>
497
506
  </react_native_svg_1.default>);
498
507
  };
499
508
  exports.MetadataIcon = MetadataIcon;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Toast: React.MemoExoticComponent<() => React.JSX.Element>;
3
+ export default Toast;
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ const react_1 = __importStar(require("react"));
37
+ const react_native_1 = require("react-native");
38
+ const toast_1 = require("../helpers/toast");
39
+ const NetworkIcons_1 = require("./NetworkIcons");
40
+ const AppColors_1 = require("../styles/AppColors");
41
+ const AppFonts_1 = require("../styles/AppFonts");
42
+ const Toast = react_1.default.memo(() => {
43
+ const [toastMessage, setToastMessage] = (0, react_1.useState)(null);
44
+ const opacityAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(0)).current;
45
+ const translateYAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(20)).current;
46
+ const hideTimerRef = (0, react_1.useRef)(null);
47
+ (0, react_1.useEffect)(() => {
48
+ const unsubscribe = (0, toast_1.subscribeToast)((message) => {
49
+ if (hideTimerRef.current) {
50
+ clearTimeout(hideTimerRef.current);
51
+ }
52
+ setToastMessage(message);
53
+ react_native_1.Animated.parallel([
54
+ react_native_1.Animated.timing(opacityAnim, {
55
+ toValue: 1,
56
+ duration: 180,
57
+ useNativeDriver: true,
58
+ }),
59
+ react_native_1.Animated.spring(translateYAnim, {
60
+ toValue: 0,
61
+ tension: 80,
62
+ friction: 8,
63
+ useNativeDriver: true,
64
+ }),
65
+ ]).start();
66
+ hideTimerRef.current = setTimeout(() => {
67
+ react_native_1.Animated.parallel([
68
+ react_native_1.Animated.timing(opacityAnim, {
69
+ toValue: 0,
70
+ duration: 200,
71
+ useNativeDriver: true,
72
+ }),
73
+ react_native_1.Animated.timing(translateYAnim, {
74
+ toValue: 20,
75
+ duration: 200,
76
+ useNativeDriver: true,
77
+ }),
78
+ ]).start(() => {
79
+ setToastMessage(null);
80
+ });
81
+ }, 2000);
82
+ });
83
+ return () => {
84
+ unsubscribe();
85
+ if (hideTimerRef.current) {
86
+ clearTimeout(hideTimerRef.current);
87
+ }
88
+ };
89
+ }, [opacityAnim, translateYAnim]);
90
+ if (!toastMessage) {
91
+ return null;
92
+ }
93
+ return (<react_native_1.Animated.View pointerEvents="none" style={[
94
+ styles.toastContainer,
95
+ {
96
+ opacity: opacityAnim,
97
+ transform: [{ translateY: translateYAnim }],
98
+ },
99
+ ]}>
100
+ <react_native_1.View style={styles.toastCard}>
101
+ <react_native_1.View style={styles.iconCircle}>
102
+ <NetworkIcons_1.CheckIcon color={AppColors_1.AppColors.white} size={11}/>
103
+ </react_native_1.View>
104
+ <react_native_1.Text style={styles.toastText} numberOfLines={2}>
105
+ {toastMessage}
106
+ </react_native_1.Text>
107
+ </react_native_1.View>
108
+ </react_native_1.Animated.View>);
109
+ });
110
+ const styles = react_native_1.StyleSheet.create({
111
+ toastContainer: {
112
+ position: 'absolute',
113
+ bottom: react_native_1.Platform.OS === 'ios' ? 44 : 28,
114
+ left: 20,
115
+ right: 20,
116
+ alignItems: 'center',
117
+ justifyContent: 'center',
118
+ zIndex: 999999,
119
+ },
120
+ toastCard: {
121
+ flexDirection: 'row',
122
+ alignItems: 'center',
123
+ backgroundColor: '#0F172AEE', // dark slate glass
124
+ paddingVertical: 10,
125
+ paddingHorizontal: 16,
126
+ borderRadius: 24,
127
+ shadowColor: '#000000',
128
+ shadowOffset: { width: 0, height: 6 },
129
+ shadowOpacity: 0.28,
130
+ shadowRadius: 10,
131
+ elevation: 8,
132
+ borderWidth: 1,
133
+ borderColor: '#33415588',
134
+ maxWidth: '90%',
135
+ gap: 9,
136
+ },
137
+ iconCircle: {
138
+ width: 18,
139
+ height: 18,
140
+ borderRadius: 9,
141
+ backgroundColor: AppColors_1.AppColors.greenColor,
142
+ alignItems: 'center',
143
+ justifyContent: 'center',
144
+ },
145
+ toastText: {
146
+ color: AppColors_1.AppColors.white,
147
+ fontFamily: AppFonts_1.AppFonts.interBold,
148
+ fontSize: 12.5,
149
+ letterSpacing: -0.1,
150
+ },
151
+ });
152
+ exports.default = Toast;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  declare const TouchableScale: React.NamedExoticComponent<{
3
3
  onPress?: () => void;
4
+ onLongPress?: () => void;
4
5
  style?: any;
5
6
  children?: React.ReactNode;
6
7
  hitSlop?: any;
@@ -35,9 +35,9 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  const react_1 = __importStar(require("react"));
37
37
  const react_native_1 = require("react-native");
38
- const TouchableScale = react_1.default.memo(function TouchableScale({ onPress, style, children, hitSlop, disabled, }) {
38
+ const TouchableScale = react_1.default.memo(function TouchableScale({ onPress, onLongPress, style, children, hitSlop, disabled, }) {
39
39
  if (react_native_1.Platform.OS === 'android') {
40
- return (<react_native_1.Pressable disabled={disabled} onPress={onPress} hitSlop={hitSlop} style={({ pressed }) => [
40
+ return (<react_native_1.Pressable disabled={disabled} onPress={onPress} onLongPress={onLongPress} hitSlop={hitSlop} style={({ pressed }) => [
41
41
  style,
42
42
  { opacity: pressed ? 0.75 : 1 },
43
43
  ]}>
@@ -73,7 +73,7 @@ const TouchableScale = react_1.default.memo(function TouchableScale({ onPress, s
73
73
  flexShrink: flattenedStyle.flexShrink,
74
74
  gap: flattenedStyle.gap,
75
75
  };
76
- return (<react_native_1.Pressable disabled={disabled} style={style} onPressIn={() => animatePress(true)} onPressOut={() => animatePress(false)} onPress={onPress} hitSlop={hitSlop}>
76
+ return (<react_native_1.Pressable disabled={disabled} style={style} onPressIn={() => animatePress(true)} onPressOut={() => animatePress(false)} onPress={onPress} onLongPress={onLongPress} hitSlop={hitSlop}>
77
77
  <react_native_1.Animated.View style={[{ opacity, transform: [{ scale }] }, layoutStyle]}>
78
78
  {children}
79
79
  </react_native_1.Animated.View>
@@ -45,9 +45,19 @@ const NetworkIcons_1 = require("./NetworkIcons");
45
45
  // Stylesheet
46
46
  const AppColors_1 = require("../styles/AppColors");
47
47
  const styles_1 = __importDefault(require("../styles"));
48
- const TreeNode = react_1.default.memo(function TreeNode({ data, name, level = 0, search, forceOpen, defaultExpandDepth, }) {
49
- const [localOpen, setLocalOpen] = (0, react_1.useState)(forceOpen || level < (defaultExpandDepth ?? 1));
48
+ const TreeNode = react_1.default.memo(function TreeNode({ data, name, level = 0, search, forceOpen, defaultExpandDepth = 1, }) {
49
+ const [localOpen, setLocalOpen] = (0, react_1.useState)(() => {
50
+ if (forceOpen !== undefined) {
51
+ return forceOpen;
52
+ }
53
+ return defaultExpandDepth !== undefined ? level < defaultExpandDepth : level < 1;
54
+ });
50
55
  const open = localOpen;
56
+ (0, react_1.useEffect)(() => {
57
+ if (forceOpen !== undefined) {
58
+ setLocalOpen(forceOpen);
59
+ }
60
+ }, [forceOpen]);
51
61
  const isObject = typeof data === 'object' && data !== null;
52
62
  const isArray = Array.isArray(data);
53
63
  // Declare all hooks at the top unconditionally (prevents "Rendered fewer hooks than expected" error)
@@ -12,12 +12,12 @@ exports.STATUS_FILTERS = [
12
12
  'Failed',
13
13
  ];
14
14
  exports.METHOD_COLORS = {
15
- ALL: AppColors_1.AppColors.grayText,
16
- GET: AppColors_1.AppColors.purple,
17
- POST: AppColors_1.AppColors.greenColor,
18
- PUT: AppColors_1.AppColors.lightOrange,
19
- PATCH: AppColors_1.AppColors.offerPurple,
20
- DELETE: AppColors_1.AppColors.errorColor,
15
+ ALL: '#64748B', // Slate
16
+ GET: '#059669', // Emerald
17
+ POST: '#2563EB', // Royal Blue
18
+ PUT: '#D97706', // Amber Gold
19
+ PATCH: '#7C3AED', // Rich Violet
20
+ DELETE: '#DC2626', // Crimson Red
21
21
  };
22
22
  exports.DOMAIN_COLORS = AppColors_1.AppColors.domainColors;
23
23
  exports.DURATION_FAST_MS = 200;
@@ -1 +1 @@
1
- export declare const LIB_VERSION = "1.1.28";
1
+ export declare const LIB_VERSION = "1.1.31";
@@ -3,4 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LIB_VERSION = void 0;
4
4
  // AUTO-GENERATED FILE — do not edit by hand.
5
5
  // Regenerated from package.json on every build by scripts/gen-version.js.
6
- exports.LIB_VERSION = '1.1.28';
6
+ exports.LIB_VERSION = '1.1.31';