react-native-inapp-inspector 1.1.16 → 1.1.18
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 +13 -0
- package/dist/commonjs/components/AnimatedEntrance.js +3 -0
- package/dist/commonjs/components/AppHeaderLogo.d.ts +8 -0
- package/dist/commonjs/components/AppHeaderLogo.js +85 -0
- package/dist/commonjs/components/Inspector/BundleTab.d.ts +46 -0
- package/dist/commonjs/components/Inspector/BundleTab.js +2439 -0
- package/dist/commonjs/components/Inspector/InspectorHeader.js +185 -52
- package/dist/commonjs/components/Inspector/MainScreen.js +93 -7
- package/dist/commonjs/components/Inspector/PerformanceTab.d.ts +22 -0
- package/dist/commonjs/components/Inspector/PerformanceTab.js +1143 -0
- package/dist/commonjs/components/Inspector/ReduxDetail.d.ts +3 -0
- package/dist/commonjs/components/Inspector/ReduxDetail.js +576 -0
- package/dist/commonjs/components/Inspector/ReduxTab.js +433 -49
- package/dist/commonjs/components/Inspector/SettingsPanel.js +13 -2
- package/dist/commonjs/components/Inspector/TabBar.js +16 -6
- package/dist/commonjs/components/JsonViewer.js +91 -30
- package/dist/commonjs/components/LogCard.js +3 -4
- package/dist/commonjs/components/NetworkIcons.d.ts +9 -0
- package/dist/commonjs/components/NetworkIcons.js +63 -1
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/consoleLogger.js +37 -9
- package/dist/commonjs/customHooks/reduxLogger.js +4 -2
- package/dist/commonjs/helpers/index.js +6 -2
- package/dist/commonjs/index.js +18 -1
- package/dist/commonjs/styles/AppColors.js +163 -163
- package/dist/commonjs/styles/index.d.ts +14 -0
- package/dist/commonjs/styles/index.js +14 -0
- package/dist/commonjs/types/enums.d.ts +2 -2
- package/dist/commonjs/types/interfaces.d.ts +11 -0
- package/dist/esm/components/AnimatedEntrance.js +4 -1
- package/dist/esm/components/AppHeaderLogo.d.ts +8 -0
- package/dist/esm/components/AppHeaderLogo.js +45 -0
- package/dist/esm/components/Inspector/BundleTab.d.ts +46 -0
- package/dist/esm/components/Inspector/BundleTab.js +2401 -0
- package/dist/esm/components/Inspector/InspectorHeader.js +151 -51
- package/dist/esm/components/Inspector/MainScreen.js +60 -7
- package/dist/esm/components/Inspector/PerformanceTab.d.ts +22 -0
- package/dist/esm/components/Inspector/PerformanceTab.js +1105 -0
- package/dist/esm/components/Inspector/ReduxDetail.d.ts +3 -0
- package/dist/esm/components/Inspector/ReduxDetail.js +538 -0
- package/dist/esm/components/Inspector/ReduxTab.js +402 -51
- package/dist/esm/components/Inspector/SettingsPanel.js +14 -3
- package/dist/esm/components/Inspector/TabBar.js +17 -7
- package/dist/esm/components/JsonViewer.js +92 -31
- package/dist/esm/components/LogCard.js +3 -4
- package/dist/esm/components/NetworkIcons.d.ts +9 -0
- package/dist/esm/components/NetworkIcons.js +55 -1
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/consoleLogger.js +37 -9
- package/dist/esm/customHooks/reduxLogger.js +4 -2
- package/dist/esm/helpers/index.js +6 -2
- package/dist/esm/index.js +18 -1
- package/dist/esm/styles/AppColors.js +163 -163
- package/dist/esm/styles/index.d.ts +14 -0
- package/dist/esm/styles/index.js +14 -0
- package/dist/esm/types/enums.d.ts +2 -2
- package/dist/esm/types/interfaces.d.ts +11 -0
- package/example/App.tsx +5 -1
- package/example/assets/app_icon.png +0 -0
- package/example/ios/Podfile.lock +3 -3
- package/example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json +18 -9
- package/example/ios/example/Images.xcassets/AppIcon.appiconset/app_icon_1024.png +0 -0
- package/example/package-lock.json +824 -10
- package/example/package.json +6 -2
- package/package.json +4 -2
|
@@ -0,0 +1,576 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
const react_1 = __importStar(require("react"));
|
|
40
|
+
const react_native_1 = require("react-native");
|
|
41
|
+
const react_i18next_1 = require("react-i18next");
|
|
42
|
+
const InspectorContext_1 = require("./InspectorContext");
|
|
43
|
+
const SegmentedTabs_1 = __importDefault(require("../SegmentedTabs"));
|
|
44
|
+
const JsonViewer_1 = __importDefault(require("../JsonViewer"));
|
|
45
|
+
const DiffViewer_1 = __importDefault(require("../DiffViewer"));
|
|
46
|
+
const CopyButton_1 = __importDefault(require("../CopyButton"));
|
|
47
|
+
const TouchableScale_1 = __importDefault(require("../TouchableScale"));
|
|
48
|
+
const HighlightText_1 = __importDefault(require("../HighlightText"));
|
|
49
|
+
const AnimatedEntrance_1 = __importDefault(require("../AnimatedEntrance"));
|
|
50
|
+
const reduxLogger_1 = require("../../customHooks/reduxLogger");
|
|
51
|
+
const helpers_1 = require("../../helpers");
|
|
52
|
+
const settingsStore_1 = require("../../helpers/settingsStore");
|
|
53
|
+
const AppColors_1 = require("../../styles/AppColors");
|
|
54
|
+
const AppFonts_1 = require("../../styles/AppFonts");
|
|
55
|
+
const NetworkIcons_1 = require("../NetworkIcons");
|
|
56
|
+
const ReduxDetail = react_1.default.memo(() => {
|
|
57
|
+
const { t } = (0, react_i18next_1.useTranslation)();
|
|
58
|
+
const { reduxState, reduxLastActionMap, selectedReduxSlice, selectedReduxAction, setSelectedReduxSlice, setSelectedReduxAction, } = (0, InspectorContext_1.useInspector)();
|
|
59
|
+
// Search filter within details
|
|
60
|
+
const [detailSearch, setDetailSearch] = (0, react_1.useState)('');
|
|
61
|
+
// Sub-tabs for Slice
|
|
62
|
+
const [sliceTab, setSliceTab] = (0, react_1.useState)('live');
|
|
63
|
+
const [viewMode, setViewMode] = (0, react_1.useState)('pretty');
|
|
64
|
+
// Selected Action inside Timeline
|
|
65
|
+
const [expandedActionId, setExpandedActionId] = (0, react_1.useState)(null);
|
|
66
|
+
// Persistence data for active slice
|
|
67
|
+
const [isPersisted, setIsPersisted] = (0, react_1.useState)(false);
|
|
68
|
+
const [persistedData, setPersistedData] = (0, react_1.useState)(null);
|
|
69
|
+
// Fetch Action History
|
|
70
|
+
const allActionHistory = (0, react_1.useMemo)(() => {
|
|
71
|
+
return (0, reduxLogger_1.getActionHistory)();
|
|
72
|
+
}, [reduxLastActionMap]);
|
|
73
|
+
// Slices-filtered actions
|
|
74
|
+
const sliceActions = (0, react_1.useMemo)(() => {
|
|
75
|
+
if (!selectedReduxSlice)
|
|
76
|
+
return allActionHistory;
|
|
77
|
+
return allActionHistory.filter(action => {
|
|
78
|
+
if (!action.affectedSlices || action.affectedSlices.length === 0)
|
|
79
|
+
return true;
|
|
80
|
+
return action.affectedSlices.includes(selectedReduxSlice);
|
|
81
|
+
});
|
|
82
|
+
}, [allActionHistory, selectedReduxSlice]);
|
|
83
|
+
(0, react_1.useEffect)(() => {
|
|
84
|
+
if (!selectedReduxSlice)
|
|
85
|
+
return;
|
|
86
|
+
async function checkPersistence() {
|
|
87
|
+
try {
|
|
88
|
+
const storage = (0, settingsStore_1.getCustomStorage)();
|
|
89
|
+
if (!storage) {
|
|
90
|
+
setIsPersisted(false);
|
|
91
|
+
setPersistedData(null);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
let raw = await storage.getItem(`persist:${selectedReduxSlice}`);
|
|
95
|
+
if (raw) {
|
|
96
|
+
try {
|
|
97
|
+
setPersistedData(JSON.parse(raw));
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
setPersistedData(raw);
|
|
101
|
+
}
|
|
102
|
+
setIsPersisted(true);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
let rootRaw = await storage.getItem('persist:root');
|
|
106
|
+
if (rootRaw) {
|
|
107
|
+
const parsedRoot = JSON.parse(rootRaw);
|
|
108
|
+
if (parsedRoot && parsedRoot[selectedReduxSlice] !== undefined) {
|
|
109
|
+
const nested = parsedRoot[selectedReduxSlice];
|
|
110
|
+
try {
|
|
111
|
+
setPersistedData(typeof nested === 'string' ? JSON.parse(nested) : nested);
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
setPersistedData(nested);
|
|
115
|
+
}
|
|
116
|
+
setIsPersisted(true);
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
catch (e) {
|
|
122
|
+
// silent catch
|
|
123
|
+
}
|
|
124
|
+
setIsPersisted(false);
|
|
125
|
+
setPersistedData(null);
|
|
126
|
+
}
|
|
127
|
+
checkPersistence();
|
|
128
|
+
}, [selectedReduxSlice]);
|
|
129
|
+
const handleClearPersistence = () => {
|
|
130
|
+
if (!selectedReduxSlice)
|
|
131
|
+
return;
|
|
132
|
+
react_native_1.Alert.alert('Clear Persisted State', `Are you sure you want to delete persisted storage for slice "${selectedReduxSlice}"?`, [
|
|
133
|
+
{ text: 'Cancel', style: 'cancel' },
|
|
134
|
+
{
|
|
135
|
+
text: 'Delete',
|
|
136
|
+
style: 'destructive',
|
|
137
|
+
onPress: async () => {
|
|
138
|
+
try {
|
|
139
|
+
const storage = (0, settingsStore_1.getCustomStorage)();
|
|
140
|
+
if (!storage)
|
|
141
|
+
return;
|
|
142
|
+
if (typeof storage.removeItem === 'function') {
|
|
143
|
+
await storage.removeItem(`persist:${selectedReduxSlice}`);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
await storage.setItem(`persist:${selectedReduxSlice}`, '');
|
|
147
|
+
}
|
|
148
|
+
setIsPersisted(false);
|
|
149
|
+
setPersistedData(null);
|
|
150
|
+
setSliceTab('live');
|
|
151
|
+
if (react_native_1.Platform.OS === 'android') {
|
|
152
|
+
react_native_1.ToastAndroid.show('Persisted state cleared', react_native_1.ToastAndroid.SHORT);
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
react_native_1.Alert.alert('Cleared', 'Persisted state has been cleared.');
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
catch (err) {
|
|
159
|
+
react_native_1.Alert.alert('Error', 'Failed to clear persisted state.');
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
]);
|
|
164
|
+
};
|
|
165
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
166
|
+
// ── 1. RENDER SLICE DETAIL VIEW ───────────────────────────────────────────
|
|
167
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
168
|
+
if (selectedReduxSlice != null) {
|
|
169
|
+
const sliceData = reduxState?.[selectedReduxSlice];
|
|
170
|
+
const fieldsCount = sliceData && typeof sliceData === 'object'
|
|
171
|
+
? Object.keys(sliceData).length
|
|
172
|
+
: typeof sliceData !== 'undefined'
|
|
173
|
+
? 1
|
|
174
|
+
: 0;
|
|
175
|
+
const lastAction = reduxLastActionMap[selectedReduxSlice];
|
|
176
|
+
const sliceTabs = [
|
|
177
|
+
{ key: 'live', label: 'Live State', icon: () => <NetworkIcons_1.LiveStateIcon color={AppColors_1.AppColors.purple} size={11}/> },
|
|
178
|
+
{ key: 'timeline', label: `Timeline (${sliceActions.length})`, icon: () => <NetworkIcons_1.TimelineIcon color={AppColors_1.AppColors.purple} size={11}/> },
|
|
179
|
+
{ key: 'persisted', label: isPersisted ? 'Persisted' : 'Storage', icon: () => <NetworkIcons_1.StorageIcon color={AppColors_1.AppColors.purple} size={11}/> },
|
|
180
|
+
{ key: 'metadata', label: 'Metadata', icon: () => <NetworkIcons_1.MetadataIcon color={AppColors_1.AppColors.purple} size={11}/> },
|
|
181
|
+
];
|
|
182
|
+
return (<react_native_1.View style={{ flex: 1, backgroundColor: AppColors_1.AppColors.grayBackground }}>
|
|
183
|
+
{/* Info Header Bar */}
|
|
184
|
+
<react_native_1.View style={reduxDetailStyles.infoBar}>
|
|
185
|
+
<react_native_1.View style={reduxDetailStyles.infoTopRow}>
|
|
186
|
+
<react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', gap: 6, flexWrap: 'wrap', flex: 1 }}>
|
|
187
|
+
<react_native_1.View style={[reduxDetailStyles.methodBadge, { backgroundColor: AppColors_1.AppColors.purple }]}>
|
|
188
|
+
<react_native_1.Text style={reduxDetailStyles.methodBadgeText}>SLICE</react_native_1.Text>
|
|
189
|
+
</react_native_1.View>
|
|
190
|
+
<react_native_1.Text style={reduxDetailStyles.sliceNameText}>
|
|
191
|
+
{selectedReduxSlice}
|
|
192
|
+
</react_native_1.Text>
|
|
193
|
+
{isPersisted ? (<react_native_1.View style={reduxDetailStyles.persistedChip}>
|
|
194
|
+
<react_native_1.Text style={reduxDetailStyles.persistedChipText}>PERSISTED</react_native_1.Text>
|
|
195
|
+
</react_native_1.View>) : (<react_native_1.View style={reduxDetailStyles.inMemoryChip}>
|
|
196
|
+
<react_native_1.Text style={reduxDetailStyles.inMemoryChipText}>IN-MEMORY</react_native_1.Text>
|
|
197
|
+
</react_native_1.View>)}
|
|
198
|
+
{lastAction?.timestamp && (<react_native_1.View style={reduxDetailStyles.timePill}>
|
|
199
|
+
<NetworkIcons_1.ClockIcon color={AppColors_1.AppColors.purple} size={10}/>
|
|
200
|
+
<react_native_1.Text style={reduxDetailStyles.timeText}>
|
|
201
|
+
{lastAction.timestamp}
|
|
202
|
+
</react_native_1.Text>
|
|
203
|
+
</react_native_1.View>)}
|
|
204
|
+
</react_native_1.View>
|
|
205
|
+
|
|
206
|
+
{/* Copy Button */}
|
|
207
|
+
<CopyButton_1.default value={() => (sliceTab === 'live' ? sliceData : persistedData)} label="Slice JSON"/>
|
|
208
|
+
</react_native_1.View>
|
|
209
|
+
|
|
210
|
+
{/* Sub Stats Row */}
|
|
211
|
+
<react_native_1.View style={reduxDetailStyles.subStatsRow}>
|
|
212
|
+
<react_native_1.View style={reduxDetailStyles.statPill}>
|
|
213
|
+
<react_native_1.Text style={reduxDetailStyles.statLabel}>Root Keys:</react_native_1.Text>
|
|
214
|
+
<react_native_1.Text style={reduxDetailStyles.statValue}>{fieldsCount}</react_native_1.Text>
|
|
215
|
+
</react_native_1.View>
|
|
216
|
+
<react_native_1.View style={reduxDetailStyles.statPill}>
|
|
217
|
+
<react_native_1.Text style={reduxDetailStyles.statLabel}>Size:</react_native_1.Text>
|
|
218
|
+
<react_native_1.Text style={reduxDetailStyles.statValue}>{(0, helpers_1.getSize)(sliceData)}</react_native_1.Text>
|
|
219
|
+
</react_native_1.View>
|
|
220
|
+
<react_native_1.View style={reduxDetailStyles.statPill}>
|
|
221
|
+
<react_native_1.Text style={reduxDetailStyles.statLabel}>Timeline:</react_native_1.Text>
|
|
222
|
+
<react_native_1.Text style={reduxDetailStyles.statValue}>{sliceActions.length} actions</react_native_1.Text>
|
|
223
|
+
</react_native_1.View>
|
|
224
|
+
{lastAction && (<react_native_1.View style={[reduxDetailStyles.statPill, { flex: 1, minWidth: 140 }]}>
|
|
225
|
+
<react_native_1.Text style={reduxDetailStyles.statLabel}>Last Action:</react_native_1.Text>
|
|
226
|
+
<react_native_1.Text style={reduxDetailStyles.statValue} numberOfLines={1}>
|
|
227
|
+
{lastAction.type}
|
|
228
|
+
</react_native_1.Text>
|
|
229
|
+
</react_native_1.View>)}
|
|
230
|
+
</react_native_1.View>
|
|
231
|
+
|
|
232
|
+
{/* Sub-Tabs */}
|
|
233
|
+
<SegmentedTabs_1.default tabs={sliceTabs} activeKey={sliceTab} onChange={key => setSliceTab(key)} style={{ marginTop: 10 }}/>
|
|
234
|
+
</react_native_1.View>
|
|
235
|
+
|
|
236
|
+
{/* Search Bar within slice */}
|
|
237
|
+
{sliceTab !== 'metadata' && (<react_native_1.View style={reduxDetailStyles.searchContainer}>
|
|
238
|
+
<NetworkIcons_1.SearchIcon color={AppColors_1.AppColors.grayTextWeak} size={14}/>
|
|
239
|
+
<react_native_1.TextInput placeholder="Search keys, values, or action types..." placeholderTextColor={AppColors_1.AppColors.grayTextWeak} value={detailSearch} onChangeText={setDetailSearch} style={reduxDetailStyles.searchInput} autoCorrect={false} autoCapitalize="none"/>
|
|
240
|
+
{detailSearch.length > 0 && (<react_native_1.Pressable onPress={() => setDetailSearch('')} hitSlop={10}>
|
|
241
|
+
<NetworkIcons_1.ClearIcon color={AppColors_1.AppColors.grayTextWeak} size={14}/>
|
|
242
|
+
</react_native_1.Pressable>)}
|
|
243
|
+
</react_native_1.View>)}
|
|
244
|
+
|
|
245
|
+
{/* Content Body */}
|
|
246
|
+
{sliceTab === 'timeline' ? (<react_native_1.ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: 12, paddingBottom: 40 }} keyboardShouldPersistTaps="handled">
|
|
247
|
+
{sliceActions.length === 0 ? (<react_native_1.View style={reduxDetailStyles.emptyBox}>
|
|
248
|
+
<react_native_1.Text style={reduxDetailStyles.emptyBoxText}>
|
|
249
|
+
No dispatched actions recorded for this slice yet.
|
|
250
|
+
</react_native_1.Text>
|
|
251
|
+
</react_native_1.View>) : (sliceActions.map((action, aIdx) => {
|
|
252
|
+
const isExpanded = expandedActionId === action.id;
|
|
253
|
+
return (<AnimatedEntrance_1.default key={action.id} index={aIdx} distance={6}>
|
|
254
|
+
<TouchableScale_1.default onPress={() => setExpandedActionId(isExpanded ? null : action.id)} style={reduxDetailStyles.timelineCard}>
|
|
255
|
+
<react_native_1.View style={reduxDetailStyles.timelineHeader}>
|
|
256
|
+
<react_native_1.View style={reduxDetailStyles.actionBadge}>
|
|
257
|
+
<react_native_1.Text style={reduxDetailStyles.actionBadgeText}>
|
|
258
|
+
#{action.id}
|
|
259
|
+
</react_native_1.Text>
|
|
260
|
+
</react_native_1.View>
|
|
261
|
+
<HighlightText_1.default text={action.type} search={detailSearch} style={reduxDetailStyles.actionTitle} highlightStyle={reduxDetailStyles.highlight}/>
|
|
262
|
+
<react_native_1.View style={reduxDetailStyles.timePill}>
|
|
263
|
+
<NetworkIcons_1.ClockIcon color={AppColors_1.AppColors.purple} size={10}/>
|
|
264
|
+
<react_native_1.Text style={reduxDetailStyles.timeText}>
|
|
265
|
+
{action.timestamp}
|
|
266
|
+
</react_native_1.Text>
|
|
267
|
+
</react_native_1.View>
|
|
268
|
+
</react_native_1.View>
|
|
269
|
+
|
|
270
|
+
{/* Expanded Payload & Diff Viewer */}
|
|
271
|
+
{isExpanded ? (<react_native_1.View style={reduxDetailStyles.expandedContent}>
|
|
272
|
+
{action.payload !== undefined && (<react_native_1.View style={{ marginBottom: 10 }}>
|
|
273
|
+
<react_native_1.Text style={reduxDetailStyles.expandedSectionTitle}>
|
|
274
|
+
Action Payload:
|
|
275
|
+
</react_native_1.Text>
|
|
276
|
+
<JsonViewer_1.default data={action.payload} search={detailSearch} forceOpen={true}/>
|
|
277
|
+
</react_native_1.View>)}
|
|
278
|
+
|
|
279
|
+
<react_native_1.Text style={reduxDetailStyles.expandedSectionTitle}>
|
|
280
|
+
State Changes (Diff):
|
|
281
|
+
</react_native_1.Text>
|
|
282
|
+
<DiffViewer_1.default oldData={action.prevState?.[selectedReduxSlice] || {}} newData={action.nextState?.[selectedReduxSlice] || {}} forceOpen={true}/>
|
|
283
|
+
</react_native_1.View>) : (<react_native_1.View style={reduxDetailStyles.collapsedPrompt}>
|
|
284
|
+
<react_native_1.Text style={reduxDetailStyles.collapsedPromptText}>
|
|
285
|
+
Tap to inspect action payload & diff changes
|
|
286
|
+
</react_native_1.Text>
|
|
287
|
+
<NetworkIcons_1.ForwardChevronIcon color={AppColors_1.AppColors.grayTextWeak} size={12}/>
|
|
288
|
+
</react_native_1.View>)}
|
|
289
|
+
</TouchableScale_1.default>
|
|
290
|
+
</AnimatedEntrance_1.default>);
|
|
291
|
+
}))}
|
|
292
|
+
</react_native_1.ScrollView>) : sliceTab === 'metadata' ? (<react_native_1.ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: 12, paddingBottom: 40 }} keyboardShouldPersistTaps="handled">
|
|
293
|
+
<react_native_1.View style={reduxDetailStyles.metadataCard}>
|
|
294
|
+
{[
|
|
295
|
+
{ label: 'Slice Name', value: selectedReduxSlice },
|
|
296
|
+
{ label: 'Root Keys Count', value: `${fieldsCount} keys` },
|
|
297
|
+
{ label: 'In-Memory State Size', value: (0, helpers_1.getSize)(sliceData) },
|
|
298
|
+
{
|
|
299
|
+
label: 'Persistence Status',
|
|
300
|
+
value: isPersisted ? `Persisted (${(0, helpers_1.getSize)(persistedData)})` : 'Not Persisted',
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
label: 'Dispatched Actions History',
|
|
304
|
+
value: `${sliceActions.length} recorded actions`,
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
label: 'Last Dispatched Action',
|
|
308
|
+
value: lastAction ? lastAction.type : 'None',
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
label: 'Last Action Timestamp',
|
|
312
|
+
value: lastAction ? lastAction.timestamp : 'Initial',
|
|
313
|
+
},
|
|
314
|
+
].map((row, rIdx) => (<react_native_1.View key={rIdx} style={[
|
|
315
|
+
reduxDetailStyles.metaRow,
|
|
316
|
+
rIdx === 6 && { borderBottomWidth: 0 },
|
|
317
|
+
]}>
|
|
318
|
+
<react_native_1.Text style={reduxDetailStyles.metaLabel}>{row.label}</react_native_1.Text>
|
|
319
|
+
<react_native_1.Text style={reduxDetailStyles.metaValue} selectable numberOfLines={2}>
|
|
320
|
+
{row.value}
|
|
321
|
+
</react_native_1.Text>
|
|
322
|
+
</react_native_1.View>))}
|
|
323
|
+
|
|
324
|
+
{isPersisted && (<react_native_1.TouchableOpacity style={reduxDetailStyles.clearPersistBtn} onPress={handleClearPersistence}>
|
|
325
|
+
<NetworkIcons_1.TrashIcon color={AppColors_1.AppColors.errorColor} size={14}/>
|
|
326
|
+
<react_native_1.Text style={reduxDetailStyles.clearPersistText}>
|
|
327
|
+
Clear Persisted Storage For This Slice
|
|
328
|
+
</react_native_1.Text>
|
|
329
|
+
</react_native_1.TouchableOpacity>)}
|
|
330
|
+
</react_native_1.View>
|
|
331
|
+
</react_native_1.ScrollView>) : (<react_native_1.ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: 12, paddingBottom: 40 }} keyboardShouldPersistTaps="handled">
|
|
332
|
+
<JsonViewer_1.default data={sliceTab === 'live' ? sliceData : persistedData ?? 'No persisted state stored.'} search={detailSearch} forceOpen={detailSearch.length > 0 ? true : undefined} mode={viewMode} onModeChange={setViewMode}/>
|
|
333
|
+
</react_native_1.ScrollView>)}
|
|
334
|
+
</react_native_1.View>);
|
|
335
|
+
}
|
|
336
|
+
return null;
|
|
337
|
+
});
|
|
338
|
+
const reduxDetailStyles = react_native_1.StyleSheet.create({
|
|
339
|
+
infoBar: {
|
|
340
|
+
backgroundColor: AppColors_1.AppColors.white,
|
|
341
|
+
padding: 12,
|
|
342
|
+
borderBottomWidth: 1,
|
|
343
|
+
borderBottomColor: AppColors_1.AppColors.dividerColor,
|
|
344
|
+
},
|
|
345
|
+
infoTopRow: {
|
|
346
|
+
flexDirection: 'row',
|
|
347
|
+
alignItems: 'center',
|
|
348
|
+
justifyContent: 'space-between',
|
|
349
|
+
marginBottom: 8,
|
|
350
|
+
},
|
|
351
|
+
methodBadge: {
|
|
352
|
+
paddingHorizontal: 8,
|
|
353
|
+
paddingVertical: 3,
|
|
354
|
+
borderRadius: 6,
|
|
355
|
+
},
|
|
356
|
+
methodBadgeText: {
|
|
357
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
358
|
+
fontSize: 10,
|
|
359
|
+
color: AppColors_1.AppColors.white,
|
|
360
|
+
letterSpacing: 0.5,
|
|
361
|
+
},
|
|
362
|
+
sliceNameText: {
|
|
363
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
364
|
+
fontSize: 14,
|
|
365
|
+
color: AppColors_1.AppColors.primaryBlack,
|
|
366
|
+
},
|
|
367
|
+
persistedChip: {
|
|
368
|
+
backgroundColor: '#D1FAE5',
|
|
369
|
+
paddingHorizontal: 6,
|
|
370
|
+
paddingVertical: 2,
|
|
371
|
+
borderRadius: 4,
|
|
372
|
+
borderWidth: 1,
|
|
373
|
+
borderColor: '#A7F3D0',
|
|
374
|
+
},
|
|
375
|
+
persistedChipText: {
|
|
376
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
377
|
+
fontSize: 9,
|
|
378
|
+
color: '#047857',
|
|
379
|
+
},
|
|
380
|
+
inMemoryChip: {
|
|
381
|
+
backgroundColor: '#F3E8FF',
|
|
382
|
+
paddingHorizontal: 6,
|
|
383
|
+
paddingVertical: 2,
|
|
384
|
+
borderRadius: 4,
|
|
385
|
+
borderWidth: 1,
|
|
386
|
+
borderColor: '#E9D5FF',
|
|
387
|
+
},
|
|
388
|
+
inMemoryChipText: {
|
|
389
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
390
|
+
fontSize: 9,
|
|
391
|
+
color: '#7E22CE',
|
|
392
|
+
},
|
|
393
|
+
subStatsRow: {
|
|
394
|
+
flexDirection: 'row',
|
|
395
|
+
alignItems: 'center',
|
|
396
|
+
gap: 8,
|
|
397
|
+
flexWrap: 'wrap',
|
|
398
|
+
},
|
|
399
|
+
statPill: {
|
|
400
|
+
flexDirection: 'row',
|
|
401
|
+
alignItems: 'center',
|
|
402
|
+
gap: 4,
|
|
403
|
+
backgroundColor: AppColors_1.AppColors.grayBackground,
|
|
404
|
+
paddingHorizontal: 8,
|
|
405
|
+
paddingVertical: 4,
|
|
406
|
+
borderRadius: 6,
|
|
407
|
+
borderWidth: 1,
|
|
408
|
+
borderColor: AppColors_1.AppColors.dividerColor,
|
|
409
|
+
},
|
|
410
|
+
statLabel: {
|
|
411
|
+
fontFamily: AppFonts_1.AppFonts.interMedium,
|
|
412
|
+
fontSize: 10.5,
|
|
413
|
+
color: AppColors_1.AppColors.grayTextWeak,
|
|
414
|
+
},
|
|
415
|
+
statValue: {
|
|
416
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
417
|
+
fontSize: 11,
|
|
418
|
+
color: AppColors_1.AppColors.primaryBlack,
|
|
419
|
+
},
|
|
420
|
+
searchContainer: {
|
|
421
|
+
flexDirection: 'row',
|
|
422
|
+
alignItems: 'center',
|
|
423
|
+
backgroundColor: AppColors_1.AppColors.white,
|
|
424
|
+
borderRadius: 8,
|
|
425
|
+
marginHorizontal: 12,
|
|
426
|
+
marginTop: 10,
|
|
427
|
+
paddingHorizontal: 10,
|
|
428
|
+
borderWidth: 1,
|
|
429
|
+
borderColor: AppColors_1.AppColors.dividerColor,
|
|
430
|
+
height: 36,
|
|
431
|
+
gap: 8,
|
|
432
|
+
},
|
|
433
|
+
searchInput: {
|
|
434
|
+
flex: 1,
|
|
435
|
+
fontFamily: AppFonts_1.AppFonts.interRegular,
|
|
436
|
+
fontSize: 12,
|
|
437
|
+
color: AppColors_1.AppColors.primaryBlack,
|
|
438
|
+
padding: 0,
|
|
439
|
+
},
|
|
440
|
+
timelineCard: {
|
|
441
|
+
backgroundColor: AppColors_1.AppColors.white,
|
|
442
|
+
borderRadius: 10,
|
|
443
|
+
padding: 12,
|
|
444
|
+
marginBottom: 8,
|
|
445
|
+
borderWidth: 1,
|
|
446
|
+
borderColor: AppColors_1.AppColors.dividerColor,
|
|
447
|
+
},
|
|
448
|
+
timelineHeader: {
|
|
449
|
+
flexDirection: 'row',
|
|
450
|
+
alignItems: 'center',
|
|
451
|
+
gap: 8,
|
|
452
|
+
},
|
|
453
|
+
actionBadge: {
|
|
454
|
+
backgroundColor: '#EEF2FF',
|
|
455
|
+
paddingHorizontal: 6,
|
|
456
|
+
paddingVertical: 2,
|
|
457
|
+
borderRadius: 4,
|
|
458
|
+
borderWidth: 1,
|
|
459
|
+
borderColor: '#C7D2FE',
|
|
460
|
+
},
|
|
461
|
+
actionBadgeText: {
|
|
462
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
463
|
+
fontSize: 9.5,
|
|
464
|
+
color: '#4338CA',
|
|
465
|
+
},
|
|
466
|
+
actionTitle: {
|
|
467
|
+
flex: 1,
|
|
468
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
469
|
+
fontSize: 12.5,
|
|
470
|
+
color: AppColors_1.AppColors.primaryBlack,
|
|
471
|
+
},
|
|
472
|
+
timePill: {
|
|
473
|
+
flexDirection: 'row',
|
|
474
|
+
alignItems: 'center',
|
|
475
|
+
gap: 3,
|
|
476
|
+
backgroundColor: `${AppColors_1.AppColors.purple}14`,
|
|
477
|
+
paddingHorizontal: 6,
|
|
478
|
+
paddingVertical: 2,
|
|
479
|
+
borderRadius: 4,
|
|
480
|
+
},
|
|
481
|
+
timeText: {
|
|
482
|
+
fontFamily: AppFonts_1.AppFonts.interMedium,
|
|
483
|
+
fontSize: 10,
|
|
484
|
+
color: AppColors_1.AppColors.purple,
|
|
485
|
+
},
|
|
486
|
+
collapsedPrompt: {
|
|
487
|
+
flexDirection: 'row',
|
|
488
|
+
alignItems: 'center',
|
|
489
|
+
justifyContent: 'space-between',
|
|
490
|
+
marginTop: 8,
|
|
491
|
+
paddingTop: 6,
|
|
492
|
+
borderTopWidth: 1,
|
|
493
|
+
borderTopColor: AppColors_1.AppColors.dividerColor,
|
|
494
|
+
},
|
|
495
|
+
collapsedPromptText: {
|
|
496
|
+
fontFamily: AppFonts_1.AppFonts.interRegular,
|
|
497
|
+
fontSize: 10.5,
|
|
498
|
+
color: AppColors_1.AppColors.grayTextWeak,
|
|
499
|
+
},
|
|
500
|
+
expandedContent: {
|
|
501
|
+
marginTop: 10,
|
|
502
|
+
paddingTop: 10,
|
|
503
|
+
borderTopWidth: 1,
|
|
504
|
+
borderTopColor: AppColors_1.AppColors.dividerColor,
|
|
505
|
+
},
|
|
506
|
+
expandedSectionTitle: {
|
|
507
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
508
|
+
fontSize: 11,
|
|
509
|
+
color: AppColors_1.AppColors.grayTextStrong,
|
|
510
|
+
marginBottom: 4,
|
|
511
|
+
},
|
|
512
|
+
metadataCard: {
|
|
513
|
+
backgroundColor: AppColors_1.AppColors.white,
|
|
514
|
+
borderRadius: 12,
|
|
515
|
+
padding: 12,
|
|
516
|
+
borderWidth: 1,
|
|
517
|
+
borderColor: AppColors_1.AppColors.dividerColor,
|
|
518
|
+
},
|
|
519
|
+
metaRow: {
|
|
520
|
+
flexDirection: 'row',
|
|
521
|
+
justifyContent: 'space-between',
|
|
522
|
+
alignItems: 'center',
|
|
523
|
+
paddingVertical: 10,
|
|
524
|
+
borderBottomWidth: 1,
|
|
525
|
+
borderBottomColor: AppColors_1.AppColors.dividerColor,
|
|
526
|
+
},
|
|
527
|
+
metaLabel: {
|
|
528
|
+
fontFamily: AppFonts_1.AppFonts.interMedium,
|
|
529
|
+
fontSize: 12,
|
|
530
|
+
color: AppColors_1.AppColors.grayTextWeak,
|
|
531
|
+
},
|
|
532
|
+
metaValue: {
|
|
533
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
534
|
+
fontSize: 12,
|
|
535
|
+
color: AppColors_1.AppColors.primaryBlack,
|
|
536
|
+
maxWidth: '60%',
|
|
537
|
+
textAlign: 'right',
|
|
538
|
+
},
|
|
539
|
+
clearPersistBtn: {
|
|
540
|
+
flexDirection: 'row',
|
|
541
|
+
alignItems: 'center',
|
|
542
|
+
justifyContent: 'center',
|
|
543
|
+
gap: 6,
|
|
544
|
+
backgroundColor: '#FEF2F2',
|
|
545
|
+
borderWidth: 1,
|
|
546
|
+
borderColor: '#FEE2E2',
|
|
547
|
+
borderRadius: 8,
|
|
548
|
+
paddingVertical: 10,
|
|
549
|
+
marginTop: 14,
|
|
550
|
+
},
|
|
551
|
+
clearPersistText: {
|
|
552
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
553
|
+
fontSize: 12,
|
|
554
|
+
color: AppColors_1.AppColors.errorColor,
|
|
555
|
+
},
|
|
556
|
+
emptyBox: {
|
|
557
|
+
backgroundColor: AppColors_1.AppColors.white,
|
|
558
|
+
borderRadius: 12,
|
|
559
|
+
padding: 24,
|
|
560
|
+
alignItems: 'center',
|
|
561
|
+
justifyContent: 'center',
|
|
562
|
+
borderWidth: 1,
|
|
563
|
+
borderColor: AppColors_1.AppColors.dividerColor,
|
|
564
|
+
},
|
|
565
|
+
emptyBoxText: {
|
|
566
|
+
fontFamily: AppFonts_1.AppFonts.interMedium,
|
|
567
|
+
fontSize: 12.5,
|
|
568
|
+
color: AppColors_1.AppColors.grayTextWeak,
|
|
569
|
+
},
|
|
570
|
+
highlight: {
|
|
571
|
+
backgroundColor: '#FEF08A',
|
|
572
|
+
color: '#854D0E',
|
|
573
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
574
|
+
},
|
|
575
|
+
});
|
|
576
|
+
exports.default = ReduxDetail;
|