1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Adding what-input dependency

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2020-11-10 10:36:17 +03:00
parent b4b3eafefd
commit 79f9971ab9
5 changed files with 10 additions and 13 deletions

View File

@ -381,6 +381,7 @@
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11",
"webpack-node-externals": "^1.7.2",
"what-input": "^5.2.10",
"xterm": "^4.6.0",
"xterm-addon-fit": "^0.4.0"
}

View File

@ -38,7 +38,8 @@ import { webFrame } from "electron";
import { clusterPageRegistry } from "../../extensions/registries/page-registry";
import { DynamicPage } from "../../extensions/dynamic-page";
import { extensionLoader } from "../../extensions/extension-loader";
import { appEventBus } from "../../common/event-bus"
import { appEventBus } from "../../common/event-bus";
import whatInput from 'what-input';
@observer
export class App extends React.Component {
@ -57,6 +58,7 @@ export class App extends React.Component {
window.addEventListener("online", () => {
window.location.reload()
})
whatInput.ask() // Start to monitor user input device
}
get startURL() {

View File

@ -119,7 +119,7 @@
&.focusable:focus:not(:hover) {
box-shadow: 0 0 0 2px var(--focus-color);
.mouse-intent & {
[data-whatintent='mouse'] & {
box-shadow: none;
&.active {

View File

@ -38,17 +38,6 @@ export class MainLayout extends React.Component<MainLayoutProps> {
(sidebarWidth) => this.storage.merge({ sidebarWidth })
);
componentDidMount() {
// Toggling .mouse-intent class if mouse or keyboard using in the dashboard
// This allows to remove focus styling to elements when mouse is used
window.addEventListener("click", (evt) => {
if (!evt.detail) return; // No mouse used (e.g. hitted spacebar on button)
document.body.classList.add("mouse-intent");
})
window.addEventListener("keydown", (evt) => {
document.body.classList.remove("mouse-intent");
})
}
toggleSidebar = () => {
this.isPinned = !this.isPinned;

View File

@ -13760,6 +13760,11 @@ wgxpath@~1.0.0:
resolved "https://registry.yarnpkg.com/wgxpath/-/wgxpath-1.0.0.tgz#eef8a4b9d558cc495ad3a9a2b751597ecd9af690"
integrity sha1-7vikudVYzEla06mit1FZfs2a9pA=
what-input@^5.2.10:
version "5.2.10"
resolved "https://registry.yarnpkg.com/what-input/-/what-input-5.2.10.tgz#f79f5b65cf95d75e55e6d580bb0a6b98174cad4e"
integrity sha512-7AQoIMGq7uU8esmKniOtZG3A+pzlwgeyFpkS3f/yzRbxknSL68tvn5gjE6bZ4OMFxCPjpaBd2udUTqlZ0HwrXQ==
whatwg-encoding@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0"