@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.
@@ -621,23 +621,23 @@ function formatKeyBindings(bindings, mode = "long") {
621
621
  })));
622
622
  groups.sort((a, b) => a.order - b.order);
623
623
  const items = [];
624
- groups.forEach((group) => {
624
+ groups.forEach((group, groupIndex) => {
625
625
  const bindingWithCustom = resolvedBindings.find(
626
- (b) => group.keys.includes(b.key) && typeof b.resolvedCaption !== "string"
626
+ (b) => group.keys.includes(formatBindingKey(b)) && typeof b.resolvedCaption !== "string"
627
627
  );
628
628
  if (bindingWithCustom && bindingWithCustom.resolvedCaption) {
629
629
  items.push(bindingWithCustom.resolvedCaption);
630
630
  } else {
631
- const keyStr = formatKeys(group.keys);
632
- if (mode === "long") {
633
- items.push(`${keyStr} to ${group.caption}`);
634
- } else {
635
- items.push(keyStr);
636
- }
631
+ items.push(formatFooterHotkey(formatKeys(group.keys), group.caption, mode, `kb-${groupIndex}`));
637
632
  }
638
633
  });
639
634
  return items;
640
635
  }
636
+ function formatFooterHotkey(keyStr, caption = "", mode = "long", reactKey = "hotkey") {
637
+ const keyNode = h3(Text3, { key: `${reactKey}-key`, ...FOOTER_HOTKEY_STYLE }, keyStr);
638
+ if (mode !== "long" || !caption) return keyNode;
639
+ return h3(Text3, { key: reactKey, dimColor: true, color: "white" }, keyNode, ` to ${caption}`);
640
+ }
641
641
  function formatKeys(keys) {
642
642
  const keyMap = {
643
643
  escape: "esc",
@@ -907,12 +907,13 @@ async function showMultiColumnListWithPreviewScreen(config2) {
907
907
  }
908
908
  });
909
909
  }
910
- var showMenuScreen, showWordGridScreen;
910
+ var FOOTER_HOTKEY_STYLE, showMenuScreen, showWordGridScreen;
911
911
  var init_screens = __esm({
912
912
  "src/screen/screens.js"() {
913
913
  init_components();
914
914
  init_list_components();
915
915
  init_key_bindings();
916
+ FOOTER_HOTKEY_STYLE = { bold: true, color: "white", dimColor: false };
916
917
  showMenuScreen = showListScreen;
917
918
  showWordGridScreen = showMultiColumnListScreen;
918
919
  }
@@ -1350,6 +1351,7 @@ __export(screen_exports, {
1350
1351
  BAR_TRACK: () => BAR_TRACK,
1351
1352
  Box: () => Box5,
1352
1353
  Divider: () => Divider,
1354
+ FOOTER_HOTKEY_STYLE: () => FOOTER_HOTKEY_STYLE,
1353
1355
  FooterPresets: () => FooterPresets,
1354
1356
  GridCell: () => GridCell,
1355
1357
  InputField: () => InputField,
@@ -1375,6 +1377,7 @@ __export(screen_exports, {
1375
1377
  buildFooter: () => buildFooter,
1376
1378
  clampScroll: () => clampScroll,
1377
1379
  formatBindingKey: () => formatBindingKey,
1380
+ formatFooterHotkey: () => formatFooterHotkey,
1378
1381
  h: () => createElement3,
1379
1382
  isScrolledToBottom: () => isScrolledToBottom,
1380
1383
  load: () => load,