@64mb/freelens-power 2.21.2 → 2.21.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/renderer.js CHANGED
@@ -16169,6 +16169,7 @@ var icons$3 = {
16169
16169
  "Upload Icon": { material: "file_upload" },
16170
16170
  Clear: { material: "clear" },
16171
16171
  "Open kubeconfig": { material: "edit" },
16172
+ "Edit icon": { material: "palette" },
16172
16173
  Connect: { material: "link" },
16173
16174
  Disconnect: { material: "link_off" },
16174
16175
  Remove: { material: "delete" },
@@ -16952,6 +16953,7 @@ function startClusterIconSettingsMenu() {
16952
16953
  let stopped = false;
16953
16954
  let request = 0;
16954
16955
  const open = async (id) => {
16956
+ if (stopped) return;
16955
16957
  const current = ++request;
16956
16958
  try {
16957
16959
  const entries = await ipcRenderer.invoke(CLUSTER_ICONS_CHANNEL, { operation: "list" });
@@ -16967,6 +16969,20 @@ function startClusterIconSettingsMenu() {
16967
16969
  if (!stopped && current === request) Renderer$1.Component.Notifications.error("Unable to open the cluster icon editor. Try again.");
16968
16970
  }
16969
16971
  };
16972
+ const addMenu = (entity, context) => {
16973
+ if (!Renderer$1.Catalog.getClusterById(entity.getId())) return;
16974
+ context.menuItems.push({
16975
+ title: "Edit icon",
16976
+ icon: "palette",
16977
+ onClick: () => void open(entity.getId())
16978
+ });
16979
+ };
16980
+ let category;
16981
+ const stopCategory = reaction(() => Renderer$1.Catalog.catalogCategories.getForGroupKind("entity.k8slens.dev", "KubernetesCluster"), (next) => {
16982
+ category?.off("contextMenuOpen", addMenu);
16983
+ category = next;
16984
+ category?.on("contextMenuOpen", addMenu);
16985
+ }, { fireImmediately: true });
16970
16986
  const remove = (menu, button) => {
16971
16987
  unmountContainer(button);
16972
16988
  button.remove();
@@ -17027,6 +17043,8 @@ function startClusterIconSettingsMenu() {
17027
17043
  stopped = true;
17028
17044
  request++;
17029
17045
  observer.disconnect();
17046
+ stopCategory();
17047
+ category?.off("contextMenuOpen", addMenu);
17030
17048
  window.removeEventListener("keydown", onKeyDown, true);
17031
17049
  for (const [menu, button] of owned) remove(menu, button);
17032
17050
  unmountContainer(modal);
@@ -21199,7 +21217,7 @@ function startExtensionUpdateNotifications() {
21199
21217
  };
21200
21218
  const started = () => {
21201
21219
  attempt = {
21202
- version: current?.installedVersion ?? "2.21.2",
21220
+ version: current?.installedVersion ?? "2.21.4",
21203
21221
  startedAt: Date.now()
21204
21222
  };
21205
21223
  try {
@@ -26766,7 +26784,7 @@ function startHotbarName() {
26766
26784
  const digit = /^Digit([1-9])$/.exec(event.code);
26767
26785
  if (!digit) return;
26768
26786
  const editable = "input, textarea, select, [contenteditable]:not([contenteditable=\"false\"]), [role=\"textbox\"], [role=\"combobox\"], .monaco-editor, .xterm, .cm-editor, .CodeMirror";
26769
- if (event.composedPath().some((node) => node instanceof Element && node.closest(editable))) return;
26787
+ if (!(event.target instanceof HTMLInputElement && event.target.matches("[data-testid^=\"catalog-list-for-\"] > .header .SearchInput input")) && event.composedPath().some((node) => node instanceof Element && node.closest(editable))) return;
26770
26788
  if (document.querySelector(".Dialog.modal, [aria-modal=\"true\"], .SettingLayout, [class*=\"command-container-module__CommandContainer--\"]")) return;
26771
26789
  const target = Number(digit[1]);
26772
26790
  const badge = document.querySelector(".HotbarMenu [data-testid^=\"hotbar-menu-badge-for-\"]");