react-native-in-app-debugger 1.0.72 → 1.0.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Highlight.jsx CHANGED
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import Text from './Text';
3
3
 
4
- export default ({ text, filter }) => {
5
- if (!filter || !/^[a-zA-Z0-9./]+$/.test(filter)) return text;
4
+ export default ({ text, filter, style = {} }) => {
5
+ if (!filter || !/^[a-zA-Z0-9./]+$/.test(filter)) return <Text style={style}>{text}</Text>;
6
6
  const indices = [...text.matchAll(new RegExp(filter, 'gi'))].map((a) => a.index);
7
- if (!indices.length) return text;
7
+ if (!indices.length) return <Text style={style}>{text}</Text>;
8
8
  return (
9
9
  <>
10
10
  {indices.map((i, ii) => {
@@ -14,7 +14,7 @@ export default ({ text, filter }) => {
14
14
  return (
15
15
  <>
16
16
  {preText}
17
- <Text style={{ backgroundColor: 'yellow', color: 'black' }}>{searchText}</Text>
17
+ <Text style={{ backgroundColor: 'yellow', color: 'black', ...style }}>{searchText}</Text>
18
18
  {seqText}
19
19
  </>
20
20
  );
package/Libs.jsx CHANGED
@@ -8,6 +8,7 @@ import {
8
8
  import Text from "./Text";
9
9
  import Highlight from "./Highlight";
10
10
  import packageJson from "../../package.json";
11
+ import realDeps from "./parentDependencies.js";
11
12
 
12
13
  const libs = Object.entries(packageJson.dependencies).reduce(
13
14
  (arr, [name, version]) => [...arr, { name, version }],
@@ -33,19 +34,38 @@ export default () => {
33
34
  (l) =>
34
35
  !filter ||
35
36
  l.name.toLowerCase().includes(filter) ||
36
- l.version.includes(filter)
37
+ l.version.includes(filter) ||
38
+ realDeps[l.name].includes(filter)
37
39
  )}
38
40
  showsVerticalScrollIndicator
39
41
  keyExtractor={(i) => i.name}
40
- renderItem={({ item }) => (
41
- <TouchableHighlight underlayColor="#ffffff44" onPress={() => null}>
42
- <Text selectable style={{ color: "white", marginVertical: 10 }}>
43
- <Highlight text={item.name} filter={filter} />
44
- {" : "}
45
- <Highlight text={item.version} filter={filter} />
46
- </Text>
47
- </TouchableHighlight>
48
- )}
42
+ renderItem={({ item }) => {
43
+ const showAlt =
44
+ !!realDeps[item.name] &&
45
+ item.version.replace("^", "") !== realDeps[item.name];
46
+ return (
47
+ <TouchableHighlight underlayColor="#ffffff44" onPress={() => null}>
48
+ <Text selectable style={{ color: "white", marginVertical: 10 }}>
49
+ <Highlight text={item.name + " : "} filter={filter} />
50
+ <Highlight
51
+ text={item.version}
52
+ filter={filter}
53
+ style={
54
+ showAlt
55
+ ? { textDecorationLine: "line-through", color: "red" }
56
+ : undefined
57
+ }
58
+ />
59
+ {showAlt && (
60
+ <Highlight
61
+ text={" " + realDeps[item.name]}
62
+ filter={filter}
63
+ />
64
+ )}
65
+ </Text>
66
+ </TouchableHighlight>
67
+ );
68
+ }}
49
69
  />
50
70
  </>
51
71
  );
package/index.jsx CHANGED
@@ -140,8 +140,8 @@ export default ({
140
140
  transform: [{ translateX }, { translateY }],
141
141
  position: "absolute",
142
142
  borderRadius,
143
- borderColor: 'white',
144
- borderWidth: .5,
143
+ borderColor: isOpen ? undefined : "white",
144
+ borderWidth: 0.5,
145
145
  backgroundColor: "#000000" + (isOpen ? "ee" : "bb"),
146
146
  height,
147
147
  width,
@@ -227,9 +227,7 @@ export default ({
227
227
  </View>
228
228
  <X style={{ marginRight: 5 }} onPress={() => setIsOpen(false)} />
229
229
  </View>
230
- {tab === "vars" && !!variables && (
231
- <Variables variables={variables} />
232
- )}
230
+ {tab === "vars" && !!variables && <Variables variables={variables} />}
233
231
  {tab === "libs" && <Libs />}
234
232
  {tab === "api" && (
235
233
  <Api
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-in-app-debugger",
3
- "version": "1.0.72",
3
+ "version": "1.0.74",
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": {
@@ -1 +1 @@
1
- {}
1
+ export default {}
package/postinstall.js CHANGED
@@ -1,10 +1,11 @@
1
1
  const fs = require('fs');
2
2
  const read = (p) => JSON.parse(fs.readFileSync(p, 'utf-8'));
3
3
  const parentDependencies = fs.openSync('./parentDependencies.js', 'w');
4
- fs.writeSync(parentDependencies, '{');
4
+ fs.writeSync(parentDependencies, 'export default {');
5
5
  for (const d in read('../../package.json').dependencies) {
6
6
  try {
7
7
  fs.writeSync(parentDependencies, `"${d}":"${read(`../${d}/package.json`).version}",`);
8
8
  } catch (e) {}
9
9
  }
10
10
  fs.writeSync(parentDependencies, '}');
11
+ fs.closeSync(parentDependencies);