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