diff --git a/package.json b/package.json index 9532a6cdf9..fdedc38db9 100644 --- a/package.json +++ b/package.json @@ -281,7 +281,6 @@ "@types/electron-window-state": "^2.0.34", "@types/fs-extra": "^9.0.1", "@types/hapi": "^18.0.3", - "@types/hard-source-webpack-plugin": "^1.0.1", "@types/hoist-non-react-statics": "^3.3.1", "@types/html-webpack-plugin": "^3.2.3", "@types/http-proxy": "^1.17.4", @@ -343,7 +342,6 @@ "file-loader": "^6.0.0", "flex.box": "^3.4.4", "fork-ts-checker-webpack-plugin": "^5.0.0", - "hard-source-webpack-plugin": "^0.13.1", "hoist-non-react-statics": "^3.3.2", "html-webpack-plugin": "^4.3.0", "identity-obj-proxy": "^3.0.0", @@ -382,9 +380,9 @@ "ts-jest": "^26.1.0", "ts-loader": "^7.0.5", "ts-node": "^8.10.2", + "type-fest": "^0.18.0", "typedoc": "0.17.0-3", "typedoc-plugin-markdown": "^3.0.11", - "type-fest": "^0.18.0", "typeface-roboto": "^0.0.75", "typescript": "^4.0.2", "url-loader": "^4.1.0", @@ -392,6 +390,7 @@ "webpack-cli": "^3.3.11", "webpack-dev-server": "^3.11.0", "webpack-node-externals": "^1.7.2", + "what-input": "^5.2.10", "xterm": "^4.6.0", "xterm-addon-fit": "^0.4.0" } diff --git a/src/extensions/core-api/index.ts b/src/extensions/core-api/index.ts index 3882763681..1a2c59759a 100644 --- a/src/extensions/core-api/index.ts +++ b/src/extensions/core-api/index.ts @@ -9,7 +9,6 @@ import * as App from "./app" import * as EventBus from "./event-bus" import * as Store from "./stores" import * as Util from "./utils" -import * as Registry from "../registries" import * as ClusterFeature from "./cluster-feature" // TODO: allow to expose windowManager.navigate() as Navigation.navigate() in runtime @@ -21,5 +20,4 @@ export { ClusterFeature, Store, Util, - Registry, } diff --git a/src/renderer/components/app.tsx b/src/renderer/components/app.tsx index 5ad908a528..a5ebe554d1 100755 --- a/src/renderer/components/app.tsx +++ b/src/renderer/components/app.tsx @@ -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() { diff --git a/src/renderer/components/drawer/drawer.scss b/src/renderer/components/drawer/drawer.scss index 72a2f10eb1..488a890f2c 100644 --- a/src/renderer/components/drawer/drawer.scss +++ b/src/renderer/components/drawer/drawer.scss @@ -3,6 +3,7 @@ --size: 50%; --full-size: 75%; --spacing: #{$padding * 3}; + --icon-focus-color: white; position: absolute; background: $contentColor; diff --git a/src/renderer/components/icon/icon.scss b/src/renderer/components/icon/icon.scss index 253423bd4c..e581ccbbdc 100644 --- a/src/renderer/components/icon/icon.scss +++ b/src/renderer/components/icon/icon.scss @@ -5,6 +5,7 @@ --big-size: 32px; --color-active: #{$iconActiveColor}; --bgc-active: #{$iconActiveBackground}; + --focus-color: var(--icon-focus-color, #{$lensBlue}); display: inline-flex; flex-shrink: 0; @@ -106,7 +107,7 @@ &.active { color: var(--color-active); - box-shadow: 0 0 0 3px $iconActiveBackground; + box-shadow: 0 0 0 2px $iconActiveBackground; background-color: $iconActiveBackground; } @@ -115,8 +116,16 @@ transition: 250ms color, 250ms opacity, 150ms background-color, 150ms box-shadow; border-radius: 50%; - &.focusable:focus { - @extend .active; + &.focusable:focus:not(:hover) { + box-shadow: 0 0 0 2px var(--focus-color); + + [data-whatintent='mouse'] & { + box-shadow: none; + + &.active { + box-shadow: 0 0 0 2px $iconActiveBackground; + } + } } &:hover { diff --git a/src/renderer/components/kube-object/kube-object-menu.tsx b/src/renderer/components/kube-object/kube-object-menu.tsx index fa008f1bac..0333bf6f9c 100644 --- a/src/renderer/components/kube-object/kube-object-menu.tsx +++ b/src/renderer/components/kube-object/kube-object-menu.tsx @@ -57,11 +57,11 @@ export class KubeObjectMenu extends React.Component { render() { const { remove, update, renderRemoveMessage, isEditable, isRemovable } = this; - const { className, object, editable, removable, ...menuProps } = this.props; + const { className, object, editable, removable, toolbar, ...menuProps } = this.props; if (!object) return null; const menuItems = kubeObjectMenuRegistry.getItemsForKind(object.kind, object.apiVersion).map((item, index) => { - return + return }) return ( { updateAction={isEditable ? update : undefined} removeAction={isRemovable ? remove : undefined} removeConfirmationMessage={renderRemoveMessage} + toolbar={toolbar} {...menuProps} > {menuItems} diff --git a/src/renderer/components/layout/main-layout.tsx b/src/renderer/components/layout/main-layout.tsx index 67c6c08bce..e66fed3d17 100755 --- a/src/renderer/components/layout/main-layout.tsx +++ b/src/renderer/components/layout/main-layout.tsx @@ -38,6 +38,7 @@ export class MainLayout extends React.Component { (sidebarWidth) => this.storage.merge({ sidebarWidth }) ); + toggleSidebar = () => { this.isPinned = !this.isPinned; this.isAccessible = false; diff --git a/webpack.main.ts b/webpack.main.ts index 29e724d711..c388466cdc 100755 --- a/webpack.main.ts +++ b/webpack.main.ts @@ -4,7 +4,6 @@ import ForkTsCheckerPlugin from "fork-ts-checker-webpack-plugin" import { isDevelopment, isProduction, mainDir, buildDir } from "./src/common/vars"; import nodeExternals from "webpack-node-externals"; import ProgressBarPlugin from "progress-bar-webpack-plugin"; -import HardSourceWebpackPlugin from 'hard-source-webpack-plugin'; export default function (): webpack.Configuration { console.info('WEBPACK:main', require("./src/common/vars")) @@ -48,7 +47,6 @@ export default function (): webpack.Configuration { plugins: [ new ProgressBarPlugin(), new ForkTsCheckerPlugin(), - isDevelopment && new HardSourceWebpackPlugin(), ].filter(Boolean) } } diff --git a/webpack.renderer.ts b/webpack.renderer.ts index 27fe6eb039..ea2b5f622c 100755 --- a/webpack.renderer.ts +++ b/webpack.renderer.ts @@ -6,7 +6,6 @@ import MiniCssExtractPlugin from "mini-css-extract-plugin"; import TerserPlugin from "terser-webpack-plugin"; import ForkTsCheckerPlugin from "fork-ts-checker-webpack-plugin" import ProgressBarPlugin from "progress-bar-webpack-plugin"; -import HardSourceWebpackPlugin from 'hard-source-webpack-plugin'; import ReactRefreshWebpackPlugin from '@pmmmwh/react-refresh-webpack-plugin' export default [ @@ -187,7 +186,6 @@ export function webpackLensRenderer({ showVars = true } = {}): webpack.Configura filename: "[name].css", }), - isDevelopment && new HardSourceWebpackPlugin(), isDevelopment && new webpack.HotModuleReplacementPlugin(), isDevelopment && new ReactRefreshWebpackPlugin(), diff --git a/yarn.lock b/yarn.lock index 1984232342..efaadd49c6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1967,13 +1967,6 @@ "@types/podium" "*" "@types/shot" "*" -"@types/hard-source-webpack-plugin@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@types/hard-source-webpack-plugin/-/hard-source-webpack-plugin-1.0.1.tgz#4aecca35bafb7939bcf318bbf5a2710c3163cdd4" - integrity sha512-5eTPERZQj5RZLADk5o2Ip/XRLwgxOUeKzlIM3+czrhwA9pnVJAUYOm2fovbxkrIEQhuozQwc17fyH1ZXnSR/8g== - dependencies: - "@types/webpack" "*" - "@types/history@*", "@types/history@^4.7.3": version "4.7.6" resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.6.tgz#ed8fc802c45b8e8f54419c2d054e55c9ea344356" @@ -5211,7 +5204,7 @@ detect-file@^1.0.0: resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" integrity sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc= -detect-indent@^5.0.0, detect-indent@~5.0.0: +detect-indent@~5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" integrity sha1-OHHMCmoALow+Wzz38zYmRnXwa50= @@ -6366,7 +6359,7 @@ finalhandler@~1.1.2: statuses "~1.5.0" unpipe "~1.0.0" -find-cache-dir@^2.0.0, find-cache-dir@^2.1.0: +find-cache-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" integrity sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ== @@ -7042,25 +7035,6 @@ har-validator@~5.1.3: ajv "^6.5.5" har-schema "^2.0.0" -hard-source-webpack-plugin@^0.13.1: - version "0.13.1" - resolved "https://registry.yarnpkg.com/hard-source-webpack-plugin/-/hard-source-webpack-plugin-0.13.1.tgz#a99071e25b232f1438a5bc3c99f10a3869e4428e" - integrity sha512-r9zf5Wq7IqJHdVAQsZ4OP+dcUSvoHqDMxJlIzaE2J0TZWn3UjMMrHqwDHR8Jr/pzPfG7XxSe36E7Y8QGNdtuAw== - dependencies: - chalk "^2.4.1" - find-cache-dir "^2.0.0" - graceful-fs "^4.1.11" - lodash "^4.15.0" - mkdirp "^0.5.1" - node-object-hash "^1.2.0" - parse-json "^4.0.0" - pkg-dir "^3.0.0" - rimraf "^2.6.2" - semver "^5.6.0" - tapable "^1.0.0-beta.5" - webpack-sources "^1.0.1" - write-json-file "^2.3.0" - harmony-reflect@^1.4.6: version "1.6.1" resolved "https://registry.yarnpkg.com/harmony-reflect/-/harmony-reflect-1.6.1.tgz#c108d4f2bb451efef7a37861fdbdae72c9bdefa9" @@ -9334,7 +9308,7 @@ lodash@^4.0.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.1 resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== -lodash@^4.15.0, lodash@^4.17.19: +lodash@^4.17.19: version "4.17.20" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== @@ -10177,11 +10151,6 @@ node-notifier@^7.0.0: uuid "^7.0.3" which "^2.0.2" -node-object-hash@^1.2.0: - version "1.4.2" - resolved "https://registry.yarnpkg.com/node-object-hash/-/node-object-hash-1.4.2.tgz#385833d85b229902b75826224f6077be969a9e94" - integrity sha512-UdS4swXs85fCGWWf6t6DMGgpN/vnlKeSGEQ7hJcrs7PBFoxoKLmibc3QRb7fwiYsjdL7PX8iI/TMSlZ90dgHhQ== - node-pty@^0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/node-pty/-/node-pty-0.9.0.tgz#8f9bcc0d1c5b970a3184ffd533d862c7eb6590a6" @@ -13700,7 +13669,7 @@ table@^5.2.3: slice-ansi "^2.1.0" string-width "^3.0.0" -tapable@^1.0.0, tapable@^1.0.0-beta.5, tapable@^1.1.3: +tapable@^1.0.0, tapable@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== @@ -14808,7 +14777,7 @@ webpack-node-externals@^1.7.2: resolved "https://registry.yarnpkg.com/webpack-node-externals/-/webpack-node-externals-1.7.2.tgz#6e1ee79ac67c070402ba700ef033a9b8d52ac4e3" integrity sha512-ajerHZ+BJKeCLviLUUmnyd5B4RavLF76uv3cs6KNuO8W+HuQaEs0y0L7o40NQxdPy5w0pcv8Ew7yPUAQG0UdCg== -webpack-sources@^1.0.1, webpack-sources@^1.1.0, webpack-sources@^1.4.0, webpack-sources@^1.4.1, webpack-sources@^1.4.3: +webpack-sources@^1.1.0, webpack-sources@^1.4.0, webpack-sources@^1.4.1, webpack-sources@^1.4.3: version "1.4.3" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.3.tgz#eedd8ec0b928fbf1cbfe994e22d2d890f330a933" integrity sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ== @@ -14871,6 +14840,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" @@ -15050,18 +15024,6 @@ write-file-atomic@^3.0.0, write-file-atomic@^3.0.3: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" -write-json-file@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/write-json-file/-/write-json-file-2.3.0.tgz#2b64c8a33004d54b8698c76d585a77ceb61da32f" - integrity sha1-K2TIozAE1UuGmMdtWFp3zrYdoy8= - dependencies: - detect-indent "^5.0.0" - graceful-fs "^4.1.2" - make-dir "^1.0.0" - pify "^3.0.0" - sort-keys "^2.0.0" - write-file-atomic "^2.0.0" - write@1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3"