react-native-debug-toolkit 3.2.1 → 3.2.3
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/README.md +13 -2
- package/README.zh-CN.md +13 -2
- package/android/build.gradle +34 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/com/reactnativedebugtoolkit/DebugToolkitDevConnectModule.java +154 -0
- package/android/src/main/java/com/reactnativedebugtoolkit/ReactNativeDebugToolkitPackage.java +25 -0
- package/ios/DebugToolkitDevConnect.mm +81 -0
- package/lib/commonjs/features/devConnect/DevConnectQrScanner.js +115 -70
- package/lib/commonjs/features/devConnect/DevConnectQrScanner.js.map +1 -1
- package/lib/commonjs/features/devConnect/DevConnectTab.js +232 -161
- package/lib/commonjs/features/devConnect/DevConnectTab.js.map +1 -1
- package/lib/commonjs/features/devConnect/devConnectPreferences.js +35 -5
- package/lib/commonjs/features/devConnect/devConnectPreferences.js.map +1 -1
- package/lib/commonjs/features/devConnect/devConnectUtils.js +99 -15
- package/lib/commonjs/features/devConnect/devConnectUtils.js.map +1 -1
- package/lib/commonjs/features/devConnect/index.js +39 -2
- package/lib/commonjs/features/devConnect/index.js.map +1 -1
- package/lib/commonjs/features/devConnect/nativeDevConnect.js +108 -0
- package/lib/commonjs/features/devConnect/nativeDevConnect.js.map +1 -0
- package/lib/commonjs/features/devConnect/platformDetect.js +7 -11
- package/lib/commonjs/features/devConnect/platformDetect.js.map +1 -1
- package/lib/commonjs/utils/debugPreferences.js +43 -6
- package/lib/commonjs/utils/debugPreferences.js.map +1 -1
- package/lib/module/features/devConnect/DevConnectQrScanner.js +116 -71
- package/lib/module/features/devConnect/DevConnectQrScanner.js.map +1 -1
- package/lib/module/features/devConnect/DevConnectTab.js +235 -164
- package/lib/module/features/devConnect/DevConnectTab.js.map +1 -1
- package/lib/module/features/devConnect/devConnectPreferences.js +33 -6
- package/lib/module/features/devConnect/devConnectPreferences.js.map +1 -1
- package/lib/module/features/devConnect/devConnectUtils.js +94 -15
- package/lib/module/features/devConnect/devConnectUtils.js.map +1 -1
- package/lib/module/features/devConnect/index.js +11 -3
- package/lib/module/features/devConnect/index.js.map +1 -1
- package/lib/module/features/devConnect/nativeDevConnect.js +102 -0
- package/lib/module/features/devConnect/nativeDevConnect.js.map +1 -0
- package/lib/module/features/devConnect/platformDetect.js +8 -12
- package/lib/module/features/devConnect/platformDetect.js.map +1 -1
- package/lib/module/utils/debugPreferences.js +43 -6
- package/lib/module/utils/debugPreferences.js.map +1 -1
- package/lib/typescript/src/features/devConnect/DevConnectQrScanner.d.ts +3 -2
- package/lib/typescript/src/features/devConnect/DevConnectQrScanner.d.ts.map +1 -1
- package/lib/typescript/src/features/devConnect/DevConnectTab.d.ts.map +1 -1
- package/lib/typescript/src/features/devConnect/devConnectPreferences.d.ts +6 -0
- package/lib/typescript/src/features/devConnect/devConnectPreferences.d.ts.map +1 -1
- package/lib/typescript/src/features/devConnect/devConnectUtils.d.ts +18 -1
- package/lib/typescript/src/features/devConnect/devConnectUtils.d.ts.map +1 -1
- package/lib/typescript/src/features/devConnect/index.d.ts +2 -2
- package/lib/typescript/src/features/devConnect/index.d.ts.map +1 -1
- package/lib/typescript/src/features/devConnect/nativeDevConnect.d.ts +17 -0
- package/lib/typescript/src/features/devConnect/nativeDevConnect.d.ts.map +1 -0
- package/lib/typescript/src/features/devConnect/platformDetect.d.ts.map +1 -1
- package/lib/typescript/src/features/devConnect/types.d.ts +3 -0
- package/lib/typescript/src/features/devConnect/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/debugPreferences.d.ts +2 -0
- package/lib/typescript/src/utils/debugPreferences.d.ts.map +1 -1
- package/package.json +4 -1
- package/react-native-debug-toolkit.podspec +18 -0
- package/src/features/devConnect/DevConnectQrScanner.tsx +101 -60
- package/src/features/devConnect/DevConnectTab.tsx +227 -105
- package/src/features/devConnect/devConnectPreferences.ts +50 -5
- package/src/features/devConnect/devConnectUtils.ts +122 -15
- package/src/features/devConnect/index.ts +13 -0
- package/src/features/devConnect/nativeDevConnect.ts +126 -0
- package/src/features/devConnect/platformDetect.ts +8 -13
- package/src/features/devConnect/types.ts +3 -0
- package/src/utils/debugPreferences.ts +49 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_colors","_cameraKit","_devConnectUtils","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CameraErrorBoundary","Component","state","hasError","getDerivedStateFromError","componentDidCatch","error","console","warn","message","props","onCameraError","render","children","DevConnectQrScanner","visible","onClose","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_colors","_cameraKit","_devConnectUtils","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CameraErrorBoundary","Component","state","hasError","getDerivedStateFromError","componentDidCatch","error","console","warn","message","props","onCameraError","render","children","DevConnectQrScanner","visible","onClose","onScanTarget","scannedRef","useRef","setError","useState","cameraFailed","setCameraFailed","scanner","getScannerModule","useEffect","current","handleScanned","useCallback","rawValue","parsed","parseMetroQrPayload","computerHost","metroPort","handleCameraKitRead","event","nativeEvent","codeStringValue","handleExpoScanned","result","value","handleCameraError","_msg","jsx","Modal","animationType","presentationStyle","onRequestClose","jsxs","View","style","styles","container","previewLayer","kind","CameraKit","Camera","camera","cameraType","CameraType","Back","scanBarcode","onReadCode","showFrame","laserColor","Colors","primary","frameColor","allowedBarcodeTypes","ExpoCamera","onBarCodeScanned","barCodeScannerSettings","barCodeTypes","cameraFallback","Text","cameraFallbackText","cameraFallbackHint","topBar","titleGroup","title","subtitle","TouchableOpacity","closeButton","onPress","activeOpacity","closeButtonText","statusPill","statusPillError","statusText","statusTextError","StyleSheet","create","flex","backgroundColor","absoluteFillObject","justifyContent","alignItems","padding","fontSize","color","fontWeight","marginBottom","textAlign","position","top","left","right","flexDirection","paddingLeft","paddingRight","paddingVertical","borderRadius","marginTop","paddingHorizontal","bottom","borderWidth","borderColor","lineHeight"],"sourceRoot":"../../../../src","sources":["features/devConnect/DevConnectQrScanner.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAKA,IAAAI,gBAAA,GAAAJ,OAAA;AAAmF,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAD,wBAAAO,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAT,uBAAA,YAAAA,CAAAO,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EA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AE;EAAG,CAAC;EAChF5B,eAAe,EAAE;IAAEU,KAAK,EAAE;EAAO;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -7,47 +7,86 @@ exports.DevConnectTab = DevConnectTab;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _colors = require("../../ui/theme/colors");
|
|
10
|
-
var _copyToComputer = require("../../utils/copyToComputer");
|
|
11
10
|
var _DaemonClient = require("../../utils/DaemonClient");
|
|
12
11
|
var _devConnectUtils = require("./devConnectUtils");
|
|
13
12
|
var _devConnectPreferences = require("./devConnectPreferences");
|
|
13
|
+
var _nativeDevConnect = require("./nativeDevConnect");
|
|
14
14
|
var _DevConnectQrScanner = require("./DevConnectQrScanner");
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
17
17
|
const CONNECTION_TIMEOUT_MS = 2000;
|
|
18
|
-
|
|
18
|
+
function getSimulatorMetroHost() {
|
|
19
|
+
return _reactNative.Platform.OS === 'android' ? '10.0.2.2' : 'localhost';
|
|
20
|
+
}
|
|
21
|
+
function describeMetroFailure(result) {
|
|
22
|
+
if (result.reason === 'native_unavailable') {
|
|
23
|
+
return 'Native DevConnect not installed. Rebuild app after installing native module.';
|
|
24
|
+
}
|
|
25
|
+
if (result.reason === 'metro_unreachable') {
|
|
26
|
+
return result.error ? `Metro not reachable: ${result.error}` : 'Metro not reachable. Start Metro on that port.';
|
|
27
|
+
}
|
|
28
|
+
if (result.reason === 'fetch_unavailable') {
|
|
29
|
+
return 'Cannot check Metro because fetch is unavailable.';
|
|
30
|
+
}
|
|
31
|
+
if (result.reason === 'invalid_target') {
|
|
32
|
+
return 'Enter a valid computer IP and Metro port.';
|
|
33
|
+
}
|
|
34
|
+
return result.error ? `Metro switch failed: ${result.error}` : 'Metro switch failed.';
|
|
35
|
+
}
|
|
19
36
|
function DevConnectTab({
|
|
20
37
|
snapshot
|
|
21
38
|
}) {
|
|
22
39
|
const inputRef = (0, _react.useRef)(null);
|
|
23
40
|
const [computerHost, setComputerHost] = (0, _react.useState)(snapshot.computerHost);
|
|
41
|
+
const [metroPort, setMetroPort] = (0, _react.useState)(snapshot.metroPort);
|
|
42
|
+
const [daemonPort, setDaemonPort] = (0, _react.useState)(snapshot.daemonPort);
|
|
24
43
|
const [streaming, setStreaming] = (0, _react.useState)(snapshot.streaming);
|
|
25
44
|
const [syncState, setSyncState] = (0, _react.useState)(snapshot.streaming ? 'running' : 'idle');
|
|
26
45
|
const [message, setMessage] = (0, _react.useState)(null);
|
|
27
46
|
const [sending, setSending] = (0, _react.useState)(false);
|
|
47
|
+
const [metroBusy, setMetroBusy] = (0, _react.useState)(false);
|
|
28
48
|
const [qrVisible, setQrVisible] = (0, _react.useState)(false);
|
|
29
49
|
const isSim = snapshot.isSimulator;
|
|
30
50
|
(0, _react.useEffect)(() => {
|
|
31
51
|
setComputerHost(snapshot.computerHost);
|
|
52
|
+
setMetroPort(snapshot.metroPort);
|
|
53
|
+
setDaemonPort(snapshot.daemonPort);
|
|
32
54
|
setStreaming(snapshot.streaming);
|
|
33
55
|
setSyncState(snapshot.streaming ? 'running' : 'idle');
|
|
34
|
-
}, [snapshot.computerHost, snapshot.streaming]);
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} : (0, _devConnectUtils.buildMetroUrls)(computerHost), [isSim, computerHost]);
|
|
56
|
+
}, [snapshot.computerHost, snapshot.daemonPort, snapshot.metroPort, snapshot.streaming]);
|
|
57
|
+
const metroHost = isSim ? getSimulatorMetroHost() : computerHost;
|
|
58
|
+
const metroTarget = (0, _react.useMemo)(() => (0, _devConnectUtils.buildMetroTarget)(metroHost, metroPort), [metroHost, metroPort]);
|
|
59
|
+
const metroUrls = (0, _react.useMemo)(() => (0, _devConnectUtils.buildMetroUrls)(metroHost, metroPort), [metroHost, metroPort]);
|
|
39
60
|
const handleHostChange = (0, _react.useCallback)(value => {
|
|
40
61
|
setComputerHost(value);
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
43
|
-
(
|
|
62
|
+
const target = (0, _devConnectUtils.parseComputerTarget)(value);
|
|
63
|
+
if (target) {
|
|
64
|
+
setMetroPort(target.metroPort);
|
|
65
|
+
(0, _devConnectPreferences.saveComputerTarget)(value).catch(() => {});
|
|
44
66
|
}
|
|
45
67
|
setSyncState(prev => prev === 'failed' ? 'idle' : prev);
|
|
46
68
|
setMessage(null);
|
|
47
69
|
}, []);
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
(0,
|
|
70
|
+
const handleMetroPortChange = (0, _react.useCallback)(value => {
|
|
71
|
+
setMetroPort(value);
|
|
72
|
+
const normalized = (0, _devConnectUtils.normalizePort)(value);
|
|
73
|
+
if (normalized) {
|
|
74
|
+
(0, _devConnectPreferences.saveMetroPort)(normalized).catch(() => {});
|
|
75
|
+
}
|
|
76
|
+
setMessage(null);
|
|
77
|
+
}, []);
|
|
78
|
+
const handleDaemonPortChange = (0, _react.useCallback)(value => {
|
|
79
|
+
setDaemonPort(value);
|
|
80
|
+
const normalized = (0, _devConnectUtils.normalizePort)(value);
|
|
81
|
+
if (normalized) {
|
|
82
|
+
(0, _devConnectPreferences.saveDaemonPort)(normalized).catch(() => {});
|
|
83
|
+
}
|
|
84
|
+
setMessage(null);
|
|
85
|
+
}, []);
|
|
86
|
+
const handleQrTarget = (0, _react.useCallback)(target => {
|
|
87
|
+
setComputerHost(target.computerHost);
|
|
88
|
+
setMetroPort(target.metroPort);
|
|
89
|
+
(0, _devConnectPreferences.saveComputerTarget)(`${target.computerHost}:${target.metroPort}`).catch(() => {});
|
|
51
90
|
setMessage('Computer IP updated from QR code.');
|
|
52
91
|
}, []);
|
|
53
92
|
const validateSettings = (0, _react.useCallback)(() => {
|
|
@@ -55,24 +94,30 @@ function DevConnectTab({
|
|
|
55
94
|
setMessage('Enter your computer IP first.');
|
|
56
95
|
return false;
|
|
57
96
|
}
|
|
97
|
+
if (!(0, _devConnectUtils.normalizePort)(daemonPort)) {
|
|
98
|
+
setMessage('Enter a valid desktop logs port.');
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
58
101
|
return true;
|
|
59
|
-
}, [computerHost, isSim]);
|
|
102
|
+
}, [computerHost, daemonPort, isSim]);
|
|
60
103
|
const configureDaemon = (0, _react.useCallback)(() => {
|
|
61
104
|
const normalizedHost = isSim ? '' : (0, _devConnectUtils.normalizeComputerHost)(computerHost) ?? '';
|
|
105
|
+
const normalizedDaemonPort = (0, _devConnectUtils.normalizePort)(daemonPort) ?? _devConnectUtils.DEFAULT_DAEMON_PORT;
|
|
106
|
+
const deviceHost = isSim ? '' : (0, _devConnectUtils.buildDaemonDeviceHost)(normalizedHost, normalizedDaemonPort);
|
|
62
107
|
const settings = {
|
|
63
108
|
mode: isSim ? 'simulator' : 'device',
|
|
64
109
|
endpoint: '',
|
|
65
|
-
deviceHost
|
|
110
|
+
deviceHost,
|
|
66
111
|
token: ''
|
|
67
112
|
};
|
|
68
113
|
_DaemonClient.daemonClient.configure(settings);
|
|
69
114
|
const normalized = (0, _DaemonClient.normalizeDaemonSettings)(settings);
|
|
70
|
-
const endpoint = normalized.endpoint || (isSim ? (0, _DaemonClient.getDefaultDaemonEndpoint)() : (0, _DaemonClient.buildDeviceDaemonEndpoint)(
|
|
115
|
+
const endpoint = normalized.endpoint || (isSim ? (0, _DaemonClient.getDefaultDaemonEndpoint)() : (0, _DaemonClient.buildDeviceDaemonEndpoint)(deviceHost));
|
|
71
116
|
return {
|
|
72
117
|
...normalized,
|
|
73
118
|
endpoint
|
|
74
119
|
};
|
|
75
|
-
}, [computerHost, isSim]);
|
|
120
|
+
}, [computerHost, daemonPort, isSim]);
|
|
76
121
|
const toggleLiveSync = (0, _react.useCallback)(async () => {
|
|
77
122
|
if (streaming) {
|
|
78
123
|
_DaemonClient.daemonClient.disconnect();
|
|
@@ -82,7 +127,9 @@ function DevConnectTab({
|
|
|
82
127
|
setMessage(null);
|
|
83
128
|
return;
|
|
84
129
|
}
|
|
85
|
-
if (!validateSettings())
|
|
130
|
+
if (!validateSettings()) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
86
133
|
const daemonOptions = configureDaemon();
|
|
87
134
|
setMessage('Checking desktop connection...');
|
|
88
135
|
setSyncState('checking');
|
|
@@ -120,7 +167,9 @@ function DevConnectTab({
|
|
|
120
167
|
setStreaming(true);
|
|
121
168
|
}, [configureDaemon, streaming, validateSettings]);
|
|
122
169
|
const sendOnce = (0, _react.useCallback)(async () => {
|
|
123
|
-
if (!validateSettings())
|
|
170
|
+
if (!validateSettings()) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
124
173
|
const daemonOptions = configureDaemon();
|
|
125
174
|
setSending(true);
|
|
126
175
|
setMessage('Checking desktop connection...');
|
|
@@ -148,17 +197,51 @@ function DevConnectTab({
|
|
|
148
197
|
setSending(false);
|
|
149
198
|
}
|
|
150
199
|
}, [configureDaemon, validateSettings]);
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
200
|
+
const applyRemoteBundle = (0, _react.useCallback)(async () => {
|
|
201
|
+
if (!metroTarget) {
|
|
202
|
+
setMessage('Enter a valid computer IP and Metro port.');
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
if (!snapshot.nativeMetroAvailable) {
|
|
206
|
+
setMessage(describeMetroFailure({
|
|
207
|
+
reason: 'native_unavailable'
|
|
208
|
+
}));
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
setMetroBusy(true);
|
|
212
|
+
setMessage('Checking Metro...');
|
|
213
|
+
try {
|
|
214
|
+
const result = await (0, _nativeDevConnect.applyMetroBundle)(metroTarget.host, metroTarget.port);
|
|
215
|
+
if (result.ok) {
|
|
216
|
+
setMessage(`Using Metro at ${result.hostPort}. Reloading...`);
|
|
217
|
+
} else {
|
|
218
|
+
setMessage(describeMetroFailure(result));
|
|
219
|
+
}
|
|
220
|
+
} finally {
|
|
221
|
+
setMetroBusy(false);
|
|
222
|
+
}
|
|
223
|
+
}, [metroTarget, snapshot.nativeMetroAvailable]);
|
|
224
|
+
const resetRemoteBundle = (0, _react.useCallback)(async () => {
|
|
225
|
+
if (!snapshot.nativeMetroAvailable) {
|
|
226
|
+
setMessage(describeMetroFailure({
|
|
227
|
+
reason: 'native_unavailable'
|
|
228
|
+
}));
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
setMetroBusy(true);
|
|
232
|
+
try {
|
|
233
|
+
const result = await (0, _nativeDevConnect.resetMetroBundle)();
|
|
234
|
+
if (result.ok) {
|
|
235
|
+
setMessage('Metro host reset. Reloading...');
|
|
236
|
+
} else {
|
|
237
|
+
setMessage(describeMetroFailure(result));
|
|
238
|
+
}
|
|
239
|
+
} finally {
|
|
240
|
+
setMetroBusy(false);
|
|
241
|
+
}
|
|
242
|
+
}, [snapshot.nativeMetroAvailable]);
|
|
243
|
+
const canConnect = isSim || Boolean((0, _devConnectUtils.normalizeComputerHost)(computerHost)) && Boolean((0, _devConnectUtils.normalizePort)(daemonPort));
|
|
244
|
+
const canUseMetro = Boolean(metroTarget) && snapshot.nativeMetroAvailable && !metroBusy;
|
|
162
245
|
const busy = sending || syncState === 'checking';
|
|
163
246
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.KeyboardAvoidingView, {
|
|
164
247
|
style: styles.container,
|
|
@@ -169,9 +252,9 @@ function DevConnectTab({
|
|
|
169
252
|
contentContainerStyle: styles.scrollContent,
|
|
170
253
|
children: [isSim ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
171
254
|
style: styles.badge,
|
|
172
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
255
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
173
256
|
style: styles.badgeText,
|
|
174
|
-
children: "Simulator
|
|
257
|
+
children: ["Simulator/emulator - using ", getSimulatorMetroHost()]
|
|
175
258
|
})
|
|
176
259
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
177
260
|
style: styles.section,
|
|
@@ -204,6 +287,47 @@ function DevConnectTab({
|
|
|
204
287
|
})
|
|
205
288
|
}) : null]
|
|
206
289
|
})]
|
|
290
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
291
|
+
style: styles.section,
|
|
292
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
293
|
+
style: styles.label,
|
|
294
|
+
children: "Ports"
|
|
295
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
296
|
+
style: styles.portRow,
|
|
297
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
298
|
+
style: styles.portField,
|
|
299
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
300
|
+
style: styles.portLabel,
|
|
301
|
+
children: "Metro"
|
|
302
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
303
|
+
style: styles.portInput,
|
|
304
|
+
value: metroPort,
|
|
305
|
+
onChangeText: handleMetroPortChange,
|
|
306
|
+
placeholder: _devConnectUtils.DEFAULT_METRO_PORT,
|
|
307
|
+
placeholderTextColor: _colors.Colors.textLight,
|
|
308
|
+
autoCapitalize: "none",
|
|
309
|
+
autoCorrect: false,
|
|
310
|
+
keyboardType: "number-pad",
|
|
311
|
+
returnKeyType: "done"
|
|
312
|
+
})]
|
|
313
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
314
|
+
style: styles.portField,
|
|
315
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
316
|
+
style: styles.portLabel,
|
|
317
|
+
children: "Logs"
|
|
318
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
319
|
+
style: styles.portInput,
|
|
320
|
+
value: daemonPort,
|
|
321
|
+
onChangeText: handleDaemonPortChange,
|
|
322
|
+
placeholder: _devConnectUtils.DEFAULT_DAEMON_PORT,
|
|
323
|
+
placeholderTextColor: _colors.Colors.textLight,
|
|
324
|
+
autoCapitalize: "none",
|
|
325
|
+
autoCorrect: false,
|
|
326
|
+
keyboardType: "number-pad",
|
|
327
|
+
returnKeyType: "done"
|
|
328
|
+
})]
|
|
329
|
+
})]
|
|
330
|
+
})]
|
|
207
331
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
208
332
|
style: styles.actions,
|
|
209
333
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
@@ -235,99 +359,66 @@ function DevConnectTab({
|
|
|
235
359
|
children: "Remote JS Bundle"
|
|
236
360
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
237
361
|
style: styles.sectionDesc,
|
|
238
|
-
children: "
|
|
362
|
+
children: "Apply this Metro host to React Native dev settings and reload the app."
|
|
239
363
|
}), !metroUrls ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
240
364
|
style: styles.stepCard,
|
|
241
365
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
242
366
|
style: styles.stepHint,
|
|
243
|
-
children: "Enter your computer IP
|
|
367
|
+
children: "Enter your computer IP and Metro port to get started."
|
|
244
368
|
})
|
|
245
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
369
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
370
|
+
style: styles.stepCard,
|
|
246
371
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
247
|
-
style: styles.
|
|
248
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
249
|
-
style: styles.
|
|
250
|
-
children:
|
|
251
|
-
style: styles.stepNumber,
|
|
252
|
-
children: "1"
|
|
253
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
254
|
-
style: styles.stepTitle,
|
|
255
|
-
children: "Copy bundle URL"
|
|
256
|
-
})]
|
|
372
|
+
style: styles.urlRow,
|
|
373
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
374
|
+
style: styles.urlLabel,
|
|
375
|
+
children: "HTTP"
|
|
257
376
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
258
|
-
style: styles.
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
style: styles.urlRow,
|
|
262
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
263
|
-
style: styles.urlText,
|
|
264
|
-
numberOfLines: 1,
|
|
265
|
-
children: metroUrls.httpUrl
|
|
266
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
267
|
-
style: styles.copyButton,
|
|
268
|
-
onPress: () => copyUrl('Metro URL', metroUrls.httpUrl),
|
|
269
|
-
activeOpacity: 0.7,
|
|
270
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
271
|
-
style: styles.copyButtonText,
|
|
272
|
-
children: "Copy"
|
|
273
|
-
})
|
|
274
|
-
})]
|
|
275
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
276
|
-
style: styles.urlRow,
|
|
277
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
278
|
-
style: styles.urlLabel,
|
|
279
|
-
children: "Expo"
|
|
280
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
281
|
-
style: styles.urlText,
|
|
282
|
-
numberOfLines: 1,
|
|
283
|
-
children: metroUrls.expUrl
|
|
284
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
285
|
-
style: styles.copyButton,
|
|
286
|
-
onPress: () => copyUrl('Expo URL', metroUrls.expUrl),
|
|
287
|
-
activeOpacity: 0.7,
|
|
288
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
289
|
-
style: styles.copyButtonText,
|
|
290
|
-
children: "Copy"
|
|
291
|
-
})
|
|
292
|
-
})]
|
|
377
|
+
style: styles.urlText,
|
|
378
|
+
numberOfLines: 1,
|
|
379
|
+
children: metroUrls.httpUrl
|
|
293
380
|
})]
|
|
294
381
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
295
|
-
style: styles.
|
|
296
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
297
|
-
style: styles.
|
|
298
|
-
children:
|
|
299
|
-
style: styles.stepNumber,
|
|
300
|
-
children: "2"
|
|
301
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
302
|
-
style: styles.stepTitle,
|
|
303
|
-
children: "Configure remote debugging"
|
|
304
|
-
})]
|
|
382
|
+
style: styles.urlRow,
|
|
383
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
384
|
+
style: styles.urlLabel,
|
|
385
|
+
children: "Expo"
|
|
305
386
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
306
|
-
style: styles.
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
310
|
-
style: styles.stepCard,
|
|
311
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
312
|
-
style: styles.stepHeader,
|
|
313
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
314
|
-
style: styles.stepNumber,
|
|
315
|
-
children: "3"
|
|
316
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
317
|
-
style: styles.stepTitle,
|
|
318
|
-
children: "Restart the app"
|
|
319
|
-
})]
|
|
320
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
321
|
-
style: styles.stepDesc,
|
|
322
|
-
children: "Close and reopen the app to load from Metro. Make sure Metro is running on your computer."
|
|
387
|
+
style: styles.urlText,
|
|
388
|
+
numberOfLines: 1,
|
|
389
|
+
children: metroUrls.expUrl
|
|
323
390
|
})]
|
|
324
391
|
})]
|
|
325
|
-
})
|
|
392
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
393
|
+
style: styles.actions,
|
|
394
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
395
|
+
style: [styles.primaryButton, !canUseMetro && styles.buttonDisabled],
|
|
396
|
+
onPress: applyRemoteBundle,
|
|
397
|
+
disabled: !canUseMetro,
|
|
398
|
+
activeOpacity: 0.75,
|
|
399
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
400
|
+
style: styles.primaryButtonText,
|
|
401
|
+
children: metroBusy ? 'Checking...' : 'Use Metro Bundle'
|
|
402
|
+
})
|
|
403
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
404
|
+
style: [styles.secondaryButton, (!snapshot.nativeMetroAvailable || metroBusy) && styles.buttonDisabled],
|
|
405
|
+
onPress: resetRemoteBundle,
|
|
406
|
+
disabled: !snapshot.nativeMetroAvailable || metroBusy,
|
|
407
|
+
activeOpacity: 0.75,
|
|
408
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
409
|
+
style: styles.secondaryButtonText,
|
|
410
|
+
children: "Reset"
|
|
411
|
+
})
|
|
412
|
+
})]
|
|
413
|
+
}), !snapshot.nativeMetroAvailable ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
414
|
+
style: styles.hint,
|
|
415
|
+
children: "Native DevConnect requires pod install / Gradle sync and app rebuild."
|
|
416
|
+
}) : null]
|
|
326
417
|
})]
|
|
327
418
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_DevConnectQrScanner.DevConnectQrScanner, {
|
|
328
419
|
visible: qrVisible,
|
|
329
420
|
onClose: () => setQrVisible(false),
|
|
330
|
-
|
|
421
|
+
onScanTarget: handleQrTarget
|
|
331
422
|
})]
|
|
332
423
|
});
|
|
333
424
|
}
|
|
@@ -408,6 +499,29 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
408
499
|
fontSize: 13,
|
|
409
500
|
fontWeight: '600'
|
|
410
501
|
},
|
|
502
|
+
portRow: {
|
|
503
|
+
flexDirection: 'row',
|
|
504
|
+
gap: 10
|
|
505
|
+
},
|
|
506
|
+
portField: {
|
|
507
|
+
flex: 1
|
|
508
|
+
},
|
|
509
|
+
portLabel: {
|
|
510
|
+
fontSize: 11,
|
|
511
|
+
color: _colors.Colors.textSecondary,
|
|
512
|
+
marginBottom: 4
|
|
513
|
+
},
|
|
514
|
+
portInput: {
|
|
515
|
+
backgroundColor: _colors.Colors.surface,
|
|
516
|
+
borderWidth: 1,
|
|
517
|
+
borderColor: _colors.Colors.border,
|
|
518
|
+
borderRadius: 8,
|
|
519
|
+
paddingHorizontal: 12,
|
|
520
|
+
paddingVertical: 9,
|
|
521
|
+
fontSize: 13,
|
|
522
|
+
color: _colors.Colors.text,
|
|
523
|
+
fontFamily: 'Courier'
|
|
524
|
+
},
|
|
411
525
|
actions: {
|
|
412
526
|
flexDirection: 'row',
|
|
413
527
|
gap: 10,
|
|
@@ -453,7 +567,8 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
453
567
|
},
|
|
454
568
|
hint: {
|
|
455
569
|
fontSize: 12,
|
|
456
|
-
color: _colors.Colors.textLight
|
|
570
|
+
color: _colors.Colors.textLight,
|
|
571
|
+
lineHeight: 17
|
|
457
572
|
},
|
|
458
573
|
stepCard: {
|
|
459
574
|
backgroundColor: _colors.Colors.surface,
|
|
@@ -468,36 +583,8 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
468
583
|
color: _colors.Colors.textSecondary,
|
|
469
584
|
lineHeight: 17
|
|
470
585
|
},
|
|
471
|
-
stepHeader: {
|
|
472
|
-
flexDirection: 'row',
|
|
473
|
-
alignItems: 'center',
|
|
474
|
-
marginBottom: 4
|
|
475
|
-
},
|
|
476
|
-
stepNumber: {
|
|
477
|
-
width: 20,
|
|
478
|
-
height: 20,
|
|
479
|
-
borderRadius: 10,
|
|
480
|
-
backgroundColor: _colors.Colors.primary,
|
|
481
|
-
color: '#fff',
|
|
482
|
-
fontSize: 11,
|
|
483
|
-
fontWeight: '700',
|
|
484
|
-
textAlign: 'center',
|
|
485
|
-
lineHeight: 20,
|
|
486
|
-
marginRight: 8,
|
|
487
|
-
overflow: 'hidden'
|
|
488
|
-
},
|
|
489
|
-
stepTitle: {
|
|
490
|
-
fontSize: 13,
|
|
491
|
-
fontWeight: '600',
|
|
492
|
-
color: _colors.Colors.text
|
|
493
|
-
},
|
|
494
|
-
stepDesc: {
|
|
495
|
-
fontSize: 12,
|
|
496
|
-
color: _colors.Colors.textSecondary,
|
|
497
|
-
lineHeight: 17,
|
|
498
|
-
marginBottom: 8
|
|
499
|
-
},
|
|
500
586
|
urlLabel: {
|
|
587
|
+
minWidth: 40,
|
|
501
588
|
fontSize: 10,
|
|
502
589
|
fontWeight: '600',
|
|
503
590
|
color: _colors.Colors.primary,
|
|
@@ -505,37 +592,21 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
505
592
|
paddingHorizontal: 6,
|
|
506
593
|
paddingVertical: 2,
|
|
507
594
|
borderRadius: 4,
|
|
508
|
-
marginRight:
|
|
595
|
+
marginRight: 8,
|
|
596
|
+
textAlign: 'center'
|
|
509
597
|
},
|
|
510
598
|
urlRow: {
|
|
511
599
|
flexDirection: 'row',
|
|
512
600
|
alignItems: 'center',
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
borderRadius: 8,
|
|
517
|
-
paddingLeft: 12,
|
|
518
|
-
paddingRight: 4,
|
|
519
|
-
paddingVertical: 4,
|
|
520
|
-
marginBottom: 8
|
|
601
|
+
borderBottomWidth: _reactNative.StyleSheet.hairlineWidth,
|
|
602
|
+
borderBottomColor: _colors.Colors.border,
|
|
603
|
+
paddingVertical: 7
|
|
521
604
|
},
|
|
522
605
|
urlText: {
|
|
523
606
|
flex: 1,
|
|
524
607
|
fontSize: 13,
|
|
525
608
|
fontFamily: 'Courier',
|
|
526
|
-
color: _colors.Colors.text
|
|
527
|
-
paddingVertical: 6
|
|
528
|
-
},
|
|
529
|
-
copyButton: {
|
|
530
|
-
paddingHorizontal: 12,
|
|
531
|
-
paddingVertical: 8,
|
|
532
|
-
borderRadius: 6,
|
|
533
|
-
backgroundColor: _colors.Colors.primary
|
|
534
|
-
},
|
|
535
|
-
copyButtonText: {
|
|
536
|
-
color: '#fff',
|
|
537
|
-
fontSize: 12,
|
|
538
|
-
fontWeight: '600'
|
|
609
|
+
color: _colors.Colors.text
|
|
539
610
|
}
|
|
540
611
|
});
|
|
541
612
|
//# sourceMappingURL=DevConnectTab.js.map
|