@nordicsemiconductor/pc-nrfconnect-shared 60.0.0-pre1 → 60.0.0-pre2
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/bootstrap.css +8951 -0
- package/dist/index.css +1451 -0
- package/dist/index.js +122119 -0
- package/{src/Logo/nordic-logo-blue-icon-only.png → dist/nordic-logo-blue-icon-only-H7BABN6D.png} +0 -0
- package/{src/Logo/nordic-logo-gray-icon-only.png → dist/nordic-logo-gray-icon-only-GATOTR3L.png} +0 -0
- package/package.json +12 -3
- package/typings/generated/src/Device/deviceInfo/deviceInfo.d.ts +1 -2
- package/.github/ISSUE_TEMPLATE/custom.md +0 -10
- package/.husky/pre-push +0 -3
- package/.renovaterc.json +0 -10
- package/Changelog.md +0 -2973
- package/azure-pipelines.yml +0 -34
- package/config/eslintrc.js +0 -190
- package/config/jest.config.js +0 -41
- package/config/prettier.config.js +0 -13
- package/config/tsconfig.json +0 -15
- package/fw/bootloader/graviton_bootloader_v1.0.1-[nRF5_SDK_15.0.1-1.alpha_f76d012].zip +0 -0
- package/jest.config.js +0 -7
- package/main/index.ts +0 -32
- package/mocks/deviceLibMock.ts +0 -21
- package/mocks/electronMock.ts +0 -15
- package/mocks/electronStoreMock.ts +0 -19
- package/mocks/emptyMock.ts +0 -7
- package/mocks/fileMock.ts +0 -13
- package/mocks/gaMock.ts +0 -9
- package/mocks/mockTests.test.ts +0 -15
- package/mocks/packageJsonMock.ts +0 -10
- package/mocks/remoteMock.ts +0 -17
- package/scripts/esbuild-bootstrap.js +0 -15
- package/scripts/esbuild-renderer.js +0 -131
- package/scripts/installHusky.ts +0 -17
- package/scripts/prepare-shared-release.ts +0 -122
- package/scripts/release-shared.test.ts +0 -132
- package/scripts/release-shared.ts +0 -207
- package/src/About/About.tsx +0 -25
- package/src/About/AboutButton.tsx +0 -28
- package/src/About/ApplicationCard.tsx +0 -83
- package/src/About/DeviceCard.tsx +0 -74
- package/src/About/DocumentationCard.tsx +0 -18
- package/src/About/DocumentationSection.tsx +0 -24
- package/src/About/Section.tsx +0 -21
- package/src/About/ShortcutButton.tsx +0 -41
- package/src/About/SupportCard.tsx +0 -97
- package/src/About/about.scss +0 -40
- package/src/About/documentationSlice.ts +0 -41
- package/src/About/section.scss +0 -15
- package/src/About/shortcutSlice.ts +0 -52
- package/src/Alert/Alert.module.scss +0 -29
- package/src/Alert/Alert.tsx +0 -37
- package/src/App/App.test.tsx +0 -47
- package/src/App/App.tsx +0 -227
- package/src/App/ConnectedToStore.tsx +0 -19
- package/src/App/VisibilityBar.tsx +0 -103
- package/src/App/app.scss +0 -83
- package/src/App/appLayout.ts +0 -95
- package/src/App/shared.scss +0 -49
- package/src/App/visibility-bar.scss +0 -55
- package/src/Button/Button.tsx +0 -66
- package/src/Button/button.module.scss +0 -154
- package/src/Card/Card.tsx +0 -26
- package/src/Card/card.module.scss +0 -28
- package/src/Device/BrokenDeviceDialog/BrokenDeviceDialog.tsx +0 -58
- package/src/Device/BrokenDeviceDialog/broken-device-dialog.scss +0 -18
- package/src/Device/BrokenDeviceDialog/brokenDeviceDialogSlice.tsx +0 -48
- package/src/Device/DeviceSelector/BasicDeviceInfo.tsx +0 -115
- package/src/Device/DeviceSelector/DeviceIcon.tsx +0 -27
- package/src/Device/DeviceSelector/DeviceList/AnimatedList.tsx +0 -62
- package/src/Device/DeviceSelector/DeviceList/BrokenDevice.tsx +0 -34
- package/src/Device/DeviceSelector/DeviceList/Device.tsx +0 -84
- package/src/Device/DeviceSelector/DeviceList/DeviceList.tsx +0 -113
- package/src/Device/DeviceSelector/DeviceList/EditDeviceButtons.tsx +0 -28
- package/src/Device/DeviceSelector/DeviceList/MoreDeviceInfo.tsx +0 -65
- package/src/Device/DeviceSelector/DeviceList/RenameDevice.tsx +0 -22
- package/src/Device/DeviceSelector/DeviceList/broken-device.scss +0 -32
- package/src/Device/DeviceSelector/DeviceList/device-list.scss +0 -64
- package/src/Device/DeviceSelector/DeviceList/device.scss +0 -28
- package/src/Device/DeviceSelector/DeviceList/edit-device-buttons.scss +0 -31
- package/src/Device/DeviceSelector/DeviceList/more-device-info.scss +0 -33
- package/src/Device/DeviceSelector/DeviceList/rename-device.scss +0 -13
- package/src/Device/DeviceSelector/DeviceSelector.test.tsx +0 -342
- package/src/Device/DeviceSelector/DeviceSelector.tsx +0 -173
- package/src/Device/DeviceSelector/Favorite.tsx +0 -49
- package/src/Device/DeviceSelector/SelectDevice.tsx +0 -36
- package/src/Device/DeviceSelector/SelectedDevice.tsx +0 -65
- package/src/Device/DeviceSelector/arrow-down.svg +0 -1
- package/src/Device/DeviceSelector/basic-device-info.scss +0 -62
- package/src/Device/DeviceSelector/device-icon.scss +0 -27
- package/src/Device/DeviceSelector/favorite.scss +0 -17
- package/src/Device/DeviceSelector/select-device.scss +0 -38
- package/src/Device/DeviceSelector/selected-device.scss +0 -57
- package/src/Device/DeviceSetup/DeviceSetupView.tsx +0 -102
- package/src/Device/deviceAutoSelectSlice.ts +0 -144
- package/src/Device/deviceInfo/deviceInfo.ts +0 -254
- package/src/Device/deviceInfo/nRF51-Series-logo.svg +0 -1
- package/src/Device/deviceInfo/nRF52-Series-logo.svg +0 -1
- package/src/Device/deviceInfo/nRF53-Series-logo.svg +0 -1
- package/src/Device/deviceInfo/nRF70-Series_no-background_RGB.svg +0 -36
- package/src/Device/deviceInfo/nRF91-Series-logo.svg +0 -1
- package/src/Device/deviceInfo/ppk-logo.svg +0 -1
- package/src/Device/deviceInfo/unknown-logo.svg +0 -30
- package/src/Device/deviceInfo/unknown-nordic-logo.svg +0 -25
- package/src/Device/deviceLibWrapper.test.ts +0 -97
- package/src/Device/deviceLibWrapper.ts +0 -133
- package/src/Device/deviceLister.test.ts +0 -89
- package/src/Device/deviceLister.ts +0 -396
- package/src/Device/deviceSetup.ts +0 -264
- package/src/Device/deviceSetupSlice.ts +0 -94
- package/src/Device/deviceSlice.ts +0 -248
- package/src/Device/dfu-cc.ts +0 -162
- package/src/Device/initPacket.ts +0 -402
- package/src/Device/jprogOperations.ts +0 -206
- package/src/Device/sdfuOperations.ts +0 -601
- package/src/Dialog/Dialog.test.tsx +0 -134
- package/src/Dialog/Dialog.tsx +0 -236
- package/src/Dialog/dialog.scss +0 -60
- package/src/Dropdown/Dropdown.module.scss +0 -83
- package/src/Dropdown/Dropdown.test.tsx +0 -62
- package/src/Dropdown/Dropdown.tsx +0 -106
- package/src/ErrorBoundary/ErrorBoundary.test.tsx +0 -105
- package/src/ErrorBoundary/ErrorBoundary.tsx +0 -186
- package/src/ErrorBoundary/bug.svg +0 -1
- package/src/ErrorBoundary/error-boundary.scss +0 -102
- package/src/ErrorDialog/ErrorDialog.test.tsx +0 -70
- package/src/ErrorDialog/ErrorDialog.tsx +0 -94
- package/src/ErrorDialog/error.scss +0 -14
- package/src/ErrorDialog/errorDialogSlice.test.ts +0 -64
- package/src/ErrorDialog/errorDialogSlice.ts +0 -80
- package/src/FactoryReset/FactoryResetButton.test.tsx +0 -46
- package/src/FactoryReset/FactoryResetButton.tsx +0 -81
- package/src/InlineInput/InlineInput.tsx +0 -170
- package/src/InlineInput/NumberInlineInput.tsx +0 -107
- package/src/InlineInput/inline-input.scss +0 -38
- package/src/InlineInput/number-inline-input.scss +0 -15
- package/src/Log/LogEntry.tsx +0 -62
- package/src/Log/LogViewer.tsx +0 -54
- package/src/Log/log-entry.scss +0 -30
- package/src/Log/log-viewer.scss +0 -24
- package/src/Log/logSlice.ts +0 -73
- package/src/Log/syncLogToStore.ts +0 -36
- package/src/Logo/Logo.tsx +0 -48
- package/src/Logo/logo.scss +0 -11
- package/src/Main/Main.tsx +0 -13
- package/src/Main/main.scss +0 -13
- package/src/MasonryLayout/MasonryLayout.tsx +0 -234
- package/src/MasonryLayout/masonryLayout.module.scss +0 -46
- package/src/NavBar/NavBar.tsx +0 -22
- package/src/NavBar/NavMenu.test.tsx +0 -41
- package/src/NavBar/NavMenu.tsx +0 -53
- package/src/NavBar/NavMenuItem.tsx +0 -41
- package/src/NavBar/nav-bar.scss +0 -26
- package/src/NavBar/nav-menu-item.scss +0 -34
- package/src/OpenApp/openApp.ts +0 -18
- package/src/Panes/FeedbackPane.tsx +0 -149
- package/src/PseudoButton/PseudoButton.tsx +0 -56
- package/src/PseudoButton/pseudo-button.scss +0 -11
- package/src/SerialPort/ConflictingSettingsDialog.tsx +0 -242
- package/src/SerialPort/SerialPort.test.ts +0 -54
- package/src/SerialPort/SerialPort.ts +0 -202
- package/src/Shortcuts/Shortcut-item.scss +0 -33
- package/src/Shortcuts/Shortcut-modal.scss +0 -20
- package/src/Shortcuts/ShortcutItem.tsx +0 -48
- package/src/Shortcuts/ShortcutModal.tsx +0 -67
- package/src/SidePanel/Group.tsx +0 -106
- package/src/SidePanel/SidePanel.tsx +0 -19
- package/src/SidePanel/group.scss +0 -42
- package/src/SidePanel/sidepanel.scss +0 -20
- package/src/Slider/Bar.tsx +0 -24
- package/src/Slider/Factor.test.ts +0 -48
- package/src/Slider/Handle.tsx +0 -121
- package/src/Slider/Slider.test.tsx +0 -25
- package/src/Slider/Slider.tsx +0 -91
- package/src/Slider/Ticks.tsx +0 -54
- package/src/Slider/__snapshots__/Slider.test.tsx.snap +0 -50
- package/src/Slider/bar.scss +0 -24
- package/src/Slider/factor.ts +0 -24
- package/src/Slider/handle.scss +0 -32
- package/src/Slider/percentage.ts +0 -67
- package/src/Slider/range.ts +0 -92
- package/src/Slider/slider.scss +0 -14
- package/src/Slider/ticks.scss +0 -28
- package/src/Slider/variables.scss +0 -16
- package/src/StartStopButton/StartStopButton.tsx +0 -60
- package/src/StartStopButton/play-circle.svg +0 -1
- package/src/StartStopButton/start-stop-button.scss +0 -47
- package/src/StartStopButton/stop-circle.svg +0 -1
- package/src/StateSelector/StateSelector.tsx +0 -64
- package/src/StateSelector/state-selector.scss +0 -38
- package/src/Stepper/Stepper.tsx +0 -139
- package/src/Stepper/stepper.scss +0 -127
- package/src/Toggle/Toggle.tsx +0 -120
- package/src/Toggle/toggle.scss +0 -109
- package/src/bootstrap.scss +0 -14
- package/src/index.ts +0 -146
- package/src/logging/appTransport.test.ts +0 -78
- package/src/logging/appTransport.ts +0 -41
- package/src/logging/describeError.test.ts +0 -38
- package/src/logging/describeError.ts +0 -56
- package/src/logging/index.ts +0 -103
- package/src/logging/logBuffer.test.ts +0 -41
- package/src/logging/logBuffer.ts +0 -24
- package/src/logging/sendInitialLogMessages.ts +0 -64
- package/src/store.ts +0 -60
- package/src/svg.d.ts +0 -15
- package/src/utils/AppTypes.ts +0 -60
- package/src/utils/appDirs.ts +0 -78
- package/src/utils/bleChannels.ts +0 -16
- package/src/utils/classNames.test.ts +0 -29
- package/src/utils/classNames.ts +0 -25
- package/src/utils/colors.scss +0 -46
- package/src/utils/colors.ts +0 -38
- package/src/utils/describeVersion.ts +0 -21
- package/src/utils/environment.ts +0 -6
- package/src/utils/logLibVersions.ts +0 -103
- package/src/utils/open.ts +0 -46
- package/src/utils/packageJson.ts +0 -60
- package/src/utils/persistentStore.ts +0 -144
- package/src/utils/systemReport.ts +0 -160
- package/src/utils/truncateMiddle.test.ts +0 -21
- package/src/utils/truncateMiddle.ts +0 -20
- package/src/utils/usageData.ts +0 -189
- package/src/utils/useHotKey.ts +0 -62
- package/src/utils/useStopwatch.test.tsx +0 -311
- package/src/utils/useStopwatch.ts +0 -140
- package/src/variables.scss +0 -820
- package/styles.scss +0 -88
- package/test/dispatchTo.ts +0 -23
- package/test/index.ts +0 -7
- package/test/jestResolver.js +0 -28
- package/test/setupTests.ts +0 -27
- package/test/testUtil.ts +0 -20
- package/test/testrenderer.tsx +0 -39
- /package/{src/Logo/nordic-logo-white-icon-only.png → dist/nordic-logo-white-icon-only-XIZBW537.png} +0 -0
|
@@ -1,58 +0,0 @@
|
|
|
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
|
-
import Button from 'react-bootstrap/Button';
|
|
9
|
-
import Modal from 'react-bootstrap/Modal';
|
|
10
|
-
import { useDispatch, useSelector } from 'react-redux';
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
hideDialog,
|
|
14
|
-
info as infoSelector,
|
|
15
|
-
isVisible as isVisibleSelector,
|
|
16
|
-
} from './brokenDeviceDialogSlice';
|
|
17
|
-
|
|
18
|
-
import './broken-device-dialog.scss';
|
|
19
|
-
|
|
20
|
-
const BrokenDeviceDialog = () => {
|
|
21
|
-
const dispatch = useDispatch();
|
|
22
|
-
|
|
23
|
-
const isVisible = useSelector(isVisibleSelector);
|
|
24
|
-
const { description, url } = useSelector(infoSelector);
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<Modal
|
|
28
|
-
show={isVisible}
|
|
29
|
-
onHide={() => dispatch(hideDialog())}
|
|
30
|
-
centered
|
|
31
|
-
className="broken-device-dialog"
|
|
32
|
-
>
|
|
33
|
-
<Modal.Header closeButton={false}>
|
|
34
|
-
<p>
|
|
35
|
-
<b>Unusable device</b>
|
|
36
|
-
</p>
|
|
37
|
-
|
|
38
|
-
<span className="mdi mdi-alert" />
|
|
39
|
-
</Modal.Header>
|
|
40
|
-
<Modal.Body>
|
|
41
|
-
<p>{description}</p>
|
|
42
|
-
<a target="_blank" rel="noreferrer" href={url}>
|
|
43
|
-
{url}
|
|
44
|
-
</a>
|
|
45
|
-
</Modal.Body>
|
|
46
|
-
<Modal.Footer>
|
|
47
|
-
<Button
|
|
48
|
-
onClick={() => dispatch(hideDialog())}
|
|
49
|
-
variant="secondary"
|
|
50
|
-
>
|
|
51
|
-
Close
|
|
52
|
-
</Button>
|
|
53
|
-
</Modal.Footer>
|
|
54
|
-
</Modal>
|
|
55
|
-
);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export default BrokenDeviceDialog;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2021 Nordic Semiconductor ASA
|
|
3
|
-
*
|
|
4
|
-
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
@import '../../variables';
|
|
8
|
-
|
|
9
|
-
.broken-device-dialog {
|
|
10
|
-
.modal-body {
|
|
11
|
-
p {
|
|
12
|
-
margin: 0;
|
|
13
|
-
}
|
|
14
|
-
p + p {
|
|
15
|
-
margin-bottom: 24px;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2021 Nordic Semiconductor ASA
|
|
3
|
-
*
|
|
4
|
-
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { createSlice } from '@reduxjs/toolkit';
|
|
8
|
-
|
|
9
|
-
import type { RootState } from '../../store';
|
|
10
|
-
|
|
11
|
-
export interface BrokenDeviceDialog {
|
|
12
|
-
isVisible: boolean;
|
|
13
|
-
description: string;
|
|
14
|
-
url: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const initialState: BrokenDeviceDialog = {
|
|
18
|
-
isVisible: false,
|
|
19
|
-
description: '',
|
|
20
|
-
url: '',
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const slice = createSlice({
|
|
24
|
-
name: 'brokenDeviceDialog',
|
|
25
|
-
initialState,
|
|
26
|
-
reducers: {
|
|
27
|
-
showDialog: (state, action) => {
|
|
28
|
-
state.isVisible = true;
|
|
29
|
-
state.description = action.payload.description;
|
|
30
|
-
state.url = action.payload.url;
|
|
31
|
-
},
|
|
32
|
-
hideDialog: state => {
|
|
33
|
-
state.isVisible = false;
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
export const {
|
|
39
|
-
reducer,
|
|
40
|
-
actions: { hideDialog, showDialog },
|
|
41
|
-
} = slice;
|
|
42
|
-
|
|
43
|
-
export const isVisible = (state: RootState) =>
|
|
44
|
-
state.brokenDeviceDialog.isVisible;
|
|
45
|
-
export const info = (state: RootState) => ({
|
|
46
|
-
description: state.brokenDeviceDialog.description,
|
|
47
|
-
url: state.brokenDeviceDialog.url,
|
|
48
|
-
});
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2015 Nordic Semiconductor ASA
|
|
3
|
-
*
|
|
4
|
-
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React, { ReactNode, useEffect, useState } from 'react';
|
|
8
|
-
import { useDispatch, useSelector } from 'react-redux';
|
|
9
|
-
|
|
10
|
-
import InlineInput from '../../InlineInput/InlineInput';
|
|
11
|
-
import {
|
|
12
|
-
getAutoReselectDevice,
|
|
13
|
-
getWaitingForDeviceTimeout,
|
|
14
|
-
getWaitingToAutoReselect,
|
|
15
|
-
} from '../deviceAutoSelectSlice';
|
|
16
|
-
import { displayedDeviceName } from '../deviceInfo/deviceInfo';
|
|
17
|
-
import { Device, resetDeviceNickname, setDeviceNickname } from '../deviceSlice';
|
|
18
|
-
import DeviceIcon from './DeviceIcon';
|
|
19
|
-
|
|
20
|
-
import './basic-device-info.scss';
|
|
21
|
-
|
|
22
|
-
interface Props {
|
|
23
|
-
device: Device;
|
|
24
|
-
inputRef?: React.Ref<HTMLInputElement>;
|
|
25
|
-
messageType: 'AutoReselect' | 'WaitingForDevice' | 'DeviceName';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const DeviceName = ({ device, inputRef, messageType }: Props) => {
|
|
29
|
-
const dispatch = useDispatch();
|
|
30
|
-
const setOrResetNickname = (name: string) => {
|
|
31
|
-
const newNameIsEqualToDefaultName =
|
|
32
|
-
name === displayedDeviceName(device, { respectNickname: false });
|
|
33
|
-
|
|
34
|
-
if (newNameIsEqualToDefaultName) {
|
|
35
|
-
dispatch(resetDeviceNickname(device.serialNumber));
|
|
36
|
-
} else {
|
|
37
|
-
dispatch(setDeviceNickname(device.serialNumber, name));
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
switch (messageType) {
|
|
42
|
-
case 'AutoReselect':
|
|
43
|
-
return <div className="reconnecting">Reconnecting...</div>;
|
|
44
|
-
case 'WaitingForDevice':
|
|
45
|
-
return <div className="reconnecting">Rebooting...</div>;
|
|
46
|
-
case 'DeviceName':
|
|
47
|
-
return (
|
|
48
|
-
<InlineInput
|
|
49
|
-
ref={inputRef}
|
|
50
|
-
className="name"
|
|
51
|
-
value={displayedDeviceName(device)}
|
|
52
|
-
isValid={name => name !== ''}
|
|
53
|
-
onChange={setOrResetNickname}
|
|
54
|
-
/>
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const DeviceSerialNumber = ({ device }: { device: Device }) => (
|
|
60
|
-
<div className="serial-number">{device.serialNumber}</div>
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
interface BasicDeviceProps {
|
|
64
|
-
device: Device;
|
|
65
|
-
deviceNameInputRef?: React.Ref<HTMLInputElement>;
|
|
66
|
-
toggles?: ReactNode;
|
|
67
|
-
showWaitingStatus?: boolean;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export default ({
|
|
71
|
-
device,
|
|
72
|
-
deviceNameInputRef,
|
|
73
|
-
toggles,
|
|
74
|
-
showWaitingStatus = false,
|
|
75
|
-
}: BasicDeviceProps) => {
|
|
76
|
-
const [messageType, setMessageType] = useState<
|
|
77
|
-
'AutoReselect' | 'WaitingForDevice' | 'DeviceName'
|
|
78
|
-
>('DeviceName');
|
|
79
|
-
const autoReselectDevice = useSelector(getAutoReselectDevice);
|
|
80
|
-
const waitingToAutoReselect = useSelector(getWaitingToAutoReselect);
|
|
81
|
-
const waitingForDevice = useSelector(getWaitingForDeviceTimeout);
|
|
82
|
-
const thisDevice = device.serialNumber === autoReselectDevice?.serialNumber;
|
|
83
|
-
|
|
84
|
-
useEffect(() => {
|
|
85
|
-
if (!showWaitingStatus) {
|
|
86
|
-
setMessageType('DeviceName');
|
|
87
|
-
} else if (waitingForDevice && thisDevice) {
|
|
88
|
-
setMessageType('WaitingForDevice');
|
|
89
|
-
} else if (waitingToAutoReselect && thisDevice) {
|
|
90
|
-
setMessageType('AutoReselect');
|
|
91
|
-
} else {
|
|
92
|
-
setMessageType('DeviceName');
|
|
93
|
-
}
|
|
94
|
-
}, [
|
|
95
|
-
thisDevice,
|
|
96
|
-
showWaitingStatus,
|
|
97
|
-
waitingForDevice,
|
|
98
|
-
waitingToAutoReselect,
|
|
99
|
-
]);
|
|
100
|
-
|
|
101
|
-
return (
|
|
102
|
-
<div className="basic-device-info">
|
|
103
|
-
<DeviceIcon device={device} />
|
|
104
|
-
<div className="details">
|
|
105
|
-
<DeviceName
|
|
106
|
-
device={device}
|
|
107
|
-
inputRef={deviceNameInputRef}
|
|
108
|
-
messageType={messageType}
|
|
109
|
-
/>
|
|
110
|
-
<DeviceSerialNumber device={device} />
|
|
111
|
-
</div>
|
|
112
|
-
<div className="toggles">{toggles}</div>
|
|
113
|
-
</div>
|
|
114
|
-
);
|
|
115
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2015 Nordic Semiconductor ASA
|
|
3
|
-
*
|
|
4
|
-
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React, { FC } from 'react';
|
|
8
|
-
|
|
9
|
-
import { deviceInfo } from '../deviceInfo/deviceInfo';
|
|
10
|
-
import { Device } from '../deviceSlice';
|
|
11
|
-
|
|
12
|
-
import './device-icon.scss';
|
|
13
|
-
|
|
14
|
-
const DeviceIcon: FC<{ device: Device }> = ({ device }) => {
|
|
15
|
-
const Icon = deviceInfo(device).icon;
|
|
16
|
-
return (
|
|
17
|
-
<div className="icon">
|
|
18
|
-
{device.traits.broken ? (
|
|
19
|
-
<span className="mdi mdi-alert" />
|
|
20
|
-
) : (
|
|
21
|
-
<Icon />
|
|
22
|
-
)}
|
|
23
|
-
</div>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export default DeviceIcon;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2015 Nordic Semiconductor ASA
|
|
3
|
-
*
|
|
4
|
-
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React, { FC, ReactNode } from 'react';
|
|
8
|
-
import { Flipped, Flipper, spring } from 'react-flip-toolkit';
|
|
9
|
-
|
|
10
|
-
import { Device } from '../../deviceSlice';
|
|
11
|
-
|
|
12
|
-
const changesOnReorder = (devices: Device[]) =>
|
|
13
|
-
devices.map(device => device.serialNumber).join('\n');
|
|
14
|
-
|
|
15
|
-
export const AnimatedList: FC<{
|
|
16
|
-
children: ReactNode;
|
|
17
|
-
devices: Device[];
|
|
18
|
-
}> = ({ children, devices }) => (
|
|
19
|
-
<Flipper element="ul" flipKey={changesOnReorder(devices)}>
|
|
20
|
-
{children}
|
|
21
|
-
</Flipper>
|
|
22
|
-
);
|
|
23
|
-
type onAppear = React.ComponentProps<typeof Flipped>['onAppear'];
|
|
24
|
-
type onExit = React.ComponentProps<typeof Flipped>['onExit'];
|
|
25
|
-
|
|
26
|
-
const fadeIn: onAppear = element =>
|
|
27
|
-
spring({
|
|
28
|
-
values: {
|
|
29
|
-
opacity: [0, 1],
|
|
30
|
-
scale: [0, 1],
|
|
31
|
-
},
|
|
32
|
-
// @ts-expect-error Library types not correct
|
|
33
|
-
onUpdate: ({ opacity, scale }) => {
|
|
34
|
-
element.style.opacity = opacity;
|
|
35
|
-
element.style.transform = `scaleY(${scale})`;
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
const fadeOut: onExit = (element, _, removeElement) =>
|
|
40
|
-
spring({
|
|
41
|
-
values: {
|
|
42
|
-
opacity: [1, 0],
|
|
43
|
-
scale: [1, 0],
|
|
44
|
-
},
|
|
45
|
-
// @ts-expect-error Library types not correct
|
|
46
|
-
onUpdate: ({ opacity, scale }) => {
|
|
47
|
-
element.style.opacity = opacity;
|
|
48
|
-
element.style.transform = `scaleY(${scale})`;
|
|
49
|
-
},
|
|
50
|
-
onComplete: () => {
|
|
51
|
-
removeElement();
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
export const AnimatedItem: FC<{
|
|
56
|
-
itemKey: string;
|
|
57
|
-
children: ReactNode;
|
|
58
|
-
}> = ({ children, itemKey }) => (
|
|
59
|
-
<Flipped flipId={itemKey} onAppear={fadeIn} onExit={fadeOut}>
|
|
60
|
-
<li>{children}</li>
|
|
61
|
-
</Flipped>
|
|
62
|
-
);
|
|
@@ -1,34 +0,0 @@
|
|
|
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
|
-
import { useDispatch } from 'react-redux';
|
|
9
|
-
|
|
10
|
-
import PseudoButton from '../../../PseudoButton/PseudoButton';
|
|
11
|
-
import { showDialog } from '../../BrokenDeviceDialog/brokenDeviceDialogSlice';
|
|
12
|
-
import { Device as DeviceProps } from '../../deviceSlice';
|
|
13
|
-
import BasicDeviceInfo from '../BasicDeviceInfo';
|
|
14
|
-
|
|
15
|
-
import './broken-device.scss';
|
|
16
|
-
|
|
17
|
-
export default ({ device }: { device: DeviceProps }) => {
|
|
18
|
-
const dispatch = useDispatch();
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<PseudoButton
|
|
22
|
-
className="broken-device"
|
|
23
|
-
onClick={() => dispatch(showDialog(device.broken))}
|
|
24
|
-
>
|
|
25
|
-
<BasicDeviceInfo device={device} />
|
|
26
|
-
<div className="broken-device-info">
|
|
27
|
-
<p>Unusable device detected </p>
|
|
28
|
-
<p>
|
|
29
|
-
<u>More information</u>
|
|
30
|
-
</p>
|
|
31
|
-
</div>
|
|
32
|
-
</PseudoButton>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2015 Nordic Semiconductor ASA
|
|
3
|
-
*
|
|
4
|
-
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React, { useRef, useState } from 'react';
|
|
8
|
-
|
|
9
|
-
import PseudoButton from '../../../PseudoButton/PseudoButton';
|
|
10
|
-
import classNames from '../../../utils/classNames';
|
|
11
|
-
import { Device as DeviceProps } from '../../deviceSlice';
|
|
12
|
-
import BasicDeviceInfo from '../BasicDeviceInfo';
|
|
13
|
-
import { FavoriteIndicator } from '../Favorite';
|
|
14
|
-
import EditDeviceButtons from './EditDeviceButtons';
|
|
15
|
-
import MoreDeviceInfo from './MoreDeviceInfo';
|
|
16
|
-
|
|
17
|
-
import './device.scss';
|
|
18
|
-
|
|
19
|
-
const ShowMoreInfo = ({
|
|
20
|
-
isVisible,
|
|
21
|
-
toggleVisible,
|
|
22
|
-
}: {
|
|
23
|
-
isVisible: boolean;
|
|
24
|
-
toggleVisible: () => void;
|
|
25
|
-
}) => (
|
|
26
|
-
<PseudoButton
|
|
27
|
-
className={`show-more mdi mdi-chevron-${isVisible ? 'up' : 'down'}`}
|
|
28
|
-
testId="show-more-device-info"
|
|
29
|
-
onClick={toggleVisible}
|
|
30
|
-
/>
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
interface Props {
|
|
34
|
-
device: DeviceProps;
|
|
35
|
-
doSelectDevice: (device: DeviceProps, autoReselected: boolean) => void;
|
|
36
|
-
allowMoreInfoVisible: boolean;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export default ({ device, doSelectDevice, allowMoreInfoVisible }: Props) => {
|
|
40
|
-
const [moreVisible, setMoreVisible] = useState(false);
|
|
41
|
-
const toggleMoreVisible = () => setMoreVisible(!moreVisible);
|
|
42
|
-
|
|
43
|
-
const deviceNameInputRef = useRef<HTMLInputElement>(null);
|
|
44
|
-
const startEditingDeviceName = () => {
|
|
45
|
-
deviceNameInputRef.current?.focus();
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
if (moreVisible && !allowMoreInfoVisible) {
|
|
49
|
-
setMoreVisible(false);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<PseudoButton
|
|
54
|
-
className={classNames(
|
|
55
|
-
'device',
|
|
56
|
-
moreVisible && 'more-infos-visible'
|
|
57
|
-
)}
|
|
58
|
-
onClick={() => doSelectDevice(device, false)}
|
|
59
|
-
>
|
|
60
|
-
<BasicDeviceInfo
|
|
61
|
-
deviceNameInputRef={deviceNameInputRef}
|
|
62
|
-
device={device}
|
|
63
|
-
toggles={
|
|
64
|
-
<>
|
|
65
|
-
<FavoriteIndicator device={device} />
|
|
66
|
-
<ShowMoreInfo
|
|
67
|
-
isVisible={moreVisible}
|
|
68
|
-
toggleVisible={toggleMoreVisible}
|
|
69
|
-
/>
|
|
70
|
-
</>
|
|
71
|
-
}
|
|
72
|
-
/>
|
|
73
|
-
{moreVisible && (
|
|
74
|
-
<>
|
|
75
|
-
<MoreDeviceInfo device={device} />
|
|
76
|
-
<EditDeviceButtons
|
|
77
|
-
device={device}
|
|
78
|
-
startEditingDeviceName={startEditingDeviceName}
|
|
79
|
-
/>
|
|
80
|
-
</>
|
|
81
|
-
)}
|
|
82
|
-
</PseudoButton>
|
|
83
|
-
);
|
|
84
|
-
};
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2015 Nordic Semiconductor ASA
|
|
3
|
-
*
|
|
4
|
-
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React, { FC, useMemo } from 'react';
|
|
8
|
-
import { useDispatch, useSelector } from 'react-redux';
|
|
9
|
-
|
|
10
|
-
import { Toggle } from '../../../Toggle/Toggle';
|
|
11
|
-
import classNames from '../../../utils/classNames';
|
|
12
|
-
import { getAutoReselect, setAutoReselect } from '../../deviceAutoSelectSlice';
|
|
13
|
-
import { displayedDeviceName } from '../../deviceInfo/deviceInfo';
|
|
14
|
-
import { Device as DeviceProps, getDevices } from '../../deviceSlice';
|
|
15
|
-
import { AnimatedItem, AnimatedList } from './AnimatedList';
|
|
16
|
-
import BrokenDevice from './BrokenDevice';
|
|
17
|
-
import Device from './Device';
|
|
18
|
-
|
|
19
|
-
import './device-list.scss';
|
|
20
|
-
|
|
21
|
-
const NoDevicesConnected = () => (
|
|
22
|
-
<div className="no-devices-connected">
|
|
23
|
-
Connect a{' '}
|
|
24
|
-
<a
|
|
25
|
-
target="_blank"
|
|
26
|
-
rel="noopener noreferrer"
|
|
27
|
-
href="https://www.nordicsemi.com/Software-and-tools/Development-Kits"
|
|
28
|
-
>
|
|
29
|
-
Nordic development kit
|
|
30
|
-
</a>{' '}
|
|
31
|
-
to your computer.
|
|
32
|
-
</div>
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
const NoSupportedDevicesConnected = () => (
|
|
36
|
-
<div className="no-devices-connected">No supported devices connected</div>
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
const showAllDevices = () => true;
|
|
40
|
-
|
|
41
|
-
const sorted = (devices: DeviceProps[]) =>
|
|
42
|
-
[...devices].sort((a, b) => {
|
|
43
|
-
if (a.favorite !== b.favorite) {
|
|
44
|
-
return a.favorite ? -1 : 1;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return displayedDeviceName(a) < displayedDeviceName(b) ? -1 : 1;
|
|
48
|
-
});
|
|
49
|
-
interface Props {
|
|
50
|
-
doSelectDevice: (device: DeviceProps, autoReselected: boolean) => void;
|
|
51
|
-
isVisible: boolean;
|
|
52
|
-
deviceFilter?: (device: DeviceProps) => boolean;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const DeviceList: FC<Props> = ({
|
|
56
|
-
isVisible,
|
|
57
|
-
doSelectDevice,
|
|
58
|
-
deviceFilter = showAllDevices,
|
|
59
|
-
}) => {
|
|
60
|
-
const dispatch = useDispatch();
|
|
61
|
-
const autoReconnect = useSelector(getAutoReselect);
|
|
62
|
-
const devices = useSelector(getDevices);
|
|
63
|
-
|
|
64
|
-
const sortedDevices = useMemo(
|
|
65
|
-
() => sorted([...devices.values()]),
|
|
66
|
-
[devices]
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
const filteredDevices = useMemo(
|
|
70
|
-
() => sortedDevices.filter(deviceFilter),
|
|
71
|
-
[deviceFilter, sortedDevices]
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
return (
|
|
75
|
-
<div className={classNames('device-list', isVisible || 'hidden')}>
|
|
76
|
-
<div className="global-auto-reconnect">
|
|
77
|
-
<Toggle
|
|
78
|
-
id="toggle-global-auto-reconnect"
|
|
79
|
-
label="Auto Reconnect"
|
|
80
|
-
isToggled={autoReconnect}
|
|
81
|
-
onToggle={value => {
|
|
82
|
-
dispatch(setAutoReselect(value));
|
|
83
|
-
}}
|
|
84
|
-
/>
|
|
85
|
-
</div>
|
|
86
|
-
{sortedDevices.length === 0 && <NoDevicesConnected />}
|
|
87
|
-
{sortedDevices.length > 0 && filteredDevices.length === 0 ? (
|
|
88
|
-
<NoSupportedDevicesConnected />
|
|
89
|
-
) : (
|
|
90
|
-
<AnimatedList devices={sortedDevices}>
|
|
91
|
-
{filteredDevices.map(device => (
|
|
92
|
-
<AnimatedItem
|
|
93
|
-
key={device.serialNumber}
|
|
94
|
-
itemKey={device.serialNumber}
|
|
95
|
-
>
|
|
96
|
-
{device.traits.broken ? (
|
|
97
|
-
<BrokenDevice device={device} />
|
|
98
|
-
) : (
|
|
99
|
-
<Device
|
|
100
|
-
device={device}
|
|
101
|
-
doSelectDevice={doSelectDevice}
|
|
102
|
-
allowMoreInfoVisible={isVisible}
|
|
103
|
-
/>
|
|
104
|
-
)}
|
|
105
|
-
</AnimatedItem>
|
|
106
|
-
))}
|
|
107
|
-
</AnimatedList>
|
|
108
|
-
)}
|
|
109
|
-
</div>
|
|
110
|
-
);
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
export default DeviceList;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2015 Nordic Semiconductor ASA
|
|
3
|
-
*
|
|
4
|
-
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React, { FC } from 'react';
|
|
8
|
-
import ButtonGroup from 'react-bootstrap/ButtonGroup';
|
|
9
|
-
|
|
10
|
-
import { Device } from '../../deviceSlice';
|
|
11
|
-
import { MakeDeviceFavorite } from '../Favorite';
|
|
12
|
-
import RenameDevice from './RenameDevice';
|
|
13
|
-
|
|
14
|
-
import './edit-device-buttons.scss';
|
|
15
|
-
|
|
16
|
-
interface Props {
|
|
17
|
-
device: Device;
|
|
18
|
-
startEditingDeviceName: () => void;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const EditDeviceButtons: FC<Props> = ({ device, startEditingDeviceName }) => (
|
|
22
|
-
<ButtonGroup className="edit-device-buttons">
|
|
23
|
-
<MakeDeviceFavorite device={device} />
|
|
24
|
-
<RenameDevice startEditingDeviceName={startEditingDeviceName} />
|
|
25
|
-
</ButtonGroup>
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
export default EditDeviceButtons;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2015 Nordic Semiconductor ASA
|
|
3
|
-
*
|
|
4
|
-
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React, { ReactNode } from 'react';
|
|
8
|
-
import { SerialPort } from '@nordicsemiconductor/nrf-device-lib-js';
|
|
9
|
-
|
|
10
|
-
import { displayedDeviceName } from '../../deviceInfo/deviceInfo';
|
|
11
|
-
import { Device } from '../../deviceSlice';
|
|
12
|
-
|
|
13
|
-
import './more-device-info.scss';
|
|
14
|
-
|
|
15
|
-
const Row = ({ children }: { children: ReactNode }) => (
|
|
16
|
-
<div className="info-row">
|
|
17
|
-
<div className="flex-space" />
|
|
18
|
-
{children}
|
|
19
|
-
</div>
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
const PcaNumber = ({ device }: { device: Device }) => {
|
|
23
|
-
if (device.boardVersion == null) {
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return <div>{device.boardVersion}</div>;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const MaybeDeviceName = ({ device }: { device: Device }) => {
|
|
31
|
-
const hasNickname = device.nickname !== '';
|
|
32
|
-
if (!hasNickname) {
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<div className="name">
|
|
38
|
-
{displayedDeviceName(device, { respectNickname: false })}
|
|
39
|
-
</div>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const Serialports = ({ ports }: { ports: SerialPort[] }) => (
|
|
44
|
-
<ul className="ports">
|
|
45
|
-
{ports.map(port => (
|
|
46
|
-
<li key={port.path}>{port.comName}</li>
|
|
47
|
-
))}
|
|
48
|
-
</ul>
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
export default ({ device }: { device: Device }) => (
|
|
52
|
-
<div className="more-infos">
|
|
53
|
-
<Row>
|
|
54
|
-
<PcaNumber device={device} />
|
|
55
|
-
</Row>
|
|
56
|
-
<Row>
|
|
57
|
-
<MaybeDeviceName device={device} />
|
|
58
|
-
</Row>
|
|
59
|
-
{device.serialPorts && (
|
|
60
|
-
<Row>
|
|
61
|
-
<Serialports ports={device.serialPorts} />
|
|
62
|
-
</Row>
|
|
63
|
-
)}
|
|
64
|
-
</div>
|
|
65
|
-
);
|
|
@@ -1,22 +0,0 @@
|
|
|
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 './rename-device.scss';
|
|
12
|
-
|
|
13
|
-
export default ({
|
|
14
|
-
startEditingDeviceName,
|
|
15
|
-
}: {
|
|
16
|
-
startEditingDeviceName: () => void;
|
|
17
|
-
}) => (
|
|
18
|
-
<PseudoButton className="rename-button" onClick={startEditingDeviceName}>
|
|
19
|
-
<span className="mdi mdi-pencil-circle pencil" />
|
|
20
|
-
Rename device
|
|
21
|
-
</PseudoButton>
|
|
22
|
-
);
|