react-native-xenon 2.3.0 → 2.4.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.
Files changed (84) hide show
  1. package/lib/module/core/utils.js +1 -1
  2. package/lib/module/core/utils.js.map +1 -1
  3. package/lib/module/interceptors/ConsoleInterceptor.js +27 -11
  4. package/lib/module/interceptors/ConsoleInterceptor.js.map +1 -1
  5. package/lib/module/ui/Xenon.js +1 -1
  6. package/lib/module/ui/Xenon.js.map +1 -1
  7. package/lib/module/ui/components/bubble/Bubble.js +4 -6
  8. package/lib/module/ui/components/bubble/Bubble.js.map +1 -1
  9. package/lib/module/ui/components/common/IndexedStack.js +5 -6
  10. package/lib/module/ui/components/common/IndexedStack.js.map +1 -1
  11. package/lib/module/ui/components/details/LogMessageDetails.js +10 -9
  12. package/lib/module/ui/components/details/LogMessageDetails.js.map +1 -1
  13. package/lib/module/ui/components/details/NetworkRequestDetails.js +6 -6
  14. package/lib/module/ui/components/details/NetworkRequestDetails.js.map +1 -1
  15. package/lib/module/ui/components/headers/ConsoleHeader.js +5 -6
  16. package/lib/module/ui/components/headers/ConsoleHeader.js.map +1 -1
  17. package/lib/module/ui/components/headers/DebuggerHeader.js +7 -7
  18. package/lib/module/ui/components/headers/DebuggerHeader.js.map +1 -1
  19. package/lib/module/ui/components/headers/HeaderComponents.js +6 -5
  20. package/lib/module/ui/components/headers/HeaderComponents.js.map +1 -1
  21. package/lib/module/ui/components/headers/NetworkHeader.js +6 -6
  22. package/lib/module/ui/components/headers/NetworkHeader.js.map +1 -1
  23. package/lib/module/ui/components/items/ConsolePanelItem.js +1 -3
  24. package/lib/module/ui/components/items/ConsolePanelItem.js.map +1 -1
  25. package/lib/module/ui/components/items/DebuggerHeaderItem.js +2 -1
  26. package/lib/module/ui/components/items/DebuggerHeaderItem.js.map +1 -1
  27. package/lib/module/ui/components/items/NetworkPanelItem.js +1 -3
  28. package/lib/module/ui/components/items/NetworkPanelItem.js.map +1 -1
  29. package/lib/module/ui/components/panels/ConsolePanel.js +6 -6
  30. package/lib/module/ui/components/panels/ConsolePanel.js.map +1 -1
  31. package/lib/module/ui/components/panels/NetworkPanel.js +7 -7
  32. package/lib/module/ui/components/panels/NetworkPanel.js.map +1 -1
  33. package/lib/module/ui/components/panels/Panel.js +4 -6
  34. package/lib/module/ui/components/panels/Panel.js.map +1 -1
  35. package/lib/module/ui/components/search-bar/SearchBar.js +4 -6
  36. package/lib/module/ui/components/search-bar/SearchBar.js.map +1 -1
  37. package/lib/typescript/src/interceptors/ConsoleInterceptor.d.ts +3 -0
  38. package/lib/typescript/src/interceptors/ConsoleInterceptor.d.ts.map +1 -1
  39. package/lib/typescript/src/ui/Xenon.d.ts +16 -14
  40. package/lib/typescript/src/ui/Xenon.d.ts.map +1 -1
  41. package/lib/typescript/src/ui/components/bubble/Bubble.d.ts +4 -2
  42. package/lib/typescript/src/ui/components/bubble/Bubble.d.ts.map +1 -1
  43. package/lib/typescript/src/ui/components/common/IndexedStack.d.ts +4 -3
  44. package/lib/typescript/src/ui/components/common/IndexedStack.d.ts.map +1 -1
  45. package/lib/typescript/src/ui/components/details/LogMessageDetails.d.ts +6 -3
  46. package/lib/typescript/src/ui/components/details/LogMessageDetails.d.ts.map +1 -1
  47. package/lib/typescript/src/ui/components/details/NetworkRequestDetails.d.ts +6 -3
  48. package/lib/typescript/src/ui/components/details/NetworkRequestDetails.d.ts.map +1 -1
  49. package/lib/typescript/src/ui/components/headers/ConsoleHeader.d.ts +5 -3
  50. package/lib/typescript/src/ui/components/headers/ConsoleHeader.d.ts.map +1 -1
  51. package/lib/typescript/src/ui/components/headers/DebuggerHeader.d.ts +4 -2
  52. package/lib/typescript/src/ui/components/headers/DebuggerHeader.d.ts.map +1 -1
  53. package/lib/typescript/src/ui/components/headers/HeaderComponents.d.ts +6 -5
  54. package/lib/typescript/src/ui/components/headers/HeaderComponents.d.ts.map +1 -1
  55. package/lib/typescript/src/ui/components/headers/NetworkHeader.d.ts +4 -2
  56. package/lib/typescript/src/ui/components/headers/NetworkHeader.d.ts.map +1 -1
  57. package/lib/typescript/src/ui/components/items/NetworkPanelItem.d.ts.map +1 -1
  58. package/lib/typescript/src/ui/components/panels/ConsolePanel.d.ts +6 -3
  59. package/lib/typescript/src/ui/components/panels/ConsolePanel.d.ts.map +1 -1
  60. package/lib/typescript/src/ui/components/panels/NetworkPanel.d.ts +7 -5
  61. package/lib/typescript/src/ui/components/panels/NetworkPanel.d.ts.map +1 -1
  62. package/lib/typescript/src/ui/components/panels/Panel.d.ts +5 -3
  63. package/lib/typescript/src/ui/components/panels/Panel.d.ts.map +1 -1
  64. package/lib/typescript/src/ui/components/search-bar/SearchBar.d.ts +4 -2
  65. package/lib/typescript/src/ui/components/search-bar/SearchBar.d.ts.map +1 -1
  66. package/package.json +2 -1
  67. package/src/core/utils.ts +1 -1
  68. package/src/interceptors/ConsoleInterceptor.ts +40 -21
  69. package/src/ui/Xenon.tsx +18 -15
  70. package/src/ui/components/bubble/Bubble.tsx +97 -100
  71. package/src/ui/components/common/IndexedStack.tsx +8 -20
  72. package/src/ui/components/details/LogMessageDetails.tsx +25 -27
  73. package/src/ui/components/details/NetworkRequestDetails.tsx +152 -151
  74. package/src/ui/components/headers/ConsoleHeader.tsx +13 -16
  75. package/src/ui/components/headers/DebuggerHeader.tsx +82 -83
  76. package/src/ui/components/headers/HeaderComponents.tsx +18 -16
  77. package/src/ui/components/headers/NetworkHeader.tsx +47 -50
  78. package/src/ui/components/items/ConsolePanelItem.tsx +3 -3
  79. package/src/ui/components/items/DebuggerHeaderItem.tsx +1 -0
  80. package/src/ui/components/items/NetworkPanelItem.tsx +6 -9
  81. package/src/ui/components/panels/ConsolePanel.tsx +8 -5
  82. package/src/ui/components/panels/NetworkPanel.tsx +9 -13
  83. package/src/ui/components/panels/Panel.tsx +7 -7
  84. package/src/ui/components/search-bar/SearchBar.tsx +7 -7
@@ -1,10 +1,12 @@
1
+ import { type Ref } from 'react';
1
2
  import type { ScrollView, StyleProp, ViewStyle } from 'react-native';
2
3
  import { PanelState } from '../../../core/refs';
3
4
  interface DebuggerHeaderProps {
4
5
  selectedPanel: PanelState;
5
6
  setSelectedPanel: React.Dispatch<React.SetStateAction<PanelState>>;
6
7
  style?: StyleProp<ViewStyle>;
8
+ ref?: Ref<ScrollView>;
7
9
  }
8
- declare const DebuggerHeader: import("react").ForwardRefExoticComponent<DebuggerHeaderProps & import("react").RefAttributes<ScrollView>>;
9
- export default DebuggerHeader;
10
+ export default function DebuggerHeader({ selectedPanel, setSelectedPanel, style, ref, }: DebuggerHeaderProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
10
12
  //# sourceMappingURL=DebuggerHeader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DebuggerHeader.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/headers/DebuggerHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAErE,OAAa,EAAsB,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAO1E,UAAU,mBAAmB;IAC3B,aAAa,EAAE,UAAU,CAAC;IAC1B,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;IACnE,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,QAAA,MAAM,cAAc,4GA8EnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"DebuggerHeader.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/headers/DebuggerHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAErE,OAAa,EAAsB,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAO1E,UAAU,mBAAmB;IAC3B,aAAa,EAAE,UAAU,CAAC;IAC1B,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;IACnE,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,GAAG,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,aAAa,EACb,gBAAgB,EAChB,KAAK,EACL,GAAG,GACJ,EAAE,mBAAmB,2CAyErB"}
@@ -1,6 +1,11 @@
1
+ import { type PropsWithChildren, type Ref } from 'react';
1
2
  import { ScrollView, type StyleProp, type ViewStyle } from 'react-native';
2
3
  import { PanelState } from '../../../core/refs';
3
4
  import type { DetailTab } from '../../../types';
5
+ declare function Wrapper({ children, style, ref, }: PropsWithChildren<{
6
+ style?: StyleProp<ViewStyle>;
7
+ ref?: Ref<ScrollView>;
8
+ }>): import("react/jsx-runtime").JSX.Element;
4
9
  declare const HeaderComponents: {
5
10
  Back: ({ selectedPanel }: {
6
11
  selectedPanel: PanelState;
@@ -10,11 +15,7 @@ declare const HeaderComponents: {
10
15
  label: string;
11
16
  }) => import("react/jsx-runtime").JSX.Element;
12
17
  MainButtons: () => import("react/jsx-runtime").JSX.Element;
13
- Wrapper: import("react").ForwardRefExoticComponent<{
14
- style?: StyleProp<ViewStyle>;
15
- } & {
16
- children?: import("react").ReactNode | undefined;
17
- } & import("react").RefAttributes<ScrollView>>;
18
+ Wrapper: typeof Wrapper;
18
19
  };
19
20
  export default HeaderComponents;
20
21
  //# sourceMappingURL=HeaderComponents.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderComponents.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/headers/HeaderComponents.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAc,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEtF,OAAa,EAAmC,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGvF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AA2FhD,QAAA,MAAM,gBAAgB;8BAxFW;QAAE,aAAa,EAAE,UAAU,CAAA;KAAE;oCAiBvB;QAAE,GAAG,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;;;gBAyCL,SAAS,CAAC,SAAS,CAAC;;;;CA8BjB,CAAC;AAEvE,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"HeaderComponents.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/headers/HeaderComponents.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,iBAAiB,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,EAAE,UAAU,EAAc,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEtF,OAAa,EAAmC,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGvF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AA6DhD,iBAAS,OAAO,CAAC,EACf,QAAQ,EACR,KAAK,EACL,GAAG,GACJ,EAAE,iBAAiB,CAAC;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAAC,GAAG,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC,CAAA;CAAE,CAAC,2CAY5E;AAgBD,QAAA,MAAM,gBAAgB;8BA1FW;QAAE,aAAa,EAAE,UAAU,CAAA;KAAE;oCAiBvB;QAAE,GAAG,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;;;CAyEF,CAAC;AAEvE,eAAe,gBAAgB,CAAC"}
@@ -1,9 +1,11 @@
1
+ import { type Ref } from 'react';
1
2
  import { type ScrollView, type StyleProp, type ViewStyle } from 'react-native';
2
3
  import { type PanelState } from '../../../core/refs';
3
4
  interface NetworkHeaderProps {
4
5
  selectedPanel: PanelState;
5
6
  style?: StyleProp<ViewStyle>;
7
+ ref?: Ref<ScrollView>;
6
8
  }
7
- declare const NetworkHeader: import("react").ForwardRefExoticComponent<NetworkHeaderProps & import("react").RefAttributes<ScrollView>>;
8
- export default NetworkHeader;
9
+ export default function NetworkHeader({ selectedPanel, style, ref }: NetworkHeaderProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
9
11
  //# sourceMappingURL=NetworkHeader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NetworkHeader.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/headers/NetworkHeader.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE/E,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AASrD,UAAU,kBAAkB;IAC1B,aAAa,EAAE,UAAU,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,QAAA,MAAM,aAAa,2GAqDlB,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"NetworkHeader.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/headers/NetworkHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE/E,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AASrD,UAAU,kBAAkB;IAC1B,aAAa,EAAE,UAAU,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,GAAG,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,kBAAkB,2CAmDtF"}
@@ -1 +1 @@
1
- {"version":3,"file":"NetworkPanelItem.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/items/NetworkPanelItem.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAIlE,UAAU,qBAAqB;IAC7B,MAAM,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC/B,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC;IAC5B,SAAS,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;IACxC,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;IAClC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAsBD,QAAA,MAAM,gBAAgB,6DAqErB,CAAC;AAwCF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"NetworkPanelItem.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/items/NetworkPanelItem.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAIlE,UAAU,qBAAqB;IAC7B,MAAM,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC/B,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC;IAC5B,SAAS,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;IACxC,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;IAClC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAsBD,QAAA,MAAM,gBAAgB,6DAkErB,CAAC;AAwCF,eAAe,gBAAgB,CAAC"}
@@ -1,6 +1,9 @@
1
+ import { type Ref } from 'react';
1
2
  import { FlatList, type StyleProp, type ViewStyle } from 'react-native';
2
- declare const ConsolePanel: import("react").ForwardRefExoticComponent<{
3
+ interface ConsolePanelProps {
3
4
  style?: StyleProp<ViewStyle>;
4
- } & import("react").RefAttributes<FlatList<any>>>;
5
- export default ConsolePanel;
5
+ ref?: Ref<FlatList<any>>;
6
+ }
7
+ export default function ConsolePanel({ style, ref }: ConsolePanelProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
6
9
  //# sourceMappingURL=ConsolePanel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConsolePanel.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/panels/ConsolePanel.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAGR,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAQtB,QAAA,MAAM,YAAY;YAAkC,SAAS,CAAC,SAAS,CAAC;iDA8DtE,CAAC;AAWH,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"ConsolePanel.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/panels/ConsolePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,EACL,QAAQ,EAGR,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAQtB,UAAU,iBAAiB;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,GAAG,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,iBAAiB,2CA8DrE"}
@@ -1,6 +1,8 @@
1
- import { FlatList, type StyleProp, type ViewStyle } from 'react-native';
2
- declare const NetworkPanel: import("react").ForwardRefExoticComponent<{
3
- style?: StyleProp<ViewStyle>;
4
- } & import("react").RefAttributes<FlatList<any>>>;
5
- export default NetworkPanel;
1
+ import { type Ref } from 'react';
2
+ import { FlatList, type ViewProps } from 'react-native';
3
+ interface NetworkPanelProps extends ViewProps {
4
+ ref?: Ref<FlatList<any>>;
5
+ }
6
+ export default function NetworkPanel({ style, ref }: NetworkPanelProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
6
8
  //# sourceMappingURL=NetworkPanel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NetworkPanel.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/panels/NetworkPanel.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAGR,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAatB,QAAA,MAAM,YAAY;YAAkC,SAAS,CAAC,SAAS,CAAC;iDAoEtE,CAAC;AASH,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"NetworkPanel.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/panels/NetworkPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAmC,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAazF,UAAU,iBAAkB,SAAQ,SAAS;IAC3C,GAAG,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,iBAAiB,2CAoErE"}
@@ -1,6 +1,8 @@
1
1
  import { View, type ViewProps } from 'react-native';
2
- interface PanelProps extends ViewProps {
2
+ import { type Ref } from 'react';
3
+ interface PanelComponentProps extends ViewProps {
4
+ ref?: Ref<View>;
3
5
  }
4
- declare const Panel: import("react").ForwardRefExoticComponent<PanelProps & import("react").RefAttributes<View>>;
5
- export default Panel;
6
+ export default function Panel({ style, ...props }: PanelComponentProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
6
8
  //# sourceMappingURL=Panel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Panel.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/panels/Panel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkC,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAgBpF,UAAU,UAAW,SAAQ,SAAS;CAAG;AAEzC,QAAA,MAAM,KAAK,6FA8CT,CAAC;AAgBH,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Panel.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/panels/Panel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkC,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAQpF,OAAO,EAAkC,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAQjE,UAAU,mBAAoB,SAAQ,SAAS;IAC7C,GAAG,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,2CA8CrE"}
@@ -1,6 +1,8 @@
1
+ import { type Ref } from 'react';
1
2
  import { View, type ViewProps } from 'react-native';
2
3
  interface SearchBarProps extends ViewProps {
4
+ ref?: Ref<View>;
3
5
  }
4
- declare const SearchBar: import("react").ForwardRefExoticComponent<SearchBarProps & import("react").RefAttributes<View>>;
5
- export default SearchBar;
6
+ export default function SearchBar({ style, ...props }: SearchBarProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
6
8
  //# sourceMappingURL=SearchBar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBar.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/search-bar/SearchBar.tsx"],"names":[],"mappings":"AACA,OAAO,EAKL,IAAI,EAGJ,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAUtB,UAAU,cAAe,SAAQ,SAAS;CAAG;AAI7C,QAAA,MAAM,SAAS,iGAiEb,CAAC;AAmCH,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"SearchBar.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/search-bar/SearchBar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAKL,IAAI,EAGJ,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAUtB,UAAU,cAAe,SAAQ,SAAS;IACxC,GAAG,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;CACjB;AAID,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,2CAiEpE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-xenon",
3
- "version": "2.3.0",
3
+ "version": "2.4.1",
4
4
  "description": "A powerful in-app debugging tool for React Native.",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -36,6 +36,7 @@
36
36
  "test": "jest",
37
37
  "typecheck": "tsc",
38
38
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
39
+ "format": "prettier --write \"**/*.{js,ts,tsx,json,md}\"",
39
40
  "clean": "del-cli lib",
40
41
  "prepare": "bob build",
41
42
  "release": "release-it --only-version"
package/src/core/utils.ts CHANGED
@@ -92,7 +92,7 @@ export const getHttpInterceptorId = () => {
92
92
  //#region formatters
93
93
  export const showNewLine = (when: boolean) => (when ? '\n' : '');
94
94
 
95
- const limitChar = (value: any, limit = 5000) => {
95
+ const limitChar = (value: any, limit = 100000) => {
96
96
  const stringValue = typeof value === 'string' ? value : JSON.stringify(value ?? '');
97
97
 
98
98
  return stringValue.length > limit
@@ -20,69 +20,88 @@ export default class ConsoleInterceptor extends Interceptor<ConsoleHandlers> {
20
20
  callback: null,
21
21
  };
22
22
 
23
+ private isSyntheticEvent(event: any): boolean {
24
+ return (
25
+ event !== null &&
26
+ typeof event === 'object' &&
27
+ 'nativeEvent' in event &&
28
+ 'currentTarget' in event &&
29
+ 'target' in event &&
30
+ typeof event.preventDefault === 'function'
31
+ );
32
+ }
33
+
34
+ private snapshotSyntheticEvent(event: any): Record<string, unknown> {
35
+ try {
36
+ return JSON.parse(JSON.stringify(event));
37
+ } catch {
38
+ return {
39
+ '[SyntheticEvent]':
40
+ 'Could not snapshot event. Seem like this event has circular references. You can extract specific properties from the event object to see the details (e.g., event.target.value)',
41
+ };
42
+ }
43
+ }
44
+
45
+ private callback(type: string, args: any[]) {
46
+ const snapshotArgs = args.map(arg =>
47
+ this.isSyntheticEvent(arg) ? this.snapshotSyntheticEvent(arg) : arg,
48
+ );
49
+ this.handlers.callback?.(type, snapshotArgs);
50
+ }
51
+
23
52
  @frozen
24
53
  enableInterception(): void {
25
54
  if (this.isInterceptorEnabled) return;
26
55
 
27
- const callback = this.handlers.callback;
56
+ const callback = this.callback.bind(this);
28
57
 
29
58
  console.error = function (...args) {
30
- callback?.('error', args);
31
-
59
+ callback('error', args);
32
60
  originalConsoleError.call(this, ...args);
33
61
  };
34
62
 
35
63
  console.info = function (...args) {
36
- callback?.('info', args);
37
-
64
+ callback('info', args);
38
65
  originalConsoleInfo.call(this, ...args);
39
66
  };
40
67
 
41
68
  console.log = function (...args) {
42
- callback?.('log', args);
43
-
69
+ callback('log', args);
44
70
  originalConsoleLog.call(this, ...args);
45
71
  };
46
72
 
47
73
  console.warn = function (...args) {
48
- callback?.('warn', args);
49
-
74
+ callback('warn', args);
50
75
  originalConsoleWarn.call(this, ...args);
51
76
  };
52
77
 
53
78
  console.trace = function (...args) {
54
- callback?.('trace', args);
55
-
79
+ callback('trace', args);
56
80
  originalConsoleTrace.call(this, ...args);
57
81
  };
58
82
 
59
83
  console.debug = function (...args) {
60
- callback?.('debug', args);
61
-
84
+ callback('debug', args);
62
85
  originalConsoleDebug.call(this, ...args);
63
86
  };
64
87
 
65
88
  console.table = function (...args: Parameters<typeof originalConsoleTable>) {
66
- callback?.('table', args);
67
-
89
+ callback('table', args);
68
90
  originalConsoleTable.call(this, ...args);
69
91
  };
70
92
 
71
93
  console.groupCollapsed = function (...args) {
72
- callback?.('groupCollapsed', args);
73
-
94
+ callback('groupCollapsed', args);
74
95
  originalConsoleGroupCollapsed.call(this, ...args);
75
96
  };
76
97
 
77
98
  console.groupEnd = function (...args) {
78
- callback?.('groupEnd', args);
79
-
99
+ callback('groupEnd', args);
80
100
  originalConsoleGroupEnd.call(this, ...args);
81
101
  };
82
102
 
83
103
  console.group = function (...args) {
84
- callback?.('group', args);
85
-
104
+ callback('group', args);
86
105
  originalConsoleGroup.call(this, ...args);
87
106
  };
88
107
 
package/src/ui/Xenon.tsx CHANGED
@@ -10,13 +10,19 @@ import { type DebuggerState } from '../types';
10
10
  import { Bubble, IndexedStack, Panel, SearchBar } from './components';
11
11
 
12
12
  namespace Xenon {
13
- interface Methods {
13
+ export interface Methods {
14
14
  isVisible(): boolean;
15
15
  show(): void;
16
16
  hide(): void;
17
17
  }
18
18
 
19
- interface Props {
19
+ export interface Props {
20
+ children: ReactNode;
21
+ /**
22
+ * If true, completely disables the debugger by rendering only the children components without any debugging functionality.
23
+ * @default false
24
+ */
25
+ disabled?: boolean;
20
26
  /**
21
27
  * Determines whether the network inspector is automatically enabled upon initialization.
22
28
  * @default true
@@ -45,15 +51,6 @@ namespace Xenon {
45
51
  includeDomains?: string[];
46
52
  }
47
53
 
48
- interface WrapperProps extends Props {
49
- /**
50
- * If true, completely disables the debugger by rendering only the children components without any debugging functionality.
51
- * @default false
52
- */
53
- disabled?: boolean;
54
- children: ReactNode;
55
- }
56
-
57
54
  enableMapSet();
58
55
  const ref = createRef<Methods>();
59
56
 
@@ -61,7 +58,7 @@ namespace Xenon {
61
58
  * Checks whether the debugger is currently visible.
62
59
  * @returns `true` if the debugger is currently visible, otherwise `false`.
63
60
  */
64
- export const isVisible = () => ref.current?.isVisible() ?? false;
61
+ export const isVisible = (): boolean => ref.current?.isVisible() ?? false;
65
62
 
66
63
  /**
67
64
  * Makes the debugger visible. If it is already visible, this method has no additional effect.
@@ -75,14 +72,14 @@ namespace Xenon {
75
72
  */
76
73
  export const hide = (): void => ref.current?.hide();
77
74
 
78
- const Debugger = memo(
75
+ const Debugger = memo<Omit<Props, 'children' | 'disabled'>>(
79
76
  ({
80
77
  autoInspectNetworkEnabled = true,
81
78
  autoInspectConsoleEnabled = true,
82
79
  bubbleSize = 40,
83
80
  idleBubbleOpacity = 0.5,
84
81
  includeDomains,
85
- }: Props) => {
82
+ }) => {
86
83
  const dimensions = useWindowDimensions();
87
84
 
88
85
  const [debuggerState, setDebuggerState] = useImmer<DebuggerState>({
@@ -142,9 +139,15 @@ namespace Xenon {
142
139
  </MainContext.Provider>
143
140
  );
144
141
  },
142
+ (prevProps, nextProps) =>
143
+ prevProps.autoInspectNetworkEnabled === nextProps.autoInspectNetworkEnabled &&
144
+ prevProps.autoInspectConsoleEnabled === nextProps.autoInspectConsoleEnabled &&
145
+ prevProps.bubbleSize === nextProps.bubbleSize &&
146
+ prevProps.idleBubbleOpacity === nextProps.idleBubbleOpacity &&
147
+ JSON.stringify(prevProps.includeDomains) === JSON.stringify(nextProps.includeDomains),
145
148
  );
146
149
 
147
- export function Wrapper({ disabled = false, children, ...props }: WrapperProps): JSX.Element {
150
+ export function Wrapper({ disabled = false, children, ...props }: Props): JSX.Element {
148
151
  if (disabled) return children as JSX.Element;
149
152
 
150
153
  return (
@@ -1,4 +1,4 @@
1
- import { forwardRef, useContext, useMemo, useRef, useState } from 'react';
1
+ import { useContext, useMemo, useRef, useState, type Ref } from 'react';
2
2
  import {
3
3
  Animated,
4
4
  PanResponder,
@@ -17,106 +17,105 @@ import Icon from '../common/Icon';
17
17
  interface BubbleProps extends ViewProps {
18
18
  bubbleSize: number;
19
19
  idleBubbleOpacity: number;
20
+ ref?: Ref<View>;
20
21
  }
21
22
 
22
- const Bubble = forwardRef<View, BubbleProps>(
23
- ({ bubbleSize, idleBubbleOpacity, style, ...props }, ref) => {
24
- const {
25
- dimensions: { width: screenWidth, height: screenHeight },
26
- } = useContext(MainContext)!;
27
- const [idleOpacity, setIdleOpacity] = useState(idleBubbleOpacity);
28
- const pan = useRef(new Animated.ValueXY({ x: 0, y: getVerticalSafeMargin(screenHeight) }));
29
- const opacityTimer = useRef<NodeJS.Timeout | null>(null);
30
-
31
- const panResponder = useMemo(() => {
32
- const clearTimer = () => {
33
- if (opacityTimer.current) clearTimeout(opacityTimer.current);
34
- opacityTimer.current = null;
35
- };
36
-
37
- const blur = () => {
38
- opacityTimer.current = setTimeout(() => {
39
- setIdleOpacity(idleBubbleOpacity);
40
- clearTimer();
41
- }, 1000);
42
- };
43
-
44
- return PanResponder.create({
45
- onStartShouldSetPanResponder: () => true,
46
- onMoveShouldSetPanResponder: () => true,
47
- onPanResponderGrant: () => {
48
- pan.current.setOffset({
49
- // @ts-ignore
50
- x: pan.current.x._value,
51
- // @ts-ignore
52
- y: pan.current.y._value,
53
- });
54
-
55
- pan.current.setValue({ x: 0, y: 0 });
56
-
57
- clearTimer();
58
- setIdleOpacity(1);
59
- },
60
- onPanResponderMove: Animated.event([null, { dx: pan.current.x, dy: pan.current.y }], {
23
+ export default function Bubble({ bubbleSize, idleBubbleOpacity, style, ...props }: BubbleProps) {
24
+ const {
25
+ dimensions: { width: screenWidth, height: screenHeight },
26
+ } = useContext(MainContext)!;
27
+ const [idleOpacity, setIdleOpacity] = useState(idleBubbleOpacity);
28
+ const pan = useRef(new Animated.ValueXY({ x: 0, y: getVerticalSafeMargin(screenHeight) }));
29
+ const opacityTimer = useRef<NodeJS.Timeout | null>(null);
30
+
31
+ const panResponder = useMemo(() => {
32
+ const clearTimer = () => {
33
+ if (opacityTimer.current) clearTimeout(opacityTimer.current);
34
+ opacityTimer.current = null;
35
+ };
36
+
37
+ const blur = () => {
38
+ opacityTimer.current = setTimeout(() => {
39
+ setIdleOpacity(idleBubbleOpacity);
40
+ clearTimer();
41
+ }, 1000);
42
+ };
43
+
44
+ return PanResponder.create({
45
+ onStartShouldSetPanResponder: () => true,
46
+ onMoveShouldSetPanResponder: () => true,
47
+ onPanResponderGrant: () => {
48
+ pan.current.setOffset({
49
+ // @ts-ignore
50
+ x: pan.current.x._value,
51
+ // @ts-ignore
52
+ y: pan.current.y._value,
53
+ });
54
+
55
+ pan.current.setValue({ x: 0, y: 0 });
56
+
57
+ clearTimer();
58
+ setIdleOpacity(1);
59
+ },
60
+ onPanResponderMove: Animated.event([null, { dx: pan.current.x, dy: pan.current.y }], {
61
+ useNativeDriver: false,
62
+ }),
63
+ onPanResponderRelease: (_, gesture: PanResponderGestureState) => {
64
+ pan.current.flattenOffset();
65
+
66
+ const isTapGesture =
67
+ gesture.dx > -10 && gesture.dx < 10 && gesture.dy > -10 && gesture.dy < 10;
68
+ if (isTapGesture) {
69
+ refs.debugger.current?.setCurrentIndex(DebuggerVisibility.Panel);
70
+ }
71
+
72
+ if (gesture.moveX === 0 && gesture.moveY === 0) {
73
+ blur();
74
+ return;
75
+ }
76
+
77
+ const finalX =
78
+ gesture.moveX < (screenWidth - bubbleSize) / 2 ? 0 : screenWidth - bubbleSize;
79
+
80
+ const verticalSafeMargin = getVerticalSafeMargin(screenHeight);
81
+
82
+ const finalY = clamp(
83
+ verticalSafeMargin,
84
+ screenHeight - verticalSafeMargin - bubbleSize,
85
+ gesture.moveY,
86
+ );
87
+
88
+ Animated.spring(pan.current, {
89
+ toValue: { x: finalX, y: finalY },
61
90
  useNativeDriver: false,
62
- }),
63
- onPanResponderRelease: (_, gesture: PanResponderGestureState) => {
64
- pan.current.flattenOffset();
65
-
66
- const isTapGesture =
67
- gesture.dx > -10 && gesture.dx < 10 && gesture.dy > -10 && gesture.dy < 10;
68
- if (isTapGesture) {
69
- refs.debugger.current?.setCurrentIndex(DebuggerVisibility.Panel);
70
- }
71
-
72
- if (gesture.moveX === 0 && gesture.moveY === 0) {
73
- blur();
74
- return;
75
- }
76
-
77
- const finalX =
78
- gesture.moveX < (screenWidth - bubbleSize) / 2 ? 0 : screenWidth - bubbleSize;
79
-
80
- const verticalSafeMargin = getVerticalSafeMargin(screenHeight);
81
-
82
- const finalY = clamp(
83
- verticalSafeMargin,
84
- screenHeight - verticalSafeMargin - bubbleSize,
85
- gesture.moveY,
86
- );
87
-
88
- Animated.spring(pan.current, {
89
- toValue: { x: finalX, y: finalY },
90
- useNativeDriver: false,
91
- }).start(({ finished }) => {
92
- if (!finished) return;
93
- blur();
94
- });
95
- },
96
- });
97
- }, [bubbleSize, idleBubbleOpacity, screenHeight, screenWidth]);
98
-
99
- return (
100
- <View ref={ref} style={[styles.bubbleBackdrop, style]} {...props}>
101
- <Animated.View
102
- {...panResponder.panHandlers}
103
- style={[
104
- styles.bubble,
105
- {
106
- width: bubbleSize,
107
- height: bubbleSize,
108
- borderRadius: bubbleSize / 2,
109
- transform: pan.current.getTranslateTransform(),
110
- opacity: idleOpacity,
111
- },
112
- ]}
113
- >
114
- <Icon source={icons.bug} size={bubbleSize * 0.65} />
115
- </Animated.View>
116
- </View>
117
- );
118
- },
119
- );
91
+ }).start(({ finished }) => {
92
+ if (!finished) return;
93
+ blur();
94
+ });
95
+ },
96
+ });
97
+ }, [bubbleSize, idleBubbleOpacity, screenHeight, screenWidth]);
98
+
99
+ return (
100
+ <View style={[styles.bubbleBackdrop, style]} {...props}>
101
+ <Animated.View
102
+ {...panResponder.panHandlers}
103
+ style={[
104
+ styles.bubble,
105
+ {
106
+ width: bubbleSize,
107
+ height: bubbleSize,
108
+ borderRadius: bubbleSize / 2,
109
+ transform: pan.current.getTranslateTransform(),
110
+ opacity: idleOpacity,
111
+ },
112
+ ]}
113
+ >
114
+ <Icon source={icons.bug} size={bubbleSize * 0.65} />
115
+ </Animated.View>
116
+ </View>
117
+ );
118
+ }
120
119
 
121
120
  const styles = StyleSheet.create({
122
121
  bubbleBackdrop: {
@@ -131,5 +130,3 @@ const styles = StyleSheet.create({
131
130
  alignItems: 'center',
132
131
  },
133
132
  });
134
-
135
- export default Bubble;
@@ -1,19 +1,11 @@
1
- import {
2
- Children,
3
- createElement,
4
- forwardRef,
5
- useImperativeHandle,
6
- useRef,
7
- type ForwardedRef,
8
- type JSX,
9
- type RefAttributes,
10
- } from 'react';
1
+ import { Children, createElement, useImperativeHandle, useRef, type JSX, type Ref } from 'react';
11
2
  import { type NativeMethods } from 'react-native';
12
3
 
13
4
  interface IndexedStackProps<T extends number> {
14
5
  children: JSX.Element[];
15
6
  id: string;
16
7
  defaultIndex: T;
8
+ ref: Ref<IndexedStackMethods<T>>;
17
9
  }
18
10
 
19
11
  export type IndexedStackMethods<T extends number> = {
@@ -21,10 +13,12 @@ export type IndexedStackMethods<T extends number> = {
21
13
  setCurrentIndex: (index: T) => void;
22
14
  };
23
15
 
24
- function IndexedStackComponent<T extends number>(
25
- { children, defaultIndex, id }: IndexedStackProps<T>,
26
- ref: ForwardedRef<IndexedStackMethods<T>>,
27
- ) {
16
+ export default function IndexedStack<T extends number>({
17
+ children,
18
+ defaultIndex,
19
+ id,
20
+ ref,
21
+ }: IndexedStackProps<T>) {
28
22
  const currentIndex = useRef<T>(defaultIndex as T);
29
23
  const childrenRefs = useRef<NativeMethods[]>([]);
30
24
 
@@ -54,9 +48,3 @@ function IndexedStackComponent<T extends number>(
54
48
  });
55
49
  });
56
50
  }
57
-
58
- const IndexedStack = forwardRef(IndexedStackComponent) as <T extends number>(
59
- props: IndexedStackProps<T> & RefAttributes<IndexedStackMethods<T>>,
60
- ) => JSX.Element;
61
-
62
- export default IndexedStack;