react-native-inapp-inspector 1.1.11 → 1.1.13

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 (53) hide show
  1. package/dist/commonjs/components/AnalyticsDetail.js +93 -479
  2. package/dist/commonjs/components/AnalyticsEventCard.js +25 -25
  3. package/dist/commonjs/components/ConsoleLogCard.js +3 -1
  4. package/dist/commonjs/components/HighlightText.js +1 -1
  5. package/dist/commonjs/components/JsonViewer.d.ts +3 -1
  6. package/dist/commonjs/components/JsonViewer.js +327 -9
  7. package/dist/commonjs/components/MetaAccordion.d.ts +10 -1
  8. package/dist/commonjs/components/MetaAccordion.js +121 -24
  9. package/dist/commonjs/components/NetworkIcons.d.ts +1 -0
  10. package/dist/commonjs/components/NetworkIcons.js +8 -1
  11. package/dist/commonjs/components/ReduxTreeView.d.ts +12 -17
  12. package/dist/commonjs/components/ReduxTreeView.js +1045 -632
  13. package/dist/commonjs/components/SectionHeader.d.ts +1 -1
  14. package/dist/commonjs/components/SectionHeader.js +7 -1
  15. package/dist/commonjs/components/TouchableScale.js +8 -0
  16. package/dist/commonjs/constants/version.d.ts +1 -1
  17. package/dist/commonjs/constants/version.js +1 -1
  18. package/dist/commonjs/customHooks/reduxLogger.d.ts +2 -0
  19. package/dist/commonjs/customHooks/reduxLogger.js +2 -0
  20. package/dist/commonjs/helpers/index.d.ts +3 -0
  21. package/dist/commonjs/helpers/index.js +103 -1
  22. package/dist/commonjs/helpers/settingsStore.d.ts +1 -0
  23. package/dist/commonjs/helpers/settingsStore.js +4 -0
  24. package/dist/commonjs/index.js +385 -339
  25. package/dist/commonjs/types/index.d.ts +3 -0
  26. package/dist/esm/components/AnalyticsDetail.js +94 -480
  27. package/dist/esm/components/AnalyticsEventCard.js +25 -25
  28. package/dist/esm/components/ConsoleLogCard.js +3 -1
  29. package/dist/esm/components/HighlightText.js +3 -3
  30. package/dist/esm/components/JsonViewer.d.ts +3 -1
  31. package/dist/esm/components/JsonViewer.js +295 -10
  32. package/dist/esm/components/MetaAccordion.d.ts +10 -1
  33. package/dist/esm/components/MetaAccordion.js +90 -26
  34. package/dist/esm/components/NetworkIcons.d.ts +1 -0
  35. package/dist/esm/components/NetworkIcons.js +6 -0
  36. package/dist/esm/components/ReduxTreeView.d.ts +12 -17
  37. package/dist/esm/components/ReduxTreeView.js +1047 -629
  38. package/dist/esm/components/SectionHeader.d.ts +1 -1
  39. package/dist/esm/components/SectionHeader.js +8 -2
  40. package/dist/esm/components/TouchableScale.js +9 -1
  41. package/dist/esm/constants/version.d.ts +1 -1
  42. package/dist/esm/constants/version.js +1 -1
  43. package/dist/esm/customHooks/reduxLogger.d.ts +2 -0
  44. package/dist/esm/customHooks/reduxLogger.js +2 -0
  45. package/dist/esm/helpers/index.d.ts +3 -0
  46. package/dist/esm/helpers/index.js +100 -1
  47. package/dist/esm/helpers/settingsStore.d.ts +1 -0
  48. package/dist/esm/helpers/settingsStore.js +3 -0
  49. package/dist/esm/index.js +389 -343
  50. package/dist/esm/types/index.d.ts +3 -0
  51. package/example/package-lock.json +33 -74
  52. package/example/package.json +1 -1
  53. package/package.json +1 -1
@@ -254,7 +254,9 @@ exports.ConsoleLogCard = react_1.default.memo(function ConsoleLogCard({ item, se
254
254
  }).start();
255
255
  }, [chevronAnim, expanded]);
256
256
  const toggleExpanded = () => {
257
- react_native_1.LayoutAnimation.configureNext(react_native_1.LayoutAnimation.Presets.easeInEaseOut);
257
+ if (react_native_1.Platform.OS === 'ios') {
258
+ react_native_1.LayoutAnimation.configureNext(react_native_1.LayoutAnimation.Presets.easeInEaseOut);
259
+ }
258
260
  setExpanded(prev => !prev);
259
261
  };
260
262
  const chevronRotate = chevronAnim.interpolate({
@@ -33,7 +33,7 @@ const HighlightText = ({ text, search, style, highlightStyle, detectLinks, ...re
33
33
  color: '#007AFF', // skyBlue link color
34
34
  textDecorationLine: 'underline',
35
35
  }} onPress={() => {
36
- react_native_1.Linking.openURL(part).catch(() => { });
36
+ (0, helpers_1.handleOpenExternalLink)(part);
37
37
  }}>
38
38
  {part}
39
39
  </react_native_1.Text>);
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
- declare const JsonViewer: ({ data, search, forceOpen, defaultExpandDepth, wrap, }: {
2
+ declare const JsonViewer: ({ data, search, forceOpen, defaultExpandDepth, wrap, fullHeight, onModeChange, }: {
3
3
  data: unknown;
4
4
  search?: string;
5
5
  forceOpen?: boolean;
6
6
  defaultExpandDepth?: number;
7
7
  wrap?: boolean;
8
+ fullHeight?: boolean;
9
+ onModeChange?: (mode: "pretty" | "raw" | "table") => void;
8
10
  }) => React.JSX.Element;
9
11
  export default JsonViewer;
@@ -1,21 +1,339 @@
1
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
+ })();
2
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
37
  };
5
38
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const react_1 = __importDefault(require("react"));
39
+ const react_1 = __importStar(require("react"));
7
40
  const react_native_1 = require("react-native");
41
+ const react_native_svg_1 = __importStar(require("react-native-svg"));
8
42
  // Components
9
43
  const TreeNode_1 = __importDefault(require("./TreeNode"));
10
- // Stylesheet
44
+ const TouchableScale_1 = __importDefault(require("./TouchableScale"));
45
+ // Helpers
46
+ const helpers_1 = require("../helpers");
47
+ // Styles
48
+ const AppColors_1 = require("../styles/AppColors");
49
+ const AppFonts_1 = require("../styles/AppFonts");
11
50
  const styles_1 = __importDefault(require("../styles"));
12
- const JsonViewer = ({ data, search, forceOpen, defaultExpandDepth, wrap, }) => {
13
- const tree = (<TreeNode_1.default data={data} search={search} forceOpen={forceOpen} defaultExpandDepth={defaultExpandDepth}/>);
14
- if (wrap) {
15
- return <react_native_1.View style={[styles_1.default.codeBlock, { width: '100%' }]}>{tree}</react_native_1.View>;
51
+ // ── Tab Icons ────────────────────────────────────────────────────────────────
52
+ const PrettyIcon = ({ color = '#94A3B8', size = 12 }) => (<react_native_svg_1.default width={size} height={size} viewBox="0 0 16 16" fill="none">
53
+ <react_native_svg_1.Path d="M5 3C3.9 3 3 3.9 3 5v1.5c0 .8-.7 1.5-1.5 1.5S0 7.3 0 6.5V5c0-2.8 2.2-5 5-5 .6 0 1 .4 1 1s-.4 1-1 1zm6 0c-1.1 0-2 .9-2 2v1.5c0 .8-.7 1.5-1.5 1.5S6 9.3 6 8.5V5c0-2.8 2.2-5 5-5 .6 0 1 .4 1 1s-.4 1-1 1z" fill={color} opacity={0.9}/>
54
+ <react_native_svg_1.Path d="M3 11v1.5c0 .8.7 1.5 1.5 1.5S6 13.3 6 12.5V11H3zm7 0v1.5c0 .8.7 1.5 1.5 1.5S13 13.3 13 12.5V11H10z" fill={color} opacity={0.6}/>
55
+ </react_native_svg_1.default>);
56
+ const RawIcon = ({ color = '#94A3B8', size = 12 }) => (<react_native_svg_1.default width={size} height={size} viewBox="0 0 16 16" fill="none">
57
+ <react_native_svg_1.Rect x="1" y="2" width="10" height="1.5" rx="0.75" fill={color} opacity={0.9}/>
58
+ <react_native_svg_1.Rect x="1" y="5.5" width="14" height="1.5" rx="0.75" fill={color} opacity={0.6}/>
59
+ <react_native_svg_1.Rect x="1" y="9" width="8" height="1.5" rx="0.75" fill={color} opacity={0.45}/>
60
+ <react_native_svg_1.Rect x="1" y="12.5" width="12" height="1.5" rx="0.75" fill={color} opacity={0.3}/>
61
+ </react_native_svg_1.default>);
62
+ const TableIcon = ({ color = '#94A3B8', size = 12 }) => (<react_native_svg_1.default width={size} height={size} viewBox="0 0 16 16" fill="none">
63
+ <react_native_svg_1.Rect x="1" y="1" width="14" height="14" rx="2" stroke={color} strokeWidth={1.2} opacity={0.7}/>
64
+ <react_native_svg_1.Path d="M1 5.5h14M1 10h14M5.5 1v14M10.5 1v14" stroke={color} strokeWidth={0.8} opacity={0.5}/>
65
+ </react_native_svg_1.default>);
66
+ // ── JsonViewer Component ─────────────────────────────────────────────────────
67
+ const JsonViewer = ({ data, search, forceOpen, defaultExpandDepth, wrap, fullHeight = false, onModeChange, }) => {
68
+ const [mode, setMode] = (0, react_1.useState)('pretty');
69
+ (0, react_1.useEffect)(() => {
70
+ onModeChange?.(mode);
71
+ }, [mode, onModeChange]);
72
+ // Determine type and size details
73
+ const isObject = typeof data === 'object' && data !== null;
74
+ const isArray = Array.isArray(data);
75
+ let typeLabel = typeof data;
76
+ let countLabel = '';
77
+ if (data === null) {
78
+ typeLabel = 'null';
79
+ }
80
+ else if (isArray) {
81
+ typeLabel = 'array';
82
+ countLabel = `${data.length} items`;
16
83
  }
17
- return (<react_native_1.ScrollView horizontal showsHorizontalScrollIndicator={true} style={styles_1.default.codeBlockScroll}>
18
- <react_native_1.View style={styles_1.default.codeBlock}>{tree}</react_native_1.View>
19
- </react_native_1.ScrollView>);
84
+ else if (isObject) {
85
+ typeLabel = 'object';
86
+ countLabel = `${Object.keys(data).length} keys`;
87
+ }
88
+ // Copy helper
89
+ const handleCopy = () => {
90
+ (0, helpers_1.copyToClipboard)(data, 'JSON data');
91
+ };
92
+ // Render Table view (Key-Value flat table for root keys)
93
+ const renderTableMode = () => {
94
+ if (!isObject) {
95
+ return (<react_native_1.View style={localStyles.tableRow}>
96
+ <react_native_1.Text style={localStyles.tableCellKey}>value</react_native_1.Text>
97
+ <react_native_1.Text style={localStyles.tableCellValue}>{String(data)}</react_native_1.Text>
98
+ </react_native_1.View>);
99
+ }
100
+ const keys = Object.keys(data);
101
+ if (keys.length === 0) {
102
+ return (<react_native_1.View style={localStyles.emptyTable}>
103
+ <react_native_1.Text style={localStyles.emptyTableText}>Empty Object</react_native_1.Text>
104
+ </react_native_1.View>);
105
+ }
106
+ return (<react_native_1.View style={localStyles.tableView}>
107
+ <react_native_1.View style={localStyles.tableHeaderRow}>
108
+ <react_native_1.Text style={[localStyles.tableHeaderCell, { flex: 2 }]}>Key</react_native_1.Text>
109
+ <react_native_1.Text style={[localStyles.tableHeaderCell, { flex: 3 }]}>Value</react_native_1.Text>
110
+ </react_native_1.View>
111
+ {keys.map((key) => {
112
+ const val = data[key];
113
+ let displayVal = '';
114
+ if (val === null) {
115
+ displayVal = 'null';
116
+ }
117
+ else if (val === undefined) {
118
+ displayVal = 'undefined';
119
+ }
120
+ else if (typeof val === 'object') {
121
+ displayVal = Array.isArray(val) ? `[Array(${val.length})]` : '{Object}';
122
+ }
123
+ else {
124
+ displayVal = String(val);
125
+ }
126
+ return (<react_native_1.View key={key} style={localStyles.tableRow}>
127
+ <react_native_1.Text style={[localStyles.tableCellKey, { flex: 2 }]}>{key}</react_native_1.Text>
128
+ <react_native_1.Text style={[localStyles.tableCellValue, { flex: 3 }]} numberOfLines={2}>
129
+ {displayVal}
130
+ </react_native_1.Text>
131
+ </react_native_1.View>);
132
+ })}
133
+ </react_native_1.View>);
134
+ };
135
+ // Tree View Content
136
+ const tree = (<TreeNode_1.default data={data} search={search} forceOpen={forceOpen} defaultExpandDepth={defaultExpandDepth}/>);
137
+ return (<react_native_1.View style={[localStyles.container, fullHeight && { flex: 1 }]}>
138
+ {/* ── Top Toolbar Bar (Postman-style) ── */}
139
+ <react_native_1.View style={localStyles.toolbar}>
140
+ {/* Left Segmented Control */}
141
+ <react_native_1.View style={localStyles.segmentedControl}>
142
+ {[
143
+ { key: 'pretty', label: 'Pretty', icon: PrettyIcon },
144
+ { key: 'raw', label: 'Raw', icon: RawIcon },
145
+ { key: 'table', label: 'Table', icon: TableIcon },
146
+ ].map(({ key, label, icon: Icon }) => (<TouchableScale_1.default key={key} onPress={() => setMode(key)} style={[
147
+ localStyles.segButton,
148
+ mode === key && localStyles.segButtonActive,
149
+ ]}>
150
+ <Icon color={mode === key ? AppColors_1.AppColors.purple : '#94A3B8'} size={12}/>
151
+ <react_native_1.Text style={[
152
+ localStyles.segText,
153
+ mode === key && localStyles.segTextActive,
154
+ ]}>
155
+ {label}
156
+ </react_native_1.Text>
157
+ </TouchableScale_1.default>))}
158
+ </react_native_1.View>
159
+
160
+ {/* Right Actions — badges & copy removed (caller provides header) */}
161
+
162
+ </react_native_1.View>
163
+
164
+ {/* ── Main View Content Area (Royal Monospace Theme) ── */}
165
+ <react_native_1.View style={[localStyles.contentWrapper, { backgroundColor: '#F8F9FB' }, fullHeight && { flex: 1, maxHeight: undefined }]}>
166
+ {mode === 'pretty' && (wrap ? (fullHeight ? (<react_native_1.ScrollView style={{ flex: 1 }} contentContainerStyle={{ flexGrow: 1 }}>
167
+ <react_native_1.View style={[styles_1.default.codeBlock, { width: '100%' }]}>{tree}</react_native_1.View>
168
+ </react_native_1.ScrollView>) : (<react_native_1.View style={[styles_1.default.codeBlock, { width: '100%' }]}>{tree}</react_native_1.View>)) : (fullHeight ? (<react_native_1.ScrollView style={{ flex: 1 }} contentContainerStyle={{ flexGrow: 1 }}>
169
+ <react_native_1.View style={styles_1.default.codeBlock}>{tree}</react_native_1.View>
170
+ </react_native_1.ScrollView>) : (<react_native_1.ScrollView horizontal showsHorizontalScrollIndicator={true} style={styles_1.default.codeBlockScroll}>
171
+ <react_native_1.View style={styles_1.default.codeBlock}>{tree}</react_native_1.View>
172
+ </react_native_1.ScrollView>)))}
173
+
174
+ {mode === 'raw' && (fullHeight ? (<react_native_1.ScrollView style={localStyles.rawScroll} contentContainerStyle={localStyles.rawContent}>
175
+ <react_native_1.Text selectable={true} style={localStyles.rawMonospaceText}>
176
+ {JSON.stringify(data, null, 2)}
177
+ </react_native_1.Text>
178
+ </react_native_1.ScrollView>) : (<react_native_1.View style={localStyles.rawContent}>
179
+ <react_native_1.Text selectable={true} style={localStyles.rawMonospaceText}>
180
+ {JSON.stringify(data, null, 2)}
181
+ </react_native_1.Text>
182
+ </react_native_1.View>))}
183
+
184
+ {mode === 'table' && (fullHeight ? (<react_native_1.ScrollView style={localStyles.rawScroll}>
185
+ {renderTableMode()}
186
+ </react_native_1.ScrollView>) : (<react_native_1.View style={localStyles.rawScroll}>
187
+ {renderTableMode()}
188
+ </react_native_1.View>))}
189
+ </react_native_1.View>
190
+ </react_native_1.View>);
20
191
  };
192
+ const localStyles = react_native_1.StyleSheet.create({
193
+ container: {
194
+ backgroundColor: '#FFFFFF',
195
+ borderRadius: 12,
196
+ borderWidth: 1.5,
197
+ borderColor: '#E2E8F0',
198
+ overflow: 'hidden',
199
+ shadowColor: '#000',
200
+ shadowOpacity: 0.04,
201
+ shadowRadius: 5,
202
+ shadowOffset: { width: 0, height: 2 },
203
+ elevation: 2,
204
+ width: '100%',
205
+ },
206
+ toolbar: {
207
+ flexDirection: 'row',
208
+ alignItems: 'center',
209
+ justifyContent: 'space-between',
210
+ backgroundColor: '#F8FAFC',
211
+ borderBottomWidth: 1,
212
+ borderBottomColor: '#E2E8F0',
213
+ paddingHorizontal: 12,
214
+ paddingVertical: 8,
215
+ },
216
+ segmentedControl: {
217
+ flexDirection: 'row',
218
+ backgroundColor: '#E2E8F0',
219
+ borderRadius: 8,
220
+ padding: 2,
221
+ },
222
+ segButton: {
223
+ flexDirection: 'row',
224
+ alignItems: 'center',
225
+ gap: 4,
226
+ paddingHorizontal: 10,
227
+ paddingVertical: 5,
228
+ borderRadius: 6,
229
+ },
230
+ segButtonActive: {
231
+ backgroundColor: '#FFFFFF',
232
+ shadowColor: '#000',
233
+ shadowOpacity: 0.08,
234
+ shadowRadius: 2,
235
+ shadowOffset: { width: 0, height: 1 },
236
+ elevation: 1,
237
+ },
238
+ segText: {
239
+ fontFamily: AppFonts_1.AppFonts.interBold,
240
+ fontSize: 9.5,
241
+ color: '#64748B',
242
+ letterSpacing: 0.3,
243
+ },
244
+ segTextActive: {
245
+ color: AppColors_1.AppColors.purple,
246
+ },
247
+ rightActions: {
248
+ flexDirection: 'row',
249
+ alignItems: 'center',
250
+ gap: 6,
251
+ },
252
+ badge: {
253
+ backgroundColor: 'rgba(104,75,155,0.06)',
254
+ borderWidth: 1,
255
+ borderColor: 'rgba(104,75,155,0.15)',
256
+ borderRadius: 5,
257
+ paddingHorizontal: 6,
258
+ paddingVertical: 2.5,
259
+ },
260
+ badgeText: {
261
+ fontFamily: AppFonts_1.AppFonts.interBold,
262
+ fontSize: 9,
263
+ color: AppColors_1.AppColors.purple,
264
+ },
265
+ copyButton: {
266
+ width: 24,
267
+ height: 24,
268
+ borderRadius: 6,
269
+ backgroundColor: 'rgba(104,75,155,0.08)',
270
+ alignItems: 'center',
271
+ justifyContent: 'center',
272
+ },
273
+ contentWrapper: {
274
+ backgroundColor: '#FFFFFF',
275
+ minHeight: 120,
276
+ maxHeight: 480,
277
+ },
278
+ rawScroll: {
279
+ flex: 1,
280
+ backgroundColor: '#FAF9F6', // Royal off-white paper tone
281
+ },
282
+ rawContent: {
283
+ padding: 12,
284
+ },
285
+ rawMonospaceText: {
286
+ fontFamily: react_native_1.Platform.OS === 'ios' ? 'Courier New' : 'monospace',
287
+ fontSize: 11.5,
288
+ color: '#0F172A',
289
+ lineHeight: 16,
290
+ },
291
+ tableView: {
292
+ flex: 1,
293
+ },
294
+ tableHeaderRow: {
295
+ flexDirection: 'row',
296
+ backgroundColor: '#F1F5F9',
297
+ borderBottomWidth: 1,
298
+ borderBottomColor: '#E2E8F0',
299
+ paddingVertical: 8,
300
+ paddingHorizontal: 12,
301
+ },
302
+ tableHeaderCell: {
303
+ fontFamily: AppFonts_1.AppFonts.interBold,
304
+ fontSize: 9.5,
305
+ color: '#475569',
306
+ letterSpacing: 0.5,
307
+ textTransform: 'uppercase',
308
+ },
309
+ tableRow: {
310
+ flexDirection: 'row',
311
+ borderBottomWidth: 1,
312
+ borderBottomColor: '#F1F5F9',
313
+ paddingVertical: 10,
314
+ paddingHorizontal: 12,
315
+ alignItems: 'center',
316
+ },
317
+ tableCellKey: {
318
+ fontFamily: react_native_1.Platform.OS === 'ios' ? 'Courier-Bold' : 'monospace',
319
+ fontSize: 11.5,
320
+ fontWeight: 'bold',
321
+ color: '#0F172A',
322
+ },
323
+ tableCellValue: {
324
+ fontFamily: react_native_1.Platform.OS === 'ios' ? 'Courier' : 'monospace',
325
+ fontSize: 11.5,
326
+ color: '#475569',
327
+ },
328
+ emptyTable: {
329
+ padding: 24,
330
+ alignItems: 'center',
331
+ justifyContent: 'center',
332
+ },
333
+ emptyTableText: {
334
+ fontFamily: AppFonts_1.AppFonts.interMedium,
335
+ fontSize: 12,
336
+ color: '#94A3B8',
337
+ },
338
+ });
21
339
  exports.default = JsonViewer;
@@ -1,4 +1,13 @@
1
1
  import React from 'react';
2
- import { MetaAccordionProps } from '../types';
2
+ export interface MetaAccordionProps {
3
+ status: number | null | undefined;
4
+ statusColor: string;
5
+ duration: number | null | undefined;
6
+ size: string;
7
+ triggeredAt: string;
8
+ method: string;
9
+ contentType?: string;
10
+ url: string;
11
+ }
3
12
  declare const MetaAccordion: ({ status, statusColor, duration, size, triggeredAt, method, contentType, url, }: MetaAccordionProps) => React.JSX.Element;
4
13
  export default MetaAccordion;
@@ -1,9 +1,42 @@
1
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
+ })();
2
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
37
  };
5
38
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const react_1 = __importDefault(require("react"));
39
+ const react_1 = __importStar(require("react"));
7
40
  const react_native_1 = require("react-native");
8
41
  // Constants
9
42
  const constants_1 = require("../constants");
@@ -13,13 +46,52 @@ const useAccordion_1 = __importDefault(require("../customHooks/useAccordion"));
13
46
  const helpers_1 = require("../helpers");
14
47
  // Assets
15
48
  const NetworkIcons_1 = require("./NetworkIcons");
49
+ // Components
50
+ const TouchableScale_1 = __importDefault(require("./TouchableScale"));
16
51
  // Stylesheet
17
52
  const AppColors_1 = require("../styles/AppColors");
18
- const styles_1 = __importDefault(require("../styles"));
19
53
  const AppFonts_1 = require("../styles/AppFonts");
54
+ const styles_1 = __importDefault(require("../styles"));
20
55
  const MetaAccordion = ({ status, statusColor, duration, size, triggeredAt, method, contentType, url, }) => {
56
+ const [urlExpanded, setUrlExpanded] = (0, react_1.useState)(false);
21
57
  const { toggleOpen, chevronStyle, bodyStyle } = (0, useAccordion_1.default)(true, 400, 390);
22
58
  const isFailed = status === 0 || status == null;
59
+ const renderFormattedUrl = (rawUrl) => {
60
+ if (!rawUrl)
61
+ return '—';
62
+ try {
63
+ const doubleSlashIndex = rawUrl.indexOf('//');
64
+ let temp = rawUrl;
65
+ let protocol = '';
66
+ if (doubleSlashIndex !== -1) {
67
+ protocol = rawUrl.substring(0, doubleSlashIndex + 2);
68
+ temp = rawUrl.substring(doubleSlashIndex + 2);
69
+ }
70
+ const slashIndex = temp.indexOf('/');
71
+ let host = temp;
72
+ let pathAndSearch = '';
73
+ if (slashIndex !== -1) {
74
+ host = temp.substring(0, slashIndex);
75
+ pathAndSearch = temp.substring(slashIndex);
76
+ }
77
+ const queryIndex = pathAndSearch.indexOf('?');
78
+ let pathname = pathAndSearch;
79
+ let search = '';
80
+ if (queryIndex !== -1) {
81
+ pathname = pathAndSearch.substring(0, queryIndex);
82
+ search = pathAndSearch.substring(queryIndex);
83
+ }
84
+ return (<react_native_1.Text style={{ lineHeight: 16 }}>
85
+ {protocol ? (<react_native_1.Text style={{ color: '#94A3B8', fontFamily: AppFonts_1.AppFonts.interRegular }}>{protocol}</react_native_1.Text>) : null}
86
+ <react_native_1.Text style={{ color: AppColors_1.AppColors.purple, fontFamily: AppFonts_1.AppFonts.interBold }}>{host}</react_native_1.Text>
87
+ <react_native_1.Text style={{ color: '#334155', fontFamily: AppFonts_1.AppFonts.interMedium }}>{pathname}</react_native_1.Text>
88
+ {search ? (<react_native_1.Text style={{ color: '#0D9488', fontFamily: AppFonts_1.AppFonts.interRegular }}>{search}</react_native_1.Text>) : null}
89
+ </react_native_1.Text>);
90
+ }
91
+ catch {
92
+ return rawUrl;
93
+ }
94
+ };
23
95
  return (<react_native_1.View style={styles_1.default.metaContainer}>
24
96
  <react_native_1.Pressable onPress={toggleOpen} hitSlop={12}>
25
97
  <react_native_1.View style={styles_1.default.metaHeader}>
@@ -145,29 +217,54 @@ const MetaAccordion = ({ status, statusColor, duration, size, triggeredAt, metho
145
217
  </react_native_1.View>
146
218
  <react_native_1.View style={styles_1.default.metaDivider}/>
147
219
 
148
- <react_native_1.View style={[styles_1.default.metaRow, { alignItems: 'flex-start' }]}>
149
- <react_native_1.View style={styles_1.default.metaLabelRow}>
150
- <NetworkIcons_1.GlobeIcon color={AppColors_1.AppColors.grayTextWeak} size={14}/>
151
- <react_native_1.Text style={styles_1.default.metaLabel}>Full URL</react_native_1.Text>
220
+ <react_native_1.View style={[styles_1.default.metaRow, { alignItems: 'flex-start', flexDirection: 'column', gap: 6 }]}>
221
+ <react_native_1.View style={{ flexDirection: 'row', justifyContent: 'space-between', width: '100%', alignItems: 'center' }}>
222
+ <react_native_1.View style={styles_1.default.metaLabelRow}>
223
+ <NetworkIcons_1.GlobeIcon color={AppColors_1.AppColors.grayTextWeak} size={14}/>
224
+ <react_native_1.Text style={styles_1.default.metaLabel}>Full URL</react_native_1.Text>
225
+ </react_native_1.View>
226
+
227
+ <react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', gap: 10 }}>
228
+ {url && url.length > 50 && (<TouchableScale_1.default onPress={() => setUrlExpanded(prev => !prev)} hitSlop={8}>
229
+ <react_native_1.Text style={{
230
+ fontFamily: AppFonts_1.AppFonts.interBold,
231
+ fontSize: 10.5,
232
+ color: AppColors_1.AppColors.purple,
233
+ }}>
234
+ {urlExpanded ? 'Show Less' : 'Show More'}
235
+ </react_native_1.Text>
236
+ </TouchableScale_1.default>)}
237
+
238
+ {url && (<TouchableScale_1.default onPress={() => (0, helpers_1.handleOpenExternalLink)(url)} hitSlop={8}>
239
+ <react_native_1.Text style={{
240
+ fontFamily: AppFonts_1.AppFonts.interBold,
241
+ fontSize: 10.5,
242
+ color: AppColors_1.AppColors.purple,
243
+ textDecorationLine: 'underline',
244
+ }}>
245
+ Open
246
+ </react_native_1.Text>
247
+ </TouchableScale_1.default>)}
248
+ </react_native_1.View>
249
+ </react_native_1.View>
250
+
251
+ <react_native_1.View style={{
252
+ backgroundColor: '#F8FAFC',
253
+ borderRadius: 8,
254
+ padding: 8,
255
+ borderWidth: 1.5,
256
+ borderColor: '#E2E8F0',
257
+ width: '100%',
258
+ marginTop: 2,
259
+ }}>
260
+ <react_native_1.Text selectable={true} numberOfLines={urlExpanded ? undefined : 2} ellipsizeMode="tail" style={{
261
+ fontSize: 11,
262
+ textAlign: 'left',
263
+ lineHeight: 16.5,
264
+ }}>
265
+ {renderFormattedUrl(url)}
266
+ </react_native_1.Text>
152
267
  </react_native_1.View>
153
- <react_native_1.Text selectable={true} numberOfLines={3} ellipsizeMode="tail" onPress={() => {
154
- if (url) {
155
- react_native_1.Linking.openURL(url).catch(() => { });
156
- }
157
- }} style={[
158
- styles_1.default.metaValue,
159
- {
160
- fontSize: 11.5,
161
- color: url ? AppColors_1.AppColors.purple : AppColors_1.AppColors.grayTextWeak,
162
- textDecorationLine: url ? 'underline' : 'none',
163
- fontFamily: AppFonts_1.AppFonts.interMedium,
164
- flex: 1,
165
- textAlign: 'right',
166
- lineHeight: 16,
167
- },
168
- ]}>
169
- {url || '—'}
170
- </react_native_1.Text>
171
268
  </react_native_1.View>
172
269
  </react_native_1.View>
173
270
  </react_native_1.Animated.View>
@@ -50,3 +50,4 @@ export declare const WarningTriangleIcon: ({ color, size, }: any) => React.JSX.E
50
50
  export declare const ErrorCircleIcon: ({ color, size, }: any) => React.JSX.Element;
51
51
  export declare const TrendingUpIcon: ({ color, size, }: any) => React.JSX.Element;
52
52
  export declare const MotionIcon: ({ color, size, }: any) => React.JSX.Element;
53
+ export declare const SortIcon: ({ ascending, color, size, }: any) => React.JSX.Element;
@@ -37,7 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.TrendingUpIcon = exports.ErrorCircleIcon = exports.WarningTriangleIcon = exports.InfoCircleIcon = exports.UserIcon = exports.LayersIcon = exports.WipeIcon = exports.FolderIcon = exports.SettingsIcon = exports.EyeIcon = exports.JsIcon = exports.CssIcon = exports.HtmlIcon = exports.BrandSquareIcon = exports.BrandCircleIcon = exports.MoonIcon = exports.SunIcon = exports.DebugIcon = exports.InsightsIcon = exports.AnalyticsIcon = exports.WhiteBackNavigation = exports.CloseWhite = exports.DownloadIcon = exports.FilterIcon = exports.ChevronIcon = exports.SortArrowIcon = exports.GlobeIcon = exports.DiffIcon = exports.SignalIcon = exports.ExportIcon = exports.HeaderPauseIcon = exports.TrashIcon = exports.FailIcon = exports.CheckIcon = exports.TerminalIcon = exports.FetchIcon = exports.CopyIcon = exports.HeadersIcon = exports.ResponseIcon = exports.RequestIcon = exports.SizeIcon = exports.StatusIcon = exports.CalendarIcon = exports.ClockIcon = exports.ClearIcon = exports.SearchIcon = exports.ExpandCollapseIcon = exports.ScreenIcon = exports.MapPinIcon = exports.EmptyRadarIcon = void 0;
40
- exports.MotionIcon = void 0;
40
+ exports.SortIcon = exports.MotionIcon = void 0;
41
41
  const react_1 = __importDefault(require("react"));
42
42
  const react_native_svg_1 = __importStar(require("react-native-svg"));
43
43
  // Stylesheet
@@ -393,3 +393,10 @@ const MotionIcon = ({ color = AppColors_1.AppColors.grayTextWeak, size = 14, })
393
393
  </react_native_svg_1.default>);
394
394
  };
395
395
  exports.MotionIcon = MotionIcon;
396
+ const SortIcon = ({ ascending, color = AppColors_1.AppColors.purple, size = 14, }) => {
397
+ return (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
398
+ <react_native_svg_1.Path d="M12 4l-6 6h12z" fill={ascending ? color : AppColors_1.AppColors.grayTextWeak}/>
399
+ <react_native_svg_1.Path d="M12 20l6-6H6z" fill={!ascending ? color : AppColors_1.AppColors.grayTextWeak}/>
400
+ </react_native_svg_1.default>);
401
+ };
402
+ exports.SortIcon = SortIcon;
@@ -1,21 +1,16 @@
1
1
  import React from 'react';
2
- export declare const ReduxStoreIcon: ({ color, size, }: any) => React.JSX.Element;
3
- export declare const ReduxBoltIcon: ({ color, size, }: any) => React.JSX.Element;
4
- export declare const ReduxTimelineIcon: ({ color, size, }: any) => React.JSX.Element;
5
- export declare const ReduxTreeIcon: ({ color, size, }: any) => React.JSX.Element;
6
- export declare const ReduxTreeView: ({ state, lastActionMap, search, }: {
2
+ export declare const ReduxTreeView: ({ state, actionHistory, lastActionMap, search, onSearchChange, autoRefresh, onToggleAutoRefresh, onClearHistory, onDetailOpenChange, selectedSliceKey, onSelectSliceKey, selectedActionId, onSelectActionId, }: {
7
3
  state: any;
8
- lastActionMap: Record<string, any>;
9
- search?: string;
10
- }) => React.JSX.Element;
11
- export declare const ReduxActionTimeline: ({ history, onClear, search, }: {
12
- history: Array<{
13
- id: number;
14
- type: string;
15
- payload: any;
16
- timestamp: string;
17
- affectedSlices: string[];
18
- }>;
19
- onClear: () => void;
4
+ actionHistory?: any[];
5
+ lastActionMap?: Record<string, any>;
20
6
  search?: string;
7
+ onSearchChange?: (val: string) => void;
8
+ autoRefresh?: boolean;
9
+ onToggleAutoRefresh?: () => void;
10
+ onClearHistory?: () => void;
11
+ onDetailOpenChange?: (isOpen: boolean) => void;
12
+ selectedSliceKey?: string | null;
13
+ onSelectSliceKey?: (key: string | null) => void;
14
+ selectedActionId?: number | null;
15
+ onSelectActionId?: (id: number | null) => void;
21
16
  }) => React.JSX.Element;