react-native-inapp-inspector 2.3.10 → 2.3.11
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/dist/commonjs/components/Inspector/DebuggingTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/DebuggingTab.js +682 -0
- package/dist/commonjs/components/Inspector/MainScreen.js +2 -0
- package/dist/commonjs/components/Inspector/SettingsPanel.js +12 -0
- package/dist/commonjs/components/Inspector/TabBar.js +9 -0
- package/dist/commonjs/components/NetworkIcons.d.ts +1 -0
- package/dist/commonjs/components/NetworkIcons.js +8 -1
- package/dist/commonjs/components/QRCodeView.d.ts +9 -0
- package/dist/commonjs/components/QRCodeView.js +79 -0
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/helpers/qrGenerator.d.ts +2 -0
- package/dist/commonjs/helpers/qrGenerator.js +170 -0
- package/dist/commonjs/index.js +2 -0
- package/dist/commonjs/types/enums.d.ts +2 -0
- package/dist/commonjs/types/enums.js +2 -0
- package/dist/esm/components/Inspector/DebuggingTab.d.ts +3 -0
- package/dist/esm/components/Inspector/DebuggingTab.js +642 -0
- package/dist/esm/components/Inspector/MainScreen.js +2 -0
- package/dist/esm/components/Inspector/SettingsPanel.js +13 -1
- package/dist/esm/components/Inspector/TabBar.js +10 -1
- package/dist/esm/components/NetworkIcons.d.ts +1 -0
- package/dist/esm/components/NetworkIcons.js +6 -0
- package/dist/esm/components/QRCodeView.d.ts +9 -0
- package/dist/esm/components/QRCodeView.js +42 -0
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/helpers/qrGenerator.d.ts +2 -0
- package/dist/esm/helpers/qrGenerator.js +167 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/types/enums.d.ts +2 -0
- package/dist/esm/types/enums.js +2 -0
- package/package.json +1 -1
- package/src/components/Inspector/DebuggingTab.tsx +755 -0
- package/src/components/Inspector/MainScreen.tsx +2 -0
- package/src/components/Inspector/SettingsPanel.tsx +20 -0
- package/src/components/Inspector/TabBar.tsx +11 -0
- package/src/components/NetworkIcons.tsx +39 -0
- package/src/components/QRCodeView.tsx +71 -0
- package/src/constants/version.ts +1 -1
- package/src/helpers/qrGenerator.ts +184 -0
- package/src/index.tsx +2 -0
- package/src/types/enums.ts +2 -0
|
@@ -57,6 +57,7 @@ const CrashTab_1 = __importDefault(require("./CrashTab"));
|
|
|
57
57
|
const CrashDetail_1 = __importDefault(require("./CrashDetail"));
|
|
58
58
|
const DeviceInfoTab_1 = __importDefault(require("./DeviceInfoTab"));
|
|
59
59
|
const StorageTab_1 = __importDefault(require("./StorageTab"));
|
|
60
|
+
const DebuggingTab_1 = __importDefault(require("./DebuggingTab"));
|
|
60
61
|
const SettingsPanel_1 = __importDefault(require("./SettingsPanel"));
|
|
61
62
|
const NpmUpdateToast_1 = __importDefault(require("./NpmUpdateToast"));
|
|
62
63
|
const Toast_1 = __importDefault(require("../Toast"));
|
|
@@ -156,6 +157,7 @@ const MainScreen = () => {
|
|
|
156
157
|
{activeTab === 'crash' && <CrashTab_1.default />}
|
|
157
158
|
{activeTab === 'device' && <DeviceInfoTab_1.default />}
|
|
158
159
|
{activeTab === 'storage' && <StorageTab_1.default />}
|
|
160
|
+
{activeTab === 'debugging' && <DebuggingTab_1.default />}
|
|
159
161
|
</react_native_1.Animated.View>
|
|
160
162
|
|
|
161
163
|
|
|
@@ -135,6 +135,13 @@ const SettingsPanel = () => {
|
|
|
135
135
|
icon: 'storage',
|
|
136
136
|
desc: 'AsyncStorage & MMKV key-value store viewer with full CRUD support',
|
|
137
137
|
},
|
|
138
|
+
{
|
|
139
|
+
key: 'debugging',
|
|
140
|
+
label: 'Multi-Device Debugging',
|
|
141
|
+
category: 'diagnostic',
|
|
142
|
+
icon: 'debugging',
|
|
143
|
+
desc: 'QR Code bridge for direct Debug APK download & Metro live-reload sync',
|
|
144
|
+
},
|
|
138
145
|
];
|
|
139
146
|
const [stagedTabVisibility, setStagedTabVisibility] = (0, react_1.useState)(() => ({
|
|
140
147
|
apis: true,
|
|
@@ -146,6 +153,7 @@ const SettingsPanel = () => {
|
|
|
146
153
|
crash: Boolean(tabVisibility?.crash),
|
|
147
154
|
device: Boolean(tabVisibility?.device),
|
|
148
155
|
storage: Boolean(tabVisibility?.storage),
|
|
156
|
+
debugging: Boolean(tabVisibility?.debugging ?? true),
|
|
149
157
|
}));
|
|
150
158
|
(0, react_1.useEffect)(() => {
|
|
151
159
|
setStagedTabVisibility({
|
|
@@ -158,6 +166,7 @@ const SettingsPanel = () => {
|
|
|
158
166
|
crash: Boolean(tabVisibility?.crash),
|
|
159
167
|
device: Boolean(tabVisibility?.device),
|
|
160
168
|
storage: Boolean(tabVisibility?.storage),
|
|
169
|
+
debugging: Boolean(tabVisibility?.debugging ?? true),
|
|
161
170
|
});
|
|
162
171
|
}, [tabVisibility]);
|
|
163
172
|
const hasUnsavedChanges = (0, react_1.useMemo)(() => {
|
|
@@ -545,6 +554,9 @@ const SettingsPanel = () => {
|
|
|
545
554
|
{moduleItem.icon === 'storage' && (<NetworkIcons_1.DatabaseIcon color={isChecked
|
|
546
555
|
? AppColors_1.AppColors.purple
|
|
547
556
|
: AppColors_1.AppColors.grayTextWeak} size={16}/>)}
|
|
557
|
+
{moduleItem.icon === 'debugging' && (<NetworkIcons_1.QrCodeIcon color={isChecked
|
|
558
|
+
? AppColors_1.AppColors.purple
|
|
559
|
+
: AppColors_1.AppColors.grayTextWeak} size={16}/>)}
|
|
548
560
|
</react_native_1.View>
|
|
549
561
|
|
|
550
562
|
|
|
@@ -73,8 +73,16 @@ const TabBar = react_1.default.memo(() => {
|
|
|
73
73
|
count: 0,
|
|
74
74
|
icon: 'storage',
|
|
75
75
|
},
|
|
76
|
+
{
|
|
77
|
+
key: 'debugging',
|
|
78
|
+
label: 'Debugging',
|
|
79
|
+
count: 0,
|
|
80
|
+
icon: 'debugging',
|
|
81
|
+
},
|
|
76
82
|
]
|
|
77
83
|
.filter(tab => {
|
|
84
|
+
if (tab.key === 'debugging')
|
|
85
|
+
return true;
|
|
78
86
|
if (!tabVisibility?.[tab.key])
|
|
79
87
|
return false;
|
|
80
88
|
if (tab.key === 'redux' && !isReduxAvail)
|
|
@@ -117,6 +125,7 @@ const TabBar = react_1.default.memo(() => {
|
|
|
117
125
|
{tab.icon === 'crash' && (<NetworkIcons_1.CrashIcon color={iconColor} size={14}/>)}
|
|
118
126
|
{tab.icon === 'device' && (<NetworkIcons_1.SmartphoneIcon color={iconColor} size={14}/>)}
|
|
119
127
|
{tab.icon === 'storage' && (<NetworkIcons_1.DatabaseIcon color={iconColor} size={14}/>)}
|
|
128
|
+
{tab.icon === 'debugging' && (<NetworkIcons_1.QrCodeIcon color={iconColor} size={14}/>)}
|
|
120
129
|
<react_native_1.Text numberOfLines={1} ellipsizeMode="tail" style={[
|
|
121
130
|
styles_1.default.contentTabButtonText,
|
|
122
131
|
isActive &&
|
|
@@ -134,3 +134,4 @@ export declare const DatabaseIcon: ({ color, size, }: IconProps) => React.JSX.El
|
|
|
134
134
|
export declare const PencilIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
135
135
|
export declare const PlusIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
136
136
|
export declare const LockIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
137
|
+
export declare const QrCodeIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
@@ -38,7 +38,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.InfoCircleIcon = exports.UserIcon = exports.LayersIcon = exports.WipeIcon = exports.FolderIcon = exports.SettingsIcon = exports.EyeIcon = exports.JsIcon = exports.CssIcon = exports.HtmlIcon = exports.BrandSquareIcon = exports.BrandCircleIcon = exports.MoonIcon = exports.SunIcon = exports.DebugIcon = exports.InsightsIcon = exports.AnalyticsIcon = exports.WhiteBackNavigation = exports.CloseWhite = exports.DownloadIcon = exports.FilterIcon = exports.ChevronIcon = exports.SortArrowIcon = exports.GlobeIcon = exports.DiffIcon = exports.SignalIcon = exports.ExportIcon = exports.HeaderPauseIcon = exports.TrashIcon = exports.FailIcon = exports.CircleAlertIcon = exports.CircleXIcon = exports.CircleCheckIcon = exports.CheckIcon = exports.TerminalIcon = exports.FetchIcon = exports.CopyIcon = exports.HeadersIcon = exports.ResponseIcon = exports.RequestIcon = exports.SizeIcon = exports.StatusIcon = exports.CalendarIcon = exports.ClockIcon = exports.ClearIcon = exports.SearchIcon = exports.ExpandCollapseIcon = exports.ScreenIcon = exports.MapPinIcon = exports.EmptyRadarIcon = void 0;
|
|
40
40
|
exports.DiagnosticsIcon = exports.StackTraceIcon = exports.LayoutIcon = exports.ChipIcon = exports.SkullIcon = exports.ShieldAlertIcon = exports.CrashIcon = exports.UserCheckIcon = exports.TargetGoalIcon = exports.RepeatIcon = exports.PinIcon = exports.HourglassIcon = exports.FlameIcon = exports.CodeBracketsIcon = exports.AndroidIcon = exports.AppleIcon = exports.LinkChainIcon = exports.GitHubIcon = exports.PackageBoxIcon = exports.ExternalLinkIcon = exports.MoneyIcon = exports.CartIcon = exports.TextAaIcon = exports.BrainIcon = exports.AtomIcon = exports.MapIcon = exports.SparkleIcon = exports.LightbulbIcon = exports.DocIcon = exports.FolderOpenIcon = exports.BanIcon = exports.BoltIcon = exports.PerformanceIcon = exports.ReduxIcon = exports.MetadataIcon = exports.StorageIcon = exports.RefreshCcwIcon = exports.TimelineIcon = exports.LiveStateIcon = exports.BundleIcon = exports.ForwardChevronIcon = exports.PackageIcon = exports.TableIcon = exports.RawIcon = exports.PrettyIcon = exports.SortIcon = exports.MotionIcon = exports.TrendingUpIcon = exports.ErrorCircleIcon = exports.WarningTriangleIcon = void 0;
|
|
41
|
-
exports.LockIcon = exports.PlusIcon = exports.PencilIcon = exports.DatabaseIcon = exports.ShieldCheckIcon = exports.WifiIcon = exports.CpuIcon = exports.ChevronDownIcon = exports.ResetIcon = exports.NpmIcon = exports.TagIcon = exports.BugIcon = exports.AlertTriangleIcon = exports.SmartphoneIcon = exports.KeyIcon = exports.BarChartIcon = exports.DiceIcon = exports.ZapIcon = exports.FlaskIcon = exports.LoadingSpinnerIcon = exports.ListenerIcon = exports.AllFramesIcon = exports.AppFramesIcon = exports.RawJsonIcon = exports.TrailIcon = void 0;
|
|
41
|
+
exports.QrCodeIcon = exports.LockIcon = exports.PlusIcon = exports.PencilIcon = exports.DatabaseIcon = exports.ShieldCheckIcon = exports.WifiIcon = exports.CpuIcon = exports.ChevronDownIcon = exports.ResetIcon = exports.NpmIcon = exports.TagIcon = exports.BugIcon = exports.AlertTriangleIcon = exports.SmartphoneIcon = exports.KeyIcon = exports.BarChartIcon = exports.DiceIcon = exports.ZapIcon = exports.FlaskIcon = exports.LoadingSpinnerIcon = exports.ListenerIcon = exports.AllFramesIcon = exports.AppFramesIcon = exports.RawJsonIcon = exports.TrailIcon = void 0;
|
|
42
42
|
const react_1 = __importDefault(require("react"));
|
|
43
43
|
const react_native_svg_1 = __importStar(require("react-native-svg"));
|
|
44
44
|
const AppColors_1 = require("../styles/AppColors");
|
|
@@ -899,3 +899,10 @@ const LockIcon = ({ color = AppColors_1.AppColors.grayTextWeak, size = 14, }) =>
|
|
|
899
899
|
<react_native_svg_1.Path d="M7 11V7a5 5 0 0 1 10 0v4" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
900
900
|
</react_native_svg_1.default>);
|
|
901
901
|
exports.LockIcon = LockIcon;
|
|
902
|
+
const QrCodeIcon = ({ color = AppColors_1.AppColors.grayTextWeak, size = 14, }) => (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
903
|
+
<react_native_svg_1.Rect x="3" y="3" width="7" height="7" rx="1.5" stroke={color} strokeWidth="2"/>
|
|
904
|
+
<react_native_svg_1.Rect x="14" y="3" width="7" height="7" rx="1.5" stroke={color} strokeWidth="2"/>
|
|
905
|
+
<react_native_svg_1.Rect x="3" y="14" width="7" height="7" rx="1.5" stroke={color} strokeWidth="2"/>
|
|
906
|
+
<react_native_svg_1.Path d="M14 14h3v3h-3zM18 18h3v3h-3zM14 19h3v2h-3zM19 14h2v3h-2z" fill={color}/>
|
|
907
|
+
</react_native_svg_1.default>);
|
|
908
|
+
exports.QrCodeIcon = QrCodeIcon;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.QRCodeView = void 0;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
const react_native_1 = require("react-native");
|
|
39
|
+
const react_native_svg_1 = __importStar(require("react-native-svg"));
|
|
40
|
+
const qrGenerator_1 = require("../helpers/qrGenerator");
|
|
41
|
+
const AppColors_1 = require("../styles/AppColors");
|
|
42
|
+
const QRCodeView = ({ value, size = 180, color = AppColors_1.AppColors.primaryBlack, backgroundColor = AppColors_1.AppColors.white, }) => {
|
|
43
|
+
const matrix = (0, react_1.useMemo)(() => (0, qrGenerator_1.generateQRMatrix)(value), [value]);
|
|
44
|
+
const numCells = matrix.length;
|
|
45
|
+
const cellSize = size / numCells;
|
|
46
|
+
return (<react_native_1.View style={[
|
|
47
|
+
styles.container,
|
|
48
|
+
{
|
|
49
|
+
width: size + 16,
|
|
50
|
+
height: size + 16,
|
|
51
|
+
backgroundColor,
|
|
52
|
+
},
|
|
53
|
+
]}>
|
|
54
|
+
<react_native_svg_1.default width={size} height={size} viewBox={`0 0 ${size} ${size}`}>
|
|
55
|
+
<react_native_svg_1.G>
|
|
56
|
+
{matrix.map((row, r) => row.map((cell, c) => {
|
|
57
|
+
if (!cell)
|
|
58
|
+
return null;
|
|
59
|
+
return (<react_native_svg_1.Rect key={`${r}-${c}`} x={c * cellSize} y={r * cellSize} width={cellSize + 0.2} height={cellSize + 0.2} fill={color}/>);
|
|
60
|
+
}))}
|
|
61
|
+
</react_native_svg_1.G>
|
|
62
|
+
</react_native_svg_1.default>
|
|
63
|
+
</react_native_1.View>);
|
|
64
|
+
};
|
|
65
|
+
exports.QRCodeView = QRCodeView;
|
|
66
|
+
const styles = react_native_1.StyleSheet.create({
|
|
67
|
+
container: {
|
|
68
|
+
padding: 8,
|
|
69
|
+
borderRadius: 14,
|
|
70
|
+
alignItems: 'center',
|
|
71
|
+
justifyContent: 'center',
|
|
72
|
+
shadowColor: AppColors_1.AppColors.black,
|
|
73
|
+
shadowOffset: { width: 0, height: 2 },
|
|
74
|
+
shadowOpacity: 0.1,
|
|
75
|
+
shadowRadius: 6,
|
|
76
|
+
elevation: 3,
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
exports.default = exports.QRCodeView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "2.3.
|
|
1
|
+
export declare const LIB_VERSION = "2.3.11";
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateQRMatrix = generateQRMatrix;
|
|
4
|
+
function generateQRMatrix(text, ecc = 'M') {
|
|
5
|
+
try {
|
|
6
|
+
return createQRMatrix(text, ecc);
|
|
7
|
+
}
|
|
8
|
+
catch {
|
|
9
|
+
return createFallbackMatrix(text);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function createQRMatrix(data, ecc) {
|
|
13
|
+
const length = data.length;
|
|
14
|
+
let version = 1;
|
|
15
|
+
if (length > 14)
|
|
16
|
+
version = 2;
|
|
17
|
+
if (length > 26)
|
|
18
|
+
version = 3;
|
|
19
|
+
if (length > 42)
|
|
20
|
+
version = 4;
|
|
21
|
+
if (length > 62)
|
|
22
|
+
version = 5;
|
|
23
|
+
if (length > 84)
|
|
24
|
+
version = 6;
|
|
25
|
+
if (length > 106)
|
|
26
|
+
version = 7;
|
|
27
|
+
if (length > 122)
|
|
28
|
+
version = 8;
|
|
29
|
+
if (length > 152)
|
|
30
|
+
version = 9;
|
|
31
|
+
if (length > 180)
|
|
32
|
+
version = 10;
|
|
33
|
+
const size = version * 4 + 17;
|
|
34
|
+
const matrix = Array(size)
|
|
35
|
+
.fill(null)
|
|
36
|
+
.map(() => Array(size).fill(null));
|
|
37
|
+
addFinderPattern(matrix, 0, 0);
|
|
38
|
+
addFinderPattern(matrix, size - 7, 0);
|
|
39
|
+
addFinderPattern(matrix, 0, size - 7);
|
|
40
|
+
for (let i = 8; i < size - 8; i++) {
|
|
41
|
+
const val = i % 2 === 0;
|
|
42
|
+
if (matrix[6][i] === null)
|
|
43
|
+
matrix[6][i] = val;
|
|
44
|
+
if (matrix[i][6] === null)
|
|
45
|
+
matrix[i][6] = val;
|
|
46
|
+
}
|
|
47
|
+
if (version >= 2) {
|
|
48
|
+
const pos = getAlignmentPositions(version);
|
|
49
|
+
for (const r of pos) {
|
|
50
|
+
for (const c of pos) {
|
|
51
|
+
if (matrix[r][c] === null) {
|
|
52
|
+
addAlignmentPattern(matrix, r - 2, c - 2);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const bits = [];
|
|
58
|
+
bits.push(false, true, false, false);
|
|
59
|
+
for (let i = 7; i >= 0; i--) {
|
|
60
|
+
bits.push(((length >> i) & 1) === 1);
|
|
61
|
+
}
|
|
62
|
+
for (let i = 0; i < length; i++) {
|
|
63
|
+
const code = data.charCodeAt(i);
|
|
64
|
+
for (let b = 7; b >= 0; b--) {
|
|
65
|
+
bits.push(((code >> b) & 1) === 1);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
for (let i = 0; i < 4 && bits.length % 8 !== 0; i++) {
|
|
69
|
+
bits.push(false);
|
|
70
|
+
}
|
|
71
|
+
while (bits.length % 8 !== 0) {
|
|
72
|
+
bits.push(false);
|
|
73
|
+
}
|
|
74
|
+
const padBytes = [0xec, 0x11];
|
|
75
|
+
let padIdx = 0;
|
|
76
|
+
const totalDataBits = size * size * 0.6;
|
|
77
|
+
while (bits.length < totalDataBits) {
|
|
78
|
+
const b = padBytes[padIdx % 2];
|
|
79
|
+
padIdx++;
|
|
80
|
+
for (let bit = 7; bit >= 0; bit--) {
|
|
81
|
+
bits.push(((b >> bit) & 1) === 1);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
let bitIdx = 0;
|
|
85
|
+
let upwards = true;
|
|
86
|
+
for (let col = size - 1; col > 0; col -= 2) {
|
|
87
|
+
if (col === 6)
|
|
88
|
+
col--;
|
|
89
|
+
const rows = upwards
|
|
90
|
+
? Array.from({ length: size }, (_, i) => size - 1 - i)
|
|
91
|
+
: Array.from({ length: size }, (_, i) => i);
|
|
92
|
+
for (const row of rows) {
|
|
93
|
+
for (const c of [col, col - 1]) {
|
|
94
|
+
if (matrix[row][c] === null) {
|
|
95
|
+
const bit = bitIdx < bits.length ? bits[bitIdx++] : false;
|
|
96
|
+
const mask = (row + c) % 2 === 0;
|
|
97
|
+
matrix[row][c] = bit !== mask;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
upwards = !upwards;
|
|
102
|
+
}
|
|
103
|
+
return matrix.map(row => row.map(cell => cell ?? false));
|
|
104
|
+
}
|
|
105
|
+
function addFinderPattern(matrix, row, col) {
|
|
106
|
+
for (let r = -1; r <= 7; r++) {
|
|
107
|
+
for (let c = -1; c <= 7; c++) {
|
|
108
|
+
const mr = row + r;
|
|
109
|
+
const mc = col + c;
|
|
110
|
+
if (mr >= 0 && mr < matrix.length && mc >= 0 && mc < matrix.length) {
|
|
111
|
+
if ((r >= 0 && r <= 6 && (c === 0 || c === 6)) ||
|
|
112
|
+
(c >= 0 && c <= 6 && (r === 0 || r === 6)) ||
|
|
113
|
+
(r >= 2 && r <= 4 && c >= 2 && c <= 4)) {
|
|
114
|
+
matrix[mr][mc] = true;
|
|
115
|
+
}
|
|
116
|
+
else if (r >= 0 && r <= 6 && c >= 0 && c <= 6) {
|
|
117
|
+
matrix[mr][mc] = false;
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
matrix[mr][mc] = false;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function addAlignmentPattern(matrix, row, col) {
|
|
127
|
+
for (let r = 0; r < 5; r++) {
|
|
128
|
+
for (let c = 0; c < 5; c++) {
|
|
129
|
+
const isOuter = r === 0 || r === 4 || c === 0 || c === 4;
|
|
130
|
+
const isCenter = r === 2 && c === 2;
|
|
131
|
+
matrix[row + r][col + c] = isOuter || isCenter;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
function getAlignmentPositions(version) {
|
|
136
|
+
if (version === 1)
|
|
137
|
+
return [];
|
|
138
|
+
if (version === 2)
|
|
139
|
+
return [6, 18];
|
|
140
|
+
if (version === 3)
|
|
141
|
+
return [6, 22];
|
|
142
|
+
if (version === 4)
|
|
143
|
+
return [6, 26];
|
|
144
|
+
if (version === 5)
|
|
145
|
+
return [6, 30];
|
|
146
|
+
if (version === 6)
|
|
147
|
+
return [6, 34];
|
|
148
|
+
if (version === 7)
|
|
149
|
+
return [6, 22, 38];
|
|
150
|
+
if (version === 8)
|
|
151
|
+
return [6, 24, 42];
|
|
152
|
+
if (version === 9)
|
|
153
|
+
return [6, 26, 46];
|
|
154
|
+
return [6, 28, 50];
|
|
155
|
+
}
|
|
156
|
+
function createFallbackMatrix(text) {
|
|
157
|
+
const size = 25;
|
|
158
|
+
const matrix = Array(size)
|
|
159
|
+
.fill(false)
|
|
160
|
+
.map(() => Array(size).fill(false));
|
|
161
|
+
addFinderPattern(matrix, 0, 0);
|
|
162
|
+
addFinderPattern(matrix, size - 7, 0);
|
|
163
|
+
addFinderPattern(matrix, 0, size - 7);
|
|
164
|
+
for (let i = 0; i < text.length; i++) {
|
|
165
|
+
const r = (i * 3) % (size - 10) + 8;
|
|
166
|
+
const c = (i * 7) % (size - 10) + 8;
|
|
167
|
+
matrix[r][c] = true;
|
|
168
|
+
}
|
|
169
|
+
return matrix;
|
|
170
|
+
}
|
package/dist/commonjs/index.js
CHANGED
|
@@ -209,6 +209,7 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
209
209
|
crash: false,
|
|
210
210
|
device: false,
|
|
211
211
|
storage: false,
|
|
212
|
+
debugging: true,
|
|
212
213
|
});
|
|
213
214
|
const [maxNetworkLogs, setMaxNetworkLogs] = (0, react_1.useState)(100);
|
|
214
215
|
const [maxAnalyticsEventsLimit, setMaxAnalyticsEventsLimit] = (0, react_1.useState)(75);
|
|
@@ -262,6 +263,7 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
262
263
|
crash: false,
|
|
263
264
|
device: false,
|
|
264
265
|
storage: false,
|
|
266
|
+
debugging: true,
|
|
265
267
|
});
|
|
266
268
|
setDefaultTab('apis');
|
|
267
269
|
setIsAutoRamLimitEnabled(true);
|
|
@@ -8,6 +8,7 @@ export declare const ActiveTab: {
|
|
|
8
8
|
readonly Crash: "crash";
|
|
9
9
|
readonly Device: "device";
|
|
10
10
|
readonly Storage: "storage";
|
|
11
|
+
readonly Debugging: "debugging";
|
|
11
12
|
};
|
|
12
13
|
export type ActiveTab = (typeof ActiveTab)[keyof typeof ActiveTab];
|
|
13
14
|
export declare const Method: {
|
|
@@ -59,6 +60,7 @@ export declare const SettingsPage: {
|
|
|
59
60
|
readonly Crash: "crash";
|
|
60
61
|
readonly Device: "device";
|
|
61
62
|
readonly Storage: "storage";
|
|
63
|
+
readonly Debugging: "debugging";
|
|
62
64
|
};
|
|
63
65
|
export type SettingsPage = (typeof SettingsPage)[keyof typeof SettingsPage] | null;
|
|
64
66
|
export declare const SettingsSubTab: {
|
|
@@ -11,6 +11,7 @@ exports.ActiveTab = {
|
|
|
11
11
|
Crash: 'crash',
|
|
12
12
|
Device: 'device',
|
|
13
13
|
Storage: 'storage',
|
|
14
|
+
Debugging: 'debugging',
|
|
14
15
|
};
|
|
15
16
|
exports.Method = {
|
|
16
17
|
All: 'ALL',
|
|
@@ -56,6 +57,7 @@ exports.SettingsPage = {
|
|
|
56
57
|
Crash: 'crash',
|
|
57
58
|
Device: 'device',
|
|
58
59
|
Storage: 'storage',
|
|
60
|
+
Debugging: 'debugging',
|
|
59
61
|
};
|
|
60
62
|
exports.SettingsSubTab = {
|
|
61
63
|
Module: 'module',
|