react-native-inapp-inspector 2.3.11 → 2.3.13
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/HeadersSection.js +3 -2
- package/dist/commonjs/components/Inspector/BundleTab.js +4 -4
- package/dist/commonjs/components/Inspector/DebuggingTab.js +29 -16
- package/dist/commonjs/components/Inspector/NetworkDetail.js +2 -2
- package/dist/commonjs/components/Inspector/NetworkFilterModal.js +18 -12
- package/dist/commonjs/components/Inspector/StorageTab.js +10 -4
- package/dist/commonjs/components/JsonViewer.js +3 -2
- package/dist/commonjs/components/NetworkIcons.d.ts +4 -1
- package/dist/commonjs/components/NetworkIcons.js +26 -3
- package/dist/commonjs/components/QRCodeView.js +15 -12
- package/dist/commonjs/constants/telemetryConfig.d.ts +3 -3
- package/dist/commonjs/constants/telemetryConfig.js +3 -3
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/helpers/qrGenerator.js +31 -157
- package/dist/esm/components/HeadersSection.js +3 -2
- package/dist/esm/components/Inspector/BundleTab.js +5 -5
- package/dist/esm/components/Inspector/DebuggingTab.js +30 -17
- package/dist/esm/components/Inspector/NetworkDetail.js +2 -2
- package/dist/esm/components/Inspector/NetworkFilterModal.js +19 -13
- package/dist/esm/components/Inspector/StorageTab.js +11 -5
- package/dist/esm/components/JsonViewer.js +4 -3
- package/dist/esm/components/NetworkIcons.d.ts +4 -1
- package/dist/esm/components/NetworkIcons.js +22 -2
- package/dist/esm/components/QRCodeView.js +15 -12
- package/dist/esm/constants/telemetryConfig.d.ts +3 -3
- package/dist/esm/constants/telemetryConfig.js +3 -3
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/helpers/qrGenerator.js +28 -157
- package/package.json +4 -2
- package/src/components/HeadersSection.tsx +7 -2
- package/src/components/Inspector/BundleTab.tsx +9 -4
- package/src/components/Inspector/DebuggingTab.tsx +37 -17
- package/src/components/Inspector/NetworkDetail.tsx +2 -2
- package/src/components/Inspector/NetworkFilterModal.tsx +32 -12
- package/src/components/Inspector/StorageTab.tsx +15 -4
- package/src/components/JsonViewer.tsx +8 -3
- package/src/components/NetworkIcons.tsx +71 -1
- package/src/components/QRCodeView.tsx +21 -17
- package/src/constants/telemetryConfig.ts +3 -5
- package/src/constants/version.ts +1 -1
- package/src/helpers/qrGenerator.ts +34 -169
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/9.2.0/checksums/checksums.lock +0 -0
- package/android/.gradle/9.2.0/fileChanges/last-build.bin +0 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/9.2.0/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/build/reports/problems/problems-report.html +0 -659
|
@@ -80,10 +80,11 @@ const HeaderRow = react_1.default.memo(function HeaderRow({ headerKey, value, is
|
|
|
80
80
|
<react_native_1.Text style={styles_1.default.htValue} selectable numberOfLines={expanded ? undefined : 3}>
|
|
81
81
|
{value}
|
|
82
82
|
</react_native_1.Text>
|
|
83
|
-
{isLong && (<react_native_1.View style={styles_1.default.htExpandRow}>
|
|
83
|
+
{isLong && (<react_native_1.View style={[styles_1.default.htExpandRow, { flexDirection: 'row', alignItems: 'center', gap: 4 }]}>
|
|
84
84
|
<react_native_1.Text style={styles_1.default.htExpandText}>
|
|
85
|
-
{expanded ? '
|
|
85
|
+
{expanded ? 'less' : 'more'}
|
|
86
86
|
</react_native_1.Text>
|
|
87
|
+
<NetworkIcons_1.ChevronIcon direction={expanded ? 'up' : 'down'} color={AppColors_1.AppColors.purple} size={10}/>
|
|
87
88
|
</react_native_1.View>)}
|
|
88
89
|
</react_native_1.Pressable>
|
|
89
90
|
<TouchableScale_1.default onPress={() => (0, helpers_1.copyToClipboard)(value, headerKey)} hitSlop={8} style={styles_1.default.htCopyBtn}>
|
|
@@ -418,9 +418,9 @@ const BundleTreeNodeView = ({ node, level, search, totalBundleKb, expandedFolder
|
|
|
418
418
|
? `${(node.sizeKb / 1024).toFixed(2)} MB`
|
|
419
419
|
: `${node.sizeKb} KB`}`} accessibilityState={{ expanded: isExpanded }} accessibilityHint="Double tap to expand or collapse folder" onPress={() => toggleFolder(node.fullPath)} style={[bundleStyles.treeFolderRow, { paddingLeft: indentLeft }]}>
|
|
420
420
|
<react_native_1.View style={bundleStyles.treeRowLeft}>
|
|
421
|
-
<react_native_1.
|
|
422
|
-
{isCollapsed ? '
|
|
423
|
-
</react_native_1.
|
|
421
|
+
<react_native_1.View style={{ marginRight: 4 }}>
|
|
422
|
+
<NetworkIcons_1.ChevronIcon direction={isCollapsed ? 'right' : 'down'} size={12} color={AppColors_1.AppColors.grayTextWeak}/>
|
|
423
|
+
</react_native_1.View>
|
|
424
424
|
{isCollapsed ? (<NetworkIcons_1.FolderIcon color={AppColors_1.AppColors.amber500} size={15}/>) : (<NetworkIcons_1.FolderOpenIcon color={AppColors_1.AppColors.amber500} size={15}/>)}
|
|
425
425
|
<HighlightText_1.default text={node.name + '/'} search={search} style={bundleStyles.treeFolderName} highlightStyle={bundleStyles.searchHighlight}/>
|
|
426
426
|
<react_native_1.View style={bundleStyles.treeCountBadge}>
|
|
@@ -876,7 +876,7 @@ const BundleTab = react_1.default.memo(() => {
|
|
|
876
876
|
letterSpacing: 0.3,
|
|
877
877
|
textTransform: 'uppercase',
|
|
878
878
|
}}>
|
|
879
|
-
Live Metro URL
|
|
879
|
+
Live Metro URL
|
|
880
880
|
</react_native_1.Text>
|
|
881
881
|
</react_native_1.View>
|
|
882
882
|
<react_native_1.Text style={{
|
|
@@ -129,6 +129,7 @@ const DebuggingTab = () => {
|
|
|
129
129
|
probePorts();
|
|
130
130
|
}, [probePorts]);
|
|
131
131
|
const metroBundleUrl = `http://${hostIp}:${selectedPort}/index.bundle?platform=android&dev=true`;
|
|
132
|
+
const directServerUrl = `http://${hostIp}:${selectedPort}`;
|
|
132
133
|
const apkDownloadUrl = `http://${hostIp}:${selectedPort}/${apkPath}`;
|
|
133
134
|
const devSettingsHost = `${hostIp}:${selectedPort}`;
|
|
134
135
|
const currentQrValue = (0, react_1.useMemo)(() => {
|
|
@@ -136,8 +137,8 @@ const DebuggingTab = () => {
|
|
|
136
137
|
return apkDownloadUrl;
|
|
137
138
|
if (activeQrTab === 'host')
|
|
138
139
|
return devSettingsHost;
|
|
139
|
-
return
|
|
140
|
-
}, [activeQrTab, apkDownloadUrl, devSettingsHost,
|
|
140
|
+
return directServerUrl;
|
|
141
|
+
}, [activeQrTab, apkDownloadUrl, devSettingsHost, directServerUrl]);
|
|
141
142
|
const activePortInfo = portsStatus[selectedPort];
|
|
142
143
|
return (<react_native_1.ScrollView style={styles.container} contentContainerStyle={styles.content} showsVerticalScrollIndicator={false}>
|
|
143
144
|
|
|
@@ -163,10 +164,10 @@ const DebuggingTab = () => {
|
|
|
163
164
|
</react_native_1.View>
|
|
164
165
|
<react_native_1.Text style={styles.serverSubtitle}>
|
|
165
166
|
{activePortInfo?.status === 'active'
|
|
166
|
-
?
|
|
167
|
+
? `Active & Bundling (${activePortInfo.latencyMs}ms)`
|
|
167
168
|
: activePortInfo?.status === 'checking'
|
|
168
|
-
? '
|
|
169
|
-
: '
|
|
169
|
+
? 'Probing Metro Ports...'
|
|
170
|
+
: 'Standby / Select active port'}
|
|
170
171
|
</react_native_1.Text>
|
|
171
172
|
</react_native_1.View>
|
|
172
173
|
</react_native_1.View>
|
|
@@ -231,9 +232,12 @@ const DebuggingTab = () => {
|
|
|
231
232
|
<react_native_1.TextInput style={styles.input} value={hostIp} onChangeText={setHostIp} placeholder="192.168.1.15" placeholderTextColor={AppColors_1.AppColors.grayTextWeak} autoCapitalize="none" autoCorrect={false}/>
|
|
232
233
|
<react_native_1.Text style={styles.inputSuffix}>:{selectedPort}</react_native_1.Text>
|
|
233
234
|
</react_native_1.View>
|
|
234
|
-
<react_native_1.
|
|
235
|
-
|
|
236
|
-
|
|
235
|
+
<react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', gap: 6, marginTop: 6 }}>
|
|
236
|
+
<NetworkIcons_1.InfoCircleIcon size={13} color={AppColors_1.AppColors.grayTextWeak}/>
|
|
237
|
+
<react_native_1.Text style={[styles.inputHint, { marginTop: 0, flex: 1 }]}>
|
|
238
|
+
Ensure your physical Android device and Mac are connected to the same Wi-Fi network.
|
|
239
|
+
</react_native_1.Text>
|
|
240
|
+
</react_native_1.View>
|
|
237
241
|
</react_native_1.View>
|
|
238
242
|
|
|
239
243
|
|
|
@@ -285,13 +289,16 @@ const DebuggingTab = () => {
|
|
|
285
289
|
<QRCodeView_1.default value={currentQrValue} size={190} color={AppColors_1.AppColors.primaryBlack} backgroundColor={AppColors_1.AppColors.white}/>
|
|
286
290
|
|
|
287
291
|
<react_native_1.View style={styles.qrInfoBox}>
|
|
288
|
-
<react_native_1.
|
|
289
|
-
{activeQrTab === 'apk'
|
|
290
|
-
|
|
292
|
+
<react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', gap: 5, marginBottom: 2 }}>
|
|
293
|
+
{activeQrTab === 'apk' ? (<NetworkIcons_1.PackageIcon size={14} color={AppColors_1.AppColors.purple}/>) : activeQrTab === 'host' ? (<NetworkIcons_1.SmartphoneIcon size={14} color={AppColors_1.AppColors.purple}/>) : (<NetworkIcons_1.BoltIcon size={14} color={AppColors_1.AppColors.amber500}/>)}
|
|
294
|
+
<react_native_1.Text style={styles.qrTargetTitle}>
|
|
295
|
+
{activeQrTab === 'apk'
|
|
296
|
+
? 'Direct APK Download URL'
|
|
291
297
|
: activeQrTab === 'host'
|
|
292
|
-
? '
|
|
293
|
-
: '
|
|
294
|
-
|
|
298
|
+
? 'Dev Settings Bundle Host'
|
|
299
|
+
: 'Live Metro Fast-Refresh Endpoint'}
|
|
300
|
+
</react_native_1.Text>
|
|
301
|
+
</react_native_1.View>
|
|
295
302
|
<react_native_1.Text style={styles.qrTargetUrl} numberOfLines={2} ellipsizeMode="middle">
|
|
296
303
|
{currentQrValue}
|
|
297
304
|
</react_native_1.Text>
|
|
@@ -317,7 +324,10 @@ const DebuggingTab = () => {
|
|
|
317
324
|
|
|
318
325
|
|
|
319
326
|
<react_native_1.View style={styles.guideCard}>
|
|
320
|
-
<react_native_1.
|
|
327
|
+
<react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', gap: 6, marginBottom: 12 }}>
|
|
328
|
+
<NetworkIcons_1.SmartphoneIcon size={15} color={AppColors_1.AppColors.primaryLight}/>
|
|
329
|
+
<react_native_1.Text style={[styles.guideHeading, { marginBottom: 0 }]}>HOW TO CONNECT ANDROID DEVICE:</react_native_1.Text>
|
|
330
|
+
</react_native_1.View>
|
|
321
331
|
|
|
322
332
|
<react_native_1.View style={styles.stepRow}>
|
|
323
333
|
<react_native_1.View style={styles.stepNumberBadge}>
|
|
@@ -348,7 +358,10 @@ const DebuggingTab = () => {
|
|
|
348
358
|
<react_native_1.Text style={styles.stepNumberText}>3</react_native_1.Text>
|
|
349
359
|
</react_native_1.View>
|
|
350
360
|
<react_native_1.View style={{ flex: 1 }}>
|
|
351
|
-
<react_native_1.
|
|
361
|
+
<react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', gap: 4 }}>
|
|
362
|
+
<react_native_1.Text style={styles.stepTitle}>Simultaneous Live Fast-Refresh</react_native_1.Text>
|
|
363
|
+
<NetworkIcons_1.BoltIcon size={13} color={AppColors_1.AppColors.amber500}/>
|
|
364
|
+
</react_native_1.View>
|
|
352
365
|
<react_native_1.Text style={styles.stepDesc}>
|
|
353
366
|
Any changes saved in VS Code will immediately update <react_native_1.Text style={{ fontWeight: '700' }}>both the iOS Simulator and physical Android phone</react_native_1.Text> in real-time!
|
|
354
367
|
</react_native_1.Text>
|
|
@@ -303,7 +303,7 @@ const NetworkDetail = react_1.default.memo(() => {
|
|
|
303
303
|
letterSpacing: 0.4,
|
|
304
304
|
textTransform: 'uppercase',
|
|
305
305
|
}}>
|
|
306
|
-
ENDPOINT URL
|
|
306
|
+
ENDPOINT URL
|
|
307
307
|
</react_native_1.Text>
|
|
308
308
|
</react_native_1.View>
|
|
309
309
|
|
|
@@ -338,7 +338,7 @@ const NetworkDetail = react_1.default.memo(() => {
|
|
|
338
338
|
fontSize: 9,
|
|
339
339
|
color: AppColors_1.AppColors.sky600,
|
|
340
340
|
}}>
|
|
341
|
-
Open
|
|
341
|
+
Open
|
|
342
342
|
</react_native_1.Text>
|
|
343
343
|
</react_native_1.View>
|
|
344
344
|
</react_native_1.View>
|
|
@@ -370,12 +370,13 @@ const NetworkFilterModal = ({ visible, onClose, filters, onApply, searchQuery =
|
|
|
370
370
|
<react_native_1.Text style={styles.sectionTitle}>LATENCY & SPEED</react_native_1.Text>
|
|
371
371
|
<react_native_1.View style={styles.chipsWrap}>
|
|
372
372
|
{[
|
|
373
|
-
{ key: 'all', label: 'All Speeds', color: AppColors_1.AppColors.purple },
|
|
374
|
-
{ key: 'fast', label: '
|
|
375
|
-
{ key: 'normal', label: '
|
|
376
|
-
{ key: 'slow', label: '
|
|
373
|
+
{ key: 'all', label: 'All Speeds', color: AppColors_1.AppColors.purple, icon: NetworkIcons_1.LayersIcon },
|
|
374
|
+
{ key: 'fast', label: 'Fast (<200ms)', color: AppColors_1.AppColors.greenColor, icon: NetworkIcons_1.BoltIcon, count: counts.fastCount },
|
|
375
|
+
{ key: 'normal', label: 'Normal (200-500ms)', color: AppColors_1.AppColors.skyBlue, icon: NetworkIcons_1.ClockIcon, count: counts.normalCount },
|
|
376
|
+
{ key: 'slow', label: 'Slow (>500ms)', color: AppColors_1.AppColors.errorColor, icon: NetworkIcons_1.CircleAlertIcon, count: counts.slowCount },
|
|
377
377
|
].map(item => {
|
|
378
378
|
const isSelected = draft.latency === item.key;
|
|
379
|
+
const IconComp = item.icon;
|
|
379
380
|
return (<react_native_1.TouchableOpacity key={item.key} activeOpacity={0.7} onPress={() => setDraft(prev => ({ ...prev, latency: item.key }))} style={[
|
|
380
381
|
styles.chip,
|
|
381
382
|
isSelected && {
|
|
@@ -383,6 +384,7 @@ const NetworkFilterModal = ({ visible, onClose, filters, onApply, searchQuery =
|
|
|
383
384
|
borderColor: item.color,
|
|
384
385
|
},
|
|
385
386
|
]}>
|
|
387
|
+
<IconComp size={13} color={isSelected ? item.color : AppColors_1.AppColors.grayTextWeak}/>
|
|
386
388
|
<react_native_1.Text style={[
|
|
387
389
|
styles.chipLabel,
|
|
388
390
|
isSelected && { color: item.color, fontFamily: AppFonts_1.AppFonts.interBold },
|
|
@@ -404,11 +406,12 @@ const NetworkFilterModal = ({ visible, onClose, filters, onApply, searchQuery =
|
|
|
404
406
|
<react_native_1.Text style={styles.sectionTitle}>PROTOCOL</react_native_1.Text>
|
|
405
407
|
<react_native_1.View style={styles.chipsWrap}>
|
|
406
408
|
{[
|
|
407
|
-
{ key: 'all', label: 'All Protocols', color: AppColors_1.AppColors.purple },
|
|
408
|
-
{ key: 'https', label: '
|
|
409
|
-
{ key: 'http', label: '
|
|
409
|
+
{ key: 'all', label: 'All Protocols', color: AppColors_1.AppColors.purple, icon: NetworkIcons_1.GlobeIcon },
|
|
410
|
+
{ key: 'https', label: 'HTTPS Secure', color: AppColors_1.AppColors.mintGreenText, icon: NetworkIcons_1.LockIcon, count: counts.httpsCount },
|
|
411
|
+
{ key: 'http', label: 'HTTP Insecure', color: AppColors_1.AppColors.amber700, icon: NetworkIcons_1.UnlockIcon, count: counts.httpCount },
|
|
410
412
|
].map(item => {
|
|
411
413
|
const isSelected = draft.protocol === item.key;
|
|
414
|
+
const IconComp = item.icon;
|
|
412
415
|
return (<react_native_1.TouchableOpacity key={item.key} activeOpacity={0.7} onPress={() => setDraft(prev => ({ ...prev, protocol: item.key }))} style={[
|
|
413
416
|
styles.chip,
|
|
414
417
|
isSelected && {
|
|
@@ -416,6 +419,7 @@ const NetworkFilterModal = ({ visible, onClose, filters, onApply, searchQuery =
|
|
|
416
419
|
borderColor: item.color,
|
|
417
420
|
},
|
|
418
421
|
]}>
|
|
422
|
+
<IconComp size={13} color={isSelected ? item.color : AppColors_1.AppColors.grayTextWeak}/>
|
|
419
423
|
<react_native_1.Text style={[
|
|
420
424
|
styles.chipLabel,
|
|
421
425
|
isSelected && { color: item.color, fontFamily: AppFonts_1.AppFonts.interBold },
|
|
@@ -437,13 +441,14 @@ const NetworkFilterModal = ({ visible, onClose, filters, onApply, searchQuery =
|
|
|
437
441
|
<react_native_1.Text style={styles.sectionTitle}>SORT BY</react_native_1.Text>
|
|
438
442
|
<react_native_1.View style={styles.chipsWrap}>
|
|
439
443
|
{[
|
|
440
|
-
{ key: 'time_desc', label: '
|
|
441
|
-
{ key: 'time_asc', label: '
|
|
442
|
-
{ key: 'duration_desc', label: '
|
|
443
|
-
{ key: 'duration_asc', label: '
|
|
444
|
-
{ key: 'size_desc', label: '
|
|
444
|
+
{ key: 'time_desc', label: 'Newest First (Default)', icon: NetworkIcons_1.ClockIcon },
|
|
445
|
+
{ key: 'time_asc', label: 'Oldest First', icon: NetworkIcons_1.HourglassIcon },
|
|
446
|
+
{ key: 'duration_desc', label: 'Slowest Response', icon: NetworkIcons_1.TurtleIcon },
|
|
447
|
+
{ key: 'duration_asc', label: 'Fastest Response', icon: NetworkIcons_1.RocketIcon },
|
|
448
|
+
{ key: 'size_desc', label: 'Largest Response Size', icon: NetworkIcons_1.PackageIcon },
|
|
445
449
|
].map(item => {
|
|
446
450
|
const isSelected = draft.sortBy === item.key;
|
|
451
|
+
const IconComp = item.icon;
|
|
447
452
|
return (<react_native_1.TouchableOpacity key={item.key} activeOpacity={0.7} onPress={() => setDraft(prev => ({ ...prev, sortBy: item.key }))} style={[
|
|
448
453
|
styles.chip,
|
|
449
454
|
isSelected && {
|
|
@@ -451,6 +456,7 @@ const NetworkFilterModal = ({ visible, onClose, filters, onApply, searchQuery =
|
|
|
451
456
|
borderColor: AppColors_1.AppColors.purple,
|
|
452
457
|
},
|
|
453
458
|
]}>
|
|
459
|
+
<IconComp size={13} color={isSelected ? AppColors_1.AppColors.purple : AppColors_1.AppColors.grayTextWeak}/>
|
|
454
460
|
<react_native_1.Text style={[
|
|
455
461
|
styles.chipLabel,
|
|
456
462
|
isSelected && { color: AppColors_1.AppColors.purple, fontFamily: AppFonts_1.AppFonts.interBold },
|
|
@@ -127,9 +127,12 @@ const StorageEntryCard = react_1.default.memo(function StorageEntryCard({ entry,
|
|
|
127
127
|
<react_native_1.Text style={styles.valuePreviewText} numberOfLines={isExpanded ? undefined : 3} selectable={isExpanded}>
|
|
128
128
|
{displayValue}
|
|
129
129
|
</react_native_1.Text>
|
|
130
|
-
{entry.value.length > 80 && (<react_native_1.
|
|
131
|
-
{
|
|
132
|
-
|
|
130
|
+
{entry.value.length > 80 && (<react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', gap: 4, marginTop: 4 }}>
|
|
131
|
+
<react_native_1.Text style={styles.expandHint}>
|
|
132
|
+
{isExpanded ? 'Collapse' : 'Expand'}
|
|
133
|
+
</react_native_1.Text>
|
|
134
|
+
<NetworkIcons_1.ChevronIcon direction={isExpanded ? 'up' : 'down'} size={10} color={AppColors_1.AppColors.purple}/>
|
|
135
|
+
</react_native_1.View>)}
|
|
133
136
|
</TouchableScale_1.default>
|
|
134
137
|
</react_native_1.View>);
|
|
135
138
|
});
|
|
@@ -504,7 +507,10 @@ exports.StorageTab = react_1.default.memo(() => {
|
|
|
504
507
|
: editType === 'boolean'
|
|
505
508
|
? 'true'
|
|
506
509
|
: 'String value...'} placeholderTextColor={AppColors_1.AppColors.grayTextWeak} style={[styles.textInput, styles.textAreaInput]} multiline textAlignVertical="top" autoCapitalize="none"/>
|
|
507
|
-
{jsonError && (<react_native_1.
|
|
510
|
+
{jsonError && (<react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', gap: 5, marginTop: 4 }}>
|
|
511
|
+
<NetworkIcons_1.WarningTriangleIcon size={12} color={AppColors_1.AppColors.errorColor}/>
|
|
512
|
+
<react_native_1.Text style={styles.errorText}>{jsonError}</react_native_1.Text>
|
|
513
|
+
</react_native_1.View>)}
|
|
508
514
|
</react_native_1.View>
|
|
509
515
|
|
|
510
516
|
|
|
@@ -82,10 +82,11 @@ const JsonTableRow = react_1.default.memo(({ itemKey, val, search, }) => {
|
|
|
82
82
|
localStyles.tableCellValue,
|
|
83
83
|
isObject && localStyles.tableCellRawCode,
|
|
84
84
|
]} highlightStyle={localStyles.highlight} numberOfLines={expanded ? undefined : 3} selectable={true}/>
|
|
85
|
-
{isMultiline && (<react_native_1.TouchableOpacity onPress={() => setExpanded(prev => !prev)} hitSlop={6} style={localStyles.showMoreBtn}>
|
|
85
|
+
{isMultiline && (<react_native_1.TouchableOpacity onPress={() => setExpanded(prev => !prev)} hitSlop={6} style={[localStyles.showMoreBtn, { flexDirection: 'row', alignItems: 'center', gap: 4 }]}>
|
|
86
86
|
<react_native_1.Text style={localStyles.showMoreText}>
|
|
87
|
-
{expanded ? 'Show less
|
|
87
|
+
{expanded ? 'Show less' : 'Show more'}
|
|
88
88
|
</react_native_1.Text>
|
|
89
|
+
<NetworkIcons_1.ChevronIcon direction={expanded ? 'up' : 'down'} size={10} color={AppColors_1.AppColors.purple}/>
|
|
89
90
|
</react_native_1.TouchableOpacity>)}
|
|
90
91
|
</react_native_1.View>
|
|
91
92
|
</react_native_1.View>);
|
|
@@ -37,7 +37,7 @@ export declare const SignalIcon: ({ color, size, }: IconProps) => React.JSX.Elem
|
|
|
37
37
|
export declare const DiffIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
38
38
|
export declare const GlobeIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
39
39
|
export declare const SortArrowIcon: ({ color, size, direction, }: IconProps) => React.JSX.Element;
|
|
40
|
-
export declare const ChevronIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
40
|
+
export declare const ChevronIcon: ({ color, size, direction, }: IconProps) => React.JSX.Element;
|
|
41
41
|
export declare const FilterIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
42
42
|
export declare const DownloadIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
43
43
|
export declare const CloseWhite: ({ color, size }: IconProps) => React.JSX.Element;
|
|
@@ -135,3 +135,6 @@ export declare const PencilIcon: ({ color, size, }: IconProps) => React.JSX.Elem
|
|
|
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
137
|
export declare const QrCodeIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
138
|
+
export declare const UnlockIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
139
|
+
export declare const RocketIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
140
|
+
export declare const TurtleIcon: ({ 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.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;
|
|
41
|
+
exports.TurtleIcon = exports.RocketIcon = exports.UnlockIcon = 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");
|
|
@@ -236,9 +236,16 @@ const SortArrowIcon = ({ color = AppColors_1.AppColors.primaryLight, size = 20,
|
|
|
236
236
|
</react_native_svg_1.default>);
|
|
237
237
|
};
|
|
238
238
|
exports.SortArrowIcon = SortArrowIcon;
|
|
239
|
-
const ChevronIcon = ({ color = AppColors_1.AppColors.grayTextWeak, size = 14, }) => {
|
|
239
|
+
const ChevronIcon = ({ color = AppColors_1.AppColors.grayTextWeak, size = 14, direction = 'down', }) => {
|
|
240
|
+
let path = 'M6 9l6 6 6-6';
|
|
241
|
+
if (direction === 'up')
|
|
242
|
+
path = 'M18 15l-6-6-6 6';
|
|
243
|
+
else if (direction === 'right')
|
|
244
|
+
path = 'M9 18l6-6-6-6';
|
|
245
|
+
else if (direction === 'left')
|
|
246
|
+
path = 'M15 18l-6-6 6-6';
|
|
240
247
|
return (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
241
|
-
<react_native_svg_1.Path d=
|
|
248
|
+
<react_native_svg_1.Path d={path} stroke={color} strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"/>
|
|
242
249
|
</react_native_svg_1.default>);
|
|
243
250
|
};
|
|
244
251
|
exports.ChevronIcon = ChevronIcon;
|
|
@@ -906,3 +913,19 @@ const QrCodeIcon = ({ color = AppColors_1.AppColors.grayTextWeak, size = 14, })
|
|
|
906
913
|
<react_native_svg_1.Path d="M14 14h3v3h-3zM18 18h3v3h-3zM14 19h3v2h-3zM19 14h2v3h-2z" fill={color}/>
|
|
907
914
|
</react_native_svg_1.default>);
|
|
908
915
|
exports.QrCodeIcon = QrCodeIcon;
|
|
916
|
+
const UnlockIcon = ({ color = AppColors_1.AppColors.grayTextWeak, size = 14, }) => (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
917
|
+
<react_native_svg_1.Rect x="3" y="11" width="18" height="11" rx="2" ry="2" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
918
|
+
<react_native_svg_1.Path d="M7 11V7a5 5 0 0 1 9.9-1" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
919
|
+
</react_native_svg_1.default>);
|
|
920
|
+
exports.UnlockIcon = UnlockIcon;
|
|
921
|
+
const RocketIcon = ({ color = AppColors_1.AppColors.grayTextWeak, size = 14, }) => (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
922
|
+
<react_native_svg_1.Path d="M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09zM12 15l-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6.05 11a22.35 22.35 0 0 1-3.95 2z" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
923
|
+
<react_native_svg_1.Path d="M9 12l-4 4M15 6l-3 3" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
924
|
+
</react_native_svg_1.default>);
|
|
925
|
+
exports.RocketIcon = RocketIcon;
|
|
926
|
+
const TurtleIcon = ({ color = AppColors_1.AppColors.grayTextWeak, size = 14, }) => (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
927
|
+
<react_native_svg_1.Ellipse cx="12" cy="14" rx="7" ry="5" stroke={color} strokeWidth="2"/>
|
|
928
|
+
<react_native_svg_1.Circle cx="12" cy="6" r="3" stroke={color} strokeWidth="2"/>
|
|
929
|
+
<react_native_svg_1.Path d="M5 12l-2-2M19 12l2-2M6 18l-2 2M18 18l2 2" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
930
|
+
</react_native_svg_1.default>);
|
|
931
|
+
exports.TurtleIcon = TurtleIcon;
|
|
@@ -39,24 +39,27 @@ const react_native_1 = require("react-native");
|
|
|
39
39
|
const react_native_svg_1 = __importStar(require("react-native-svg"));
|
|
40
40
|
const qrGenerator_1 = require("../helpers/qrGenerator");
|
|
41
41
|
const AppColors_1 = require("../styles/AppColors");
|
|
42
|
-
const QRCodeView = ({ value, size =
|
|
43
|
-
const matrix = (0, react_1.useMemo)(() => (0, qrGenerator_1.generateQRMatrix)(value), [value]);
|
|
44
|
-
const numCells = matrix.length;
|
|
45
|
-
const
|
|
42
|
+
const QRCodeView = ({ value, size = 200, color = '#000000', backgroundColor = '#FFFFFF', }) => {
|
|
43
|
+
const matrix = (0, react_1.useMemo)(() => (0, qrGenerator_1.generateQRMatrix)(value || 'http://localhost:8081'), [value]);
|
|
44
|
+
const numCells = matrix.length || 21;
|
|
45
|
+
const margin = 3;
|
|
46
|
+
const totalCells = numCells + margin * 2;
|
|
47
|
+
const cellSize = size / totalCells;
|
|
46
48
|
return (<react_native_1.View style={[
|
|
47
49
|
styles.container,
|
|
48
50
|
{
|
|
49
|
-
width: size +
|
|
50
|
-
height: size +
|
|
51
|
+
width: size + 20,
|
|
52
|
+
height: size + 20,
|
|
51
53
|
backgroundColor,
|
|
52
54
|
},
|
|
53
55
|
]}>
|
|
54
56
|
<react_native_svg_1.default width={size} height={size} viewBox={`0 0 ${size} ${size}`}>
|
|
57
|
+
<react_native_svg_1.Rect width={size} height={size} fill={backgroundColor}/>
|
|
55
58
|
<react_native_svg_1.G>
|
|
56
59
|
{matrix.map((row, r) => row.map((cell, c) => {
|
|
57
60
|
if (!cell)
|
|
58
61
|
return null;
|
|
59
|
-
return (<react_native_svg_1.Rect key={`${r}-${c}`} x={c * cellSize} y={r * cellSize} width={cellSize + 0.
|
|
62
|
+
return (<react_native_svg_1.Rect key={`${r}-${c}`} x={(c + margin) * cellSize} y={(r + margin) * cellSize} width={cellSize + 0.3} height={cellSize + 0.3} fill={color}/>);
|
|
60
63
|
}))}
|
|
61
64
|
</react_native_svg_1.G>
|
|
62
65
|
</react_native_svg_1.default>
|
|
@@ -65,15 +68,15 @@ const QRCodeView = ({ value, size = 180, color = AppColors_1.AppColors.primaryBl
|
|
|
65
68
|
exports.QRCodeView = QRCodeView;
|
|
66
69
|
const styles = react_native_1.StyleSheet.create({
|
|
67
70
|
container: {
|
|
68
|
-
padding:
|
|
71
|
+
padding: 10,
|
|
69
72
|
borderRadius: 14,
|
|
70
73
|
alignItems: 'center',
|
|
71
74
|
justifyContent: 'center',
|
|
72
75
|
shadowColor: AppColors_1.AppColors.black,
|
|
73
|
-
shadowOffset: { width: 0, height:
|
|
74
|
-
shadowOpacity: 0.
|
|
75
|
-
shadowRadius:
|
|
76
|
-
elevation:
|
|
76
|
+
shadowOffset: { width: 0, height: 3 },
|
|
77
|
+
shadowOpacity: 0.15,
|
|
78
|
+
shadowRadius: 8,
|
|
79
|
+
elevation: 4,
|
|
77
80
|
},
|
|
78
81
|
});
|
|
79
82
|
exports.default = exports.QRCodeView;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const ENC_MID = "
|
|
2
|
-
export declare const ENC_SEC = "
|
|
3
|
-
export declare const TELEMETRY_SALT = "
|
|
1
|
+
export declare const ENC_MID = "";
|
|
2
|
+
export declare const ENC_SEC = "";
|
|
3
|
+
export declare const TELEMETRY_SALT = "";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TELEMETRY_SALT = exports.ENC_SEC = exports.ENC_MID = void 0;
|
|
4
|
-
exports.ENC_MID = '
|
|
5
|
-
exports.ENC_SEC = '
|
|
6
|
-
exports.TELEMETRY_SALT = '
|
|
4
|
+
exports.ENC_MID = '';
|
|
5
|
+
exports.ENC_SEC = '';
|
|
6
|
+
exports.TELEMETRY_SALT = '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "2.3.
|
|
1
|
+
export declare const LIB_VERSION = "2.3.13";
|
|
@@ -1,170 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.generateQRMatrix = generateQRMatrix;
|
|
7
|
+
const qrcode_generator_1 = __importDefault(require("qrcode-generator"));
|
|
4
8
|
function generateQRMatrix(text, ecc = 'M') {
|
|
5
9
|
try {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
}
|
|
10
|
+
const qr = (0, qrcode_generator_1.default)(0, ecc);
|
|
11
|
+
qr.addData(text);
|
|
12
|
+
qr.make();
|
|
13
|
+
const count = qr.getModuleCount();
|
|
14
|
+
const matrix = [];
|
|
15
|
+
for (let row = 0; row < count; row++) {
|
|
16
|
+
const rowData = [];
|
|
17
|
+
for (let col = 0; col < count; col++) {
|
|
18
|
+
rowData.push(qr.isDark(row, col));
|
|
54
19
|
}
|
|
20
|
+
matrix.push(rowData);
|
|
55
21
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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;
|
|
22
|
+
return matrix;
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
try {
|
|
26
|
+
const qr = (0, qrcode_generator_1.default)(10, ecc);
|
|
27
|
+
qr.addData(text);
|
|
28
|
+
qr.make();
|
|
29
|
+
const count = qr.getModuleCount();
|
|
30
|
+
const matrix = [];
|
|
31
|
+
for (let row = 0; row < count; row++) {
|
|
32
|
+
const rowData = [];
|
|
33
|
+
for (let col = 0; col < count; col++) {
|
|
34
|
+
rowData.push(qr.isDark(row, col));
|
|
98
35
|
}
|
|
36
|
+
matrix.push(rowData);
|
|
99
37
|
}
|
|
38
|
+
return matrix;
|
|
100
39
|
}
|
|
101
|
-
|
|
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
|
-
}
|
|
40
|
+
catch {
|
|
41
|
+
return [];
|
|
123
42
|
}
|
|
124
43
|
}
|
|
125
44
|
}
|
|
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
|
-
}
|