diff --git a/src/api/focus.js b/src/api/focus.js
index 8842402b0..bba0d239e 100644
--- a/src/api/focus.js
+++ b/src/api/focus.js
@@ -13,11 +13,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
+import logger from "@renderer/utils/Logger";
import Colormap from "./focus/colormap";
-import Macros from "./focus/macros";
import Keymap, { OnlyCustom } from "./focus/keymap";
import LayerNames from "./focus/layernames";
-import logger from "@renderer/utils/Logger";
+import Macros from "./focus/macros";
global.chrysalis_focus_instance = null;
diff --git a/src/api/focus/keymap.js b/src/api/focus/keymap.js
index 48e668d0b..94490dbce 100644
--- a/src/api/focus/keymap.js
+++ b/src/api/focus/keymap.js
@@ -139,4 +139,4 @@ class OnlyCustom {
}
}
-export { Keymap as default, OnlyCustom };
+export { OnlyCustom, Keymap as default };
diff --git a/src/api/focus/keymap/db.js b/src/api/focus/keymap/db.js
index eeff9ff38..6ad1e52cc 100644
--- a/src/api/focus/keymap/db.js
+++ b/src/api/focus/keymap/db.js
@@ -14,13 +14,12 @@
* this program. If not, see .
*/
+import logger from "@renderer/utils/Logger";
import i18n from "i18next";
import cldr_data from "./cldr_data";
-import { Base } from "./db/base";
-import { USQwerty } from "./db/base";
+import { Base, USQwerty } from "./db/base";
import { constants } from "./db/constants";
import { withModifiers } from "./db/modifiers";
-import logger from "@renderer/utils/Logger";
import enLangMap from "./cldr_languages/en";
import nlLangMap from "./cldr_languages/nl";
diff --git a/src/api/focus/keymap/db/base.js b/src/api/focus/keymap/db/base.js
index 97f2094d3..c89e73d0d 100644
--- a/src/api/focus/keymap/db/base.js
+++ b/src/api/focus/keymap/db/base.js
@@ -14,9 +14,9 @@
* this program. If not, see .
*/
-import { withModifiers } from "./modifiers";
-import { GuiLabel } from "./gui";
import { constants } from "./constants";
+import { GuiLabel } from "./gui";
+import { withModifiers } from "./modifiers";
const assignKeysToCategory = (categories, keys) => {
const newKeys = [];
@@ -617,4 +617,4 @@ const Base = {
layout: key_layout_104key,
};
-export { Base, USQwerty, addDualUseModifier, addDualUseLayer };
+export { Base, USQwerty, addDualUseLayer, addDualUseModifier };
diff --git a/src/api/focus/macros.js b/src/api/focus/macros.js
index 7bf24c2b3..5a5944879 100644
--- a/src/api/focus/macros.js
+++ b/src/api/focus/macros.js
@@ -399,4 +399,4 @@ const Macros = function () {
return this;
};
-export { Macros as default, Step };
+export { Step, Macros as default };
diff --git a/src/api/hardware-keyboardio-model01/components/Keymap.js b/src/api/hardware-keyboardio-model01/components/Keymap.js
index 6214101cc..5eee78c22 100644
--- a/src/api/hardware-keyboardio-model01/components/Keymap.js
+++ b/src/api/hardware-keyboardio-model01/components/Keymap.js
@@ -22,6 +22,7 @@
import React from "react";
import Key from "./keymap/Key";
+
const Keymap = (props) => {
const keyProps = {
layerNames: props.LayerNames,
diff --git a/src/api/hardware-keyboardio-model01/components/keymap/Key.js b/src/api/hardware-keyboardio-model01/components/keymap/Key.js
index 117582138..de28203a5 100644
--- a/src/api/hardware-keyboardio-model01/components/keymap/Key.js
+++ b/src/api/hardware-keyboardio-model01/components/keymap/Key.js
@@ -16,8 +16,8 @@
*/
import KeymapDB from "@api/focus/keymap/db";
-import React from "react";
import useTheme from "@mui/material/styles/useTheme";
+import React from "react";
const db = new KeymapDB();
diff --git a/src/renderer/ActiveDevice.js b/src/renderer/ActiveDevice.js
index 536d395ca..4e47ea329 100644
--- a/src/renderer/ActiveDevice.js
+++ b/src/renderer/ActiveDevice.js
@@ -22,7 +22,6 @@ import { v4 as uuidv4 } from "uuid";
import { AVR109Flasher } from "@api/flash/AVR109Flasher";
import { WebDFUFlasher } from "@api/flash/WebDFUFlasher";
-import { t } from "i18next";
import logger from "@renderer/utils/Logger";
export function ActiveDevice() {
diff --git a/src/renderer/App.js b/src/renderer/App.js
index 961b990fb..93e0cda43 100644
--- a/src/renderer/App.js
+++ b/src/renderer/App.js
@@ -21,7 +21,7 @@ import KeymapDB from "@api/focus/keymap/db";
import { LocationProvider, Router } from "@gatsbyjs/reach-router";
import Box from "@mui/material/Box";
import CssBaseline from "@mui/material/CssBaseline";
-import { createTheme, StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
+import { StyledEngineProvider, ThemeProvider, createTheme } from "@mui/material/styles";
import React, { Suspense, useContext, useEffect, useState } from "react";
import { DndProvider } from "react-dnd";
import { HTML5Backend } from "react-dnd-html5-backend";
@@ -38,14 +38,14 @@ import ChangeLog from "./screens/ChangeLog";
import Editor from "./screens/Editor";
import FirmwareUpdate from "./screens/FirmwareUpdate";
import FocusNotDetected from "./screens/FocusNotDetected";
+import ImportExport from "./screens/ImportExport";
import KeyboardSelect from "./screens/KeyboardSelect";
import LayoutCard from "./screens/LayoutCard";
import Preferences from "./screens/Preferences";
import SystemInfo from "./screens/SystemInfo";
-import ImportExport from "./screens/ImportExport";
-import logger from "@renderer/utils/Logger";
import { Store } from "@renderer/localStore";
+import logger from "@renderer/utils/Logger";
const settings = new Store();
const App = (props) => {
diff --git a/src/renderer/breaking-news/firmware-0.90.1.js b/src/renderer/breaking-news/firmware-0.90.1.js
index ad23dec52..4af4de282 100644
--- a/src/renderer/breaking-news/firmware-0.90.1.js
+++ b/src/renderer/breaking-news/firmware-0.90.1.js
@@ -18,10 +18,10 @@
import AlertTitle from "@mui/material/AlertTitle";
import Button from "@mui/material/Button";
import Typography from "@mui/material/Typography";
+import { GlobalContext } from "@renderer/components/GlobalContext";
import openURL from "@renderer/utils/openURL";
import React from "react";
import { useTranslation } from "react-i18next";
-import { GlobalContext } from "@renderer/components/GlobalContext";
import { BreakingNews } from "@renderer/components/BreakingNews";
import logger from "@renderer/utils/Logger";
diff --git a/src/renderer/components/GlobalContext.js b/src/renderer/components/GlobalContext.js
index f1d2c591e..7e125861e 100644
--- a/src/renderer/components/GlobalContext.js
+++ b/src/renderer/components/GlobalContext.js
@@ -16,7 +16,6 @@
*/
import React, { createContext, useState, useEffect } from "react";
-import { Logger } from "@renderer/utils/Logger"; // Assuming Logger class is exported from Logger.js
export const GlobalContext = createContext();
diff --git a/src/renderer/components/Header.js b/src/renderer/components/Header.js
index a127c15cd..2d5dd16b8 100644
--- a/src/renderer/components/Header.js
+++ b/src/renderer/components/Header.js
@@ -26,7 +26,7 @@ import Typography from "@mui/material/Typography";
import useMediaQuery from "@mui/material/useMediaQuery";
import ConfirmationDialog from "@renderer/components/ConfirmationDialog";
import { GlobalContext } from "@renderer/components/GlobalContext";
-import React, { useEffect, useState, useContext } from "react";
+import React, { useContext, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import "typeface-roboto/index.css";
import "typeface-source-code-pro/index.css";
diff --git a/src/renderer/components/LoadingScreen.js b/src/renderer/components/LoadingScreen.js
index 202c1b7f8..aa814a5be 100644
--- a/src/renderer/components/LoadingScreen.js
+++ b/src/renderer/components/LoadingScreen.js
@@ -18,9 +18,10 @@
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import { keyframes } from "@mui/system";
+import logo from "images/logo.png";
import React from "react";
import { useTranslation } from "react-i18next";
-import logo from "images/logo.png";
+
function LoadingScreen(props) {
const spin = keyframes`
from {
diff --git a/src/renderer/components/MainMenu/MainMenu.js b/src/renderer/components/MainMenu/MainMenu.js
index fe2219c82..6544227ee 100644
--- a/src/renderer/components/MainMenu/MainMenu.js
+++ b/src/renderer/components/MainMenu/MainMenu.js
@@ -17,7 +17,6 @@
import ChatIcon from "@mui/icons-material/Chat";
import CloudUploadIcon from "@mui/icons-material/CloudUpload";
-import ExitToAppIcon from "@mui/icons-material/ExitToApp";
import InfoIcon from "@mui/icons-material/Info";
import KeyboardIcon from "@mui/icons-material/Keyboard";
import ListIcon from "@mui/icons-material/List";
diff --git a/src/renderer/components/SaveChangesButton.js b/src/renderer/components/SaveChangesButton.js
index f4836fe34..fb3025b84 100644
--- a/src/renderer/components/SaveChangesButton.js
+++ b/src/renderer/components/SaveChangesButton.js
@@ -20,10 +20,10 @@ import SaveAltIcon from "@mui/icons-material/SaveAlt";
import Box from "@mui/material/Box";
import CircularProgress from "@mui/material/CircularProgress";
import Fab from "@mui/material/Fab";
-import Tooltip from "@mui/material/Tooltip";
+import Typography from "@mui/material/Typography";
import i18n from "@renderer/i18n";
import React from "react";
-import Typography from "@mui/material/Typography";
+
const SaveChangesButton = (props) => {
const [inProgress, setInProgress] = React.useState(false);
const [success, setSuccess] = React.useState(false);
diff --git a/src/renderer/components/Toast.js b/src/renderer/components/Toast.js
index e63180c77..2df053013 100644
--- a/src/renderer/components/Toast.js
+++ b/src/renderer/components/Toast.js
@@ -15,7 +15,7 @@
* along with this program. If not, see .
*/
-import React, { useState, useEffect } from "react";
+import React, { useEffect, useState } from "react";
import Alert from "@mui/material/Alert";
import LinearProgress from "@mui/material/LinearProgress";
diff --git a/src/renderer/components/WebSerialCheck.js b/src/renderer/components/WebSerialCheck.js
index 37f454815..7b5c525a6 100644
--- a/src/renderer/components/WebSerialCheck.js
+++ b/src/renderer/components/WebSerialCheck.js
@@ -1,6 +1,6 @@
-import React, { useState } from "react";
-import Modal from "@mui/material/Modal";
import Alert from "@mui/material/Alert";
+import Modal from "@mui/material/Modal";
+import React, { useState } from "react";
const webSerialSupported = !!navigator.serial;
export const WebSerialCheck = () => {
diff --git a/src/renderer/hooks/useCheckDeviceSupportsPlugins.js b/src/renderer/hooks/useCheckDeviceSupportsPlugins.js
index c40f604fc..26dd38718 100644
--- a/src/renderer/hooks/useCheckDeviceSupportsPlugins.js
+++ b/src/renderer/hooks/useCheckDeviceSupportsPlugins.js
@@ -15,8 +15,7 @@
*/
import { GlobalContext } from "@renderer/components/GlobalContext";
-
-import { useEffect, useState, useContext } from "react";
+import { useContext, useEffect, useState } from "react";
const useCheckDeviceSupportsPlugins = (desiredPlugins) => {
const globalContext = useContext(GlobalContext);
diff --git a/src/renderer/hooks/usePluginEffect.js b/src/renderer/hooks/usePluginEffect.js
index 9800c8744..c51bb8e18 100644
--- a/src/renderer/hooks/usePluginEffect.js
+++ b/src/renderer/hooks/usePluginEffect.js
@@ -15,8 +15,7 @@
*/
import { GlobalContext } from "@renderer/components/GlobalContext";
-
-import { useEffect, useState, useContext } from "react";
+import { useContext, useEffect, useState } from "react";
const usePluginEffect = (initialize) => {
const globalContext = useContext(GlobalContext);
diff --git a/src/renderer/hooks/usePluginVisibility.js b/src/renderer/hooks/usePluginVisibility.js
index 9b636f023..98491ab83 100644
--- a/src/renderer/hooks/usePluginVisibility.js
+++ b/src/renderer/hooks/usePluginVisibility.js
@@ -14,10 +14,10 @@
* along with this program. If not, see .
*/
-import { useEffect, useContext, useState } from "react";
import { GlobalContext } from "@renderer/components/GlobalContext";
-
import { Store } from "@renderer/localStore";
+import { useContext, useEffect, useState } from "react";
+
const settings = new Store();
export default function usePluginVisibility(plugin) {
diff --git a/src/renderer/i18n.js b/src/renderer/i18n.js
index 9f54b12e9..dc8a871f5 100644
--- a/src/renderer/i18n.js
+++ b/src/renderer/i18n.js
@@ -15,10 +15,10 @@
* along with this program. If not, see .
*/
-import i18n from "i18next";
-import { initReactI18next } from "react-i18next";
import English from "@renderer/i18n/en";
import Dutch from "@renderer/i18n/nl";
+import i18n from "i18next";
+import { initReactI18next } from "react-i18next";
const resources = {
en: {
diff --git a/src/renderer/screens/Editor.js b/src/renderer/screens/Editor.js
index c9aaed3e8..823ce232c 100644
--- a/src/renderer/screens/Editor.js
+++ b/src/renderer/screens/Editor.js
@@ -14,14 +14,15 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-import logger from "@renderer/utils/Logger";
import Keymap from "@api/focus/keymap";
import KeymapDB from "@api/focus/keymap/db";
-import Macros, { Step as MacroStep } from "@api/focus/macros";
import LayerNames from "@api/focus/layernames";
-import Button from "@mui/material/Button";
+import Macros, { Step as MacroStep } from "@api/focus/macros";
import Box from "@mui/material/Box";
+import Button from "@mui/material/Button";
+import Drawer from "@mui/material/Drawer";
+import useTheme from "@mui/material/styles/useTheme";
import { hideContextBar, showContextBar } from "@renderer/components/ContextBar";
import { GlobalContext } from "@renderer/components/GlobalContext";
import LoadingScreen from "@renderer/components/LoadingScreen";
@@ -29,17 +30,16 @@ import { PageTitle } from "@renderer/components/PageTitle";
import SaveChangesButton from "@renderer/components/SaveChangesButton";
import { toast } from "@renderer/components/Toast";
import useEffectOnce from "@renderer/hooks/useEffectOnce";
+import logger from "@renderer/utils/Logger";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
+import MacroEditor from "./Editor/Macros/MacroEditor";
+import LayoutSharing from "./Editor/Sidebar/LayoutSharing";
+import Overview from "./Editor/Sidebar/Overview";
import { KeyPicker } from "./Editor/components/KeyPicker";
-import { MacroStorageAlert } from "./Editor/components/MacroStorageAlert";
import { LayerNamesStorageAlert } from "./Editor/components/LayerNamesStorageAlert";
+import { MacroStorageAlert } from "./Editor/components/MacroStorageAlert";
import OnlyCustomScreen from "./Editor/components/OnlyCustomScreen";
-import MacroEditor from "./Editor/Macros/MacroEditor";
-import Overview from "./Editor/Sidebar/Overview";
-import Drawer from "@mui/material/Drawer";
-import LayoutSharing from "./Editor/Sidebar/LayoutSharing";
-import useTheme from "@mui/material/styles/useTheme";
const db = new KeymapDB();
diff --git a/src/renderer/screens/Editor/Macros/MacroEditor.js b/src/renderer/screens/Editor/Macros/MacroEditor.js
index 0fed9d782..a6d41fe39 100644
--- a/src/renderer/screens/Editor/Macros/MacroEditor.js
+++ b/src/renderer/screens/Editor/Macros/MacroEditor.js
@@ -16,6 +16,7 @@
*/
import CloseIcon from "@mui/icons-material/Close";
+import { Divider } from "@mui/material";
import Card from "@mui/material/Card";
import CardContent from "@mui/material/CardContent";
import CardHeader from "@mui/material/CardHeader";
@@ -27,7 +28,6 @@ import { useTranslation } from "react-i18next";
import MacroStep from "./MacroStep";
import MacroStepAdd from "./MacroStepAdd";
import MacroStepEditor from "./MacroStepEditor";
-import { Divider } from "@mui/material";
const MacroEditor = (props) => {
const { macroId, macro, onMacroChange, macroStep, setMacroStep } = props;
diff --git a/src/renderer/screens/Editor/Macros/MacroStepAdd.js b/src/renderer/screens/Editor/Macros/MacroStepAdd.js
index 32bbfe1d4..9680c9fe7 100644
--- a/src/renderer/screens/Editor/Macros/MacroStepAdd.js
+++ b/src/renderer/screens/Editor/Macros/MacroStepAdd.js
@@ -15,7 +15,7 @@
* along with this program. If not, see .
*/
-import React, { useState } from "react";
+import React from "react";
import { useTranslation } from "react-i18next";
import KeymapDB from "@api/focus/keymap/db";
diff --git a/src/renderer/screens/Editor/Sidebar/Colormap.js b/src/renderer/screens/Editor/Sidebar/Colormap.js
index 1233c0e60..efb700ff2 100644
--- a/src/renderer/screens/Editor/Sidebar/Colormap.js
+++ b/src/renderer/screens/Editor/Sidebar/Colormap.js
@@ -15,12 +15,12 @@
* along with this program. If not, see .
*/
+import Stack from "@mui/material/Stack";
import React from "react";
import { ChromePicker } from "react-color";
import { useTranslation } from "react-i18next";
-import PalettePicker from "./Colormap/PalettePicker";
import FKPCategorySelector from "../components/FKPCategorySelector";
-import Stack from "@mui/material/Stack";
+import PalettePicker from "./Colormap/PalettePicker";
const Colormap = (props) => {
const { t } = useTranslation();
diff --git a/src/renderer/screens/Editor/Sidebar/DynamicMacroKeys.js b/src/renderer/screens/Editor/Sidebar/DynamicMacroKeys.js
index 78053de44..2be120a83 100644
--- a/src/renderer/screens/Editor/Sidebar/DynamicMacroKeys.js
+++ b/src/renderer/screens/Editor/Sidebar/DynamicMacroKeys.js
@@ -15,16 +15,16 @@
* along with this program. If not, see .
*/
-import React from "react";
-import { useTranslation } from "react-i18next";
+import KeymapDB from "@api/focus/keymap/db";
+import Macros from "@api/focus/macros";
import Button from "@mui/material/Button";
-import Paper from "@mui/material/Paper";
+import Divider from "@mui/material/Divider";
import Grid from "@mui/material/Grid";
+import Paper from "@mui/material/Paper";
import Typography from "@mui/material/Typography";
+import React from "react";
+import { useTranslation } from "react-i18next";
import FKPCategorySelector from "../components/FKPCategorySelector";
-import Divider from "@mui/material/Divider";
-import Macros from "@api/focus/macros";
-import KeymapDB from "@api/focus/keymap/db";
const DynamicMacroKeys = (props) => {
const { currentKey } = props;
diff --git a/src/renderer/screens/Editor/Sidebar/LayerNameInput.js b/src/renderer/screens/Editor/Sidebar/LayerNameInput.js
index 5dcd38466..8f61d2fc2 100644
--- a/src/renderer/screens/Editor/Sidebar/LayerNameInput.js
+++ b/src/renderer/screens/Editor/Sidebar/LayerNameInput.js
@@ -1,6 +1,6 @@
import InputBase from "@mui/material/InputBase";
-import React from "react";
import useCheckDeviceSupportsPlugins from "@renderer/hooks/useCheckDeviceSupportsPlugins";
+import React from "react";
export const LayerNameInput = (props) => {
const [loaded, plugins] = useCheckDeviceSupportsPlugins(["LayerNames"]);
diff --git a/src/renderer/screens/Editor/Sidebar/LayoutSharing.js b/src/renderer/screens/Editor/Sidebar/LayoutSharing.js
index 9e62f8995..d106c8f3f 100644
--- a/src/renderer/screens/Editor/Sidebar/LayoutSharing.js
+++ b/src/renderer/screens/Editor/Sidebar/LayoutSharing.js
@@ -15,22 +15,13 @@
* along with this program. If not, see .
*/
-import CloseIcon from "@mui/icons-material/Close";
import Box from "@mui/material/Box";
import Button from "@mui/material/Button";
-import Dialog from "@mui/material/Dialog";
-import DialogContent from "@mui/material/DialogContent";
-import DialogTitle from "@mui/material/DialogTitle";
-import Divider from "@mui/material/Divider";
import Drawer from "@mui/material/Drawer";
-import IconButton from "@mui/material/IconButton";
-import Typography from "@mui/material/Typography";
import ConfirmationDialog from "@renderer/components/ConfirmationDialog";
import { GlobalContext } from "@renderer/components/GlobalContext";
-
import { t } from "i18next";
-import React, { useContext, useState, useEffect } from "react";
-
+import React, { useContext, useEffect, useState } from "react";
import { ExportToFile } from "./LayoutSharing/ExportToFile";
import { FileImport } from "./LayoutSharing/FileImport";
import { LibraryImport } from "./LayoutSharing/LibraryImport";
diff --git a/src/renderer/screens/Editor/Sidebar/LayoutSharing/BackupImport.js b/src/renderer/screens/Editor/Sidebar/LayoutSharing/BackupImport.js
index 764d3d418..ecfd25853 100644
--- a/src/renderer/screens/Editor/Sidebar/LayoutSharing/BackupImport.js
+++ b/src/renderer/screens/Editor/Sidebar/LayoutSharing/BackupImport.js
@@ -20,19 +20,18 @@ import Divider from "@mui/material/Divider";
import MenuItem from "@mui/material/MenuItem";
import MenuList from "@mui/material/MenuList";
import Typography from "@mui/material/Typography";
-import { ipcRenderer } from "electron";
+import { GlobalContext } from "@renderer/components/GlobalContext";
+import logger from "@renderer/utils/Logger";
import React, { useContext } from "react";
import { useTranslation } from "react-i18next";
import { loadLayout } from "./LoadLayout";
-import { GlobalContext } from "@renderer/components/GlobalContext";
-import logger from "@renderer/utils/Logger";
export const BackupImport = (props) => {
const { t } = useTranslation();
const [activeDevice] = useContext(GlobalContext).state.activeDevice;
const deviceDescriptor = activeDevice.focusDeviceDescriptor();
-
+ /*
const library = ipcRenderer.sendSync("backups.list-library", deviceDescriptor.info);
const selectBackupItem = (item) => () => {
const [layoutFileData, error] = ipcRenderer.sendSync("backups.load-file", deviceDescriptor.info, item);
@@ -50,7 +49,7 @@ export const BackupImport = (props) => {
const layoutData = loadLayout("$userData/" + item, layoutFileData);
if (layoutData != null) props.setLayout(item, layoutData);
};
-
+*/
const formatName = (name) => {
const ts = new Date(parseInt(name));
diff --git a/src/renderer/screens/Editor/Sidebar/LayoutSharing/ExportToFile.js b/src/renderer/screens/Editor/Sidebar/LayoutSharing/ExportToFile.js
index fb98d9e9e..3b2d500a3 100644
--- a/src/renderer/screens/Editor/Sidebar/LayoutSharing/ExportToFile.js
+++ b/src/renderer/screens/Editor/Sidebar/LayoutSharing/ExportToFile.js
@@ -1,9 +1,9 @@
import Box from "@mui/material/Box";
import Button from "@mui/material/Button";
+import { GlobalContext } from "@renderer/components/GlobalContext";
+import exportKeyboardConfigToFile from "@renderer/utils/exportKeyboardConfigToFile";
import React from "react";
import { useTranslation } from "react-i18next";
-import exportKeyboardConfigToFile from "@renderer/utils/exportKeyboardConfigToFile";
-import { GlobalContext } from "@renderer/components/GlobalContext";
export const ExportToFile = (props) => {
const { t } = useTranslation();
diff --git a/src/renderer/screens/Editor/Sidebar/LayoutSharing/FileImport.js b/src/renderer/screens/Editor/Sidebar/LayoutSharing/FileImport.js
index addcba3c8..48b193755 100644
--- a/src/renderer/screens/Editor/Sidebar/LayoutSharing/FileImport.js
+++ b/src/renderer/screens/Editor/Sidebar/LayoutSharing/FileImport.js
@@ -1,9 +1,9 @@
import Box from "@mui/material/Box";
import Button from "@mui/material/Button";
+import logger from "@renderer/utils/Logger";
import React from "react";
import { useTranslation } from "react-i18next";
import { loadLayout } from "./LoadLayout";
-import logger from "@renderer/utils/Logger";
export const FileImport = (props) => {
const { t } = useTranslation();
diff --git a/src/renderer/screens/Editor/Sidebar/LayoutSharing/LibraryImport.js b/src/renderer/screens/Editor/Sidebar/LayoutSharing/LibraryImport.js
index f67f32b47..4a1cea840 100644
--- a/src/renderer/screens/Editor/Sidebar/LayoutSharing/LibraryImport.js
+++ b/src/renderer/screens/Editor/Sidebar/LayoutSharing/LibraryImport.js
@@ -20,10 +20,9 @@ import Divider from "@mui/material/Divider";
import MenuItem from "@mui/material/MenuItem";
import MenuList from "@mui/material/MenuList";
import Typography from "@mui/material/Typography";
+import { GlobalContext } from "@renderer/components/GlobalContext";
import React, { useContext } from "react";
import { useTranslation } from "react-i18next";
-import { GlobalContext } from "@renderer/components/GlobalContext";
-
import { loadLayout } from "./LoadLayout";
export const LibraryImport = (props) => {
diff --git a/src/renderer/screens/Editor/Sidebar/LayoutSharing/LoadLayout.js b/src/renderer/screens/Editor/Sidebar/LayoutSharing/LoadLayout.js
index e6e905fa5..7d4c60718 100644
--- a/src/renderer/screens/Editor/Sidebar/LayoutSharing/LoadLayout.js
+++ b/src/renderer/screens/Editor/Sidebar/LayoutSharing/LoadLayout.js
@@ -1,8 +1,7 @@
import KeymapDB from "@api/focus/keymap/db";
+import { toast } from "@renderer/components/Toast";
import logger from "@renderer/utils/Logger";
-
import { t } from "i18next";
-import { toast } from "@renderer/components/Toast";
const db = new KeymapDB();
diff --git a/src/renderer/screens/Editor/Sidebar/Modifiers.js b/src/renderer/screens/Editor/Sidebar/Modifiers.js
index ff77331a1..171e7c80d 100644
--- a/src/renderer/screens/Editor/Sidebar/Modifiers.js
+++ b/src/renderer/screens/Editor/Sidebar/Modifiers.js
@@ -25,6 +25,7 @@ import Switch from "@mui/material/Switch";
import React from "react";
import { useTranslation } from "react-i18next";
import FKPCategorySelector from "../components/FKPCategorySelector";
+
const db = new KeymapDB();
const Modifiers = (props) => {
diff --git a/src/renderer/screens/Editor/Sidebar/MouseWarpKeys.js b/src/renderer/screens/Editor/Sidebar/MouseWarpKeys.js
index 4683837a9..e64ad127a 100644
--- a/src/renderer/screens/Editor/Sidebar/MouseWarpKeys.js
+++ b/src/renderer/screens/Editor/Sidebar/MouseWarpKeys.js
@@ -1,10 +1,11 @@
-import React, { useState } from "react";
-import usePluginEffect from "@renderer/hooks/usePluginEffect";
-import KeyButton from "../components/KeyButton";
import KeymapDB from "@api/focus/keymap/db";
+import { constants } from "@api/focus/keymap/db/constants";
import Grid from "@mui/material/Grid";
+import usePluginEffect from "@renderer/hooks/usePluginEffect";
+import React, { useState } from "react";
import FKPCategorySelector from "../components/FKPCategorySelector";
-import { constants } from "@api/focus/keymap/db/constants";
+import KeyButton from "../components/KeyButton";
+
export const MouseWarpKeys = (props) => {
const [gridSize, setGridSize] = useState(undefined);
const db = new KeymapDB();
diff --git a/src/renderer/screens/Editor/Sidebar/Overview.js b/src/renderer/screens/Editor/Sidebar/Overview.js
index 6d19956b1..e4b46169c 100644
--- a/src/renderer/screens/Editor/Sidebar/Overview.js
+++ b/src/renderer/screens/Editor/Sidebar/Overview.js
@@ -17,8 +17,12 @@
import KeymapDB from "@api/focus/keymap/db";
import CropSquareIcon from "@mui/icons-material/CropSquare";
+import MenuIcon from "@mui/icons-material/Menu";
+import { IconButton } from "@mui/material";
import Avatar from "@mui/material/Avatar";
import Box from "@mui/material/Box";
+import Menu from "@mui/material/Menu";
+import MenuItem from "@mui/material/MenuItem";
import Paper from "@mui/material/Paper";
import Table from "@mui/material/Table";
import TableBody from "@mui/material/TableBody";
@@ -28,19 +32,11 @@ import TableHead from "@mui/material/TableHead";
import TableRow from "@mui/material/TableRow";
import Tooltip from "@mui/material/Tooltip";
import Typography from "@mui/material/Typography";
+import React, { useEffect, useState } from "react";
+import Draggable from "react-draggable";
import { useTranslation } from "react-i18next";
import { LayerNameInput } from "./LayerNameInput";
-import Card from "@mui/material/Card";
-import Draggable from "react-draggable";
-import CardContent from "@mui/material/CardContent";
-import React, { useState, useEffect } from "react";
-import { Icon, IconButton } from "@mui/material";
-import ContentCopyIcon from "@mui/icons-material/ContentCopy";
-import ContentPasteIcon from "@mui/icons-material/ContentPaste";
-import Menu from "@mui/material/Menu";
-import MenuItem from "@mui/material/MenuItem";
-import MenuIcon from "@mui/icons-material/Menu";
-import { Resizable } from "re-resizable";
+
const Overview = (props) => {
const { t } = useTranslation();
diff --git a/src/renderer/screens/Editor/Sidebar/SecondaryFunction.js b/src/renderer/screens/Editor/Sidebar/SecondaryFunction.js
index 0360a5f7d..501d3b980 100644
--- a/src/renderer/screens/Editor/Sidebar/SecondaryFunction.js
+++ b/src/renderer/screens/Editor/Sidebar/SecondaryFunction.js
@@ -16,18 +16,17 @@
*/
import KeymapDB from "@api/focus/keymap/db";
-import { GuiLabel } from "@api/focus/keymap/db/gui";
import { addDualUseLayer, addDualUseModifier } from "@api/focus/keymap/db/base";
+import { GuiLabel } from "@api/focus/keymap/db/gui";
import FormControl from "@mui/material/FormControl";
import FormGroup from "@mui/material/FormGroup";
import InputLabel from "@mui/material/InputLabel";
import MenuItem from "@mui/material/MenuItem";
import Select from "@mui/material/Select";
+import Tooltip from "@mui/material/Tooltip";
import React from "react";
import { useTranslation } from "react-i18next";
import FKPCategorySelector from "../components/FKPCategorySelector";
-import { Typography } from "@mui/material";
-import Tooltip from "@mui/material/Tooltip";
const db = new KeymapDB();
const SecondaryFunction = (props) => {
diff --git a/src/renderer/screens/Editor/Sidebar/SpecialModifiers.js b/src/renderer/screens/Editor/Sidebar/SpecialModifiers.js
index 371a3f7c5..b4fba53c0 100644
--- a/src/renderer/screens/Editor/Sidebar/SpecialModifiers.js
+++ b/src/renderer/screens/Editor/Sidebar/SpecialModifiers.js
@@ -1,3 +1,4 @@
+import KeymapDB from "@api/focus/keymap/db";
import { addModifier, removeModifier } from "@api/focus/keymap/db/modifiers";
import FormControl from "@mui/material/FormControl";
import FormControlLabel from "@mui/material/FormControlLabel";
@@ -8,7 +9,6 @@ import usePluginAvailable from "@renderer/hooks/usePluginVisibility";
import React from "react";
import { useTranslation } from "react-i18next";
import FKPCategorySelector from "../components/FKPCategorySelector";
-import KeymapDB from "@api/focus/keymap/db";
const db = new KeymapDB();
diff --git a/src/renderer/screens/Editor/components/FKPCategorySelector.js b/src/renderer/screens/Editor/components/FKPCategorySelector.js
index 199991f7e..7ff582b2c 100644
--- a/src/renderer/screens/Editor/components/FKPCategorySelector.js
+++ b/src/renderer/screens/Editor/components/FKPCategorySelector.js
@@ -16,13 +16,14 @@
*/
import KeymapDB from "@api/focus/keymap/db";
-import { SectionTitle } from "@renderer/components/SectionTitle";
-import React from "react";
-import KeyButtonList from "../components/KeyButtonList";
import FormHelperText from "@mui/material/FormHelperText";
import Tooltip from "@mui/material/Tooltip";
-import { useTranslation } from "react-i18next";
+import { SectionTitle } from "@renderer/components/SectionTitle";
import usePluginAvailable from "@renderer/hooks/usePluginVisibility";
+import React from "react";
+import { useTranslation } from "react-i18next";
+import KeyButtonList from "../components/KeyButtonList";
+
const db = new KeymapDB();
const FKPCategorySelector = (props) => {
diff --git a/src/renderer/screens/Editor/components/KeyButton.js b/src/renderer/screens/Editor/components/KeyButton.js
index bb0d6b429..fb1a85c46 100644
--- a/src/renderer/screens/Editor/components/KeyButton.js
+++ b/src/renderer/screens/Editor/components/KeyButton.js
@@ -18,8 +18,8 @@
import KeymapDB from "@api/focus/keymap/db";
import Button from "@mui/material/Button";
import Tooltip from "@mui/material/Tooltip";
-import React from "react";
import useTheme from "@mui/material/styles/useTheme";
+import React from "react";
const db = new KeymapDB();
diff --git a/src/renderer/screens/Editor/components/KeyPicker.js b/src/renderer/screens/Editor/components/KeyPicker.js
index b171e4420..f8cd0ffd2 100644
--- a/src/renderer/screens/Editor/components/KeyPicker.js
+++ b/src/renderer/screens/Editor/components/KeyPicker.js
@@ -15,31 +15,32 @@
* along with this program. If not, see .
*/
+import KeymapDB from "@api/focus/keymap/db";
+import { constants } from "@api/focus/keymap/db/constants";
+import TabContext from "@mui/lab/TabContext";
+import TabList from "@mui/lab/TabList";
+import TabPanel from "@mui/lab/TabPanel";
import Box from "@mui/material/Box";
import Grid from "@mui/material/Grid";
-import TabContext from "@mui/lab/TabContext";
import Stack from "@mui/material/Stack";
import Tab from "@mui/material/Tab";
-import TabList from "@mui/lab/TabList";
-import TabPanel from "@mui/lab/TabPanel";
import TextField from "@mui/material/TextField";
+import usePluginAvailable from "@renderer/hooks/usePluginVisibility";
import { useWindowSize } from "@renderer/hooks/useWindowSize";
-import React, { useState, useEffect } from "react";
+import React, { useEffect, useState } from "react";
+import { useTranslation } from "react-i18next";
import Keyboard104 from "../Keyboard104";
-import { MouseWarpKeys } from "../Sidebar/MouseWarpKeys";
-import DynamicMacroKeys from "../Sidebar/DynamicMacroKeys";
-import usePluginAvailable from "@renderer/hooks/usePluginVisibility";
-import KeymapDB from "@api/focus/keymap/db";
-import KeyButton from "../components/KeyButton";
-import VerticalSectionDivider from "./VerticalSectionDivider";
import Colormap from "../Sidebar/Colormap";
+import DynamicMacroKeys from "../Sidebar/DynamicMacroKeys";
import LayerKeys from "../Sidebar/LayerKeys";
-import SecondaryFunction from "../Sidebar/SecondaryFunction";
import Modifiers from "../Sidebar/Modifiers";
+import { MouseWarpKeys } from "../Sidebar/MouseWarpKeys";
+import SecondaryFunction from "../Sidebar/SecondaryFunction";
import SpecialModifiers from "../Sidebar/SpecialModifiers";
import FKPCategorySelector from "../components/FKPCategorySelector";
-import { useTranslation } from "react-i18next";
-import { constants } from "@api/focus/keymap/db/constants";
+import KeyButton from "../components/KeyButton";
+import VerticalSectionDivider from "./VerticalSectionDivider";
+
const fkp_channel = new BroadcastChannel("floating-key-picker");
export const KeyPicker = (props) => {
diff --git a/src/renderer/screens/Editor/components/LayerNamesStorageAlert.js b/src/renderer/screens/Editor/components/LayerNamesStorageAlert.js
index 817c03f7a..35db34b18 100644
--- a/src/renderer/screens/Editor/components/LayerNamesStorageAlert.js
+++ b/src/renderer/screens/Editor/components/LayerNamesStorageAlert.js
@@ -15,15 +15,13 @@
* along with this program. If not, see .
*/
-import Alert from "@mui/material/Alert";
-import Button from "@mui/material/Button";
+import LayerNames from "@api/focus/layernames";
import DiscFullIcon from "@mui/icons-material/DiscFull";
+import Alert from "@mui/material/Alert";
import Typography from "@mui/material/Typography";
import React from "react";
import { useTranslation } from "react-i18next";
-import LayerNames from "@api/focus/layernames";
-
export const LayerNamesStorageAlert = (props) => {
const { t } = useTranslation();
diff --git a/src/renderer/screens/Editor/components/MacroStorageAlert.js b/src/renderer/screens/Editor/components/MacroStorageAlert.js
index 95b37eb33..a008a36a6 100644
--- a/src/renderer/screens/Editor/components/MacroStorageAlert.js
+++ b/src/renderer/screens/Editor/components/MacroStorageAlert.js
@@ -15,15 +15,13 @@
* along with this program. If not, see .
*/
-import Alert from "@mui/material/Alert";
-import Button from "@mui/material/Button";
+import Macros from "@api/focus/macros";
import DiscFullIcon from "@mui/icons-material/DiscFull";
+import Alert from "@mui/material/Alert";
import Typography from "@mui/material/Typography";
import React from "react";
import { useTranslation } from "react-i18next";
-import Macros from "@api/focus/macros";
-
export const MacroStorageAlert = (props) => {
const { t } = useTranslation();
diff --git a/src/renderer/screens/Editor/components/VerticalSectionDivider.js b/src/renderer/screens/Editor/components/VerticalSectionDivider.js
index 75a4e0d94..586196f78 100644
--- a/src/renderer/screens/Editor/components/VerticalSectionDivider.js
+++ b/src/renderer/screens/Editor/components/VerticalSectionDivider.js
@@ -1,5 +1,6 @@
import Divider from "@mui/material/Divider";
import React from "react";
+
const VerticalSectionDivider = () => {
return ;
};
diff --git a/src/renderer/screens/FirmwareUpdate.js b/src/renderer/screens/FirmwareUpdate.js
index 31db7024f..81bfcf8ac 100644
--- a/src/renderer/screens/FirmwareUpdate.js
+++ b/src/renderer/screens/FirmwareUpdate.js
@@ -17,7 +17,6 @@
import { RebootMessage } from "@api/flash";
import Focus from "@api/focus";
-
import CheckIcon from "@mui/icons-material/Check";
import CloudUploadIcon from "@mui/icons-material/CloudUpload";
import Alert from "@mui/material/Alert";
@@ -33,10 +32,12 @@ import ConfirmationDialog from "@renderer/components/ConfirmationDialog";
import { GlobalContext } from "@renderer/components/GlobalContext";
import { PageTitle } from "@renderer/components/PageTitle";
import { toast } from "@renderer/components/Toast";
+import logger from "@renderer/utils/Logger";
import React, { useContext, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
-import { connectToSerialport } from "../utils/connectToSerialport";
import { connectToDfuUsbPort } from "../utils/connectToDfuUsbPort";
+import { connectToSerialport } from "../utils/connectToSerialport";
+import exportKeyboardConfigToFile from "../utils/exportKeyboardConfigToFile";
import BootloaderWarning from "./FirmwareUpdate/BootloaderWarning";
import FirmwareSelect from "./FirmwareUpdate/FirmwareSelect";
import FirmwareUpdateWarning from "./FirmwareUpdate/FirmwareUpdateWarning";
@@ -44,8 +45,6 @@ import FirmwareVersion from "./FirmwareUpdate/FirmwareVersion";
import { FlashNotification } from "./FirmwareUpdate/FlashNotification";
import FlashSteps from "./FirmwareUpdate/FlashSteps";
import UpdateDescription from "./FirmwareUpdate/UpdateDescription";
-import logger from "@renderer/utils/Logger";
-import exportKeyboardConfigToFile from "../utils/exportKeyboardConfigToFile";
const delay = (ms) => new Promise((res) => setTimeout(res, ms));
diff --git a/src/renderer/screens/ImportExport.js b/src/renderer/screens/ImportExport.js
index 96277bae9..df01dc13f 100644
--- a/src/renderer/screens/ImportExport.js
+++ b/src/renderer/screens/ImportExport.js
@@ -17,10 +17,7 @@
import Keymap from "@api/focus/keymap";
import KeymapDB from "@api/focus/keymap/db";
-import Macros, { Step as MacroStep } from "@api/focus/macros";
import LayerNames from "@api/focus/layernames";
-import Button from "@mui/material/Button";
-
import Box from "@mui/material/Box";
import { hideContextBar, showContextBar } from "@renderer/components/ContextBar";
import { GlobalContext } from "@renderer/components/GlobalContext";
@@ -29,15 +26,11 @@ import { PageTitle } from "@renderer/components/PageTitle";
import SaveChangesButton from "@renderer/components/SaveChangesButton";
import { toast } from "@renderer/components/Toast";
import useEffectOnce from "@renderer/hooks/useEffectOnce";
+import logger from "@renderer/utils/Logger";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
-import { KeyPicker } from "./Editor/components/KeyPicker";
-import { LayerNamesStorageAlert } from "./Editor/components/LayerNamesStorageAlert";
-import OnlyCustomScreen from "./Editor/components/OnlyCustomScreen";
-import Overview from "./Editor/Sidebar/Overview";
-
import LayoutSharing from "./Editor/Sidebar/LayoutSharing";
-import logger from "@renderer/utils/Logger";
+import Overview from "./Editor/Sidebar/Overview";
const db = new KeymapDB();
diff --git a/src/renderer/screens/KeyboardSelect.js b/src/renderer/screens/KeyboardSelect.js
index 1b26e98e6..d192dc307 100644
--- a/src/renderer/screens/KeyboardSelect.js
+++ b/src/renderer/screens/KeyboardSelect.js
@@ -16,26 +16,25 @@
*/
import Focus from "@api/focus";
-import logger from "@renderer/utils/Logger";
-
import Box from "@mui/material/Box";
import Card from "@mui/material/Card";
import CardActions from "@mui/material/CardActions";
import CardContent from "@mui/material/CardContent";
import Grid from "@mui/material/Grid";
import LinearProgress from "@mui/material/LinearProgress";
+import { Firmware0_90_1 } from "@renderer/breaking-news";
import { GlobalContext } from "@renderer/components/GlobalContext";
import { PageTitle } from "@renderer/components/PageTitle";
import { toast } from "@renderer/components/Toast";
+import { WebSerialCheck } from "@renderer/components/WebSerialCheck";
import logo from "@renderer/logo-small.png";
+import logger from "@renderer/utils/Logger";
import { connectToSerialport } from "@renderer/utils/connectToSerialport";
-import React, { useEffect, useState } from "react";
+import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { ConnectionButton } from "./KeyboardSelect/ConnectionButton";
import { DeviceImage } from "./KeyboardSelect/DeviceImage";
import { ProductStatus } from "./KeyboardSelect/ProductStatus";
-import { Firmware0_90_1 } from "@renderer/breaking-news";
-import { WebSerialCheck } from "@renderer/components/WebSerialCheck";
const KeyboardSelect = (props) => {
const [opening, setOpening] = useState(false);
diff --git a/src/renderer/screens/LayoutCard.js b/src/renderer/screens/LayoutCard.js
index a8103d6f4..746fd5ca8 100644
--- a/src/renderer/screens/LayoutCard.js
+++ b/src/renderer/screens/LayoutCard.js
@@ -16,20 +16,20 @@
*/
import KeymapDB from "@api/focus/keymap/db";
-import Box from "@mui/material/Box";
-import Typography from "@mui/material/Typography";
import PrintIcon from "@mui/icons-material/Print";
+import Box from "@mui/material/Box";
import Fab from "@mui/material/Fab";
import Tooltip from "@mui/material/Tooltip";
+import Typography from "@mui/material/Typography";
import { GlobalContext } from "@renderer/components/GlobalContext";
import LoadingScreen from "@renderer/components/LoadingScreen";
import { PageTitle } from "@renderer/components/PageTitle";
import { toast } from "@renderer/components/Toast";
import useEffectOnce from "@renderer/hooks/useEffectOnce";
-import React, { useState, useEffect, useContext } from "react";
-import { useTranslation } from "react-i18next";
import { Store } from "@renderer/localStore";
import logger from "@renderer/utils/Logger";
+import React, { useContext, useEffect, useState } from "react";
+import { useTranslation } from "react-i18next";
const settings = new Store();
diff --git a/src/renderer/screens/Preferences.js b/src/renderer/screens/Preferences.js
index a0c22858c..aa717f0d3 100644
--- a/src/renderer/screens/Preferences.js
+++ b/src/renderer/screens/Preferences.js
@@ -22,9 +22,9 @@ import { GlobalContext } from "@renderer/components/GlobalContext";
import { PageTitle } from "@renderer/components/PageTitle";
import React, { useContext } from "react";
import { useTranslation } from "react-i18next";
-import { UserInterfacePreferences } from "./Preferences/UserInterface";
import { DevtoolsPreferences } from "./Preferences/Devtools";
import { MyKeyboardPreferences } from "./Preferences/MyKeyboard";
+import { UserInterfacePreferences } from "./Preferences/UserInterface";
function TabPanel(props) {
const { children, value, index, ...other } = props;
diff --git a/src/renderer/screens/SystemInfo.js b/src/renderer/screens/SystemInfo.js
index 505c2720d..03d0abfe8 100644
--- a/src/renderer/screens/SystemInfo.js
+++ b/src/renderer/screens/SystemInfo.js
@@ -32,10 +32,9 @@ import TextField from "@mui/material/TextField";
import Typography from "@mui/material/Typography";
import { GlobalContext } from "@renderer/components/GlobalContext";
import { PageTitle } from "@renderer/components/PageTitle";
-import { toast } from "@renderer/components/Toast";
import logo from "@renderer/logo-small.png";
-import pkg from "@root/package.json";
import logger from "@renderer/utils/Logger";
+import pkg from "@root/package.json";
// TODO: ipcRenderer is an Electron-specific module. There is no direct browser equivalent.
// Consider alternative solutions for IPC in a browser environment.
// import { ipcRenderer } from "electron";
diff --git a/src/renderer/utils/connectToDfuUsbPort.js b/src/renderer/utils/connectToDfuUsbPort.js
index 1173485b5..b77149d05 100644
--- a/src/renderer/utils/connectToDfuUsbPort.js
+++ b/src/renderer/utils/connectToDfuUsbPort.js
@@ -1,4 +1,4 @@
-import { Hardware, getDfuDevices } from "@api/hardware";
+import { getDfuDevices } from "@api/hardware";
import logger from "@renderer/utils/Logger";
const connectToDfuUsbPort = async () => {