@nmakarov/cli-toolkit 0.82.0 → 0.84.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.
package/dist/index.cjs CHANGED
@@ -634,23 +634,23 @@ function formatKeyBindings(bindings, mode = "long") {
634
634
  })));
635
635
  groups.sort((a, b) => a.order - b.order);
636
636
  const items = [];
637
- groups.forEach((group) => {
637
+ groups.forEach((group, groupIndex) => {
638
638
  const bindingWithCustom = resolvedBindings.find(
639
- (b) => group.keys.includes(b.key) && typeof b.resolvedCaption !== "string"
639
+ (b) => group.keys.includes(formatBindingKey(b)) && typeof b.resolvedCaption !== "string"
640
640
  );
641
641
  if (bindingWithCustom && bindingWithCustom.resolvedCaption) {
642
642
  items.push(bindingWithCustom.resolvedCaption);
643
643
  } else {
644
- const keyStr = formatKeys(group.keys);
645
- if (mode === "long") {
646
- items.push(`${keyStr} to ${group.caption}`);
647
- } else {
648
- items.push(keyStr);
649
- }
644
+ items.push(formatFooterHotkey(formatKeys(group.keys), group.caption, mode, `kb-${groupIndex}`));
650
645
  }
651
646
  });
652
647
  return items;
653
648
  }
649
+ function formatFooterHotkey(keyStr, caption = "", mode = "long", reactKey = "hotkey") {
650
+ const keyNode = (0, import_react3.createElement)(import_ink3.Text, { key: `${reactKey}-key`, ...FOOTER_HOTKEY_STYLE }, keyStr);
651
+ if (mode !== "long" || !caption) return keyNode;
652
+ return (0, import_react3.createElement)(import_ink3.Text, { key: reactKey, dimColor: true, color: "white" }, keyNode, ` to ${caption}`);
653
+ }
654
654
  function formatKeys(keys) {
655
655
  const keyMap = {
656
656
  escape: "esc",
@@ -920,7 +920,7 @@ async function showMultiColumnListWithPreviewScreen(config2) {
920
920
  }
921
921
  });
922
922
  }
923
- var import_react3, import_ink3, showMenuScreen, showWordGridScreen;
923
+ var import_react3, import_ink3, FOOTER_HOTKEY_STYLE, showMenuScreen, showWordGridScreen;
924
924
  var init_screens = __esm({
925
925
  "src/screen/screens.js"() {
926
926
  import_react3 = require("react");
@@ -928,6 +928,7 @@ var init_screens = __esm({
928
928
  init_components();
929
929
  init_list_components();
930
930
  init_key_bindings();
931
+ FOOTER_HOTKEY_STYLE = { bold: true, color: "white", dimColor: false };
931
932
  showMenuScreen = showListScreen;
932
933
  showWordGridScreen = showMultiColumnListScreen;
933
934
  }
@@ -1402,6 +1403,7 @@ __export(src_exports, {
1402
1403
  DEFAULT_RUNTIME_PARAM_SPECS: () => DEFAULT_RUNTIME_PARAM_SPECS,
1403
1404
  Db: () => Db,
1404
1405
  Divider: () => Divider,
1406
+ FOOTER_HOTKEY_STYLE: () => FOOTER_HOTKEY_STYLE,
1405
1407
  FileDatabase: () => FileDatabase,
1406
1408
  FileDatabaseError: () => FileDatabaseError,
1407
1409
  FooterPresets: () => FooterPresets,
@@ -1486,6 +1488,7 @@ __export(src_exports, {
1486
1488
  ensureTasksRuntime: () => ensureTasksRuntime,
1487
1489
  flushTaskIpcLogs: () => flushTaskIpcLogs,
1488
1490
  formatBindingKey: () => formatBindingKey,
1491
+ formatFooterHotkey: () => formatFooterHotkey,
1489
1492
  getArgsInstance: () => getArgsInstance,
1490
1493
  getPm2Process: () => getPm2Process,
1491
1494
  h: () => import_react6.createElement,
@@ -10384,6 +10387,7 @@ var TasksManager = class _TasksManager {
10384
10387
  DEFAULT_RUNTIME_PARAM_SPECS,
10385
10388
  Db,
10386
10389
  Divider,
10390
+ FOOTER_HOTKEY_STYLE,
10387
10391
  FileDatabase,
10388
10392
  FileDatabaseError,
10389
10393
  FooterPresets,
@@ -10468,6 +10472,7 @@ var TasksManager = class _TasksManager {
10468
10472
  ensureTasksRuntime,
10469
10473
  flushTaskIpcLogs,
10470
10474
  formatBindingKey,
10475
+ formatFooterHotkey,
10471
10476
  getArgsInstance,
10472
10477
  getPm2Process,
10473
10478
  h,