react-native-xenon 0.4.1 → 0.5.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.
Files changed (156) hide show
  1. package/LICENSE +1 -1
  2. package/lib/commonjs/assets/icons/arrow-left.png +0 -0
  3. package/lib/commonjs/assets/icons/beautify.png +0 -0
  4. package/lib/commonjs/assets/icons/share.png +0 -0
  5. package/lib/commonjs/core/utils.js +49 -14
  6. package/lib/commonjs/core/utils.js.map +1 -1
  7. package/lib/commonjs/hooks/useNetworkInterceptor.js +5 -4
  8. package/lib/commonjs/hooks/useNetworkInterceptor.js.map +1 -1
  9. package/lib/commonjs/interceptors/FetchInterceptor.js +1 -1
  10. package/lib/commonjs/interceptors/FetchInterceptor.js.map +1 -1
  11. package/lib/commonjs/theme/colors.js +1 -0
  12. package/lib/commonjs/theme/colors.js.map +1 -1
  13. package/lib/commonjs/theme/icons.js +4 -1
  14. package/lib/commonjs/theme/icons.js.map +1 -1
  15. package/lib/commonjs/types/common.js.map +1 -1
  16. package/lib/commonjs/ui/Xenon.js +92 -110
  17. package/lib/commonjs/ui/Xenon.js.map +1 -1
  18. package/lib/commonjs/ui/components/details/DetailsViewer.js +11 -7
  19. package/lib/commonjs/ui/components/details/DetailsViewer.js.map +1 -1
  20. package/lib/commonjs/ui/components/details/NetworkRequestDetails.js +55 -60
  21. package/lib/commonjs/ui/components/details/NetworkRequestDetails.js.map +1 -1
  22. package/lib/commonjs/ui/components/headers/DebuggerHeader.js +139 -73
  23. package/lib/commonjs/ui/components/headers/DebuggerHeader.js.map +1 -1
  24. package/lib/commonjs/ui/components/headers/NetworkPanelHeader.js +3 -3
  25. package/lib/commonjs/ui/components/headers/NetworkPanelHeader.js.map +1 -1
  26. package/lib/commonjs/ui/components/items/DebuggerHeaderItem.js +4 -4
  27. package/lib/commonjs/ui/components/items/DebuggerHeaderItem.js.map +1 -1
  28. package/lib/commonjs/ui/components/items/NetworkPanelItem.js +4 -4
  29. package/lib/commonjs/ui/components/items/NetworkPanelItem.js.map +1 -1
  30. package/lib/commonjs/ui/components/panels/ConsolePanel.js +8 -5
  31. package/lib/commonjs/ui/components/panels/ConsolePanel.js.map +1 -1
  32. package/lib/commonjs/ui/components/panels/NetworkPanel.js +6 -4
  33. package/lib/commonjs/ui/components/panels/NetworkPanel.js.map +1 -1
  34. package/lib/module/assets/icons/arrow-left.png +0 -0
  35. package/lib/module/assets/icons/beautify.png +0 -0
  36. package/lib/module/assets/icons/share.png +0 -0
  37. package/lib/module/core/utils.js +49 -14
  38. package/lib/module/core/utils.js.map +1 -1
  39. package/lib/module/hooks/useNetworkInterceptor.js +5 -4
  40. package/lib/module/hooks/useNetworkInterceptor.js.map +1 -1
  41. package/lib/module/interceptors/FetchInterceptor.js +1 -1
  42. package/lib/module/interceptors/FetchInterceptor.js.map +1 -1
  43. package/lib/module/theme/colors.js +1 -0
  44. package/lib/module/theme/colors.js.map +1 -1
  45. package/lib/module/theme/icons.js +4 -1
  46. package/lib/module/theme/icons.js.map +1 -1
  47. package/lib/module/types/common.js.map +1 -1
  48. package/lib/module/ui/Xenon.js +92 -110
  49. package/lib/module/ui/Xenon.js.map +1 -1
  50. package/lib/module/ui/components/details/DetailsViewer.js +11 -7
  51. package/lib/module/ui/components/details/DetailsViewer.js.map +1 -1
  52. package/lib/module/ui/components/details/NetworkRequestDetails.js +55 -60
  53. package/lib/module/ui/components/details/NetworkRequestDetails.js.map +1 -1
  54. package/lib/module/ui/components/headers/DebuggerHeader.js +139 -73
  55. package/lib/module/ui/components/headers/DebuggerHeader.js.map +1 -1
  56. package/lib/module/ui/components/headers/NetworkPanelHeader.js +3 -3
  57. package/lib/module/ui/components/headers/NetworkPanelHeader.js.map +1 -1
  58. package/lib/module/ui/components/items/DebuggerHeaderItem.js +4 -4
  59. package/lib/module/ui/components/items/DebuggerHeaderItem.js.map +1 -1
  60. package/lib/module/ui/components/items/NetworkPanelItem.js +4 -4
  61. package/lib/module/ui/components/items/NetworkPanelItem.js.map +1 -1
  62. package/lib/module/ui/components/panels/ConsolePanel.js +8 -5
  63. package/lib/module/ui/components/panels/ConsolePanel.js.map +1 -1
  64. package/lib/module/ui/components/panels/NetworkPanel.js +6 -4
  65. package/lib/module/ui/components/panels/NetworkPanel.js.map +1 -1
  66. package/lib/typescript/commonjs/src/contexts/MainContext.d.ts +1 -1
  67. package/lib/typescript/commonjs/src/contexts/MainContext.d.ts.map +1 -1
  68. package/lib/typescript/commonjs/src/core/utils.d.ts +14 -4
  69. package/lib/typescript/commonjs/src/core/utils.d.ts.map +1 -1
  70. package/lib/typescript/commonjs/src/hooks/useNetworkInterceptor.d.ts.map +1 -1
  71. package/lib/typescript/commonjs/src/interceptors/FetchInterceptor.d.ts.map +1 -1
  72. package/lib/typescript/commonjs/src/theme/colors.d.ts +1 -0
  73. package/lib/typescript/commonjs/src/theme/colors.d.ts.map +1 -1
  74. package/lib/typescript/commonjs/src/theme/icons.d.ts +3 -0
  75. package/lib/typescript/commonjs/src/theme/icons.d.ts.map +1 -1
  76. package/lib/typescript/commonjs/src/types/common.d.ts +13 -1
  77. package/lib/typescript/commonjs/src/types/common.d.ts.map +1 -1
  78. package/lib/typescript/commonjs/src/ui/Xenon.d.ts +12 -15
  79. package/lib/typescript/commonjs/src/ui/Xenon.d.ts.map +1 -1
  80. package/lib/typescript/commonjs/src/ui/components/details/DetailsViewer.d.ts.map +1 -1
  81. package/lib/typescript/commonjs/src/ui/components/details/NetworkRequestDetails.d.ts.map +1 -1
  82. package/lib/typescript/commonjs/src/ui/components/headers/DebuggerHeader.d.ts +1 -5
  83. package/lib/typescript/commonjs/src/ui/components/headers/DebuggerHeader.d.ts.map +1 -1
  84. package/lib/typescript/commonjs/src/ui/components/items/DebuggerHeaderItem.d.ts +2 -1
  85. package/lib/typescript/commonjs/src/ui/components/items/DebuggerHeaderItem.d.ts.map +1 -1
  86. package/lib/typescript/commonjs/src/ui/components/panels/ConsolePanel.d.ts.map +1 -1
  87. package/lib/typescript/commonjs/src/ui/components/panels/NetworkPanel.d.ts.map +1 -1
  88. package/lib/typescript/module/src/contexts/MainContext.d.ts +1 -1
  89. package/lib/typescript/module/src/contexts/MainContext.d.ts.map +1 -1
  90. package/lib/typescript/module/src/core/utils.d.ts +14 -4
  91. package/lib/typescript/module/src/core/utils.d.ts.map +1 -1
  92. package/lib/typescript/module/src/hooks/useNetworkInterceptor.d.ts.map +1 -1
  93. package/lib/typescript/module/src/interceptors/FetchInterceptor.d.ts.map +1 -1
  94. package/lib/typescript/module/src/theme/colors.d.ts +1 -0
  95. package/lib/typescript/module/src/theme/colors.d.ts.map +1 -1
  96. package/lib/typescript/module/src/theme/icons.d.ts +3 -0
  97. package/lib/typescript/module/src/theme/icons.d.ts.map +1 -1
  98. package/lib/typescript/module/src/types/common.d.ts +13 -1
  99. package/lib/typescript/module/src/types/common.d.ts.map +1 -1
  100. package/lib/typescript/module/src/ui/Xenon.d.ts +12 -15
  101. package/lib/typescript/module/src/ui/Xenon.d.ts.map +1 -1
  102. package/lib/typescript/module/src/ui/components/details/DetailsViewer.d.ts.map +1 -1
  103. package/lib/typescript/module/src/ui/components/details/NetworkRequestDetails.d.ts.map +1 -1
  104. package/lib/typescript/module/src/ui/components/headers/DebuggerHeader.d.ts +1 -5
  105. package/lib/typescript/module/src/ui/components/headers/DebuggerHeader.d.ts.map +1 -1
  106. package/lib/typescript/module/src/ui/components/items/DebuggerHeaderItem.d.ts +2 -1
  107. package/lib/typescript/module/src/ui/components/items/DebuggerHeaderItem.d.ts.map +1 -1
  108. package/lib/typescript/module/src/ui/components/panels/ConsolePanel.d.ts.map +1 -1
  109. package/lib/typescript/module/src/ui/components/panels/NetworkPanel.d.ts.map +1 -1
  110. package/package.json +1 -1
  111. package/src/assets/icons/arrow-left.png +0 -0
  112. package/src/assets/icons/beautify.png +0 -0
  113. package/src/assets/icons/share.png +0 -0
  114. package/src/contexts/MainContext.ts +1 -1
  115. package/src/core/utils.ts +56 -17
  116. package/src/hooks/useNetworkInterceptor.ts +17 -4
  117. package/src/interceptors/FetchInterceptor.ts +5 -1
  118. package/src/theme/colors.ts +1 -0
  119. package/src/theme/icons.ts +3 -0
  120. package/src/types/common.ts +17 -1
  121. package/src/ui/Xenon.tsx +78 -107
  122. package/src/ui/components/details/DetailsViewer.tsx +9 -7
  123. package/src/ui/components/details/NetworkRequestDetails.tsx +87 -74
  124. package/src/ui/components/headers/DebuggerHeader.tsx +199 -91
  125. package/src/ui/components/headers/NetworkPanelHeader.tsx +3 -3
  126. package/src/ui/components/items/DebuggerHeaderItem.tsx +3 -4
  127. package/src/ui/components/items/NetworkPanelItem.tsx +4 -4
  128. package/src/ui/components/panels/ConsolePanel.tsx +8 -4
  129. package/src/ui/components/panels/NetworkPanel.tsx +13 -3
  130. package/lib/commonjs/core/data.js +0 -10
  131. package/lib/commonjs/core/data.js.map +0 -1
  132. package/lib/commonjs/ui/components/headers/NetworkRequestDetailsHeader.js +0 -64
  133. package/lib/commonjs/ui/components/headers/NetworkRequestDetailsHeader.js.map +0 -1
  134. package/lib/commonjs/ui/components/items/NetworkRequestDetailsHeaderItem.js +0 -48
  135. package/lib/commonjs/ui/components/items/NetworkRequestDetailsHeaderItem.js.map +0 -1
  136. package/lib/module/core/data.js +0 -10
  137. package/lib/module/core/data.js.map +0 -1
  138. package/lib/module/ui/components/headers/NetworkRequestDetailsHeader.js +0 -64
  139. package/lib/module/ui/components/headers/NetworkRequestDetailsHeader.js.map +0 -1
  140. package/lib/module/ui/components/items/NetworkRequestDetailsHeaderItem.js +0 -48
  141. package/lib/module/ui/components/items/NetworkRequestDetailsHeaderItem.js.map +0 -1
  142. package/lib/typescript/commonjs/src/core/data.d.ts +0 -10
  143. package/lib/typescript/commonjs/src/core/data.d.ts.map +0 -1
  144. package/lib/typescript/commonjs/src/ui/components/headers/NetworkRequestDetailsHeader.d.ts +0 -13
  145. package/lib/typescript/commonjs/src/ui/components/headers/NetworkRequestDetailsHeader.d.ts.map +0 -1
  146. package/lib/typescript/commonjs/src/ui/components/items/NetworkRequestDetailsHeaderItem.d.ts +0 -9
  147. package/lib/typescript/commonjs/src/ui/components/items/NetworkRequestDetailsHeaderItem.d.ts.map +0 -1
  148. package/lib/typescript/module/src/core/data.d.ts +0 -10
  149. package/lib/typescript/module/src/core/data.d.ts.map +0 -1
  150. package/lib/typescript/module/src/ui/components/headers/NetworkRequestDetailsHeader.d.ts +0 -13
  151. package/lib/typescript/module/src/ui/components/headers/NetworkRequestDetailsHeader.d.ts.map +0 -1
  152. package/lib/typescript/module/src/ui/components/items/NetworkRequestDetailsHeaderItem.d.ts +0 -9
  153. package/lib/typescript/module/src/ui/components/items/NetworkRequestDetailsHeaderItem.d.ts.map +0 -1
  154. package/src/core/data.ts +0 -12
  155. package/src/ui/components/headers/NetworkRequestDetailsHeader.tsx +0 -90
  156. package/src/ui/components/items/NetworkRequestDetailsHeaderItem.tsx +0 -49
@@ -1 +1 @@
1
- {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../../../src/theme/icons.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,KAAK;;;;;;EAMT,CAAC;AAEH,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../../../src/theme/icons.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,KAAK;;;;;;;;;EAST,CAAC;AAEH,eAAe,KAAK,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { HttpRequest, LogMessage, WebSocketRequest } from '.';
1
2
  export declare enum NetworkType {
2
3
  XHR = "xhr",
3
4
  Fetch = "fetch",
@@ -14,10 +15,21 @@ export interface NetworkRequest {
14
15
  status?: number;
15
16
  duration?: number;
16
17
  }
17
- export type NetworkTab = 'headers' | 'queryStringParameters' | 'body' | 'response' | 'messages';
18
+ export type DetailTab = 'overview' | 'headers' | 'request' | 'response' | 'messages' | 'logMessage';
18
19
  export interface DebuggerState {
19
20
  visibility: 'hidden' | 'bubble' | 'panel';
20
21
  position: 'top' | 'bottom';
21
22
  selectedPanel: DebuggerPanel | null;
23
+ detailsData: {
24
+ type: DebuggerPanel.Network;
25
+ data: HttpRequest | WebSocketRequest;
26
+ selectedTab: Exclude<DetailTab, 'logMessage'>;
27
+ beautified: boolean;
28
+ } | {
29
+ type: DebuggerPanel.Console;
30
+ data: LogMessage;
31
+ selectedTab: Extract<DetailTab, 'logMessage'>;
32
+ beautified: boolean;
33
+ } | null;
22
34
  }
23
35
  //# sourceMappingURL=common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/types/common.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,EAAE,OAAO;CACV;AAED,oBAAY,aAAa;IACvB,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAElD,MAAM,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;AAEpC,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,uBAAuB,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;AAEhG,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC1C,QAAQ,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC3B,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;CACrC"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/types/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,GAAG,CAAC;AAEnE,oBAAY,WAAW;IACrB,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,EAAE,OAAO;CACV;AAED,oBAAY,aAAa;IACvB,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAElD,MAAM,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;AAEpC,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,YAAY,CAAC;AAEpG,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC1C,QAAQ,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC3B,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;IACpC,WAAW,EACP;QACE,IAAI,EAAE,aAAa,CAAC,OAAO,CAAC;QAC5B,IAAI,EAAE,WAAW,GAAG,gBAAgB,CAAC;QACrC,WAAW,EAAE,OAAO,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QAC9C,UAAU,EAAE,OAAO,CAAC;KACrB,GACD;QACE,IAAI,EAAE,aAAa,CAAC,OAAO,CAAC;QAC5B,IAAI,EAAE,UAAU,CAAC;QACjB,WAAW,EAAE,OAAO,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QAC9C,UAAU,EAAE,OAAO,CAAC;KACrB,GACD,IAAI,CAAC;CACV"}
@@ -1,18 +1,15 @@
1
- import { type NamedExoticComponent } from 'react';
2
- interface XenonComponentMethods {
3
- isVisible(): boolean;
4
- show(): void;
5
- hide(): void;
1
+ declare namespace Xenon {
2
+ interface Props {
3
+ autoInspectNetworkEnabled?: boolean;
4
+ autoInspectConsoleEnabled?: boolean;
5
+ bubbleSize?: number;
6
+ idleBubbleOpacity?: number;
7
+ }
8
+ export const isVisible: () => boolean;
9
+ export const show: () => void;
10
+ export const hide: () => void;
11
+ export const Component: import("react").MemoExoticComponent<({ autoInspectNetworkEnabled, autoInspectConsoleEnabled, bubbleSize, idleBubbleOpacity, }: Props) => import("react/jsx-runtime").JSX.Element>;
12
+ export {};
6
13
  }
7
- interface XenonComponentProps {
8
- autoInspectNetworkEnabled?: boolean;
9
- autoInspectConsoleEnabled?: boolean;
10
- bubbleSize?: number;
11
- idleBubbleOpacity?: number;
12
- }
13
- interface ReactNativeXenon extends XenonComponentMethods {
14
- Component: NamedExoticComponent<XenonComponentProps>;
15
- }
16
- declare const Xenon: ReactNativeXenon;
17
14
  export default Xenon;
18
15
  //# sourceMappingURL=Xenon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Xenon.d.ts","sourceRoot":"","sources":["../../../../../src/ui/Xenon.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,oBAAoB,EAC1B,MAAM,OAAO,CAAC;AAYf,UAAU,qBAAqB;IAC7B,SAAS,IAAI,OAAO,CAAC;IACrB,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;CACd;AAED,UAAU,mBAAmB;IAC3B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,UAAU,gBAAiB,SAAQ,qBAAqB;IACtD,SAAS,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,CAAC;CACtD;AAwHD,QAAA,MAAM,KAAK,EAAE,gBAWZ,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Xenon.d.ts","sourceRoot":"","sources":["../../../../../src/ui/Xenon.tsx"],"names":[],"mappings":"AAYA,kBAAU,KAAK,CAAC;IAOd,UAAU,KAAK;QACb,yBAAyB,CAAC,EAAE,OAAO,CAAC;QACpC,yBAAyB,CAAC,EAAE,OAAO,CAAC;QACpC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B;IA2GD,MAAM,CAAC,MAAM,SAAS,eAA0C,CAAC;IACjE,MAAM,CAAC,MAAM,IAAI,QAAO,IAA2B,CAAC;IACpD,MAAM,CAAC,MAAM,IAAI,QAAO,IAA2B,CAAC;IAEpD,MAAM,CAAC,MAAM,SAAS,iIAtFnB,KAAK,6CAsF+B,CAAC;;CAEzC;AAED,eAAe,KAAK,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DetailsViewer.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/details/DetailsViewer.tsx"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,UAAU,aAAa,mDAWpC"}
1
+ {"version":3,"file":"DetailsViewer.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/details/DetailsViewer.tsx"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,UAAU,aAAa,mDAYpC"}
@@ -1 +1 @@
1
- {"version":3,"file":"NetworkRequestDetails.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/details/NetworkRequestDetails.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,WAAW,EAEhB,KAAK,gBAAgB,EACtB,MAAM,gBAAgB,CAAC;AAWxB,UAAU,0BAA0B;IAClC,IAAI,EAAE,WAAW,GAAG,gBAAgB,CAAC;CACtC;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAAE,IAAI,EAAE,EAAE,0BAA0B,2CAgHjF"}
1
+ {"version":3,"file":"NetworkRequestDetails.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/details/NetworkRequestDetails.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAkB,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGzF,UAAU,0BAA0B;IAClC,IAAI,EAAE,WAAW,GAAG,gBAAgB,CAAC;CACtC;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAAE,IAAI,EAAE,EAAE,0BAA0B,2CAiIjF"}
@@ -1,6 +1,2 @@
1
- interface DebuggerHeaderProps {
2
- detailsShown: boolean;
3
- }
4
- export default function DebuggerHeader({ detailsShown }: DebuggerHeaderProps): import("react/jsx-runtime").JSX.Element;
5
- export {};
1
+ export default function DebuggerHeader(): import("react/jsx-runtime").JSX.Element;
6
2
  //# sourceMappingURL=DebuggerHeader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DebuggerHeader.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/headers/DebuggerHeader.tsx"],"names":[],"mappings":"AAQA,UAAU,mBAAmB;IAC3B,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,YAAY,EAAE,EAAE,mBAAmB,2CAuG3E"}
1
+ {"version":3,"file":"DebuggerHeader.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/headers/DebuggerHeader.tsx"],"names":[],"mappings":"AASA,MAAM,CAAC,OAAO,UAAU,cAAc,4CAsNrC"}
@@ -3,8 +3,9 @@ interface DebuggerHeaderItemProps {
3
3
  content?: ImageRequireSource | string;
4
4
  isLabel?: boolean;
5
5
  isActive?: boolean;
6
+ activeColor?: string;
6
7
  onPress: () => void;
7
8
  }
8
- export default function DebuggerHeaderItem({ content, isLabel, isActive, onPress, }: DebuggerHeaderItemProps): import("react/jsx-runtime").JSX.Element;
9
+ export default function DebuggerHeaderItem({ content, isLabel, isActive, activeColor, onPress, }: DebuggerHeaderItemProps): import("react/jsx-runtime").JSX.Element;
9
10
  export {};
10
11
  //# sourceMappingURL=DebuggerHeaderItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DebuggerHeaderItem.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/items/DebuggerHeaderItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6C,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlG,UAAU,uBAAuB;IAC/B,OAAO,CAAC,EAAE,kBAAkB,GAAG,MAAM,CAAC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,OAAO,EACP,OAAO,EACP,QAAQ,EACR,OAAO,GACR,EAAE,uBAAuB,2CAuBzB"}
1
+ {"version":3,"file":"DebuggerHeaderItem.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/items/DebuggerHeaderItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6C,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlG,UAAU,uBAAuB;IAC/B,OAAO,CAAC,EAAE,kBAAkB,GAAG,MAAM,CAAC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,OAAO,EACP,OAAO,EACP,QAAQ,EACR,WAAwB,EACxB,OAAO,GACR,EAAE,uBAAuB,2CAuBzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConsolePanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/panels/ConsolePanel.tsx"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,YAAY,4CA+BnC"}
1
+ {"version":3,"file":"ConsolePanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/panels/ConsolePanel.tsx"],"names":[],"mappings":"AASA,MAAM,CAAC,OAAO,UAAU,YAAY,4CAoCnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"NetworkPanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/panels/NetworkPanel.tsx"],"names":[],"mappings":"AAWA,MAAM,CAAC,OAAO,UAAU,YAAY,4CAuCnC"}
1
+ {"version":3,"file":"NetworkPanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/panels/NetworkPanel.tsx"],"names":[],"mappings":"AAgBA,MAAM,CAAC,OAAO,UAAU,YAAY,4CA4CnC"}
@@ -5,7 +5,7 @@ interface MainContextValue {
5
5
  debuggerState: DebuggerState;
6
6
  setDebuggerState: Updater<DebuggerState>;
7
7
  networkInterceptor: ReturnType<typeof useNetworkInterceptor>;
8
- logInterceptor: ReturnType<typeof useConsoleInterceptor>;
8
+ consoleInterceptor: ReturnType<typeof useConsoleInterceptor>;
9
9
  }
10
10
  declare const MainContext: import("react").Context<MainContextValue | null>;
11
11
  export default MainContext;
@@ -1 +1 @@
1
- {"version":3,"file":"MainContext.d.ts","sourceRoot":"","sources":["../../../../../src/contexts/MainContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAC7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,UAAU,gBAAgB;IACxB,aAAa,EAAE,aAAa,CAAC;IAC7B,gBAAgB,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACzC,kBAAkB,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;IAC7D,cAAc,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;CAC1D;AAED,QAAA,MAAM,WAAW,kDAA+C,CAAC;AAEjE,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"MainContext.d.ts","sourceRoot":"","sources":["../../../../../src/contexts/MainContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAC7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,UAAU,gBAAgB;IACxB,aAAa,EAAE,aAAa,CAAC;IAC7B,gBAAgB,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACzC,kBAAkB,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;IAC7D,kBAAkB,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;CAC9D;AAED,QAAA,MAAM,WAAW,kDAA+C,CAAC;AAEjE,eAAe,WAAW,CAAC"}
@@ -1,13 +1,23 @@
1
- import type { HttpRequest } from '../types';
1
+ import { type HttpRequest, type WebSocketRequest } from '../types';
2
+ export declare const getNetworkUtils: (data: HttpRequest | WebSocketRequest) => {
3
+ isHttp: boolean;
4
+ requestUrl: URL;
5
+ overviewShown: boolean;
6
+ headersShown: boolean;
7
+ requestShown: boolean;
8
+ responseShown: boolean;
9
+ messagesShown: boolean;
10
+ };
2
11
  export declare const getVerticalSafeMargin: (screenHeight: number) => number;
3
- export declare const limitChar: (value: any, limit?: number) => string;
4
- export declare const getHttpInterceptorId: () => string;
5
12
  export declare const clamp: (value: number, min: number, max: number) => number;
6
- export declare const keyValueToString: (key: string, value: any) => string;
13
+ export declare const getHttpInterceptorId: () => string;
14
+ export declare const limitChar: (value: any, limit?: number) => string;
15
+ export declare const keyValueToString: (key: string, value: any, newLine?: "leading" | "trailing" | null) => string;
7
16
  export declare const formatRequestMethod: (method?: string) => string;
8
17
  export declare const formatRequestDuration: (duration?: number) => string;
9
18
  export declare const formatRequestStatusCode: (statusCode?: number) => string;
10
19
  export declare const formatLogMessage: (type: string, values: any[]) => string;
20
+ export declare const beautify: (data: any, beautified: boolean) => string;
11
21
  export declare const convertToCurl: (method: HttpRequest["method"], url: HttpRequest["url"], headers: HttpRequest["requestHeaders"], body: HttpRequest["body"]) => string;
12
22
  export declare function frozen(_target: Object): void;
13
23
  export declare function singleton<T extends {
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/core/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,eAAO,MAAM,qBAAqB,iBAAkB,MAAM,WAAqB,CAAC;AAEhF,eAAO,MAAM,SAAS,UAAW,GAAG,2BAMnC,CAAC;AAEF,eAAO,MAAM,oBAAoB,cAIhC,CAAC;AAEF,eAAO,MAAM,KAAK,UAAW,MAAM,OAAO,MAAM,OAAO,MAAM,WACxB,CAAC;AAEtC,eAAO,MAAM,gBAAgB,QAAS,MAAM,SAAS,GAAG,KAAG,MAC1B,CAAC;AAElC,eAAO,MAAM,mBAAmB,YAAa,MAAM,WAAoB,CAAC;AAExE,eAAO,MAAM,qBAAqB,cAAe,MAAM,WACf,CAAC;AAEzC,eAAO,MAAM,uBAAuB,gBAAiB,MAAM,WAAiC,CAAC;AAE7F,eAAO,MAAM,gBAAgB,SAAU,MAAM,UAAU,GAAG,EAAE,WAQ3D,CAAC;AAEF,eAAO,MAAM,aAAa,WAChB,WAAW,CAAC,QAAQ,CAAC,OACxB,WAAW,CAAC,KAAK,CAAC,WACd,WAAW,CAAC,gBAAgB,CAAC,QAChC,WAAW,CAAC,MAAM,CAAC,WAgB1B,CAAC;AAEF,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,QAIrC;AAED,wBAAgB,SAAS,CAAC,CAAC,SAAS;IAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;CAAE,EAAE,WAAW,EAAE,CAAC;kBAIvD,GAAG,EAAE;;MAS7B"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/core/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEhF,eAAO,MAAM,eAAe,SAAU,WAAW,GAAG,gBAAgB;;;;;;;;CAmBnE,CAAC;AAGF,eAAO,MAAM,qBAAqB,iBAAkB,MAAM,WAAqB,CAAC;AAEhF,eAAO,MAAM,KAAK,UAAW,MAAM,OAAO,MAAM,OAAO,MAAM,WACxB,CAAC;AAEtC,eAAO,MAAM,oBAAoB,cAIhC,CAAC;AAIF,eAAO,MAAM,SAAS,UAAW,GAAG,2BAMnC,CAAC;AAEF,eAAO,MAAM,gBAAgB,QACtB,MAAM,SACJ,GAAG,YACD,SAAS,GAAG,UAAU,GAAG,IAAI,KACrC,MACqG,CAAC;AAEzG,eAAO,MAAM,mBAAmB,YAAa,MAAM,WAAoB,CAAC;AAExE,eAAO,MAAM,qBAAqB,cAAe,MAAM,WACf,CAAC;AAEzC,eAAO,MAAM,uBAAuB,gBAAiB,MAAM,WAAiC,CAAC;AAE7F,eAAO,MAAM,gBAAgB,SAAU,MAAM,UAAU,GAAG,EAAE,WAO3D,CAAC;AAEF,eAAO,MAAM,QAAQ,SAAU,GAAG,cAAc,OAAO,WAOtD,CAAC;AAEF,eAAO,MAAM,aAAa,WAChB,WAAW,CAAC,QAAQ,CAAC,OACxB,WAAW,CAAC,KAAK,CAAC,WACd,WAAW,CAAC,gBAAgB,CAAC,QAChC,WAAW,CAAC,MAAM,CAAC,WAgB1B,CAAC;AAIF,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,QAIrC;AAED,wBAAgB,SAAS,CAAC,CAAC,SAAS;IAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;CAAE,EAAE,WAAW,EAAE,CAAC;kBAIvD,GAAG,EAAE;;MAS7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"useNetworkInterceptor.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useNetworkInterceptor.ts"],"names":[],"mappings":"AAcA,UAAU,wBAAwB;IAChC,WAAW,EAAE,OAAO,CAAC;CACtB;AAUD,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAAE,WAAW,EAAE,EAAE,wBAAwB;;;;;;EA+OtF"}
1
+ {"version":3,"file":"useNetworkInterceptor.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useNetworkInterceptor.ts"],"names":[],"mappings":"AAcA,UAAU,wBAAwB;IAChC,WAAW,EAAE,OAAO,CAAC;CACtB;AAUD,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAAE,WAAW,EAAE,EAAE,wBAAwB;;;;;;EA4PtF"}
@@ -1 +1 @@
1
- {"version":3,"file":"FetchInterceptor.d.ts","sourceRoot":"","sources":["../../../../../src/interceptors/FetchInterceptor.ts"],"names":[],"mappings":"AASA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAKhD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,eAAe;IAE3D,kBAAkB;IA+GlB,mBAAmB;CASpB"}
1
+ {"version":3,"file":"FetchInterceptor.d.ts","sourceRoot":"","sources":["../../../../../src/interceptors/FetchInterceptor.ts"],"names":[],"mappings":"AASA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAKhD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,eAAe;IAE3D,kBAAkB;IAmHlB,mBAAmB;CASpB"}
@@ -1,6 +1,7 @@
1
1
  declare const colors: Readonly<{
2
2
  black: "#000000";
3
3
  red: "#ef4444";
4
+ green: "#22c55e";
4
5
  gray: "#888888";
5
6
  lightGray: "#AAAAAA";
6
7
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../../../src/theme/colors.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,MAAM;;;;;EAKV,CAAC;AAEH,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../../../src/theme/colors.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,MAAM;;;;;;EAMV,CAAC;AAEH,eAAe,MAAM,CAAC"}
@@ -4,6 +4,9 @@ declare const icons: Readonly<{
4
4
  hide: any;
5
5
  move: any;
6
6
  record: any;
7
+ share: any;
8
+ arrowLeft: any;
9
+ beautify: any;
7
10
  }>;
8
11
  export default icons;
9
12
  //# sourceMappingURL=icons.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../../../src/theme/icons.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,KAAK;;;;;;EAMT,CAAC;AAEH,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../../../src/theme/icons.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,KAAK;;;;;;;;;EAST,CAAC;AAEH,eAAe,KAAK,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { HttpRequest, LogMessage, WebSocketRequest } from '.';
1
2
  export declare enum NetworkType {
2
3
  XHR = "xhr",
3
4
  Fetch = "fetch",
@@ -14,10 +15,21 @@ export interface NetworkRequest {
14
15
  status?: number;
15
16
  duration?: number;
16
17
  }
17
- export type NetworkTab = 'headers' | 'queryStringParameters' | 'body' | 'response' | 'messages';
18
+ export type DetailTab = 'overview' | 'headers' | 'request' | 'response' | 'messages' | 'logMessage';
18
19
  export interface DebuggerState {
19
20
  visibility: 'hidden' | 'bubble' | 'panel';
20
21
  position: 'top' | 'bottom';
21
22
  selectedPanel: DebuggerPanel | null;
23
+ detailsData: {
24
+ type: DebuggerPanel.Network;
25
+ data: HttpRequest | WebSocketRequest;
26
+ selectedTab: Exclude<DetailTab, 'logMessage'>;
27
+ beautified: boolean;
28
+ } | {
29
+ type: DebuggerPanel.Console;
30
+ data: LogMessage;
31
+ selectedTab: Extract<DetailTab, 'logMessage'>;
32
+ beautified: boolean;
33
+ } | null;
22
34
  }
23
35
  //# sourceMappingURL=common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/types/common.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,EAAE,OAAO;CACV;AAED,oBAAY,aAAa;IACvB,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAElD,MAAM,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;AAEpC,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,uBAAuB,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;AAEhG,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC1C,QAAQ,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC3B,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;CACrC"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/types/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,GAAG,CAAC;AAEnE,oBAAY,WAAW;IACrB,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,EAAE,OAAO;CACV;AAED,oBAAY,aAAa;IACvB,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAElD,MAAM,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;AAEpC,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,YAAY,CAAC;AAEpG,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC1C,QAAQ,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC3B,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;IACpC,WAAW,EACP;QACE,IAAI,EAAE,aAAa,CAAC,OAAO,CAAC;QAC5B,IAAI,EAAE,WAAW,GAAG,gBAAgB,CAAC;QACrC,WAAW,EAAE,OAAO,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QAC9C,UAAU,EAAE,OAAO,CAAC;KACrB,GACD;QACE,IAAI,EAAE,aAAa,CAAC,OAAO,CAAC;QAC5B,IAAI,EAAE,UAAU,CAAC;QACjB,WAAW,EAAE,OAAO,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QAC9C,UAAU,EAAE,OAAO,CAAC;KACrB,GACD,IAAI,CAAC;CACV"}
@@ -1,18 +1,15 @@
1
- import { type NamedExoticComponent } from 'react';
2
- interface XenonComponentMethods {
3
- isVisible(): boolean;
4
- show(): void;
5
- hide(): void;
1
+ declare namespace Xenon {
2
+ interface Props {
3
+ autoInspectNetworkEnabled?: boolean;
4
+ autoInspectConsoleEnabled?: boolean;
5
+ bubbleSize?: number;
6
+ idleBubbleOpacity?: number;
7
+ }
8
+ export const isVisible: () => boolean;
9
+ export const show: () => void;
10
+ export const hide: () => void;
11
+ export const Component: import("react").MemoExoticComponent<({ autoInspectNetworkEnabled, autoInspectConsoleEnabled, bubbleSize, idleBubbleOpacity, }: Props) => import("react/jsx-runtime").JSX.Element>;
12
+ export {};
6
13
  }
7
- interface XenonComponentProps {
8
- autoInspectNetworkEnabled?: boolean;
9
- autoInspectConsoleEnabled?: boolean;
10
- bubbleSize?: number;
11
- idleBubbleOpacity?: number;
12
- }
13
- interface ReactNativeXenon extends XenonComponentMethods {
14
- Component: NamedExoticComponent<XenonComponentProps>;
15
- }
16
- declare const Xenon: ReactNativeXenon;
17
14
  export default Xenon;
18
15
  //# sourceMappingURL=Xenon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Xenon.d.ts","sourceRoot":"","sources":["../../../../../src/ui/Xenon.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,oBAAoB,EAC1B,MAAM,OAAO,CAAC;AAYf,UAAU,qBAAqB;IAC7B,SAAS,IAAI,OAAO,CAAC;IACrB,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;CACd;AAED,UAAU,mBAAmB;IAC3B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,UAAU,gBAAiB,SAAQ,qBAAqB;IACtD,SAAS,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,CAAC;CACtD;AAwHD,QAAA,MAAM,KAAK,EAAE,gBAWZ,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Xenon.d.ts","sourceRoot":"","sources":["../../../../../src/ui/Xenon.tsx"],"names":[],"mappings":"AAYA,kBAAU,KAAK,CAAC;IAOd,UAAU,KAAK;QACb,yBAAyB,CAAC,EAAE,OAAO,CAAC;QACpC,yBAAyB,CAAC,EAAE,OAAO,CAAC;QACpC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B;IA2GD,MAAM,CAAC,MAAM,SAAS,eAA0C,CAAC;IACjE,MAAM,CAAC,MAAM,IAAI,QAAO,IAA2B,CAAC;IACpD,MAAM,CAAC,MAAM,IAAI,QAAO,IAA2B,CAAC;IAEpD,MAAM,CAAC,MAAM,SAAS,iIAtFnB,KAAK,6CAsF+B,CAAC;;CAEzC;AAED,eAAe,KAAK,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DetailsViewer.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/details/DetailsViewer.tsx"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,UAAU,aAAa,mDAWpC"}
1
+ {"version":3,"file":"DetailsViewer.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/details/DetailsViewer.tsx"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,UAAU,aAAa,mDAYpC"}
@@ -1 +1 @@
1
- {"version":3,"file":"NetworkRequestDetails.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/details/NetworkRequestDetails.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,WAAW,EAEhB,KAAK,gBAAgB,EACtB,MAAM,gBAAgB,CAAC;AAWxB,UAAU,0BAA0B;IAClC,IAAI,EAAE,WAAW,GAAG,gBAAgB,CAAC;CACtC;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAAE,IAAI,EAAE,EAAE,0BAA0B,2CAgHjF"}
1
+ {"version":3,"file":"NetworkRequestDetails.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/details/NetworkRequestDetails.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAkB,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGzF,UAAU,0BAA0B;IAClC,IAAI,EAAE,WAAW,GAAG,gBAAgB,CAAC;CACtC;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAAE,IAAI,EAAE,EAAE,0BAA0B,2CAiIjF"}
@@ -1,6 +1,2 @@
1
- interface DebuggerHeaderProps {
2
- detailsShown: boolean;
3
- }
4
- export default function DebuggerHeader({ detailsShown }: DebuggerHeaderProps): import("react/jsx-runtime").JSX.Element;
5
- export {};
1
+ export default function DebuggerHeader(): import("react/jsx-runtime").JSX.Element;
6
2
  //# sourceMappingURL=DebuggerHeader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DebuggerHeader.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/headers/DebuggerHeader.tsx"],"names":[],"mappings":"AAQA,UAAU,mBAAmB;IAC3B,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,YAAY,EAAE,EAAE,mBAAmB,2CAuG3E"}
1
+ {"version":3,"file":"DebuggerHeader.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/headers/DebuggerHeader.tsx"],"names":[],"mappings":"AASA,MAAM,CAAC,OAAO,UAAU,cAAc,4CAsNrC"}
@@ -3,8 +3,9 @@ interface DebuggerHeaderItemProps {
3
3
  content?: ImageRequireSource | string;
4
4
  isLabel?: boolean;
5
5
  isActive?: boolean;
6
+ activeColor?: string;
6
7
  onPress: () => void;
7
8
  }
8
- export default function DebuggerHeaderItem({ content, isLabel, isActive, onPress, }: DebuggerHeaderItemProps): import("react/jsx-runtime").JSX.Element;
9
+ export default function DebuggerHeaderItem({ content, isLabel, isActive, activeColor, onPress, }: DebuggerHeaderItemProps): import("react/jsx-runtime").JSX.Element;
9
10
  export {};
10
11
  //# sourceMappingURL=DebuggerHeaderItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DebuggerHeaderItem.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/items/DebuggerHeaderItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6C,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlG,UAAU,uBAAuB;IAC/B,OAAO,CAAC,EAAE,kBAAkB,GAAG,MAAM,CAAC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,OAAO,EACP,OAAO,EACP,QAAQ,EACR,OAAO,GACR,EAAE,uBAAuB,2CAuBzB"}
1
+ {"version":3,"file":"DebuggerHeaderItem.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/items/DebuggerHeaderItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6C,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlG,UAAU,uBAAuB;IAC/B,OAAO,CAAC,EAAE,kBAAkB,GAAG,MAAM,CAAC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,OAAO,EACP,OAAO,EACP,QAAQ,EACR,WAAwB,EACxB,OAAO,GACR,EAAE,uBAAuB,2CAuBzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConsolePanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/panels/ConsolePanel.tsx"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,YAAY,4CA+BnC"}
1
+ {"version":3,"file":"ConsolePanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/panels/ConsolePanel.tsx"],"names":[],"mappings":"AASA,MAAM,CAAC,OAAO,UAAU,YAAY,4CAoCnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"NetworkPanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/panels/NetworkPanel.tsx"],"names":[],"mappings":"AAWA,MAAM,CAAC,OAAO,UAAU,YAAY,4CAuCnC"}
1
+ {"version":3,"file":"NetworkPanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/panels/NetworkPanel.tsx"],"names":[],"mappings":"AAgBA,MAAM,CAAC,OAAO,UAAU,YAAY,4CA4CnC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-xenon",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "A comprehensive tool for analyzing HTTP(S) requests and logs in React Native apps. Designed for use across all environments, it offers an intuitive interface for efficient debugging and issue resolution.",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./lib/commonjs/index.js",
Binary file
Binary file
Binary file
@@ -7,7 +7,7 @@ interface MainContextValue {
7
7
  debuggerState: DebuggerState;
8
8
  setDebuggerState: Updater<DebuggerState>;
9
9
  networkInterceptor: ReturnType<typeof useNetworkInterceptor>;
10
- logInterceptor: ReturnType<typeof useConsoleInterceptor>;
10
+ consoleInterceptor: ReturnType<typeof useConsoleInterceptor>;
11
11
  }
12
12
 
13
13
  const MainContext = createContext<MainContextValue | null>(null);
package/src/core/utils.ts CHANGED
@@ -1,26 +1,54 @@
1
- import type { HttpRequest } from '../types';
1
+ import { NetworkType, type HttpRequest, type WebSocketRequest } from '../types';
2
+
3
+ export const getNetworkUtils = (data: HttpRequest | WebSocketRequest) => {
4
+ const isHttp = data?.type !== NetworkType.WS;
5
+ const requestUrl = new URL(data.url);
6
+
7
+ const overviewShown = !!data.url;
8
+ const headersShown = isHttp && (!!data.requestHeaders || !!data.responseHeaders);
9
+ const requestShown = isHttp && (!!requestUrl.search || !!data.body);
10
+ const responseShown = isHttp && !!data.response;
11
+ const messagesShown = !isHttp && !!data.messages;
12
+
13
+ return {
14
+ isHttp,
15
+ requestUrl,
16
+ overviewShown,
17
+ headersShown,
18
+ requestShown,
19
+ responseShown,
20
+ messagesShown,
21
+ };
22
+ };
2
23
 
24
+ //#region metrics
3
25
  export const getVerticalSafeMargin = (screenHeight: number) => screenHeight / 8;
4
26
 
5
- export const limitChar = (value: any, limit = 5000) => {
6
- const stringValue = typeof value === 'string' ? value : JSON.stringify(value ?? '');
7
-
8
- return stringValue.length > limit
9
- ? `${stringValue.slice(0, limit)}\n---LIMITED TO ${limit} CHARACTERS---`
10
- : stringValue;
11
- };
27
+ export const clamp = (value: number, min: number, max: number) =>
28
+ Math.max(min, Math.min(max, value));
12
29
 
13
30
  export const getHttpInterceptorId = () => {
14
31
  const timestamp = Date.now().toString(36);
15
32
  const randomNum = Math.random().toString(36).substring(2, 10);
16
33
  return timestamp + randomNum;
17
34
  };
35
+ //#endregion
18
36
 
19
- export const clamp = (value: number, min: number, max: number) =>
20
- Math.max(min, Math.min(max, value));
37
+ //#region formatters
38
+ export const limitChar = (value: any, limit = 5000) => {
39
+ const stringValue = typeof value === 'string' ? value : JSON.stringify(value ?? '');
21
40
 
22
- export const keyValueToString = (key: string, value: any): string =>
23
- `${key}: ${limitChar(value)}\n`;
41
+ return stringValue.length > limit
42
+ ? `${stringValue.slice(0, limit)}\n---LIMITED TO ${limit} CHARACTERS---`
43
+ : stringValue;
44
+ };
45
+
46
+ export const keyValueToString = (
47
+ key: string,
48
+ value: any,
49
+ newLine: 'leading' | 'trailing' | null = 'trailing',
50
+ ): string =>
51
+ `${newLine === 'leading' ? '\n' : ''}${key}: ${limitChar(value)}${newLine === 'trailing' ? '\n' : ''}`;
24
52
 
25
53
  export const formatRequestMethod = (method?: string) => method ?? 'GET';
26
54
 
@@ -30,15 +58,23 @@ export const formatRequestDuration = (duration?: number) =>
30
58
  export const formatRequestStatusCode = (statusCode?: number) => `${statusCode ?? 'pending'}`;
31
59
 
32
60
  export const formatLogMessage = (type: string, values: any[]) => {
33
- const message: string = values.reduce((pre, cur, index, array) => {
34
- const isLastItem = index === array.length - 1;
35
-
36
- return pre + limitChar(cur) + (isLastItem ? '' : ', ');
37
- }, '');
61
+ const message: string = values.reduce(
62
+ (pre, cur, index) => pre + (!index ? '' : ', ') + limitChar(cur),
63
+ '',
64
+ );
38
65
 
39
66
  return `${type.toUpperCase()}: ${message}`;
40
67
  };
41
68
 
69
+ export const beautify = (data: any, beautified: boolean) => {
70
+ try {
71
+ const res = typeof data === 'string' ? JSON.parse(data) : data;
72
+ return beautified ? JSON.stringify(res, null, 2) : limitChar(res);
73
+ } catch (error) {
74
+ return limitChar(data);
75
+ }
76
+ };
77
+
42
78
  export const convertToCurl = (
43
79
  method: HttpRequest['method'],
44
80
  url: HttpRequest['url'],
@@ -60,7 +96,9 @@ export const convertToCurl = (
60
96
 
61
97
  return curlCommand;
62
98
  };
99
+ //#endregion
63
100
 
101
+ //#region decorators
64
102
  export function frozen(_target: Object) {
65
103
  const descriptor: PropertyDescriptor = arguments[2];
66
104
  descriptor.configurable = false;
@@ -81,3 +119,4 @@ export function singleton<T extends { new (...args: any[]): {} }>(constructor: T
81
119
 
82
120
  return Singleton;
83
121
  }
122
+ //#endregion
@@ -53,10 +53,15 @@ export default function useNetworkInterceptor({ autoEnabled }: NetworkIntercepto
53
53
  setNetworkRequests((draft: NetworkRequests<HttpRequest>) => {
54
54
  if (!draft.get(id)) return draft;
55
55
 
56
- const currentHeaderLine = keyValueToString(header, value);
56
+ const requestHeaderNewLine: Parameters<typeof keyValueToString>[2] = draft.get(id)!
57
+ .requestHeadersString?.length
58
+ ? 'leading'
59
+ : null;
60
+
61
+ const currentHeaderLine = keyValueToString(header, value, requestHeaderNewLine);
57
62
 
58
63
  const fetchRequestHeaderLineRegex = RegExp(
59
- keyValueToString(NETWORK_REQUEST_HEADER, NetworkType.Fetch),
64
+ keyValueToString(NETWORK_REQUEST_HEADER, NetworkType.Fetch, requestHeaderNewLine),
60
65
  'gi',
61
66
  );
62
67
 
@@ -163,7 +168,11 @@ export default function useNetworkInterceptor({ autoEnabled }: NetworkIntercepto
163
168
  if (!draft.get(`${socketId}`)) return draft;
164
169
 
165
170
  draft.get(`${socketId}`)!.messages ??= '';
166
- draft.get(`${socketId}`)!.messages += keyValueToString('SENT', data);
171
+ draft.get(`${socketId}`)!.messages += keyValueToString(
172
+ 'SENT',
173
+ data,
174
+ draft.get(`${socketId}`)!.messages?.length ? 'leading' : null,
175
+ );
167
176
  });
168
177
  };
169
178
 
@@ -195,7 +204,11 @@ export default function useNetworkInterceptor({ autoEnabled }: NetworkIntercepto
195
204
  if (!draft.get(`${socketId}`)) return draft;
196
205
 
197
206
  draft.get(`${socketId}`)!.messages ??= '';
198
- draft.get(`${socketId}`)!.messages += keyValueToString('RECEIVED', message);
207
+ draft.get(`${socketId}`)!.messages += keyValueToString(
208
+ 'RECEIVED',
209
+ message,
210
+ draft.get(`${socketId}`)!.messages?.length ? 'leading' : null,
211
+ );
199
212
  });
200
213
  };
201
214
 
@@ -97,7 +97,11 @@ export default class FetchInterceptor extends HttpInterceptor {
97
97
  let responseHeaders: string = '';
98
98
 
99
99
  for (const [headerKey, headerValue] of clonedResponseHeaders.entries()) {
100
- responseHeaders += keyValueToString(headerKey, headerValue);
100
+ responseHeaders += keyValueToString(
101
+ headerKey,
102
+ headerValue,
103
+ responseHeaders.length ? 'leading' : null,
104
+ );
101
105
  }
102
106
 
103
107
  headerReceivedCallback?.(interceptionId, responseContentType, responseSize, responseHeaders);
@@ -1,6 +1,7 @@
1
1
  const colors = Object.freeze({
2
2
  black: '#000000',
3
3
  red: '#ef4444',
4
+ green: '#22c55e',
4
5
  gray: '#888888',
5
6
  lightGray: '#AAAAAA',
6
7
  });
@@ -4,6 +4,9 @@ const icons = Object.freeze({
4
4
  hide: require('../assets/icons/hide.png'),
5
5
  move: require('../assets/icons/move.png'),
6
6
  record: require('../assets/icons/record.png'),
7
+ share: require('../assets/icons/share.png'),
8
+ arrowLeft: require('../assets/icons/arrow-left.png'),
9
+ beautify: require('../assets/icons/beautify.png'),
7
10
  });
8
11
 
9
12
  export default icons;
@@ -1,3 +1,5 @@
1
+ import type { HttpRequest, LogMessage, WebSocketRequest } from '.';
2
+
1
3
  export enum NetworkType {
2
4
  XHR = 'xhr',
3
5
  Fetch = 'fetch',
@@ -19,10 +21,24 @@ export interface NetworkRequest {
19
21
  duration?: number;
20
22
  }
21
23
 
22
- export type NetworkTab = 'headers' | 'queryStringParameters' | 'body' | 'response' | 'messages';
24
+ export type DetailTab = 'overview' | 'headers' | 'request' | 'response' | 'messages' | 'logMessage';
23
25
 
24
26
  export interface DebuggerState {
25
27
  visibility: 'hidden' | 'bubble' | 'panel';
26
28
  position: 'top' | 'bottom';
27
29
  selectedPanel: DebuggerPanel | null;
30
+ detailsData:
31
+ | {
32
+ type: DebuggerPanel.Network;
33
+ data: HttpRequest | WebSocketRequest;
34
+ selectedTab: Exclude<DetailTab, 'logMessage'>;
35
+ beautified: boolean;
36
+ }
37
+ | {
38
+ type: DebuggerPanel.Console;
39
+ data: LogMessage;
40
+ selectedTab: Extract<DetailTab, 'logMessage'>;
41
+ beautified: boolean;
42
+ }
43
+ | null;
28
44
  }