@nordicsemiconductor/pc-nrfconnect-shared 194.0.0 → 196.0.0
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/Changelog.md +15 -0
- package/ipc/MetaFiles.ts +8 -6
- package/ipc/schema/packageJson.ts +3 -4
- package/ipc/schema/parseJson.ts +2 -2
- package/main/index.ts +2 -0
- package/package.json +1 -1
- package/scripts/nordic-publish.js +10 -10
- package/src/Device/DeviceSelector/DeviceList/DeviceList.tsx +66 -41
- package/src/Device/DeviceSelector/DeviceList/VirtualDevices.tsx +93 -0
- package/src/Device/DeviceSelector/DeviceList/device-list.scss +29 -24
- package/src/Device/DeviceSelector/DeviceSelector.tsx +54 -4
- package/src/Device/DeviceSelector/DisconnectDevice.tsx +20 -0
- package/src/Device/DeviceSelector/SelectedDevice.tsx +1 -13
- package/src/Device/DeviceSelector/SelectedVirtualDevice.tsx +40 -0
- package/src/Device/deviceSlice.ts +14 -0
- package/src/Link/ExternalLink.tsx +1 -1
- package/typings/generated/ipc/MetaFiles.d.ts +12 -4
- package/typings/generated/ipc/MetaFiles.d.ts.map +1 -1
- package/typings/generated/ipc/schema/packageJson.d.ts.map +1 -1
- package/typings/generated/ipc/schema/parseJson.d.ts +1 -1
- package/typings/generated/ipc/schema/parseJson.d.ts.map +1 -1
- package/typings/generated/main/index.d.ts +1 -1
- package/typings/generated/main/index.d.ts.map +1 -1
- package/typings/generated/src/Device/DeviceSelector/DeviceList/DeviceList.d.ts +2 -0
- package/typings/generated/src/Device/DeviceSelector/DeviceList/DeviceList.d.ts.map +1 -1
- package/typings/generated/src/Device/DeviceSelector/DeviceList/VirtualDevices.d.ts +14 -0
- package/typings/generated/src/Device/DeviceSelector/DeviceList/VirtualDevices.d.ts.map +1 -0
- package/typings/generated/src/Device/DeviceSelector/DeviceSelector.d.ts +4 -1
- package/typings/generated/src/Device/DeviceSelector/DeviceSelector.d.ts.map +1 -1
- package/typings/generated/src/Device/DeviceSelector/DisconnectDevice.d.ts +7 -0
- package/typings/generated/src/Device/DeviceSelector/DisconnectDevice.d.ts.map +1 -0
- package/typings/generated/src/Device/DeviceSelector/SelectedDevice.d.ts.map +1 -1
- package/typings/generated/src/Device/DeviceSelector/SelectedVirtualDevice.d.ts +9 -0
- package/typings/generated/src/Device/DeviceSelector/SelectedVirtualDevice.d.ts.map +1 -0
- package/typings/generated/src/Device/deviceSlice.d.ts +3 -1
- package/typings/generated/src/Device/deviceSlice.d.ts.map +1 -1
- package/typings/generated/src/Group/Group.d.ts +1 -1
- package/typings/generated/src/Link/ExternalLink.d.ts +2 -2
- package/typings/generated/src/Link/ExternalLink.d.ts.map +1 -1
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
import { AnimatedItem, AnimatedList } from './AnimatedList';
|
|
20
20
|
import BrokenDevice from './BrokenDevice';
|
|
21
21
|
import Device from './Device';
|
|
22
|
+
import VirtualDevices from './VirtualDevices';
|
|
22
23
|
|
|
23
24
|
import './device-list.scss';
|
|
24
25
|
|
|
@@ -52,14 +53,18 @@ const sorted = (devices: DeviceProps[]) =>
|
|
|
52
53
|
});
|
|
53
54
|
interface Props {
|
|
54
55
|
doSelectDevice: (device: DeviceProps, autoReselected: boolean) => void;
|
|
56
|
+
doSelectVirtualDevice: (device: string) => void;
|
|
55
57
|
isVisible: boolean;
|
|
56
58
|
deviceFilter?: (device: DeviceProps) => boolean;
|
|
59
|
+
virtualDevices?: string[];
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
const DeviceList: FC<Props> = ({
|
|
60
63
|
isVisible,
|
|
61
64
|
doSelectDevice,
|
|
65
|
+
doSelectVirtualDevice,
|
|
62
66
|
deviceFilter = showAllDevices,
|
|
67
|
+
virtualDevices = [],
|
|
63
68
|
}) => {
|
|
64
69
|
const dispatch = useDispatch();
|
|
65
70
|
const autoReconnect = useSelector(getAutoReselect);
|
|
@@ -80,49 +85,69 @@ const DeviceList: FC<Props> = ({
|
|
|
80
85
|
(!!currentDevice && !!currentDevice?.serialNumber) || !currentDevice;
|
|
81
86
|
|
|
82
87
|
return (
|
|
83
|
-
<div
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
88
|
+
<div
|
|
89
|
+
className={classNames(
|
|
90
|
+
'device-list-container',
|
|
91
|
+
isVisible || 'hidden'
|
|
92
|
+
)}
|
|
93
|
+
>
|
|
94
|
+
<div className="tw-flex tw-flex-col tw-overflow-y-hidden">
|
|
95
|
+
<div className="global-auto-reconnect">
|
|
96
|
+
<Toggle
|
|
97
|
+
id="toggle-global-auto-reconnect"
|
|
98
|
+
label="Auto Reconnect"
|
|
99
|
+
title={
|
|
100
|
+
!canUseAutoReconnect
|
|
101
|
+
? 'Cannot auto reconnect to a device with no serial number'
|
|
102
|
+
: ''
|
|
103
|
+
}
|
|
104
|
+
disabled={!canUseAutoReconnect}
|
|
105
|
+
isToggled={
|
|
106
|
+
autoReconnect &&
|
|
107
|
+
((!!currentDevice &&
|
|
108
|
+
!!currentDevice?.serialNumber) ||
|
|
109
|
+
!currentDevice)
|
|
110
|
+
}
|
|
111
|
+
onToggle={value => {
|
|
112
|
+
dispatch(setAutoReselect(value));
|
|
113
|
+
}}
|
|
114
|
+
/>
|
|
115
|
+
</div>
|
|
116
|
+
<div className="device-list">
|
|
117
|
+
{sortedDevices.length === 0 && <NoDevicesConnected />}
|
|
118
|
+
{sortedDevices.length > 0 &&
|
|
119
|
+
filteredDevices.length === 0 ? (
|
|
120
|
+
<NoSupportedDevicesConnected />
|
|
121
|
+
) : (
|
|
122
|
+
<AnimatedList devices={sortedDevices}>
|
|
123
|
+
{filteredDevices.map(device => (
|
|
124
|
+
<AnimatedItem
|
|
125
|
+
key={device.id.toString()}
|
|
126
|
+
itemKey={device.id.toString()}
|
|
127
|
+
>
|
|
128
|
+
{device.traits.broken ? (
|
|
129
|
+
<BrokenDevice device={device} />
|
|
130
|
+
) : (
|
|
131
|
+
<Device
|
|
132
|
+
device={device}
|
|
133
|
+
doSelectDevice={doSelectDevice}
|
|
134
|
+
allowMoreInfoVisible={isVisible}
|
|
135
|
+
/>
|
|
136
|
+
)}
|
|
137
|
+
</AnimatedItem>
|
|
138
|
+
))}
|
|
139
|
+
</AnimatedList>
|
|
140
|
+
)}
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
{virtualDevices.length > 0 && (
|
|
144
|
+
<VirtualDevices
|
|
145
|
+
virtualDevices={virtualDevices}
|
|
146
|
+
visibleAndNoDevicesConnected={
|
|
147
|
+
isVisible && filteredDevices.length === 0
|
|
98
148
|
}
|
|
99
|
-
|
|
100
|
-
dispatch(setAutoReselect(value));
|
|
101
|
-
}}
|
|
149
|
+
doSelectVirtualDevice={doSelectVirtualDevice}
|
|
102
150
|
/>
|
|
103
|
-
</div>
|
|
104
|
-
{sortedDevices.length === 0 && <NoDevicesConnected />}
|
|
105
|
-
{sortedDevices.length > 0 && filteredDevices.length === 0 ? (
|
|
106
|
-
<NoSupportedDevicesConnected />
|
|
107
|
-
) : (
|
|
108
|
-
<AnimatedList devices={sortedDevices}>
|
|
109
|
-
{filteredDevices.map(device => (
|
|
110
|
-
<AnimatedItem
|
|
111
|
-
key={device.id.toString()}
|
|
112
|
-
itemKey={device.id.toString()}
|
|
113
|
-
>
|
|
114
|
-
{device.traits.broken ? (
|
|
115
|
-
<BrokenDevice device={device} />
|
|
116
|
-
) : (
|
|
117
|
-
<Device
|
|
118
|
-
device={device}
|
|
119
|
-
doSelectDevice={doSelectDevice}
|
|
120
|
-
allowMoreInfoVisible={isVisible}
|
|
121
|
-
/>
|
|
122
|
-
)}
|
|
123
|
-
</AnimatedItem>
|
|
124
|
-
))}
|
|
125
|
-
</AnimatedList>
|
|
126
151
|
)}
|
|
127
152
|
</div>
|
|
128
153
|
);
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2015 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import React, { useEffect, useState } from 'react';
|
|
8
|
+
|
|
9
|
+
import PseudoButton from '../../../PseudoButton/PseudoButton';
|
|
10
|
+
import classNames from '../../../utils/classNames';
|
|
11
|
+
import chevron from '../arrow-down.svg';
|
|
12
|
+
|
|
13
|
+
import './broken-device.scss';
|
|
14
|
+
import '../selected-device.scss';
|
|
15
|
+
|
|
16
|
+
export const VirtualDeviceEntry = ({
|
|
17
|
+
virtualDevice,
|
|
18
|
+
onSelect,
|
|
19
|
+
}: {
|
|
20
|
+
virtualDevice: string;
|
|
21
|
+
onSelect: () => void;
|
|
22
|
+
}) => (
|
|
23
|
+
<PseudoButton
|
|
24
|
+
className="tw-flex tw-flex-col tw-gap-2 tw-border-x-0 tw-border-b tw-border-t-0 tw-border-solid tw-border-b-gray-200 tw-bg-gray-700 tw-py-3 tw-font-light hover:tw-bg-gray-600"
|
|
25
|
+
onClick={onSelect}
|
|
26
|
+
>
|
|
27
|
+
<div className="basic-device-info tw-h-[42px] tw-cursor-pointer tw-text-gray-50">
|
|
28
|
+
<span className="icon mdi mdi-flask-empty tw-text-2xl" />
|
|
29
|
+
<div className="details tw-flex tw-flex-col">
|
|
30
|
+
<p className="tw-m-0 tw-text-sm tw-font-bold">
|
|
31
|
+
{virtualDevice}
|
|
32
|
+
</p>
|
|
33
|
+
<p className="tw-m-0 tw-text-xs tw-uppercase">Virtual Device</p>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</PseudoButton>
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
export default ({
|
|
40
|
+
virtualDevices,
|
|
41
|
+
visibleAndNoDevicesConnected,
|
|
42
|
+
doSelectVirtualDevice,
|
|
43
|
+
}: {
|
|
44
|
+
virtualDevices: string[];
|
|
45
|
+
visibleAndNoDevicesConnected: boolean;
|
|
46
|
+
doSelectVirtualDevice: (virtualDevice: string) => void;
|
|
47
|
+
}) => {
|
|
48
|
+
const [deviceListVisible, setDeviceListVisible] = useState(false);
|
|
49
|
+
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (visibleAndNoDevicesConnected) {
|
|
52
|
+
setDeviceListVisible(true);
|
|
53
|
+
}
|
|
54
|
+
}, [visibleAndNoDevicesConnected]);
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<div>
|
|
58
|
+
<div
|
|
59
|
+
className={classNames(
|
|
60
|
+
'device-list tw-transform tw-duration-200 tw-ease-in-out',
|
|
61
|
+
!deviceListVisible && 'tw-h-0 tw-translate-y-full'
|
|
62
|
+
)}
|
|
63
|
+
>
|
|
64
|
+
{virtualDevices.map(virtualDevice => (
|
|
65
|
+
<VirtualDeviceEntry
|
|
66
|
+
key={virtualDevice}
|
|
67
|
+
virtualDevice={virtualDevice}
|
|
68
|
+
onSelect={() => {
|
|
69
|
+
setDeviceListVisible(false);
|
|
70
|
+
doSelectVirtualDevice(virtualDevice);
|
|
71
|
+
}}
|
|
72
|
+
/>
|
|
73
|
+
))}
|
|
74
|
+
</div>
|
|
75
|
+
<PseudoButton
|
|
76
|
+
className="tw-relative tw-z-10 tw-flex tw-h-10 tw-flex-row tw-items-center tw-justify-end tw-bg-gray-700 tw-p-3 tw-text-base tw-text-gray-50"
|
|
77
|
+
onClick={() => setDeviceListVisible(!deviceListVisible)}
|
|
78
|
+
>
|
|
79
|
+
<div className="tw-flex-grow-[.5] tw-uppercase">
|
|
80
|
+
Virtual Devices
|
|
81
|
+
</div>
|
|
82
|
+
<img
|
|
83
|
+
className={classNames(
|
|
84
|
+
'tw-transform tw-duration-100 tw-ease-linear',
|
|
85
|
+
!deviceListVisible && 'tw-rotate-180'
|
|
86
|
+
)}
|
|
87
|
+
src={chevron}
|
|
88
|
+
alt=""
|
|
89
|
+
/>
|
|
90
|
+
</PseudoButton>
|
|
91
|
+
</div>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
@@ -9,36 +9,41 @@
|
|
|
9
9
|
@import "../../../variables";
|
|
10
10
|
|
|
11
11
|
.core19-device-selector {
|
|
12
|
-
.device-list {
|
|
13
|
-
@include scrollbars($gray-50);
|
|
14
|
-
background: $gray-50;
|
|
15
|
-
color: $gray-700;
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
|
|
12
|
+
.device-list-container {
|
|
19
13
|
position: fixed;
|
|
20
14
|
width: $side-panel-width;
|
|
21
15
|
height: calc(100vh - #{$nav-bar-height});
|
|
22
16
|
z-index: -1;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
|
|
28
21
|
&.hidden {
|
|
29
22
|
transform: translateY(-100%);
|
|
30
23
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
24
|
+
|
|
25
|
+
transition: transform $normal-transition;
|
|
26
|
+
|
|
27
|
+
background: $gray-50;
|
|
28
|
+
color: $gray-700;
|
|
29
|
+
|
|
30
|
+
.device-list {
|
|
31
|
+
@include scrollbars($gray-50);
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
overflow-y: overlay;
|
|
35
|
+
|
|
36
|
+
.no-devices-connected {
|
|
37
|
+
padding: 20px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
> ul {
|
|
41
|
+
padding: 0;
|
|
42
|
+
margin-bottom: 0;
|
|
43
|
+
|
|
44
|
+
> li {
|
|
45
|
+
border-bottom: 1px solid $gray-200;
|
|
46
|
+
}
|
|
42
47
|
}
|
|
43
48
|
}
|
|
44
49
|
}
|
|
@@ -61,4 +66,4 @@
|
|
|
61
66
|
}
|
|
62
67
|
}
|
|
63
68
|
}
|
|
64
|
-
|
|
69
|
+
|
|
@@ -27,16 +27,20 @@ import { DeviceSetupConfig, setupDevice } from '../deviceSetup';
|
|
|
27
27
|
import DeviceSetupView from '../DeviceSetup/DeviceSetupView';
|
|
28
28
|
import {
|
|
29
29
|
deselectDevice,
|
|
30
|
+
deselectVirtualDevice,
|
|
30
31
|
Device,
|
|
31
32
|
deviceIsSelected as deviceIsSelectedSelector,
|
|
32
33
|
isDeviceWithSerialNumber,
|
|
33
34
|
selectDevice,
|
|
34
35
|
selectedDevice,
|
|
36
|
+
selectedVirtualDevice,
|
|
37
|
+
selectVirtualDevice,
|
|
35
38
|
setSelectedDeviceInfo,
|
|
36
39
|
} from '../deviceSlice';
|
|
37
40
|
import DeviceList from './DeviceList/DeviceList';
|
|
38
41
|
import SelectDevice from './SelectDevice';
|
|
39
42
|
import SelectedDevice from './SelectedDevice';
|
|
43
|
+
import SelectedVirtualDevice from './SelectedVirtualDevice';
|
|
40
44
|
|
|
41
45
|
export interface Props {
|
|
42
46
|
deviceListing: DeviceTraits;
|
|
@@ -51,6 +55,9 @@ export interface Props {
|
|
|
51
55
|
onDeviceDisconnected?: (device: Device) => void;
|
|
52
56
|
onDeviceIsReady?: (device: Device) => void;
|
|
53
57
|
deviceFilter?: (device: Device) => boolean;
|
|
58
|
+
virtualDevices?: string[];
|
|
59
|
+
onVirtualDeviceSelected?: (device: string) => void;
|
|
60
|
+
onVirtualDeviceDeselected?: () => void;
|
|
54
61
|
}
|
|
55
62
|
|
|
56
63
|
const noop = () => {};
|
|
@@ -63,6 +70,9 @@ export default ({
|
|
|
63
70
|
onDeviceDisconnected = noop,
|
|
64
71
|
onDeviceIsReady = noop,
|
|
65
72
|
deviceFilter,
|
|
73
|
+
virtualDevices = [],
|
|
74
|
+
onVirtualDeviceSelected = noop,
|
|
75
|
+
onVirtualDeviceDeselected = noop,
|
|
66
76
|
}: Props) => {
|
|
67
77
|
const dispatch = useDispatch();
|
|
68
78
|
const [deviceListVisible, setDeviceListVisible] = useState(false);
|
|
@@ -71,6 +81,7 @@ export default ({
|
|
|
71
81
|
const currentDevice = useSelector(selectedDevice);
|
|
72
82
|
const waitingToAutoReconnect = useSelector(getWaitingToAutoReselect);
|
|
73
83
|
const showSelectedDevice = deviceIsSelected || waitingToAutoReconnect;
|
|
84
|
+
const virtualDeviceSelected = useSelector(selectedVirtualDevice);
|
|
74
85
|
|
|
75
86
|
const abortController = useRef<AbortController>();
|
|
76
87
|
|
|
@@ -204,14 +215,25 @@ export default ({
|
|
|
204
215
|
|
|
205
216
|
return (
|
|
206
217
|
<div className="core19-device-selector">
|
|
207
|
-
{showSelectedDevice
|
|
218
|
+
{!showSelectedDevice && !virtualDeviceSelected && (
|
|
219
|
+
<SelectDevice
|
|
220
|
+
deviceListVisible={deviceListVisible}
|
|
221
|
+
toggleDeviceListVisible={toggleDeviceListVisible}
|
|
222
|
+
/>
|
|
223
|
+
)}
|
|
224
|
+
{showSelectedDevice && (
|
|
208
225
|
<SelectedDevice
|
|
209
226
|
doDeselectDevice={() => doDeselectDevice(currentDevice)}
|
|
210
227
|
toggleDeviceListVisible={toggleDeviceListVisible}
|
|
211
228
|
/>
|
|
212
|
-
)
|
|
213
|
-
|
|
214
|
-
|
|
229
|
+
)}
|
|
230
|
+
{virtualDeviceSelected && (
|
|
231
|
+
<SelectedVirtualDevice
|
|
232
|
+
virtualDevice={virtualDeviceSelected}
|
|
233
|
+
deselectVirtualDevice={() => {
|
|
234
|
+
onVirtualDeviceDeselected();
|
|
235
|
+
dispatch(deselectVirtualDevice());
|
|
236
|
+
}}
|
|
215
237
|
toggleDeviceListVisible={toggleDeviceListVisible}
|
|
216
238
|
/>
|
|
217
239
|
)}
|
|
@@ -227,8 +249,36 @@ export default ({
|
|
|
227
249
|
doDeselectDevice(currentDevice);
|
|
228
250
|
}
|
|
229
251
|
|
|
252
|
+
if (virtualDeviceSelected) {
|
|
253
|
+
dispatch(deselectVirtualDevice());
|
|
254
|
+
onVirtualDeviceDeselected();
|
|
255
|
+
}
|
|
256
|
+
|
|
230
257
|
doSelectDevice(device, autoReselected);
|
|
231
258
|
}}
|
|
259
|
+
virtualDevices={virtualDevices}
|
|
260
|
+
doSelectVirtualDevice={device => {
|
|
261
|
+
if (virtualDeviceSelected === device) {
|
|
262
|
+
setDeviceListVisible(false);
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
if (deviceIsSelected) {
|
|
267
|
+
doDeselectDevice(currentDevice);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
if (virtualDeviceSelected) {
|
|
271
|
+
dispatch(deselectVirtualDevice());
|
|
272
|
+
onVirtualDeviceSelected(device);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
dispatch(clearWaitForDevice());
|
|
276
|
+
setDeviceListVisible(false);
|
|
277
|
+
abortController.current?.abort();
|
|
278
|
+
|
|
279
|
+
dispatch(selectVirtualDevice(device));
|
|
280
|
+
onVirtualDeviceSelected(device);
|
|
281
|
+
}}
|
|
232
282
|
deviceFilter={deviceFilter}
|
|
233
283
|
/>
|
|
234
284
|
<DeviceSetupView />
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2015 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
import PseudoButton from '../../PseudoButton/PseudoButton';
|
|
10
|
+
|
|
11
|
+
import './selected-device.scss';
|
|
12
|
+
|
|
13
|
+
export default ({ doDeselectDevice }: { doDeselectDevice: () => void }) => (
|
|
14
|
+
<PseudoButton
|
|
15
|
+
className="mdi mdi-24px mdi-eject disconnect"
|
|
16
|
+
onClick={doDeselectDevice}
|
|
17
|
+
title="Disconnect device"
|
|
18
|
+
testId="disconnect-device"
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
@@ -15,22 +15,10 @@ import {
|
|
|
15
15
|
} from '../deviceAutoSelectSlice';
|
|
16
16
|
import { selectedDevice } from '../deviceSlice';
|
|
17
17
|
import BasicDeviceInfo from './BasicDeviceInfo';
|
|
18
|
+
import DisconnectDevice from './DisconnectDevice';
|
|
18
19
|
|
|
19
20
|
import './selected-device.scss';
|
|
20
21
|
|
|
21
|
-
const DisconnectDevice = ({
|
|
22
|
-
doDeselectDevice,
|
|
23
|
-
}: {
|
|
24
|
-
doDeselectDevice: () => void;
|
|
25
|
-
}) => (
|
|
26
|
-
<PseudoButton
|
|
27
|
-
className="mdi mdi-24px mdi-eject disconnect"
|
|
28
|
-
onClick={doDeselectDevice}
|
|
29
|
-
title="Disconnect device"
|
|
30
|
-
testId="disconnect-device"
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
33
|
-
|
|
34
22
|
export default ({
|
|
35
23
|
doDeselectDevice,
|
|
36
24
|
toggleDeviceListVisible,
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2015 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
import PseudoButton from '../../PseudoButton/PseudoButton';
|
|
10
|
+
import DisconnectDevice from './DisconnectDevice';
|
|
11
|
+
|
|
12
|
+
import './selected-device.scss';
|
|
13
|
+
|
|
14
|
+
export default ({
|
|
15
|
+
virtualDevice,
|
|
16
|
+
deselectVirtualDevice,
|
|
17
|
+
toggleDeviceListVisible,
|
|
18
|
+
}: {
|
|
19
|
+
virtualDevice: string;
|
|
20
|
+
deselectVirtualDevice: () => void;
|
|
21
|
+
toggleDeviceListVisible: () => void;
|
|
22
|
+
}) => (
|
|
23
|
+
<PseudoButton
|
|
24
|
+
className="tw-flex tw-h-10 tw-flex-row tw-items-center tw-bg-gray-700 tw-text-gray-50 hover:tw-bg-gray-600"
|
|
25
|
+
onClick={toggleDeviceListVisible}
|
|
26
|
+
>
|
|
27
|
+
<span className="icon mdi mdi-flask-empty tw-text-2xl" />
|
|
28
|
+
<div className="details tw-flex tw-flex-grow-[2] tw-flex-col">
|
|
29
|
+
<p className="tw-m-0 tw-h-[17px] tw-text-sm/[14px] tw-font-bold">
|
|
30
|
+
{virtualDevice}
|
|
31
|
+
</p>
|
|
32
|
+
<p className="tw-m-0 tw-text-[11px]/3 tw-uppercase group-hover:tw-text-gray-600">
|
|
33
|
+
Virtual Device
|
|
34
|
+
</p>
|
|
35
|
+
</div>
|
|
36
|
+
<div className="tw-mr-2.5 tw-flex tw-h-full tw-items-center tw-justify-center">
|
|
37
|
+
<DisconnectDevice doDeselectDevice={deselectVirtualDevice} />
|
|
38
|
+
</div>
|
|
39
|
+
</PseudoButton>
|
|
40
|
+
);
|
|
@@ -60,6 +60,7 @@ export interface DeviceState {
|
|
|
60
60
|
devices: Device[];
|
|
61
61
|
selectedDevice?: Device;
|
|
62
62
|
selectedDeviceInfo?: DeviceInfo;
|
|
63
|
+
selectedVirtualDevice?: string;
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
const initialState: DeviceState = {
|
|
@@ -224,6 +225,14 @@ const slice = createSlice({
|
|
|
224
225
|
action.payload.serialNumber
|
|
225
226
|
);
|
|
226
227
|
},
|
|
228
|
+
|
|
229
|
+
selectVirtualDevice: (state, action: PayloadAction<string>) => {
|
|
230
|
+
state.selectedVirtualDevice = action.payload;
|
|
231
|
+
},
|
|
232
|
+
|
|
233
|
+
deselectVirtualDevice: state => {
|
|
234
|
+
state.selectedVirtualDevice = undefined;
|
|
235
|
+
},
|
|
227
236
|
},
|
|
228
237
|
});
|
|
229
238
|
|
|
@@ -239,6 +248,8 @@ export const {
|
|
|
239
248
|
setDeviceNickname,
|
|
240
249
|
toggleDeviceFavorited,
|
|
241
250
|
persistSerialPortOptions,
|
|
251
|
+
selectVirtualDevice,
|
|
252
|
+
deselectVirtualDevice,
|
|
242
253
|
},
|
|
243
254
|
} = slice;
|
|
244
255
|
|
|
@@ -260,3 +271,6 @@ export const selectedSerialNumber = (state: RootState) =>
|
|
|
260
271
|
|
|
261
272
|
export const getReadbackProtection = (state: RootState) =>
|
|
262
273
|
state.device.selectedDeviceInfo?.jlink?.protectionStatus;
|
|
274
|
+
|
|
275
|
+
export const selectedVirtualDevice = (state: RootState) =>
|
|
276
|
+
state.device.selectedVirtualDevice;
|
|
@@ -8,7 +8,7 @@ import React from 'react';
|
|
|
8
8
|
|
|
9
9
|
import classNames from '../utils/classNames';
|
|
10
10
|
|
|
11
|
-
export default ({
|
|
11
|
+
export default ({ href, label = href }: { href: string; label?: string }) => (
|
|
12
12
|
<a
|
|
13
13
|
target="_blank"
|
|
14
14
|
rel="noreferrer noopener"
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export type UrlString = string;
|
|
3
|
-
export
|
|
3
|
+
export declare const sourceJsonSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
apps: z.ZodArray<z.ZodString, "many">;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
4
7
|
name: string;
|
|
5
|
-
apps:
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
+
apps: string[];
|
|
9
|
+
}, {
|
|
10
|
+
name: string;
|
|
11
|
+
apps: string[];
|
|
12
|
+
}>;
|
|
13
|
+
export type SourceJson = z.infer<typeof sourceJsonSchema>;
|
|
14
|
+
export declare const withdrawnJsonSchema: z.ZodArray<z.ZodString, "many">;
|
|
15
|
+
export type WithdrawnJson = z.infer<typeof withdrawnJsonSchema>;
|
|
8
16
|
export type AppVersions = {
|
|
9
17
|
[version: string]: AppVersion;
|
|
10
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetaFiles.d.ts","sourceRoot":"","sources":["../../../ipc/MetaFiles.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B,MAAM,
|
|
1
|
+
{"version":3,"file":"MetaFiles.d.ts","sourceRoot":"","sources":["../../../ipc/MetaFiles.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B,eAAO,MAAM,gBAAgB;;;;;;;;;EAG3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,mBAAmB,iCAA4B,CAAC;AAC7D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,MAAM,MAAM,WAAW,GAAG;IACtB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,SAAS,CAAC;IACtB,cAAc,CAAC,EAAE,cAAc,CAAC;CACnC,CAAC;AAEF,MAAM,WAAW,OAAO;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,SAAS,CAAC;IACnB,eAAe,EAAE,SAAS,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,WAAW,CAAC;IACtB,SAAS,CAAC,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC7B,CAAC;CACL;AAED,eAAO,MAAM,MAAM,aAIlB,CAAC;AAEF,QAAA,MAAM,iBAAiB,aAAa,CAAC;AACrC,QAAA,MAAM,oBAAoB,aAAS,CAAC;AAEpC,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAClE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,eAAO,MAAM,UAAU,2DAAiD,CAAC;AAEzE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageJson.d.ts","sourceRoot":"","sources":["../../../../ipc/schema/packageJson.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,QAAA,MAAM,WAAW;;;;;;;;;;;;EAKf,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD,eAAO,MAAM,gBAAgB;;;;;;;;
|
|
1
|
+
{"version":3,"file":"packageJson.d.ts","sourceRoot":"","sources":["../../../../ipc/schema/packageJson.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,QAAA,MAAM,WAAW;;;;;;;;;;;;EAKf,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD,eAAO,MAAM,gBAAgB;;;;;;;;CAA+C,CAAC;AAgB7E,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBlB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;CACmB,CAAC;AAIpD,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKxB,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;CACmB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const parseWithPrettifiedErrorMessage: <
|
|
2
|
+
export declare const parseWithPrettifiedErrorMessage: <T extends z.ZodTypeAny>(schema: T) => (content: string) => z.SafeParseSuccess<z.TypeOf<T>> | {
|
|
3
3
|
error: import("zod-validation-error").ValidationError;
|
|
4
4
|
success: false;
|
|
5
5
|
data?: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseJson.d.ts","sourceRoot":"","sources":["../../../../ipc/schema/parseJson.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,+BAA+B,
|
|
1
|
+
{"version":3,"file":"parseJson.d.ts","sourceRoot":"","sources":["../../../../ipc/schema/parseJson.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,+BAA+B,mDAE9B,MAAM;;;;CAef,CAAC"}
|
|
@@ -62,7 +62,7 @@ export declare const serialPort: {
|
|
|
62
62
|
registerWrite: (handler: ((path: string, data: string | Buffer | number[]) => void) | ((path: string, data: string | Buffer | number[]) => Promise<void>)) => void;
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
|
-
export { type AppInfo, type NrfutilModuleName, type NrfutilModules, type NrfutilModuleVersion, type SourceJson, type WithdrawnJson, } from '../ipc/MetaFiles';
|
|
65
|
+
export { sourceJsonSchema, withdrawnJsonSchema, type AppInfo, type NrfutilModuleName, type NrfutilModules, type NrfutilModuleVersion, type SourceJson, type WithdrawnJson, } from '../ipc/MetaFiles';
|
|
66
66
|
export { type PackageJsonLegacyApp, type PackageJsonApp, parsePackageJsonLegacyApp, parsePackageJsonApp, } from '../ipc/schema/packageJson';
|
|
67
67
|
export { type OverwriteOptions } from '../ipc/serialPort';
|
|
68
68
|
export type { OpenAppOptions } from '../ipc/openWindow';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../main/index.ts"],"names":[],"mappings":";AAiBA,OAAO,EACH,8BAA8B,EAC9B,4BAA4B,GAC/B,MAAM,sCAAsC,CAAC;AAE9C,eAAO,MAAM,UAAU;;;;CAAyC,CAAC;AACjE,eAAO,MAAM,IAAI;;;;;;;;;;;;;CAAmC,CAAC;AACrD,eAAO,MAAM,cAAc;;;;CAA6C,CAAC;AACzE,eAAO,MAAM,UAAU;;;;;CAAyC,CAAC;AACjE,eAAO,MAAM,YAAY;;;;;CAA2C,CAAC;AACrE,eAAO,MAAM,WAAW;;;;;;CAEvB,CAAC;AACF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;CAGtB,CAAC;AAEF,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,UAAU,EACf,KAAK,aAAa,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACH,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,yBAAyB,EACzB,mBAAmB,GACtB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EACH,0BAA0B,EAC1B,wBAAwB,GAC3B,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../main/index.ts"],"names":[],"mappings":";AAiBA,OAAO,EACH,8BAA8B,EAC9B,4BAA4B,GAC/B,MAAM,sCAAsC,CAAC;AAE9C,eAAO,MAAM,UAAU;;;;CAAyC,CAAC;AACjE,eAAO,MAAM,IAAI;;;;;;;;;;;;;CAAmC,CAAC;AACrD,eAAO,MAAM,cAAc;;;;CAA6C,CAAC;AACzE,eAAO,MAAM,UAAU;;;;;CAAyC,CAAC;AACjE,eAAO,MAAM,YAAY;;;;;CAA2C,CAAC;AACrE,eAAO,MAAM,WAAW;;;;;;CAEvB,CAAC;AACF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;CAGtB,CAAC;AAEF,OAAO,EACH,gBAAgB,EAChB,mBAAmB,EACnB,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,UAAU,EACf,KAAK,aAAa,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACH,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,yBAAyB,EACzB,mBAAmB,GACtB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EACH,0BAA0B,EAC1B,wBAAwB,GAC3B,MAAM,mBAAmB,CAAC"}
|
|
@@ -3,8 +3,10 @@ import { Device as DeviceProps } from '../../deviceSlice';
|
|
|
3
3
|
import './device-list.scss';
|
|
4
4
|
interface Props {
|
|
5
5
|
doSelectDevice: (device: DeviceProps, autoReselected: boolean) => void;
|
|
6
|
+
doSelectVirtualDevice: (device: string) => void;
|
|
6
7
|
isVisible: boolean;
|
|
7
8
|
deviceFilter?: (device: DeviceProps) => boolean;
|
|
9
|
+
virtualDevices?: string[];
|
|
8
10
|
}
|
|
9
11
|
declare const DeviceList: FC<Props>;
|
|
10
12
|
export default DeviceList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceList.d.ts","sourceRoot":"","sources":["../../../../../../src/Device/DeviceSelector/DeviceList/DeviceList.tsx"],"names":[],"mappings":"AAMA,OAAc,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AAO3C,OAAO,EACH,MAAM,IAAI,WAAW,EAGxB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"DeviceList.d.ts","sourceRoot":"","sources":["../../../../../../src/Device/DeviceSelector/DeviceList/DeviceList.tsx"],"names":[],"mappings":"AAMA,OAAc,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AAO3C,OAAO,EACH,MAAM,IAAI,WAAW,EAGxB,MAAM,mBAAmB,CAAC;AAM3B,OAAO,oBAAoB,CAAC;AA8B5B,UAAU,KAAK;IACX,cAAc,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,OAAO,KAAK,IAAI,CAAC;IACvE,qBAAqB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC;IAChD,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,KAAK,CA4FzB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './broken-device.scss';
|
|
3
|
+
import '../selected-device.scss';
|
|
4
|
+
export declare const VirtualDeviceEntry: ({ virtualDevice, onSelect, }: {
|
|
5
|
+
virtualDevice: string;
|
|
6
|
+
onSelect: () => void;
|
|
7
|
+
}) => JSX.Element;
|
|
8
|
+
declare const _default: ({ virtualDevices, visibleAndNoDevicesConnected, doSelectVirtualDevice, }: {
|
|
9
|
+
virtualDevices: string[];
|
|
10
|
+
visibleAndNoDevicesConnected: boolean;
|
|
11
|
+
doSelectVirtualDevice: (virtualDevice: string) => void;
|
|
12
|
+
}) => JSX.Element;
|
|
13
|
+
export default _default;
|
|
14
|
+
//# sourceMappingURL=VirtualDevices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VirtualDevices.d.ts","sourceRoot":"","sources":["../../../../../../src/Device/DeviceSelector/DeviceList/VirtualDevices.tsx"],"names":[],"mappings":";AAYA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,yBAAyB,CAAC;AAEjC,eAAO,MAAM,kBAAkB;mBAIZ,MAAM;cACX,MAAM,IAAI;iBAgBvB,CAAC;;oBAOkB,MAAM,EAAE;kCACM,OAAO;2CACE,MAAM,KAAK,IAAI;;AAP1D,wBAsDE"}
|