@k8slens/extensions 5.3.1-git.44f1f38a75.0 → 5.3.1-git.4f33dfdfd5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,6 +33,6 @@ export declare class ApiManager {
33
33
  unregisterApi(api: string | KubeApi<KubeObject>): void;
34
34
  registerStore(store: KubeObjectStore<KubeObject>, apis?: KubeApi<KubeObject>[]): void;
35
35
  getStore<S extends KubeObjectStore<KubeObject>>(api: string | KubeApi<KubeObject>): S | undefined;
36
- lookupApiLink(ref: IKubeObjectRef, parentObject: KubeObject): string;
36
+ lookupApiLink(ref: IKubeObjectRef, parentObject?: KubeObject): string;
37
37
  }
38
38
  export declare const apiManager: ApiManager;
@@ -40058,7 +40058,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
40058
40058
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
40059
40059
 
40060
40060
  "use strict";
40061
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ApiManager\", function() { return ApiManager; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"apiManager\", function() { return apiManager; });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ \"./src/common/utils/index.ts\");\n/* harmony import */ var _kube_api_parse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./kube-api-parse */ \"./src/common/k8s-api/kube-api-parse.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n\n\n\nclass ApiManager {\n constructor() {\n Object.defineProperty(this, \"apis\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].map()\n });\n Object.defineProperty(this, \"stores\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].map()\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"makeObservable\"])(this);\n Object(_utils__WEBPACK_IMPORTED_MODULE_1__[\"autoBind\"])(this);\n }\n getApi(pathOrCallback) {\n if (typeof pathOrCallback === \"string\") {\n return this.apis.get(pathOrCallback) || this.apis.get(Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_2__[\"parseKubeApi\"])(pathOrCallback).apiBase);\n }\n return _utils__WEBPACK_IMPORTED_MODULE_1__[\"iter\"].find(this.apis.values(), pathOrCallback !== null && pathOrCallback !== void 0 ? pathOrCallback : (() => true));\n }\n getApiByKind(kind, apiVersion) {\n return _utils__WEBPACK_IMPORTED_MODULE_1__[\"iter\"].find(this.apis.values(), api => api.kind === kind && api.apiVersionWithGroup === apiVersion);\n }\n registerApi(apiBase, api) {\n if (!api.apiBase)\n return;\n if (!this.apis.has(apiBase)) {\n this.stores.forEach((store) => {\n if (store.api === api) {\n this.stores.set(apiBase, store);\n }\n });\n this.apis.set(apiBase, api);\n }\n }\n resolveApi(api) {\n if (!api) {\n return undefined;\n }\n if (typeof api === \"string\") {\n return this.getApi(api);\n }\n return api;\n }\n unregisterApi(api) {\n if (typeof api === \"string\")\n this.apis.delete(api);\n else {\n const apis = Array.from(this.apis.entries());\n const entry = apis.find(entry => entry[1] === api);\n if (entry)\n this.unregisterApi(entry[0]);\n }\n }\n registerStore(store, apis = [store.api]) {\n apis.filter(Boolean).forEach(api => {\n if (api.apiBase)\n this.stores.set(api.apiBase, store);\n });\n }\n getStore(api) {\n var _a;\n return this.stores.get((_a = this.resolveApi(api)) === null || _a === void 0 ? void 0 : _a.apiBase);\n }\n lookupApiLink(ref, parentObject) {\n const { kind, apiVersion, name, namespace = parentObject.getNs(), } = ref;\n if (!kind)\n return \"\";\n // search in registered apis by 'kind' & 'apiVersion'\n const api = this.getApi(api => api.kind === kind && api.apiVersionWithGroup == apiVersion);\n if (api) {\n return api.getUrl({ namespace, name });\n }\n // lookup api by generated resource link\n const apiPrefixes = [\"/apis\", \"/api\"];\n const resource = kind.endsWith(\"s\") ? `${kind.toLowerCase()}es` : `${kind.toLowerCase()}s`;\n for (const apiPrefix of apiPrefixes) {\n const apiLink = Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_2__[\"createKubeApiURL\"])({ apiPrefix, apiVersion, name, namespace, resource });\n if (this.getApi(apiLink)) {\n return apiLink;\n }\n }\n // resolve by kind only (hpa's might use refs to older versions of resources for example)\n const apiByKind = this.getApi(api => api.kind === kind);\n if (apiByKind) {\n return apiByKind.getUrl({ name, namespace });\n }\n // otherwise generate link with default prefix\n // resource still might exists in k8s, but api is not registered in the app\n return Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_2__[\"createKubeApiURL\"])({ apiVersion, name, namespace, resource });\n }\n}\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Function, Array]),\n __metadata(\"design:returntype\", void 0)\n], ApiManager.prototype, \"registerStore\", null);\nconst apiManager = new ApiManager();\n\n\n//# sourceURL=webpack:///./src/common/k8s-api/api-manager.ts?");
40061
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ApiManager\", function() { return ApiManager; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"apiManager\", function() { return apiManager; });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ \"./src/common/utils/index.ts\");\n/* harmony import */ var _kube_api_parse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./kube-api-parse */ \"./src/common/k8s-api/kube-api-parse.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n\n\n\nclass ApiManager {\n constructor() {\n Object.defineProperty(this, \"apis\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].map()\n });\n Object.defineProperty(this, \"stores\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].map()\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"makeObservable\"])(this);\n Object(_utils__WEBPACK_IMPORTED_MODULE_1__[\"autoBind\"])(this);\n }\n getApi(pathOrCallback) {\n if (typeof pathOrCallback === \"string\") {\n return this.apis.get(pathOrCallback) || this.apis.get(Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_2__[\"parseKubeApi\"])(pathOrCallback).apiBase);\n }\n return _utils__WEBPACK_IMPORTED_MODULE_1__[\"iter\"].find(this.apis.values(), pathOrCallback !== null && pathOrCallback !== void 0 ? pathOrCallback : (() => true));\n }\n getApiByKind(kind, apiVersion) {\n return _utils__WEBPACK_IMPORTED_MODULE_1__[\"iter\"].find(this.apis.values(), api => api.kind === kind && api.apiVersionWithGroup === apiVersion);\n }\n registerApi(apiBase, api) {\n if (!api.apiBase)\n return;\n if (!this.apis.has(apiBase)) {\n this.stores.forEach((store) => {\n if (store.api === api) {\n this.stores.set(apiBase, store);\n }\n });\n this.apis.set(apiBase, api);\n }\n }\n resolveApi(api) {\n if (!api) {\n return undefined;\n }\n if (typeof api === \"string\") {\n return this.getApi(api);\n }\n return api;\n }\n unregisterApi(api) {\n if (typeof api === \"string\")\n this.apis.delete(api);\n else {\n const apis = Array.from(this.apis.entries());\n const entry = apis.find(entry => entry[1] === api);\n if (entry)\n this.unregisterApi(entry[0]);\n }\n }\n registerStore(store, apis = [store.api]) {\n apis.filter(Boolean).forEach(api => {\n if (api.apiBase)\n this.stores.set(api.apiBase, store);\n });\n }\n getStore(api) {\n var _a;\n return this.stores.get((_a = this.resolveApi(api)) === null || _a === void 0 ? void 0 : _a.apiBase);\n }\n lookupApiLink(ref, parentObject) {\n const { kind, apiVersion, name, namespace = parentObject === null || parentObject === void 0 ? void 0 : parentObject.getNs(), } = ref;\n if (!kind)\n return \"\";\n // search in registered apis by 'kind' & 'apiVersion'\n const api = this.getApi(api => api.kind === kind && api.apiVersionWithGroup == apiVersion);\n if (api) {\n return api.getUrl({ namespace, name });\n }\n // lookup api by generated resource link\n const apiPrefixes = [\"/apis\", \"/api\"];\n const resource = kind.endsWith(\"s\") ? `${kind.toLowerCase()}es` : `${kind.toLowerCase()}s`;\n for (const apiPrefix of apiPrefixes) {\n const apiLink = Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_2__[\"createKubeApiURL\"])({ apiPrefix, apiVersion, name, namespace, resource });\n if (this.getApi(apiLink)) {\n return apiLink;\n }\n }\n // resolve by kind only (hpa's might use refs to older versions of resources for example)\n const apiByKind = this.getApi(api => api.kind === kind);\n if (apiByKind) {\n return apiByKind.getUrl({ name, namespace });\n }\n // otherwise generate link with default prefix\n // resource still might exists in k8s, but api is not registered in the app\n return Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_2__[\"createKubeApiURL\"])({ apiVersion, name, namespace, resource });\n }\n}\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Function, Array]),\n __metadata(\"design:returntype\", void 0)\n], ApiManager.prototype, \"registerStore\", null);\nconst apiManager = new ApiManager();\n\n\n//# sourceURL=webpack:///./src/common/k8s-api/api-manager.ts?");
40062
40062
 
40063
40063
  /***/ }),
40064
40064
 
@@ -44483,7 +44483,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
44483
44483
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
44484
44484
 
44485
44485
  "use strict";
44486
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Notifications\", function() { return Notifications; });\n/* harmony import */ var _notifications_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./notifications.scss */ \"./src/renderer/components/notifications/notifications.scss\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var mobx_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! mobx-react */ \"./node_modules/mobx-react/dist/mobxreact.esm.js\");\n/* harmony import */ var _common_k8s_api_json_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/k8s-api/json-api */ \"./src/common/k8s-api/json-api.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var _notifications_store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./notifications.store */ \"./src/renderer/components/notifications/notifications.store.tsx\");\n/* harmony import */ var _animate__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../animate */ \"./src/renderer/components/animate/index.ts\");\n/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../icon */ \"./src/renderer/components/icon/index.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n\n\n\n\n\n\n\n\n\nlet Notifications = class Notifications extends react__WEBPACK_IMPORTED_MODULE_1___default.a.Component {\n constructor() {\n super(...arguments);\n Object.defineProperty(this, \"elem\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n }\n static ok(message) {\n _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"notificationsStore\"].add({\n message,\n timeout: 2500,\n status: _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"NotificationStatus\"].OK,\n });\n }\n static error(message, customOpts = {}) {\n _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"notificationsStore\"].add(Object.assign({ message, timeout: 10000, status: _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"NotificationStatus\"].ERROR }, customOpts));\n }\n static shortInfo(message, customOpts = {}) {\n this.info(message, Object.assign({ timeout: 5000 }, customOpts));\n }\n static info(message, customOpts = {}) {\n return _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"notificationsStore\"].add(Object.assign({ status: _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"NotificationStatus\"].INFO, timeout: 0, message }, customOpts));\n }\n componentDidMount() {\n Object(mobx_react__WEBPACK_IMPORTED_MODULE_3__[\"disposeOnUnmount\"])(this, [\n Object(mobx__WEBPACK_IMPORTED_MODULE_2__[\"reaction\"])(() => _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"notificationsStore\"].notifications.length, () => {\n this.scrollToLastNotification();\n }, { delay: 250 }),\n ]);\n }\n scrollToLastNotification() {\n if (!this.elem) {\n return;\n }\n this.elem.scrollTo({\n top: this.elem.scrollHeight,\n behavior: \"smooth\",\n });\n }\n getMessage(notification) {\n let { message } = notification;\n if (message instanceof _common_k8s_api_json_api__WEBPACK_IMPORTED_MODULE_4__[\"JsonApiErrorParsed\"] || message instanceof Error) {\n message = message.toString();\n }\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.Children.toArray(message);\n }\n render() {\n const { notifications, remove, addAutoHideTimer, removeAutoHideTimer } = _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"notificationsStore\"];\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"Notifications flex column align-flex-end\", ref: e => this.elem = e }, notifications.map(notification => {\n const { id, status, onClose } = notification;\n const msgText = this.getMessage(notification);\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_animate__WEBPACK_IMPORTED_MODULE_7__[\"Animate\"], { key: id },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: Object(_utils__WEBPACK_IMPORTED_MODULE_5__[\"cssNames\"])(\"notification flex\", status), onMouseLeave: () => addAutoHideTimer(id), onMouseEnter: () => removeAutoHideTimer(id) },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"box\" },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_8__[\"Icon\"], { material: \"info_outline\" })),\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"message box grow\" }, msgText),\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"box\" },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_8__[\"Icon\"], { material: \"close\", className: \"close\", onClick: Object(_utils__WEBPACK_IMPORTED_MODULE_5__[\"prevDefault\"])(() => {\n remove(id);\n onClose === null || onClose === void 0 ? void 0 : onClose();\n }) })))));\n })));\n }\n};\nNotifications = __decorate([\n mobx_react__WEBPACK_IMPORTED_MODULE_3__[\"observer\"]\n], Notifications);\n\n\n\n//# sourceURL=webpack:///./src/renderer/components/notifications/notifications.tsx?");
44486
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Notifications\", function() { return Notifications; });\n/* harmony import */ var _notifications_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./notifications.scss */ \"./src/renderer/components/notifications/notifications.scss\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var mobx_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! mobx-react */ \"./node_modules/mobx-react/dist/mobxreact.esm.js\");\n/* harmony import */ var _common_k8s_api_json_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/k8s-api/json-api */ \"./src/common/k8s-api/json-api.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var _notifications_store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./notifications.store */ \"./src/renderer/components/notifications/notifications.store.tsx\");\n/* harmony import */ var _animate__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../animate */ \"./src/renderer/components/animate/index.ts\");\n/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../icon */ \"./src/renderer/components/icon/index.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n\n\n\n\n\n\n\n\n\nlet Notifications = class Notifications extends react__WEBPACK_IMPORTED_MODULE_1___default.a.Component {\n constructor() {\n super(...arguments);\n Object.defineProperty(this, \"elem\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n }\n static ok(message) {\n return _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"notificationsStore\"].add({\n message,\n timeout: 2500,\n status: _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"NotificationStatus\"].OK,\n });\n }\n static error(message, customOpts = {}) {\n return _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"notificationsStore\"].add(Object.assign({ message, timeout: 10000, status: _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"NotificationStatus\"].ERROR }, customOpts));\n }\n static shortInfo(message, customOpts = {}) {\n return this.info(message, Object.assign({ timeout: 5000 }, customOpts));\n }\n static info(message, customOpts = {}) {\n return _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"notificationsStore\"].add(Object.assign({ status: _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"NotificationStatus\"].INFO, timeout: 0, message }, customOpts));\n }\n componentDidMount() {\n Object(mobx_react__WEBPACK_IMPORTED_MODULE_3__[\"disposeOnUnmount\"])(this, [\n Object(mobx__WEBPACK_IMPORTED_MODULE_2__[\"reaction\"])(() => _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"notificationsStore\"].notifications.length, () => {\n this.scrollToLastNotification();\n }, { delay: 250 }),\n ]);\n }\n scrollToLastNotification() {\n if (!this.elem) {\n return;\n }\n this.elem.scrollTo({\n top: this.elem.scrollHeight,\n behavior: \"smooth\",\n });\n }\n getMessage(notification) {\n let { message } = notification;\n if (message instanceof _common_k8s_api_json_api__WEBPACK_IMPORTED_MODULE_4__[\"JsonApiErrorParsed\"] || message instanceof Error) {\n message = message.toString();\n }\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.Children.toArray(message);\n }\n render() {\n const { notifications, remove, addAutoHideTimer, removeAutoHideTimer } = _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"notificationsStore\"];\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"Notifications flex column align-flex-end\", ref: e => this.elem = e }, notifications.map(notification => {\n const { id, status, onClose } = notification;\n const msgText = this.getMessage(notification);\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_animate__WEBPACK_IMPORTED_MODULE_7__[\"Animate\"], { key: id },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: Object(_utils__WEBPACK_IMPORTED_MODULE_5__[\"cssNames\"])(\"notification flex\", status), onMouseLeave: () => addAutoHideTimer(id), onMouseEnter: () => removeAutoHideTimer(id) },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"box\" },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_8__[\"Icon\"], { material: \"info_outline\" })),\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"message box grow\" }, msgText),\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"box\" },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_8__[\"Icon\"], { material: \"close\", className: \"close\", onClick: Object(_utils__WEBPACK_IMPORTED_MODULE_5__[\"prevDefault\"])(() => {\n remove(id);\n onClose === null || onClose === void 0 ? void 0 : onClose();\n }) })))));\n })));\n }\n};\nNotifications = __decorate([\n mobx_react__WEBPACK_IMPORTED_MODULE_3__[\"observer\"]\n], Notifications);\n\n\n\n//# sourceURL=webpack:///./src/renderer/components/notifications/notifications.tsx?");
44487
44487
 
44488
44488
  /***/ }),
44489
44489
 
@@ -23,9 +23,9 @@ import React from "react";
23
23
  import { Notification, NotificationMessage } from "./notifications.store";
24
24
  export declare class Notifications extends React.Component {
25
25
  elem: HTMLElement;
26
- static ok(message: NotificationMessage): void;
27
- static error(message: NotificationMessage, customOpts?: Partial<Notification>): void;
28
- static shortInfo(message: NotificationMessage, customOpts?: Partial<Notification>): void;
26
+ static ok(message: NotificationMessage): () => void;
27
+ static error(message: NotificationMessage, customOpts?: Partial<Notification>): () => void;
28
+ static shortInfo(message: NotificationMessage, customOpts?: Partial<Notification>): () => void;
29
29
  static info(message: NotificationMessage, customOpts?: Partial<Notification>): () => void;
30
30
  componentDidMount(): void;
31
31
  scrollToLastNotification(): void;
@@ -26,5 +26,5 @@ interface Styles extends Partial<Record<SwitchClassKey, string>> {
26
26
  interface Props extends SwitchProps {
27
27
  classes: Styles;
28
28
  }
29
- export declare const Switcher: React.ComponentType<Pick<Props, "name" | "key" | "id" | "value" | "type" | "size" | "resource" | "style" | "dir" | "form" | "slot" | "title" | "color" | "className" | "prefix" | "defaultValue" | "hidden" | "ref" | "disabled" | "onDrag" | "onDoubleClick" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClickCapture" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "role" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "autoFocus" | "checked" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "readOnly" | "required" | "inputProps" | "action" | "icon" | "innerRef" | "checkedIcon" | "disableFocusRipple" | "edge" | "buttonRef" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "onFocusVisible" | "TouchRippleProps" | "inputRef"> & import("@material-ui/core/styles").StyledComponentProps<"track" | "checked" | "root" | "thumb" | "focusVisible" | "switchBase">>;
29
+ export declare const Switcher: React.ComponentType<Pick<Props, "name" | "key" | "id" | "value" | "type" | "size" | "resource" | "style" | "dir" | "form" | "slot" | "title" | "color" | "className" | "prefix" | "defaultValue" | "hidden" | "ref" | "disabled" | "onDrag" | "onDoubleClick" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClickCapture" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "role" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "autoFocus" | "icon" | "checked" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "readOnly" | "required" | "inputProps" | "action" | "checkedIcon" | "innerRef" | "disableFocusRipple" | "edge" | "buttonRef" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "onFocusVisible" | "TouchRippleProps" | "inputRef"> & import("@material-ui/core/styles").StyledComponentProps<"track" | "checked" | "root" | "switchBase" | "thumb" | "focusVisible">>;
30
30
  export {};
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@k8slens/extensions",
3
3
  "productName": "OpenLens extensions",
4
4
  "description": "OpenLens - Open Source Kubernetes IDE: extensions",
5
- "version": "5.3.1-git.44f1f38a75.0",
5
+ "version": "5.3.1-git.4f33dfdfd5.0",
6
6
  "copyright": "© 2021 OpenLens Authors",
7
7
  "license": "MIT",
8
8
  "main": "dist/src/extensions/extension-api.js",