react-native-inapp-inspector 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -6
- package/dist/commonjs/components/AnalyticsDetail.js +28 -23
- package/dist/commonjs/components/AnalyticsEventCard.js +9 -9
- package/dist/commonjs/components/BrandSquareIcon.d.ts +5 -0
- package/dist/commonjs/components/BrandSquareIcon.js +180 -0
- package/dist/commonjs/components/CodeSnippet.js +32 -24
- package/dist/commonjs/components/ConsoleLogCard.js +127 -70
- package/dist/commonjs/components/JsonViewer.d.ts +2 -1
- package/dist/commonjs/components/JsonViewer.js +2 -2
- package/dist/commonjs/components/MetaAccordion.d.ts +1 -1
- package/dist/commonjs/components/MetaAccordion.js +45 -2
- package/dist/commonjs/components/NetworkIcons.d.ts +7 -0
- package/dist/commonjs/components/NetworkIcons.js +42 -1
- package/dist/commonjs/components/ReduxTreeView.d.ts +6 -0
- package/dist/commonjs/components/ReduxTreeView.js +403 -0
- package/dist/commonjs/components/TouchableScale.js +15 -1
- package/dist/commonjs/components/TreeNode.js +3 -3
- package/dist/commonjs/customHooks/reduxLogger.d.ts +4 -0
- package/dist/commonjs/customHooks/reduxLogger.js +48 -2
- package/dist/commonjs/index.js +1520 -504
- package/dist/commonjs/styles/index.d.ts +11 -1
- package/dist/commonjs/styles/index.js +19 -9
- package/dist/commonjs/types/index.d.ts +4 -0
- package/dist/esm/components/AnalyticsDetail.js +28 -23
- package/dist/esm/components/AnalyticsEventCard.js +9 -9
- package/dist/esm/components/BrandSquareIcon.d.ts +5 -0
- package/dist/esm/components/BrandSquareIcon.js +140 -0
- package/dist/esm/components/CodeSnippet.js +32 -24
- package/dist/esm/components/ConsoleLogCard.js +127 -70
- package/dist/esm/components/JsonViewer.d.ts +2 -1
- package/dist/esm/components/JsonViewer.js +2 -2
- package/dist/esm/components/MetaAccordion.d.ts +1 -1
- package/dist/esm/components/MetaAccordion.js +46 -3
- package/dist/esm/components/NetworkIcons.d.ts +7 -0
- package/dist/esm/components/NetworkIcons.js +34 -0
- package/dist/esm/components/ReduxTreeView.d.ts +6 -0
- package/dist/esm/components/ReduxTreeView.js +366 -0
- package/dist/esm/components/TouchableScale.js +16 -2
- package/dist/esm/components/TreeNode.js +3 -3
- package/dist/esm/customHooks/reduxLogger.d.ts +4 -0
- package/dist/esm/customHooks/reduxLogger.js +43 -1
- package/dist/esm/index.js +1523 -507
- package/dist/esm/styles/index.d.ts +11 -1
- package/dist/esm/styles/index.js +19 -9
- package/dist/esm/types/index.d.ts +4 -0
- package/example/App.tsx +46 -0
- package/package.json +7 -5
|
@@ -0,0 +1,403 @@
|
|
|
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
|
+
exports.ReduxTreeView = void 0;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
const react_native_1 = require("react-native");
|
|
39
|
+
const AppColors_1 = require("../styles/AppColors");
|
|
40
|
+
const AppFonts_1 = require("../styles/AppFonts");
|
|
41
|
+
const NetworkIcons_1 = require("./NetworkIcons");
|
|
42
|
+
const react_native_svg_1 = __importStar(require("react-native-svg"));
|
|
43
|
+
// Custom icons
|
|
44
|
+
const DatabaseIcon = ({ color = AppColors_1.AppColors.grayTextWeak, size = 12 }) => (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
45
|
+
<react_native_svg_1.Path d="M12 2C6.5 2 2 4.2 2 7v10c0 2.8 4.5 5 10 5s10-2.2 10-5V7c0-2.8-4.5-5-10-5z" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
46
|
+
<react_native_svg_1.Path d="M2 12c0 2.8 4.5 5 10 5s10-2.2 10-5" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
47
|
+
<react_native_svg_1.Path d="M2 7c0 2.8 4.5 5 10 5s10-2.2 10-5" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
48
|
+
</react_native_svg_1.default>);
|
|
49
|
+
const BoltIcon = ({ color = AppColors_1.AppColors.grayTextWeak, size = 12 }) => (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
50
|
+
<react_native_svg_1.Path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z" fill={color} stroke={color} strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
|
|
51
|
+
</react_native_svg_1.default>);
|
|
52
|
+
const FolderIcon = ({ color = AppColors_1.AppColors.grayTextWeak, size = 12 }) => (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
53
|
+
<react_native_svg_1.Path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
54
|
+
</react_native_svg_1.default>);
|
|
55
|
+
const ReduxValueNode = ({ name, value, level, search }) => {
|
|
56
|
+
const [expanded, setExpanded] = (0, react_1.useState)(level < 1);
|
|
57
|
+
const isObject = typeof value === 'object' && value !== null;
|
|
58
|
+
const isArray = Array.isArray(value);
|
|
59
|
+
const nameStr = String(name);
|
|
60
|
+
// Filter check if search query matches key or value
|
|
61
|
+
const matchesSearch = (k, val) => {
|
|
62
|
+
if (!search)
|
|
63
|
+
return true;
|
|
64
|
+
const s = search.toLowerCase();
|
|
65
|
+
if (k.toLowerCase().includes(s))
|
|
66
|
+
return true;
|
|
67
|
+
if (typeof val !== 'object' && String(val).toLowerCase().includes(s))
|
|
68
|
+
return true;
|
|
69
|
+
if (typeof val === 'object' && val !== null) {
|
|
70
|
+
return Object.keys(val).some(key => matchesSearch(key, val[key]));
|
|
71
|
+
}
|
|
72
|
+
return false;
|
|
73
|
+
};
|
|
74
|
+
if (!matchesSearch(nameStr, value)) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
if (!isObject) {
|
|
78
|
+
const valStr = value === null ? 'null' : value === undefined ? 'undefined' : String(value);
|
|
79
|
+
// Pick different colors for primitives
|
|
80
|
+
let valColor = '#0D9488'; // String
|
|
81
|
+
if (value === null || value === undefined) {
|
|
82
|
+
valColor = AppColors_1.AppColors.grayTextWeak;
|
|
83
|
+
}
|
|
84
|
+
else if (typeof value === 'number') {
|
|
85
|
+
valColor = '#D97706';
|
|
86
|
+
}
|
|
87
|
+
else if (typeof value === 'boolean') {
|
|
88
|
+
valColor = '#4F46E5';
|
|
89
|
+
}
|
|
90
|
+
return (<react_native_1.View style={[reduxValueStyles.treeRow, { paddingLeft: 12 }]}>
|
|
91
|
+
<react_native_1.View style={reduxValueStyles.treeLeafConnector}/>
|
|
92
|
+
<react_native_1.Text style={reduxValueStyles.keyText} selectable={true}>
|
|
93
|
+
{nameStr}
|
|
94
|
+
<react_native_1.Text style={reduxValueStyles.colonText}>: </react_native_1.Text>
|
|
95
|
+
<react_native_1.Text style={[reduxValueStyles.valText, { color: valColor }]} selectable={true}>
|
|
96
|
+
{valStr}
|
|
97
|
+
</react_native_1.Text>
|
|
98
|
+
</react_native_1.Text>
|
|
99
|
+
</react_native_1.View>);
|
|
100
|
+
}
|
|
101
|
+
const keys = Object.keys(value);
|
|
102
|
+
const summaryText = isArray ? `Array [${keys.length}]` : `Object {${keys.length}}`;
|
|
103
|
+
return (<react_native_1.View style={reduxValueStyles.treeNodeBlock}>
|
|
104
|
+
<react_native_1.Pressable onPress={() => setExpanded(!expanded)} style={reduxValueStyles.treeRow}>
|
|
105
|
+
<react_native_1.View style={reduxValueStyles.treeLeafConnector}/>
|
|
106
|
+
<react_native_1.View style={[reduxValueStyles.chevronWrap, { transform: [{ rotate: expanded ? '90deg' : '0deg' }] }]}>
|
|
107
|
+
<NetworkIcons_1.ChevronIcon color={AppColors_1.AppColors.grayTextWeak} size={10}/>
|
|
108
|
+
</react_native_1.View>
|
|
109
|
+
<react_native_1.Text style={reduxValueStyles.keyText} selectable={true}>
|
|
110
|
+
{nameStr}
|
|
111
|
+
<react_native_1.Text style={reduxValueStyles.colonText}>: </react_native_1.Text>
|
|
112
|
+
<react_native_1.Text style={reduxValueStyles.summaryText}>{summaryText}</react_native_1.Text>
|
|
113
|
+
</react_native_1.Text>
|
|
114
|
+
</react_native_1.Pressable>
|
|
115
|
+
{expanded && (<react_native_1.View style={reduxValueStyles.treeChildrenContainer}>
|
|
116
|
+
{keys.map(key => (<ReduxValueNode key={key} name={key} value={value[key]} level={level + 1} search={search}/>))}
|
|
117
|
+
</react_native_1.View>)}
|
|
118
|
+
</react_native_1.View>);
|
|
119
|
+
};
|
|
120
|
+
const ReduxTreeView = ({ state, lastActionMap, search, }) => {
|
|
121
|
+
const [storeExpanded, setStoreExpanded] = (0, react_1.useState)(true);
|
|
122
|
+
const [reducerExpanded, setReducerExpanded] = (0, react_1.useState)({});
|
|
123
|
+
if (!state || typeof state !== 'object') {
|
|
124
|
+
return (<react_native_1.Text style={{ fontFamily: AppFonts_1.AppFonts.interRegular, fontSize: 12, color: AppColors_1.AppColors.grayTextWeak, padding: 12 }}>
|
|
125
|
+
No state object to display.
|
|
126
|
+
</react_native_1.Text>);
|
|
127
|
+
}
|
|
128
|
+
const reducers = Object.keys(state);
|
|
129
|
+
const toggleReducer = (key) => {
|
|
130
|
+
setReducerExpanded(prev => ({
|
|
131
|
+
...prev,
|
|
132
|
+
[key]: !prev[key],
|
|
133
|
+
}));
|
|
134
|
+
};
|
|
135
|
+
return (<react_native_1.View style={styles.container}>
|
|
136
|
+
{/* Root Node: Store */}
|
|
137
|
+
<react_native_1.Pressable onPress={() => setStoreExpanded(!storeExpanded)} style={styles.storeHeader}>
|
|
138
|
+
<react_native_1.View style={[styles.chevronWrap, { transform: [{ rotate: storeExpanded ? '90deg' : '0deg' }] }]}>
|
|
139
|
+
<NetworkIcons_1.ChevronIcon color="#FFFFFF" size={12}/>
|
|
140
|
+
</react_native_1.View>
|
|
141
|
+
<react_native_1.Text style={styles.storeTitle}>🏪 Redux Store</react_native_1.Text>
|
|
142
|
+
<react_native_1.View style={styles.badge}>
|
|
143
|
+
<react_native_1.Text style={styles.badgeText}>{reducers.length} Reducers</react_native_1.Text>
|
|
144
|
+
</react_native_1.View>
|
|
145
|
+
</react_native_1.Pressable>
|
|
146
|
+
|
|
147
|
+
{storeExpanded && (<react_native_1.View style={styles.storeChildren}>
|
|
148
|
+
{reducers.map((reducerKey, index) => {
|
|
149
|
+
const isLastReducer = index === reducers.length - 1;
|
|
150
|
+
const isExpanded = !!reducerExpanded[reducerKey];
|
|
151
|
+
const sliceData = state[reducerKey];
|
|
152
|
+
const lastAction = lastActionMap[reducerKey];
|
|
153
|
+
return (<react_native_1.View key={reducerKey} style={styles.reducerContainer}>
|
|
154
|
+
{/* Visual Branch Line for Reducer */}
|
|
155
|
+
<react_native_1.View style={[styles.reducerVerticalLine, isLastReducer && { bottom: '50%' }]}/>
|
|
156
|
+
|
|
157
|
+
{/* Reducer Header */}
|
|
158
|
+
<react_native_1.Pressable onPress={() => toggleReducer(reducerKey)} style={styles.reducerHeader}>
|
|
159
|
+
<react_native_1.View style={styles.reducerHorizontalLine}/>
|
|
160
|
+
<react_native_1.View style={[styles.chevronWrap, { transform: [{ rotate: isExpanded ? '90deg' : '0deg' }] }]}>
|
|
161
|
+
<NetworkIcons_1.ChevronIcon color={AppColors_1.AppColors.purple} size={10}/>
|
|
162
|
+
</react_native_1.View>
|
|
163
|
+
<react_native_1.View style={styles.iconWrap}>
|
|
164
|
+
<FolderIcon color={AppColors_1.AppColors.purple} size={11}/>
|
|
165
|
+
</react_native_1.View>
|
|
166
|
+
<react_native_1.Text style={styles.reducerText}>{reducerKey}</react_native_1.Text>
|
|
167
|
+
</react_native_1.Pressable>
|
|
168
|
+
|
|
169
|
+
{isExpanded && (<react_native_1.View style={styles.reducerChildren}>
|
|
170
|
+
{/* Vertical line connecting children */}
|
|
171
|
+
<react_native_1.View style={styles.childrenVerticalLine}/>
|
|
172
|
+
|
|
173
|
+
{/* Node 1: Last Action */}
|
|
174
|
+
<react_native_1.View style={styles.childItem}>
|
|
175
|
+
<react_native_1.View style={styles.childHorizontalLine}/>
|
|
176
|
+
<react_native_1.View style={[styles.iconWrap, { backgroundColor: '#FDF2F8' }]}>
|
|
177
|
+
<BoltIcon color="#DB2777" size={11}/>
|
|
178
|
+
</react_native_1.View>
|
|
179
|
+
<react_native_1.View style={{ flex: 1 }}>
|
|
180
|
+
<react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', flexWrap: 'wrap', gap: 6 }}>
|
|
181
|
+
<react_native_1.Text style={styles.childLabel}>Last Action:</react_native_1.Text>
|
|
182
|
+
{lastAction ? (<react_native_1.View style={styles.actionTypeBadge}>
|
|
183
|
+
<react_native_1.Text style={styles.actionTypeText}>{lastAction.type}</react_native_1.Text>
|
|
184
|
+
</react_native_1.View>) : (<react_native_1.Text style={styles.noActionText}>None dispatched</react_native_1.Text>)}
|
|
185
|
+
</react_native_1.View>
|
|
186
|
+
{lastAction && (<react_native_1.Text style={styles.timestampText}>Dispatched: {lastAction.timestamp}</react_native_1.Text>)}
|
|
187
|
+
{lastAction && lastAction.payload !== null && (<react_native_1.View style={{ marginTop: 6 }}>
|
|
188
|
+
<ReduxValueNode name="payload" value={lastAction.payload} level={0} search={search}/>
|
|
189
|
+
</react_native_1.View>)}
|
|
190
|
+
</react_native_1.View>
|
|
191
|
+
</react_native_1.View>
|
|
192
|
+
|
|
193
|
+
{/* Node 2: State Data */}
|
|
194
|
+
<react_native_1.View style={styles.childItem}>
|
|
195
|
+
<react_native_1.View style={[styles.childHorizontalLine, { bottom: '50%' }]}/>
|
|
196
|
+
<react_native_1.View style={[styles.iconWrap, { backgroundColor: '#ECFDF5' }]}>
|
|
197
|
+
<DatabaseIcon color="#059669" size={11}/>
|
|
198
|
+
</react_native_1.View>
|
|
199
|
+
<react_native_1.View style={{ flex: 1 }}>
|
|
200
|
+
<react_native_1.Text style={styles.childLabel}>State Slice Data</react_native_1.Text>
|
|
201
|
+
<react_native_1.View style={{ marginTop: 6 }}>
|
|
202
|
+
<ReduxValueNode name="state" value={sliceData} level={0} search={search}/>
|
|
203
|
+
</react_native_1.View>
|
|
204
|
+
</react_native_1.View>
|
|
205
|
+
</react_native_1.View>
|
|
206
|
+
</react_native_1.View>)}
|
|
207
|
+
</react_native_1.View>);
|
|
208
|
+
})}
|
|
209
|
+
</react_native_1.View>)}
|
|
210
|
+
</react_native_1.View>);
|
|
211
|
+
};
|
|
212
|
+
exports.ReduxTreeView = ReduxTreeView;
|
|
213
|
+
const reduxValueStyles = react_native_1.StyleSheet.create({
|
|
214
|
+
treeNodeBlock: {
|
|
215
|
+
marginTop: 4,
|
|
216
|
+
},
|
|
217
|
+
treeRow: {
|
|
218
|
+
flexDirection: 'row',
|
|
219
|
+
alignItems: 'center',
|
|
220
|
+
paddingVertical: 3,
|
|
221
|
+
gap: 4,
|
|
222
|
+
position: 'relative',
|
|
223
|
+
},
|
|
224
|
+
treeLeafConnector: {
|
|
225
|
+
position: 'absolute',
|
|
226
|
+
left: -12,
|
|
227
|
+
top: '50%',
|
|
228
|
+
width: 8,
|
|
229
|
+
height: 1,
|
|
230
|
+
borderBottomWidth: 1,
|
|
231
|
+
borderBottomColor: AppColors_1.AppColors.dividerColor,
|
|
232
|
+
opacity: 0.5,
|
|
233
|
+
},
|
|
234
|
+
treeChildrenContainer: {
|
|
235
|
+
paddingLeft: 14,
|
|
236
|
+
borderLeftWidth: 1,
|
|
237
|
+
borderLeftColor: AppColors_1.AppColors.dividerColor,
|
|
238
|
+
marginLeft: 6,
|
|
239
|
+
},
|
|
240
|
+
chevronWrap: {
|
|
241
|
+
width: 10,
|
|
242
|
+
height: 10,
|
|
243
|
+
alignItems: 'center',
|
|
244
|
+
justifyContent: 'center',
|
|
245
|
+
},
|
|
246
|
+
keyText: {
|
|
247
|
+
fontFamily: AppFonts_1.AppFonts.interMedium,
|
|
248
|
+
fontSize: 11.5,
|
|
249
|
+
color: AppColors_1.AppColors.grayTextStrong,
|
|
250
|
+
},
|
|
251
|
+
colonText: {
|
|
252
|
+
color: AppColors_1.AppColors.grayTextWeak,
|
|
253
|
+
},
|
|
254
|
+
valText: {
|
|
255
|
+
fontFamily: AppFonts_1.AppFonts.interRegular,
|
|
256
|
+
fontSize: 11.5,
|
|
257
|
+
},
|
|
258
|
+
summaryText: {
|
|
259
|
+
fontFamily: AppFonts_1.AppFonts.interRegular,
|
|
260
|
+
fontSize: 11,
|
|
261
|
+
color: AppColors_1.AppColors.grayTextWeak,
|
|
262
|
+
},
|
|
263
|
+
});
|
|
264
|
+
const styles = react_native_1.StyleSheet.create({
|
|
265
|
+
container: {
|
|
266
|
+
flex: 1,
|
|
267
|
+
},
|
|
268
|
+
storeHeader: {
|
|
269
|
+
flexDirection: 'row',
|
|
270
|
+
alignItems: 'center',
|
|
271
|
+
backgroundColor: AppColors_1.AppColors.purple,
|
|
272
|
+
borderRadius: 8,
|
|
273
|
+
paddingVertical: 10,
|
|
274
|
+
paddingHorizontal: 12,
|
|
275
|
+
gap: 8,
|
|
276
|
+
},
|
|
277
|
+
chevronWrap: {
|
|
278
|
+
width: 12,
|
|
279
|
+
height: 12,
|
|
280
|
+
alignItems: 'center',
|
|
281
|
+
justifyContent: 'center',
|
|
282
|
+
},
|
|
283
|
+
storeTitle: {
|
|
284
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
285
|
+
fontSize: 14,
|
|
286
|
+
color: '#FFFFFF',
|
|
287
|
+
},
|
|
288
|
+
badge: {
|
|
289
|
+
backgroundColor: 'rgba(255,255,255,0.2)',
|
|
290
|
+
paddingHorizontal: 8,
|
|
291
|
+
paddingVertical: 2,
|
|
292
|
+
borderRadius: 12,
|
|
293
|
+
marginLeft: 'auto',
|
|
294
|
+
},
|
|
295
|
+
badgeText: {
|
|
296
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
297
|
+
fontSize: 10,
|
|
298
|
+
color: '#FFFFFF',
|
|
299
|
+
},
|
|
300
|
+
storeChildren: {
|
|
301
|
+
paddingLeft: 12,
|
|
302
|
+
marginTop: 4,
|
|
303
|
+
},
|
|
304
|
+
reducerContainer: {
|
|
305
|
+
position: 'relative',
|
|
306
|
+
paddingLeft: 16,
|
|
307
|
+
paddingVertical: 4,
|
|
308
|
+
},
|
|
309
|
+
reducerVerticalLine: {
|
|
310
|
+
position: 'absolute',
|
|
311
|
+
left: 0,
|
|
312
|
+
top: 0,
|
|
313
|
+
bottom: 0,
|
|
314
|
+
width: 1,
|
|
315
|
+
backgroundColor: AppColors_1.AppColors.dividerColor,
|
|
316
|
+
},
|
|
317
|
+
reducerHorizontalLine: {
|
|
318
|
+
position: 'absolute',
|
|
319
|
+
left: -16,
|
|
320
|
+
top: '50%',
|
|
321
|
+
width: 16,
|
|
322
|
+
height: 1,
|
|
323
|
+
backgroundColor: AppColors_1.AppColors.dividerColor,
|
|
324
|
+
},
|
|
325
|
+
reducerHeader: {
|
|
326
|
+
flexDirection: 'row',
|
|
327
|
+
alignItems: 'center',
|
|
328
|
+
paddingVertical: 6,
|
|
329
|
+
gap: 6,
|
|
330
|
+
},
|
|
331
|
+
iconWrap: {
|
|
332
|
+
width: 18,
|
|
333
|
+
height: 18,
|
|
334
|
+
borderRadius: 4,
|
|
335
|
+
backgroundColor: AppColors_1.AppColors.purpleShade50,
|
|
336
|
+
alignItems: 'center',
|
|
337
|
+
justifyContent: 'center',
|
|
338
|
+
},
|
|
339
|
+
reducerText: {
|
|
340
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
341
|
+
fontSize: 13,
|
|
342
|
+
color: AppColors_1.AppColors.primaryBlack,
|
|
343
|
+
},
|
|
344
|
+
reducerChildren: {
|
|
345
|
+
paddingLeft: 20,
|
|
346
|
+
position: 'relative',
|
|
347
|
+
marginTop: 4,
|
|
348
|
+
gap: 10,
|
|
349
|
+
},
|
|
350
|
+
childrenVerticalLine: {
|
|
351
|
+
position: 'absolute',
|
|
352
|
+
left: 8,
|
|
353
|
+
top: 0,
|
|
354
|
+
bottom: 16,
|
|
355
|
+
width: 1,
|
|
356
|
+
backgroundColor: AppColors_1.AppColors.dividerColor,
|
|
357
|
+
},
|
|
358
|
+
childItem: {
|
|
359
|
+
flexDirection: 'row',
|
|
360
|
+
alignItems: 'flex-start',
|
|
361
|
+
gap: 8,
|
|
362
|
+
position: 'relative',
|
|
363
|
+
paddingLeft: 12,
|
|
364
|
+
},
|
|
365
|
+
childHorizontalLine: {
|
|
366
|
+
position: 'absolute',
|
|
367
|
+
left: -12,
|
|
368
|
+
top: 10,
|
|
369
|
+
width: 12,
|
|
370
|
+
height: 1,
|
|
371
|
+
backgroundColor: AppColors_1.AppColors.dividerColor,
|
|
372
|
+
},
|
|
373
|
+
childLabel: {
|
|
374
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
375
|
+
fontSize: 11.5,
|
|
376
|
+
color: AppColors_1.AppColors.grayText,
|
|
377
|
+
marginTop: 2,
|
|
378
|
+
},
|
|
379
|
+
actionTypeBadge: {
|
|
380
|
+
backgroundColor: '#FCE7F3',
|
|
381
|
+
borderColor: '#FBCFE8',
|
|
382
|
+
borderWidth: 1,
|
|
383
|
+
borderRadius: 6,
|
|
384
|
+
paddingHorizontal: 6,
|
|
385
|
+
paddingVertical: 2,
|
|
386
|
+
},
|
|
387
|
+
actionTypeText: {
|
|
388
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
389
|
+
fontSize: 10.5,
|
|
390
|
+
color: '#BE185D',
|
|
391
|
+
},
|
|
392
|
+
noActionText: {
|
|
393
|
+
fontFamily: AppFonts_1.AppFonts.interRegular,
|
|
394
|
+
fontSize: 11,
|
|
395
|
+
color: AppColors_1.AppColors.grayTextWeak,
|
|
396
|
+
},
|
|
397
|
+
timestampText: {
|
|
398
|
+
fontFamily: AppFonts_1.AppFonts.interRegular,
|
|
399
|
+
fontSize: 9.5,
|
|
400
|
+
color: AppColors_1.AppColors.grayTextWeak,
|
|
401
|
+
marginTop: 2,
|
|
402
|
+
},
|
|
403
|
+
});
|
|
@@ -37,8 +37,22 @@ const react_1 = __importStar(require("react"));
|
|
|
37
37
|
const react_native_1 = require("react-native");
|
|
38
38
|
const TouchableScale = ({ onPress, style, children, hitSlop, disabled, }) => {
|
|
39
39
|
const scale = (0, react_1.useRef)(new react_native_1.Animated.Value(1)).current;
|
|
40
|
+
const flattenedStyle = react_native_1.StyleSheet.flatten(style) || {};
|
|
41
|
+
const layoutStyle = {
|
|
42
|
+
flex: flattenedStyle.flex,
|
|
43
|
+
flexDirection: flattenedStyle.flexDirection,
|
|
44
|
+
alignItems: flattenedStyle.alignItems,
|
|
45
|
+
justifyContent: flattenedStyle.justifyContent,
|
|
46
|
+
flexWrap: flattenedStyle.flexWrap,
|
|
47
|
+
alignSelf: flattenedStyle.alignSelf,
|
|
48
|
+
flexGrow: flattenedStyle.flexGrow,
|
|
49
|
+
flexShrink: flattenedStyle.flexShrink,
|
|
50
|
+
gap: flattenedStyle.gap,
|
|
51
|
+
};
|
|
40
52
|
return (<react_native_1.Pressable disabled={disabled} style={style} onPressIn={() => react_native_1.Animated.spring(scale, { toValue: 0.94, useNativeDriver: true }).start()} onPressOut={() => react_native_1.Animated.spring(scale, { toValue: 1, useNativeDriver: true }).start()} onPress={onPress} hitSlop={hitSlop}>
|
|
41
|
-
<react_native_1.Animated.View style={{ transform: [{ scale }] }}>
|
|
53
|
+
<react_native_1.Animated.View style={[{ transform: [{ scale }] }, layoutStyle]}>
|
|
54
|
+
{children}
|
|
55
|
+
</react_native_1.Animated.View>
|
|
42
56
|
</react_native_1.Pressable>);
|
|
43
57
|
};
|
|
44
58
|
exports.default = TouchableScale;
|
|
@@ -45,8 +45,8 @@ 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, }) {
|
|
49
|
-
const [localOpen, setLocalOpen] = (0, react_1.useState)(level < 1);
|
|
48
|
+
const TreeNode = react_1.default.memo(function TreeNode({ data, name, level = 0, search, forceOpen, defaultExpandDepth, }) {
|
|
49
|
+
const [localOpen, setLocalOpen] = (0, react_1.useState)(level < (defaultExpandDepth ?? 1));
|
|
50
50
|
const open = forceOpen !== undefined ? forceOpen : localOpen;
|
|
51
51
|
const isObject = typeof data === 'object' && data !== null;
|
|
52
52
|
const isArray = Array.isArray(data);
|
|
@@ -132,7 +132,7 @@ const TreeNode = react_1.default.memo(function TreeNode({ data, name, level = 0,
|
|
|
132
132
|
</react_native_1.Pressable>
|
|
133
133
|
|
|
134
134
|
{open &&
|
|
135
|
-
entries.map(([k, v]) => (<TreeNode key={String(k)} name={k} data={v} level={level + 1} search={search} forceOpen={forceOpen}/>))}
|
|
135
|
+
entries.map(([k, v]) => (<TreeNode key={String(k)} name={k} data={v} level={level + 1} search={search} forceOpen={forceOpen} defaultExpandDepth={defaultExpandDepth}/>))}
|
|
136
136
|
|
|
137
137
|
{open && <react_native_1.Text style={styles_1.default.codeSyntax}>{isArray ? ']' : '}'}</react_native_1.Text>}
|
|
138
138
|
</react_native_1.View>);
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export declare const getReduxState: () => any;
|
|
2
|
+
export declare const setReduxAutoRefresh: (val: boolean) => void;
|
|
3
|
+
export declare const getReduxAutoRefresh: () => boolean;
|
|
4
|
+
export declare const getLastActionForReducer: () => Record<string, any>;
|
|
5
|
+
export declare const clearLastActionForReducer: () => void;
|
|
2
6
|
export declare const setReduxState: (state: any) => void;
|
|
3
7
|
export declare const subscribeReduxState: (cb: () => void) => () => void;
|
|
4
8
|
export declare const connectReduxStore: (store: any) => void;
|
|
@@ -1,10 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.connectReduxStore = exports.subscribeReduxState = exports.setReduxState = exports.getReduxState = void 0;
|
|
3
|
+
exports.connectReduxStore = exports.subscribeReduxState = exports.setReduxState = exports.clearLastActionForReducer = exports.getLastActionForReducer = exports.getReduxAutoRefresh = exports.setReduxAutoRefresh = exports.getReduxState = void 0;
|
|
4
4
|
let currentReduxState = null;
|
|
5
5
|
const listeners = new Set();
|
|
6
|
+
let globalReduxAutoRefresh = true;
|
|
7
|
+
let lastActionForReducer = {};
|
|
6
8
|
const getReduxState = () => currentReduxState;
|
|
7
9
|
exports.getReduxState = getReduxState;
|
|
10
|
+
const setReduxAutoRefresh = (val) => {
|
|
11
|
+
globalReduxAutoRefresh = val;
|
|
12
|
+
};
|
|
13
|
+
exports.setReduxAutoRefresh = setReduxAutoRefresh;
|
|
14
|
+
const getReduxAutoRefresh = () => globalReduxAutoRefresh;
|
|
15
|
+
exports.getReduxAutoRefresh = getReduxAutoRefresh;
|
|
16
|
+
const getLastActionForReducer = () => lastActionForReducer;
|
|
17
|
+
exports.getLastActionForReducer = getLastActionForReducer;
|
|
18
|
+
const clearLastActionForReducer = () => {
|
|
19
|
+
lastActionForReducer = {};
|
|
20
|
+
listeners.forEach(cb => cb());
|
|
21
|
+
};
|
|
22
|
+
exports.clearLastActionForReducer = clearLastActionForReducer;
|
|
8
23
|
const setReduxState = (state) => {
|
|
9
24
|
currentReduxState = state;
|
|
10
25
|
listeners.forEach(cb => cb());
|
|
@@ -22,9 +37,40 @@ const connectReduxStore = (store) => {
|
|
|
22
37
|
console.warn('[NetworkInspector] Invalid Redux store passed to connectReduxStore.');
|
|
23
38
|
return;
|
|
24
39
|
}
|
|
40
|
+
// Intercept dispatch calls to log actions and tie them to modified state slices
|
|
41
|
+
const originalDispatch = store.dispatch.bind(store);
|
|
42
|
+
store.dispatch = (action) => {
|
|
43
|
+
const prevState = store.getState();
|
|
44
|
+
const result = originalDispatch(action);
|
|
45
|
+
const nextState = store.getState();
|
|
46
|
+
// Map the dispatched action to state slices that actually changed
|
|
47
|
+
if (prevState &&
|
|
48
|
+
nextState &&
|
|
49
|
+
typeof prevState === 'object' &&
|
|
50
|
+
typeof nextState === 'object' &&
|
|
51
|
+
action &&
|
|
52
|
+
typeof action === 'object') {
|
|
53
|
+
Object.keys(nextState).forEach(key => {
|
|
54
|
+
if (prevState[key] !== nextState[key]) {
|
|
55
|
+
lastActionForReducer[key] = {
|
|
56
|
+
type: action.type || 'UNKNOWN_ACTION',
|
|
57
|
+
payload: action.payload !== undefined ? action.payload : null,
|
|
58
|
+
timestamp: new Date().toLocaleTimeString(),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
if (globalReduxAutoRefresh) {
|
|
64
|
+
(0, exports.setReduxState)(nextState);
|
|
65
|
+
}
|
|
66
|
+
return result;
|
|
67
|
+
};
|
|
25
68
|
(0, exports.setReduxState)(store.getState());
|
|
69
|
+
// Listen to subscription for devtools updates or any other state changes
|
|
26
70
|
store.subscribe(() => {
|
|
27
|
-
|
|
71
|
+
if (globalReduxAutoRefresh) {
|
|
72
|
+
(0, exports.setReduxState)(store.getState());
|
|
73
|
+
}
|
|
28
74
|
});
|
|
29
75
|
};
|
|
30
76
|
exports.connectReduxStore = connectReduxStore;
|