react-native-inapp-inspector 1.0.18 → 1.1.1
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 +42 -40
- package/dist/commonjs/components/ReduxTreeView.d.ts +4 -0
- package/dist/commonjs/components/ReduxTreeView.js +35 -5
- package/dist/commonjs/constants/index.d.ts +1 -0
- package/dist/commonjs/constants/index.js +5 -1
- package/dist/commonjs/constants/version.d.ts +1 -0
- package/dist/commonjs/constants/version.js +6 -0
- package/dist/commonjs/customHooks/reduxLogger.js +9 -1
- package/dist/commonjs/index.js +488 -40
- package/dist/esm/components/ReduxTreeView.d.ts +4 -0
- package/dist/esm/components/ReduxTreeView.js +30 -4
- package/dist/esm/constants/index.d.ts +1 -0
- package/dist/esm/constants/index.js +3 -0
- package/dist/esm/constants/version.d.ts +1 -0
- package/dist/esm/constants/version.js +3 -0
- package/dist/esm/customHooks/reduxLogger.js +9 -1
- package/dist/esm/index.js +490 -42
- package/example/ios/example.xcodeproj/project.pbxproj +10 -0
- package/package.json +3 -2
|
@@ -17,6 +17,26 @@ const BoltIcon = ({ color = AppColors.grayTextWeak, size = 12 }) => (<Svg width=
|
|
|
17
17
|
const FolderIcon = ({ color = AppColors.grayTextWeak, size = 12 }) => (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
18
18
|
<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"/>
|
|
19
19
|
</Svg>);
|
|
20
|
+
// Exported icons so the Redux tab's section headers and sub-tab buttons can
|
|
21
|
+
// render real vector icons instead of emoji (which fail to render on some
|
|
22
|
+
// Android/font setups).
|
|
23
|
+
export const ReduxStoreIcon = ({ color = AppColors.grayTextWeak, size = 12, }) => (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
24
|
+
<Path d="M3 9l1.5-5h15L21 9M3 9v10a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1V9M3 9h18M7 9v3a2 2 0 0 0 4 0V9m2 0v3a2 2 0 0 0 4 0V9" stroke={color} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/>
|
|
25
|
+
</Svg>);
|
|
26
|
+
export const ReduxBoltIcon = ({ color = AppColors.grayTextWeak, size = 12, }) => (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
27
|
+
<Path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z" fill={color} stroke={color} strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
|
|
28
|
+
</Svg>);
|
|
29
|
+
// Action Timeline — a history/clock icon reads as "sequence over time".
|
|
30
|
+
export const ReduxTimelineIcon = ({ color = AppColors.grayTextWeak, size = 12, }) => (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
31
|
+
<Path d="M3 3v5h5" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
32
|
+
<Path d="M3.05 13A9 9 0 1 0 6 5.3L3 8" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
33
|
+
<Path d="M12 7v5l3 2" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
34
|
+
</Svg>);
|
|
35
|
+
// Store Tree — a node hierarchy icon reads as "nested tree structure".
|
|
36
|
+
export const ReduxTreeIcon = ({ color = AppColors.grayTextWeak, size = 12, }) => (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
37
|
+
<Path d="M9 4h6v4H9zM3 16h6v4H3zm12 0h6v4h-6z" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
38
|
+
<Path d="M12 8v4M6 16v-2h12v2" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
39
|
+
</Svg>);
|
|
20
40
|
const animateTreeLayout = () => {
|
|
21
41
|
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
22
42
|
};
|
|
@@ -142,7 +162,10 @@ export const ReduxTreeView = ({ state, lastActionMap, search, }) => {
|
|
|
142
162
|
setStoreExpanded(!storeExpanded);
|
|
143
163
|
}} style={styles.storeHeader}>
|
|
144
164
|
<AnimatedChevron color="#FFFFFF" expanded={storeExpanded} size={12} style={styles.chevronWrap}/>
|
|
145
|
-
<
|
|
165
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 6 }}>
|
|
166
|
+
<ReduxStoreIcon color="#FFFFFF" size={14}/>
|
|
167
|
+
<Text style={styles.storeTitle}>Redux Store</Text>
|
|
168
|
+
</View>
|
|
146
169
|
<View style={styles.badge}>
|
|
147
170
|
<Text style={styles.badgeText}>{reducers.length} Reducers</Text>
|
|
148
171
|
</View>
|
|
@@ -246,9 +269,12 @@ export const ReduxActionTimeline = ({ history, onClear, search, }) => {
|
|
|
246
269
|
});
|
|
247
270
|
return (<View style={timelineStyles.container}>
|
|
248
271
|
<View style={timelineStyles.headerRow}>
|
|
249
|
-
<
|
|
250
|
-
|
|
251
|
-
|
|
272
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 6 }}>
|
|
273
|
+
<ReduxBoltIcon color={AppColors.purple} size={15}/>
|
|
274
|
+
<Text style={timelineStyles.headerTitle}>
|
|
275
|
+
Dispatched Actions ({filteredHistory.length})
|
|
276
|
+
</Text>
|
|
277
|
+
</View>
|
|
252
278
|
{history.length > 0 && (<Pressable onPress={onClear} style={timelineStyles.clearBtn}>
|
|
253
279
|
<Text style={timelineStyles.clearBtnText}>Clear Log</Text>
|
|
254
280
|
</Pressable>)}
|
|
@@ -30,3 +30,6 @@ export const DOMAIN_COLORS = [
|
|
|
30
30
|
];
|
|
31
31
|
export const DURATION_FAST_MS = 200;
|
|
32
32
|
export const DURATION_SLOW_MS = 800;
|
|
33
|
+
// Package version — auto-generated from package.json at build time.
|
|
34
|
+
// See scripts/gen-version.js (wired to the "prebuild" npm script).
|
|
35
|
+
export { LIB_VERSION } from './version';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LIB_VERSION = "1.1.1";
|
|
@@ -29,7 +29,9 @@ export const subscribeReduxState = (cb) => {
|
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
31
|
export const connectReduxStore = (store) => {
|
|
32
|
-
if (!store ||
|
|
32
|
+
if (!store ||
|
|
33
|
+
typeof store.getState !== 'function' ||
|
|
34
|
+
typeof store.subscribe !== 'function') {
|
|
33
35
|
console.warn('[NetworkInspector] Invalid Redux store passed to connectReduxStore.');
|
|
34
36
|
return;
|
|
35
37
|
}
|
|
@@ -72,8 +74,14 @@ export const connectReduxStore = (store) => {
|
|
|
72
74
|
}
|
|
73
75
|
}
|
|
74
76
|
if (globalReduxAutoRefresh) {
|
|
77
|
+
// Refresh the displayed state tree snapshot.
|
|
75
78
|
setReduxState(nextState);
|
|
76
79
|
}
|
|
80
|
+
else {
|
|
81
|
+
// Tree is paused, but the action timeline / last-action map still changed,
|
|
82
|
+
// so notify subscribers to re-render those without moving the tree snapshot.
|
|
83
|
+
listeners.forEach(cb => cb());
|
|
84
|
+
}
|
|
77
85
|
return result;
|
|
78
86
|
};
|
|
79
87
|
setReduxState(store.getState());
|