react-native-in-app-debugger 1.0.55 → 1.0.56

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 (3) hide show
  1. package/Libs.jsx +44 -0
  2. package/index.jsx +3 -2
  3. package/package.json +1 -1
package/Libs.jsx ADDED
@@ -0,0 +1,44 @@
1
+ import React, { useState } from "react";
2
+ import { FlatList, TextInput, TouchableHighlight } from "react-native";
3
+ import Text from "./Text";
4
+ import Highlight from "./Highlight";
5
+ import packageJson from '../../package.json';
6
+
7
+ const libs = Object.entries(packageJson.dependencies).reduce((arr,[name, version])=>[...arr,{name,version}],[]);
8
+
9
+ export default () => {
10
+ const [filter, setFilter] = useState("");
11
+
12
+ return (
13
+ <>
14
+ <TextInput
15
+ value={filter}
16
+ placeholder="Filter..."
17
+ placeholderTextColor="grey"
18
+ style={{ paddingHorizontal: 5, color: "white" }}
19
+ onChangeText={(t) => setFilter(t.toLowerCase())}
20
+ clearButtonMode="always"
21
+ />
22
+ <FlatList
23
+ contentContainerStyle={{ padding: 5, paddingBottom: 20 }}
24
+ data={libs.filter(
25
+ (l) =>
26
+ !filter ||
27
+ l.name.toLowerCase().includes(filter) ||
28
+ l.version.includes(filter)
29
+ )}
30
+ showsVerticalScrollIndicator
31
+ keyExtractor={(i) => i.name}
32
+ renderItem={({ item }) => (
33
+ <TouchableHighlight underlayColor="#ffffff44" onPress={() => null}>
34
+ <Text selectable style={{ color: "white", marginVertical: 10 }}>
35
+ <Highlight text={item.name} filter={filter} />
36
+ {" : "}
37
+ <Highlight text={item.version} filter={filter} />
38
+ </Text>
39
+ </TouchableHighlight>
40
+ )}
41
+ />
42
+ </>
43
+ );
44
+ };
package/index.jsx CHANGED
@@ -30,6 +30,7 @@ import Variables from "./Variables";
30
30
  import Api from "./Api";
31
31
  import useApiInterceptor from "./useApiInterceptor";
32
32
  import useStateRef from "./useStateRef";
33
+ import Libs from "react-native-in-app-debugger/Libs";
33
34
 
34
35
  const fontSize = 7;
35
36
 
@@ -176,8 +177,7 @@ export default ({
176
177
  </View>
177
178
  <View style={{ flexDirection: "row", padding: 5, gap: 6 }}>
178
179
  <View style={{ flex: 1, flexDirection: "row" }}>
179
- {!!variables &&
180
- ["api", "variables", ...tabs.map((t) => t.title)].map(
180
+ {["api", !!variables && "variables", "libs", ...tabs.map((t) => t.title)].filter(Boolean).map(
181
181
  (t, i) => {
182
182
  const isSelected = t === tab;
183
183
  return (
@@ -212,6 +212,7 @@ export default ({
212
212
  {tab === "variables" && !!variables && (
213
213
  <Variables variables={variables} />
214
214
  )}
215
+ {tab === "libs" && <Libs />}
215
216
  {tab === "api" && (
216
217
  <Api
217
218
  {...{ apis, setBlacklists, blacklists, maxNumOfApiToStore }}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-in-app-debugger",
3
- "version": "1.0.55",
3
+ "version": "1.0.56",
4
4
  "description": "This library's main usage is to be used by Non-Technical testers during UAT, SIT or any testing phase.",
5
5
  "main": "index.jsx",
6
6
  "scripts": {