@rozenite/network-activity-plugin 1.0.0-alpha.4 → 1.0.0-alpha.6

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 (75) hide show
  1. package/dist/{panel.html → App.html} +3 -3
  2. package/dist/assets/App-CIflVb88.js +24164 -0
  3. package/dist/assets/App-Czu6Vt2P.css +1233 -0
  4. package/dist/react-native.cjs +1 -1
  5. package/dist/react-native.d.ts +1 -90
  6. package/dist/rozenite.config.d.ts +7 -0
  7. package/dist/rozenite.json +1 -1
  8. package/dist/src/react-native/network-inspector.d.ts +8 -0
  9. package/dist/src/react-native/network-requests-registry.d.ts +6 -0
  10. package/dist/src/react-native/useNetworkActivityDevTools.d.ts +2 -0
  11. package/dist/src/react-native/xhr-interceptor.d.ts +38 -0
  12. package/dist/src/shared/client.d.ts +64 -0
  13. package/dist/src/ui/App.d.ts +1 -0
  14. package/dist/src/ui/components/Badge.d.ts +9 -0
  15. package/dist/src/ui/components/Button.d.ts +11 -0
  16. package/dist/src/ui/components/Input.d.ts +3 -0
  17. package/dist/src/ui/components/JsonTree.d.ts +5 -0
  18. package/dist/src/ui/components/RequestList.d.ts +45 -0
  19. package/dist/src/ui/components/ScrollArea.d.ts +4 -0
  20. package/dist/src/ui/components/Separator.d.ts +3 -0
  21. package/dist/src/ui/tabs/CookiesTab.d.ts +8 -0
  22. package/dist/src/ui/tabs/HeadersTab.d.ts +17 -0
  23. package/dist/src/ui/tabs/RequestTab.d.ts +10 -0
  24. package/dist/src/ui/tabs/ResponseTab.d.ts +12 -0
  25. package/dist/src/ui/tabs/TimingTab.d.ts +7 -0
  26. package/dist/src/ui/types.d.ts +23 -0
  27. package/dist/src/ui/utils.d.ts +2 -0
  28. package/dist/src/ui/views/InspectorView.d.ts +5 -0
  29. package/dist/src/ui/views/LoadingView.d.ts +1 -0
  30. package/dist/useNetworkActivityDevTools.cjs +360 -0
  31. package/dist/useNetworkActivityDevTools.js +108 -236
  32. package/package.json +23 -16
  33. package/postcss.config.js +6 -0
  34. package/rozenite.config.ts +1 -1
  35. package/src/react-native/network-inspector.ts +113 -260
  36. package/src/react-native/network-requests-registry.ts +7 -77
  37. package/src/react-native/useNetworkActivityDevTools.ts +1 -1
  38. package/src/react-native/xhr-interceptor.ts +2 -2
  39. package/src/react-native/xml-request.d.ts +11 -1
  40. package/src/shared/client.ts +80 -0
  41. package/src/ui/App.tsx +19 -0
  42. package/src/ui/components/Badge.tsx +36 -0
  43. package/src/ui/components/Button.tsx +56 -0
  44. package/src/ui/components/Input.tsx +22 -0
  45. package/src/ui/components/JsonTree.tsx +37 -0
  46. package/src/ui/components/RequestList.tsx +376 -0
  47. package/src/ui/components/ScrollArea.tsx +48 -0
  48. package/src/ui/components/Separator.tsx +31 -0
  49. package/src/ui/components/Tabs.tsx +55 -0
  50. package/src/ui/globals.css +90 -0
  51. package/src/ui/tabs/CookiesTab.tsx +290 -0
  52. package/src/ui/tabs/HeadersTab.tsx +117 -0
  53. package/src/ui/tabs/RequestTab.tsx +72 -0
  54. package/src/ui/tabs/ResponseTab.tsx +140 -0
  55. package/src/ui/tabs/TimingTab.tsx +71 -0
  56. package/src/ui/types.ts +30 -0
  57. package/src/ui/utils.ts +5 -97
  58. package/src/ui/views/InspectorView.tsx +349 -0
  59. package/src/ui/views/LoadingView.tsx +19 -0
  60. package/tailwind.config.ts +93 -0
  61. package/dist/assets/panel-C0o5JcM0.js +0 -16664
  62. package/dist/assets/panel-DXGMsavf.css +0 -555
  63. package/src/types/client.ts +0 -111
  64. package/src/types/network.ts +0 -32
  65. package/src/ui/components.module.css +0 -158
  66. package/src/ui/components.tsx +0 -241
  67. package/src/ui/network-details.module.css +0 -197
  68. package/src/ui/network-details.tsx +0 -345
  69. package/src/ui/network-list.module.css +0 -128
  70. package/src/ui/network-list.tsx +0 -240
  71. package/src/ui/network-toolbar.module.css +0 -9
  72. package/src/ui/network-toolbar.tsx +0 -34
  73. package/src/ui/panel.module.css +0 -67
  74. package/src/ui/panel.tsx +0 -319
  75. package/src/ui/tanstack-query.tsx +0 -204
@@ -1,158 +0,0 @@
1
- /* Button Component */
2
- .button {
3
- border: none;
4
- border-radius: 4px;
5
- cursor: pointer;
6
- font-weight: 500;
7
- transition: all 0.2s ease;
8
- }
9
-
10
- .button:disabled {
11
- opacity: 0.6;
12
- cursor: not-allowed;
13
- }
14
-
15
- .buttonSmall {
16
- font-size: 12px;
17
- padding: 4px 8px;
18
- }
19
-
20
- .buttonMedium {
21
- font-size: 14px;
22
- padding: 8px 16px;
23
- }
24
-
25
- .buttonLarge {
26
- font-size: 16px;
27
- padding: 12px 24px;
28
- }
29
-
30
- .buttonPrimary {
31
- background-color: #007AFF;
32
- color: white;
33
- }
34
-
35
- .buttonSecondary {
36
- background-color: #6c757d;
37
- color: white;
38
- }
39
-
40
- .buttonDanger {
41
- background-color: #dc3545;
42
- color: white;
43
- }
44
-
45
- .buttonSuccess {
46
- background-color: #28a745;
47
- color: white;
48
- }
49
-
50
- /* Card Component */
51
- .card {
52
- background-color: #ffffff;
53
- border: 1px solid #e0e0e0;
54
- border-radius: 8px;
55
- padding: 16px;
56
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
57
- }
58
-
59
- /* Badge Component */
60
- .badge {
61
- background-color: #007AFF;
62
- color: white;
63
- padding: 2px 6px;
64
- border-radius: 12px;
65
- font-size: 11px;
66
- font-weight: 500;
67
- display: inline-block;
68
- }
69
-
70
- /* Toolbar Component */
71
- .toolbar {
72
- display: flex;
73
- align-items: center;
74
- padding: 8px 12px;
75
- border-bottom: 1px solid #e0e0e0;
76
- background-color: #f8f9fa;
77
- }
78
-
79
- /* Panel Header Component */
80
- .panelHeader {
81
- display: flex;
82
- align-items: center;
83
- padding: 8px 12px;
84
- border-bottom: 1px solid #e0e0e0;
85
- background-color: #f8f9fa;
86
- font-size: 12px;
87
- font-weight: bold;
88
- color: #333;
89
- }
90
-
91
- /* Empty State Component */
92
- .emptyState {
93
- display: flex;
94
- align-items: center;
95
- justify-content: center;
96
- padding: 40px 20px;
97
- color: #666;
98
- font-size: 14px;
99
- text-align: center;
100
- }
101
-
102
- /* Loading Spinner Component */
103
- .loadingSpinner {
104
- border: 2px solid #e0e0e0;
105
- border-top: 2px solid #007AFF;
106
- border-radius: 50%;
107
- animation: spin 1s linear infinite;
108
- }
109
-
110
- /* Tooltip Component */
111
- .tooltipReference {
112
- display: inline-block;
113
- }
114
-
115
- .tooltipFloating {
116
- padding: 6px 10px;
117
- border-radius: 6px;
118
- font-size: 12px;
119
- white-space: nowrap;
120
- z-index: 1000;
121
- max-width: 300px;
122
- word-break: break-all;
123
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
124
- -webkit-backdrop-filter: blur(8px);
125
- backdrop-filter: blur(8px);
126
- font-family: system-ui, -apple-system, sans-serif;
127
- line-height: 1.4;
128
- }
129
-
130
- .tooltipDefault {
131
- background-color: #333;
132
- color: white;
133
- border: 1px solid rgba(255, 255, 255, 0.1);
134
- }
135
-
136
- .tooltipInfo {
137
- background-color: #0066cc;
138
- color: white;
139
- border: 1px solid rgba(255, 255, 255, 0.2);
140
- }
141
-
142
- .tooltipWarning {
143
- background-color: #ff8c00;
144
- color: white;
145
- border: 1px solid rgba(255, 255, 255, 0.2);
146
- }
147
-
148
- .tooltipError {
149
- background-color: #dc3545;
150
- color: white;
151
- border: 1px solid rgba(255, 255, 255, 0.2);
152
- }
153
-
154
- /* Spinner Animation */
155
- @keyframes spin {
156
- 0% { transform: rotate(0deg); }
157
- 100% { transform: rotate(360deg); }
158
- }
@@ -1,241 +0,0 @@
1
- import React, { useState, useRef } from 'react';
2
- import {
3
- useFloating,
4
- useHover,
5
- useInteractions,
6
- useRole,
7
- useDismiss,
8
- FloatingPortal,
9
- offset,
10
- shift,
11
- flip,
12
- autoUpdate,
13
- } from '@floating-ui/react';
14
- import styles from './components.module.css';
15
-
16
- // Button Component
17
- interface ButtonProps {
18
- onClick: () => void;
19
- children: React.ReactNode;
20
- variant?: 'primary' | 'secondary' | 'danger' | 'success';
21
- size?: 'small' | 'medium' | 'large';
22
- disabled?: boolean;
23
- style?: React.CSSProperties;
24
- className?: string;
25
- }
26
-
27
- export const Button: React.FC<ButtonProps> = ({
28
- onClick,
29
- children,
30
- variant = 'primary',
31
- size = 'medium',
32
- disabled = false,
33
- style,
34
- className,
35
- }) => {
36
- const sizeClass =
37
- size === 'small'
38
- ? styles.buttonSmall
39
- : size === 'large'
40
- ? styles.buttonLarge
41
- : styles.buttonMedium;
42
- const variantClass =
43
- styles[
44
- `button${
45
- variant.charAt(0).toUpperCase() + variant.slice(1)
46
- }` as keyof typeof styles
47
- ];
48
-
49
- return (
50
- <button
51
- onClick={onClick}
52
- disabled={disabled}
53
- className={`${styles.button} ${sizeClass} ${variantClass} ${
54
- className || ''
55
- }`}
56
- style={style}
57
- >
58
- {children}
59
- </button>
60
- );
61
- };
62
-
63
- // Card Component
64
- interface CardProps {
65
- children: React.ReactNode;
66
- style?: React.CSSProperties;
67
- className?: string;
68
- }
69
-
70
- export const Card: React.FC<CardProps> = ({ children, style, className }) => (
71
- <div className={`${styles.card} ${className || ''}`} style={style}>
72
- {children}
73
- </div>
74
- );
75
-
76
- // Badge Component
77
- interface BadgeProps {
78
- children: React.ReactNode;
79
- color?: string;
80
- style?: React.CSSProperties;
81
- }
82
-
83
- export const Badge: React.FC<BadgeProps> = ({
84
- children,
85
- color = '#007AFF',
86
- style,
87
- }) => (
88
- <span className={styles.badge} style={{ backgroundColor: color, ...style }}>
89
- {children}
90
- </span>
91
- );
92
-
93
- // Toolbar Component
94
- interface ToolbarProps {
95
- children: React.ReactNode;
96
- style?: React.CSSProperties;
97
- }
98
-
99
- export const Toolbar: React.FC<ToolbarProps> = ({ children, style }) => (
100
- <div className={styles.toolbar} style={style}>
101
- {children}
102
- </div>
103
- );
104
-
105
- // Panel Header Component
106
- interface PanelHeaderProps {
107
- children: React.ReactNode;
108
- style?: React.CSSProperties;
109
- }
110
-
111
- export const PanelHeader: React.FC<PanelHeaderProps> = ({
112
- children,
113
- style,
114
- }) => (
115
- <div className={styles.panelHeader} style={style}>
116
- {children}
117
- </div>
118
- );
119
-
120
- // Empty State Component
121
- interface EmptyStateProps {
122
- message: string;
123
- style?: React.CSSProperties;
124
- }
125
-
126
- export const EmptyState: React.FC<EmptyStateProps> = ({ message, style }) => (
127
- <div className={styles.emptyState} style={style}>
128
- {message}
129
- </div>
130
- );
131
-
132
- // Loading Spinner Component
133
- interface LoadingSpinnerProps {
134
- size?: number;
135
- color?: string;
136
- style?: React.CSSProperties;
137
- }
138
-
139
- export const LoadingSpinner: React.FC<LoadingSpinnerProps> = ({
140
- size = 16,
141
- color = '#007AFF',
142
- style,
143
- }) => (
144
- <div
145
- className={styles.loadingSpinner}
146
- style={{
147
- width: size,
148
- height: size,
149
- borderTopColor: color,
150
- ...style,
151
- }}
152
- />
153
- );
154
-
155
- // Tooltip Component using Floating UI
156
- interface TooltipProps {
157
- children: React.ReactNode;
158
- content: string;
159
- style?: React.CSSProperties;
160
- showOnlyWhenTruncated?: boolean;
161
- placement?: 'top' | 'bottom' | 'left' | 'right';
162
- variant?: 'default' | 'info' | 'warning' | 'error';
163
- }
164
-
165
- export const Tooltip: React.FC<TooltipProps> = ({
166
- children,
167
- content,
168
- style,
169
- showOnlyWhenTruncated = false,
170
- placement = 'top',
171
- variant = 'default',
172
- }) => {
173
- const [isOpen, setIsOpen] = useState(false);
174
- const [isTruncated, setIsTruncated] = useState(false);
175
-
176
- const { refs, floatingStyles, context } = useFloating({
177
- open: isOpen,
178
- onOpenChange: setIsOpen,
179
- placement,
180
- middleware: [offset(8), shift(), flip()],
181
- whileElementsMounted: autoUpdate,
182
- });
183
-
184
- const hover = useHover(context, {
185
- move: false,
186
- delay: { open: 200, close: 0 },
187
- });
188
-
189
- const dismiss = useDismiss(context);
190
- const role = useRole(context, { role: 'tooltip' });
191
-
192
- const { getReferenceProps, getFloatingProps } = useInteractions([
193
- hover,
194
- dismiss,
195
- role,
196
- ]);
197
-
198
- React.useEffect(() => {
199
- if (showOnlyWhenTruncated && refs.reference.current) {
200
- const element = refs.reference.current as HTMLElement;
201
- if (element && 'scrollWidth' in element && 'clientWidth' in element) {
202
- setIsTruncated(element.scrollWidth > element.clientWidth);
203
- }
204
- }
205
- }, [content, showOnlyWhenTruncated, refs.reference]);
206
-
207
- const shouldShowTooltip = showOnlyWhenTruncated ? isTruncated : true;
208
-
209
- const variantClass =
210
- styles[
211
- `tooltip${
212
- variant.charAt(0).toUpperCase() + variant.slice(1)
213
- }` as keyof typeof styles
214
- ];
215
-
216
- return (
217
- <>
218
- <div
219
- ref={refs.setReference}
220
- className={styles.tooltipReference}
221
- style={style}
222
- {...getReferenceProps()}
223
- >
224
- {children}
225
- </div>
226
-
227
- <FloatingPortal>
228
- {isOpen && (
229
- <div
230
- ref={refs.setFloating}
231
- className={`${styles.tooltipFloating} ${variantClass}`}
232
- style={floatingStyles}
233
- {...getFloatingProps()}
234
- >
235
- {content}
236
- </div>
237
- )}
238
- </FloatingPortal>
239
- </>
240
- );
241
- };
@@ -1,197 +0,0 @@
1
- .container {
2
- padding: 16px;
3
- height: 100%;
4
- overflow: auto;
5
- }
6
-
7
- .card {
8
- margin-bottom: 20px;
9
- }
10
-
11
- .cardTitle {
12
- margin: 0 0 8px 0;
13
- font-size: 16px;
14
- }
15
-
16
- .cardTitleError {
17
- margin: 0 0 8px 0;
18
- font-size: 16px;
19
- color: #f44336;
20
- }
21
-
22
- .infoText {
23
- font-size: 12px;
24
- font-family: monospace;
25
- }
26
-
27
- .infoRow {
28
- margin-bottom: 4px;
29
- word-break: break-all;
30
- }
31
-
32
- .infoRowUrl {
33
- margin-bottom: 4px;
34
- word-break: break-all;
35
- }
36
-
37
- .infoRowSub {
38
- margin-bottom: 2px;
39
- margin-left: 16px;
40
- word-break: break-all;
41
- font-size: 11px;
42
- color: #666;
43
- }
44
-
45
- .urlText {
46
- cursor: help;
47
- border-bottom: 1px dotted #666;
48
- }
49
-
50
- .headersContainer {
51
- font-size: 12px;
52
- font-family: monospace;
53
- background-color: #f5f5f5;
54
- padding: 8px;
55
- border-radius: 4px;
56
- }
57
-
58
- .headerRow {
59
- margin-bottom: 2px;
60
- word-break: break-all;
61
- }
62
-
63
- .headerValue {
64
- word-break: break-all;
65
- }
66
-
67
- .postDataContainer {
68
- background-color: #f5f5f5;
69
- padding: 8px;
70
- border-radius: 4px;
71
- max-height: 200px;
72
- overflow: auto;
73
- }
74
-
75
- .postDataText {
76
- margin: 0;
77
- font-size: 12px;
78
- font-family: monospace;
79
- white-space: pre-wrap;
80
- word-break: break-all;
81
- }
82
-
83
- .responseBodyContainer {
84
- background-color: #f5f5f5;
85
- padding: 8px;
86
- border-radius: 4px;
87
- max-height: 300px;
88
- overflow: auto;
89
- }
90
-
91
- .responseBodyText {
92
- margin: 0;
93
- font-size: 12px;
94
- font-family: monospace;
95
- white-space: pre-wrap;
96
- word-break: break-all;
97
- }
98
-
99
- .loadResponseBodyButton {
100
- background-color: #007acc;
101
- color: white;
102
- border: none;
103
- padding: 8px 16px;
104
- border-radius: 4px;
105
- cursor: pointer;
106
- font-size: 12px;
107
- }
108
-
109
- .loadResponseBodyButton:hover:not(:disabled) {
110
- background-color: #005a9e;
111
- }
112
-
113
- .loadResponseBodyButton:disabled {
114
- background-color: #ccc;
115
- cursor: not-allowed;
116
- }
117
-
118
- .symbolicateButton {
119
- background-color: #28a745;
120
- color: white;
121
- border: none;
122
- padding: 4px 8px;
123
- border-radius: 4px;
124
- cursor: pointer;
125
- font-size: 11px;
126
- margin-top: 4px;
127
- }
128
-
129
- .symbolicateButton:hover:not(:disabled) {
130
- background-color: #218838;
131
- }
132
-
133
- .symbolicateButton:disabled {
134
- background-color: #ccc;
135
- cursor: not-allowed;
136
- }
137
-
138
- .symbolicatedContainer {
139
- font-size: 12px;
140
- font-family: monospace;
141
- }
142
-
143
- .codeFrameContainer {
144
- margin-bottom: 16px;
145
- }
146
-
147
- .codeFrameTitle {
148
- margin: 0 0 8px 0;
149
- font-size: 14px;
150
- font-weight: bold;
151
- }
152
-
153
- .codeFrameContent {
154
- background-color: #f5f5f5;
155
- padding: 8px;
156
- border-radius: 4px;
157
- margin: 0;
158
- font-size: 11px;
159
- white-space: pre-wrap;
160
- word-break: break-all;
161
- max-height: 200px;
162
- overflow: auto;
163
- }
164
-
165
- .stackContainer {
166
- background-color: #f5f5f5;
167
- padding: 8px;
168
- border-radius: 4px;
169
- }
170
-
171
- .stackTitle {
172
- margin: 0 0 8px 0;
173
- font-size: 14px;
174
- font-weight: bold;
175
- }
176
-
177
- .stackFrame {
178
- margin-bottom: 8px;
179
- padding: 4px 0;
180
- border-bottom: 1px solid #ddd;
181
- }
182
-
183
- .stackFrame:last-child {
184
- border-bottom: none;
185
- margin-bottom: 0;
186
- }
187
-
188
- .stackFrameHeader {
189
- margin-bottom: 2px;
190
- color: #333;
191
- }
192
-
193
- .stackFrameLocation {
194
- font-size: 11px;
195
- color: #666;
196
- word-break: break-all;
197
- }