react-native-xenon 2.3.0 → 2.4.0
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/lib/module/core/utils.js +1 -1
- package/lib/module/core/utils.js.map +1 -1
- package/lib/module/ui/Xenon.js +1 -1
- package/lib/module/ui/Xenon.js.map +1 -1
- package/lib/module/ui/components/bubble/Bubble.js +4 -6
- package/lib/module/ui/components/bubble/Bubble.js.map +1 -1
- package/lib/module/ui/components/common/IndexedStack.js +5 -6
- package/lib/module/ui/components/common/IndexedStack.js.map +1 -1
- package/lib/module/ui/components/details/LogMessageDetails.js +10 -9
- package/lib/module/ui/components/details/LogMessageDetails.js.map +1 -1
- package/lib/module/ui/components/details/NetworkRequestDetails.js +6 -6
- package/lib/module/ui/components/details/NetworkRequestDetails.js.map +1 -1
- package/lib/module/ui/components/headers/ConsoleHeader.js +5 -6
- package/lib/module/ui/components/headers/ConsoleHeader.js.map +1 -1
- package/lib/module/ui/components/headers/DebuggerHeader.js +7 -7
- package/lib/module/ui/components/headers/DebuggerHeader.js.map +1 -1
- package/lib/module/ui/components/headers/HeaderComponents.js +6 -5
- package/lib/module/ui/components/headers/HeaderComponents.js.map +1 -1
- package/lib/module/ui/components/headers/NetworkHeader.js +6 -6
- package/lib/module/ui/components/headers/NetworkHeader.js.map +1 -1
- package/lib/module/ui/components/items/ConsolePanelItem.js +1 -3
- package/lib/module/ui/components/items/ConsolePanelItem.js.map +1 -1
- package/lib/module/ui/components/items/DebuggerHeaderItem.js +2 -1
- package/lib/module/ui/components/items/DebuggerHeaderItem.js.map +1 -1
- package/lib/module/ui/components/items/NetworkPanelItem.js +1 -3
- package/lib/module/ui/components/items/NetworkPanelItem.js.map +1 -1
- package/lib/module/ui/components/panels/ConsolePanel.js +6 -6
- package/lib/module/ui/components/panels/ConsolePanel.js.map +1 -1
- package/lib/module/ui/components/panels/NetworkPanel.js +7 -7
- package/lib/module/ui/components/panels/NetworkPanel.js.map +1 -1
- package/lib/module/ui/components/panels/Panel.js +4 -6
- package/lib/module/ui/components/panels/Panel.js.map +1 -1
- package/lib/module/ui/components/search-bar/SearchBar.js +4 -6
- package/lib/module/ui/components/search-bar/SearchBar.js.map +1 -1
- package/lib/typescript/src/ui/Xenon.d.ts +16 -14
- package/lib/typescript/src/ui/Xenon.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/bubble/Bubble.d.ts +4 -2
- package/lib/typescript/src/ui/components/bubble/Bubble.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/common/IndexedStack.d.ts +4 -3
- package/lib/typescript/src/ui/components/common/IndexedStack.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/details/LogMessageDetails.d.ts +6 -3
- package/lib/typescript/src/ui/components/details/LogMessageDetails.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/details/NetworkRequestDetails.d.ts +6 -3
- package/lib/typescript/src/ui/components/details/NetworkRequestDetails.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/headers/ConsoleHeader.d.ts +5 -3
- package/lib/typescript/src/ui/components/headers/ConsoleHeader.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/headers/DebuggerHeader.d.ts +4 -2
- package/lib/typescript/src/ui/components/headers/DebuggerHeader.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/headers/HeaderComponents.d.ts +6 -5
- package/lib/typescript/src/ui/components/headers/HeaderComponents.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/headers/NetworkHeader.d.ts +4 -2
- package/lib/typescript/src/ui/components/headers/NetworkHeader.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/items/NetworkPanelItem.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/panels/ConsolePanel.d.ts +6 -3
- package/lib/typescript/src/ui/components/panels/ConsolePanel.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/panels/NetworkPanel.d.ts +7 -5
- package/lib/typescript/src/ui/components/panels/NetworkPanel.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/panels/Panel.d.ts +5 -3
- package/lib/typescript/src/ui/components/panels/Panel.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/search-bar/SearchBar.d.ts +4 -2
- package/lib/typescript/src/ui/components/search-bar/SearchBar.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/core/utils.ts +1 -1
- package/src/ui/Xenon.tsx +18 -15
- package/src/ui/components/bubble/Bubble.tsx +97 -100
- package/src/ui/components/common/IndexedStack.tsx +8 -20
- package/src/ui/components/details/LogMessageDetails.tsx +25 -27
- package/src/ui/components/details/NetworkRequestDetails.tsx +152 -151
- package/src/ui/components/headers/ConsoleHeader.tsx +13 -16
- package/src/ui/components/headers/DebuggerHeader.tsx +82 -83
- package/src/ui/components/headers/HeaderComponents.tsx +18 -16
- package/src/ui/components/headers/NetworkHeader.tsx +47 -50
- package/src/ui/components/items/ConsolePanelItem.tsx +3 -3
- package/src/ui/components/items/DebuggerHeaderItem.tsx +1 -0
- package/src/ui/components/items/NetworkPanelItem.tsx +6 -9
- package/src/ui/components/panels/ConsolePanel.tsx +8 -5
- package/src/ui/components/panels/NetworkPanel.tsx +9 -13
- package/src/ui/components/panels/Panel.tsx +7 -7
- package/src/ui/components/search-bar/SearchBar.tsx +7 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useContext, type Ref } from 'react';
|
|
2
2
|
import { type ScrollView, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
3
|
import { MainContext } from '../../../contexts';
|
|
4
4
|
import { type PanelState } from '../../../core/refs';
|
|
@@ -13,61 +13,58 @@ import HeaderComponents from './HeaderComponents';
|
|
|
13
13
|
interface NetworkHeaderProps {
|
|
14
14
|
selectedPanel: PanelState;
|
|
15
15
|
style?: StyleProp<ViewStyle>;
|
|
16
|
+
ref?: Ref<ScrollView>;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = useContext(MainContext)!;
|
|
19
|
+
export default function NetworkHeader({ selectedPanel, style, ref }: NetworkHeaderProps) {
|
|
20
|
+
const {
|
|
21
|
+
debuggerState: { detailsData },
|
|
22
|
+
setDebuggerState,
|
|
23
|
+
} = useContext(MainContext)!;
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
const data = detailsData?.data as HttpRequest | WebSocketRequest | undefined;
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const { isWS, overviewShown, headersShown, requestShown, responseShown, messagesShown } =
|
|
28
|
+
getNetworkUtils(data);
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
return (
|
|
31
|
+
<HeaderComponents.Wrapper ref={ref} style={style}>
|
|
32
|
+
<HeaderComponents.Back selectedPanel={selectedPanel} />
|
|
33
|
+
<HeaderComponents.MainButtons />
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
<Divider type="vertical" />
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
{!!overviewShown && <HeaderComponents.DetailTabItem tab="overview" label="Overview" />}
|
|
38
|
+
{!!headersShown && <HeaderComponents.DetailTabItem tab="headers" label="Headers" />}
|
|
39
|
+
{!!requestShown && <HeaderComponents.DetailTabItem tab="request" label="Request" />}
|
|
40
|
+
{!!responseShown && <HeaderComponents.DetailTabItem tab="response" label="Response" />}
|
|
41
|
+
{!!messagesShown && <HeaderComponents.DetailTabItem tab="messages" label="Messages" />}
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
{!isWS && (
|
|
44
|
+
<>
|
|
45
|
+
<Divider type="vertical" />
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
export default NetworkHeader;
|
|
47
|
+
<DebuggerHeaderItem
|
|
48
|
+
content={icons.beautify}
|
|
49
|
+
isActive={detailsData?.beautified}
|
|
50
|
+
activeColor={colors.green}
|
|
51
|
+
onPress={() => {
|
|
52
|
+
setDebuggerState(draft => {
|
|
53
|
+
draft.detailsData!.beautified = !draft.detailsData?.beautified;
|
|
54
|
+
});
|
|
55
|
+
}}
|
|
56
|
+
/>
|
|
57
|
+
<DebuggerHeaderItem
|
|
58
|
+
content={icons.share}
|
|
59
|
+
onPress={async () => {
|
|
60
|
+
if (data?.type === NetworkType.WS) return;
|
|
61
|
+
await shareText(
|
|
62
|
+
convertToCurl(data!.method, data!.url, data!.requestHeaders, data!.body),
|
|
63
|
+
);
|
|
64
|
+
}}
|
|
65
|
+
/>
|
|
66
|
+
</>
|
|
67
|
+
)}
|
|
68
|
+
</HeaderComponents.Wrapper>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
@@ -22,9 +22,9 @@ const ConsolePanelItem = memo<ConsolePanelItemProps>(
|
|
|
22
22
|
</Touchable>
|
|
23
23
|
);
|
|
24
24
|
},
|
|
25
|
-
(prevProps, nextProps) =>
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
(prevProps, nextProps) =>
|
|
26
|
+
prevProps.type === nextProps.type &&
|
|
27
|
+
JSON.stringify(prevProps.values) === JSON.stringify(nextProps.values),
|
|
28
28
|
);
|
|
29
29
|
|
|
30
30
|
const styles = StyleSheet.create({
|
|
@@ -101,15 +101,12 @@ const NetworkPanelItem = memo<NetworkPanelItemProps>(
|
|
|
101
101
|
</View>
|
|
102
102
|
);
|
|
103
103
|
},
|
|
104
|
-
(prevProps, nextProps) =>
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
prevProps.status === nextProps.status
|
|
111
|
-
);
|
|
112
|
-
},
|
|
104
|
+
(prevProps, nextProps) =>
|
|
105
|
+
prevProps.method === nextProps.method &&
|
|
106
|
+
prevProps.name === nextProps.name &&
|
|
107
|
+
prevProps.startTime === nextProps.startTime &&
|
|
108
|
+
prevProps.endTime === nextProps.endTime &&
|
|
109
|
+
prevProps.status === nextProps.status,
|
|
113
110
|
);
|
|
114
111
|
|
|
115
112
|
const styles = StyleSheet.create({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useCallback, useContext, useMemo, type Ref } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
FlatList,
|
|
4
4
|
StyleSheet,
|
|
@@ -13,7 +13,12 @@ import { DebuggerPanel, type LogMessage } from '../../../types';
|
|
|
13
13
|
import Empty from '../common/Empty';
|
|
14
14
|
import ConsolePanelItem from '../items/ConsolePanelItem';
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
interface ConsolePanelProps {
|
|
17
|
+
style?: StyleProp<ViewStyle>;
|
|
18
|
+
ref?: Ref<FlatList<any>>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default function ConsolePanel({ style, ref }: ConsolePanelProps) {
|
|
17
22
|
const {
|
|
18
23
|
debuggerState: { searchQuery },
|
|
19
24
|
consoleInterceptor: { logMessages },
|
|
@@ -75,7 +80,7 @@ const ConsolePanel = forwardRef<FlatList, { style?: StyleProp<ViewStyle> }>(({ s
|
|
|
75
80
|
getItemLayout={getItemLayout}
|
|
76
81
|
/>
|
|
77
82
|
);
|
|
78
|
-
}
|
|
83
|
+
}
|
|
79
84
|
|
|
80
85
|
const styles = StyleSheet.create({
|
|
81
86
|
container: {
|
|
@@ -85,5 +90,3 @@ const styles = StyleSheet.create({
|
|
|
85
90
|
padding: 8,
|
|
86
91
|
},
|
|
87
92
|
});
|
|
88
|
-
|
|
89
|
-
export default ConsolePanel;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
FlatList,
|
|
4
|
-
StyleSheet,
|
|
5
|
-
type ListRenderItem,
|
|
6
|
-
type StyleProp,
|
|
7
|
-
type ViewStyle,
|
|
8
|
-
} from 'react-native';
|
|
1
|
+
import { useCallback, useContext, useMemo, type Ref } from 'react';
|
|
2
|
+
import { FlatList, StyleSheet, type ListRenderItem, type ViewProps } from 'react-native';
|
|
9
3
|
import { MainContext } from '../../../contexts';
|
|
10
4
|
import { NETWORK_ITEM_HEIGHT } from '../../../core/constants';
|
|
11
5
|
import {
|
|
@@ -18,7 +12,11 @@ import {
|
|
|
18
12
|
import Empty from '../common/Empty';
|
|
19
13
|
import NetworkPanelItem from '../items/NetworkPanelItem';
|
|
20
14
|
|
|
21
|
-
|
|
15
|
+
interface NetworkPanelProps extends ViewProps {
|
|
16
|
+
ref?: Ref<FlatList<any>>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default function NetworkPanel({ style, ref }: NetworkPanelProps) {
|
|
22
20
|
const {
|
|
23
21
|
debuggerState: { searchQuery },
|
|
24
22
|
networkInterceptor: { networkRequests },
|
|
@@ -76,9 +74,9 @@ const NetworkPanel = forwardRef<FlatList, { style?: StyleProp<ViewStyle> }>(({ s
|
|
|
76
74
|
|
|
77
75
|
return (
|
|
78
76
|
<FlatList
|
|
77
|
+
ref={ref}
|
|
79
78
|
inverted={!!data.length}
|
|
80
79
|
data={data}
|
|
81
|
-
ref={ref}
|
|
82
80
|
renderItem={renderItem}
|
|
83
81
|
keyExtractor={([key]) => key}
|
|
84
82
|
style={[styles.container, style]}
|
|
@@ -86,7 +84,7 @@ const NetworkPanel = forwardRef<FlatList, { style?: StyleProp<ViewStyle> }>(({ s
|
|
|
86
84
|
getItemLayout={getItemLayout}
|
|
87
85
|
/>
|
|
88
86
|
);
|
|
89
|
-
}
|
|
87
|
+
}
|
|
90
88
|
|
|
91
89
|
const styles = StyleSheet.create({
|
|
92
90
|
container: {
|
|
@@ -94,5 +92,3 @@ const styles = StyleSheet.create({
|
|
|
94
92
|
paddingHorizontal: 8,
|
|
95
93
|
},
|
|
96
94
|
});
|
|
97
|
-
|
|
98
|
-
export default NetworkPanel;
|
|
@@ -6,7 +6,7 @@ import NetworkRequestDetails from '../details/NetworkRequestDetails';
|
|
|
6
6
|
import ConsolePanel from './ConsolePanel';
|
|
7
7
|
import NetworkPanel from './NetworkPanel';
|
|
8
8
|
import colors from '../../../theme/colors';
|
|
9
|
-
import {
|
|
9
|
+
import { useContext, useEffect, useMemo, type Ref } from 'react';
|
|
10
10
|
import Header from '../headers/Header';
|
|
11
11
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
12
12
|
import SafeArea from '../common/SafeArea';
|
|
@@ -14,9 +14,11 @@ import { MainContext } from '../../../contexts';
|
|
|
14
14
|
import Handle from '../handle/Handle';
|
|
15
15
|
import { DebuggerPanel } from '../../../types';
|
|
16
16
|
|
|
17
|
-
interface
|
|
17
|
+
interface PanelComponentProps extends ViewProps {
|
|
18
|
+
ref?: Ref<View>;
|
|
19
|
+
}
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
export default function Panel({ style, ...props }: PanelComponentProps) {
|
|
20
22
|
const {
|
|
21
23
|
debuggerState: { position, detailsData },
|
|
22
24
|
} = useContext(MainContext)!;
|
|
@@ -43,7 +45,7 @@ const Panel = forwardRef<View, PanelProps>(({ style, ...props }, ref) => {
|
|
|
43
45
|
}, [detailsData?.type]);
|
|
44
46
|
|
|
45
47
|
return (
|
|
46
|
-
<Animated.View style={[containerStyle, style]}
|
|
48
|
+
<Animated.View style={[containerStyle, style]} {...props}>
|
|
47
49
|
<SafeAreaProvider>
|
|
48
50
|
{position === 'bottom' && <Handle />}
|
|
49
51
|
{position === 'top' && <SafeArea inset="top" />}
|
|
@@ -62,7 +64,7 @@ const Panel = forwardRef<View, PanelProps>(({ style, ...props }, ref) => {
|
|
|
62
64
|
</SafeAreaProvider>
|
|
63
65
|
</Animated.View>
|
|
64
66
|
);
|
|
65
|
-
}
|
|
67
|
+
}
|
|
66
68
|
|
|
67
69
|
const styles = StyleSheet.create({
|
|
68
70
|
container: {
|
|
@@ -77,5 +79,3 @@ const styles = StyleSheet.create({
|
|
|
77
79
|
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
78
80
|
},
|
|
79
81
|
});
|
|
80
|
-
|
|
81
|
-
export default Panel;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useContext, useState, type Ref } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Keyboard,
|
|
4
4
|
Platform,
|
|
@@ -18,11 +18,13 @@ import Icon from '../common/Icon';
|
|
|
18
18
|
import Touchable from '../common/Touchable';
|
|
19
19
|
import SafeArea from '../common/SafeArea';
|
|
20
20
|
|
|
21
|
-
interface SearchBarProps extends ViewProps {
|
|
21
|
+
interface SearchBarProps extends ViewProps {
|
|
22
|
+
ref?: Ref<View>;
|
|
23
|
+
}
|
|
22
24
|
|
|
23
25
|
const ICON_SIZE = 20;
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
export default function SearchBar({ style, ...props }: SearchBarProps) {
|
|
26
28
|
const {
|
|
27
29
|
debuggerState: { searchQuery },
|
|
28
30
|
setDebuggerState,
|
|
@@ -49,7 +51,7 @@ const SearchBar = forwardRef<View, SearchBarProps>(({ style, ...props }, ref) =>
|
|
|
49
51
|
};
|
|
50
52
|
|
|
51
53
|
return (
|
|
52
|
-
<View
|
|
54
|
+
<View style={[styles.container, style]} {...props}>
|
|
53
55
|
<SafeAreaProvider>
|
|
54
56
|
<View style={styles.barView}>
|
|
55
57
|
<SafeArea inset="top" />
|
|
@@ -87,7 +89,7 @@ const SearchBar = forwardRef<View, SearchBarProps>(({ style, ...props }, ref) =>
|
|
|
87
89
|
</SafeAreaProvider>
|
|
88
90
|
</View>
|
|
89
91
|
);
|
|
90
|
-
}
|
|
92
|
+
}
|
|
91
93
|
|
|
92
94
|
const styles = StyleSheet.create({
|
|
93
95
|
container: {
|
|
@@ -121,5 +123,3 @@ const styles = StyleSheet.create({
|
|
|
121
123
|
flex: 1,
|
|
122
124
|
},
|
|
123
125
|
});
|
|
124
|
-
|
|
125
|
-
export default SearchBar;
|