@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.
@@ -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
  }
@@ -1366,6 +1367,7 @@ __export(screen_exports, {
1366
1367
  BAR_TRACK: () => BAR_TRACK,
1367
1368
  Box: () => import_ink6.Box,
1368
1369
  Divider: () => Divider,
1370
+ FOOTER_HOTKEY_STYLE: () => FOOTER_HOTKEY_STYLE,
1369
1371
  FooterPresets: () => FooterPresets,
1370
1372
  GridCell: () => GridCell,
1371
1373
  InputField: () => InputField,
@@ -1391,6 +1393,7 @@ __export(screen_exports, {
1391
1393
  buildFooter: () => buildFooter,
1392
1394
  clampScroll: () => clampScroll,
1393
1395
  formatBindingKey: () => formatBindingKey,
1396
+ formatFooterHotkey: () => formatFooterHotkey,
1394
1397
  h: () => import_react6.createElement,
1395
1398
  isScrolledToBottom: () => isScrolledToBottom,
1396
1399
  load: () => load,